From 758237b4505afe0e6b0b0ee917339b3ffffc940e Mon Sep 17 00:00:00 2001 From: phaag Date: Sat, 3 Oct 2015 14:06:34 +0200 Subject: [PATCH] Initial git release 1.6.13 --- AUTHORS | 1 + BSD-license.txt | 32 + COPYING | 1 + ChangeLog | 438 ++ CreateSubHierarchy.pl | 133 + INSTALL | 370 ++ Makefile.am | 4 + Makefile.in | 765 ++++ NEWS | 1 + README.md | 412 +- ToDo | 6 + aclocal.m4 | 1149 +++++ autom4te.cache/output.0 | 9524 +++++++++++++++++++++++++++++++++++++++ autom4te.cache/output.1 | 9524 +++++++++++++++++++++++++++++++++++++++ autom4te.cache/requests | 154 + autom4te.cache/traces.0 | 1090 +++++ autom4te.cache/traces.1 | 909 ++++ bin/AddExtension.txt | 11 + bin/Makefile.am | 130 + bin/Makefile.in | 2549 +++++++++++ bin/applybits_inline.c | 92 + bin/bookkeeper.c | 619 +++ bin/bookkeeper.h | 100 + bin/collector.c | 676 +++ bin/collector.h | 184 + bin/collector_inline.c | 126 + bin/content_dns.c | 273 ++ bin/content_dns.h | 39 + bin/expire.c | 822 ++++ bin/expire.h | 68 + bin/exporter.c | 465 ++ bin/exporter.h | 53 + bin/flist.c | 1245 +++++ bin/flist.h | 52 + bin/flowtree.c | 626 +++ bin/flowtree.h | 149 + bin/ft2nfdump.c | 406 ++ bin/fts_compat.c | 1129 +++++ bin/fts_compat.h | 126 + bin/grammar.y | 2204 +++++++++ bin/grammar.y.mine | 1732 +++++++ bin/heapsort_inline.c | 91 + bin/inline.c | 334 ++ bin/ipconv.c | 361 ++ bin/ipconv.h | 52 + bin/ipfix.c | 1742 +++++++ bin/ipfix.h | 268 ++ bin/ipfrag.c | 302 ++ bin/ipfrag.h | 74 + bin/launch.c | 440 ++ bin/launch.h | 56 + bin/lzoconf.h | 444 ++ bin/lzodefs.h | 2998 ++++++++++++ bin/minilzo.c | 6053 +++++++++++++++++++++++++ bin/minilzo.h | 94 + bin/netflow_pcap.c | 353 ++ bin/netflow_pcap.h | 42 + bin/netflow_v1.c | 538 +++ bin/netflow_v1.h | 97 + bin/netflow_v5_v7.c | 796 ++++ bin/netflow_v5_v7.h | 149 + bin/netflow_v9.c | 3064 +++++++++++++ bin/netflow_v9.h | 309 ++ bin/nf_common.c | 2887 ++++++++++++ bin/nf_common.h | 122 + bin/nfanon.c | 483 ++ bin/nfcapd.c | 1236 +++++ bin/nfdump.c | 1236 +++++ bin/nfdump.h | 85 + bin/nfdump.test.diff | 188 + bin/nfdump_inline.c | 127 + bin/nfexpire.c | 544 +++ bin/nfexport.c | 412 ++ bin/nfexport.h | 45 + bin/nffile.c | 1356 ++++++ bin/nffile.h | 2203 +++++++++ bin/nffile_inline.c | 835 ++++ bin/nfgen.c | 550 +++ bin/nflowcache.c | 933 ++++ bin/nflowcache.h | 149 + bin/nfnet.c | 555 +++ bin/nfnet.h | 72 + bin/nfpcapd.c | 1566 +++++++ bin/nfprof.c | 134 + bin/nfprof.h | 55 + bin/nfprofile.c | 694 +++ bin/nfreader.c | 387 ++ bin/nfreplay.c | 625 +++ bin/nfstat.c | 1913 ++++++++ bin/nfstat.h | 125 + bin/nfstatfile.c | 579 +++ bin/nfstatfile.h | 80 + bin/nftest.c | 1244 +++++ bin/nftree.c | 631 +++ bin/nftree.h | 178 + bin/nfx.c | 635 +++ bin/nfx.h | 87 + bin/nfxstat.c | 112 + bin/nfxstat.h | 82 + bin/panonymizer.c | 229 + bin/panonymizer.h | 96 + bin/parse_csv.pl | 209 + bin/pcap_reader.c | 295 ++ bin/pcap_reader.h | 49 + bin/pcaproc.c | 799 ++++ bin/pcaproc.h | 77 + bin/profile.c | 473 ++ bin/profile.h | 78 + bin/rbtree.h | 677 +++ bin/rijndael.c | 1689 +++++++ bin/rijndael.h | 200 + bin/scanner.l | 325 ++ bin/sfcapd.c | 1098 +++++ bin/sflow.c | 2745 +++++++++++ bin/sflow.h | 571 +++ bin/sflow_proto.h | 702 +++ bin/test.sh | 123 + bin/util.c | 568 +++ bin/util.h | 102 + bootstrap | 8 + compile | 347 ++ config.h.in | 333 ++ configure | 9524 +++++++++++++++++++++++++++++++++++++++ configure.ac | 396 ++ depcomp | 791 ++++ extra/PortTracker.pm | 322 ++ extra/nfdump.spec | 38 + flows | Bin 0 -> 4800 bytes install-sh | 527 +++ man/Makefile.am | 4 + man/Makefile.in | 476 ++ man/ft2nfdump.1 | 52 + man/nfanon.1 | 87 + man/nfcapd.1 | 478 ++ man/nfdump.1 | 1262 ++++++ man/nfexpire.1 | 101 + man/nfprofile.1 | 24 + man/nfreplay.1 | 86 + man/sfcapd.1 | 254 ++ missing | 215 + non-dist/TJ-Work-Notes | 7 + non-dist/install-sh | 251 ++ non-dist/make-dist | 15 + non-dist/mkinstalldirs | 40 + non-dist/test.sh | 95 + test-driver | 139 + ylwrap | 247 + 147 files changed, 107413 insertions(+), 2 deletions(-) create mode 100755 AUTHORS create mode 100644 BSD-license.txt create mode 120000 COPYING create mode 100755 ChangeLog create mode 100755 CreateSubHierarchy.pl create mode 100644 INSTALL create mode 100755 Makefile.am create mode 100644 Makefile.in create mode 120000 NEWS mode change 100644 => 100755 README.md create mode 100644 ToDo create mode 100644 aclocal.m4 create mode 100644 autom4te.cache/output.0 create mode 100644 autom4te.cache/output.1 create mode 100644 autom4te.cache/requests create mode 100644 autom4te.cache/traces.0 create mode 100644 autom4te.cache/traces.1 create mode 100755 bin/AddExtension.txt create mode 100755 bin/Makefile.am create mode 100644 bin/Makefile.in create mode 100755 bin/applybits_inline.c create mode 100644 bin/bookkeeper.c create mode 100644 bin/bookkeeper.h create mode 100755 bin/collector.c create mode 100755 bin/collector.h create mode 100755 bin/collector_inline.c create mode 100644 bin/content_dns.c create mode 100644 bin/content_dns.h create mode 100644 bin/expire.c create mode 100644 bin/expire.h create mode 100755 bin/exporter.c create mode 100755 bin/exporter.h create mode 100644 bin/flist.c create mode 100644 bin/flist.h create mode 100644 bin/flowtree.c create mode 100644 bin/flowtree.h create mode 100644 bin/ft2nfdump.c create mode 100755 bin/fts_compat.c create mode 100755 bin/fts_compat.h create mode 100755 bin/grammar.y create mode 100755 bin/grammar.y.mine create mode 100755 bin/heapsort_inline.c create mode 100644 bin/inline.c create mode 100644 bin/ipconv.c create mode 100755 bin/ipconv.h create mode 100644 bin/ipfix.c create mode 100644 bin/ipfix.h create mode 100644 bin/ipfrag.c create mode 100644 bin/ipfrag.h create mode 100644 bin/launch.c create mode 100644 bin/launch.h create mode 100755 bin/lzoconf.h create mode 100755 bin/lzodefs.h create mode 100755 bin/minilzo.c create mode 100755 bin/minilzo.h create mode 100644 bin/netflow_pcap.c create mode 100644 bin/netflow_pcap.h create mode 100644 bin/netflow_v1.c create mode 100644 bin/netflow_v1.h create mode 100644 bin/netflow_v5_v7.c create mode 100644 bin/netflow_v5_v7.h create mode 100644 bin/netflow_v9.c create mode 100644 bin/netflow_v9.h create mode 100644 bin/nf_common.c create mode 100644 bin/nf_common.h create mode 100755 bin/nfanon.c create mode 100644 bin/nfcapd.c create mode 100644 bin/nfdump.c create mode 100644 bin/nfdump.h create mode 100644 bin/nfdump.test.diff create mode 100755 bin/nfdump_inline.c create mode 100644 bin/nfexpire.c create mode 100755 bin/nfexport.c create mode 100755 bin/nfexport.h create mode 100644 bin/nffile.c create mode 100644 bin/nffile.h create mode 100755 bin/nffile_inline.c create mode 100644 bin/nfgen.c create mode 100755 bin/nflowcache.c create mode 100755 bin/nflowcache.h create mode 100644 bin/nfnet.c create mode 100644 bin/nfnet.h create mode 100644 bin/nfpcapd.c create mode 100644 bin/nfprof.c create mode 100644 bin/nfprof.h create mode 100644 bin/nfprofile.c create mode 100755 bin/nfreader.c create mode 100644 bin/nfreplay.c create mode 100644 bin/nfstat.c create mode 100644 bin/nfstat.h create mode 100644 bin/nfstatfile.c create mode 100644 bin/nfstatfile.h create mode 100644 bin/nftest.c create mode 100644 bin/nftree.c create mode 100644 bin/nftree.h create mode 100755 bin/nfx.c create mode 100755 bin/nfx.h create mode 100644 bin/nfxstat.c create mode 100644 bin/nfxstat.h create mode 100644 bin/panonymizer.c create mode 100644 bin/panonymizer.h create mode 100755 bin/parse_csv.pl create mode 100755 bin/pcap_reader.c create mode 100755 bin/pcap_reader.h create mode 100644 bin/pcaproc.c create mode 100644 bin/pcaproc.h create mode 100644 bin/profile.c create mode 100644 bin/profile.h create mode 100755 bin/rbtree.h create mode 100644 bin/rijndael.c create mode 100644 bin/rijndael.h create mode 100755 bin/scanner.l create mode 100644 bin/sfcapd.c create mode 100644 bin/sflow.c create mode 100644 bin/sflow.h create mode 100644 bin/sflow_proto.h create mode 100755 bin/test.sh create mode 100644 bin/util.c create mode 100644 bin/util.h create mode 100755 bootstrap create mode 100755 compile create mode 100644 config.h.in create mode 100755 configure create mode 100755 configure.ac create mode 100755 depcomp create mode 100644 extra/PortTracker.pm create mode 100644 extra/nfdump.spec create mode 100644 flows create mode 100755 install-sh create mode 100755 man/Makefile.am create mode 100644 man/Makefile.in create mode 100755 man/ft2nfdump.1 create mode 100755 man/nfanon.1 create mode 100755 man/nfcapd.1 create mode 100755 man/nfdump.1 create mode 100755 man/nfexpire.1 create mode 100755 man/nfprofile.1 create mode 100755 man/nfreplay.1 create mode 100755 man/sfcapd.1 create mode 100755 missing create mode 100644 non-dist/TJ-Work-Notes create mode 100755 non-dist/install-sh create mode 100644 non-dist/make-dist create mode 100755 non-dist/mkinstalldirs create mode 100755 non-dist/test.sh create mode 100755 test-driver create mode 100755 ylwrap diff --git a/AUTHORS b/AUTHORS new file mode 100755 index 0000000..da6bd5b --- /dev/null +++ b/AUTHORS @@ -0,0 +1 @@ +Peter Haag peter.haag@switch.ch diff --git a/BSD-license.txt b/BSD-license.txt new file mode 100644 index 0000000..ed5df4f --- /dev/null +++ b/BSD-license.txt @@ -0,0 +1,32 @@ + + The nfdump project is distributed under the BSD license: + + Copyright (c) 2014, Peter Haag + Copyright (c) 2009, Peter Haag + Copyright (c) 2004-2008, SWITCH - Teleinformatikdienste fuer Lehre und Forschung + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + * 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. + * Neither the name of the author nor the names of its contributors may be + used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 COPYRIGHT OWNER 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. + diff --git a/COPYING b/COPYING new file mode 120000 index 0000000..f962ec7 --- /dev/null +++ b/COPYING @@ -0,0 +1 @@ +BSD-license.txt \ No newline at end of file diff --git a/ChangeLog b/ChangeLog new file mode 100755 index 0000000..ba3e667 --- /dev/null +++ b/ChangeLog @@ -0,0 +1,438 @@ +2014-11-16 +- Fix v1 extension size bug +- Add htonll check for autoconf +- Fix AddExtensionMap compare bug +- Fix ipfix templare withdraw problems - free all maps correctly +- Add minilzo 2.08 - fixes CVE-2014-4607 +- Cleanup some stat code. more needs to be done .. +- Cleanup man pages for -O -n +- Remove SunPro test in configure - no longer supported anyway + +2014-06-15 v1.6.12p1 +- Add pblock compare functions +- Update extended filter: Allow modification left/right values + +2014-02-16 v1.6.12 +- Add NAT pool port allocation +- Modify/fix NAT vrf tags. Add egress vrf ID +- Modify common record due to exporter exhaustion. new common record + type 10 adds 4 extra bytes. Reads v1 common record transparently +- Fix sflow potential crash + +2013-11-13 v1.6.11 +- Add ASA/NSEL 9.x protcol changes +- Make it llvm compilable + +2013-08-12 v1.6.10p1 +- Fix -t +/- n timeslot option +- Fix bug in nfanon - stat record update. +- Fix bug in netflow v5 mudule: extension map size wrong. +- Fix bug nfexport: In some cases could result in wrong flow counter. +- Fix nftrack - could coredump in some cases. + +2013-05-16 v1.6.10 +- Fix SPARC compile/optimise bug +- Add output packet/bytes counter to global stat - importatnt for NSEL flows ASA > 8.5 +- Add NSEL filter options xnet +- Modify extension descriptor code for nfdump1.7. Still use 1.6 extension map layout for compatibility +- Add prototype for nfpcapd - pcap -> nfdump collector. Converts traffoc directly to nfdump files. +- Fix bug in ipfix module: uninitialised variable +- Cleanup syslog/LogError calls +- Fix minor non critical bugs and compile issues + +2013-03-02 v1.6.9 +- Fix some bugs in beta 1.6.9 NSEL code +- Fix bug statistics update with aggreagted flow records +- Fix sflow bug sfcapd stores wrong (ghost) dump by past samples in same sflow datagram + +2012-12-31 +- Add time received in csv output +- ICMP should handled better now - somewhat +- Implement ASA NSEL records +- Add definitions in nffile and nx for ASA NSEL extensions + +2012-11-09 v1.6.8p1 +- Add dynamic source directory tree for multiple exporters +- Fix exporter bug: 'too many exporters' with large time windows +- Fix uninitialised exporter sysid in default sampler record - v9 +- Fix v9/ipfix cache initialisation with no templates > 1 in same packet + +2012-10-26 v1.6.8 +- Add ip list option for 'next ip' in filter syntax +- Accept v9 sampler_id in 2bytes +- Fix IPFIX mac address bug - did not get collected +- Add IPFIX packet/octet TotalCount fields 85/86 +- Add received timestamp to sflow collector +- Fix long flow duration calculation - 32bit overflow +- Fix v9 sampling ID: allow 2 byte ID +- Add IPFIX options as rfc5101 section-6.2 +- Add exporter records for sflow collector +- Fix bug for MAC address printing %idmc and %odmc. +- Add received time stamp extension +- Add recursive format parser. Allows to extend predefined formats. +- Change flow record sorting to heapsort. remove limit 1000 +- Merge -m option to -O tstart. -m now depricated. +- Add -O tend. Print order according to tend of flows ascending +- Apply -O print order for printing flow cache. Applies to -A + +2012-07-31 v1.6.7-tc-1 +- Special version for TC +- Print exporter and sampling records with nfdump -E +- Added exporter and sampling records to file. + +2012-07-30 v1.6.7 +- Prepare for file catalog in current file format. +- Fix bug in ReadBlock when reading flow from stdin pipe +- Add new more flexible translation engine for v9 +- Add nprobe client/server delay fields +- Prepare for NSEL merging +- Fix memory corruption with double -A flags +- Fix bug in nfreader with compat15 mode files + +2012-03-12 v1.6.6 +- Minor IPFIX bug. +- IPFIX implement template withdraw +- For IPFIX, check packet sequence per template and observation domain +- Fix time window, when no flows collected or no flows matched + while processing +- Fixed typos +- Fix seg fault bug - test for EMPTY_LIST was missing at several places. + +2012-02-19 v1.6.6b1 +- Fix bps/pps. make it uint64_t, as bps/pps > 4Gb/s overflows. +- In record raw print mode: decode ICMP instead of src/dst ports +- sflow use announced exporter IP instead of sending IP for router ID +- sflow: Ignore extra fill bytes. Do not complain. +- sflow: fix packet length issue. +- Add IPFIX protokoll support + +2011-12-31 v1.6.5 +- Fix 64bit bug when using byte/packet limits +- for v5 and sampling use 64bit counters to prevent overflow for large sampled flows. +- Fixed Ident printig bug + +2011-07-11 v1.6.4 +- some code restructuring - prepare for IPFIX module +- Add netflow v1 module. Some routers still use that +- Add %sn, %dn output tags for src/dst networks +- Fix buffer length check in v5. +- Fix export bug: include last flow cache bucket, when exporting +- number in all filter expressions accept hex values +- fix an sflow colletor bug. Missing extension maps in rotated files +- implement extended statistics. Currently ports and bpp distribution + vectors can be collected automatically be nfcapd. Still experimental + +2011-02-26 v1.6.3p1 +- Fix timebug fix :(, make it a compile time option +- fix v7 sequence errors + +2011-02-15 +- Zero out unused fields after aggregation + +2011-02-05 +- Fix SysUptime 32bit overflow in v5 header +- Add fix for strange first/last swap reported by some users. + +2011-01-09 v1.6.3 +- Fix extension size bug +- Move IP anonymisation to separate binary nfanon +- Fix initialise bug of -o fmt: and not available fields + +2010-09-09 v1.6.2 +- released +- fixes some sflow bugs in sfcapd + +2010-04-28 v1.6.1p0 +- Update flow tools converter to build with Google-Code version 0.68.5 +- Fix sflow bugs + +2010-03-05 v1.6.1 +- Fix bug in man page for -t +- Test sampler infos before using them ( nfcapd startup ) +- Add sampling tags #34, #35 used by JunOS +- nfexpire: Fix empty .nfsat, when setting limits on an empty directory +- Fix coredump for -B -m (-w) combination +- Optimise some extension map code + +2009-12-28 stable v1.6 +- Few bug fixes in release candidates rc1, rc2 and rc3 + +2009-11-16 snapshot-1.6b-20091116 +- Update sflow collector with new tags +- Add router IP extension +- Add router ID (engine type/ID) extension + +2009-09-30 snapshot-1.6b-20090930 +- snapshot bugfix release + +2009-11-0801 snapshot-1.6b-20090806 +- Add srcmask and dstmask aggregation +- Add csv output mode. -o csv +- Fix some bugs of previous beta +- Add bidirectional aggregation of flows ( -b, -B ) +- Add possibility to save aggregated flows into file ( -w ) + Note: This results in a behaviour change for -w in combination + with aggragation ) +- Extend -N ( do not scale numbers ) to all text output not just summary +- Make extension handling more robust for some moody IOSes. +- Remove header lines of -s stat, when using -q ( quiet ) + Note: This results in a behaviour change for -N +- Remove -S option from nfdump ( legacy 1.4 compatibility ) +- Make use of log (syslog) functions for nfprofile. +- Move log functions to util.c + +2009-06-19 snapshot-1.6b-20090717 +- Flow-tools converter updated - supports more common elements. +- Sflow collector updated. Supports more common elements. +- Add sampling to nfdump. Sampling is automatically recognised + in v5 undocumented header fields and in v9 option templates. + see nfcapd.1(1) +- Add @include option for filter to include more filter files. +- Add flexible aggregation comparable to Flexible Netflow (FNF) +- All new tags can be selected in -o fmt:... see nfdump(1) +- topN stat for all new tags is implemented +- Integrate developer code to read from pcap files into stable +- Update filter syntax for new tags +- Added more v9 tags for netflow v9. + The detailed tags are listed in nfcapd(1) + Adding new tags also extended the binary file format with + data block format 2, which is extension based. File format + for version <= 1.5.* ( Data block format 1 ) is read + transparently. Data block 2 are skipped by nfdump 1.5.7. + 32bit but AS and interface numbers are supported. +- Add flexible storage option for nfcapd. To save disk space, the + data extensions to be stored in the data file are user selectable. +- Added option for multiple netflow stream to same port. + -n + Example: -n router1,192.168.100.1,/var/nfdump/router1 + So multiple -n options may be given at the command line + Old style syntax still works for compatibility, ( -I .. -l ... ) + but then only one source is supported. +- Move to automake for building nfdump +- Switch scaling factor ( k, M, G ) from 1024 to 1000. +- Make nfdump fully 64bit compliant. ( 8bit data alignments and access ) + +2009-04-17 stable 1.5.8 +- Fix daylight summer time bug, when guessing sub dirs. file access ( -M, -r ) +- Bug fixes for 64bits CPUs + +2008-02-22 stable-1,5.7 +- Add icmp type/code decoding +- Add proper icmp v9 decoding +- Fix memory leaks in -e auto expire mode in nfcapd. +- Fix somee potential dead locks with file locking, when expiring +- Fix multicast bug in nfreplay +- Add hostname lookup for IP addresses in filter. + +2007-10-15 stable-1.5.6 +- Fix odd CISCO behaviour for ICMP type/code in src port. +- Add fast LZO1X-1 compression option (-z) for output file. +- Add lists for port in syntax -> port in [ 135 137 445] +- Add lists for AS syntax -> as in [ 1024 1025 ] +- Bug fix in filter for syntax 'src as and dst as' + +2007-08-24 stable-1.5.5 +- Fix nfprofile bug, nfprofile crashes when last opts line is not valid for + some reason. +- Fix potential hand for nfexpire, on empty flow directories. + +2007-08-08 snapshot-20070808 +- Idents may contain '-' in name. +- Fixed install bugs in Makefile.in and configure.in +- Installs now cleanly on Solaris +- Handle 4byte interface numbers in v9. Quick fix: 4bytes reduced to 2bytes. +- Fix aggregation bug in statistics. +- ftok(3) C library call replaced by more reliable own implementation. + Did result in error messages like "Another collector is already running" +- Fix minor bugs iin file range selction -R. +- Add recursive behaviour for -R +- New option -i can canche Ident descriptor in data files. + +2007-03-12 snapshot-20070312 +- Bug fix release of 20070306 + +2007-03-06 snapshot-20070306 +- Fix bug in flist.c. Resulted in a coredump when using sub dirs and -R . ( all files ) +- Fix minor bug in nfcapd.c. +- Extend nfprofile for alerting system of nfsen - special version of profiles +- Extend nfprofile for shadow profiles. + +2007-08-10 snapshot-20070110 +- Fix some compiler warnings, when compiled on a 64bit LINUX +- Fixes an sflow bug: IP address was printed in wrong direction. ( lower bits first ) +- Add new IP addr taging option -T for easy parsing for nfsen lookups +- Add new IP list for massive address filtering: + syntax: ip in [ 12345 23456 3456 ....] +- Change nfprofile for channel based profiling. This breaks with old nfprofile + functionality. +- Remove space from ICMP type/code when followed by an IP address + +2006-07-21 snapshot-20060809 +- Make nfexpire ready for profile expiration +- Fix bug in nfrpofile. sub dir hierarchy not handled correctly. + +2006-07-21 snapshot-20060721 +- Add -N option for plain number output in summary line + +2006-07-21 snapshot-20060721 +- Do recursive file selection when a directory is given by -R + +2006-06-14 snapshot-20060621 +- Add srcas/dstas/proto aggregation. + Note: This changes the default aggregation behaviour, but gives more flexibility +- Add tos to element statistics list + +2006-06-14 snapshot-20060614 +- Add additional stat line at the end of output +- Add new binary nfexpire. Manages data expiry on time and/or size based limits + Includes new bookkeeping records in nfcapd. See nfexpire(1) +- Add ICMP type/code decoding in flow listing instead of dst port +- Add packet repeater in nfcapd/sfcapd. In addition, incoming UDP packets can + be directly forwarded to another IP address/Port. See new option -R +- Add sub directory hierarchies: Files can be stored into various sub dir levels + based on different time formats. see new option -S +- Some minor bug fixes. +- Code cleanup in nfcapd. better daemonize code and communication with launcher. + +2006-04-xx v.1.5.1 + Fix bug in nfdump.c: Writing anonymized flows to file did not work corretly + stdin input format now compatible with file format, therefore + 'nfdump < file' works again as it did in nfdump 1.4. + Fix bug in nfcapd.c: Error handling not correct when receiving a non + recognized netflow packet. Resulted in an endless loop +2006-03-27 snapshot 1.5-20060327 + Make all element statistics -s transport layer protocol + independant by default. Add :p to stat name ( e.g. srcip:p ) to + enable transport layer dependant statistics on request. +2006-03-20 snapshot 1.5-20060320 + Fix bug in filter engine: 'not flags xyz' produces wrong results + when more than a single flag is specified. + Minor man page fixes. + +2006-03-06 v1.5 + Fix bug nfcapd. Laucher signaled too early. File not yet properly + closed. +2006-02-14 v1.5-beta-5 + Add srcas, dstas, input and output interfaces in aggregated + output. + Fix IPv6 bug in filter: accept 1234:: address. + rename nfcapd.curent tmp file to nfcapd.curren.. Poorly + configured nfcapd processes may mess up themselves otherwise. +2006-02-02 v1.5-beta-4 + Fix netflow v5 dPkts <-> dOctets collector bug. + Update pipe format to include more information + Allow AS number 0 in filter syntax. + Add some more boundary checking - netflow exporters aren't bug free either - sigh .. +2006-01-11 v1.5-beta-3 + Fix isnumber incompatibility in grammar.y + Add 'if' statistics +2006-01-10 v1.5-beta-2 +nf_common.c Fix bug in format parser. + Extended 'proto ' syntax to support all protocols + Change time format in summary line to ISO format +2005-12-20 v1.5-beta-1 +*.* A lot of internal changes, not mentioned here. :( + +nfdump Add subnet aggregation for option -A + A new syntax e.g. srcip4/24, dstip6/64 is supported for subnet wise aggregation. + example: traffic of a whole subnet -A srcip4/24 -s srcip/bytes + +nfdump Add more stat element option. -s now supports: + srcip, dstip, ip, srcport, dstport, port, srcas, dstas, as, inif, outif, proto + +nfdump Add -z. Suppress writing flows to data files. Only stat information is written. +nfprofile Used only be nfsen for upcoming shadow profiles. If you don't understand this + simply ignore it. + +nfdump Add -q option to suppress header as well as stat information at the bottom +nfprofile for easier post processing with external programms. + +nf_common.c Output format processsing rewritting for more flexibility. Besides standard +nfdump.c output formats line, long extended etc., user defined output formats are now + possible and can even be compiled into nfdump for easy access. See -o fmt: + and nfdump.c around line 100. + +*.* Integrate netflow v9 into nfdump. Only a subset of v9 is stored into + the data files, basically everything needed for nfdump to work as it did before. + This also includes IPv6 support for any nfdump options. CryptoPAN extended + to work with IPv6. IPv6 condensed output format for better readability. + Output formats available in long and condensed mode: e.g. line -> line6 + extended -> extended6 + +*.* Replace binary data file format. Old format not flexible enough for + upcoming netflow v9/sflow data. *.stat files are gone. The same + information is now available under nfdump -I + New format about 5% larger in size, but faster for reading and writing. + speed gain eaten up by more complex processing - sigh .. + compat14 mode enables transparent reading of old style format. + nffile.[ch] now handles all data file stuff. + +nfreplay Multicast enabled: + Add -j . Joins the specified multicast group ( v4 or v6 ) + sending flows to this group. + +nfreplay IPv6 enabled: + Add option -4 and -6 to force a specific protocol, otherwise + protocol is automatically selected according the hostname to send flows to. + Add -K key, to send data anonymized, using CryptoPAn + +nfcapd Multicast enabled: + Add -j . Joins the specified multicast group ( v4 or v6 ) + for listening. + +nfcapd IPv6 enabled: + Add option -4 and -6 for IPv4 and IPv6. By default, listen on IPv4. + Option -b to bind for a specific host/IP address automatically + selects appropriate protocol. + +nfnet.c All functions to setup network sockets for listening/sending are + put into this file. + +2005-08-22 v1.4 +- nfreplay: Bug fix sending flows. +- nfdump: Add CryptoPAn code to anonymize IP addresses. New option -K +- nfdump: Change time format in output to ISO 8601 compatible: e.g. 1981-04-05 14:30:30.100 +- nfdump: Add scaling factor k,m,g to number in filter syntax: e.g. bytes > 1m +- nfdump: Create new output format extended with additional fields pps, bps and bpp +- nfdump: Rename output format extended to raw +- nfdump: More than one single flow element statistic ( -s ) is now possible +- nfdump: Add user defined sort order in flow element statistic +- nfdump: Flow element statistic can be ordered by more than one order in the same run +- nfdump: Add pps, bps and bpp fields in flow element statistics +- nfdump: Add more symbolic protocols ESP, AH, GRP and RVSP to filter syntax +- nfdump: Add duration, pps, bps and bpp to filter syntax +- nfdump: Make nfdump miliseconds aware. Older versions skipped msecs. + Binary nfdump file format changed due to this. + output formats changed, due to this. +- nfdump: Add interface in/out if syntax to filter +- nfcapd: Add flow_sequence check. Reports missing flows now. +- nfcapd: Report statistics to syslog LOG_INFO when data file is rotated. +- ft2nfdump: Add ft2nfdump to read netflow data from flow-tools + +2005-04-21 v1.3 +- Add option -A for more flexible aggregation. +- Correct spelling errors :( + +2005-03-04 v1.2.1 +Bug fix release +- nfcapd: launcher subprocess may hang on Linux 2.6.x kernels. + Cleaned up interrupt handling. +- nfcapd: fix include order of socket.h and types.h in order to + compile cleanly under FreeBSD 4.x +- nfcapd: clean up syslog logging. +- nfdump: Multiple sources ( -M ) and sort flows ( -m ) with + -c did not list the correct flows. +- nfprofile: Profiling with multiple sources may produce incorrect + profiles. + +2004-12-20 v1.2 +- nfcapd handles transparent v5 and v7 flows. v7 gets converted into v5 +- nfcapd can execute any command at the end of interval. New option -x +- nfdump Extended filter syntax for flags, to, bytes and packets +- Rearrange output formats in nfdump: new switch -o, remove switch -E + output formats: 'line', 'long', 'extended' and 'pipe' +- More flexible statistic handling in nfdump: cleanup ugly -s -s -s + syntax. Replaced by -s option. New statistics for Port and AS. + +2004-09-20 v 1.1 +First public Version. diff --git a/CreateSubHierarchy.pl b/CreateSubHierarchy.pl new file mode 100755 index 0000000..67c6ca8 --- /dev/null +++ b/CreateSubHierarchy.pl @@ -0,0 +1,133 @@ +#!/usr/bin/perl +# +# +# Sample script to clean old data. +# Run this script each hour to cleanup old files to make room for +# new data. When max_size_spool is reached the oldest files are +# deleted down to high_water. +# +# Copyright (c) 2004, SWITCH - Teleinformatikdienste fuer Lehre und Forschung +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# * 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. +# * Neither the name of SWITCH nor the names of its contributors may be +# used to endorse or promote products derived from this software without +# specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 COPYRIGHT OWNER 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. +# +# $Author: peter $ +# +# $Id: CreateSubHierarchy.pl 77 2006-06-14 14:52:25Z peter $ +# +# $LastChangedRevision: 77 $ +# +use strict; +use warnings; +use POSIX qw(strftime); +use Time::Local; +use Getopt::Std; + +our( + $opt_l, # Data directory + $opt_S, # Sub hierarchy format. Correspondes to -S to nfcapd. See nfcapd(1) +); + +getopts('l:S:'); + +my $subdir_format; + +my @subdir_formats = ( + "", + "%Y/%m/%d", + "%Y/%m/%d/%H", + "%Y/%W/%u", + "%Y/%W/%u/%H", + "%Y/%j", + "%Y/%j/%H", + "%F", + "%F/%H" +); + +sub usage { + print "$0 [options]\n", + " -l datadir Data directory\n", + " -S Sub hierarchy format. Correspondes to -S to nfcapd. See nfcapd(1)\n", + "\n"; + exit(0); +} + +sub ISO2UNIX { + my $isotime = shift; + + $isotime =~ s/\-//g; # allow '-' to structur time string + + # 2004 02 13 12 45 / + my $sec = 0; + my ( $year, $mon, $mday, $hour, $min ) = $isotime =~ /(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})/; + $mon--; + + # round down to nearest 5 min slot + my $diff = $min % 5; + if ( $diff ) { + $min -= $diff; + } + + my $unixtime = Time::Local::timelocal($sec,$min,$hour,$mday,$mon,$year); + + return $unixtime; + +} # End of ISO2UNIX + +if ( !defined $opt_l || !defined $opt_S ) { + usage(); +} + +my $data_dir = $opt_l; +if ( !defined $subdir_formats[$opt_S] ) { + die "Unknown format number $opt_S"; +} +$subdir_format = $subdir_formats[$opt_S]; + +opendir DIR, "$data_dir" || die "Can't open current directory: $!\n"; +$| = 1; +print "Reorganizing data files ... "; +while ( my $entry = readdir DIR ) { + next if $entry =~ /^\./; + next unless -f "$data_dir/$entry"; + next unless $entry =~ /nfcapd\.(\d{12})$/; + my $date = $1; + my $unix_time = ISO2UNIX($date); + my $sub_path = strftime $subdir_format, localtime($unix_time); + if ( !-d "$data_dir/$sub_path" ) { + print "Need to create '$data_dir/$sub_path'\n"; + my @dirlist = split '\/', $sub_path; + my $all_dirs = undef; + foreach my $dir ( @dirlist ) { + $all_dirs = defined $all_dirs ? "$all_dirs/$dir" : $dir; + if ( !-d "$data_dir/$all_dirs" ) { + mkdir "$data_dir/$all_dirs" || die "Can't create subdir '$data_dir/$all_dirs'\n"; + } + } + } + rename "$data_dir/$entry", "$data_dir/$sub_path/$entry" || die "Can't move file: $!\n"; + +} +print "done.\n"; diff --git a/INSTALL b/INSTALL new file mode 100644 index 0000000..2099840 --- /dev/null +++ b/INSTALL @@ -0,0 +1,370 @@ +Installation Instructions +************************* + +Copyright (C) 1994-1996, 1999-2002, 2004-2013 Free Software Foundation, +Inc. + + Copying and distribution of this file, with or without modification, +are permitted in any medium without royalty provided the copyright +notice and this notice are preserved. This file is offered as-is, +without warranty of any kind. + +Basic Installation +================== + + Briefly, the shell command `./configure && make && make install' +should configure, build, and install this package. The following +more-detailed instructions are generic; see the `README' file for +instructions specific to this package. Some packages provide this +`INSTALL' file but do not implement all of the features documented +below. The lack of an optional feature in a given package is not +necessarily a bug. More recommendations for GNU packages can be found +in *note Makefile Conventions: (standards)Makefile Conventions. + + 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, and a +file `config.log' containing compiler output (useful mainly for +debugging `configure'). + + It can also use an optional file (typically called `config.cache' +and enabled with `--cache-file=config.cache' or simply `-C') that saves +the results of its tests to speed up reconfiguring. Caching is +disabled by default to prevent problems with accidental use of stale +cache files. + + 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 you are using the cache, and at +some point `config.cache' contains results you don't want to keep, you +may remove or edit it. + + The file `configure.ac' (or `configure.in') is used to create +`configure' by a program called `autoconf'. You need `configure.ac' 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. + + Running `configure' might take a while. 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, generally using the just-built uninstalled binaries. + + 4. Type `make install' to install the programs and any data files and + documentation. When installing into a prefix owned by root, it is + recommended that the package be configured and built as a regular + user, and only the `make install' phase executed with root + privileges. + + 5. Optionally, type `make installcheck' to repeat any self-tests, but + this time using the binaries in their final installed location. + This target does not install anything. Running this target as a + regular user, particularly if the prior `make install' required + root privileges, verifies that the installation completed + correctly. + + 6. 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. + + 7. Often, you can also type `make uninstall' to remove the installed + files again. In practice, not all packages have tested that + uninstallation works correctly, even though it is required by the + GNU Coding Standards. + + 8. Some packages, particularly those that use Automake, provide `make + distcheck', which can by used by developers to test that all other + targets like `make install' and `make uninstall' work correctly. + This target is generally not run by end users. + +Compilers and Options +===================== + + Some systems require unusual options for compilation or linking that +the `configure' script does not know about. Run `./configure --help' +for details on some of the pertinent environment variables. + + You can give `configure' initial values for configuration parameters +by setting variables in the command line or in the environment. Here +is an example: + + ./configure CC=c99 CFLAGS=-g LIBS=-lposix + + *Note Defining Variables::, for more details. + +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 can use 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 `..'. This +is known as a "VPATH" build. + + With a non-GNU `make', it is safer 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. + + On MacOS X 10.5 and later systems, you can create libraries and +executables that work on multiple system types--known as "fat" or +"universal" binaries--by specifying multiple `-arch' options to the +compiler but only a single `-arch' option to the preprocessor. Like +this: + + ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ + CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ + CPP="gcc -E" CXXCPP="g++ -E" + + This is not guaranteed to produce working output in all cases, you +may have to build one architecture at a time and combine the results +using the `lipo' tool if you have problems. + +Installation Names +================== + + By default, `make install' installs the package's commands under +`/usr/local/bin', include files under `/usr/local/include', etc. You +can specify an installation prefix other than `/usr/local' by giving +`configure' the option `--prefix=PREFIX', where PREFIX must be an +absolute file name. + + You can specify separate installation prefixes for +architecture-specific files and architecture-independent files. If you +pass the option `--exec-prefix=PREFIX' to `configure', the package uses +PREFIX as the prefix for installing programs and libraries. +Documentation and other data files still use the regular prefix. + + In addition, if you use an unusual directory layout you can give +options like `--bindir=DIR' 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. In general, the +default for these options is expressed in terms of `${prefix}', so that +specifying just `--prefix' will affect all of the other directory +specifications that were not explicitly provided. + + The most portable way to affect installation locations is to pass the +correct locations to `configure'; however, many packages provide one or +both of the following shortcuts of passing variable assignments to the +`make install' command line to change installation locations without +having to reconfigure or recompile. + + The first method involves providing an override variable for each +affected directory. For example, `make install +prefix=/alternate/directory' will choose an alternate location for all +directory configuration variables that were expressed in terms of +`${prefix}'. Any directories that were specified during `configure', +but not in terms of `${prefix}', must each be overridden at install +time for the entire installation to be relocated. The approach of +makefile variable overrides for each directory variable is required by +the GNU Coding Standards, and ideally causes no recompilation. +However, some platforms have known limitations with the semantics of +shared libraries that end up requiring recompilation when using this +method, particularly noticeable in packages that use GNU Libtool. + + The second method involves providing the `DESTDIR' variable. For +example, `make install DESTDIR=/alternate/directory' will prepend +`/alternate/directory' before all installation names. The approach of +`DESTDIR' overrides is not required by the GNU Coding Standards, and +does not work on platforms that have drive letters. On the other hand, +it does better at avoiding recompilation issues, and works well even +when some directory options were not specified in terms of `${prefix}' +at `configure' time. + +Optional Features +================= + + 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'. + + 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. + + Some packages offer the ability to configure how verbose the +execution of `make' will be. For these packages, running `./configure +--enable-silent-rules' sets the default to minimal output, which can be +overridden with `make V=1'; while running `./configure +--disable-silent-rules' sets the default to verbose, which can be +overridden with `make V=0'. + +Particular systems +================== + + On HP-UX, the default C compiler is not ANSI C compatible. If GNU +CC is not installed, it is recommended to use the following options in +order to use an ANSI C compiler: + + ./configure CC="cc -Ae -D_XOPEN_SOURCE=500" + +and if that doesn't work, install pre-built binaries of GCC for HP-UX. + + HP-UX `make' updates targets which have the same time stamps as +their prerequisites, which makes it generally unusable when shipped +generated files such as `configure' are involved. Use GNU `make' +instead. + + On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot +parse its `' header file. The option `-nodtk' can be used as +a workaround. If GNU CC is not installed, it is therefore recommended +to try + + ./configure CC="cc" + +and if that doesn't work, try + + ./configure CC="cc -nodtk" + + On Solaris, don't put `/usr/ucb' early in your `PATH'. This +directory contains several dysfunctional programs; working variants of +these programs are available in `/usr/bin'. So, if you need `/usr/ucb' +in your `PATH', put it _after_ `/usr/bin'. + + On Haiku, software installed for all users goes in `/boot/common', +not `/usr/local'. It is recommended to use the following options: + + ./configure --prefix=/boot/common + +Specifying the System Type +========================== + + There may be some features `configure' cannot figure out +automatically, but needs to determine by the type of machine the package +will run on. Usually, assuming the package is built to be run on the +_same_ architectures, `configure' can figure that out, but if it prints +a message saying it cannot guess the machine type, give it the +`--build=TYPE' option. TYPE can either be a short name for the system +type, such as `sun4', or a canonical name which has the form: + + CPU-COMPANY-SYSTEM + +where SYSTEM can have one of these forms: + + OS + KERNEL-OS + + 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 machine type. + + If you are _building_ compiler tools for cross-compiling, you should +use the option `--target=TYPE' to select the type of system they will +produce code for. + + If you want to _use_ a cross compiler, that generates code for a +platform different from the build platform, you should specify the +"host" platform (i.e., that on which the generated programs will +eventually be run) with `--host=TYPE'. + +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. + +Defining Variables +================== + + Variables not defined in a site shell script can be set in the +environment passed to `configure'. However, some packages may run +configure again during the build, and the customized values of these +variables may be lost. In order to avoid this problem, you should set +them in the `configure' command line, using `VAR=value'. For example: + + ./configure CC=/usr/local2/bin/gcc + +causes the specified `gcc' to be used as the C compiler (unless it is +overridden in the site shell script). + +Unfortunately, this technique does not work for `CONFIG_SHELL' due to +an Autoconf limitation. Until the limitation is lifted, you can use +this workaround: + + CONFIG_SHELL=/bin/bash ./configure CONFIG_SHELL=/bin/bash + +`configure' Invocation +====================== + + `configure' recognizes the following options to control how it +operates. + +`--help' +`-h' + Print a summary of all of the options to `configure', and exit. + +`--help=short' +`--help=recursive' + Print a summary of the options unique to this package's + `configure', and exit. The `short' variant lists options used + only in the top level, while the `recursive' variant lists options + also present in any nested packages. + +`--version' +`-V' + Print the version of Autoconf used to generate the `configure' + script, and exit. + +`--cache-file=FILE' + Enable the cache: use and save the results of the tests in FILE, + traditionally `config.cache'. FILE defaults to `/dev/null' to + disable caching. + +`--config-cache' +`-C' + Alias for `--cache-file=config.cache'. + +`--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. + +`--prefix=DIR' + Use DIR as the installation prefix. *note Installation Names:: + for more details, including other options available for fine-tuning + the installation locations. + +`--no-create' +`-n' + Run the configure checks, but stop before creating any output + files. + +`configure' also accepts some other, not widely useful, options. Run +`configure --help' for more details. diff --git a/Makefile.am b/Makefile.am new file mode 100755 index 0000000..e637cef --- /dev/null +++ b/Makefile.am @@ -0,0 +1,4 @@ + +SUBDIRS = . bin man + +EXTRA_dist = CreateSubHierarchy.pl diff --git a/Makefile.in b/Makefile.in new file mode 100644 index 0000000..2801768 --- /dev/null +++ b/Makefile.in @@ -0,0 +1,765 @@ +# Makefile.in generated by automake 1.14.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2013 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@ +VPATH = @srcdir@ +am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +subdir = . +DIST_COMMON = INSTALL NEWS README AUTHORS ChangeLog \ + $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ + $(top_srcdir)/configure $(am__configure_deps) \ + $(srcdir)/config.h.in COPYING compile depcomp install-sh \ + missing ylwrap +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ + configure.lineno config.status.lineno +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +SOURCES = +DIST_SOURCES = +RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ + ctags-recursive dvi-recursive html-recursive info-recursive \ + install-data-recursive install-dvi-recursive \ + install-exec-recursive install-html-recursive \ + install-info-recursive install-pdf-recursive \ + install-ps-recursive install-recursive installcheck-recursive \ + installdirs-recursive pdf-recursive ps-recursive \ + tags-recursive uninstall-recursive +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ + distclean-recursive maintainer-clean-recursive +am__recursive_targets = \ + $(RECURSIVE_TARGETS) \ + $(RECURSIVE_CLEAN_TARGETS) \ + $(am__extra_recursive_targets) +AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ + cscope distdir dist dist-all distcheck +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \ + $(LISP)config.h.in +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` +ETAGS = etags +CTAGS = ctags +CSCOPE = cscope +DIST_SUBDIRS = $(SUBDIRS) +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +distdir = $(PACKAGE)-$(VERSION) +top_distdir = $(distdir) +am__remove_distdir = \ + if test -d "$(distdir)"; then \ + find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ + && rm -rf "$(distdir)" \ + || { sleep 5 && rm -rf "$(distdir)"; }; \ + else :; fi +am__post_remove_distdir = $(am__remove_distdir) +am__relativize = \ + dir0=`pwd`; \ + sed_first='s,^\([^/]*\)/.*$$,\1,'; \ + sed_rest='s,^[^/]*/*,,'; \ + sed_last='s,^.*/\([^/]*\)$$,\1,'; \ + sed_butlast='s,/*[^/]*$$,,'; \ + while test -n "$$dir1"; do \ + first=`echo "$$dir1" | sed -e "$$sed_first"`; \ + if test "$$first" != "."; then \ + if test "$$first" = ".."; then \ + dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ + dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ + else \ + first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ + if test "$$first2" = "$$first"; then \ + dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ + else \ + dir2="../$$dir2"; \ + fi; \ + dir0="$$dir0"/"$$first"; \ + fi; \ + fi; \ + dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ + done; \ + reldir="$$dir2" +DIST_ARCHIVES = $(distdir).tar.gz +GZIP_ENV = --best +DIST_TARGETS = dist-gzip +distuninstallcheck_listfiles = find . -type f -print +am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ + | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' +distcleancheck_listfiles = find . -type f -print +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FTS_OBJ = @FTS_OBJ@ +FT_INCLUDES = @FT_INCLUDES@ +FT_LDFLAGS = @FT_LDFLAGS@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LEX = @LEX@ +LEXLIB = @LEXLIB@ +LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ +LFLAGS = @LFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +RRD_LIBS = @RRD_LIBS@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +YACC = @YACC@ +YFLAGS = @YFLAGS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build_alias = @build_alias@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host_alias = @host_alias@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +SUBDIRS = . bin man +EXTRA_dist = CreateSubHierarchy.pl +all: config.h + $(MAKE) $(AM_MAKEFLAGS) all-recursive + +.SUFFIXES: +am--refresh: Makefile + @: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + echo ' cd $(srcdir) && $(AUTOMAKE) --gnu'; \ + $(am__cd) $(srcdir) && $(AUTOMAKE) --gnu \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + echo ' $(SHELL) ./config.status'; \ + $(SHELL) ./config.status;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + $(SHELL) ./config.status --recheck + +$(top_srcdir)/configure: $(am__configure_deps) + $(am__cd) $(srcdir) && $(AUTOCONF) +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) +$(am__aclocal_m4_deps): + +config.h: stamp-h1 + @test -f $@ || rm -f stamp-h1 + @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h1 + +stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status + @rm -f stamp-h1 + cd $(top_builddir) && $(SHELL) ./config.status config.h +$(srcdir)/config.h.in: $(am__configure_deps) + ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) + rm -f stamp-h1 + touch $@ + +distclean-hdr: + -rm -f config.h stamp-h1 + +# 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. +$(am__recursive_targets): + @fail=; \ + if $(am__make_keepgoing); then \ + failcom='fail=yes'; \ + else \ + failcom='exit 1'; \ + fi; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + 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; \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" + +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-recursive +TAGS: tags + +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + set x; \ + here=`pwd`; \ + if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ + include_option=--etags-include; \ + empty_fix=.; \ + else \ + include_option=--include; \ + empty_fix=; \ + fi; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test ! -f $$subdir/TAGS || \ + set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ + fi; \ + done; \ + $(am__define_uniq_tagged_files); \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: ctags-recursive + +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" +cscope: cscope.files + test ! -s cscope.files \ + || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS) +clean-cscope: + -rm -f cscope.files +cscope.files: clean-cscope cscopelist +cscopelist: cscopelist-recursive + +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + -rm -f cscope.out cscope.in.out cscope.po.out cscope.files + +distdir: $(DISTFILES) + $(am__remove_distdir) + test -d "$(distdir)" || mkdir "$(distdir)" + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done + @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + $(am__make_dryrun) \ + || test -d "$(distdir)/$$subdir" \ + || $(MKDIR_P) "$(distdir)/$$subdir" \ + || exit 1; \ + dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ + $(am__relativize); \ + new_distdir=$$reldir; \ + dir1=$$subdir; dir2="$(top_distdir)"; \ + $(am__relativize); \ + new_top_distdir=$$reldir; \ + echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ + echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ + ($(am__cd) $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$$new_top_distdir" \ + distdir="$$new_distdir" \ + am__remove_distdir=: \ + am__skip_length_check=: \ + am__skip_mode_fix=: \ + distdir) \ + || exit 1; \ + fi; \ + done + -test -n "$(am__skip_mode_fix)" \ + || find "$(distdir)" -type d ! -perm -755 \ + -exec chmod u+rwx,go+rx {} \; -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 $(install_sh) -c -m a+r {} {} \; \ + || chmod -R a+r "$(distdir)" +dist-gzip: distdir + tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz + $(am__post_remove_distdir) + +dist-bzip2: distdir + tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 + $(am__post_remove_distdir) + +dist-lzip: distdir + tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz + $(am__post_remove_distdir) + +dist-xz: distdir + tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz + $(am__post_remove_distdir) + +dist-tarZ: distdir + @echo WARNING: "Support for shar distribution archives is" \ + "deprecated." >&2 + @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 + tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z + $(am__post_remove_distdir) + +dist-shar: distdir + @echo WARNING: "Support for distribution archives compressed with" \ + "legacy program 'compress' is deprecated." >&2 + @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 + shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz + $(am__post_remove_distdir) + +dist-zip: distdir + -rm -f $(distdir).zip + zip -rq $(distdir).zip $(distdir) + $(am__post_remove_distdir) + +dist dist-all: + $(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:' + $(am__post_remove_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 + case '$(DIST_ARCHIVES)' in \ + *.tar.gz*) \ + GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\ + *.tar.bz2*) \ + bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ + *.tar.lz*) \ + lzip -dc $(distdir).tar.lz | $(am__untar) ;;\ + *.tar.xz*) \ + xz -dc $(distdir).tar.xz | $(am__untar) ;;\ + *.tar.Z*) \ + uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ + *.shar.gz*) \ + GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\ + *.zip*) \ + unzip $(distdir).zip ;;\ + esac + chmod -R a-w $(distdir) + chmod u+w $(distdir) + mkdir $(distdir)/_build $(distdir)/_inst + chmod a-w $(distdir) + test -d $(distdir)/_build || exit 0; \ + dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ + && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ + && am__cwd=`pwd` \ + && $(am__cd) $(distdir)/_build \ + && ../configure \ + $(AM_DISTCHECK_CONFIGURE_FLAGS) \ + $(DISTCHECK_CONFIGURE_FLAGS) \ + --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 \ + && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ + distuninstallcheck \ + && chmod -R a-w "$$dc_install_base" \ + && ({ \ + (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ + distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ + } || { rm -rf "$$dc_destdir"; exit 1; }) \ + && rm -rf "$$dc_destdir" \ + && $(MAKE) $(AM_MAKEFLAGS) dist \ + && rm -rf $(DIST_ARCHIVES) \ + && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ + && cd "$$am__cwd" \ + || exit 1 + $(am__post_remove_distdir) + @(echo "$(distdir) archives ready for distribution: "; \ + list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ + sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' +distuninstallcheck: + @test -n '$(distuninstallcheck_dir)' || { \ + echo 'ERROR: trying to run $@ with an empty' \ + '$$(distuninstallcheck_dir)' >&2; \ + exit 1; \ + }; \ + $(am__cd) '$(distuninstallcheck_dir)' || { \ + echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \ + exit 1; \ + }; \ + test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \ + || { echo "ERROR: files left after uninstall:" ; \ + if test -n "$(DESTDIR)"; then \ + echo " (check DESTDIR support)"; \ + fi ; \ + $(distuninstallcheck_listfiles) ; \ + exit 1; } >&2 +distcleancheck: distclean + @if test '$(srcdir)' = . ; then \ + echo "ERROR: distcleancheck can only run from a VPATH build" ; \ + exit 1 ; \ + fi + @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ + || { echo "ERROR: files left in build directory after distclean:" ; \ + $(distcleancheck_listfiles) ; \ + exit 1; } >&2 +check-am: all-am +check: check-recursive +all-am: Makefile config.h +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: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +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 + +distclean: distclean-recursive + -rm -f $(am__CONFIG_DISTCLEAN_FILES) + -rm -f Makefile +distclean-am: clean-am distclean-generic distclean-hdr distclean-tags + +dvi: dvi-recursive + +dvi-am: + +html: html-recursive + +html-am: + +info: info-recursive + +info-am: + +install-data-am: + +install-dvi: install-dvi-recursive + +install-dvi-am: + +install-exec-am: + +install-html: install-html-recursive + +install-html-am: + +install-info: install-info-recursive + +install-info-am: + +install-man: + +install-pdf: install-pdf-recursive + +install-pdf-am: + +install-ps: install-ps-recursive + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-recursive + -rm -f $(am__CONFIG_DISTCLEAN_FILES) + -rm -rf $(top_srcdir)/autom4te.cache + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-recursive + +mostlyclean-am: mostlyclean-generic + +pdf: pdf-recursive + +pdf-am: + +ps: ps-recursive + +ps-am: + +uninstall-am: + +.MAKE: $(am__recursive_targets) all install-am install-strip + +.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \ + am--refresh check check-am clean clean-cscope clean-generic \ + cscope cscopelist-am ctags ctags-am dist dist-all dist-bzip2 \ + dist-gzip dist-lzip dist-shar dist-tarZ dist-xz dist-zip \ + distcheck distclean distclean-generic distclean-hdr \ + distclean-tags distcleancheck distdir distuninstallcheck dvi \ + dvi-am html html-am info info-am install install-am \ + install-data install-data-am install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-info install-info-am install-man install-pdf \ + install-pdf-am install-ps install-ps-am install-strip \ + installcheck installcheck-am installdirs installdirs-am \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-generic pdf pdf-am ps ps-am tags tags-am uninstall \ + uninstall-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: diff --git a/NEWS b/NEWS new file mode 120000 index 0000000..b0936e8 --- /dev/null +++ b/NEWS @@ -0,0 +1 @@ +ChangeLog \ No newline at end of file diff --git a/README.md b/README.md old mode 100644 new mode 100755 index c67437d..7984177 --- a/README.md +++ b/README.md @@ -1,4 +1,412 @@ # nfdump -Netflow processing tools -nfdump is moving here - stay tuned. +Stable Release v1.6.13 + +See the Changelog file for all changes in release 1.6.10 + +Notes on NSEL/ASA support +------------------------- + +nfdump-1.6.9 includes a new written from scratch implemented NSEL/ASA +module. It's based on the CISCO ASA Spec 8.4: +"Implementation Note for NetFlow Collectors, Version 8.4" +Due to this new implementation, nfdump-1.6.9 is not compatible with old +nfdump-1.5.8-2-NSEL. +To build nfdump, add --enable-nsel to the configure command. By enabling +the ASA/NSEL option, nfdump processes normal flows as well ASA/NSEL records +likewise. nfcapd adds by default all required NSEL extesions equivalent +to '-Tnsel' + +Note on NEL support +------------------- + +nfdump-1.6.9 includes a new module for decoding the CISCO NEL ( NAT event +logging ) records. It's considered to be experimantal, as no official +documentation can be found. Let me know otherwise. +To build nfdump, add --enable-nel to the configure command. By enabling +the NEL option, nfdump processes normal flows as well NEL records +likewise. nfcapd adds by default all required NEL extesions equivalent +to '-Tnel' + +Although it's possibel to enable NSEL und NEL likewise, users could get +confused by nfdump output, as NSEL output format overwrites NEL format. +In that case you need explicitly to define -o nel. + +Notes on IPFIX +--------------- + +nfdump contains an IPFIX module for decoding IPFIX data. It +is considered not yet to be complete and does not yet support full IPFIX. +o Supports basically same feature set of elements as netflow_v9 module +o Only UDP traffic is accepted no SCTP so far +o No sampling support. +o Still more test data needed. If you would like to see more IPFIX + support, please contact me. + + +General README +-------------- + +This is a small description, what the nfdump tools do and how they work. +Nfdump is distributed under the BSD license - see BSD-license.txt + +The nfdump tools collect and process netflow data on the command line. +They are part of the NFSEN project, which is explained more detailed at +http://www.terena.nl/tech/task-forces/tf-csirt/meeting12/nfsen-Haag.pdf + +The Web interface mentioned is not part of nfdump and is available at +http://nfsen.sourceforge.net + +nfdump tools overview: +---------------------- + +nfcapd - netflow collector daemon. +Reads the netflow data from the network and stores the flow records +into files. Automatically rotates files every n minutes. ( typically +every 5 min ) nfcapd reads netflow versions v1, v5, v7 and v9 flows +as well as IPFIX flows transparently. Several netflow streams can be +sent to a single or collector. + +nfdump - netflow dump. +Reads the netflow data from the files stored by nfcapd. It's filter +syntax is similar to tcpdump ( pcap like ) but for netflow adapted. +If you like tcpdump you will like nfdump. nfdump displays netflow +data and/or creates top N statistics of flows, bytes, packets. nfdump +has a powerful and flexible flow aggregation including bi-directional +flows. The output format is user selectable and also includes a simple +csv format for post processing. + +nfreplay - netflow replay +Reads the netflow data from the files stored by nfcapd and sends it +over the network to another host. + +nfexpire - expire old netflow data +Manages data expiration. Sets appropriate limits. + +Optional binaries: + +nfprofile - netflow profiler. Required by NfSen +Reads the netflow data from the files stored by nfcapd. Filters the +netflow data according to the specified filter sets ( profiles ) and +stores the filtered data into files for later use. + +nftrack - Port tracking decoder for NfSen plugin PortTracker. + +ft2nfdump - read flow-tools format - Optional tool +ft2nfdump acts as a pipe converter for flow-tools data. It allows +to read any flow-tools data and process and save it in nfdump format. + +sfcapd - sflow collector daemon +scfapd collects sflow data and stores it into nfcapd comaptible files. +"sfcapd includes sFlow(TM), freely available from http://www.inmon.com/". + +nfreader - Framework for programmers +nfreader is a framework to read nfdump files for any other purpose. +Own C code can be added to process flows. nfreader is not installed + +parse_csv.pl - Simple reader, written in Perl. +parse_csv.pl reads nfdump csv output and print the flows to stdout. +This program is intended to be a framework for post processing flows +for any other purpose. + +Note for sflow users: +sfcapd and nfcapd can be used concurrently to collect netflow and sflow +data at the same time. Generic command line options apply to both +collectors likewise. Due to lack of availability of sflow devices, +I could not test the correct output of IPv6 records. Users are requested +to send feedback to the list or directly to me. sfcapd's sflow decoding +module is based on InMon's sflowtool code and supports similar fields as +nfcapd does for netflow v9, which is a subset of all available sflow +fields in an sflow record. More fields may be integrated in future +versions of sfcapd. + + +Compression +----------- +Binary data files can optionally be compressed using the fast LZO1X-1 +compression. For more details on this algorithm see, +http://www.oberhumer.com/opensource/lzo. LZO1X-1 is very fast, so +that compression can be used in real time by the collector. LZO1X-1 +reduces the file size around 50%. You can check the compression speed +for your system by doing ./nftest . + + +Principle of Operation: +----------------------- +The goal of the design is to able to analyze netflow data from +the past as well as to track interesting traffic patterns +continuously. The amount of time back in the past is limited only +by the disk storage available for all the netflow data. The tools +are optimized for speed for efficient filtering. The filter rules +should look familiar to the syntax of tcpdump ( pcap compatible ). + +All data is stored to disk, before it gets analyzed. This separates +the process of storing and analyzing the data. + +The data is organized in a time-based fashion. Every n minutes +- typically 5 min - nfcapd rotates and renames the output file +with the timestamp nfcapd.YYYYMMddhhmm of the interval e.g. +nfcapd.200907110845 contains data from July 11th 2009 08:45 onward. +Based on a 5min time interval, this results in 288 files per day. + +Analyzing the data can be done for a single file, or by concatenating +several files for a single output. The output is either ASCII text +or binary data, when saved into a file, ready to be processed again +with the same tools. + +You may have several netflow sources - let's say 'router1' 'router2' +and so on. The data is organized as follows: + +/flow_base_dir/router1 +/flow_base_dir/router2 + +which means router1 and router2 are subdirs of the flow_base_dir. + +Although several flow sources can be sent to a single collector, +It's recommended to have multiple collector on busy networks for +each source. +Example: Start two collectors on different ports: + +nfcapd -w -D -S 2 -B 1024000 -l /flow_base_dir/router1 -p 23456 +nfcapd -w -D -S 2 -B 1024000 -l /flow_base_dir/router2 -p 23457 + +nfcapd can handle multiple flow sources. +All sources can go into a single file or can be split: + +All into the same file: +nfcapd -w -D -S 2 -l /flow_base_dir/routers -p 23456 + +Collected on one port and split per source: +nfcapd -w -D -S 2 -n router1,172.16.17.18,/flow_base_dir/router1 \ + -n router2,172.16.17.20,/flow_base_dir/router2 -p 23456 + +See nfcapd(1) for a detailed explanation of all options. + +Security: none of the tools requires root privileges, unless you have +a port < 1024. However, there is no access control mechanism in nfcapd. +It is assumed, that host level security is in place to filter the +proper IP addresses. + +See the manual pages or use the -h switch for details on using each of +the programs. For any questions send email to phaag@users.sourceforge.net + +Configure your router to export netflow. See the relevant documentation +for your model. + +A generic Cisco sample configuration enabling NetFlow on an interface: + + ip address 192.168.92.162 255.255.255.224 + interface fastethernet 0/0 + ip route-cache flow + +To tell the router where to send the NetFlow data, enter the following +global configuration command: + + ip flow-export 192.168.92.218 9995 + ip flow-export version 5 + + ip flow-cache timeout active 5 + +This breaks up long-lived flows into 5-minute segments. You can choose +any number of minutes between 1 and 60; + + +Netflow v9 full export example of a cisco 7200 with sampling enabled: + + interface Ethernet1/0 + ip address 192.168.92.162 255.255.255.224 + duplex half + flow-sampler my-map + ! + ! + flow-sampler-map my-map + mode random one-out-of 5 + ! + ip flow-cache timeout inactive 60 + ip flow-cache timeout active 1 + ip flow-capture fragment-offset + ip flow-capture packet-length + ip flow-capture ttl + ip flow-capture vlan-id + ip flow-capture icmp + ip flow-capture ip-id + ip flow-capture mac-addresses + ip flow-export version 9 + ip flow-export template options export-stats + ip flow-export template options sampler + ip flow-export template options timeout-rate 1 + ip flow-export template timeout-rate 1 + ip flow-export destination 192.168.92.218 9995 + + +See the relevant documentation for a full description of netflow commands + +Note: Netflow version v5 and v7 have 32 bit counter values. The number of +packets or bytes may overflow this value, within the flow-cache timeout +on very busy routers. To prevent overflow, you may consider to reduce the +flow-cache timeout to lower values. All nfdump tools use 64 bit counters +internally, which means, all aggregated values are correctly reported. + +The binary format of the data files is netflow version independent. +For speed reasons the binary format is machine architecture dependent, and +as such can not be exchanged between little and big endian systems. +Internally nfdump does all processing IP protocol independent, which means +everything works for IPv4 as well as IPv6 addresses. +See the nfdump(1) man page for details. + +netflow version 9: +nfcapd supports a large range of netflow v9 tags. Version 1.6 nfdump +supports the following fields. This list can be found in netflow_v9.h + +// Flowset record types +#define NF9_IN_BYTES 1 +#define NF9_IN_PACKETS 2 +#define NF9_FLOWS_AGGR 3 +#define NF9_IN_PROTOCOL 4 +#define NF9_SRC_TOS 5 +#define NF9_TCP_FLAGS 6 +#define NF9_L4_SRC_PORT 7 +#define NF9_IPV4_SRC_ADDR 8 +#define NF9_SRC_MASK 9 +#define NF9_INPUT_SNMP 10 +#define NF9_L4_DST_PORT 11 +#define NF9_IPV4_DST_ADDR 12 +#define NF9_DST_MASK 13 +#define NF9_OUTPUT_SNMP 14 +#define NF9_V4_NEXT_HOP 15 +#define NF9_SRC_AS 16 +#define NF9_DST_AS 17 +#define NF9_BGP_V4_NEXT_HOP 18 + +#define NF9_LAST_SWITCHED 21 +#define NF9_FIRST_SWITCHED 22 +#define NF9_OUT_BYTES 23 +#define NF9_OUT_PKTS 24 + +#define NF9_IPV6_SRC_ADDR 27 +#define NF9_IPV6_DST_ADDR 28 +#define NF9_IPV6_SRC_MASK 29 +#define NF9_IPV6_DST_MASK 30 + +#define NF9_IPV6_FLOW_LABEL 31 +#define NF9_ICMP_TYPE 32 + +#define NF9_SAMPLING_INTERVAL 34 +#define NF9_SAMPLING_ALGORITHM 35 + +#define NF9_ENGINE_TYPE 38 +#define NF9_ENGINE_ID 39 + +#define NF9_FLOW_SAMPLER_ID 48 +#define FLOW_SAMPLER_MODE 49 +#define NF9_FLOW_SAMPLER_RANDOM_INTERVAL 50 + +// #define NF9_MIN_TTL 52 +// #define NF9_MAX_TTL 53 +// #define NF9_IPV4_IDENT 54 + +#define NF9_DST_TOS 55 +#define NF9_IN_SRC_MAC 56 +#define NF9_OUT_DST_MAC 57 +#define NF9_SRC_VLAN 58 +#define NF9_DST_VLAN 59 + +#define NF9_DIRECTION 61 +#define NF9_V6_NEXT_HOP 62 +#define NF9_BPG_V6_NEXT_HOP 63 +// #define NF9_V6_OPTION_HEADERS 64 + +#define NF9_MPLS_LABEL_1 70 +#define NF9_MPLS_LABEL_2 71 +#define NF9_MPLS_LABEL_3 72 +#define NF9_MPLS_LABEL_4 73 +#define NF9_MPLS_LABEL_5 74 +#define NF9_MPLS_LABEL_6 75 +#define NF9_MPLS_LABEL_7 76 +#define NF9_MPLS_LABEL_8 77 +#define NF9_MPLS_LABEL_9 78 +#define NF9_MPLS_LABEL_10 79 +#define NF9_IN_DST_MAC 80 +#define NF9_OUT_SRC_MAC 81 + + +#define NF9_FORWARDING_STATUS 89 + +#define NF9_BGP_ADJ_NEXT_AS 128 +#define NF9_BGP_ADJ_PREV_AS 129 + +// CISCO ASA NSEL extension - Network Security Event Logging +#define NF_F_FLOW_BYTES 85 +#define NF_F_CONN_ID 148 +#define NF_F_FLOW_CREATE_TIME_MSEC 152 +#define NF_F_ICMP_TYPE 176 +#define NF_F_ICMP_CODE 177 +#define NF_F_ICMP_TYPE_IPV6 178 +#define NF_F_ICMP_CODE_IPV6 179 +#define NF_F_FWD_FLOW_DELTA_BYTES 231 +#define NF_F_REV_FLOW_DELTA_BYTES 232 +#define NF_F_FW_EVENT84 233 +#define NF_F_EVENT_TIME_MSEC 323 +#define NF_F_INGRESS_ACL_ID 33000 +#define NF_F_EGRESS_ACL_ID 33001 +#define NF_F_FW_EXT_EVENT 33002 +#define NF_F_USERNAME 40000 +#define NF_F_XLATE_SRC_ADDR_IPV4 40001 +#define NF_F_XLATE_DST_ADDR_IPV4 40002 +#define NF_F_XLATE_SRC_PORT 40003 +#define NF_F_XLATE_DST_PORT 40004 +#define NF_F_FW_EVENT 40005 + +// Cisco ASR 1000 series NEL extension - Nat Event Logging +#define NF_N_NAT_EVENT 230 +#define NF_N_INGRESS_VRFID 234 +#define NF_N_NAT_INSIDE_GLOBAL_IPV4 225 +#define NF_N_NAT_OUTSIDE_GLOBAL_IPV4 226 +#define NF_N_POST_NAPT_SRC_PORT 227 +#define NF_N_POST_NAPT_DST_PORT 228 + + +// nprobe latency extensions +#define NF9_NPROBE_CLIENT_NW_DELAY_SEC 57554 +#define NF9_NPROBE_CLIENT_NW_DELAY_USEC 57555 +#define NF9_NPROBE_SERVER_NW_DELAY_SEC 57556 +#define NF9_NPROBE_SERVER_NW_DELAY_USEC 57557 +#define NF9_NPROBE_APPL_LATENCY_SEC 57558 +#define NF9_NPROBE_APPL_LATENCY_USEC 57559 + +32 and 64 bit counters are supported for any counters. However, internally +nfdump stores packets and bytes counters always as 64bit counters. +16 and 32 bit AS numbers are supported. + +Extensions: nfcapd supports a large number of v9 tags. In order to optimise +disk space and performance, v9 tags are grouped into a number of extensions +which may or may not be stored into the data file. Therefore the v9 templates +configured on the exporter may be tuned with the collector. Only the tags +common to both are stored into the data files. Extensions can be switch +on/off by using the -T option. + +Sampling: By default, the sampling rate is set to 1 (unsampled) or to +any given value specified by the -s cmd line option. If sampling information +is found in the netflow stream, it overwrites the default value. Sampling +is automatically recognised when announced in v9 option templates +(tags #48, #49, #50 ) or in the unofficial v5 header hack. Note: Not all +platforms (or IOS versions) support exporting sampling information in +netflow data, even if sampling is configured. The number of bytes/packets +in each netflow record is automatically multiplied by the sampling rate. +The total number of flows is not changed as this is not accurate enough. +(Small flows versus large flows) + +nfcapd can listen on IPv6 or IPv4. Furthermore multicast is supported. + +Flow-tools compatibility +------------------------ +When building with configure option --enable-ftconv, the flow-tools converter +is compiled. Using this converter, any flow-tools created data can be read +and processed and stored by nfdump. + +Example: + + flow-cat [options] | ft2nfdump | nfdump [options] + + +See the INSTALL file for installation details. diff --git a/ToDo b/ToDo new file mode 100644 index 0000000..0eb9cd6 --- /dev/null +++ b/ToDo @@ -0,0 +1,6 @@ +- Add ASA support. + Port CISCO code from nfdump-1.5.7-nsel to v1.6 +- Add packeteer code from wm.edu +- Add BGP merge for AS filtering +- Add index for fast IP lookup. +- ... and endless new user ideas ... diff --git a/aclocal.m4 b/aclocal.m4 new file mode 100644 index 0000000..3a9a040 --- /dev/null +++ b/aclocal.m4 @@ -0,0 +1,1149 @@ +# generated automatically by aclocal 1.14.1 -*- Autoconf -*- + +# Copyright (C) 1996-2013 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. + +m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) +m4_ifndef([AC_AUTOCONF_VERSION], + [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl +m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],, +[m4_warning([this file was generated for autoconf 2.69. +You have another version of autoconf. It may work, but is not guaranteed to. +If you have problems, you may need to regenerate the build system entirely. +To do so, use the procedure documented by the package, typically 'autoreconf'.])]) + +# Copyright (C) 2002-2013 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. + +# AM_AUTOMAKE_VERSION(VERSION) +# ---------------------------- +# Automake X.Y traces this macro to ensure aclocal.m4 has been +# generated from the m4 files accompanying Automake X.Y. +# (This private macro should not be called outside this file.) +AC_DEFUN([AM_AUTOMAKE_VERSION], +[am__api_version='1.14' +dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to +dnl require some minimum version. Point them to the right macro. +m4_if([$1], [1.14.1], [], + [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl +]) + +# _AM_AUTOCONF_VERSION(VERSION) +# ----------------------------- +# aclocal traces this macro to find the Autoconf version. +# This is a private macro too. Using m4_define simplifies +# the logic in aclocal, which can simply ignore this definition. +m4_define([_AM_AUTOCONF_VERSION], []) + +# AM_SET_CURRENT_AUTOMAKE_VERSION +# ------------------------------- +# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. +# This function is AC_REQUIREd by AM_INIT_AUTOMAKE. +AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], +[AM_AUTOMAKE_VERSION([1.14.1])dnl +m4_ifndef([AC_AUTOCONF_VERSION], + [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl +_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) + +# AM_AUX_DIR_EXPAND -*- Autoconf -*- + +# Copyright (C) 2001-2013 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. + +# 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], +[dnl Rely on autoconf to set up CDPATH properly. +AC_PREREQ([2.50])dnl +# expand $ac_aux_dir to an absolute path +am_aux_dir=`cd $ac_aux_dir && pwd` +]) + +# AM_CONDITIONAL -*- Autoconf -*- + +# Copyright (C) 1997-2013 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. + +# AM_CONDITIONAL(NAME, SHELL-CONDITION) +# ------------------------------------- +# Define a conditional. +AC_DEFUN([AM_CONDITIONAL], +[AC_PREREQ([2.52])dnl + m4_if([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], + [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl +AC_SUBST([$1_TRUE])dnl +AC_SUBST([$1_FALSE])dnl +_AM_SUBST_NOTMAKE([$1_TRUE])dnl +_AM_SUBST_NOTMAKE([$1_FALSE])dnl +m4_define([_AM_COND_VALUE_$1], [$2])dnl +if $2; then + $1_TRUE= + $1_FALSE='#' +else + $1_TRUE='#' + $1_FALSE= +fi +AC_CONFIG_COMMANDS_PRE( +[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then + AC_MSG_ERROR([[conditional "$1" was never defined. +Usually this means the macro was only invoked conditionally.]]) +fi])]) + +# Copyright (C) 1999-2013 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. + + +# 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", "OBJC", "OBJCXX", "UPC", or "GJC". +# 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 + +m4_if([$1], [CC], [depcc="$CC" am_compiler_list=], + [$1], [CXX], [depcc="$CXX" am_compiler_list=], + [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'], + [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'], + [$1], [UPC], [depcc="$UPC" am_compiler_list=], + [$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". + rm -rf conftest.dir + 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 + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + 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 + am__universal=false + m4_case([$1], [CC], + [case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac], + [CXX], + [case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac]) + + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # 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. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with + # Solaris 10 /bin/sh. + echo '/* dummy */' > sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + # 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. Also, some Intel + # versions had trouble with output in subdirs. + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; + 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 + ;; + msvc7 | msvc7msys | msvisualcpp | msvcmsys) + # This compiler won't grok '-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; + none) break ;; + esac + if depmode=$depmode \ + source=sub/conftest.c object=$am__obj \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_$1_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_$1_dependencies_compiler_type=none +fi +]) +AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) +AM_CONDITIONAL([am__fastdep$1], [ + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) +]) + + +# AM_SET_DEPDIR +# ------------- +# Choose a directory name for dependency files. +# This macro is AC_REQUIREd in _AM_DEPENDENCIES. +AC_DEFUN([AM_SET_DEPDIR], +[AC_REQUIRE([AM_SET_LEADING_DOT])dnl +AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl +]) + + +# AM_DEP_TRACK +# ------------ +AC_DEFUN([AM_DEP_TRACK], +[AC_ARG_ENABLE([dependency-tracking], [dnl +AS_HELP_STRING( + [--enable-dependency-tracking], + [do not reject slow dependency extractors]) +AS_HELP_STRING( + [--disable-dependency-tracking], + [speeds up one-time build])]) +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' + am__nodep='_no' +fi +AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) +AC_SUBST([AMDEPBACKSLASH])dnl +_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl +AC_SUBST([am__nodep])dnl +_AM_SUBST_NOTMAKE([am__nodep])dnl +]) + +# Generate code to set up dependency tracking. -*- Autoconf -*- + +# Copyright (C) 1999-2013 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. + + +# _AM_OUTPUT_DEPENDENCY_COMMANDS +# ------------------------------ +AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], +[{ + # Older Autoconf quotes --file arguments for eval, but not when files + # are listed without --file. Let's play safe and only enable the eval + # if we detect the quoting. + case $CONFIG_FILES in + *\'*) eval set x "$CONFIG_FILES" ;; + *) set x $CONFIG_FILES ;; + esac + shift + for mf + do + # Strip MF so we end up with the name of the file. + mf=`echo "$mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile or not. + # We used to match only the files named 'Makefile.in', but + # some people rename them; so instead we look at the file content. + # Grep'ing the first line is not enough: some people post-process + # each Makefile.in and add a new line on top of each file to say so. + # Grep'ing the whole file is not good either: AIX grep has a line + # limit of 2048, but all sed's we know have understand at least 4000. + if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then + dirpart=`AS_DIRNAME("$mf")` + else + continue + fi + # Extract the definition of DEPDIR, am__include, and am__quote + # from the Makefile without running 'make'. + DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` + test -z "$DEPDIR" && continue + am__include=`sed -n 's/^am__include = //p' < "$mf"` + test -z "$am__include" && continue + am__quote=`sed -n 's/^am__quote = //p' < "$mf"` + # Find all dependency output files, they are included files with + # $(DEPDIR) in their names. 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 " + s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do + # Make sure the directory exists. + test -f "$dirpart/$file" && continue + fdir=`AS_DIRNAME(["$file"])` + AS_MKDIR_P([$dirpart/$fdir]) + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" + done + done +} +])# _AM_OUTPUT_DEPENDENCY_COMMANDS + + +# AM_OUTPUT_DEPENDENCY_COMMANDS +# ----------------------------- +# This macro should only be invoked once -- use via AC_REQUIRE. +# +# 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_CONFIG_COMMANDS([depfiles], + [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], + [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) +]) + +# Do all the work for Automake. -*- Autoconf -*- + +# Copyright (C) 1996-2013 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 macro actually does too much. Some checks are only needed if +# your package does certain things. But this isn't really a big deal. + +dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O. +m4_define([AC_PROG_CC], +m4_defn([AC_PROG_CC]) +[_AM_PROG_CC_C_O +]) + +# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) +# AM_INIT_AUTOMAKE([OPTIONS]) +# ----------------------------------------------- +# The call with PACKAGE and VERSION arguments is the old style +# call (pre autoconf-2.50), which is being phased out. PACKAGE +# and VERSION should now be passed to AC_INIT and removed from +# the call to AM_INIT_AUTOMAKE. +# We support both call styles for the transition. After +# the next Automake release, Autoconf can make the AC_INIT +# arguments mandatory, and then we can depend on a new Autoconf +# release and drop the old call support. +AC_DEFUN([AM_INIT_AUTOMAKE], +[AC_PREREQ([2.65])dnl +dnl Autoconf wants to disallow AM_ names. We explicitly allow +dnl the ones we care about. +m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl +AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl +AC_REQUIRE([AC_PROG_INSTALL])dnl +if test "`cd $srcdir && pwd`" != "`pwd`"; then + # Use -I$(srcdir) only when $(srcdir) != ., so that make's output + # is not polluted with repeated "-I." + AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl + # test to see if srcdir already configured + if test -f $srcdir/config.status; then + AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) + fi +fi + +# test whether we have cygpath +if test -z "$CYGPATH_W"; then + if (cygpath --version) >/dev/null 2>/dev/null; then + CYGPATH_W='cygpath -w' + else + CYGPATH_W=echo + fi +fi +AC_SUBST([CYGPATH_W]) + +# Define the identity of the package. +dnl Distinguish between old-style and new-style calls. +m4_ifval([$2], +[AC_DIAGNOSE([obsolete], + [$0: two- and three-arguments forms are deprecated.]) +m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl + AC_SUBST([PACKAGE], [$1])dnl + AC_SUBST([VERSION], [$2])], +[_AM_SET_OPTIONS([$1])dnl +dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. +m4_if( + m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]), + [ok:ok],, + [m4_fatal([AC_INIT should be called with package and version arguments])])dnl + AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl + AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl + +_AM_IF_OPTION([no-define],, +[AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package]) + AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl + +# Some tools Automake needs. +AC_REQUIRE([AM_SANITY_CHECK])dnl +AC_REQUIRE([AC_ARG_PROGRAM])dnl +AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}]) +AM_MISSING_PROG([AUTOCONF], [autoconf]) +AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}]) +AM_MISSING_PROG([AUTOHEADER], [autoheader]) +AM_MISSING_PROG([MAKEINFO], [makeinfo]) +AC_REQUIRE([AM_PROG_INSTALL_SH])dnl +AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl +AC_REQUIRE([AC_PROG_MKDIR_P])dnl +# For better backward compatibility. To be removed once Automake 1.9.x +# dies out for good. For more background, see: +# +# +AC_SUBST([mkdir_p], ['$(MKDIR_P)']) +# 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_SET_LEADING_DOT])dnl +_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], + [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], + [_AM_PROG_TAR([v7])])]) +_AM_IF_OPTION([no-dependencies],, +[AC_PROVIDE_IFELSE([AC_PROG_CC], + [_AM_DEPENDENCIES([CC])], + [m4_define([AC_PROG_CC], + m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl +AC_PROVIDE_IFELSE([AC_PROG_CXX], + [_AM_DEPENDENCIES([CXX])], + [m4_define([AC_PROG_CXX], + m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl +AC_PROVIDE_IFELSE([AC_PROG_OBJC], + [_AM_DEPENDENCIES([OBJC])], + [m4_define([AC_PROG_OBJC], + m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl +AC_PROVIDE_IFELSE([AC_PROG_OBJCXX], + [_AM_DEPENDENCIES([OBJCXX])], + [m4_define([AC_PROG_OBJCXX], + m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl +]) +AC_REQUIRE([AM_SILENT_RULES])dnl +dnl The testsuite driver may need to know about EXEEXT, so add the +dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This +dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below. +AC_CONFIG_COMMANDS_PRE(dnl +[m4_provide_if([_AM_COMPILER_EXEEXT], + [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl + +# POSIX will say in a future version that running "rm -f" with no argument +# is OK; and we want to be able to make that assumption in our Makefile +# recipes. So use an aggressive probe to check that the usage we want is +# actually supported "in the wild" to an acceptable degree. +# See automake bug#10828. +# To make any issue more visible, cause the running configure to be aborted +# by default if the 'rm' program in use doesn't match our expectations; the +# user can still override this though. +if rm -f && rm -fr && rm -rf; then : OK; else + cat >&2 <<'END' +Oops! + +Your 'rm' program seems unable to run without file operands specified +on the command line, even when the '-f' option is present. This is contrary +to the behaviour of most rm programs out there, and not conforming with +the upcoming POSIX standard: + +Please tell bug-automake@gnu.org about your system, including the value +of your $PATH and any error possibly output before this message. This +can help us improve future automake versions. + +END + if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then + echo 'Configuration will proceed anyway, since you have set the' >&2 + echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 + echo >&2 + else + cat >&2 <<'END' +Aborting the configuration process, to ensure you take notice of the issue. + +You can download and install GNU coreutils to get an 'rm' implementation +that behaves properly: . + +If you want to complete the configuration process using your problematic +'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM +to "yes", and re-run configure. + +END + AC_MSG_ERROR([Your 'rm' program is bad, sorry.]) + fi +fi]) + +dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not +dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further +dnl mangled by Autoconf and run in a shell conditional statement. +m4_define([_AC_COMPILER_EXEEXT], +m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) + +# 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. The stamp files are numbered to have different names. + +# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the +# loop where config.status creates the headers, so we can generate +# our stamp files there. +AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], +[# Compute $1's index in $config_headers. +_am_arg=$1 +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $_am_arg | $_am_arg:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) + +# Copyright (C) 2001-2013 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. + +# AM_PROG_INSTALL_SH +# ------------------ +# Define $install_sh. +AC_DEFUN([AM_PROG_INSTALL_SH], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +if test x"${install_sh}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; + *) + install_sh="\${SHELL} $am_aux_dir/install-sh" + esac +fi +AC_SUBST([install_sh])]) + +# Copyright (C) 2003-2013 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. + +# Check whether the underlying file-system supports filenames +# with a leading dot. For instance MS-DOS doesn't. +AC_DEFUN([AM_SET_LEADING_DOT], +[rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null +AC_SUBST([am__leading_dot])]) + +# Check to see how 'make' treats includes. -*- Autoconf -*- + +# Copyright (C) 2001-2013 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. + +# AM_MAKE_INCLUDE() +# ----------------- +# Check to see how make treats includes. +AC_DEFUN([AM_MAKE_INCLUDE], +[am_make=${MAKE-make} +cat > confinc << 'END' +am__doit: + @echo this is the am__doit target +.PHONY: am__doit +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 +# Ignore all kinds of additional output from 'make'. +case `$am_make -s -f confmf 2> /dev/null` in #( +*the\ am__doit\ target*) + am__include=include + am__quote= + _am_result=GNU + ;; +esac +# Now try BSD make style include. +if test "$am__include" = "#"; then + echo '.include "confinc"' > confmf + case `$am_make -s -f confmf 2> /dev/null` in #( + *the\ am__doit\ target*) + am__include=.include + am__quote="\"" + _am_result=BSD + ;; + esac +fi +AC_SUBST([am__include]) +AC_SUBST([am__quote]) +AC_MSG_RESULT([$_am_result]) +rm -f confinc confmf +]) + +# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- + +# Copyright (C) 1997-2013 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. + +# 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 is modern enough. +# If it is, set am_missing_run to use it, otherwise, to nothing. +AC_DEFUN([AM_MISSING_HAS_RUN], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +AC_REQUIRE_AUX_FILE([missing])dnl +if test x"${MISSING+set}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; + *) + MISSING="\${SHELL} $am_aux_dir/missing" ;; + esac +fi +# Use eval to expand $SHELL +if eval "$MISSING --is-lightweight"; then + am_missing_run="$MISSING " +else + am_missing_run= + AC_MSG_WARN(['missing' script is too old or missing]) +fi +]) + +# Helper functions for option handling. -*- Autoconf -*- + +# Copyright (C) 2001-2013 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. + +# _AM_MANGLE_OPTION(NAME) +# ----------------------- +AC_DEFUN([_AM_MANGLE_OPTION], +[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) + +# _AM_SET_OPTION(NAME) +# -------------------- +# Set option NAME. Presently that only means defining a flag for this option. +AC_DEFUN([_AM_SET_OPTION], +[m4_define(_AM_MANGLE_OPTION([$1]), [1])]) + +# _AM_SET_OPTIONS(OPTIONS) +# ------------------------ +# OPTIONS is a space-separated list of Automake options. +AC_DEFUN([_AM_SET_OPTIONS], +[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) + +# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) +# ------------------------------------------- +# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. +AC_DEFUN([_AM_IF_OPTION], +[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) + +# Copyright (C) 1999-2013 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. + +# _AM_PROG_CC_C_O +# --------------- +# Like AC_PROG_CC_C_O, but changed for automake. We rewrite AC_PROG_CC +# to automatically call this. +AC_DEFUN([_AM_PROG_CC_C_O], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +AC_REQUIRE_AUX_FILE([compile])dnl +AC_LANG_PUSH([C])dnl +AC_CACHE_CHECK( + [whether $CC understands -c and -o together], + [am_cv_prog_cc_c_o], + [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])]) + # Make sure it works both with $CC and with simple cc. + # Following AC_PROG_CC_C_O, we do the test twice because some + # compilers refuse to overwrite an existing .o file with -o, + # though they will create one. + am_cv_prog_cc_c_o=yes + for am_i in 1 2; do + if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \ + && test -f conftest2.$ac_objext; then + : OK + else + am_cv_prog_cc_c_o=no + break + fi + done + rm -f core conftest* + unset am_i]) +if test "$am_cv_prog_cc_c_o" != yes; then + # Losing compiler, so override with the script. + # FIXME: It is wrong to rewrite CC. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__CC in this case, + # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" + CC="$am_aux_dir/compile $CC" +fi +AC_LANG_POP([C])]) + +# For backward compatibility. +AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])]) + +# Copyright (C) 2001-2013 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. + +# AM_RUN_LOG(COMMAND) +# ------------------- +# Run COMMAND, save the exit status in ac_status, and log it. +# (This has been adapted from Autoconf's _AC_RUN_LOG macro.) +AC_DEFUN([AM_RUN_LOG], +[{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD + ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD + (exit $ac_status); }]) + +# Check to make sure that the build environment is sane. -*- Autoconf -*- + +# Copyright (C) 1996-2013 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. + +# AM_SANITY_CHECK +# --------------- +AC_DEFUN([AM_SANITY_CHECK], +[AC_MSG_CHECKING([whether build environment is sane]) +# Reject unsafe characters in $srcdir or the absolute working directory +# name. Accept space and tab only in the latter. +am_lf=' +' +case `pwd` in + *[[\\\"\#\$\&\'\`$am_lf]]*) + AC_MSG_ERROR([unsafe absolute working directory name]);; +esac +case $srcdir in + *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) + AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);; +esac + +# 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 ( + am_has_slept=no + for am_try in 1 2; do + echo "timestamp, slept: $am_has_slept" > conftest.file + 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 + 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 + if test "$[2]" = conftest.file || test $am_try -eq 2; then + break + fi + # Just in case. + sleep 1 + am_has_slept=yes + done + 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]) +# If we didn't sleep, we still need to ensure time stamps of config.status and +# generated files are strictly newer. +am_sleep_pid= +if grep 'slept: no' conftest.file >/dev/null 2>&1; then + ( sleep 1 ) & + am_sleep_pid=$! +fi +AC_CONFIG_COMMANDS_PRE( + [AC_MSG_CHECKING([that generated files are newer than configure]) + if test -n "$am_sleep_pid"; then + # Hide warnings about reused PIDs. + wait $am_sleep_pid 2>/dev/null + fi + AC_MSG_RESULT([done])]) +rm -f conftest.file +]) + +# Copyright (C) 2009-2013 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. + +# AM_SILENT_RULES([DEFAULT]) +# -------------------------- +# Enable less verbose build rules; with the default set to DEFAULT +# ("yes" being less verbose, "no" or empty being verbose). +AC_DEFUN([AM_SILENT_RULES], +[AC_ARG_ENABLE([silent-rules], [dnl +AS_HELP_STRING( + [--enable-silent-rules], + [less verbose build output (undo: "make V=1")]) +AS_HELP_STRING( + [--disable-silent-rules], + [verbose build output (undo: "make V=0")])dnl +]) +case $enable_silent_rules in @%:@ ((( + yes) AM_DEFAULT_VERBOSITY=0;; + no) AM_DEFAULT_VERBOSITY=1;; + *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);; +esac +dnl +dnl A few 'make' implementations (e.g., NonStop OS and NextStep) +dnl do not support nested variable expansions. +dnl See automake bug#9928 and bug#10237. +am_make=${MAKE-make} +AC_CACHE_CHECK([whether $am_make supports nested variables], + [am_cv_make_support_nested_variables], + [if AS_ECHO([['TRUE=$(BAR$(V)) +BAR0=false +BAR1=true +V=1 +am__doit: + @$(TRUE) +.PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then + am_cv_make_support_nested_variables=yes +else + am_cv_make_support_nested_variables=no +fi]) +if test $am_cv_make_support_nested_variables = yes; then + dnl Using '$V' instead of '$(V)' breaks IRIX make. + AM_V='$(V)' + AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' +else + AM_V=$AM_DEFAULT_VERBOSITY + AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY +fi +AC_SUBST([AM_V])dnl +AM_SUBST_NOTMAKE([AM_V])dnl +AC_SUBST([AM_DEFAULT_V])dnl +AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl +AC_SUBST([AM_DEFAULT_VERBOSITY])dnl +AM_BACKSLASH='\' +AC_SUBST([AM_BACKSLASH])dnl +_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl +]) + +# Copyright (C) 2001-2013 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. + +# AM_PROG_INSTALL_STRIP +# --------------------- +# 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 +# Installed binaries are usually stripped using 'strip' when the user +# run "make install-strip". However 'strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the 'STRIP' environment variable to overrule this program. +dnl Don't test for $cross_compiling = yes, because it might be 'maybe'. +if test "$cross_compiling" != no; then + AC_CHECK_TOOL([STRIP], [strip], :) +fi +INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" +AC_SUBST([INSTALL_STRIP_PROGRAM])]) + +# Copyright (C) 2006-2013 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. + +# _AM_SUBST_NOTMAKE(VARIABLE) +# --------------------------- +# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. +# This macro is traced by Automake. +AC_DEFUN([_AM_SUBST_NOTMAKE]) + +# AM_SUBST_NOTMAKE(VARIABLE) +# -------------------------- +# Public sister of _AM_SUBST_NOTMAKE. +AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) + +# Check how to create a tarball. -*- Autoconf -*- + +# Copyright (C) 2004-2013 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. + +# _AM_PROG_TAR(FORMAT) +# -------------------- +# Check how to create a tarball in format FORMAT. +# FORMAT should be one of 'v7', 'ustar', or 'pax'. +# +# Substitute a variable $(am__tar) that is a command +# writing to stdout a FORMAT-tarball containing the directory +# $tardir. +# tardir=directory && $(am__tar) > result.tar +# +# Substitute a variable $(am__untar) that extract such +# a tarball read from stdin. +# $(am__untar) < result.tar +# +AC_DEFUN([_AM_PROG_TAR], +[# Always define AMTAR for backward compatibility. Yes, it's still used +# in the wild :-( We should find a proper way to deprecate it ... +AC_SUBST([AMTAR], ['$${TAR-tar}']) + +# We'll loop over all known methods to create a tar archive until one works. +_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' + +m4_if([$1], [v7], + [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], + + [m4_case([$1], + [ustar], + [# The POSIX 1988 'ustar' format is defined with fixed-size fields. + # There is notably a 21 bits limit for the UID and the GID. In fact, + # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343 + # and bug#13588). + am_max_uid=2097151 # 2^21 - 1 + am_max_gid=$am_max_uid + # The $UID and $GID variables are not portable, so we need to resort + # to the POSIX-mandated id(1) utility. Errors in the 'id' calls + # below are definitely unexpected, so allow the users to see them + # (that is, avoid stderr redirection). + am_uid=`id -u || echo unknown` + am_gid=`id -g || echo unknown` + AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format]) + if test $am_uid -le $am_max_uid; then + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + _am_tools=none + fi + AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format]) + if test $am_gid -le $am_max_gid; then + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + _am_tools=none + fi], + + [pax], + [], + + [m4_fatal([Unknown tar format])]) + + AC_MSG_CHECKING([how to create a $1 tar archive]) + + # Go ahead even if we have the value already cached. We do so because we + # need to set the values for the 'am__tar' and 'am__untar' variables. + _am_tools=${am_cv_prog_tar_$1-$_am_tools} + + for _am_tool in $_am_tools; do + case $_am_tool in + gnutar) + for _am_tar in tar gnutar gtar; do + AM_RUN_LOG([$_am_tar --version]) && break + done + am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' + am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' + am__untar="$_am_tar -xf -" + ;; + plaintar) + # Must skip GNU tar: if it does not support --format= it doesn't create + # ustar tarball either. + (tar --version) >/dev/null 2>&1 && continue + am__tar='tar chf - "$$tardir"' + am__tar_='tar chf - "$tardir"' + am__untar='tar xf -' + ;; + pax) + am__tar='pax -L -x $1 -w "$$tardir"' + am__tar_='pax -L -x $1 -w "$tardir"' + am__untar='pax -r' + ;; + cpio) + am__tar='find "$$tardir" -print | cpio -o -H $1 -L' + am__tar_='find "$tardir" -print | cpio -o -H $1 -L' + am__untar='cpio -i -H $1 -d' + ;; + none) + am__tar=false + am__tar_=false + am__untar=false + ;; + esac + + # If the value was cached, stop now. We just wanted to have am__tar + # and am__untar set. + test -n "${am_cv_prog_tar_$1}" && break + + # tar/untar a dummy directory, and stop if the command works. + rm -rf conftest.dir + mkdir conftest.dir + echo GrepMe > conftest.dir/file + AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) + rm -rf conftest.dir + if test -s conftest.tar; then + AM_RUN_LOG([$am__untar /dev/null 2>&1 && break + fi + done + rm -rf conftest.dir + + AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) + AC_MSG_RESULT([$am_cv_prog_tar_$1])]) + +AC_SUBST([am__tar]) +AC_SUBST([am__untar]) +]) # _AM_PROG_TAR + diff --git a/autom4te.cache/output.0 b/autom4te.cache/output.0 new file mode 100644 index 0000000..35f5a55 --- /dev/null +++ b/autom4te.cache/output.0 @@ -0,0 +1,9524 @@ +@%:@! /bin/sh +@%:@ From configure.ac Revision: 243 . +@%:@ Guess values for system-dependent variables and create Makefiles. +@%:@ Generated by GNU Autoconf 2.69 for nfdump 1.6.13. +@%:@ +@%:@ Report bugs to . +@%:@ +@%:@ +@%:@ Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. +@%:@ +@%:@ +@%:@ This configure script is free software; the Free Software Foundation +@%:@ gives unlimited permission to copy, distribute and modify it. +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in @%:@( + *posix*) : + set -o posix ;; @%:@( + *) : + ;; +esac +fi + + +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in @%:@( + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +as_myself= +case $0 in @%:@(( + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +# Use a proper internal environment variable to ensure we don't fall + # into an infinite loop, continuously re-executing ourselves. + if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then + _as_can_reexec=no; export _as_can_reexec; + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in @%:@ (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed `exec'. +$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +as_fn_exit 255 + fi + # We don't want this to propagate to other subprocesses. + { _as_can_reexec=; unset _as_can_reexec;} +if test "x$CONFIG_SHELL" = x; then + as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which + # is contrary to our usage. Disable this feature. + alias -g '\${1+\"\$@\"}'='\"\$@\"' + setopt NO_GLOB_SUBST +else + case \`(set -o) 2>/dev/null\` in @%:@( + *posix*) : + set -o posix ;; @%:@( + *) : + ;; +esac +fi +" + as_required="as_fn_return () { (exit \$1); } +as_fn_success () { as_fn_return 0; } +as_fn_failure () { as_fn_return 1; } +as_fn_ret_success () { return 0; } +as_fn_ret_failure () { return 1; } + +exitcode=0 +as_fn_success || { exitcode=1; echo as_fn_success failed.; } +as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } +as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } +as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } +if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : + +else + exitcode=1; echo positional parameters were not saved. +fi +test x\$exitcode = x0 || exit 1 +test -x / || exit 1" + as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO + as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO + eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && + test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 +test \$(( 1 + 1 )) = 2 || exit 1" + if (eval "$as_required") 2>/dev/null; then : + as_have_required=yes +else + as_have_required=no +fi + if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : + +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_found=false +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + as_found=: + case $as_dir in @%:@( + /*) + for as_base in sh bash ksh sh5; do + # Try only shells that exist, to save several forks. + as_shell=$as_dir/$as_base + if { test -f "$as_shell" || test -f "$as_shell.exe"; } && + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : + CONFIG_SHELL=$as_shell as_have_required=yes + if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : + break 2 +fi +fi + done;; + esac + as_found=false +done +$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : + CONFIG_SHELL=$SHELL as_have_required=yes +fi; } +IFS=$as_save_IFS + + + if test "x$CONFIG_SHELL" != x; then : + export CONFIG_SHELL + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in @%:@ (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed `exec'. +$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +exit 255 +fi + + if test x$as_have_required = xno; then : + $as_echo "$0: This script requires a shell more modern than all" + $as_echo "$0: the shells that I found on your system." + if test x${ZSH_VERSION+set} = xset ; then + $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" + $as_echo "$0: be upgraded to zsh 4.3.4 or later." + else + $as_echo "$0: Please tell bug-autoconf@gnu.org and +$0: phaag@users.sourceforge.net about your system, +$0: including any error possibly output before this +$0: message. Then install a modern shell, or manually run +$0: the script under such a shell if you do have one." + fi + exit 1 +fi +fi +fi +SHELL=${CONFIG_SHELL-/bin/sh} +export SHELL +# Unset more variables known to interfere with behavior of common tools. +CLICOLOR_FORCE= GREP_OPTIONS= +unset CLICOLOR_FORCE GREP_OPTIONS + +## --------------------- ## +## M4sh Shell Functions. ## +## --------------------- ## +@%:@ as_fn_unset VAR +@%:@ --------------- +@%:@ Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset + +@%:@ as_fn_set_status STATUS +@%:@ ----------------------- +@%:@ Set @S|@? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} @%:@ as_fn_set_status + +@%:@ as_fn_exit STATUS +@%:@ ----------------- +@%:@ Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} @%:@ as_fn_exit + +@%:@ as_fn_mkdir_p +@%:@ ------------- +@%:@ Create "@S|@as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} @%:@ as_fn_mkdir_p + +@%:@ as_fn_executable_p FILE +@%:@ ----------------------- +@%:@ Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} @%:@ as_fn_executable_p +@%:@ as_fn_append VAR VALUE +@%:@ ---------------------- +@%:@ Append the text in VALUE to the end of the definition contained in VAR. Take +@%:@ advantage of any shell optimizations that allow amortized linear growth over +@%:@ repeated appends, instead of the typical quadratic growth present in naive +@%:@ implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +@%:@ as_fn_arith ARG... +@%:@ ------------------ +@%:@ Perform arithmetic evaluation on the ARGs, and store the result in the +@%:@ global @S|@as_val. Take advantage of shells that can avoid forks. The arguments +@%:@ must be portable across @S|@(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + +@%:@ as_fn_error STATUS ERROR [LINENO LOG_FD] +@%:@ ---------------------------------------- +@%:@ Output "`basename @S|@0`: error: ERROR" to stderr. If LINENO and LOG_FD are +@%:@ provided, also output the error to LOG_FD, referencing LINENO. Then exit the +@%:@ script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + $as_echo "$as_me: error: $2" >&2 + as_fn_exit $as_status +} @%:@ as_fn_error + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# 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 + + + as_lineno_1=$LINENO as_lineno_1a=$LINENO + as_lineno_2=$LINENO as_lineno_2a=$LINENO + eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && + test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { + # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) + sed -n ' + p + /[$]LINENO/= + ' <$as_myself | + sed ' + s/[$]LINENO.*/&-/ + t lineno + b + :lineno + N + :loop + s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ + t loop + s/-\n.*// + ' >$as_me.lineno && + chmod +x "$as_me.lineno" || + { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } + + # If we had to re-execute with $CONFIG_SHELL, we're ensured to have + # already done that, so ensure we don't try to do so again and fall + # in an infinite loop. This has already happened in practice. + _as_can_reexec=no; export _as_can_reexec + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensitive to this). + . "./$as_me.lineno" + # Exit status is that of the last command. + exit +} + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in @%:@((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -pR'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -pR' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -pR' + fi +else + as_ln_s='cp -pR' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +as_test_x='test -x' +as_executable_p=as_fn_executable_p + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +test -n "$DJDIR" || exec 7<&0 &1 + +# Name of the host. +# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, +# so uname gets run too. +ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` + +# +# Initializations. +# +ac_default_prefix=/usr/local +ac_clean_files= +ac_config_libobj_dir=. +LIB@&t@OBJS= +cross_compiling=no +subdirs= +MFLAGS= +MAKEFLAGS= + +# Identity of this package. +PACKAGE_NAME='nfdump' +PACKAGE_TARNAME='nfdump' +PACKAGE_VERSION='1.6.13' +PACKAGE_STRING='nfdump 1.6.13' +PACKAGE_BUGREPORT='phaag@users.sourceforge.net' +PACKAGE_URL='' + +# Factoring default headers for most tests. +ac_includes_default="\ +#include +#ifdef HAVE_SYS_TYPES_H +# include +#endif +#ifdef HAVE_SYS_STAT_H +# include +#endif +#ifdef STDC_HEADERS +# include +# include +#else +# ifdef HAVE_STDLIB_H +# include +# endif +#endif +#ifdef HAVE_STRING_H +# if !defined STDC_HEADERS && defined HAVE_MEMORY_H +# include +# endif +# include +#endif +#ifdef HAVE_STRINGS_H +# include +#endif +#ifdef HAVE_INTTYPES_H +# include +#endif +#ifdef HAVE_STDINT_H +# include +#endif +#ifdef HAVE_UNISTD_H +# include +#endif" + +ac_header_list= +ac_func_list= +ac_subst_vars='am__EXEEXT_FALSE +am__EXEEXT_TRUE +LTLIBOBJS +LIB@&t@OBJS +FTS_OBJ +LFLAGS +FT_LDFLAGS +FT_INCLUDES +BUILDNFPCAPD_FALSE +BUILDNFPCAPD_TRUE +READPCAP_FALSE +READPCAP_TRUE +SFLOW_FALSE +SFLOW_TRUE +NFTRACK_FALSE +NFTRACK_TRUE +EGREP +GREP +CPP +RRD_LIBS +NFPROFILE_FALSE +NFPROFILE_TRUE +FT2NFDUMP_FALSE +FT2NFDUMP_TRUE +LEXLIB +LEX_OUTPUT_ROOT +LEX +YFLAGS +YACC +am__fastdepCC_FALSE +am__fastdepCC_TRUE +CCDEPMODE +am__nodep +AMDEPBACKSLASH +AMDEP_FALSE +AMDEP_TRUE +am__quote +am__include +DEPDIR +OBJEXT +EXEEXT +ac_ct_CC +CPPFLAGS +LDFLAGS +CFLAGS +CC +AM_BACKSLASH +AM_DEFAULT_VERBOSITY +AM_DEFAULT_V +AM_V +am__untar +am__tar +AMTAR +am__leading_dot +SET_MAKE +AWK +mkdir_p +MKDIR_P +INSTALL_STRIP_PROGRAM +STRIP +install_sh +MAKEINFO +AUTOHEADER +AUTOMAKE +AUTOCONF +ACLOCAL +VERSION +PACKAGE +CYGPATH_W +am__isrc +INSTALL_DATA +INSTALL_SCRIPT +INSTALL_PROGRAM +target_alias +host_alias +build_alias +LIBS +ECHO_T +ECHO_N +ECHO_C +DEFS +mandir +localedir +libdir +psdir +pdfdir +dvidir +htmldir +infodir +docdir +oldincludedir +includedir +localstatedir +sharedstatedir +sysconfdir +datadir +datarootdir +libexecdir +sbindir +bindir +program_transform_name +prefix +exec_prefix +PACKAGE_URL +PACKAGE_BUGREPORT +PACKAGE_STRING +PACKAGE_VERSION +PACKAGE_TARNAME +PACKAGE_NAME +PATH_SEPARATOR +SHELL' +ac_subst_files='' +ac_user_opts=' +enable_option_checking +enable_silent_rules +enable_dependency_tracking +enable_devel +enable_compat15 +enable_nsel +enable_nel +enable_fixtimebug +with_ftpath +with_rrdpath +enable_ftconv +enable_nfprofile +enable_nftrack +enable_sflow +enable_readpcap +enable_nfpcapd +' + ac_precious_vars='build_alias +host_alias +target_alias +CC +CFLAGS +LDFLAGS +LIBS +CPPFLAGS +YACC +YFLAGS +CPP' + + +# Initialize some variables set by options. +ac_init_help= +ac_init_version=false +ac_unrecognized_opts= +ac_unrecognized_sep= +# 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. +# (The list follows the same order as the GNU Coding Standards.) +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datarootdir='${prefix}/share' +datadir='${datarootdir}' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +includedir='${prefix}/include' +oldincludedir='/usr/include' +docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' +infodir='${datarootdir}/info' +htmldir='${docdir}' +dvidir='${docdir}' +pdfdir='${docdir}' +psdir='${docdir}' +libdir='${exec_prefix}/lib' +localedir='${datarootdir}/locale' +mandir='${datarootdir}/man' + +ac_prev= +ac_dashdash= +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 + + case $ac_option in + *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; + *=) ac_optarg= ;; + *) ac_optarg=yes ;; + esac + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case $ac_dashdash$ac_option in + --) + ac_dashdash=yes ;; + + -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) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=*) + datadir=$ac_optarg ;; + + -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ + | --dataroo | --dataro | --datar) + ac_prev=datarootdir ;; + -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ + | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) + datarootdir=$ac_optarg ;; + + -disable-* | --disable-*) + ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid feature name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=no ;; + + -docdir | --docdir | --docdi | --doc | --do) + ac_prev=docdir ;; + -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) + docdir=$ac_optarg ;; + + -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) + ac_prev=dvidir ;; + -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) + dvidir=$ac_optarg ;; + + -enable-* | --enable-*) + ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid feature name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=\$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 ;; + + -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) + ac_prev=htmldir ;; + -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ + | --ht=*) + htmldir=$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 ;; + + -localedir | --localedir | --localedi | --localed | --locale) + ac_prev=localedir ;; + -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) + localedir=$ac_optarg ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst | --locals) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) + 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 | -n) + 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 ;; + + -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) + ac_prev=pdfdir ;; + -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) + pdfdir=$ac_optarg ;; + + -psdir | --psdir | --psdi | --psd | --ps) + ac_prev=psdir ;; + -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) + psdir=$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_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid package name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=\$ac_optarg ;; + + -without-* | --without-*) + ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid package name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=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 ;; + + -*) as_fn_error $? "unrecognized option: \`$ac_option' +Try \`$0 --help' for more information" + ;; + + *=*) + ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` + # Reject names that are not valid shell variable names. + case $ac_envvar in #( + '' | [0-9]* | *[!_$as_cr_alnum]* ) + as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; + esac + eval $ac_envvar=\$ac_optarg + export $ac_envvar ;; + + *) + # FIXME: should be removed in autoconf 3.0. + $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && + $as_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'` + as_fn_error $? "missing argument to $ac_option" +fi + +if test -n "$ac_unrecognized_opts"; then + case $enable_option_checking in + no) ;; + fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; + *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; + esac +fi + +# Check all directory arguments for consistency. +for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ + datadir sysconfdir sharedstatedir localstatedir includedir \ + oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ + libdir localedir mandir +do + eval ac_val=\$$ac_var + # Remove trailing slashes. + case $ac_val in + */ ) + ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` + eval $ac_var=\$ac_val;; + esac + # Be sure to have absolute directory names. + case $ac_val in + [\\/$]* | ?:[\\/]* ) continue;; + NONE | '' ) case $ac_var in *prefix ) continue;; esac;; + esac + as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" +done + +# There might be people who depend on the old broken behavior: `$host' +# used to hold the argument of --host etc. +# FIXME: To remove some day. +build=$build_alias +host=$host_alias +target=$target_alias + +# FIXME: To remove some day. +if test "x$host_alias" != x; then + if test "x$build_alias" = x; then + cross_compiling=maybe + 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 + + +ac_pwd=`pwd` && test -n "$ac_pwd" && +ac_ls_di=`ls -di .` && +ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || + as_fn_error $? "working directory cannot be determined" +test "X$ac_ls_di" = "X$ac_pwd_ls_di" || + as_fn_error $? "pwd does not report name of working directory" + + +# 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 the parent directory. + ac_confdir=`$as_dirname -- "$as_myself" || +$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_myself" : 'X\(//\)[^/]' \| \ + X"$as_myself" : 'X\(//\)$' \| \ + X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_myself" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + 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 + test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." + as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" +fi +ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" +ac_abs_confdir=`( + cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" + pwd)` +# When building in place, set srcdir=. +if test "$ac_abs_confdir" = "$ac_pwd"; then + srcdir=. +fi +# Remove unnecessary trailing slashes from srcdir. +# Double slashes in file names in object file debugging info +# mess up M-x gdb in Emacs. +case $srcdir in +*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; +esac +for ac_var in $ac_precious_vars; do + eval ac_env_${ac_var}_set=\${${ac_var}+set} + eval ac_env_${ac_var}_value=\$${ac_var} + eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} + eval ac_cv_env_${ac_var}_value=\$${ac_var} +done + +# +# 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 <<_ACEOF +\`configure' configures nfdump 1.6.13 to adapt to many kinds of systems. + +Usage: $0 [OPTION]... [VAR=VALUE]... + +To assign environment variables (e.g., CC, CFLAGS...), specify them as +VAR=VALUE. See below for descriptions of some of the useful variables. + +Defaults for the options are specified in brackets. + +Configuration: + -h, --help display this help and exit + --help=short display options specific to this package + --help=recursive display the short help of all the included packages + -V, --version display version information and exit + -q, --quiet, --silent do not print \`checking ...' messages + --cache-file=FILE cache test results in FILE [disabled] + -C, --config-cache alias for \`--cache-file=config.cache' + -n, --no-create do not create output files + --srcdir=DIR find the sources in DIR [configure dir or \`..'] + +Installation directories: + --prefix=PREFIX install architecture-independent files in PREFIX + @<:@@S|@ac_default_prefix@:>@ + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + @<:@PREFIX@:>@ + +By default, \`make install' will install all the files in +\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify +an installation prefix other than \`$ac_default_prefix' using \`--prefix', +for instance \`--prefix=\$HOME'. + +For better control, use the options below. + +Fine tuning of the installation directories: + --bindir=DIR user executables [EPREFIX/bin] + --sbindir=DIR system admin executables [EPREFIX/sbin] + --libexecdir=DIR program executables [EPREFIX/libexec] + --sysconfdir=DIR read-only single-machine data [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] + --localstatedir=DIR modifiable single-machine data [PREFIX/var] + --libdir=DIR object code libraries [EPREFIX/lib] + --includedir=DIR C header files [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc [/usr/include] + --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] + --datadir=DIR read-only architecture-independent data [DATAROOTDIR] + --infodir=DIR info documentation [DATAROOTDIR/info] + --localedir=DIR locale-dependent data [DATAROOTDIR/locale] + --mandir=DIR man documentation [DATAROOTDIR/man] + --docdir=DIR documentation root @<:@DATAROOTDIR/doc/nfdump@:>@ + --htmldir=DIR html documentation [DOCDIR] + --dvidir=DIR dvi documentation [DOCDIR] + --pdfdir=DIR pdf documentation [DOCDIR] + --psdir=DIR ps documentation [DOCDIR] +_ACEOF + + cat <<\_ACEOF + +Program names: + --program-prefix=PREFIX prepend PREFIX to installed program names + --program-suffix=SUFFIX append SUFFIX to installed program names + --program-transform-name=PROGRAM run sed PROGRAM on installed program names +_ACEOF +fi + +if test -n "$ac_init_help"; then + case $ac_init_help in + short | recursive ) echo "Configuration of nfdump 1.6.13:";; + esac + cat <<\_ACEOF + +Optional Features: + --disable-option-checking ignore unrecognized --enable/--with options + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --enable-silent-rules less verbose build output (undo: "make V=1") + --disable-silent-rules verbose build output (undo: "make V=0") + --enable-dependency-tracking + do not reject slow dependency extractors + --disable-dependency-tracking + speeds up one-time build + --enable-devel compile debug and development code into nfdump; default is NO + --enable-compat15 compile nfdump, to read nfdump data files created with nfdump 1.5.x; default is NO + --enable-nsel compile nfdump, to read and process ASA/NSEL/NEL event data; default is NO + --enable-nel (depricated) compile nfdump, to read and process NAT/NSEL/NEL event data; default is NO + --enable-fixtimebug enable code for swap time bug of some v5 exporters; default is NO + --enable-ftconv Build the flow-tools to nfdump converter; default is NO + --enable-nfprofile Build nfprofile used by NfSen; default is NO + --enable-nftrack Build nftrack used by PortTracker; default is NO + --enable-sflow Build sflow collector sfcpad; default is NO + --enable-readpcap Build nfcapd collector to read from pcap file instead of network data; default is NO + --enable-nfpcapd Build nfpcapd collector to create netflow data from interface or pcap data; default is NO + +Optional Packages: + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --with-ftpath=PATH Expect flow-tool sources in PATH; default /usr/local/flow-tools/ + --with-rrdpath=PATH Expect RRD installed in PATH; default /usr/local + +Some influential environment variables: + CC C compiler command + CFLAGS C compiler flags + LDFLAGS linker flags, e.g. -L if you have libraries in a + nonstandard directory + LIBS libraries to pass to the linker, e.g. -l + CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if + you have headers in a nonstandard directory + YACC The `Yet Another Compiler Compiler' implementation to use. + Defaults to the first program found out of: `bison -y', `byacc', + `yacc'. + YFLAGS The list of arguments that will be passed by default to @S|@YACC. + This script will default YFLAGS to the empty string to avoid a + default value of `-d' given by some make applications. + 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. + +Report bugs to . +_ACEOF +ac_status=$? +fi + +if test "$ac_init_help" = "recursive"; then + # If there are subdirs, report their specific --help. + for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue + test -d "$ac_dir" || + { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || + continue + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + cd "$ac_dir" || { ac_status=$?; continue; } + # Check for guested configure. + if test -f "$ac_srcdir/configure.gnu"; then + echo && + $SHELL "$ac_srcdir/configure.gnu" --help=recursive + elif test -f "$ac_srcdir/configure"; then + echo && + $SHELL "$ac_srcdir/configure" --help=recursive + else + $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + fi || ac_status=$? + cd "$ac_pwd" || { ac_status=$?; break; } + done +fi + +test -n "$ac_init_help" && exit $ac_status +if $ac_init_version; then + cat <<\_ACEOF +nfdump configure 1.6.13 +generated by GNU Autoconf 2.69 + +Copyright (C) 2012 Free Software Foundation, Inc. +This configure script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it. +_ACEOF + exit +fi + +## ------------------------ ## +## Autoconf initialization. ## +## ------------------------ ## + +@%:@ ac_fn_c_try_compile LINENO +@%:@ -------------------------- +@%:@ Try to compile conftest.@S|@ac_ext, and return whether this succeeded. +ac_fn_c_try_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext + if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} @%:@ ac_fn_c_try_compile + +@%:@ ac_fn_c_try_link LINENO +@%:@ ----------------------- +@%:@ Try to link conftest.@S|@ac_ext, and return whether this succeeded. +ac_fn_c_try_link () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext conftest$ac_exeext + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + test -x conftest$ac_exeext + }; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information + # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would + # interfere with the next link command; also delete a directory that is + # left behind by Apple's compiler. We do this before executing the actions. + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} @%:@ ac_fn_c_try_link + +@%:@ ac_fn_c_try_cpp LINENO +@%:@ ---------------------- +@%:@ Try to preprocess conftest.@S|@ac_ext, and return whether this succeeded. +ac_fn_c_try_cpp () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } > conftest.i && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} @%:@ ac_fn_c_try_cpp + +@%:@ ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES +@%:@ ------------------------------------------------------- +@%:@ Tests whether HEADER exists, giving a warning if it cannot be compiled using +@%:@ the include files in INCLUDES and setting the cache variable VAR +@%:@ accordingly. +ac_fn_c_check_header_mongrel () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if eval \${$3+:} false; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +else + # Is the header compilable? +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 +$as_echo_n "checking $2 usability... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +@%:@include <$2> +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_header_compiler=yes +else + ac_header_compiler=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } + +# Is the header present? +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 +$as_echo_n "checking $2 presence... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +@%:@include <$2> +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + ac_header_preproc=yes +else + ac_header_preproc=no +fi +rm -f conftest.err conftest.i conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( + yes:no: ) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} + ;; + no:yes:* ) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} +( $as_echo "## ------------------------------------------ ## +## Report this to phaag@users.sourceforge.net ## +## ------------------------------------------ ##" + ) | sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + eval "$3=\$ac_header_compiler" +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} @%:@ ac_fn_c_check_header_mongrel + +@%:@ ac_fn_c_try_run LINENO +@%:@ ---------------------- +@%:@ Try to link conftest.@S|@ac_ext, and return whether this succeeded. Assumes +@%:@ that executables *can* be run. +ac_fn_c_try_run () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then : + ac_retval=0 +else + $as_echo "$as_me: program exited with status $ac_status" >&5 + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=$ac_status +fi + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} @%:@ ac_fn_c_try_run + +@%:@ ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES +@%:@ ------------------------------------------------------- +@%:@ Tests whether HEADER exists and can be compiled using the include files in +@%:@ INCLUDES, setting the cache variable VAR accordingly. +ac_fn_c_check_header_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +@%:@include <$2> +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + eval "$3=yes" +else + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} @%:@ ac_fn_c_check_header_compile + +@%:@ ac_fn_c_check_member LINENO AGGR MEMBER VAR INCLUDES +@%:@ ---------------------------------------------------- +@%:@ Tries to find if the field MEMBER exists in type AGGR, after including +@%:@ INCLUDES, setting cache variable VAR accordingly. +ac_fn_c_check_member () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2.$3" >&5 +$as_echo_n "checking for $2.$3... " >&6; } +if eval \${$4+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$5 +int +main () +{ +static $2 ac_aggr; +if (ac_aggr.$3) +return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + eval "$4=yes" +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$5 +int +main () +{ +static $2 ac_aggr; +if (sizeof ac_aggr.$3) +return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + eval "$4=yes" +else + eval "$4=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$4 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} @%:@ ac_fn_c_check_member + +@%:@ ac_fn_c_check_func LINENO FUNC VAR +@%:@ ---------------------------------- +@%:@ Tests whether FUNC exists, setting the cache variable VAR accordingly +ac_fn_c_check_func () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Define $2 to an innocuous variant, in case declares $2. + For example, HP-UX 11i declares gettimeofday. */ +#define $2 innocuous_$2 + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $2 (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $2 + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char $2 (); +/* 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_$2 || defined __stub___$2 +choke me +#endif + +int +main () +{ +return $2 (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + eval "$3=yes" +else + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} @%:@ ac_fn_c_check_func + +@%:@ ac_fn_c_compute_int LINENO EXPR VAR INCLUDES +@%:@ -------------------------------------------- +@%:@ Tries to find the compile-time value of EXPR in a program that includes +@%:@ INCLUDES, setting VAR accordingly. Returns whether the value could be +@%:@ computed +ac_fn_c_compute_int () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if test "$cross_compiling" = yes; then + # Depending upon the size, compute the lo and hi bounds. +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +static int test_array @<:@1 - 2 * !(($2) >= 0)@:>@; +test_array @<:@0@:>@ = 0; +return test_array @<:@0@:>@; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_lo=0 ac_mid=0 + while :; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +static int test_array @<:@1 - 2 * !(($2) <= $ac_mid)@:>@; +test_array @<:@0@:>@ = 0; +return test_array @<:@0@:>@; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_hi=$ac_mid; break +else + as_fn_arith $ac_mid + 1 && ac_lo=$as_val + if test $ac_lo -le $ac_mid; then + ac_lo= ac_hi= + break + fi + as_fn_arith 2 '*' $ac_mid + 1 && ac_mid=$as_val +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +static int test_array @<:@1 - 2 * !(($2) < 0)@:>@; +test_array @<:@0@:>@ = 0; +return test_array @<:@0@:>@; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_hi=-1 ac_mid=-1 + while :; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +static int test_array @<:@1 - 2 * !(($2) >= $ac_mid)@:>@; +test_array @<:@0@:>@ = 0; +return test_array @<:@0@:>@; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_lo=$ac_mid; break +else + as_fn_arith '(' $ac_mid ')' - 1 && ac_hi=$as_val + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + as_fn_arith 2 '*' $ac_mid && ac_mid=$as_val +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + ac_lo= ac_hi= +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +# Binary search between lo and hi bounds. +while test "x$ac_lo" != "x$ac_hi"; do + as_fn_arith '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo && ac_mid=$as_val + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +static int test_array @<:@1 - 2 * !(($2) <= $ac_mid)@:>@; +test_array @<:@0@:>@ = 0; +return test_array @<:@0@:>@; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_hi=$ac_mid +else + as_fn_arith '(' $ac_mid ')' + 1 && ac_lo=$as_val +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +done +case $ac_lo in @%:@(( +?*) eval "$3=\$ac_lo"; ac_retval=0 ;; +'') ac_retval=1 ;; +esac + else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +static long int longval () { return $2; } +static unsigned long int ulongval () { return $2; } +@%:@include +@%:@include +int +main () +{ + + FILE *f = fopen ("conftest.val", "w"); + if (! f) + return 1; + if (($2) < 0) + { + long int i = longval (); + if (i != ($2)) + return 1; + fprintf (f, "%ld", i); + } + else + { + unsigned long int i = ulongval (); + if (i != ($2)) + return 1; + fprintf (f, "%lu", i); + } + /* Do not output a trailing newline, as this causes \r\n confusion + on some platforms. */ + return ferror (f) || fclose (f) != 0; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + echo >>conftest.val; read $3 &5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + eval "$3=no" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +if (sizeof ($2)) + return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +if (sizeof (($2))) + return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + +else + eval "$3=yes" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} @%:@ ac_fn_c_check_type +cat >config.log <<_ACEOF +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. + +It was created by nfdump $as_me 1.6.13, which was +generated by GNU Autoconf 2.69. Invocation command line was + + $ $0 $@ + +_ACEOF +exec 5>>config.log +{ +cat <<_ASUNAME +## --------- ## +## Platform. ## +## --------- ## + +hostname = `(hostname || uname -n) 2>/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` +/usr/bin/hostinfo = `(/usr/bin/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` + +_ASUNAME + +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + $as_echo "PATH: $as_dir" + done +IFS=$as_save_IFS + +} >&5 + +cat >&5 <<_ACEOF + + +## ----------- ## +## Core tests. ## +## ----------- ## + +_ACEOF + + +# Keep a trace of the command line. +# Strip out --no-create and --no-recursion so they do not pile up. +# Strip out --silent because we don't want to record it for future runs. +# Also quote any args containing shell meta-characters. +# Make two passes to allow for proper duplicate-argument suppression. +ac_configure_args= +ac_configure_args0= +ac_configure_args1= +ac_must_keep_next=false +for ac_pass in 1 2 +do + for ac_arg + do + case $ac_arg in + -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + continue ;; + *\'*) + ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + case $ac_pass in + 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; + 2) + as_fn_append ac_configure_args1 " '$ac_arg'" + if test $ac_must_keep_next = true; then + ac_must_keep_next=false # Got value, back to normal. + else + case $ac_arg in + *=* | --config-cache | -C | -disable-* | --disable-* \ + | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ + | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ + | -with-* | --with-* | -without-* | --without-* | --x) + case "$ac_configure_args0 " in + "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; + esac + ;; + -* ) ac_must_keep_next=true ;; + esac + fi + as_fn_append ac_configure_args " '$ac_arg'" + ;; + esac + done +done +{ ac_configure_args0=; unset ac_configure_args0;} +{ ac_configure_args1=; unset ac_configure_args1;} + +# 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. +# WARNING: Use '\'' to represent an apostrophe within the trap. +# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. +trap 'exit_status=$? + # Save into config.log some information that might help in debugging. + { + echo + + $as_echo "## ---------------- ## +## Cache variables. ## +## ---------------- ##" + echo + # The following way of writing the cache mishandles newlines in values, +( + for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done + (set) 2>&1 | + case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + sed -n \ + "s/'\''/'\''\\\\'\'''\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" + ;; #( + *) + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) + echo + + $as_echo "## ----------------- ## +## Output variables. ## +## ----------------- ##" + echo + for ac_var in $ac_subst_vars + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + $as_echo "$ac_var='\''$ac_val'\''" + done | sort + echo + + if test -n "$ac_subst_files"; then + $as_echo "## ------------------- ## +## File substitutions. ## +## ------------------- ##" + echo + for ac_var in $ac_subst_files + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + $as_echo "$ac_var='\''$ac_val'\''" + done | sort + echo + fi + + if test -s confdefs.h; then + $as_echo "## ----------- ## +## confdefs.h. ## +## ----------- ##" + echo + cat confdefs.h + echo + fi + test "$ac_signal" != 0 && + $as_echo "$as_me: caught signal $ac_signal" + $as_echo "$as_me: exit $exit_status" + } >&5 + rm -f core *.core core.conftest.* && + rm -f -r conftest* confdefs* conf$$* $ac_clean_files && + exit $exit_status +' 0 +for ac_signal in 1 2 13 15; do + trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal +done +ac_signal=0 + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -f -r conftest* confdefs.h + +$as_echo "/* confdefs.h */" > confdefs.h + +# Predefined preprocessor variables. + +cat >>confdefs.h <<_ACEOF +@%:@define PACKAGE_NAME "$PACKAGE_NAME" +_ACEOF + +cat >>confdefs.h <<_ACEOF +@%:@define PACKAGE_TARNAME "$PACKAGE_TARNAME" +_ACEOF + +cat >>confdefs.h <<_ACEOF +@%:@define PACKAGE_VERSION "$PACKAGE_VERSION" +_ACEOF + +cat >>confdefs.h <<_ACEOF +@%:@define PACKAGE_STRING "$PACKAGE_STRING" +_ACEOF + +cat >>confdefs.h <<_ACEOF +@%:@define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" +_ACEOF + +cat >>confdefs.h <<_ACEOF +@%:@define PACKAGE_URL "$PACKAGE_URL" +_ACEOF + + +# Let the site file select an alternate cache file if it wants to. +# Prefer an explicitly selected file to automatically selected ones. +ac_site_file1=NONE +ac_site_file2=NONE +if test -n "$CONFIG_SITE"; then + # We do not want a PATH search for config.site. + case $CONFIG_SITE in @%:@(( + -*) ac_site_file1=./$CONFIG_SITE;; + */*) ac_site_file1=$CONFIG_SITE;; + *) ac_site_file1=./$CONFIG_SITE;; + esac +elif test "x$prefix" != xNONE; then + ac_site_file1=$prefix/share/config.site + ac_site_file2=$prefix/etc/config.site +else + ac_site_file1=$ac_default_prefix/share/config.site + ac_site_file2=$ac_default_prefix/etc/config.site +fi +for ac_site_file in "$ac_site_file1" "$ac_site_file2" +do + test "x$ac_site_file" = xNONE && continue + if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 +$as_echo "$as_me: loading site script $ac_site_file" >&6;} + sed 's/^/| /' "$ac_site_file" >&5 + . "$ac_site_file" \ + || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "failed to load site script $ac_site_file +See \`config.log' for more details" "$LINENO" 5; } + 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. DJGPP emulates it as a regular file. + if test /dev/null != "$cache_file" && test -f "$cache_file"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 +$as_echo "$as_me: loading cache $cache_file" >&6;} + case $cache_file in + [\\/]* | ?:[\\/]* ) . "$cache_file";; + *) . "./$cache_file";; + esac + fi +else + { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 +$as_echo "$as_me: creating cache $cache_file" >&6;} + >$cache_file +fi + +as_fn_append ac_header_list " sys/time.h" +as_fn_append ac_header_list " unistd.h" +as_fn_append ac_func_list " alarm" +# Check that the precious variables saved in the cache have kept the same +# value. +ac_cache_corrupted=false +for ac_var in $ac_precious_vars; 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,) + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,set) + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 +$as_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 + # differences in whitespace do not lead to failure. + ac_old_val_w=`echo x $ac_old_val` + ac_new_val_w=`echo x $ac_new_val` + if test "$ac_old_val_w" != "$ac_new_val_w"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 +$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + ac_cache_corrupted=: + else + { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 +$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} + eval $ac_var=\$ac_old_val + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 +$as_echo "$as_me: former value: \`$ac_old_val'" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 +$as_echo "$as_me: current value: \`$ac_new_val'" >&2;} + fi;; + esac + # Pass precious variables to config.status. + if test "$ac_new_set" = set; then + case $ac_new_val in + *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *) ac_arg=$ac_var=$ac_new_val ;; + esac + case " $ac_configure_args " in + *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. + *) as_fn_append ac_configure_args " '$ac_arg'" ;; + esac + fi +done +if $ac_cache_corrupted; then + { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 +$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} + as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 +fi +## -------------------- ## +## Main body of script. ## +## -------------------- ## + +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 + + +# $Date: 2014-11-16 14:10:20 +0100 (Sun, 16 Nov 2014) $ +#AC_CONFIG_SRCDIR([grammar.y]) +ac_config_headers="$ac_config_headers config.h" + +am__api_version='1.14' + +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 + as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 +fi + +# These three variables are undocumented and unsupported, +# and are intended to be withdrawn in a future Autoconf release. +# They can cause serious problems if a builder's source tree is in a directory +# whose full name contains unusual characters. +ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. +ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. +ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. + + +# 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" +# OS/2's system install, which has a completely different semantic +# ./install, which can be erroneously created by make from ./install.sh. +# Reject install programs that cannot install multiple files. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 +$as_echo_n "checking for a BSD-compatible install... " >&6; } +if test -z "$INSTALL"; then +if ${ac_cv_path_install+:} false; then : + $as_echo_n "(cached) " >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + # Account for people who put trailing slashes in PATH elements. +case $as_dir/ in @%:@(( + ./ | .// | /[cC]/* | \ + /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ + ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ + /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 + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then + if test $ac_prog = install && + grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + elif test $ac_prog = install && + grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # program-specific install script used by HP pwplus--don't use. + : + else + rm -rf conftest.one conftest.two conftest.dir + echo one > conftest.one + echo two > conftest.two + mkdir conftest.dir + if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && + test -s conftest.one && test -s conftest.two && + test -s conftest.dir/conftest.one && + test -s conftest.dir/conftest.two + then + ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + break 3 + fi + fi + fi + done + done + ;; +esac + + done +IFS=$as_save_IFS + +rm -rf conftest.one conftest.two conftest.dir + +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. Don't cache a + # value for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + INSTALL=$ac_install_sh + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 +$as_echo "$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' + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 +$as_echo_n "checking whether build environment is sane... " >&6; } +# Reject unsafe characters in $srcdir or the absolute working directory +# name. Accept space and tab only in the latter. +am_lf=' +' +case `pwd` in + *[\\\"\#\$\&\'\`$am_lf]*) + as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; +esac +case $srcdir in + *[\\\"\#\$\&\'\`$am_lf\ \ ]*) + as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;; +esac + +# 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 ( + am_has_slept=no + for am_try in 1 2; do + echo "timestamp, slept: $am_has_slept" > conftest.file + 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 + 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". + as_fn_error $? "ls -t appears to fail. Make sure there is not a broken + alias in your environment" "$LINENO" 5 + fi + if test "$2" = conftest.file || test $am_try -eq 2; then + break + fi + # Just in case. + sleep 1 + am_has_slept=yes + done + test "$2" = conftest.file + ) +then + # Ok. + : +else + as_fn_error $? "newly created file is older than distributed files! +Check your system clock" "$LINENO" 5 +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +# If we didn't sleep, we still need to ensure time stamps of config.status and +# generated files are strictly newer. +am_sleep_pid= +if grep 'slept: no' conftest.file >/dev/null 2>&1; then + ( sleep 1 ) & + am_sleep_pid=$! +fi + +rm -f conftest.file + +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 $. +# By default was `s,x,x', remove it if useless. +ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' +program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` + +# expand $ac_aux_dir to an absolute path +am_aux_dir=`cd $ac_aux_dir && pwd` + +if test x"${MISSING+set}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; + *) + MISSING="\${SHELL} $am_aux_dir/missing" ;; + esac +fi +# Use eval to expand $SHELL +if eval "$MISSING --is-lightweight"; then + am_missing_run="$MISSING " +else + am_missing_run= + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5 +$as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;} +fi + +if test x"${install_sh}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; + *) + install_sh="\${SHELL} $am_aux_dir/install-sh" + esac +fi + +# Installed binaries are usually stripped using 'strip' when the user +# run "make install-strip". However 'strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the 'STRIP' environment variable to overrule this program. +if test "$cross_compiling" != no; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. +set dummy ${ac_tool_prefix}strip; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_STRIP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$STRIP"; then + ac_cv_prog_STRIP="$STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_STRIP="${ac_tool_prefix}strip" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +STRIP=$ac_cv_prog_STRIP +if test -n "$STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 +$as_echo "$STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_STRIP"; then + ac_ct_STRIP=$STRIP + # Extract the first word of "strip", so it can be a program name with args. +set dummy strip; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_STRIP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_STRIP"; then + ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_STRIP="strip" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP +if test -n "$ac_ct_STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 +$as_echo "$ac_ct_STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_STRIP" = x; then + STRIP=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + STRIP=$ac_ct_STRIP + fi +else + STRIP="$ac_cv_prog_STRIP" +fi + +fi +INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 +$as_echo_n "checking for a thread-safe mkdir -p... " >&6; } +if test -z "$MKDIR_P"; then + if ${ac_cv_path_mkdir+:} false; then : + $as_echo_n "(cached) " >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in mkdir gmkdir; do + for ac_exec_ext in '' $ac_executable_extensions; do + as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue + case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( + 'mkdir (GNU coreutils) '* | \ + 'mkdir (coreutils) '* | \ + 'mkdir (fileutils) '4.1*) + ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext + break 3;; + esac + done + done + done +IFS=$as_save_IFS + +fi + + test -d ./--version && rmdir ./--version + if test "${ac_cv_path_mkdir+set}" = set; then + MKDIR_P="$ac_cv_path_mkdir -p" + else + # As a last resort, use the slow shell script. Don't cache a + # value for MKDIR_P within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + MKDIR_P="$ac_install_sh -d" + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 +$as_echo "$MKDIR_P" >&6; } + +for ac_prog in gawk mawk 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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_AWK+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$AWK"; then + ac_cv_prog_AWK="$AWK" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_AWK="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +AWK=$ac_cv_prog_AWK +if test -n "$AWK"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 +$as_echo "$AWK" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$AWK" && break +done + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } +set x ${MAKE-make} +ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` +if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat >conftest.make <<\_ACEOF +SHELL = /bin/sh +all: + @echo '@@@%%%=$(MAKE)=@@@%%%' +_ACEOF +# GNU make sometimes prints "make[1]: Entering ...", which would confuse us. +case `${MAKE-make} -f conftest.make 2>/dev/null` in + *@@@%%%=?*=@@@%%%*) + eval ac_cv_prog_make_${ac_make}_set=yes;; + *) + eval ac_cv_prog_make_${ac_make}_set=no;; +esac +rm -f conftest.make +fi +if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + SET_MAKE= +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + SET_MAKE="MAKE=${MAKE-make}" +fi + +rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null + +@%:@ Check whether --enable-silent-rules was given. +if test "${enable_silent_rules+set}" = set; then : + enableval=$enable_silent_rules; +fi + +case $enable_silent_rules in @%:@ ((( + yes) AM_DEFAULT_VERBOSITY=0;; + no) AM_DEFAULT_VERBOSITY=1;; + *) AM_DEFAULT_VERBOSITY=1;; +esac +am_make=${MAKE-make} +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 +$as_echo_n "checking whether $am_make supports nested variables... " >&6; } +if ${am_cv_make_support_nested_variables+:} false; then : + $as_echo_n "(cached) " >&6 +else + if $as_echo 'TRUE=$(BAR$(V)) +BAR0=false +BAR1=true +V=1 +am__doit: + @$(TRUE) +.PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then + am_cv_make_support_nested_variables=yes +else + am_cv_make_support_nested_variables=no +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 +$as_echo "$am_cv_make_support_nested_variables" >&6; } +if test $am_cv_make_support_nested_variables = yes; then + AM_V='$(V)' + AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' +else + AM_V=$AM_DEFAULT_VERBOSITY + AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY +fi +AM_BACKSLASH='\' + +if test "`cd $srcdir && pwd`" != "`pwd`"; then + # Use -I$(srcdir) only when $(srcdir) != ., so that make's output + # is not polluted with repeated "-I." + am__isrc=' -I$(srcdir)' + # test to see if srcdir already configured + if test -f $srcdir/config.status; then + as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 + fi +fi + +# test whether we have cygpath +if test -z "$CYGPATH_W"; then + if (cygpath --version) >/dev/null 2>/dev/null; then + CYGPATH_W='cygpath -w' + else + CYGPATH_W=echo + fi +fi + + +# Define the identity of the package. + PACKAGE='nfdump' + VERSION='1.6.13' + + +cat >>confdefs.h <<_ACEOF +@%:@define PACKAGE "$PACKAGE" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +@%:@define VERSION "$VERSION" +_ACEOF + +# Some tools Automake needs. + +ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} + + +AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} + + +AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} + + +AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} + + +MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} + +# For better backward compatibility. To be removed once Automake 1.9.x +# dies out for good. For more background, see: +# +# +mkdir_p='$(MKDIR_P)' + +# We need awk for the "check" target. The system "awk" is bad on +# some platforms. +# Always define AMTAR for backward compatibility. Yes, it's still used +# in the wild :-( We should find a proper way to deprecate it ... +AMTAR='$${TAR-tar}' + + +# We'll loop over all known methods to create a tar archive until one works. +_am_tools='gnutar pax cpio none' + +am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' + + + + + + +# POSIX will say in a future version that running "rm -f" with no argument +# is OK; and we want to be able to make that assumption in our Makefile +# recipes. So use an aggressive probe to check that the usage we want is +# actually supported "in the wild" to an acceptable degree. +# See automake bug#10828. +# To make any issue more visible, cause the running configure to be aborted +# by default if the 'rm' program in use doesn't match our expectations; the +# user can still override this though. +if rm -f && rm -fr && rm -rf; then : OK; else + cat >&2 <<'END' +Oops! + +Your 'rm' program seems unable to run without file operands specified +on the command line, even when the '-f' option is present. This is contrary +to the behaviour of most rm programs out there, and not conforming with +the upcoming POSIX standard: + +Please tell bug-automake@gnu.org about your system, including the value +of your $PATH and any error possibly output before this message. This +can help us improve future automake versions. + +END + if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then + echo 'Configuration will proceed anyway, since you have set the' >&2 + echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 + echo >&2 + else + cat >&2 <<'END' +Aborting the configuration process, to ensure you take notice of the issue. + +You can download and install GNU coreutils to get an 'rm' implementation +that behaves properly: . + +If you want to complete the configuration process using your problematic +'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM +to "yes", and re-run configure. + +END + as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5 + fi +fi + +# Checks for programs. +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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}gcc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_CC+:} false; then : + $as_echo_n "(cached) " >&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 +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="gcc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}cc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + 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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_prog_rejected=no +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +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 + ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" + fi +fi +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl.exe + 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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$CC" && break + done +fi +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in cl.exe +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_CC+:} false; then : + $as_echo_n "(cached) " >&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 +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_CC" && break +done + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +fi + +fi + + +test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "no acceptable C compiler found in \$PATH +See \`config.log' for more details" "$LINENO" 5; } + +# Provide some information about the compiler. +$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 +set X $ac_compile +ac_compiler=$2 +for ac_option in --version -v -V -qversion; do + { { ac_try="$ac_compiler $ac_option >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compiler $ac_option >&5") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + sed '10a\ +... rest of stderr output deleted ... + 10q' conftest.err >conftest.er1 + cat conftest.er1 >&5 + fi + rm -f conftest.er1 conftest.err + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +done + +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" +# 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. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 +$as_echo_n "checking whether the C compiler works... " >&6; } +ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` + +# The possible output files: +ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" + +ac_rmfiles= +for ac_file in $ac_files +do + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + * ) ac_rmfiles="$ac_rmfiles $ac_file";; + esac +done +rm -f $ac_rmfiles + +if { { ac_try="$ac_link_default" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link_default") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. +# So ignore a value of `no', otherwise this would lead to `EXEEXT = no' +# in a Makefile. We should not override ac_cv_exeext if it was cached, +# so that the user can short-circuit this test for compilers unknown to +# Autoconf. +for ac_file in $ac_files '' +do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) + ;; + [ab].out ) + # We found the default executable, but exeext='' is most + # certainly right. + break;; + *.* ) + if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; + then :; else + ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + fi + # We set ac_cv_exeext here because the later test for it is not + # safe: cross compilers may not add the suffix if given an `-o' + # argument, so we may need to know it at that point already. + # Even if this section looks crufty: it has the advantage of + # actually working. + break;; + * ) + break;; + esac +done +test "$ac_cv_exeext" = no && ac_cv_exeext= + +else + ac_file='' +fi +if test -z "$ac_file"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +$as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "C compiler cannot create executables +See \`config.log' for more details" "$LINENO" 5; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 +$as_echo_n "checking for C compiler default output file name... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 +$as_echo "$ac_file" >&6; } +ac_exeext=$ac_cv_exeext + +rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out +ac_clean_files=$ac_clean_files_save +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 +$as_echo_n "checking for suffix of executables... " >&6; } +if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; 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 conftest.exe conftest conftest.*; do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + break;; + * ) break;; + esac +done +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details" "$LINENO" 5; } +fi +rm -f conftest conftest$ac_cv_exeext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 +$as_echo "$ac_cv_exeext" >&6; } + +rm -f conftest.$ac_ext +EXEEXT=$ac_cv_exeext +ac_exeext=$EXEEXT +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +@%:@include +int +main () +{ +FILE *f = fopen ("conftest.out", "w"); + return ferror (f) || fclose (f) != 0; + + ; + return 0; +} +_ACEOF +ac_clean_files="$ac_clean_files conftest.out" +# Check that the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 +$as_echo_n "checking whether we are cross compiling... " >&6; } +if test "$cross_compiling" != yes; then + { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if { ac_try='./conftest$ac_cv_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then + cross_compiling=no + else + if test "$cross_compiling" = maybe; then + cross_compiling=yes + else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot run C compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details" "$LINENO" 5; } + fi + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 +$as_echo "$cross_compiling" >&6; } + +rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out +ac_clean_files=$ac_clean_files_save +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 +$as_echo_n "checking for suffix of object files... " >&6; } +if ${ac_cv_objext+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.o conftest.obj +if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + for ac_file in conftest.o conftest.obj conftest.*; do + test -f "$ac_file" || continue; + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; + *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` + break;; + esac +done +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot compute suffix of object files: cannot compile +See \`config.log' for more details" "$LINENO" 5; } +fi +rm -f conftest.$ac_cv_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 +$as_echo "$ac_cv_objext" >&6; } +OBJEXT=$ac_cv_objext +ac_objext=$OBJEXT +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 +$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } +if ${ac_cv_c_compiler_gnu+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_compiler_gnu=yes +else + ac_compiler_gnu=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_c_compiler_gnu=$ac_compiler_gnu + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 +$as_echo "$ac_cv_c_compiler_gnu" >&6; } +if test $ac_compiler_gnu = yes; then + GCC=yes +else + GCC= +fi +ac_test_CFLAGS=${CFLAGS+set} +ac_save_CFLAGS=$CFLAGS +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 +$as_echo_n "checking whether $CC accepts -g... " >&6; } +if ${ac_cv_prog_cc_g+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_save_c_werror_flag=$ac_c_werror_flag + ac_c_werror_flag=yes + ac_cv_prog_cc_g=no + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_g=yes +else + CFLAGS="" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + +else + ac_c_werror_flag=$ac_save_c_werror_flag + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_g=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_c_werror_flag=$ac_save_c_werror_flag +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 +$as_echo "$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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 +$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } +if ${ac_cv_prog_cc_c89+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_prog_cc_c89=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +struct stat; +/* 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; +} + +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not '\xHH' hex character constants. + These don't provoke an error unfortunately, instead are silently treated + as 'x'. The following induces an error, until -std is added to get + proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an + array size at least. It's necessary to write '\x00'==0 to get something + that's true only with -std. */ +int osf4_cc_array ['\x00' == 0 ? 1 : -1]; + +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) 'x' +int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; + +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 +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ + -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_c89=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext + test "x$ac_cv_prog_cc_c89" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC + +fi +# AC_CACHE_VAL +case "x$ac_cv_prog_cc_c89" in + x) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +$as_echo "none needed" >&6; } ;; + xno) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +$as_echo "unsupported" >&6; } ;; + *) + CC="$CC $ac_cv_prog_cc_c89" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 +$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; +esac +if test "x$ac_cv_prog_cc_c89" != xno; then : + +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 + +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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 +$as_echo_n "checking whether $CC understands -c and -o together... " >&6; } +if ${am_cv_prog_cc_c_o+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF + # Make sure it works both with $CC and with simple cc. + # Following AC_PROG_CC_C_O, we do the test twice because some + # compilers refuse to overwrite an existing .o file with -o, + # though they will create one. + am_cv_prog_cc_c_o=yes + for am_i in 1 2; do + if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 + ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } \ + && test -f conftest2.$ac_objext; then + : OK + else + am_cv_prog_cc_c_o=no + break + fi + done + rm -f core conftest* + unset am_i +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 +$as_echo "$am_cv_prog_cc_c_o" >&6; } +if test "$am_cv_prog_cc_c_o" != yes; then + # Losing compiler, so override with the script. + # FIXME: It is wrong to rewrite CC. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__CC in this case, + # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" + CC="$am_aux_dir/compile $CC" +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 + +DEPDIR="${am__leading_dot}deps" + +ac_config_commands="$ac_config_commands depfiles" + + +am_make=${MAKE-make} +cat > confinc << 'END' +am__doit: + @echo this is the am__doit target +.PHONY: am__doit +END +# If we don't find an include directive, just comment out the code. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5 +$as_echo_n "checking for style of include used by $am_make... " >&6; } +am__include="#" +am__quote= +_am_result=none +# First try GNU make style include. +echo "include confinc" > confmf +# Ignore all kinds of additional output from 'make'. +case `$am_make -s -f confmf 2> /dev/null` in #( +*the\ am__doit\ target*) + am__include=include + am__quote= + _am_result=GNU + ;; +esac +# Now try BSD make style include. +if test "$am__include" = "#"; then + echo '.include "confinc"' > confmf + case `$am_make -s -f confmf 2> /dev/null` in #( + *the\ am__doit\ target*) + am__include=.include + am__quote="\"" + _am_result=BSD + ;; + esac +fi + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5 +$as_echo "$_am_result" >&6; } +rm -f confinc confmf + +@%:@ Check whether --enable-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='\' + am__nodep='_no' +fi + if test "x$enable_dependency_tracking" != xno; then + AMDEP_TRUE= + AMDEP_FALSE='#' +else + AMDEP_TRUE='#' + AMDEP_FALSE= +fi + + + +depcc="$CC" am_compiler_list= + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 +$as_echo_n "checking dependency style of $depcc... " >&6; } +if ${am_cv_CC_dependencies_compiler_type+:} false; then : + $as_echo_n "(cached) " >&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". + rm -rf conftest.dir + 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 + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + 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 + am__universal=false + case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac + + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # 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. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with + # Solaris 10 /bin/sh. + echo '/* dummy */' > sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + # 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. Also, some Intel + # versions had trouble with output in subdirs. + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; + 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 + ;; + msvc7 | msvc7msys | msvisualcpp | msvcmsys) + # This compiler won't grok '-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; + none) break ;; + esac + if depmode=$depmode \ + source=sub/conftest.c object=$am__obj \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_CC_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_CC_dependencies_compiler_type=none +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 +$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } +CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type + + if + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then + am__fastdepCC_TRUE= + am__fastdepCC_FALSE='#' +else + am__fastdepCC_TRUE='#' + am__fastdepCC_FALSE= +fi + + + + +CFLAGS="${CFLAGS=}" +if test $ac_cv_c_compiler_gnu = yes -a "x$CFLAGS" = "x-g -O2"; then + CFLAGS="-g -O2 -Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wmissing-noreturn -fno-strict-aliasing" +fi + +@%:@ Check whether --enable-devel was given. +if test "${enable_devel+set}" = set; then : + enableval=$enable_devel; +fi + + +# Which way is better? +if test "${enable_devel}" = "yes" ; then + CFLAGS="$CFLAGS -DDEVEL" +cat >>config.h <<_ACEOF +#define dbg_printf(...) printf(__VA_ARGS__) +_ACEOF +else +cat >>config.h <<_ACEOF +#define dbg_printf(...) /* printf(__VA_ARGS__) */ +_ACEOF +fi + +@%:@ Check whether --enable-compat15 was given. +if test "${enable_compat15+set}" = set; then : + enableval=$enable_compat15; +fi + + +if test "${enable_compat15}" = "yes" ; then + CFLAGS="$CFLAGS -DCOMPAT15" +fi + +@%:@ Check whether --enable-nsel was given. +if test "${enable_nsel+set}" = set; then : + enableval=$enable_nsel; +fi + + +if test "${enable_nsel}" = "yes" ; then + CFLAGS="$CFLAGS -DNSEL" +fi + +@%:@ Check whether --enable-nel was given. +if test "${enable_nel+set}" = set; then : + enableval=$enable_nel; +fi + + +if test "${enable_nel}" = "yes" ; then + CFLAGS="$CFLAGS -DNSEL" +fi + +@%:@ Check whether --enable-fixtimebug was given. +if test "${enable_fixtimebug+set}" = set; then : + enableval=$enable_fixtimebug; +fi + + +if test "${enable_fixtimebug}" = "yes" ; then + CFLAGS="$CFLAGS -DFIXTIMEBUG" +fi + +for ac_prog in 'bison -y' byacc +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_YACC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$YACC"; then + ac_cv_prog_YACC="$YACC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_YACC="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +YACC=$ac_cv_prog_YACC +if test -n "$YACC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $YACC" >&5 +$as_echo "$YACC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$YACC" && break +done +test -n "$YACC" || YACC="yacc" + + +for ac_prog in flex lex +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_LEX+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$LEX"; then + ac_cv_prog_LEX="$LEX" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_LEX="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +LEX=$ac_cv_prog_LEX +if test -n "$LEX"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LEX" >&5 +$as_echo "$LEX" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$LEX" && break +done +test -n "$LEX" || LEX=":" + +if test "x$LEX" != "x:"; then + cat >conftest.l <<_ACEOF +%% +a { ECHO; } +b { REJECT; } +c { yymore (); } +d { yyless (1); } +e { /* IRIX 6.5 flex 2.5.4 underquotes its yyless argument. */ + yyless ((input () != 0)); } +f { unput (yytext[0]); } +. { BEGIN INITIAL; } +%% +#ifdef YYTEXT_POINTER +extern char *yytext; +#endif +int +main (void) +{ + return ! yylex () + ! yywrap (); +} +_ACEOF +{ { ac_try="$LEX conftest.l" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$LEX conftest.l") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking lex output file root" >&5 +$as_echo_n "checking lex output file root... " >&6; } +if ${ac_cv_prog_lex_root+:} false; then : + $as_echo_n "(cached) " >&6 +else + +if test -f lex.yy.c; then + ac_cv_prog_lex_root=lex.yy +elif test -f lexyy.c; then + ac_cv_prog_lex_root=lexyy +else + as_fn_error $? "cannot find output from $LEX; giving up" "$LINENO" 5 +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_lex_root" >&5 +$as_echo "$ac_cv_prog_lex_root" >&6; } +LEX_OUTPUT_ROOT=$ac_cv_prog_lex_root + +if test -z "${LEXLIB+set}"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking lex library" >&5 +$as_echo_n "checking lex library... " >&6; } +if ${ac_cv_lib_lex+:} false; then : + $as_echo_n "(cached) " >&6 +else + + ac_save_LIBS=$LIBS + ac_cv_lib_lex='none needed' + for ac_lib in '' -lfl -ll; do + LIBS="$ac_lib $ac_save_LIBS" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +`cat $LEX_OUTPUT_ROOT.c` +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_lex=$ac_lib +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + test "$ac_cv_lib_lex" != 'none needed' && break + done + LIBS=$ac_save_LIBS + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_lex" >&5 +$as_echo "$ac_cv_lib_lex" >&6; } + test "$ac_cv_lib_lex" != 'none needed' && LEXLIB=$ac_cv_lib_lex +fi + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether yytext is a pointer" >&5 +$as_echo_n "checking whether yytext is a pointer... " >&6; } +if ${ac_cv_prog_lex_yytext_pointer+:} false; then : + $as_echo_n "(cached) " >&6 +else + # POSIX says lex can declare yytext either as a pointer or an array; the +# default is implementation-dependent. Figure out which it is, since +# not all implementations provide the %pointer and %array declarations. +ac_cv_prog_lex_yytext_pointer=no +ac_save_LIBS=$LIBS +LIBS="$LEXLIB $ac_save_LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #define YYTEXT_POINTER 1 +`cat $LEX_OUTPUT_ROOT.c` +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_prog_lex_yytext_pointer=yes +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_save_LIBS + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_lex_yytext_pointer" >&5 +$as_echo "$ac_cv_prog_lex_yytext_pointer" >&6; } +if test $ac_cv_prog_lex_yytext_pointer = yes; then + +$as_echo "@%:@define YYTEXT_POINTER 1" >>confdefs.h + +fi +rm -f conftest.l $LEX_OUTPUT_ROOT.c + +fi +which $LEX > /dev/null 2>&1 +if test $? = 1; then + as_fn_error $? "No lex or flex found on system" "$LINENO" 5 +fi + + +if test "x$ac_cv_prog_LEX" = "xflex"; then + LFLAGS=-i +fi + +# Check if we need to build the flow-tools converter +# FIXME? This should use flow-tools-dev if possible, not local sources.. + +@%:@ Check whether --with-ftpath was given. +if test "${with_ftpath+set}" = set; then : + withval=$with_ftpath; if test "x$with_ftpath" = "xyes" ; then + WHERE_FTPATH="/usr/local/flow-tools/" +else + WHERE_FTPATH=$with_ftpath +fi + +else + WHERE_FTPATH="/usr/local/flow-tools/" + +fi + + + +@%:@ Check whether --with-rrdpath was given. +if test "${with_rrdpath+set}" = set; then : + withval=$with_rrdpath; if test "x$with_rrdpath" = "xyes" ; then + CPPFLAGS="${CPPFLAGS} -I/usr/local/include" + LDFLAGS="${LDFLAGS} -L/usr/local/lib" +else + CPPFLAGS="${CPPFLAGS} -I${with_rrdpath}/include" + LDFLAGS="${LDFLAGS} -L${with_rrdpath}/lib" +fi + +fi + + +#Tidz up? esp not using in source dist flow-tools +@%:@ Check whether --enable-ftconv was given. +if test "${enable_ftconv+set}" = set; then : + enableval=$enable_ftconv; { $as_echo "$as_me:${as_lineno-$LINENO}: checking for zlibVersion in -lz" >&5 +$as_echo_n "checking for zlibVersion in -lz... " >&6; } +if ${ac_cv_lib_z_zlibVersion+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lz $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char zlibVersion (); +int +main () +{ +return zlibVersion (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_z_zlibVersion=yes +else + ac_cv_lib_z_zlibVersion=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_z_zlibVersion" >&5 +$as_echo "$ac_cv_lib_z_zlibVersion" >&6; } +if test "x$ac_cv_lib_z_zlibVersion" = xyes; then : + cat >>confdefs.h <<_ACEOF +@%:@define HAVE_LIBZ 1 +_ACEOF + + LIBS="-lz $LIBS" + +else + as_fn_error $? "Link with \"-lz\" failed! (Need zlib >= 1.0.2)" "$LINENO" 5 + +fi + +if test -d "$WHERE_FTPATH"; then + if test ! -f "$WHERE_FTPATH/include/ftlib.h"; then + as_fn_error $? "ftlib.h file not found in flow-tools directory '$WHERE_FTPATH'. Use --with-ftpath=PATH" "$LINENO" 5 + fi + if test ! -f "$WHERE_FTPATH/lib/libft.a"; then + as_fn_error $? "libft.a not found in flow-tools directory '$WHERE_FTPATH'. Build flow tools first" "$LINENO" 5 + fi + FT_INCLUDES="-I$WHERE_FTPATH/include -I$WHERE_FTPATH/lib" + FT_LDFLAGS="-L$WHERE_FTPATH/lib" +else + as_fn_error $? "flow-tools directory '$WHERE_FTPATH' does not exists. Use --with-ftpath=PATH" "$LINENO" 5 +fi + if true; then + FT2NFDUMP_TRUE= + FT2NFDUMP_FALSE='#' +else + FT2NFDUMP_TRUE='#' + FT2NFDUMP_FALSE= +fi + + +else + if false; then + FT2NFDUMP_TRUE= + FT2NFDUMP_FALSE='#' +else + FT2NFDUMP_TRUE='#' + FT2NFDUMP_FALSE= +fi + + +fi + + +#Needs tidy +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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 +$as_echo_n "checking how to run the C preprocessor... " >&6; } +# On Suns, sometimes $CPP names a directory. +if test -n "$CPP" && test -d "$CPP"; then + CPP= +fi +if test -z "$CPP"; then + if ${ac_cv_prog_CPP+:} false; then : + $as_echo_n "(cached) " >&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. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # 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 confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +@%:@ifdef __STDC__ +@%:@ include +@%:@else +@%:@ include +@%:@endif + Syntax error +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + +else + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +@%:@include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue +else + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.i conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i 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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 +$as_echo "$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. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # 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 confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +@%:@ifdef __STDC__ +@%:@ include +@%:@else +@%:@ include +@%:@endif + Syntax error +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + +else + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +@%:@include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue +else + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.i conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : + +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details" "$LINENO" 5; } +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 + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 +$as_echo_n "checking for grep that handles long lines and -e... " >&6; } +if ${ac_cv_path_GREP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$GREP"; then + ac_path_GREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in grep ggrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_GREP" || continue +# Check for GNU ac_path_GREP and select it if it is found. + # Check for GNU $ac_path_GREP +case `"$ac_path_GREP" --version 2>&1` in +*GNU*) + ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'GREP' >> "conftest.nl" + "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_GREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_GREP="$ac_path_GREP" + ac_path_GREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_GREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_GREP"; then + as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_GREP=$GREP +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 +$as_echo "$ac_cv_path_GREP" >&6; } + GREP="$ac_cv_path_GREP" + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 +$as_echo_n "checking for egrep... " >&6; } +if ${ac_cv_path_EGREP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 + then ac_cv_path_EGREP="$GREP -E" + else + if test -z "$EGREP"; then + ac_path_EGREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in egrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_EGREP" || continue +# Check for GNU ac_path_EGREP and select it if it is found. + # Check for GNU $ac_path_EGREP +case `"$ac_path_EGREP" --version 2>&1` in +*GNU*) + ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'EGREP' >> "conftest.nl" + "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_EGREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_EGREP="$ac_path_EGREP" + ac_path_EGREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_EGREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_EGREP"; then + as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_EGREP=$EGREP +fi + + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 +$as_echo "$ac_cv_path_EGREP" >&6; } + EGREP="$ac_cv_path_EGREP" + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 +$as_echo_n "checking for ANSI C header files... " >&6; } +if ${ac_cv_header_stdc+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#include +#include + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_header_stdc=yes +else + ac_cv_header_stdc=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end 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 confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end 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 confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#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)) + return 2; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + +else + ac_cv_header_stdc=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 +$as_echo "$ac_cv_header_stdc" >&6; } +if test $ac_cv_header_stdc = yes; then + +$as_echo "@%:@define STDC_HEADERS 1" >>confdefs.h + +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=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default +" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +@%:@define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + +@%:@ Check whether --enable-nfprofile was given. +if test "${enable_nfprofile+set}" = set; then : + enableval=$enable_nfprofile; + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for rrd_update in -lrrd" >&5 +$as_echo_n "checking for rrd_update in -lrrd... " >&6; } +if ${ac_cv_lib_rrd_rrd_update+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lrrd $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char rrd_update (); +int +main () +{ +return rrd_update (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_rrd_rrd_update=yes +else + ac_cv_lib_rrd_rrd_update=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_rrd_rrd_update" >&5 +$as_echo "$ac_cv_lib_rrd_rrd_update" >&6; } +if test "x$ac_cv_lib_rrd_rrd_update" = xyes; then : + +cat >>config.h <<_ACEOF +#define HAVE_LIBRRD 1 +_ACEOF +RRD_LIBS="-lrrd" + + + +else + as_fn_error $? "Can not link librrd. Please specify --with-rrdpath=.. configure failed! " "$LINENO" 5 +fi + + for ac_header in rrd.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "rrd.h" "ac_cv_header_rrd_h" "$ac_includes_default" +if test "x$ac_cv_header_rrd_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +@%:@define HAVE_RRD_H 1 +_ACEOF + +fi + +done + + if test "$ac_cv_header_rrd_h" = yes; then + if true; then + NFPROFILE_TRUE= + NFPROFILE_FALSE='#' +else + NFPROFILE_TRUE='#' + NFPROFILE_FALSE= +fi + + else + as_fn_error $? "Required rrd.h header file not found!" "$LINENO" 5 + fi + if test "$cross_compiling" = yes; then : + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot run test program while cross compiling +See \`config.log' for more details" "$LINENO" 5; } +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + #include + +int +main () +{ + + rrd_value_t d; + + ; + return 0; +} + +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + +else + as_fn_error $? "Can not load rrd library. Not in loader search path! " "$LINENO" 5 +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + + + +else + if false; then + NFPROFILE_TRUE= + NFPROFILE_FALSE='#' +else + NFPROFILE_TRUE='#' + NFPROFILE_FALSE= +fi + + +fi + + +@%:@ Check whether --enable-nftrack was given. +if test "${enable_nftrack+set}" = set; then : + enableval=$enable_nftrack; + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for rrd_update in -lrrd" >&5 +$as_echo_n "checking for rrd_update in -lrrd... " >&6; } +if ${ac_cv_lib_rrd_rrd_update+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lrrd $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char rrd_update (); +int +main () +{ +return rrd_update (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_rrd_rrd_update=yes +else + ac_cv_lib_rrd_rrd_update=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_rrd_rrd_update" >&5 +$as_echo "$ac_cv_lib_rrd_rrd_update" >&6; } +if test "x$ac_cv_lib_rrd_rrd_update" = xyes; then : + +cat >>config.h <<_ACEOF +#define HAVE_LIBRRD 1 +_ACEOF +RRD_LIBS="-lrrd" + + + +else + as_fn_error $? "Can not link librrd. Please specify --with-rrdpath=.. configure failed! " "$LINENO" 5 +fi + + for ac_header in rrd.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "rrd.h" "ac_cv_header_rrd_h" "$ac_includes_default" +if test "x$ac_cv_header_rrd_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +@%:@define HAVE_RRD_H 1 +_ACEOF + +fi + +done + + if test "$ac_cv_header_rrd_h" = yes; then + if true; then + NFTRACK_TRUE= + NFTRACK_FALSE='#' +else + NFTRACK_TRUE='#' + NFTRACK_FALSE= +fi + + else + as_fn_error $? "Required rrd.h header file not found!" "$LINENO" 5 + fi + if test "$cross_compiling" = yes; then : + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot run test program while cross compiling +See \`config.log' for more details" "$LINENO" 5; } +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + #include + +int +main () +{ + + rrd_value_t d; + + ; + return 0; +} + +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + +else + as_fn_error $? "Can not load rrd library. Not in loader search path! " "$LINENO" 5 +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + + + +else + if false; then + NFTRACK_TRUE= + NFTRACK_FALSE='#' +else + NFTRACK_TRUE='#' + NFTRACK_FALSE= +fi + + +fi + + +@%:@ Check whether --enable-sflow was given. +if test "${enable_sflow+set}" = set; then : + enableval=$enable_sflow; +fi + + if test "$enable_sflow" = yes; then + SFLOW_TRUE= + SFLOW_FALSE='#' +else + SFLOW_TRUE='#' + SFLOW_FALSE= +fi + + +@%:@ Check whether --enable-readpcap was given. +if test "${enable_readpcap+set}" = set; then : + enableval=$enable_readpcap; +fi + + if test "$enable_readpcap" = yes; then + READPCAP_TRUE= + READPCAP_FALSE='#' +else + READPCAP_TRUE='#' + READPCAP_FALSE= +fi + + +@%:@ Check whether --enable-nfpcapd was given. +if test "${enable_nfpcapd+set}" = set; then : + enableval=$enable_nfpcapd; +fi + + if test "$enable_nfpcapd" = yes; then + BUILDNFPCAPD_TRUE= + BUILDNFPCAPD_FALSE='#' +else + BUILDNFPCAPD_TRUE='#' + BUILDNFPCAPD_FALSE= +fi + + +# Check for structures +ac_fn_c_check_member "$LINENO" "struct sockaddr" "sa_len" "ac_cv_member_struct_sockaddr_sa_len" " +#include +#include +" +if test "x$ac_cv_member_struct_sockaddr_sa_len" = xyes; then : + +$as_echo "@%:@define HAVE_SOCKADDR_SA_LEN 1" >>confdefs.h + +fi + + +ac_fn_c_check_member "$LINENO" "struct sockaddr_storage" "ss_family" "ac_cv_member_struct_sockaddr_storage_ss_family" " +#include +#include + +" +if test "x$ac_cv_member_struct_sockaddr_storage_ss_family" = xyes; then : + +cat >>confdefs.h <<_ACEOF +@%:@define HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY 1 +_ACEOF + + +fi +ac_fn_c_check_member "$LINENO" "struct sockaddr_storage" "__ss_family" "ac_cv_member_struct_sockaddr_storage___ss_family" " +#include +#include + +" +if test "x$ac_cv_member_struct_sockaddr_storage___ss_family" = xyes; then : + +cat >>confdefs.h <<_ACEOF +@%:@define HAVE_STRUCT_SOCKADDR_STORAGE___SS_FAMILY 1 +_ACEOF + + +fi +ac_fn_c_check_member "$LINENO" "struct sockaddr_storage" "ss_len" "ac_cv_member_struct_sockaddr_storage_ss_len" " +#include +#include + +" +if test "x$ac_cv_member_struct_sockaddr_storage_ss_len" = xyes; then : + +cat >>confdefs.h <<_ACEOF +@%:@define HAVE_STRUCT_SOCKADDR_STORAGE_SS_LEN 1 +_ACEOF + + +fi +ac_fn_c_check_member "$LINENO" "struct sockaddr_storage" "__ss_len" "ac_cv_member_struct_sockaddr_storage___ss_len" " +#include +#include + +" +if test "x$ac_cv_member_struct_sockaddr_storage___ss_len" = xyes; then : + +cat >>confdefs.h <<_ACEOF +@%:@define HAVE_STRUCT_SOCKADDR_STORAGE___SS_LEN 1 +_ACEOF + + +fi +ac_fn_c_check_member "$LINENO" "struct sockaddr" "sa_len" "ac_cv_member_struct_sockaddr_sa_len" " +#include +#include + +" +if test "x$ac_cv_member_struct_sockaddr_sa_len" = xyes; then : + +cat >>confdefs.h <<_ACEOF +@%:@define HAVE_STRUCT_SOCKADDR_SA_LEN 1 +_ACEOF + + +fi + + +#AC_SUBST(opt_objects) + + + + + +# Checks for libraries. +for ac_func in gethostbyname +do : + ac_fn_c_check_func "$LINENO" "gethostbyname" "ac_cv_func_gethostbyname" +if test "x$ac_cv_func_gethostbyname" = xyes; then : + cat >>confdefs.h <<_ACEOF +@%:@define HAVE_GETHOSTBYNAME 1 +_ACEOF + +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gethostbyname in -lnsl" >&5 +$as_echo_n "checking for gethostbyname in -lnsl... " >&6; } +if ${ac_cv_lib_nsl_gethostbyname+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lnsl $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char gethostbyname (); +int +main () +{ +return gethostbyname (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_nsl_gethostbyname=yes +else + ac_cv_lib_nsl_gethostbyname=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nsl_gethostbyname" >&5 +$as_echo "$ac_cv_lib_nsl_gethostbyname" >&6; } +if test "x$ac_cv_lib_nsl_gethostbyname" = xyes; then : + cat >>confdefs.h <<_ACEOF +@%:@define HAVE_LIBNSL 1 +_ACEOF + + LIBS="-lnsl $LIBS" + +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gethostbyname in -lsocket" >&5 +$as_echo_n "checking for gethostbyname in -lsocket... " >&6; } +if ${ac_cv_lib_socket_gethostbyname+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lsocket $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char gethostbyname (); +int +main () +{ +return gethostbyname (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_socket_gethostbyname=yes +else + ac_cv_lib_socket_gethostbyname=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_gethostbyname" >&5 +$as_echo "$ac_cv_lib_socket_gethostbyname" >&6; } +if test "x$ac_cv_lib_socket_gethostbyname" = xyes; then : + cat >>confdefs.h <<_ACEOF +@%:@define HAVE_LIBSOCKET 1 +_ACEOF + + LIBS="-lsocket $LIBS" + +fi + +fi + +fi +done + +for ac_func in setsockopt +do : + ac_fn_c_check_func "$LINENO" "setsockopt" "ac_cv_func_setsockopt" +if test "x$ac_cv_func_setsockopt" = xyes; then : + cat >>confdefs.h <<_ACEOF +@%:@define HAVE_SETSOCKOPT 1 +_ACEOF + +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for setsockopt in -lsocket" >&5 +$as_echo_n "checking for setsockopt in -lsocket... " >&6; } +if ${ac_cv_lib_socket_setsockopt+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lsocket $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char setsockopt (); +int +main () +{ +return setsockopt (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_socket_setsockopt=yes +else + ac_cv_lib_socket_setsockopt=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_setsockopt" >&5 +$as_echo "$ac_cv_lib_socket_setsockopt" >&6; } +if test "x$ac_cv_lib_socket_setsockopt" = xyes; then : + cat >>confdefs.h <<_ACEOF +@%:@define HAVE_LIBSOCKET 1 +_ACEOF + + LIBS="-lsocket $LIBS" + +fi + +fi +done + + +for ac_func in fpurge __fpurge +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +@%:@define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if htonll is defined" >&5 +$as_echo_n "checking if htonll is defined... " >&6; } + +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + +int +main () +{ + + return htonll(0); + + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + +$as_echo "@%:@define HAVE_HTONLL 1" >>confdefs.h + + +else + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + + +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + +# Checks for header files. +ac_header_dirent=no +for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do + as_ac_Header=`$as_echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh` +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_hdr that defines DIR" >&5 +$as_echo_n "checking for $ac_hdr that defines DIR... " >&6; } +if eval \${$as_ac_Header+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include <$ac_hdr> + +int +main () +{ +if ((DIR *) 0) +return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + eval "$as_ac_Header=yes" +else + eval "$as_ac_Header=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$as_ac_Header + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +@%:@define `$as_echo "HAVE_$ac_hdr" | $as_tr_cpp` 1 +_ACEOF + +ac_header_dirent=$ac_hdr; break +fi + +done +# Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. +if test $ac_header_dirent = dirent.h; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing opendir" >&5 +$as_echo_n "checking for library containing opendir... " >&6; } +if ${ac_cv_search_opendir+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_func_search_save_LIBS=$LIBS +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char opendir (); +int +main () +{ +return opendir (); + ; + return 0; +} +_ACEOF +for ac_lib in '' dir; do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + if ac_fn_c_try_link "$LINENO"; then : + ac_cv_search_opendir=$ac_res +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext + if ${ac_cv_search_opendir+:} false; then : + break +fi +done +if ${ac_cv_search_opendir+:} false; then : + +else + ac_cv_search_opendir=no +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_opendir" >&5 +$as_echo "$ac_cv_search_opendir" >&6; } +ac_res=$ac_cv_search_opendir +if test "$ac_res" != no; then : + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + +fi + +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing opendir" >&5 +$as_echo_n "checking for library containing opendir... " >&6; } +if ${ac_cv_search_opendir+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_func_search_save_LIBS=$LIBS +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char opendir (); +int +main () +{ +return opendir (); + ; + return 0; +} +_ACEOF +for ac_lib in '' x; do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + if ac_fn_c_try_link "$LINENO"; then : + ac_cv_search_opendir=$ac_res +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext + if ${ac_cv_search_opendir+:} false; then : + break +fi +done +if ${ac_cv_search_opendir+:} false; then : + +else + ac_cv_search_opendir=no +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_opendir" >&5 +$as_echo "$ac_cv_search_opendir" >&6; } +ac_res=$ac_cv_search_opendir +if test "$ac_res" != no; then : + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + +fi + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 +$as_echo_n "checking for ANSI C header files... " >&6; } +if ${ac_cv_header_stdc+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#include +#include + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_header_stdc=yes +else + ac_cv_header_stdc=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end 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 confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end 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 confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#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)) + return 2; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + +else + ac_cv_header_stdc=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 +$as_echo "$ac_cv_header_stdc" >&6; } +if test $ac_cv_header_stdc = yes; then + +$as_echo "@%:@define STDC_HEADERS 1" >>confdefs.h + +fi + +for ac_header in nameser8_compat.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "nameser8_compat.h" "ac_cv_header_nameser8_compat_h" "$ac_includes_default" +if test "x$ac_cv_header_nameser8_compat_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +@%:@define HAVE_NAMESER8_COMPAT_H 1 +_ACEOF + +fi + +done + +for ac_header in features.h arpa/inet.h fcntl.h netinet/in.h fts.h stdint.h stdlib.h stddef.h string.h sys/socket.h syslog.h unistd.h iso/limits_iso.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +@%:@define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + +for ac_header in pcap-bpf.h net/bpf.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +@%:@define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + +for ac_header in sys/types.h netinet/in.h arpa/nameser.h arpa/nameser_compat.h netdb.h resolv.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "#ifdef HAVE_SYS_TYPES_H +# include +#endif +#ifdef HAVE_NETINET_IN_H +# include /* inet_ functions / structs */ +#endif +#ifdef HAVE_ARPA_NAMESER_H +# include /* DNS HEADER struct */ +#endif +#ifdef HAVE_NETDB_H +# include +#endif +" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +@%:@define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + + +if test "$ac_cv_header_fts_h" != yes; then + FTS_OBJ=fts_compat.o +fi + + + +# Checks for typedefs, structures, and compiler characteristics. +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of void *" >&5 +$as_echo_n "checking size of void *... " >&6; } +if ${ac_cv_sizeof_void_p+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (void *))" "ac_cv_sizeof_void_p" "$ac_includes_default"; then : + +else + if test "$ac_cv_type_void_p" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute sizeof (void *) +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof_void_p=0 + fi +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_void_p" >&5 +$as_echo "$ac_cv_sizeof_void_p" >&6; } + + + +cat >>confdefs.h <<_ACEOF +@%:@define SIZEOF_VOID_P $ac_cv_sizeof_void_p +_ACEOF + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5 +$as_echo_n "checking for an ANSI C-conforming const... " >&6; } +if ${ac_cv_c_const+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + +#ifndef __cplusplus + /* Ultrix mips cc rejects this sort of thing. */ + typedef int charset[2]; + const charset cs = { 0, 0 }; + /* SunOS 4.1.1 cc rejects this. */ + char const *const *pcpcc; + char **ppc; + /* 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"; + pcpcc = &g + (g ? g-g : 0); + /* HPUX 7.0 cc rejects these. */ + ++pcpcc; + ppc = (char**) pcpcc; + pcpcc = (char const *const *) ppc; + { /* SCO 3.2v4 cc rejects this sort of thing. */ + char tx; + char *t = &tx; + char const *s = 0 ? (char *) 0 : (char const *) 0; + + *t++ = 0; + if (s) return 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 sort of thing, saying + "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ + struct s { int j; const int *ap[3]; } bx; + struct s *b = &bx; b->j = 5; + } + { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ + const int foo = 10; + if (!foo) return 0; + } + return !cs[0] && !zero.x; +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_c_const=yes +else + ac_cv_c_const=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5 +$as_echo "$ac_cv_c_const" >&6; } +if test $ac_cv_c_const = no; then + +$as_echo "@%:@define const /**/" >>confdefs.h + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5 +$as_echo_n "checking for inline... " >&6; } +if ${ac_cv_c_inline+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_c_inline=no +for ac_kw in inline __inline__ __inline; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifndef __cplusplus +typedef int foo_t; +static $ac_kw foo_t static_foo () {return 0; } +$ac_kw foo_t foo () {return 0; } +#endif + +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_c_inline=$ac_kw +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + test "$ac_cv_c_inline" != no && break +done + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5 +$as_echo "$ac_cv_c_inline" >&6; } + +case $ac_cv_c_inline in + inline | yes) ;; + *) + case $ac_cv_c_inline in + no) ac_val=;; + *) ac_val=$ac_cv_c_inline;; + esac + cat >>confdefs.h <<_ACEOF +#ifndef __cplusplus +#define inline $ac_val +#endif +_ACEOF + ;; +esac + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5 +$as_echo_n "checking whether byte ordering is bigendian... " >&6; } +if ${ac_cv_c_bigendian+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_c_bigendian=unknown + # See if we're dealing with a universal compiler. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifndef __APPLE_CC__ + not a universal capable compiler + #endif + typedef int dummy; + +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + + # Check for potential -arch flags. It is not universal unless + # there are at least two -arch flags with different values. + ac_arch= + ac_prev= + for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do + if test -n "$ac_prev"; then + case $ac_word in + i?86 | x86_64 | ppc | ppc64) + if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then + ac_arch=$ac_word + else + ac_cv_c_bigendian=universal + break + fi + ;; + esac + ac_prev= + elif test "x$ac_word" = "x-arch"; then + ac_prev=arch + fi + done +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + if test $ac_cv_c_bigendian = unknown; then + # See if sys/param.h defines the BYTE_ORDER macro. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + #include + +int +main () +{ +#if ! (defined BYTE_ORDER && defined BIG_ENDIAN \ + && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \ + && LITTLE_ENDIAN) + bogus endian macros + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + # It does; now see whether it defined to BIG_ENDIAN or not. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + #include + +int +main () +{ +#if BYTE_ORDER != BIG_ENDIAN + not big endian + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_c_bigendian=yes +else + ac_cv_c_bigendian=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi + if test $ac_cv_c_bigendian = unknown; then + # See if defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris). + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +int +main () +{ +#if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN) + bogus endian macros + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + # It does; now see whether it defined to _BIG_ENDIAN or not. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +int +main () +{ +#ifndef _BIG_ENDIAN + not big endian + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_c_bigendian=yes +else + ac_cv_c_bigendian=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi + if test $ac_cv_c_bigendian = unknown; then + # Compile a test program. + if test "$cross_compiling" = yes; then : + # Try to guess by grepping values from an object file. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +short int ascii_mm[] = + { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; + short int ascii_ii[] = + { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; + int use_ascii (int i) { + return ascii_mm[i] + ascii_ii[i]; + } + short int ebcdic_ii[] = + { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; + short int ebcdic_mm[] = + { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; + int use_ebcdic (int i) { + return ebcdic_mm[i] + ebcdic_ii[i]; + } + extern int foo; + +int +main () +{ +return use_ascii (foo) == use_ebcdic (foo); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then + ac_cv_c_bigendian=yes + fi + if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then + if test "$ac_cv_c_bigendian" = unknown; then + ac_cv_c_bigendian=no + else + # finding both strings is unlikely to happen, but who knows? + ac_cv_c_bigendian=unknown + fi + fi +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ + + /* Are we little or big endian? From Harbison&Steele. */ + union + { + long int l; + char c[sizeof (long int)]; + } u; + u.l = 1; + return u.c[sizeof (long int) - 1] == 1; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + ac_cv_c_bigendian=no +else + ac_cv_c_bigendian=yes +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_bigendian" >&5 +$as_echo "$ac_cv_c_bigendian" >&6; } + case $ac_cv_c_bigendian in #( + yes) + $as_echo "@%:@define WORDS_BIGENDIAN 1" >>confdefs.h +;; #( + no) + ;; #( + universal) + +$as_echo "@%:@define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h + + ;; #( + *) + as_fn_error $? "unknown endianness + presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;; + esac + +ac_fn_c_check_type "$LINENO" "pid_t" "ac_cv_type_pid_t" "$ac_includes_default" +if test "x$ac_cv_type_pid_t" = xyes; then : + +else + +cat >>confdefs.h <<_ACEOF +@%:@define pid_t int +_ACEOF + +fi + +ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" +if test "x$ac_cv_type_size_t" = xyes; then : + +else + +cat >>confdefs.h <<_ACEOF +@%:@define size_t unsigned int +_ACEOF + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether struct tm is in sys/time.h or time.h" >&5 +$as_echo_n "checking whether struct tm is in sys/time.h or time.h... " >&6; } +if ${ac_cv_struct_tm+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include + +int +main () +{ +struct tm tm; + int *p = &tm.tm_sec; + return !p; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_struct_tm=time.h +else + ac_cv_struct_tm=sys/time.h +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_struct_tm" >&5 +$as_echo "$ac_cv_struct_tm" >&6; } +if test $ac_cv_struct_tm = sys/time.h; then + +$as_echo "@%:@define TM_IN_SYS_TIME 1" >>confdefs.h + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for stdbool.h that conforms to C99" >&5 +$as_echo_n "checking for stdbool.h that conforms to C99... " >&6; } +if ${ac_cv_header_stdbool_h+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + #ifndef bool + "error: bool is not defined" + #endif + #ifndef false + "error: false is not defined" + #endif + #if false + "error: false is not 0" + #endif + #ifndef true + "error: true is not defined" + #endif + #if true != 1 + "error: true is not 1" + #endif + #ifndef __bool_true_false_are_defined + "error: __bool_true_false_are_defined is not defined" + #endif + + struct s { _Bool s: 1; _Bool t; } s; + + char a[true == 1 ? 1 : -1]; + char b[false == 0 ? 1 : -1]; + char c[__bool_true_false_are_defined == 1 ? 1 : -1]; + char d[(bool) 0.5 == true ? 1 : -1]; + /* See body of main program for 'e'. */ + char f[(_Bool) 0.0 == false ? 1 : -1]; + char g[true]; + char h[sizeof (_Bool)]; + char i[sizeof s.t]; + enum { j = false, k = true, l = false * true, m = true * 256 }; + /* The following fails for + HP aC++/ANSI C B3910B A.05.55 [Dec 04 2003]. */ + _Bool n[m]; + char o[sizeof n == m * sizeof n[0] ? 1 : -1]; + char p[-1 - (_Bool) 0 < 0 && -1 - (bool) 0 < 0 ? 1 : -1]; + /* Catch a bug in an HP-UX C compiler. See + http://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html + http://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html + */ + _Bool q = true; + _Bool *pq = &q; + +int +main () +{ + + bool e = &s; + *pq |= q; + *pq |= ! q; + /* Refer to every declared value, to avoid compiler optimizations. */ + return (!a + !b + !c + !d + !e + !f + !g + !h + !i + !!j + !k + !!l + + !m + !n + !o + !p + !q + !pq); + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_header_stdbool_h=yes +else + ac_cv_header_stdbool_h=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdbool_h" >&5 +$as_echo "$ac_cv_header_stdbool_h" >&6; } + ac_fn_c_check_type "$LINENO" "_Bool" "ac_cv_type__Bool" "$ac_includes_default" +if test "x$ac_cv_type__Bool" = xyes; then : + +cat >>confdefs.h <<_ACEOF +@%:@define HAVE__BOOL 1 +_ACEOF + + +fi + + +if test $ac_cv_header_stdbool_h = yes; then + +$as_echo "@%:@define HAVE_STDBOOL_H 1" >>confdefs.h + +fi + + +# Checks for library functions. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether closedir returns void" >&5 +$as_echo_n "checking whether closedir returns void... " >&6; } +if ${ac_cv_func_closedir_void+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + ac_cv_func_closedir_void=yes +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +#include <$ac_header_dirent> +#ifndef __cplusplus +int closedir (); +#endif + +int +main () +{ +return closedir (opendir (".")) != 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + ac_cv_func_closedir_void=no +else + ac_cv_func_closedir_void=yes +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_closedir_void" >&5 +$as_echo "$ac_cv_func_closedir_void" >&6; } +if test $ac_cv_func_closedir_void = yes; then + +$as_echo "@%:@define CLOSEDIR_VOID 1" >>confdefs.h + +fi + +for ac_header in vfork.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "vfork.h" "ac_cv_header_vfork_h" "$ac_includes_default" +if test "x$ac_cv_header_vfork_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +@%:@define HAVE_VFORK_H 1 +_ACEOF + +fi + +done + +for ac_func in fork vfork +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +@%:@define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + +if test "x$ac_cv_func_fork" = xyes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working fork" >&5 +$as_echo_n "checking for working fork... " >&6; } +if ${ac_cv_func_fork_works+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + ac_cv_func_fork_works=cross +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ + + /* By Ruediger Kuhlmann. */ + return fork () < 0; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + ac_cv_func_fork_works=yes +else + ac_cv_func_fork_works=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_fork_works" >&5 +$as_echo "$ac_cv_func_fork_works" >&6; } + +else + ac_cv_func_fork_works=$ac_cv_func_fork +fi +if test "x$ac_cv_func_fork_works" = xcross; then + case $host in + *-*-amigaos* | *-*-msdosdjgpp*) + # Override, as these systems have only a dummy fork() stub + ac_cv_func_fork_works=no + ;; + *) + ac_cv_func_fork_works=yes + ;; + esac + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: result $ac_cv_func_fork_works guessed because of cross compilation" >&5 +$as_echo "$as_me: WARNING: result $ac_cv_func_fork_works guessed because of cross compilation" >&2;} +fi +ac_cv_func_vfork_works=$ac_cv_func_vfork +if test "x$ac_cv_func_vfork" = xyes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working vfork" >&5 +$as_echo_n "checking for working vfork... " >&6; } +if ${ac_cv_func_vfork_works+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + ac_cv_func_vfork_works=cross +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Thanks to Paul Eggert for this test. */ +$ac_includes_default +#include +#ifdef HAVE_VFORK_H +# include +#endif +/* On some sparc systems, changes by the child to local and incoming + argument registers are propagated back to the parent. The compiler + is told about this with #include , but some compilers + (e.g. gcc -O) don't grok . Test for this by using a + static variable whose address is put into a register that is + clobbered by the vfork. */ +static void +#ifdef __cplusplus +sparc_address_test (int arg) +# else +sparc_address_test (arg) int arg; +#endif +{ + static pid_t child; + if (!child) { + child = vfork (); + if (child < 0) { + perror ("vfork"); + _exit(2); + } + if (!child) { + arg = getpid(); + write(-1, "", 0); + _exit (arg); + } + } +} + +int +main () +{ + pid_t parent = getpid (); + pid_t child; + + sparc_address_test (0); + + child = vfork (); + + if (child == 0) { + /* Here is another test for sparc vfork register problems. This + test uses lots of local variables, at least as many local + variables as main has allocated so far including compiler + temporaries. 4 locals are enough for gcc 1.40.3 on a Solaris + 4.1.3 sparc, but we use 8 to be safe. A buggy compiler should + reuse the register of parent for one of the local variables, + since it will think that parent can't possibly be used any more + in this routine. Assigning to the local variable will thus + munge parent in the parent process. */ + pid_t + p = getpid(), p1 = getpid(), p2 = getpid(), p3 = getpid(), + p4 = getpid(), p5 = getpid(), p6 = getpid(), p7 = getpid(); + /* Convince the compiler that p..p7 are live; otherwise, it might + use the same hardware register for all 8 local variables. */ + if (p != p1 || p != p2 || p != p3 || p != p4 + || p != p5 || p != p6 || p != p7) + _exit(1); + + /* On some systems (e.g. IRIX 3.3), vfork doesn't separate parent + from child file descriptors. If the child closes a descriptor + before it execs or exits, this munges the parent's descriptor + as well. Test for this by closing stdout in the child. */ + _exit(close(fileno(stdout)) != 0); + } else { + int status; + struct stat st; + + while (wait(&status) != child) + ; + return ( + /* Was there some problem with vforking? */ + child < 0 + + /* Did the child fail? (This shouldn't happen.) */ + || status + + /* Did the vfork/compiler bug occur? */ + || parent != getpid() + + /* Did the file descriptor bug occur? */ + || fstat(fileno(stdout), &st) != 0 + ); + } +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + ac_cv_func_vfork_works=yes +else + ac_cv_func_vfork_works=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_vfork_works" >&5 +$as_echo "$ac_cv_func_vfork_works" >&6; } + +fi; +if test "x$ac_cv_func_fork_works" = xcross; then + ac_cv_func_vfork_works=$ac_cv_func_vfork + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: result $ac_cv_func_vfork_works guessed because of cross compilation" >&5 +$as_echo "$as_me: WARNING: result $ac_cv_func_vfork_works guessed because of cross compilation" >&2;} +fi + +if test "x$ac_cv_func_vfork_works" = xyes; then + +$as_echo "@%:@define HAVE_WORKING_VFORK 1" >>confdefs.h + +else + +$as_echo "@%:@define vfork fork" >>confdefs.h + +fi +if test "x$ac_cv_func_fork_works" = xyes; then + +$as_echo "@%:@define HAVE_WORKING_FORK 1" >>confdefs.h + +fi + +for ac_header in stdlib.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "stdlib.h" "ac_cv_header_stdlib_h" "$ac_includes_default" +if test "x$ac_cv_header_stdlib_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +@%:@define HAVE_STDLIB_H 1 +_ACEOF + +fi + +done + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU libc compatible malloc" >&5 +$as_echo_n "checking for GNU libc compatible malloc... " >&6; } +if ${ac_cv_func_malloc_0_nonnull+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + ac_cv_func_malloc_0_nonnull=no +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#if defined STDC_HEADERS || defined HAVE_STDLIB_H +# include +#else +char *malloc (); +#endif + +int +main () +{ +return ! malloc (0); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + ac_cv_func_malloc_0_nonnull=yes +else + ac_cv_func_malloc_0_nonnull=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_malloc_0_nonnull" >&5 +$as_echo "$ac_cv_func_malloc_0_nonnull" >&6; } +if test $ac_cv_func_malloc_0_nonnull = yes; then : + +$as_echo "@%:@define HAVE_MALLOC 1" >>confdefs.h + +else + $as_echo "@%:@define HAVE_MALLOC 0" >>confdefs.h + + case " $LIB@&t@OBJS " in + *" malloc.$ac_objext "* ) ;; + *) LIB@&t@OBJS="$LIB@&t@OBJS malloc.$ac_objext" + ;; +esac + + +$as_echo "@%:@define malloc rpl_malloc" >>confdefs.h + +fi + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether time.h and sys/time.h may both be included" >&5 +$as_echo_n "checking whether time.h and sys/time.h may both be included... " >&6; } +if ${ac_cv_header_time+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#include + +int +main () +{ +if ((struct tm *) 0) +return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_header_time=yes +else + ac_cv_header_time=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_time" >&5 +$as_echo "$ac_cv_header_time" >&6; } +if test $ac_cv_header_time = yes; then + +$as_echo "@%:@define TIME_WITH_SYS_TIME 1" >>confdefs.h + +fi + + + + + for ac_header in $ac_header_list +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default +" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +@%:@define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + + + + + + + + for ac_func in $ac_func_list +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +@%:@define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for working mktime" >&5 +$as_echo_n "checking for working mktime... " >&6; } +if ${ac_cv_func_working_mktime+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + ac_cv_func_working_mktime=no +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Test program from Paul Eggert and Tony Leneis. */ +#ifdef TIME_WITH_SYS_TIME +# include +# include +#else +# ifdef HAVE_SYS_TIME_H +# include +# else +# include +# endif +#endif + +#include +#include + +#ifdef HAVE_UNISTD_H +# include +#endif + +#ifndef HAVE_ALARM +# define alarm(X) /* empty */ +#endif + +/* Work around redefinition to rpl_putenv by other config tests. */ +#undef putenv + +static time_t time_t_max; +static time_t time_t_min; + +/* Values we'll use to set the TZ environment variable. */ +static const char *tz_strings[] = { + (const char *) 0, "TZ=GMT0", "TZ=JST-9", + "TZ=EST+3EDT+2,M10.1.0/00:00:00,M2.3.0/00:00:00" +}; +#define N_STRINGS (sizeof (tz_strings) / sizeof (tz_strings[0])) + +/* Return 0 if mktime fails to convert a date in the spring-forward gap. + Based on a problem report from Andreas Jaeger. */ +static int +spring_forward_gap () +{ + /* glibc (up to about 1998-10-07) failed this test. */ + struct tm tm; + + /* Use the portable POSIX.1 specification "TZ=PST8PDT,M4.1.0,M10.5.0" + instead of "TZ=America/Vancouver" in order to detect the bug even + on systems that don't support the Olson extension, or don't have the + full zoneinfo tables installed. */ + putenv ((char*) "TZ=PST8PDT,M4.1.0,M10.5.0"); + + tm.tm_year = 98; + tm.tm_mon = 3; + tm.tm_mday = 5; + tm.tm_hour = 2; + tm.tm_min = 0; + tm.tm_sec = 0; + tm.tm_isdst = -1; + return mktime (&tm) != (time_t) -1; +} + +static int +mktime_test1 (time_t now) +{ + struct tm *lt; + return ! (lt = localtime (&now)) || mktime (lt) == now; +} + +static int +mktime_test (time_t now) +{ + return (mktime_test1 (now) + && mktime_test1 ((time_t) (time_t_max - now)) + && mktime_test1 ((time_t) (time_t_min + now))); +} + +static int +irix_6_4_bug () +{ + /* Based on code from Ariel Faigon. */ + struct tm tm; + tm.tm_year = 96; + tm.tm_mon = 3; + tm.tm_mday = 0; + tm.tm_hour = 0; + tm.tm_min = 0; + tm.tm_sec = 0; + tm.tm_isdst = -1; + mktime (&tm); + return tm.tm_mon == 2 && tm.tm_mday == 31; +} + +static int +bigtime_test (int j) +{ + struct tm tm; + time_t now; + tm.tm_year = tm.tm_mon = tm.tm_mday = tm.tm_hour = tm.tm_min = tm.tm_sec = j; + now = mktime (&tm); + if (now != (time_t) -1) + { + struct tm *lt = localtime (&now); + if (! (lt + && lt->tm_year == tm.tm_year + && lt->tm_mon == tm.tm_mon + && lt->tm_mday == tm.tm_mday + && lt->tm_hour == tm.tm_hour + && lt->tm_min == tm.tm_min + && lt->tm_sec == tm.tm_sec + && lt->tm_yday == tm.tm_yday + && lt->tm_wday == tm.tm_wday + && ((lt->tm_isdst < 0 ? -1 : 0 < lt->tm_isdst) + == (tm.tm_isdst < 0 ? -1 : 0 < tm.tm_isdst)))) + return 0; + } + return 1; +} + +static int +year_2050_test () +{ + /* The correct answer for 2050-02-01 00:00:00 in Pacific time, + ignoring leap seconds. */ + unsigned long int answer = 2527315200UL; + + struct tm tm; + time_t t; + tm.tm_year = 2050 - 1900; + tm.tm_mon = 2 - 1; + tm.tm_mday = 1; + tm.tm_hour = tm.tm_min = tm.tm_sec = 0; + tm.tm_isdst = -1; + + /* Use the portable POSIX.1 specification "TZ=PST8PDT,M4.1.0,M10.5.0" + instead of "TZ=America/Vancouver" in order to detect the bug even + on systems that don't support the Olson extension, or don't have the + full zoneinfo tables installed. */ + putenv ((char*) "TZ=PST8PDT,M4.1.0,M10.5.0"); + + t = mktime (&tm); + + /* Check that the result is either a failure, or close enough + to the correct answer that we can assume the discrepancy is + due to leap seconds. */ + return (t == (time_t) -1 + || (0 < t && answer - 120 <= t && t <= answer + 120)); +} + +int +main () +{ + time_t t, delta; + int i, j; + + /* This test makes some buggy mktime implementations loop. + Give up after 60 seconds; a mktime slower than that + isn't worth using anyway. */ + alarm (60); + + for (;;) + { + t = (time_t_max << 1) + 1; + if (t <= time_t_max) + break; + time_t_max = t; + } + time_t_min = - ((time_t) ~ (time_t) 0 == (time_t) -1) - time_t_max; + + delta = time_t_max / 997; /* a suitable prime number */ + for (i = 0; i < N_STRINGS; i++) + { + if (tz_strings[i]) + putenv ((char*) tz_strings[i]); + + for (t = 0; t <= time_t_max - delta; t += delta) + if (! mktime_test (t)) + return 1; + if (! (mktime_test ((time_t) 1) + && mktime_test ((time_t) (60 * 60)) + && mktime_test ((time_t) (60 * 60 * 24)))) + return 1; + + for (j = 1; ; j <<= 1) + if (! bigtime_test (j)) + return 1; + else if (INT_MAX / 2 < j) + break; + if (! bigtime_test (INT_MAX)) + return 1; + } + return ! (irix_6_4_bug () && spring_forward_gap () && year_2050_test ()); +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + ac_cv_func_working_mktime=yes +else + ac_cv_func_working_mktime=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_working_mktime" >&5 +$as_echo "$ac_cv_func_working_mktime" >&6; } +if test $ac_cv_func_working_mktime = no; then + case " $LIB@&t@OBJS " in + *" mktime.$ac_objext "* ) ;; + *) LIB@&t@OBJS="$LIB@&t@OBJS mktime.$ac_objext" + ;; +esac + +fi + +for ac_header in stdlib.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "stdlib.h" "ac_cv_header_stdlib_h" "$ac_includes_default" +if test "x$ac_cv_header_stdlib_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +@%:@define HAVE_STDLIB_H 1 +_ACEOF + +fi + +done + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU libc compatible realloc" >&5 +$as_echo_n "checking for GNU libc compatible realloc... " >&6; } +if ${ac_cv_func_realloc_0_nonnull+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + ac_cv_func_realloc_0_nonnull=no +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#if defined STDC_HEADERS || defined HAVE_STDLIB_H +# include +#else +char *realloc (); +#endif + +int +main () +{ +return ! realloc (0, 0); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + ac_cv_func_realloc_0_nonnull=yes +else + ac_cv_func_realloc_0_nonnull=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_realloc_0_nonnull" >&5 +$as_echo "$ac_cv_func_realloc_0_nonnull" >&6; } +if test $ac_cv_func_realloc_0_nonnull = yes; then : + +$as_echo "@%:@define HAVE_REALLOC 1" >>confdefs.h + +else + $as_echo "@%:@define HAVE_REALLOC 0" >>confdefs.h + + case " $LIB@&t@OBJS " in + *" realloc.$ac_objext "* ) ;; + *) LIB@&t@OBJS="$LIB@&t@OBJS realloc.$ac_objext" + ;; +esac + + +$as_echo "@%:@define realloc rpl_realloc" >>confdefs.h + +fi + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether lstat correctly handles trailing slash" >&5 +$as_echo_n "checking whether lstat correctly handles trailing slash... " >&6; } +if ${ac_cv_func_lstat_dereferences_slashed_symlink+:} false; then : + $as_echo_n "(cached) " >&6 +else + rm -f conftest.sym conftest.file +echo >conftest.file +if test "$as_ln_s" = "ln -s" && ln -s conftest.file conftest.sym; then + if test "$cross_compiling" = yes; then : + ac_cv_func_lstat_dereferences_slashed_symlink=no +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +struct stat sbuf; + /* Linux will dereference the symlink and fail, as required by POSIX. + That is better in the sense that it means we will not + have to compile and use the lstat wrapper. */ + return lstat ("conftest.sym/", &sbuf) == 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + ac_cv_func_lstat_dereferences_slashed_symlink=yes +else + ac_cv_func_lstat_dereferences_slashed_symlink=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +else + # If the `ln -s' command failed, then we probably don't even + # have an lstat function. + ac_cv_func_lstat_dereferences_slashed_symlink=no +fi +rm -f conftest.sym conftest.file + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_lstat_dereferences_slashed_symlink" >&5 +$as_echo "$ac_cv_func_lstat_dereferences_slashed_symlink" >&6; } + +test $ac_cv_func_lstat_dereferences_slashed_symlink = yes && + +cat >>confdefs.h <<_ACEOF +@%:@define LSTAT_FOLLOWS_SLASHED_SYMLINK 1 +_ACEOF + + +if test "x$ac_cv_func_lstat_dereferences_slashed_symlink" = xno; then + case " $LIB@&t@OBJS " in + *" lstat.$ac_objext "* ) ;; + *) LIB@&t@OBJS="$LIB@&t@OBJS lstat.$ac_objext" + ;; +esac + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stat accepts an empty string" >&5 +$as_echo_n "checking whether stat accepts an empty string... " >&6; } +if ${ac_cv_func_stat_empty_string_bug+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + ac_cv_func_stat_empty_string_bug=yes +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +struct stat sbuf; + return stat ("", &sbuf) == 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + ac_cv_func_stat_empty_string_bug=no +else + ac_cv_func_stat_empty_string_bug=yes +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_stat_empty_string_bug" >&5 +$as_echo "$ac_cv_func_stat_empty_string_bug" >&6; } +if test $ac_cv_func_stat_empty_string_bug = yes; then + case " $LIB@&t@OBJS " in + *" stat.$ac_objext "* ) ;; + *) LIB@&t@OBJS="$LIB@&t@OBJS stat.$ac_objext" + ;; +esac + + +cat >>confdefs.h <<_ACEOF +@%:@define HAVE_STAT_EMPTY_STRING_BUG 1 +_ACEOF + +fi + +for ac_func in strftime +do : + ac_fn_c_check_func "$LINENO" "strftime" "ac_cv_func_strftime" +if test "x$ac_cv_func_strftime" = xyes; then : + cat >>confdefs.h <<_ACEOF +@%:@define HAVE_STRFTIME 1 +_ACEOF + +else + # strftime is in -lintl on SCO UNIX. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for strftime in -lintl" >&5 +$as_echo_n "checking for strftime in -lintl... " >&6; } +if ${ac_cv_lib_intl_strftime+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lintl $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char strftime (); +int +main () +{ +return strftime (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_intl_strftime=yes +else + ac_cv_lib_intl_strftime=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_intl_strftime" >&5 +$as_echo "$ac_cv_lib_intl_strftime" >&6; } +if test "x$ac_cv_lib_intl_strftime" = xyes; then : + $as_echo "@%:@define HAVE_STRFTIME 1" >>confdefs.h + +LIBS="-lintl $LIBS" +fi + +fi +done + +for ac_func in inet_ntoa socket strchr strdup strerror strrchr strstr scandir +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +@%:@define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for res_search in -lsocket" >&5 +$as_echo_n "checking for res_search in -lsocket... " >&6; } +if ${ac_cv_lib_socket_res_search+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lsocket $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char res_search (); +int +main () +{ +return res_search (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_socket_res_search=yes +else + ac_cv_lib_socket_res_search=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_res_search" >&5 +$as_echo "$ac_cv_lib_socket_res_search" >&6; } +if test "x$ac_cv_lib_socket_res_search" = xyes; then : + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dn_skipname in -lresolv" >&5 +$as_echo_n "checking for dn_skipname in -lresolv... " >&6; } +if ${ac_cv_lib_resolv_dn_skipname+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lresolv $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dn_skipname (); +int +main () +{ +return dn_skipname (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_resolv_dn_skipname=yes +else + ac_cv_lib_resolv_dn_skipname=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_resolv_dn_skipname" >&5 +$as_echo "$ac_cv_lib_resolv_dn_skipname" >&6; } +if test "x$ac_cv_lib_resolv_dn_skipname" = xyes; then : + cat >>confdefs.h <<_ACEOF +@%:@define HAVE_LIBRESOLV 1 +_ACEOF + + LIBS="-lresolv $LIBS" + +fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __dn_skipname in -lresolv" >&5 +$as_echo_n "checking for __dn_skipname in -lresolv... " >&6; } +if ${ac_cv_lib_resolv___dn_skipname+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lresolv $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char __dn_skipname (); +int +main () +{ +return __dn_skipname (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_resolv___dn_skipname=yes +else + ac_cv_lib_resolv___dn_skipname=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_resolv___dn_skipname" >&5 +$as_echo "$ac_cv_lib_resolv___dn_skipname" >&6; } +if test "x$ac_cv_lib_resolv___dn_skipname" = xyes; then : + cat >>confdefs.h <<_ACEOF +@%:@define HAVE_LIBRESOLV 1 +_ACEOF + + LIBS="-lresolv $LIBS" + +fi + + LIBS="$LIBS -lsocket" + +$as_echo "@%:@define HAVE_LIBSOCKET 1" >>confdefs.h + +else + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for res_search in -lresolv" >&5 +$as_echo_n "checking for res_search in -lresolv... " >&6; } +if ${ac_cv_lib_resolv_res_search+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lresolv $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char res_search (); +int +main () +{ +return res_search (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_resolv_res_search=yes +else + ac_cv_lib_resolv_res_search=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_resolv_res_search" >&5 +$as_echo "$ac_cv_lib_resolv_res_search" >&6; } +if test "x$ac_cv_lib_resolv_res_search" = xyes; then : + + LIBS="$LIBS -lresolv" + +$as_echo "@%:@define HAVE_LIBRESOLV 1" >>confdefs.h + + +else + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dn_skipname in -lresolv" >&5 +$as_echo_n "checking for dn_skipname in -lresolv... " >&6; } +if ${ac_cv_lib_resolv_dn_skipname+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lresolv $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dn_skipname (); +int +main () +{ +return dn_skipname (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_resolv_dn_skipname=yes +else + ac_cv_lib_resolv_dn_skipname=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_resolv_dn_skipname" >&5 +$as_echo "$ac_cv_lib_resolv_dn_skipname" >&6; } +if test "x$ac_cv_lib_resolv_dn_skipname" = xyes; then : + cat >>confdefs.h <<_ACEOF +@%:@define HAVE_LIBRESOLV 1 +_ACEOF + + LIBS="-lresolv $LIBS" + +fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __dn_skipname in -lresolv" >&5 +$as_echo_n "checking for __dn_skipname in -lresolv... " >&6; } +if ${ac_cv_lib_resolv___dn_skipname+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lresolv $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char __dn_skipname (); +int +main () +{ +return __dn_skipname (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_resolv___dn_skipname=yes +else + ac_cv_lib_resolv___dn_skipname=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_resolv___dn_skipname" >&5 +$as_echo "$ac_cv_lib_resolv___dn_skipname" >&6; } +if test "x$ac_cv_lib_resolv___dn_skipname" = xyes; then : + cat >>confdefs.h <<_ACEOF +@%:@define HAVE_LIBRESOLV 1 +_ACEOF + + LIBS="-lresolv $LIBS" + +fi + + +fi + + +fi + + +# lzo compression requirements +ac_fn_c_check_type "$LINENO" "ptrdiff_t" "ac_cv_type_ptrdiff_t" "$ac_includes_default" +if test "x$ac_cv_type_ptrdiff_t" = xyes; then : + +else + +cat >>confdefs.h <<_ACEOF +@%:@define ptrdiff_t long +_ACEOF + +fi + +ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" +if test "x$ac_cv_type_size_t" = xyes; then : + +else + +cat >>confdefs.h <<_ACEOF +@%:@define size_t unsigned int +_ACEOF + +fi + +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of short" >&5 +$as_echo_n "checking size of short... " >&6; } +if ${ac_cv_sizeof_short+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (short))" "ac_cv_sizeof_short" "$ac_includes_default"; then : + +else + if test "$ac_cv_type_short" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute sizeof (short) +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof_short=0 + fi +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_short" >&5 +$as_echo "$ac_cv_sizeof_short" >&6; } + + + +cat >>confdefs.h <<_ACEOF +@%:@define SIZEOF_SHORT $ac_cv_sizeof_short +_ACEOF + + +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of int" >&5 +$as_echo_n "checking size of int... " >&6; } +if ${ac_cv_sizeof_int+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (int))" "ac_cv_sizeof_int" "$ac_includes_default"; then : + +else + if test "$ac_cv_type_int" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute sizeof (int) +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof_int=0 + fi +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_int" >&5 +$as_echo "$ac_cv_sizeof_int" >&6; } + + + +cat >>confdefs.h <<_ACEOF +@%:@define SIZEOF_INT $ac_cv_sizeof_int +_ACEOF + + +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long" >&5 +$as_echo_n "checking size of long... " >&6; } +if ${ac_cv_sizeof_long+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long))" "ac_cv_sizeof_long" "$ac_includes_default"; then : + +else + if test "$ac_cv_type_long" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute sizeof (long) +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof_long=0 + fi +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long" >&5 +$as_echo "$ac_cv_sizeof_long" >&6; } + + + +cat >>confdefs.h <<_ACEOF +@%:@define SIZEOF_LONG $ac_cv_sizeof_long +_ACEOF + + +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long long" >&5 +$as_echo_n "checking size of long long... " >&6; } +if ${ac_cv_sizeof_long_long+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long long))" "ac_cv_sizeof_long_long" "$ac_includes_default"; then : + +else + if test "$ac_cv_type_long_long" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute sizeof (long long) +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof_long_long=0 + fi +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long_long" >&5 +$as_echo "$ac_cv_sizeof_long_long" >&6; } + + + +cat >>confdefs.h <<_ACEOF +@%:@define SIZEOF_LONG_LONG $ac_cv_sizeof_long_long +_ACEOF + + +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of __int64" >&5 +$as_echo_n "checking size of __int64... " >&6; } +if ${ac_cv_sizeof___int64+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (__int64))" "ac_cv_sizeof___int64" "$ac_includes_default"; then : + +else + if test "$ac_cv_type___int64" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute sizeof (__int64) +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof___int64=0 + fi +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof___int64" >&5 +$as_echo "$ac_cv_sizeof___int64" >&6; } + + + +cat >>confdefs.h <<_ACEOF +@%:@define SIZEOF___INT64 $ac_cv_sizeof___int64 +_ACEOF + + +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of void *" >&5 +$as_echo_n "checking size of void *... " >&6; } +if ${ac_cv_sizeof_void_p+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (void *))" "ac_cv_sizeof_void_p" "$ac_includes_default"; then : + +else + if test "$ac_cv_type_void_p" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute sizeof (void *) +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof_void_p=0 + fi +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_void_p" >&5 +$as_echo "$ac_cv_sizeof_void_p" >&6; } + + + +cat >>confdefs.h <<_ACEOF +@%:@define SIZEOF_VOID_P $ac_cv_sizeof_void_p +_ACEOF + + +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of size_t" >&5 +$as_echo_n "checking size of size_t... " >&6; } +if ${ac_cv_sizeof_size_t+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (size_t))" "ac_cv_sizeof_size_t" "$ac_includes_default"; then : + +else + if test "$ac_cv_type_size_t" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute sizeof (size_t) +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof_size_t=0 + fi +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_size_t" >&5 +$as_echo "$ac_cv_sizeof_size_t" >&6; } + + + +cat >>confdefs.h <<_ACEOF +@%:@define SIZEOF_SIZE_T $ac_cv_sizeof_size_t +_ACEOF + + +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of ptrdiff_t" >&5 +$as_echo_n "checking size of ptrdiff_t... " >&6; } +if ${ac_cv_sizeof_ptrdiff_t+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (ptrdiff_t))" "ac_cv_sizeof_ptrdiff_t" "$ac_includes_default"; then : + +else + if test "$ac_cv_type_ptrdiff_t" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute sizeof (ptrdiff_t) +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof_ptrdiff_t=0 + fi +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_ptrdiff_t" >&5 +$as_echo "$ac_cv_sizeof_ptrdiff_t" >&6; } + + + +cat >>confdefs.h <<_ACEOF +@%:@define SIZEOF_PTRDIFF_T $ac_cv_sizeof_ptrdiff_t +_ACEOF + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5 +$as_echo_n "checking for an ANSI C-conforming const... " >&6; } +if ${ac_cv_c_const+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + +#ifndef __cplusplus + /* Ultrix mips cc rejects this sort of thing. */ + typedef int charset[2]; + const charset cs = { 0, 0 }; + /* SunOS 4.1.1 cc rejects this. */ + char const *const *pcpcc; + char **ppc; + /* 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"; + pcpcc = &g + (g ? g-g : 0); + /* HPUX 7.0 cc rejects these. */ + ++pcpcc; + ppc = (char**) pcpcc; + pcpcc = (char const *const *) ppc; + { /* SCO 3.2v4 cc rejects this sort of thing. */ + char tx; + char *t = &tx; + char const *s = 0 ? (char *) 0 : (char const *) 0; + + *t++ = 0; + if (s) return 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 sort of thing, saying + "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ + struct s { int j; const int *ap[3]; } bx; + struct s *b = &bx; b->j = 5; + } + { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ + const int foo = 10; + if (!foo) return 0; + } + return !cs[0] && !zero.x; +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_c_const=yes +else + ac_cv_c_const=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5 +$as_echo "$ac_cv_c_const" >&6; } +if test $ac_cv_c_const = no; then + +$as_echo "@%:@define const /**/" >>confdefs.h + +fi + +for ac_func in memcmp memcpy memmove memset +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +@%:@define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for union semun" >&5 +$as_echo_n "checking for union semun... " >&6; } +if ${ac_cv_struct_semun+:} false; then : + $as_echo_n "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + #include + #include ; + +int +main () +{ + + union semun semdat; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_struct_semun=yes +else + ac_cv_struct_semun=no + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + + +fi + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_struct_semun" >&5 +$as_echo "$ac_cv_struct_semun" >&6; } +if test "$ac_cv_struct_semun" = "yes"; then + +$as_echo "@%:@define HAVE_SEMUN 1" >>confdefs.h + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for the %z format string in printf()" >&5 +$as_echo_n "checking for the %z format string in printf()... " >&6; } +if test "$cross_compiling" = yes; then : + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include + +int main() { +int i; +size_t s; +char string[16]; + + s = 12345; + i = snprintf(string,16,"%zu", s); + + return i == 5 ? 0 : 1; +} + +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + +$as_echo "@%:@define HAVE_SIZE_T_Z_FORMAT 1" >>confdefs.h + + +else + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + +#AC_CONFIG_FILES([Makefile]) +ac_config_files="$ac_config_files Makefile bin/Makefile man/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 overridden 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, we kill variables containing newlines. +# 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. +( + for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done + + (set) 2>&1 | + case $as_nl`(ac_space=' '; set) 2>&1` in #( + *${as_nl}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 "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) | + sed ' + /^ac_cv_env_/b end + t clear + :clear + s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ + t end + s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ + :end' >>confcache +if diff "$cache_file" confcache >/dev/null 2>&1; then :; else + if test -w "$cache_file"; then + if test "x$cache_file" != "x/dev/null"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 +$as_echo "$as_me: updating cache $cache_file" >&6;} + if test ! -f "$cache_file" || test -h "$cache_file"; then + cat confcache >"$cache_file" + else + case $cache_file in #( + */* | ?:*) + mv -f confcache "$cache_file"$$ && + mv -f "$cache_file"$$ "$cache_file" ;; #( + *) + mv -f confcache "$cache_file" ;; + esac + fi + fi + else + { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 +$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} + 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}' + +DEFS=-DHAVE_CONFIG_H + +ac_libobjs= +ac_ltlibobjs= +U= +for ac_i in : $LIB@&t@OBJS; do test "x$ac_i" = x: && continue + # 1. Remove the extension, and $U if already installed. + ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' + ac_i=`$as_echo "$ac_i" | sed "$ac_script"` + # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR + # will be set to the directory where LIBOBJS objects are built. + as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" + as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' +done +LIB@&t@OBJS=$ac_libobjs + +LTLIBOBJS=$ac_ltlibobjs + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5 +$as_echo_n "checking that generated files are newer than configure... " >&6; } + if test -n "$am_sleep_pid"; then + # Hide warnings about reused PIDs. + wait $am_sleep_pid 2>/dev/null + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5 +$as_echo "done" >&6; } + if test -n "$EXEEXT"; then + am__EXEEXT_TRUE= + am__EXEEXT_FALSE='#' +else + am__EXEEXT_TRUE='#' + am__EXEEXT_FALSE= +fi + +if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then + as_fn_error $? "conditional \"AMDEP\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then + as_fn_error $? "conditional \"am__fastdepCC\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${FT2NFDUMP_TRUE}" && test -z "${FT2NFDUMP_FALSE}"; then + as_fn_error $? "conditional \"FT2NFDUMP\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${FT2NFDUMP_TRUE}" && test -z "${FT2NFDUMP_FALSE}"; then + as_fn_error $? "conditional \"FT2NFDUMP\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${NFPROFILE_TRUE}" && test -z "${NFPROFILE_FALSE}"; then + as_fn_error $? "conditional \"NFPROFILE\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${NFPROFILE_TRUE}" && test -z "${NFPROFILE_FALSE}"; then + as_fn_error $? "conditional \"NFPROFILE\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${NFTRACK_TRUE}" && test -z "${NFTRACK_FALSE}"; then + as_fn_error $? "conditional \"NFTRACK\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${NFTRACK_TRUE}" && test -z "${NFTRACK_FALSE}"; then + as_fn_error $? "conditional \"NFTRACK\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${SFLOW_TRUE}" && test -z "${SFLOW_FALSE}"; then + as_fn_error $? "conditional \"SFLOW\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${READPCAP_TRUE}" && test -z "${READPCAP_FALSE}"; then + as_fn_error $? "conditional \"READPCAP\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${BUILDNFPCAPD_TRUE}" && test -z "${BUILDNFPCAPD_FALSE}"; then + as_fn_error $? "conditional \"BUILDNFPCAPD\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi + + +: "${CONFIG_STATUS=./config.status}" +ac_write_fail=0 +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files $CONFIG_STATUS" +{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 +$as_echo "$as_me: creating $CONFIG_STATUS" >&6;} +as_write_fail=0 +cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 +#! $SHELL +# Generated by $as_me. +# 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 +ac_cs_recheck=false +ac_cs_silent=false + +SHELL=\${CONFIG_SHELL-$SHELL} +export SHELL +_ASEOF +cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in @%:@( + *posix*) : + set -o posix ;; @%:@( + *) : + ;; +esac +fi + + +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in @%:@( + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +as_myself= +case $0 in @%:@(( + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + + +@%:@ as_fn_error STATUS ERROR [LINENO LOG_FD] +@%:@ ---------------------------------------- +@%:@ Output "`basename @S|@0`: error: ERROR" to stderr. If LINENO and LOG_FD are +@%:@ provided, also output the error to LOG_FD, referencing LINENO. Then exit the +@%:@ script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + $as_echo "$as_me: error: $2" >&2 + as_fn_exit $as_status +} @%:@ as_fn_error + + +@%:@ as_fn_set_status STATUS +@%:@ ----------------------- +@%:@ Set @S|@? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} @%:@ as_fn_set_status + +@%:@ as_fn_exit STATUS +@%:@ ----------------- +@%:@ Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} @%:@ as_fn_exit + +@%:@ as_fn_unset VAR +@%:@ --------------- +@%:@ Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset +@%:@ as_fn_append VAR VALUE +@%:@ ---------------------- +@%:@ Append the text in VALUE to the end of the definition contained in VAR. Take +@%:@ advantage of any shell optimizations that allow amortized linear growth over +@%:@ repeated appends, instead of the typical quadratic growth present in naive +@%:@ implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +@%:@ as_fn_arith ARG... +@%:@ ------------------ +@%:@ Perform arithmetic evaluation on the ARGs, and store the result in the +@%:@ global @S|@as_val. Take advantage of shells that can avoid forks. The arguments +@%:@ must be portable across @S|@(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# 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 + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in @%:@((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -pR'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -pR' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -pR' + fi +else + as_ln_s='cp -pR' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + + +@%:@ as_fn_mkdir_p +@%:@ ------------- +@%:@ Create "@S|@as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} @%:@ as_fn_mkdir_p +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + + +@%:@ as_fn_executable_p FILE +@%:@ ----------------------- +@%:@ Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} @%:@ as_fn_executable_p +as_test_x='test -x' +as_executable_p=as_fn_executable_p + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +exec 6>&1 +## ----------------------------------- ## +## Main body of $CONFIG_STATUS script. ## +## ----------------------------------- ## +_ASEOF +test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# Save the log message, to keep $0 and so on meaningful, and to +# report actual input values of CONFIG_FILES etc. instead of their +# values after options handling. +ac_log=" +This file was extended by nfdump $as_me 1.6.13, which was +generated by GNU Autoconf 2.69. Invocation command line was + + CONFIG_FILES = $CONFIG_FILES + CONFIG_HEADERS = $CONFIG_HEADERS + CONFIG_LINKS = $CONFIG_LINKS + CONFIG_COMMANDS = $CONFIG_COMMANDS + $ $0 $@ + +on `(hostname || uname -n) 2>/dev/null | sed 1q` +" + +_ACEOF + +case $ac_config_files in *" +"*) set x $ac_config_files; shift; ac_config_files=$*;; +esac + +case $ac_config_headers in *" +"*) set x $ac_config_headers; shift; ac_config_headers=$*;; +esac + + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +# Files that config.status was made for. +config_files="$ac_config_files" +config_headers="$ac_config_headers" +config_commands="$ac_config_commands" + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +ac_cs_usage="\ +\`$as_me' instantiates files and other configuration actions +from templates according to the current configuration. Unless the files +and actions are specified as TAGs, all are instantiated by default. + +Usage: $0 [OPTION]... [TAG]... + + -h, --help print this help, then exit + -V, --version print version number and configuration settings, then exit + --config print configuration, then exit + -q, --quiet, --silent + do not print progress messages + -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 ." + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" +ac_cs_version="\\ +nfdump config.status 1.6.13 +configured by $0, generated by GNU Autoconf 2.69, + with options \\"\$ac_cs_config\\" + +Copyright (C) 2012 Free Software Foundation, Inc. +This config.status script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it." + +ac_pwd='$ac_pwd' +srcdir='$srcdir' +INSTALL='$INSTALL' +MKDIR_P='$MKDIR_P' +AWK='$AWK' +test -n "\$AWK" || AWK=awk +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# The default lists apply if the user does not specify any file. +ac_need_defaults=: +while test $# != 0 +do + case $1 in + --*=?*) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` + ac_shift=: + ;; + --*=) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg= + ac_shift=: + ;; + *) + ac_option=$1 + ac_optarg=$2 + ac_shift=shift + ;; + esac + + case $ac_option in + # Handling of the options. + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + ac_cs_recheck=: ;; + --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) + $as_echo "$ac_cs_version"; exit ;; + --config | --confi | --conf | --con | --co | --c ) + $as_echo "$ac_cs_config"; exit ;; + --debug | --debu | --deb | --de | --d | -d ) + debug=: ;; + --file | --fil | --fi | --f ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + '') as_fn_error $? "missing file argument" ;; + esac + as_fn_append CONFIG_FILES " '$ac_optarg'" + ac_need_defaults=false;; + --header | --heade | --head | --hea ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + as_fn_append CONFIG_HEADERS " '$ac_optarg'" + ac_need_defaults=false;; + --he | --h) + # Conflict between --help and --header + as_fn_error $? "ambiguous option: \`$1' +Try \`$0 --help' for more information.";; + --help | --hel | -h ) + $as_echo "$ac_cs_usage"; exit ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil | --si | --s) + ac_cs_silent=: ;; + + # This is an error. + -*) as_fn_error $? "unrecognized option: \`$1' +Try \`$0 --help' for more information." ;; + + *) as_fn_append ac_config_targets " $1" + ac_need_defaults=false ;; + + esac + shift +done + +ac_configure_extra_args= + +if $ac_cs_silent; then + exec 6>/dev/null + ac_configure_extra_args="$ac_configure_extra_args --silent" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +if \$ac_cs_recheck; then + set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion + shift + \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 + CONFIG_SHELL='$SHELL' + export CONFIG_SHELL + exec "\$@" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../@%:@@%:@ /;s/...$/ @%:@@%:@/;p;x;p;x' <<_ASBOX +@%:@@%:@ Running $as_me. @%:@@%:@ +_ASBOX + $as_echo "$ac_log" +} >&5 + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +# +# INIT-COMMANDS +# +AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 + +# Handling of arguments. +for ac_config_target in $ac_config_targets +do + case $ac_config_target in + "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; + "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; + "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; + "bin/Makefile") CONFIG_FILES="$CONFIG_FILES bin/Makefile" ;; + "man/Makefile") CONFIG_FILES="$CONFIG_FILES man/Makefile" ;; + + *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; + 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 + +# Have a temporary directory for convenience. Make it in the build tree +# simply because there is no reason against having it here, and in addition, +# creating and moving files from /tmp can sometimes cause problems. +# Hook for its removal unless debugging. +# Note that there is a small window in which the directory will not be cleaned: +# after its creation but before its name has been assigned to `$tmp'. +$debug || +{ + tmp= ac_tmp= + trap 'exit_status=$? + : "${ac_tmp:=$tmp}" + { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status +' 0 + trap 'as_fn_exit 1' 1 2 13 15 +} +# Create a (secure) tmp directory for tmp files. + +{ + tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && + test -d "$tmp" +} || +{ + tmp=./conf$$-$RANDOM + (umask 077 && mkdir "$tmp") +} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 +ac_tmp=$tmp + +# Set up the scripts for CONFIG_FILES section. +# No need to generate them if there are no CONFIG_FILES. +# This happens for instance with `./config.status config.h'. +if test -n "$CONFIG_FILES"; then + + +ac_cr=`echo X | tr X '\015'` +# On cygwin, bash can eat \r inside `` if the user requested igncr. +# But we know of no other shell where ac_cr would be empty at this +# point, so we can use a bashism as a fallback. +if test "x$ac_cr" = x; then + eval ac_cr=\$\'\\r\' +fi +ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` +if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then + ac_cs_awk_cr='\\r' +else + ac_cs_awk_cr=$ac_cr +fi + +echo 'BEGIN {' >"$ac_tmp/subs1.awk" && +_ACEOF + + +{ + echo "cat >conf$$subs.awk <<_ACEOF" && + echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && + echo "_ACEOF" +} >conf$$subs.sh || + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 +ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` +ac_delim='%!_!# ' +for ac_last_try in false false false false false :; do + . ./conf$$subs.sh || + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 + + ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` + if test $ac_delim_n = $ac_delim_num; then + break + elif $ac_last_try; then + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done +rm -f conf$$subs.sh + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && +_ACEOF +sed -n ' +h +s/^/S["/; s/!.*/"]=/ +p +g +s/^[^!]*!// +:repl +t repl +s/'"$ac_delim"'$// +t delim +:nl +h +s/\(.\{148\}\)..*/\1/ +t more1 +s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ +p +n +b repl +:more1 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t nl +:delim +h +s/\(.\{148\}\)..*/\1/ +t more2 +s/["\\]/\\&/g; s/^/"/; s/$/"/ +p +b +:more2 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t delim +' >$CONFIG_STATUS || ac_write_fail=1 +rm -f conf$$subs.awk +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +_ACAWK +cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && + for (key in S) S_is_set[key] = 1 + FS = "" + +} +{ + line = $ 0 + nfields = split(line, field, "@") + substed = 0 + len = length(field[1]) + for (i = 2; i < nfields; i++) { + key = field[i] + keylen = length(key) + if (S_is_set[key]) { + value = S[key] + line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) + len += length(value) + length(field[++i]) + substed = 1 + } else + len += 1 + keylen + } + + print line +} + +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then + sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" +else + cat +fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ + || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 +_ACEOF + +# VPATH may cause trouble with some makes, so we remove sole $(srcdir), +# ${srcdir} and @srcdir@ entries 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[ ]*=[ ]*/{ +h +s/// +s/^/:/ +s/[ ]*$/:/ +s/:\$(srcdir):/:/g +s/:\${srcdir}:/:/g +s/:@srcdir@:/:/g +s/^:*// +s/:*$// +x +s/\(=[ ]*\).*/\1/ +G +s/\n// +s/^[^=]*=[ ]*$// +}' +fi + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +fi # test -n "$CONFIG_FILES" + +# Set up the scripts for CONFIG_HEADERS section. +# No need to generate them if there are no CONFIG_HEADERS. +# This happens for instance with `./config.status Makefile'. +if test -n "$CONFIG_HEADERS"; then +cat >"$ac_tmp/defines.awk" <<\_ACAWK || +BEGIN { +_ACEOF + +# Transform confdefs.h into an awk script `defines.awk', embedded as +# here-document in config.status, that substitutes the proper values into +# config.h.in to produce config.h. + +# Create a delimiter string that does not exist in confdefs.h, to ease +# handling of long lines. +ac_delim='%!_!# ' +for ac_last_try in false false :; do + ac_tt=`sed -n "/$ac_delim/p" confdefs.h` + if test -z "$ac_tt"; then + break + elif $ac_last_try; then + as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done + +# For the awk script, D is an array of macro values keyed by name, +# likewise P contains macro parameters if any. Preserve backslash +# newline sequences. + +ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* +sed -n ' +s/.\{148\}/&'"$ac_delim"'/g +t rset +:rset +s/^[ ]*#[ ]*define[ ][ ]*/ / +t def +d +:def +s/\\$// +t bsnl +s/["\\]/\\&/g +s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ +D["\1"]=" \3"/p +s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p +d +:bsnl +s/["\\]/\\&/g +s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ +D["\1"]=" \3\\\\\\n"\\/p +t cont +s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p +t cont +d +:cont +n +s/.\{148\}/&'"$ac_delim"'/g +t clear +:clear +s/\\$// +t bsnlc +s/["\\]/\\&/g; s/^/"/; s/$/"/p +d +:bsnlc +s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p +b cont +' >$CONFIG_STATUS || ac_write_fail=1 + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + for (key in D) D_is_set[key] = 1 + FS = "" +} +/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { + line = \$ 0 + split(line, arg, " ") + if (arg[1] == "#") { + defundef = arg[2] + mac1 = arg[3] + } else { + defundef = substr(arg[1], 2) + mac1 = arg[2] + } + split(mac1, mac2, "(") #) + macro = mac2[1] + prefix = substr(line, 1, index(line, defundef) - 1) + if (D_is_set[macro]) { + # Preserve the white space surrounding the "#". + print prefix "define", macro P[macro] D[macro] + next + } else { + # Replace #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. + if (defundef == "undef") { + print "/*", prefix defundef, macro, "*/" + next + } + } +} +{ print } +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 + as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 +fi # test -n "$CONFIG_HEADERS" + + +eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" +shift +for ac_tag +do + case $ac_tag in + :[FHLC]) ac_mode=$ac_tag; continue;; + esac + case $ac_mode$ac_tag in + :[FHL]*:*);; + :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; + :[FH]-) ac_tag=-:-;; + :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; + esac + ac_save_IFS=$IFS + IFS=: + set x $ac_tag + IFS=$ac_save_IFS + shift + ac_file=$1 + shift + + case $ac_mode in + :L) ac_source=$1;; + :[FH]) + ac_file_inputs= + for ac_f + do + case $ac_f in + -) ac_f="$ac_tmp/stdin";; + *) # Look for the file first in the build tree, then in the source tree + # (if the path is not absolute). The absolute path cannot be DOS-style, + # because $ac_f cannot contain `:'. + test -f "$ac_f" || + case $ac_f in + [\\/$]*) false;; + *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; + esac || + as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; + esac + case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac + as_fn_append ac_file_inputs " '$ac_f'" + done + + # 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 by config.status. */ + configure_input='Generated from '` + $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' + `' by configure.' + if test x"$ac_file" != x-; then + configure_input="$ac_file. $configure_input" + { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 +$as_echo "$as_me: creating $ac_file" >&6;} + fi + # Neutralize special characters interpreted by sed in replacement strings. + case $configure_input in #( + *\&* | *\|* | *\\* ) + ac_sed_conf_input=`$as_echo "$configure_input" | + sed 's/[\\\\&|]/\\\\&/g'`;; #( + *) ac_sed_conf_input=$configure_input;; + esac + + case $ac_tag in + *:-:* | *:-) cat >"$ac_tmp/stdin" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; + esac + ;; + esac + + ac_dir=`$as_dirname -- "$ac_file" || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + as_dir="$ac_dir"; as_fn_mkdir_p + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + + case $ac_mode in + :F) + # + # CONFIG_FILE + # + + case $INSTALL in + [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; + *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; + esac + ac_MKDIR_P=$MKDIR_P + case $MKDIR_P in + [\\/$]* | ?:[\\/]* ) ;; + */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; + esac +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# If the template does not know about datarootdir, expand it. +# FIXME: This hack should be removed a few years after 2.60. +ac_datarootdir_hack=; ac_datarootdir_seen= +ac_sed_dataroot=' +/datarootdir/ { + p + q +} +/@datadir@/p +/@docdir@/p +/@infodir@/p +/@localedir@/p +/@mandir@/p' +case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in +*datarootdir*) ac_datarootdir_seen=yes;; +*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + ac_datarootdir_hack=' + s&@datadir@&$datadir&g + s&@docdir@&$docdir&g + s&@infodir@&$infodir&g + s&@localedir@&$localedir&g + s&@mandir@&$mandir&g + s&\\\${datarootdir}&$datarootdir&g' ;; +esac +_ACEOF + +# Neutralize VPATH when `$srcdir' = `.'. +# Shell code in configure.ac might set extrasub. +# FIXME: do we really want to maintain this feature? +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_sed_extra="$ac_vpsub +$extrasub +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +:t +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +s|@configure_input@|$ac_sed_conf_input|;t t +s&@top_builddir@&$ac_top_builddir_sub&;t t +s&@top_build_prefix@&$ac_top_build_prefix&;t t +s&@srcdir@&$ac_srcdir&;t t +s&@abs_srcdir@&$ac_abs_srcdir&;t t +s&@top_srcdir@&$ac_top_srcdir&;t t +s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t +s&@builddir@&$ac_builddir&;t t +s&@abs_builddir@&$ac_abs_builddir&;t t +s&@abs_top_builddir@&$ac_abs_top_builddir&;t t +s&@INSTALL@&$ac_INSTALL&;t t +s&@MKDIR_P@&$ac_MKDIR_P&;t t +$ac_datarootdir_hack +" +eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ + >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + +test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && + { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && + { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ + "$ac_tmp/out"`; test -z "$ac_out"; } && + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined" >&5 +$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined" >&2;} + + rm -f "$ac_tmp/stdin" + case $ac_file in + -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; + *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; + esac \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + ;; + :H) + # + # CONFIG_HEADER + # + if test x"$ac_file" != x-; then + { + $as_echo "/* $configure_input */" \ + && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" + } >"$ac_tmp/config.h" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then + { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 +$as_echo "$as_me: $ac_file is unchanged" >&6;} + else + rm -f "$ac_file" + mv "$ac_tmp/config.h" "$ac_file" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + fi + else + $as_echo "/* $configure_input */" \ + && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ + || as_fn_error $? "could not create -" "$LINENO" 5 + fi +# Compute "$ac_file"'s index in $config_headers. +_am_arg="$ac_file" +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $_am_arg | $_am_arg:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || +$as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$_am_arg" : 'X\(//\)[^/]' \| \ + X"$_am_arg" : 'X\(//\)$' \| \ + X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$_am_arg" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'`/stamp-h$_am_stamp_count + ;; + + :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 +$as_echo "$as_me: executing $ac_file commands" >&6;} + ;; + esac + + + case $ac_file$ac_mode in + "depfiles":C) test x"$AMDEP_TRUE" != x"" || { + # Older Autoconf quotes --file arguments for eval, but not when files + # are listed without --file. Let's play safe and only enable the eval + # if we detect the quoting. + case $CONFIG_FILES in + *\'*) eval set x "$CONFIG_FILES" ;; + *) set x $CONFIG_FILES ;; + esac + shift + for mf + do + # Strip MF so we end up with the name of the file. + mf=`echo "$mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile or not. + # We used to match only the files named 'Makefile.in', but + # some people rename them; so instead we look at the file content. + # Grep'ing the first line is not enough: some people post-process + # each Makefile.in and add a new line on top of each file to say so. + # Grep'ing the whole file is not good either: AIX grep has a line + # limit of 2048, but all sed's we know have understand at least 4000. + if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then + dirpart=`$as_dirname -- "$mf" || +$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$mf" : 'X\(//\)[^/]' \| \ + X"$mf" : 'X\(//\)$' \| \ + X"$mf" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$mf" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + else + continue + fi + # Extract the definition of DEPDIR, am__include, and am__quote + # from the Makefile without running 'make'. + DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` + test -z "$DEPDIR" && continue + am__include=`sed -n 's/^am__include = //p' < "$mf"` + test -z "$am__include" && continue + am__quote=`sed -n 's/^am__quote = //p' < "$mf"` + # Find all dependency output files, they are included files with + # $(DEPDIR) in their names. 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 " + s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do + # Make sure the directory exists. + test -f "$dirpart/$file" && continue + fdir=`$as_dirname -- "$file" || +$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$file" : 'X\(//\)[^/]' \| \ + X"$file" : 'X\(//\)$' \| \ + X"$file" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + as_dir=$dirpart/$fdir; as_fn_mkdir_p + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" + done + done +} + ;; + + esac +done # for ac_tag + + +as_fn_exit 0 +_ACEOF +ac_clean_files=$ac_clean_files_save + +test $ac_write_fail = 0 || + as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 + + +# 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=: + ac_config_status_args= + test "$silent" = yes && + ac_config_status_args="$ac_config_status_args --quiet" + exec 5>/dev/null + $SHELL $CONFIG_STATUS $ac_config_status_args || 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 || as_fn_exit 1 +fi +if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 +$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} +fi + + +echo "" +echo "* Many thanks for using nfdump tools" +echo "* You may want to subscribe to the nfdump-discuss and/or" +echo "* nfsen-discuss mailing list:" +echo "* http://lists.sourceforge.net/lists/listinfo/nfdump-discuss" +echo "* http://lists.sourceforge.net/lists/listinfo/nfsen-discuss" +echo "* Please send bug reports back to me: phaag@users.sourceforge.net" +echo "* or to one of the lists." + diff --git a/autom4te.cache/output.1 b/autom4te.cache/output.1 new file mode 100644 index 0000000..35f5a55 --- /dev/null +++ b/autom4te.cache/output.1 @@ -0,0 +1,9524 @@ +@%:@! /bin/sh +@%:@ From configure.ac Revision: 243 . +@%:@ Guess values for system-dependent variables and create Makefiles. +@%:@ Generated by GNU Autoconf 2.69 for nfdump 1.6.13. +@%:@ +@%:@ Report bugs to . +@%:@ +@%:@ +@%:@ Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. +@%:@ +@%:@ +@%:@ This configure script is free software; the Free Software Foundation +@%:@ gives unlimited permission to copy, distribute and modify it. +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in @%:@( + *posix*) : + set -o posix ;; @%:@( + *) : + ;; +esac +fi + + +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in @%:@( + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +as_myself= +case $0 in @%:@(( + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +# Use a proper internal environment variable to ensure we don't fall + # into an infinite loop, continuously re-executing ourselves. + if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then + _as_can_reexec=no; export _as_can_reexec; + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in @%:@ (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed `exec'. +$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +as_fn_exit 255 + fi + # We don't want this to propagate to other subprocesses. + { _as_can_reexec=; unset _as_can_reexec;} +if test "x$CONFIG_SHELL" = x; then + as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which + # is contrary to our usage. Disable this feature. + alias -g '\${1+\"\$@\"}'='\"\$@\"' + setopt NO_GLOB_SUBST +else + case \`(set -o) 2>/dev/null\` in @%:@( + *posix*) : + set -o posix ;; @%:@( + *) : + ;; +esac +fi +" + as_required="as_fn_return () { (exit \$1); } +as_fn_success () { as_fn_return 0; } +as_fn_failure () { as_fn_return 1; } +as_fn_ret_success () { return 0; } +as_fn_ret_failure () { return 1; } + +exitcode=0 +as_fn_success || { exitcode=1; echo as_fn_success failed.; } +as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } +as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } +as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } +if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : + +else + exitcode=1; echo positional parameters were not saved. +fi +test x\$exitcode = x0 || exit 1 +test -x / || exit 1" + as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO + as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO + eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && + test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 +test \$(( 1 + 1 )) = 2 || exit 1" + if (eval "$as_required") 2>/dev/null; then : + as_have_required=yes +else + as_have_required=no +fi + if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : + +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_found=false +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + as_found=: + case $as_dir in @%:@( + /*) + for as_base in sh bash ksh sh5; do + # Try only shells that exist, to save several forks. + as_shell=$as_dir/$as_base + if { test -f "$as_shell" || test -f "$as_shell.exe"; } && + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : + CONFIG_SHELL=$as_shell as_have_required=yes + if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : + break 2 +fi +fi + done;; + esac + as_found=false +done +$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : + CONFIG_SHELL=$SHELL as_have_required=yes +fi; } +IFS=$as_save_IFS + + + if test "x$CONFIG_SHELL" != x; then : + export CONFIG_SHELL + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in @%:@ (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed `exec'. +$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +exit 255 +fi + + if test x$as_have_required = xno; then : + $as_echo "$0: This script requires a shell more modern than all" + $as_echo "$0: the shells that I found on your system." + if test x${ZSH_VERSION+set} = xset ; then + $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" + $as_echo "$0: be upgraded to zsh 4.3.4 or later." + else + $as_echo "$0: Please tell bug-autoconf@gnu.org and +$0: phaag@users.sourceforge.net about your system, +$0: including any error possibly output before this +$0: message. Then install a modern shell, or manually run +$0: the script under such a shell if you do have one." + fi + exit 1 +fi +fi +fi +SHELL=${CONFIG_SHELL-/bin/sh} +export SHELL +# Unset more variables known to interfere with behavior of common tools. +CLICOLOR_FORCE= GREP_OPTIONS= +unset CLICOLOR_FORCE GREP_OPTIONS + +## --------------------- ## +## M4sh Shell Functions. ## +## --------------------- ## +@%:@ as_fn_unset VAR +@%:@ --------------- +@%:@ Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset + +@%:@ as_fn_set_status STATUS +@%:@ ----------------------- +@%:@ Set @S|@? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} @%:@ as_fn_set_status + +@%:@ as_fn_exit STATUS +@%:@ ----------------- +@%:@ Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} @%:@ as_fn_exit + +@%:@ as_fn_mkdir_p +@%:@ ------------- +@%:@ Create "@S|@as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} @%:@ as_fn_mkdir_p + +@%:@ as_fn_executable_p FILE +@%:@ ----------------------- +@%:@ Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} @%:@ as_fn_executable_p +@%:@ as_fn_append VAR VALUE +@%:@ ---------------------- +@%:@ Append the text in VALUE to the end of the definition contained in VAR. Take +@%:@ advantage of any shell optimizations that allow amortized linear growth over +@%:@ repeated appends, instead of the typical quadratic growth present in naive +@%:@ implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +@%:@ as_fn_arith ARG... +@%:@ ------------------ +@%:@ Perform arithmetic evaluation on the ARGs, and store the result in the +@%:@ global @S|@as_val. Take advantage of shells that can avoid forks. The arguments +@%:@ must be portable across @S|@(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + +@%:@ as_fn_error STATUS ERROR [LINENO LOG_FD] +@%:@ ---------------------------------------- +@%:@ Output "`basename @S|@0`: error: ERROR" to stderr. If LINENO and LOG_FD are +@%:@ provided, also output the error to LOG_FD, referencing LINENO. Then exit the +@%:@ script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + $as_echo "$as_me: error: $2" >&2 + as_fn_exit $as_status +} @%:@ as_fn_error + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# 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 + + + as_lineno_1=$LINENO as_lineno_1a=$LINENO + as_lineno_2=$LINENO as_lineno_2a=$LINENO + eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && + test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { + # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) + sed -n ' + p + /[$]LINENO/= + ' <$as_myself | + sed ' + s/[$]LINENO.*/&-/ + t lineno + b + :lineno + N + :loop + s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ + t loop + s/-\n.*// + ' >$as_me.lineno && + chmod +x "$as_me.lineno" || + { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } + + # If we had to re-execute with $CONFIG_SHELL, we're ensured to have + # already done that, so ensure we don't try to do so again and fall + # in an infinite loop. This has already happened in practice. + _as_can_reexec=no; export _as_can_reexec + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensitive to this). + . "./$as_me.lineno" + # Exit status is that of the last command. + exit +} + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in @%:@((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -pR'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -pR' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -pR' + fi +else + as_ln_s='cp -pR' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +as_test_x='test -x' +as_executable_p=as_fn_executable_p + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +test -n "$DJDIR" || exec 7<&0 &1 + +# Name of the host. +# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, +# so uname gets run too. +ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` + +# +# Initializations. +# +ac_default_prefix=/usr/local +ac_clean_files= +ac_config_libobj_dir=. +LIB@&t@OBJS= +cross_compiling=no +subdirs= +MFLAGS= +MAKEFLAGS= + +# Identity of this package. +PACKAGE_NAME='nfdump' +PACKAGE_TARNAME='nfdump' +PACKAGE_VERSION='1.6.13' +PACKAGE_STRING='nfdump 1.6.13' +PACKAGE_BUGREPORT='phaag@users.sourceforge.net' +PACKAGE_URL='' + +# Factoring default headers for most tests. +ac_includes_default="\ +#include +#ifdef HAVE_SYS_TYPES_H +# include +#endif +#ifdef HAVE_SYS_STAT_H +# include +#endif +#ifdef STDC_HEADERS +# include +# include +#else +# ifdef HAVE_STDLIB_H +# include +# endif +#endif +#ifdef HAVE_STRING_H +# if !defined STDC_HEADERS && defined HAVE_MEMORY_H +# include +# endif +# include +#endif +#ifdef HAVE_STRINGS_H +# include +#endif +#ifdef HAVE_INTTYPES_H +# include +#endif +#ifdef HAVE_STDINT_H +# include +#endif +#ifdef HAVE_UNISTD_H +# include +#endif" + +ac_header_list= +ac_func_list= +ac_subst_vars='am__EXEEXT_FALSE +am__EXEEXT_TRUE +LTLIBOBJS +LIB@&t@OBJS +FTS_OBJ +LFLAGS +FT_LDFLAGS +FT_INCLUDES +BUILDNFPCAPD_FALSE +BUILDNFPCAPD_TRUE +READPCAP_FALSE +READPCAP_TRUE +SFLOW_FALSE +SFLOW_TRUE +NFTRACK_FALSE +NFTRACK_TRUE +EGREP +GREP +CPP +RRD_LIBS +NFPROFILE_FALSE +NFPROFILE_TRUE +FT2NFDUMP_FALSE +FT2NFDUMP_TRUE +LEXLIB +LEX_OUTPUT_ROOT +LEX +YFLAGS +YACC +am__fastdepCC_FALSE +am__fastdepCC_TRUE +CCDEPMODE +am__nodep +AMDEPBACKSLASH +AMDEP_FALSE +AMDEP_TRUE +am__quote +am__include +DEPDIR +OBJEXT +EXEEXT +ac_ct_CC +CPPFLAGS +LDFLAGS +CFLAGS +CC +AM_BACKSLASH +AM_DEFAULT_VERBOSITY +AM_DEFAULT_V +AM_V +am__untar +am__tar +AMTAR +am__leading_dot +SET_MAKE +AWK +mkdir_p +MKDIR_P +INSTALL_STRIP_PROGRAM +STRIP +install_sh +MAKEINFO +AUTOHEADER +AUTOMAKE +AUTOCONF +ACLOCAL +VERSION +PACKAGE +CYGPATH_W +am__isrc +INSTALL_DATA +INSTALL_SCRIPT +INSTALL_PROGRAM +target_alias +host_alias +build_alias +LIBS +ECHO_T +ECHO_N +ECHO_C +DEFS +mandir +localedir +libdir +psdir +pdfdir +dvidir +htmldir +infodir +docdir +oldincludedir +includedir +localstatedir +sharedstatedir +sysconfdir +datadir +datarootdir +libexecdir +sbindir +bindir +program_transform_name +prefix +exec_prefix +PACKAGE_URL +PACKAGE_BUGREPORT +PACKAGE_STRING +PACKAGE_VERSION +PACKAGE_TARNAME +PACKAGE_NAME +PATH_SEPARATOR +SHELL' +ac_subst_files='' +ac_user_opts=' +enable_option_checking +enable_silent_rules +enable_dependency_tracking +enable_devel +enable_compat15 +enable_nsel +enable_nel +enable_fixtimebug +with_ftpath +with_rrdpath +enable_ftconv +enable_nfprofile +enable_nftrack +enable_sflow +enable_readpcap +enable_nfpcapd +' + ac_precious_vars='build_alias +host_alias +target_alias +CC +CFLAGS +LDFLAGS +LIBS +CPPFLAGS +YACC +YFLAGS +CPP' + + +# Initialize some variables set by options. +ac_init_help= +ac_init_version=false +ac_unrecognized_opts= +ac_unrecognized_sep= +# 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. +# (The list follows the same order as the GNU Coding Standards.) +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datarootdir='${prefix}/share' +datadir='${datarootdir}' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +includedir='${prefix}/include' +oldincludedir='/usr/include' +docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' +infodir='${datarootdir}/info' +htmldir='${docdir}' +dvidir='${docdir}' +pdfdir='${docdir}' +psdir='${docdir}' +libdir='${exec_prefix}/lib' +localedir='${datarootdir}/locale' +mandir='${datarootdir}/man' + +ac_prev= +ac_dashdash= +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 + + case $ac_option in + *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; + *=) ac_optarg= ;; + *) ac_optarg=yes ;; + esac + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case $ac_dashdash$ac_option in + --) + ac_dashdash=yes ;; + + -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) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=*) + datadir=$ac_optarg ;; + + -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ + | --dataroo | --dataro | --datar) + ac_prev=datarootdir ;; + -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ + | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) + datarootdir=$ac_optarg ;; + + -disable-* | --disable-*) + ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid feature name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=no ;; + + -docdir | --docdir | --docdi | --doc | --do) + ac_prev=docdir ;; + -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) + docdir=$ac_optarg ;; + + -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) + ac_prev=dvidir ;; + -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) + dvidir=$ac_optarg ;; + + -enable-* | --enable-*) + ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid feature name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=\$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 ;; + + -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) + ac_prev=htmldir ;; + -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ + | --ht=*) + htmldir=$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 ;; + + -localedir | --localedir | --localedi | --localed | --locale) + ac_prev=localedir ;; + -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) + localedir=$ac_optarg ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst | --locals) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) + 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 | -n) + 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 ;; + + -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) + ac_prev=pdfdir ;; + -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) + pdfdir=$ac_optarg ;; + + -psdir | --psdir | --psdi | --psd | --ps) + ac_prev=psdir ;; + -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) + psdir=$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_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid package name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=\$ac_optarg ;; + + -without-* | --without-*) + ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid package name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=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 ;; + + -*) as_fn_error $? "unrecognized option: \`$ac_option' +Try \`$0 --help' for more information" + ;; + + *=*) + ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` + # Reject names that are not valid shell variable names. + case $ac_envvar in #( + '' | [0-9]* | *[!_$as_cr_alnum]* ) + as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; + esac + eval $ac_envvar=\$ac_optarg + export $ac_envvar ;; + + *) + # FIXME: should be removed in autoconf 3.0. + $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && + $as_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'` + as_fn_error $? "missing argument to $ac_option" +fi + +if test -n "$ac_unrecognized_opts"; then + case $enable_option_checking in + no) ;; + fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; + *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; + esac +fi + +# Check all directory arguments for consistency. +for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ + datadir sysconfdir sharedstatedir localstatedir includedir \ + oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ + libdir localedir mandir +do + eval ac_val=\$$ac_var + # Remove trailing slashes. + case $ac_val in + */ ) + ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` + eval $ac_var=\$ac_val;; + esac + # Be sure to have absolute directory names. + case $ac_val in + [\\/$]* | ?:[\\/]* ) continue;; + NONE | '' ) case $ac_var in *prefix ) continue;; esac;; + esac + as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" +done + +# There might be people who depend on the old broken behavior: `$host' +# used to hold the argument of --host etc. +# FIXME: To remove some day. +build=$build_alias +host=$host_alias +target=$target_alias + +# FIXME: To remove some day. +if test "x$host_alias" != x; then + if test "x$build_alias" = x; then + cross_compiling=maybe + 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 + + +ac_pwd=`pwd` && test -n "$ac_pwd" && +ac_ls_di=`ls -di .` && +ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || + as_fn_error $? "working directory cannot be determined" +test "X$ac_ls_di" = "X$ac_pwd_ls_di" || + as_fn_error $? "pwd does not report name of working directory" + + +# 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 the parent directory. + ac_confdir=`$as_dirname -- "$as_myself" || +$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_myself" : 'X\(//\)[^/]' \| \ + X"$as_myself" : 'X\(//\)$' \| \ + X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_myself" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + 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 + test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." + as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" +fi +ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" +ac_abs_confdir=`( + cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" + pwd)` +# When building in place, set srcdir=. +if test "$ac_abs_confdir" = "$ac_pwd"; then + srcdir=. +fi +# Remove unnecessary trailing slashes from srcdir. +# Double slashes in file names in object file debugging info +# mess up M-x gdb in Emacs. +case $srcdir in +*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; +esac +for ac_var in $ac_precious_vars; do + eval ac_env_${ac_var}_set=\${${ac_var}+set} + eval ac_env_${ac_var}_value=\$${ac_var} + eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} + eval ac_cv_env_${ac_var}_value=\$${ac_var} +done + +# +# 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 <<_ACEOF +\`configure' configures nfdump 1.6.13 to adapt to many kinds of systems. + +Usage: $0 [OPTION]... [VAR=VALUE]... + +To assign environment variables (e.g., CC, CFLAGS...), specify them as +VAR=VALUE. See below for descriptions of some of the useful variables. + +Defaults for the options are specified in brackets. + +Configuration: + -h, --help display this help and exit + --help=short display options specific to this package + --help=recursive display the short help of all the included packages + -V, --version display version information and exit + -q, --quiet, --silent do not print \`checking ...' messages + --cache-file=FILE cache test results in FILE [disabled] + -C, --config-cache alias for \`--cache-file=config.cache' + -n, --no-create do not create output files + --srcdir=DIR find the sources in DIR [configure dir or \`..'] + +Installation directories: + --prefix=PREFIX install architecture-independent files in PREFIX + @<:@@S|@ac_default_prefix@:>@ + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + @<:@PREFIX@:>@ + +By default, \`make install' will install all the files in +\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify +an installation prefix other than \`$ac_default_prefix' using \`--prefix', +for instance \`--prefix=\$HOME'. + +For better control, use the options below. + +Fine tuning of the installation directories: + --bindir=DIR user executables [EPREFIX/bin] + --sbindir=DIR system admin executables [EPREFIX/sbin] + --libexecdir=DIR program executables [EPREFIX/libexec] + --sysconfdir=DIR read-only single-machine data [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] + --localstatedir=DIR modifiable single-machine data [PREFIX/var] + --libdir=DIR object code libraries [EPREFIX/lib] + --includedir=DIR C header files [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc [/usr/include] + --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] + --datadir=DIR read-only architecture-independent data [DATAROOTDIR] + --infodir=DIR info documentation [DATAROOTDIR/info] + --localedir=DIR locale-dependent data [DATAROOTDIR/locale] + --mandir=DIR man documentation [DATAROOTDIR/man] + --docdir=DIR documentation root @<:@DATAROOTDIR/doc/nfdump@:>@ + --htmldir=DIR html documentation [DOCDIR] + --dvidir=DIR dvi documentation [DOCDIR] + --pdfdir=DIR pdf documentation [DOCDIR] + --psdir=DIR ps documentation [DOCDIR] +_ACEOF + + cat <<\_ACEOF + +Program names: + --program-prefix=PREFIX prepend PREFIX to installed program names + --program-suffix=SUFFIX append SUFFIX to installed program names + --program-transform-name=PROGRAM run sed PROGRAM on installed program names +_ACEOF +fi + +if test -n "$ac_init_help"; then + case $ac_init_help in + short | recursive ) echo "Configuration of nfdump 1.6.13:";; + esac + cat <<\_ACEOF + +Optional Features: + --disable-option-checking ignore unrecognized --enable/--with options + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --enable-silent-rules less verbose build output (undo: "make V=1") + --disable-silent-rules verbose build output (undo: "make V=0") + --enable-dependency-tracking + do not reject slow dependency extractors + --disable-dependency-tracking + speeds up one-time build + --enable-devel compile debug and development code into nfdump; default is NO + --enable-compat15 compile nfdump, to read nfdump data files created with nfdump 1.5.x; default is NO + --enable-nsel compile nfdump, to read and process ASA/NSEL/NEL event data; default is NO + --enable-nel (depricated) compile nfdump, to read and process NAT/NSEL/NEL event data; default is NO + --enable-fixtimebug enable code for swap time bug of some v5 exporters; default is NO + --enable-ftconv Build the flow-tools to nfdump converter; default is NO + --enable-nfprofile Build nfprofile used by NfSen; default is NO + --enable-nftrack Build nftrack used by PortTracker; default is NO + --enable-sflow Build sflow collector sfcpad; default is NO + --enable-readpcap Build nfcapd collector to read from pcap file instead of network data; default is NO + --enable-nfpcapd Build nfpcapd collector to create netflow data from interface or pcap data; default is NO + +Optional Packages: + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --with-ftpath=PATH Expect flow-tool sources in PATH; default /usr/local/flow-tools/ + --with-rrdpath=PATH Expect RRD installed in PATH; default /usr/local + +Some influential environment variables: + CC C compiler command + CFLAGS C compiler flags + LDFLAGS linker flags, e.g. -L if you have libraries in a + nonstandard directory + LIBS libraries to pass to the linker, e.g. -l + CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if + you have headers in a nonstandard directory + YACC The `Yet Another Compiler Compiler' implementation to use. + Defaults to the first program found out of: `bison -y', `byacc', + `yacc'. + YFLAGS The list of arguments that will be passed by default to @S|@YACC. + This script will default YFLAGS to the empty string to avoid a + default value of `-d' given by some make applications. + 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. + +Report bugs to . +_ACEOF +ac_status=$? +fi + +if test "$ac_init_help" = "recursive"; then + # If there are subdirs, report their specific --help. + for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue + test -d "$ac_dir" || + { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || + continue + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + cd "$ac_dir" || { ac_status=$?; continue; } + # Check for guested configure. + if test -f "$ac_srcdir/configure.gnu"; then + echo && + $SHELL "$ac_srcdir/configure.gnu" --help=recursive + elif test -f "$ac_srcdir/configure"; then + echo && + $SHELL "$ac_srcdir/configure" --help=recursive + else + $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + fi || ac_status=$? + cd "$ac_pwd" || { ac_status=$?; break; } + done +fi + +test -n "$ac_init_help" && exit $ac_status +if $ac_init_version; then + cat <<\_ACEOF +nfdump configure 1.6.13 +generated by GNU Autoconf 2.69 + +Copyright (C) 2012 Free Software Foundation, Inc. +This configure script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it. +_ACEOF + exit +fi + +## ------------------------ ## +## Autoconf initialization. ## +## ------------------------ ## + +@%:@ ac_fn_c_try_compile LINENO +@%:@ -------------------------- +@%:@ Try to compile conftest.@S|@ac_ext, and return whether this succeeded. +ac_fn_c_try_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext + if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} @%:@ ac_fn_c_try_compile + +@%:@ ac_fn_c_try_link LINENO +@%:@ ----------------------- +@%:@ Try to link conftest.@S|@ac_ext, and return whether this succeeded. +ac_fn_c_try_link () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext conftest$ac_exeext + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + test -x conftest$ac_exeext + }; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information + # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would + # interfere with the next link command; also delete a directory that is + # left behind by Apple's compiler. We do this before executing the actions. + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} @%:@ ac_fn_c_try_link + +@%:@ ac_fn_c_try_cpp LINENO +@%:@ ---------------------- +@%:@ Try to preprocess conftest.@S|@ac_ext, and return whether this succeeded. +ac_fn_c_try_cpp () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } > conftest.i && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} @%:@ ac_fn_c_try_cpp + +@%:@ ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES +@%:@ ------------------------------------------------------- +@%:@ Tests whether HEADER exists, giving a warning if it cannot be compiled using +@%:@ the include files in INCLUDES and setting the cache variable VAR +@%:@ accordingly. +ac_fn_c_check_header_mongrel () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if eval \${$3+:} false; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +else + # Is the header compilable? +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 +$as_echo_n "checking $2 usability... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +@%:@include <$2> +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_header_compiler=yes +else + ac_header_compiler=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } + +# Is the header present? +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 +$as_echo_n "checking $2 presence... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +@%:@include <$2> +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + ac_header_preproc=yes +else + ac_header_preproc=no +fi +rm -f conftest.err conftest.i conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( + yes:no: ) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} + ;; + no:yes:* ) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} +( $as_echo "## ------------------------------------------ ## +## Report this to phaag@users.sourceforge.net ## +## ------------------------------------------ ##" + ) | sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + eval "$3=\$ac_header_compiler" +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} @%:@ ac_fn_c_check_header_mongrel + +@%:@ ac_fn_c_try_run LINENO +@%:@ ---------------------- +@%:@ Try to link conftest.@S|@ac_ext, and return whether this succeeded. Assumes +@%:@ that executables *can* be run. +ac_fn_c_try_run () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then : + ac_retval=0 +else + $as_echo "$as_me: program exited with status $ac_status" >&5 + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=$ac_status +fi + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} @%:@ ac_fn_c_try_run + +@%:@ ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES +@%:@ ------------------------------------------------------- +@%:@ Tests whether HEADER exists and can be compiled using the include files in +@%:@ INCLUDES, setting the cache variable VAR accordingly. +ac_fn_c_check_header_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +@%:@include <$2> +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + eval "$3=yes" +else + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} @%:@ ac_fn_c_check_header_compile + +@%:@ ac_fn_c_check_member LINENO AGGR MEMBER VAR INCLUDES +@%:@ ---------------------------------------------------- +@%:@ Tries to find if the field MEMBER exists in type AGGR, after including +@%:@ INCLUDES, setting cache variable VAR accordingly. +ac_fn_c_check_member () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2.$3" >&5 +$as_echo_n "checking for $2.$3... " >&6; } +if eval \${$4+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$5 +int +main () +{ +static $2 ac_aggr; +if (ac_aggr.$3) +return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + eval "$4=yes" +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$5 +int +main () +{ +static $2 ac_aggr; +if (sizeof ac_aggr.$3) +return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + eval "$4=yes" +else + eval "$4=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$4 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} @%:@ ac_fn_c_check_member + +@%:@ ac_fn_c_check_func LINENO FUNC VAR +@%:@ ---------------------------------- +@%:@ Tests whether FUNC exists, setting the cache variable VAR accordingly +ac_fn_c_check_func () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Define $2 to an innocuous variant, in case declares $2. + For example, HP-UX 11i declares gettimeofday. */ +#define $2 innocuous_$2 + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $2 (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $2 + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char $2 (); +/* 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_$2 || defined __stub___$2 +choke me +#endif + +int +main () +{ +return $2 (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + eval "$3=yes" +else + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} @%:@ ac_fn_c_check_func + +@%:@ ac_fn_c_compute_int LINENO EXPR VAR INCLUDES +@%:@ -------------------------------------------- +@%:@ Tries to find the compile-time value of EXPR in a program that includes +@%:@ INCLUDES, setting VAR accordingly. Returns whether the value could be +@%:@ computed +ac_fn_c_compute_int () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if test "$cross_compiling" = yes; then + # Depending upon the size, compute the lo and hi bounds. +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +static int test_array @<:@1 - 2 * !(($2) >= 0)@:>@; +test_array @<:@0@:>@ = 0; +return test_array @<:@0@:>@; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_lo=0 ac_mid=0 + while :; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +static int test_array @<:@1 - 2 * !(($2) <= $ac_mid)@:>@; +test_array @<:@0@:>@ = 0; +return test_array @<:@0@:>@; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_hi=$ac_mid; break +else + as_fn_arith $ac_mid + 1 && ac_lo=$as_val + if test $ac_lo -le $ac_mid; then + ac_lo= ac_hi= + break + fi + as_fn_arith 2 '*' $ac_mid + 1 && ac_mid=$as_val +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +static int test_array @<:@1 - 2 * !(($2) < 0)@:>@; +test_array @<:@0@:>@ = 0; +return test_array @<:@0@:>@; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_hi=-1 ac_mid=-1 + while :; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +static int test_array @<:@1 - 2 * !(($2) >= $ac_mid)@:>@; +test_array @<:@0@:>@ = 0; +return test_array @<:@0@:>@; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_lo=$ac_mid; break +else + as_fn_arith '(' $ac_mid ')' - 1 && ac_hi=$as_val + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + as_fn_arith 2 '*' $ac_mid && ac_mid=$as_val +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + ac_lo= ac_hi= +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +# Binary search between lo and hi bounds. +while test "x$ac_lo" != "x$ac_hi"; do + as_fn_arith '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo && ac_mid=$as_val + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +static int test_array @<:@1 - 2 * !(($2) <= $ac_mid)@:>@; +test_array @<:@0@:>@ = 0; +return test_array @<:@0@:>@; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_hi=$ac_mid +else + as_fn_arith '(' $ac_mid ')' + 1 && ac_lo=$as_val +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +done +case $ac_lo in @%:@(( +?*) eval "$3=\$ac_lo"; ac_retval=0 ;; +'') ac_retval=1 ;; +esac + else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +static long int longval () { return $2; } +static unsigned long int ulongval () { return $2; } +@%:@include +@%:@include +int +main () +{ + + FILE *f = fopen ("conftest.val", "w"); + if (! f) + return 1; + if (($2) < 0) + { + long int i = longval (); + if (i != ($2)) + return 1; + fprintf (f, "%ld", i); + } + else + { + unsigned long int i = ulongval (); + if (i != ($2)) + return 1; + fprintf (f, "%lu", i); + } + /* Do not output a trailing newline, as this causes \r\n confusion + on some platforms. */ + return ferror (f) || fclose (f) != 0; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + echo >>conftest.val; read $3 &5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + eval "$3=no" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +if (sizeof ($2)) + return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +if (sizeof (($2))) + return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + +else + eval "$3=yes" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} @%:@ ac_fn_c_check_type +cat >config.log <<_ACEOF +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. + +It was created by nfdump $as_me 1.6.13, which was +generated by GNU Autoconf 2.69. Invocation command line was + + $ $0 $@ + +_ACEOF +exec 5>>config.log +{ +cat <<_ASUNAME +## --------- ## +## Platform. ## +## --------- ## + +hostname = `(hostname || uname -n) 2>/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` +/usr/bin/hostinfo = `(/usr/bin/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` + +_ASUNAME + +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + $as_echo "PATH: $as_dir" + done +IFS=$as_save_IFS + +} >&5 + +cat >&5 <<_ACEOF + + +## ----------- ## +## Core tests. ## +## ----------- ## + +_ACEOF + + +# Keep a trace of the command line. +# Strip out --no-create and --no-recursion so they do not pile up. +# Strip out --silent because we don't want to record it for future runs. +# Also quote any args containing shell meta-characters. +# Make two passes to allow for proper duplicate-argument suppression. +ac_configure_args= +ac_configure_args0= +ac_configure_args1= +ac_must_keep_next=false +for ac_pass in 1 2 +do + for ac_arg + do + case $ac_arg in + -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + continue ;; + *\'*) + ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + case $ac_pass in + 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; + 2) + as_fn_append ac_configure_args1 " '$ac_arg'" + if test $ac_must_keep_next = true; then + ac_must_keep_next=false # Got value, back to normal. + else + case $ac_arg in + *=* | --config-cache | -C | -disable-* | --disable-* \ + | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ + | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ + | -with-* | --with-* | -without-* | --without-* | --x) + case "$ac_configure_args0 " in + "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; + esac + ;; + -* ) ac_must_keep_next=true ;; + esac + fi + as_fn_append ac_configure_args " '$ac_arg'" + ;; + esac + done +done +{ ac_configure_args0=; unset ac_configure_args0;} +{ ac_configure_args1=; unset ac_configure_args1;} + +# 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. +# WARNING: Use '\'' to represent an apostrophe within the trap. +# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. +trap 'exit_status=$? + # Save into config.log some information that might help in debugging. + { + echo + + $as_echo "## ---------------- ## +## Cache variables. ## +## ---------------- ##" + echo + # The following way of writing the cache mishandles newlines in values, +( + for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done + (set) 2>&1 | + case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + sed -n \ + "s/'\''/'\''\\\\'\'''\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" + ;; #( + *) + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) + echo + + $as_echo "## ----------------- ## +## Output variables. ## +## ----------------- ##" + echo + for ac_var in $ac_subst_vars + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + $as_echo "$ac_var='\''$ac_val'\''" + done | sort + echo + + if test -n "$ac_subst_files"; then + $as_echo "## ------------------- ## +## File substitutions. ## +## ------------------- ##" + echo + for ac_var in $ac_subst_files + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + $as_echo "$ac_var='\''$ac_val'\''" + done | sort + echo + fi + + if test -s confdefs.h; then + $as_echo "## ----------- ## +## confdefs.h. ## +## ----------- ##" + echo + cat confdefs.h + echo + fi + test "$ac_signal" != 0 && + $as_echo "$as_me: caught signal $ac_signal" + $as_echo "$as_me: exit $exit_status" + } >&5 + rm -f core *.core core.conftest.* && + rm -f -r conftest* confdefs* conf$$* $ac_clean_files && + exit $exit_status +' 0 +for ac_signal in 1 2 13 15; do + trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal +done +ac_signal=0 + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -f -r conftest* confdefs.h + +$as_echo "/* confdefs.h */" > confdefs.h + +# Predefined preprocessor variables. + +cat >>confdefs.h <<_ACEOF +@%:@define PACKAGE_NAME "$PACKAGE_NAME" +_ACEOF + +cat >>confdefs.h <<_ACEOF +@%:@define PACKAGE_TARNAME "$PACKAGE_TARNAME" +_ACEOF + +cat >>confdefs.h <<_ACEOF +@%:@define PACKAGE_VERSION "$PACKAGE_VERSION" +_ACEOF + +cat >>confdefs.h <<_ACEOF +@%:@define PACKAGE_STRING "$PACKAGE_STRING" +_ACEOF + +cat >>confdefs.h <<_ACEOF +@%:@define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" +_ACEOF + +cat >>confdefs.h <<_ACEOF +@%:@define PACKAGE_URL "$PACKAGE_URL" +_ACEOF + + +# Let the site file select an alternate cache file if it wants to. +# Prefer an explicitly selected file to automatically selected ones. +ac_site_file1=NONE +ac_site_file2=NONE +if test -n "$CONFIG_SITE"; then + # We do not want a PATH search for config.site. + case $CONFIG_SITE in @%:@(( + -*) ac_site_file1=./$CONFIG_SITE;; + */*) ac_site_file1=$CONFIG_SITE;; + *) ac_site_file1=./$CONFIG_SITE;; + esac +elif test "x$prefix" != xNONE; then + ac_site_file1=$prefix/share/config.site + ac_site_file2=$prefix/etc/config.site +else + ac_site_file1=$ac_default_prefix/share/config.site + ac_site_file2=$ac_default_prefix/etc/config.site +fi +for ac_site_file in "$ac_site_file1" "$ac_site_file2" +do + test "x$ac_site_file" = xNONE && continue + if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 +$as_echo "$as_me: loading site script $ac_site_file" >&6;} + sed 's/^/| /' "$ac_site_file" >&5 + . "$ac_site_file" \ + || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "failed to load site script $ac_site_file +See \`config.log' for more details" "$LINENO" 5; } + 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. DJGPP emulates it as a regular file. + if test /dev/null != "$cache_file" && test -f "$cache_file"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 +$as_echo "$as_me: loading cache $cache_file" >&6;} + case $cache_file in + [\\/]* | ?:[\\/]* ) . "$cache_file";; + *) . "./$cache_file";; + esac + fi +else + { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 +$as_echo "$as_me: creating cache $cache_file" >&6;} + >$cache_file +fi + +as_fn_append ac_header_list " sys/time.h" +as_fn_append ac_header_list " unistd.h" +as_fn_append ac_func_list " alarm" +# Check that the precious variables saved in the cache have kept the same +# value. +ac_cache_corrupted=false +for ac_var in $ac_precious_vars; 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,) + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,set) + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 +$as_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 + # differences in whitespace do not lead to failure. + ac_old_val_w=`echo x $ac_old_val` + ac_new_val_w=`echo x $ac_new_val` + if test "$ac_old_val_w" != "$ac_new_val_w"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 +$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + ac_cache_corrupted=: + else + { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 +$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} + eval $ac_var=\$ac_old_val + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 +$as_echo "$as_me: former value: \`$ac_old_val'" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 +$as_echo "$as_me: current value: \`$ac_new_val'" >&2;} + fi;; + esac + # Pass precious variables to config.status. + if test "$ac_new_set" = set; then + case $ac_new_val in + *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *) ac_arg=$ac_var=$ac_new_val ;; + esac + case " $ac_configure_args " in + *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. + *) as_fn_append ac_configure_args " '$ac_arg'" ;; + esac + fi +done +if $ac_cache_corrupted; then + { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 +$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} + as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 +fi +## -------------------- ## +## Main body of script. ## +## -------------------- ## + +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 + + +# $Date: 2014-11-16 14:10:20 +0100 (Sun, 16 Nov 2014) $ +#AC_CONFIG_SRCDIR([grammar.y]) +ac_config_headers="$ac_config_headers config.h" + +am__api_version='1.14' + +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 + as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 +fi + +# These three variables are undocumented and unsupported, +# and are intended to be withdrawn in a future Autoconf release. +# They can cause serious problems if a builder's source tree is in a directory +# whose full name contains unusual characters. +ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. +ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. +ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. + + +# 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" +# OS/2's system install, which has a completely different semantic +# ./install, which can be erroneously created by make from ./install.sh. +# Reject install programs that cannot install multiple files. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 +$as_echo_n "checking for a BSD-compatible install... " >&6; } +if test -z "$INSTALL"; then +if ${ac_cv_path_install+:} false; then : + $as_echo_n "(cached) " >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + # Account for people who put trailing slashes in PATH elements. +case $as_dir/ in @%:@(( + ./ | .// | /[cC]/* | \ + /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ + ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ + /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 + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then + if test $ac_prog = install && + grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + elif test $ac_prog = install && + grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # program-specific install script used by HP pwplus--don't use. + : + else + rm -rf conftest.one conftest.two conftest.dir + echo one > conftest.one + echo two > conftest.two + mkdir conftest.dir + if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && + test -s conftest.one && test -s conftest.two && + test -s conftest.dir/conftest.one && + test -s conftest.dir/conftest.two + then + ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + break 3 + fi + fi + fi + done + done + ;; +esac + + done +IFS=$as_save_IFS + +rm -rf conftest.one conftest.two conftest.dir + +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. Don't cache a + # value for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + INSTALL=$ac_install_sh + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 +$as_echo "$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' + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 +$as_echo_n "checking whether build environment is sane... " >&6; } +# Reject unsafe characters in $srcdir or the absolute working directory +# name. Accept space and tab only in the latter. +am_lf=' +' +case `pwd` in + *[\\\"\#\$\&\'\`$am_lf]*) + as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; +esac +case $srcdir in + *[\\\"\#\$\&\'\`$am_lf\ \ ]*) + as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;; +esac + +# 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 ( + am_has_slept=no + for am_try in 1 2; do + echo "timestamp, slept: $am_has_slept" > conftest.file + 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 + 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". + as_fn_error $? "ls -t appears to fail. Make sure there is not a broken + alias in your environment" "$LINENO" 5 + fi + if test "$2" = conftest.file || test $am_try -eq 2; then + break + fi + # Just in case. + sleep 1 + am_has_slept=yes + done + test "$2" = conftest.file + ) +then + # Ok. + : +else + as_fn_error $? "newly created file is older than distributed files! +Check your system clock" "$LINENO" 5 +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +# If we didn't sleep, we still need to ensure time stamps of config.status and +# generated files are strictly newer. +am_sleep_pid= +if grep 'slept: no' conftest.file >/dev/null 2>&1; then + ( sleep 1 ) & + am_sleep_pid=$! +fi + +rm -f conftest.file + +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 $. +# By default was `s,x,x', remove it if useless. +ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' +program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` + +# expand $ac_aux_dir to an absolute path +am_aux_dir=`cd $ac_aux_dir && pwd` + +if test x"${MISSING+set}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; + *) + MISSING="\${SHELL} $am_aux_dir/missing" ;; + esac +fi +# Use eval to expand $SHELL +if eval "$MISSING --is-lightweight"; then + am_missing_run="$MISSING " +else + am_missing_run= + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5 +$as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;} +fi + +if test x"${install_sh}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; + *) + install_sh="\${SHELL} $am_aux_dir/install-sh" + esac +fi + +# Installed binaries are usually stripped using 'strip' when the user +# run "make install-strip". However 'strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the 'STRIP' environment variable to overrule this program. +if test "$cross_compiling" != no; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. +set dummy ${ac_tool_prefix}strip; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_STRIP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$STRIP"; then + ac_cv_prog_STRIP="$STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_STRIP="${ac_tool_prefix}strip" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +STRIP=$ac_cv_prog_STRIP +if test -n "$STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 +$as_echo "$STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_STRIP"; then + ac_ct_STRIP=$STRIP + # Extract the first word of "strip", so it can be a program name with args. +set dummy strip; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_STRIP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_STRIP"; then + ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_STRIP="strip" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP +if test -n "$ac_ct_STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 +$as_echo "$ac_ct_STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_STRIP" = x; then + STRIP=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + STRIP=$ac_ct_STRIP + fi +else + STRIP="$ac_cv_prog_STRIP" +fi + +fi +INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 +$as_echo_n "checking for a thread-safe mkdir -p... " >&6; } +if test -z "$MKDIR_P"; then + if ${ac_cv_path_mkdir+:} false; then : + $as_echo_n "(cached) " >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in mkdir gmkdir; do + for ac_exec_ext in '' $ac_executable_extensions; do + as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue + case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( + 'mkdir (GNU coreutils) '* | \ + 'mkdir (coreutils) '* | \ + 'mkdir (fileutils) '4.1*) + ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext + break 3;; + esac + done + done + done +IFS=$as_save_IFS + +fi + + test -d ./--version && rmdir ./--version + if test "${ac_cv_path_mkdir+set}" = set; then + MKDIR_P="$ac_cv_path_mkdir -p" + else + # As a last resort, use the slow shell script. Don't cache a + # value for MKDIR_P within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + MKDIR_P="$ac_install_sh -d" + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 +$as_echo "$MKDIR_P" >&6; } + +for ac_prog in gawk mawk 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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_AWK+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$AWK"; then + ac_cv_prog_AWK="$AWK" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_AWK="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +AWK=$ac_cv_prog_AWK +if test -n "$AWK"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 +$as_echo "$AWK" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$AWK" && break +done + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } +set x ${MAKE-make} +ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` +if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat >conftest.make <<\_ACEOF +SHELL = /bin/sh +all: + @echo '@@@%%%=$(MAKE)=@@@%%%' +_ACEOF +# GNU make sometimes prints "make[1]: Entering ...", which would confuse us. +case `${MAKE-make} -f conftest.make 2>/dev/null` in + *@@@%%%=?*=@@@%%%*) + eval ac_cv_prog_make_${ac_make}_set=yes;; + *) + eval ac_cv_prog_make_${ac_make}_set=no;; +esac +rm -f conftest.make +fi +if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + SET_MAKE= +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + SET_MAKE="MAKE=${MAKE-make}" +fi + +rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null + +@%:@ Check whether --enable-silent-rules was given. +if test "${enable_silent_rules+set}" = set; then : + enableval=$enable_silent_rules; +fi + +case $enable_silent_rules in @%:@ ((( + yes) AM_DEFAULT_VERBOSITY=0;; + no) AM_DEFAULT_VERBOSITY=1;; + *) AM_DEFAULT_VERBOSITY=1;; +esac +am_make=${MAKE-make} +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 +$as_echo_n "checking whether $am_make supports nested variables... " >&6; } +if ${am_cv_make_support_nested_variables+:} false; then : + $as_echo_n "(cached) " >&6 +else + if $as_echo 'TRUE=$(BAR$(V)) +BAR0=false +BAR1=true +V=1 +am__doit: + @$(TRUE) +.PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then + am_cv_make_support_nested_variables=yes +else + am_cv_make_support_nested_variables=no +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 +$as_echo "$am_cv_make_support_nested_variables" >&6; } +if test $am_cv_make_support_nested_variables = yes; then + AM_V='$(V)' + AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' +else + AM_V=$AM_DEFAULT_VERBOSITY + AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY +fi +AM_BACKSLASH='\' + +if test "`cd $srcdir && pwd`" != "`pwd`"; then + # Use -I$(srcdir) only when $(srcdir) != ., so that make's output + # is not polluted with repeated "-I." + am__isrc=' -I$(srcdir)' + # test to see if srcdir already configured + if test -f $srcdir/config.status; then + as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 + fi +fi + +# test whether we have cygpath +if test -z "$CYGPATH_W"; then + if (cygpath --version) >/dev/null 2>/dev/null; then + CYGPATH_W='cygpath -w' + else + CYGPATH_W=echo + fi +fi + + +# Define the identity of the package. + PACKAGE='nfdump' + VERSION='1.6.13' + + +cat >>confdefs.h <<_ACEOF +@%:@define PACKAGE "$PACKAGE" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +@%:@define VERSION "$VERSION" +_ACEOF + +# Some tools Automake needs. + +ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} + + +AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} + + +AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} + + +AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} + + +MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} + +# For better backward compatibility. To be removed once Automake 1.9.x +# dies out for good. For more background, see: +# +# +mkdir_p='$(MKDIR_P)' + +# We need awk for the "check" target. The system "awk" is bad on +# some platforms. +# Always define AMTAR for backward compatibility. Yes, it's still used +# in the wild :-( We should find a proper way to deprecate it ... +AMTAR='$${TAR-tar}' + + +# We'll loop over all known methods to create a tar archive until one works. +_am_tools='gnutar pax cpio none' + +am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' + + + + + + +# POSIX will say in a future version that running "rm -f" with no argument +# is OK; and we want to be able to make that assumption in our Makefile +# recipes. So use an aggressive probe to check that the usage we want is +# actually supported "in the wild" to an acceptable degree. +# See automake bug#10828. +# To make any issue more visible, cause the running configure to be aborted +# by default if the 'rm' program in use doesn't match our expectations; the +# user can still override this though. +if rm -f && rm -fr && rm -rf; then : OK; else + cat >&2 <<'END' +Oops! + +Your 'rm' program seems unable to run without file operands specified +on the command line, even when the '-f' option is present. This is contrary +to the behaviour of most rm programs out there, and not conforming with +the upcoming POSIX standard: + +Please tell bug-automake@gnu.org about your system, including the value +of your $PATH and any error possibly output before this message. This +can help us improve future automake versions. + +END + if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then + echo 'Configuration will proceed anyway, since you have set the' >&2 + echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 + echo >&2 + else + cat >&2 <<'END' +Aborting the configuration process, to ensure you take notice of the issue. + +You can download and install GNU coreutils to get an 'rm' implementation +that behaves properly: . + +If you want to complete the configuration process using your problematic +'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM +to "yes", and re-run configure. + +END + as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5 + fi +fi + +# Checks for programs. +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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}gcc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_CC+:} false; then : + $as_echo_n "(cached) " >&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 +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="gcc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}cc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + 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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_prog_rejected=no +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +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 + ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" + fi +fi +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl.exe + 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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$CC" && break + done +fi +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in cl.exe +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_CC+:} false; then : + $as_echo_n "(cached) " >&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 +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_CC" && break +done + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +fi + +fi + + +test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "no acceptable C compiler found in \$PATH +See \`config.log' for more details" "$LINENO" 5; } + +# Provide some information about the compiler. +$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 +set X $ac_compile +ac_compiler=$2 +for ac_option in --version -v -V -qversion; do + { { ac_try="$ac_compiler $ac_option >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compiler $ac_option >&5") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + sed '10a\ +... rest of stderr output deleted ... + 10q' conftest.err >conftest.er1 + cat conftest.er1 >&5 + fi + rm -f conftest.er1 conftest.err + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +done + +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" +# 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. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 +$as_echo_n "checking whether the C compiler works... " >&6; } +ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` + +# The possible output files: +ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" + +ac_rmfiles= +for ac_file in $ac_files +do + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + * ) ac_rmfiles="$ac_rmfiles $ac_file";; + esac +done +rm -f $ac_rmfiles + +if { { ac_try="$ac_link_default" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link_default") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. +# So ignore a value of `no', otherwise this would lead to `EXEEXT = no' +# in a Makefile. We should not override ac_cv_exeext if it was cached, +# so that the user can short-circuit this test for compilers unknown to +# Autoconf. +for ac_file in $ac_files '' +do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) + ;; + [ab].out ) + # We found the default executable, but exeext='' is most + # certainly right. + break;; + *.* ) + if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; + then :; else + ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + fi + # We set ac_cv_exeext here because the later test for it is not + # safe: cross compilers may not add the suffix if given an `-o' + # argument, so we may need to know it at that point already. + # Even if this section looks crufty: it has the advantage of + # actually working. + break;; + * ) + break;; + esac +done +test "$ac_cv_exeext" = no && ac_cv_exeext= + +else + ac_file='' +fi +if test -z "$ac_file"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +$as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "C compiler cannot create executables +See \`config.log' for more details" "$LINENO" 5; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 +$as_echo_n "checking for C compiler default output file name... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 +$as_echo "$ac_file" >&6; } +ac_exeext=$ac_cv_exeext + +rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out +ac_clean_files=$ac_clean_files_save +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 +$as_echo_n "checking for suffix of executables... " >&6; } +if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; 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 conftest.exe conftest conftest.*; do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + break;; + * ) break;; + esac +done +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details" "$LINENO" 5; } +fi +rm -f conftest conftest$ac_cv_exeext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 +$as_echo "$ac_cv_exeext" >&6; } + +rm -f conftest.$ac_ext +EXEEXT=$ac_cv_exeext +ac_exeext=$EXEEXT +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +@%:@include +int +main () +{ +FILE *f = fopen ("conftest.out", "w"); + return ferror (f) || fclose (f) != 0; + + ; + return 0; +} +_ACEOF +ac_clean_files="$ac_clean_files conftest.out" +# Check that the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 +$as_echo_n "checking whether we are cross compiling... " >&6; } +if test "$cross_compiling" != yes; then + { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if { ac_try='./conftest$ac_cv_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then + cross_compiling=no + else + if test "$cross_compiling" = maybe; then + cross_compiling=yes + else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot run C compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details" "$LINENO" 5; } + fi + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 +$as_echo "$cross_compiling" >&6; } + +rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out +ac_clean_files=$ac_clean_files_save +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 +$as_echo_n "checking for suffix of object files... " >&6; } +if ${ac_cv_objext+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.o conftest.obj +if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + for ac_file in conftest.o conftest.obj conftest.*; do + test -f "$ac_file" || continue; + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; + *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` + break;; + esac +done +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot compute suffix of object files: cannot compile +See \`config.log' for more details" "$LINENO" 5; } +fi +rm -f conftest.$ac_cv_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 +$as_echo "$ac_cv_objext" >&6; } +OBJEXT=$ac_cv_objext +ac_objext=$OBJEXT +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 +$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } +if ${ac_cv_c_compiler_gnu+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_compiler_gnu=yes +else + ac_compiler_gnu=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_c_compiler_gnu=$ac_compiler_gnu + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 +$as_echo "$ac_cv_c_compiler_gnu" >&6; } +if test $ac_compiler_gnu = yes; then + GCC=yes +else + GCC= +fi +ac_test_CFLAGS=${CFLAGS+set} +ac_save_CFLAGS=$CFLAGS +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 +$as_echo_n "checking whether $CC accepts -g... " >&6; } +if ${ac_cv_prog_cc_g+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_save_c_werror_flag=$ac_c_werror_flag + ac_c_werror_flag=yes + ac_cv_prog_cc_g=no + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_g=yes +else + CFLAGS="" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + +else + ac_c_werror_flag=$ac_save_c_werror_flag + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_g=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_c_werror_flag=$ac_save_c_werror_flag +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 +$as_echo "$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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 +$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } +if ${ac_cv_prog_cc_c89+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_prog_cc_c89=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +struct stat; +/* 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; +} + +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not '\xHH' hex character constants. + These don't provoke an error unfortunately, instead are silently treated + as 'x'. The following induces an error, until -std is added to get + proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an + array size at least. It's necessary to write '\x00'==0 to get something + that's true only with -std. */ +int osf4_cc_array ['\x00' == 0 ? 1 : -1]; + +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) 'x' +int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; + +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 +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ + -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_c89=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext + test "x$ac_cv_prog_cc_c89" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC + +fi +# AC_CACHE_VAL +case "x$ac_cv_prog_cc_c89" in + x) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +$as_echo "none needed" >&6; } ;; + xno) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +$as_echo "unsupported" >&6; } ;; + *) + CC="$CC $ac_cv_prog_cc_c89" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 +$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; +esac +if test "x$ac_cv_prog_cc_c89" != xno; then : + +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 + +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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 +$as_echo_n "checking whether $CC understands -c and -o together... " >&6; } +if ${am_cv_prog_cc_c_o+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF + # Make sure it works both with $CC and with simple cc. + # Following AC_PROG_CC_C_O, we do the test twice because some + # compilers refuse to overwrite an existing .o file with -o, + # though they will create one. + am_cv_prog_cc_c_o=yes + for am_i in 1 2; do + if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 + ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } \ + && test -f conftest2.$ac_objext; then + : OK + else + am_cv_prog_cc_c_o=no + break + fi + done + rm -f core conftest* + unset am_i +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 +$as_echo "$am_cv_prog_cc_c_o" >&6; } +if test "$am_cv_prog_cc_c_o" != yes; then + # Losing compiler, so override with the script. + # FIXME: It is wrong to rewrite CC. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__CC in this case, + # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" + CC="$am_aux_dir/compile $CC" +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 + +DEPDIR="${am__leading_dot}deps" + +ac_config_commands="$ac_config_commands depfiles" + + +am_make=${MAKE-make} +cat > confinc << 'END' +am__doit: + @echo this is the am__doit target +.PHONY: am__doit +END +# If we don't find an include directive, just comment out the code. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5 +$as_echo_n "checking for style of include used by $am_make... " >&6; } +am__include="#" +am__quote= +_am_result=none +# First try GNU make style include. +echo "include confinc" > confmf +# Ignore all kinds of additional output from 'make'. +case `$am_make -s -f confmf 2> /dev/null` in #( +*the\ am__doit\ target*) + am__include=include + am__quote= + _am_result=GNU + ;; +esac +# Now try BSD make style include. +if test "$am__include" = "#"; then + echo '.include "confinc"' > confmf + case `$am_make -s -f confmf 2> /dev/null` in #( + *the\ am__doit\ target*) + am__include=.include + am__quote="\"" + _am_result=BSD + ;; + esac +fi + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5 +$as_echo "$_am_result" >&6; } +rm -f confinc confmf + +@%:@ Check whether --enable-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='\' + am__nodep='_no' +fi + if test "x$enable_dependency_tracking" != xno; then + AMDEP_TRUE= + AMDEP_FALSE='#' +else + AMDEP_TRUE='#' + AMDEP_FALSE= +fi + + + +depcc="$CC" am_compiler_list= + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 +$as_echo_n "checking dependency style of $depcc... " >&6; } +if ${am_cv_CC_dependencies_compiler_type+:} false; then : + $as_echo_n "(cached) " >&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". + rm -rf conftest.dir + 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 + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + 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 + am__universal=false + case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac + + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # 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. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with + # Solaris 10 /bin/sh. + echo '/* dummy */' > sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + # 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. Also, some Intel + # versions had trouble with output in subdirs. + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; + 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 + ;; + msvc7 | msvc7msys | msvisualcpp | msvcmsys) + # This compiler won't grok '-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; + none) break ;; + esac + if depmode=$depmode \ + source=sub/conftest.c object=$am__obj \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_CC_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_CC_dependencies_compiler_type=none +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 +$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } +CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type + + if + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then + am__fastdepCC_TRUE= + am__fastdepCC_FALSE='#' +else + am__fastdepCC_TRUE='#' + am__fastdepCC_FALSE= +fi + + + + +CFLAGS="${CFLAGS=}" +if test $ac_cv_c_compiler_gnu = yes -a "x$CFLAGS" = "x-g -O2"; then + CFLAGS="-g -O2 -Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wmissing-noreturn -fno-strict-aliasing" +fi + +@%:@ Check whether --enable-devel was given. +if test "${enable_devel+set}" = set; then : + enableval=$enable_devel; +fi + + +# Which way is better? +if test "${enable_devel}" = "yes" ; then + CFLAGS="$CFLAGS -DDEVEL" +cat >>config.h <<_ACEOF +#define dbg_printf(...) printf(__VA_ARGS__) +_ACEOF +else +cat >>config.h <<_ACEOF +#define dbg_printf(...) /* printf(__VA_ARGS__) */ +_ACEOF +fi + +@%:@ Check whether --enable-compat15 was given. +if test "${enable_compat15+set}" = set; then : + enableval=$enable_compat15; +fi + + +if test "${enable_compat15}" = "yes" ; then + CFLAGS="$CFLAGS -DCOMPAT15" +fi + +@%:@ Check whether --enable-nsel was given. +if test "${enable_nsel+set}" = set; then : + enableval=$enable_nsel; +fi + + +if test "${enable_nsel}" = "yes" ; then + CFLAGS="$CFLAGS -DNSEL" +fi + +@%:@ Check whether --enable-nel was given. +if test "${enable_nel+set}" = set; then : + enableval=$enable_nel; +fi + + +if test "${enable_nel}" = "yes" ; then + CFLAGS="$CFLAGS -DNSEL" +fi + +@%:@ Check whether --enable-fixtimebug was given. +if test "${enable_fixtimebug+set}" = set; then : + enableval=$enable_fixtimebug; +fi + + +if test "${enable_fixtimebug}" = "yes" ; then + CFLAGS="$CFLAGS -DFIXTIMEBUG" +fi + +for ac_prog in 'bison -y' byacc +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_YACC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$YACC"; then + ac_cv_prog_YACC="$YACC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_YACC="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +YACC=$ac_cv_prog_YACC +if test -n "$YACC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $YACC" >&5 +$as_echo "$YACC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$YACC" && break +done +test -n "$YACC" || YACC="yacc" + + +for ac_prog in flex lex +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_LEX+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$LEX"; then + ac_cv_prog_LEX="$LEX" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_LEX="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +LEX=$ac_cv_prog_LEX +if test -n "$LEX"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LEX" >&5 +$as_echo "$LEX" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$LEX" && break +done +test -n "$LEX" || LEX=":" + +if test "x$LEX" != "x:"; then + cat >conftest.l <<_ACEOF +%% +a { ECHO; } +b { REJECT; } +c { yymore (); } +d { yyless (1); } +e { /* IRIX 6.5 flex 2.5.4 underquotes its yyless argument. */ + yyless ((input () != 0)); } +f { unput (yytext[0]); } +. { BEGIN INITIAL; } +%% +#ifdef YYTEXT_POINTER +extern char *yytext; +#endif +int +main (void) +{ + return ! yylex () + ! yywrap (); +} +_ACEOF +{ { ac_try="$LEX conftest.l" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$LEX conftest.l") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking lex output file root" >&5 +$as_echo_n "checking lex output file root... " >&6; } +if ${ac_cv_prog_lex_root+:} false; then : + $as_echo_n "(cached) " >&6 +else + +if test -f lex.yy.c; then + ac_cv_prog_lex_root=lex.yy +elif test -f lexyy.c; then + ac_cv_prog_lex_root=lexyy +else + as_fn_error $? "cannot find output from $LEX; giving up" "$LINENO" 5 +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_lex_root" >&5 +$as_echo "$ac_cv_prog_lex_root" >&6; } +LEX_OUTPUT_ROOT=$ac_cv_prog_lex_root + +if test -z "${LEXLIB+set}"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking lex library" >&5 +$as_echo_n "checking lex library... " >&6; } +if ${ac_cv_lib_lex+:} false; then : + $as_echo_n "(cached) " >&6 +else + + ac_save_LIBS=$LIBS + ac_cv_lib_lex='none needed' + for ac_lib in '' -lfl -ll; do + LIBS="$ac_lib $ac_save_LIBS" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +`cat $LEX_OUTPUT_ROOT.c` +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_lex=$ac_lib +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + test "$ac_cv_lib_lex" != 'none needed' && break + done + LIBS=$ac_save_LIBS + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_lex" >&5 +$as_echo "$ac_cv_lib_lex" >&6; } + test "$ac_cv_lib_lex" != 'none needed' && LEXLIB=$ac_cv_lib_lex +fi + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether yytext is a pointer" >&5 +$as_echo_n "checking whether yytext is a pointer... " >&6; } +if ${ac_cv_prog_lex_yytext_pointer+:} false; then : + $as_echo_n "(cached) " >&6 +else + # POSIX says lex can declare yytext either as a pointer or an array; the +# default is implementation-dependent. Figure out which it is, since +# not all implementations provide the %pointer and %array declarations. +ac_cv_prog_lex_yytext_pointer=no +ac_save_LIBS=$LIBS +LIBS="$LEXLIB $ac_save_LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #define YYTEXT_POINTER 1 +`cat $LEX_OUTPUT_ROOT.c` +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_prog_lex_yytext_pointer=yes +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_save_LIBS + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_lex_yytext_pointer" >&5 +$as_echo "$ac_cv_prog_lex_yytext_pointer" >&6; } +if test $ac_cv_prog_lex_yytext_pointer = yes; then + +$as_echo "@%:@define YYTEXT_POINTER 1" >>confdefs.h + +fi +rm -f conftest.l $LEX_OUTPUT_ROOT.c + +fi +which $LEX > /dev/null 2>&1 +if test $? = 1; then + as_fn_error $? "No lex or flex found on system" "$LINENO" 5 +fi + + +if test "x$ac_cv_prog_LEX" = "xflex"; then + LFLAGS=-i +fi + +# Check if we need to build the flow-tools converter +# FIXME? This should use flow-tools-dev if possible, not local sources.. + +@%:@ Check whether --with-ftpath was given. +if test "${with_ftpath+set}" = set; then : + withval=$with_ftpath; if test "x$with_ftpath" = "xyes" ; then + WHERE_FTPATH="/usr/local/flow-tools/" +else + WHERE_FTPATH=$with_ftpath +fi + +else + WHERE_FTPATH="/usr/local/flow-tools/" + +fi + + + +@%:@ Check whether --with-rrdpath was given. +if test "${with_rrdpath+set}" = set; then : + withval=$with_rrdpath; if test "x$with_rrdpath" = "xyes" ; then + CPPFLAGS="${CPPFLAGS} -I/usr/local/include" + LDFLAGS="${LDFLAGS} -L/usr/local/lib" +else + CPPFLAGS="${CPPFLAGS} -I${with_rrdpath}/include" + LDFLAGS="${LDFLAGS} -L${with_rrdpath}/lib" +fi + +fi + + +#Tidz up? esp not using in source dist flow-tools +@%:@ Check whether --enable-ftconv was given. +if test "${enable_ftconv+set}" = set; then : + enableval=$enable_ftconv; { $as_echo "$as_me:${as_lineno-$LINENO}: checking for zlibVersion in -lz" >&5 +$as_echo_n "checking for zlibVersion in -lz... " >&6; } +if ${ac_cv_lib_z_zlibVersion+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lz $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char zlibVersion (); +int +main () +{ +return zlibVersion (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_z_zlibVersion=yes +else + ac_cv_lib_z_zlibVersion=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_z_zlibVersion" >&5 +$as_echo "$ac_cv_lib_z_zlibVersion" >&6; } +if test "x$ac_cv_lib_z_zlibVersion" = xyes; then : + cat >>confdefs.h <<_ACEOF +@%:@define HAVE_LIBZ 1 +_ACEOF + + LIBS="-lz $LIBS" + +else + as_fn_error $? "Link with \"-lz\" failed! (Need zlib >= 1.0.2)" "$LINENO" 5 + +fi + +if test -d "$WHERE_FTPATH"; then + if test ! -f "$WHERE_FTPATH/include/ftlib.h"; then + as_fn_error $? "ftlib.h file not found in flow-tools directory '$WHERE_FTPATH'. Use --with-ftpath=PATH" "$LINENO" 5 + fi + if test ! -f "$WHERE_FTPATH/lib/libft.a"; then + as_fn_error $? "libft.a not found in flow-tools directory '$WHERE_FTPATH'. Build flow tools first" "$LINENO" 5 + fi + FT_INCLUDES="-I$WHERE_FTPATH/include -I$WHERE_FTPATH/lib" + FT_LDFLAGS="-L$WHERE_FTPATH/lib" +else + as_fn_error $? "flow-tools directory '$WHERE_FTPATH' does not exists. Use --with-ftpath=PATH" "$LINENO" 5 +fi + if true; then + FT2NFDUMP_TRUE= + FT2NFDUMP_FALSE='#' +else + FT2NFDUMP_TRUE='#' + FT2NFDUMP_FALSE= +fi + + +else + if false; then + FT2NFDUMP_TRUE= + FT2NFDUMP_FALSE='#' +else + FT2NFDUMP_TRUE='#' + FT2NFDUMP_FALSE= +fi + + +fi + + +#Needs tidy +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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 +$as_echo_n "checking how to run the C preprocessor... " >&6; } +# On Suns, sometimes $CPP names a directory. +if test -n "$CPP" && test -d "$CPP"; then + CPP= +fi +if test -z "$CPP"; then + if ${ac_cv_prog_CPP+:} false; then : + $as_echo_n "(cached) " >&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. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # 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 confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +@%:@ifdef __STDC__ +@%:@ include +@%:@else +@%:@ include +@%:@endif + Syntax error +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + +else + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +@%:@include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue +else + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.i conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i 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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 +$as_echo "$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. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # 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 confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +@%:@ifdef __STDC__ +@%:@ include +@%:@else +@%:@ include +@%:@endif + Syntax error +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + +else + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +@%:@include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue +else + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.i conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : + +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details" "$LINENO" 5; } +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 + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 +$as_echo_n "checking for grep that handles long lines and -e... " >&6; } +if ${ac_cv_path_GREP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$GREP"; then + ac_path_GREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in grep ggrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_GREP" || continue +# Check for GNU ac_path_GREP and select it if it is found. + # Check for GNU $ac_path_GREP +case `"$ac_path_GREP" --version 2>&1` in +*GNU*) + ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'GREP' >> "conftest.nl" + "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_GREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_GREP="$ac_path_GREP" + ac_path_GREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_GREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_GREP"; then + as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_GREP=$GREP +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 +$as_echo "$ac_cv_path_GREP" >&6; } + GREP="$ac_cv_path_GREP" + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 +$as_echo_n "checking for egrep... " >&6; } +if ${ac_cv_path_EGREP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 + then ac_cv_path_EGREP="$GREP -E" + else + if test -z "$EGREP"; then + ac_path_EGREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in egrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_EGREP" || continue +# Check for GNU ac_path_EGREP and select it if it is found. + # Check for GNU $ac_path_EGREP +case `"$ac_path_EGREP" --version 2>&1` in +*GNU*) + ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'EGREP' >> "conftest.nl" + "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_EGREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_EGREP="$ac_path_EGREP" + ac_path_EGREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_EGREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_EGREP"; then + as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_EGREP=$EGREP +fi + + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 +$as_echo "$ac_cv_path_EGREP" >&6; } + EGREP="$ac_cv_path_EGREP" + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 +$as_echo_n "checking for ANSI C header files... " >&6; } +if ${ac_cv_header_stdc+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#include +#include + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_header_stdc=yes +else + ac_cv_header_stdc=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end 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 confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end 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 confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#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)) + return 2; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + +else + ac_cv_header_stdc=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 +$as_echo "$ac_cv_header_stdc" >&6; } +if test $ac_cv_header_stdc = yes; then + +$as_echo "@%:@define STDC_HEADERS 1" >>confdefs.h + +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=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default +" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +@%:@define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + +@%:@ Check whether --enable-nfprofile was given. +if test "${enable_nfprofile+set}" = set; then : + enableval=$enable_nfprofile; + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for rrd_update in -lrrd" >&5 +$as_echo_n "checking for rrd_update in -lrrd... " >&6; } +if ${ac_cv_lib_rrd_rrd_update+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lrrd $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char rrd_update (); +int +main () +{ +return rrd_update (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_rrd_rrd_update=yes +else + ac_cv_lib_rrd_rrd_update=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_rrd_rrd_update" >&5 +$as_echo "$ac_cv_lib_rrd_rrd_update" >&6; } +if test "x$ac_cv_lib_rrd_rrd_update" = xyes; then : + +cat >>config.h <<_ACEOF +#define HAVE_LIBRRD 1 +_ACEOF +RRD_LIBS="-lrrd" + + + +else + as_fn_error $? "Can not link librrd. Please specify --with-rrdpath=.. configure failed! " "$LINENO" 5 +fi + + for ac_header in rrd.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "rrd.h" "ac_cv_header_rrd_h" "$ac_includes_default" +if test "x$ac_cv_header_rrd_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +@%:@define HAVE_RRD_H 1 +_ACEOF + +fi + +done + + if test "$ac_cv_header_rrd_h" = yes; then + if true; then + NFPROFILE_TRUE= + NFPROFILE_FALSE='#' +else + NFPROFILE_TRUE='#' + NFPROFILE_FALSE= +fi + + else + as_fn_error $? "Required rrd.h header file not found!" "$LINENO" 5 + fi + if test "$cross_compiling" = yes; then : + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot run test program while cross compiling +See \`config.log' for more details" "$LINENO" 5; } +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + #include + +int +main () +{ + + rrd_value_t d; + + ; + return 0; +} + +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + +else + as_fn_error $? "Can not load rrd library. Not in loader search path! " "$LINENO" 5 +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + + + +else + if false; then + NFPROFILE_TRUE= + NFPROFILE_FALSE='#' +else + NFPROFILE_TRUE='#' + NFPROFILE_FALSE= +fi + + +fi + + +@%:@ Check whether --enable-nftrack was given. +if test "${enable_nftrack+set}" = set; then : + enableval=$enable_nftrack; + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for rrd_update in -lrrd" >&5 +$as_echo_n "checking for rrd_update in -lrrd... " >&6; } +if ${ac_cv_lib_rrd_rrd_update+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lrrd $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char rrd_update (); +int +main () +{ +return rrd_update (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_rrd_rrd_update=yes +else + ac_cv_lib_rrd_rrd_update=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_rrd_rrd_update" >&5 +$as_echo "$ac_cv_lib_rrd_rrd_update" >&6; } +if test "x$ac_cv_lib_rrd_rrd_update" = xyes; then : + +cat >>config.h <<_ACEOF +#define HAVE_LIBRRD 1 +_ACEOF +RRD_LIBS="-lrrd" + + + +else + as_fn_error $? "Can not link librrd. Please specify --with-rrdpath=.. configure failed! " "$LINENO" 5 +fi + + for ac_header in rrd.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "rrd.h" "ac_cv_header_rrd_h" "$ac_includes_default" +if test "x$ac_cv_header_rrd_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +@%:@define HAVE_RRD_H 1 +_ACEOF + +fi + +done + + if test "$ac_cv_header_rrd_h" = yes; then + if true; then + NFTRACK_TRUE= + NFTRACK_FALSE='#' +else + NFTRACK_TRUE='#' + NFTRACK_FALSE= +fi + + else + as_fn_error $? "Required rrd.h header file not found!" "$LINENO" 5 + fi + if test "$cross_compiling" = yes; then : + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot run test program while cross compiling +See \`config.log' for more details" "$LINENO" 5; } +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + #include + +int +main () +{ + + rrd_value_t d; + + ; + return 0; +} + +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + +else + as_fn_error $? "Can not load rrd library. Not in loader search path! " "$LINENO" 5 +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + + + +else + if false; then + NFTRACK_TRUE= + NFTRACK_FALSE='#' +else + NFTRACK_TRUE='#' + NFTRACK_FALSE= +fi + + +fi + + +@%:@ Check whether --enable-sflow was given. +if test "${enable_sflow+set}" = set; then : + enableval=$enable_sflow; +fi + + if test "$enable_sflow" = yes; then + SFLOW_TRUE= + SFLOW_FALSE='#' +else + SFLOW_TRUE='#' + SFLOW_FALSE= +fi + + +@%:@ Check whether --enable-readpcap was given. +if test "${enable_readpcap+set}" = set; then : + enableval=$enable_readpcap; +fi + + if test "$enable_readpcap" = yes; then + READPCAP_TRUE= + READPCAP_FALSE='#' +else + READPCAP_TRUE='#' + READPCAP_FALSE= +fi + + +@%:@ Check whether --enable-nfpcapd was given. +if test "${enable_nfpcapd+set}" = set; then : + enableval=$enable_nfpcapd; +fi + + if test "$enable_nfpcapd" = yes; then + BUILDNFPCAPD_TRUE= + BUILDNFPCAPD_FALSE='#' +else + BUILDNFPCAPD_TRUE='#' + BUILDNFPCAPD_FALSE= +fi + + +# Check for structures +ac_fn_c_check_member "$LINENO" "struct sockaddr" "sa_len" "ac_cv_member_struct_sockaddr_sa_len" " +#include +#include +" +if test "x$ac_cv_member_struct_sockaddr_sa_len" = xyes; then : + +$as_echo "@%:@define HAVE_SOCKADDR_SA_LEN 1" >>confdefs.h + +fi + + +ac_fn_c_check_member "$LINENO" "struct sockaddr_storage" "ss_family" "ac_cv_member_struct_sockaddr_storage_ss_family" " +#include +#include + +" +if test "x$ac_cv_member_struct_sockaddr_storage_ss_family" = xyes; then : + +cat >>confdefs.h <<_ACEOF +@%:@define HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY 1 +_ACEOF + + +fi +ac_fn_c_check_member "$LINENO" "struct sockaddr_storage" "__ss_family" "ac_cv_member_struct_sockaddr_storage___ss_family" " +#include +#include + +" +if test "x$ac_cv_member_struct_sockaddr_storage___ss_family" = xyes; then : + +cat >>confdefs.h <<_ACEOF +@%:@define HAVE_STRUCT_SOCKADDR_STORAGE___SS_FAMILY 1 +_ACEOF + + +fi +ac_fn_c_check_member "$LINENO" "struct sockaddr_storage" "ss_len" "ac_cv_member_struct_sockaddr_storage_ss_len" " +#include +#include + +" +if test "x$ac_cv_member_struct_sockaddr_storage_ss_len" = xyes; then : + +cat >>confdefs.h <<_ACEOF +@%:@define HAVE_STRUCT_SOCKADDR_STORAGE_SS_LEN 1 +_ACEOF + + +fi +ac_fn_c_check_member "$LINENO" "struct sockaddr_storage" "__ss_len" "ac_cv_member_struct_sockaddr_storage___ss_len" " +#include +#include + +" +if test "x$ac_cv_member_struct_sockaddr_storage___ss_len" = xyes; then : + +cat >>confdefs.h <<_ACEOF +@%:@define HAVE_STRUCT_SOCKADDR_STORAGE___SS_LEN 1 +_ACEOF + + +fi +ac_fn_c_check_member "$LINENO" "struct sockaddr" "sa_len" "ac_cv_member_struct_sockaddr_sa_len" " +#include +#include + +" +if test "x$ac_cv_member_struct_sockaddr_sa_len" = xyes; then : + +cat >>confdefs.h <<_ACEOF +@%:@define HAVE_STRUCT_SOCKADDR_SA_LEN 1 +_ACEOF + + +fi + + +#AC_SUBST(opt_objects) + + + + + +# Checks for libraries. +for ac_func in gethostbyname +do : + ac_fn_c_check_func "$LINENO" "gethostbyname" "ac_cv_func_gethostbyname" +if test "x$ac_cv_func_gethostbyname" = xyes; then : + cat >>confdefs.h <<_ACEOF +@%:@define HAVE_GETHOSTBYNAME 1 +_ACEOF + +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gethostbyname in -lnsl" >&5 +$as_echo_n "checking for gethostbyname in -lnsl... " >&6; } +if ${ac_cv_lib_nsl_gethostbyname+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lnsl $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char gethostbyname (); +int +main () +{ +return gethostbyname (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_nsl_gethostbyname=yes +else + ac_cv_lib_nsl_gethostbyname=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nsl_gethostbyname" >&5 +$as_echo "$ac_cv_lib_nsl_gethostbyname" >&6; } +if test "x$ac_cv_lib_nsl_gethostbyname" = xyes; then : + cat >>confdefs.h <<_ACEOF +@%:@define HAVE_LIBNSL 1 +_ACEOF + + LIBS="-lnsl $LIBS" + +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gethostbyname in -lsocket" >&5 +$as_echo_n "checking for gethostbyname in -lsocket... " >&6; } +if ${ac_cv_lib_socket_gethostbyname+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lsocket $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char gethostbyname (); +int +main () +{ +return gethostbyname (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_socket_gethostbyname=yes +else + ac_cv_lib_socket_gethostbyname=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_gethostbyname" >&5 +$as_echo "$ac_cv_lib_socket_gethostbyname" >&6; } +if test "x$ac_cv_lib_socket_gethostbyname" = xyes; then : + cat >>confdefs.h <<_ACEOF +@%:@define HAVE_LIBSOCKET 1 +_ACEOF + + LIBS="-lsocket $LIBS" + +fi + +fi + +fi +done + +for ac_func in setsockopt +do : + ac_fn_c_check_func "$LINENO" "setsockopt" "ac_cv_func_setsockopt" +if test "x$ac_cv_func_setsockopt" = xyes; then : + cat >>confdefs.h <<_ACEOF +@%:@define HAVE_SETSOCKOPT 1 +_ACEOF + +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for setsockopt in -lsocket" >&5 +$as_echo_n "checking for setsockopt in -lsocket... " >&6; } +if ${ac_cv_lib_socket_setsockopt+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lsocket $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char setsockopt (); +int +main () +{ +return setsockopt (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_socket_setsockopt=yes +else + ac_cv_lib_socket_setsockopt=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_setsockopt" >&5 +$as_echo "$ac_cv_lib_socket_setsockopt" >&6; } +if test "x$ac_cv_lib_socket_setsockopt" = xyes; then : + cat >>confdefs.h <<_ACEOF +@%:@define HAVE_LIBSOCKET 1 +_ACEOF + + LIBS="-lsocket $LIBS" + +fi + +fi +done + + +for ac_func in fpurge __fpurge +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +@%:@define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if htonll is defined" >&5 +$as_echo_n "checking if htonll is defined... " >&6; } + +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + +int +main () +{ + + return htonll(0); + + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + +$as_echo "@%:@define HAVE_HTONLL 1" >>confdefs.h + + +else + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + + +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + +# Checks for header files. +ac_header_dirent=no +for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do + as_ac_Header=`$as_echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh` +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_hdr that defines DIR" >&5 +$as_echo_n "checking for $ac_hdr that defines DIR... " >&6; } +if eval \${$as_ac_Header+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include <$ac_hdr> + +int +main () +{ +if ((DIR *) 0) +return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + eval "$as_ac_Header=yes" +else + eval "$as_ac_Header=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$as_ac_Header + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +@%:@define `$as_echo "HAVE_$ac_hdr" | $as_tr_cpp` 1 +_ACEOF + +ac_header_dirent=$ac_hdr; break +fi + +done +# Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. +if test $ac_header_dirent = dirent.h; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing opendir" >&5 +$as_echo_n "checking for library containing opendir... " >&6; } +if ${ac_cv_search_opendir+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_func_search_save_LIBS=$LIBS +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char opendir (); +int +main () +{ +return opendir (); + ; + return 0; +} +_ACEOF +for ac_lib in '' dir; do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + if ac_fn_c_try_link "$LINENO"; then : + ac_cv_search_opendir=$ac_res +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext + if ${ac_cv_search_opendir+:} false; then : + break +fi +done +if ${ac_cv_search_opendir+:} false; then : + +else + ac_cv_search_opendir=no +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_opendir" >&5 +$as_echo "$ac_cv_search_opendir" >&6; } +ac_res=$ac_cv_search_opendir +if test "$ac_res" != no; then : + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + +fi + +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing opendir" >&5 +$as_echo_n "checking for library containing opendir... " >&6; } +if ${ac_cv_search_opendir+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_func_search_save_LIBS=$LIBS +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char opendir (); +int +main () +{ +return opendir (); + ; + return 0; +} +_ACEOF +for ac_lib in '' x; do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + if ac_fn_c_try_link "$LINENO"; then : + ac_cv_search_opendir=$ac_res +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext + if ${ac_cv_search_opendir+:} false; then : + break +fi +done +if ${ac_cv_search_opendir+:} false; then : + +else + ac_cv_search_opendir=no +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_opendir" >&5 +$as_echo "$ac_cv_search_opendir" >&6; } +ac_res=$ac_cv_search_opendir +if test "$ac_res" != no; then : + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + +fi + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 +$as_echo_n "checking for ANSI C header files... " >&6; } +if ${ac_cv_header_stdc+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#include +#include + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_header_stdc=yes +else + ac_cv_header_stdc=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end 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 confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end 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 confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#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)) + return 2; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + +else + ac_cv_header_stdc=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 +$as_echo "$ac_cv_header_stdc" >&6; } +if test $ac_cv_header_stdc = yes; then + +$as_echo "@%:@define STDC_HEADERS 1" >>confdefs.h + +fi + +for ac_header in nameser8_compat.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "nameser8_compat.h" "ac_cv_header_nameser8_compat_h" "$ac_includes_default" +if test "x$ac_cv_header_nameser8_compat_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +@%:@define HAVE_NAMESER8_COMPAT_H 1 +_ACEOF + +fi + +done + +for ac_header in features.h arpa/inet.h fcntl.h netinet/in.h fts.h stdint.h stdlib.h stddef.h string.h sys/socket.h syslog.h unistd.h iso/limits_iso.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +@%:@define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + +for ac_header in pcap-bpf.h net/bpf.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +@%:@define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + +for ac_header in sys/types.h netinet/in.h arpa/nameser.h arpa/nameser_compat.h netdb.h resolv.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "#ifdef HAVE_SYS_TYPES_H +# include +#endif +#ifdef HAVE_NETINET_IN_H +# include /* inet_ functions / structs */ +#endif +#ifdef HAVE_ARPA_NAMESER_H +# include /* DNS HEADER struct */ +#endif +#ifdef HAVE_NETDB_H +# include +#endif +" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +@%:@define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + + +if test "$ac_cv_header_fts_h" != yes; then + FTS_OBJ=fts_compat.o +fi + + + +# Checks for typedefs, structures, and compiler characteristics. +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of void *" >&5 +$as_echo_n "checking size of void *... " >&6; } +if ${ac_cv_sizeof_void_p+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (void *))" "ac_cv_sizeof_void_p" "$ac_includes_default"; then : + +else + if test "$ac_cv_type_void_p" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute sizeof (void *) +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof_void_p=0 + fi +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_void_p" >&5 +$as_echo "$ac_cv_sizeof_void_p" >&6; } + + + +cat >>confdefs.h <<_ACEOF +@%:@define SIZEOF_VOID_P $ac_cv_sizeof_void_p +_ACEOF + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5 +$as_echo_n "checking for an ANSI C-conforming const... " >&6; } +if ${ac_cv_c_const+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + +#ifndef __cplusplus + /* Ultrix mips cc rejects this sort of thing. */ + typedef int charset[2]; + const charset cs = { 0, 0 }; + /* SunOS 4.1.1 cc rejects this. */ + char const *const *pcpcc; + char **ppc; + /* 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"; + pcpcc = &g + (g ? g-g : 0); + /* HPUX 7.0 cc rejects these. */ + ++pcpcc; + ppc = (char**) pcpcc; + pcpcc = (char const *const *) ppc; + { /* SCO 3.2v4 cc rejects this sort of thing. */ + char tx; + char *t = &tx; + char const *s = 0 ? (char *) 0 : (char const *) 0; + + *t++ = 0; + if (s) return 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 sort of thing, saying + "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ + struct s { int j; const int *ap[3]; } bx; + struct s *b = &bx; b->j = 5; + } + { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ + const int foo = 10; + if (!foo) return 0; + } + return !cs[0] && !zero.x; +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_c_const=yes +else + ac_cv_c_const=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5 +$as_echo "$ac_cv_c_const" >&6; } +if test $ac_cv_c_const = no; then + +$as_echo "@%:@define const /**/" >>confdefs.h + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5 +$as_echo_n "checking for inline... " >&6; } +if ${ac_cv_c_inline+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_c_inline=no +for ac_kw in inline __inline__ __inline; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifndef __cplusplus +typedef int foo_t; +static $ac_kw foo_t static_foo () {return 0; } +$ac_kw foo_t foo () {return 0; } +#endif + +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_c_inline=$ac_kw +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + test "$ac_cv_c_inline" != no && break +done + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5 +$as_echo "$ac_cv_c_inline" >&6; } + +case $ac_cv_c_inline in + inline | yes) ;; + *) + case $ac_cv_c_inline in + no) ac_val=;; + *) ac_val=$ac_cv_c_inline;; + esac + cat >>confdefs.h <<_ACEOF +#ifndef __cplusplus +#define inline $ac_val +#endif +_ACEOF + ;; +esac + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5 +$as_echo_n "checking whether byte ordering is bigendian... " >&6; } +if ${ac_cv_c_bigendian+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_c_bigendian=unknown + # See if we're dealing with a universal compiler. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifndef __APPLE_CC__ + not a universal capable compiler + #endif + typedef int dummy; + +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + + # Check for potential -arch flags. It is not universal unless + # there are at least two -arch flags with different values. + ac_arch= + ac_prev= + for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do + if test -n "$ac_prev"; then + case $ac_word in + i?86 | x86_64 | ppc | ppc64) + if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then + ac_arch=$ac_word + else + ac_cv_c_bigendian=universal + break + fi + ;; + esac + ac_prev= + elif test "x$ac_word" = "x-arch"; then + ac_prev=arch + fi + done +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + if test $ac_cv_c_bigendian = unknown; then + # See if sys/param.h defines the BYTE_ORDER macro. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + #include + +int +main () +{ +#if ! (defined BYTE_ORDER && defined BIG_ENDIAN \ + && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \ + && LITTLE_ENDIAN) + bogus endian macros + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + # It does; now see whether it defined to BIG_ENDIAN or not. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + #include + +int +main () +{ +#if BYTE_ORDER != BIG_ENDIAN + not big endian + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_c_bigendian=yes +else + ac_cv_c_bigendian=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi + if test $ac_cv_c_bigendian = unknown; then + # See if defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris). + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +int +main () +{ +#if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN) + bogus endian macros + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + # It does; now see whether it defined to _BIG_ENDIAN or not. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +int +main () +{ +#ifndef _BIG_ENDIAN + not big endian + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_c_bigendian=yes +else + ac_cv_c_bigendian=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi + if test $ac_cv_c_bigendian = unknown; then + # Compile a test program. + if test "$cross_compiling" = yes; then : + # Try to guess by grepping values from an object file. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +short int ascii_mm[] = + { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; + short int ascii_ii[] = + { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; + int use_ascii (int i) { + return ascii_mm[i] + ascii_ii[i]; + } + short int ebcdic_ii[] = + { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; + short int ebcdic_mm[] = + { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; + int use_ebcdic (int i) { + return ebcdic_mm[i] + ebcdic_ii[i]; + } + extern int foo; + +int +main () +{ +return use_ascii (foo) == use_ebcdic (foo); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then + ac_cv_c_bigendian=yes + fi + if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then + if test "$ac_cv_c_bigendian" = unknown; then + ac_cv_c_bigendian=no + else + # finding both strings is unlikely to happen, but who knows? + ac_cv_c_bigendian=unknown + fi + fi +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ + + /* Are we little or big endian? From Harbison&Steele. */ + union + { + long int l; + char c[sizeof (long int)]; + } u; + u.l = 1; + return u.c[sizeof (long int) - 1] == 1; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + ac_cv_c_bigendian=no +else + ac_cv_c_bigendian=yes +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_bigendian" >&5 +$as_echo "$ac_cv_c_bigendian" >&6; } + case $ac_cv_c_bigendian in #( + yes) + $as_echo "@%:@define WORDS_BIGENDIAN 1" >>confdefs.h +;; #( + no) + ;; #( + universal) + +$as_echo "@%:@define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h + + ;; #( + *) + as_fn_error $? "unknown endianness + presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;; + esac + +ac_fn_c_check_type "$LINENO" "pid_t" "ac_cv_type_pid_t" "$ac_includes_default" +if test "x$ac_cv_type_pid_t" = xyes; then : + +else + +cat >>confdefs.h <<_ACEOF +@%:@define pid_t int +_ACEOF + +fi + +ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" +if test "x$ac_cv_type_size_t" = xyes; then : + +else + +cat >>confdefs.h <<_ACEOF +@%:@define size_t unsigned int +_ACEOF + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether struct tm is in sys/time.h or time.h" >&5 +$as_echo_n "checking whether struct tm is in sys/time.h or time.h... " >&6; } +if ${ac_cv_struct_tm+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include + +int +main () +{ +struct tm tm; + int *p = &tm.tm_sec; + return !p; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_struct_tm=time.h +else + ac_cv_struct_tm=sys/time.h +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_struct_tm" >&5 +$as_echo "$ac_cv_struct_tm" >&6; } +if test $ac_cv_struct_tm = sys/time.h; then + +$as_echo "@%:@define TM_IN_SYS_TIME 1" >>confdefs.h + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for stdbool.h that conforms to C99" >&5 +$as_echo_n "checking for stdbool.h that conforms to C99... " >&6; } +if ${ac_cv_header_stdbool_h+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + #ifndef bool + "error: bool is not defined" + #endif + #ifndef false + "error: false is not defined" + #endif + #if false + "error: false is not 0" + #endif + #ifndef true + "error: true is not defined" + #endif + #if true != 1 + "error: true is not 1" + #endif + #ifndef __bool_true_false_are_defined + "error: __bool_true_false_are_defined is not defined" + #endif + + struct s { _Bool s: 1; _Bool t; } s; + + char a[true == 1 ? 1 : -1]; + char b[false == 0 ? 1 : -1]; + char c[__bool_true_false_are_defined == 1 ? 1 : -1]; + char d[(bool) 0.5 == true ? 1 : -1]; + /* See body of main program for 'e'. */ + char f[(_Bool) 0.0 == false ? 1 : -1]; + char g[true]; + char h[sizeof (_Bool)]; + char i[sizeof s.t]; + enum { j = false, k = true, l = false * true, m = true * 256 }; + /* The following fails for + HP aC++/ANSI C B3910B A.05.55 [Dec 04 2003]. */ + _Bool n[m]; + char o[sizeof n == m * sizeof n[0] ? 1 : -1]; + char p[-1 - (_Bool) 0 < 0 && -1 - (bool) 0 < 0 ? 1 : -1]; + /* Catch a bug in an HP-UX C compiler. See + http://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html + http://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html + */ + _Bool q = true; + _Bool *pq = &q; + +int +main () +{ + + bool e = &s; + *pq |= q; + *pq |= ! q; + /* Refer to every declared value, to avoid compiler optimizations. */ + return (!a + !b + !c + !d + !e + !f + !g + !h + !i + !!j + !k + !!l + + !m + !n + !o + !p + !q + !pq); + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_header_stdbool_h=yes +else + ac_cv_header_stdbool_h=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdbool_h" >&5 +$as_echo "$ac_cv_header_stdbool_h" >&6; } + ac_fn_c_check_type "$LINENO" "_Bool" "ac_cv_type__Bool" "$ac_includes_default" +if test "x$ac_cv_type__Bool" = xyes; then : + +cat >>confdefs.h <<_ACEOF +@%:@define HAVE__BOOL 1 +_ACEOF + + +fi + + +if test $ac_cv_header_stdbool_h = yes; then + +$as_echo "@%:@define HAVE_STDBOOL_H 1" >>confdefs.h + +fi + + +# Checks for library functions. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether closedir returns void" >&5 +$as_echo_n "checking whether closedir returns void... " >&6; } +if ${ac_cv_func_closedir_void+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + ac_cv_func_closedir_void=yes +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +#include <$ac_header_dirent> +#ifndef __cplusplus +int closedir (); +#endif + +int +main () +{ +return closedir (opendir (".")) != 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + ac_cv_func_closedir_void=no +else + ac_cv_func_closedir_void=yes +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_closedir_void" >&5 +$as_echo "$ac_cv_func_closedir_void" >&6; } +if test $ac_cv_func_closedir_void = yes; then + +$as_echo "@%:@define CLOSEDIR_VOID 1" >>confdefs.h + +fi + +for ac_header in vfork.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "vfork.h" "ac_cv_header_vfork_h" "$ac_includes_default" +if test "x$ac_cv_header_vfork_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +@%:@define HAVE_VFORK_H 1 +_ACEOF + +fi + +done + +for ac_func in fork vfork +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +@%:@define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + +if test "x$ac_cv_func_fork" = xyes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working fork" >&5 +$as_echo_n "checking for working fork... " >&6; } +if ${ac_cv_func_fork_works+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + ac_cv_func_fork_works=cross +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ + + /* By Ruediger Kuhlmann. */ + return fork () < 0; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + ac_cv_func_fork_works=yes +else + ac_cv_func_fork_works=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_fork_works" >&5 +$as_echo "$ac_cv_func_fork_works" >&6; } + +else + ac_cv_func_fork_works=$ac_cv_func_fork +fi +if test "x$ac_cv_func_fork_works" = xcross; then + case $host in + *-*-amigaos* | *-*-msdosdjgpp*) + # Override, as these systems have only a dummy fork() stub + ac_cv_func_fork_works=no + ;; + *) + ac_cv_func_fork_works=yes + ;; + esac + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: result $ac_cv_func_fork_works guessed because of cross compilation" >&5 +$as_echo "$as_me: WARNING: result $ac_cv_func_fork_works guessed because of cross compilation" >&2;} +fi +ac_cv_func_vfork_works=$ac_cv_func_vfork +if test "x$ac_cv_func_vfork" = xyes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working vfork" >&5 +$as_echo_n "checking for working vfork... " >&6; } +if ${ac_cv_func_vfork_works+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + ac_cv_func_vfork_works=cross +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Thanks to Paul Eggert for this test. */ +$ac_includes_default +#include +#ifdef HAVE_VFORK_H +# include +#endif +/* On some sparc systems, changes by the child to local and incoming + argument registers are propagated back to the parent. The compiler + is told about this with #include , but some compilers + (e.g. gcc -O) don't grok . Test for this by using a + static variable whose address is put into a register that is + clobbered by the vfork. */ +static void +#ifdef __cplusplus +sparc_address_test (int arg) +# else +sparc_address_test (arg) int arg; +#endif +{ + static pid_t child; + if (!child) { + child = vfork (); + if (child < 0) { + perror ("vfork"); + _exit(2); + } + if (!child) { + arg = getpid(); + write(-1, "", 0); + _exit (arg); + } + } +} + +int +main () +{ + pid_t parent = getpid (); + pid_t child; + + sparc_address_test (0); + + child = vfork (); + + if (child == 0) { + /* Here is another test for sparc vfork register problems. This + test uses lots of local variables, at least as many local + variables as main has allocated so far including compiler + temporaries. 4 locals are enough for gcc 1.40.3 on a Solaris + 4.1.3 sparc, but we use 8 to be safe. A buggy compiler should + reuse the register of parent for one of the local variables, + since it will think that parent can't possibly be used any more + in this routine. Assigning to the local variable will thus + munge parent in the parent process. */ + pid_t + p = getpid(), p1 = getpid(), p2 = getpid(), p3 = getpid(), + p4 = getpid(), p5 = getpid(), p6 = getpid(), p7 = getpid(); + /* Convince the compiler that p..p7 are live; otherwise, it might + use the same hardware register for all 8 local variables. */ + if (p != p1 || p != p2 || p != p3 || p != p4 + || p != p5 || p != p6 || p != p7) + _exit(1); + + /* On some systems (e.g. IRIX 3.3), vfork doesn't separate parent + from child file descriptors. If the child closes a descriptor + before it execs or exits, this munges the parent's descriptor + as well. Test for this by closing stdout in the child. */ + _exit(close(fileno(stdout)) != 0); + } else { + int status; + struct stat st; + + while (wait(&status) != child) + ; + return ( + /* Was there some problem with vforking? */ + child < 0 + + /* Did the child fail? (This shouldn't happen.) */ + || status + + /* Did the vfork/compiler bug occur? */ + || parent != getpid() + + /* Did the file descriptor bug occur? */ + || fstat(fileno(stdout), &st) != 0 + ); + } +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + ac_cv_func_vfork_works=yes +else + ac_cv_func_vfork_works=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_vfork_works" >&5 +$as_echo "$ac_cv_func_vfork_works" >&6; } + +fi; +if test "x$ac_cv_func_fork_works" = xcross; then + ac_cv_func_vfork_works=$ac_cv_func_vfork + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: result $ac_cv_func_vfork_works guessed because of cross compilation" >&5 +$as_echo "$as_me: WARNING: result $ac_cv_func_vfork_works guessed because of cross compilation" >&2;} +fi + +if test "x$ac_cv_func_vfork_works" = xyes; then + +$as_echo "@%:@define HAVE_WORKING_VFORK 1" >>confdefs.h + +else + +$as_echo "@%:@define vfork fork" >>confdefs.h + +fi +if test "x$ac_cv_func_fork_works" = xyes; then + +$as_echo "@%:@define HAVE_WORKING_FORK 1" >>confdefs.h + +fi + +for ac_header in stdlib.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "stdlib.h" "ac_cv_header_stdlib_h" "$ac_includes_default" +if test "x$ac_cv_header_stdlib_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +@%:@define HAVE_STDLIB_H 1 +_ACEOF + +fi + +done + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU libc compatible malloc" >&5 +$as_echo_n "checking for GNU libc compatible malloc... " >&6; } +if ${ac_cv_func_malloc_0_nonnull+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + ac_cv_func_malloc_0_nonnull=no +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#if defined STDC_HEADERS || defined HAVE_STDLIB_H +# include +#else +char *malloc (); +#endif + +int +main () +{ +return ! malloc (0); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + ac_cv_func_malloc_0_nonnull=yes +else + ac_cv_func_malloc_0_nonnull=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_malloc_0_nonnull" >&5 +$as_echo "$ac_cv_func_malloc_0_nonnull" >&6; } +if test $ac_cv_func_malloc_0_nonnull = yes; then : + +$as_echo "@%:@define HAVE_MALLOC 1" >>confdefs.h + +else + $as_echo "@%:@define HAVE_MALLOC 0" >>confdefs.h + + case " $LIB@&t@OBJS " in + *" malloc.$ac_objext "* ) ;; + *) LIB@&t@OBJS="$LIB@&t@OBJS malloc.$ac_objext" + ;; +esac + + +$as_echo "@%:@define malloc rpl_malloc" >>confdefs.h + +fi + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether time.h and sys/time.h may both be included" >&5 +$as_echo_n "checking whether time.h and sys/time.h may both be included... " >&6; } +if ${ac_cv_header_time+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#include + +int +main () +{ +if ((struct tm *) 0) +return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_header_time=yes +else + ac_cv_header_time=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_time" >&5 +$as_echo "$ac_cv_header_time" >&6; } +if test $ac_cv_header_time = yes; then + +$as_echo "@%:@define TIME_WITH_SYS_TIME 1" >>confdefs.h + +fi + + + + + for ac_header in $ac_header_list +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default +" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +@%:@define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + + + + + + + + for ac_func in $ac_func_list +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +@%:@define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for working mktime" >&5 +$as_echo_n "checking for working mktime... " >&6; } +if ${ac_cv_func_working_mktime+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + ac_cv_func_working_mktime=no +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Test program from Paul Eggert and Tony Leneis. */ +#ifdef TIME_WITH_SYS_TIME +# include +# include +#else +# ifdef HAVE_SYS_TIME_H +# include +# else +# include +# endif +#endif + +#include +#include + +#ifdef HAVE_UNISTD_H +# include +#endif + +#ifndef HAVE_ALARM +# define alarm(X) /* empty */ +#endif + +/* Work around redefinition to rpl_putenv by other config tests. */ +#undef putenv + +static time_t time_t_max; +static time_t time_t_min; + +/* Values we'll use to set the TZ environment variable. */ +static const char *tz_strings[] = { + (const char *) 0, "TZ=GMT0", "TZ=JST-9", + "TZ=EST+3EDT+2,M10.1.0/00:00:00,M2.3.0/00:00:00" +}; +#define N_STRINGS (sizeof (tz_strings) / sizeof (tz_strings[0])) + +/* Return 0 if mktime fails to convert a date in the spring-forward gap. + Based on a problem report from Andreas Jaeger. */ +static int +spring_forward_gap () +{ + /* glibc (up to about 1998-10-07) failed this test. */ + struct tm tm; + + /* Use the portable POSIX.1 specification "TZ=PST8PDT,M4.1.0,M10.5.0" + instead of "TZ=America/Vancouver" in order to detect the bug even + on systems that don't support the Olson extension, or don't have the + full zoneinfo tables installed. */ + putenv ((char*) "TZ=PST8PDT,M4.1.0,M10.5.0"); + + tm.tm_year = 98; + tm.tm_mon = 3; + tm.tm_mday = 5; + tm.tm_hour = 2; + tm.tm_min = 0; + tm.tm_sec = 0; + tm.tm_isdst = -1; + return mktime (&tm) != (time_t) -1; +} + +static int +mktime_test1 (time_t now) +{ + struct tm *lt; + return ! (lt = localtime (&now)) || mktime (lt) == now; +} + +static int +mktime_test (time_t now) +{ + return (mktime_test1 (now) + && mktime_test1 ((time_t) (time_t_max - now)) + && mktime_test1 ((time_t) (time_t_min + now))); +} + +static int +irix_6_4_bug () +{ + /* Based on code from Ariel Faigon. */ + struct tm tm; + tm.tm_year = 96; + tm.tm_mon = 3; + tm.tm_mday = 0; + tm.tm_hour = 0; + tm.tm_min = 0; + tm.tm_sec = 0; + tm.tm_isdst = -1; + mktime (&tm); + return tm.tm_mon == 2 && tm.tm_mday == 31; +} + +static int +bigtime_test (int j) +{ + struct tm tm; + time_t now; + tm.tm_year = tm.tm_mon = tm.tm_mday = tm.tm_hour = tm.tm_min = tm.tm_sec = j; + now = mktime (&tm); + if (now != (time_t) -1) + { + struct tm *lt = localtime (&now); + if (! (lt + && lt->tm_year == tm.tm_year + && lt->tm_mon == tm.tm_mon + && lt->tm_mday == tm.tm_mday + && lt->tm_hour == tm.tm_hour + && lt->tm_min == tm.tm_min + && lt->tm_sec == tm.tm_sec + && lt->tm_yday == tm.tm_yday + && lt->tm_wday == tm.tm_wday + && ((lt->tm_isdst < 0 ? -1 : 0 < lt->tm_isdst) + == (tm.tm_isdst < 0 ? -1 : 0 < tm.tm_isdst)))) + return 0; + } + return 1; +} + +static int +year_2050_test () +{ + /* The correct answer for 2050-02-01 00:00:00 in Pacific time, + ignoring leap seconds. */ + unsigned long int answer = 2527315200UL; + + struct tm tm; + time_t t; + tm.tm_year = 2050 - 1900; + tm.tm_mon = 2 - 1; + tm.tm_mday = 1; + tm.tm_hour = tm.tm_min = tm.tm_sec = 0; + tm.tm_isdst = -1; + + /* Use the portable POSIX.1 specification "TZ=PST8PDT,M4.1.0,M10.5.0" + instead of "TZ=America/Vancouver" in order to detect the bug even + on systems that don't support the Olson extension, or don't have the + full zoneinfo tables installed. */ + putenv ((char*) "TZ=PST8PDT,M4.1.0,M10.5.0"); + + t = mktime (&tm); + + /* Check that the result is either a failure, or close enough + to the correct answer that we can assume the discrepancy is + due to leap seconds. */ + return (t == (time_t) -1 + || (0 < t && answer - 120 <= t && t <= answer + 120)); +} + +int +main () +{ + time_t t, delta; + int i, j; + + /* This test makes some buggy mktime implementations loop. + Give up after 60 seconds; a mktime slower than that + isn't worth using anyway. */ + alarm (60); + + for (;;) + { + t = (time_t_max << 1) + 1; + if (t <= time_t_max) + break; + time_t_max = t; + } + time_t_min = - ((time_t) ~ (time_t) 0 == (time_t) -1) - time_t_max; + + delta = time_t_max / 997; /* a suitable prime number */ + for (i = 0; i < N_STRINGS; i++) + { + if (tz_strings[i]) + putenv ((char*) tz_strings[i]); + + for (t = 0; t <= time_t_max - delta; t += delta) + if (! mktime_test (t)) + return 1; + if (! (mktime_test ((time_t) 1) + && mktime_test ((time_t) (60 * 60)) + && mktime_test ((time_t) (60 * 60 * 24)))) + return 1; + + for (j = 1; ; j <<= 1) + if (! bigtime_test (j)) + return 1; + else if (INT_MAX / 2 < j) + break; + if (! bigtime_test (INT_MAX)) + return 1; + } + return ! (irix_6_4_bug () && spring_forward_gap () && year_2050_test ()); +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + ac_cv_func_working_mktime=yes +else + ac_cv_func_working_mktime=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_working_mktime" >&5 +$as_echo "$ac_cv_func_working_mktime" >&6; } +if test $ac_cv_func_working_mktime = no; then + case " $LIB@&t@OBJS " in + *" mktime.$ac_objext "* ) ;; + *) LIB@&t@OBJS="$LIB@&t@OBJS mktime.$ac_objext" + ;; +esac + +fi + +for ac_header in stdlib.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "stdlib.h" "ac_cv_header_stdlib_h" "$ac_includes_default" +if test "x$ac_cv_header_stdlib_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +@%:@define HAVE_STDLIB_H 1 +_ACEOF + +fi + +done + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU libc compatible realloc" >&5 +$as_echo_n "checking for GNU libc compatible realloc... " >&6; } +if ${ac_cv_func_realloc_0_nonnull+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + ac_cv_func_realloc_0_nonnull=no +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#if defined STDC_HEADERS || defined HAVE_STDLIB_H +# include +#else +char *realloc (); +#endif + +int +main () +{ +return ! realloc (0, 0); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + ac_cv_func_realloc_0_nonnull=yes +else + ac_cv_func_realloc_0_nonnull=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_realloc_0_nonnull" >&5 +$as_echo "$ac_cv_func_realloc_0_nonnull" >&6; } +if test $ac_cv_func_realloc_0_nonnull = yes; then : + +$as_echo "@%:@define HAVE_REALLOC 1" >>confdefs.h + +else + $as_echo "@%:@define HAVE_REALLOC 0" >>confdefs.h + + case " $LIB@&t@OBJS " in + *" realloc.$ac_objext "* ) ;; + *) LIB@&t@OBJS="$LIB@&t@OBJS realloc.$ac_objext" + ;; +esac + + +$as_echo "@%:@define realloc rpl_realloc" >>confdefs.h + +fi + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether lstat correctly handles trailing slash" >&5 +$as_echo_n "checking whether lstat correctly handles trailing slash... " >&6; } +if ${ac_cv_func_lstat_dereferences_slashed_symlink+:} false; then : + $as_echo_n "(cached) " >&6 +else + rm -f conftest.sym conftest.file +echo >conftest.file +if test "$as_ln_s" = "ln -s" && ln -s conftest.file conftest.sym; then + if test "$cross_compiling" = yes; then : + ac_cv_func_lstat_dereferences_slashed_symlink=no +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +struct stat sbuf; + /* Linux will dereference the symlink and fail, as required by POSIX. + That is better in the sense that it means we will not + have to compile and use the lstat wrapper. */ + return lstat ("conftest.sym/", &sbuf) == 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + ac_cv_func_lstat_dereferences_slashed_symlink=yes +else + ac_cv_func_lstat_dereferences_slashed_symlink=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +else + # If the `ln -s' command failed, then we probably don't even + # have an lstat function. + ac_cv_func_lstat_dereferences_slashed_symlink=no +fi +rm -f conftest.sym conftest.file + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_lstat_dereferences_slashed_symlink" >&5 +$as_echo "$ac_cv_func_lstat_dereferences_slashed_symlink" >&6; } + +test $ac_cv_func_lstat_dereferences_slashed_symlink = yes && + +cat >>confdefs.h <<_ACEOF +@%:@define LSTAT_FOLLOWS_SLASHED_SYMLINK 1 +_ACEOF + + +if test "x$ac_cv_func_lstat_dereferences_slashed_symlink" = xno; then + case " $LIB@&t@OBJS " in + *" lstat.$ac_objext "* ) ;; + *) LIB@&t@OBJS="$LIB@&t@OBJS lstat.$ac_objext" + ;; +esac + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stat accepts an empty string" >&5 +$as_echo_n "checking whether stat accepts an empty string... " >&6; } +if ${ac_cv_func_stat_empty_string_bug+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + ac_cv_func_stat_empty_string_bug=yes +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +struct stat sbuf; + return stat ("", &sbuf) == 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + ac_cv_func_stat_empty_string_bug=no +else + ac_cv_func_stat_empty_string_bug=yes +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_stat_empty_string_bug" >&5 +$as_echo "$ac_cv_func_stat_empty_string_bug" >&6; } +if test $ac_cv_func_stat_empty_string_bug = yes; then + case " $LIB@&t@OBJS " in + *" stat.$ac_objext "* ) ;; + *) LIB@&t@OBJS="$LIB@&t@OBJS stat.$ac_objext" + ;; +esac + + +cat >>confdefs.h <<_ACEOF +@%:@define HAVE_STAT_EMPTY_STRING_BUG 1 +_ACEOF + +fi + +for ac_func in strftime +do : + ac_fn_c_check_func "$LINENO" "strftime" "ac_cv_func_strftime" +if test "x$ac_cv_func_strftime" = xyes; then : + cat >>confdefs.h <<_ACEOF +@%:@define HAVE_STRFTIME 1 +_ACEOF + +else + # strftime is in -lintl on SCO UNIX. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for strftime in -lintl" >&5 +$as_echo_n "checking for strftime in -lintl... " >&6; } +if ${ac_cv_lib_intl_strftime+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lintl $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char strftime (); +int +main () +{ +return strftime (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_intl_strftime=yes +else + ac_cv_lib_intl_strftime=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_intl_strftime" >&5 +$as_echo "$ac_cv_lib_intl_strftime" >&6; } +if test "x$ac_cv_lib_intl_strftime" = xyes; then : + $as_echo "@%:@define HAVE_STRFTIME 1" >>confdefs.h + +LIBS="-lintl $LIBS" +fi + +fi +done + +for ac_func in inet_ntoa socket strchr strdup strerror strrchr strstr scandir +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +@%:@define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for res_search in -lsocket" >&5 +$as_echo_n "checking for res_search in -lsocket... " >&6; } +if ${ac_cv_lib_socket_res_search+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lsocket $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char res_search (); +int +main () +{ +return res_search (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_socket_res_search=yes +else + ac_cv_lib_socket_res_search=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_res_search" >&5 +$as_echo "$ac_cv_lib_socket_res_search" >&6; } +if test "x$ac_cv_lib_socket_res_search" = xyes; then : + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dn_skipname in -lresolv" >&5 +$as_echo_n "checking for dn_skipname in -lresolv... " >&6; } +if ${ac_cv_lib_resolv_dn_skipname+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lresolv $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dn_skipname (); +int +main () +{ +return dn_skipname (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_resolv_dn_skipname=yes +else + ac_cv_lib_resolv_dn_skipname=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_resolv_dn_skipname" >&5 +$as_echo "$ac_cv_lib_resolv_dn_skipname" >&6; } +if test "x$ac_cv_lib_resolv_dn_skipname" = xyes; then : + cat >>confdefs.h <<_ACEOF +@%:@define HAVE_LIBRESOLV 1 +_ACEOF + + LIBS="-lresolv $LIBS" + +fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __dn_skipname in -lresolv" >&5 +$as_echo_n "checking for __dn_skipname in -lresolv... " >&6; } +if ${ac_cv_lib_resolv___dn_skipname+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lresolv $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char __dn_skipname (); +int +main () +{ +return __dn_skipname (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_resolv___dn_skipname=yes +else + ac_cv_lib_resolv___dn_skipname=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_resolv___dn_skipname" >&5 +$as_echo "$ac_cv_lib_resolv___dn_skipname" >&6; } +if test "x$ac_cv_lib_resolv___dn_skipname" = xyes; then : + cat >>confdefs.h <<_ACEOF +@%:@define HAVE_LIBRESOLV 1 +_ACEOF + + LIBS="-lresolv $LIBS" + +fi + + LIBS="$LIBS -lsocket" + +$as_echo "@%:@define HAVE_LIBSOCKET 1" >>confdefs.h + +else + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for res_search in -lresolv" >&5 +$as_echo_n "checking for res_search in -lresolv... " >&6; } +if ${ac_cv_lib_resolv_res_search+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lresolv $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char res_search (); +int +main () +{ +return res_search (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_resolv_res_search=yes +else + ac_cv_lib_resolv_res_search=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_resolv_res_search" >&5 +$as_echo "$ac_cv_lib_resolv_res_search" >&6; } +if test "x$ac_cv_lib_resolv_res_search" = xyes; then : + + LIBS="$LIBS -lresolv" + +$as_echo "@%:@define HAVE_LIBRESOLV 1" >>confdefs.h + + +else + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dn_skipname in -lresolv" >&5 +$as_echo_n "checking for dn_skipname in -lresolv... " >&6; } +if ${ac_cv_lib_resolv_dn_skipname+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lresolv $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dn_skipname (); +int +main () +{ +return dn_skipname (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_resolv_dn_skipname=yes +else + ac_cv_lib_resolv_dn_skipname=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_resolv_dn_skipname" >&5 +$as_echo "$ac_cv_lib_resolv_dn_skipname" >&6; } +if test "x$ac_cv_lib_resolv_dn_skipname" = xyes; then : + cat >>confdefs.h <<_ACEOF +@%:@define HAVE_LIBRESOLV 1 +_ACEOF + + LIBS="-lresolv $LIBS" + +fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __dn_skipname in -lresolv" >&5 +$as_echo_n "checking for __dn_skipname in -lresolv... " >&6; } +if ${ac_cv_lib_resolv___dn_skipname+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lresolv $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char __dn_skipname (); +int +main () +{ +return __dn_skipname (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_resolv___dn_skipname=yes +else + ac_cv_lib_resolv___dn_skipname=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_resolv___dn_skipname" >&5 +$as_echo "$ac_cv_lib_resolv___dn_skipname" >&6; } +if test "x$ac_cv_lib_resolv___dn_skipname" = xyes; then : + cat >>confdefs.h <<_ACEOF +@%:@define HAVE_LIBRESOLV 1 +_ACEOF + + LIBS="-lresolv $LIBS" + +fi + + +fi + + +fi + + +# lzo compression requirements +ac_fn_c_check_type "$LINENO" "ptrdiff_t" "ac_cv_type_ptrdiff_t" "$ac_includes_default" +if test "x$ac_cv_type_ptrdiff_t" = xyes; then : + +else + +cat >>confdefs.h <<_ACEOF +@%:@define ptrdiff_t long +_ACEOF + +fi + +ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" +if test "x$ac_cv_type_size_t" = xyes; then : + +else + +cat >>confdefs.h <<_ACEOF +@%:@define size_t unsigned int +_ACEOF + +fi + +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of short" >&5 +$as_echo_n "checking size of short... " >&6; } +if ${ac_cv_sizeof_short+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (short))" "ac_cv_sizeof_short" "$ac_includes_default"; then : + +else + if test "$ac_cv_type_short" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute sizeof (short) +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof_short=0 + fi +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_short" >&5 +$as_echo "$ac_cv_sizeof_short" >&6; } + + + +cat >>confdefs.h <<_ACEOF +@%:@define SIZEOF_SHORT $ac_cv_sizeof_short +_ACEOF + + +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of int" >&5 +$as_echo_n "checking size of int... " >&6; } +if ${ac_cv_sizeof_int+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (int))" "ac_cv_sizeof_int" "$ac_includes_default"; then : + +else + if test "$ac_cv_type_int" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute sizeof (int) +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof_int=0 + fi +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_int" >&5 +$as_echo "$ac_cv_sizeof_int" >&6; } + + + +cat >>confdefs.h <<_ACEOF +@%:@define SIZEOF_INT $ac_cv_sizeof_int +_ACEOF + + +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long" >&5 +$as_echo_n "checking size of long... " >&6; } +if ${ac_cv_sizeof_long+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long))" "ac_cv_sizeof_long" "$ac_includes_default"; then : + +else + if test "$ac_cv_type_long" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute sizeof (long) +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof_long=0 + fi +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long" >&5 +$as_echo "$ac_cv_sizeof_long" >&6; } + + + +cat >>confdefs.h <<_ACEOF +@%:@define SIZEOF_LONG $ac_cv_sizeof_long +_ACEOF + + +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long long" >&5 +$as_echo_n "checking size of long long... " >&6; } +if ${ac_cv_sizeof_long_long+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long long))" "ac_cv_sizeof_long_long" "$ac_includes_default"; then : + +else + if test "$ac_cv_type_long_long" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute sizeof (long long) +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof_long_long=0 + fi +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long_long" >&5 +$as_echo "$ac_cv_sizeof_long_long" >&6; } + + + +cat >>confdefs.h <<_ACEOF +@%:@define SIZEOF_LONG_LONG $ac_cv_sizeof_long_long +_ACEOF + + +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of __int64" >&5 +$as_echo_n "checking size of __int64... " >&6; } +if ${ac_cv_sizeof___int64+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (__int64))" "ac_cv_sizeof___int64" "$ac_includes_default"; then : + +else + if test "$ac_cv_type___int64" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute sizeof (__int64) +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof___int64=0 + fi +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof___int64" >&5 +$as_echo "$ac_cv_sizeof___int64" >&6; } + + + +cat >>confdefs.h <<_ACEOF +@%:@define SIZEOF___INT64 $ac_cv_sizeof___int64 +_ACEOF + + +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of void *" >&5 +$as_echo_n "checking size of void *... " >&6; } +if ${ac_cv_sizeof_void_p+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (void *))" "ac_cv_sizeof_void_p" "$ac_includes_default"; then : + +else + if test "$ac_cv_type_void_p" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute sizeof (void *) +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof_void_p=0 + fi +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_void_p" >&5 +$as_echo "$ac_cv_sizeof_void_p" >&6; } + + + +cat >>confdefs.h <<_ACEOF +@%:@define SIZEOF_VOID_P $ac_cv_sizeof_void_p +_ACEOF + + +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of size_t" >&5 +$as_echo_n "checking size of size_t... " >&6; } +if ${ac_cv_sizeof_size_t+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (size_t))" "ac_cv_sizeof_size_t" "$ac_includes_default"; then : + +else + if test "$ac_cv_type_size_t" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute sizeof (size_t) +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof_size_t=0 + fi +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_size_t" >&5 +$as_echo "$ac_cv_sizeof_size_t" >&6; } + + + +cat >>confdefs.h <<_ACEOF +@%:@define SIZEOF_SIZE_T $ac_cv_sizeof_size_t +_ACEOF + + +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of ptrdiff_t" >&5 +$as_echo_n "checking size of ptrdiff_t... " >&6; } +if ${ac_cv_sizeof_ptrdiff_t+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (ptrdiff_t))" "ac_cv_sizeof_ptrdiff_t" "$ac_includes_default"; then : + +else + if test "$ac_cv_type_ptrdiff_t" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute sizeof (ptrdiff_t) +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof_ptrdiff_t=0 + fi +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_ptrdiff_t" >&5 +$as_echo "$ac_cv_sizeof_ptrdiff_t" >&6; } + + + +cat >>confdefs.h <<_ACEOF +@%:@define SIZEOF_PTRDIFF_T $ac_cv_sizeof_ptrdiff_t +_ACEOF + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5 +$as_echo_n "checking for an ANSI C-conforming const... " >&6; } +if ${ac_cv_c_const+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + +#ifndef __cplusplus + /* Ultrix mips cc rejects this sort of thing. */ + typedef int charset[2]; + const charset cs = { 0, 0 }; + /* SunOS 4.1.1 cc rejects this. */ + char const *const *pcpcc; + char **ppc; + /* 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"; + pcpcc = &g + (g ? g-g : 0); + /* HPUX 7.0 cc rejects these. */ + ++pcpcc; + ppc = (char**) pcpcc; + pcpcc = (char const *const *) ppc; + { /* SCO 3.2v4 cc rejects this sort of thing. */ + char tx; + char *t = &tx; + char const *s = 0 ? (char *) 0 : (char const *) 0; + + *t++ = 0; + if (s) return 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 sort of thing, saying + "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ + struct s { int j; const int *ap[3]; } bx; + struct s *b = &bx; b->j = 5; + } + { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ + const int foo = 10; + if (!foo) return 0; + } + return !cs[0] && !zero.x; +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_c_const=yes +else + ac_cv_c_const=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5 +$as_echo "$ac_cv_c_const" >&6; } +if test $ac_cv_c_const = no; then + +$as_echo "@%:@define const /**/" >>confdefs.h + +fi + +for ac_func in memcmp memcpy memmove memset +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +@%:@define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for union semun" >&5 +$as_echo_n "checking for union semun... " >&6; } +if ${ac_cv_struct_semun+:} false; then : + $as_echo_n "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + #include + #include ; + +int +main () +{ + + union semun semdat; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_struct_semun=yes +else + ac_cv_struct_semun=no + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + + +fi + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_struct_semun" >&5 +$as_echo "$ac_cv_struct_semun" >&6; } +if test "$ac_cv_struct_semun" = "yes"; then + +$as_echo "@%:@define HAVE_SEMUN 1" >>confdefs.h + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for the %z format string in printf()" >&5 +$as_echo_n "checking for the %z format string in printf()... " >&6; } +if test "$cross_compiling" = yes; then : + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include + +int main() { +int i; +size_t s; +char string[16]; + + s = 12345; + i = snprintf(string,16,"%zu", s); + + return i == 5 ? 0 : 1; +} + +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + +$as_echo "@%:@define HAVE_SIZE_T_Z_FORMAT 1" >>confdefs.h + + +else + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + +#AC_CONFIG_FILES([Makefile]) +ac_config_files="$ac_config_files Makefile bin/Makefile man/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 overridden 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, we kill variables containing newlines. +# 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. +( + for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done + + (set) 2>&1 | + case $as_nl`(ac_space=' '; set) 2>&1` in #( + *${as_nl}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 "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) | + sed ' + /^ac_cv_env_/b end + t clear + :clear + s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ + t end + s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ + :end' >>confcache +if diff "$cache_file" confcache >/dev/null 2>&1; then :; else + if test -w "$cache_file"; then + if test "x$cache_file" != "x/dev/null"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 +$as_echo "$as_me: updating cache $cache_file" >&6;} + if test ! -f "$cache_file" || test -h "$cache_file"; then + cat confcache >"$cache_file" + else + case $cache_file in #( + */* | ?:*) + mv -f confcache "$cache_file"$$ && + mv -f "$cache_file"$$ "$cache_file" ;; #( + *) + mv -f confcache "$cache_file" ;; + esac + fi + fi + else + { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 +$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} + 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}' + +DEFS=-DHAVE_CONFIG_H + +ac_libobjs= +ac_ltlibobjs= +U= +for ac_i in : $LIB@&t@OBJS; do test "x$ac_i" = x: && continue + # 1. Remove the extension, and $U if already installed. + ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' + ac_i=`$as_echo "$ac_i" | sed "$ac_script"` + # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR + # will be set to the directory where LIBOBJS objects are built. + as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" + as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' +done +LIB@&t@OBJS=$ac_libobjs + +LTLIBOBJS=$ac_ltlibobjs + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5 +$as_echo_n "checking that generated files are newer than configure... " >&6; } + if test -n "$am_sleep_pid"; then + # Hide warnings about reused PIDs. + wait $am_sleep_pid 2>/dev/null + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5 +$as_echo "done" >&6; } + if test -n "$EXEEXT"; then + am__EXEEXT_TRUE= + am__EXEEXT_FALSE='#' +else + am__EXEEXT_TRUE='#' + am__EXEEXT_FALSE= +fi + +if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then + as_fn_error $? "conditional \"AMDEP\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then + as_fn_error $? "conditional \"am__fastdepCC\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${FT2NFDUMP_TRUE}" && test -z "${FT2NFDUMP_FALSE}"; then + as_fn_error $? "conditional \"FT2NFDUMP\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${FT2NFDUMP_TRUE}" && test -z "${FT2NFDUMP_FALSE}"; then + as_fn_error $? "conditional \"FT2NFDUMP\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${NFPROFILE_TRUE}" && test -z "${NFPROFILE_FALSE}"; then + as_fn_error $? "conditional \"NFPROFILE\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${NFPROFILE_TRUE}" && test -z "${NFPROFILE_FALSE}"; then + as_fn_error $? "conditional \"NFPROFILE\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${NFTRACK_TRUE}" && test -z "${NFTRACK_FALSE}"; then + as_fn_error $? "conditional \"NFTRACK\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${NFTRACK_TRUE}" && test -z "${NFTRACK_FALSE}"; then + as_fn_error $? "conditional \"NFTRACK\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${SFLOW_TRUE}" && test -z "${SFLOW_FALSE}"; then + as_fn_error $? "conditional \"SFLOW\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${READPCAP_TRUE}" && test -z "${READPCAP_FALSE}"; then + as_fn_error $? "conditional \"READPCAP\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${BUILDNFPCAPD_TRUE}" && test -z "${BUILDNFPCAPD_FALSE}"; then + as_fn_error $? "conditional \"BUILDNFPCAPD\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi + + +: "${CONFIG_STATUS=./config.status}" +ac_write_fail=0 +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files $CONFIG_STATUS" +{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 +$as_echo "$as_me: creating $CONFIG_STATUS" >&6;} +as_write_fail=0 +cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 +#! $SHELL +# Generated by $as_me. +# 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 +ac_cs_recheck=false +ac_cs_silent=false + +SHELL=\${CONFIG_SHELL-$SHELL} +export SHELL +_ASEOF +cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in @%:@( + *posix*) : + set -o posix ;; @%:@( + *) : + ;; +esac +fi + + +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in @%:@( + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +as_myself= +case $0 in @%:@(( + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + + +@%:@ as_fn_error STATUS ERROR [LINENO LOG_FD] +@%:@ ---------------------------------------- +@%:@ Output "`basename @S|@0`: error: ERROR" to stderr. If LINENO and LOG_FD are +@%:@ provided, also output the error to LOG_FD, referencing LINENO. Then exit the +@%:@ script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + $as_echo "$as_me: error: $2" >&2 + as_fn_exit $as_status +} @%:@ as_fn_error + + +@%:@ as_fn_set_status STATUS +@%:@ ----------------------- +@%:@ Set @S|@? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} @%:@ as_fn_set_status + +@%:@ as_fn_exit STATUS +@%:@ ----------------- +@%:@ Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} @%:@ as_fn_exit + +@%:@ as_fn_unset VAR +@%:@ --------------- +@%:@ Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset +@%:@ as_fn_append VAR VALUE +@%:@ ---------------------- +@%:@ Append the text in VALUE to the end of the definition contained in VAR. Take +@%:@ advantage of any shell optimizations that allow amortized linear growth over +@%:@ repeated appends, instead of the typical quadratic growth present in naive +@%:@ implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +@%:@ as_fn_arith ARG... +@%:@ ------------------ +@%:@ Perform arithmetic evaluation on the ARGs, and store the result in the +@%:@ global @S|@as_val. Take advantage of shells that can avoid forks. The arguments +@%:@ must be portable across @S|@(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# 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 + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in @%:@((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -pR'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -pR' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -pR' + fi +else + as_ln_s='cp -pR' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + + +@%:@ as_fn_mkdir_p +@%:@ ------------- +@%:@ Create "@S|@as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} @%:@ as_fn_mkdir_p +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + + +@%:@ as_fn_executable_p FILE +@%:@ ----------------------- +@%:@ Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} @%:@ as_fn_executable_p +as_test_x='test -x' +as_executable_p=as_fn_executable_p + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +exec 6>&1 +## ----------------------------------- ## +## Main body of $CONFIG_STATUS script. ## +## ----------------------------------- ## +_ASEOF +test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# Save the log message, to keep $0 and so on meaningful, and to +# report actual input values of CONFIG_FILES etc. instead of their +# values after options handling. +ac_log=" +This file was extended by nfdump $as_me 1.6.13, which was +generated by GNU Autoconf 2.69. Invocation command line was + + CONFIG_FILES = $CONFIG_FILES + CONFIG_HEADERS = $CONFIG_HEADERS + CONFIG_LINKS = $CONFIG_LINKS + CONFIG_COMMANDS = $CONFIG_COMMANDS + $ $0 $@ + +on `(hostname || uname -n) 2>/dev/null | sed 1q` +" + +_ACEOF + +case $ac_config_files in *" +"*) set x $ac_config_files; shift; ac_config_files=$*;; +esac + +case $ac_config_headers in *" +"*) set x $ac_config_headers; shift; ac_config_headers=$*;; +esac + + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +# Files that config.status was made for. +config_files="$ac_config_files" +config_headers="$ac_config_headers" +config_commands="$ac_config_commands" + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +ac_cs_usage="\ +\`$as_me' instantiates files and other configuration actions +from templates according to the current configuration. Unless the files +and actions are specified as TAGs, all are instantiated by default. + +Usage: $0 [OPTION]... [TAG]... + + -h, --help print this help, then exit + -V, --version print version number and configuration settings, then exit + --config print configuration, then exit + -q, --quiet, --silent + do not print progress messages + -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 ." + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" +ac_cs_version="\\ +nfdump config.status 1.6.13 +configured by $0, generated by GNU Autoconf 2.69, + with options \\"\$ac_cs_config\\" + +Copyright (C) 2012 Free Software Foundation, Inc. +This config.status script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it." + +ac_pwd='$ac_pwd' +srcdir='$srcdir' +INSTALL='$INSTALL' +MKDIR_P='$MKDIR_P' +AWK='$AWK' +test -n "\$AWK" || AWK=awk +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# The default lists apply if the user does not specify any file. +ac_need_defaults=: +while test $# != 0 +do + case $1 in + --*=?*) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` + ac_shift=: + ;; + --*=) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg= + ac_shift=: + ;; + *) + ac_option=$1 + ac_optarg=$2 + ac_shift=shift + ;; + esac + + case $ac_option in + # Handling of the options. + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + ac_cs_recheck=: ;; + --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) + $as_echo "$ac_cs_version"; exit ;; + --config | --confi | --conf | --con | --co | --c ) + $as_echo "$ac_cs_config"; exit ;; + --debug | --debu | --deb | --de | --d | -d ) + debug=: ;; + --file | --fil | --fi | --f ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + '') as_fn_error $? "missing file argument" ;; + esac + as_fn_append CONFIG_FILES " '$ac_optarg'" + ac_need_defaults=false;; + --header | --heade | --head | --hea ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + as_fn_append CONFIG_HEADERS " '$ac_optarg'" + ac_need_defaults=false;; + --he | --h) + # Conflict between --help and --header + as_fn_error $? "ambiguous option: \`$1' +Try \`$0 --help' for more information.";; + --help | --hel | -h ) + $as_echo "$ac_cs_usage"; exit ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil | --si | --s) + ac_cs_silent=: ;; + + # This is an error. + -*) as_fn_error $? "unrecognized option: \`$1' +Try \`$0 --help' for more information." ;; + + *) as_fn_append ac_config_targets " $1" + ac_need_defaults=false ;; + + esac + shift +done + +ac_configure_extra_args= + +if $ac_cs_silent; then + exec 6>/dev/null + ac_configure_extra_args="$ac_configure_extra_args --silent" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +if \$ac_cs_recheck; then + set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion + shift + \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 + CONFIG_SHELL='$SHELL' + export CONFIG_SHELL + exec "\$@" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../@%:@@%:@ /;s/...$/ @%:@@%:@/;p;x;p;x' <<_ASBOX +@%:@@%:@ Running $as_me. @%:@@%:@ +_ASBOX + $as_echo "$ac_log" +} >&5 + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +# +# INIT-COMMANDS +# +AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 + +# Handling of arguments. +for ac_config_target in $ac_config_targets +do + case $ac_config_target in + "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; + "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; + "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; + "bin/Makefile") CONFIG_FILES="$CONFIG_FILES bin/Makefile" ;; + "man/Makefile") CONFIG_FILES="$CONFIG_FILES man/Makefile" ;; + + *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; + 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 + +# Have a temporary directory for convenience. Make it in the build tree +# simply because there is no reason against having it here, and in addition, +# creating and moving files from /tmp can sometimes cause problems. +# Hook for its removal unless debugging. +# Note that there is a small window in which the directory will not be cleaned: +# after its creation but before its name has been assigned to `$tmp'. +$debug || +{ + tmp= ac_tmp= + trap 'exit_status=$? + : "${ac_tmp:=$tmp}" + { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status +' 0 + trap 'as_fn_exit 1' 1 2 13 15 +} +# Create a (secure) tmp directory for tmp files. + +{ + tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && + test -d "$tmp" +} || +{ + tmp=./conf$$-$RANDOM + (umask 077 && mkdir "$tmp") +} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 +ac_tmp=$tmp + +# Set up the scripts for CONFIG_FILES section. +# No need to generate them if there are no CONFIG_FILES. +# This happens for instance with `./config.status config.h'. +if test -n "$CONFIG_FILES"; then + + +ac_cr=`echo X | tr X '\015'` +# On cygwin, bash can eat \r inside `` if the user requested igncr. +# But we know of no other shell where ac_cr would be empty at this +# point, so we can use a bashism as a fallback. +if test "x$ac_cr" = x; then + eval ac_cr=\$\'\\r\' +fi +ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` +if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then + ac_cs_awk_cr='\\r' +else + ac_cs_awk_cr=$ac_cr +fi + +echo 'BEGIN {' >"$ac_tmp/subs1.awk" && +_ACEOF + + +{ + echo "cat >conf$$subs.awk <<_ACEOF" && + echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && + echo "_ACEOF" +} >conf$$subs.sh || + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 +ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` +ac_delim='%!_!# ' +for ac_last_try in false false false false false :; do + . ./conf$$subs.sh || + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 + + ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` + if test $ac_delim_n = $ac_delim_num; then + break + elif $ac_last_try; then + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done +rm -f conf$$subs.sh + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && +_ACEOF +sed -n ' +h +s/^/S["/; s/!.*/"]=/ +p +g +s/^[^!]*!// +:repl +t repl +s/'"$ac_delim"'$// +t delim +:nl +h +s/\(.\{148\}\)..*/\1/ +t more1 +s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ +p +n +b repl +:more1 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t nl +:delim +h +s/\(.\{148\}\)..*/\1/ +t more2 +s/["\\]/\\&/g; s/^/"/; s/$/"/ +p +b +:more2 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t delim +' >$CONFIG_STATUS || ac_write_fail=1 +rm -f conf$$subs.awk +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +_ACAWK +cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && + for (key in S) S_is_set[key] = 1 + FS = "" + +} +{ + line = $ 0 + nfields = split(line, field, "@") + substed = 0 + len = length(field[1]) + for (i = 2; i < nfields; i++) { + key = field[i] + keylen = length(key) + if (S_is_set[key]) { + value = S[key] + line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) + len += length(value) + length(field[++i]) + substed = 1 + } else + len += 1 + keylen + } + + print line +} + +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then + sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" +else + cat +fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ + || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 +_ACEOF + +# VPATH may cause trouble with some makes, so we remove sole $(srcdir), +# ${srcdir} and @srcdir@ entries 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[ ]*=[ ]*/{ +h +s/// +s/^/:/ +s/[ ]*$/:/ +s/:\$(srcdir):/:/g +s/:\${srcdir}:/:/g +s/:@srcdir@:/:/g +s/^:*// +s/:*$// +x +s/\(=[ ]*\).*/\1/ +G +s/\n// +s/^[^=]*=[ ]*$// +}' +fi + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +fi # test -n "$CONFIG_FILES" + +# Set up the scripts for CONFIG_HEADERS section. +# No need to generate them if there are no CONFIG_HEADERS. +# This happens for instance with `./config.status Makefile'. +if test -n "$CONFIG_HEADERS"; then +cat >"$ac_tmp/defines.awk" <<\_ACAWK || +BEGIN { +_ACEOF + +# Transform confdefs.h into an awk script `defines.awk', embedded as +# here-document in config.status, that substitutes the proper values into +# config.h.in to produce config.h. + +# Create a delimiter string that does not exist in confdefs.h, to ease +# handling of long lines. +ac_delim='%!_!# ' +for ac_last_try in false false :; do + ac_tt=`sed -n "/$ac_delim/p" confdefs.h` + if test -z "$ac_tt"; then + break + elif $ac_last_try; then + as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done + +# For the awk script, D is an array of macro values keyed by name, +# likewise P contains macro parameters if any. Preserve backslash +# newline sequences. + +ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* +sed -n ' +s/.\{148\}/&'"$ac_delim"'/g +t rset +:rset +s/^[ ]*#[ ]*define[ ][ ]*/ / +t def +d +:def +s/\\$// +t bsnl +s/["\\]/\\&/g +s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ +D["\1"]=" \3"/p +s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p +d +:bsnl +s/["\\]/\\&/g +s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ +D["\1"]=" \3\\\\\\n"\\/p +t cont +s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p +t cont +d +:cont +n +s/.\{148\}/&'"$ac_delim"'/g +t clear +:clear +s/\\$// +t bsnlc +s/["\\]/\\&/g; s/^/"/; s/$/"/p +d +:bsnlc +s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p +b cont +' >$CONFIG_STATUS || ac_write_fail=1 + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + for (key in D) D_is_set[key] = 1 + FS = "" +} +/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { + line = \$ 0 + split(line, arg, " ") + if (arg[1] == "#") { + defundef = arg[2] + mac1 = arg[3] + } else { + defundef = substr(arg[1], 2) + mac1 = arg[2] + } + split(mac1, mac2, "(") #) + macro = mac2[1] + prefix = substr(line, 1, index(line, defundef) - 1) + if (D_is_set[macro]) { + # Preserve the white space surrounding the "#". + print prefix "define", macro P[macro] D[macro] + next + } else { + # Replace #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. + if (defundef == "undef") { + print "/*", prefix defundef, macro, "*/" + next + } + } +} +{ print } +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 + as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 +fi # test -n "$CONFIG_HEADERS" + + +eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" +shift +for ac_tag +do + case $ac_tag in + :[FHLC]) ac_mode=$ac_tag; continue;; + esac + case $ac_mode$ac_tag in + :[FHL]*:*);; + :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; + :[FH]-) ac_tag=-:-;; + :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; + esac + ac_save_IFS=$IFS + IFS=: + set x $ac_tag + IFS=$ac_save_IFS + shift + ac_file=$1 + shift + + case $ac_mode in + :L) ac_source=$1;; + :[FH]) + ac_file_inputs= + for ac_f + do + case $ac_f in + -) ac_f="$ac_tmp/stdin";; + *) # Look for the file first in the build tree, then in the source tree + # (if the path is not absolute). The absolute path cannot be DOS-style, + # because $ac_f cannot contain `:'. + test -f "$ac_f" || + case $ac_f in + [\\/$]*) false;; + *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; + esac || + as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; + esac + case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac + as_fn_append ac_file_inputs " '$ac_f'" + done + + # 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 by config.status. */ + configure_input='Generated from '` + $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' + `' by configure.' + if test x"$ac_file" != x-; then + configure_input="$ac_file. $configure_input" + { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 +$as_echo "$as_me: creating $ac_file" >&6;} + fi + # Neutralize special characters interpreted by sed in replacement strings. + case $configure_input in #( + *\&* | *\|* | *\\* ) + ac_sed_conf_input=`$as_echo "$configure_input" | + sed 's/[\\\\&|]/\\\\&/g'`;; #( + *) ac_sed_conf_input=$configure_input;; + esac + + case $ac_tag in + *:-:* | *:-) cat >"$ac_tmp/stdin" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; + esac + ;; + esac + + ac_dir=`$as_dirname -- "$ac_file" || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + as_dir="$ac_dir"; as_fn_mkdir_p + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + + case $ac_mode in + :F) + # + # CONFIG_FILE + # + + case $INSTALL in + [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; + *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; + esac + ac_MKDIR_P=$MKDIR_P + case $MKDIR_P in + [\\/$]* | ?:[\\/]* ) ;; + */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; + esac +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# If the template does not know about datarootdir, expand it. +# FIXME: This hack should be removed a few years after 2.60. +ac_datarootdir_hack=; ac_datarootdir_seen= +ac_sed_dataroot=' +/datarootdir/ { + p + q +} +/@datadir@/p +/@docdir@/p +/@infodir@/p +/@localedir@/p +/@mandir@/p' +case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in +*datarootdir*) ac_datarootdir_seen=yes;; +*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + ac_datarootdir_hack=' + s&@datadir@&$datadir&g + s&@docdir@&$docdir&g + s&@infodir@&$infodir&g + s&@localedir@&$localedir&g + s&@mandir@&$mandir&g + s&\\\${datarootdir}&$datarootdir&g' ;; +esac +_ACEOF + +# Neutralize VPATH when `$srcdir' = `.'. +# Shell code in configure.ac might set extrasub. +# FIXME: do we really want to maintain this feature? +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_sed_extra="$ac_vpsub +$extrasub +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +:t +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +s|@configure_input@|$ac_sed_conf_input|;t t +s&@top_builddir@&$ac_top_builddir_sub&;t t +s&@top_build_prefix@&$ac_top_build_prefix&;t t +s&@srcdir@&$ac_srcdir&;t t +s&@abs_srcdir@&$ac_abs_srcdir&;t t +s&@top_srcdir@&$ac_top_srcdir&;t t +s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t +s&@builddir@&$ac_builddir&;t t +s&@abs_builddir@&$ac_abs_builddir&;t t +s&@abs_top_builddir@&$ac_abs_top_builddir&;t t +s&@INSTALL@&$ac_INSTALL&;t t +s&@MKDIR_P@&$ac_MKDIR_P&;t t +$ac_datarootdir_hack +" +eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ + >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + +test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && + { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && + { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ + "$ac_tmp/out"`; test -z "$ac_out"; } && + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined" >&5 +$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined" >&2;} + + rm -f "$ac_tmp/stdin" + case $ac_file in + -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; + *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; + esac \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + ;; + :H) + # + # CONFIG_HEADER + # + if test x"$ac_file" != x-; then + { + $as_echo "/* $configure_input */" \ + && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" + } >"$ac_tmp/config.h" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then + { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 +$as_echo "$as_me: $ac_file is unchanged" >&6;} + else + rm -f "$ac_file" + mv "$ac_tmp/config.h" "$ac_file" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + fi + else + $as_echo "/* $configure_input */" \ + && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ + || as_fn_error $? "could not create -" "$LINENO" 5 + fi +# Compute "$ac_file"'s index in $config_headers. +_am_arg="$ac_file" +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $_am_arg | $_am_arg:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || +$as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$_am_arg" : 'X\(//\)[^/]' \| \ + X"$_am_arg" : 'X\(//\)$' \| \ + X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$_am_arg" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'`/stamp-h$_am_stamp_count + ;; + + :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 +$as_echo "$as_me: executing $ac_file commands" >&6;} + ;; + esac + + + case $ac_file$ac_mode in + "depfiles":C) test x"$AMDEP_TRUE" != x"" || { + # Older Autoconf quotes --file arguments for eval, but not when files + # are listed without --file. Let's play safe and only enable the eval + # if we detect the quoting. + case $CONFIG_FILES in + *\'*) eval set x "$CONFIG_FILES" ;; + *) set x $CONFIG_FILES ;; + esac + shift + for mf + do + # Strip MF so we end up with the name of the file. + mf=`echo "$mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile or not. + # We used to match only the files named 'Makefile.in', but + # some people rename them; so instead we look at the file content. + # Grep'ing the first line is not enough: some people post-process + # each Makefile.in and add a new line on top of each file to say so. + # Grep'ing the whole file is not good either: AIX grep has a line + # limit of 2048, but all sed's we know have understand at least 4000. + if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then + dirpart=`$as_dirname -- "$mf" || +$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$mf" : 'X\(//\)[^/]' \| \ + X"$mf" : 'X\(//\)$' \| \ + X"$mf" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$mf" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + else + continue + fi + # Extract the definition of DEPDIR, am__include, and am__quote + # from the Makefile without running 'make'. + DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` + test -z "$DEPDIR" && continue + am__include=`sed -n 's/^am__include = //p' < "$mf"` + test -z "$am__include" && continue + am__quote=`sed -n 's/^am__quote = //p' < "$mf"` + # Find all dependency output files, they are included files with + # $(DEPDIR) in their names. 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 " + s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do + # Make sure the directory exists. + test -f "$dirpart/$file" && continue + fdir=`$as_dirname -- "$file" || +$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$file" : 'X\(//\)[^/]' \| \ + X"$file" : 'X\(//\)$' \| \ + X"$file" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + as_dir=$dirpart/$fdir; as_fn_mkdir_p + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" + done + done +} + ;; + + esac +done # for ac_tag + + +as_fn_exit 0 +_ACEOF +ac_clean_files=$ac_clean_files_save + +test $ac_write_fail = 0 || + as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 + + +# 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=: + ac_config_status_args= + test "$silent" = yes && + ac_config_status_args="$ac_config_status_args --quiet" + exec 5>/dev/null + $SHELL $CONFIG_STATUS $ac_config_status_args || 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 || as_fn_exit 1 +fi +if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 +$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} +fi + + +echo "" +echo "* Many thanks for using nfdump tools" +echo "* You may want to subscribe to the nfdump-discuss and/or" +echo "* nfsen-discuss mailing list:" +echo "* http://lists.sourceforge.net/lists/listinfo/nfdump-discuss" +echo "* http://lists.sourceforge.net/lists/listinfo/nfsen-discuss" +echo "* Please send bug reports back to me: phaag@users.sourceforge.net" +echo "* or to one of the lists." + diff --git a/autom4te.cache/requests b/autom4te.cache/requests new file mode 100644 index 0000000..003c94c --- /dev/null +++ b/autom4te.cache/requests @@ -0,0 +1,154 @@ +# This file was generated. +# It contains the lists of macros which have been traced. +# It can be safely removed. + +@request = ( + bless( [ + '0', + 1, + [ + '/opt/local/share/autoconf' + ], + [ + '/opt/local/share/autoconf/autoconf/autoconf.m4f', + '-', + '/opt/local/share/aclocal-1.14/internal/ac-config-macro-dirs.m4', + '/opt/local/share/aclocal-1.14/amversion.m4', + '/opt/local/share/aclocal-1.14/auxdir.m4', + '/opt/local/share/aclocal-1.14/cond.m4', + '/opt/local/share/aclocal-1.14/depend.m4', + '/opt/local/share/aclocal-1.14/depout.m4', + '/opt/local/share/aclocal-1.14/init.m4', + '/opt/local/share/aclocal-1.14/install-sh.m4', + '/opt/local/share/aclocal-1.14/lead-dot.m4', + '/opt/local/share/aclocal-1.14/make.m4', + '/opt/local/share/aclocal-1.14/missing.m4', + '/opt/local/share/aclocal-1.14/options.m4', + '/opt/local/share/aclocal-1.14/prog-cc-c-o.m4', + '/opt/local/share/aclocal-1.14/runlog.m4', + '/opt/local/share/aclocal-1.14/sanity.m4', + '/opt/local/share/aclocal-1.14/silent.m4', + '/opt/local/share/aclocal-1.14/strip.m4', + '/opt/local/share/aclocal-1.14/substnot.m4', + '/opt/local/share/aclocal-1.14/tar.m4', + 'configure.ac' + ], + { + 'm4_pattern_forbid' => 1, + 'AM_SET_CURRENT_AUTOMAKE_VERSION' => 1, + '_AM_SET_OPTION' => 1, + 'AC_DEFUN' => 1, + 'AM_INIT_AUTOMAKE' => 1, + 'AM_AUTOMAKE_VERSION' => 1, + 'AM_MISSING_HAS_RUN' => 1, + 'AM_SUBST_NOTMAKE' => 1, + 'AM_MISSING_PROG' => 1, + 'AM_OUTPUT_DEPENDENCY_COMMANDS' => 1, + 'AC_DEFUN_ONCE' => 1, + '_AM_CONFIG_MACRO_DIRS' => 1, + 'AM_PROG_INSTALL_STRIP' => 1, + '_m4_warn' => 1, + 'AM_SANITY_CHECK' => 1, + 'AM_SILENT_RULES' => 1, + 'include' => 1, + '_AM_PROG_TAR' => 1, + 'AM_AUX_DIR_EXPAND' => 1, + 'AM_DEP_TRACK' => 1, + '_AM_SET_OPTIONS' => 1, + '_AM_OUTPUT_DEPENDENCY_COMMANDS' => 1, + 'AM_RUN_LOG' => 1, + 'AC_CONFIG_MACRO_DIR' => 1, + '_AM_IF_OPTION' => 1, + '_AM_SUBST_NOTMAKE' => 1, + 'm4_pattern_allow' => 1, + '_AM_AUTOCONF_VERSION' => 1, + 'AM_PROG_CC_C_O' => 1, + '_AM_MANGLE_OPTION' => 1, + 'AM_CONDITIONAL' => 1, + 'AM_SET_LEADING_DOT' => 1, + 'AC_CONFIG_MACRO_DIR_TRACE' => 1, + 'AM_SET_DEPDIR' => 1, + '_AM_DEPENDENCIES' => 1, + 'AM_PROG_INSTALL_SH' => 1, + 'm4_include' => 1, + '_AM_PROG_CC_C_O' => 1, + '_AC_AM_CONFIG_HEADER_HOOK' => 1, + 'AU_DEFUN' => 1, + 'AM_MAKE_INCLUDE' => 1 + } + ], 'Autom4te::Request' ), + bless( [ + '1', + 1, + [ + '/opt/local/share/autoconf' + ], + [ + '/opt/local/share/autoconf/autoconf/autoconf.m4f', + 'aclocal.m4', + 'configure.ac' + ], + { + 'AM_PROG_F77_C_O' => 1, + '_LT_AC_TAGCONFIG' => 1, + 'm4_pattern_forbid' => 1, + 'AC_INIT' => 1, + '_AM_COND_IF' => 1, + 'AC_CANONICAL_TARGET' => 1, + 'AC_SUBST' => 1, + 'AC_CONFIG_LIBOBJ_DIR' => 1, + 'AM_EXTRA_RECURSIVE_TARGETS' => 1, + 'AC_FC_SRCEXT' => 1, + 'AC_CANONICAL_HOST' => 1, + 'AC_PROG_LIBTOOL' => 1, + 'AM_PROG_MKDIR_P' => 1, + 'AM_INIT_AUTOMAKE' => 1, + 'AM_PATH_GUILE' => 1, + 'AC_CONFIG_SUBDIRS' => 1, + 'AM_AUTOMAKE_VERSION' => 1, + 'LT_CONFIG_LTDL_DIR' => 1, + 'AC_REQUIRE_AUX_FILE' => 1, + 'AC_CONFIG_LINKS' => 1, + 'LT_SUPPORTED_TAG' => 1, + 'm4_sinclude' => 1, + 'AM_MAINTAINER_MODE' => 1, + 'AM_NLS' => 1, + 'AC_FC_PP_DEFINE' => 1, + 'AM_GNU_GETTEXT_INTL_SUBDIR' => 1, + 'AM_MAKEFILE_INCLUDE' => 1, + '_m4_warn' => 1, + 'AM_PROG_CXX_C_O' => 1, + '_AM_MAKEFILE_INCLUDE' => 1, + '_AM_COND_ENDIF' => 1, + 'AM_ENABLE_MULTILIB' => 1, + 'AM_SILENT_RULES' => 1, + 'AM_PROG_MOC' => 1, + 'AC_CONFIG_FILES' => 1, + 'LT_INIT' => 1, + 'include' => 1, + 'AM_PROG_AR' => 1, + 'AM_GNU_GETTEXT' => 1, + 'AC_LIBSOURCE' => 1, + 'AM_PROG_FC_C_O' => 1, + 'AC_CANONICAL_BUILD' => 1, + 'AC_FC_FREEFORM' => 1, + 'AH_OUTPUT' => 1, + 'AC_FC_PP_SRCEXT' => 1, + '_AM_SUBST_NOTMAKE' => 1, + 'AC_CONFIG_AUX_DIR' => 1, + 'AM_PROG_CC_C_O' => 1, + 'm4_pattern_allow' => 1, + 'sinclude' => 1, + 'AM_XGETTEXT_OPTION' => 1, + 'AC_CANONICAL_SYSTEM' => 1, + 'AM_CONDITIONAL' => 1, + 'AC_CONFIG_HEADERS' => 1, + 'AC_DEFINE_TRACE_LITERAL' => 1, + 'AM_POT_TOOLS' => 1, + 'm4_include' => 1, + '_AM_COND_ELSE' => 1, + 'AC_SUBST_TRACE' => 1 + } + ], 'Autom4te::Request' ) + ); + diff --git a/autom4te.cache/traces.0 b/autom4te.cache/traces.0 new file mode 100644 index 0000000..6eb65ab --- /dev/null +++ b/autom4te.cache/traces.0 @@ -0,0 +1,1090 @@ +m4trace:/opt/local/share/aclocal-1.14/amversion.m4:14: -1- AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version='1.14' +dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to +dnl require some minimum version. Point them to the right macro. +m4_if([$1], [1.14.1], [], + [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl +]) +m4trace:/opt/local/share/aclocal-1.14/amversion.m4:33: -1- AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], [AM_AUTOMAKE_VERSION([1.14.1])dnl +m4_ifndef([AC_AUTOCONF_VERSION], + [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl +_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) +m4trace:/opt/local/share/aclocal-1.14/auxdir.m4:47: -1- AC_DEFUN([AM_AUX_DIR_EXPAND], [dnl Rely on autoconf to set up CDPATH properly. +AC_PREREQ([2.50])dnl +# expand $ac_aux_dir to an absolute path +am_aux_dir=`cd $ac_aux_dir && pwd` +]) +m4trace:/opt/local/share/aclocal-1.14/cond.m4:12: -1- AC_DEFUN([AM_CONDITIONAL], [AC_PREREQ([2.52])dnl + m4_if([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], + [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl +AC_SUBST([$1_TRUE])dnl +AC_SUBST([$1_FALSE])dnl +_AM_SUBST_NOTMAKE([$1_TRUE])dnl +_AM_SUBST_NOTMAKE([$1_FALSE])dnl +m4_define([_AM_COND_VALUE_$1], [$2])dnl +if $2; then + $1_TRUE= + $1_FALSE='#' +else + $1_TRUE='#' + $1_FALSE= +fi +AC_CONFIG_COMMANDS_PRE( +[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then + AC_MSG_ERROR([[conditional "$1" was never defined. +Usually this means the macro was only invoked conditionally.]]) +fi])]) +m4trace:/opt/local/share/aclocal-1.14/depend.m4:26: -1- 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 + +m4_if([$1], [CC], [depcc="$CC" am_compiler_list=], + [$1], [CXX], [depcc="$CXX" am_compiler_list=], + [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'], + [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'], + [$1], [UPC], [depcc="$UPC" am_compiler_list=], + [$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". + rm -rf conftest.dir + 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 + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + 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 + am__universal=false + m4_case([$1], [CC], + [case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac], + [CXX], + [case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac]) + + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # 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. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with + # Solaris 10 /bin/sh. + echo '/* dummy */' > sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + # 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. Also, some Intel + # versions had trouble with output in subdirs. + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; + 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 + ;; + msvc7 | msvc7msys | msvisualcpp | msvcmsys) + # This compiler won't grok '-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; + none) break ;; + esac + if depmode=$depmode \ + source=sub/conftest.c object=$am__obj \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_$1_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_$1_dependencies_compiler_type=none +fi +]) +AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) +AM_CONDITIONAL([am__fastdep$1], [ + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) +]) +m4trace:/opt/local/share/aclocal-1.14/depend.m4:163: -1- AC_DEFUN([AM_SET_DEPDIR], [AC_REQUIRE([AM_SET_LEADING_DOT])dnl +AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl +]) +m4trace:/opt/local/share/aclocal-1.14/depend.m4:171: -1- AC_DEFUN([AM_DEP_TRACK], [AC_ARG_ENABLE([dependency-tracking], [dnl +AS_HELP_STRING( + [--enable-dependency-tracking], + [do not reject slow dependency extractors]) +AS_HELP_STRING( + [--disable-dependency-tracking], + [speeds up one-time build])]) +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' + am__nodep='_no' +fi +AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) +AC_SUBST([AMDEPBACKSLASH])dnl +_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl +AC_SUBST([am__nodep])dnl +_AM_SUBST_NOTMAKE([am__nodep])dnl +]) +m4trace:/opt/local/share/aclocal-1.14/depout.m4:12: -1- AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], [{ + # Older Autoconf quotes --file arguments for eval, but not when files + # are listed without --file. Let's play safe and only enable the eval + # if we detect the quoting. + case $CONFIG_FILES in + *\'*) eval set x "$CONFIG_FILES" ;; + *) set x $CONFIG_FILES ;; + esac + shift + for mf + do + # Strip MF so we end up with the name of the file. + mf=`echo "$mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile or not. + # We used to match only the files named 'Makefile.in', but + # some people rename them; so instead we look at the file content. + # Grep'ing the first line is not enough: some people post-process + # each Makefile.in and add a new line on top of each file to say so. + # Grep'ing the whole file is not good either: AIX grep has a line + # limit of 2048, but all sed's we know have understand at least 4000. + if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then + dirpart=`AS_DIRNAME("$mf")` + else + continue + fi + # Extract the definition of DEPDIR, am__include, and am__quote + # from the Makefile without running 'make'. + DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` + test -z "$DEPDIR" && continue + am__include=`sed -n 's/^am__include = //p' < "$mf"` + test -z "$am__include" && continue + am__quote=`sed -n 's/^am__quote = //p' < "$mf"` + # Find all dependency output files, they are included files with + # $(DEPDIR) in their names. 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 " + s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do + # Make sure the directory exists. + test -f "$dirpart/$file" && continue + fdir=`AS_DIRNAME(["$file"])` + AS_MKDIR_P([$dirpart/$fdir]) + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" + done + done +} +]) +m4trace:/opt/local/share/aclocal-1.14/depout.m4:71: -1- AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], [AC_CONFIG_COMMANDS([depfiles], + [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], + [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) +]) +m4trace:/opt/local/share/aclocal-1.14/init.m4:29: -1- AC_DEFUN([AM_INIT_AUTOMAKE], [AC_PREREQ([2.65])dnl +dnl Autoconf wants to disallow AM_ names. We explicitly allow +dnl the ones we care about. +m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl +AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl +AC_REQUIRE([AC_PROG_INSTALL])dnl +if test "`cd $srcdir && pwd`" != "`pwd`"; then + # Use -I$(srcdir) only when $(srcdir) != ., so that make's output + # is not polluted with repeated "-I." + AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl + # test to see if srcdir already configured + if test -f $srcdir/config.status; then + AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) + fi +fi + +# test whether we have cygpath +if test -z "$CYGPATH_W"; then + if (cygpath --version) >/dev/null 2>/dev/null; then + CYGPATH_W='cygpath -w' + else + CYGPATH_W=echo + fi +fi +AC_SUBST([CYGPATH_W]) + +# Define the identity of the package. +dnl Distinguish between old-style and new-style calls. +m4_ifval([$2], +[AC_DIAGNOSE([obsolete], + [$0: two- and three-arguments forms are deprecated.]) +m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl + AC_SUBST([PACKAGE], [$1])dnl + AC_SUBST([VERSION], [$2])], +[_AM_SET_OPTIONS([$1])dnl +dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. +m4_if( + m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]), + [ok:ok],, + [m4_fatal([AC_INIT should be called with package and version arguments])])dnl + AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl + AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl + +_AM_IF_OPTION([no-define],, +[AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package]) + AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl + +# Some tools Automake needs. +AC_REQUIRE([AM_SANITY_CHECK])dnl +AC_REQUIRE([AC_ARG_PROGRAM])dnl +AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}]) +AM_MISSING_PROG([AUTOCONF], [autoconf]) +AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}]) +AM_MISSING_PROG([AUTOHEADER], [autoheader]) +AM_MISSING_PROG([MAKEINFO], [makeinfo]) +AC_REQUIRE([AM_PROG_INSTALL_SH])dnl +AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl +AC_REQUIRE([AC_PROG_MKDIR_P])dnl +# For better backward compatibility. To be removed once Automake 1.9.x +# dies out for good. For more background, see: +# +# +AC_SUBST([mkdir_p], ['$(MKDIR_P)']) +# 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_SET_LEADING_DOT])dnl +_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], + [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], + [_AM_PROG_TAR([v7])])]) +_AM_IF_OPTION([no-dependencies],, +[AC_PROVIDE_IFELSE([AC_PROG_CC], + [_AM_DEPENDENCIES([CC])], + [m4_define([AC_PROG_CC], + m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl +AC_PROVIDE_IFELSE([AC_PROG_CXX], + [_AM_DEPENDENCIES([CXX])], + [m4_define([AC_PROG_CXX], + m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl +AC_PROVIDE_IFELSE([AC_PROG_OBJC], + [_AM_DEPENDENCIES([OBJC])], + [m4_define([AC_PROG_OBJC], + m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl +AC_PROVIDE_IFELSE([AC_PROG_OBJCXX], + [_AM_DEPENDENCIES([OBJCXX])], + [m4_define([AC_PROG_OBJCXX], + m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl +]) +AC_REQUIRE([AM_SILENT_RULES])dnl +dnl The testsuite driver may need to know about EXEEXT, so add the +dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This +dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below. +AC_CONFIG_COMMANDS_PRE(dnl +[m4_provide_if([_AM_COMPILER_EXEEXT], + [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl + +# POSIX will say in a future version that running "rm -f" with no argument +# is OK; and we want to be able to make that assumption in our Makefile +# recipes. So use an aggressive probe to check that the usage we want is +# actually supported "in the wild" to an acceptable degree. +# See automake bug#10828. +# To make any issue more visible, cause the running configure to be aborted +# by default if the 'rm' program in use doesn't match our expectations; the +# user can still override this though. +if rm -f && rm -fr && rm -rf; then : OK; else + cat >&2 <<'END' +Oops! + +Your 'rm' program seems unable to run without file operands specified +on the command line, even when the '-f' option is present. This is contrary +to the behaviour of most rm programs out there, and not conforming with +the upcoming POSIX standard: + +Please tell bug-automake@gnu.org about your system, including the value +of your $PATH and any error possibly output before this message. This +can help us improve future automake versions. + +END + if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then + echo 'Configuration will proceed anyway, since you have set the' >&2 + echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 + echo >&2 + else + cat >&2 <<'END' +Aborting the configuration process, to ensure you take notice of the issue. + +You can download and install GNU coreutils to get an 'rm' implementation +that behaves properly: . + +If you want to complete the configuration process using your problematic +'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM +to "yes", and re-run configure. + +END + AC_MSG_ERROR([Your 'rm' program is bad, sorry.]) + fi +fi]) +m4trace:/opt/local/share/aclocal-1.14/init.m4:182: -1- AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], [# Compute $1's index in $config_headers. +_am_arg=$1 +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $_am_arg | $_am_arg:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) +m4trace:/opt/local/share/aclocal-1.14/install-sh.m4:11: -1- AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +if test x"${install_sh}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; + *) + install_sh="\${SHELL} $am_aux_dir/install-sh" + esac +fi +AC_SUBST([install_sh])]) +m4trace:/opt/local/share/aclocal-1.14/lead-dot.m4:10: -1- AC_DEFUN([AM_SET_LEADING_DOT], [rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null +AC_SUBST([am__leading_dot])]) +m4trace:/opt/local/share/aclocal-1.14/make.m4:12: -1- AC_DEFUN([AM_MAKE_INCLUDE], [am_make=${MAKE-make} +cat > confinc << 'END' +am__doit: + @echo this is the am__doit target +.PHONY: am__doit +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 +# Ignore all kinds of additional output from 'make'. +case `$am_make -s -f confmf 2> /dev/null` in #( +*the\ am__doit\ target*) + am__include=include + am__quote= + _am_result=GNU + ;; +esac +# Now try BSD make style include. +if test "$am__include" = "#"; then + echo '.include "confinc"' > confmf + case `$am_make -s -f confmf 2> /dev/null` in #( + *the\ am__doit\ target*) + am__include=.include + am__quote="\"" + _am_result=BSD + ;; + esac +fi +AC_SUBST([am__include]) +AC_SUBST([am__quote]) +AC_MSG_RESULT([$_am_result]) +rm -f confinc confmf +]) +m4trace:/opt/local/share/aclocal-1.14/missing.m4:11: -1- AC_DEFUN([AM_MISSING_PROG], [AC_REQUIRE([AM_MISSING_HAS_RUN]) +$1=${$1-"${am_missing_run}$2"} +AC_SUBST($1)]) +m4trace:/opt/local/share/aclocal-1.14/missing.m4:20: -1- AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +AC_REQUIRE_AUX_FILE([missing])dnl +if test x"${MISSING+set}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; + *) + MISSING="\${SHELL} $am_aux_dir/missing" ;; + esac +fi +# Use eval to expand $SHELL +if eval "$MISSING --is-lightweight"; then + am_missing_run="$MISSING " +else + am_missing_run= + AC_MSG_WARN(['missing' script is too old or missing]) +fi +]) +m4trace:/opt/local/share/aclocal-1.14/options.m4:11: -1- AC_DEFUN([_AM_MANGLE_OPTION], [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) +m4trace:/opt/local/share/aclocal-1.14/options.m4:17: -1- AC_DEFUN([_AM_SET_OPTION], [m4_define(_AM_MANGLE_OPTION([$1]), [1])]) +m4trace:/opt/local/share/aclocal-1.14/options.m4:23: -1- AC_DEFUN([_AM_SET_OPTIONS], [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) +m4trace:/opt/local/share/aclocal-1.14/options.m4:29: -1- AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) +m4trace:/opt/local/share/aclocal-1.14/prog-cc-c-o.m4:12: -1- AC_DEFUN([_AM_PROG_CC_C_O], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +AC_REQUIRE_AUX_FILE([compile])dnl +AC_LANG_PUSH([C])dnl +AC_CACHE_CHECK( + [whether $CC understands -c and -o together], + [am_cv_prog_cc_c_o], + [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])]) + # Make sure it works both with $CC and with simple cc. + # Following AC_PROG_CC_C_O, we do the test twice because some + # compilers refuse to overwrite an existing .o file with -o, + # though they will create one. + am_cv_prog_cc_c_o=yes + for am_i in 1 2; do + if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \ + && test -f conftest2.$ac_objext; then + : OK + else + am_cv_prog_cc_c_o=no + break + fi + done + rm -f core conftest* + unset am_i]) +if test "$am_cv_prog_cc_c_o" != yes; then + # Losing compiler, so override with the script. + # FIXME: It is wrong to rewrite CC. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__CC in this case, + # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" + CC="$am_aux_dir/compile $CC" +fi +AC_LANG_POP([C])]) +m4trace:/opt/local/share/aclocal-1.14/prog-cc-c-o.m4:47: -1- AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])]) +m4trace:/opt/local/share/aclocal-1.14/runlog.m4:12: -1- AC_DEFUN([AM_RUN_LOG], [{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD + ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD + (exit $ac_status); }]) +m4trace:/opt/local/share/aclocal-1.14/sanity.m4:11: -1- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) +# Reject unsafe characters in $srcdir or the absolute working directory +# name. Accept space and tab only in the latter. +am_lf=' +' +case `pwd` in + *[[\\\"\#\$\&\'\`$am_lf]]*) + AC_MSG_ERROR([unsafe absolute working directory name]);; +esac +case $srcdir in + *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) + AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);; +esac + +# 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 ( + am_has_slept=no + for am_try in 1 2; do + echo "timestamp, slept: $am_has_slept" > conftest.file + 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 + 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 + if test "$[2]" = conftest.file || test $am_try -eq 2; then + break + fi + # Just in case. + sleep 1 + am_has_slept=yes + done + 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]) +# If we didn't sleep, we still need to ensure time stamps of config.status and +# generated files are strictly newer. +am_sleep_pid= +if grep 'slept: no' conftest.file >/dev/null 2>&1; then + ( sleep 1 ) & + am_sleep_pid=$! +fi +AC_CONFIG_COMMANDS_PRE( + [AC_MSG_CHECKING([that generated files are newer than configure]) + if test -n "$am_sleep_pid"; then + # Hide warnings about reused PIDs. + wait $am_sleep_pid 2>/dev/null + fi + AC_MSG_RESULT([done])]) +rm -f conftest.file +]) +m4trace:/opt/local/share/aclocal-1.14/silent.m4:12: -1- AC_DEFUN([AM_SILENT_RULES], [AC_ARG_ENABLE([silent-rules], [dnl +AS_HELP_STRING( + [--enable-silent-rules], + [less verbose build output (undo: "make V=1")]) +AS_HELP_STRING( + [--disable-silent-rules], + [verbose build output (undo: "make V=0")])dnl +]) +case $enable_silent_rules in @%:@ ((( + yes) AM_DEFAULT_VERBOSITY=0;; + no) AM_DEFAULT_VERBOSITY=1;; + *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);; +esac +dnl +dnl A few 'make' implementations (e.g., NonStop OS and NextStep) +dnl do not support nested variable expansions. +dnl See automake bug#9928 and bug#10237. +am_make=${MAKE-make} +AC_CACHE_CHECK([whether $am_make supports nested variables], + [am_cv_make_support_nested_variables], + [if AS_ECHO([['TRUE=$(BAR$(V)) +BAR0=false +BAR1=true +V=1 +am__doit: + @$(TRUE) +.PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then + am_cv_make_support_nested_variables=yes +else + am_cv_make_support_nested_variables=no +fi]) +if test $am_cv_make_support_nested_variables = yes; then + dnl Using '$V' instead of '$(V)' breaks IRIX make. + AM_V='$(V)' + AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' +else + AM_V=$AM_DEFAULT_VERBOSITY + AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY +fi +AC_SUBST([AM_V])dnl +AM_SUBST_NOTMAKE([AM_V])dnl +AC_SUBST([AM_DEFAULT_V])dnl +AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl +AC_SUBST([AM_DEFAULT_VERBOSITY])dnl +AM_BACKSLASH='\' +AC_SUBST([AM_BACKSLASH])dnl +_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl +]) +m4trace:/opt/local/share/aclocal-1.14/strip.m4:17: -1- AC_DEFUN([AM_PROG_INSTALL_STRIP], [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl +# Installed binaries are usually stripped using 'strip' when the user +# run "make install-strip". However 'strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the 'STRIP' environment variable to overrule this program. +dnl Don't test for $cross_compiling = yes, because it might be 'maybe'. +if test "$cross_compiling" != no; then + AC_CHECK_TOOL([STRIP], [strip], :) +fi +INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" +AC_SUBST([INSTALL_STRIP_PROGRAM])]) +m4trace:/opt/local/share/aclocal-1.14/substnot.m4:12: -1- AC_DEFUN([_AM_SUBST_NOTMAKE]) +m4trace:/opt/local/share/aclocal-1.14/substnot.m4:17: -1- AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) +m4trace:/opt/local/share/aclocal-1.14/tar.m4:23: -1- AC_DEFUN([_AM_PROG_TAR], [# Always define AMTAR for backward compatibility. Yes, it's still used +# in the wild :-( We should find a proper way to deprecate it ... +AC_SUBST([AMTAR], ['$${TAR-tar}']) + +# We'll loop over all known methods to create a tar archive until one works. +_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' + +m4_if([$1], [v7], + [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], + + [m4_case([$1], + [ustar], + [# The POSIX 1988 'ustar' format is defined with fixed-size fields. + # There is notably a 21 bits limit for the UID and the GID. In fact, + # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343 + # and bug#13588). + am_max_uid=2097151 # 2^21 - 1 + am_max_gid=$am_max_uid + # The $UID and $GID variables are not portable, so we need to resort + # to the POSIX-mandated id(1) utility. Errors in the 'id' calls + # below are definitely unexpected, so allow the users to see them + # (that is, avoid stderr redirection). + am_uid=`id -u || echo unknown` + am_gid=`id -g || echo unknown` + AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format]) + if test $am_uid -le $am_max_uid; then + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + _am_tools=none + fi + AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format]) + if test $am_gid -le $am_max_gid; then + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + _am_tools=none + fi], + + [pax], + [], + + [m4_fatal([Unknown tar format])]) + + AC_MSG_CHECKING([how to create a $1 tar archive]) + + # Go ahead even if we have the value already cached. We do so because we + # need to set the values for the 'am__tar' and 'am__untar' variables. + _am_tools=${am_cv_prog_tar_$1-$_am_tools} + + for _am_tool in $_am_tools; do + case $_am_tool in + gnutar) + for _am_tar in tar gnutar gtar; do + AM_RUN_LOG([$_am_tar --version]) && break + done + am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' + am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' + am__untar="$_am_tar -xf -" + ;; + plaintar) + # Must skip GNU tar: if it does not support --format= it doesn't create + # ustar tarball either. + (tar --version) >/dev/null 2>&1 && continue + am__tar='tar chf - "$$tardir"' + am__tar_='tar chf - "$tardir"' + am__untar='tar xf -' + ;; + pax) + am__tar='pax -L -x $1 -w "$$tardir"' + am__tar_='pax -L -x $1 -w "$tardir"' + am__untar='pax -r' + ;; + cpio) + am__tar='find "$$tardir" -print | cpio -o -H $1 -L' + am__tar_='find "$tardir" -print | cpio -o -H $1 -L' + am__untar='cpio -i -H $1 -d' + ;; + none) + am__tar=false + am__tar_=false + am__untar=false + ;; + esac + + # If the value was cached, stop now. We just wanted to have am__tar + # and am__untar set. + test -n "${am_cv_prog_tar_$1}" && break + + # tar/untar a dummy directory, and stop if the command works. + rm -rf conftest.dir + mkdir conftest.dir + echo GrepMe > conftest.dir/file + AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) + rm -rf conftest.dir + if test -s conftest.tar; then + AM_RUN_LOG([$am__untar /dev/null 2>&1 && break + fi + done + rm -rf conftest.dir + + AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) + AC_MSG_RESULT([$am_cv_prog_tar_$1])]) + +AC_SUBST([am__tar]) +AC_SUBST([am__untar]) +]) +m4trace:configure.ac:6: -1- m4_pattern_forbid([^_?A[CHUM]_]) +m4trace:configure.ac:6: -1- m4_pattern_forbid([_AC_]) +m4trace:configure.ac:6: -1- m4_pattern_forbid([^LIBOBJS$], [do not use LIBOBJS directly, use AC_LIBOBJ (see section `AC_LIBOBJ vs LIBOBJS']) +m4trace:configure.ac:6: -1- m4_pattern_allow([^AS_FLAGS$]) +m4trace:configure.ac:6: -1- m4_pattern_forbid([^_?m4_]) +m4trace:configure.ac:6: -1- m4_pattern_forbid([^dnl$]) +m4trace:configure.ac:6: -1- m4_pattern_forbid([^_?AS_]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^SHELL$]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^PATH_SEPARATOR$]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^PACKAGE_NAME$]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^PACKAGE_TARNAME$]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^PACKAGE_VERSION$]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^PACKAGE_STRING$]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^PACKAGE_BUGREPORT$]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^PACKAGE_URL$]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^exec_prefix$]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^prefix$]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^program_transform_name$]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^bindir$]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^sbindir$]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^libexecdir$]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^datarootdir$]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^datadir$]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^sysconfdir$]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^sharedstatedir$]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^localstatedir$]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^includedir$]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^oldincludedir$]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^docdir$]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^infodir$]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^htmldir$]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^dvidir$]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^pdfdir$]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^psdir$]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^libdir$]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^localedir$]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^mandir$]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^PACKAGE_NAME$]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^PACKAGE_TARNAME$]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^PACKAGE_VERSION$]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^PACKAGE_STRING$]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^PACKAGE_BUGREPORT$]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^PACKAGE_URL$]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^DEFS$]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^ECHO_C$]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^ECHO_N$]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^ECHO_T$]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^LIBS$]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^build_alias$]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^host_alias$]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^target_alias$]) +m4trace:configure.ac:10: -1- AM_INIT_AUTOMAKE([subdir-objects]) +m4trace:configure.ac:10: -1- m4_pattern_allow([^AM_[A-Z]+FLAGS$]) +m4trace:configure.ac:10: -1- AM_SET_CURRENT_AUTOMAKE_VERSION +m4trace:configure.ac:10: -1- AM_AUTOMAKE_VERSION([1.14.1]) +m4trace:configure.ac:10: -1- _AM_AUTOCONF_VERSION([2.69]) +m4trace:configure.ac:10: -1- m4_pattern_allow([^INSTALL_PROGRAM$]) +m4trace:configure.ac:10: -1- m4_pattern_allow([^INSTALL_SCRIPT$]) +m4trace:configure.ac:10: -1- m4_pattern_allow([^INSTALL_DATA$]) +m4trace:configure.ac:10: -1- m4_pattern_allow([^am__isrc$]) +m4trace:configure.ac:10: -1- _AM_SUBST_NOTMAKE([am__isrc]) +m4trace:configure.ac:10: -1- m4_pattern_allow([^CYGPATH_W$]) +m4trace:configure.ac:10: -1- _AM_SET_OPTIONS([subdir-objects]) +m4trace:configure.ac:10: -1- _AM_SET_OPTION([subdir-objects]) +m4trace:configure.ac:10: -2- _AM_MANGLE_OPTION([subdir-objects]) +m4trace:configure.ac:10: -1- m4_pattern_allow([^PACKAGE$]) +m4trace:configure.ac:10: -1- m4_pattern_allow([^VERSION$]) +m4trace:configure.ac:10: -1- _AM_IF_OPTION([no-define], [], [AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package]) + AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])]) +m4trace:configure.ac:10: -2- _AM_MANGLE_OPTION([no-define]) +m4trace:configure.ac:10: -1- m4_pattern_allow([^PACKAGE$]) +m4trace:configure.ac:10: -1- m4_pattern_allow([^VERSION$]) +m4trace:configure.ac:10: -1- AM_SANITY_CHECK +m4trace:configure.ac:10: -1- AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}]) +m4trace:configure.ac:10: -1- AM_MISSING_HAS_RUN +m4trace:configure.ac:10: -1- AM_AUX_DIR_EXPAND +m4trace:configure.ac:10: -1- m4_pattern_allow([^ACLOCAL$]) +m4trace:configure.ac:10: -1- AM_MISSING_PROG([AUTOCONF], [autoconf]) +m4trace:configure.ac:10: -1- m4_pattern_allow([^AUTOCONF$]) +m4trace:configure.ac:10: -1- AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}]) +m4trace:configure.ac:10: -1- m4_pattern_allow([^AUTOMAKE$]) +m4trace:configure.ac:10: -1- AM_MISSING_PROG([AUTOHEADER], [autoheader]) +m4trace:configure.ac:10: -1- m4_pattern_allow([^AUTOHEADER$]) +m4trace:configure.ac:10: -1- AM_MISSING_PROG([MAKEINFO], [makeinfo]) +m4trace:configure.ac:10: -1- m4_pattern_allow([^MAKEINFO$]) +m4trace:configure.ac:10: -1- AM_PROG_INSTALL_SH +m4trace:configure.ac:10: -1- m4_pattern_allow([^install_sh$]) +m4trace:configure.ac:10: -1- AM_PROG_INSTALL_STRIP +m4trace:configure.ac:10: -1- m4_pattern_allow([^STRIP$]) +m4trace:configure.ac:10: -1- m4_pattern_allow([^INSTALL_STRIP_PROGRAM$]) +m4trace:configure.ac:10: -1- m4_pattern_allow([^MKDIR_P$]) +m4trace:configure.ac:10: -1- m4_pattern_allow([^mkdir_p$]) +m4trace:configure.ac:10: -1- m4_pattern_allow([^AWK$]) +m4trace:configure.ac:10: -1- m4_pattern_allow([^SET_MAKE$]) +m4trace:configure.ac:10: -1- AM_SET_LEADING_DOT +m4trace:configure.ac:10: -1- m4_pattern_allow([^am__leading_dot$]) +m4trace:configure.ac:10: -1- _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], + [_AM_PROG_TAR([v7])])]) +m4trace:configure.ac:10: -2- _AM_MANGLE_OPTION([tar-ustar]) +m4trace:configure.ac:10: -1- _AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], [_AM_PROG_TAR([v7])]) +m4trace:configure.ac:10: -2- _AM_MANGLE_OPTION([tar-pax]) +m4trace:configure.ac:10: -1- _AM_PROG_TAR([v7]) +m4trace:configure.ac:10: -1- m4_pattern_allow([^AMTAR$]) +m4trace:configure.ac:10: -1- m4_pattern_allow([^am__tar$]) +m4trace:configure.ac:10: -1- m4_pattern_allow([^am__untar$]) +m4trace:configure.ac:10: -1- _AM_IF_OPTION([no-dependencies], [], [AC_PROVIDE_IFELSE([AC_PROG_CC], + [_AM_DEPENDENCIES([CC])], + [m4_define([AC_PROG_CC], + m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl +AC_PROVIDE_IFELSE([AC_PROG_CXX], + [_AM_DEPENDENCIES([CXX])], + [m4_define([AC_PROG_CXX], + m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl +AC_PROVIDE_IFELSE([AC_PROG_OBJC], + [_AM_DEPENDENCIES([OBJC])], + [m4_define([AC_PROG_OBJC], + m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl +AC_PROVIDE_IFELSE([AC_PROG_OBJCXX], + [_AM_DEPENDENCIES([OBJCXX])], + [m4_define([AC_PROG_OBJCXX], + m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl +]) +m4trace:configure.ac:10: -2- _AM_MANGLE_OPTION([no-dependencies]) +m4trace:configure.ac:10: -1- AM_SILENT_RULES +m4trace:configure.ac:10: -1- m4_pattern_allow([^AM_V$]) +m4trace:configure.ac:10: -1- AM_SUBST_NOTMAKE([AM_V]) +m4trace:configure.ac:10: -1- _AM_SUBST_NOTMAKE([AM_V]) +m4trace:configure.ac:10: -1- m4_pattern_allow([^AM_DEFAULT_V$]) +m4trace:configure.ac:10: -1- AM_SUBST_NOTMAKE([AM_DEFAULT_V]) +m4trace:configure.ac:10: -1- _AM_SUBST_NOTMAKE([AM_DEFAULT_V]) +m4trace:configure.ac:10: -1- m4_pattern_allow([^AM_DEFAULT_VERBOSITY$]) +m4trace:configure.ac:10: -1- m4_pattern_allow([^AM_BACKSLASH$]) +m4trace:configure.ac:10: -1- _AM_SUBST_NOTMAKE([AM_BACKSLASH]) +m4trace:configure.ac:13: -1- m4_pattern_allow([^CC$]) +m4trace:configure.ac:13: -1- m4_pattern_allow([^CFLAGS$]) +m4trace:configure.ac:13: -1- m4_pattern_allow([^LDFLAGS$]) +m4trace:configure.ac:13: -1- m4_pattern_allow([^LIBS$]) +m4trace:configure.ac:13: -1- m4_pattern_allow([^CPPFLAGS$]) +m4trace:configure.ac:13: -1- m4_pattern_allow([^CC$]) +m4trace:configure.ac:13: -1- m4_pattern_allow([^CC$]) +m4trace:configure.ac:13: -1- m4_pattern_allow([^CC$]) +m4trace:configure.ac:13: -1- m4_pattern_allow([^CC$]) +m4trace:configure.ac:13: -1- m4_pattern_allow([^ac_ct_CC$]) +m4trace:configure.ac:13: -1- m4_pattern_allow([^EXEEXT$]) +m4trace:configure.ac:13: -1- m4_pattern_allow([^OBJEXT$]) +m4trace:configure.ac:13: -1- _AM_PROG_CC_C_O +m4trace:configure.ac:13: -1- AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) +m4trace:configure.ac:13: -1- _AM_DEPENDENCIES([CC]) +m4trace:configure.ac:13: -1- AM_SET_DEPDIR +m4trace:configure.ac:13: -1- m4_pattern_allow([^DEPDIR$]) +m4trace:configure.ac:13: -1- AM_OUTPUT_DEPENDENCY_COMMANDS +m4trace:configure.ac:13: -1- AM_MAKE_INCLUDE +m4trace:configure.ac:13: -1- m4_pattern_allow([^am__include$]) +m4trace:configure.ac:13: -1- m4_pattern_allow([^am__quote$]) +m4trace:configure.ac:13: -1- AM_DEP_TRACK +m4trace:configure.ac:13: -1- AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) +m4trace:configure.ac:13: -1- m4_pattern_allow([^AMDEP_TRUE$]) +m4trace:configure.ac:13: -1- m4_pattern_allow([^AMDEP_FALSE$]) +m4trace:configure.ac:13: -1- _AM_SUBST_NOTMAKE([AMDEP_TRUE]) +m4trace:configure.ac:13: -1- _AM_SUBST_NOTMAKE([AMDEP_FALSE]) +m4trace:configure.ac:13: -1- m4_pattern_allow([^AMDEPBACKSLASH$]) +m4trace:configure.ac:13: -1- _AM_SUBST_NOTMAKE([AMDEPBACKSLASH]) +m4trace:configure.ac:13: -1- m4_pattern_allow([^am__nodep$]) +m4trace:configure.ac:13: -1- _AM_SUBST_NOTMAKE([am__nodep]) +m4trace:configure.ac:13: -1- m4_pattern_allow([^CCDEPMODE$]) +m4trace:configure.ac:13: -1- AM_CONDITIONAL([am__fastdepCC], [ + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CC_dependencies_compiler_type" = gcc3]) +m4trace:configure.ac:13: -1- m4_pattern_allow([^am__fastdepCC_TRUE$]) +m4trace:configure.ac:13: -1- m4_pattern_allow([^am__fastdepCC_FALSE$]) +m4trace:configure.ac:13: -1- _AM_SUBST_NOTMAKE([am__fastdepCC_TRUE]) +m4trace:configure.ac:13: -1- _AM_SUBST_NOTMAKE([am__fastdepCC_FALSE]) +m4trace:configure.ac:14: -1- AM_PROG_CC_C_O +m4trace:configure.ac:18: -1- _m4_warn([obsolete], [The macro `ac_cv_prog_gcc' is obsolete. +You should run autoupdate.], [../../lib/autoconf/c.m4:436: ac_cv_prog_gcc is expanded from... +configure.ac:18: the top level]) +m4trace:configure.ac:65: -1- m4_pattern_allow([^YACC$]) +m4trace:configure.ac:65: -1- m4_pattern_allow([^YACC$]) +m4trace:configure.ac:65: -1- m4_pattern_allow([^YFLAGS$]) +m4trace:configure.ac:66: -1- m4_pattern_allow([^LEX$]) +m4trace:configure.ac:66: -1- m4_pattern_allow([^LEX_OUTPUT_ROOT$]) +m4trace:configure.ac:66: -1- m4_pattern_allow([^LEXLIB$]) +m4trace:configure.ac:66: -1- m4_pattern_allow([^YYTEXT_POINTER$]) +m4trace:configure.ac:105: -2- m4_pattern_allow([^HAVE_LIBZ$]) +m4trace:configure.ac:120: -2- AM_CONDITIONAL([FT2NFDUMP], [true]) +m4trace:configure.ac:120: -2- m4_pattern_allow([^FT2NFDUMP_TRUE$]) +m4trace:configure.ac:120: -2- m4_pattern_allow([^FT2NFDUMP_FALSE$]) +m4trace:configure.ac:120: -2- _AM_SUBST_NOTMAKE([FT2NFDUMP_TRUE]) +m4trace:configure.ac:120: -2- _AM_SUBST_NOTMAKE([FT2NFDUMP_FALSE]) +m4trace:configure.ac:122: -2- AM_CONDITIONAL([FT2NFDUMP], [false]) +m4trace:configure.ac:122: -2- m4_pattern_allow([^FT2NFDUMP_TRUE$]) +m4trace:configure.ac:122: -2- m4_pattern_allow([^FT2NFDUMP_FALSE$]) +m4trace:configure.ac:122: -2- _AM_SUBST_NOTMAKE([FT2NFDUMP_TRUE]) +m4trace:configure.ac:122: -2- _AM_SUBST_NOTMAKE([FT2NFDUMP_FALSE]) +m4trace:configure.ac:156: -2- AM_CONDITIONAL([NFPROFILE], [false]) +m4trace:configure.ac:156: -2- m4_pattern_allow([^NFPROFILE_TRUE$]) +m4trace:configure.ac:156: -2- m4_pattern_allow([^NFPROFILE_FALSE$]) +m4trace:configure.ac:156: -2- _AM_SUBST_NOTMAKE([NFPROFILE_TRUE]) +m4trace:configure.ac:156: -2- _AM_SUBST_NOTMAKE([NFPROFILE_FALSE]) +m4trace:configure.ac:126: -1- m4_pattern_allow([^RRD_LIBS$]) +m4trace:configure.ac:126: -1- m4_pattern_allow([^CPP$]) +m4trace:configure.ac:126: -1- m4_pattern_allow([^CPPFLAGS$]) +m4trace:configure.ac:126: -1- m4_pattern_allow([^CPP$]) +m4trace:configure.ac:126: -1- m4_pattern_allow([^GREP$]) +m4trace:configure.ac:126: -1- m4_pattern_allow([^EGREP$]) +m4trace:configure.ac:126: -1- m4_pattern_allow([^STDC_HEADERS$]) +m4trace:configure.ac:126: -1- m4_pattern_allow([^HAVE_RRD_H$]) +m4trace:configure.ac:126: -1- AM_CONDITIONAL([NFPROFILE], [true]) +m4trace:configure.ac:126: -1- m4_pattern_allow([^NFPROFILE_TRUE$]) +m4trace:configure.ac:126: -1- m4_pattern_allow([^NFPROFILE_FALSE$]) +m4trace:configure.ac:126: -1- _AM_SUBST_NOTMAKE([NFPROFILE_TRUE]) +m4trace:configure.ac:126: -1- _AM_SUBST_NOTMAKE([NFPROFILE_FALSE]) +m4trace:configure.ac:126: -1- _m4_warn([cross], [AC_RUN_IFELSE called without default to allow cross compiling], [../../lib/autoconf/general.m4:2748: AC_RUN_IFELSE is expanded from... +../../lib/m4sugar/m4sh.m4:639: AS_IF is expanded from... +../../lib/autoconf/general.m4:1462: AC_ARG_ENABLE is expanded from... +configure.ac:126: the top level]) +m4trace:configure.ac:189: -2- AM_CONDITIONAL([NFTRACK], [false]) +m4trace:configure.ac:189: -2- m4_pattern_allow([^NFTRACK_TRUE$]) +m4trace:configure.ac:189: -2- m4_pattern_allow([^NFTRACK_FALSE$]) +m4trace:configure.ac:189: -2- _AM_SUBST_NOTMAKE([NFTRACK_TRUE]) +m4trace:configure.ac:189: -2- _AM_SUBST_NOTMAKE([NFTRACK_FALSE]) +m4trace:configure.ac:159: -1- m4_pattern_allow([^RRD_LIBS$]) +m4trace:configure.ac:159: -1- m4_pattern_allow([^HAVE_RRD_H$]) +m4trace:configure.ac:159: -1- AM_CONDITIONAL([NFTRACK], [true]) +m4trace:configure.ac:159: -1- m4_pattern_allow([^NFTRACK_TRUE$]) +m4trace:configure.ac:159: -1- m4_pattern_allow([^NFTRACK_FALSE$]) +m4trace:configure.ac:159: -1- _AM_SUBST_NOTMAKE([NFTRACK_TRUE]) +m4trace:configure.ac:159: -1- _AM_SUBST_NOTMAKE([NFTRACK_FALSE]) +m4trace:configure.ac:159: -1- _m4_warn([cross], [AC_RUN_IFELSE called without default to allow cross compiling], [../../lib/autoconf/general.m4:2748: AC_RUN_IFELSE is expanded from... +../../lib/m4sugar/m4sh.m4:639: AS_IF is expanded from... +../../lib/autoconf/general.m4:1462: AC_ARG_ENABLE is expanded from... +configure.ac:159: the top level]) +m4trace:configure.ac:194: -1- AM_CONDITIONAL([SFLOW], [test "$enable_sflow" = yes]) +m4trace:configure.ac:194: -1- m4_pattern_allow([^SFLOW_TRUE$]) +m4trace:configure.ac:194: -1- m4_pattern_allow([^SFLOW_FALSE$]) +m4trace:configure.ac:194: -1- _AM_SUBST_NOTMAKE([SFLOW_TRUE]) +m4trace:configure.ac:194: -1- _AM_SUBST_NOTMAKE([SFLOW_FALSE]) +m4trace:configure.ac:198: -1- AM_CONDITIONAL([READPCAP], [test "$enable_readpcap" = yes]) +m4trace:configure.ac:198: -1- m4_pattern_allow([^READPCAP_TRUE$]) +m4trace:configure.ac:198: -1- m4_pattern_allow([^READPCAP_FALSE$]) +m4trace:configure.ac:198: -1- _AM_SUBST_NOTMAKE([READPCAP_TRUE]) +m4trace:configure.ac:198: -1- _AM_SUBST_NOTMAKE([READPCAP_FALSE]) +m4trace:configure.ac:202: -1- AM_CONDITIONAL([BUILDNFPCAPD], [test "$enable_nfpcapd" = yes]) +m4trace:configure.ac:202: -1- m4_pattern_allow([^BUILDNFPCAPD_TRUE$]) +m4trace:configure.ac:202: -1- m4_pattern_allow([^BUILDNFPCAPD_FALSE$]) +m4trace:configure.ac:202: -1- _AM_SUBST_NOTMAKE([BUILDNFPCAPD_TRUE]) +m4trace:configure.ac:202: -1- _AM_SUBST_NOTMAKE([BUILDNFPCAPD_FALSE]) +m4trace:configure.ac:206: -2- m4_pattern_allow([^HAVE_SOCKADDR_SA_LEN$]) +m4trace:configure.ac:210: -1- m4_pattern_allow([^HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY$]) +m4trace:configure.ac:210: -1- m4_pattern_allow([^HAVE_STRUCT_SOCKADDR_STORAGE___SS_FAMILY$]) +m4trace:configure.ac:210: -1- m4_pattern_allow([^HAVE_STRUCT_SOCKADDR_STORAGE_SS_LEN$]) +m4trace:configure.ac:210: -1- m4_pattern_allow([^HAVE_STRUCT_SOCKADDR_STORAGE___SS_LEN$]) +m4trace:configure.ac:210: -1- m4_pattern_allow([^HAVE_STRUCT_SOCKADDR_SA_LEN$]) +m4trace:configure.ac:220: -1- m4_pattern_allow([^FT_INCLUDES$]) +m4trace:configure.ac:221: -1- m4_pattern_allow([^FT_LDFLAGS$]) +m4trace:configure.ac:222: -1- m4_pattern_allow([^LFLAGS$]) +m4trace:configure.ac:226: -1- m4_pattern_allow([^HAVE_GETHOSTBYNAME$]) +m4trace:configure.ac:226: -1- m4_pattern_allow([^HAVE_LIBNSL$]) +m4trace:configure.ac:226: -1- m4_pattern_allow([^HAVE_LIBSOCKET$]) +m4trace:configure.ac:227: -1- m4_pattern_allow([^HAVE_SETSOCKOPT$]) +m4trace:configure.ac:227: -1- m4_pattern_allow([^HAVE_LIBSOCKET$]) +m4trace:configure.ac:235: -1- m4_pattern_allow([^HAVE_HTONLL$]) +m4trace:configure.ac:255: -1- m4_pattern_allow([^STDC_HEADERS$]) +m4trace:configure.ac:256: -1- m4_pattern_allow([^HAVE_NAMESER8_COMPAT_H$]) +m4trace:configure.ac:279: -1- m4_pattern_allow([^FTS_OBJ$]) +m4trace:configure.ac:283: -1- m4_pattern_allow([^SIZEOF_VOID_P$]) +m4trace:configure.ac:285: -1- m4_pattern_allow([^const$]) +m4trace:configure.ac:287: -1- m4_pattern_allow([^WORDS_BIGENDIAN$]) +m4trace:configure.ac:287: -1- m4_pattern_allow([^AC_APPLE_UNIVERSAL_BUILD$]) +m4trace:configure.ac:288: -1- m4_pattern_allow([^pid_t$]) +m4trace:configure.ac:289: -1- m4_pattern_allow([^size_t$]) +m4trace:configure.ac:290: -1- m4_pattern_allow([^TM_IN_SYS_TIME$]) +m4trace:configure.ac:291: -1- m4_pattern_allow([^HAVE__BOOL$]) +m4trace:configure.ac:291: -1- m4_pattern_allow([^HAVE_STDBOOL_H$]) +m4trace:configure.ac:294: -1- m4_pattern_allow([^CLOSEDIR_VOID$]) +m4trace:configure.ac:295: -1- m4_pattern_allow([^HAVE_VFORK_H$]) +m4trace:configure.ac:295: -1- m4_pattern_allow([^HAVE_WORKING_VFORK$]) +m4trace:configure.ac:295: -1- m4_pattern_allow([^vfork$]) +m4trace:configure.ac:295: -1- m4_pattern_allow([^HAVE_WORKING_FORK$]) +m4trace:configure.ac:296: -1- m4_pattern_allow([^HAVE_STDLIB_H$]) +m4trace:configure.ac:296: -1- m4_pattern_allow([^HAVE_MALLOC$]) +m4trace:configure.ac:296: -1- m4_pattern_allow([^HAVE_MALLOC$]) +m4trace:configure.ac:296: -1- m4_pattern_allow([^LIB@&t@OBJS$]) +m4trace:configure.ac:296: -1- m4_pattern_allow([^malloc$]) +m4trace:configure.ac:297: -1- m4_pattern_allow([^TIME_WITH_SYS_TIME$]) +m4trace:configure.ac:297: -1- AC_DEFUN([_AC_Header_sys_time_h], [m4_divert_text([INIT_PREPARE], [AS_VAR_APPEND([ac_header_list], [" sys/time.h"])]) +_AC_HEADERS_EXPANSION]) +m4trace:configure.ac:297: -1- AC_DEFUN([_AC_Header_unistd_h], [m4_divert_text([INIT_PREPARE], [AS_VAR_APPEND([ac_header_list], [" unistd.h"])]) +_AC_HEADERS_EXPANSION]) +m4trace:configure.ac:297: -1- AC_DEFUN([_AC_Func_alarm], [m4_divert_text([INIT_PREPARE], [AS_VAR_APPEND([ac_func_list], [" alarm"])]) +_AC_FUNCS_EXPANSION]) +m4trace:configure.ac:297: -1- m4_pattern_allow([^LIB@&t@OBJS$]) +m4trace:configure.ac:298: -1- m4_pattern_allow([^HAVE_STDLIB_H$]) +m4trace:configure.ac:298: -1- m4_pattern_allow([^HAVE_REALLOC$]) +m4trace:configure.ac:298: -1- m4_pattern_allow([^HAVE_REALLOC$]) +m4trace:configure.ac:298: -1- m4_pattern_allow([^LIB@&t@OBJS$]) +m4trace:configure.ac:298: -1- m4_pattern_allow([^realloc$]) +m4trace:configure.ac:299: -1- m4_pattern_allow([^LSTAT_FOLLOWS_SLASHED_SYMLINK$]) +m4trace:configure.ac:299: -1- m4_pattern_allow([^LIB@&t@OBJS$]) +m4trace:configure.ac:299: -1- m4_pattern_allow([^LIB@&t@OBJS$]) +m4trace:configure.ac:299: -1- m4_pattern_allow([^HAVE_STAT_EMPTY_STRING_BUG$]) +m4trace:configure.ac:300: -1- m4_pattern_allow([^HAVE_STRFTIME$]) +m4trace:configure.ac:300: -1- m4_pattern_allow([^HAVE_STRFTIME$]) +m4trace:configure.ac:306: -1- m4_pattern_allow([^HAVE_LIBRESOLV$]) +m4trace:configure.ac:306: -1- m4_pattern_allow([^HAVE_LIBRESOLV$]) +m4trace:configure.ac:306: -1- m4_pattern_allow([^HAVE_LIBSOCKET$]) +m4trace:configure.ac:306: -1- m4_pattern_allow([^HAVE_LIBRESOLV$]) +m4trace:configure.ac:306: -1- m4_pattern_allow([^HAVE_LIBRESOLV$]) +m4trace:configure.ac:306: -1- m4_pattern_allow([^HAVE_LIBRESOLV$]) +m4trace:configure.ac:321: -1- m4_pattern_allow([^ptrdiff_t$]) +m4trace:configure.ac:322: -1- m4_pattern_allow([^size_t$]) +m4trace:configure.ac:323: -1- m4_pattern_allow([^SIZEOF_SHORT$]) +m4trace:configure.ac:324: -1- m4_pattern_allow([^SIZEOF_INT$]) +m4trace:configure.ac:325: -1- m4_pattern_allow([^SIZEOF_LONG$]) +m4trace:configure.ac:326: -1- m4_pattern_allow([^SIZEOF_LONG_LONG$]) +m4trace:configure.ac:327: -1- m4_pattern_allow([^SIZEOF___INT64$]) +m4trace:configure.ac:328: -1- m4_pattern_allow([^SIZEOF_VOID_P$]) +m4trace:configure.ac:329: -1- m4_pattern_allow([^SIZEOF_SIZE_T$]) +m4trace:configure.ac:330: -1- m4_pattern_allow([^SIZEOF_PTRDIFF_T$]) +m4trace:configure.ac:331: -1- m4_pattern_allow([^const$]) +m4trace:configure.ac:335: -1- _m4_warn([obsolete], [The macro `AC_TRY_COMPILE' is obsolete. +You should run autoupdate.], [../../lib/autoconf/general.m4:2614: AC_TRY_COMPILE is expanded from... +../../lib/m4sugar/m4sh.m4:639: AS_IF is expanded from... +../../lib/autoconf/general.m4:2031: AC_CACHE_VAL is expanded from... +configure.ac:335: the top level]) +m4trace:configure.ac:353: -1- m4_pattern_allow([^HAVE_SEMUN$]) +m4trace:configure.ac:357: -1- _m4_warn([obsolete], [The macro `AC_TRY_RUN' is obsolete. +You should run autoupdate.], [../../lib/autoconf/general.m4:2764: AC_TRY_RUN is expanded from... +configure.ac:357: the top level]) +m4trace:configure.ac:357: -1- m4_pattern_allow([^HAVE_SIZE_T_Z_FORMAT$]) +m4trace:configure.ac:386: -1- _m4_warn([obsolete], [AC_OUTPUT should be used without arguments. +You should run autoupdate.], []) +m4trace:configure.ac:386: -1- m4_pattern_allow([^LIB@&t@OBJS$]) +m4trace:configure.ac:386: -1- m4_pattern_allow([^LTLIBOBJS$]) +m4trace:configure.ac:386: -1- AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"]) +m4trace:configure.ac:386: -1- m4_pattern_allow([^am__EXEEXT_TRUE$]) +m4trace:configure.ac:386: -1- m4_pattern_allow([^am__EXEEXT_FALSE$]) +m4trace:configure.ac:386: -1- _AM_SUBST_NOTMAKE([am__EXEEXT_TRUE]) +m4trace:configure.ac:386: -1- _AM_SUBST_NOTMAKE([am__EXEEXT_FALSE]) +m4trace:configure.ac:386: -1- _AC_AM_CONFIG_HEADER_HOOK(["$ac_file"]) +m4trace:configure.ac:386: -1- _AM_OUTPUT_DEPENDENCY_COMMANDS diff --git a/autom4te.cache/traces.1 b/autom4te.cache/traces.1 new file mode 100644 index 0000000..8a5ed5a --- /dev/null +++ b/autom4te.cache/traces.1 @@ -0,0 +1,909 @@ +m4trace:configure.ac:6: -1- AC_INIT([nfdump], [1.6.13], [phaag@users.sourceforge.net]) +m4trace:configure.ac:6: -1- m4_pattern_forbid([^_?A[CHUM]_]) +m4trace:configure.ac:6: -1- m4_pattern_forbid([_AC_]) +m4trace:configure.ac:6: -1- m4_pattern_forbid([^LIBOBJS$], [do not use LIBOBJS directly, use AC_LIBOBJ (see section `AC_LIBOBJ vs LIBOBJS']) +m4trace:configure.ac:6: -1- m4_pattern_allow([^AS_FLAGS$]) +m4trace:configure.ac:6: -1- m4_pattern_forbid([^_?m4_]) +m4trace:configure.ac:6: -1- m4_pattern_forbid([^dnl$]) +m4trace:configure.ac:6: -1- m4_pattern_forbid([^_?AS_]) +m4trace:configure.ac:6: -1- AC_SUBST([SHELL]) +m4trace:configure.ac:6: -1- AC_SUBST_TRACE([SHELL]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^SHELL$]) +m4trace:configure.ac:6: -1- AC_SUBST([PATH_SEPARATOR]) +m4trace:configure.ac:6: -1- AC_SUBST_TRACE([PATH_SEPARATOR]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^PATH_SEPARATOR$]) +m4trace:configure.ac:6: -1- AC_SUBST([PACKAGE_NAME], [m4_ifdef([AC_PACKAGE_NAME], ['AC_PACKAGE_NAME'])]) +m4trace:configure.ac:6: -1- AC_SUBST_TRACE([PACKAGE_NAME]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^PACKAGE_NAME$]) +m4trace:configure.ac:6: -1- AC_SUBST([PACKAGE_TARNAME], [m4_ifdef([AC_PACKAGE_TARNAME], ['AC_PACKAGE_TARNAME'])]) +m4trace:configure.ac:6: -1- AC_SUBST_TRACE([PACKAGE_TARNAME]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^PACKAGE_TARNAME$]) +m4trace:configure.ac:6: -1- AC_SUBST([PACKAGE_VERSION], [m4_ifdef([AC_PACKAGE_VERSION], ['AC_PACKAGE_VERSION'])]) +m4trace:configure.ac:6: -1- AC_SUBST_TRACE([PACKAGE_VERSION]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^PACKAGE_VERSION$]) +m4trace:configure.ac:6: -1- AC_SUBST([PACKAGE_STRING], [m4_ifdef([AC_PACKAGE_STRING], ['AC_PACKAGE_STRING'])]) +m4trace:configure.ac:6: -1- AC_SUBST_TRACE([PACKAGE_STRING]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^PACKAGE_STRING$]) +m4trace:configure.ac:6: -1- AC_SUBST([PACKAGE_BUGREPORT], [m4_ifdef([AC_PACKAGE_BUGREPORT], ['AC_PACKAGE_BUGREPORT'])]) +m4trace:configure.ac:6: -1- AC_SUBST_TRACE([PACKAGE_BUGREPORT]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^PACKAGE_BUGREPORT$]) +m4trace:configure.ac:6: -1- AC_SUBST([PACKAGE_URL], [m4_ifdef([AC_PACKAGE_URL], ['AC_PACKAGE_URL'])]) +m4trace:configure.ac:6: -1- AC_SUBST_TRACE([PACKAGE_URL]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^PACKAGE_URL$]) +m4trace:configure.ac:6: -1- AC_SUBST([exec_prefix], [NONE]) +m4trace:configure.ac:6: -1- AC_SUBST_TRACE([exec_prefix]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^exec_prefix$]) +m4trace:configure.ac:6: -1- AC_SUBST([prefix], [NONE]) +m4trace:configure.ac:6: -1- AC_SUBST_TRACE([prefix]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^prefix$]) +m4trace:configure.ac:6: -1- AC_SUBST([program_transform_name], [s,x,x,]) +m4trace:configure.ac:6: -1- AC_SUBST_TRACE([program_transform_name]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^program_transform_name$]) +m4trace:configure.ac:6: -1- AC_SUBST([bindir], ['${exec_prefix}/bin']) +m4trace:configure.ac:6: -1- AC_SUBST_TRACE([bindir]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^bindir$]) +m4trace:configure.ac:6: -1- AC_SUBST([sbindir], ['${exec_prefix}/sbin']) +m4trace:configure.ac:6: -1- AC_SUBST_TRACE([sbindir]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^sbindir$]) +m4trace:configure.ac:6: -1- AC_SUBST([libexecdir], ['${exec_prefix}/libexec']) +m4trace:configure.ac:6: -1- AC_SUBST_TRACE([libexecdir]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^libexecdir$]) +m4trace:configure.ac:6: -1- AC_SUBST([datarootdir], ['${prefix}/share']) +m4trace:configure.ac:6: -1- AC_SUBST_TRACE([datarootdir]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^datarootdir$]) +m4trace:configure.ac:6: -1- AC_SUBST([datadir], ['${datarootdir}']) +m4trace:configure.ac:6: -1- AC_SUBST_TRACE([datadir]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^datadir$]) +m4trace:configure.ac:6: -1- AC_SUBST([sysconfdir], ['${prefix}/etc']) +m4trace:configure.ac:6: -1- AC_SUBST_TRACE([sysconfdir]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^sysconfdir$]) +m4trace:configure.ac:6: -1- AC_SUBST([sharedstatedir], ['${prefix}/com']) +m4trace:configure.ac:6: -1- AC_SUBST_TRACE([sharedstatedir]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^sharedstatedir$]) +m4trace:configure.ac:6: -1- AC_SUBST([localstatedir], ['${prefix}/var']) +m4trace:configure.ac:6: -1- AC_SUBST_TRACE([localstatedir]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^localstatedir$]) +m4trace:configure.ac:6: -1- AC_SUBST([includedir], ['${prefix}/include']) +m4trace:configure.ac:6: -1- AC_SUBST_TRACE([includedir]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^includedir$]) +m4trace:configure.ac:6: -1- AC_SUBST([oldincludedir], ['/usr/include']) +m4trace:configure.ac:6: -1- AC_SUBST_TRACE([oldincludedir]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^oldincludedir$]) +m4trace:configure.ac:6: -1- AC_SUBST([docdir], [m4_ifset([AC_PACKAGE_TARNAME], + ['${datarootdir}/doc/${PACKAGE_TARNAME}'], + ['${datarootdir}/doc/${PACKAGE}'])]) +m4trace:configure.ac:6: -1- AC_SUBST_TRACE([docdir]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^docdir$]) +m4trace:configure.ac:6: -1- AC_SUBST([infodir], ['${datarootdir}/info']) +m4trace:configure.ac:6: -1- AC_SUBST_TRACE([infodir]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^infodir$]) +m4trace:configure.ac:6: -1- AC_SUBST([htmldir], ['${docdir}']) +m4trace:configure.ac:6: -1- AC_SUBST_TRACE([htmldir]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^htmldir$]) +m4trace:configure.ac:6: -1- AC_SUBST([dvidir], ['${docdir}']) +m4trace:configure.ac:6: -1- AC_SUBST_TRACE([dvidir]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^dvidir$]) +m4trace:configure.ac:6: -1- AC_SUBST([pdfdir], ['${docdir}']) +m4trace:configure.ac:6: -1- AC_SUBST_TRACE([pdfdir]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^pdfdir$]) +m4trace:configure.ac:6: -1- AC_SUBST([psdir], ['${docdir}']) +m4trace:configure.ac:6: -1- AC_SUBST_TRACE([psdir]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^psdir$]) +m4trace:configure.ac:6: -1- AC_SUBST([libdir], ['${exec_prefix}/lib']) +m4trace:configure.ac:6: -1- AC_SUBST_TRACE([libdir]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^libdir$]) +m4trace:configure.ac:6: -1- AC_SUBST([localedir], ['${datarootdir}/locale']) +m4trace:configure.ac:6: -1- AC_SUBST_TRACE([localedir]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^localedir$]) +m4trace:configure.ac:6: -1- AC_SUBST([mandir], ['${datarootdir}/man']) +m4trace:configure.ac:6: -1- AC_SUBST_TRACE([mandir]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^mandir$]) +m4trace:configure.ac:6: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_NAME]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^PACKAGE_NAME$]) +m4trace:configure.ac:6: -1- AH_OUTPUT([PACKAGE_NAME], [/* Define to the full name of this package. */ +@%:@undef PACKAGE_NAME]) +m4trace:configure.ac:6: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_TARNAME]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^PACKAGE_TARNAME$]) +m4trace:configure.ac:6: -1- AH_OUTPUT([PACKAGE_TARNAME], [/* Define to the one symbol short name of this package. */ +@%:@undef PACKAGE_TARNAME]) +m4trace:configure.ac:6: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_VERSION]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^PACKAGE_VERSION$]) +m4trace:configure.ac:6: -1- AH_OUTPUT([PACKAGE_VERSION], [/* Define to the version of this package. */ +@%:@undef PACKAGE_VERSION]) +m4trace:configure.ac:6: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_STRING]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^PACKAGE_STRING$]) +m4trace:configure.ac:6: -1- AH_OUTPUT([PACKAGE_STRING], [/* Define to the full name and version of this package. */ +@%:@undef PACKAGE_STRING]) +m4trace:configure.ac:6: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_BUGREPORT]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^PACKAGE_BUGREPORT$]) +m4trace:configure.ac:6: -1- AH_OUTPUT([PACKAGE_BUGREPORT], [/* Define to the address where bug reports for this package should be sent. */ +@%:@undef PACKAGE_BUGREPORT]) +m4trace:configure.ac:6: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_URL]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^PACKAGE_URL$]) +m4trace:configure.ac:6: -1- AH_OUTPUT([PACKAGE_URL], [/* Define to the home page for this package. */ +@%:@undef PACKAGE_URL]) +m4trace:configure.ac:6: -1- AC_SUBST([DEFS]) +m4trace:configure.ac:6: -1- AC_SUBST_TRACE([DEFS]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^DEFS$]) +m4trace:configure.ac:6: -1- AC_SUBST([ECHO_C]) +m4trace:configure.ac:6: -1- AC_SUBST_TRACE([ECHO_C]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^ECHO_C$]) +m4trace:configure.ac:6: -1- AC_SUBST([ECHO_N]) +m4trace:configure.ac:6: -1- AC_SUBST_TRACE([ECHO_N]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^ECHO_N$]) +m4trace:configure.ac:6: -1- AC_SUBST([ECHO_T]) +m4trace:configure.ac:6: -1- AC_SUBST_TRACE([ECHO_T]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^ECHO_T$]) +m4trace:configure.ac:6: -1- AC_SUBST([LIBS]) +m4trace:configure.ac:6: -1- AC_SUBST_TRACE([LIBS]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^LIBS$]) +m4trace:configure.ac:6: -1- AC_SUBST([build_alias]) +m4trace:configure.ac:6: -1- AC_SUBST_TRACE([build_alias]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^build_alias$]) +m4trace:configure.ac:6: -1- AC_SUBST([host_alias]) +m4trace:configure.ac:6: -1- AC_SUBST_TRACE([host_alias]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^host_alias$]) +m4trace:configure.ac:6: -1- AC_SUBST([target_alias]) +m4trace:configure.ac:6: -1- AC_SUBST_TRACE([target_alias]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^target_alias$]) +m4trace:configure.ac:9: -1- AC_CONFIG_HEADERS([config.h]) +m4trace:configure.ac:10: -1- AM_INIT_AUTOMAKE([subdir-objects]) +m4trace:configure.ac:10: -1- m4_pattern_allow([^AM_[A-Z]+FLAGS$]) +m4trace:configure.ac:10: -1- AM_AUTOMAKE_VERSION([1.14.1]) +m4trace:configure.ac:10: -1- AC_REQUIRE_AUX_FILE([install-sh]) +m4trace:configure.ac:10: -1- AC_SUBST([INSTALL_PROGRAM]) +m4trace:configure.ac:10: -1- AC_SUBST_TRACE([INSTALL_PROGRAM]) +m4trace:configure.ac:10: -1- m4_pattern_allow([^INSTALL_PROGRAM$]) +m4trace:configure.ac:10: -1- AC_SUBST([INSTALL_SCRIPT]) +m4trace:configure.ac:10: -1- AC_SUBST_TRACE([INSTALL_SCRIPT]) +m4trace:configure.ac:10: -1- m4_pattern_allow([^INSTALL_SCRIPT$]) +m4trace:configure.ac:10: -1- AC_SUBST([INSTALL_DATA]) +m4trace:configure.ac:10: -1- AC_SUBST_TRACE([INSTALL_DATA]) +m4trace:configure.ac:10: -1- m4_pattern_allow([^INSTALL_DATA$]) +m4trace:configure.ac:10: -1- AC_SUBST([am__isrc], [' -I$(srcdir)']) +m4trace:configure.ac:10: -1- AC_SUBST_TRACE([am__isrc]) +m4trace:configure.ac:10: -1- m4_pattern_allow([^am__isrc$]) +m4trace:configure.ac:10: -1- _AM_SUBST_NOTMAKE([am__isrc]) +m4trace:configure.ac:10: -1- AC_SUBST([CYGPATH_W]) +m4trace:configure.ac:10: -1- AC_SUBST_TRACE([CYGPATH_W]) +m4trace:configure.ac:10: -1- m4_pattern_allow([^CYGPATH_W$]) +m4trace:configure.ac:10: -1- AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME']) +m4trace:configure.ac:10: -1- AC_SUBST_TRACE([PACKAGE]) +m4trace:configure.ac:10: -1- m4_pattern_allow([^PACKAGE$]) +m4trace:configure.ac:10: -1- AC_SUBST([VERSION], ['AC_PACKAGE_VERSION']) +m4trace:configure.ac:10: -1- AC_SUBST_TRACE([VERSION]) +m4trace:configure.ac:10: -1- m4_pattern_allow([^VERSION$]) +m4trace:configure.ac:10: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE]) +m4trace:configure.ac:10: -1- m4_pattern_allow([^PACKAGE$]) +m4trace:configure.ac:10: -1- AH_OUTPUT([PACKAGE], [/* Name of package */ +@%:@undef PACKAGE]) +m4trace:configure.ac:10: -1- AC_DEFINE_TRACE_LITERAL([VERSION]) +m4trace:configure.ac:10: -1- m4_pattern_allow([^VERSION$]) +m4trace:configure.ac:10: -1- AH_OUTPUT([VERSION], [/* Version number of package */ +@%:@undef VERSION]) +m4trace:configure.ac:10: -1- AC_REQUIRE_AUX_FILE([missing]) +m4trace:configure.ac:10: -1- AC_SUBST([ACLOCAL]) +m4trace:configure.ac:10: -1- AC_SUBST_TRACE([ACLOCAL]) +m4trace:configure.ac:10: -1- m4_pattern_allow([^ACLOCAL$]) +m4trace:configure.ac:10: -1- AC_SUBST([AUTOCONF]) +m4trace:configure.ac:10: -1- AC_SUBST_TRACE([AUTOCONF]) +m4trace:configure.ac:10: -1- m4_pattern_allow([^AUTOCONF$]) +m4trace:configure.ac:10: -1- AC_SUBST([AUTOMAKE]) +m4trace:configure.ac:10: -1- AC_SUBST_TRACE([AUTOMAKE]) +m4trace:configure.ac:10: -1- m4_pattern_allow([^AUTOMAKE$]) +m4trace:configure.ac:10: -1- AC_SUBST([AUTOHEADER]) +m4trace:configure.ac:10: -1- AC_SUBST_TRACE([AUTOHEADER]) +m4trace:configure.ac:10: -1- m4_pattern_allow([^AUTOHEADER$]) +m4trace:configure.ac:10: -1- AC_SUBST([MAKEINFO]) +m4trace:configure.ac:10: -1- AC_SUBST_TRACE([MAKEINFO]) +m4trace:configure.ac:10: -1- m4_pattern_allow([^MAKEINFO$]) +m4trace:configure.ac:10: -1- AC_SUBST([install_sh]) +m4trace:configure.ac:10: -1- AC_SUBST_TRACE([install_sh]) +m4trace:configure.ac:10: -1- m4_pattern_allow([^install_sh$]) +m4trace:configure.ac:10: -1- AC_SUBST([STRIP]) +m4trace:configure.ac:10: -1- AC_SUBST_TRACE([STRIP]) +m4trace:configure.ac:10: -1- m4_pattern_allow([^STRIP$]) +m4trace:configure.ac:10: -1- AC_SUBST([INSTALL_STRIP_PROGRAM]) +m4trace:configure.ac:10: -1- AC_SUBST_TRACE([INSTALL_STRIP_PROGRAM]) +m4trace:configure.ac:10: -1- m4_pattern_allow([^INSTALL_STRIP_PROGRAM$]) +m4trace:configure.ac:10: -1- AC_REQUIRE_AUX_FILE([install-sh]) +m4trace:configure.ac:10: -1- AC_SUBST([MKDIR_P]) +m4trace:configure.ac:10: -1- AC_SUBST_TRACE([MKDIR_P]) +m4trace:configure.ac:10: -1- m4_pattern_allow([^MKDIR_P$]) +m4trace:configure.ac:10: -1- AC_SUBST([mkdir_p], ['$(MKDIR_P)']) +m4trace:configure.ac:10: -1- AC_SUBST_TRACE([mkdir_p]) +m4trace:configure.ac:10: -1- m4_pattern_allow([^mkdir_p$]) +m4trace:configure.ac:10: -1- AC_SUBST([AWK]) +m4trace:configure.ac:10: -1- AC_SUBST_TRACE([AWK]) +m4trace:configure.ac:10: -1- m4_pattern_allow([^AWK$]) +m4trace:configure.ac:10: -1- AC_SUBST([SET_MAKE]) +m4trace:configure.ac:10: -1- AC_SUBST_TRACE([SET_MAKE]) +m4trace:configure.ac:10: -1- m4_pattern_allow([^SET_MAKE$]) +m4trace:configure.ac:10: -1- AC_SUBST([am__leading_dot]) +m4trace:configure.ac:10: -1- AC_SUBST_TRACE([am__leading_dot]) +m4trace:configure.ac:10: -1- m4_pattern_allow([^am__leading_dot$]) +m4trace:configure.ac:10: -1- AC_SUBST([AMTAR], ['$${TAR-tar}']) +m4trace:configure.ac:10: -1- AC_SUBST_TRACE([AMTAR]) +m4trace:configure.ac:10: -1- m4_pattern_allow([^AMTAR$]) +m4trace:configure.ac:10: -1- AC_SUBST([am__tar]) +m4trace:configure.ac:10: -1- AC_SUBST_TRACE([am__tar]) +m4trace:configure.ac:10: -1- m4_pattern_allow([^am__tar$]) +m4trace:configure.ac:10: -1- AC_SUBST([am__untar]) +m4trace:configure.ac:10: -1- AC_SUBST_TRACE([am__untar]) +m4trace:configure.ac:10: -1- m4_pattern_allow([^am__untar$]) +m4trace:configure.ac:10: -1- AM_SILENT_RULES +m4trace:configure.ac:10: -1- AC_SUBST([AM_V]) +m4trace:configure.ac:10: -1- AC_SUBST_TRACE([AM_V]) +m4trace:configure.ac:10: -1- m4_pattern_allow([^AM_V$]) +m4trace:configure.ac:10: -1- _AM_SUBST_NOTMAKE([AM_V]) +m4trace:configure.ac:10: -1- AC_SUBST([AM_DEFAULT_V]) +m4trace:configure.ac:10: -1- AC_SUBST_TRACE([AM_DEFAULT_V]) +m4trace:configure.ac:10: -1- m4_pattern_allow([^AM_DEFAULT_V$]) +m4trace:configure.ac:10: -1- _AM_SUBST_NOTMAKE([AM_DEFAULT_V]) +m4trace:configure.ac:10: -1- AC_SUBST([AM_DEFAULT_VERBOSITY]) +m4trace:configure.ac:10: -1- AC_SUBST_TRACE([AM_DEFAULT_VERBOSITY]) +m4trace:configure.ac:10: -1- m4_pattern_allow([^AM_DEFAULT_VERBOSITY$]) +m4trace:configure.ac:10: -1- AC_SUBST([AM_BACKSLASH]) +m4trace:configure.ac:10: -1- AC_SUBST_TRACE([AM_BACKSLASH]) +m4trace:configure.ac:10: -1- m4_pattern_allow([^AM_BACKSLASH$]) +m4trace:configure.ac:10: -1- _AM_SUBST_NOTMAKE([AM_BACKSLASH]) +m4trace:configure.ac:13: -1- AC_SUBST([CC]) +m4trace:configure.ac:13: -1- AC_SUBST_TRACE([CC]) +m4trace:configure.ac:13: -1- m4_pattern_allow([^CC$]) +m4trace:configure.ac:13: -1- AC_SUBST([CFLAGS]) +m4trace:configure.ac:13: -1- AC_SUBST_TRACE([CFLAGS]) +m4trace:configure.ac:13: -1- m4_pattern_allow([^CFLAGS$]) +m4trace:configure.ac:13: -1- AC_SUBST([LDFLAGS]) +m4trace:configure.ac:13: -1- AC_SUBST_TRACE([LDFLAGS]) +m4trace:configure.ac:13: -1- m4_pattern_allow([^LDFLAGS$]) +m4trace:configure.ac:13: -1- AC_SUBST([LIBS]) +m4trace:configure.ac:13: -1- AC_SUBST_TRACE([LIBS]) +m4trace:configure.ac:13: -1- m4_pattern_allow([^LIBS$]) +m4trace:configure.ac:13: -1- AC_SUBST([CPPFLAGS]) +m4trace:configure.ac:13: -1- AC_SUBST_TRACE([CPPFLAGS]) +m4trace:configure.ac:13: -1- m4_pattern_allow([^CPPFLAGS$]) +m4trace:configure.ac:13: -1- AC_SUBST([CC]) +m4trace:configure.ac:13: -1- AC_SUBST_TRACE([CC]) +m4trace:configure.ac:13: -1- m4_pattern_allow([^CC$]) +m4trace:configure.ac:13: -1- AC_SUBST([CC]) +m4trace:configure.ac:13: -1- AC_SUBST_TRACE([CC]) +m4trace:configure.ac:13: -1- m4_pattern_allow([^CC$]) +m4trace:configure.ac:13: -1- AC_SUBST([CC]) +m4trace:configure.ac:13: -1- AC_SUBST_TRACE([CC]) +m4trace:configure.ac:13: -1- m4_pattern_allow([^CC$]) +m4trace:configure.ac:13: -1- AC_SUBST([CC]) +m4trace:configure.ac:13: -1- AC_SUBST_TRACE([CC]) +m4trace:configure.ac:13: -1- m4_pattern_allow([^CC$]) +m4trace:configure.ac:13: -1- AC_SUBST([ac_ct_CC]) +m4trace:configure.ac:13: -1- AC_SUBST_TRACE([ac_ct_CC]) +m4trace:configure.ac:13: -1- m4_pattern_allow([^ac_ct_CC$]) +m4trace:configure.ac:13: -1- AC_SUBST([EXEEXT], [$ac_cv_exeext]) +m4trace:configure.ac:13: -1- AC_SUBST_TRACE([EXEEXT]) +m4trace:configure.ac:13: -1- m4_pattern_allow([^EXEEXT$]) +m4trace:configure.ac:13: -1- AC_SUBST([OBJEXT], [$ac_cv_objext]) +m4trace:configure.ac:13: -1- AC_SUBST_TRACE([OBJEXT]) +m4trace:configure.ac:13: -1- m4_pattern_allow([^OBJEXT$]) +m4trace:configure.ac:13: -1- AC_REQUIRE_AUX_FILE([compile]) +m4trace:configure.ac:13: -1- AC_SUBST([DEPDIR], ["${am__leading_dot}deps"]) +m4trace:configure.ac:13: -1- AC_SUBST_TRACE([DEPDIR]) +m4trace:configure.ac:13: -1- m4_pattern_allow([^DEPDIR$]) +m4trace:configure.ac:13: -1- AC_SUBST([am__include]) +m4trace:configure.ac:13: -1- AC_SUBST_TRACE([am__include]) +m4trace:configure.ac:13: -1- m4_pattern_allow([^am__include$]) +m4trace:configure.ac:13: -1- AC_SUBST([am__quote]) +m4trace:configure.ac:13: -1- AC_SUBST_TRACE([am__quote]) +m4trace:configure.ac:13: -1- m4_pattern_allow([^am__quote$]) +m4trace:configure.ac:13: -1- AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) +m4trace:configure.ac:13: -1- AC_SUBST([AMDEP_TRUE]) +m4trace:configure.ac:13: -1- AC_SUBST_TRACE([AMDEP_TRUE]) +m4trace:configure.ac:13: -1- m4_pattern_allow([^AMDEP_TRUE$]) +m4trace:configure.ac:13: -1- AC_SUBST([AMDEP_FALSE]) +m4trace:configure.ac:13: -1- AC_SUBST_TRACE([AMDEP_FALSE]) +m4trace:configure.ac:13: -1- m4_pattern_allow([^AMDEP_FALSE$]) +m4trace:configure.ac:13: -1- _AM_SUBST_NOTMAKE([AMDEP_TRUE]) +m4trace:configure.ac:13: -1- _AM_SUBST_NOTMAKE([AMDEP_FALSE]) +m4trace:configure.ac:13: -1- AC_SUBST([AMDEPBACKSLASH]) +m4trace:configure.ac:13: -1- AC_SUBST_TRACE([AMDEPBACKSLASH]) +m4trace:configure.ac:13: -1- m4_pattern_allow([^AMDEPBACKSLASH$]) +m4trace:configure.ac:13: -1- _AM_SUBST_NOTMAKE([AMDEPBACKSLASH]) +m4trace:configure.ac:13: -1- AC_SUBST([am__nodep]) +m4trace:configure.ac:13: -1- AC_SUBST_TRACE([am__nodep]) +m4trace:configure.ac:13: -1- m4_pattern_allow([^am__nodep$]) +m4trace:configure.ac:13: -1- _AM_SUBST_NOTMAKE([am__nodep]) +m4trace:configure.ac:13: -1- AC_SUBST([CCDEPMODE], [depmode=$am_cv_CC_dependencies_compiler_type]) +m4trace:configure.ac:13: -1- AC_SUBST_TRACE([CCDEPMODE]) +m4trace:configure.ac:13: -1- m4_pattern_allow([^CCDEPMODE$]) +m4trace:configure.ac:13: -1- AM_CONDITIONAL([am__fastdepCC], [ + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CC_dependencies_compiler_type" = gcc3]) +m4trace:configure.ac:13: -1- AC_SUBST([am__fastdepCC_TRUE]) +m4trace:configure.ac:13: -1- AC_SUBST_TRACE([am__fastdepCC_TRUE]) +m4trace:configure.ac:13: -1- m4_pattern_allow([^am__fastdepCC_TRUE$]) +m4trace:configure.ac:13: -1- AC_SUBST([am__fastdepCC_FALSE]) +m4trace:configure.ac:13: -1- AC_SUBST_TRACE([am__fastdepCC_FALSE]) +m4trace:configure.ac:13: -1- m4_pattern_allow([^am__fastdepCC_FALSE$]) +m4trace:configure.ac:13: -1- _AM_SUBST_NOTMAKE([am__fastdepCC_TRUE]) +m4trace:configure.ac:13: -1- _AM_SUBST_NOTMAKE([am__fastdepCC_FALSE]) +m4trace:configure.ac:14: -1- AM_PROG_CC_C_O +m4trace:configure.ac:18: -1- _m4_warn([obsolete], [The macro `ac_cv_prog_gcc' is obsolete. +You should run autoupdate.], [../../lib/autoconf/c.m4:436: ac_cv_prog_gcc is expanded from... +configure.ac:18: the top level]) +m4trace:configure.ac:65: -1- AC_SUBST([YACC]) +m4trace:configure.ac:65: -1- AC_SUBST_TRACE([YACC]) +m4trace:configure.ac:65: -1- m4_pattern_allow([^YACC$]) +m4trace:configure.ac:65: -1- AC_SUBST([YACC]) +m4trace:configure.ac:65: -1- AC_SUBST_TRACE([YACC]) +m4trace:configure.ac:65: -1- m4_pattern_allow([^YACC$]) +m4trace:configure.ac:65: -1- AC_SUBST([YFLAGS]) +m4trace:configure.ac:65: -1- AC_SUBST_TRACE([YFLAGS]) +m4trace:configure.ac:65: -1- m4_pattern_allow([^YFLAGS$]) +m4trace:configure.ac:66: -1- AC_SUBST([LEX]) +m4trace:configure.ac:66: -1- AC_SUBST_TRACE([LEX]) +m4trace:configure.ac:66: -1- m4_pattern_allow([^LEX$]) +m4trace:configure.ac:66: -1- AC_SUBST([LEX_OUTPUT_ROOT], [$ac_cv_prog_lex_root]) +m4trace:configure.ac:66: -1- AC_SUBST_TRACE([LEX_OUTPUT_ROOT]) +m4trace:configure.ac:66: -1- m4_pattern_allow([^LEX_OUTPUT_ROOT$]) +m4trace:configure.ac:66: -1- AC_SUBST([LEXLIB]) +m4trace:configure.ac:66: -1- AC_SUBST_TRACE([LEXLIB]) +m4trace:configure.ac:66: -1- m4_pattern_allow([^LEXLIB$]) +m4trace:configure.ac:66: -1- AC_DEFINE_TRACE_LITERAL([YYTEXT_POINTER]) +m4trace:configure.ac:66: -1- m4_pattern_allow([^YYTEXT_POINTER$]) +m4trace:configure.ac:66: -1- AH_OUTPUT([YYTEXT_POINTER], [/* Define to 1 if `lex\' declares `yytext\' as a `char *\' by default, not a + `char@<:@@:>@\'. */ +@%:@undef YYTEXT_POINTER]) +m4trace:configure.ac:105: -2- AH_OUTPUT([HAVE_LIBZ], [/* Define to 1 if you have the `z\' library (-lz). */ +@%:@undef HAVE_LIBZ]) +m4trace:configure.ac:105: -2- AC_DEFINE_TRACE_LITERAL([HAVE_LIBZ]) +m4trace:configure.ac:105: -2- m4_pattern_allow([^HAVE_LIBZ$]) +m4trace:configure.ac:120: -2- AM_CONDITIONAL([FT2NFDUMP], [true]) +m4trace:configure.ac:120: -2- AC_SUBST([FT2NFDUMP_TRUE]) +m4trace:configure.ac:120: -2- AC_SUBST_TRACE([FT2NFDUMP_TRUE]) +m4trace:configure.ac:120: -2- m4_pattern_allow([^FT2NFDUMP_TRUE$]) +m4trace:configure.ac:120: -2- AC_SUBST([FT2NFDUMP_FALSE]) +m4trace:configure.ac:120: -2- AC_SUBST_TRACE([FT2NFDUMP_FALSE]) +m4trace:configure.ac:120: -2- m4_pattern_allow([^FT2NFDUMP_FALSE$]) +m4trace:configure.ac:120: -2- _AM_SUBST_NOTMAKE([FT2NFDUMP_TRUE]) +m4trace:configure.ac:120: -2- _AM_SUBST_NOTMAKE([FT2NFDUMP_FALSE]) +m4trace:configure.ac:122: -2- AM_CONDITIONAL([FT2NFDUMP], [false]) +m4trace:configure.ac:122: -2- AC_SUBST([FT2NFDUMP_TRUE]) +m4trace:configure.ac:122: -2- AC_SUBST_TRACE([FT2NFDUMP_TRUE]) +m4trace:configure.ac:122: -2- m4_pattern_allow([^FT2NFDUMP_TRUE$]) +m4trace:configure.ac:122: -2- AC_SUBST([FT2NFDUMP_FALSE]) +m4trace:configure.ac:122: -2- AC_SUBST_TRACE([FT2NFDUMP_FALSE]) +m4trace:configure.ac:122: -2- m4_pattern_allow([^FT2NFDUMP_FALSE$]) +m4trace:configure.ac:122: -2- _AM_SUBST_NOTMAKE([FT2NFDUMP_TRUE]) +m4trace:configure.ac:122: -2- _AM_SUBST_NOTMAKE([FT2NFDUMP_FALSE]) +m4trace:configure.ac:156: -2- AM_CONDITIONAL([NFPROFILE], [false]) +m4trace:configure.ac:156: -2- AC_SUBST([NFPROFILE_TRUE]) +m4trace:configure.ac:156: -2- AC_SUBST_TRACE([NFPROFILE_TRUE]) +m4trace:configure.ac:156: -2- m4_pattern_allow([^NFPROFILE_TRUE$]) +m4trace:configure.ac:156: -2- AC_SUBST([NFPROFILE_FALSE]) +m4trace:configure.ac:156: -2- AC_SUBST_TRACE([NFPROFILE_FALSE]) +m4trace:configure.ac:156: -2- m4_pattern_allow([^NFPROFILE_FALSE$]) +m4trace:configure.ac:156: -2- _AM_SUBST_NOTMAKE([NFPROFILE_TRUE]) +m4trace:configure.ac:156: -2- _AM_SUBST_NOTMAKE([NFPROFILE_FALSE]) +m4trace:configure.ac:126: -1- AC_SUBST([RRD_LIBS]) +m4trace:configure.ac:126: -1- AC_SUBST_TRACE([RRD_LIBS]) +m4trace:configure.ac:126: -1- m4_pattern_allow([^RRD_LIBS$]) +m4trace:configure.ac:126: -1- AH_OUTPUT([HAVE_RRD_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_RRD_H]) +m4trace:configure.ac:126: -1- AC_SUBST([CPP]) +m4trace:configure.ac:126: -1- AC_SUBST_TRACE([CPP]) +m4trace:configure.ac:126: -1- m4_pattern_allow([^CPP$]) +m4trace:configure.ac:126: -1- AC_SUBST([CPPFLAGS]) +m4trace:configure.ac:126: -1- AC_SUBST_TRACE([CPPFLAGS]) +m4trace:configure.ac:126: -1- m4_pattern_allow([^CPPFLAGS$]) +m4trace:configure.ac:126: -1- AC_SUBST([CPP]) +m4trace:configure.ac:126: -1- AC_SUBST_TRACE([CPP]) +m4trace:configure.ac:126: -1- m4_pattern_allow([^CPP$]) +m4trace:configure.ac:126: -1- AC_SUBST([GREP]) +m4trace:configure.ac:126: -1- AC_SUBST_TRACE([GREP]) +m4trace:configure.ac:126: -1- m4_pattern_allow([^GREP$]) +m4trace:configure.ac:126: -1- AC_SUBST([EGREP]) +m4trace:configure.ac:126: -1- AC_SUBST_TRACE([EGREP]) +m4trace:configure.ac:126: -1- m4_pattern_allow([^EGREP$]) +m4trace:configure.ac:126: -1- AC_DEFINE_TRACE_LITERAL([STDC_HEADERS]) +m4trace:configure.ac:126: -1- m4_pattern_allow([^STDC_HEADERS$]) +m4trace:configure.ac:126: -1- AH_OUTPUT([STDC_HEADERS], [/* Define to 1 if you have the ANSI C header files. */ +@%:@undef STDC_HEADERS]) +m4trace:configure.ac:126: -1- AH_OUTPUT([HAVE_SYS_TYPES_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_SYS_TYPES_H]) +m4trace:configure.ac:126: -1- AH_OUTPUT([HAVE_SYS_STAT_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_SYS_STAT_H]) +m4trace:configure.ac:126: -1- AH_OUTPUT([HAVE_STDLIB_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_STDLIB_H]) +m4trace:configure.ac:126: -1- AH_OUTPUT([HAVE_STRING_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_STRING_H]) +m4trace:configure.ac:126: -1- AH_OUTPUT([HAVE_MEMORY_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_MEMORY_H]) +m4trace:configure.ac:126: -1- AH_OUTPUT([HAVE_STRINGS_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_STRINGS_H]) +m4trace:configure.ac:126: -1- AH_OUTPUT([HAVE_INTTYPES_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_INTTYPES_H]) +m4trace:configure.ac:126: -1- AH_OUTPUT([HAVE_STDINT_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_STDINT_H]) +m4trace:configure.ac:126: -1- AH_OUTPUT([HAVE_UNISTD_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_UNISTD_H]) +m4trace:configure.ac:126: -1- AC_DEFINE_TRACE_LITERAL([HAVE_RRD_H]) +m4trace:configure.ac:126: -1- m4_pattern_allow([^HAVE_RRD_H$]) +m4trace:configure.ac:126: -1- AM_CONDITIONAL([NFPROFILE], [true]) +m4trace:configure.ac:126: -1- AC_SUBST([NFPROFILE_TRUE]) +m4trace:configure.ac:126: -1- AC_SUBST_TRACE([NFPROFILE_TRUE]) +m4trace:configure.ac:126: -1- m4_pattern_allow([^NFPROFILE_TRUE$]) +m4trace:configure.ac:126: -1- AC_SUBST([NFPROFILE_FALSE]) +m4trace:configure.ac:126: -1- AC_SUBST_TRACE([NFPROFILE_FALSE]) +m4trace:configure.ac:126: -1- m4_pattern_allow([^NFPROFILE_FALSE$]) +m4trace:configure.ac:126: -1- _AM_SUBST_NOTMAKE([NFPROFILE_TRUE]) +m4trace:configure.ac:126: -1- _AM_SUBST_NOTMAKE([NFPROFILE_FALSE]) +m4trace:configure.ac:126: -1- _m4_warn([cross], [AC_RUN_IFELSE called without default to allow cross compiling], [../../lib/autoconf/general.m4:2748: AC_RUN_IFELSE is expanded from... +../../lib/m4sugar/m4sh.m4:639: AS_IF is expanded from... +../../lib/autoconf/general.m4:1462: AC_ARG_ENABLE is expanded from... +configure.ac:126: the top level]) +m4trace:configure.ac:189: -2- AM_CONDITIONAL([NFTRACK], [false]) +m4trace:configure.ac:189: -2- AC_SUBST([NFTRACK_TRUE]) +m4trace:configure.ac:189: -2- AC_SUBST_TRACE([NFTRACK_TRUE]) +m4trace:configure.ac:189: -2- m4_pattern_allow([^NFTRACK_TRUE$]) +m4trace:configure.ac:189: -2- AC_SUBST([NFTRACK_FALSE]) +m4trace:configure.ac:189: -2- AC_SUBST_TRACE([NFTRACK_FALSE]) +m4trace:configure.ac:189: -2- m4_pattern_allow([^NFTRACK_FALSE$]) +m4trace:configure.ac:189: -2- _AM_SUBST_NOTMAKE([NFTRACK_TRUE]) +m4trace:configure.ac:189: -2- _AM_SUBST_NOTMAKE([NFTRACK_FALSE]) +m4trace:configure.ac:159: -1- AC_SUBST([RRD_LIBS]) +m4trace:configure.ac:159: -1- AC_SUBST_TRACE([RRD_LIBS]) +m4trace:configure.ac:159: -1- m4_pattern_allow([^RRD_LIBS$]) +m4trace:configure.ac:159: -1- AH_OUTPUT([HAVE_RRD_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_RRD_H]) +m4trace:configure.ac:159: -1- AC_DEFINE_TRACE_LITERAL([HAVE_RRD_H]) +m4trace:configure.ac:159: -1- m4_pattern_allow([^HAVE_RRD_H$]) +m4trace:configure.ac:159: -1- AM_CONDITIONAL([NFTRACK], [true]) +m4trace:configure.ac:159: -1- AC_SUBST([NFTRACK_TRUE]) +m4trace:configure.ac:159: -1- AC_SUBST_TRACE([NFTRACK_TRUE]) +m4trace:configure.ac:159: -1- m4_pattern_allow([^NFTRACK_TRUE$]) +m4trace:configure.ac:159: -1- AC_SUBST([NFTRACK_FALSE]) +m4trace:configure.ac:159: -1- AC_SUBST_TRACE([NFTRACK_FALSE]) +m4trace:configure.ac:159: -1- m4_pattern_allow([^NFTRACK_FALSE$]) +m4trace:configure.ac:159: -1- _AM_SUBST_NOTMAKE([NFTRACK_TRUE]) +m4trace:configure.ac:159: -1- _AM_SUBST_NOTMAKE([NFTRACK_FALSE]) +m4trace:configure.ac:159: -1- _m4_warn([cross], [AC_RUN_IFELSE called without default to allow cross compiling], [../../lib/autoconf/general.m4:2748: AC_RUN_IFELSE is expanded from... +../../lib/m4sugar/m4sh.m4:639: AS_IF is expanded from... +../../lib/autoconf/general.m4:1462: AC_ARG_ENABLE is expanded from... +configure.ac:159: the top level]) +m4trace:configure.ac:194: -1- AM_CONDITIONAL([SFLOW], [test "$enable_sflow" = yes]) +m4trace:configure.ac:194: -1- AC_SUBST([SFLOW_TRUE]) +m4trace:configure.ac:194: -1- AC_SUBST_TRACE([SFLOW_TRUE]) +m4trace:configure.ac:194: -1- m4_pattern_allow([^SFLOW_TRUE$]) +m4trace:configure.ac:194: -1- AC_SUBST([SFLOW_FALSE]) +m4trace:configure.ac:194: -1- AC_SUBST_TRACE([SFLOW_FALSE]) +m4trace:configure.ac:194: -1- m4_pattern_allow([^SFLOW_FALSE$]) +m4trace:configure.ac:194: -1- _AM_SUBST_NOTMAKE([SFLOW_TRUE]) +m4trace:configure.ac:194: -1- _AM_SUBST_NOTMAKE([SFLOW_FALSE]) +m4trace:configure.ac:198: -1- AM_CONDITIONAL([READPCAP], [test "$enable_readpcap" = yes]) +m4trace:configure.ac:198: -1- AC_SUBST([READPCAP_TRUE]) +m4trace:configure.ac:198: -1- AC_SUBST_TRACE([READPCAP_TRUE]) +m4trace:configure.ac:198: -1- m4_pattern_allow([^READPCAP_TRUE$]) +m4trace:configure.ac:198: -1- AC_SUBST([READPCAP_FALSE]) +m4trace:configure.ac:198: -1- AC_SUBST_TRACE([READPCAP_FALSE]) +m4trace:configure.ac:198: -1- m4_pattern_allow([^READPCAP_FALSE$]) +m4trace:configure.ac:198: -1- _AM_SUBST_NOTMAKE([READPCAP_TRUE]) +m4trace:configure.ac:198: -1- _AM_SUBST_NOTMAKE([READPCAP_FALSE]) +m4trace:configure.ac:202: -1- AM_CONDITIONAL([BUILDNFPCAPD], [test "$enable_nfpcapd" = yes]) +m4trace:configure.ac:202: -1- AC_SUBST([BUILDNFPCAPD_TRUE]) +m4trace:configure.ac:202: -1- AC_SUBST_TRACE([BUILDNFPCAPD_TRUE]) +m4trace:configure.ac:202: -1- m4_pattern_allow([^BUILDNFPCAPD_TRUE$]) +m4trace:configure.ac:202: -1- AC_SUBST([BUILDNFPCAPD_FALSE]) +m4trace:configure.ac:202: -1- AC_SUBST_TRACE([BUILDNFPCAPD_FALSE]) +m4trace:configure.ac:202: -1- m4_pattern_allow([^BUILDNFPCAPD_FALSE$]) +m4trace:configure.ac:202: -1- _AM_SUBST_NOTMAKE([BUILDNFPCAPD_TRUE]) +m4trace:configure.ac:202: -1- _AM_SUBST_NOTMAKE([BUILDNFPCAPD_FALSE]) +m4trace:configure.ac:206: -2- AC_DEFINE_TRACE_LITERAL([HAVE_SOCKADDR_SA_LEN]) +m4trace:configure.ac:206: -2- m4_pattern_allow([^HAVE_SOCKADDR_SA_LEN$]) +m4trace:configure.ac:206: -2- AH_OUTPUT([HAVE_SOCKADDR_SA_LEN], [/* define if socket address structures have length fields */ +@%:@undef HAVE_SOCKADDR_SA_LEN]) +m4trace:configure.ac:210: -1- AC_DEFINE_TRACE_LITERAL([HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY]) +m4trace:configure.ac:210: -1- m4_pattern_allow([^HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY$]) +m4trace:configure.ac:210: -1- AH_OUTPUT([HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY], [/* Define to 1 if `ss_family\' is a member of `struct sockaddr_storage\'. */ +@%:@undef HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY]) +m4trace:configure.ac:210: -1- AC_DEFINE_TRACE_LITERAL([HAVE_STRUCT_SOCKADDR_STORAGE___SS_FAMILY]) +m4trace:configure.ac:210: -1- m4_pattern_allow([^HAVE_STRUCT_SOCKADDR_STORAGE___SS_FAMILY$]) +m4trace:configure.ac:210: -1- AH_OUTPUT([HAVE_STRUCT_SOCKADDR_STORAGE___SS_FAMILY], [/* Define to 1 if `__ss_family\' is a member of `struct sockaddr_storage\'. */ +@%:@undef HAVE_STRUCT_SOCKADDR_STORAGE___SS_FAMILY]) +m4trace:configure.ac:210: -1- AC_DEFINE_TRACE_LITERAL([HAVE_STRUCT_SOCKADDR_STORAGE_SS_LEN]) +m4trace:configure.ac:210: -1- m4_pattern_allow([^HAVE_STRUCT_SOCKADDR_STORAGE_SS_LEN$]) +m4trace:configure.ac:210: -1- AH_OUTPUT([HAVE_STRUCT_SOCKADDR_STORAGE_SS_LEN], [/* Define to 1 if `ss_len\' is a member of `struct sockaddr_storage\'. */ +@%:@undef HAVE_STRUCT_SOCKADDR_STORAGE_SS_LEN]) +m4trace:configure.ac:210: -1- AC_DEFINE_TRACE_LITERAL([HAVE_STRUCT_SOCKADDR_STORAGE___SS_LEN]) +m4trace:configure.ac:210: -1- m4_pattern_allow([^HAVE_STRUCT_SOCKADDR_STORAGE___SS_LEN$]) +m4trace:configure.ac:210: -1- AH_OUTPUT([HAVE_STRUCT_SOCKADDR_STORAGE___SS_LEN], [/* Define to 1 if `__ss_len\' is a member of `struct sockaddr_storage\'. */ +@%:@undef HAVE_STRUCT_SOCKADDR_STORAGE___SS_LEN]) +m4trace:configure.ac:210: -1- AC_DEFINE_TRACE_LITERAL([HAVE_STRUCT_SOCKADDR_SA_LEN]) +m4trace:configure.ac:210: -1- m4_pattern_allow([^HAVE_STRUCT_SOCKADDR_SA_LEN$]) +m4trace:configure.ac:210: -1- AH_OUTPUT([HAVE_STRUCT_SOCKADDR_SA_LEN], [/* Define to 1 if `sa_len\' is a member of `struct sockaddr\'. */ +@%:@undef HAVE_STRUCT_SOCKADDR_SA_LEN]) +m4trace:configure.ac:220: -1- AC_SUBST([FT_INCLUDES]) +m4trace:configure.ac:220: -1- AC_SUBST_TRACE([FT_INCLUDES]) +m4trace:configure.ac:220: -1- m4_pattern_allow([^FT_INCLUDES$]) +m4trace:configure.ac:221: -1- AC_SUBST([FT_LDFLAGS]) +m4trace:configure.ac:221: -1- AC_SUBST_TRACE([FT_LDFLAGS]) +m4trace:configure.ac:221: -1- m4_pattern_allow([^FT_LDFLAGS$]) +m4trace:configure.ac:222: -1- AC_SUBST([LFLAGS]) +m4trace:configure.ac:222: -1- AC_SUBST_TRACE([LFLAGS]) +m4trace:configure.ac:222: -1- m4_pattern_allow([^LFLAGS$]) +m4trace:configure.ac:226: -1- AH_OUTPUT([HAVE_GETHOSTBYNAME], [/* Define to 1 if you have the `gethostbyname\' function. */ +@%:@undef HAVE_GETHOSTBYNAME]) +m4trace:configure.ac:226: -1- AC_DEFINE_TRACE_LITERAL([HAVE_GETHOSTBYNAME]) +m4trace:configure.ac:226: -1- m4_pattern_allow([^HAVE_GETHOSTBYNAME$]) +m4trace:configure.ac:226: -1- AH_OUTPUT([HAVE_LIBNSL], [/* Define to 1 if you have the `nsl\' library (-lnsl). */ +@%:@undef HAVE_LIBNSL]) +m4trace:configure.ac:226: -1- AC_DEFINE_TRACE_LITERAL([HAVE_LIBNSL]) +m4trace:configure.ac:226: -1- m4_pattern_allow([^HAVE_LIBNSL$]) +m4trace:configure.ac:226: -1- AH_OUTPUT([HAVE_LIBSOCKET], [/* Define to 1 if you have the `socket\' library (-lsocket). */ +@%:@undef HAVE_LIBSOCKET]) +m4trace:configure.ac:226: -1- AC_DEFINE_TRACE_LITERAL([HAVE_LIBSOCKET]) +m4trace:configure.ac:226: -1- m4_pattern_allow([^HAVE_LIBSOCKET$]) +m4trace:configure.ac:227: -1- AH_OUTPUT([HAVE_SETSOCKOPT], [/* Define to 1 if you have the `setsockopt\' function. */ +@%:@undef HAVE_SETSOCKOPT]) +m4trace:configure.ac:227: -1- AC_DEFINE_TRACE_LITERAL([HAVE_SETSOCKOPT]) +m4trace:configure.ac:227: -1- m4_pattern_allow([^HAVE_SETSOCKOPT$]) +m4trace:configure.ac:227: -1- AH_OUTPUT([HAVE_LIBSOCKET], [/* Define to 1 if you have the `socket\' library (-lsocket). */ +@%:@undef HAVE_LIBSOCKET]) +m4trace:configure.ac:227: -1- AC_DEFINE_TRACE_LITERAL([HAVE_LIBSOCKET]) +m4trace:configure.ac:227: -1- m4_pattern_allow([^HAVE_LIBSOCKET$]) +m4trace:configure.ac:230: -1- AH_OUTPUT([HAVE_FPURGE], [/* Define to 1 if you have the `fpurge\' function. */ +@%:@undef HAVE_FPURGE]) +m4trace:configure.ac:230: -1- AH_OUTPUT([HAVE___FPURGE], [/* Define to 1 if you have the `__fpurge\' function. */ +@%:@undef HAVE___FPURGE]) +m4trace:configure.ac:235: -1- AC_DEFINE_TRACE_LITERAL([HAVE_HTONLL]) +m4trace:configure.ac:235: -1- m4_pattern_allow([^HAVE_HTONLL$]) +m4trace:configure.ac:235: -1- AH_OUTPUT([HAVE_HTONLL], [/* Define to 1 if the function (or macro) htonll exists. */ +@%:@undef HAVE_HTONLL]) +m4trace:configure.ac:254: -1- AH_OUTPUT([HAVE_DIRENT_H], [/* Define to 1 if you have the header file, and it defines `DIR\'. + */ +@%:@undef HAVE_DIRENT_H]) +m4trace:configure.ac:254: -1- AH_OUTPUT([HAVE_SYS_NDIR_H], [/* Define to 1 if you have the header file, and it defines `DIR\'. + */ +@%:@undef HAVE_SYS_NDIR_H]) +m4trace:configure.ac:254: -1- AH_OUTPUT([HAVE_SYS_DIR_H], [/* Define to 1 if you have the header file, and it defines `DIR\'. + */ +@%:@undef HAVE_SYS_DIR_H]) +m4trace:configure.ac:254: -1- AH_OUTPUT([HAVE_NDIR_H], [/* Define to 1 if you have the header file, and it defines `DIR\'. */ +@%:@undef HAVE_NDIR_H]) +m4trace:configure.ac:255: -1- AC_DEFINE_TRACE_LITERAL([STDC_HEADERS]) +m4trace:configure.ac:255: -1- m4_pattern_allow([^STDC_HEADERS$]) +m4trace:configure.ac:255: -1- AH_OUTPUT([STDC_HEADERS], [/* Define to 1 if you have the ANSI C header files. */ +@%:@undef STDC_HEADERS]) +m4trace:configure.ac:256: -1- AH_OUTPUT([HAVE_NAMESER8_COMPAT_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_NAMESER8_COMPAT_H]) +m4trace:configure.ac:256: -1- AC_DEFINE_TRACE_LITERAL([HAVE_NAMESER8_COMPAT_H]) +m4trace:configure.ac:256: -1- m4_pattern_allow([^HAVE_NAMESER8_COMPAT_H$]) +m4trace:configure.ac:257: -1- AH_OUTPUT([HAVE_FEATURES_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_FEATURES_H]) +m4trace:configure.ac:257: -1- AH_OUTPUT([HAVE_ARPA_INET_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_ARPA_INET_H]) +m4trace:configure.ac:257: -1- AH_OUTPUT([HAVE_FCNTL_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_FCNTL_H]) +m4trace:configure.ac:257: -1- AH_OUTPUT([HAVE_NETINET_IN_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_NETINET_IN_H]) +m4trace:configure.ac:257: -1- AH_OUTPUT([HAVE_FTS_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_FTS_H]) +m4trace:configure.ac:257: -1- AH_OUTPUT([HAVE_STDINT_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_STDINT_H]) +m4trace:configure.ac:257: -1- AH_OUTPUT([HAVE_STDLIB_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_STDLIB_H]) +m4trace:configure.ac:257: -1- AH_OUTPUT([HAVE_STDDEF_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_STDDEF_H]) +m4trace:configure.ac:257: -1- AH_OUTPUT([HAVE_STRING_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_STRING_H]) +m4trace:configure.ac:257: -1- AH_OUTPUT([HAVE_SYS_SOCKET_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_SYS_SOCKET_H]) +m4trace:configure.ac:257: -1- AH_OUTPUT([HAVE_SYSLOG_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_SYSLOG_H]) +m4trace:configure.ac:257: -1- AH_OUTPUT([HAVE_UNISTD_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_UNISTD_H]) +m4trace:configure.ac:257: -1- AH_OUTPUT([HAVE_ISO_LIMITS_ISO_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_ISO_LIMITS_ISO_H]) +m4trace:configure.ac:258: -1- AH_OUTPUT([HAVE_PCAP_BPF_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_PCAP_BPF_H]) +m4trace:configure.ac:258: -1- AH_OUTPUT([HAVE_NET_BPF_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_NET_BPF_H]) +m4trace:configure.ac:260: -1- AH_OUTPUT([HAVE_SYS_TYPES_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_SYS_TYPES_H]) +m4trace:configure.ac:260: -1- AH_OUTPUT([HAVE_NETINET_IN_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_NETINET_IN_H]) +m4trace:configure.ac:260: -1- AH_OUTPUT([HAVE_ARPA_NAMESER_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_ARPA_NAMESER_H]) +m4trace:configure.ac:260: -1- AH_OUTPUT([HAVE_ARPA_NAMESER_COMPAT_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_ARPA_NAMESER_COMPAT_H]) +m4trace:configure.ac:260: -1- AH_OUTPUT([HAVE_NETDB_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_NETDB_H]) +m4trace:configure.ac:260: -1- AH_OUTPUT([HAVE_RESOLV_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_RESOLV_H]) +m4trace:configure.ac:279: -1- AC_SUBST([FTS_OBJ]) +m4trace:configure.ac:279: -1- AC_SUBST_TRACE([FTS_OBJ]) +m4trace:configure.ac:279: -1- m4_pattern_allow([^FTS_OBJ$]) +m4trace:configure.ac:283: -1- AC_DEFINE_TRACE_LITERAL([SIZEOF_VOID_P]) +m4trace:configure.ac:283: -1- m4_pattern_allow([^SIZEOF_VOID_P$]) +m4trace:configure.ac:283: -1- AH_OUTPUT([SIZEOF_VOID_P], [/* The size of `void *\', as computed by sizeof. */ +@%:@undef SIZEOF_VOID_P]) +m4trace:configure.ac:285: -1- AC_DEFINE_TRACE_LITERAL([const]) +m4trace:configure.ac:285: -1- m4_pattern_allow([^const$]) +m4trace:configure.ac:285: -1- AH_OUTPUT([const], [/* Define to empty if `const\' does not conform to ANSI C. */ +@%:@undef const]) +m4trace:configure.ac:286: -1- AH_OUTPUT([inline], [/* Define to `__inline__\' or `__inline\' if that\'s what the C compiler + calls it, or to nothing if \'inline\' is not supported under any name. */ +#ifndef __cplusplus +#undef inline +#endif]) +m4trace:configure.ac:287: -1- AH_OUTPUT([WORDS_BIGENDIAN], [/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most + significant byte first (like Motorola and SPARC, unlike Intel). */ +#if defined AC_APPLE_UNIVERSAL_BUILD +# if defined __BIG_ENDIAN__ +# define WORDS_BIGENDIAN 1 +# endif +#else +# ifndef WORDS_BIGENDIAN +# undef WORDS_BIGENDIAN +# endif +#endif]) +m4trace:configure.ac:287: -1- AC_DEFINE_TRACE_LITERAL([WORDS_BIGENDIAN]) +m4trace:configure.ac:287: -1- m4_pattern_allow([^WORDS_BIGENDIAN$]) +m4trace:configure.ac:287: -1- AC_DEFINE_TRACE_LITERAL([AC_APPLE_UNIVERSAL_BUILD]) +m4trace:configure.ac:287: -1- m4_pattern_allow([^AC_APPLE_UNIVERSAL_BUILD$]) +m4trace:configure.ac:287: -1- AH_OUTPUT([AC_APPLE_UNIVERSAL_BUILD], [/* Define if building universal (internal helper macro) */ +@%:@undef AC_APPLE_UNIVERSAL_BUILD]) +m4trace:configure.ac:288: -1- AC_DEFINE_TRACE_LITERAL([pid_t]) +m4trace:configure.ac:288: -1- m4_pattern_allow([^pid_t$]) +m4trace:configure.ac:288: -1- AH_OUTPUT([pid_t], [/* Define to `int\' if does not define. */ +@%:@undef pid_t]) +m4trace:configure.ac:289: -1- AC_DEFINE_TRACE_LITERAL([size_t]) +m4trace:configure.ac:289: -1- m4_pattern_allow([^size_t$]) +m4trace:configure.ac:289: -1- AH_OUTPUT([size_t], [/* Define to `unsigned int\' if does not define. */ +@%:@undef size_t]) +m4trace:configure.ac:290: -1- AC_DEFINE_TRACE_LITERAL([TM_IN_SYS_TIME]) +m4trace:configure.ac:290: -1- m4_pattern_allow([^TM_IN_SYS_TIME$]) +m4trace:configure.ac:290: -1- AH_OUTPUT([TM_IN_SYS_TIME], [/* Define to 1 if your declares `struct tm\'. */ +@%:@undef TM_IN_SYS_TIME]) +m4trace:configure.ac:291: -1- AC_DEFINE_TRACE_LITERAL([HAVE__BOOL]) +m4trace:configure.ac:291: -1- m4_pattern_allow([^HAVE__BOOL$]) +m4trace:configure.ac:291: -1- AH_OUTPUT([HAVE__BOOL], [/* Define to 1 if the system has the type `_Bool\'. */ +@%:@undef HAVE__BOOL]) +m4trace:configure.ac:291: -1- AC_DEFINE_TRACE_LITERAL([HAVE_STDBOOL_H]) +m4trace:configure.ac:291: -1- m4_pattern_allow([^HAVE_STDBOOL_H$]) +m4trace:configure.ac:291: -1- AH_OUTPUT([HAVE_STDBOOL_H], [/* Define to 1 if stdbool.h conforms to C99. */ +@%:@undef HAVE_STDBOOL_H]) +m4trace:configure.ac:294: -1- AC_DEFINE_TRACE_LITERAL([CLOSEDIR_VOID]) +m4trace:configure.ac:294: -1- m4_pattern_allow([^CLOSEDIR_VOID$]) +m4trace:configure.ac:294: -1- AH_OUTPUT([CLOSEDIR_VOID], [/* Define to 1 if the `closedir\' function returns void instead of `int\'. */ +@%:@undef CLOSEDIR_VOID]) +m4trace:configure.ac:295: -1- AH_OUTPUT([HAVE_VFORK_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_VFORK_H]) +m4trace:configure.ac:295: -1- AC_DEFINE_TRACE_LITERAL([HAVE_VFORK_H]) +m4trace:configure.ac:295: -1- m4_pattern_allow([^HAVE_VFORK_H$]) +m4trace:configure.ac:295: -1- AH_OUTPUT([HAVE_FORK], [/* Define to 1 if you have the `fork\' function. */ +@%:@undef HAVE_FORK]) +m4trace:configure.ac:295: -1- AH_OUTPUT([HAVE_VFORK], [/* Define to 1 if you have the `vfork\' function. */ +@%:@undef HAVE_VFORK]) +m4trace:configure.ac:295: -1- AC_DEFINE_TRACE_LITERAL([HAVE_WORKING_VFORK]) +m4trace:configure.ac:295: -1- m4_pattern_allow([^HAVE_WORKING_VFORK$]) +m4trace:configure.ac:295: -1- AH_OUTPUT([HAVE_WORKING_VFORK], [/* Define to 1 if `vfork\' works. */ +@%:@undef HAVE_WORKING_VFORK]) +m4trace:configure.ac:295: -1- AC_DEFINE_TRACE_LITERAL([vfork]) +m4trace:configure.ac:295: -1- m4_pattern_allow([^vfork$]) +m4trace:configure.ac:295: -1- AH_OUTPUT([vfork], [/* Define as `fork\' if `vfork\' does not work. */ +@%:@undef vfork]) +m4trace:configure.ac:295: -1- AC_DEFINE_TRACE_LITERAL([HAVE_WORKING_FORK]) +m4trace:configure.ac:295: -1- m4_pattern_allow([^HAVE_WORKING_FORK$]) +m4trace:configure.ac:295: -1- AH_OUTPUT([HAVE_WORKING_FORK], [/* Define to 1 if `fork\' works. */ +@%:@undef HAVE_WORKING_FORK]) +m4trace:configure.ac:296: -1- AH_OUTPUT([HAVE_STDLIB_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_STDLIB_H]) +m4trace:configure.ac:296: -1- AC_DEFINE_TRACE_LITERAL([HAVE_STDLIB_H]) +m4trace:configure.ac:296: -1- m4_pattern_allow([^HAVE_STDLIB_H$]) +m4trace:configure.ac:296: -1- AC_DEFINE_TRACE_LITERAL([HAVE_MALLOC]) +m4trace:configure.ac:296: -1- m4_pattern_allow([^HAVE_MALLOC$]) +m4trace:configure.ac:296: -1- AH_OUTPUT([HAVE_MALLOC], [/* Define to 1 if your system has a GNU libc compatible `malloc\' function, and + to 0 otherwise. */ +@%:@undef HAVE_MALLOC]) +m4trace:configure.ac:296: -1- AC_DEFINE_TRACE_LITERAL([HAVE_MALLOC]) +m4trace:configure.ac:296: -1- m4_pattern_allow([^HAVE_MALLOC$]) +m4trace:configure.ac:296: -1- AC_SUBST([LIB@&t@OBJS], ["$LIB@&t@OBJS malloc.$ac_objext"]) +m4trace:configure.ac:296: -1- AC_SUBST_TRACE([LIB@&t@OBJS]) +m4trace:configure.ac:296: -1- m4_pattern_allow([^LIB@&t@OBJS$]) +m4trace:configure.ac:296: -1- AC_LIBSOURCE([malloc.c]) +m4trace:configure.ac:296: -1- AC_DEFINE_TRACE_LITERAL([malloc]) +m4trace:configure.ac:296: -1- m4_pattern_allow([^malloc$]) +m4trace:configure.ac:296: -1- AH_OUTPUT([malloc], [/* Define to rpl_malloc if the replacement function should be used. */ +@%:@undef malloc]) +m4trace:configure.ac:297: -1- AC_DEFINE_TRACE_LITERAL([TIME_WITH_SYS_TIME]) +m4trace:configure.ac:297: -1- m4_pattern_allow([^TIME_WITH_SYS_TIME$]) +m4trace:configure.ac:297: -1- AH_OUTPUT([TIME_WITH_SYS_TIME], [/* Define to 1 if you can safely include both and . */ +@%:@undef TIME_WITH_SYS_TIME]) +m4trace:configure.ac:297: -1- AH_OUTPUT([HAVE_SYS_TIME_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_SYS_TIME_H]) +m4trace:configure.ac:297: -1- AH_OUTPUT([HAVE_UNISTD_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_UNISTD_H]) +m4trace:configure.ac:297: -1- AH_OUTPUT([HAVE_ALARM], [/* Define to 1 if you have the `alarm\' function. */ +@%:@undef HAVE_ALARM]) +m4trace:configure.ac:297: -1- AC_SUBST([LIB@&t@OBJS], ["$LIB@&t@OBJS mktime.$ac_objext"]) +m4trace:configure.ac:297: -1- AC_SUBST_TRACE([LIB@&t@OBJS]) +m4trace:configure.ac:297: -1- m4_pattern_allow([^LIB@&t@OBJS$]) +m4trace:configure.ac:297: -1- AC_LIBSOURCE([mktime.c]) +m4trace:configure.ac:298: -1- AH_OUTPUT([HAVE_STDLIB_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_STDLIB_H]) +m4trace:configure.ac:298: -1- AC_DEFINE_TRACE_LITERAL([HAVE_STDLIB_H]) +m4trace:configure.ac:298: -1- m4_pattern_allow([^HAVE_STDLIB_H$]) +m4trace:configure.ac:298: -1- AC_DEFINE_TRACE_LITERAL([HAVE_REALLOC]) +m4trace:configure.ac:298: -1- m4_pattern_allow([^HAVE_REALLOC$]) +m4trace:configure.ac:298: -1- AH_OUTPUT([HAVE_REALLOC], [/* Define to 1 if your system has a GNU libc compatible `realloc\' function, + and to 0 otherwise. */ +@%:@undef HAVE_REALLOC]) +m4trace:configure.ac:298: -1- AC_DEFINE_TRACE_LITERAL([HAVE_REALLOC]) +m4trace:configure.ac:298: -1- m4_pattern_allow([^HAVE_REALLOC$]) +m4trace:configure.ac:298: -1- AC_SUBST([LIB@&t@OBJS], ["$LIB@&t@OBJS realloc.$ac_objext"]) +m4trace:configure.ac:298: -1- AC_SUBST_TRACE([LIB@&t@OBJS]) +m4trace:configure.ac:298: -1- m4_pattern_allow([^LIB@&t@OBJS$]) +m4trace:configure.ac:298: -1- AC_LIBSOURCE([realloc.c]) +m4trace:configure.ac:298: -1- AC_DEFINE_TRACE_LITERAL([realloc]) +m4trace:configure.ac:298: -1- m4_pattern_allow([^realloc$]) +m4trace:configure.ac:298: -1- AH_OUTPUT([realloc], [/* Define to rpl_realloc if the replacement function should be used. */ +@%:@undef realloc]) +m4trace:configure.ac:299: -1- AC_DEFINE_TRACE_LITERAL([LSTAT_FOLLOWS_SLASHED_SYMLINK]) +m4trace:configure.ac:299: -1- m4_pattern_allow([^LSTAT_FOLLOWS_SLASHED_SYMLINK$]) +m4trace:configure.ac:299: -1- AH_OUTPUT([LSTAT_FOLLOWS_SLASHED_SYMLINK], [/* Define to 1 if `lstat\' dereferences a symlink specified with a trailing + slash. */ +@%:@undef LSTAT_FOLLOWS_SLASHED_SYMLINK]) +m4trace:configure.ac:299: -1- AC_SUBST([LIB@&t@OBJS], ["$LIB@&t@OBJS lstat.$ac_objext"]) +m4trace:configure.ac:299: -1- AC_SUBST_TRACE([LIB@&t@OBJS]) +m4trace:configure.ac:299: -1- m4_pattern_allow([^LIB@&t@OBJS$]) +m4trace:configure.ac:299: -1- AC_LIBSOURCE([lstat.c]) +m4trace:configure.ac:299: -1- AC_SUBST([LIB@&t@OBJS], ["$LIB@&t@OBJS stat.$ac_objext"]) +m4trace:configure.ac:299: -1- AC_SUBST_TRACE([LIB@&t@OBJS]) +m4trace:configure.ac:299: -1- m4_pattern_allow([^LIB@&t@OBJS$]) +m4trace:configure.ac:299: -1- AC_LIBSOURCE([stat.c]) +m4trace:configure.ac:299: -1- AC_DEFINE_TRACE_LITERAL([HAVE_STAT_EMPTY_STRING_BUG]) +m4trace:configure.ac:299: -1- m4_pattern_allow([^HAVE_STAT_EMPTY_STRING_BUG$]) +m4trace:configure.ac:299: -1- AH_OUTPUT([HAVE_STAT_EMPTY_STRING_BUG], [/* Define to 1 if `stat\' has the bug that it succeeds when given the + zero-length file name argument. */ +@%:@undef HAVE_STAT_EMPTY_STRING_BUG]) +m4trace:configure.ac:300: -1- AH_OUTPUT([HAVE_STRFTIME], [/* Define to 1 if you have the `strftime\' function. */ +@%:@undef HAVE_STRFTIME]) +m4trace:configure.ac:300: -1- AC_DEFINE_TRACE_LITERAL([HAVE_STRFTIME]) +m4trace:configure.ac:300: -1- m4_pattern_allow([^HAVE_STRFTIME$]) +m4trace:configure.ac:300: -1- AC_DEFINE_TRACE_LITERAL([HAVE_STRFTIME]) +m4trace:configure.ac:300: -1- m4_pattern_allow([^HAVE_STRFTIME$]) +m4trace:configure.ac:301: -1- AH_OUTPUT([HAVE_INET_NTOA], [/* Define to 1 if you have the `inet_ntoa\' function. */ +@%:@undef HAVE_INET_NTOA]) +m4trace:configure.ac:301: -1- AH_OUTPUT([HAVE_SOCKET], [/* Define to 1 if you have the `socket\' function. */ +@%:@undef HAVE_SOCKET]) +m4trace:configure.ac:301: -1- AH_OUTPUT([HAVE_STRCHR], [/* Define to 1 if you have the `strchr\' function. */ +@%:@undef HAVE_STRCHR]) +m4trace:configure.ac:301: -1- AH_OUTPUT([HAVE_STRDUP], [/* Define to 1 if you have the `strdup\' function. */ +@%:@undef HAVE_STRDUP]) +m4trace:configure.ac:301: -1- AH_OUTPUT([HAVE_STRERROR], [/* Define to 1 if you have the `strerror\' function. */ +@%:@undef HAVE_STRERROR]) +m4trace:configure.ac:301: -1- AH_OUTPUT([HAVE_STRRCHR], [/* Define to 1 if you have the `strrchr\' function. */ +@%:@undef HAVE_STRRCHR]) +m4trace:configure.ac:301: -1- AH_OUTPUT([HAVE_STRSTR], [/* Define to 1 if you have the `strstr\' function. */ +@%:@undef HAVE_STRSTR]) +m4trace:configure.ac:301: -1- AH_OUTPUT([HAVE_SCANDIR], [/* Define to 1 if you have the `scandir\' function. */ +@%:@undef HAVE_SCANDIR]) +m4trace:configure.ac:306: -1- AH_OUTPUT([HAVE_LIBRESOLV], [/* Define to 1 if you have the `resolv\' library (-lresolv). */ +@%:@undef HAVE_LIBRESOLV]) +m4trace:configure.ac:306: -1- AC_DEFINE_TRACE_LITERAL([HAVE_LIBRESOLV]) +m4trace:configure.ac:306: -1- m4_pattern_allow([^HAVE_LIBRESOLV$]) +m4trace:configure.ac:306: -1- AH_OUTPUT([HAVE_LIBRESOLV], [/* Define to 1 if you have the `resolv\' library (-lresolv). */ +@%:@undef HAVE_LIBRESOLV]) +m4trace:configure.ac:306: -1- AC_DEFINE_TRACE_LITERAL([HAVE_LIBRESOLV]) +m4trace:configure.ac:306: -1- m4_pattern_allow([^HAVE_LIBRESOLV$]) +m4trace:configure.ac:306: -1- AC_DEFINE_TRACE_LITERAL([HAVE_LIBSOCKET]) +m4trace:configure.ac:306: -1- m4_pattern_allow([^HAVE_LIBSOCKET$]) +m4trace:configure.ac:306: -1- AH_OUTPUT([HAVE_LIBSOCKET], [/* */ +@%:@undef HAVE_LIBSOCKET]) +m4trace:configure.ac:306: -1- AC_DEFINE_TRACE_LITERAL([HAVE_LIBRESOLV]) +m4trace:configure.ac:306: -1- m4_pattern_allow([^HAVE_LIBRESOLV$]) +m4trace:configure.ac:306: -1- AH_OUTPUT([HAVE_LIBRESOLV], [/* */ +@%:@undef HAVE_LIBRESOLV]) +m4trace:configure.ac:306: -1- AH_OUTPUT([HAVE_LIBRESOLV], [/* Define to 1 if you have the `resolv\' library (-lresolv). */ +@%:@undef HAVE_LIBRESOLV]) +m4trace:configure.ac:306: -1- AC_DEFINE_TRACE_LITERAL([HAVE_LIBRESOLV]) +m4trace:configure.ac:306: -1- m4_pattern_allow([^HAVE_LIBRESOLV$]) +m4trace:configure.ac:306: -1- AH_OUTPUT([HAVE_LIBRESOLV], [/* Define to 1 if you have the `resolv\' library (-lresolv). */ +@%:@undef HAVE_LIBRESOLV]) +m4trace:configure.ac:306: -1- AC_DEFINE_TRACE_LITERAL([HAVE_LIBRESOLV]) +m4trace:configure.ac:306: -1- m4_pattern_allow([^HAVE_LIBRESOLV$]) +m4trace:configure.ac:321: -1- AC_DEFINE_TRACE_LITERAL([ptrdiff_t]) +m4trace:configure.ac:321: -1- m4_pattern_allow([^ptrdiff_t$]) +m4trace:configure.ac:321: -1- AH_OUTPUT([ptrdiff_t], [/* Define to `long\' if does not define. */ +@%:@undef ptrdiff_t]) +m4trace:configure.ac:322: -1- AC_DEFINE_TRACE_LITERAL([size_t]) +m4trace:configure.ac:322: -1- m4_pattern_allow([^size_t$]) +m4trace:configure.ac:322: -1- AH_OUTPUT([size_t], [/* Define to `unsigned int\' if does not define. */ +@%:@undef size_t]) +m4trace:configure.ac:323: -1- AC_DEFINE_TRACE_LITERAL([SIZEOF_SHORT]) +m4trace:configure.ac:323: -1- m4_pattern_allow([^SIZEOF_SHORT$]) +m4trace:configure.ac:323: -1- AH_OUTPUT([SIZEOF_SHORT], [/* The size of `short\', as computed by sizeof. */ +@%:@undef SIZEOF_SHORT]) +m4trace:configure.ac:324: -1- AC_DEFINE_TRACE_LITERAL([SIZEOF_INT]) +m4trace:configure.ac:324: -1- m4_pattern_allow([^SIZEOF_INT$]) +m4trace:configure.ac:324: -1- AH_OUTPUT([SIZEOF_INT], [/* The size of `int\', as computed by sizeof. */ +@%:@undef SIZEOF_INT]) +m4trace:configure.ac:325: -1- AC_DEFINE_TRACE_LITERAL([SIZEOF_LONG]) +m4trace:configure.ac:325: -1- m4_pattern_allow([^SIZEOF_LONG$]) +m4trace:configure.ac:325: -1- AH_OUTPUT([SIZEOF_LONG], [/* The size of `long\', as computed by sizeof. */ +@%:@undef SIZEOF_LONG]) +m4trace:configure.ac:326: -1- AC_DEFINE_TRACE_LITERAL([SIZEOF_LONG_LONG]) +m4trace:configure.ac:326: -1- m4_pattern_allow([^SIZEOF_LONG_LONG$]) +m4trace:configure.ac:326: -1- AH_OUTPUT([SIZEOF_LONG_LONG], [/* The size of `long long\', as computed by sizeof. */ +@%:@undef SIZEOF_LONG_LONG]) +m4trace:configure.ac:327: -1- AC_DEFINE_TRACE_LITERAL([SIZEOF___INT64]) +m4trace:configure.ac:327: -1- m4_pattern_allow([^SIZEOF___INT64$]) +m4trace:configure.ac:327: -1- AH_OUTPUT([SIZEOF___INT64], [/* The size of `__int64\', as computed by sizeof. */ +@%:@undef SIZEOF___INT64]) +m4trace:configure.ac:328: -1- AC_DEFINE_TRACE_LITERAL([SIZEOF_VOID_P]) +m4trace:configure.ac:328: -1- m4_pattern_allow([^SIZEOF_VOID_P$]) +m4trace:configure.ac:328: -1- AH_OUTPUT([SIZEOF_VOID_P], [/* The size of `void *\', as computed by sizeof. */ +@%:@undef SIZEOF_VOID_P]) +m4trace:configure.ac:329: -1- AC_DEFINE_TRACE_LITERAL([SIZEOF_SIZE_T]) +m4trace:configure.ac:329: -1- m4_pattern_allow([^SIZEOF_SIZE_T$]) +m4trace:configure.ac:329: -1- AH_OUTPUT([SIZEOF_SIZE_T], [/* The size of `size_t\', as computed by sizeof. */ +@%:@undef SIZEOF_SIZE_T]) +m4trace:configure.ac:330: -1- AC_DEFINE_TRACE_LITERAL([SIZEOF_PTRDIFF_T]) +m4trace:configure.ac:330: -1- m4_pattern_allow([^SIZEOF_PTRDIFF_T$]) +m4trace:configure.ac:330: -1- AH_OUTPUT([SIZEOF_PTRDIFF_T], [/* The size of `ptrdiff_t\', as computed by sizeof. */ +@%:@undef SIZEOF_PTRDIFF_T]) +m4trace:configure.ac:331: -1- AC_DEFINE_TRACE_LITERAL([const]) +m4trace:configure.ac:331: -1- m4_pattern_allow([^const$]) +m4trace:configure.ac:331: -1- AH_OUTPUT([const], [/* Define to empty if `const\' does not conform to ANSI C. */ +@%:@undef const]) +m4trace:configure.ac:332: -1- AH_OUTPUT([HAVE_MEMCMP], [/* Define to 1 if you have the `memcmp\' function. */ +@%:@undef HAVE_MEMCMP]) +m4trace:configure.ac:332: -1- AH_OUTPUT([HAVE_MEMCPY], [/* Define to 1 if you have the `memcpy\' function. */ +@%:@undef HAVE_MEMCPY]) +m4trace:configure.ac:332: -1- AH_OUTPUT([HAVE_MEMMOVE], [/* Define to 1 if you have the `memmove\' function. */ +@%:@undef HAVE_MEMMOVE]) +m4trace:configure.ac:332: -1- AH_OUTPUT([HAVE_MEMSET], [/* Define to 1 if you have the `memset\' function. */ +@%:@undef HAVE_MEMSET]) +m4trace:configure.ac:335: -1- _m4_warn([obsolete], [The macro `AC_TRY_COMPILE' is obsolete. +You should run autoupdate.], [../../lib/autoconf/general.m4:2614: AC_TRY_COMPILE is expanded from... +../../lib/m4sugar/m4sh.m4:639: AS_IF is expanded from... +../../lib/autoconf/general.m4:2031: AC_CACHE_VAL is expanded from... +configure.ac:335: the top level]) +m4trace:configure.ac:353: -1- AC_DEFINE_TRACE_LITERAL([HAVE_SEMUN]) +m4trace:configure.ac:353: -1- m4_pattern_allow([^HAVE_SEMUN$]) +m4trace:configure.ac:353: -1- AH_OUTPUT([HAVE_SEMUN], [/* Define if sys/sem.h defines struct semun */ +@%:@undef HAVE_SEMUN]) +m4trace:configure.ac:357: -1- _m4_warn([obsolete], [The macro `AC_TRY_RUN' is obsolete. +You should run autoupdate.], [../../lib/autoconf/general.m4:2764: AC_TRY_RUN is expanded from... +configure.ac:357: the top level]) +m4trace:configure.ac:357: -1- AC_DEFINE_TRACE_LITERAL([HAVE_SIZE_T_Z_FORMAT]) +m4trace:configure.ac:357: -1- m4_pattern_allow([^HAVE_SIZE_T_Z_FORMAT$]) +m4trace:configure.ac:357: -1- AH_OUTPUT([HAVE_SIZE_T_Z_FORMAT], [/* Define to 1 if you have a printf() that supports the %z format string. */ +@%:@undef HAVE_SIZE_T_Z_FORMAT]) +m4trace:configure.ac:386: -1- AC_CONFIG_FILES([Makefile bin/Makefile man/Makefile]) +m4trace:configure.ac:386: -1- _m4_warn([obsolete], [AC_OUTPUT should be used without arguments. +You should run autoupdate.], []) +m4trace:configure.ac:386: -1- AC_SUBST([LIB@&t@OBJS], [$ac_libobjs]) +m4trace:configure.ac:386: -1- AC_SUBST_TRACE([LIB@&t@OBJS]) +m4trace:configure.ac:386: -1- m4_pattern_allow([^LIB@&t@OBJS$]) +m4trace:configure.ac:386: -1- AC_SUBST([LTLIBOBJS], [$ac_ltlibobjs]) +m4trace:configure.ac:386: -1- AC_SUBST_TRACE([LTLIBOBJS]) +m4trace:configure.ac:386: -1- m4_pattern_allow([^LTLIBOBJS$]) +m4trace:configure.ac:386: -1- AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"]) +m4trace:configure.ac:386: -1- AC_SUBST([am__EXEEXT_TRUE]) +m4trace:configure.ac:386: -1- AC_SUBST_TRACE([am__EXEEXT_TRUE]) +m4trace:configure.ac:386: -1- m4_pattern_allow([^am__EXEEXT_TRUE$]) +m4trace:configure.ac:386: -1- AC_SUBST([am__EXEEXT_FALSE]) +m4trace:configure.ac:386: -1- AC_SUBST_TRACE([am__EXEEXT_FALSE]) +m4trace:configure.ac:386: -1- m4_pattern_allow([^am__EXEEXT_FALSE$]) +m4trace:configure.ac:386: -1- _AM_SUBST_NOTMAKE([am__EXEEXT_TRUE]) +m4trace:configure.ac:386: -1- _AM_SUBST_NOTMAKE([am__EXEEXT_FALSE]) +m4trace:configure.ac:386: -1- AC_SUBST_TRACE([top_builddir]) +m4trace:configure.ac:386: -1- AC_SUBST_TRACE([top_build_prefix]) +m4trace:configure.ac:386: -1- AC_SUBST_TRACE([srcdir]) +m4trace:configure.ac:386: -1- AC_SUBST_TRACE([abs_srcdir]) +m4trace:configure.ac:386: -1- AC_SUBST_TRACE([top_srcdir]) +m4trace:configure.ac:386: -1- AC_SUBST_TRACE([abs_top_srcdir]) +m4trace:configure.ac:386: -1- AC_SUBST_TRACE([builddir]) +m4trace:configure.ac:386: -1- AC_SUBST_TRACE([abs_builddir]) +m4trace:configure.ac:386: -1- AC_SUBST_TRACE([abs_top_builddir]) +m4trace:configure.ac:386: -1- AC_SUBST_TRACE([INSTALL]) +m4trace:configure.ac:386: -1- AC_SUBST_TRACE([MKDIR_P]) diff --git a/bin/AddExtension.txt b/bin/AddExtension.txt new file mode 100755 index 0000000..4e40f33 --- /dev/null +++ b/bin/AddExtension.txt @@ -0,0 +1,11 @@ +Add extensions: +=============== + +1. Add appropriate definitions for new extension in nffile.h +2. Update extension_descriptor array in nfx.c to reflect the new extension. + Increase user index ( 3rd value ) +3. Add filter in grammar.y +4. test filter with nftest. +5. nffile_inline.c +6. nf_common.c define printing functions +7. nfsta.c add stat definitions diff --git a/bin/Makefile.am b/bin/Makefile.am new file mode 100755 index 0000000..3a9993b --- /dev/null +++ b/bin/Makefile.am @@ -0,0 +1,130 @@ + +bin_PROGRAMS = nfcapd nfdump nfreplay nfexpire nfanon +EXTRA_PROGRAMS = nftest nfgen nfreader + +check_PROGRAMMS = test.sh +TESTS = nftest test.sh + +if SFLOW +bin_PROGRAMS += sfcapd +endif + +if NFPROFILE +bin_PROGRAMS += nfprofile +endif + +if NFTRACK +bin_PROGRAMS += nftrack +endif + +if FT2NFDUMP +bin_PROGRAMS += ft2nfdump +endif + +BUILT_SOURCES = grammar.h +AM_YFLAGS = -d + +AM_CPPFLAGS = $(DEPS_CFLAGS) +LDADD = $(DEPS_LIBS) + +#Add extra debug info for gdb +AM_CFLAGS = -ggdb + +common = nf_common.c nf_common.h +util = util.c util.h +filelzo = minilzo.c minilzo.h lzoconf.h lzodefs.h nffile.c nffile.h nfx.c nfx.h nfxstat.h nfxstat.c +nflist = flist.c flist.h fts_compat.c fts_compat.h +filter = grammar.y scanner.l nftree.c nftree.h ipconv.c ipconv.h rbtree.h +nfprof = nfprof.c nfprof.h +nfnet = nfnet.c nfnet.h +anon = panonymizer.c panonymizer.h rijndael.c rijndael.h +collector = collector.c collector.h +nfv1 = netflow_v1.c netflow_v1.h +nfv9 = netflow_v9.c netflow_v9.h +pcaproc = pcaproc.c pcaproc.h flowtree.c flowtree.h ipfrag.c ipfrag.h +content = content_dns.c content_dns.h +netflow_pcap = netflow_pcap.c netflow_pcap.h +ipfix = ipfix.c ipfix.h +nfv5v7 = netflow_v5_v7.c netflow_v5_v7.h +nfstatfile = nfstatfile.c nfstatfile.h +nflowcache = nflowcache.c nflowcache.h +bookkeeper = bookkeeper.c bookkeeper.h +exporter = exporter.c exporter.h +expire= expire.c expire.h +launch = launch.c launch.h + +nfdump_SOURCES = nfdump.c nfdump.h nfstat.c nfstat.h nfexport.c nfexport.h \ + $(common) $(nflowcache) $(util) $(filelzo) $(nflist) $(filter) $(nfprof) $(exporter) + +nfreplay_SOURCES = nfreplay.c \ + $(common) $(util) $(filelzo) $(nflist) $(filter) $(nfprof) \ + $(nfnet) $(collector) $(nfv1) $(nfv9) $(nfv5v7) $(ipfix) $(exporter) + +nfprofile_SOURCES = nfprofile.c profile.c profile.h \ + $(common) $(util) $(filelzo) $(nflist) $(filter) $(nfstatfile) $(exporter) +nfprofile_LDADD = -lrrd + +nftrack_SOURCES = ../extra/nftrack/nftrack.c \ + ../extra/nftrack/nftrack_rrd.c ../extra/nftrack/nftrack_rrd.h \ + ../extra/nftrack/nftrack_stat.c ../extra/nftrack/nftrack_stat.h \ + $(common) $(util) $(filelzo) $(nflist) $(filter) +nftrack_CFLAGS = -I ../extra/nftrack +nftrack_LDADD = -lrrd + +nfcapd_SOURCES = nfcapd.c \ + $(common) $(util) $(filelzo) $(nflist) $(nfstatfile) $(launch) \ + $(nfnet) $(collector) $(nfv1) $(nfv5v7) $(nfv9) $(ipfix) $(bookkeeper) $(expire) + +nfpcapd_SOURCES = nfpcapd.c \ + $(pcaproc) $(netflow_pcap) \ + $(common) $(util) $(filelzo) $(nflist) $(nfstatfile) $(launch) \ + $(nfnet) $(collector) $(bookkeeper) $(expire) $(content) + +if READPCAP +nfcapd_CFLAGS = -DPCAP +nfcapd_SOURCES += pcap_reader.c pcap_reader.h +nfcapd_LDADD = -lpcap +endif + +if BUILDNFPCAPD +bin_PROGRAMS += nfpcapd +nfpcapd_CFLAGS = -D_BSD_SOURCE +nfpcapd_LDADD = -lpcap +nfpcapd_LDFLAGS = -pthread +endif + +sfcapd_SOURCES = sfcapd.c sflow.c sflow.h sflow_proto.h \ + $(common) $(util) $(filelzo) $(nflist) $(nfstatfile) $(launch) \ + $(nfnet) $(collector) $(bookkeeper) $(expire) + +if READPCAP +sfcapd_CFLAGS = -DPCAP +sfcapd_SOURCES += pcap_reader.c pcap_reader.h +sfcapd_LDADD = -lpcap +endif + +nfreader_SOURCES = nfreader.c \ + $(util) $(filelzo) $(nflist) $(exporter) + +nfanon_SOURCES = nfanon.c \ + $(util) $(filelzo) $(nflist) $(anon) + +nfgen_SOURCES = nfgen.c $(util) $(filelzo) $(nflist) + +nfexpire_SOURCES = nfexpire.c \ + $(bookkeeper) $(expire) $(util) $(nfstatfile) +nfexpire_LDADD = @FTS_OBJ@ + +nftest_SOURCES = nftest.c $(common) $(util) $(filter) $(filelzo) +nftest_DEPENDENCIES = nfgen + +if FT2NFDUMP +ft2nfdump_SOURCES = ft2nfdump.c $(common) $(filelzo) $(util) +ft2nfdump_CFLAGS = @FT_INCLUDES@ +ft2nfdump_LDADD = -lft -lz +ft2nfdump_LDADD += @FT_LDFLAGS@ +endif + +EXTRA_DIST = inline.c collector_inline.c nffile_inline.c nfdump_inline.c heapsort_inline.c applybits_inline.c test.sh nfdump.test.out parse_csv.pl + +CLEANFILES = lex.yy.c grammar.c grammar.h scanner.c scanner.h diff --git a/bin/Makefile.in b/bin/Makefile.in new file mode 100644 index 0000000..3288f6a --- /dev/null +++ b/bin/Makefile.in @@ -0,0 +1,2549 @@ +# Makefile.in generated by automake 1.14.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2013 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@ + +VPATH = @srcdir@ +am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +bin_PROGRAMS = nfcapd$(EXEEXT) nfdump$(EXEEXT) nfreplay$(EXEEXT) \ + nfexpire$(EXEEXT) nfanon$(EXEEXT) $(am__EXEEXT_1) \ + $(am__EXEEXT_2) $(am__EXEEXT_3) $(am__EXEEXT_4) \ + $(am__EXEEXT_5) +EXTRA_PROGRAMS = nftest$(EXEEXT) nfgen$(EXEEXT) nfreader$(EXEEXT) +TESTS = nftest$(EXEEXT) test.sh +@SFLOW_TRUE@am__append_1 = sfcapd +@NFPROFILE_TRUE@am__append_2 = nfprofile +@NFTRACK_TRUE@am__append_3 = nftrack +@FT2NFDUMP_TRUE@am__append_4 = ft2nfdump +@READPCAP_TRUE@am__append_5 = pcap_reader.c pcap_reader.h +@BUILDNFPCAPD_TRUE@am__append_6 = nfpcapd +@READPCAP_TRUE@am__append_7 = pcap_reader.c pcap_reader.h +subdir = bin +DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am grammar.h \ + grammar.c scanner.c $(top_srcdir)/depcomp $(top_srcdir)/ylwrap \ + $(top_srcdir)/test-driver +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +@SFLOW_TRUE@am__EXEEXT_1 = sfcapd$(EXEEXT) +@NFPROFILE_TRUE@am__EXEEXT_2 = nfprofile$(EXEEXT) +@NFTRACK_TRUE@am__EXEEXT_3 = nftrack$(EXEEXT) +@FT2NFDUMP_TRUE@am__EXEEXT_4 = ft2nfdump$(EXEEXT) +@BUILDNFPCAPD_TRUE@am__EXEEXT_5 = nfpcapd$(EXEEXT) +am__installdirs = "$(DESTDIR)$(bindir)" +PROGRAMS = $(bin_PROGRAMS) +am__ft2nfdump_SOURCES_DIST = ft2nfdump.c nf_common.c nf_common.h \ + minilzo.c minilzo.h lzoconf.h lzodefs.h nffile.c nffile.h \ + nfx.c nfx.h nfxstat.h nfxstat.c util.c util.h +am__objects_1 = ft2nfdump-nf_common.$(OBJEXT) +am__objects_2 = ft2nfdump-minilzo.$(OBJEXT) ft2nfdump-nffile.$(OBJEXT) \ + ft2nfdump-nfx.$(OBJEXT) ft2nfdump-nfxstat.$(OBJEXT) +am__objects_3 = ft2nfdump-util.$(OBJEXT) +@FT2NFDUMP_TRUE@am_ft2nfdump_OBJECTS = ft2nfdump-ft2nfdump.$(OBJEXT) \ +@FT2NFDUMP_TRUE@ $(am__objects_1) $(am__objects_2) \ +@FT2NFDUMP_TRUE@ $(am__objects_3) +ft2nfdump_OBJECTS = $(am_ft2nfdump_OBJECTS) +ft2nfdump_DEPENDENCIES = +ft2nfdump_LINK = $(CCLD) $(ft2nfdump_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ +am__objects_4 = util.$(OBJEXT) +am__objects_5 = minilzo.$(OBJEXT) nffile.$(OBJEXT) nfx.$(OBJEXT) \ + nfxstat.$(OBJEXT) +am__objects_6 = flist.$(OBJEXT) fts_compat.$(OBJEXT) +am__objects_7 = panonymizer.$(OBJEXT) rijndael.$(OBJEXT) +am_nfanon_OBJECTS = nfanon.$(OBJEXT) $(am__objects_4) $(am__objects_5) \ + $(am__objects_6) $(am__objects_7) +nfanon_OBJECTS = $(am_nfanon_OBJECTS) +nfanon_LDADD = $(LDADD) +nfanon_DEPENDENCIES = +am__nfcapd_SOURCES_DIST = nfcapd.c nf_common.c nf_common.h util.c \ + util.h minilzo.c minilzo.h lzoconf.h lzodefs.h nffile.c \ + nffile.h nfx.c nfx.h nfxstat.h nfxstat.c flist.c flist.h \ + fts_compat.c fts_compat.h nfstatfile.c nfstatfile.h launch.c \ + launch.h nfnet.c nfnet.h collector.c collector.h netflow_v1.c \ + netflow_v1.h netflow_v5_v7.c netflow_v5_v7.h netflow_v9.c \ + netflow_v9.h ipfix.c ipfix.h bookkeeper.c bookkeeper.h \ + expire.c expire.h pcap_reader.c pcap_reader.h +am__objects_8 = nfcapd-nf_common.$(OBJEXT) +am__objects_9 = nfcapd-util.$(OBJEXT) +am__objects_10 = nfcapd-minilzo.$(OBJEXT) nfcapd-nffile.$(OBJEXT) \ + nfcapd-nfx.$(OBJEXT) nfcapd-nfxstat.$(OBJEXT) +am__objects_11 = nfcapd-flist.$(OBJEXT) nfcapd-fts_compat.$(OBJEXT) +am__objects_12 = nfcapd-nfstatfile.$(OBJEXT) +am__objects_13 = nfcapd-launch.$(OBJEXT) +am__objects_14 = nfcapd-nfnet.$(OBJEXT) +am__objects_15 = nfcapd-collector.$(OBJEXT) +am__objects_16 = nfcapd-netflow_v1.$(OBJEXT) +am__objects_17 = nfcapd-netflow_v5_v7.$(OBJEXT) +am__objects_18 = nfcapd-netflow_v9.$(OBJEXT) +am__objects_19 = nfcapd-ipfix.$(OBJEXT) +am__objects_20 = nfcapd-bookkeeper.$(OBJEXT) +am__objects_21 = nfcapd-expire.$(OBJEXT) +@READPCAP_TRUE@am__objects_22 = nfcapd-pcap_reader.$(OBJEXT) +am_nfcapd_OBJECTS = nfcapd-nfcapd.$(OBJEXT) $(am__objects_8) \ + $(am__objects_9) $(am__objects_10) $(am__objects_11) \ + $(am__objects_12) $(am__objects_13) $(am__objects_14) \ + $(am__objects_15) $(am__objects_16) $(am__objects_17) \ + $(am__objects_18) $(am__objects_19) $(am__objects_20) \ + $(am__objects_21) $(am__objects_22) +nfcapd_OBJECTS = $(am_nfcapd_OBJECTS) +nfcapd_DEPENDENCIES = +nfcapd_LINK = $(CCLD) $(nfcapd_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ +am__objects_23 = nf_common.$(OBJEXT) +am__objects_24 = nflowcache.$(OBJEXT) +am__objects_25 = grammar.$(OBJEXT) scanner.$(OBJEXT) nftree.$(OBJEXT) \ + ipconv.$(OBJEXT) +am__objects_26 = nfprof.$(OBJEXT) +am__objects_27 = exporter.$(OBJEXT) +am_nfdump_OBJECTS = nfdump.$(OBJEXT) nfstat.$(OBJEXT) \ + nfexport.$(OBJEXT) $(am__objects_23) $(am__objects_24) \ + $(am__objects_4) $(am__objects_5) $(am__objects_6) \ + $(am__objects_25) $(am__objects_26) $(am__objects_27) +nfdump_OBJECTS = $(am_nfdump_OBJECTS) +nfdump_LDADD = $(LDADD) +nfdump_DEPENDENCIES = +am__objects_28 = bookkeeper.$(OBJEXT) +am__objects_29 = expire.$(OBJEXT) +am__objects_30 = nfstatfile.$(OBJEXT) +am_nfexpire_OBJECTS = nfexpire.$(OBJEXT) $(am__objects_28) \ + $(am__objects_29) $(am__objects_4) $(am__objects_30) +nfexpire_OBJECTS = $(am_nfexpire_OBJECTS) +nfexpire_DEPENDENCIES = +am_nfgen_OBJECTS = nfgen.$(OBJEXT) $(am__objects_4) $(am__objects_5) \ + $(am__objects_6) +nfgen_OBJECTS = $(am_nfgen_OBJECTS) +nfgen_LDADD = $(LDADD) +nfgen_DEPENDENCIES = +am__objects_31 = nfpcapd-pcaproc.$(OBJEXT) nfpcapd-flowtree.$(OBJEXT) \ + nfpcapd-ipfrag.$(OBJEXT) +am__objects_32 = nfpcapd-netflow_pcap.$(OBJEXT) +am__objects_33 = nfpcapd-nf_common.$(OBJEXT) +am__objects_34 = nfpcapd-util.$(OBJEXT) +am__objects_35 = nfpcapd-minilzo.$(OBJEXT) nfpcapd-nffile.$(OBJEXT) \ + nfpcapd-nfx.$(OBJEXT) nfpcapd-nfxstat.$(OBJEXT) +am__objects_36 = nfpcapd-flist.$(OBJEXT) nfpcapd-fts_compat.$(OBJEXT) +am__objects_37 = nfpcapd-nfstatfile.$(OBJEXT) +am__objects_38 = nfpcapd-launch.$(OBJEXT) +am__objects_39 = nfpcapd-nfnet.$(OBJEXT) +am__objects_40 = nfpcapd-collector.$(OBJEXT) +am__objects_41 = nfpcapd-bookkeeper.$(OBJEXT) +am__objects_42 = nfpcapd-expire.$(OBJEXT) +am__objects_43 = nfpcapd-content_dns.$(OBJEXT) +am_nfpcapd_OBJECTS = nfpcapd-nfpcapd.$(OBJEXT) $(am__objects_31) \ + $(am__objects_32) $(am__objects_33) $(am__objects_34) \ + $(am__objects_35) $(am__objects_36) $(am__objects_37) \ + $(am__objects_38) $(am__objects_39) $(am__objects_40) \ + $(am__objects_41) $(am__objects_42) $(am__objects_43) +nfpcapd_OBJECTS = $(am_nfpcapd_OBJECTS) +nfpcapd_DEPENDENCIES = +nfpcapd_LINK = $(CCLD) $(nfpcapd_CFLAGS) $(CFLAGS) $(nfpcapd_LDFLAGS) \ + $(LDFLAGS) -o $@ +am_nfprofile_OBJECTS = nfprofile.$(OBJEXT) profile.$(OBJEXT) \ + $(am__objects_23) $(am__objects_4) $(am__objects_5) \ + $(am__objects_6) $(am__objects_25) $(am__objects_30) \ + $(am__objects_27) +nfprofile_OBJECTS = $(am_nfprofile_OBJECTS) +nfprofile_DEPENDENCIES = +am_nfreader_OBJECTS = nfreader.$(OBJEXT) $(am__objects_4) \ + $(am__objects_5) $(am__objects_6) $(am__objects_27) +nfreader_OBJECTS = $(am_nfreader_OBJECTS) +nfreader_LDADD = $(LDADD) +nfreader_DEPENDENCIES = +am__objects_44 = nfnet.$(OBJEXT) +am__objects_45 = collector.$(OBJEXT) +am__objects_46 = netflow_v1.$(OBJEXT) +am__objects_47 = netflow_v9.$(OBJEXT) +am__objects_48 = netflow_v5_v7.$(OBJEXT) +am__objects_49 = ipfix.$(OBJEXT) +am_nfreplay_OBJECTS = nfreplay.$(OBJEXT) $(am__objects_23) \ + $(am__objects_4) $(am__objects_5) $(am__objects_6) \ + $(am__objects_25) $(am__objects_26) $(am__objects_44) \ + $(am__objects_45) $(am__objects_46) $(am__objects_47) \ + $(am__objects_48) $(am__objects_49) $(am__objects_27) +nfreplay_OBJECTS = $(am_nfreplay_OBJECTS) +nfreplay_LDADD = $(LDADD) +nfreplay_DEPENDENCIES = +am_nftest_OBJECTS = nftest.$(OBJEXT) $(am__objects_23) \ + $(am__objects_4) $(am__objects_25) $(am__objects_5) +nftest_OBJECTS = $(am_nftest_OBJECTS) +nftest_LDADD = $(LDADD) +am__dirstamp = $(am__leading_dot)dirstamp +am__objects_50 = nftrack-nf_common.$(OBJEXT) +am__objects_51 = nftrack-util.$(OBJEXT) +am__objects_52 = nftrack-minilzo.$(OBJEXT) nftrack-nffile.$(OBJEXT) \ + nftrack-nfx.$(OBJEXT) nftrack-nfxstat.$(OBJEXT) +am__objects_53 = nftrack-flist.$(OBJEXT) nftrack-fts_compat.$(OBJEXT) +am__objects_54 = nftrack-grammar.$(OBJEXT) nftrack-scanner.$(OBJEXT) \ + nftrack-nftree.$(OBJEXT) nftrack-ipconv.$(OBJEXT) +am_nftrack_OBJECTS = ../extra/nftrack/nftrack-nftrack.$(OBJEXT) \ + ../extra/nftrack/nftrack-nftrack_rrd.$(OBJEXT) \ + ../extra/nftrack/nftrack-nftrack_stat.$(OBJEXT) \ + $(am__objects_50) $(am__objects_51) $(am__objects_52) \ + $(am__objects_53) $(am__objects_54) +nftrack_OBJECTS = $(am_nftrack_OBJECTS) +nftrack_DEPENDENCIES = +nftrack_LINK = $(CCLD) $(nftrack_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ +am__sfcapd_SOURCES_DIST = sfcapd.c sflow.c sflow.h sflow_proto.h \ + nf_common.c nf_common.h util.c util.h minilzo.c minilzo.h \ + lzoconf.h lzodefs.h nffile.c nffile.h nfx.c nfx.h nfxstat.h \ + nfxstat.c flist.c flist.h fts_compat.c fts_compat.h \ + nfstatfile.c nfstatfile.h launch.c launch.h nfnet.c nfnet.h \ + collector.c collector.h bookkeeper.c bookkeeper.h expire.c \ + expire.h pcap_reader.c pcap_reader.h +am__objects_55 = sfcapd-nf_common.$(OBJEXT) +am__objects_56 = sfcapd-util.$(OBJEXT) +am__objects_57 = sfcapd-minilzo.$(OBJEXT) sfcapd-nffile.$(OBJEXT) \ + sfcapd-nfx.$(OBJEXT) sfcapd-nfxstat.$(OBJEXT) +am__objects_58 = sfcapd-flist.$(OBJEXT) sfcapd-fts_compat.$(OBJEXT) +am__objects_59 = sfcapd-nfstatfile.$(OBJEXT) +am__objects_60 = sfcapd-launch.$(OBJEXT) +am__objects_61 = sfcapd-nfnet.$(OBJEXT) +am__objects_62 = sfcapd-collector.$(OBJEXT) +am__objects_63 = sfcapd-bookkeeper.$(OBJEXT) +am__objects_64 = sfcapd-expire.$(OBJEXT) +@READPCAP_TRUE@am__objects_65 = sfcapd-pcap_reader.$(OBJEXT) +am_sfcapd_OBJECTS = sfcapd-sfcapd.$(OBJEXT) sfcapd-sflow.$(OBJEXT) \ + $(am__objects_55) $(am__objects_56) $(am__objects_57) \ + $(am__objects_58) $(am__objects_59) $(am__objects_60) \ + $(am__objects_61) $(am__objects_62) $(am__objects_63) \ + $(am__objects_64) $(am__objects_65) +sfcapd_OBJECTS = $(am_sfcapd_OBJECTS) +sfcapd_DEPENDENCIES = +sfcapd_LINK = $(CCLD) $(sfcapd_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +am__mv = mv -f +AM_V_lt = $(am__v_lt_@AM_V@) +am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) +am__v_lt_0 = --silent +am__v_lt_1 = +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +AM_V_CC = $(am__v_CC_@AM_V@) +am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +am__v_CC_0 = @echo " CC " $@; +am__v_CC_1 = +CCLD = $(CC) +LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CCLD = $(am__v_CCLD_@AM_V@) +am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +am__v_CCLD_0 = @echo " CCLD " $@; +am__v_CCLD_1 = +LEXCOMPILE = $(LEX) $(AM_LFLAGS) $(LFLAGS) +AM_V_LEX = $(am__v_LEX_@AM_V@) +am__v_LEX_ = $(am__v_LEX_@AM_DEFAULT_V@) +am__v_LEX_0 = @echo " LEX " $@; +am__v_LEX_1 = +YLWRAP = $(top_srcdir)/ylwrap +am__yacc_c2h = sed -e s/cc$$/hh/ -e s/cpp$$/hpp/ -e s/cxx$$/hxx/ \ + -e s/c++$$/h++/ -e s/c$$/h/ +YACCCOMPILE = $(YACC) $(AM_YFLAGS) $(YFLAGS) +AM_V_YACC = $(am__v_YACC_@AM_V@) +am__v_YACC_ = $(am__v_YACC_@AM_DEFAULT_V@) +am__v_YACC_0 = @echo " YACC " $@; +am__v_YACC_1 = +SOURCES = $(ft2nfdump_SOURCES) $(nfanon_SOURCES) $(nfcapd_SOURCES) \ + $(nfdump_SOURCES) $(nfexpire_SOURCES) $(nfgen_SOURCES) \ + $(nfpcapd_SOURCES) $(nfprofile_SOURCES) $(nfreader_SOURCES) \ + $(nfreplay_SOURCES) $(nftest_SOURCES) $(nftrack_SOURCES) \ + $(sfcapd_SOURCES) +DIST_SOURCES = $(am__ft2nfdump_SOURCES_DIST) $(nfanon_SOURCES) \ + $(am__nfcapd_SOURCES_DIST) $(nfdump_SOURCES) \ + $(nfexpire_SOURCES) $(nfgen_SOURCES) $(nfpcapd_SOURCES) \ + $(nfprofile_SOURCES) $(nfreader_SOURCES) $(nfreplay_SOURCES) \ + $(nftest_SOURCES) $(nftrack_SOURCES) \ + $(am__sfcapd_SOURCES_DIST) +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` +ETAGS = etags +CTAGS = ctags +am__tty_colors_dummy = \ + mgn= red= grn= lgn= blu= brg= std=; \ + am__color_tests=no +am__tty_colors = { \ + $(am__tty_colors_dummy); \ + if test "X$(AM_COLOR_TESTS)" = Xno; then \ + am__color_tests=no; \ + elif test "X$(AM_COLOR_TESTS)" = Xalways; then \ + am__color_tests=yes; \ + elif test "X$$TERM" != Xdumb && { test -t 1; } 2>/dev/null; then \ + am__color_tests=yes; \ + fi; \ + if test $$am__color_tests = yes; then \ + red=''; \ + grn=''; \ + lgn=''; \ + blu=''; \ + mgn=''; \ + brg=''; \ + std=''; \ + fi; \ +} +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } +am__recheck_rx = ^[ ]*:recheck:[ ]* +am__global_test_result_rx = ^[ ]*:global-test-result:[ ]* +am__copy_in_global_log_rx = ^[ ]*:copy-in-global-log:[ ]* +# A command that, given a newline-separated list of test names on the +# standard input, print the name of the tests that are to be re-run +# upon "make recheck". +am__list_recheck_tests = $(AWK) '{ \ + recheck = 1; \ + while ((rc = (getline line < ($$0 ".trs"))) != 0) \ + { \ + if (rc < 0) \ + { \ + if ((getline line2 < ($$0 ".log")) < 0) \ + recheck = 0; \ + break; \ + } \ + else if (line ~ /$(am__recheck_rx)[nN][Oo]/) \ + { \ + recheck = 0; \ + break; \ + } \ + else if (line ~ /$(am__recheck_rx)[yY][eE][sS]/) \ + { \ + break; \ + } \ + }; \ + if (recheck) \ + print $$0; \ + close ($$0 ".trs"); \ + close ($$0 ".log"); \ +}' +# A command that, given a newline-separated list of test names on the +# standard input, create the global log from their .trs and .log files. +am__create_global_log = $(AWK) ' \ +function fatal(msg) \ +{ \ + print "fatal: making $@: " msg | "cat >&2"; \ + exit 1; \ +} \ +function rst_section(header) \ +{ \ + print header; \ + len = length(header); \ + for (i = 1; i <= len; i = i + 1) \ + printf "="; \ + printf "\n\n"; \ +} \ +{ \ + copy_in_global_log = 1; \ + global_test_result = "RUN"; \ + while ((rc = (getline line < ($$0 ".trs"))) != 0) \ + { \ + if (rc < 0) \ + fatal("failed to read from " $$0 ".trs"); \ + if (line ~ /$(am__global_test_result_rx)/) \ + { \ + sub("$(am__global_test_result_rx)", "", line); \ + sub("[ ]*$$", "", line); \ + global_test_result = line; \ + } \ + else if (line ~ /$(am__copy_in_global_log_rx)[nN][oO]/) \ + copy_in_global_log = 0; \ + }; \ + if (copy_in_global_log) \ + { \ + rst_section(global_test_result ": " $$0); \ + while ((rc = (getline line < ($$0 ".log"))) != 0) \ + { \ + if (rc < 0) \ + fatal("failed to read from " $$0 ".log"); \ + print line; \ + }; \ + printf "\n"; \ + }; \ + close ($$0 ".trs"); \ + close ($$0 ".log"); \ +}' +# Restructured Text title. +am__rst_title = { sed 's/.*/ & /;h;s/./=/g;p;x;s/ *$$//;p;g' && echo; } +# Solaris 10 'make', and several other traditional 'make' implementations, +# pass "-e" to $(SHELL), and POSIX 2008 even requires this. Work around it +# by disabling -e (using the XSI extension "set +e") if it's set. +am__sh_e_setup = case $$- in *e*) set +e;; esac +# Default flags passed to test drivers. +am__common_driver_flags = \ + --color-tests "$$am__color_tests" \ + --enable-hard-errors "$$am__enable_hard_errors" \ + --expect-failure "$$am__expect_failure" +# To be inserted before the command running the test. Creates the +# directory for the log if needed. Stores in $dir the directory +# containing $f, in $tst the test, in $log the log. Executes the +# developer- defined test setup AM_TESTS_ENVIRONMENT (if any), and +# passes TESTS_ENVIRONMENT. Set up options for the wrapper that +# will run the test scripts (or their associated LOG_COMPILER, if +# thy have one). +am__check_pre = \ +$(am__sh_e_setup); \ +$(am__vpath_adj_setup) $(am__vpath_adj) \ +$(am__tty_colors); \ +srcdir=$(srcdir); export srcdir; \ +case "$@" in \ + */*) am__odir=`echo "./$@" | sed 's|/[^/]*$$||'`;; \ + *) am__odir=.;; \ +esac; \ +test "x$$am__odir" = x"." || test -d "$$am__odir" \ + || $(MKDIR_P) "$$am__odir" || exit $$?; \ +if test -f "./$$f"; then dir=./; \ +elif test -f "$$f"; then dir=; \ +else dir="$(srcdir)/"; fi; \ +tst=$$dir$$f; log='$@'; \ +if test -n '$(DISABLE_HARD_ERRORS)'; then \ + am__enable_hard_errors=no; \ +else \ + am__enable_hard_errors=yes; \ +fi; \ +case " $(XFAIL_TESTS) " in \ + *[\ \ ]$$f[\ \ ]* | *[\ \ ]$$dir$$f[\ \ ]*) \ + am__expect_failure=yes;; \ + *) \ + am__expect_failure=no;; \ +esac; \ +$(AM_TESTS_ENVIRONMENT) $(TESTS_ENVIRONMENT) +# A shell command to get the names of the tests scripts with any registered +# extension removed (i.e., equivalently, the names of the test logs, with +# the '.log' extension removed). The result is saved in the shell variable +# '$bases'. This honors runtime overriding of TESTS and TEST_LOGS. Sadly, +# we cannot use something simpler, involving e.g., "$(TEST_LOGS:.log=)", +# since that might cause problem with VPATH rewrites for suffix-less tests. +# See also 'test-harness-vpath-rewrite.sh' and 'test-trs-basic.sh'. +am__set_TESTS_bases = \ + bases='$(TEST_LOGS)'; \ + bases=`for i in $$bases; do echo $$i; done | sed 's/\.log$$//'`; \ + bases=`echo $$bases` +RECHECK_LOGS = $(TEST_LOGS) +AM_RECURSIVE_TARGETS = check recheck +TEST_SUITE_LOG = test-suite.log +TEST_EXTENSIONS = @EXEEXT@ .test +LOG_DRIVER = $(SHELL) $(top_srcdir)/test-driver +LOG_COMPILE = $(LOG_COMPILER) $(AM_LOG_FLAGS) $(LOG_FLAGS) +am__set_b = \ + case '$@' in \ + */*) \ + case '$*' in \ + */*) b='$*';; \ + *) b=`echo '$@' | sed 's/\.log$$//'`; \ + esac;; \ + *) \ + b='$*';; \ + esac +am__test_logs1 = $(TESTS:=.log) +am__test_logs2 = $(am__test_logs1:@EXEEXT@.log=.log) +TEST_LOGS = $(am__test_logs2:.test.log=.log) +TEST_LOG_DRIVER = $(SHELL) $(top_srcdir)/test-driver +TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \ + $(TEST_LOG_FLAGS) +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FTS_OBJ = @FTS_OBJ@ +FT_INCLUDES = @FT_INCLUDES@ +FT_LDFLAGS = @FT_LDFLAGS@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LEX = @LEX@ +LEXLIB = @LEXLIB@ +LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ +LFLAGS = @LFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +RRD_LIBS = @RRD_LIBS@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +YACC = @YACC@ +YFLAGS = @YFLAGS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build_alias = @build_alias@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host_alias = @host_alias@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +check_PROGRAMMS = test.sh +BUILT_SOURCES = grammar.h +AM_YFLAGS = -d +AM_CPPFLAGS = $(DEPS_CFLAGS) +LDADD = $(DEPS_LIBS) + +#Add extra debug info for gdb +AM_CFLAGS = -ggdb +common = nf_common.c nf_common.h +util = util.c util.h +filelzo = minilzo.c minilzo.h lzoconf.h lzodefs.h nffile.c nffile.h nfx.c nfx.h nfxstat.h nfxstat.c +nflist = flist.c flist.h fts_compat.c fts_compat.h +filter = grammar.y scanner.l nftree.c nftree.h ipconv.c ipconv.h rbtree.h +nfprof = nfprof.c nfprof.h +nfnet = nfnet.c nfnet.h +anon = panonymizer.c panonymizer.h rijndael.c rijndael.h +collector = collector.c collector.h +nfv1 = netflow_v1.c netflow_v1.h +nfv9 = netflow_v9.c netflow_v9.h +pcaproc = pcaproc.c pcaproc.h flowtree.c flowtree.h ipfrag.c ipfrag.h +content = content_dns.c content_dns.h +netflow_pcap = netflow_pcap.c netflow_pcap.h +ipfix = ipfix.c ipfix.h +nfv5v7 = netflow_v5_v7.c netflow_v5_v7.h +nfstatfile = nfstatfile.c nfstatfile.h +nflowcache = nflowcache.c nflowcache.h +bookkeeper = bookkeeper.c bookkeeper.h +exporter = exporter.c exporter.h +expire = expire.c expire.h +launch = launch.c launch.h +nfdump_SOURCES = nfdump.c nfdump.h nfstat.c nfstat.h nfexport.c nfexport.h \ + $(common) $(nflowcache) $(util) $(filelzo) $(nflist) $(filter) $(nfprof) $(exporter) + +nfreplay_SOURCES = nfreplay.c \ + $(common) $(util) $(filelzo) $(nflist) $(filter) $(nfprof) \ + $(nfnet) $(collector) $(nfv1) $(nfv9) $(nfv5v7) $(ipfix) $(exporter) + +nfprofile_SOURCES = nfprofile.c profile.c profile.h \ + $(common) $(util) $(filelzo) $(nflist) $(filter) $(nfstatfile) $(exporter) + +nfprofile_LDADD = -lrrd +nftrack_SOURCES = ../extra/nftrack/nftrack.c \ + ../extra/nftrack/nftrack_rrd.c ../extra/nftrack/nftrack_rrd.h \ + ../extra/nftrack/nftrack_stat.c ../extra/nftrack/nftrack_stat.h \ + $(common) $(util) $(filelzo) $(nflist) $(filter) + +nftrack_CFLAGS = -I ../extra/nftrack +nftrack_LDADD = -lrrd +nfcapd_SOURCES = nfcapd.c $(common) $(util) $(filelzo) $(nflist) \ + $(nfstatfile) $(launch) $(nfnet) $(collector) $(nfv1) \ + $(nfv5v7) $(nfv9) $(ipfix) $(bookkeeper) $(expire) \ + $(am__append_5) +nfpcapd_SOURCES = nfpcapd.c \ + $(pcaproc) $(netflow_pcap) \ + $(common) $(util) $(filelzo) $(nflist) $(nfstatfile) $(launch) \ + $(nfnet) $(collector) $(bookkeeper) $(expire) $(content) + +@READPCAP_TRUE@nfcapd_CFLAGS = -DPCAP +@READPCAP_TRUE@nfcapd_LDADD = -lpcap +@BUILDNFPCAPD_TRUE@nfpcapd_CFLAGS = -D_BSD_SOURCE +@BUILDNFPCAPD_TRUE@nfpcapd_LDADD = -lpcap +@BUILDNFPCAPD_TRUE@nfpcapd_LDFLAGS = -pthread +sfcapd_SOURCES = sfcapd.c sflow.c sflow.h sflow_proto.h $(common) \ + $(util) $(filelzo) $(nflist) $(nfstatfile) $(launch) $(nfnet) \ + $(collector) $(bookkeeper) $(expire) $(am__append_7) +@READPCAP_TRUE@sfcapd_CFLAGS = -DPCAP +@READPCAP_TRUE@sfcapd_LDADD = -lpcap +nfreader_SOURCES = nfreader.c \ + $(util) $(filelzo) $(nflist) $(exporter) + +nfanon_SOURCES = nfanon.c \ + $(util) $(filelzo) $(nflist) $(anon) + +nfgen_SOURCES = nfgen.c $(util) $(filelzo) $(nflist) +nfexpire_SOURCES = nfexpire.c \ + $(bookkeeper) $(expire) $(util) $(nfstatfile) + +nfexpire_LDADD = @FTS_OBJ@ +nftest_SOURCES = nftest.c $(common) $(util) $(filter) $(filelzo) +nftest_DEPENDENCIES = nfgen +@FT2NFDUMP_TRUE@ft2nfdump_SOURCES = ft2nfdump.c $(common) $(filelzo) $(util) +@FT2NFDUMP_TRUE@ft2nfdump_CFLAGS = @FT_INCLUDES@ +@FT2NFDUMP_TRUE@ft2nfdump_LDADD = -lft -lz @FT_LDFLAGS@ +EXTRA_DIST = inline.c collector_inline.c nffile_inline.c nfdump_inline.c heapsort_inline.c applybits_inline.c test.sh nfdump.test.out parse_csv.pl +CLEANFILES = lex.yy.c grammar.c grammar.h scanner.c scanner.h +all: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) all-am + +.SUFFIXES: +.SUFFIXES: .c .l .log .o .obj .test .test$(EXEEXT) .trs .y +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu bin/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu bin/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): +install-binPROGRAMS: $(bin_PROGRAMS) + @$(NORMAL_INSTALL) + @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ + fi; \ + for p in $$list; do echo "$$p $$p"; done | \ + sed 's/$(EXEEXT)$$//' | \ + while read p p1; do if test -f $$p \ + ; then echo "$$p"; echo "$$p"; else :; fi; \ + done | \ + sed -e 'p;s,.*/,,;n;h' \ + -e 's|.*|.|' \ + -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ + sed 'N;N;N;s,\n, ,g' | \ + $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ + { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ + if ($$2 == $$4) files[d] = files[d] " " $$1; \ + else { print "f", $$3 "/" $$4, $$1; } } \ + END { for (d in files) print "f", d, files[d] }' | \ + while read type dir files; do \ + if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ + test -z "$$files" || { \ + echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ + $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ + } \ + ; done + +uninstall-binPROGRAMS: + @$(NORMAL_UNINSTALL) + @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ + files=`for p in $$list; do echo "$$p"; done | \ + sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ + -e 's/$$/$(EXEEXT)/' \ + `; \ + test -n "$$list" || exit 0; \ + echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(bindir)" && rm -f $$files + +clean-binPROGRAMS: + -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) + +ft2nfdump$(EXEEXT): $(ft2nfdump_OBJECTS) $(ft2nfdump_DEPENDENCIES) $(EXTRA_ft2nfdump_DEPENDENCIES) + @rm -f ft2nfdump$(EXEEXT) + $(AM_V_CCLD)$(ft2nfdump_LINK) $(ft2nfdump_OBJECTS) $(ft2nfdump_LDADD) $(LIBS) + +nfanon$(EXEEXT): $(nfanon_OBJECTS) $(nfanon_DEPENDENCIES) $(EXTRA_nfanon_DEPENDENCIES) + @rm -f nfanon$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(nfanon_OBJECTS) $(nfanon_LDADD) $(LIBS) + +nfcapd$(EXEEXT): $(nfcapd_OBJECTS) $(nfcapd_DEPENDENCIES) $(EXTRA_nfcapd_DEPENDENCIES) + @rm -f nfcapd$(EXEEXT) + $(AM_V_CCLD)$(nfcapd_LINK) $(nfcapd_OBJECTS) $(nfcapd_LDADD) $(LIBS) +grammar.h: grammar.c + @if test ! -f $@; then rm -f grammar.c; else :; fi + @if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) grammar.c; else :; fi + +nfdump$(EXEEXT): $(nfdump_OBJECTS) $(nfdump_DEPENDENCIES) $(EXTRA_nfdump_DEPENDENCIES) + @rm -f nfdump$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(nfdump_OBJECTS) $(nfdump_LDADD) $(LIBS) + +nfexpire$(EXEEXT): $(nfexpire_OBJECTS) $(nfexpire_DEPENDENCIES) $(EXTRA_nfexpire_DEPENDENCIES) + @rm -f nfexpire$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(nfexpire_OBJECTS) $(nfexpire_LDADD) $(LIBS) + +nfgen$(EXEEXT): $(nfgen_OBJECTS) $(nfgen_DEPENDENCIES) $(EXTRA_nfgen_DEPENDENCIES) + @rm -f nfgen$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(nfgen_OBJECTS) $(nfgen_LDADD) $(LIBS) + +nfpcapd$(EXEEXT): $(nfpcapd_OBJECTS) $(nfpcapd_DEPENDENCIES) $(EXTRA_nfpcapd_DEPENDENCIES) + @rm -f nfpcapd$(EXEEXT) + $(AM_V_CCLD)$(nfpcapd_LINK) $(nfpcapd_OBJECTS) $(nfpcapd_LDADD) $(LIBS) + +nfprofile$(EXEEXT): $(nfprofile_OBJECTS) $(nfprofile_DEPENDENCIES) $(EXTRA_nfprofile_DEPENDENCIES) + @rm -f nfprofile$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(nfprofile_OBJECTS) $(nfprofile_LDADD) $(LIBS) + +nfreader$(EXEEXT): $(nfreader_OBJECTS) $(nfreader_DEPENDENCIES) $(EXTRA_nfreader_DEPENDENCIES) + @rm -f nfreader$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(nfreader_OBJECTS) $(nfreader_LDADD) $(LIBS) + +nfreplay$(EXEEXT): $(nfreplay_OBJECTS) $(nfreplay_DEPENDENCIES) $(EXTRA_nfreplay_DEPENDENCIES) + @rm -f nfreplay$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(nfreplay_OBJECTS) $(nfreplay_LDADD) $(LIBS) + +nftest$(EXEEXT): $(nftest_OBJECTS) $(nftest_DEPENDENCIES) $(EXTRA_nftest_DEPENDENCIES) + @rm -f nftest$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(nftest_OBJECTS) $(nftest_LDADD) $(LIBS) +../extra/nftrack/$(am__dirstamp): + @$(MKDIR_P) ../extra/nftrack + @: > ../extra/nftrack/$(am__dirstamp) +../extra/nftrack/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) ../extra/nftrack/$(DEPDIR) + @: > ../extra/nftrack/$(DEPDIR)/$(am__dirstamp) +../extra/nftrack/nftrack-nftrack.$(OBJEXT): \ + ../extra/nftrack/$(am__dirstamp) \ + ../extra/nftrack/$(DEPDIR)/$(am__dirstamp) +../extra/nftrack/nftrack-nftrack_rrd.$(OBJEXT): \ + ../extra/nftrack/$(am__dirstamp) \ + ../extra/nftrack/$(DEPDIR)/$(am__dirstamp) +../extra/nftrack/nftrack-nftrack_stat.$(OBJEXT): \ + ../extra/nftrack/$(am__dirstamp) \ + ../extra/nftrack/$(DEPDIR)/$(am__dirstamp) + +nftrack$(EXEEXT): $(nftrack_OBJECTS) $(nftrack_DEPENDENCIES) $(EXTRA_nftrack_DEPENDENCIES) + @rm -f nftrack$(EXEEXT) + $(AM_V_CCLD)$(nftrack_LINK) $(nftrack_OBJECTS) $(nftrack_LDADD) $(LIBS) + +sfcapd$(EXEEXT): $(sfcapd_OBJECTS) $(sfcapd_DEPENDENCIES) $(EXTRA_sfcapd_DEPENDENCIES) + @rm -f sfcapd$(EXEEXT) + $(AM_V_CCLD)$(sfcapd_LINK) $(sfcapd_OBJECTS) $(sfcapd_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + -rm -f ../extra/nftrack/*.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@../extra/nftrack/$(DEPDIR)/nftrack-nftrack.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@../extra/nftrack/$(DEPDIR)/nftrack-nftrack_rrd.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@../extra/nftrack/$(DEPDIR)/nftrack-nftrack_stat.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bookkeeper.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/collector.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/expire.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/exporter.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/flist.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ft2nfdump-ft2nfdump.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ft2nfdump-minilzo.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ft2nfdump-nf_common.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ft2nfdump-nffile.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ft2nfdump-nfx.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ft2nfdump-nfxstat.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ft2nfdump-util.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fts_compat.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/grammar.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ipconv.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ipfix.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/minilzo.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/netflow_v1.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/netflow_v5_v7.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/netflow_v9.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nf_common.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nfanon.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nfcapd-bookkeeper.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nfcapd-collector.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nfcapd-expire.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nfcapd-flist.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nfcapd-fts_compat.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nfcapd-ipfix.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nfcapd-launch.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nfcapd-minilzo.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nfcapd-netflow_v1.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nfcapd-netflow_v5_v7.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nfcapd-netflow_v9.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nfcapd-nf_common.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nfcapd-nfcapd.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nfcapd-nffile.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nfcapd-nfnet.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nfcapd-nfstatfile.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nfcapd-nfx.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nfcapd-nfxstat.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nfcapd-pcap_reader.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nfcapd-util.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nfdump.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nfexpire.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nfexport.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nffile.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nfgen.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nflowcache.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nfnet.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nfpcapd-bookkeeper.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nfpcapd-collector.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nfpcapd-content_dns.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nfpcapd-expire.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nfpcapd-flist.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nfpcapd-flowtree.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nfpcapd-fts_compat.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nfpcapd-ipfrag.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nfpcapd-launch.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nfpcapd-minilzo.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nfpcapd-netflow_pcap.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nfpcapd-nf_common.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nfpcapd-nffile.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nfpcapd-nfnet.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nfpcapd-nfpcapd.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nfpcapd-nfstatfile.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nfpcapd-nfx.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nfpcapd-nfxstat.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nfpcapd-pcaproc.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nfpcapd-util.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nfprof.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nfprofile.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nfreader.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nfreplay.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nfstat.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nfstatfile.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nftest.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nftrack-flist.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nftrack-fts_compat.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nftrack-grammar.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nftrack-ipconv.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nftrack-minilzo.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nftrack-nf_common.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nftrack-nffile.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nftrack-nftree.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nftrack-nfx.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nftrack-nfxstat.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nftrack-scanner.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nftrack-util.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nftree.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nfx.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nfxstat.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/panonymizer.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/profile.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rijndael.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/scanner.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sfcapd-bookkeeper.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sfcapd-collector.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sfcapd-expire.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sfcapd-flist.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sfcapd-fts_compat.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sfcapd-launch.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sfcapd-minilzo.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sfcapd-nf_common.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sfcapd-nffile.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sfcapd-nfnet.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sfcapd-nfstatfile.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sfcapd-nfx.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sfcapd-nfxstat.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sfcapd-pcap_reader.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sfcapd-sfcapd.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sfcapd-sflow.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sfcapd-util.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/util.Po@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< + +.c.obj: +@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +ft2nfdump-ft2nfdump.o: ft2nfdump.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ft2nfdump_CFLAGS) $(CFLAGS) -MT ft2nfdump-ft2nfdump.o -MD -MP -MF $(DEPDIR)/ft2nfdump-ft2nfdump.Tpo -c -o ft2nfdump-ft2nfdump.o `test -f 'ft2nfdump.c' || echo '$(srcdir)/'`ft2nfdump.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/ft2nfdump-ft2nfdump.Tpo $(DEPDIR)/ft2nfdump-ft2nfdump.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ft2nfdump.c' object='ft2nfdump-ft2nfdump.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ft2nfdump_CFLAGS) $(CFLAGS) -c -o ft2nfdump-ft2nfdump.o `test -f 'ft2nfdump.c' || echo '$(srcdir)/'`ft2nfdump.c + +ft2nfdump-ft2nfdump.obj: ft2nfdump.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ft2nfdump_CFLAGS) $(CFLAGS) -MT ft2nfdump-ft2nfdump.obj -MD -MP -MF $(DEPDIR)/ft2nfdump-ft2nfdump.Tpo -c -o ft2nfdump-ft2nfdump.obj `if test -f 'ft2nfdump.c'; then $(CYGPATH_W) 'ft2nfdump.c'; else $(CYGPATH_W) '$(srcdir)/ft2nfdump.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/ft2nfdump-ft2nfdump.Tpo $(DEPDIR)/ft2nfdump-ft2nfdump.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ft2nfdump.c' object='ft2nfdump-ft2nfdump.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ft2nfdump_CFLAGS) $(CFLAGS) -c -o ft2nfdump-ft2nfdump.obj `if test -f 'ft2nfdump.c'; then $(CYGPATH_W) 'ft2nfdump.c'; else $(CYGPATH_W) '$(srcdir)/ft2nfdump.c'; fi` + +ft2nfdump-nf_common.o: nf_common.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ft2nfdump_CFLAGS) $(CFLAGS) -MT ft2nfdump-nf_common.o -MD -MP -MF $(DEPDIR)/ft2nfdump-nf_common.Tpo -c -o ft2nfdump-nf_common.o `test -f 'nf_common.c' || echo '$(srcdir)/'`nf_common.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/ft2nfdump-nf_common.Tpo $(DEPDIR)/ft2nfdump-nf_common.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='nf_common.c' object='ft2nfdump-nf_common.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ft2nfdump_CFLAGS) $(CFLAGS) -c -o ft2nfdump-nf_common.o `test -f 'nf_common.c' || echo '$(srcdir)/'`nf_common.c + +ft2nfdump-nf_common.obj: nf_common.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ft2nfdump_CFLAGS) $(CFLAGS) -MT ft2nfdump-nf_common.obj -MD -MP -MF $(DEPDIR)/ft2nfdump-nf_common.Tpo -c -o ft2nfdump-nf_common.obj `if test -f 'nf_common.c'; then $(CYGPATH_W) 'nf_common.c'; else $(CYGPATH_W) '$(srcdir)/nf_common.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/ft2nfdump-nf_common.Tpo $(DEPDIR)/ft2nfdump-nf_common.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='nf_common.c' object='ft2nfdump-nf_common.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ft2nfdump_CFLAGS) $(CFLAGS) -c -o ft2nfdump-nf_common.obj `if test -f 'nf_common.c'; then $(CYGPATH_W) 'nf_common.c'; else $(CYGPATH_W) '$(srcdir)/nf_common.c'; fi` + +ft2nfdump-minilzo.o: minilzo.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ft2nfdump_CFLAGS) $(CFLAGS) -MT ft2nfdump-minilzo.o -MD -MP -MF $(DEPDIR)/ft2nfdump-minilzo.Tpo -c -o ft2nfdump-minilzo.o `test -f 'minilzo.c' || echo '$(srcdir)/'`minilzo.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/ft2nfdump-minilzo.Tpo $(DEPDIR)/ft2nfdump-minilzo.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='minilzo.c' object='ft2nfdump-minilzo.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ft2nfdump_CFLAGS) $(CFLAGS) -c -o ft2nfdump-minilzo.o `test -f 'minilzo.c' || echo '$(srcdir)/'`minilzo.c + +ft2nfdump-minilzo.obj: minilzo.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ft2nfdump_CFLAGS) $(CFLAGS) -MT ft2nfdump-minilzo.obj -MD -MP -MF $(DEPDIR)/ft2nfdump-minilzo.Tpo -c -o ft2nfdump-minilzo.obj `if test -f 'minilzo.c'; then $(CYGPATH_W) 'minilzo.c'; else $(CYGPATH_W) '$(srcdir)/minilzo.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/ft2nfdump-minilzo.Tpo $(DEPDIR)/ft2nfdump-minilzo.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='minilzo.c' object='ft2nfdump-minilzo.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ft2nfdump_CFLAGS) $(CFLAGS) -c -o ft2nfdump-minilzo.obj `if test -f 'minilzo.c'; then $(CYGPATH_W) 'minilzo.c'; else $(CYGPATH_W) '$(srcdir)/minilzo.c'; fi` + +ft2nfdump-nffile.o: nffile.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ft2nfdump_CFLAGS) $(CFLAGS) -MT ft2nfdump-nffile.o -MD -MP -MF $(DEPDIR)/ft2nfdump-nffile.Tpo -c -o ft2nfdump-nffile.o `test -f 'nffile.c' || echo '$(srcdir)/'`nffile.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/ft2nfdump-nffile.Tpo $(DEPDIR)/ft2nfdump-nffile.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='nffile.c' object='ft2nfdump-nffile.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ft2nfdump_CFLAGS) $(CFLAGS) -c -o ft2nfdump-nffile.o `test -f 'nffile.c' || echo '$(srcdir)/'`nffile.c + +ft2nfdump-nffile.obj: nffile.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ft2nfdump_CFLAGS) $(CFLAGS) -MT ft2nfdump-nffile.obj -MD -MP -MF $(DEPDIR)/ft2nfdump-nffile.Tpo -c -o ft2nfdump-nffile.obj `if test -f 'nffile.c'; then $(CYGPATH_W) 'nffile.c'; else $(CYGPATH_W) '$(srcdir)/nffile.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/ft2nfdump-nffile.Tpo $(DEPDIR)/ft2nfdump-nffile.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='nffile.c' object='ft2nfdump-nffile.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ft2nfdump_CFLAGS) $(CFLAGS) -c -o ft2nfdump-nffile.obj `if test -f 'nffile.c'; then $(CYGPATH_W) 'nffile.c'; else $(CYGPATH_W) '$(srcdir)/nffile.c'; fi` + +ft2nfdump-nfx.o: nfx.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ft2nfdump_CFLAGS) $(CFLAGS) -MT ft2nfdump-nfx.o -MD -MP -MF $(DEPDIR)/ft2nfdump-nfx.Tpo -c -o ft2nfdump-nfx.o `test -f 'nfx.c' || echo '$(srcdir)/'`nfx.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/ft2nfdump-nfx.Tpo $(DEPDIR)/ft2nfdump-nfx.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='nfx.c' object='ft2nfdump-nfx.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ft2nfdump_CFLAGS) $(CFLAGS) -c -o ft2nfdump-nfx.o `test -f 'nfx.c' || echo '$(srcdir)/'`nfx.c + +ft2nfdump-nfx.obj: nfx.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ft2nfdump_CFLAGS) $(CFLAGS) -MT ft2nfdump-nfx.obj -MD -MP -MF $(DEPDIR)/ft2nfdump-nfx.Tpo -c -o ft2nfdump-nfx.obj `if test -f 'nfx.c'; then $(CYGPATH_W) 'nfx.c'; else $(CYGPATH_W) '$(srcdir)/nfx.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/ft2nfdump-nfx.Tpo $(DEPDIR)/ft2nfdump-nfx.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='nfx.c' object='ft2nfdump-nfx.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ft2nfdump_CFLAGS) $(CFLAGS) -c -o ft2nfdump-nfx.obj `if test -f 'nfx.c'; then $(CYGPATH_W) 'nfx.c'; else $(CYGPATH_W) '$(srcdir)/nfx.c'; fi` + +ft2nfdump-nfxstat.o: nfxstat.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ft2nfdump_CFLAGS) $(CFLAGS) -MT ft2nfdump-nfxstat.o -MD -MP -MF $(DEPDIR)/ft2nfdump-nfxstat.Tpo -c -o ft2nfdump-nfxstat.o `test -f 'nfxstat.c' || echo '$(srcdir)/'`nfxstat.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/ft2nfdump-nfxstat.Tpo $(DEPDIR)/ft2nfdump-nfxstat.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='nfxstat.c' object='ft2nfdump-nfxstat.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ft2nfdump_CFLAGS) $(CFLAGS) -c -o ft2nfdump-nfxstat.o `test -f 'nfxstat.c' || echo '$(srcdir)/'`nfxstat.c + +ft2nfdump-nfxstat.obj: nfxstat.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ft2nfdump_CFLAGS) $(CFLAGS) -MT ft2nfdump-nfxstat.obj -MD -MP -MF $(DEPDIR)/ft2nfdump-nfxstat.Tpo -c -o ft2nfdump-nfxstat.obj `if test -f 'nfxstat.c'; then $(CYGPATH_W) 'nfxstat.c'; else $(CYGPATH_W) '$(srcdir)/nfxstat.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/ft2nfdump-nfxstat.Tpo $(DEPDIR)/ft2nfdump-nfxstat.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='nfxstat.c' object='ft2nfdump-nfxstat.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ft2nfdump_CFLAGS) $(CFLAGS) -c -o ft2nfdump-nfxstat.obj `if test -f 'nfxstat.c'; then $(CYGPATH_W) 'nfxstat.c'; else $(CYGPATH_W) '$(srcdir)/nfxstat.c'; fi` + +ft2nfdump-util.o: util.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ft2nfdump_CFLAGS) $(CFLAGS) -MT ft2nfdump-util.o -MD -MP -MF $(DEPDIR)/ft2nfdump-util.Tpo -c -o ft2nfdump-util.o `test -f 'util.c' || echo '$(srcdir)/'`util.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/ft2nfdump-util.Tpo $(DEPDIR)/ft2nfdump-util.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='util.c' object='ft2nfdump-util.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ft2nfdump_CFLAGS) $(CFLAGS) -c -o ft2nfdump-util.o `test -f 'util.c' || echo '$(srcdir)/'`util.c + +ft2nfdump-util.obj: util.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ft2nfdump_CFLAGS) $(CFLAGS) -MT ft2nfdump-util.obj -MD -MP -MF $(DEPDIR)/ft2nfdump-util.Tpo -c -o ft2nfdump-util.obj `if test -f 'util.c'; then $(CYGPATH_W) 'util.c'; else $(CYGPATH_W) '$(srcdir)/util.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/ft2nfdump-util.Tpo $(DEPDIR)/ft2nfdump-util.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='util.c' object='ft2nfdump-util.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ft2nfdump_CFLAGS) $(CFLAGS) -c -o ft2nfdump-util.obj `if test -f 'util.c'; then $(CYGPATH_W) 'util.c'; else $(CYGPATH_W) '$(srcdir)/util.c'; fi` + +nfcapd-nfcapd.o: nfcapd.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nfcapd_CFLAGS) $(CFLAGS) -MT nfcapd-nfcapd.o -MD -MP -MF $(DEPDIR)/nfcapd-nfcapd.Tpo -c -o nfcapd-nfcapd.o `test -f 'nfcapd.c' || echo '$(srcdir)/'`nfcapd.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nfcapd-nfcapd.Tpo $(DEPDIR)/nfcapd-nfcapd.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='nfcapd.c' object='nfcapd-nfcapd.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nfcapd_CFLAGS) $(CFLAGS) -c -o nfcapd-nfcapd.o `test -f 'nfcapd.c' || echo '$(srcdir)/'`nfcapd.c + +nfcapd-nfcapd.obj: nfcapd.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nfcapd_CFLAGS) $(CFLAGS) -MT nfcapd-nfcapd.obj -MD -MP -MF $(DEPDIR)/nfcapd-nfcapd.Tpo -c -o nfcapd-nfcapd.obj `if test -f 'nfcapd.c'; then $(CYGPATH_W) 'nfcapd.c'; else $(CYGPATH_W) '$(srcdir)/nfcapd.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nfcapd-nfcapd.Tpo $(DEPDIR)/nfcapd-nfcapd.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='nfcapd.c' object='nfcapd-nfcapd.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nfcapd_CFLAGS) $(CFLAGS) -c -o nfcapd-nfcapd.obj `if test -f 'nfcapd.c'; then $(CYGPATH_W) 'nfcapd.c'; else $(CYGPATH_W) '$(srcdir)/nfcapd.c'; fi` + +nfcapd-nf_common.o: nf_common.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nfcapd_CFLAGS) $(CFLAGS) -MT nfcapd-nf_common.o -MD -MP -MF $(DEPDIR)/nfcapd-nf_common.Tpo -c -o nfcapd-nf_common.o `test -f 'nf_common.c' || echo '$(srcdir)/'`nf_common.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nfcapd-nf_common.Tpo $(DEPDIR)/nfcapd-nf_common.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='nf_common.c' object='nfcapd-nf_common.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nfcapd_CFLAGS) $(CFLAGS) -c -o nfcapd-nf_common.o `test -f 'nf_common.c' || echo '$(srcdir)/'`nf_common.c + +nfcapd-nf_common.obj: nf_common.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nfcapd_CFLAGS) $(CFLAGS) -MT nfcapd-nf_common.obj -MD -MP -MF $(DEPDIR)/nfcapd-nf_common.Tpo -c -o nfcapd-nf_common.obj `if test -f 'nf_common.c'; then $(CYGPATH_W) 'nf_common.c'; else $(CYGPATH_W) '$(srcdir)/nf_common.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nfcapd-nf_common.Tpo $(DEPDIR)/nfcapd-nf_common.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='nf_common.c' object='nfcapd-nf_common.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nfcapd_CFLAGS) $(CFLAGS) -c -o nfcapd-nf_common.obj `if test -f 'nf_common.c'; then $(CYGPATH_W) 'nf_common.c'; else $(CYGPATH_W) '$(srcdir)/nf_common.c'; fi` + +nfcapd-util.o: util.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nfcapd_CFLAGS) $(CFLAGS) -MT nfcapd-util.o -MD -MP -MF $(DEPDIR)/nfcapd-util.Tpo -c -o nfcapd-util.o `test -f 'util.c' || echo '$(srcdir)/'`util.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nfcapd-util.Tpo $(DEPDIR)/nfcapd-util.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='util.c' object='nfcapd-util.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nfcapd_CFLAGS) $(CFLAGS) -c -o nfcapd-util.o `test -f 'util.c' || echo '$(srcdir)/'`util.c + +nfcapd-util.obj: util.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nfcapd_CFLAGS) $(CFLAGS) -MT nfcapd-util.obj -MD -MP -MF $(DEPDIR)/nfcapd-util.Tpo -c -o nfcapd-util.obj `if test -f 'util.c'; then $(CYGPATH_W) 'util.c'; else $(CYGPATH_W) '$(srcdir)/util.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nfcapd-util.Tpo $(DEPDIR)/nfcapd-util.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='util.c' object='nfcapd-util.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nfcapd_CFLAGS) $(CFLAGS) -c -o nfcapd-util.obj `if test -f 'util.c'; then $(CYGPATH_W) 'util.c'; else $(CYGPATH_W) '$(srcdir)/util.c'; fi` + +nfcapd-minilzo.o: minilzo.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nfcapd_CFLAGS) $(CFLAGS) -MT nfcapd-minilzo.o -MD -MP -MF $(DEPDIR)/nfcapd-minilzo.Tpo -c -o nfcapd-minilzo.o `test -f 'minilzo.c' || echo '$(srcdir)/'`minilzo.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nfcapd-minilzo.Tpo $(DEPDIR)/nfcapd-minilzo.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='minilzo.c' object='nfcapd-minilzo.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nfcapd_CFLAGS) $(CFLAGS) -c -o nfcapd-minilzo.o `test -f 'minilzo.c' || echo '$(srcdir)/'`minilzo.c + +nfcapd-minilzo.obj: minilzo.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nfcapd_CFLAGS) $(CFLAGS) -MT nfcapd-minilzo.obj -MD -MP -MF $(DEPDIR)/nfcapd-minilzo.Tpo -c -o nfcapd-minilzo.obj `if test -f 'minilzo.c'; then $(CYGPATH_W) 'minilzo.c'; else $(CYGPATH_W) '$(srcdir)/minilzo.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nfcapd-minilzo.Tpo $(DEPDIR)/nfcapd-minilzo.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='minilzo.c' object='nfcapd-minilzo.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nfcapd_CFLAGS) $(CFLAGS) -c -o nfcapd-minilzo.obj `if test -f 'minilzo.c'; then $(CYGPATH_W) 'minilzo.c'; else $(CYGPATH_W) '$(srcdir)/minilzo.c'; fi` + +nfcapd-nffile.o: nffile.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nfcapd_CFLAGS) $(CFLAGS) -MT nfcapd-nffile.o -MD -MP -MF $(DEPDIR)/nfcapd-nffile.Tpo -c -o nfcapd-nffile.o `test -f 'nffile.c' || echo '$(srcdir)/'`nffile.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nfcapd-nffile.Tpo $(DEPDIR)/nfcapd-nffile.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='nffile.c' object='nfcapd-nffile.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nfcapd_CFLAGS) $(CFLAGS) -c -o nfcapd-nffile.o `test -f 'nffile.c' || echo '$(srcdir)/'`nffile.c + +nfcapd-nffile.obj: nffile.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nfcapd_CFLAGS) $(CFLAGS) -MT nfcapd-nffile.obj -MD -MP -MF $(DEPDIR)/nfcapd-nffile.Tpo -c -o nfcapd-nffile.obj `if test -f 'nffile.c'; then $(CYGPATH_W) 'nffile.c'; else $(CYGPATH_W) '$(srcdir)/nffile.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nfcapd-nffile.Tpo $(DEPDIR)/nfcapd-nffile.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='nffile.c' object='nfcapd-nffile.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nfcapd_CFLAGS) $(CFLAGS) -c -o nfcapd-nffile.obj `if test -f 'nffile.c'; then $(CYGPATH_W) 'nffile.c'; else $(CYGPATH_W) '$(srcdir)/nffile.c'; fi` + +nfcapd-nfx.o: nfx.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nfcapd_CFLAGS) $(CFLAGS) -MT nfcapd-nfx.o -MD -MP -MF $(DEPDIR)/nfcapd-nfx.Tpo -c -o nfcapd-nfx.o `test -f 'nfx.c' || echo '$(srcdir)/'`nfx.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nfcapd-nfx.Tpo $(DEPDIR)/nfcapd-nfx.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='nfx.c' object='nfcapd-nfx.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nfcapd_CFLAGS) $(CFLAGS) -c -o nfcapd-nfx.o `test -f 'nfx.c' || echo '$(srcdir)/'`nfx.c + +nfcapd-nfx.obj: nfx.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nfcapd_CFLAGS) $(CFLAGS) -MT nfcapd-nfx.obj -MD -MP -MF $(DEPDIR)/nfcapd-nfx.Tpo -c -o nfcapd-nfx.obj `if test -f 'nfx.c'; then $(CYGPATH_W) 'nfx.c'; else $(CYGPATH_W) '$(srcdir)/nfx.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nfcapd-nfx.Tpo $(DEPDIR)/nfcapd-nfx.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='nfx.c' object='nfcapd-nfx.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nfcapd_CFLAGS) $(CFLAGS) -c -o nfcapd-nfx.obj `if test -f 'nfx.c'; then $(CYGPATH_W) 'nfx.c'; else $(CYGPATH_W) '$(srcdir)/nfx.c'; fi` + +nfcapd-nfxstat.o: nfxstat.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nfcapd_CFLAGS) $(CFLAGS) -MT nfcapd-nfxstat.o -MD -MP -MF $(DEPDIR)/nfcapd-nfxstat.Tpo -c -o nfcapd-nfxstat.o `test -f 'nfxstat.c' || echo '$(srcdir)/'`nfxstat.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nfcapd-nfxstat.Tpo $(DEPDIR)/nfcapd-nfxstat.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='nfxstat.c' object='nfcapd-nfxstat.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nfcapd_CFLAGS) $(CFLAGS) -c -o nfcapd-nfxstat.o `test -f 'nfxstat.c' || echo '$(srcdir)/'`nfxstat.c + +nfcapd-nfxstat.obj: nfxstat.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nfcapd_CFLAGS) $(CFLAGS) -MT nfcapd-nfxstat.obj -MD -MP -MF $(DEPDIR)/nfcapd-nfxstat.Tpo -c -o nfcapd-nfxstat.obj `if test -f 'nfxstat.c'; then $(CYGPATH_W) 'nfxstat.c'; else $(CYGPATH_W) '$(srcdir)/nfxstat.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nfcapd-nfxstat.Tpo $(DEPDIR)/nfcapd-nfxstat.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='nfxstat.c' object='nfcapd-nfxstat.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nfcapd_CFLAGS) $(CFLAGS) -c -o nfcapd-nfxstat.obj `if test -f 'nfxstat.c'; then $(CYGPATH_W) 'nfxstat.c'; else $(CYGPATH_W) '$(srcdir)/nfxstat.c'; fi` + +nfcapd-flist.o: flist.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nfcapd_CFLAGS) $(CFLAGS) -MT nfcapd-flist.o -MD -MP -MF $(DEPDIR)/nfcapd-flist.Tpo -c -o nfcapd-flist.o `test -f 'flist.c' || echo '$(srcdir)/'`flist.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nfcapd-flist.Tpo $(DEPDIR)/nfcapd-flist.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='flist.c' object='nfcapd-flist.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nfcapd_CFLAGS) $(CFLAGS) -c -o nfcapd-flist.o `test -f 'flist.c' || echo '$(srcdir)/'`flist.c + +nfcapd-flist.obj: flist.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nfcapd_CFLAGS) $(CFLAGS) -MT nfcapd-flist.obj -MD -MP -MF $(DEPDIR)/nfcapd-flist.Tpo -c -o nfcapd-flist.obj `if test -f 'flist.c'; then $(CYGPATH_W) 'flist.c'; else $(CYGPATH_W) '$(srcdir)/flist.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nfcapd-flist.Tpo $(DEPDIR)/nfcapd-flist.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='flist.c' object='nfcapd-flist.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nfcapd_CFLAGS) $(CFLAGS) -c -o nfcapd-flist.obj `if test -f 'flist.c'; then $(CYGPATH_W) 'flist.c'; else $(CYGPATH_W) '$(srcdir)/flist.c'; fi` + +nfcapd-fts_compat.o: fts_compat.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nfcapd_CFLAGS) $(CFLAGS) -MT nfcapd-fts_compat.o -MD -MP -MF $(DEPDIR)/nfcapd-fts_compat.Tpo -c -o nfcapd-fts_compat.o `test -f 'fts_compat.c' || echo '$(srcdir)/'`fts_compat.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nfcapd-fts_compat.Tpo $(DEPDIR)/nfcapd-fts_compat.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fts_compat.c' object='nfcapd-fts_compat.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nfcapd_CFLAGS) $(CFLAGS) -c -o nfcapd-fts_compat.o `test -f 'fts_compat.c' || echo '$(srcdir)/'`fts_compat.c + +nfcapd-fts_compat.obj: fts_compat.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nfcapd_CFLAGS) $(CFLAGS) -MT nfcapd-fts_compat.obj -MD -MP -MF $(DEPDIR)/nfcapd-fts_compat.Tpo -c -o nfcapd-fts_compat.obj `if test -f 'fts_compat.c'; then $(CYGPATH_W) 'fts_compat.c'; else $(CYGPATH_W) '$(srcdir)/fts_compat.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nfcapd-fts_compat.Tpo $(DEPDIR)/nfcapd-fts_compat.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fts_compat.c' object='nfcapd-fts_compat.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nfcapd_CFLAGS) $(CFLAGS) -c -o nfcapd-fts_compat.obj `if test -f 'fts_compat.c'; then $(CYGPATH_W) 'fts_compat.c'; else $(CYGPATH_W) '$(srcdir)/fts_compat.c'; fi` + +nfcapd-nfstatfile.o: nfstatfile.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nfcapd_CFLAGS) $(CFLAGS) -MT nfcapd-nfstatfile.o -MD -MP -MF $(DEPDIR)/nfcapd-nfstatfile.Tpo -c -o nfcapd-nfstatfile.o `test -f 'nfstatfile.c' || echo '$(srcdir)/'`nfstatfile.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nfcapd-nfstatfile.Tpo $(DEPDIR)/nfcapd-nfstatfile.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='nfstatfile.c' object='nfcapd-nfstatfile.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nfcapd_CFLAGS) $(CFLAGS) -c -o nfcapd-nfstatfile.o `test -f 'nfstatfile.c' || echo '$(srcdir)/'`nfstatfile.c + +nfcapd-nfstatfile.obj: nfstatfile.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nfcapd_CFLAGS) $(CFLAGS) -MT nfcapd-nfstatfile.obj -MD -MP -MF $(DEPDIR)/nfcapd-nfstatfile.Tpo -c -o nfcapd-nfstatfile.obj `if test -f 'nfstatfile.c'; then $(CYGPATH_W) 'nfstatfile.c'; else $(CYGPATH_W) '$(srcdir)/nfstatfile.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nfcapd-nfstatfile.Tpo $(DEPDIR)/nfcapd-nfstatfile.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='nfstatfile.c' object='nfcapd-nfstatfile.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nfcapd_CFLAGS) $(CFLAGS) -c -o nfcapd-nfstatfile.obj `if test -f 'nfstatfile.c'; then $(CYGPATH_W) 'nfstatfile.c'; else $(CYGPATH_W) '$(srcdir)/nfstatfile.c'; fi` + +nfcapd-launch.o: launch.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nfcapd_CFLAGS) $(CFLAGS) -MT nfcapd-launch.o -MD -MP -MF $(DEPDIR)/nfcapd-launch.Tpo -c -o nfcapd-launch.o `test -f 'launch.c' || echo '$(srcdir)/'`launch.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nfcapd-launch.Tpo $(DEPDIR)/nfcapd-launch.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='launch.c' object='nfcapd-launch.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nfcapd_CFLAGS) $(CFLAGS) -c -o nfcapd-launch.o `test -f 'launch.c' || echo '$(srcdir)/'`launch.c + +nfcapd-launch.obj: launch.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nfcapd_CFLAGS) $(CFLAGS) -MT nfcapd-launch.obj -MD -MP -MF $(DEPDIR)/nfcapd-launch.Tpo -c -o nfcapd-launch.obj `if test -f 'launch.c'; then $(CYGPATH_W) 'launch.c'; else $(CYGPATH_W) '$(srcdir)/launch.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nfcapd-launch.Tpo $(DEPDIR)/nfcapd-launch.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='launch.c' object='nfcapd-launch.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nfcapd_CFLAGS) $(CFLAGS) -c -o nfcapd-launch.obj `if test -f 'launch.c'; then $(CYGPATH_W) 'launch.c'; else $(CYGPATH_W) '$(srcdir)/launch.c'; fi` + +nfcapd-nfnet.o: nfnet.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nfcapd_CFLAGS) $(CFLAGS) -MT nfcapd-nfnet.o -MD -MP -MF $(DEPDIR)/nfcapd-nfnet.Tpo -c -o nfcapd-nfnet.o `test -f 'nfnet.c' || echo '$(srcdir)/'`nfnet.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nfcapd-nfnet.Tpo $(DEPDIR)/nfcapd-nfnet.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='nfnet.c' object='nfcapd-nfnet.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nfcapd_CFLAGS) $(CFLAGS) -c -o nfcapd-nfnet.o `test -f 'nfnet.c' || echo '$(srcdir)/'`nfnet.c + +nfcapd-nfnet.obj: nfnet.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nfcapd_CFLAGS) $(CFLAGS) -MT nfcapd-nfnet.obj -MD -MP -MF $(DEPDIR)/nfcapd-nfnet.Tpo -c -o nfcapd-nfnet.obj `if test -f 'nfnet.c'; then $(CYGPATH_W) 'nfnet.c'; else $(CYGPATH_W) '$(srcdir)/nfnet.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nfcapd-nfnet.Tpo $(DEPDIR)/nfcapd-nfnet.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='nfnet.c' object='nfcapd-nfnet.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nfcapd_CFLAGS) $(CFLAGS) -c -o nfcapd-nfnet.obj `if test -f 'nfnet.c'; then $(CYGPATH_W) 'nfnet.c'; else $(CYGPATH_W) '$(srcdir)/nfnet.c'; fi` + +nfcapd-collector.o: collector.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nfcapd_CFLAGS) $(CFLAGS) -MT nfcapd-collector.o -MD -MP -MF $(DEPDIR)/nfcapd-collector.Tpo -c -o nfcapd-collector.o `test -f 'collector.c' || echo '$(srcdir)/'`collector.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nfcapd-collector.Tpo $(DEPDIR)/nfcapd-collector.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='collector.c' object='nfcapd-collector.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nfcapd_CFLAGS) $(CFLAGS) -c -o nfcapd-collector.o `test -f 'collector.c' || echo '$(srcdir)/'`collector.c + +nfcapd-collector.obj: collector.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nfcapd_CFLAGS) $(CFLAGS) -MT nfcapd-collector.obj -MD -MP -MF $(DEPDIR)/nfcapd-collector.Tpo -c -o nfcapd-collector.obj `if test -f 'collector.c'; then $(CYGPATH_W) 'collector.c'; else $(CYGPATH_W) '$(srcdir)/collector.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nfcapd-collector.Tpo $(DEPDIR)/nfcapd-collector.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='collector.c' object='nfcapd-collector.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nfcapd_CFLAGS) $(CFLAGS) -c -o nfcapd-collector.obj `if test -f 'collector.c'; then $(CYGPATH_W) 'collector.c'; else $(CYGPATH_W) '$(srcdir)/collector.c'; fi` + +nfcapd-netflow_v1.o: netflow_v1.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nfcapd_CFLAGS) $(CFLAGS) -MT nfcapd-netflow_v1.o -MD -MP -MF $(DEPDIR)/nfcapd-netflow_v1.Tpo -c -o nfcapd-netflow_v1.o `test -f 'netflow_v1.c' || echo '$(srcdir)/'`netflow_v1.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nfcapd-netflow_v1.Tpo $(DEPDIR)/nfcapd-netflow_v1.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='netflow_v1.c' object='nfcapd-netflow_v1.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nfcapd_CFLAGS) $(CFLAGS) -c -o nfcapd-netflow_v1.o `test -f 'netflow_v1.c' || echo '$(srcdir)/'`netflow_v1.c + +nfcapd-netflow_v1.obj: netflow_v1.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nfcapd_CFLAGS) $(CFLAGS) -MT nfcapd-netflow_v1.obj -MD -MP -MF $(DEPDIR)/nfcapd-netflow_v1.Tpo -c -o nfcapd-netflow_v1.obj `if test -f 'netflow_v1.c'; then $(CYGPATH_W) 'netflow_v1.c'; else $(CYGPATH_W) '$(srcdir)/netflow_v1.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nfcapd-netflow_v1.Tpo $(DEPDIR)/nfcapd-netflow_v1.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='netflow_v1.c' object='nfcapd-netflow_v1.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nfcapd_CFLAGS) $(CFLAGS) -c -o nfcapd-netflow_v1.obj `if test -f 'netflow_v1.c'; then $(CYGPATH_W) 'netflow_v1.c'; else $(CYGPATH_W) '$(srcdir)/netflow_v1.c'; fi` + +nfcapd-netflow_v5_v7.o: netflow_v5_v7.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nfcapd_CFLAGS) $(CFLAGS) -MT nfcapd-netflow_v5_v7.o -MD -MP -MF $(DEPDIR)/nfcapd-netflow_v5_v7.Tpo -c -o nfcapd-netflow_v5_v7.o `test -f 'netflow_v5_v7.c' || echo '$(srcdir)/'`netflow_v5_v7.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nfcapd-netflow_v5_v7.Tpo $(DEPDIR)/nfcapd-netflow_v5_v7.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='netflow_v5_v7.c' object='nfcapd-netflow_v5_v7.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nfcapd_CFLAGS) $(CFLAGS) -c -o nfcapd-netflow_v5_v7.o `test -f 'netflow_v5_v7.c' || echo '$(srcdir)/'`netflow_v5_v7.c + +nfcapd-netflow_v5_v7.obj: netflow_v5_v7.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nfcapd_CFLAGS) $(CFLAGS) -MT nfcapd-netflow_v5_v7.obj -MD -MP -MF $(DEPDIR)/nfcapd-netflow_v5_v7.Tpo -c -o nfcapd-netflow_v5_v7.obj `if test -f 'netflow_v5_v7.c'; then $(CYGPATH_W) 'netflow_v5_v7.c'; else $(CYGPATH_W) '$(srcdir)/netflow_v5_v7.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nfcapd-netflow_v5_v7.Tpo $(DEPDIR)/nfcapd-netflow_v5_v7.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='netflow_v5_v7.c' object='nfcapd-netflow_v5_v7.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nfcapd_CFLAGS) $(CFLAGS) -c -o nfcapd-netflow_v5_v7.obj `if test -f 'netflow_v5_v7.c'; then $(CYGPATH_W) 'netflow_v5_v7.c'; else $(CYGPATH_W) '$(srcdir)/netflow_v5_v7.c'; fi` + +nfcapd-netflow_v9.o: netflow_v9.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nfcapd_CFLAGS) $(CFLAGS) -MT nfcapd-netflow_v9.o -MD -MP -MF $(DEPDIR)/nfcapd-netflow_v9.Tpo -c -o nfcapd-netflow_v9.o `test -f 'netflow_v9.c' || echo '$(srcdir)/'`netflow_v9.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nfcapd-netflow_v9.Tpo $(DEPDIR)/nfcapd-netflow_v9.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='netflow_v9.c' object='nfcapd-netflow_v9.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nfcapd_CFLAGS) $(CFLAGS) -c -o nfcapd-netflow_v9.o `test -f 'netflow_v9.c' || echo '$(srcdir)/'`netflow_v9.c + +nfcapd-netflow_v9.obj: netflow_v9.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nfcapd_CFLAGS) $(CFLAGS) -MT nfcapd-netflow_v9.obj -MD -MP -MF $(DEPDIR)/nfcapd-netflow_v9.Tpo -c -o nfcapd-netflow_v9.obj `if test -f 'netflow_v9.c'; then $(CYGPATH_W) 'netflow_v9.c'; else $(CYGPATH_W) '$(srcdir)/netflow_v9.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nfcapd-netflow_v9.Tpo $(DEPDIR)/nfcapd-netflow_v9.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='netflow_v9.c' object='nfcapd-netflow_v9.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nfcapd_CFLAGS) $(CFLAGS) -c -o nfcapd-netflow_v9.obj `if test -f 'netflow_v9.c'; then $(CYGPATH_W) 'netflow_v9.c'; else $(CYGPATH_W) '$(srcdir)/netflow_v9.c'; fi` + +nfcapd-ipfix.o: ipfix.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nfcapd_CFLAGS) $(CFLAGS) -MT nfcapd-ipfix.o -MD -MP -MF $(DEPDIR)/nfcapd-ipfix.Tpo -c -o nfcapd-ipfix.o `test -f 'ipfix.c' || echo '$(srcdir)/'`ipfix.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nfcapd-ipfix.Tpo $(DEPDIR)/nfcapd-ipfix.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ipfix.c' object='nfcapd-ipfix.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nfcapd_CFLAGS) $(CFLAGS) -c -o nfcapd-ipfix.o `test -f 'ipfix.c' || echo '$(srcdir)/'`ipfix.c + +nfcapd-ipfix.obj: ipfix.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nfcapd_CFLAGS) $(CFLAGS) -MT nfcapd-ipfix.obj -MD -MP -MF $(DEPDIR)/nfcapd-ipfix.Tpo -c -o nfcapd-ipfix.obj `if test -f 'ipfix.c'; then $(CYGPATH_W) 'ipfix.c'; else $(CYGPATH_W) '$(srcdir)/ipfix.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nfcapd-ipfix.Tpo $(DEPDIR)/nfcapd-ipfix.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ipfix.c' object='nfcapd-ipfix.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nfcapd_CFLAGS) $(CFLAGS) -c -o nfcapd-ipfix.obj `if test -f 'ipfix.c'; then $(CYGPATH_W) 'ipfix.c'; else $(CYGPATH_W) '$(srcdir)/ipfix.c'; fi` + +nfcapd-bookkeeper.o: bookkeeper.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nfcapd_CFLAGS) $(CFLAGS) -MT nfcapd-bookkeeper.o -MD -MP -MF $(DEPDIR)/nfcapd-bookkeeper.Tpo -c -o nfcapd-bookkeeper.o `test -f 'bookkeeper.c' || echo '$(srcdir)/'`bookkeeper.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nfcapd-bookkeeper.Tpo $(DEPDIR)/nfcapd-bookkeeper.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='bookkeeper.c' object='nfcapd-bookkeeper.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nfcapd_CFLAGS) $(CFLAGS) -c -o nfcapd-bookkeeper.o `test -f 'bookkeeper.c' || echo '$(srcdir)/'`bookkeeper.c + +nfcapd-bookkeeper.obj: bookkeeper.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nfcapd_CFLAGS) $(CFLAGS) -MT nfcapd-bookkeeper.obj -MD -MP -MF $(DEPDIR)/nfcapd-bookkeeper.Tpo -c -o nfcapd-bookkeeper.obj `if test -f 'bookkeeper.c'; then $(CYGPATH_W) 'bookkeeper.c'; else $(CYGPATH_W) '$(srcdir)/bookkeeper.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nfcapd-bookkeeper.Tpo $(DEPDIR)/nfcapd-bookkeeper.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='bookkeeper.c' object='nfcapd-bookkeeper.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nfcapd_CFLAGS) $(CFLAGS) -c -o nfcapd-bookkeeper.obj `if test -f 'bookkeeper.c'; then $(CYGPATH_W) 'bookkeeper.c'; else $(CYGPATH_W) '$(srcdir)/bookkeeper.c'; fi` + +nfcapd-expire.o: expire.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nfcapd_CFLAGS) $(CFLAGS) -MT nfcapd-expire.o -MD -MP -MF $(DEPDIR)/nfcapd-expire.Tpo -c -o nfcapd-expire.o `test -f 'expire.c' || echo '$(srcdir)/'`expire.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nfcapd-expire.Tpo $(DEPDIR)/nfcapd-expire.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='expire.c' object='nfcapd-expire.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nfcapd_CFLAGS) $(CFLAGS) -c -o nfcapd-expire.o `test -f 'expire.c' || echo '$(srcdir)/'`expire.c + +nfcapd-expire.obj: expire.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nfcapd_CFLAGS) $(CFLAGS) -MT nfcapd-expire.obj -MD -MP -MF $(DEPDIR)/nfcapd-expire.Tpo -c -o nfcapd-expire.obj `if test -f 'expire.c'; then $(CYGPATH_W) 'expire.c'; else $(CYGPATH_W) '$(srcdir)/expire.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nfcapd-expire.Tpo $(DEPDIR)/nfcapd-expire.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='expire.c' object='nfcapd-expire.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nfcapd_CFLAGS) $(CFLAGS) -c -o nfcapd-expire.obj `if test -f 'expire.c'; then $(CYGPATH_W) 'expire.c'; else $(CYGPATH_W) '$(srcdir)/expire.c'; fi` + +nfcapd-pcap_reader.o: pcap_reader.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nfcapd_CFLAGS) $(CFLAGS) -MT nfcapd-pcap_reader.o -MD -MP -MF $(DEPDIR)/nfcapd-pcap_reader.Tpo -c -o nfcapd-pcap_reader.o `test -f 'pcap_reader.c' || echo '$(srcdir)/'`pcap_reader.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nfcapd-pcap_reader.Tpo $(DEPDIR)/nfcapd-pcap_reader.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pcap_reader.c' object='nfcapd-pcap_reader.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nfcapd_CFLAGS) $(CFLAGS) -c -o nfcapd-pcap_reader.o `test -f 'pcap_reader.c' || echo '$(srcdir)/'`pcap_reader.c + +nfcapd-pcap_reader.obj: pcap_reader.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nfcapd_CFLAGS) $(CFLAGS) -MT nfcapd-pcap_reader.obj -MD -MP -MF $(DEPDIR)/nfcapd-pcap_reader.Tpo -c -o nfcapd-pcap_reader.obj `if test -f 'pcap_reader.c'; then $(CYGPATH_W) 'pcap_reader.c'; else $(CYGPATH_W) '$(srcdir)/pcap_reader.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nfcapd-pcap_reader.Tpo $(DEPDIR)/nfcapd-pcap_reader.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pcap_reader.c' object='nfcapd-pcap_reader.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nfcapd_CFLAGS) $(CFLAGS) -c -o nfcapd-pcap_reader.obj `if test -f 'pcap_reader.c'; then $(CYGPATH_W) 'pcap_reader.c'; else $(CYGPATH_W) '$(srcdir)/pcap_reader.c'; fi` + +nfpcapd-nfpcapd.o: nfpcapd.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nfpcapd_CFLAGS) $(CFLAGS) -MT nfpcapd-nfpcapd.o -MD -MP -MF $(DEPDIR)/nfpcapd-nfpcapd.Tpo -c -o nfpcapd-nfpcapd.o `test -f 'nfpcapd.c' || echo '$(srcdir)/'`nfpcapd.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nfpcapd-nfpcapd.Tpo $(DEPDIR)/nfpcapd-nfpcapd.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='nfpcapd.c' object='nfpcapd-nfpcapd.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nfpcapd_CFLAGS) $(CFLAGS) -c -o nfpcapd-nfpcapd.o `test -f 'nfpcapd.c' || echo '$(srcdir)/'`nfpcapd.c + +nfpcapd-nfpcapd.obj: nfpcapd.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nfpcapd_CFLAGS) $(CFLAGS) -MT nfpcapd-nfpcapd.obj -MD -MP -MF $(DEPDIR)/nfpcapd-nfpcapd.Tpo -c -o nfpcapd-nfpcapd.obj `if test -f 'nfpcapd.c'; then $(CYGPATH_W) 'nfpcapd.c'; else $(CYGPATH_W) '$(srcdir)/nfpcapd.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nfpcapd-nfpcapd.Tpo $(DEPDIR)/nfpcapd-nfpcapd.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='nfpcapd.c' object='nfpcapd-nfpcapd.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nfpcapd_CFLAGS) $(CFLAGS) -c -o nfpcapd-nfpcapd.obj `if test -f 'nfpcapd.c'; then $(CYGPATH_W) 'nfpcapd.c'; else $(CYGPATH_W) '$(srcdir)/nfpcapd.c'; fi` + +nfpcapd-pcaproc.o: pcaproc.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nfpcapd_CFLAGS) $(CFLAGS) -MT nfpcapd-pcaproc.o -MD -MP -MF $(DEPDIR)/nfpcapd-pcaproc.Tpo -c -o nfpcapd-pcaproc.o `test -f 'pcaproc.c' || echo '$(srcdir)/'`pcaproc.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nfpcapd-pcaproc.Tpo $(DEPDIR)/nfpcapd-pcaproc.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pcaproc.c' object='nfpcapd-pcaproc.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nfpcapd_CFLAGS) $(CFLAGS) -c -o nfpcapd-pcaproc.o `test -f 'pcaproc.c' || echo '$(srcdir)/'`pcaproc.c + +nfpcapd-pcaproc.obj: pcaproc.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nfpcapd_CFLAGS) $(CFLAGS) -MT nfpcapd-pcaproc.obj -MD -MP -MF $(DEPDIR)/nfpcapd-pcaproc.Tpo -c -o nfpcapd-pcaproc.obj `if test -f 'pcaproc.c'; then $(CYGPATH_W) 'pcaproc.c'; else $(CYGPATH_W) '$(srcdir)/pcaproc.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nfpcapd-pcaproc.Tpo $(DEPDIR)/nfpcapd-pcaproc.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pcaproc.c' object='nfpcapd-pcaproc.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nfpcapd_CFLAGS) $(CFLAGS) -c -o nfpcapd-pcaproc.obj `if test -f 'pcaproc.c'; then $(CYGPATH_W) 'pcaproc.c'; else $(CYGPATH_W) '$(srcdir)/pcaproc.c'; fi` + +nfpcapd-flowtree.o: flowtree.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nfpcapd_CFLAGS) $(CFLAGS) -MT nfpcapd-flowtree.o -MD -MP -MF $(DEPDIR)/nfpcapd-flowtree.Tpo -c -o nfpcapd-flowtree.o `test -f 'flowtree.c' || echo '$(srcdir)/'`flowtree.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nfpcapd-flowtree.Tpo $(DEPDIR)/nfpcapd-flowtree.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='flowtree.c' object='nfpcapd-flowtree.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nfpcapd_CFLAGS) $(CFLAGS) -c -o nfpcapd-flowtree.o `test -f 'flowtree.c' || echo '$(srcdir)/'`flowtree.c + +nfpcapd-flowtree.obj: flowtree.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nfpcapd_CFLAGS) $(CFLAGS) -MT nfpcapd-flowtree.obj -MD -MP -MF $(DEPDIR)/nfpcapd-flowtree.Tpo -c -o nfpcapd-flowtree.obj `if test -f 'flowtree.c'; then $(CYGPATH_W) 'flowtree.c'; else $(CYGPATH_W) '$(srcdir)/flowtree.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nfpcapd-flowtree.Tpo $(DEPDIR)/nfpcapd-flowtree.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='flowtree.c' object='nfpcapd-flowtree.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nfpcapd_CFLAGS) $(CFLAGS) -c -o nfpcapd-flowtree.obj `if test -f 'flowtree.c'; then $(CYGPATH_W) 'flowtree.c'; else $(CYGPATH_W) '$(srcdir)/flowtree.c'; fi` + +nfpcapd-ipfrag.o: ipfrag.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nfpcapd_CFLAGS) $(CFLAGS) -MT nfpcapd-ipfrag.o -MD -MP -MF $(DEPDIR)/nfpcapd-ipfrag.Tpo -c -o nfpcapd-ipfrag.o `test -f 'ipfrag.c' || echo '$(srcdir)/'`ipfrag.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nfpcapd-ipfrag.Tpo $(DEPDIR)/nfpcapd-ipfrag.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ipfrag.c' object='nfpcapd-ipfrag.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nfpcapd_CFLAGS) $(CFLAGS) -c -o nfpcapd-ipfrag.o `test -f 'ipfrag.c' || echo '$(srcdir)/'`ipfrag.c + +nfpcapd-ipfrag.obj: ipfrag.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nfpcapd_CFLAGS) $(CFLAGS) -MT nfpcapd-ipfrag.obj -MD -MP -MF $(DEPDIR)/nfpcapd-ipfrag.Tpo -c -o nfpcapd-ipfrag.obj `if test -f 'ipfrag.c'; then $(CYGPATH_W) 'ipfrag.c'; else $(CYGPATH_W) '$(srcdir)/ipfrag.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nfpcapd-ipfrag.Tpo $(DEPDIR)/nfpcapd-ipfrag.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ipfrag.c' object='nfpcapd-ipfrag.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nfpcapd_CFLAGS) $(CFLAGS) -c -o nfpcapd-ipfrag.obj `if test -f 'ipfrag.c'; then $(CYGPATH_W) 'ipfrag.c'; else $(CYGPATH_W) '$(srcdir)/ipfrag.c'; fi` + +nfpcapd-netflow_pcap.o: netflow_pcap.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nfpcapd_CFLAGS) $(CFLAGS) -MT nfpcapd-netflow_pcap.o -MD -MP -MF $(DEPDIR)/nfpcapd-netflow_pcap.Tpo -c -o nfpcapd-netflow_pcap.o `test -f 'netflow_pcap.c' || echo '$(srcdir)/'`netflow_pcap.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nfpcapd-netflow_pcap.Tpo $(DEPDIR)/nfpcapd-netflow_pcap.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='netflow_pcap.c' object='nfpcapd-netflow_pcap.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nfpcapd_CFLAGS) $(CFLAGS) -c -o nfpcapd-netflow_pcap.o `test -f 'netflow_pcap.c' || echo '$(srcdir)/'`netflow_pcap.c + +nfpcapd-netflow_pcap.obj: netflow_pcap.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nfpcapd_CFLAGS) $(CFLAGS) -MT nfpcapd-netflow_pcap.obj -MD -MP -MF $(DEPDIR)/nfpcapd-netflow_pcap.Tpo -c -o nfpcapd-netflow_pcap.obj `if test -f 'netflow_pcap.c'; then $(CYGPATH_W) 'netflow_pcap.c'; else $(CYGPATH_W) '$(srcdir)/netflow_pcap.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nfpcapd-netflow_pcap.Tpo $(DEPDIR)/nfpcapd-netflow_pcap.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='netflow_pcap.c' object='nfpcapd-netflow_pcap.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nfpcapd_CFLAGS) $(CFLAGS) -c -o nfpcapd-netflow_pcap.obj `if test -f 'netflow_pcap.c'; then $(CYGPATH_W) 'netflow_pcap.c'; else $(CYGPATH_W) '$(srcdir)/netflow_pcap.c'; fi` + +nfpcapd-nf_common.o: nf_common.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nfpcapd_CFLAGS) $(CFLAGS) -MT nfpcapd-nf_common.o -MD -MP -MF $(DEPDIR)/nfpcapd-nf_common.Tpo -c -o nfpcapd-nf_common.o `test -f 'nf_common.c' || echo '$(srcdir)/'`nf_common.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nfpcapd-nf_common.Tpo $(DEPDIR)/nfpcapd-nf_common.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='nf_common.c' object='nfpcapd-nf_common.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nfpcapd_CFLAGS) $(CFLAGS) -c -o nfpcapd-nf_common.o `test -f 'nf_common.c' || echo '$(srcdir)/'`nf_common.c + +nfpcapd-nf_common.obj: nf_common.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nfpcapd_CFLAGS) $(CFLAGS) -MT nfpcapd-nf_common.obj -MD -MP -MF $(DEPDIR)/nfpcapd-nf_common.Tpo -c -o nfpcapd-nf_common.obj `if test -f 'nf_common.c'; then $(CYGPATH_W) 'nf_common.c'; else $(CYGPATH_W) '$(srcdir)/nf_common.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nfpcapd-nf_common.Tpo $(DEPDIR)/nfpcapd-nf_common.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='nf_common.c' object='nfpcapd-nf_common.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nfpcapd_CFLAGS) $(CFLAGS) -c -o nfpcapd-nf_common.obj `if test -f 'nf_common.c'; then $(CYGPATH_W) 'nf_common.c'; else $(CYGPATH_W) '$(srcdir)/nf_common.c'; fi` + +nfpcapd-util.o: util.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nfpcapd_CFLAGS) $(CFLAGS) -MT nfpcapd-util.o -MD -MP -MF $(DEPDIR)/nfpcapd-util.Tpo -c -o nfpcapd-util.o `test -f 'util.c' || echo '$(srcdir)/'`util.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nfpcapd-util.Tpo $(DEPDIR)/nfpcapd-util.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='util.c' object='nfpcapd-util.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nfpcapd_CFLAGS) $(CFLAGS) -c -o nfpcapd-util.o `test -f 'util.c' || echo '$(srcdir)/'`util.c + +nfpcapd-util.obj: util.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nfpcapd_CFLAGS) $(CFLAGS) -MT nfpcapd-util.obj -MD -MP -MF $(DEPDIR)/nfpcapd-util.Tpo -c -o nfpcapd-util.obj `if test -f 'util.c'; then $(CYGPATH_W) 'util.c'; else $(CYGPATH_W) '$(srcdir)/util.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nfpcapd-util.Tpo $(DEPDIR)/nfpcapd-util.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='util.c' object='nfpcapd-util.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nfpcapd_CFLAGS) $(CFLAGS) -c -o nfpcapd-util.obj `if test -f 'util.c'; then $(CYGPATH_W) 'util.c'; else $(CYGPATH_W) '$(srcdir)/util.c'; fi` + +nfpcapd-minilzo.o: minilzo.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nfpcapd_CFLAGS) $(CFLAGS) -MT nfpcapd-minilzo.o -MD -MP -MF $(DEPDIR)/nfpcapd-minilzo.Tpo -c -o nfpcapd-minilzo.o `test -f 'minilzo.c' || echo '$(srcdir)/'`minilzo.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nfpcapd-minilzo.Tpo $(DEPDIR)/nfpcapd-minilzo.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='minilzo.c' object='nfpcapd-minilzo.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nfpcapd_CFLAGS) $(CFLAGS) -c -o nfpcapd-minilzo.o `test -f 'minilzo.c' || echo '$(srcdir)/'`minilzo.c + +nfpcapd-minilzo.obj: minilzo.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nfpcapd_CFLAGS) $(CFLAGS) -MT nfpcapd-minilzo.obj -MD -MP -MF $(DEPDIR)/nfpcapd-minilzo.Tpo -c -o nfpcapd-minilzo.obj `if test -f 'minilzo.c'; then $(CYGPATH_W) 'minilzo.c'; else $(CYGPATH_W) '$(srcdir)/minilzo.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nfpcapd-minilzo.Tpo $(DEPDIR)/nfpcapd-minilzo.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='minilzo.c' object='nfpcapd-minilzo.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nfpcapd_CFLAGS) $(CFLAGS) -c -o nfpcapd-minilzo.obj `if test -f 'minilzo.c'; then $(CYGPATH_W) 'minilzo.c'; else $(CYGPATH_W) '$(srcdir)/minilzo.c'; fi` + +nfpcapd-nffile.o: nffile.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nfpcapd_CFLAGS) $(CFLAGS) -MT nfpcapd-nffile.o -MD -MP -MF $(DEPDIR)/nfpcapd-nffile.Tpo -c -o nfpcapd-nffile.o `test -f 'nffile.c' || echo '$(srcdir)/'`nffile.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nfpcapd-nffile.Tpo $(DEPDIR)/nfpcapd-nffile.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='nffile.c' object='nfpcapd-nffile.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nfpcapd_CFLAGS) $(CFLAGS) -c -o nfpcapd-nffile.o `test -f 'nffile.c' || echo '$(srcdir)/'`nffile.c + +nfpcapd-nffile.obj: nffile.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nfpcapd_CFLAGS) $(CFLAGS) -MT nfpcapd-nffile.obj -MD -MP -MF $(DEPDIR)/nfpcapd-nffile.Tpo -c -o nfpcapd-nffile.obj `if test -f 'nffile.c'; then $(CYGPATH_W) 'nffile.c'; else $(CYGPATH_W) '$(srcdir)/nffile.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nfpcapd-nffile.Tpo $(DEPDIR)/nfpcapd-nffile.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='nffile.c' object='nfpcapd-nffile.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nfpcapd_CFLAGS) $(CFLAGS) -c -o nfpcapd-nffile.obj `if test -f 'nffile.c'; then $(CYGPATH_W) 'nffile.c'; else $(CYGPATH_W) '$(srcdir)/nffile.c'; fi` + +nfpcapd-nfx.o: nfx.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nfpcapd_CFLAGS) $(CFLAGS) -MT nfpcapd-nfx.o -MD -MP -MF $(DEPDIR)/nfpcapd-nfx.Tpo -c -o nfpcapd-nfx.o `test -f 'nfx.c' || echo '$(srcdir)/'`nfx.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nfpcapd-nfx.Tpo $(DEPDIR)/nfpcapd-nfx.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='nfx.c' object='nfpcapd-nfx.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nfpcapd_CFLAGS) $(CFLAGS) -c -o nfpcapd-nfx.o `test -f 'nfx.c' || echo '$(srcdir)/'`nfx.c + +nfpcapd-nfx.obj: nfx.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nfpcapd_CFLAGS) $(CFLAGS) -MT nfpcapd-nfx.obj -MD -MP -MF $(DEPDIR)/nfpcapd-nfx.Tpo -c -o nfpcapd-nfx.obj `if test -f 'nfx.c'; then $(CYGPATH_W) 'nfx.c'; else $(CYGPATH_W) '$(srcdir)/nfx.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nfpcapd-nfx.Tpo $(DEPDIR)/nfpcapd-nfx.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='nfx.c' object='nfpcapd-nfx.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nfpcapd_CFLAGS) $(CFLAGS) -c -o nfpcapd-nfx.obj `if test -f 'nfx.c'; then $(CYGPATH_W) 'nfx.c'; else $(CYGPATH_W) '$(srcdir)/nfx.c'; fi` + +nfpcapd-nfxstat.o: nfxstat.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nfpcapd_CFLAGS) $(CFLAGS) -MT nfpcapd-nfxstat.o -MD -MP -MF $(DEPDIR)/nfpcapd-nfxstat.Tpo -c -o nfpcapd-nfxstat.o `test -f 'nfxstat.c' || echo '$(srcdir)/'`nfxstat.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nfpcapd-nfxstat.Tpo $(DEPDIR)/nfpcapd-nfxstat.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='nfxstat.c' object='nfpcapd-nfxstat.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nfpcapd_CFLAGS) $(CFLAGS) -c -o nfpcapd-nfxstat.o `test -f 'nfxstat.c' || echo '$(srcdir)/'`nfxstat.c + +nfpcapd-nfxstat.obj: nfxstat.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nfpcapd_CFLAGS) $(CFLAGS) -MT nfpcapd-nfxstat.obj -MD -MP -MF $(DEPDIR)/nfpcapd-nfxstat.Tpo -c -o nfpcapd-nfxstat.obj `if test -f 'nfxstat.c'; then $(CYGPATH_W) 'nfxstat.c'; else $(CYGPATH_W) '$(srcdir)/nfxstat.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nfpcapd-nfxstat.Tpo $(DEPDIR)/nfpcapd-nfxstat.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='nfxstat.c' object='nfpcapd-nfxstat.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nfpcapd_CFLAGS) $(CFLAGS) -c -o nfpcapd-nfxstat.obj `if test -f 'nfxstat.c'; then $(CYGPATH_W) 'nfxstat.c'; else $(CYGPATH_W) '$(srcdir)/nfxstat.c'; fi` + +nfpcapd-flist.o: flist.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nfpcapd_CFLAGS) $(CFLAGS) -MT nfpcapd-flist.o -MD -MP -MF $(DEPDIR)/nfpcapd-flist.Tpo -c -o nfpcapd-flist.o `test -f 'flist.c' || echo '$(srcdir)/'`flist.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nfpcapd-flist.Tpo $(DEPDIR)/nfpcapd-flist.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='flist.c' object='nfpcapd-flist.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nfpcapd_CFLAGS) $(CFLAGS) -c -o nfpcapd-flist.o `test -f 'flist.c' || echo '$(srcdir)/'`flist.c + +nfpcapd-flist.obj: flist.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nfpcapd_CFLAGS) $(CFLAGS) -MT nfpcapd-flist.obj -MD -MP -MF $(DEPDIR)/nfpcapd-flist.Tpo -c -o nfpcapd-flist.obj `if test -f 'flist.c'; then $(CYGPATH_W) 'flist.c'; else $(CYGPATH_W) '$(srcdir)/flist.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nfpcapd-flist.Tpo $(DEPDIR)/nfpcapd-flist.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='flist.c' object='nfpcapd-flist.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nfpcapd_CFLAGS) $(CFLAGS) -c -o nfpcapd-flist.obj `if test -f 'flist.c'; then $(CYGPATH_W) 'flist.c'; else $(CYGPATH_W) '$(srcdir)/flist.c'; fi` + +nfpcapd-fts_compat.o: fts_compat.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nfpcapd_CFLAGS) $(CFLAGS) -MT nfpcapd-fts_compat.o -MD -MP -MF $(DEPDIR)/nfpcapd-fts_compat.Tpo -c -o nfpcapd-fts_compat.o `test -f 'fts_compat.c' || echo '$(srcdir)/'`fts_compat.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nfpcapd-fts_compat.Tpo $(DEPDIR)/nfpcapd-fts_compat.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fts_compat.c' object='nfpcapd-fts_compat.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nfpcapd_CFLAGS) $(CFLAGS) -c -o nfpcapd-fts_compat.o `test -f 'fts_compat.c' || echo '$(srcdir)/'`fts_compat.c + +nfpcapd-fts_compat.obj: fts_compat.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nfpcapd_CFLAGS) $(CFLAGS) -MT nfpcapd-fts_compat.obj -MD -MP -MF $(DEPDIR)/nfpcapd-fts_compat.Tpo -c -o nfpcapd-fts_compat.obj `if test -f 'fts_compat.c'; then $(CYGPATH_W) 'fts_compat.c'; else $(CYGPATH_W) '$(srcdir)/fts_compat.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nfpcapd-fts_compat.Tpo $(DEPDIR)/nfpcapd-fts_compat.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fts_compat.c' object='nfpcapd-fts_compat.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nfpcapd_CFLAGS) $(CFLAGS) -c -o nfpcapd-fts_compat.obj `if test -f 'fts_compat.c'; then $(CYGPATH_W) 'fts_compat.c'; else $(CYGPATH_W) '$(srcdir)/fts_compat.c'; fi` + +nfpcapd-nfstatfile.o: nfstatfile.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nfpcapd_CFLAGS) $(CFLAGS) -MT nfpcapd-nfstatfile.o -MD -MP -MF $(DEPDIR)/nfpcapd-nfstatfile.Tpo -c -o nfpcapd-nfstatfile.o `test -f 'nfstatfile.c' || echo '$(srcdir)/'`nfstatfile.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nfpcapd-nfstatfile.Tpo $(DEPDIR)/nfpcapd-nfstatfile.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='nfstatfile.c' object='nfpcapd-nfstatfile.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nfpcapd_CFLAGS) $(CFLAGS) -c -o nfpcapd-nfstatfile.o `test -f 'nfstatfile.c' || echo '$(srcdir)/'`nfstatfile.c + +nfpcapd-nfstatfile.obj: nfstatfile.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nfpcapd_CFLAGS) $(CFLAGS) -MT nfpcapd-nfstatfile.obj -MD -MP -MF $(DEPDIR)/nfpcapd-nfstatfile.Tpo -c -o nfpcapd-nfstatfile.obj `if test -f 'nfstatfile.c'; then $(CYGPATH_W) 'nfstatfile.c'; else $(CYGPATH_W) '$(srcdir)/nfstatfile.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nfpcapd-nfstatfile.Tpo $(DEPDIR)/nfpcapd-nfstatfile.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='nfstatfile.c' object='nfpcapd-nfstatfile.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nfpcapd_CFLAGS) $(CFLAGS) -c -o nfpcapd-nfstatfile.obj `if test -f 'nfstatfile.c'; then $(CYGPATH_W) 'nfstatfile.c'; else $(CYGPATH_W) '$(srcdir)/nfstatfile.c'; fi` + +nfpcapd-launch.o: launch.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nfpcapd_CFLAGS) $(CFLAGS) -MT nfpcapd-launch.o -MD -MP -MF $(DEPDIR)/nfpcapd-launch.Tpo -c -o nfpcapd-launch.o `test -f 'launch.c' || echo '$(srcdir)/'`launch.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nfpcapd-launch.Tpo $(DEPDIR)/nfpcapd-launch.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='launch.c' object='nfpcapd-launch.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nfpcapd_CFLAGS) $(CFLAGS) -c -o nfpcapd-launch.o `test -f 'launch.c' || echo '$(srcdir)/'`launch.c + +nfpcapd-launch.obj: launch.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nfpcapd_CFLAGS) $(CFLAGS) -MT nfpcapd-launch.obj -MD -MP -MF $(DEPDIR)/nfpcapd-launch.Tpo -c -o nfpcapd-launch.obj `if test -f 'launch.c'; then $(CYGPATH_W) 'launch.c'; else $(CYGPATH_W) '$(srcdir)/launch.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nfpcapd-launch.Tpo $(DEPDIR)/nfpcapd-launch.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='launch.c' object='nfpcapd-launch.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nfpcapd_CFLAGS) $(CFLAGS) -c -o nfpcapd-launch.obj `if test -f 'launch.c'; then $(CYGPATH_W) 'launch.c'; else $(CYGPATH_W) '$(srcdir)/launch.c'; fi` + +nfpcapd-nfnet.o: nfnet.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nfpcapd_CFLAGS) $(CFLAGS) -MT nfpcapd-nfnet.o -MD -MP -MF $(DEPDIR)/nfpcapd-nfnet.Tpo -c -o nfpcapd-nfnet.o `test -f 'nfnet.c' || echo '$(srcdir)/'`nfnet.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nfpcapd-nfnet.Tpo $(DEPDIR)/nfpcapd-nfnet.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='nfnet.c' object='nfpcapd-nfnet.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nfpcapd_CFLAGS) $(CFLAGS) -c -o nfpcapd-nfnet.o `test -f 'nfnet.c' || echo '$(srcdir)/'`nfnet.c + +nfpcapd-nfnet.obj: nfnet.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nfpcapd_CFLAGS) $(CFLAGS) -MT nfpcapd-nfnet.obj -MD -MP -MF $(DEPDIR)/nfpcapd-nfnet.Tpo -c -o nfpcapd-nfnet.obj `if test -f 'nfnet.c'; then $(CYGPATH_W) 'nfnet.c'; else $(CYGPATH_W) '$(srcdir)/nfnet.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nfpcapd-nfnet.Tpo $(DEPDIR)/nfpcapd-nfnet.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='nfnet.c' object='nfpcapd-nfnet.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nfpcapd_CFLAGS) $(CFLAGS) -c -o nfpcapd-nfnet.obj `if test -f 'nfnet.c'; then $(CYGPATH_W) 'nfnet.c'; else $(CYGPATH_W) '$(srcdir)/nfnet.c'; fi` + +nfpcapd-collector.o: collector.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nfpcapd_CFLAGS) $(CFLAGS) -MT nfpcapd-collector.o -MD -MP -MF $(DEPDIR)/nfpcapd-collector.Tpo -c -o nfpcapd-collector.o `test -f 'collector.c' || echo '$(srcdir)/'`collector.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nfpcapd-collector.Tpo $(DEPDIR)/nfpcapd-collector.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='collector.c' object='nfpcapd-collector.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nfpcapd_CFLAGS) $(CFLAGS) -c -o nfpcapd-collector.o `test -f 'collector.c' || echo '$(srcdir)/'`collector.c + +nfpcapd-collector.obj: collector.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nfpcapd_CFLAGS) $(CFLAGS) -MT nfpcapd-collector.obj -MD -MP -MF $(DEPDIR)/nfpcapd-collector.Tpo -c -o nfpcapd-collector.obj `if test -f 'collector.c'; then $(CYGPATH_W) 'collector.c'; else $(CYGPATH_W) '$(srcdir)/collector.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nfpcapd-collector.Tpo $(DEPDIR)/nfpcapd-collector.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='collector.c' object='nfpcapd-collector.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nfpcapd_CFLAGS) $(CFLAGS) -c -o nfpcapd-collector.obj `if test -f 'collector.c'; then $(CYGPATH_W) 'collector.c'; else $(CYGPATH_W) '$(srcdir)/collector.c'; fi` + +nfpcapd-bookkeeper.o: bookkeeper.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nfpcapd_CFLAGS) $(CFLAGS) -MT nfpcapd-bookkeeper.o -MD -MP -MF $(DEPDIR)/nfpcapd-bookkeeper.Tpo -c -o nfpcapd-bookkeeper.o `test -f 'bookkeeper.c' || echo '$(srcdir)/'`bookkeeper.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nfpcapd-bookkeeper.Tpo $(DEPDIR)/nfpcapd-bookkeeper.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='bookkeeper.c' object='nfpcapd-bookkeeper.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nfpcapd_CFLAGS) $(CFLAGS) -c -o nfpcapd-bookkeeper.o `test -f 'bookkeeper.c' || echo '$(srcdir)/'`bookkeeper.c + +nfpcapd-bookkeeper.obj: bookkeeper.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nfpcapd_CFLAGS) $(CFLAGS) -MT nfpcapd-bookkeeper.obj -MD -MP -MF $(DEPDIR)/nfpcapd-bookkeeper.Tpo -c -o nfpcapd-bookkeeper.obj `if test -f 'bookkeeper.c'; then $(CYGPATH_W) 'bookkeeper.c'; else $(CYGPATH_W) '$(srcdir)/bookkeeper.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nfpcapd-bookkeeper.Tpo $(DEPDIR)/nfpcapd-bookkeeper.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='bookkeeper.c' object='nfpcapd-bookkeeper.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nfpcapd_CFLAGS) $(CFLAGS) -c -o nfpcapd-bookkeeper.obj `if test -f 'bookkeeper.c'; then $(CYGPATH_W) 'bookkeeper.c'; else $(CYGPATH_W) '$(srcdir)/bookkeeper.c'; fi` + +nfpcapd-expire.o: expire.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nfpcapd_CFLAGS) $(CFLAGS) -MT nfpcapd-expire.o -MD -MP -MF $(DEPDIR)/nfpcapd-expire.Tpo -c -o nfpcapd-expire.o `test -f 'expire.c' || echo '$(srcdir)/'`expire.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nfpcapd-expire.Tpo $(DEPDIR)/nfpcapd-expire.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='expire.c' object='nfpcapd-expire.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nfpcapd_CFLAGS) $(CFLAGS) -c -o nfpcapd-expire.o `test -f 'expire.c' || echo '$(srcdir)/'`expire.c + +nfpcapd-expire.obj: expire.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nfpcapd_CFLAGS) $(CFLAGS) -MT nfpcapd-expire.obj -MD -MP -MF $(DEPDIR)/nfpcapd-expire.Tpo -c -o nfpcapd-expire.obj `if test -f 'expire.c'; then $(CYGPATH_W) 'expire.c'; else $(CYGPATH_W) '$(srcdir)/expire.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nfpcapd-expire.Tpo $(DEPDIR)/nfpcapd-expire.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='expire.c' object='nfpcapd-expire.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nfpcapd_CFLAGS) $(CFLAGS) -c -o nfpcapd-expire.obj `if test -f 'expire.c'; then $(CYGPATH_W) 'expire.c'; else $(CYGPATH_W) '$(srcdir)/expire.c'; fi` + +nfpcapd-content_dns.o: content_dns.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nfpcapd_CFLAGS) $(CFLAGS) -MT nfpcapd-content_dns.o -MD -MP -MF $(DEPDIR)/nfpcapd-content_dns.Tpo -c -o nfpcapd-content_dns.o `test -f 'content_dns.c' || echo '$(srcdir)/'`content_dns.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nfpcapd-content_dns.Tpo $(DEPDIR)/nfpcapd-content_dns.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='content_dns.c' object='nfpcapd-content_dns.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nfpcapd_CFLAGS) $(CFLAGS) -c -o nfpcapd-content_dns.o `test -f 'content_dns.c' || echo '$(srcdir)/'`content_dns.c + +nfpcapd-content_dns.obj: content_dns.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nfpcapd_CFLAGS) $(CFLAGS) -MT nfpcapd-content_dns.obj -MD -MP -MF $(DEPDIR)/nfpcapd-content_dns.Tpo -c -o nfpcapd-content_dns.obj `if test -f 'content_dns.c'; then $(CYGPATH_W) 'content_dns.c'; else $(CYGPATH_W) '$(srcdir)/content_dns.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nfpcapd-content_dns.Tpo $(DEPDIR)/nfpcapd-content_dns.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='content_dns.c' object='nfpcapd-content_dns.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nfpcapd_CFLAGS) $(CFLAGS) -c -o nfpcapd-content_dns.obj `if test -f 'content_dns.c'; then $(CYGPATH_W) 'content_dns.c'; else $(CYGPATH_W) '$(srcdir)/content_dns.c'; fi` + +../extra/nftrack/nftrack-nftrack.o: ../extra/nftrack/nftrack.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nftrack_CFLAGS) $(CFLAGS) -MT ../extra/nftrack/nftrack-nftrack.o -MD -MP -MF ../extra/nftrack/$(DEPDIR)/nftrack-nftrack.Tpo -c -o ../extra/nftrack/nftrack-nftrack.o `test -f '../extra/nftrack/nftrack.c' || echo '$(srcdir)/'`../extra/nftrack/nftrack.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../extra/nftrack/$(DEPDIR)/nftrack-nftrack.Tpo ../extra/nftrack/$(DEPDIR)/nftrack-nftrack.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../extra/nftrack/nftrack.c' object='../extra/nftrack/nftrack-nftrack.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nftrack_CFLAGS) $(CFLAGS) -c -o ../extra/nftrack/nftrack-nftrack.o `test -f '../extra/nftrack/nftrack.c' || echo '$(srcdir)/'`../extra/nftrack/nftrack.c + +../extra/nftrack/nftrack-nftrack.obj: ../extra/nftrack/nftrack.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nftrack_CFLAGS) $(CFLAGS) -MT ../extra/nftrack/nftrack-nftrack.obj -MD -MP -MF ../extra/nftrack/$(DEPDIR)/nftrack-nftrack.Tpo -c -o ../extra/nftrack/nftrack-nftrack.obj `if test -f '../extra/nftrack/nftrack.c'; then $(CYGPATH_W) '../extra/nftrack/nftrack.c'; else $(CYGPATH_W) '$(srcdir)/../extra/nftrack/nftrack.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../extra/nftrack/$(DEPDIR)/nftrack-nftrack.Tpo ../extra/nftrack/$(DEPDIR)/nftrack-nftrack.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../extra/nftrack/nftrack.c' object='../extra/nftrack/nftrack-nftrack.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nftrack_CFLAGS) $(CFLAGS) -c -o ../extra/nftrack/nftrack-nftrack.obj `if test -f '../extra/nftrack/nftrack.c'; then $(CYGPATH_W) '../extra/nftrack/nftrack.c'; else $(CYGPATH_W) '$(srcdir)/../extra/nftrack/nftrack.c'; fi` + +../extra/nftrack/nftrack-nftrack_rrd.o: ../extra/nftrack/nftrack_rrd.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nftrack_CFLAGS) $(CFLAGS) -MT ../extra/nftrack/nftrack-nftrack_rrd.o -MD -MP -MF ../extra/nftrack/$(DEPDIR)/nftrack-nftrack_rrd.Tpo -c -o ../extra/nftrack/nftrack-nftrack_rrd.o `test -f '../extra/nftrack/nftrack_rrd.c' || echo '$(srcdir)/'`../extra/nftrack/nftrack_rrd.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../extra/nftrack/$(DEPDIR)/nftrack-nftrack_rrd.Tpo ../extra/nftrack/$(DEPDIR)/nftrack-nftrack_rrd.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../extra/nftrack/nftrack_rrd.c' object='../extra/nftrack/nftrack-nftrack_rrd.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nftrack_CFLAGS) $(CFLAGS) -c -o ../extra/nftrack/nftrack-nftrack_rrd.o `test -f '../extra/nftrack/nftrack_rrd.c' || echo '$(srcdir)/'`../extra/nftrack/nftrack_rrd.c + +../extra/nftrack/nftrack-nftrack_rrd.obj: ../extra/nftrack/nftrack_rrd.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nftrack_CFLAGS) $(CFLAGS) -MT ../extra/nftrack/nftrack-nftrack_rrd.obj -MD -MP -MF ../extra/nftrack/$(DEPDIR)/nftrack-nftrack_rrd.Tpo -c -o ../extra/nftrack/nftrack-nftrack_rrd.obj `if test -f '../extra/nftrack/nftrack_rrd.c'; then $(CYGPATH_W) '../extra/nftrack/nftrack_rrd.c'; else $(CYGPATH_W) '$(srcdir)/../extra/nftrack/nftrack_rrd.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../extra/nftrack/$(DEPDIR)/nftrack-nftrack_rrd.Tpo ../extra/nftrack/$(DEPDIR)/nftrack-nftrack_rrd.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../extra/nftrack/nftrack_rrd.c' object='../extra/nftrack/nftrack-nftrack_rrd.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nftrack_CFLAGS) $(CFLAGS) -c -o ../extra/nftrack/nftrack-nftrack_rrd.obj `if test -f '../extra/nftrack/nftrack_rrd.c'; then $(CYGPATH_W) '../extra/nftrack/nftrack_rrd.c'; else $(CYGPATH_W) '$(srcdir)/../extra/nftrack/nftrack_rrd.c'; fi` + +../extra/nftrack/nftrack-nftrack_stat.o: ../extra/nftrack/nftrack_stat.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nftrack_CFLAGS) $(CFLAGS) -MT ../extra/nftrack/nftrack-nftrack_stat.o -MD -MP -MF ../extra/nftrack/$(DEPDIR)/nftrack-nftrack_stat.Tpo -c -o ../extra/nftrack/nftrack-nftrack_stat.o `test -f '../extra/nftrack/nftrack_stat.c' || echo '$(srcdir)/'`../extra/nftrack/nftrack_stat.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../extra/nftrack/$(DEPDIR)/nftrack-nftrack_stat.Tpo ../extra/nftrack/$(DEPDIR)/nftrack-nftrack_stat.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../extra/nftrack/nftrack_stat.c' object='../extra/nftrack/nftrack-nftrack_stat.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nftrack_CFLAGS) $(CFLAGS) -c -o ../extra/nftrack/nftrack-nftrack_stat.o `test -f '../extra/nftrack/nftrack_stat.c' || echo '$(srcdir)/'`../extra/nftrack/nftrack_stat.c + +../extra/nftrack/nftrack-nftrack_stat.obj: ../extra/nftrack/nftrack_stat.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nftrack_CFLAGS) $(CFLAGS) -MT ../extra/nftrack/nftrack-nftrack_stat.obj -MD -MP -MF ../extra/nftrack/$(DEPDIR)/nftrack-nftrack_stat.Tpo -c -o ../extra/nftrack/nftrack-nftrack_stat.obj `if test -f '../extra/nftrack/nftrack_stat.c'; then $(CYGPATH_W) '../extra/nftrack/nftrack_stat.c'; else $(CYGPATH_W) '$(srcdir)/../extra/nftrack/nftrack_stat.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../extra/nftrack/$(DEPDIR)/nftrack-nftrack_stat.Tpo ../extra/nftrack/$(DEPDIR)/nftrack-nftrack_stat.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../extra/nftrack/nftrack_stat.c' object='../extra/nftrack/nftrack-nftrack_stat.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nftrack_CFLAGS) $(CFLAGS) -c -o ../extra/nftrack/nftrack-nftrack_stat.obj `if test -f '../extra/nftrack/nftrack_stat.c'; then $(CYGPATH_W) '../extra/nftrack/nftrack_stat.c'; else $(CYGPATH_W) '$(srcdir)/../extra/nftrack/nftrack_stat.c'; fi` + +nftrack-nf_common.o: nf_common.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nftrack_CFLAGS) $(CFLAGS) -MT nftrack-nf_common.o -MD -MP -MF $(DEPDIR)/nftrack-nf_common.Tpo -c -o nftrack-nf_common.o `test -f 'nf_common.c' || echo '$(srcdir)/'`nf_common.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nftrack-nf_common.Tpo $(DEPDIR)/nftrack-nf_common.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='nf_common.c' object='nftrack-nf_common.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nftrack_CFLAGS) $(CFLAGS) -c -o nftrack-nf_common.o `test -f 'nf_common.c' || echo '$(srcdir)/'`nf_common.c + +nftrack-nf_common.obj: nf_common.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nftrack_CFLAGS) $(CFLAGS) -MT nftrack-nf_common.obj -MD -MP -MF $(DEPDIR)/nftrack-nf_common.Tpo -c -o nftrack-nf_common.obj `if test -f 'nf_common.c'; then $(CYGPATH_W) 'nf_common.c'; else $(CYGPATH_W) '$(srcdir)/nf_common.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nftrack-nf_common.Tpo $(DEPDIR)/nftrack-nf_common.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='nf_common.c' object='nftrack-nf_common.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nftrack_CFLAGS) $(CFLAGS) -c -o nftrack-nf_common.obj `if test -f 'nf_common.c'; then $(CYGPATH_W) 'nf_common.c'; else $(CYGPATH_W) '$(srcdir)/nf_common.c'; fi` + +nftrack-util.o: util.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nftrack_CFLAGS) $(CFLAGS) -MT nftrack-util.o -MD -MP -MF $(DEPDIR)/nftrack-util.Tpo -c -o nftrack-util.o `test -f 'util.c' || echo '$(srcdir)/'`util.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nftrack-util.Tpo $(DEPDIR)/nftrack-util.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='util.c' object='nftrack-util.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nftrack_CFLAGS) $(CFLAGS) -c -o nftrack-util.o `test -f 'util.c' || echo '$(srcdir)/'`util.c + +nftrack-util.obj: util.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nftrack_CFLAGS) $(CFLAGS) -MT nftrack-util.obj -MD -MP -MF $(DEPDIR)/nftrack-util.Tpo -c -o nftrack-util.obj `if test -f 'util.c'; then $(CYGPATH_W) 'util.c'; else $(CYGPATH_W) '$(srcdir)/util.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nftrack-util.Tpo $(DEPDIR)/nftrack-util.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='util.c' object='nftrack-util.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nftrack_CFLAGS) $(CFLAGS) -c -o nftrack-util.obj `if test -f 'util.c'; then $(CYGPATH_W) 'util.c'; else $(CYGPATH_W) '$(srcdir)/util.c'; fi` + +nftrack-minilzo.o: minilzo.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nftrack_CFLAGS) $(CFLAGS) -MT nftrack-minilzo.o -MD -MP -MF $(DEPDIR)/nftrack-minilzo.Tpo -c -o nftrack-minilzo.o `test -f 'minilzo.c' || echo '$(srcdir)/'`minilzo.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nftrack-minilzo.Tpo $(DEPDIR)/nftrack-minilzo.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='minilzo.c' object='nftrack-minilzo.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nftrack_CFLAGS) $(CFLAGS) -c -o nftrack-minilzo.o `test -f 'minilzo.c' || echo '$(srcdir)/'`minilzo.c + +nftrack-minilzo.obj: minilzo.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nftrack_CFLAGS) $(CFLAGS) -MT nftrack-minilzo.obj -MD -MP -MF $(DEPDIR)/nftrack-minilzo.Tpo -c -o nftrack-minilzo.obj `if test -f 'minilzo.c'; then $(CYGPATH_W) 'minilzo.c'; else $(CYGPATH_W) '$(srcdir)/minilzo.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nftrack-minilzo.Tpo $(DEPDIR)/nftrack-minilzo.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='minilzo.c' object='nftrack-minilzo.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nftrack_CFLAGS) $(CFLAGS) -c -o nftrack-minilzo.obj `if test -f 'minilzo.c'; then $(CYGPATH_W) 'minilzo.c'; else $(CYGPATH_W) '$(srcdir)/minilzo.c'; fi` + +nftrack-nffile.o: nffile.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nftrack_CFLAGS) $(CFLAGS) -MT nftrack-nffile.o -MD -MP -MF $(DEPDIR)/nftrack-nffile.Tpo -c -o nftrack-nffile.o `test -f 'nffile.c' || echo '$(srcdir)/'`nffile.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nftrack-nffile.Tpo $(DEPDIR)/nftrack-nffile.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='nffile.c' object='nftrack-nffile.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nftrack_CFLAGS) $(CFLAGS) -c -o nftrack-nffile.o `test -f 'nffile.c' || echo '$(srcdir)/'`nffile.c + +nftrack-nffile.obj: nffile.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nftrack_CFLAGS) $(CFLAGS) -MT nftrack-nffile.obj -MD -MP -MF $(DEPDIR)/nftrack-nffile.Tpo -c -o nftrack-nffile.obj `if test -f 'nffile.c'; then $(CYGPATH_W) 'nffile.c'; else $(CYGPATH_W) '$(srcdir)/nffile.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nftrack-nffile.Tpo $(DEPDIR)/nftrack-nffile.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='nffile.c' object='nftrack-nffile.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nftrack_CFLAGS) $(CFLAGS) -c -o nftrack-nffile.obj `if test -f 'nffile.c'; then $(CYGPATH_W) 'nffile.c'; else $(CYGPATH_W) '$(srcdir)/nffile.c'; fi` + +nftrack-nfx.o: nfx.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nftrack_CFLAGS) $(CFLAGS) -MT nftrack-nfx.o -MD -MP -MF $(DEPDIR)/nftrack-nfx.Tpo -c -o nftrack-nfx.o `test -f 'nfx.c' || echo '$(srcdir)/'`nfx.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nftrack-nfx.Tpo $(DEPDIR)/nftrack-nfx.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='nfx.c' object='nftrack-nfx.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nftrack_CFLAGS) $(CFLAGS) -c -o nftrack-nfx.o `test -f 'nfx.c' || echo '$(srcdir)/'`nfx.c + +nftrack-nfx.obj: nfx.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nftrack_CFLAGS) $(CFLAGS) -MT nftrack-nfx.obj -MD -MP -MF $(DEPDIR)/nftrack-nfx.Tpo -c -o nftrack-nfx.obj `if test -f 'nfx.c'; then $(CYGPATH_W) 'nfx.c'; else $(CYGPATH_W) '$(srcdir)/nfx.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nftrack-nfx.Tpo $(DEPDIR)/nftrack-nfx.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='nfx.c' object='nftrack-nfx.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nftrack_CFLAGS) $(CFLAGS) -c -o nftrack-nfx.obj `if test -f 'nfx.c'; then $(CYGPATH_W) 'nfx.c'; else $(CYGPATH_W) '$(srcdir)/nfx.c'; fi` + +nftrack-nfxstat.o: nfxstat.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nftrack_CFLAGS) $(CFLAGS) -MT nftrack-nfxstat.o -MD -MP -MF $(DEPDIR)/nftrack-nfxstat.Tpo -c -o nftrack-nfxstat.o `test -f 'nfxstat.c' || echo '$(srcdir)/'`nfxstat.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nftrack-nfxstat.Tpo $(DEPDIR)/nftrack-nfxstat.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='nfxstat.c' object='nftrack-nfxstat.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nftrack_CFLAGS) $(CFLAGS) -c -o nftrack-nfxstat.o `test -f 'nfxstat.c' || echo '$(srcdir)/'`nfxstat.c + +nftrack-nfxstat.obj: nfxstat.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nftrack_CFLAGS) $(CFLAGS) -MT nftrack-nfxstat.obj -MD -MP -MF $(DEPDIR)/nftrack-nfxstat.Tpo -c -o nftrack-nfxstat.obj `if test -f 'nfxstat.c'; then $(CYGPATH_W) 'nfxstat.c'; else $(CYGPATH_W) '$(srcdir)/nfxstat.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nftrack-nfxstat.Tpo $(DEPDIR)/nftrack-nfxstat.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='nfxstat.c' object='nftrack-nfxstat.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nftrack_CFLAGS) $(CFLAGS) -c -o nftrack-nfxstat.obj `if test -f 'nfxstat.c'; then $(CYGPATH_W) 'nfxstat.c'; else $(CYGPATH_W) '$(srcdir)/nfxstat.c'; fi` + +nftrack-flist.o: flist.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nftrack_CFLAGS) $(CFLAGS) -MT nftrack-flist.o -MD -MP -MF $(DEPDIR)/nftrack-flist.Tpo -c -o nftrack-flist.o `test -f 'flist.c' || echo '$(srcdir)/'`flist.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nftrack-flist.Tpo $(DEPDIR)/nftrack-flist.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='flist.c' object='nftrack-flist.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nftrack_CFLAGS) $(CFLAGS) -c -o nftrack-flist.o `test -f 'flist.c' || echo '$(srcdir)/'`flist.c + +nftrack-flist.obj: flist.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nftrack_CFLAGS) $(CFLAGS) -MT nftrack-flist.obj -MD -MP -MF $(DEPDIR)/nftrack-flist.Tpo -c -o nftrack-flist.obj `if test -f 'flist.c'; then $(CYGPATH_W) 'flist.c'; else $(CYGPATH_W) '$(srcdir)/flist.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nftrack-flist.Tpo $(DEPDIR)/nftrack-flist.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='flist.c' object='nftrack-flist.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nftrack_CFLAGS) $(CFLAGS) -c -o nftrack-flist.obj `if test -f 'flist.c'; then $(CYGPATH_W) 'flist.c'; else $(CYGPATH_W) '$(srcdir)/flist.c'; fi` + +nftrack-fts_compat.o: fts_compat.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nftrack_CFLAGS) $(CFLAGS) -MT nftrack-fts_compat.o -MD -MP -MF $(DEPDIR)/nftrack-fts_compat.Tpo -c -o nftrack-fts_compat.o `test -f 'fts_compat.c' || echo '$(srcdir)/'`fts_compat.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nftrack-fts_compat.Tpo $(DEPDIR)/nftrack-fts_compat.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fts_compat.c' object='nftrack-fts_compat.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nftrack_CFLAGS) $(CFLAGS) -c -o nftrack-fts_compat.o `test -f 'fts_compat.c' || echo '$(srcdir)/'`fts_compat.c + +nftrack-fts_compat.obj: fts_compat.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nftrack_CFLAGS) $(CFLAGS) -MT nftrack-fts_compat.obj -MD -MP -MF $(DEPDIR)/nftrack-fts_compat.Tpo -c -o nftrack-fts_compat.obj `if test -f 'fts_compat.c'; then $(CYGPATH_W) 'fts_compat.c'; else $(CYGPATH_W) '$(srcdir)/fts_compat.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nftrack-fts_compat.Tpo $(DEPDIR)/nftrack-fts_compat.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fts_compat.c' object='nftrack-fts_compat.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nftrack_CFLAGS) $(CFLAGS) -c -o nftrack-fts_compat.obj `if test -f 'fts_compat.c'; then $(CYGPATH_W) 'fts_compat.c'; else $(CYGPATH_W) '$(srcdir)/fts_compat.c'; fi` + +nftrack-grammar.o: grammar.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nftrack_CFLAGS) $(CFLAGS) -MT nftrack-grammar.o -MD -MP -MF $(DEPDIR)/nftrack-grammar.Tpo -c -o nftrack-grammar.o `test -f 'grammar.c' || echo '$(srcdir)/'`grammar.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nftrack-grammar.Tpo $(DEPDIR)/nftrack-grammar.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='grammar.c' object='nftrack-grammar.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nftrack_CFLAGS) $(CFLAGS) -c -o nftrack-grammar.o `test -f 'grammar.c' || echo '$(srcdir)/'`grammar.c + +nftrack-grammar.obj: grammar.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nftrack_CFLAGS) $(CFLAGS) -MT nftrack-grammar.obj -MD -MP -MF $(DEPDIR)/nftrack-grammar.Tpo -c -o nftrack-grammar.obj `if test -f 'grammar.c'; then $(CYGPATH_W) 'grammar.c'; else $(CYGPATH_W) '$(srcdir)/grammar.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nftrack-grammar.Tpo $(DEPDIR)/nftrack-grammar.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='grammar.c' object='nftrack-grammar.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nftrack_CFLAGS) $(CFLAGS) -c -o nftrack-grammar.obj `if test -f 'grammar.c'; then $(CYGPATH_W) 'grammar.c'; else $(CYGPATH_W) '$(srcdir)/grammar.c'; fi` + +nftrack-scanner.o: scanner.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nftrack_CFLAGS) $(CFLAGS) -MT nftrack-scanner.o -MD -MP -MF $(DEPDIR)/nftrack-scanner.Tpo -c -o nftrack-scanner.o `test -f 'scanner.c' || echo '$(srcdir)/'`scanner.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nftrack-scanner.Tpo $(DEPDIR)/nftrack-scanner.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='scanner.c' object='nftrack-scanner.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nftrack_CFLAGS) $(CFLAGS) -c -o nftrack-scanner.o `test -f 'scanner.c' || echo '$(srcdir)/'`scanner.c + +nftrack-scanner.obj: scanner.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nftrack_CFLAGS) $(CFLAGS) -MT nftrack-scanner.obj -MD -MP -MF $(DEPDIR)/nftrack-scanner.Tpo -c -o nftrack-scanner.obj `if test -f 'scanner.c'; then $(CYGPATH_W) 'scanner.c'; else $(CYGPATH_W) '$(srcdir)/scanner.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nftrack-scanner.Tpo $(DEPDIR)/nftrack-scanner.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='scanner.c' object='nftrack-scanner.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nftrack_CFLAGS) $(CFLAGS) -c -o nftrack-scanner.obj `if test -f 'scanner.c'; then $(CYGPATH_W) 'scanner.c'; else $(CYGPATH_W) '$(srcdir)/scanner.c'; fi` + +nftrack-nftree.o: nftree.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nftrack_CFLAGS) $(CFLAGS) -MT nftrack-nftree.o -MD -MP -MF $(DEPDIR)/nftrack-nftree.Tpo -c -o nftrack-nftree.o `test -f 'nftree.c' || echo '$(srcdir)/'`nftree.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nftrack-nftree.Tpo $(DEPDIR)/nftrack-nftree.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='nftree.c' object='nftrack-nftree.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nftrack_CFLAGS) $(CFLAGS) -c -o nftrack-nftree.o `test -f 'nftree.c' || echo '$(srcdir)/'`nftree.c + +nftrack-nftree.obj: nftree.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nftrack_CFLAGS) $(CFLAGS) -MT nftrack-nftree.obj -MD -MP -MF $(DEPDIR)/nftrack-nftree.Tpo -c -o nftrack-nftree.obj `if test -f 'nftree.c'; then $(CYGPATH_W) 'nftree.c'; else $(CYGPATH_W) '$(srcdir)/nftree.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nftrack-nftree.Tpo $(DEPDIR)/nftrack-nftree.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='nftree.c' object='nftrack-nftree.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nftrack_CFLAGS) $(CFLAGS) -c -o nftrack-nftree.obj `if test -f 'nftree.c'; then $(CYGPATH_W) 'nftree.c'; else $(CYGPATH_W) '$(srcdir)/nftree.c'; fi` + +nftrack-ipconv.o: ipconv.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nftrack_CFLAGS) $(CFLAGS) -MT nftrack-ipconv.o -MD -MP -MF $(DEPDIR)/nftrack-ipconv.Tpo -c -o nftrack-ipconv.o `test -f 'ipconv.c' || echo '$(srcdir)/'`ipconv.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nftrack-ipconv.Tpo $(DEPDIR)/nftrack-ipconv.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ipconv.c' object='nftrack-ipconv.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nftrack_CFLAGS) $(CFLAGS) -c -o nftrack-ipconv.o `test -f 'ipconv.c' || echo '$(srcdir)/'`ipconv.c + +nftrack-ipconv.obj: ipconv.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nftrack_CFLAGS) $(CFLAGS) -MT nftrack-ipconv.obj -MD -MP -MF $(DEPDIR)/nftrack-ipconv.Tpo -c -o nftrack-ipconv.obj `if test -f 'ipconv.c'; then $(CYGPATH_W) 'ipconv.c'; else $(CYGPATH_W) '$(srcdir)/ipconv.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nftrack-ipconv.Tpo $(DEPDIR)/nftrack-ipconv.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ipconv.c' object='nftrack-ipconv.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(nftrack_CFLAGS) $(CFLAGS) -c -o nftrack-ipconv.obj `if test -f 'ipconv.c'; then $(CYGPATH_W) 'ipconv.c'; else $(CYGPATH_W) '$(srcdir)/ipconv.c'; fi` + +sfcapd-sfcapd.o: sfcapd.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sfcapd_CFLAGS) $(CFLAGS) -MT sfcapd-sfcapd.o -MD -MP -MF $(DEPDIR)/sfcapd-sfcapd.Tpo -c -o sfcapd-sfcapd.o `test -f 'sfcapd.c' || echo '$(srcdir)/'`sfcapd.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/sfcapd-sfcapd.Tpo $(DEPDIR)/sfcapd-sfcapd.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='sfcapd.c' object='sfcapd-sfcapd.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sfcapd_CFLAGS) $(CFLAGS) -c -o sfcapd-sfcapd.o `test -f 'sfcapd.c' || echo '$(srcdir)/'`sfcapd.c + +sfcapd-sfcapd.obj: sfcapd.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sfcapd_CFLAGS) $(CFLAGS) -MT sfcapd-sfcapd.obj -MD -MP -MF $(DEPDIR)/sfcapd-sfcapd.Tpo -c -o sfcapd-sfcapd.obj `if test -f 'sfcapd.c'; then $(CYGPATH_W) 'sfcapd.c'; else $(CYGPATH_W) '$(srcdir)/sfcapd.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/sfcapd-sfcapd.Tpo $(DEPDIR)/sfcapd-sfcapd.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='sfcapd.c' object='sfcapd-sfcapd.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sfcapd_CFLAGS) $(CFLAGS) -c -o sfcapd-sfcapd.obj `if test -f 'sfcapd.c'; then $(CYGPATH_W) 'sfcapd.c'; else $(CYGPATH_W) '$(srcdir)/sfcapd.c'; fi` + +sfcapd-sflow.o: sflow.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sfcapd_CFLAGS) $(CFLAGS) -MT sfcapd-sflow.o -MD -MP -MF $(DEPDIR)/sfcapd-sflow.Tpo -c -o sfcapd-sflow.o `test -f 'sflow.c' || echo '$(srcdir)/'`sflow.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/sfcapd-sflow.Tpo $(DEPDIR)/sfcapd-sflow.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='sflow.c' object='sfcapd-sflow.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sfcapd_CFLAGS) $(CFLAGS) -c -o sfcapd-sflow.o `test -f 'sflow.c' || echo '$(srcdir)/'`sflow.c + +sfcapd-sflow.obj: sflow.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sfcapd_CFLAGS) $(CFLAGS) -MT sfcapd-sflow.obj -MD -MP -MF $(DEPDIR)/sfcapd-sflow.Tpo -c -o sfcapd-sflow.obj `if test -f 'sflow.c'; then $(CYGPATH_W) 'sflow.c'; else $(CYGPATH_W) '$(srcdir)/sflow.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/sfcapd-sflow.Tpo $(DEPDIR)/sfcapd-sflow.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='sflow.c' object='sfcapd-sflow.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sfcapd_CFLAGS) $(CFLAGS) -c -o sfcapd-sflow.obj `if test -f 'sflow.c'; then $(CYGPATH_W) 'sflow.c'; else $(CYGPATH_W) '$(srcdir)/sflow.c'; fi` + +sfcapd-nf_common.o: nf_common.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sfcapd_CFLAGS) $(CFLAGS) -MT sfcapd-nf_common.o -MD -MP -MF $(DEPDIR)/sfcapd-nf_common.Tpo -c -o sfcapd-nf_common.o `test -f 'nf_common.c' || echo '$(srcdir)/'`nf_common.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/sfcapd-nf_common.Tpo $(DEPDIR)/sfcapd-nf_common.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='nf_common.c' object='sfcapd-nf_common.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sfcapd_CFLAGS) $(CFLAGS) -c -o sfcapd-nf_common.o `test -f 'nf_common.c' || echo '$(srcdir)/'`nf_common.c + +sfcapd-nf_common.obj: nf_common.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sfcapd_CFLAGS) $(CFLAGS) -MT sfcapd-nf_common.obj -MD -MP -MF $(DEPDIR)/sfcapd-nf_common.Tpo -c -o sfcapd-nf_common.obj `if test -f 'nf_common.c'; then $(CYGPATH_W) 'nf_common.c'; else $(CYGPATH_W) '$(srcdir)/nf_common.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/sfcapd-nf_common.Tpo $(DEPDIR)/sfcapd-nf_common.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='nf_common.c' object='sfcapd-nf_common.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sfcapd_CFLAGS) $(CFLAGS) -c -o sfcapd-nf_common.obj `if test -f 'nf_common.c'; then $(CYGPATH_W) 'nf_common.c'; else $(CYGPATH_W) '$(srcdir)/nf_common.c'; fi` + +sfcapd-util.o: util.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sfcapd_CFLAGS) $(CFLAGS) -MT sfcapd-util.o -MD -MP -MF $(DEPDIR)/sfcapd-util.Tpo -c -o sfcapd-util.o `test -f 'util.c' || echo '$(srcdir)/'`util.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/sfcapd-util.Tpo $(DEPDIR)/sfcapd-util.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='util.c' object='sfcapd-util.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sfcapd_CFLAGS) $(CFLAGS) -c -o sfcapd-util.o `test -f 'util.c' || echo '$(srcdir)/'`util.c + +sfcapd-util.obj: util.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sfcapd_CFLAGS) $(CFLAGS) -MT sfcapd-util.obj -MD -MP -MF $(DEPDIR)/sfcapd-util.Tpo -c -o sfcapd-util.obj `if test -f 'util.c'; then $(CYGPATH_W) 'util.c'; else $(CYGPATH_W) '$(srcdir)/util.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/sfcapd-util.Tpo $(DEPDIR)/sfcapd-util.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='util.c' object='sfcapd-util.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sfcapd_CFLAGS) $(CFLAGS) -c -o sfcapd-util.obj `if test -f 'util.c'; then $(CYGPATH_W) 'util.c'; else $(CYGPATH_W) '$(srcdir)/util.c'; fi` + +sfcapd-minilzo.o: minilzo.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sfcapd_CFLAGS) $(CFLAGS) -MT sfcapd-minilzo.o -MD -MP -MF $(DEPDIR)/sfcapd-minilzo.Tpo -c -o sfcapd-minilzo.o `test -f 'minilzo.c' || echo '$(srcdir)/'`minilzo.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/sfcapd-minilzo.Tpo $(DEPDIR)/sfcapd-minilzo.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='minilzo.c' object='sfcapd-minilzo.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sfcapd_CFLAGS) $(CFLAGS) -c -o sfcapd-minilzo.o `test -f 'minilzo.c' || echo '$(srcdir)/'`minilzo.c + +sfcapd-minilzo.obj: minilzo.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sfcapd_CFLAGS) $(CFLAGS) -MT sfcapd-minilzo.obj -MD -MP -MF $(DEPDIR)/sfcapd-minilzo.Tpo -c -o sfcapd-minilzo.obj `if test -f 'minilzo.c'; then $(CYGPATH_W) 'minilzo.c'; else $(CYGPATH_W) '$(srcdir)/minilzo.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/sfcapd-minilzo.Tpo $(DEPDIR)/sfcapd-minilzo.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='minilzo.c' object='sfcapd-minilzo.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sfcapd_CFLAGS) $(CFLAGS) -c -o sfcapd-minilzo.obj `if test -f 'minilzo.c'; then $(CYGPATH_W) 'minilzo.c'; else $(CYGPATH_W) '$(srcdir)/minilzo.c'; fi` + +sfcapd-nffile.o: nffile.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sfcapd_CFLAGS) $(CFLAGS) -MT sfcapd-nffile.o -MD -MP -MF $(DEPDIR)/sfcapd-nffile.Tpo -c -o sfcapd-nffile.o `test -f 'nffile.c' || echo '$(srcdir)/'`nffile.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/sfcapd-nffile.Tpo $(DEPDIR)/sfcapd-nffile.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='nffile.c' object='sfcapd-nffile.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sfcapd_CFLAGS) $(CFLAGS) -c -o sfcapd-nffile.o `test -f 'nffile.c' || echo '$(srcdir)/'`nffile.c + +sfcapd-nffile.obj: nffile.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sfcapd_CFLAGS) $(CFLAGS) -MT sfcapd-nffile.obj -MD -MP -MF $(DEPDIR)/sfcapd-nffile.Tpo -c -o sfcapd-nffile.obj `if test -f 'nffile.c'; then $(CYGPATH_W) 'nffile.c'; else $(CYGPATH_W) '$(srcdir)/nffile.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/sfcapd-nffile.Tpo $(DEPDIR)/sfcapd-nffile.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='nffile.c' object='sfcapd-nffile.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sfcapd_CFLAGS) $(CFLAGS) -c -o sfcapd-nffile.obj `if test -f 'nffile.c'; then $(CYGPATH_W) 'nffile.c'; else $(CYGPATH_W) '$(srcdir)/nffile.c'; fi` + +sfcapd-nfx.o: nfx.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sfcapd_CFLAGS) $(CFLAGS) -MT sfcapd-nfx.o -MD -MP -MF $(DEPDIR)/sfcapd-nfx.Tpo -c -o sfcapd-nfx.o `test -f 'nfx.c' || echo '$(srcdir)/'`nfx.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/sfcapd-nfx.Tpo $(DEPDIR)/sfcapd-nfx.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='nfx.c' object='sfcapd-nfx.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sfcapd_CFLAGS) $(CFLAGS) -c -o sfcapd-nfx.o `test -f 'nfx.c' || echo '$(srcdir)/'`nfx.c + +sfcapd-nfx.obj: nfx.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sfcapd_CFLAGS) $(CFLAGS) -MT sfcapd-nfx.obj -MD -MP -MF $(DEPDIR)/sfcapd-nfx.Tpo -c -o sfcapd-nfx.obj `if test -f 'nfx.c'; then $(CYGPATH_W) 'nfx.c'; else $(CYGPATH_W) '$(srcdir)/nfx.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/sfcapd-nfx.Tpo $(DEPDIR)/sfcapd-nfx.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='nfx.c' object='sfcapd-nfx.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sfcapd_CFLAGS) $(CFLAGS) -c -o sfcapd-nfx.obj `if test -f 'nfx.c'; then $(CYGPATH_W) 'nfx.c'; else $(CYGPATH_W) '$(srcdir)/nfx.c'; fi` + +sfcapd-nfxstat.o: nfxstat.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sfcapd_CFLAGS) $(CFLAGS) -MT sfcapd-nfxstat.o -MD -MP -MF $(DEPDIR)/sfcapd-nfxstat.Tpo -c -o sfcapd-nfxstat.o `test -f 'nfxstat.c' || echo '$(srcdir)/'`nfxstat.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/sfcapd-nfxstat.Tpo $(DEPDIR)/sfcapd-nfxstat.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='nfxstat.c' object='sfcapd-nfxstat.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sfcapd_CFLAGS) $(CFLAGS) -c -o sfcapd-nfxstat.o `test -f 'nfxstat.c' || echo '$(srcdir)/'`nfxstat.c + +sfcapd-nfxstat.obj: nfxstat.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sfcapd_CFLAGS) $(CFLAGS) -MT sfcapd-nfxstat.obj -MD -MP -MF $(DEPDIR)/sfcapd-nfxstat.Tpo -c -o sfcapd-nfxstat.obj `if test -f 'nfxstat.c'; then $(CYGPATH_W) 'nfxstat.c'; else $(CYGPATH_W) '$(srcdir)/nfxstat.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/sfcapd-nfxstat.Tpo $(DEPDIR)/sfcapd-nfxstat.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='nfxstat.c' object='sfcapd-nfxstat.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sfcapd_CFLAGS) $(CFLAGS) -c -o sfcapd-nfxstat.obj `if test -f 'nfxstat.c'; then $(CYGPATH_W) 'nfxstat.c'; else $(CYGPATH_W) '$(srcdir)/nfxstat.c'; fi` + +sfcapd-flist.o: flist.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sfcapd_CFLAGS) $(CFLAGS) -MT sfcapd-flist.o -MD -MP -MF $(DEPDIR)/sfcapd-flist.Tpo -c -o sfcapd-flist.o `test -f 'flist.c' || echo '$(srcdir)/'`flist.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/sfcapd-flist.Tpo $(DEPDIR)/sfcapd-flist.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='flist.c' object='sfcapd-flist.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sfcapd_CFLAGS) $(CFLAGS) -c -o sfcapd-flist.o `test -f 'flist.c' || echo '$(srcdir)/'`flist.c + +sfcapd-flist.obj: flist.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sfcapd_CFLAGS) $(CFLAGS) -MT sfcapd-flist.obj -MD -MP -MF $(DEPDIR)/sfcapd-flist.Tpo -c -o sfcapd-flist.obj `if test -f 'flist.c'; then $(CYGPATH_W) 'flist.c'; else $(CYGPATH_W) '$(srcdir)/flist.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/sfcapd-flist.Tpo $(DEPDIR)/sfcapd-flist.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='flist.c' object='sfcapd-flist.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sfcapd_CFLAGS) $(CFLAGS) -c -o sfcapd-flist.obj `if test -f 'flist.c'; then $(CYGPATH_W) 'flist.c'; else $(CYGPATH_W) '$(srcdir)/flist.c'; fi` + +sfcapd-fts_compat.o: fts_compat.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sfcapd_CFLAGS) $(CFLAGS) -MT sfcapd-fts_compat.o -MD -MP -MF $(DEPDIR)/sfcapd-fts_compat.Tpo -c -o sfcapd-fts_compat.o `test -f 'fts_compat.c' || echo '$(srcdir)/'`fts_compat.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/sfcapd-fts_compat.Tpo $(DEPDIR)/sfcapd-fts_compat.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fts_compat.c' object='sfcapd-fts_compat.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sfcapd_CFLAGS) $(CFLAGS) -c -o sfcapd-fts_compat.o `test -f 'fts_compat.c' || echo '$(srcdir)/'`fts_compat.c + +sfcapd-fts_compat.obj: fts_compat.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sfcapd_CFLAGS) $(CFLAGS) -MT sfcapd-fts_compat.obj -MD -MP -MF $(DEPDIR)/sfcapd-fts_compat.Tpo -c -o sfcapd-fts_compat.obj `if test -f 'fts_compat.c'; then $(CYGPATH_W) 'fts_compat.c'; else $(CYGPATH_W) '$(srcdir)/fts_compat.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/sfcapd-fts_compat.Tpo $(DEPDIR)/sfcapd-fts_compat.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fts_compat.c' object='sfcapd-fts_compat.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sfcapd_CFLAGS) $(CFLAGS) -c -o sfcapd-fts_compat.obj `if test -f 'fts_compat.c'; then $(CYGPATH_W) 'fts_compat.c'; else $(CYGPATH_W) '$(srcdir)/fts_compat.c'; fi` + +sfcapd-nfstatfile.o: nfstatfile.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sfcapd_CFLAGS) $(CFLAGS) -MT sfcapd-nfstatfile.o -MD -MP -MF $(DEPDIR)/sfcapd-nfstatfile.Tpo -c -o sfcapd-nfstatfile.o `test -f 'nfstatfile.c' || echo '$(srcdir)/'`nfstatfile.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/sfcapd-nfstatfile.Tpo $(DEPDIR)/sfcapd-nfstatfile.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='nfstatfile.c' object='sfcapd-nfstatfile.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sfcapd_CFLAGS) $(CFLAGS) -c -o sfcapd-nfstatfile.o `test -f 'nfstatfile.c' || echo '$(srcdir)/'`nfstatfile.c + +sfcapd-nfstatfile.obj: nfstatfile.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sfcapd_CFLAGS) $(CFLAGS) -MT sfcapd-nfstatfile.obj -MD -MP -MF $(DEPDIR)/sfcapd-nfstatfile.Tpo -c -o sfcapd-nfstatfile.obj `if test -f 'nfstatfile.c'; then $(CYGPATH_W) 'nfstatfile.c'; else $(CYGPATH_W) '$(srcdir)/nfstatfile.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/sfcapd-nfstatfile.Tpo $(DEPDIR)/sfcapd-nfstatfile.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='nfstatfile.c' object='sfcapd-nfstatfile.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sfcapd_CFLAGS) $(CFLAGS) -c -o sfcapd-nfstatfile.obj `if test -f 'nfstatfile.c'; then $(CYGPATH_W) 'nfstatfile.c'; else $(CYGPATH_W) '$(srcdir)/nfstatfile.c'; fi` + +sfcapd-launch.o: launch.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sfcapd_CFLAGS) $(CFLAGS) -MT sfcapd-launch.o -MD -MP -MF $(DEPDIR)/sfcapd-launch.Tpo -c -o sfcapd-launch.o `test -f 'launch.c' || echo '$(srcdir)/'`launch.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/sfcapd-launch.Tpo $(DEPDIR)/sfcapd-launch.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='launch.c' object='sfcapd-launch.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sfcapd_CFLAGS) $(CFLAGS) -c -o sfcapd-launch.o `test -f 'launch.c' || echo '$(srcdir)/'`launch.c + +sfcapd-launch.obj: launch.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sfcapd_CFLAGS) $(CFLAGS) -MT sfcapd-launch.obj -MD -MP -MF $(DEPDIR)/sfcapd-launch.Tpo -c -o sfcapd-launch.obj `if test -f 'launch.c'; then $(CYGPATH_W) 'launch.c'; else $(CYGPATH_W) '$(srcdir)/launch.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/sfcapd-launch.Tpo $(DEPDIR)/sfcapd-launch.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='launch.c' object='sfcapd-launch.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sfcapd_CFLAGS) $(CFLAGS) -c -o sfcapd-launch.obj `if test -f 'launch.c'; then $(CYGPATH_W) 'launch.c'; else $(CYGPATH_W) '$(srcdir)/launch.c'; fi` + +sfcapd-nfnet.o: nfnet.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sfcapd_CFLAGS) $(CFLAGS) -MT sfcapd-nfnet.o -MD -MP -MF $(DEPDIR)/sfcapd-nfnet.Tpo -c -o sfcapd-nfnet.o `test -f 'nfnet.c' || echo '$(srcdir)/'`nfnet.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/sfcapd-nfnet.Tpo $(DEPDIR)/sfcapd-nfnet.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='nfnet.c' object='sfcapd-nfnet.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sfcapd_CFLAGS) $(CFLAGS) -c -o sfcapd-nfnet.o `test -f 'nfnet.c' || echo '$(srcdir)/'`nfnet.c + +sfcapd-nfnet.obj: nfnet.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sfcapd_CFLAGS) $(CFLAGS) -MT sfcapd-nfnet.obj -MD -MP -MF $(DEPDIR)/sfcapd-nfnet.Tpo -c -o sfcapd-nfnet.obj `if test -f 'nfnet.c'; then $(CYGPATH_W) 'nfnet.c'; else $(CYGPATH_W) '$(srcdir)/nfnet.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/sfcapd-nfnet.Tpo $(DEPDIR)/sfcapd-nfnet.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='nfnet.c' object='sfcapd-nfnet.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sfcapd_CFLAGS) $(CFLAGS) -c -o sfcapd-nfnet.obj `if test -f 'nfnet.c'; then $(CYGPATH_W) 'nfnet.c'; else $(CYGPATH_W) '$(srcdir)/nfnet.c'; fi` + +sfcapd-collector.o: collector.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sfcapd_CFLAGS) $(CFLAGS) -MT sfcapd-collector.o -MD -MP -MF $(DEPDIR)/sfcapd-collector.Tpo -c -o sfcapd-collector.o `test -f 'collector.c' || echo '$(srcdir)/'`collector.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/sfcapd-collector.Tpo $(DEPDIR)/sfcapd-collector.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='collector.c' object='sfcapd-collector.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sfcapd_CFLAGS) $(CFLAGS) -c -o sfcapd-collector.o `test -f 'collector.c' || echo '$(srcdir)/'`collector.c + +sfcapd-collector.obj: collector.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sfcapd_CFLAGS) $(CFLAGS) -MT sfcapd-collector.obj -MD -MP -MF $(DEPDIR)/sfcapd-collector.Tpo -c -o sfcapd-collector.obj `if test -f 'collector.c'; then $(CYGPATH_W) 'collector.c'; else $(CYGPATH_W) '$(srcdir)/collector.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/sfcapd-collector.Tpo $(DEPDIR)/sfcapd-collector.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='collector.c' object='sfcapd-collector.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sfcapd_CFLAGS) $(CFLAGS) -c -o sfcapd-collector.obj `if test -f 'collector.c'; then $(CYGPATH_W) 'collector.c'; else $(CYGPATH_W) '$(srcdir)/collector.c'; fi` + +sfcapd-bookkeeper.o: bookkeeper.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sfcapd_CFLAGS) $(CFLAGS) -MT sfcapd-bookkeeper.o -MD -MP -MF $(DEPDIR)/sfcapd-bookkeeper.Tpo -c -o sfcapd-bookkeeper.o `test -f 'bookkeeper.c' || echo '$(srcdir)/'`bookkeeper.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/sfcapd-bookkeeper.Tpo $(DEPDIR)/sfcapd-bookkeeper.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='bookkeeper.c' object='sfcapd-bookkeeper.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sfcapd_CFLAGS) $(CFLAGS) -c -o sfcapd-bookkeeper.o `test -f 'bookkeeper.c' || echo '$(srcdir)/'`bookkeeper.c + +sfcapd-bookkeeper.obj: bookkeeper.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sfcapd_CFLAGS) $(CFLAGS) -MT sfcapd-bookkeeper.obj -MD -MP -MF $(DEPDIR)/sfcapd-bookkeeper.Tpo -c -o sfcapd-bookkeeper.obj `if test -f 'bookkeeper.c'; then $(CYGPATH_W) 'bookkeeper.c'; else $(CYGPATH_W) '$(srcdir)/bookkeeper.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/sfcapd-bookkeeper.Tpo $(DEPDIR)/sfcapd-bookkeeper.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='bookkeeper.c' object='sfcapd-bookkeeper.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sfcapd_CFLAGS) $(CFLAGS) -c -o sfcapd-bookkeeper.obj `if test -f 'bookkeeper.c'; then $(CYGPATH_W) 'bookkeeper.c'; else $(CYGPATH_W) '$(srcdir)/bookkeeper.c'; fi` + +sfcapd-expire.o: expire.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sfcapd_CFLAGS) $(CFLAGS) -MT sfcapd-expire.o -MD -MP -MF $(DEPDIR)/sfcapd-expire.Tpo -c -o sfcapd-expire.o `test -f 'expire.c' || echo '$(srcdir)/'`expire.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/sfcapd-expire.Tpo $(DEPDIR)/sfcapd-expire.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='expire.c' object='sfcapd-expire.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sfcapd_CFLAGS) $(CFLAGS) -c -o sfcapd-expire.o `test -f 'expire.c' || echo '$(srcdir)/'`expire.c + +sfcapd-expire.obj: expire.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sfcapd_CFLAGS) $(CFLAGS) -MT sfcapd-expire.obj -MD -MP -MF $(DEPDIR)/sfcapd-expire.Tpo -c -o sfcapd-expire.obj `if test -f 'expire.c'; then $(CYGPATH_W) 'expire.c'; else $(CYGPATH_W) '$(srcdir)/expire.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/sfcapd-expire.Tpo $(DEPDIR)/sfcapd-expire.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='expire.c' object='sfcapd-expire.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sfcapd_CFLAGS) $(CFLAGS) -c -o sfcapd-expire.obj `if test -f 'expire.c'; then $(CYGPATH_W) 'expire.c'; else $(CYGPATH_W) '$(srcdir)/expire.c'; fi` + +sfcapd-pcap_reader.o: pcap_reader.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sfcapd_CFLAGS) $(CFLAGS) -MT sfcapd-pcap_reader.o -MD -MP -MF $(DEPDIR)/sfcapd-pcap_reader.Tpo -c -o sfcapd-pcap_reader.o `test -f 'pcap_reader.c' || echo '$(srcdir)/'`pcap_reader.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/sfcapd-pcap_reader.Tpo $(DEPDIR)/sfcapd-pcap_reader.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pcap_reader.c' object='sfcapd-pcap_reader.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sfcapd_CFLAGS) $(CFLAGS) -c -o sfcapd-pcap_reader.o `test -f 'pcap_reader.c' || echo '$(srcdir)/'`pcap_reader.c + +sfcapd-pcap_reader.obj: pcap_reader.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sfcapd_CFLAGS) $(CFLAGS) -MT sfcapd-pcap_reader.obj -MD -MP -MF $(DEPDIR)/sfcapd-pcap_reader.Tpo -c -o sfcapd-pcap_reader.obj `if test -f 'pcap_reader.c'; then $(CYGPATH_W) 'pcap_reader.c'; else $(CYGPATH_W) '$(srcdir)/pcap_reader.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/sfcapd-pcap_reader.Tpo $(DEPDIR)/sfcapd-pcap_reader.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pcap_reader.c' object='sfcapd-pcap_reader.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sfcapd_CFLAGS) $(CFLAGS) -c -o sfcapd-pcap_reader.obj `if test -f 'pcap_reader.c'; then $(CYGPATH_W) 'pcap_reader.c'; else $(CYGPATH_W) '$(srcdir)/pcap_reader.c'; fi` + +.l.c: + $(AM_V_LEX)$(am__skiplex) $(SHELL) $(YLWRAP) $< $(LEX_OUTPUT_ROOT).c $@ -- $(LEXCOMPILE) + +.y.c: + $(AM_V_YACC)$(am__skipyacc) $(SHELL) $(YLWRAP) $< y.tab.c $@ y.tab.h `echo $@ | $(am__yacc_c2h)` y.output $*.output -- $(YACCCOMPILE) + +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-am +TAGS: tags + +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + set x; \ + here=`pwd`; \ + $(am__define_uniq_tagged_files); \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: ctags-am + +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" +cscopelist: cscopelist-am + +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +# Recover from deleted '.trs' file; this should ensure that +# "rm -f foo.log; make foo.trs" re-run 'foo.test', and re-create +# both 'foo.log' and 'foo.trs'. Break the recipe in two subshells +# to avoid problems with "make -n". +.log.trs: + rm -f $< $@ + $(MAKE) $(AM_MAKEFLAGS) $< + +# Leading 'am--fnord' is there to ensure the list of targets does not +# expand to empty, as could happen e.g. with make check TESTS=''. +am--fnord $(TEST_LOGS) $(TEST_LOGS:.log=.trs): $(am__force_recheck) +am--force-recheck: + @: + +$(TEST_SUITE_LOG): $(TEST_LOGS) + @$(am__set_TESTS_bases); \ + am__f_ok () { test -f "$$1" && test -r "$$1"; }; \ + redo_bases=`for i in $$bases; do \ + am__f_ok $$i.trs && am__f_ok $$i.log || echo $$i; \ + done`; \ + if test -n "$$redo_bases"; then \ + redo_logs=`for i in $$redo_bases; do echo $$i.log; done`; \ + redo_results=`for i in $$redo_bases; do echo $$i.trs; done`; \ + if $(am__make_dryrun); then :; else \ + rm -f $$redo_logs && rm -f $$redo_results || exit 1; \ + fi; \ + fi; \ + if test -n "$$am__remaking_logs"; then \ + echo "fatal: making $(TEST_SUITE_LOG): possible infinite" \ + "recursion detected" >&2; \ + else \ + am__remaking_logs=yes $(MAKE) $(AM_MAKEFLAGS) $$redo_logs; \ + fi; \ + if $(am__make_dryrun); then :; else \ + st=0; \ + errmsg="fatal: making $(TEST_SUITE_LOG): failed to create"; \ + for i in $$redo_bases; do \ + test -f $$i.trs && test -r $$i.trs \ + || { echo "$$errmsg $$i.trs" >&2; st=1; }; \ + test -f $$i.log && test -r $$i.log \ + || { echo "$$errmsg $$i.log" >&2; st=1; }; \ + done; \ + test $$st -eq 0 || exit 1; \ + fi + @$(am__sh_e_setup); $(am__tty_colors); $(am__set_TESTS_bases); \ + ws='[ ]'; \ + results=`for b in $$bases; do echo $$b.trs; done`; \ + test -n "$$results" || results=/dev/null; \ + all=` grep "^$$ws*:test-result:" $$results | wc -l`; \ + pass=` grep "^$$ws*:test-result:$$ws*PASS" $$results | wc -l`; \ + fail=` grep "^$$ws*:test-result:$$ws*FAIL" $$results | wc -l`; \ + skip=` grep "^$$ws*:test-result:$$ws*SKIP" $$results | wc -l`; \ + xfail=`grep "^$$ws*:test-result:$$ws*XFAIL" $$results | wc -l`; \ + xpass=`grep "^$$ws*:test-result:$$ws*XPASS" $$results | wc -l`; \ + error=`grep "^$$ws*:test-result:$$ws*ERROR" $$results | wc -l`; \ + if test `expr $$fail + $$xpass + $$error` -eq 0; then \ + success=true; \ + else \ + success=false; \ + fi; \ + br='==================='; br=$$br$$br$$br$$br; \ + result_count () \ + { \ + if test x"$$1" = x"--maybe-color"; then \ + maybe_colorize=yes; \ + elif test x"$$1" = x"--no-color"; then \ + maybe_colorize=no; \ + else \ + echo "$@: invalid 'result_count' usage" >&2; exit 4; \ + fi; \ + shift; \ + desc=$$1 count=$$2; \ + if test $$maybe_colorize = yes && test $$count -gt 0; then \ + color_start=$$3 color_end=$$std; \ + else \ + color_start= color_end=; \ + fi; \ + echo "$${color_start}# $$desc $$count$${color_end}"; \ + }; \ + create_testsuite_report () \ + { \ + result_count $$1 "TOTAL:" $$all "$$brg"; \ + result_count $$1 "PASS: " $$pass "$$grn"; \ + result_count $$1 "SKIP: " $$skip "$$blu"; \ + result_count $$1 "XFAIL:" $$xfail "$$lgn"; \ + result_count $$1 "FAIL: " $$fail "$$red"; \ + result_count $$1 "XPASS:" $$xpass "$$red"; \ + result_count $$1 "ERROR:" $$error "$$mgn"; \ + }; \ + { \ + echo "$(PACKAGE_STRING): $(subdir)/$(TEST_SUITE_LOG)" | \ + $(am__rst_title); \ + create_testsuite_report --no-color; \ + echo; \ + echo ".. contents:: :depth: 2"; \ + echo; \ + for b in $$bases; do echo $$b; done \ + | $(am__create_global_log); \ + } >$(TEST_SUITE_LOG).tmp || exit 1; \ + mv $(TEST_SUITE_LOG).tmp $(TEST_SUITE_LOG); \ + if $$success; then \ + col="$$grn"; \ + else \ + col="$$red"; \ + test x"$$VERBOSE" = x || cat $(TEST_SUITE_LOG); \ + fi; \ + echo "$${col}$$br$${std}"; \ + echo "$${col}Testsuite summary for $(PACKAGE_STRING)$${std}"; \ + echo "$${col}$$br$${std}"; \ + create_testsuite_report --maybe-color; \ + echo "$$col$$br$$std"; \ + if $$success; then :; else \ + echo "$${col}See $(subdir)/$(TEST_SUITE_LOG)$${std}"; \ + if test -n "$(PACKAGE_BUGREPORT)"; then \ + echo "$${col}Please report to $(PACKAGE_BUGREPORT)$${std}"; \ + fi; \ + echo "$$col$$br$$std"; \ + fi; \ + $$success || exit 1 + +check-TESTS: + @list='$(RECHECK_LOGS)'; test -z "$$list" || rm -f $$list + @list='$(RECHECK_LOGS:.log=.trs)'; test -z "$$list" || rm -f $$list + @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) + @set +e; $(am__set_TESTS_bases); \ + log_list=`for i in $$bases; do echo $$i.log; done`; \ + trs_list=`for i in $$bases; do echo $$i.trs; done`; \ + log_list=`echo $$log_list`; trs_list=`echo $$trs_list`; \ + $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) TEST_LOGS="$$log_list"; \ + exit $$?; +recheck: all + @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) + @set +e; $(am__set_TESTS_bases); \ + bases=`for i in $$bases; do echo $$i; done \ + | $(am__list_recheck_tests)` || exit 1; \ + log_list=`for i in $$bases; do echo $$i.log; done`; \ + log_list=`echo $$log_list`; \ + $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) \ + am__force_recheck=am--force-recheck \ + TEST_LOGS="$$log_list"; \ + exit $$? +nftest.log: nftest$(EXEEXT) + @p='nftest$(EXEEXT)'; \ + b='nftest'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test.sh.log: test.sh + @p='test.sh'; \ + b='test.sh'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +.test.log: + @p='$<'; \ + $(am__set_b); \ + $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +@am__EXEEXT_TRUE@.test$(EXEEXT).log: +@am__EXEEXT_TRUE@ @p='$<'; \ +@am__EXEEXT_TRUE@ $(am__set_b); \ +@am__EXEEXT_TRUE@ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ +@am__EXEEXT_TRUE@ --log-file $$b.log --trs-file $$b.trs \ +@am__EXEEXT_TRUE@ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ +@am__EXEEXT_TRUE@ "$$tst" $(AM_TESTS_FD_REDIRECT) + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am + $(MAKE) $(AM_MAKEFLAGS) check-TESTS +check: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) check-am +all-am: Makefile $(PROGRAMS) +installdirs: + for dir in "$(DESTDIR)$(bindir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) 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: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + -test -z "$(TEST_LOGS)" || rm -f $(TEST_LOGS) + -test -z "$(TEST_LOGS:.log=.trs)" || rm -f $(TEST_LOGS:.log=.trs) + -test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) + +clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + -rm -f ../extra/nftrack/$(DEPDIR)/$(am__dirstamp) + -rm -f ../extra/nftrack/$(am__dirstamp) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." + -rm -f grammar.c + -rm -f grammar.h + -rm -f scanner.c + -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) +clean: clean-am + +clean-am: clean-binPROGRAMS clean-generic mostlyclean-am + +distclean: distclean-am + -rm -rf ../extra/nftrack/$(DEPDIR) ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: install-binPROGRAMS + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ../extra/nftrack/$(DEPDIR) ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-binPROGRAMS + +.MAKE: all check check-am install install-am install-strip + +.PHONY: CTAGS GTAGS TAGS all all-am check check-TESTS check-am clean \ + clean-binPROGRAMS clean-generic cscopelist-am ctags ctags-am \ + distclean distclean-compile distclean-generic distclean-tags \ + distdir dvi dvi-am html html-am info info-am install \ + install-am install-binPROGRAMS install-data install-data-am \ + install-dvi install-dvi-am install-exec install-exec-am \ + install-html install-html-am install-info install-info-am \ + install-man install-pdf install-pdf-am install-ps \ + install-ps-am install-strip installcheck installcheck-am \ + installdirs maintainer-clean maintainer-clean-generic \ + mostlyclean mostlyclean-compile mostlyclean-generic pdf pdf-am \ + ps ps-am recheck tags tags-am uninstall uninstall-am \ + uninstall-binPROGRAMS + + +# 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: diff --git a/bin/applybits_inline.c b/bin/applybits_inline.c new file mode 100755 index 0000000..a35fbb6 --- /dev/null +++ b/bin/applybits_inline.c @@ -0,0 +1,92 @@ +/* + * Copyright (c) 2014, Peter Haag + * Copyright (c) 2009, Peter Haag + * Copyright (c) 2004-2008, SWITCH - Teleinformatikdienste fuer Lehre und Forschung + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of the author nor the names of its contributors may be + * used to endorse or promote products derived from this software without + * specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 COPYRIGHT OWNER 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. + * + * $Author: haag $ + * + * $Id: applybits_inline.c 39 2009-11-25 08:11:15Z haag $ + * + * $LastChangedRevision: 39 $ + * + */ + +static inline void ApplyNetMaskBits(master_record_t *flow_record, int apply_netbits); + +static inline void ApplyNetMaskBits(master_record_t *flow_record, int apply_netbits) { + + if ( (flow_record->flags & FLAG_IPV6_ADDR ) != 0 ) { // IPv6 + if ( apply_netbits & 1 ) { + uint64_t mask; + uint32_t mask_bits = flow_record->src_mask; + if ( mask_bits > 64 ) { + mask = 0xffffffffffffffffLL << ( 128 - mask_bits ); + flow_record->v6.srcaddr[1] &= mask; + } else { + mask = 0xffffffffffffffffLL << ( 64 - mask_bits ); + flow_record->v6.srcaddr[0] &= mask; + flow_record->v6.srcaddr[1] = 0; + } + } + if ( apply_netbits & 2 ) { + uint64_t mask; + uint32_t mask_bits = flow_record->dst_mask; + + if ( mask_bits > 64 ) { + mask = 0xffffffffffffffffLL << ( 128 - mask_bits ); + flow_record->v6.dstaddr[1] &= mask; + } else { + mask = 0xffffffffffffffffLL << ( 64 - mask_bits ); + flow_record->v6.dstaddr[0] &= mask; + flow_record->v6.dstaddr[1] = 0; + } + } + } else { // IPv4 + if ( apply_netbits & 1 ) { + uint32_t srcmask = 0xffffffff << ( 32 - flow_record->src_mask ); + flow_record->v4.srcaddr &= srcmask; + } + if ( apply_netbits & 2 ) { + uint32_t dstmask = 0xffffffff << ( 32 - flow_record->dst_mask ); + flow_record->v4.dstaddr &= dstmask; + } + } + +} // End of ApplyNetMaskBits + +static inline void ApplyAggrMask(master_record_t *record, master_record_t *mask) { +uint64_t *r = (uint64_t *)record; +uint64_t *m = (uint64_t *)mask; +int i, max_offset; + + max_offset = offsetof(master_record_t, map_ref) >> 3; + for (i=2; i +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#ifdef HAVE_STDINT_H +#include +#endif + +#ifndef HAVE_SEMUN +union semun { + int val; // value for SETVAL + struct semid_ds *buf; // buffer for IPC_STAT & IPC_SET + u_short *array; // array for GETALL & SETALL +}; +#endif + +#include "config.h" + +#include "bookkeeper.h" + +static bookkeeper_list_t *bookkeeper_list = NULL; + +/* function prototypes */ + +/* + * bookkeeper.c is needed for daemon code as well as normal stdio code + * therefore a generic LogError is defined, which maps to the + * approriate logging channel - either stderr or syslog + */ +void LogError(char *format, ...); + +static key_t _ftok(const char *path, int id); + +static void sem_lock(int sem_set_id); + +static void sem_unlock(int sem_set_id); + +static inline bookkeeper_list_t *Get_bookkeeper_list_entry(bookkeeper_t *bookkeeper); + +/* Create shared memory object and set its size */ + +/* our own ftok implementation - the standard C library ftok is not reliable enough */ +static key_t _ftok(const char *path, int id) { +struct stat st; + + if (stat(path, &st) < 0) + return (key_t)-1; + + return (key_t) ( ((st.st_dev & 0xffff) << 16) ^ st.st_ino ) + id; +} + + +// locks the semaphore, for exclusive access to the bookkeeping record +static void sem_lock(int sem_set_id) { +struct sembuf sem_op; + + /* wait on the semaphore, unless it's value is non-negative. */ + sem_op.sem_num = 0; + sem_op.sem_op = -1; + sem_op.sem_flg = 0; + if ( semop(sem_set_id, &sem_op, 1) == 0 ) + return; + + LogError("semop() error in %s line %d: %s", __FILE__, __LINE__, strerror(errno) ); + +} // End of sem_lock + +// sem_unlock. un-locks the semaphore. +static void sem_unlock(int sem_set_id) { +struct sembuf sem_op; + + /* signal the semaphore - increase its value by one. */ + sem_op.sem_num = 0; + sem_op.sem_op = 1; + sem_op.sem_flg = 0; + if ( semop(sem_set_id, &sem_op, 1) == 0 ) + return; + + LogError("semop() error in %s line %d: %s", __FILE__, __LINE__, strerror(errno) ); + +} // End of sem_unlock + +static inline bookkeeper_list_t *Get_bookkeeper_list_entry(bookkeeper_t *bookkeeper) { +bookkeeper_list_t *bookkeeper_list_entry; + + if ( bookkeeper == NULL ) + return NULL; + + bookkeeper_list_entry = bookkeeper_list; + while ( bookkeeper_list_entry != NULL && bookkeeper_list_entry->bookkeeper != bookkeeper ) + bookkeeper_list_entry = bookkeeper_list_entry->next; + + return bookkeeper_list_entry; + +} // End of Get_bookkeeper_list_entry + +int InitBookkeeper(bookkeeper_t **bookkeeper, char *path, pid_t nfcapd_pid, pid_t launcher_pid) { +int sem_key, shm_key, shm_id, sem_id; +union semun sem_val; +bookkeeper_list_t **bookkeeper_list_entry; + + *bookkeeper = NULL; + + shm_key = _ftok(path, 1); + if ( shm_key == - 1 ) + return ERR_PATHACCESS; + + // check if the shared memory is already allocated + shm_id = shmget(shm_key, sizeof(bookkeeper_t), 0600); + + if ( shm_id >= 0 ) { + // the segment already exists. Either a running process is active + // or an unclean shutdown happened + + // map the segement and check the record + *bookkeeper = (bookkeeper_t *)shmat(shm_id, NULL, 0); + if ( *bookkeeper == (bookkeeper_t *)-1 ) { + LogError("shmat() error in %s line %d: %s", __FILE__, __LINE__, strerror(errno) ); + return ERR_FAILED; + } + if ( (*bookkeeper)->nfcapd_pid <= 0 ) { + // rubbish or invalid pid of nfcapd process. + // Assume unclean shutdown or something else. We clean up and take this record. + memset((void *)(*bookkeeper), 0, sizeof(bookkeeper_t)); + } else { + // check if the process created this record is still alive + int ret = kill((*bookkeeper)->nfcapd_pid, 0); + if ( ret == - 1 ) { + switch (errno) { + case ESRCH: + // process does not exist, we can clean up this record and use it + memset((void *)(*bookkeeper), 0, sizeof(bookkeeper_t)); + break; + case EPERM: + // A process exists, but we are not allowed to signal this process + LogError("Another collector with pid %i but different user ID is already running, and configured for '%s'", + (*bookkeeper)->nfcapd_pid, path); + return ERR_EXISTS; + break; + default: + // This should never happen, but catch it anyway + LogError("semop() error in %s line %d: %s", __FILE__, __LINE__, strerror(errno) ); + return ERR_FAILED; + } + } else { + // process exists; + LogError("Another collector with pid %i is already running, and configured for '%s'", + (*bookkeeper)->nfcapd_pid, path); + return ERR_EXISTS; + } + // if we pass this point, we have recycled an existing record + + } + } else { + // no valid shared segment was found + switch (errno) { + case ENOENT: + // this is ok - no shared segemtn exists, we can create a new one below + break; + case EACCES: + // there is such a segment, but we are not allowed to get it + // Assume it's another nfcapd + LogError("Access denied to collector bookkeeping record."); + return ERR_EXISTS; + break; + default: + // This should never happen, but catch it anyway + LogError("semop() error in %s line %d: %s", __FILE__, __LINE__, strerror(errno) ); + return ERR_FAILED; + } + // we now create a new segement, this hould not fail now + shm_id = shmget(shm_key, sizeof(bookkeeper_t), IPC_CREAT | 0600); + if ( shm_id == - 1 ) { + // but did anyway - give up + LogError("shmget() error in %s line %d: %s", __FILE__, __LINE__, strerror(errno) ); + return ERR_FAILED; + } + *bookkeeper = (bookkeeper_t *)shmat(shm_id, NULL, 0); + if ( (*bookkeeper) == (bookkeeper_t *)-1 ) { + LogError("shmget() error in %s line %d: %s", __FILE__, __LINE__, strerror(errno) ); + return ERR_FAILED; + } + memset((void *)(*bookkeeper), 0, sizeof(bookkeeper_t)); + } + // at this point we now have a valid record and can proceed + (*bookkeeper)->nfcapd_pid = nfcapd_pid; + (*bookkeeper)->launcher_pid = launcher_pid; + (*bookkeeper)->sequence++; + + // create semaphore + + sem_key = _ftok(path, 2); + // this should never fail, as we aleady got a key for the shared memory + if ( sem_key == - 1 ) { + // .. but catch it anyway .. and release shared memory. something is fishy + struct shmid_ds buf; + shmdt((void *)(*bookkeeper)); + shmctl(shm_id, IPC_RMID, &buf); + return ERR_FAILED; + } + + // get the semaphore + sem_id = semget(sem_key, 1, IPC_CREAT | 0600); + if ( sem_id == - 1 ) { + struct shmid_ds buf; + + // this should not have failed + LogError("semget() error in %s line %d: %s", __FILE__, __LINE__, strerror(errno) ); + + // release shared memory + shmdt((void *)(*bookkeeper)); + shmctl(shm_id, IPC_RMID, &buf); + return ERR_FAILED; + } + + // initialize the semaphore + sem_val.val = 1; + if ( semctl(sem_id, 0, SETVAL, sem_val) == -1) { + struct shmid_ds buf; + + // this should not have failed + LogError("semctl() error in %s line %d: %s", __FILE__, __LINE__, strerror(errno) ); + + // release shared memory + shmdt((void *)(*bookkeeper)); + shmctl(shm_id, IPC_RMID, &buf); + return ERR_FAILED; + } + + bookkeeper_list_entry = &bookkeeper_list; + while ( *bookkeeper_list_entry != NULL ) + bookkeeper_list_entry = &((*bookkeeper_list_entry)->next); + + (*bookkeeper_list_entry) = (bookkeeper_list_t *)malloc(sizeof(bookkeeper_list_t)); + if ( !*bookkeeper_list_entry ) { + struct shmid_ds buf; + + LogError("malloc() error in %s line %d: %s", __FILE__, __LINE__, strerror(errno) ); + shmdt((void *)(*bookkeeper)); + shmctl(shm_id, IPC_RMID, &buf); + semctl( sem_id, 0, IPC_RMID ); + return ERR_FAILED; + } + memset((void *)*bookkeeper_list_entry, 0, sizeof(bookkeeper_list_t)); + + (*bookkeeper_list_entry)->shm_id = shm_id; + (*bookkeeper_list_entry)->sem_id = sem_id; + (*bookkeeper_list_entry)->bookkeeper = *bookkeeper; + (*bookkeeper_list_entry)->next = NULL; + + // we are done + return BOOKKEEPER_OK; + +} // End of InitBookkeeper + +int AccessBookkeeper(bookkeeper_t **bookkeeper, char *path) { +bookkeeper_list_t **bookkeeper_list_entry; +int sem_key, shm_key, shm_id, sem_id; + + *bookkeeper = NULL; + + shm_key = _ftok(path, 1); + if ( shm_key == - 1 ) + return ERR_PATHACCESS; + + // check if the shared memory is already allocated + shm_id = shmget(shm_key, sizeof(bookkeeper_t), 0600); + + if ( shm_id < 0 ) { + // the segment does not exists. Check why + + switch (errno) { + case ENOENT: + // no shared segemtn exists. + return ERR_NOTEXISTS; + break; + case EACCES: + // there is such a segment, but we are not allowed to get it + // Assume it's another nfcapd + LogError("Access denied to collector bookkeeping record."); + return ERR_FAILED; + break; + default: + // This should never happen, but catch it anyway + LogError("semop() error in %s line %d: %s", __FILE__, __LINE__, strerror(errno) ); + return ERR_FAILED; + } + // not reached + } + // at this point we now have a valid record and can proceed + + // create semaphore + sem_key = _ftok(path, 2); + // this should never fail, as we aleady got a key for the shared memory + if ( sem_key == - 1 ) { + // .. but catch it anyway .. and release shared memory. something is fishy + return ERR_FAILED; + } + + // get the semaphore + sem_id = semget(sem_key, 1, 0600); + if ( sem_id == - 1 ) { + // this should not have failed + LogError("semget() error in %s line %d: %s", __FILE__, __LINE__, strerror(errno) ); + + return ERR_FAILED; + } + + // map the shared segment + *bookkeeper = (bookkeeper_t *)shmat(shm_id, NULL, 0); + if ( *bookkeeper == (bookkeeper_t *)-1 ) { + LogError("shmat() error in %s line %d: %s", __FILE__, __LINE__, strerror(errno) ); + return ERR_FAILED; + } + + bookkeeper_list_entry = &bookkeeper_list; + while ( *bookkeeper_list_entry != NULL && (*bookkeeper_list_entry)->bookkeeper != NULL ) + bookkeeper_list_entry = &((*bookkeeper_list_entry)->next); + + // allocate new slot, else use unused slot + if ( *bookkeeper_list_entry == NULL ) { + (*bookkeeper_list_entry) = (bookkeeper_list_t *)malloc(sizeof(bookkeeper_list_t)); + if ( !*bookkeeper_list_entry ) { + LogError("malloc() error in %s line %d: %s", __FILE__, __LINE__, strerror(errno) ); + return ERR_FAILED; + } + memset((void *)*bookkeeper_list_entry, 0, sizeof(bookkeeper_list_t)); + } + + (*bookkeeper_list_entry)->shm_id = shm_id; + (*bookkeeper_list_entry)->sem_id = sem_id; + (*bookkeeper_list_entry)->bookkeeper = *bookkeeper; + (*bookkeeper_list_entry)->next = NULL; + + return BOOKKEEPER_OK; + + +} // End of AccessBookkeeper + +void ReleaseBookkeeper(bookkeeper_t *bookkeeper, int destroy) { +bookkeeper_list_t *bookkeeper_list_entry; +struct shmid_ds buf; + + if ( !bookkeeper ) + return; + + bookkeeper_list_entry = Get_bookkeeper_list_entry(bookkeeper); + if ( !bookkeeper_list_entry ) { + // this should never happen + LogError("Software error in %s line %d: %s", __FILE__, __LINE__, "Entry not found in list"); + return; + } + + // detach from my process addr space memory + if ( shmdt((void *)bookkeeper) == -1 ) { + // ups .. + LogError("shmdt() error in %s line %d: %s", __FILE__, __LINE__, strerror(errno) ); + } + bookkeeper = NULL; + + if ( destroy == 0 ) { + // Entry no longer valid + bookkeeper_list_entry->bookkeeper = NULL; + bookkeeper_list_entry->shm_id = 0; + bookkeeper_list_entry->sem_id = 0; + return; + } + + // prevent other proceeses to access the share memory, while we are removing it + // try to clean up. + sem_lock(bookkeeper_list_entry->sem_id); + if ( shmctl(bookkeeper_list_entry->shm_id, IPC_RMID, &buf) ) { + // ups .. + LogError("shmctl() error in %s line %d: %s", __FILE__, __LINE__, strerror(errno) ); + } + sem_unlock(bookkeeper_list_entry->sem_id); + + if ( semctl( bookkeeper_list_entry->sem_id, 0, IPC_RMID ) == -1 ) { + // ups .. + LogError("semctl() error in %s line %d: %s", __FILE__, __LINE__, strerror(errno) ); + } + + // Entry no longer valid + bookkeeper_list_entry->bookkeeper = NULL; + bookkeeper_list_entry->shm_id = 0; + bookkeeper_list_entry->sem_id = 0; + + +} // End of ReleaseBookkeeper + +int LookBooks(bookkeeper_t *bookkeeper) { +bookkeeper_list_t *bookkeeper_list_entry; + + if ( !bookkeeper ) + return 0; + + bookkeeper_list_entry = Get_bookkeeper_list_entry(bookkeeper); + if ( !bookkeeper_list_entry ) { + // this should never happen + LogError("Software error in %s line %d: %s", __FILE__, __LINE__, "Entry not found in list"); + return 1; + } + + sem_lock(bookkeeper_list_entry->sem_id); + + return 0; + +} // End of LookBooks + +int UnlookBooks(bookkeeper_t *bookkeeper) { +bookkeeper_list_t *bookkeeper_list_entry; + + if ( !bookkeeper ) + return 0; + + bookkeeper_list_entry = Get_bookkeeper_list_entry(bookkeeper); + if ( !bookkeeper_list_entry ) { + // this should never happen + LogError("Software error in %s line %d: %s", __FILE__, __LINE__, "Entry not found in list"); + return 1; + } + + sem_unlock(bookkeeper_list_entry->sem_id); + + return 0; + +} // End of UnlookBooks + +void ClearBooks(bookkeeper_t *bookkeeper, bookkeeper_t *tmp_books) { +bookkeeper_list_t *bookkeeper_list_entry; + + if ( !bookkeeper ) + return; + + bookkeeper_list_entry = Get_bookkeeper_list_entry(bookkeeper); + if ( !bookkeeper_list_entry ) { + // this should never happen + LogError("Software error in %s line %d: %s", __FILE__, __LINE__, "Entry not found in list"); + return; + } + + sem_lock(bookkeeper_list_entry->sem_id); + // backup copy + if ( tmp_books != NULL ) { + memcpy((void *)tmp_books, (void *)bookkeeper, sizeof(bookkeeper_t)); + } + bookkeeper->first = 0; + bookkeeper->last = 0; + bookkeeper->numfiles = 0; + bookkeeper->filesize = 0; + bookkeeper->sequence++; + sem_unlock(bookkeeper_list_entry->sem_id); + +} // End of ClearBooks + +uint64_t BookSequence(bookkeeper_t *bookkeeper) { +bookkeeper_list_t *bookkeeper_list_entry; +uint64_t seq; + + if ( !bookkeeper ) + return 0; + + bookkeeper_list_entry = Get_bookkeeper_list_entry(bookkeeper); + if ( !bookkeeper_list_entry ) { + // this should never happen + LogError("Software error in %s line %d: %s", __FILE__, __LINE__, "Entry not found in list"); + return 0; + } + + sem_lock(bookkeeper_list_entry->sem_id); + seq = bookkeeper->sequence; + sem_unlock(bookkeeper_list_entry->sem_id); + + return seq; + +} // End of BookSequence + +void UpdateBooks(bookkeeper_t *bookkeeper, time_t when, uint64_t size) { +bookkeeper_list_t *bookkeeper_list_entry; + + if ( !bookkeeper ) + return; + + bookkeeper_list_entry = Get_bookkeeper_list_entry(bookkeeper); + if ( !bookkeeper_list_entry ) { + // this should never happen + LogError("Software error in %s line %d: %s", __FILE__, __LINE__, "Entry not found in list"); + return; + } + + sem_lock(bookkeeper_list_entry->sem_id); + if ( bookkeeper->first == 0 ) + bookkeeper->first = when; + + bookkeeper->last = when; + bookkeeper->numfiles++; + bookkeeper->filesize += size; + bookkeeper->sequence++; + sem_unlock(bookkeeper_list_entry->sem_id); + +} // End of UpdateBooks + +void UpdateBooksParam(bookkeeper_t *bookkeeper, time_t lifetime, uint64_t maxsize) { +bookkeeper_list_t *bookkeeper_list_entry; + + if ( !bookkeeper ) + return; + + bookkeeper_list_entry = Get_bookkeeper_list_entry(bookkeeper); + if ( !bookkeeper_list_entry ) { + // this should never happen + LogError("Software error in %s line %d: %s", __FILE__, __LINE__, "Entry not found in list"); + return; + } + + sem_lock(bookkeeper_list_entry->sem_id); + bookkeeper->max_lifetime = lifetime; + bookkeeper->max_filesize = maxsize; + bookkeeper->sequence++; + sem_unlock(bookkeeper_list_entry->sem_id); + +} // End of UpdateBooksParam + +void PrintBooks(bookkeeper_t *bookkeeper) { +bookkeeper_list_t *bookkeeper_list_entry; +struct tm *ts; +time_t t; +char string[32]; + + if ( !bookkeeper ) { + printf("No bookkeeper record available!\n"); + return; + } + + bookkeeper_list_entry = Get_bookkeeper_list_entry(bookkeeper); + if ( !bookkeeper_list_entry ) { + // this should never happen + LogError("Software error in %s line %d: %s", __FILE__, __LINE__, "Entry not found in list"); + return; + } + + sem_lock(bookkeeper_list_entry->sem_id); + printf("Collector process: %lu\n", (unsigned long)bookkeeper->nfcapd_pid); + if ( bookkeeper->launcher_pid ) + printf("Launcher process: %lu\n", (unsigned long)bookkeeper->launcher_pid); + else + printf("Launcher process: \n"); + printf("Record sequence : %llu\n", (unsigned long long)bookkeeper->sequence); + + t = bookkeeper->first; + ts = localtime(&t); + strftime(string, 31, "%Y-%m-%d %H:%M:%S", ts); + string[31] = '\0'; + printf("First : %s\n", bookkeeper->first ? string : ""); + + t = bookkeeper->last; + ts = localtime(&t); + strftime(string, 31, "%Y-%m-%d %H:%M:%S", ts); + string[31] = '\0'; + printf("Last : %s\n", bookkeeper->last ? string : ""); + printf("Number of files : %llu\n", (unsigned long long)bookkeeper->numfiles); + printf("Total file size : %llu\n", (unsigned long long)bookkeeper->filesize); + printf("Max file size : %llu\n", (unsigned long long)bookkeeper->max_filesize); + printf("Max life time : %llu\n", (unsigned long long)bookkeeper->max_lifetime); + sem_unlock(bookkeeper_list_entry->sem_id); + +} // End of PrintBooks + diff --git a/bin/bookkeeper.h b/bin/bookkeeper.h new file mode 100644 index 0000000..3ed3e08 --- /dev/null +++ b/bin/bookkeeper.h @@ -0,0 +1,100 @@ +/* + * Copyright (c) 2014, Peter Haag + * Copyright (c) 2009, Peter Haag + * Copyright (c) 2004-2008, SWITCH - Teleinformatikdienste fuer Lehre und Forschung + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of the author nor the names of its contributors may be + * used to endorse or promote products derived from this software without + * specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 COPYRIGHT OWNER 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. + * + * $Author: haag $ + * + * $Id: bookkeeper.h 39 2009-11-25 08:11:15Z haag $ + * + * $LastChangedRevision: 39 $ + * + * + */ + +#ifndef _BOOKKEEPER_H +#define _BOOKKEEPER_H 1 + +enum { BOOKKEEPER_OK = 0, ERR_FAILED, ERR_NOTEXISTS, ERR_PATHACCESS, ERR_EXISTS }; + +#define DETACH_ONLY 0 +#define DESTROY_BOOKKEEPER 1 + +typedef struct bookkeeper_s { + // collector infos + pid_t nfcapd_pid; + pid_t launcher_pid; + + // track info + uint64_t sequence; + + // file infos + time_t first; + time_t last; + uint64_t numfiles; + uint64_t filesize; + uint64_t max_filesize; + uint64_t max_lifetime; + + +} bookkeeper_t; + +// All bookkeepers are put into a linked list, to have all the shm_id,sem_id +typedef struct bookkeeper_list_s { + struct bookkeeper_list_s *next; + + bookkeeper_t *bookkeeper; + + // shared parameters + int sem_id; + int shm_id; + +} bookkeeper_list_t; + +/* function prototypes */ +int InitBookkeeper(bookkeeper_t **bookkeeper, char *path, pid_t nfcapd_pid, pid_t launcher_pid); + +int AccessBookkeeper(bookkeeper_t **bookkeeper, char *path); + +void ReleaseBookkeeper(bookkeeper_t *bookkeeper, int destroy); + +void ClearBooks(bookkeeper_t *bookkeeper, bookkeeper_t *tmp_books); + +int LookBooks(bookkeeper_t *bookkeeper); + +int UnlookBooks(bookkeeper_t *bookkeeper); + +uint64_t BookSequence(bookkeeper_t *bookkeeper); + +void UpdateBooks(bookkeeper_t *bookkeeper, time_t when, uint64_t size); + +void UpdateBooksParam(bookkeeper_t *bookkeeper, time_t lifetime, uint64_t maxsize); + +void PrintBooks(bookkeeper_t *bookkeeper); + +#endif //_BOOKKEEPER_H diff --git a/bin/collector.c b/bin/collector.c new file mode 100755 index 0000000..ef1ee58 --- /dev/null +++ b/bin/collector.c @@ -0,0 +1,676 @@ +/* + * Copyright (c) 2014, Peter Haag + * Copyright (c) 2009, Peter Haag + * Copyright (c) 2008, SWITCH - Teleinformatikdienste fuer Lehre und Forschung + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of the author nor the names of its contributors may be + * used to endorse or promote products derived from this software without + * specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 COPYRIGHT OWNER 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. + * + * $Author: haag $ + * + * $Id: collector.c 69 2010-09-09 07:17:43Z haag $ + * + * $LastChangedRevision: 69 $ + * + */ + +#include "config.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#ifdef HAVE_STDINT_H +#include +#endif + +#ifndef DEVEL +# define dbg_printf(...) /* printf(__VA_ARGS__) */ +#else +# define dbg_printf(...) printf(__VA_ARGS__) +#endif + +#include "util.h" +#include "nf_common.h" +#include "nffile.h" +#include "nfxstat.h" +#include "bookkeeper.h" +#include "collector.h" +#include "nfx.h" + +#include "nffile_inline.c" + +/* globals */ +uint32_t default_sampling = 1; +uint32_t overwrite_sampling = 0; + +/* local variables */ +static uint32_t exporter_sysid = 0; +static char *DynamicSourcesDir = NULL; + +/* local prototypes */ +static uint32_t AssignExporterID(void); + +/* local functions */ +static uint32_t AssignExporterID(void) { + + if ( exporter_sysid >= 0xFFFF ) { + LogError("Too many exporters (id > 65535). Flow records collected but without reference to exporter"); + return 0; + } + + return ++exporter_sysid; + +} // End of AssignExporterID + +/* global functions */ + +int SetDynamicSourcesDir(FlowSource_t **FlowSource, char *dir) { + + if ( *FlowSource ) + return 0; + + DynamicSourcesDir = dir; + return 1; + +} // End of SetDynamicSourcesDir + +int AddFlowSource(FlowSource_t **FlowSource, char *ident) { +FlowSource_t **source; +struct stat fstat; +char *p, *q, s[MAXPATHLEN]; +int has_any_source = 0; +int ok; + + if ( DynamicSourcesDir ) + return 0; + + source = FlowSource; + while ( *source ) { + has_any_source |= (*source)->any_source; + source = &((*source)->next); + } + if ( has_any_source ) { + fprintf(stderr, "Ambiguous idents not allowed\n"); + return 0; + } + + *source = (FlowSource_t *)calloc(1, sizeof(FlowSource_t)); + if ( !*source ) { + LogError("malloc() error in %s line %d: %s\n", __FILE__, __LINE__, strerror(errno) ); + return 0; + } + (*source)->next = NULL; + (*source)->bookkeeper = NULL; + (*source)->any_source = 0; + (*source)->exporter_data = NULL; + (*source)->xstat = NULL; + (*FlowSource)->exporter_count = 0; + + // separate IP address from ident + if ( ( p = strchr(ident, ',')) == NULL ) { + fprintf(stderr, "Syntax error for netflow source definition. Expect -n ident,IP,path\n"); + return 0; + } + *p++ = '\0'; + + // separate path from IP + if ( ( q = strchr(p, ',')) == NULL ) { + fprintf(stderr, "Syntax error for netflow source definition. Expect -n ident,IP,path\n"); + return 0; + } + *q++ = '\0'; + + if ( strchr(p, ':') != NULL ) { + uint64_t _ip[2]; + ok = inet_pton(PF_INET6, p, _ip); + (*source)->sa_family = PF_INET6; + (*source)->ip.v6[0] = ntohll(_ip[0]); + (*source)->ip.v6[1] = ntohll(_ip[1]); + } else { + uint32_t _ip; + ok = inet_pton(PF_INET, p, &_ip); + (*source)->sa_family = PF_INET; + (*source)->ip.v6[0] = 0; + (*source)->ip.v6[1] = 0; + (*source)->ip.v4 = ntohl(_ip); + } + switch (ok) { + case 0: + fprintf(stderr, "Unparsable IP address: %s\n", p); + return 0; + case 1: + // success + break; + case -1: + fprintf(stderr, "Error while parsing IP address: %s\n", strerror(errno)); + return 0; + break; + } + + // fill in ident + if ( strlen(ident) >= IDENTLEN ) { + fprintf(stderr, "Source identifier too long: %s\n", ident); + return 0; + } + if ( strchr(ident, ' ') ) { + fprintf(stderr,"Illegal characters in ident %s\n", ident); + exit(255); + } + strncpy((*source)->Ident, ident, IDENTLEN-1 ); + (*source)->Ident[IDENTLEN-1] = '\0'; + + if ( strlen(q) >= MAXPATHLEN ) { + fprintf(stderr,"Path too long: %s\n", q); + exit(255); + } + + // check for existing path + if ( stat(q, &fstat) ) { + fprintf(stderr, "stat() error %s: %s\n", q, strerror(errno)); + return 0; + } + if ( !(fstat.st_mode & S_IFDIR) ) { + fprintf(stderr, "No such directory: %s\n", q); + return 0; + } + + // remember path + (*source)->datadir = strdup(q); + if ( !(*source)->datadir ) { + fprintf(stderr, "strdup() error: %s\n", strerror(errno)); + return 0; + } + + // cache current collector file + if ( snprintf(s, MAXPATHLEN-1, "%s/%s.%lu", (*source)->datadir , NF_DUMPFILE, (unsigned long)getpid() ) >= (MAXPATHLEN-1)) { + fprintf(stderr, "Path too long: %s\n", q); + return 0; + } + (*source)->current = strdup(s); + if ( !(*source)->current ) { + fprintf(stderr, "strdup() error: %s\n", strerror(errno)); + return 0; + } + + return 1; + +} // End of AddFlowSource + +int AddDefaultFlowSource(FlowSource_t **FlowSource, char *ident, char *path) { +struct stat fstat; +char s[MAXPATHLEN]; + + if ( DynamicSourcesDir ) + return 0; + + *FlowSource = (FlowSource_t *)calloc(1,sizeof(FlowSource_t)); + if ( !*FlowSource ) { + fprintf(stderr, "calloc() allocation error: %s\n", strerror(errno)); + return 0; + } + (*FlowSource)->next = NULL; + (*FlowSource)->bookkeeper = NULL; + (*FlowSource)->any_source = 1; + (*FlowSource)->exporter_data = NULL; + (*FlowSource)->xstat = NULL; + (*FlowSource)->exporter_count = 0; + + // fill in ident + if ( strlen(ident) >= IDENTLEN ) { + fprintf(stderr, "Source identifier too long: %s\n", ident); + return 0; + } + if ( strchr(ident, ' ') ) { + fprintf(stderr,"Illegal characters in ident %s\n", ident); + return 0; + } + strncpy((*FlowSource)->Ident, ident, IDENTLEN-1 ); + (*FlowSource)->Ident[IDENTLEN-1] = '\0'; + + if ( strlen(path) >= MAXPATHLEN ) { + fprintf(stderr,"Path too long: %s\n",path); + return 0; + } + + // check for existing path + if ( stat(path, &fstat) ) { + fprintf(stderr, "stat() error %s: %s\n", path, strerror(errno)); + return 0; + } + if ( !(fstat.st_mode & S_IFDIR) ) { + fprintf(stderr, "No such directory: %s\n", path); + return 0; + } + + // remember path + (*FlowSource)->datadir = strdup(path); + if ( !(*FlowSource)->datadir ) { + fprintf(stderr, "strdup() error: %s\n", strerror(errno)); + return 0; + } + + // cache current collector file + if ( snprintf(s, MAXPATHLEN-1, "%s/%s.%lu", (*FlowSource)->datadir , NF_DUMPFILE, (unsigned long)getpid() ) >= (MAXPATHLEN-1)) { + fprintf(stderr, "Path too long: %s\n", path); + return 0; + } + (*FlowSource)->current = strdup(s); + if ( !(*FlowSource)->current ) { + fprintf(stderr, "strdup() error: %s\n", strerror(errno)); + return 0; + } + + return 1; + +} // End of AddDefaultFlowSource + +FlowSource_t *AddDynamicSource(FlowSource_t **FlowSource, struct sockaddr_storage *ss) { +FlowSource_t **source; +void *ptr; +char *s, ident[100], path[MAXPATHLEN]; +int err; + + union { + struct sockaddr_storage *ss; + struct sockaddr *sa; + struct sockaddr_in *sa_in; + struct sockaddr_in6 *sa_in6; + } u; + u.ss = ss; + + if ( !DynamicSourcesDir ) + return NULL; + + source = FlowSource; + while ( *source ) { + source = &((*source)->next); + } + + *source = (FlowSource_t *)calloc(1, sizeof(FlowSource_t)); + if ( !*source ) { + LogError("malloc() error in %s line %d: %s\n", __FILE__, __LINE__, strerror(errno) ); + return NULL; + } + (*source)->next = NULL; + (*source)->bookkeeper = NULL; + (*source)->any_source = 0; + (*source)->exporter_data = NULL; + (*source)->xstat = NULL; + (*FlowSource)->exporter_count = 0; + + switch (ss->ss_family) { + case PF_INET: { +#ifdef HAVE_STRUCT_SOCKADDR_STORAGE_SS_LEN + if (ss->ss_len != sizeof(struct sockaddr_in) ) { + // malformed struct + LogError("Malformed IPv4 socket struct in '%s', line '%d'", __FILE__, __LINE__ ); + free(*source); + *source = NULL; + return NULL; + } +#endif + (*source)->sa_family = PF_INET; + (*source)->ip.v6[0] = 0; + (*source)->ip.v6[1] = 0; + (*source)->ip.v4 = ntohl(u.sa_in->sin_addr.s_addr); + ptr = &u.sa_in->sin_addr; + } break; + case PF_INET6: { + uint64_t *ip_ptr = (uint64_t *)u.sa_in6->sin6_addr.s6_addr; + +#ifdef HAVE_STRUCT_SOCKADDR_STORAGE_SS_LEN + if (ss->ss_len != sizeof(struct sockaddr_in6) ) { + // malformed struct + LogError("Malformed IPv6 socket struct in '%s', line '%d'", __FILE__, __LINE__ ); + free(*source); + *source = NULL; + return NULL; + } +#endif + // ptr = &((struct sockaddr_in6 *)sa)->sin6_addr; + (*source)->sa_family = PF_INET6; + (*source)->ip.v6[0] = ntohll(ip_ptr[0]); + (*source)->ip.v6[1] = ntohll(ip_ptr[1]); + ptr = &u.sa_in6->sin6_addr; + } break; + default: + // keep compiler happy + (*source)->ip.v6[0] = 0; + (*source)->ip.v6[1] = 0; + ptr = NULL; + + LogError("Unknown sa fanily: %d in '%s', line '%d'", ss->ss_family, __FILE__, __LINE__ ); + free(*source); + *source = NULL; + return NULL; + } + + if ( !ptr ) { + free(*source); + *source = NULL; + return NULL; + } + + inet_ntop(ss->ss_family, ptr, ident, sizeof(ident)); + ident[99] = '\0'; + dbg_printf("Dynamic Flow Source IP: %s\n", ident); + + if ( strchr(ident, ':') ) { // condense IPv6 addresses + condense_v6(ident); + } + + s = ident; + while ( *s != '\0' ) { + if ( *s == '.' || *s == ':' ) + *s = '-'; + s++; + } + dbg_printf("Dynamic Flow Source ident: %s\n", ident); + + strncpy((*source)->Ident, ident, IDENTLEN-1 ); + (*source)->Ident[IDENTLEN-1] = '\0'; + + snprintf(path, MAXPATHLEN-1, "%s/%s", DynamicSourcesDir, ident); + path[MAXPATHLEN-1] = '\0'; + + err = mkdir(path, 0755); + if ( err != 0 && errno != EEXIST ) { + LogError("mkdir() error in %s line %d: %s\n", __FILE__, __LINE__, strerror(errno) ); + free(*source); + *source = NULL; + return NULL; + } + (*source)->datadir = strdup(path); + + if ( snprintf(path, MAXPATHLEN-1, "%s/%s.%lu", (*source)->datadir, NF_DUMPFILE, (unsigned long)getpid() ) >= (MAXPATHLEN-1)) { + fprintf(stderr, "Path too long: %s\n", path); + free(*source); + *source = NULL; + return NULL; + } + (*source)->current = strdup(path); + + LogInfo("Dynamically add source ident: %s in directory: %s", ident, path); + return *source; + +} // End of AddDynamicSource + +int InitExtensionMapList(FlowSource_t *fs) { + + fs->extension_map_list.maps = (extension_map_t **)calloc(BLOCK_SIZE, sizeof(extension_map_t *)); + if ( !fs->extension_map_list.maps ) { + LogError("malloc() error in %s line %d: %s\n", __FILE__, __LINE__, strerror(errno) ); + return 0; + } + fs->extension_map_list.max_maps = BLOCK_SIZE; + fs->extension_map_list.next_free = 0; + fs->extension_map_list.num_maps = 0; + + return 1; + +} // End of InitExtensionMapList + +int ReInitExtensionMapList(FlowSource_t *fs) { + + dbg_printf("Flush all extension maps!\n"); + free(fs->extension_map_list.maps); + fs->extension_map_list.maps = NULL; + + return InitExtensionMapList(fs); + +} // End of ReInitExtensionMapList + +int RemoveExtensionMap(FlowSource_t *fs, extension_map_t *map) { +int slot = map->map_id; + + dbg_printf("Remove extension map ID: %d\n", slot); + if ( slot >= fs->extension_map_list.max_maps ) { + // XXX hmm .. is simply return correct /// + LogError("*** software error *** Try to remove extension map %d, while only %d slots are available\n", slot, fs->extension_map_list.max_maps); + return 0; + } + fs->extension_map_list.maps[slot] = NULL; + + return 1; + +} // End of RemoveExtensionMap + +int AddExtensionMap(FlowSource_t *fs, extension_map_t *map) { +int next_slot = fs->extension_map_list.next_free; + + dbg_printf("Add extension map\n"); + // is it a new map, we have not yet in the list + if ( map->map_id == INIT_ID ) { + if ( next_slot >= fs->extension_map_list.max_maps ) { + // extend map list + dbg_printf("List full - extend extension list to %d slots\n", fs->extension_map_list.max_maps + BLOCK_SIZE); + extension_map_t **p = realloc((void *)fs->extension_map_list.maps, + (fs->extension_map_list.max_maps + BLOCK_SIZE ) * sizeof(extension_map_t *)); + if ( !p ) { + LogError("realloc() error in %s line %d: %s\n", __FILE__, __LINE__, strerror(errno) ); + return 0; + } + fs->extension_map_list.maps = p; + fs->extension_map_list.max_maps += BLOCK_SIZE; + } + + dbg_printf("Add map to slot %d\n", next_slot); + fs->extension_map_list.maps[next_slot] = map; + map->map_id = next_slot; + fs->extension_map_list.num_maps++; + + if ( (next_slot + 1) == fs->extension_map_list.num_maps ) { + // sequencially filled slots + // next free is next slot + fs->extension_map_list.next_free++; + dbg_printf("Next slot is sequential: %d\n", fs->extension_map_list.next_free); + } else { + // fill gap in list - search for next free + int i; + dbg_printf("Search next slot ... \n"); + for ( i = (next_slot + 1); i < fs->extension_map_list.max_maps; i++ ) { + if ( fs->extension_map_list.maps[i] == NULL ) { + // empty slot found + dbg_printf("Empty slot found at %d\n", i); + break; + } + } + // assign next_free - if none found up to max, the list will get extended + // in the next round + dbg_printf("Set next free to %d\n", i); + fs->extension_map_list.next_free = i; + } + + } + + AppendToBuffer(fs->nffile, (void *)map, map->size); + + return 1; + +} // End of AddExtensionMap + +int FlushInfoExporter(FlowSource_t *fs, exporter_info_record_t *exporter) { + + exporter->sysid = AssignExporterID(); + fs->exporter_count++; + AppendToBuffer(fs->nffile, (void *)exporter, exporter->header.size); + +#ifdef DEVEL + { + #define IP_STRING_LEN 40 + char ipstr[IP_STRING_LEN]; + printf("Flush Exporter: "); + if ( exporter->sa_family == AF_INET ) { + uint32_t _ip = htonl(exporter->ip.v4); + inet_ntop(AF_INET, &_ip, ipstr, sizeof(ipstr)); + printf("SysID: %u, IP: %16s, version: %u, ID: %2u\n", exporter->sysid, + ipstr, exporter->version, exporter->id); + } else if ( exporter->sa_family == AF_INET6 ) { + uint64_t _ip[2]; + _ip[0] = htonll(exporter->ip.v6[0]); + _ip[1] = htonll(exporter->ip.v6[1]); + inet_ntop(AF_INET6, &_ip, ipstr, sizeof(ipstr)); + printf("SysID: %u, IP: %40s, version: %u, ID: %2u\n", exporter->sysid, + ipstr, exporter->version, exporter->id); + } else { + strncpy(ipstr, "", IP_STRING_LEN); + printf("**** Exporter IP version unknown ****\n"); + } + } +#endif + + return 1; + +} // End of FlushInfoExporter + +int FlushInfoSampler(FlowSource_t *fs, sampler_info_record_t *sampler) { + + AppendToBuffer(fs->nffile, (void *)sampler, sampler->header.size); + +#ifdef DEVEL + { + printf("Flush Sampler: "); + if ( sampler->id < 0 ) { + printf("Exporter SysID: %u, Generic Sampler: mode: %u, interval: %u\n", + sampler->exporter_sysid, sampler->mode, sampler->interval); + } else { + printf("Exporter SysID: %u, Sampler: id: %i, mode: %u, interval: %u\n", + sampler->exporter_sysid, sampler->id, sampler->mode, sampler->interval); + } + } +#endif + + return 1; + +} // End of FlushInfoSampler + +void FlushStdRecords(FlowSource_t *fs) { +generic_exporter_t *e = fs->exporter_data; +int i; + + while ( e ) { + generic_sampler_t *sampler = e->sampler; + AppendToBuffer(fs->nffile, (void *)&(e->info), e->info.header.size); + while ( sampler ) { + AppendToBuffer(fs->nffile, (void *)&(sampler->info), sampler->info.header.size); + sampler = sampler->next; + } + e = e->next; + } + + for ( i=0; iextension_map_list.next_free; i++ ) { + extension_map_t *map = fs->extension_map_list.maps[i]; + if ( map ) + AppendToBuffer(fs->nffile, (void *)map, map->size); + } + +} // End of FlushStdRecords + +void FlushExporterStats(FlowSource_t *fs) { +generic_exporter_t *e = fs->exporter_data; +exporter_stats_record_t *exporter_stats; +uint32_t i, size; + + // idle collector .. + if ( !fs->exporter_count ) + return; + + size = sizeof(exporter_stats_record_t) + (fs->exporter_count -1) * sizeof(struct exporter_stat_s); + exporter_stats = ( exporter_stats_record_t *)malloc(size); + if ( !exporter_stats ) { + LogError("malloc() error in %s line %d: %s\n", __FILE__, __LINE__, strerror(errno) ); + return; + } + exporter_stats->header.type = ExporterStatRecordType; + exporter_stats->header.size = size; + exporter_stats->stat_count = fs->exporter_count; + +#ifdef DEVEL + printf("Flush Exporter Stats: %u exporters, size: %u\n", fs->exporter_count, size); +#endif + i = 0; + while ( e ) { + // prevent memory corruption - just in case .. should not happen anyway + // continue loop for error reporting after while + if ( i >= fs->exporter_count ) { + i++; + e = e->next; + continue; + } + exporter_stats->stat[i].sysid = e->info.sysid; + exporter_stats->stat[i].sequence_failure = e->sequence_failure; + exporter_stats->stat[i].packets = e->packets; + exporter_stats->stat[i].flows = e->flows; +#ifdef DEVEL + printf("Stat: SysID: %u, version: %u, ID: %2u, Packets: %llu, Flows: %llu, Sequence Failures: %u\n", e->info.sysid, + e->info.version, e->info.id, e->packets, e->flows, e->sequence_failure); + +#endif + // reset counters + e->sequence_failure = 0; + e->packets = 0; + e->flows = 0; + + i++; + e = e->next; + } + AppendToBuffer(fs->nffile, (void *)exporter_stats, size); + free(exporter_stats); + + if ( i != fs->exporter_count ) { + LogError("ERROR: exporter stats: Expected %u records, but found %u in %s line %d: %s\n", + fs->exporter_count, i, __FILE__, __LINE__, strerror(errno) ); + } + +} // End of FlushExporterStats + + + +int HasOptionTable(FlowSource_t *fs, uint16_t id ) { +option_offset_t *t; + + t = fs->option_offset_table; + while ( t && t->id != id ) + t = t->next; + + dbg_printf("Has option table: %s\n", t == NULL ? "not found" : "found"); + + return t != NULL; + +} // End of HasOptionTable diff --git a/bin/collector.h b/bin/collector.h new file mode 100755 index 0000000..c4014f6 --- /dev/null +++ b/bin/collector.h @@ -0,0 +1,184 @@ +/* + * Copyright (c) 2014, Peter Haag + * Copyright (c) 2009, Peter Haag + * Copyright (c) 2008, SWITCH - Teleinformatikdienste fuer Lehre und Forschung + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of the author nor the names of its contributors may be + * used to endorse or promote products derived from this software without + * specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 COPYRIGHT OWNER 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. + * + * $Author: haag $ + * + * $Id: collector.h 51 2010-01-29 09:01:54Z haag $ + * + * $LastChangedRevision: 51 $ + * + */ + +#ifndef _COLLECTOR_H +#define _COLLECTOR_H 1 + +#define FNAME_SIZE 256 +#define IDENT_SIZE 32 + +typedef struct srecord_s { + char fname[FNAME_SIZE]; // file name + char subdir[FNAME_SIZE]; // subdir name + char tstring[16]; // actually 12 needed e.g. 200411011230 + time_t tstamp; // UNIX time stamp + int failed; // in case of an error +} srecord_t; + +// common_record_t defines ext_map as uint_8, so max 256 extension maps allowed. +// should be enough anyway + + +typedef struct option_offset_s { + struct option_offset_s *next; + uint32_t id; // table id + uint32_t flags; // info about this map + + // sampling offsets +#define HAS_SAMPLER_DATA 1 + uint16_t offset_id; + uint16_t sampler_id_length; + uint16_t offset_mode; + uint16_t offset_interval; + +#define HAS_STD_SAMPLER_DATA 2 + uint16_t offset_std_sampler_interval; + uint16_t offset_std_sampler_algorithm; + +} option_offset_t; + +typedef struct generic_sampler_s { + struct generic_sampler_s *next; + sampler_info_record_t info; +} generic_sampler_t; + +typedef struct generic_exporter_s { + // link chain + struct generic_exporter_s *next; + + // generic exporter information + exporter_info_record_t info; + + uint64_t packets; // number of packets sent by this exporter + uint64_t flows; // number of flow records sent by this exporter + uint32_t sequence_failure; // number of sequence failues + + generic_sampler_t *sampler; + +} generic_exporter_t; + +typedef struct FlowSource_s { + // link + struct FlowSource_s *next; + + // exporter identifiers + char Ident[IDENTLEN]; + ip_addr_t ip; + uint32_t sa_family; + + int any_source; + bookkeeper_t *bookkeeper; + + // all about data storage + char *datadir; // where to store data for this source + char *current; // current file name - typically nfcad.current.pid + nffile_t *nffile; // the writing file handle + + // statistical data per source + uint32_t bad_packets; + uint64_t first_seen; // in msec + uint64_t last_seen; // in msec + + // port histogram data + xstat_t *xstat; + + // Any exporter specific data + generic_exporter_t *exporter_data; + uint32_t exporter_count; + struct timeval received; + + // extension map list + struct { +#define BLOCK_SIZE 16 + int next_free; + int max_maps; + int num_maps; + extension_map_t **maps; + } extension_map_list; + + option_offset_t *option_offset_table; + +} FlowSource_t; + +/* input buffer size, to read data from the network */ +#define NETWORK_INPUT_BUFF_SIZE 65535 // Maximum UDP message size + +// prototypes +int AddFlowSource(FlowSource_t **FlowSource, char *ident); + +int AddDefaultFlowSource(FlowSource_t **FlowSource, char *ident, char *path); + +int SetDynamicSourcesDir(FlowSource_t **FlowSource, char *dir); + +FlowSource_t *AddDynamicSource(FlowSource_t **FlowSource, struct sockaddr_storage *ss); + +int InitExtensionMapList(FlowSource_t *fs); + +int ReInitExtensionMapList(FlowSource_t *fs); + +int RemoveExtensionMap(FlowSource_t *fs, extension_map_t *map); + +int AddExtensionMap(FlowSource_t *fs, extension_map_t *map); + +void FlushStdRecords(FlowSource_t *fs); + +void FlushExporterStats(FlowSource_t *fs); + +int FlushInfoExporter(FlowSource_t *fs, exporter_info_record_t *exporter); + +int FlushInfoSampler(FlowSource_t *fs, sampler_info_record_t *sampler); + +int HasOptionTable(FlowSource_t *fs, uint16_t id ); + +void launcher (char *commbuff, FlowSource_t *FlowSource, char *process, int expire); + +/* Default time window in seconds to rotate files */ +#define TIME_WINDOW 300 + +/* overdue time: + * if nfcapd does not get any data, wake up the receive system call + * at least after OVERDUE_TIME seconds after the time window + */ +#define OVERDUE_TIME 10 + +// time nfcapd will wait for launcher to terminate +#define LAUNCHER_TIMEOUT 60 + +#define SYSLOG_FACILITY "daemon" + +#endif //_COLLECTOR_H diff --git a/bin/collector_inline.c b/bin/collector_inline.c new file mode 100755 index 0000000..4e1c22b --- /dev/null +++ b/bin/collector_inline.c @@ -0,0 +1,126 @@ +/* + * Copyright (c) 2014, Peter Haag + * Copyright (c) 2009, Peter Haag + * Copyright (c) 2008, SWITCH - Teleinformatikdienste fuer Lehre und Forschung + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of the author nor the names of its contributors may be + * used to endorse or promote products derived from this software without + * specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 COPYRIGHT OWNER 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. + * + * $Author: haag $ + * + * $Id: collector_inline.c 37 2009-11-10 08:40:30Z haag $ + * + * $LastChangedRevision: 37 $ + * + */ + +static inline FlowSource_t *GetFlowSource(struct sockaddr_storage *ss) { +FlowSource_t *fs; +void *ptr; +ip_addr_t ip; +char as[100]; + + union { + struct sockaddr_storage *ss; + struct sockaddr *sa; + struct sockaddr_in *sa_in; + struct sockaddr_in6 *sa_in6; + } u; + u.ss = ss; + + switch (ss->ss_family) { + case PF_INET: { +#ifdef HAVE_STRUCT_SOCKADDR_STORAGE_SS_LEN + if (ss->ss_len != sizeof(struct sockaddr_in) ) { + // malformed struct + LogError("Malformed IPv4 socket struct in '%s', line '%d'", __FILE__, __LINE__ ); + return NULL; + } +#endif + ip.v6[0] = 0; + ip.v6[1] = 0; + ip.v4 = ntohl(u.sa_in->sin_addr.s_addr); + ptr = &u.sa_in->sin_addr; + } break; + case PF_INET6: { + uint64_t *ip_ptr = (uint64_t *)u.sa_in6->sin6_addr.s6_addr; + +#ifdef HAVE_STRUCT_SOCKADDR_STORAGE_SS_LEN + if (ss->ss_len != sizeof(struct sockaddr_in6) ) { + // malformed struct + LogError("Malformed IPv6 socket struct in '%s', line '%d'", __FILE__, __LINE__ ); + return NULL; + } +#endif + // ptr = &((struct sockaddr_in6 *)sa)->sin6_addr; + ip.v6[0] = ntohll(ip_ptr[0]); + ip.v6[1] = ntohll(ip_ptr[1]); + ptr = &u.sa_in6->sin6_addr; + } break; + default: + // keep compiler happy + ip.v6[0] = 0; + ip.v6[1] = 0; + ptr = NULL; + + LogError("Unknown sa fanily: %d in '%s', line '%d'", ss->ss_family, __FILE__, __LINE__ ); + return NULL; + } + +#ifdef DEVEL + inet_ntop(ss->ss_family, ptr, as, sizeof(as)); + as[99] = '\0'; + printf("Flow Source IP: %s\n", as); +#endif + + fs = FlowSource; + while ( fs ) { + if ( ip.v6[0] == fs->ip.v6[0] && ip.v6[1] == fs->ip.v6[1] ) + return fs; + + // if we match any source, store the current IP address - works as faster cache next time + // and identifies the current source by IP + if ( fs->any_source ) { + fs->ip = ip; + fs->sa_family = ss->ss_family; + return fs; + } + fs = fs->next; + } + + if ( ptr ) { + inet_ntop (ss->ss_family, ptr, as, 100); + } else + strncpy(as, "", 99); + + as[99] = '\0'; + LogError("Unknown flow source: '%s'" , as); + + return NULL; + +} // End of GetFlowSource + + + diff --git a/bin/content_dns.c b/bin/content_dns.c new file mode 100644 index 0000000..3829288 --- /dev/null +++ b/bin/content_dns.c @@ -0,0 +1,273 @@ +/* + * Copyright (c) 2014, Peter Haag + * Copyright (c) 2013, Peter Haag + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of the author nor the names of its contributors may be + * used to endorse or promote products derived from this software without + * specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 COPYRIGHT OWNER 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. + * + * $Author$ + * + * $Id$ + * + * $LastChangedRevision$ + * + */ + +#include "config.h" + +#ifdef HAVE_FEATURES_H +#include +#endif + +#include +#include +#include +#include +#include +#include +#include +#include + +#ifdef HAVE_ARPA_NAMESER_H +#include +#endif + +#ifdef HAVE_ARPA_NAMESER_COMPAT_H +#include +#endif + +#include +#include + +#ifdef HAVE_STDINT_H +#include +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include "util.h" +#include "nffile.h" +#include "bookkeeper.h" +#include "nfxstat.h" +#include "collector.h" +#include "flowtree.h" +#include "content_dns.h" + +#ifndef DEVEL +# define dbg_printf(...) /* printf(__VA_ARGS__) */ +#else +# define dbg_printf(...) printf(__VA_ARGS__) +#endif + +#include "inline.c" + +/* + * Structure for query header. The order of the fields is machine- and + * compiler-dependent, depending on the byte/bit order and the layout + * of bit fields. We use bit fields only in int variables, as this + * is all ANSI requires. This requires a somewhat confusing rearrangement. + */ + +typedef struct dns_header_s { + unsigned id :16; /* query identification number */ +#ifdef WORDS_BIGENDIAN + /* fields in third byte */ + unsigned qr: 1; /* response flag */ + unsigned opcode: 4; /* purpose of message */ + unsigned aa: 1; /* authoritive answer */ + unsigned tc: 1; /* truncated message */ + unsigned rd: 1; /* recursion desired */ + /* fields in fourth byte */ + unsigned ra: 1; /* recursion available */ + unsigned unused :3; /* unused bits (MBZ as of 4.9.3a3) */ + unsigned rcode :4; /* response code */ +#else + /* fields in third byte */ + unsigned rd :1; /* recursion desired */ + unsigned tc :1; /* truncated message */ + unsigned aa :1; /* authoritive answer */ + unsigned opcode :4; /* purpose of message */ + unsigned qr :1; /* response flag */ + /* fields in fourth byte */ + unsigned rcode :4; /* response code */ + unsigned unused :3; /* unused bits (MBZ as of 4.9.3a3) */ + unsigned ra :1; /* recursion available */ +#endif + /* remaining bytes */ + unsigned qdcount :16; /* number of question entries */ + unsigned ancount :16; /* number of answer entries */ + unsigned nscount :16; /* number of authority entries */ + unsigned arcount :16; /* number of resource entries */ +} dns_header_t; + +#define DNS_QUERY_TYPE_A (1) +#define DNS_QUERY_TYPE_AAAA (2) +#define DNS_QUERY_TYPE_SRV (3) + +typedef struct dns_host_st { + struct dns_host_st *next; + + unsigned int type; + unsigned int class; + unsigned int ttl; + + void *rr; +} dns_host_t; + +typedef struct dns_srv_st { + unsigned int priority; + unsigned int weight; + unsigned int port; + unsigned int rweight; + + char name[256]; +} dns_srv_t; + +static void *_a_rr(void **p) { +struct in_addr in; + + in.s_addr = ntohl(Get_val32(*p)); *p += 4; + return strdup(inet_ntoa(in)); +} + +static void *_aaaa_rr(void **p) { +char addr[INET6_ADDRSTRLEN]; +uint64_t sa6[2]; + + memcpy((void *)sa6, *p, 16); + inet_ntop(AF_INET6, (struct sockaddr_storage *)&sa6, addr, sizeof(addr)); + + return strdup(addr); +} + +void content_decode_dns(struct FlowNode *node, uint8_t *payload, uint32_t payload_size) { +dns_header_t *dns_header = (dns_header_t *)payload; +uint32_t qdcount, ancount; +void *p, *eod; +#define DN_LENGTH 256 +char dn[DN_LENGTH]; +int i; + + if ( payload_size < sizeof(dns_header_t) ) { + LogError("Unable to decode short DNS packet"); + return; + } + + // no of query packets + qdcount = ntohs(dns_header->qdcount); + dbg_printf("DNS Queries: %u\n", qdcount); + + // no of answer packets + ancount = ntohs(dns_header->ancount); + dbg_printf("DNS Answers: %u\n", ancount); + + // end of dns packet + eod = (void *)(payload + payload_size); + + // reord pointer + p = (void *)(payload + sizeof(dns_header_t)); + + for (i=0; i\n"); + p = (void *)(p + len); + continue; + } + + } + +} // End of content_decode_dns + diff --git a/bin/content_dns.h b/bin/content_dns.h new file mode 100644 index 0000000..e9c95ab --- /dev/null +++ b/bin/content_dns.h @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2014, Peter Haag + * Copyright (c) 2013, Peter Haag + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of the author nor the names of its contributors may be + * used to endorse or promote products derived from this software without + * specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 COPYRIGHT OWNER 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. + * + * $Author$ + * + * $Id$ + * + * $LastChangedRevision$ + * + */ + +void content_decode_dns(struct FlowNode *node, uint8_t *payload, uint32_t payload_size); + diff --git a/bin/expire.c b/bin/expire.c new file mode 100644 index 0000000..c9ebf0c --- /dev/null +++ b/bin/expire.c @@ -0,0 +1,822 @@ +/* + * Copyright (c) 2014, Peter Haag + * Copyright (c) 2009, Peter Haag + * Copyright (c) 2004-2008, SWITCH - Teleinformatikdienste fuer Lehre und Forschung + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of the author nor the names of its contributors may be + * used to endorse or promote products derived from this software without + * specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 COPYRIGHT OWNER 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. + * + * $Author: haag $ + * + * $Id: expire.c 39 2009-11-25 08:11:15Z haag $ + * + * $LastChangedRevision: 39 $ + * + */ + +#include "config.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#ifdef HAVE_FTS_H +# include +#else +# include "fts_compat.h" +#define fts_children fts_children_compat +#define fts_close fts_close_compat +#define fts_open fts_open_compat +#define fts_read fts_read_compat +#define fts_set fts_set_compat +#endif + +#ifdef HAVE_STDINT_H +#include +#endif + +#include "util.h" +#include "bookkeeper.h" +#include "nfstatfile.h" +#include "expire.h" + +static uint32_t timeout = 0; + +/* + * expire.c is needed for daemon code as well as normal stdio code + * therefore a generic LogError is defined, which maps to the + * approriate logging channel - either stderr or syslog + */ +void LogError(char *format, ...); + +static void PrepareDirLists(channel_t *channel); + +static int compare(const FTSENT **f1, const FTSENT **f2); + +#if 0 +#define unlink unlink_debug + +static int unlink_debug (const char *path) { + printf("Unlink %s\n", path); + return 0; +} // End of unlink_debug +#endif + +static void IntHandler(int signal) { + + switch (signal) { + case SIGALRM: + timeout = 1; + break; + case SIGHUP: + case SIGINT: + case SIGTERM: + timeout = 1; + break; + break; + case SIGCHLD: + default: + // ignore everything we don't know + break; + } + +} /* End of IntHandler */ + +static void SetupSignalHandler(void) { +struct sigaction act; + + memset((void *)&act,0,sizeof(struct sigaction)); + act.sa_handler = IntHandler; + sigemptyset(&act.sa_mask); + act.sa_flags = 0; + sigaction(SIGTERM, &act, NULL); + sigaction(SIGINT, &act, NULL); + sigaction(SIGHUP, &act, NULL); + sigaction(SIGALRM, &act, NULL); + sigaction(SIGCHLD, &act, NULL); + +} // End of SetupSignalHandler + +uint64_t ParseSizeDef(char *s, uint64_t *value) { +char *p; +uint64_t fac; +int dot; + + dot = 0; + *value = 0; + p = s; + while ( *p ) { + if ( *p < '0' || *p > '9' ) { + if ( *p == '.' ) { + if ( dot ) { + break; + } else { + dot = 1; + } + } else + break; + } + p++; + } + if ( p == s ) { + fprintf(stderr, "Missing number in '%s'\n", s); + return 0; + } + + fac = 0; + switch (*p) { + case '\0': + case 'b': + case 'B': + fac = 1; + break; + case 'k': + case 'K': + fac = 1024; + break; + case 'm': + case 'M': + fac = 1024 * 1024; + break; + case 'g': + case 'G': + fac = 1024 * 1024 * 1024; + break; + case 't': + case 'T': + fac = 1024LL * 1024LL * 1024LL * 1024LL; + break; + default: + fprintf(stderr, "Garbage character(s) '%s' in '%s'\n", p, s); + return 0; + } + + if ( *p ) { + char *r = p++; + + // skip optional 'B' for Bytes in KB etc. + if ( fac != 1 && (*p == 'B' || *p == 'b') ) p++; + + if ( *p ) { + // extra garbage after factor + fprintf(stderr, "Garbage character(s) '%s''in '%s'\n", p, s); + return 0; + } + *r = '\0'; + } + + // *value = strtoll(s, NULL, 10) * fac; + *value = (uint64_t)(atof(s) * (double)fac); + + return 1; + +} // End of ParseSizeDef + +/* + * Accepted time scales + * + * w week + * d day + * H hour + * M minute + */ +uint64_t ParseTimeDef(char *s, uint64_t *value) { +char *p; +uint64_t weeks, days, hours, minutes; + + *value = 0; + weeks=days=hours=minutes=0; + + p = s; + while ( *p ) { + char *q = p; + while ( *p ) { + if ( *p < '0' || *p > '9' ) { + break; + } + p++; + } + if ( p == q ) { + fprintf(stderr, "Missing number before '%s'\n", q); + return 0; + } + switch (*p) { + case 'w': + *p++ = '\0'; + if ( weeks ) { + fprintf(stderr, "Ambiguous weeks %sw\n", q); + return 0; + } + weeks = strtoll(q, NULL, 10); + break; + case 'd': + *p++ = '\0'; + if ( days ) { + fprintf(stderr, "Ambiguous days %sD\n", q); + return 0; + } + days = strtoll(q, NULL, 10); + break; + case '\0': // without any units, assume hours + case 'H': + if ( *p ) *p++ = '\0'; + if ( hours ) { + fprintf(stderr, "Ambiguous hours %sH\n", q); + return 0; + } + hours = strtoll(q, NULL, 10); + break; + case 'M': + *p++ = '\0'; + if ( minutes ) { + fprintf(stderr, "Ambiguous minutes %sM\n", q); + return 0; + } + minutes = strtoll(q, NULL, 10); + break; + default: + fprintf(stderr, "Unknown time unit '%s'\n", q); + return 0; + + } + } + + *value = minutes*60 + hours*3600 + days*24*3600 + weeks*7*24*3600; + + return 1; + +} // End of ParseTimeDef + +static int compare(const FTSENT **f1, const FTSENT **f2) { + return strcmp( (*f1)->fts_name, (*f2)->fts_name); +} // End of compare + +void RescanDir(char *dir, dirstat_t *dirstat) { +FTS *fts; +FTSENT *ftsent; +char *const path[] = { dir, NULL }; +char first_timestring[16], last_timestring[16]; + + dirstat->filesize = dirstat->numfiles = 0; + dirstat->first = 0; + dirstat->last = 0; + strncpy(first_timestring, "999999999999", 15); + strncpy(last_timestring, "000000000000", 15); + + fts = fts_open(path, FTS_LOGICAL, compare); + if ( !fts ) { + LogError( "fts_open() error in %s line %d: %s\n", __FILE__, __LINE__, strerror(errno) ); + return; + } + while ( (ftsent = fts_read(fts)) != NULL) { + if ( ftsent->fts_info == FTS_F && ftsent->fts_namelen == 19 ) { + // nfcapd.200604301200 strlen = 19 + if ( strncmp(ftsent->fts_name, "nfcapd.", 7) == 0 ) { + char *s, *p = &(ftsent->fts_name[7]); + + // make sure, we have only digits + s = p; + while ( *s ) { + if ( *s < '0' || *s > '9' ) + break; + s++; + } + // otherwise skip + if ( *s ) + continue; + + if ( strcmp(p, first_timestring) < 0 ) { + first_timestring[0] = '\0'; + strncat(first_timestring, p, 15); + } + if ( strcmp(p, last_timestring) > 0 ) { + last_timestring[0] = '\0'; + strncat(last_timestring, p, 15); + } + + dirstat->filesize += 512 * ftsent->fts_statp->st_blocks; + dirstat->numfiles++; + } + } else { + switch (ftsent->fts_info) { + case FTS_D: + // skip all '.' entries as well as hidden directories + if ( ftsent->fts_level > 0 && ftsent->fts_name[0] == '.' ) + fts_set(fts, ftsent, FTS_SKIP); + // any valid dirctory need to start with a digit ( %Y -> year ) + if ( ftsent->fts_level > 0 && !isdigit(ftsent->fts_name[0]) ) + fts_set(fts, ftsent, FTS_SKIP); + break; + case FTS_DP: + break; + } + } + } + fts_close(fts); + + // no files means do rebuild next time, otherwise the stat record may not be accurate + if ( dirstat->numfiles == 0 ) { + dirstat->first = dirstat->last = time(NULL); + dirstat->status = FORCE_REBUILD; + } else { + dirstat->first = ISO2UNIX(first_timestring); + dirstat->last = ISO2UNIX(last_timestring); + dirstat->status = STATFILE_OK; + } + +} // End of RescanDir + +void ExpireDir(char *dir, dirstat_t *dirstat, uint64_t maxsize, uint64_t maxlife, uint32_t runtime ) { +FTS *fts; +FTSENT *ftsent; +uint64_t sizelimit, num_expired; +int done, size_done, lifetime_done, dir_files; +char *const path[] = { dir, NULL }; +char *expire_timelimit = NULL; +time_t now = time(NULL); + + dir_files = 0; + if ( dirstat->low_water == 0 ) + dirstat->low_water = 95; + + if ( runtime ) { + SetupSignalHandler(); + alarm(runtime); + } + + if ( maxlife ) { + // build an appropriate string for comparing + time_t t_expire = now - maxlife; + + time_t t_watermark = now - (time_t)((maxlife * dirstat->low_water)/100); + +// printf("Expire files before %s", ctime(&t_expire)); + expire_timelimit = strdup(UNIX2ISO(t_watermark)); +// printf("down to %s", ctime(&t_watermark)); +// printf("Diff: %i\n", t_watermark - t_expire ); + + if ( dirstat->last < t_expire && (isatty(STDIN_FILENO) ) ) { + // this means all files will get expired - are you sure ? + char *s, s1[32], s2[32]; + time_t t; + struct tm *when; + + t = t_expire; + when = localtime(&t); + strftime(s1, 31, "%Y-%m-%d %H:%M:%S", when); + s1[31] = '\0'; + + t = dirstat->last; + when = localtime(&t); + strftime(s2, 31, "%Y-%m-%d %H:%M:%S", when); + s2[31] = '\0'; + + printf("Your max lifetime of %s will expire all file before %s\n", ScaleTime(maxlife), s1); + printf("Your latest files are dated %s. This means all files will be deleted!\n", s2); + printf("Are you sure? yes/[no] "); + s = fgets(s1, 31, stdin); + s1[31] = '\0'; + if ( s && strncasecmp(s1, "yes\n", 31) == 0 ) { + printf("Ok - you've beeen warned!\n"); + } else { + printf("Expire canceled!\n"); + return; + } + } + } + + done = 0; + size_done = maxsize == 0 || dirstat->filesize < maxsize; + lifetime_done = maxlife == 0 || ( now - dirstat->first ) < maxlife; + sizelimit = (dirstat->low_water * maxsize)/100; + num_expired = 0; + fts = fts_open(path, FTS_LOGICAL, compare); + while ( !done && ((ftsent = fts_read(fts)) != NULL) ) { + if ( ftsent->fts_info == FTS_F ) { + dir_files++; // count files in directories + if ( ftsent->fts_namelen == 19 && strncmp(ftsent->fts_name, "nfcapd.", 7) == 0 ) { + // nfcapd.200604301200 strlen = 19 + char *s, *p = &(ftsent->fts_name[7]); + + // process only nfcapd. files + // make sure it's really an nfcapd. file and we have + // only digits in the rest of the file name + s = p; + while ( *s ) { + if ( *s < '0' || *s > '9' ) + break; + s++; + } + // otherwise skip + if ( *s ) + continue; + + // expire size-wise if needed + if ( !size_done ) { + if ( dirstat->filesize > sizelimit ) { + if ( unlink(ftsent->fts_path) == 0 ) { + dirstat->filesize -= 512 * ftsent->fts_statp->st_blocks; + num_expired++; + dir_files--; + } else { + LogError( "unlink() error in %s line %d: %s\n", __FILE__, __LINE__, strerror(errno) ); + } + continue; // next file if file was unlinked + } else { + dirstat->first = ISO2UNIX(p); // time of first file not expired + size_done = 1; + } + } + + // expire time-wise if needed + // this part of the code is executed only when size-wise is fullfilled + if ( !lifetime_done ) { + if ( expire_timelimit && strcmp(p, expire_timelimit) < 0 ) { + if ( unlink(ftsent->fts_path) == 0 ) { + dirstat->filesize -= 512 * ftsent->fts_statp->st_blocks; + num_expired++; + dir_files--; + } else { + LogError( "unlink() error in %s line %d: %s\n", __FILE__, __LINE__, strerror(errno) ); + } + lifetime_done = 0; + } else { + dirstat->first = ISO2UNIX(p); // time of first file not expired + lifetime_done = 1; + } + } + done = (size_done && lifetime_done) || timeout; + + } + } else { + switch (ftsent->fts_info) { + case FTS_D: + // set pre-order flag + dir_files = 0; + // skip all '.' entries as well as hidden directories + if ( ftsent->fts_level > 0 && ftsent->fts_name[0] == '.' ) + fts_set(fts, ftsent, FTS_SKIP); + // any valid directory needs to start with a digit ( %Y -> year ) + if ( ftsent->fts_level > 0 && !isdigit(ftsent->fts_name[0]) ) + fts_set(fts, ftsent, FTS_SKIP); + break; + case FTS_DP: + // do not delete base data directory ( level == 0 ) + if ( dir_files == 0 && ftsent->fts_level > 0 ) { + // directory is empty and can be deleted +// printf("Will remove directory %s\n", ftsent->fts_path); + if ( rmdir(ftsent->fts_path) != 0 ) { + LogError( "rmdir() error in %s line %d: %s\n", __FILE__, __LINE__, strerror(errno) ); + } + } + break; + } + } + } + fts_close(fts); + if ( !done ) { + // all files expired and limits not reached + // this may be possible, when files get time-wise expired and + // the time limit is shorter than the latest file + dirstat->first = dirstat->last; + } + if ( runtime ) + alarm(0); + if ( timeout ) { + LogError( "Maximum execution time reached! Interrupt expire.\n"); + } + if ( num_expired > dirstat->numfiles ) { + LogError( "Error updating stat record: Number of files inconsistent!\n"); + LogError( "Will automatically rebuild this directory next time\n"); + dirstat->numfiles = 0; + dirstat->status = FORCE_REBUILD; + } else { + dirstat->numfiles -= num_expired; + } + if ( dirstat->numfiles == 0 ) { + dirstat->first = dirstat->last = time(NULL); + dirstat->status = FORCE_REBUILD; + } + + free(expire_timelimit); + +} // End of ExpireDir + +static void PrepareDirLists(channel_t *channel) { +channel_t *current_channel = channel; + + while ( current_channel ) { + char *const path[] = { current_channel->datadir, NULL }; + + current_channel->fts = fts_open(path, FTS_LOGICAL|FTS_NOCHDIR, compare); + if ( !current_channel->fts ) { + LogError( "fts_open() error in %s line %d: %s\n", __FILE__, __LINE__, strerror(errno) ); + continue; + } + + // get first entry + current_channel->ftsent = fts_read(current_channel->fts); + if ( current_channel->ftsent ) + // use fts_number as the number of files already seen in this directory. + current_channel->ftsent->fts_number = 0; + + while ( current_channel->ftsent ) { + +/* + FTSENT *ftsent = current_channel->ftsent; + char *finfo; + switch (ftsent->fts_info) { + case FTS_ERR: + case FTS_NS: + LogError( "fts_read() %s error in %s line %d: %s\n", + current_channel->ftsent->fts_path, __FILE__, __LINE__, strerror(current_channel->ftsent->fts_errno) ); + break; + case FTS_D: + finfo = "DIR pre "; + break; + case FTS_DP: + finfo = "DIR post"; + break; + case FTS_F: + finfo = "FILE "; + break; + default: + finfo = " "; + } + printf("%u %i %s %s %s\n", ftsent->fts_info, ftsent->fts_level, finfo, ftsent->fts_path, ftsent->fts_name); +*/ + if ( current_channel->ftsent->fts_info == FTS_ERR || + current_channel->ftsent->fts_info == FTS_NS) { + LogError( "fts_read() %s error in %s line %d: %s\n", + current_channel->ftsent->fts_path, __FILE__, __LINE__, strerror(current_channel->ftsent->fts_errno) ); + continue; + } + if ( current_channel->ftsent->fts_info != FTS_F ) { + current_channel->ftsent = fts_read(current_channel->fts); + continue; + } + // it's now FTS_F + current_channel->ftsent->fts_number++; + + // if ftsent points to first valid file, break + if ( current_channel->ftsent->fts_namelen == 19 && strncmp(current_channel->ftsent->fts_name, "nfcapd.", 7) == 0 ) + break; + + // otherwise loop + current_channel->ftsent = fts_read(current_channel->fts); + } + current_channel = current_channel->next; + } + +} // End of PrepareDirLists + +void ExpireProfile(channel_t *channel, dirstat_t *current_stat, uint64_t maxsize, uint64_t maxlife, uint32_t runtime ) { +int size_done, lifetime_done, done; +char *expire_timelimit = ""; +time_t now = time(NULL); +uint64_t sizelimit, num_expired; + + if ( !channel ) + return; + + done = 0; + SetupSignalHandler(); + + if ( maxlife ) { +// time_t t_expire = now - maxlife; + // build an appropriate string for comparing + time_t t_watermark = now - (time_t)((maxlife * current_stat->low_water)/100); + +// printf("Expire files before %s", ctime(&t_expire)); + expire_timelimit = strdup(UNIX2ISO(t_watermark)); +// printf("down to %s", ctime(&t_watermark)); +// printf("Diff: %i\n", t_watermark - t_expire ); + + } + + size_done = maxsize == 0 || current_stat->filesize < maxsize; + sizelimit = (current_stat->low_water * maxsize)/100; + lifetime_done = maxlife == 0 || ( now - current_stat->first ) < maxlife; + + num_expired = 0; + + PrepareDirLists(channel); + if ( runtime ) + alarm(runtime); + while ( !done ) { + char *p; + int file_removed; + + // search for the channel with oldest file. If all channel have same age, + // get the last in the list + channel_t *expire_channel = channel; + channel_t *compare_channel = expire_channel->next; + while ( compare_channel ) { + if ( expire_channel->ftsent == NULL ) { + expire_channel = compare_channel; + } + if ( compare_channel->ftsent == NULL ) { + compare_channel = compare_channel->next; + continue; + } + // at this point expire_channel and current_channel fts entries are valid + if ( strcmp(expire_channel->ftsent->fts_name, compare_channel->ftsent->fts_name) >= 0 ) { + expire_channel = compare_channel; + } + compare_channel = compare_channel->next; + } + if ( !expire_channel->ftsent ) { + // no more entries in any channel - we are done + done = 1; + continue; + } + + // flag is file got removed + file_removed = 0; + + // expire_channel now points to the channel with oldest file + // do expire + p = &(expire_channel->ftsent->fts_name[7]); +// printf("File: %s\n", expire_channel->ftsent->fts_path); + + if ( !size_done ) { + // expire size-wise if needed +// printf(" Size expire %llu %llu\n", current_stat->filesize, sizelimit); + if ( current_stat->filesize > sizelimit ) { + // need to delete this file + if ( unlink(expire_channel->ftsent->fts_path) == 0 ) { + // Update profile stat + current_stat->filesize -= 512 * expire_channel->ftsent->fts_statp->st_blocks; + current_stat->numfiles--; + + // Update channel stat + expire_channel->dirstat->filesize -= 512 * expire_channel->ftsent->fts_statp->st_blocks; + expire_channel->dirstat->numfiles--; + + // decrement number of files seen in this directory + expire_channel->ftsent->fts_number--; + + file_removed = 1; + num_expired++; + } else { + LogError( "unlink() error in %s line %d: %s\n", __FILE__, __LINE__, strerror(errno) ); + } + } else { + // we are done size-wise + // time of first file not expired = start time of channel/profile + expire_channel->dirstat->first = current_stat->first = ISO2UNIX(p); + size_done = 1; + } + } else if ( !lifetime_done ) { +// printf(" Time expire \n"); + // expire time-wise if needed + // this part of the code is executed only when size-wise is already fullfilled + if ( strcmp(p, expire_timelimit) < 0 ) { + // need to delete this file + if ( unlink(expire_channel->ftsent->fts_path) == 0 ) { + // Update profile stat + current_stat->filesize -= 512 * expire_channel->ftsent->fts_statp->st_blocks; + current_stat->numfiles--; + + // Update channel stat + expire_channel->dirstat->filesize -= 512 * expire_channel->ftsent->fts_statp->st_blocks; + expire_channel->dirstat->numfiles--; + + // decrement number of files seen in this directory + expire_channel->ftsent->fts_number--; + + file_removed = 1; + num_expired++; + } else { + LogError( "unlink() error in %s line %d: %s\n", __FILE__, __LINE__, strerror(errno) ); + } + } else { + // we are done time-wise + // time of first file not expired = start time of channel/profile + expire_channel->dirstat->first = current_stat->first = ISO2UNIX(p); + lifetime_done = 1; + } + } else + // all done + done = 1; + if ( timeout ) + done = 1; + + // advance fts entry in expire channel to next file, if file was removed + if ( file_removed ) { + expire_channel->ftsent = fts_read(expire_channel->fts); + while ( expire_channel->ftsent ) { + if ( expire_channel->ftsent->fts_info == FTS_F ) { // entry is a file + expire_channel->ftsent->fts_number++; + if ( expire_channel->ftsent->fts_namelen == 19 && + strncmp(expire_channel->ftsent->fts_name, "nfcapd.", 7) == 0 ) { + // if ftsent points to next valid file + char *p = &(expire_channel->ftsent->fts_name[7]); + // next file is first (oldest) for channel and for profile - update first mark + expire_channel->dirstat->first = current_stat->first = ISO2UNIX(p); + break; + } + } else { + + switch (expire_channel->ftsent->fts_info) { + case FTS_D: // entry is a directory + // set number of files seen in this directory = 0 + expire_channel->ftsent->fts_number = 0; + // skip all '.' entries as well as hidden directories + if ( expire_channel->ftsent->fts_level > 0 && expire_channel->ftsent->fts_name[0] == '.' ) + fts_set(expire_channel->fts, expire_channel->ftsent, FTS_SKIP); + // any valid directory needs to start with a digit ( %Y -> year ) + if ( expire_channel->ftsent->fts_level > 0 && !isdigit(expire_channel->ftsent->fts_name[0]) ) + fts_set(expire_channel->fts, expire_channel->ftsent, FTS_SKIP); + break; + case FTS_DP: + // do not delete base data directory ( level == 0 ) + if ( expire_channel->ftsent->fts_number == 0 && expire_channel->ftsent->fts_level > 0 ) { + // directory is empty and can be deleted +// printf("Will remove directory %s\n", expire_channel->ftsent->fts_path); + if ( rmdir(expire_channel->ftsent->fts_path) != 0 ) { + LogError( "rmdir() error in %s line %d: %s\n", __FILE__, __LINE__, strerror(errno) ); + } + } + break; + } + } + // otherwise loop + expire_channel->ftsent = fts_read(expire_channel->fts); + } // end advance fts entry + file_removed = 0; + } + + if ( expire_channel->ftsent == NULL ) { + // this channel has no more files now + expire_channel->dirstat->first = expire_channel->dirstat->last; + if ( expire_channel->dirstat->numfiles ) { + // if channel is empty, no files must be reported, but rebuild is done anyway + LogError( "Inconsitency detected in channel %s. Will rebuild automatically.\n", expire_channel->datadir); + LogError( "No more files found, but %llu expected.\n", expire_channel->dirstat->numfiles); + } + expire_channel->dirstat->numfiles = 0; + expire_channel->dirstat->status = FORCE_REBUILD; + } + } // while ( !done ) + + if ( runtime ) + alarm(0); + if ( timeout ) { + LogError( "Maximum execution time reached! Interrupt expire.\n"); + } + +} // End of ExpireProfile + +void UpdateBookStat(dirstat_t *dirstat, bookkeeper_t *books) { + + if ( books->numfiles ) { + /* prevent some faults and dublicates: + * book records can never be timewise smaller than directory records => fishy! + * in case book records == directory records, the user stopped and restarted nfcapd + * this is not necessarily wrong, but results in overwriting an existing file + * which results in wrong stats => rescan needed + */ + if ( books->last <= dirstat->last || books->first <= dirstat->first) { + dirstat->status = FORCE_REBUILD; + return; + } + dirstat->last = books->last; + dirstat->numfiles += books->numfiles; + dirstat->filesize += books->filesize; + } + +} // End of UpdateBookStat + + diff --git a/bin/expire.h b/bin/expire.h new file mode 100644 index 0000000..9d964cd --- /dev/null +++ b/bin/expire.h @@ -0,0 +1,68 @@ +/* + * Copyright (c) 2014, Peter Haag + * Copyright (c) 2009, Peter Haag + * Copyright (c) 2004-2008, SWITCH - Teleinformatikdienste fuer Lehre und Forschung + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of the author nor the names of its contributors may be + * used to endorse or promote products derived from this software without + * specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 COPYRIGHT OWNER 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. + * + * $Author: haag $ + * + * $Id: expire.h 39 2009-11-25 08:11:15Z haag $ + * + * $LastChangedRevision: 39 $ + * + */ + +#ifndef _EXPIRE_H +#define _EXPIRE_H 1 + +typedef struct channel_s { + struct channel_s *next; + char *datadir; + dirstat_t *dirstat; + bookkeeper_t *books; + int books_stat; + int do_rescan; + int status; + FTS *fts; + FTSENT *ftsent; +} channel_t; + +enum { OK = 0, NOFILES }; + +uint64_t ParseSizeDef(char *s, uint64_t *value); + +uint64_t ParseTimeDef(char *s, uint64_t *value); + +void RescanDir(char *dir, dirstat_t *dirstat); + +void ExpireDir(char *dir, dirstat_t *dirstat, uint64_t maxsize, uint64_t maxlife, uint32_t runtime ); + +void ExpireProfile(channel_t *channel, dirstat_t *current_stat, uint64_t maxsize, uint64_t maxlife, uint32_t runtime ); + +void UpdateBookStat(dirstat_t *dirstat, bookkeeper_t *books); + +#endif //_EXPIRE_H diff --git a/bin/exporter.c b/bin/exporter.c new file mode 100755 index 0000000..9c72423 --- /dev/null +++ b/bin/exporter.c @@ -0,0 +1,465 @@ +/* + * Copyright (c) 2014, Peter Haag + * Copyright (c) 2012, Peter Haag + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of the author nor the names of its contributors may be + * used to endorse or promote products derived from this software without + * specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 COPYRIGHT OWNER 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. + * + * $Author: peter $ + * + * $Id: exporter.c 224 2014-02-16 12:59:29Z peter $ + * + * $LastChangedRevision: 224 $ + * + */ + +#include "config.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#ifdef HAVE_STDINT_H +#include +#endif + +#ifndef DEVEL +# define dbg_printf(...) /* printf(__VA_ARGS__) */ +#else +# define dbg_printf(...) printf(__VA_ARGS__) +#endif + +#include "util.h" +#include "nffile.h" +#include "nfx.h" +#include "nfnet.h" +#include "bookkeeper.h" +#include "nfxstat.h" +#include "collector.h" +#include "exporter.h" +#include "nf_common.h" +#include "netflow_v1.h" +#include "netflow_v5_v7.h" +#include "netflow_v9.h" +#include "ipfix.h" + +/* global */ +generic_exporter_t **exporter_list; + +/* local variables */ +#define MAX_EXPORTERS 65535 +static generic_exporter_t *exporter_root; + +#include "nffile_inline.c" + +/* local prototypes */ + +/* functions */ +int InitExporterList(void) { + + exporter_list = calloc(MAX_EXPORTERS, sizeof(generic_exporter_t *)); + if ( !exporter_list ) { + LogError("malloc() error in %s line %d: %s\n", __FILE__, __LINE__, strerror(errno) ); + return 0; + } + exporter_root = NULL; + return 1; + +} // End of InitExporterList + +int AddExporterInfo(exporter_info_record_t *exporter_record) { +uint32_t id = exporter_record->sysid; +int i; +char *p1, *p2; + + // sanity check + if ( id >= MAX_EXPORTERS ) { + LogError("Exporter id: %u out of range. Skip exporter", id); + return 0; + } + if ( exporter_list[id] != NULL ) { + // slot already taken - check if exporters are identical + exporter_record->sysid = exporter_list[id]->info.sysid; + if ( memcmp((void *)exporter_record, (void *)&(exporter_list[id]->info), sizeof(exporter_info_record_t)) == 0 ) { + dbg_printf("Found identical exporter record at SysID: %i, Slot: %u\n", exporter_record->sysid, id); + // we are done + return 2; + } else { + // exporters not identical - move current slot + int i; + // search first emty slot at the top of the list + for ( i = id+1; i < MAX_EXPORTERS && exporter_list[i] != NULL; i++ ) {;} + if ( i >= MAX_EXPORTERS ) { + // all slots taken + LogError("Too many exporters (>256)\n"); + return 0; + } + dbg_printf("Move existing exporter from slot %u, to %i\n", id, i); + // else - move slot + exporter_list[i] = exporter_list[id]; + exporter_list[id] = NULL; + exporter_record->sysid = i; + } + } + + // slot[id] is now available + exporter_list[id] = (generic_exporter_t *)calloc(1, sizeof(generic_exporter_t)); + if ( !exporter_list[id] ) { + LogError("malloc() error in %s line %d: %s\n", __FILE__, __LINE__, strerror(errno) ); + return 0; + } + + // SPARC gcc fails here, if we use directly a pointer to the struct. + // SPARC barfs and core dumps otherwise + // memcpy((void *)&(exporter_list[id]->info), (void *)exporter_record, sizeof(exporter_info_record_t)); + p1 = (char *)&(exporter_list[id]->info); + p2 = (char *)exporter_record; + for ( i=0; isysid); + +#ifdef DEVEL + { + #define IP_STRING_LEN 40 + char ipstr[IP_STRING_LEN]; + if ( exporter_record->sa_family == AF_INET ) { + uint32_t _ip = htonl(exporter_record->ip.v4); + inet_ntop(AF_INET, &_ip, ipstr, sizeof(ipstr)); + printf("SysID: %u, IP: %16s, version: %u, ID: %2u, Slot: %u\n", exporter_record->sysid, + ipstr, exporter_record->version, exporter_record->id, id); + } else if ( exporter_record->sa_family == AF_INET6 ) { + uint64_t _ip[2]; + _ip[0] = htonll(exporter_record->ip.v6[0]); + _ip[1] = htonll(exporter_record->ip.v6[1]); + inet_ntop(AF_INET6, &_ip, ipstr, sizeof(ipstr)); + printf("SysID: %u, IP: %40s, version: %u, ID: %2u, Slot: %u\n", exporter_record->sysid, + ipstr, exporter_record->version, exporter_record->id, id); + } else { + strncpy(ipstr, "", IP_STRING_LEN); + printf("**** Exporter IP version unknown ****\n"); + } + } + printf("\n"); +#endif + + if ( !exporter_root ) { + exporter_root = exporter_list[id]; + } + + return 1; +} // End of AddExporterInfo + +int AddSamplerInfo(sampler_info_record_t *sampler_record) { +uint32_t id = sampler_record->exporter_sysid; +generic_sampler_t **sampler; + + if ( !exporter_list[id] ) { + LogError("Exporter SysID: %u not found! - Skip sampler record", id); + return 0; + } + sampler = &exporter_list[id]->sampler; + while ( *sampler ) { + if ( memcmp((void *)&(*sampler)->info, (void *)sampler_record, sizeof(sampler_info_record_t)) == 0 ) { + // Found identical sampler already registered + dbg_printf("Identical sampler already registered: Exporter SysID: %u, Sampler: id: %i, mode: %u, interval: %u\n", + sampler_record->exporter_sysid, sampler_record->id, sampler_record->mode, sampler_record->interval); + return 2; + } + sampler = &((*sampler)->next); + } + + *sampler = (generic_sampler_t *)malloc(sizeof(generic_sampler_t)); + if ( !*sampler ) { + LogError("malloc() error in %s line %d: %s\n", __FILE__, __LINE__, strerror(errno) ); + return 0; + } + (*sampler)->next = NULL; + sampler_record->exporter_sysid = exporter_list[id]->info.sysid; + + memcpy((void *)&(*sampler)->info, (void *)sampler_record, sizeof(sampler_info_record_t)); + dbg_printf("Insert sampler record for exporter at slot %i:\n", id); + +#ifdef DEVEL + { + if ( sampler_record->id < 0 ) { + printf("Exporter SysID: %u, Generic Sampler: mode: %u, interval: %u\n", + sampler_record->exporter_sysid, sampler_record->mode, sampler_record->interval); + } else { + printf("Exporter SysID: %u, Sampler: id: %i, mode: %u, interval: %u\n", + sampler_record->exporter_sysid, sampler_record->id, sampler_record->mode, sampler_record->interval); + } + } +#endif + + return 1; +} // End of AddSamplerInfo + +int AddExporterStat(exporter_stats_record_t *stat_record) { +int i, use_copy; +exporter_stats_record_t *rec; + + // 64bit counters can be potentially unaligned + if ( ((ptrdiff_t)stat_record & 0x7) != 0 ) { + rec = malloc(stat_record->header.size); + if ( !rec ) { + LogError("malloc() error in %s line %d: %s\n", __FILE__, __LINE__, strerror(errno) ); + exit(255); + } + memcpy(rec, stat_record, stat_record->header.size); + use_copy = 1; + } else { + rec = stat_record; + use_copy = 0; + } + + for (i=0; istat_count; i++ ) { + uint32_t id = rec->stat[i].sysid; + if ( !exporter_list[id] ) { + LogError("Exporter SysID: %u not found! - Skip stat record record.\n"); + continue; + } + exporter_list[id]->sequence_failure += rec->stat[i].sequence_failure; + exporter_list[id]->packets += rec->stat[i].packets; + exporter_list[id]->flows += rec->stat[i].flows; + dbg_printf("Update exporter stat for SysID: %i: Sequence failures: %u, packets: %llu, flows: %llu\n", + id, exporter_list[id]->sequence_failure, exporter_list[id]->packets, exporter_list[id]->flows); + } + + if ( use_copy ) + free(rec); + + return 1; + +} // End of AddExporterStat + +void ExportExporterList( nffile_t *nffile ) { +int i; + + // sysid 0 unused -> no exporter available + i = 1; + while ( i < MAX_EXPORTERS && exporter_list[i] != NULL ) { + exporter_info_record_t *exporter; + generic_sampler_t *sampler; + + exporter = &exporter_list[i]->info; + AppendToBuffer(nffile, (void *)exporter, exporter->header.size); + + sampler = exporter_list[i]->sampler; + while ( sampler ) { + AppendToBuffer(nffile, (void *)&(sampler->info), sampler->info.header.size); + sampler = sampler->next; + } + + i++; + } + + +} // End of ExportExporterList + +void PrintExporters(char *filename) { +int i, done, found = 0; +nffile_t *nffile; +record_header_t *record; +uint32_t skipped_blocks; +uint64_t total_bytes; + + printf("Exporters:\n"); + + nffile = OpenFile(filename, NULL); + if ( !nffile ) { + return; + } + + total_bytes = 0; + skipped_blocks = 0; + done = 0; + while ( !done ) { + int i, ret; + + // get next data block from file + ret = ReadBlock(nffile); + + switch (ret) { + case NF_CORRUPT: + case NF_ERROR: + if ( ret == NF_CORRUPT ) + LogError("Corrupt data file '%s': '%s'\n",filename); + else + LogError("Read error in file '%s': %s\n",filename, strerror(errno) ); + done = 1; + continue; + break; + // fall through - get next file in chain + case NF_EOF: + done = 1; + continue; + break; + + default: + // successfully read block + total_bytes += ret; + } + + if ( nffile->block_header->id != DATA_BLOCK_TYPE_2 ) { + skipped_blocks++; + continue; + } + + // block type = 2 + + record = (record_header_t *)nffile->buff_ptr; + + for ( i=0; i < nffile->block_header->NumRecords; i++ ) { + switch ( record->type ) { + // ExporterRecordType and SamplerRecordype tc versions only + case ExporterRecordType: { + #define IP_STRING_LEN 40 + char ipstr[IP_STRING_LEN]; + exporter_record_t *exporter_record = (exporter_record_t *)record ; + found = 1; + printf("\n"); + if ( exporter_record->sa_family == AF_INET ) { + uint32_t _ip = htonl(exporter_record->ip.v4); + inet_ntop(AF_INET, &_ip, ipstr, sizeof(ipstr)); + printf("SysID: %u, IP: %16s, version: %u, ID: %2u, Sequence Failures: %u\n", exporter_record->sysid, + ipstr, exporter_record->version, exporter_record->exporter_id, exporter_record->sequence_failure); + } else if ( exporter_record->sa_family == AF_INET6 ) { + uint64_t _ip[2]; + _ip[0] = htonll(exporter_record->ip.v6[0]); + _ip[1] = htonll(exporter_record->ip.v6[1]); + inet_ntop(AF_INET6, &_ip, ipstr, sizeof(ipstr)); + printf("SysID: %u, IP: %40s, version: %u, ID: %2u, Sequence Failures: %u\n", exporter_record->sysid, + ipstr, exporter_record->version, exporter_record->exporter_id, exporter_record->sequence_failure); + } else { + strncpy(ipstr, "", IP_STRING_LEN); + printf("**** Exporter IP version unknown ****\n"); + } + } break; + case SamplerRecordype: { + sampler_record_t *sampler_record = (sampler_record_t *)record;; + if ( sampler_record->id < 0 ) { + printf(" Generic Sampler: mode: %u, interval: %u\n", + sampler_record->mode, sampler_record->interval); + } else { + printf(" Sampler: id: %i, mode: %u, interval: %u\n", + sampler_record->id, sampler_record->mode, sampler_record->interval); + } + } break; + case ExporterInfoRecordType: + found = 1; + if ( !AddExporterInfo((exporter_info_record_t *)record) ) { + LogError("Failed to add Exporter Record\n"); + } + break; + case ExporterStatRecordType: + AddExporterStat((exporter_stats_record_t *)record); + break; + case SamplerInfoRecordype: + if ( !AddSamplerInfo((sampler_info_record_t *)record) ) { + LogError("Failed to add Sampler Record\n"); + } + break; + } + // Advance pointer by number of bytes for netflow record + record = (record_header_t *)((pointer_addr_t)record + record->size); + } + } + + CloseFile(nffile); + DisposeFile(nffile); + if ( !found ) { + printf("No Exporter records found\n"); + } + + i = 1; + while ( i < MAX_EXPORTERS && exporter_list[i] != NULL ) { + #define IP_STRING_LEN 40 + char ipstr[IP_STRING_LEN]; + + exporter_info_record_t *exporter; + generic_sampler_t *sampler; + + printf("\n"); + exporter = &exporter_list[i]->info; + if ( exporter->sa_family == AF_INET ) { + uint32_t _ip = htonl(exporter->ip.v4); + inet_ntop(AF_INET, &_ip, ipstr, sizeof(ipstr)); + if ( exporter_list[i]->flows ) + printf("SysID: %u, IP: %16s, version: %u, ID: %2u, Sequence failures: %u, packets: %llu, flows: %llu\n", + exporter->sysid, ipstr, exporter->version, exporter->id, + exporter_list[i]->sequence_failure, + (long long unsigned)exporter_list[i]->packets, + (long long unsigned)exporter_list[i]->flows); + else + printf("SysID: %u, IP: %16s, version: %u, ID: %2u\n", + exporter->sysid, ipstr, exporter->version, exporter->id); + + } else if ( exporter->sa_family == AF_INET6 ) { + uint64_t _ip[2]; + _ip[0] = htonll(exporter->ip.v6[0]); + _ip[1] = htonll(exporter->ip.v6[1]); + inet_ntop(AF_INET6, &_ip, ipstr, sizeof(ipstr)); + if ( exporter_list[i]->flows ) + printf("SysID: %u, IP: %40s, version: %u, ID: %2u, Sequence failures: %u, packets: %llu, flows: %llu\n ", + exporter->sysid, ipstr, exporter->version, exporter->id, + exporter_list[i]->sequence_failure, + (long long unsigned)exporter_list[i]->packets, + (long long unsigned)exporter_list[i]->flows); + else + printf("SysID: %u, IP: %40s, version: %u, ID: %2u\n ", + exporter->sysid, ipstr, exporter->version, exporter->id); + } else { + strncpy(ipstr, "", IP_STRING_LEN); + printf("**** Exporter IP version unknown ****\n"); + } + + sampler = exporter_list[i]->sampler; + while ( sampler ) { + if ( sampler->info.id < 0 ) { + printf(" Sampler for Exporter SysID: %u, Generic Sampler: mode: %u, interval: %u\n", + sampler->info.exporter_sysid, sampler->info.mode, sampler->info.interval); + } else { + printf(" Sampler for Exporter SysID: %u, Sampler: id: %i, mode: %u, interval: %u\n", + sampler->info.exporter_sysid, sampler->info.id, sampler->info.mode, sampler->info.interval); + } + sampler = sampler->next; + } + + i++; + } + + +} // End of PrintExporters + diff --git a/bin/exporter.h b/bin/exporter.h new file mode 100755 index 0000000..69ee688 --- /dev/null +++ b/bin/exporter.h @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2014, Peter Haag + * Copyright (c) 2012, Peter Haag + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of the author nor the names of its contributors may be + * used to endorse or promote products derived from this software without + * specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 COPYRIGHT OWNER 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. + * + * $Author: peter $ + * + * $Id: exporter.h 224 2014-02-16 12:59:29Z peter $ + * + * $LastChangedRevision: 224 $ + * + */ + +#ifndef _EXPORTER_H +#define _EXPORTER_H 1 + +int InitExporterList(void); + +int AddExporterInfo(exporter_info_record_t *exporter_record); + +int AddSamplerInfo(sampler_info_record_t *sampler_record); + +int AddExporterStat(exporter_stats_record_t *stat_record); + +void ExportExporterList( nffile_t *nffile ); + +void PrintExporters(char *filename); + +#endif //_EXPORTER_H + diff --git a/bin/flist.c b/bin/flist.c new file mode 100644 index 0000000..7f7152e --- /dev/null +++ b/bin/flist.c @@ -0,0 +1,1245 @@ +/* + * Copyright (c) 2014, Peter Haag + * Copyright (c) 2009, Peter Haag + * Copyright (c) 2004-2008, SWITCH - Teleinformatikdienste fuer Lehre und Forschung + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of the author nor the names of its contributors may be + * used to endorse or promote products derived from this software without + * specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 COPYRIGHT OWNER 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. + * + * $Author: haag $ + * + * $Id: flist.c 39 2009-11-25 08:11:15Z haag $ + * + * $LastChangedRevision: 39 $ + * + */ + +#include "config.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#ifdef HAVE_STDINT_H +# include +#endif + +#ifdef HAVE_FTS_H +# include +#else +# include "fts_compat.h" +#define fts_children fts_children_compat +#define fts_close fts_close_compat +#define fts_open fts_open_compat +#define fts_read fts_read_compat +#define fts_set fts_set_compat +#endif + +#include "nffile.h" +#include "util.h" +#include "flist.h" + +/* + * Select a single file + * -------------------- + * -r [/]path/to/single_file + * Select a single file: absolute or relativ path to a single file. + * Recursive: no + * + * Selecting a range of files + * -------------------------- + * -R [/]path/to/first_file + * Select a range of files in directory specified by absolut or relative path [/]path/to/ + * Files are selected in alphabetical order starting with 'first_file' to the end of + * the directory. + * + * -R [/]path/to/first_file:last_file + * Select a range of files in directory specified by absolut or relative path [/]path/to/ + * Files are selected in alphabetical order starting with 'first_file' and ending with + * 'last_file'. + * + * -R [/]path/to/directory + * Select all files in alphabetical order in directory specified by absolut or relative + * path [/]path/to/directory + * + * Selecting files over multiple sources + * ------------------------------------- + * -M /path/to/multiple/source1:source2[:..:sourceN] + * It is assumed, that each source directory 'source1', 'source2' etc. exists in directory + * /path/to/multiple. This will expand to multiple directories: + * /path/to/multiple/source1 + * /path/to/multiple/source2 + * .. + * /path/to/multiple/sourceN + * Each of these directories contain the same files. + * Used in combination with -r and -R to prepend file selections. + * + * Select a single file from multiple directories + * ---------------------------------------------- + * -M /path/to/source1:source2 -r single_file + * Select the same file 'single_file' from each source directory: e.g. + * /path/to/source1/single_file + * /path/to/source2/single_file + * + * + * Select a range of files from multiple directories + * ------------------------------------------------- + * -M /path/to/source1:source2[:..] -R first_file + * For each expanded directory specified by -M /path/to/source1:source2 + * select a range of files as described above. Would be identical to + * -R /path/to/source1/first_file -R /path/to/source2/first_file + * + * -M /path/to/source1:source2[:..] -R first_file:last_file + * For each expanded directory specified by -M /path/to/source1:source2 + * select a range of files as described above. Would be identical to + * -R /path/to/source1/first_file:last_file -R /path/to/source2/first_file:last_file [-R .. ] + * + * -M /path/to/source1:source2[:..] -R . + * For each expanded directory specified by -M /path/to/source1:source2 + * select all files of the directory as described above. Would be to + * -R /path/to/source1 -R /path/to/source2 [-R ...] + * + * + * Hierarchical file organinisation: + * For performance reasons, files may be store in various sub directries instead of a + * single directory. These sub directories are assumed to be created in alpabetical order. + * For example daily sub directories: 2006/04/01 .. 2006/04/30 as created by nfcapd with + * option -S %y/%m/%d + * + * Single file selection is identical to the flat file layout: + * -r [/]path/to/sub1/sub2/sub3/single_file + * + * Selecting a range of files in a hierarchical file layout + * -------------------------------------------------------- + * -R [/]path/to/sub1/sub2/first_file + * Select a range of files in directory specified by absolut or relative path + * [/]path/to/sub1/sub2/. Files are selected in alphabetical order starting with + * 'first_file' to the end of the directory. The hierarchy has no impact here. + * + * -R [/]path/to/first_sub1/first_sub2/first_file:last_sub1/last_sub2/last_file + * Select a range of files over multiple sub directories starting at absolut or + * relative path [/]path/to/first_sub1/first_sub2/first_file up to and including + * [/]path/to/last_sub1/last_sub2/last_file. Files are selected in alphabetical + * order by iterating over the required sub directory hierachy + * Example: + * -R /path/to/2006/03/31/nfcapd.200603312300:2006/04/01/nfcapd.200604010600 + * + * -R [/]path/to/directory + * Select all files in alphabetical order in directory specified by absolut or relative + * path [/]path/to/directory, identical to flat layout + * + * The same methode applies for selecting a range of files over multiple sub directories + * and multiple sources. + * + * Example: + * -M /path/to/source1:source2 -R 2006/03/31/nfcapd.200603312300:2006/04/01/nfcapd.200604010600 + * + */ + +/* + * syntax for possible sub dir definitions: + * + * %Y is replaced by the year with century as a decimal number. + * %y is replaced by the year without century as a decimal number (00-99). + * %m is replaced by the month as a decimal number (01-12). + * %d is replaced by the day of the month as a decimal number (01-31). + * %j is replaced by the day of the year as a decimal number (001-366). + * %H is replaced by the hour (24-hour clock) as a decimal number (00-23). + * %M is replaced by the minute as a decimal number (00-59). + * %s is replaced by the number of seconds since the Epoch, UTC + * %U is replaced by the week number of the year (Sunday as the first day + * of the week) as a decimal number (00-53). + * %W is replaced by the week number of the year (Monday as the first day + * of the week) as a decimal number (00-53). + * %w is replaced by the weekday (Sunday as the first day of the week) as + * a decimal number (0-6). + * %u is replaced by the weekday (Monday as the first day of the week) as + * a decimal number (1-7). + * %F is equivalent to ``%Y-%m-%d''. + */ + +// predefined and accpeted formats +static const char *subdir_def[] = { + "", // default index 0 - no subdir hierarchy + "%Y/%m/%d", + "%Y/%m/%d/%H", + "%Y/%W/%u", + "%Y/%W/%u/%H", + "%Y/%j", + "%Y/%j/%H", + "%F", + "%F/%H", + NULL +}; + + +// all accpeted char in a string +#define AcceptedFormatChar "YymdjHMsUWwuF" + +static mode_t mode, dir_mode; +static const char *subdir_format; + +static struct entry_filter_s { + char *first_entry; + char *last_entry; + int list_files; +} *dir_entry_filter; + +#define NUM_PTR 16 + +// globals +extern uint32_t twin_first, twin_last; + +static char *first_file, *last_file; +static char *current_file = NULL; +static stringlist_t source_dirs, file_list; + +/* Function prototypes */ +static inline int CheckTimeWindow(uint32_t t_start, uint32_t t_end, stat_record_t *stat_record); + +static void GetFileList(char *path); + +static void CleanPath(char *entry); + +static void Getsource_dirs(char *dirs); + +static int mkpath(char *path, char *p, mode_t mode, mode_t dir_mode, char *error, size_t errlen); + +static char *GuessSubDir(char *channeldir, char *filename); + +static char *VerifyFileRange(char *path, char *last_file); + +/* Functions */ + +static int compare(const FTSENT **f1, const FTSENT **f2) { + return strcmp( (*f1)->fts_name, (*f2)->fts_name); +} // End of compare + +static void CleanPath(char *entry) { +char *p, *q; +size_t len; + + // wash out any '//' in entry + while ( (p = strstr(entry, "//")) != NULL ) { + p++; + q = p+1; // q points to first char after '//' + while ( *p ) + *p++ = *q++; + } + + // remove trailing '/' + len = strlen(entry); + if ( entry[len-1] == '/' ) + entry[len-1] = '\0'; + + // wash out any '/./' in entry + while ( (p = strstr(entry, "/./")) != NULL ) { + p++; + q = p+2; // q points to first char after '/./' + while ( *p ) + *p++ = *q++; + } + + // remove leading './' in entry + if ( strstr(entry, "./") == entry ) { + p = entry; + q = p + 2; + while ( *p ) + *p++ = *q++; + } + +} // End of CleanPath + +static inline int CheckTimeWindow(uint32_t t_start, uint32_t t_end, stat_record_t *stat_record) { + +/* + printf("t start %u %s", t_start, ctime(&t_start)); + printf("t end %u %s", t_end, ctime(&t_end)); + printf("f start %u %s", NetflowStat.first_seen, ctime(&NetflowStat.first_seen)); + printf("f end %u %s", NetflowStat.last_seen, ctime(&NetflowStat.last_seen)); +*/ + + // if no time window is set, return true + if ( t_start == 0 ) + return 1; + + if ( stat_record->first_seen == 0 ) + return 0; + + if ( t_start >= stat_record->first_seen && t_start <= stat_record->last_seen ) + return 1; + + if ( t_end >= stat_record->first_seen && t_end <= stat_record->last_seen ) + return 1; + + if ( t_start < stat_record->first_seen && t_end > stat_record->last_seen ) + return 1; + + return 0; + +} // End of CheckTimeWindow + +// file filter for scandir function + +static int dirlevels(char *dir) { +int num; + + if ( !dir ) + return 0; + + num = 0; + if ( dir[0] == '/' ) + dir++; + + while ( *dir ) { + if ( *dir == '/' ) + num++; + dir++; + } + + return num; + +} // End of dirlevels + +static void CreateDirListFilter(char *first_path, char *last_path, int file_list_level) { +int i; +char *p, *q, *first_mark, *last_mark; + +// printf("First Dir: '%s', first_path: '%s', last_path '%s', first_file '%s', last_file '%s', list_level: %i\n", +// source_dirs.list[0], first_path, last_path, first_file, last_file, file_list_level); + + if ( file_list_level == 0 ) + return; + + if ( file_list_level < 0 ) { + fprintf(stderr, "software error in %s line %d: %s\n", __FILE__, __LINE__, strerror(errno) ); + exit(250); + } + + dir_entry_filter = (struct entry_filter_s *)malloc((file_list_level+1) * sizeof(struct entry_filter_s)); + if ( !dir_entry_filter ) { + fprintf(stderr, "malloc() error in %s line %d: %s\n", __FILE__, __LINE__, strerror(errno) ); + exit(250); + } + + // first default entry - the directory itself + dir_entry_filter[0].first_entry = NULL; + dir_entry_filter[0].last_entry = NULL; + dir_entry_filter[0].list_files = 0; + + first_mark = first_path; + last_mark = last_path; + // intermediate directory level filters + for ( i=1; i 0 ) + fprintf(stderr, "WARNING: Entry '%s' > '%s'. Will not match anything!\n", + dir_entry_filter[i].first_entry, dir_entry_filter[i].last_entry); + +// printf("%i first: '%s', last: '%s'\n", +// i, dir_entry_filter[i].first_entry, dir_entry_filter[i].last_entry); + } + + // the last level - files are listed here + dir_entry_filter[file_list_level].first_entry = first_file; + dir_entry_filter[file_list_level].last_entry = last_file; + dir_entry_filter[file_list_level].list_files = 1; + + if ( dir_entry_filter[file_list_level].first_entry && dir_entry_filter[file_list_level].last_entry && + strcmp(dir_entry_filter[file_list_level].first_entry, dir_entry_filter[file_list_level].last_entry) > 0 ) + fprintf(stderr, "WARNING: File '%s' > '%s'. Will not match anything!\n", + dir_entry_filter[file_list_level].first_entry, dir_entry_filter[file_list_level].last_entry); + +// printf("%i first: '%s', last: '%s'\n", +// file_list_level, dir_entry_filter[file_list_level].first_entry, dir_entry_filter[file_list_level].last_entry); + +} // End of CreateDirListFilter + +static void GetFileList(char *path) { +struct stat stat_buf; +char *last_file_ptr, *first_path, *last_path; +int levels_first_file, levels_last_file, file_list_level; +int sub_index; + +FTS *fts; +FTSENT *ftsent; + + CleanPath(path); + + // Check for last_file option + last_file_ptr = strchr(path, ':'); + first_path = last_path = NULL; + levels_first_file = levels_last_file = 0; + if ( last_file_ptr ) { + // make sure we have only a single ':' in path + if ( strrchr(path, ':') != last_file_ptr ) { + fprintf(stderr, "Multiple file separators ':' in path not allowed!\n"); + exit(250); + } + *last_file_ptr++ = '\0'; + // last_file_ptr points to last_file + + if ( strlen(last_file_ptr) == 0 ) { + fprintf(stderr, "Missing last file option after ':'!\n"); + exit(250); + } + + CleanPath(last_file_ptr); + // make sure last_file option is not a full path + if ( last_file_ptr[0] == '/') { + fprintf(stderr, "Last file name in -R list must not start with '/'\n"); + exit(250); + } + // how may sub dir levels has last_file option? + levels_last_file = dirlevels(last_file_ptr); + + // if no subdirs are given for last_file, try to find out, if the last_file + // exists in any possible subdirs + if ( levels_last_file == 0 ) { + char s[MAXPATHLEN]; + char *r = VerifyFileRange(path, last_file_ptr); + + if ( r != last_file_ptr && r[0] != '\0' ) { + snprintf(s, MAXPATHLEN-1, "%s/%s", r, last_file_ptr); + s[MAXPATHLEN-1] = '\0'; + last_file_ptr = strdup(s); + levels_last_file = dirlevels(last_file_ptr); + } + } + + } + + levels_first_file = dirlevels(path); + + if ( source_dirs.num_strings == 0 ) { + // No multiple sources option -M + + // path contains the path to a file/directory + // stat this entry + if ( stat(path, &stat_buf) ) { + fprintf(stderr, "stat() error '%s': %s\n", path, strerror(errno)); + exit(250); + } + if ( !S_ISDIR(stat_buf.st_mode) && !S_ISREG(stat_buf.st_mode) ) { + fprintf(stderr, "Not a file or directory: '%s'\n", path); + exit(250); + } + + // Check, how many levels of directory in path + levels_first_file = dirlevels(path); + + if ( last_file_ptr ) { + // path is [/]path/to/any/dir|file:last_file_ptr + + // make sure first_file is a file + if ( S_ISDIR(stat_buf.st_mode) ) { + fprintf(stderr, "Not a file: '%s'\n", path); + exit(250); + } + + if ( levels_last_file ) { + // we have levels_last_file number of sub dirs + + // sub dir levels of first_file mus have at least the same number of levels as last_file + if ( levels_first_file < levels_last_file ) { + fprintf(stderr, "Number of sub dirs for sub level hierarchy for file list -R do not match\n"); + exit(250); + } + if ( levels_first_file == levels_last_file ) { + char *p, *q; + // path = [/]sub1[/..]/first_file:sub1[/...]/last_file + if ( path[0] == '/' ) { + // this is rather strange, but strctly spoken, valid anyway + InsertString(&source_dirs, "/"); + path++; + } else { + InsertString(&source_dirs, "."); + } + + // path = sub_first[/..]/first_file:sub_last[/...]/last_file + p = strrchr(path, '/'); + q = strrchr(last_file_ptr, '/'); + if ( !p || !q ) { + // this should never happen + fprintf(stderr, "software error in %s line %d: %s\n", __FILE__, __LINE__, strerror(errno) ); + exit(250); + } + *p++ = '\0'; + *q++ = '\0'; + first_file = strdup(p); + last_file = strdup(q); + file_list_level = levels_last_file + 1; + first_path = path; + last_path = last_file_ptr; + + } else { + // path = [/]path/to/sub_first[/..]/first_file:sub_last[/...]/last_file + int i; + char *p, *r, *s; + + p = strrchr(path, '/'); + // levels_first_file > levels_last_file + + // step back the number of sub dirs in first_file + for ( i=0; i= path && *p != '/'); + } + *p++ = '\0'; + + InsertString(&source_dirs, path); + + r = strrchr(p, '/'); + s = strrchr(last_file_ptr, '/'); + if ( !r || !s ) { + // this must never happen + fprintf(stderr, "software error in %s line %d: %s\n", __FILE__, __LINE__, strerror(errno) ); + exit(250); + } + *r++ = '\0'; + *s++ = '\0'; + first_file = strdup(r); + last_file = strdup(s); + // files are listed at this sub dir level + file_list_level = levels_last_file + 1; + first_path = p; + last_path = last_file_ptr; + + } + + } else { + // we have no sub dir levels given + + // path is [/]path/to/any/file + char *p = strrchr(path, '/'); + + if ( p ) { + // path is [/]path/to/any/first_file:last_file + *p++ = '\0'; + // path is the direcory containing all the files + InsertString(&source_dirs, path); + first_file = strdup(p); + } else { + // path is first_file:last_file + InsertString(&source_dirs, "."); + first_file = strdup(path); + } + // set last_file filter + last_file = strdup(last_file_ptr); + // in any case we list the files of directory level 1 + file_list_level = 1; + } + } else { + // path is [/]path/to/any/dir|file + if ( S_ISDIR(stat_buf.st_mode) ) { + // path is [/]path/to/any/dir + // list all files in this directory + InsertString(&source_dirs, path); + first_file = NULL; + file_list_level = 0; + } else { + // path is [/]path/to/any/file + char *p = strrchr(path, '/'); + if ( p ) { + // path is [/]path/to/any/file + *p++ = '\0'; + // path is the direcory containing all the files + InsertString(&source_dirs, path); + first_file = strdup(p); + } else { + // path is file + InsertString(&source_dirs, "."); + first_file = strdup(path); + } + // in any case we list the files of directory level 1 + file_list_level = 1; + } + // in any case, no last_file filter + last_file = NULL; + } + + } else { + char pathbuff[MAXPATHLEN]; + // multiple sources option -M given + if ( path[0] == '/') { + fprintf(stderr, "File list -R must not start with '/' when combined with a source list -M\n"); + exit(250); + } + + // special case for all files in directory + if ( strcmp(path, ".") == 0 ) { + first_file = NULL; + last_file = NULL; + file_list_level = 0; + } else { + // pathbuff contains the path to a file/directory, compiled using the first entry + // in the source_dirs + snprintf(pathbuff, MAXPATHLEN-1, "%s/%s", source_dirs.list[0], path); + pathbuff[MAXPATHLEN-1] = '\0'; + + // pathbuff must point to a file + if ( stat(pathbuff, &stat_buf) ) { + if ( errno == ENOENT ) { + // file not found - try to guess a possible subdir + char *sub_dir = GuessSubDir(source_dirs.list[0], path); + if ( sub_dir ) { // subdir found + snprintf(pathbuff, MAXPATHLEN-1, "%s/%s", sub_dir, path); + pathbuff[MAXPATHLEN-1] = '\0'; + // update path + path = strdup(pathbuff); + free(sub_dir); + + // need guessing subdir with last_file too + if ( last_file_ptr ) { + sub_dir = GuessSubDir(source_dirs.list[0], last_file_ptr); + if ( sub_dir ) { // subdir found + snprintf(pathbuff, MAXPATHLEN-1, "%s/%s", sub_dir, last_file_ptr); + pathbuff[MAXPATHLEN-1] = '\0'; + last_file_ptr = strdup(pathbuff); + free(sub_dir); + + // update dir levels of extended file path + levels_last_file = dirlevels(last_file_ptr); + } else { + fprintf(stderr, "'%s': %s\n", last_file_ptr, "File not found!"); + exit(250); + } + } + + } else { // no file in any possible subdir found + fprintf(stderr, "stat() error '%s': %s\n", pathbuff, "File not found!"); + exit(250); + } + } else { // Any other stat error + fprintf(stderr, "stat() error '%s': %s\n", pathbuff, strerror(errno)); + exit(250); + } + } else if ( !S_ISREG(stat_buf.st_mode) ) { + fprintf(stderr, "Not a file : '%s'\n", pathbuff); + exit(250); + } + + // Check, how many levels of directory in path + levels_first_file = dirlevels(path); + + if ( last_file_ptr ) { + // path is path/to/any/first_file:last_file_ptr + char *p, *q; + + // the number of sub dirs must be eqal for first_file and last_file + if ( levels_first_file != levels_last_file ) { + fprintf(stderr, "Number of sub dirs must agree in '%s' and '%s'\n", path, last_file_ptr); + exit(250); + } + + p = strrchr(path, '/'); + if ( p ) { + // path is fist_sub/to/any/first_file + // recursive all files in sub dirs + file_list_level = dirlevels(path) + 1; + *p++ = '\0'; + first_file = strdup(p); + first_path = path; + } else { + // path is first_file + first_file = strdup(path); + file_list_level = 1; + } + + q = strrchr(last_file_ptr, '/'); + if ( q ) { + *q++ = '\0'; + last_file = strdup(q); + last_path = last_file_ptr; + } else { + last_file = strdup(last_file_ptr); + } + + } else { + // path is path/to/any/first_file + char *p = strrchr(path, '/'); + if ( p ) { + // path is fist_sub/to/any/first_file + // recursive all files in sub dirs + file_list_level = dirlevels(path) + 1; + *p++ = '\0'; + first_file = strdup(p); + first_path = path; + } else { + // path is first_file + first_file = strdup(path); + file_list_level = 1; + } + last_file = NULL; + } + } + } + +/* +printf("first_file %s\n", first_file ? first_file : ""); +printf("last_file %s\n", last_file ? last_file : ""); +printf("first_path %s\n", first_path ? first_path : ""); +printf("last_path %s\n", last_path ? last_path : ""); +printf("file_list_level: %i\n", file_list_level); +*/ + CreateDirListFilter(first_path, last_path, file_list_level ); + + // last entry must be NULL + InsertString(&source_dirs, NULL); + fts = fts_open(source_dirs.list, FTS_LOGICAL, compare); + sub_index = 0; + while ( (ftsent = fts_read(fts)) != NULL) { + int fts_level = ftsent->fts_level; + char *fts_path; + +// printf("DBG: %u %i %s %s\n", ftsent->fts_info, ftsent->fts_level, ftsent->fts_path, ftsent->fts_name); + + if ( fts_level == 0 ) { + sub_index = ftsent->fts_pathlen + 1; + continue; + } + + if ( ftsent->fts_pathlen < sub_index ) { + printf("ERROR: fts_pathlen error at %s line %d\n", __FILE__, __LINE__); + exit(250); + } + fts_path = &ftsent->fts_path[sub_index]; + +/* +if ( file_list_level ) +printf("DGB: short fts: '%s', filer_first: '%s', filter_last: '%s'\n", + fts_path, dir_entry_filter[fts_level].first_entry , dir_entry_filter[fts_level].last_entry); +*/ + switch (ftsent->fts_info) { + case FTS_D: + // dir entry pre descend + if ( file_list_level && file_list_level && ( + ( dir_entry_filter[fts_level].first_entry && + ( strcmp(fts_path, dir_entry_filter[fts_level].first_entry ) < 0 ) ) || + ( dir_entry_filter[fts_level].last_entry && + ( strcmp(fts_path, dir_entry_filter[fts_level].last_entry ) > 0 ) ) + )) + fts_set(fts, ftsent, FTS_SKIP ); + + break; + case FTS_DP: + break; + case FTS_F: + // file entry +// printf("==> Check: %s\n", ftsent->fts_name); + + // skip stat file + if ( strcmp(ftsent->fts_name, ".nfstat") == 0 || + strncmp(ftsent->fts_name, NF_DUMPFILE , strlen(NF_DUMPFILE)) == 0) + continue; + if ( strstr(ftsent->fts_name, ".stat") != NULL ) + continue; + // skip pcap file + if ( strstr(ftsent->fts_name, "pcap") != NULL ) + continue; + + if ( file_list_level && ( + ( fts_level != file_list_level ) || + ( dir_entry_filter[fts_level].first_entry && + ( strcmp(ftsent->fts_name, dir_entry_filter[fts_level].first_entry) < 0 ) ) || + ( dir_entry_filter[fts_level].last_entry && + ( strcmp(ftsent->fts_name, dir_entry_filter[fts_level].last_entry) > 0 ) ) + ) ) + continue; + +// printf("==> Listed: %s\n", ftsent->fts_path); + InsertString(&file_list, ftsent->fts_path); + + break; + } + + } + fts_close(fts); + +} // End of GetFileList + +/* + * Get the list of directories + * dirs: user supplied parameter: /any/path/dir1:dir2:dir3:... + * source_dirs must result in + * /any/path/dir1 + * /any/path/dir2 + * /any/path/dir3 + * /any/path is dir prefix, which may be NULL e.g. dir1:dir2:dir3:... + * dir1, dir2 etc entrys + */ +void Getsource_dirs(char *dirs) { +struct stat stat_buf; +char *p, *q, *dirprefix; +char path[MAXPATHLEN]; + + q = strchr(dirs, ':'); + if ( q ) { // we have /path/to/firstdir:dir1:dir2:... + *q = 0; + p = strrchr(dirs, '/'); + if ( p ) { + *p++ = 0; // p points now to the first name in the dir list + dirprefix = dirs; + } else { // we have a source_dirs in current directory + p = dirs; // p points now to the first name in the dir list + dirprefix = "."; // current directory + } + *q = ':'; // restore ':' in source_dirs + + while ( p ) { // iterate over all elements in the dir list + q = strchr(p, ':'); + if ( q ) + *q = 0; + + // p point to a dir name + snprintf(path, 1023, "%s/%s", dirprefix, p); + path[MAXPATHLEN-1] = 0; + if ( stat(dirs, &stat_buf) ) { + fprintf(stderr, "Can't stat '%s': %s\n", path, strerror(errno)); + return; + } + if ( !S_ISDIR(stat_buf.st_mode) ) { + fprintf(stderr, "Not a directory: '%s'\n", path); + return; + } + + // save path into source_dirs + InsertString(&source_dirs, path); + + p = q ? q + 1 : NULL; + } + + } else { // we have only one directory + if ( stat(dirs, &stat_buf) ) { + fprintf(stderr, "Can't stat '%s': %s\n", dirs, strerror(errno)); + return; + } + if ( !S_ISDIR(stat_buf.st_mode) ) { + fprintf(stderr, "Not a directory: '%s'\n", dirs); + return; + } + + // save the path into source_dirs + InsertString(&source_dirs, dirs); + } + +} // End of Getsource_dirs + +void SetupInputFileSequence(char *multiple_dirs, char *single_file, char *multiple_files) { + + twin_first = 0; + twin_last = 0xffffffff; + + first_file = NULL; + last_file = NULL; + + InitStringlist(&source_dirs, NUM_PTR); + InitStringlist(&file_list, 64); + + if ( multiple_dirs ) + Getsource_dirs(multiple_dirs); + + if ( multiple_files ) { + // use multiple files + GetFileList(multiple_files); + + // get time window spanning all the files + if ( file_list.num_strings ) { + stat_record_t stat_ptr; + + // read the stat record + if ( !GetStatRecord(file_list.list[0], &stat_ptr) ) { + exit(250); + } + twin_first = stat_ptr.first_seen; + + // read the stat record of last file + if ( !GetStatRecord(file_list.list[file_list.num_strings-1], &stat_ptr) ) { + exit(250); + } + twin_last = stat_ptr.last_seen; + } + + } else if ( single_file ) { + CleanPath(single_file); + + if ( source_dirs.num_strings == 0 ) { + stat_record_t stat_ptr; + InsertString(&file_list, single_file); + if ( !GetStatRecord(single_file, &stat_ptr) ) { + exit(250); + } + twin_first = stat_ptr.first_seen; + twin_last = stat_ptr.last_seen; + + } else { + int i; + + if ( single_file[0] == '/' ) { + fprintf(stderr, "File -r must not start with '/', when combined with a source list -M\n"); + exit(250); + } + + for ( i=0; i"); +#endif + nffile = OpenFile(file_list.list[cnt], nffile); // Open the file + if ( !nffile ) { + return NULL; + } + current_file = file_list.list[cnt]; + cnt++; + + // stdin + if ( nffile->fd == STDIN_FILENO ) { + current_file = NULL; + return nffile; + } + + if ( CheckTimeWindow(twin_start, twin_end, nffile->stat_record) ) { + // printf("Return file: %s\n", string); + return nffile; + } + CloseFile(nffile); + } + + current_file = NULL; + return EMPTY_LIST; + +} // End of GetNextFile + + +int InitHierPath(int num) { +int i; + + subdir_format = NULL; + + i=0; + while ( subdir_def[i] != NULL ) { + if ( i == num ) + break; + i++; + } + if ( subdir_def[i] == NULL ) { + fprintf(stderr, "No such subdir level %i\n", num); + return 0; + } + + subdir_format = subdir_def[i]; + + /* + * The default file mode is a=rwx (0777) with selected permissions + * removed in accordance with the file mode creation mask. For + * intermediate path name components, the mode is the default modified + * by u+wx so that the subdirectories can always be created. + */ + + // get umask + mode = umask(0); + umask(mode); + + mode = 0777 & ~mode; + dir_mode = mode | S_IWUSR | S_IXUSR; + + return 1; + +} // End of InitHierPath + +static char *VerifyFileRange(char *path, char *last_file) { +char *p, *q, *r; + + r = strdup(path); + p = strrchr(r, '/'); + while ( p ) { + *p = '\0'; + + q = GuessSubDir(r, last_file); + if ( q ) { + free(r); + return q; + } + p = strrchr(r, '/'); + } + + free(r); + return last_file; + +} // End of VerifyFileRange + +static char *GuessSubDir(char *channeldir, char *filename) { +char s[MAXPATHLEN]; +struct tm *t_tm; +int i; + + if ( strlen(filename) == 19 && (strncmp(filename, "nfcapd.", 7) == 0) ) { + char *p = &filename[7]; + time_t t = ISO2UNIX(p); + t_tm = localtime(&t); + } else + return NULL; + + i = 0; + // if the file exists, it must be in any of the possible subdirs + // so try one after the next - one will match + while ( subdir_def[i] ) { + char const *sub_fmt = subdir_def[i]; + char subpath[255]; + struct stat stat_buf; + strftime(subpath, 254, sub_fmt, t_tm); + subpath[254] = '\0'; + + snprintf(s, MAXPATHLEN-1, "%s/%s/%s", channeldir, subpath, filename); + if ( stat(s, &stat_buf) == 0 && S_ISREG(stat_buf.st_mode) ) { + // found file in subdir + return strdup(subpath); + } + i++; + } + + return NULL; + +} // End of GuessSubDir + +char *GetSubDir(struct tm *now ) { +static char subpath[255]; +size_t sublen; + + sublen = strftime(subpath, 254, subdir_format, now); + + return sublen == 0 ? NULL : subpath; + +} // End of GetSubDir + +int SetupSubDir(char *dir, char *subdir, char *error, size_t errlen ) { +char *p, path[MAXPATHLEN]; +struct stat stat_buf; +size_t sublen, pathlen; +int err; + + error[0] = '\0'; + + path[0] = '\0'; + strncat(path, dir, MAXPATHLEN-1); + path[MAXPATHLEN-1] = '\0'; + + sublen = strlen(subdir); + pathlen = strlen(path); + // set p as reference between path and subdir + if ( (sublen + pathlen + 2) >= (MAXPATHLEN-1) ) { // +2 : add 1 for '/' + snprintf(error, errlen, "Path '%s': too long", path); + return 0; + } + + p = path + pathlen; // points to '\0' of path + *p++ = '/'; + *p = '\0'; + + strncat(path, subdir, MAXPATHLEN-pathlen-2); // +2: add 1 for '/' + + // our cwd is basedir ( -l ) so test if, dir exists + if ( stat(path, &stat_buf) == 0 ) { + if ( S_ISDIR(stat_buf.st_mode) ) { + // sub directory already exists + return 1; + } else { + // an entry with this name exists, but it's not a directory + snprintf(error, errlen, "Path '%s': %s ", path, strerror(ENOTDIR)); + return 0; + } + } + + // no such entry exists - try to create the directory, assuming path below exists + err = mkdir(path, dir_mode); + if ( err == 0 ) // success + return 1; + + // else errno is set + if ( errno == ENOENT ) { // we need to create intermediate directories as well + err = mkpath(path, p, mode, dir_mode, error, errlen); + if ( err == 0 ) // creation was successful + return 1; + } else { + snprintf(error, errlen, "mkdir() error for '%s': %s\n", path, strerror(errno)); + } + + // anything else failed and error string is set + return 0; + +} // End of SetupSubDir + +/* + * mkpath -- create directories. + * path - path + * p - separator path/subpath + * mode - file mode of terminal directory + * dir_mode - file mode of intermediate directories + */ +static int mkpath(char *path, char *p, mode_t mode, mode_t dir_mode, char *error, size_t errlen) { +struct stat sb; +char *slash; +int done = 0; + + slash = p; + + while (!done) { + slash += strspn(slash, "/"); + slash += strcspn(slash, "/"); + + done = (*slash == '\0'); + *slash = '\0'; + + if (stat(path, &sb)) { + if (errno != ENOENT || (mkdir(path, done ? mode : dir_mode) && errno != EEXIST)) { + snprintf(error, errlen, "mkdir() error for '%s': %s\n", path, strerror(errno)); + return (-1); + } + } else if (!S_ISDIR(sb.st_mode)) { + snprintf(error, errlen, "Path '%s': %s ", path, strerror(ENOTDIR)); + return (-1); + } + + *slash = '/'; + } + + return (0); + +} // End of mkpath + diff --git a/bin/flist.h b/bin/flist.h new file mode 100644 index 0000000..1b2fac5 --- /dev/null +++ b/bin/flist.h @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2014, Peter Haag + * Copyright (c) 2009, Peter Haag + * Copyright (c) 2004-2008, SWITCH - Teleinformatikdienste fuer Lehre und Forschung + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of the author nor the names of its contributors may be + * used to endorse or promote products derived from this software without + * specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 COPYRIGHT OWNER 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. + * + * $Author: haag $ + * + * $Id: flist.h 39 2009-11-25 08:11:15Z haag $ + * + * $LastChangedRevision: 39 $ + * + */ + +#ifndef _FLIST_H +#define _FLIST_H 1 + +#define EMPTY_LIST ((nffile_t *)-1) + +int InitHierPath(int num); + +char *GetSubDir(struct tm *now); + +int SetupSubDir(char *dir, char *subdir, char *error, size_t errlen ); + +nffile_t *GetNextFile(nffile_t *nffile, time_t twin_start, time_t twin_end); + +#endif //_FLIST_H diff --git a/bin/flowtree.c b/bin/flowtree.c new file mode 100644 index 0000000..a1480da --- /dev/null +++ b/bin/flowtree.c @@ -0,0 +1,626 @@ +/* + * Copyright (c) 2014, Peter Haag + * Copyright (c) 2011, Peter Haag + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of the author nor the names of its contributors may be + * used to endorse or promote products derived from this software without + * specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 COPYRIGHT OWNER 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. + * + * $Author$ + * + * $Id$ + * + * $LastChangedRevision$ + * + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "rbtree.h" +#include "util.h" +#include "nffile.h" +#include "bookkeeper.h" +#include "nfxstat.h" +#include "collector.h" +#include "flowtree.h" +#include "netflow_pcap.h" + +#ifndef DEVEL +# define dbg_printf(...) /* printf(__VA_ARGS__) */ +#else +# define dbg_printf(...) printf(__VA_ARGS__) +#endif + +static int FlowNodeCMP(struct FlowNode *e1, struct FlowNode *e2); + +// Insert the IP RB tree code here +RB_GENERATE(FlowTree, FlowNode, entry, FlowNodeCMP); + +// Flow Cache to store all nodes +#define FLOWELEMENTNUM 1024 * 1024 +//#define FLOWELEMENTNUM 128 +static struct FlowNode *FlowElementCache; + +// free list +static struct FlowNode *FlowNode_FreeList; +static pthread_mutex_t m_FreeList = PTHREAD_MUTEX_INITIALIZER; +static pthread_cond_t c_FreeList = PTHREAD_COND_INITIALIZER; +static uint32_t CacheOverflow; +static uint32_t Allocated; + +// Flow tree +static FlowTree_t *FlowTree; +static int NumFlows; + +// Simple unprotected list +typedef struct FlowNode_list_s { + struct FlowNode *list; + struct FlowNode *tail; + uint32_t size; +} Linked_list_t; + +static Linked_list_t UDP_list; + +/* static prototypes */ +static void AppendFlowNode(Linked_list_t *LinkedList, struct FlowNode *node); + +static void DisconnectFlowNode(Linked_list_t *LinkedList, struct FlowNode *node); + +static void TouchFlowNode(Linked_list_t *LinkedList, struct FlowNode *node); + +/* Free list handling functions */ +// Get next free node from free list +struct FlowNode *New_Node(void) { +struct FlowNode *node; + +#ifdef USE_MALLOC + node = malloc(sizeof(struct FlowNode)); + memset((void *)node, 'A', sizeof(struct FlowNode)); + node->left = NULL; + node->right = NULL; + node->data = NULL; + node->memflag = NODE_IN_USE; + dbg_printf("New node: %llx\n", (unsigned long long)node); + return node; +#endif + + pthread_mutex_lock(&m_FreeList); + while ( FlowNode_FreeList == NULL ) { + CacheOverflow++; + LogError("Free list exhausted: %u, Flows: %u - sleep", Allocated, NumFlows); + pthread_cond_wait(&c_FreeList, &m_FreeList); + } + + node = FlowNode_FreeList; + if ( node == NULL ) { + // should never happen , as we were waiting for a free node + LogError("*** Software ERROR *** New_Node() unexpected error in %s line %d: %s: %u\n", + __FILE__, __LINE__, "Node list exhausted", NumFlows); + pthread_mutex_unlock(&m_FreeList); + return NULL; + } + if ( node->memflag != NODE_FREE ) { + LogError("*** Software ERROR *** New_Node() unexpected error in %s line %d: %s\n", + __FILE__, __LINE__, "Tried to allocate a non free Node"); + abort(); + } + + FlowNode_FreeList = node->right; + Allocated++; + pthread_mutex_unlock(&m_FreeList); + + node->left = NULL; + node->right = NULL; + node->memflag = NODE_IN_USE; + + return node; + +} // End of New_node + +// return node into free list +void Free_Node(struct FlowNode *node) { + + if ( node->memflag == NODE_FREE ) { + LogError("Free_Node() Fatal: Tried to free an already freed Node"); + abort(); + } + + if ( node->memflag != NODE_IN_USE ) { + LogError("Free_Node() Fatal: Tried to free a Node not in use"); + abort(); + } + + if ( node->data ) { + free(node->data); + node->data = NULL; + } + +#ifdef DEVEL + assert(node->left == NULL); + assert(node->right == NULL); +#endif + +#ifdef USE_MALLOC + dbg_printf("Free node: %llx\n", (unsigned long long)node); + node->memflag = NODE_FREE; + memset((void *)node, 'B', sizeof(struct FlowNode)); + free(node); + return; +#endif + + memset((void *)node, 0, sizeof(struct FlowNode)); + + pthread_mutex_lock(&m_FreeList); + node->right = FlowNode_FreeList; + node->left = NULL; + node->memflag = NODE_FREE; + FlowNode_FreeList = node; + Allocated--; + pthread_mutex_unlock(&m_FreeList); + if ( CacheOverflow ) { + CacheOverflow = 0; + pthread_cond_signal(&c_FreeList); + } + +} // End of Free_Node + +/* safety check - this must never become 0 - otherwise the cache is too small */ +uint32_t CacheCheck(void) { + return FLOWELEMENTNUM - NumFlows; +} // End of CacheCheck + +/* flow tree functions */ +int Init_FlowTree(uint32_t CacheSize) { +int i; + + FlowTree = malloc(sizeof(FlowTree_t)); + if ( !FlowTree ) { + LogError("malloc() error in %s line %d: %s", __FILE__, __LINE__, strerror(errno) ); + return 0; + } + RB_INIT(FlowTree); + + if ( CacheSize == 0 ) + CacheSize = FLOWELEMENTNUM; + FlowElementCache = calloc(CacheSize, sizeof(struct FlowNode)); + if ( !FlowElementCache ) { + LogError("malloc() error in %s line %d: %s", __FILE__, __LINE__, strerror(errno) ); + free(FlowTree); + FlowTree = NULL; + return 0; + } + + // init free list + FlowNode_FreeList = FlowElementCache; + FlowNode_FreeList->left = NULL; + FlowNode_FreeList->right = &FlowElementCache[1]; + FlowNode_FreeList->memflag = NODE_FREE; + for (i=1; i < (CacheSize-1); i++ ) { + FlowElementCache[i].memflag = NODE_FREE; + FlowElementCache[i].left = &FlowElementCache[i-1]; + FlowElementCache[i].right = &FlowElementCache[i+1]; + } + FlowElementCache[i].left = &FlowElementCache[i-1]; + FlowElementCache[i].right = NULL; + FlowElementCache[i].memflag = NODE_FREE; + + CacheOverflow = 0; + Allocated = 0; + NumFlows = 0; + + UDP_list.list = NULL; + UDP_list.tail = NULL; + UDP_list.size = 0; + + return 1; +} // End of Init_FlowTree + +void Dispose_FlowTree(void) { +struct FlowNode *node, *nxt; + + // Dump all incomplete flows to the file + for (node = RB_MIN(FlowTree, FlowTree); node != NULL; node = nxt) { + nxt = RB_NEXT(FlowTree, FlowTree, node); + RB_REMOVE(FlowTree, FlowTree, node); + if ( node->data ) + free(node->data); + } + free(FlowElementCache); + FlowElementCache = NULL; + FlowNode_FreeList = NULL; + CacheOverflow = 0; + +} // End of Dispose_FlowTree + +static int FlowNodeCMP(struct FlowNode *e1, struct FlowNode *e2) { +uint64_t *a = e1->src_addr.v6; +uint64_t *b = e2->src_addr.v6; +int i; + +#define CMPLEN (offsetof(struct FlowNode, _ENDKEY_) - offsetof(struct FlowNode, src_addr)) + + i = memcmp((void *)a, (void *)b, CMPLEN ); + return i; + +} // End of FlowNodeCMP + +struct FlowNode *Lookup_Node(struct FlowNode *node) { + return RB_FIND(FlowTree, FlowTree, node); +} // End of Lookup_FlowTree + +struct FlowNode *Insert_Node(struct FlowNode *node) { +struct FlowNode *n; + + // return RB_INSERT(FlowTree, FlowTree, node); + n = RB_INSERT(FlowTree, FlowTree, node); + if ( n ) { // existing node + return n; + } else { + NumFlows++; + return NULL; + } +} // End of Lookup_FlowTree + +void Remove_Node(struct FlowNode *node) { + +#ifdef DEVEL + assert(node->memflag == NODE_IN_USE); + if ( NumFlows == 0 ) { + LogError("Remove_Node() Fatal Tried to remove a Node from empty tree"); + return; + } +#endif + + RB_REMOVE(FlowTree, FlowTree, node); + Free_Node(node); + NumFlows--; + +} // End of Lookup_FlowTree + +uint32_t Flush_FlowTree(FlowSource_t *fs) { +struct FlowNode *node, *nxt; +uint32_t n = NumFlows; + + // Dump all incomplete flows to the file + for (node = RB_MIN(FlowTree, FlowTree); node != NULL; node = nxt) { + StorePcapFlow(fs, node); + nxt = RB_NEXT(FlowTree, FlowTree, node); +#ifdef DEVEL +if ( node->left || node->right ) { + assert(node->proto == 17); + node->left = node->right = NULL; +} +#endif + Remove_Node(node); + } + +#ifdef DEVEL + if ( NumFlows != 0 ) + LogError("### Flush_FlowTree() remaining flows: %u\n", NumFlows); +#endif + + UDP_list.list = NULL; + UDP_list.tail = NULL; + UDP_list.size = 0; + + return n; + +} // End of Flush_FlowTree + +void UDPexpire(FlowSource_t *fs, time_t t_expire) { +struct FlowNode *node; +uint32_t num = 0; + + node = UDP_list.list; + while ( node && (node->t_last.tv_sec < t_expire) ) { + struct FlowNode *n = node; + node = node->right; + DisconnectFlowNode(&UDP_list, n); + StorePcapFlow(fs, n); + Remove_Node(n); + num++; + } + dbg_printf("UDP expired %u flows - left %u\n", num, UDP_list.size); + +} // End of UDPexpire + +void AppendUDPNode(struct FlowNode *node) { + AppendFlowNode(&UDP_list, node); +} // End of AppendUDPNode + +static void AppendFlowNode(Linked_list_t *LinkedList, struct FlowNode *node) { + +#ifdef DEVEL + if ( LinkedList->tail ) + assert(LinkedList->tail->right == NULL); + assert(node->memflag == NODE_IN_USE); + assert(node->left == NULL); + assert(node->right == NULL); +#endif + if ( LinkedList->list == NULL ) { + dbg_printf("AppendFlowNode(): First node\n"); + node->left = NULL; + node->right = NULL; + LinkedList->list = node; + LinkedList->tail = node; + LinkedList->size++; + } else { + // new node + dbg_printf("AppendFlowNode(): next node: %u\n", LinkedList->size); + LinkedList->tail->right = node; + node->left = LinkedList->tail; + node->right = NULL; + LinkedList->tail = node; + LinkedList->size++; + } +#ifdef DEVEL + assert(LinkedList->tail->right == NULL); +#endif +} // End of AppendFlowNode + + +static void DisconnectFlowNode(Linked_list_t *LinkedList, struct FlowNode *node) { + + if ( node == NULL ) + return; + + else { + // disconnect node + struct FlowNode *prev = node->left; + struct FlowNode *next = node->right; + if ( prev ) + prev->right = next; + else + LinkedList->list = next; + + if ( next ) + next->left = prev; + + if ( LinkedList->tail == node ) + LinkedList->tail = node->left; + + node->left = NULL; + node->right = NULL; + + LinkedList->size--; + } + +} // End of DisconnectFlowNode + +void TouchUDPNode(struct FlowNode *node) { + TouchFlowNode(&UDP_list, node); +} // End of TouchUDPNode + +static void TouchFlowNode(Linked_list_t *LinkedList, struct FlowNode *node) { + + dbg_printf("In TochFlowNode()\n"); + if ( LinkedList->list == NULL ) { + // should never happen + LogError("TouchFlowNode() error in %s line %d: %s\n", __FILE__, __LINE__, "Tried to touch node in empty list" ); + return; + } + + if ( LinkedList->tail == node ) { + // nothing to do + dbg_printf("TochFlowNode() - last node - nothing to do\n"); + return; + } + + if ( node->left == NULL ) { + // first node - disconnect node + dbg_printf("TochFlowNode() - touch first node\n"); + LinkedList->list = node->right; + LinkedList->list->left = NULL; + } else { + dbg_printf("TochFlowNode() - touch middle node\n"); + (node->right)->left = node->left; + (node->left)->right = node->right; + } + + // append node + LinkedList->tail->right = node; + node->left = LinkedList->tail; + node->right = NULL; + LinkedList->tail = node; + +} // End of TouchFlowNode + +int AddNodeData(struct FlowNode *node, uint32_t seq, void *payload, uint32_t size) { + + return 0; +} // End of AddNodeData + +/* Node list functions */ +NodeList_t *NewNodeList(void) { +NodeList_t *NodeList; + + NodeList = (NodeList_t *)malloc(sizeof(NodeList_t)); + if ( !NodeList ) { + LogError("malloc() error in %s line %d: %s", __FILE__, __LINE__, strerror(errno) ); + return NULL; + } + NodeList->list = NULL; + NodeList->last = NULL; + NodeList->length = 0; + pthread_mutex_init(&NodeList->m_list, NULL); + pthread_cond_init(&NodeList->c_list, NULL); + + return NodeList; + +} // End of NewNodeList + +void DisposeNodeList(NodeList_t *NodeList) { + + if ( !NodeList ) + return; + + if ( NodeList->length ) { + LogError("Try to free non empty NodeList"); + return; + } + free(NodeList); + +} // End of DisposeNodeList + +#ifdef DEVEL +void ListCheck(NodeList_t *NodeList) { +uint32_t len = 0, mem = 0, proto; +static uint32_t loops = 0; +struct FlowNode *node, *n; + +// DumpList(NodeList); + loops++; + node = NodeList->list; + while (node) { + len++; + if ( node == NodeList->last ) { + mem = len; + } + if ( node->memflag != NODE_IN_USE ) { + printf("mem flag error : len: %u, last: %u, Nodelist: %u, loops: %u\n", len, mem, NodeList->length, loops); + } + if ( node->right == NULL ) { + proto = node->proto; + n = node; + } + + node=node->right; + } + if ( len != NodeList->length) { + printf("Len miss match: len: %u, last: %u, proto: %u, Nodelist: %u, loops: %u, allocated: %u, overlow: %u node: %llx\n", len, mem, proto, NodeList->length, loops, Allocated, CacheOverflow, (long long unsigned)n); + assert(len==NodeList->length); + } else { +printf("Len: %u ok last: %u, proto: %u in loop %u, allocated: %u, overlow: %u\n", +len, mem, proto, loops, Allocated, CacheOverflow); + } +} +#endif + +void Push_Node(NodeList_t *NodeList, struct FlowNode *node) { + + pthread_mutex_lock(&NodeList->m_list); + if ( NodeList->length == 0 ) { + // empty list + NodeList->list = node; + node->left = NULL; + node->right = NULL; + } else { + NodeList->last->right = node; + node->left = NodeList->last; + node->right = NULL; + } + NodeList->last = node; + NodeList->length++; +#ifdef DEVEL + int proto = node->proto; + printf("pushed node 0x%llx proto: %u, length: %u first: %llx, last: %llx\n", + (unsigned long long)node, proto, NodeList->length, (unsigned long long)NodeList->list, (unsigned long long)NodeList->last); + ListCheck(NodeList); +#endif + pthread_mutex_unlock(&NodeList->m_list); + pthread_cond_signal(&NodeList->c_list); + +} // End of Push_Node + +struct FlowNode *Pop_Node(NodeList_t *NodeList, int *done) { +struct FlowNode *node; +int proto; + + pthread_mutex_lock(&NodeList->m_list); + while ( NodeList->length == 0 && !*done ) + pthread_cond_wait(&NodeList->c_list, &NodeList->m_list); + + if ( NodeList->length == 0 && *done ) { + pthread_mutex_unlock(&NodeList->m_list); + dbg_printf("Pop_Node done\n"); + return NULL; + } + + if ( NodeList->list == NULL ) { + // should never happen - list is supposed to have at least one item + pthread_mutex_unlock(&NodeList->m_list); + LogError("Unexpected empty FlowNode_ProcessList"); + return NULL; + } + + node = NodeList->list; + NodeList->list = node->right; + if ( NodeList->list ) + NodeList->list->left = NULL; + else + NodeList->last = NULL; + + node->left = NULL; + node->right = NULL; + proto = node->proto; + + NodeList->length--; +#ifdef DEVEL + printf("popped node 0x%llx proto: %u, length: %u first: %llx, last: %llx\n", + (unsigned long long)node, proto, NodeList->length, (unsigned long long)NodeList->list, (unsigned long long)NodeList->last); + + ListCheck(NodeList); +#endif + pthread_mutex_unlock(&NodeList->m_list); + + return node; +} // End of Pop_Node + +void DumpList(NodeList_t *NodeList) { +struct FlowNode *node; + + printf("FlowNode_ProcessList: 0x%llx, length: %u\n", + (unsigned long long)NodeList->list, NodeList->length); + node = NodeList->list; + while ( node ) { + printf("node: 0x%llx\n", (unsigned long long)node); + printf(" ->left: 0x%llx\n", (unsigned long long)node->left); + printf(" ->right: 0x%llx\n", (unsigned long long)node->right); + node = node->right; + } + printf("tail: 0x%llx\n\n", (unsigned long long)NodeList->last); +} // End of DumpList + +void DumpNodeStat(void) { + LogInfo("Nodes in use: %u, Flows: %u CacheOverflow: %u", Allocated, NumFlows, CacheOverflow); +} // End of NodesAllocated + +/* +int main(int argc, char **argv) { + + + return 0; +} // End of main +*/ diff --git a/bin/flowtree.h b/bin/flowtree.h new file mode 100644 index 0000000..7b1f130 --- /dev/null +++ b/bin/flowtree.h @@ -0,0 +1,149 @@ +/* + * Copyright (c) 2014, Peter Haag + * Copyright (c) 2011, Peter Haag + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of the author nor the names of its contributors may be + * used to endorse or promote products derived from this software without + * specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 COPYRIGHT OWNER 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. + * + * $Author$ + * + * $Id$ + * + * $LastChangedRevision$ + * + */ + +#include "rbtree.h" + +#define v4 ip_union._v4 +#define v6 ip_union._v6 + +struct FlowNode { + // tree + RB_ENTRY(FlowNode) entry; + + // linked list + struct FlowNode *left; + struct FlowNode *right; + + struct FlowNode *biflow; + + // flow key + // IP addr + ip_addr_t src_addr; + ip_addr_t dst_addr; + + uint16_t src_port; + uint16_t dst_port; + uint8_t proto; + uint8_t version; + uint16_t _ENDKEY_; + // End of flow key + + ip_addr_t tun_src_addr; + ip_addr_t tun_dst_addr; + uint8_t tun_proto; + +#define NODE_FREE 0xA5 +#define NODE_IN_USE 0x5A + uint16_t memflag; // internal houskeeping flag + uint8_t flags; +#define FIN_NODE 1 +#define SIGNAL_NODE 255 + uint8_t fin; // double use: 1: fin received - flow can be exported, if complete + // 255: empty node - used to wake up flow thread priodically on quite lines + + // flow stat data + struct timeval t_first; + struct timeval t_last; + + uint32_t packets; // summed up number of packets + uint32_t bytes; // summed up number of bytes + + // flow payload +#define DATABLOCKSIZE 256 + uint32_t DataSize; // max size of data buffer + void *data; // start of data buffer +// uint32_t eodata; // offset last byte in buffer + +}; + +typedef struct NodeList_s { + struct FlowNode *list; + struct FlowNode *last; + pthread_mutex_t m_list; + pthread_cond_t c_list; + uint32_t length; +} NodeList_t; + + +/* flow tree type */ +typedef RB_HEAD(FlowTree, FlowNode) FlowTree_t; + +// Insert the RB prototypes here +RB_PROTOTYPE(FlowTree, FlowNode, entry, FlowNodeCMP); + +int Init_FlowTree(uint32_t CacheSize); + +void Dispose_FlowTree(void); + +uint32_t Flush_FlowTree(FlowSource_t *fs); + +struct FlowNode *Lookup_Node(struct FlowNode *node); + +struct FlowNode *New_Node(void); + +void Free_Node(struct FlowNode *node); + +uint32_t CacheCheck(void); + +int AddNodeData(struct FlowNode *node, uint32_t seq, void *payload, uint32_t size); + +struct FlowNode *Insert_Node(struct FlowNode *node); + +void Remove_Node(struct FlowNode *node); + +// Node list functions +NodeList_t *NewNodeList(void); + +void DisposeNodeList(NodeList_t *NodeList); + +void Push_Node(NodeList_t *NodeList, struct FlowNode *node); + +struct FlowNode *Pop_Node(NodeList_t *NodeList, int *done); + +void DumpList(NodeList_t *NodeList); + +// Liked lists +void AppendUDPNode(struct FlowNode *node); + +void TouchUDPNode(struct FlowNode *node); + +void UDPexpire(FlowSource_t *fs, time_t t_expire); + +// Stat functions +void DumpNodeStat(void); + + diff --git a/bin/ft2nfdump.c b/bin/ft2nfdump.c new file mode 100644 index 0000000..5f6e01a --- /dev/null +++ b/bin/ft2nfdump.c @@ -0,0 +1,406 @@ +/* + * All rights reserved. + * Copyright (c) 2014, Peter Haag + * Copyright (c) 2009, Peter Haag + * Copyright (c) 2004-2008, SWITCH - Teleinformatikdienste fuer Lehre und Forschung + * Copyright (c) 2001 Mark Fullmer and The Ohio State University + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of the author nor the names of its contributors may be + * used to endorse or promote products derived from this software without + * specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 COPYRIGHT OWNER 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. + * + * Flow-Tools related code taken from flow-tools-0.67 cretated by Mark Fullmer + * + * $Author: haag $ + * + * $Id: ft2nfdump.c 69 2010-09-09 07:17:43Z haag $ + * + * $LastChangedRevision: 69 $ + * + * + */ + +#include "config.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#ifdef HAVE_STDINT_H +#include +#endif + +#include "ftlib.h" +#include "nf_common.h" +#include "nffile.h" +#include "nfx.h" +#include "launch.h" + +/* Global defines */ +#define MAXRECORDS 30 + +/* Global consts */ +extern extension_descriptor_t extension_descriptor[]; + +const char *nfdump_version = VERSION; + +typedef struct v5_block_s { + uint32_t srcaddr; + uint32_t dstaddr; + uint32_t dPkts; + uint32_t dOctets; + uint8_t data[4]; // link to next record +} v5_block_t; + +/* externals */ +extern uint32_t Max_num_extensions; + +/* prototypes */ +void usage(char *name); + +extension_info_t *GenExtensionMap(struct ftio *ftio); + +int flows2nfdump(struct ftio *ftio, extension_info_t *extension_info, int extended, uint32_t limitflows); + +#define NEED_PACKRECORD +#include "nffile_inline.c" +#undef NEED_PACKRECORD + +void usage(char *name) { + printf("usage %s [options] \n" + "-h\t\tthis text you see right here.\n" + "-E\t\tDump records in ASCII extended format to stdout.\n" + "-c\t\tLimit number of records to convert.\n" + "-m\t\tPrint the extension map and exit.\n" + "-V\t\tPrint version and exit.\n" + "-r\t\tread input from file\n" + "Convert flow-tools format to nfdump format:\n" + "ft2nfdump -r | nfdump -z -w \n" + , name); + +} // End of usage + +extension_info_t *GenExtensionMap(struct ftio *ftio) { +extension_info_t *extension_info; +int i; + + if (ftio_check_xfield(ftio, FT_XFIELD_DPKTS | + FT_XFIELD_DOCTETS | FT_XFIELD_FIRST | FT_XFIELD_LAST | + FT_XFIELD_SRCADDR | FT_XFIELD_DSTADDR | + FT_XFIELD_SRCPORT | FT_XFIELD_DSTPORT | + FT_XFIELD_UNIX_SECS | FT_XFIELD_UNIX_NSECS | FT_XFIELD_SYSUPTIME | + FT_XFIELD_TOS | FT_XFIELD_TCP_FLAGS | FT_XFIELD_PROT)) { + fprintf(stderr,"Flow-tools record missing required fields."); + return NULL; + } + + InitExtensionMaps(NO_EXTENSION_LIST); + extension_info = (extension_info_t *)malloc(sizeof(extension_info_t)); + if ( !extension_info ) { + fprintf(stderr, "malloc() error in %s line %d: %s\n", __FILE__, __LINE__, strerror (errno)); + return NULL; + } + memset((void *)extension_info, 0, sizeof(extension_info_t)); + + extension_info->map = (extension_map_t *)malloc(sizeof(extension_map_t) + Max_num_extensions * sizeof(uint16_t)); + if ( !extension_info->map ) { + fprintf(stderr, "malloc() error in %s line %d: %s\n", __FILE__, __LINE__, strerror (errno)); + return NULL; + } + + i = 0; + extension_info->map->type = ExtensionMapType; + extension_info->map->map_id = 0; + + if ( !ftio_check_xfield(ftio, FT_XFIELD_INPUT | FT_XFIELD_OUTPUT )) { + extension_info->map->ex_id[i++] = EX_IO_SNMP_2; + } + + if (!ftio_check_xfield(ftio, FT_XFIELD_SRC_AS | FT_XFIELD_DST_AS)) { + extension_info->map->ex_id[i++] = EX_AS_2; + } + + if (!ftio_check_xfield(ftio, FT_XFIELD_SRC_MASK | FT_XFIELD_DST_MASK)) { + extension_info->map->ex_id[i++] = EX_MULIPLE; + } + + if (!ftio_check_xfield(ftio, FT_XFIELD_NEXTHOP )) { + extension_info->map->ex_id[i++] = EX_NEXT_HOP_v4; + } + + if (!ftio_check_xfield(ftio, FT_XFIELD_EXADDR )) { + extension_info->map->ex_id[i++] = EX_ROUTER_IP_v4; + } + + if (!ftio_check_xfield(ftio, FT_XFIELD_ENGINE_TYPE )) { + extension_info->map->ex_id[i++] = EX_ROUTER_ID; + } + + extension_info->map->ex_id[i++] = 0; + extension_info->map->size = sizeof(extension_map_t) + i * sizeof(uint16_t); + + // align 32bits + if (( extension_info->map->size & 0x3 ) != 0 ) { + extension_info->map->size += 4 - ( extension_info->map->size & 0x3 ); + } + + extension_info->map->extension_size = 0; + i=0; + while (extension_info->map->ex_id[i]) { + int id = extension_info->map->ex_id[i]; + extension_info->map->extension_size += extension_descriptor[id].size; + i++; + } + + return extension_info; + +} // End of GenExtensionMap + +int flows2nfdump(struct ftio *ftio, extension_info_t *extension_info, int extended, uint32_t limitflows) { +// required flow tools variables +struct fttime ftt; +struct fts3rec_offsets fo; +struct ftver ftv; +char *rec; +// nfdump variables +nffile_t *nffile; +master_record_t record; +char *s; +uint32_t cnt; + + s = "flow-tools"; + nffile = OpenNewFile( "-", NULL, 0, 0, s); + if ( !nffile ) { + fprintf(stderr, "%s\n", s); + return 1; + } + + AppendToBuffer(nffile, (void *)extension_info->map, extension_info->map->size); + + ftio_get_ver(ftio, &ftv); + fts3rec_compute_offsets(&fo, &ftv); + + memset((void *)&record, 0, sizeof(record)); + record.map_ref = extension_info->map; + record.type = CommonRecordType; + record.exporter_sysid = 0; + + // only v4 addresses + ClearFlag(record.flags, FLAG_IPV6_ADDR); + + cnt = 0; + while ((rec = ftio_read(ftio))) { + uint32_t when, unix_secs, unix_nsecs, sysUpTime; + int i, id; + + unix_secs = *((uint32_t*)(rec+fo.unix_secs)); + unix_nsecs = *((uint32_t*)(rec+fo.unix_nsecs)); + sysUpTime = *((uint32_t*)(rec+fo.sysUpTime)); + + when = *((uint32_t*)(rec+fo.First)); + ftt = ftltime(sysUpTime, unix_secs, unix_nsecs, when); + record.first = ftt.secs; + record.msec_first = ftt.msecs; + + when = *((uint32_t*)(rec+fo.Last)); + ftt = ftltime(sysUpTime, unix_secs, unix_nsecs, when); + record.last = ftt.secs; + record.msec_last = ftt.msecs; + + record.v4.srcaddr = *((uint32_t*)(rec+fo.srcaddr)); + record.v4.dstaddr = *((uint32_t*)(rec+fo.dstaddr)); + record.srcport = *((uint16_t*)(rec+fo.srcport)); + record.dstport = *((uint16_t*)(rec+fo.dstport)); + + record.prot = *((uint8_t*)(rec+fo.prot)); + record.tcp_flags = *((uint8_t*)(rec+fo.tcp_flags)); + record.tos = *((uint8_t*)(rec+fo.tos)); + + record.dOctets = *((uint32_t*)(rec+fo.dOctets)); + record.dPkts = *((uint32_t*)(rec+fo.dPkts)); + + i = 0; + while ( (id = extension_info->map->ex_id[i]) != 0 ) { + switch (id) { + case EX_IO_SNMP_2: + record.input = *((uint16_t*)(rec+fo.input)); + record.output = *((uint16_t*)(rec+fo.output)); + break; + case EX_AS_2: + record.srcas = *((uint16_t*)(rec+fo.src_as)); + record.dstas = *((uint16_t*)(rec+fo.dst_as)); + break; + case EX_MULIPLE: + record.src_mask = *((uint8_t*)(rec+fo.src_mask)); + record.dst_mask = *((uint8_t*)(rec+fo.dst_mask)); + record.dir = 0; + record.dst_tos = 0; + break; + case EX_ROUTER_IP_v4: + record.ip_nexthop.v4 = *((uint32_t*)(rec+fo.peer_nexthop)); + break; + case EX_NEXT_HOP_v4: + record.ip_router.v4 = *((uint32_t*)(rec+fo.router_sc)); + break; + case EX_ROUTER_ID: + record.engine_type = *((uint8_t*)(rec+fo.engine_type)); + record.engine_id = *((uint8_t*)(rec+fo.engine_id)); + break; + // default: Other extensions can not be sent with v5 + } + i++; + } + + PackRecord(&record, nffile); + + if ( extended ) { + char *string; + format_file_block_record(&record, &string, 0); + fprintf(stderr, "%s\n", string); + } + + cnt++; + if ( cnt == limitflows ) + break; + + } /* while */ + + // write the last records in buffer + if ( nffile->block_header->NumRecords ) { + if ( WriteBlock(nffile) <= 0 ) { + fprintf(stderr, "Failed to write output buffer: '%s'" , strerror(errno)); + } + } + + free((void *)extension_info->map); + free((void *)extension_info); + DisposeFile(nffile); + + return 0; + +} // End of flows2nfdump + +int main(int argc, char **argv) { +struct ftio ftio; +extension_info_t *extension_info; +struct stat statbuf; +uint32_t limitflows; +int i, extended, printmap, ret, fd; +char *ftfile; + + /* init fterr */ + fterr_setid(argv[0]); + + extended = 0; + printmap = 0; + limitflows = 0; + ftfile = NULL; + + while ((i = getopt(argc, argv, "EVc:hmr:?")) != -1) + switch (i) { + case 'h': /* help */ + case '?': + usage(argv[0]); + exit (0); + break; + + case 'V': + printf("%s: Version: %s\n",argv[0], nfdump_version); + exit(0); + break; + + case 'E': + extended = 1; + break; + + case 'c': + limitflows = atoi(optarg); + if ( !limitflows ) { + fprintf(stderr, "Option -c needs a number > 0\n"); + exit(255); + } + break; + + case 'm': + printmap = 1; + break; + + case 'r': + ftfile = optarg; + if ( (stat(ftfile, &statbuf) < 0 ) || !(statbuf.st_mode & S_IFREG) ) { + fprintf(stderr, "No such file: '%s'\n", ftfile); + exit(255); + } + break; + + default: + usage(argv[0]); + exit (1); + break; + + } /* switch */ + // End while + + if (argc - optind) + fterr_errx(1, "Extra arguments starting with %s.", argv[optind]); + + if ( ftfile ) { + fd = open(ftfile, O_RDONLY, 0); + if ( fd < 0 ) { + fprintf(stderr, "Can't open file '%s': %s.", ftfile, strerror(errno)); + exit(255); + } + } else { + fd = 0; + } + + /* read from fd */ + if (ftio_init(&ftio, fd, FT_IO_FLAG_READ) < 0) + fterr_errx(1, "ftio_init(): failed"); + + extension_info = GenExtensionMap(&ftio); + if ( !extension_info ) + exit(255); + + if ( printmap ) { + PrintExtensionMap(extension_info->map); + exit(255); + } + + ret = flows2nfdump(&ftio, extension_info, extended, limitflows); + + return ret; + +} // End of main + diff --git a/bin/fts_compat.c b/bin/fts_compat.c new file mode 100755 index 0000000..8474422 --- /dev/null +++ b/bin/fts_compat.c @@ -0,0 +1,1129 @@ +/* $Id: fts_compat.c 16 2009-06-19 09:26:19Z haag $ */ +/* TNFTPD ORIGINAL: libnetbsd/fts_open.c */ + +/* $TNFTPPD: fts_open.c,v 1.4 2003/12/17 01:42:45 lukem Exp $ */ +/* from NetBSD: __fts13.c,v 1.36 2001/11/28 22:31:39 christos Exp */ + +/*- + * Copyright (c) 1990, 1993, 1994 + * The Regents of the University of California. 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. + * 3. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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. + */ + +#include "config.h" + +#include +#include +#include +#include +#include +#include +#include +#include + +#ifdef HAVE_ISO_LIMITS_ISO_H +#include +#endif + +#if HAVE_DIRENT_H +# include +# define NAMLEN(dirent) strlen((dirent)->d_name) +#else +# define dirent direct +# define NAMLEN(dirent) (dirent)->d_namlen +# if HAVE_SYS_NDIR_H +# include +# endif +# if HAVE_SYS_DIR_H +# include +# endif +# if HAVE_NDIR_H +# include +# endif +#endif + +#include "fts_compat.h" + +#if ! defined(MIN) +# define MIN(a, b) ((a) < (b) ? (a) : (b)) +#endif +#if ! defined(MAX) +# define MAX(a, b) ((a) < (b) ? (b) : (a)) +#endif + +#define STAT stat + +static FTSENT *fts_alloc(FTS *, const char *, size_t); +static FTSENT *fts_build(FTS *, int); +static void fts_lfree(FTSENT *); +static void fts_load(FTS *, FTSENT *); +static size_t fts_maxarglen(char * const *); +static size_t fts_pow2(size_t); +static int fts_palloc(FTS *, size_t); +static void fts_padjust(FTS *, FTSENT *); +static FTSENT *fts_sort(FTS *, FTSENT *, size_t); +static u_short fts_stat(FTS *, FTSENT *, int); +static int fts_safe_changedir(const FTS *, const FTSENT *, int, + const char *); + +#define ISDOT(a) (a[0] == '.' && (!a[1] || (a[1] == '.' && !a[2]))) + +#define CLR(opt) (sp->fts_options &= ~(opt)) +#define ISSET(opt) (sp->fts_options & (opt)) +#define SET(opt) (sp->fts_options |= (opt)) + +#define CHDIR(sp, path) (!ISSET(FTS_NOCHDIR) && chdir(path)) +#define FCHDIR(sp, fd) (!ISSET(FTS_NOCHDIR) && fchdir(fd)) + +/* fts_build flags */ +#define BCHILD 1 /* fts_children */ +#define BNAMES 2 /* fts_children, names only */ +#define BREAD 3 /* fts_read */ + +#ifndef DTF_HIDEW +#undef FTS_WHITEOUT +#endif + +FTS * +fts_open_compat(char * const *argv, int options, + int (*compar)(const FTSENT **, const FTSENT **)) +{ + FTS *sp; + FTSENT *p, *root; + size_t nitems; + FTSENT *parent, *tmp = NULL; /* pacify gcc */ + size_t len; + + /* Options check. */ + if (options & ~FTS_OPTIONMASK) { + errno = EINVAL; + return (NULL); + } + + /* Allocate/initialize the stream */ + if ((sp = malloc((u_int)sizeof(FTS))) == NULL) + return (NULL); + memset(sp, 0, sizeof(FTS)); + sp->fts_compar = compar; + sp->fts_options = options; + + /* Logical walks turn on NOCHDIR; symbolic links are too hard. */ + if (ISSET(FTS_LOGICAL)) + SET(FTS_NOCHDIR); + + /* + * Start out with 1K of path space, and enough, in any case, + * to hold the user's paths. + */ + if (fts_palloc(sp, MAX(fts_maxarglen(argv), MAXPATHLEN))) + goto mem1; + + /* Allocate/initialize root's parent. */ + if ((parent = fts_alloc(sp, "", 0)) == NULL) + goto mem2; + parent->fts_level = FTS_ROOTPARENTLEVEL; + + /* Allocate/initialize root(s). */ + for (root = NULL, nitems = 0; *argv; ++argv, ++nitems) { + /* Don't allow zero-length paths. */ + if ((len = strlen(*argv)) == 0) { + errno = ENOENT; + goto mem3; + } + + if ((p = fts_alloc(sp, *argv, len)) == NULL) + goto mem3; + p->fts_level = FTS_ROOTLEVEL; + p->fts_parent = parent; + p->fts_accpath = p->fts_name; + p->fts_info = fts_stat(sp, p, ISSET(FTS_COMFOLLOW)); + + /* Command-line "." and ".." are real directories. */ + if (p->fts_info == FTS_DOT) + p->fts_info = FTS_D; + + /* + * If comparison routine supplied, traverse in sorted + * order; otherwise traverse in the order specified. + */ + if (compar) { + p->fts_link = root; + root = p; + } else { + p->fts_link = NULL; + if (root == NULL) + tmp = root = p; + else { + tmp->fts_link = p; + tmp = p; + } + } + } + if (compar && nitems > 1) + root = fts_sort(sp, root, nitems); + + /* + * Allocate a dummy pointer and make fts_read think that we've just + * finished the node before the root(s); set p->fts_info to FTS_INIT + * so that everything about the "current" node is ignored. + */ + if ((sp->fts_cur = fts_alloc(sp, "", 0)) == NULL) + goto mem3; + sp->fts_cur->fts_link = root; + sp->fts_cur->fts_info = FTS_INIT; + + /* + * If using chdir(2), grab a file descriptor pointing to dot to insure + * that we can get back here; this could be avoided for some paths, + * but almost certainly not worth the effort. Slashes, symbolic links, + * and ".." are all fairly nasty problems. Note, if we can't get the + * descriptor we run anyway, just more slowly. + */ + if (!ISSET(FTS_NOCHDIR) && (sp->fts_rfd = open(".", O_RDONLY, 0)) < 0) + SET(FTS_NOCHDIR); + + return (sp); + +mem3: fts_lfree(root); + free(parent); +mem2: free(sp->fts_path); +mem1: free(sp); + return (NULL); +} + +static void +fts_load(FTS *sp, FTSENT *p) +{ + size_t len; + char *cp; + + /* + * Load the stream structure for the next traversal. Since we don't + * actually enter the directory until after the preorder visit, set + * the fts_accpath field specially so the chdir gets done to the right + * place and the user can access the first node. From fts_open it's + * known that the path will fit. + */ + len = p->fts_pathlen = p->fts_namelen; + memmove(sp->fts_path, p->fts_name, len + 1); + if ((cp = strrchr(p->fts_name, '/')) && (cp != p->fts_name || cp[1])) { + len = strlen(++cp); + memmove(p->fts_name, cp, len + 1); + p->fts_namelen = len; + } + p->fts_accpath = p->fts_path = sp->fts_path; + sp->fts_dev = p->fts_dev; +} + +int +fts_close_compat(FTS *sp) +{ + FTSENT *freep, *p; + int saved_errno = 0; + + /* + * This still works if we haven't read anything -- the dummy structure + * points to the root list, so we step through to the end of the root + * list which has a valid parent pointer. + */ + if (sp->fts_cur) { + for (p = sp->fts_cur; p->fts_level >= FTS_ROOTLEVEL;) { + freep = p; + p = p->fts_link ? p->fts_link : p->fts_parent; + free(freep); + } + free(p); + } + + /* Free up child linked list, sort array, path buffer. */ + if (sp->fts_child) + fts_lfree(sp->fts_child); + if (sp->fts_array) + free(sp->fts_array); + free(sp->fts_path); + + /* Return to original directory, save errno if necessary. */ + if (!ISSET(FTS_NOCHDIR)) { + if (fchdir(sp->fts_rfd)) + saved_errno = errno; + (void)close(sp->fts_rfd); + } + + /* Free up the stream pointer. */ + free(sp); + /* ISSET() is illegal after this, since the macro touches sp */ + + /* Set errno and return. */ + if (saved_errno) { + errno = saved_errno; + return (-1); + } + return (0); +} + +/* + * Special case a root of "/" so that slashes aren't appended which would + * cause paths to be written as "//foo". + */ +#define NAPPEND(p) \ + (p->fts_level == FTS_ROOTLEVEL && p->fts_pathlen == 1 && \ + p->fts_path[0] == '/' ? 0 : p->fts_pathlen) + +FTSENT * +fts_read_compat(FTS *sp) +{ + FTSENT *p, *tmp; + int instr; + char *t; + int saved_errno; + + /* If finished or unrecoverable error, return NULL. */ + if (sp->fts_cur == NULL || ISSET(FTS_STOP)) + return (NULL); + + /* Set current node pointer. */ + p = sp->fts_cur; + + /* Save and zero out user instructions. */ + instr = p->fts_instr; + p->fts_instr = FTS_NOINSTR; + + /* Any type of file may be re-visited; re-stat and re-turn. */ + if (instr == FTS_AGAIN) { + p->fts_info = fts_stat(sp, p, 0); + return (p); + } + + /* + * Following a symlink -- SLNONE test allows application to see + * SLNONE and recover. If indirecting through a symlink, have + * keep a pointer to current location. If unable to get that + * pointer, follow fails. + */ + if (instr == FTS_FOLLOW && + (p->fts_info == FTS_SL || p->fts_info == FTS_SLNONE)) { + p->fts_info = fts_stat(sp, p, 1); + if (p->fts_info == FTS_D && !ISSET(FTS_NOCHDIR)) { + if ((p->fts_symfd = open(".", O_RDONLY, 0)) < 0) { + p->fts_errno = errno; + p->fts_info = FTS_ERR; + } else + p->fts_flags |= FTS_SYMFOLLOW; + } + return (p); + } + + /* Directory in pre-order. */ + if (p->fts_info == FTS_D) { + /* If skipped or crossed mount point, do post-order visit. */ + if (instr == FTS_SKIP || + (ISSET(FTS_XDEV) && p->fts_dev != sp->fts_dev)) { + if (p->fts_flags & FTS_SYMFOLLOW) + (void)close(p->fts_symfd); + if (sp->fts_child) { + fts_lfree(sp->fts_child); + sp->fts_child = NULL; + } + p->fts_info = FTS_DP; + return (p); + } + + /* Rebuild if only read the names and now traversing. */ + if (sp->fts_child && ISSET(FTS_NAMEONLY)) { + CLR(FTS_NAMEONLY); + fts_lfree(sp->fts_child); + sp->fts_child = NULL; + } + + /* + * Cd to the subdirectory. + * + * If have already read and now fail to chdir, whack the list + * to make the names come out right, and set the parent errno + * so the application will eventually get an error condition. + * Set the FTS_DONTCHDIR flag so that when we logically change + * directories back to the parent we don't do a chdir. + * + * If haven't read do so. If the read fails, fts_build sets + * FTS_STOP or the fts_info field of the node. + */ + if (sp->fts_child) { + if (fts_safe_changedir(sp, p, -1, p->fts_accpath)) { + p->fts_errno = errno; + p->fts_flags |= FTS_DONTCHDIR; + for (p = sp->fts_child; p; p = p->fts_link) + p->fts_accpath = + p->fts_parent->fts_accpath; + } + } else if ((sp->fts_child = fts_build(sp, BREAD)) == NULL) { + if (ISSET(FTS_STOP)) + return (NULL); + return (p); + } + p = sp->fts_child; + sp->fts_child = NULL; + goto name; + } + + /* Move to the next node on this level. */ +next: tmp = p; + if ((p = p->fts_link) != NULL) { + + free(tmp); + + /* + * If reached the top, return to the original directory, and + * load the paths for the next root. + */ + if (p->fts_level == FTS_ROOTLEVEL) { + if (FCHDIR(sp, sp->fts_rfd)) { + SET(FTS_STOP); + return (NULL); + } + fts_load(sp, p); + return (sp->fts_cur = p); + } + + /* + * User may have called fts_set on the node. If skipped, + * ignore. If followed, get a file descriptor so we can + * get back if necessary. + */ + if (p->fts_instr == FTS_SKIP) + goto next; + if (p->fts_instr == FTS_FOLLOW) { + p->fts_info = fts_stat(sp, p, 1); + if (p->fts_info == FTS_D && !ISSET(FTS_NOCHDIR)) { + if ((p->fts_symfd = + open(".", O_RDONLY, 0)) < 0) { + p->fts_errno = errno; + p->fts_info = FTS_ERR; + } else + p->fts_flags |= FTS_SYMFOLLOW; + } + p->fts_instr = FTS_NOINSTR; + } + +name: t = sp->fts_path + NAPPEND(p->fts_parent); + *t++ = '/'; + memmove(t, p->fts_name, (size_t)(p->fts_namelen + 1)); + return (sp->fts_cur = p); + } + + /* Move up to the parent node. */ + p = tmp->fts_parent; + free(tmp); + + if (p->fts_level == FTS_ROOTPARENTLEVEL) { + /* + * Done; free everything up and set errno to 0 so the user + * can distinguish between error and EOF. + */ + free(p); + errno = 0; + return (sp->fts_cur = NULL); + } + + /* Nul terminate the pathname. */ + sp->fts_path[p->fts_pathlen] = '\0'; + + /* + * Return to the parent directory. If at a root node or came through + * a symlink, go back through the file descriptor. Otherwise, cd up + * one directory. + */ + if (p->fts_level == FTS_ROOTLEVEL) { + if (FCHDIR(sp, sp->fts_rfd)) { + SET(FTS_STOP); + return (NULL); + } + } else if (p->fts_flags & FTS_SYMFOLLOW) { + if (FCHDIR(sp, p->fts_symfd)) { + saved_errno = errno; + (void)close(p->fts_symfd); + errno = saved_errno; + SET(FTS_STOP); + return (NULL); + } + (void)close(p->fts_symfd); + } else if (!(p->fts_flags & FTS_DONTCHDIR) && + fts_safe_changedir(sp, p->fts_parent, -1, "..")) { + SET(FTS_STOP); + return (NULL); + } + p->fts_info = p->fts_errno ? FTS_ERR : FTS_DP; + return (sp->fts_cur = p); +} + +/* + * Fts_set takes the stream as an argument although it's not used in this + * implementation; it would be necessary if anyone wanted to add global + * semantics to fts using fts_set. An error return is allowed for similar + * reasons. + */ +/* ARGSUSED */ +int +fts_set_compat(FTS *sp, FTSENT *p, int instr) +{ + + if (instr && instr != FTS_AGAIN && instr != FTS_FOLLOW && + instr != FTS_NOINSTR && instr != FTS_SKIP) { + errno = EINVAL; + return (1); + } + p->fts_instr = instr; + return (0); +} + +FTSENT * +fts_children_compat(FTS *sp, int instr) +{ + FTSENT *p; + int fd; + + if (instr && instr != FTS_NAMEONLY) { + errno = EINVAL; + return (NULL); + } + + /* Set current node pointer. */ + p = sp->fts_cur; + + /* + * Errno set to 0 so user can distinguish empty directory from + * an error. + */ + errno = 0; + + /* Fatal errors stop here. */ + if (ISSET(FTS_STOP)) + return (NULL); + + /* Return logical hierarchy of user's arguments. */ + if (p->fts_info == FTS_INIT) + return (p->fts_link); + + /* + * If not a directory being visited in pre-order, stop here. Could + * allow FTS_DNR, assuming the user has fixed the problem, but the + * same effect is available with FTS_AGAIN. + */ + if (p->fts_info != FTS_D /* && p->fts_info != FTS_DNR */) + return (NULL); + + /* Free up any previous child list. */ + if (sp->fts_child) + fts_lfree(sp->fts_child); + + if (instr == FTS_NAMEONLY) { + SET(FTS_NAMEONLY); + instr = BNAMES; + } else + instr = BCHILD; + + /* + * If using chdir on a relative path and called BEFORE fts_read does + * its chdir to the root of a traversal, we can lose -- we need to + * chdir into the subdirectory, and we don't know where the current + * directory is, so we can't get back so that the upcoming chdir by + * fts_read will work. + */ + if (p->fts_level != FTS_ROOTLEVEL || p->fts_accpath[0] == '/' || + ISSET(FTS_NOCHDIR)) + return (sp->fts_child = fts_build(sp, instr)); + + if ((fd = open(".", O_RDONLY, 0)) < 0) + return (sp->fts_child = NULL); + sp->fts_child = fts_build(sp, instr); + if (fchdir(fd)) { + (void)close(fd); + return (NULL); + } + (void)close(fd); + return (sp->fts_child); +} + +/* + * This is the tricky part -- do not casually change *anything* in here. The + * idea is to build the linked list of entries that are used by fts_children + * and fts_read. There are lots of special cases. + * + * The real slowdown in walking the tree is the stat calls. If FTS_NOSTAT is + * set and it's a physical walk (so that symbolic links can't be directories), + * we can do things quickly. First, if it's a 4.4BSD file system, the type + * of the file is in the directory entry. Otherwise, we assume that the number + * of subdirectories in a node is equal to the number of links to the parent. + * The former skips all stat calls. The latter skips stat calls in any leaf + * directories and for any files after the subdirectories in the directory have + * been found, cutting the stat calls by about 2/3. + */ +static FTSENT * +fts_build(FTS *sp, int type) +{ + struct dirent *dp; + FTSENT *p, *head; + size_t nitems; + FTSENT *cur, *tail; + DIR *dirp; + int adjust, cderrno, descend, len, level, nlinks, saved_errno, nostat; + size_t maxlen; +#ifdef FTS_WHITEOUT + int oflag; +#endif + char *cp = NULL; /* pacify gcc */ + + /* Set current node pointer. */ + cur = sp->fts_cur; + + /* + * Open the directory for reading. If this fails, we're done. + * If being called from fts_read, set the fts_info field. + */ +#ifdef FTS_WHITEOUT + if (ISSET(FTS_WHITEOUT)) + oflag = DTF_NODUP|DTF_REWIND; + else + oflag = DTF_HIDEW|DTF_NODUP|DTF_REWIND; +#else +#define __opendir2(path, flag) opendir(path) +#endif + if ((dirp = __opendir2(cur->fts_accpath, oflag)) == NULL) { + if (type == BREAD) { + cur->fts_info = FTS_DNR; + cur->fts_errno = errno; + } + return (NULL); + } + + /* + * Nlinks is the number of possible entries of type directory in the + * directory if we're cheating on stat calls, 0 if we're not doing + * any stat calls at all, -1 if we're doing stats on everything. + */ + if (type == BNAMES) { + nlinks = 0; + nostat = 1; + } else if (ISSET(FTS_NOSTAT) && ISSET(FTS_PHYSICAL)) { + nlinks = cur->fts_nlink - (ISSET(FTS_SEEDOT) ? 0 : 2); + nostat = 1; + } else { + nlinks = -1; + nostat = 0; + } + +#ifdef notdef + (void)printf("nlinks == %d (cur: %d)\n", nlinks, cur->fts_nlink); + (void)printf("NOSTAT %d PHYSICAL %d SEEDOT %d\n", + ISSET(FTS_NOSTAT), ISSET(FTS_PHYSICAL), ISSET(FTS_SEEDOT)); +#endif + /* + * If we're going to need to stat anything or we want to descend + * and stay in the directory, chdir. If this fails we keep going, + * but set a flag so we don't chdir after the post-order visit. + * We won't be able to stat anything, but we can still return the + * names themselves. Note, that since fts_read won't be able to + * chdir into the directory, it will have to return different path + * names than before, i.e. "a/b" instead of "b". Since the node + * has already been visited in pre-order, have to wait until the + * post-order visit to return the error. There is a special case + * here, if there was nothing to stat then it's not an error to + * not be able to stat. This is all fairly nasty. If a program + * needed sorted entries or stat information, they had better be + * checking FTS_NS on the returned nodes. + */ + cderrno = 0; + if (nlinks || type == BREAD) { + if (fts_safe_changedir(sp, cur, -1, cur->fts_accpath)) { + if (nlinks && type == BREAD) + cur->fts_errno = errno; + cur->fts_flags |= FTS_DONTCHDIR; + descend = 0; + cderrno = errno; + } else + descend = 1; + } else + descend = 0; + + /* + * Figure out the max file name length that can be stored in the + * current path -- the inner loop allocates more path as necessary. + * We really wouldn't have to do the maxlen calculations here, we + * could do them in fts_read before returning the path, but it's a + * lot easier here since the length is part of the dirent structure. + * + * If not changing directories set a pointer so that can just append + * each new name into the path. + */ + len = NAPPEND(cur); + if (ISSET(FTS_NOCHDIR)) { + cp = sp->fts_path + len; + *cp++ = '/'; + } + len++; + maxlen = sp->fts_pathlen - len; + + level = cur->fts_level + 1; + + /* Read the directory, attaching each entry to the `link' pointer. */ + adjust = 0; + for (head = tail = NULL, nitems = 0; (dp = readdir(dirp)) != NULL;) { + size_t dlen; + + if (!ISSET(FTS_SEEDOT) && ISDOT(dp->d_name)) + continue; + + dlen = NAMLEN(dp); +/* +#if !defined(DIRENT_MISSING_D_NAMLEN) + dlen = dp->d_namlen; +#else + dlen = strlen(dp->d_name); +#endif +*/ + if ((p = fts_alloc(sp, dp->d_name, dlen)) == NULL) + goto mem1; + if (dlen >= maxlen) { /* include space for NUL */ + if (fts_palloc(sp, len + dlen + 1)) { + /* + * No more memory for path or structures. Save + * errno, free up the current structure and the + * structures already allocated. + */ +mem1: saved_errno = errno; + if (p) + free(p); + fts_lfree(head); + (void)closedir(dirp); + errno = saved_errno; + cur->fts_info = FTS_ERR; + SET(FTS_STOP); + return (NULL); + } + adjust = 1; + if (ISSET(FTS_NOCHDIR)) + cp = sp->fts_path + len; + maxlen = sp->fts_pathlen - len; + } + + p->fts_pathlen = len + dlen; + p->fts_parent = sp->fts_cur; + p->fts_level = level; + +#ifdef FTS_WHITEOUT + if (dp->d_type == DT_WHT) + p->fts_flags |= FTS_ISW; +#endif + + if (cderrno) { + if (nlinks) { + p->fts_info = FTS_NS; + p->fts_errno = cderrno; + } else + p->fts_info = FTS_NSOK; + p->fts_accpath = cur->fts_accpath; + } else if (nlinks == 0 +#ifdef DT_DIR + || (nostat && + dp->d_type != DT_DIR && dp->d_type != DT_UNKNOWN) +#endif + ) { + p->fts_accpath = + ISSET(FTS_NOCHDIR) ? p->fts_path : p->fts_name; + p->fts_info = FTS_NSOK; + } else { + /* Build a file name for fts_stat to stat. */ + if (ISSET(FTS_NOCHDIR)) { + p->fts_accpath = p->fts_path; + memmove(cp, p->fts_name, + (size_t)(p->fts_namelen + 1)); + } else + p->fts_accpath = p->fts_name; + /* Stat it. */ + p->fts_info = fts_stat(sp, p, 0); + + /* Decrement link count if applicable. */ + if (nlinks > 0 && (p->fts_info == FTS_D || + p->fts_info == FTS_DC || p->fts_info == FTS_DOT)) + --nlinks; + } + + /* We walk in directory order so "ls -f" doesn't get upset. */ + p->fts_link = NULL; + if (head == NULL) + head = tail = p; + else { + tail->fts_link = p; + tail = p; + } + ++nitems; + } + (void)closedir(dirp); + + /* + * If had to realloc the path, adjust the addresses for the rest + * of the tree. + */ + if (adjust) + fts_padjust(sp, head); + + /* + * If not changing directories, reset the path back to original + * state. + */ + if (ISSET(FTS_NOCHDIR)) { + if (cp - 1 > sp->fts_path) + --cp; + *cp = '\0'; + } + + /* + * If descended after called from fts_children or after called from + * fts_read and nothing found, get back. At the root level we use + * the saved fd; if one of fts_open()'s arguments is a relative path + * to an empty directory, we wind up here with no other way back. If + * can't get back, we're done. + */ + if (descend && (type == BCHILD || !nitems) && + (cur->fts_level == FTS_ROOTLEVEL ? + FCHDIR(sp, sp->fts_rfd) : + fts_safe_changedir(sp, cur->fts_parent, -1, ".."))) { + cur->fts_info = FTS_ERR; + SET(FTS_STOP); + return (NULL); + } + + /* If didn't find anything, return NULL. */ + if (!nitems) { + if (type == BREAD) + cur->fts_info = FTS_DP; + return (NULL); + } + + /* Sort the entries. */ + if (sp->fts_compar && nitems > 1) + head = fts_sort(sp, head, nitems); + return (head); +} + +static u_short +fts_stat(FTS *sp, FTSENT *p, int follow) +{ + FTSENT *t; + dev_t dev; + ino_t ino; + struct STAT *sbp, sb; + int saved_errno; + + /* If user needs stat info, stat buffer already allocated. */ + sbp = ISSET(FTS_NOSTAT) ? &sb : p->fts_statp; + +#ifdef FTS_WHITEOUT + /* check for whiteout */ + if (p->fts_flags & FTS_ISW) { + if (sbp != &sb) { + memset(sbp, '\0', sizeof (*sbp)); + sbp->st_mode = S_IFWHT; + } + return (FTS_W); + } +#endif + + /* + * If doing a logical walk, or application requested FTS_FOLLOW, do + * a stat(2). If that fails, check for a non-existent symlink. If + * fail, set the errno from the stat call. + */ + if (ISSET(FTS_LOGICAL) || follow) { + if (stat(p->fts_accpath, sbp)) { + saved_errno = errno; + if (!lstat(p->fts_accpath, sbp)) { + errno = 0; + return (FTS_SLNONE); + } + p->fts_errno = saved_errno; + goto err; + } + } else if (lstat(p->fts_accpath, sbp)) { + p->fts_errno = errno; +err: memset(sbp, 0, sizeof(struct STAT)); + return (FTS_NS); + } + + if (S_ISDIR(sbp->st_mode)) { + /* + * Set the device/inode. Used to find cycles and check for + * crossing mount points. Also remember the link count, used + * in fts_build to limit the number of stat calls. It is + * understood that these fields are only referenced if fts_info + * is set to FTS_D. + */ + dev = p->fts_dev = sbp->st_dev; + ino = p->fts_ino = sbp->st_ino; + p->fts_nlink = sbp->st_nlink; + + if (ISDOT(p->fts_name)) + return (FTS_DOT); + + /* + * Cycle detection is done by brute force when the directory + * is first encountered. If the tree gets deep enough or the + * number of symbolic links to directories is high enough, + * something faster might be worthwhile. + */ + for (t = p->fts_parent; + t->fts_level >= FTS_ROOTLEVEL; t = t->fts_parent) + if (ino == t->fts_ino && dev == t->fts_dev) { + p->fts_cycle = t; + return (FTS_DC); + } + return (FTS_D); + } + if (S_ISLNK(sbp->st_mode)) + return (FTS_SL); + if (S_ISREG(sbp->st_mode)) + return (FTS_F); + return (FTS_DEFAULT); +} + +static FTSENT * +fts_sort(FTS *sp, FTSENT *head, size_t nitems) +{ + FTSENT **ap, *p; + + /* + * Construct an array of pointers to the structures and call qsort(3). + * Reassemble the array in the order returned by qsort. If unable to + * sort for memory reasons, return the directory entries in their + * current order. Allocate enough space for the current needs plus + * 40 so don't realloc one entry at a time. + */ + if (nitems > sp->fts_nitems) { + FTSENT **new; + + new = realloc(sp->fts_array, sizeof(FTSENT *) * (nitems + 40)); + if (new == 0) + return (head); + sp->fts_array = new; + sp->fts_nitems = nitems + 40; + } + for (ap = sp->fts_array, p = head; p; p = p->fts_link) + *ap++ = p; + qsort((void *)sp->fts_array, nitems, sizeof(FTSENT *), + (int (*)(const void *, const void *))sp->fts_compar); + for (head = *(ap = sp->fts_array); --nitems; ++ap) + ap[0]->fts_link = ap[1]; + ap[0]->fts_link = NULL; + return (head); +} + +static FTSENT * +fts_alloc(FTS *sp, const char *name, size_t namelen) +{ + FTSENT *p; + +#ifndef ALIGNBYTES +#define ALIGNBYTES (sizeof(int) - 1) +#endif + +#ifndef ALIGN +#define ALIGN(p) (((u_int)(p) + ALIGNBYTES) &~ ALIGNBYTES) +#endif + + size_t len; + /* + * The file name is a variable length array and no stat structure is + * necessary if the user has set the nostat bit. Allocate the FTSENT + * structure, the file name and the stat structure in one chunk, but + * be careful that the stat structure is reasonably aligned. Since the + * fts_name field is declared to be of size 1, the fts_name pointer is + * namelen + 2 before the first possible address of the stat structure. + */ + len = sizeof(FTSENT) + namelen; + if (!ISSET(FTS_NOSTAT)) + len += sizeof(struct STAT) + ALIGNBYTES; + if ((p = malloc(len)) == NULL) + return (NULL); + + if (!ISSET(FTS_NOSTAT)) + p->fts_statp = + (struct STAT *)ALIGN((u_long)(p->fts_name + namelen + 2)); + + /* Copy the name plus the trailing NULL. */ + memmove(p->fts_name, name, namelen + 1); + + p->fts_namelen = namelen; + p->fts_path = sp->fts_path; + p->fts_errno = 0; + p->fts_flags = 0; + p->fts_instr = FTS_NOINSTR; + p->fts_number = 0; + p->fts_pointer = NULL; + return (p); +} + +static void +fts_lfree(FTSENT *head) +{ + FTSENT *p; + + /* XXX: head may be NULL ? */ + + /* Free a linked list of structures. */ + while ((p = head) != NULL) { + head = head->fts_link; + + free(p); + } +} + +static size_t +fts_pow2(size_t x) +{ + + x--; + x |= x>>1; + x |= x>>2; + x |= x>>4; + x |= x>>8; + x |= x>>16; +#if LONG_BIT > 32 + x |= x>>32; +#endif +#if LONG_BIT > 64 + x |= x>>64; +#endif + x++; + return (x); +} + +/* + * Allow essentially unlimited paths; find, rm, ls should all work on any tree. + * Most systems will allow creation of paths much longer than MAXPATHLEN, even + * though the kernel won't resolve them. Round up the new size to a power of 2, + * so we don't realloc the path 2 bytes at a time. + */ +static int +fts_palloc(FTS *sp, size_t size) +{ + char *new; + +#if 1 + /* Protect against fts_pathlen overflow. */ + if (size > USHRT_MAX + 1) { + errno = ENOMEM; + return (1); + } +#endif + size = fts_pow2(size); + new = realloc(sp->fts_path, size); + if (new == 0) + return (1); + sp->fts_path = new; + sp->fts_pathlen = size; + return (0); +} + +/* + * When the path is realloc'd, have to fix all of the pointers in structures + * already returned. + */ +static void +fts_padjust(FTS *sp, FTSENT *head) +{ + FTSENT *p; + char *addr; + +#define ADJUST(p) do { \ + if ((p)->fts_accpath != (p)->fts_name) \ + (p)->fts_accpath = \ + addr + ((p)->fts_accpath - (p)->fts_path); \ + (p)->fts_path = addr; \ +} while (/*CONSTCOND*/0) + + addr = sp->fts_path; + + /* Adjust the current set of children. */ + for (p = sp->fts_child; p; p = p->fts_link) + ADJUST(p); + + /* Adjust the rest of the tree, including the current level. */ + for (p = head; p->fts_level >= FTS_ROOTLEVEL;) { + ADJUST(p); + p = p->fts_link ? p->fts_link : p->fts_parent; + } +} + +static size_t +fts_maxarglen(argv) + char * const *argv; +{ + size_t len, max; + + for (max = 0; *argv; ++argv) + if ((len = strlen(*argv)) > max) + max = len; + return (max + 1); +} + +/* + * Change to dir specified by fd or p->fts_accpath without getting + * tricked by someone changing the world out from underneath us. + * Assumes p->fts_dev and p->fts_ino are filled in. + */ +static int +fts_safe_changedir(sp, p, fd, path) + const FTS *sp; + const FTSENT *p; + int fd; + const char *path; +{ + int oldfd = fd, ret = -1; + struct STAT sb; + + if (ISSET(FTS_NOCHDIR)) + return 0; + + if (fd < 0 && (fd = open(path, O_RDONLY)) == -1) + return -1; + + if (fstat(fd, &sb) == -1) + goto bail; + + if (sb.st_ino != p->fts_ino || sb.st_dev != p->fts_dev) { + errno = ENOENT; + goto bail; + } + + ret = fchdir(fd); + +bail: + if (oldfd < 0) { + int save_errno = errno; + (void)close(fd); + errno = save_errno; + } + return ret; +} diff --git a/bin/fts_compat.h b/bin/fts_compat.h new file mode 100755 index 0000000..1c3f1ad --- /dev/null +++ b/bin/fts_compat.h @@ -0,0 +1,126 @@ +/* $Id: fts_compat.h 16 2009-06-19 09:26:19Z haag $ */ +/* TNFTPD ORIGINAL: libnetbsd/ftpfts.h */ + +/* $NetBSD: ftpfts.h,v 1.3 2003/12/15 23:52:02 lukem Exp $ */ + +/* + * Copyright (c) 1989, 1993 + * The Regents of the University of California. 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. + * 3. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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. + * + * @(#)fts.h 8.3 (Berkeley) 8/14/94 + */ + +#ifndef _FTS_H_ +#define _FTS_H_ 1 + +typedef struct { + struct _ftsent *fts_cur; /* current node */ + struct _ftsent *fts_child; /* linked list of children */ + struct _ftsent **fts_array; /* sort array */ + dev_t fts_dev; /* starting device # */ + char *fts_path; /* path for this descent */ + int fts_rfd; /* fd for root */ + u_int fts_pathlen; /* sizeof(path) */ + u_int fts_nitems; /* elements in the sort array */ + int (*fts_compar) /* compare function */ + (const struct _ftsent **, const struct _ftsent **); + +#define FTS_COMFOLLOW 0x001 /* follow command line symlinks */ +#define FTS_LOGICAL 0x002 /* logical walk */ +#define FTS_NOCHDIR 0x004 /* don't change directories */ +#define FTS_NOSTAT 0x008 /* don't get stat info */ +#define FTS_PHYSICAL 0x010 /* physical walk */ +#define FTS_SEEDOT 0x020 /* return dot and dot-dot */ +#define FTS_XDEV 0x040 /* don't cross devices */ +#define FTS_WHITEOUT 0x080 /* return whiteout information */ +#define FTS_OPTIONMASK 0x0ff /* valid user option mask */ + +#define FTS_NAMEONLY 0x100 /* (private) child names only */ +#define FTS_STOP 0x200 /* (private) unrecoverable error */ + int fts_options; /* fts_open options, global flags */ +} FTS; + +typedef struct _ftsent { + struct _ftsent *fts_cycle; /* cycle node */ + struct _ftsent *fts_parent; /* parent directory */ + struct _ftsent *fts_link; /* next file in directory */ + long fts_number; /* local numeric value */ + void *fts_pointer; /* local address value */ + char *fts_accpath; /* access path */ + char *fts_path; /* root path */ + int fts_errno; /* errno for this node */ + int fts_symfd; /* fd for symlink */ + u_short fts_pathlen; /* strlen(fts_path) */ + u_short fts_namelen; /* strlen(fts_name) */ + + ino_t fts_ino; /* inode */ + dev_t fts_dev; /* device */ + nlink_t fts_nlink; /* link count */ + +#define FTS_ROOTPARENTLEVEL -1 +#define FTS_ROOTLEVEL 0 + short fts_level; /* depth (-1 to N) */ + +#define FTS_D 1 /* preorder directory */ +#define FTS_DC 2 /* directory that causes cycles */ +#define FTS_DEFAULT 3 /* none of the above */ +#define FTS_DNR 4 /* unreadable directory */ +#define FTS_DOT 5 /* dot or dot-dot */ +#define FTS_DP 6 /* postorder directory */ +#define FTS_ERR 7 /* error; errno is set */ +#define FTS_F 8 /* regular file */ +#define FTS_INIT 9 /* initialized only */ +#define FTS_NS 10 /* stat(2) failed */ +#define FTS_NSOK 11 /* no stat(2) requested */ +#define FTS_SL 12 /* symbolic link */ +#define FTS_SLNONE 13 /* symbolic link without target */ +#define FTS_W 14 /* whiteout object */ + u_short fts_info; /* user flags for FTSENT structure */ + +#define FTS_DONTCHDIR 0x01 /* don't chdir .. to the parent */ +#define FTS_SYMFOLLOW 0x02 /* followed a symlink to get here */ +#define FTS_ISW 0x04 /* this is a whiteout object */ + u_short fts_flags; /* private flags for FTSENT structure */ + +#define FTS_AGAIN 1 /* read node again */ +#define FTS_FOLLOW 2 /* follow symbolic link */ +#define FTS_NOINSTR 3 /* no instructions */ +#define FTS_SKIP 4 /* discard node */ + u_short fts_instr; /* fts_set() instructions */ + + struct stat *fts_statp; /* stat(2) information */ + char fts_name[1]; /* file name */ +} FTSENT; + +FTSENT *fts_children_compat(FTS *, int); +int fts_close_compat(FTS *); +FTS *fts_open_compat(char * const *, int, + int (*)(const FTSENT **, const FTSENT **)); +FTSENT *fts_read_compat(FTS *); +int fts_set_compat(FTS *, FTSENT *, int); + +#endif /* !_FTS_H_ */ diff --git a/bin/grammar.y b/bin/grammar.y new file mode 100755 index 0000000..154d1d8 --- /dev/null +++ b/bin/grammar.y @@ -0,0 +1,2204 @@ +/* + * This file is part of the nfdump project. + * + * Copyright (c) 2004-2008, SWITCH - Teleinformatikdienste fuer Lehre und Forschung + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of SWITCH nor the names of its contributors may be + * used to endorse or promote products derived from this software without + * specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 COPYRIGHT OWNER 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. + * + * $Author: peter $ + * + * $Id: grammar.y 100 2008-08-15 11:36:21Z peter $ + * + * $LastChangedRevision: 100 $ + * + * + * + */ + +%{ + +#include "config.h" + +#include +#include +#include +#include +#include +#include +#include +#include + +#ifdef HAVE_STDINT_H +#include +#endif + +#include "nf_common.h" +#include "rbtree.h" +#include "nfdump.h" +#include "nffile.h" +#include "nftree.h" +#include "ipconv.h" +#include "util.h" + +/* + * function prototypes + */ +static void yyerror(char *msg); + +static uint32_t ChainHosts(uint64_t *offsets, uint64_t *hostlist, int num_records, int type); + +static uint64_t VerifyMac(char *s); + +enum { DIR_UNSPEC = 1, + SOURCE, DESTINATION, SOURCE_AND_DESTINATION, SOURCE_OR_DESTINATION, + DIR_IN, DIR_OUT, + IN_SRC, IN_DST, OUT_SRC, OUT_DST, + ADJ_PREV, ADJ_NEXT }; + +enum { IS_START = 0, IS_END }; + +/* var defs */ +extern int lineno; +extern char *yytext; +extern uint64_t *IPstack; +extern uint32_t StartNode; +extern uint16_t Extended; +extern int (*FilterEngine)(uint32_t *); +extern char *FilterFilename; + +static uint32_t num_ip; + +char yyerror_buff[256]; + +#define MPLSMAX 0x00ffffff +%} + +%union { + uint64_t value; + char *s; + FilterParam_t param; + void *list; +} + +%token ANY IP IF MAC MPLS TOS DIR FLAGS PROTO MASK HOSTNAME NET PORT FWDSTAT IN OUT SRC DST EQ LT GT PREV NEXT +%token NUMBER STRING IDENT PORTNUM ICMP_TYPE ICMP_CODE ENGINE_TYPE ENGINE_ID AS PACKETS BYTES FLOWS +%token PPS BPS BPP DURATION NOT +%token IPV4 IPV6 BGPNEXTHOP ROUTER VLAN +%token CLIENT SERVER APP LATENCY SYSID +%token ASA REASON DENIED XEVENT XIP XNET XPORT INGRESS EGRESS ACL ACE XACE +%token NAT ADD EVENT VRF NPORT NIP +%token PBLOCK START END STEP SIZE +%type expr NUMBER PORTNUM ICMP_TYPE ICMP_CODE +%type STRING REASON +%type dqual term comp acl inout +%type iplist ullist + +%left '+' OR +%left '*' AND +%left NEGATE + +%% +prog: /* empty */ + | expr { + StartNode = $1; + } + ; + +term: ANY { /* this is an unconditionally true expression, as a filter applies in any case */ + $$.self = NewBlock(OffsetProto, 0, 0, CMP_EQ, FUNC_NONE, NULL ); + } + + | IDENT STRING { + if ( !ScreenIdentString($2) ) { + yyerror("Illegal ident string"); + YYABORT; + } + + uint32_t index = AddIdent($2); + $$.self = NewBlock(0, 0, index, CMP_IDENT, FUNC_NONE, NULL ); + } + + | IPV4 { + $$.self = NewBlock(OffsetRecordFlags, (1LL << ShiftRecordFlags) & MaskRecordFlags, + (0LL << ShiftRecordFlags) & MaskRecordFlags, CMP_EQ, FUNC_NONE, NULL); + } + + | IPV6 { + $$.self = NewBlock(OffsetRecordFlags, (1LL << ShiftRecordFlags) & MaskRecordFlags, + (1LL << ShiftRecordFlags) & MaskRecordFlags, CMP_EQ, FUNC_NONE, NULL); + } + + | PROTO NUMBER { + int64_t proto; + proto = $2; + + if ( proto > 255 ) { + yyerror("Protocol number > 255"); + YYABORT; + } + if ( proto < 0 ) { + yyerror("Unknown protocol"); + YYABORT; + } + $$.self = NewBlock(OffsetProto, MaskProto, (proto << ShiftProto) & MaskProto, CMP_EQ, FUNC_NONE, NULL); + + } + + | PROTO STRING { + int64_t proto; + proto = Proto_num($2); + + if ( proto > 255 ) { + yyerror("Protocol number > 255"); + YYABORT; + } + if ( proto < 0 ) { + yyerror("Unknown protocol"); + YYABORT; + } + $$.self = NewBlock(OffsetProto, MaskProto, (proto << ShiftProto) & MaskProto, CMP_EQ, FUNC_NONE, NULL); + } + + | dqual PACKETS comp NUMBER { + + switch ( $1.direction ) { + case DIR_UNSPEC: + case DIR_IN: + $$.self = NewBlock(OffsetPackets, MaskPackets, $4, $3.comp, FUNC_NONE, NULL); + break; + case DIR_OUT: + $$.self = NewBlock(OffsetOutPackets, MaskPackets, $4, $3.comp, FUNC_NONE, NULL); + break; + default: + /* should never happen */ + yyerror("This token is not expected here!"); + YYABORT; + } // End of switch + + } + + | dqual BYTES comp NUMBER { + + switch ( $1.direction ) { + case DIR_UNSPEC: + case DIR_IN: + $$.self = NewBlock(OffsetBytes, MaskBytes, $4, $3.comp, FUNC_NONE, NULL); + break; + case DIR_OUT: + $$.self = NewBlock(OffsetOutBytes, MaskBytes, $4, $3.comp, FUNC_NONE, NULL); + break; + default: + yyerror("This token is not expected here!"); + YYABORT; + } // End of switch + + } + + | FLOWS comp NUMBER { + $$.self = NewBlock(OffsetAggrFlows, MaskFlows, $3, $2.comp, FUNC_NONE, NULL); + } + + | PPS comp NUMBER { + $$.self = NewBlock(0, AnyMask, $3, $2.comp, FUNC_PPS, NULL); + } + + | BPS comp NUMBER { + $$.self = NewBlock(0, AnyMask, $3, $2.comp, FUNC_BPS, NULL); + } + + | BPP comp NUMBER { + $$.self = NewBlock(0, AnyMask, $3, $2.comp, FUNC_BPP, NULL); + } + + | DURATION comp NUMBER { + $$.self = NewBlock(0, AnyMask, $3, $2.comp, FUNC_DURATION, NULL); + } + + | dqual TOS comp NUMBER { + if ( $4 > 255 ) { + yyerror("TOS must be 0..255"); + YYABORT; + } + + switch ( $1.direction ) { + case DIR_UNSPEC: + case SOURCE: + $$.self = NewBlock(OffsetTos, MaskTos, ($4 << ShiftTos) & MaskTos, $3.comp, FUNC_NONE, NULL); + break; + case DESTINATION: + $$.self = NewBlock(OffsetDstTos, MaskDstTos, ($4 << ShiftDstTos) & MaskDstTos, $3.comp, FUNC_NONE, NULL); + break; + case SOURCE_OR_DESTINATION: + $$.self = Connect_OR( + NewBlock(OffsetTos, MaskTos, ($4 << ShiftTos) & MaskTos, $3.comp, FUNC_NONE, NULL), + NewBlock(OffsetDstTos, MaskDstTos, ($4 << ShiftDstTos) & MaskDstTos, $3.comp, FUNC_NONE, NULL) + ); + break; + case SOURCE_AND_DESTINATION: + $$.self = Connect_AND( + NewBlock(OffsetTos, MaskTos, ($4 << ShiftTos) & MaskTos, $3.comp, FUNC_NONE, NULL), + NewBlock(OffsetDstTos, MaskDstTos, ($4 << ShiftDstTos) & MaskDstTos, $3.comp, FUNC_NONE, NULL) + ); + break; + default: + yyerror("This token is not expected here!"); + YYABORT; + } + } + + | FLAGS comp NUMBER { + if ( $3 > 63 ) { + yyerror("Flags must be 0..63"); + YYABORT; + } + $$.self = NewBlock(OffsetFlags, MaskFlags, ($3 << ShiftFlags) & MaskFlags, $2.comp, FUNC_NONE, NULL); + } + + | FLAGS STRING { + uint64_t fl = 0; + int cnt = 0; + size_t len = strlen($2); + + if ( len > 7 ) { + yyerror("Too many flags"); + YYABORT; + } + + if ( strchr($2, 'F') ) { fl |= 1; cnt++; } + if ( strchr($2, 'S') ) { fl |= 2; cnt++; } + if ( strchr($2, 'R') ) { fl |= 4; cnt++; } + if ( strchr($2, 'P') ) { fl |= 8; cnt++; } + if ( strchr($2, 'A') ) { fl |= 16; cnt++; } + if ( strchr($2, 'U') ) { fl |= 32; cnt++; } + if ( strchr($2, 'X') ) { fl = 63; cnt++; } + + if ( cnt != len ) { + yyerror("Too many flags"); + YYABORT; + } + + $$.self = NewBlock(OffsetFlags, (fl << ShiftFlags) & MaskFlags, + (fl << ShiftFlags) & MaskFlags, CMP_FLAGS, FUNC_NONE, NULL); + } + + | dqual IP STRING { + int af, bytes, ret; + + ret = parse_ip(&af, $3, IPstack, &bytes, ALLOW_LOOKUP, &num_ip); + + if ( ret == 0 ) { + yyerror("Error parsing IP address."); + YYABORT; + } + + // ret == -1 will never happen here, as ALLOW_LOOKUP is set + if ( ret == -2 ) { + // could not resolv host => 'not any' + $$.self = Invert(NewBlock(OffsetProto, 0, 0, CMP_EQ, FUNC_NONE, NULL )); + } else { + uint64_t offsets[4] = {OffsetSrcIPv6a, OffsetSrcIPv6b, OffsetDstIPv6a, OffsetDstIPv6b }; + if ( af && (( af == PF_INET && bytes != 4 ) || ( af == PF_INET6 && bytes != 16 ))) { + yyerror("incomplete IP address"); + YYABORT; + } + + switch ( $1.direction ) { + case SOURCE: + case DESTINATION: + $$.self = ChainHosts(offsets, IPstack, num_ip, $1.direction); + break; + case DIR_UNSPEC: + case SOURCE_OR_DESTINATION: { + uint32_t src = ChainHosts(offsets, IPstack, num_ip, SOURCE); + uint32_t dst = ChainHosts(offsets, IPstack, num_ip, DESTINATION); + $$.self = Connect_OR(src, dst); + } break; + case SOURCE_AND_DESTINATION: { + uint32_t src = ChainHosts(offsets, IPstack, num_ip, SOURCE); + uint32_t dst = ChainHosts(offsets, IPstack, num_ip, DESTINATION); + $$.self = Connect_AND(src, dst); + } break; + default: + yyerror("This token is not expected here!"); + YYABORT; + + } // End of switch + + } + } + + | dqual IP IN '[' iplist ']' { + + switch ( $1.direction ) { + case SOURCE: + $$.self = NewBlock(OffsetSrcIPv6a, MaskIPv6, 0 , CMP_IPLIST, FUNC_NONE, (void *)$5 ); + break; + case DESTINATION: + $$.self = NewBlock(OffsetDstIPv6a, MaskIPv6, 0 , CMP_IPLIST, FUNC_NONE, (void *)$5 ); + break; + case DIR_UNSPEC: + case SOURCE_OR_DESTINATION: + $$.self = Connect_OR( + NewBlock(OffsetSrcIPv6a, MaskIPv6, 0 , CMP_IPLIST, FUNC_NONE, (void *)$5 ), + NewBlock(OffsetDstIPv6a, MaskIPv6, 0 , CMP_IPLIST, FUNC_NONE, (void *)$5 ) + ); + break; + case SOURCE_AND_DESTINATION: + $$.self = Connect_AND( + NewBlock(OffsetSrcIPv6a, MaskIPv6, 0 , CMP_IPLIST, FUNC_NONE, (void *)$5 ), + NewBlock(OffsetDstIPv6a, MaskIPv6, 0 , CMP_IPLIST, FUNC_NONE, (void *)$5 ) + ); + break; + default: + yyerror("This token is not expected here!"); + YYABORT; + } + } + + | NEXT IP STRING { + int af, bytes, ret; + + ret = parse_ip(&af, $3, IPstack, &bytes, STRICT_IP, &num_ip); + + if ( ret == 0 ) { + yyerror("Error parsing IP address."); + YYABORT; + } + + if ( ret == -1 ) { + yyerror("IP address required - hostname not allowed here."); + YYABORT; + } + // ret == -2 will never happen here, as STRICT_IP is set + + if ( af && (( af == PF_INET && bytes != 4 ) || ( af == PF_INET6 && bytes != 16 ))) { + yyerror("incomplete IP address"); + YYABORT; + } + + $$.self = Connect_AND( + NewBlock(OffsetNexthopv6b, MaskIPv6, IPstack[1] , CMP_EQ, FUNC_NONE, NULL ), + NewBlock(OffsetNexthopv6a, MaskIPv6, IPstack[0] , CMP_EQ, FUNC_NONE, NULL ) + ); + } + + | NEXT IP IN '[' iplist ']' { + + $$.self = NewBlock(OffsetNexthopv6a, MaskIPv6, 0 , CMP_IPLIST, FUNC_NONE, (void *)$5 ); + + } + + | BGPNEXTHOP IP STRING { + int af, bytes, ret; + + ret = parse_ip(&af, $3, IPstack, &bytes, STRICT_IP, &num_ip); + + if ( ret == 0 ) { + yyerror("Error parsing IP address."); + YYABORT; + } + + if ( ret == -1 ) { + yyerror("IP address required - hostname not allowed here."); + YYABORT; + } + // ret == -2 will never happen here, as STRICT_IP is set + + if ( af && (( af == PF_INET && bytes != 4 ) || ( af == PF_INET6 && bytes != 16 ))) { + yyerror("incomplete IP address"); + YYABORT; + } + + $$.self = Connect_AND( + NewBlock(OffsetBGPNexthopv6b, MaskIPv6, IPstack[1] , CMP_EQ, FUNC_NONE, NULL ), + NewBlock(OffsetBGPNexthopv6a, MaskIPv6, IPstack[0] , CMP_EQ, FUNC_NONE, NULL ) + ); + } + + | ROUTER IP STRING { + int af, bytes, ret; + + ret = parse_ip(&af, $3, IPstack, &bytes, STRICT_IP, &num_ip); + + if ( ret == 0 ) { + yyerror("Error parsing IP address."); + YYABORT; + } + + if ( ret == -1 ) { + yyerror("IP address required - hostname not allowed here."); + YYABORT; + } + // ret == -2 will never happen here, as STRICT_IP is set + + if ( af && (( af == PF_INET && bytes != 4 ) || ( af == PF_INET6 && bytes != 16 ))) { + yyerror("incomplete IP address"); + YYABORT; + } + + $$.self = Connect_AND( + NewBlock(OffsetRouterv6b, MaskIPv6, IPstack[1] , CMP_EQ, FUNC_NONE, NULL ), + NewBlock(OffsetRouterv6a, MaskIPv6, IPstack[0] , CMP_EQ, FUNC_NONE, NULL ) + ); + } + + | CLIENT LATENCY comp NUMBER { + $$.self = NewBlock(OffsetClientLatency, MaskLatency, $4, $3.comp, FUNC_NONE, NULL); + } + + | SERVER LATENCY comp NUMBER { + $$.self = NewBlock(OffsetServerLatency, MaskLatency, $4, $3.comp, FUNC_NONE, NULL); + } + + | APP LATENCY comp NUMBER { + $$.self = NewBlock(OffsetAppLatency, MaskLatency, $4, $3.comp, FUNC_NONE, NULL); + } + + | SYSID NUMBER { + if ( $2 > 255 ) { + yyerror("Router SysID expected between be 1..255"); + YYABORT; + } + $$.self = NewBlock(OffsetExporterSysID, MaskExporterSysID, ($2 << ShiftExporterSysID) & MaskExporterSysID, CMP_EQ, FUNC_NONE, NULL); + } + + | dqual PORT comp NUMBER { + if ( $4 > 65535 ) { + yyerror("Port outside of range 0..65535"); + YYABORT; + } + + switch ( $1.direction ) { + case SOURCE: + $$.self = NewBlock(OffsetPort, MaskSrcPort, ($4 << ShiftSrcPort) & MaskSrcPort, $3.comp, FUNC_NONE, NULL ); + break; + case DESTINATION: + $$.self = NewBlock(OffsetPort, MaskDstPort, ($4 << ShiftDstPort) & MaskDstPort, $3.comp, FUNC_NONE, NULL ); + break; + case DIR_UNSPEC: + case SOURCE_OR_DESTINATION: + $$.self = Connect_OR( + NewBlock(OffsetPort, MaskSrcPort, ($4 << ShiftSrcPort) & MaskSrcPort, $3.comp, FUNC_NONE, NULL ), + NewBlock(OffsetPort, MaskDstPort, ($4 << ShiftDstPort) & MaskDstPort, $3.comp, FUNC_NONE, NULL ) + ); + break; + case SOURCE_AND_DESTINATION: + $$.self = Connect_AND( + NewBlock(OffsetPort, MaskSrcPort, ($4 << ShiftSrcPort) & MaskSrcPort, $3.comp, FUNC_NONE, NULL ), + NewBlock(OffsetPort, MaskDstPort, ($4 << ShiftDstPort) & MaskDstPort, $3.comp, FUNC_NONE, NULL ) + ); + break; + default: + yyerror("This token is not expected here!"); + YYABORT; + } // End switch + + } + + | dqual PORT IN PBLOCK { +#ifdef NSEL + switch ( $1.direction ) { + case SOURCE: + $$.self = NewBlock(OffsetPort, MaskSrcPort, ShiftSrcPort, CMP_EQ, FUNC_PBLOCK, NULL ); + break; + case DESTINATION: + $$.self = NewBlock(OffsetPort, MaskDstPort, ShiftDstPort, CMP_EQ, FUNC_PBLOCK, NULL ); + break; + case DIR_UNSPEC: + case SOURCE_OR_DESTINATION: + $$.self = Connect_OR( + NewBlock(OffsetPort, MaskSrcPort, ShiftSrcPort, CMP_EQ, FUNC_PBLOCK, NULL ), + NewBlock(OffsetPort, MaskDstPort, ShiftDstPort, CMP_EQ, FUNC_PBLOCK, NULL ) + ); + break; + default: + yyerror("This token is not expected here!"); + YYABORT; + } // End switch + +#else + yyerror("NAT filters not available"); + YYABORT; +#endif + } + + | dqual PORT IN '[' ullist ']' { + struct ULongListNode *node; + ULongtree_t *root = NULL; + + if ( $1.direction == DIR_UNSPEC || $1.direction == SOURCE_OR_DESTINATION || $1.direction == SOURCE_AND_DESTINATION ) { + // src and/or dst port + // we need a second rbtree due to different shifts for src and dst ports + root = malloc(sizeof(ULongtree_t)); + + struct ULongListNode *n; + if ( root == NULL) { + yyerror("malloc() error"); + YYABORT; + } + RB_INIT(root); + + RB_FOREACH(node, ULongtree, (ULongtree_t *)$5) { + if ( node->value > 65535 ) { + yyerror("Port outside of range 0..65535"); + YYABORT; + } + if ((n = malloc(sizeof(struct ULongListNode))) == NULL) { + yyerror("malloc() error"); + YYABORT; + } + n->value = (node->value << ShiftDstPort) & MaskDstPort; + node->value = (node->value << ShiftSrcPort) & MaskSrcPort; + RB_INSERT(ULongtree, root, n); + } + } + + switch ( $1.direction ) { + case SOURCE: + RB_FOREACH(node, ULongtree, (ULongtree_t *)$5) { + node->value = (node->value << ShiftSrcPort) & MaskSrcPort; + } + $$.self = NewBlock(OffsetPort, MaskSrcPort, 0, CMP_ULLIST, FUNC_NONE, (void *)$5 ); + break; + case DESTINATION: + RB_FOREACH(node, ULongtree, (ULongtree_t *)$5) { + node->value = (node->value << ShiftDstPort) & MaskDstPort; + } + $$.self = NewBlock(OffsetPort, MaskDstPort, 0, CMP_ULLIST, FUNC_NONE, (void *)$5 ); + break; + case DIR_UNSPEC: + case SOURCE_OR_DESTINATION: + $$.self = Connect_OR( + NewBlock(OffsetPort, MaskSrcPort, 0, CMP_ULLIST, FUNC_NONE, (void *)$5 ), + NewBlock(OffsetPort, MaskDstPort, 0, CMP_ULLIST, FUNC_NONE, (void *)root ) + ); + break; + case SOURCE_AND_DESTINATION: + $$.self = Connect_AND( + NewBlock(OffsetPort, MaskSrcPort, 0, CMP_ULLIST, FUNC_NONE, (void *)$5 ), + NewBlock(OffsetPort, MaskDstPort, 0, CMP_ULLIST, FUNC_NONE, (void *)root ) + ); + break; + default: + yyerror("This token is not expected here!"); + YYABORT; + } // End of switch + + } + + | ICMP_TYPE NUMBER { + if ( $2 > 255 ) { + yyerror("ICMP tpye of range 0..15"); + YYABORT; + } + $$.self = Connect_AND( + // imply proto ICMP with a proto ICMP block + Connect_OR ( + NewBlock(OffsetProto, MaskProto, ((uint64_t)IPPROTO_ICMP << ShiftProto) & MaskProto, CMP_EQ, FUNC_NONE, NULL), + NewBlock(OffsetProto, MaskProto, ((uint64_t)IPPROTO_ICMPV6 << ShiftProto) & MaskProto, CMP_EQ, FUNC_NONE, NULL) + ), + NewBlock(OffsetPort, MaskICMPtype, ($2 << ShiftICMPtype) & MaskICMPtype, CMP_EQ, FUNC_NONE, NULL ) + ); + + } + + | ICMP_CODE NUMBER { + if ( $2 > 255 ) { + yyerror("ICMP code of range 0..15"); + YYABORT; + } + $$.self = Connect_AND( + // imply proto ICMP with a proto ICMP block + Connect_OR ( + NewBlock(OffsetProto, MaskProto, ((uint64_t)IPPROTO_ICMP << ShiftProto) & MaskProto, CMP_EQ, FUNC_NONE, NULL), + NewBlock(OffsetProto, MaskProto, ((uint64_t)IPPROTO_ICMPV6 << ShiftProto) & MaskProto, CMP_EQ, FUNC_NONE, NULL) + ), + NewBlock(OffsetPort, MaskICMPcode, ($2 << ShiftICMPcode) & MaskICMPcode, CMP_EQ, FUNC_NONE, NULL ) + ); + + } + + | ENGINE_TYPE comp NUMBER { + if ( $3 > 255 ) { + yyerror("Engine type of range 0..255"); + YYABORT; + } + $$.self = NewBlock(OffsetRouterID, MaskEngineType, ($3 << ShiftEngineType) & MaskEngineType, $2.comp, FUNC_NONE, NULL); + + } + + | ENGINE_ID comp NUMBER { + if ( $3 > 255 ) { + yyerror("Engine ID of range 0..255"); + YYABORT; + } + $$.self = NewBlock(OffsetRouterID, MaskEngineID, ($3 << ShiftEngineID) & MaskEngineID, $2.comp, FUNC_NONE, NULL); + + } + + | ASA EVENT REASON { +#ifdef NSEL + if ( strncasecmp($3,"ignore", 6) == 0) { + $$.self = NewBlock(OffsetConnID, MaskFWevent, ( NSEL_EVENT_IGNORE << ShiftFWevent) & MaskFWevent, CMP_EQ, FUNC_NONE, NULL ); + } else if( strncasecmp($3,"create", 6) == 0) { + $$.self = NewBlock(OffsetConnID, MaskFWevent, ( NSEL_EVENT_CREATE << ShiftFWevent) & MaskFWevent, CMP_EQ, FUNC_NONE, NULL ); + } else if( strncasecmp($3,"term", 4) == 0 || strncasecmp($3,"delete", 6) == 0) { + $$.self = NewBlock(OffsetConnID, MaskFWevent, ( NSEL_EVENT_DELETE << ShiftFWevent) & MaskFWevent, CMP_EQ, FUNC_NONE, NULL ); + } else if (strncasecmp($3,"deny", 4) == 0) { + $$.self = NewBlock(OffsetConnID, MaskFWevent, ( NSEL_EVENT_DENIED << ShiftFWevent) & MaskFWevent, CMP_EQ, FUNC_NONE, NULL ); + } else if (strncasecmp($3,"alert", 5) == 0) { + $$.self = NewBlock(OffsetConnID, MaskFWevent, ( NSEL_EVENT_ALERT << ShiftFWevent) & MaskFWevent, CMP_EQ, FUNC_NONE, NULL ); + } else if (strncasecmp($3,"update", 6) == 0) { + $$.self = NewBlock(OffsetConnID, MaskFWevent, ( NSEL_EVENT_UPDATE << ShiftFWevent) & MaskFWevent, CMP_EQ, FUNC_NONE, NULL ); + } else { + yyerror("Unknown asa event"); + YYABORT; + } +#else + yyerror("NSEL/ASA filters not available"); + YYABORT; +#endif + } + + | ASA EVENT comp NUMBER { +#ifdef NSEL + if ( $4 > 255 ) { + yyerror("Invalid xevent ID"); + YYABORT; + } + $$.self = NewBlock(OffsetConnID, MaskFWevent, ( $4 << ShiftFWevent) & MaskFWevent, $3.comp, FUNC_NONE, NULL ); +#else + yyerror("NSEL/ASA filters not available"); + YYABORT; +#endif + } + + | ASA EVENT DENIED inout { +#ifdef NSEL + uint64_t xevent = 0; + if ( $4.inout == INGRESS ) { + xevent = 1001; + } else if ( $4.inout == EGRESS ) { + xevent = 1002; + } else { + yyerror("Invalid inout token"); + YYABORT; + } + $$.self = Connect_AND( + NewBlock(OffsetConnID, MaskFWevent, ( NSEL_EVENT_DENIED << ShiftFWevent) & MaskFWevent, CMP_EQ, FUNC_NONE, NULL ), + NewBlock(OffsetConnID, MaskFWXevent, ( xevent << ShiftFWXevent) & MaskFWXevent, CMP_EQ, FUNC_NONE, NULL ) + ); +#else + yyerror("NSEL/ASA filters not available"); + YYABORT; +#endif + } + | ASA EVENT DENIED STRING { +#ifdef NSEL + uint64_t xevent = 0; + if( strncasecmp($4,"interface", 6) == 0) { + xevent = 1003; + } else if( strncasecmp($4,"nosyn", 6) == 0) { + xevent = 1004; + } else { + xevent = (uint64_t)strtol($4, (char **)NULL, 10); + if ( (xevent == 0 && errno == EINVAL) || xevent > 65535 ) { + yyerror("Invalid xevent ID"); + YYABORT; + } + } + $$.self = Connect_AND( + NewBlock(OffsetConnID, MaskFWevent, ( NSEL_EVENT_DENIED << ShiftFWevent) & MaskFWevent, CMP_EQ, FUNC_NONE, NULL ), + NewBlock(OffsetConnID, MaskFWXevent, ( xevent << ShiftFWXevent) & MaskFWXevent, CMP_EQ, FUNC_NONE, NULL ) + ); +#else + yyerror("NSEL/ASA filters not available"); + YYABORT; +#endif + } + + | ASA XEVENT comp NUMBER { +#ifdef NSEL + if ( $4 > 65535 ) { + yyerror("Invalid xevent ID"); + YYABORT; + } + $$.self = NewBlock(OffsetConnID, MaskFWXevent, ( $4 << ShiftFWXevent) & MaskFWXevent, $3.comp, FUNC_NONE, NULL ); +#else + yyerror("NSEL/ASA filters not available"); + YYABORT; +#endif + } + + | dqual XIP STRING { +#ifdef NSEL + int af, bytes, ret; + + ret = parse_ip(&af, $3, IPstack, &bytes, ALLOW_LOOKUP, &num_ip); + + if ( ret == 0 ) { + yyerror("Error parsing IP address."); + YYABORT; + } + + // ret == -1 will never happen here, as ALLOW_LOOKUP is set + if ( ret == -2 ) { + // could not resolv host => 'not any' + $$.self = Invert(NewBlock(OffsetProto, 0, 0, CMP_EQ, FUNC_NONE, NULL )); + } else { + uint64_t offsets[4] = {OffsetXLATESRCv6a, OffsetXLATESRCv6b, OffsetXLATEDSTv6a, OffsetXLATEDSTv6b }; + if ( af && (( af == PF_INET && bytes != 4 ) || ( af == PF_INET6 && bytes != 16 ))) { + yyerror("incomplete IP address"); + YYABORT; + } + + switch ( $1.direction ) { + case SOURCE: + case DESTINATION: + $$.self = ChainHosts(offsets, IPstack, num_ip, $1.direction); + break; + case DIR_UNSPEC: + case SOURCE_OR_DESTINATION: { + uint32_t src = ChainHosts(offsets, IPstack, num_ip, SOURCE); + uint32_t dst = ChainHosts(offsets, IPstack, num_ip, DESTINATION); + $$.self = Connect_OR(src, dst); + } break; + case SOURCE_AND_DESTINATION: { + uint32_t src = ChainHosts(offsets, IPstack, num_ip, SOURCE); + uint32_t dst = ChainHosts(offsets, IPstack, num_ip, DESTINATION); + $$.self = Connect_AND(src, dst); + } break; + default: + yyerror("This token is not expected here!"); + YYABORT; + + } // End of switch + + } +#else + yyerror("NSEL/ASA filters not available"); + YYABORT; +#endif + } + + | dqual XNET STRING '/' NUMBER { +#ifdef NSEL + int af, bytes, ret; + uint64_t mask[2]; + + ret = parse_ip(&af, $3, IPstack, &bytes, STRICT_IP, &num_ip); + if ( ret == 0 ) { + yyerror("Invalid IP address"); + YYABORT; + } + if ( ret == -1 ) { + yyerror("IP address required - hostname not allowed here."); + YYABORT; + } + // ret == -2 will never happen here, as STRICT_IP is set + + + if ( $5 > (bytes*8) ) { + yyerror("Too many netbits for this IP addresss"); + YYABORT; + } + + if ( af == PF_INET ) { + mask[0] = 0xffffffffffffffffLL; + mask[1] = 0xffffffffffffffffLL << ( 32 - $5 ); + } else { // PF_INET6 + if ( $5 > 64 ) { + mask[0] = 0xffffffffffffffffLL; + mask[1] = 0xffffffffffffffffLL << ( 128 - $5 ); + } else { + mask[0] = 0xffffffffffffffffLL << ( 64 - $5 ); + mask[1] = 0; + } + } + // IP aadresses are stored in network representation + mask[0] = mask[0]; + mask[1] = mask[1]; + + IPstack[0] &= mask[0]; + IPstack[1] &= mask[1]; + + switch ( $1.direction ) { + case SOURCE: + $$.self = Connect_AND( + NewBlock(OffsetXLATESRCv6b, mask[1], IPstack[1] , CMP_EQ, FUNC_NONE, NULL ), + NewBlock(OffsetXLATESRCv6a, mask[0], IPstack[0] , CMP_EQ, FUNC_NONE, NULL ) + ); + break; + case DESTINATION: + $$.self = Connect_AND( + NewBlock(OffsetXLATEDSTv6b, mask[1], IPstack[1] , CMP_EQ, FUNC_NONE, NULL ), + NewBlock(OffsetXLATEDSTv6a, mask[0], IPstack[0] , CMP_EQ, FUNC_NONE, NULL ) + ); + break; + case DIR_UNSPEC: + case SOURCE_OR_DESTINATION: + $$.self = Connect_OR( + Connect_AND( + NewBlock(OffsetXLATESRCv6b, mask[1], IPstack[1] , CMP_EQ, FUNC_NONE, NULL ), + NewBlock(OffsetXLATESRCv6a, mask[0], IPstack[0] , CMP_EQ, FUNC_NONE, NULL ) + ), + Connect_AND( + NewBlock(OffsetXLATEDSTv6b, mask[1], IPstack[1] , CMP_EQ, FUNC_NONE, NULL ), + NewBlock(OffsetXLATEDSTv6a, mask[0], IPstack[0] , CMP_EQ, FUNC_NONE, NULL ) + ) + ); + break; + case SOURCE_AND_DESTINATION: + $$.self = Connect_AND( + Connect_AND( + NewBlock(OffsetXLATESRCv6b, mask[1], IPstack[1] , CMP_EQ, FUNC_NONE, NULL ), + NewBlock(OffsetXLATESRCv6a, mask[0], IPstack[0] , CMP_EQ, FUNC_NONE, NULL ) + ), + Connect_AND( + NewBlock(OffsetXLATEDSTv6b, mask[1], IPstack[1] , CMP_EQ, FUNC_NONE, NULL ), + NewBlock(OffsetXLATEDSTv6a, mask[0], IPstack[0] , CMP_EQ, FUNC_NONE, NULL ) + ) + ); + break; + default: + yyerror("This token is not expected here!"); + YYABORT; + } // End of switch + +#else + yyerror("NSEL/ASA filters not available"); + YYABORT; +#endif + } + + | dqual XPORT comp NUMBER { +#ifdef NSEL + if ( $4 > 65535 ) { + yyerror("Port outside of range 0..65535"); + YYABORT; + } + + switch ( $1.direction ) { + case SOURCE: + $$.self = NewBlock(OffsetXLATEPort, MaskXLATESRCPORT, ($4 << ShiftXLATESRCPORT) & MaskXLATESRCPORT, $3.comp, FUNC_NONE, NULL ); + break; + case DESTINATION: + $$.self = NewBlock(OffsetXLATEPort, MaskXLATEDSTPORT, ($4 << ShiftXLATEDSTPORT) & MaskXLATEDSTPORT, $3.comp, FUNC_NONE, NULL ); + break; + case DIR_UNSPEC: + case SOURCE_OR_DESTINATION: + $$.self = Connect_OR( + NewBlock(OffsetXLATEPort, MaskXLATESRCPORT, ($4 << ShiftXLATESRCPORT) & MaskXLATESRCPORT, $3.comp, FUNC_NONE, NULL ), + NewBlock(OffsetXLATEPort, MaskXLATEDSTPORT, ($4 << ShiftXLATEDSTPORT) & MaskXLATEDSTPORT, $3.comp, FUNC_NONE, NULL ) + ); + break; + case SOURCE_AND_DESTINATION: + $$.self = Connect_AND( + NewBlock(OffsetXLATEPort, MaskXLATESRCPORT, ($4 << ShiftXLATESRCPORT) & MaskXLATESRCPORT, $3.comp, FUNC_NONE, NULL ), + NewBlock(OffsetXLATEPort, MaskXLATEDSTPORT, ($4 << ShiftXLATEDSTPORT) & MaskXLATEDSTPORT, $3.comp, FUNC_NONE, NULL ) + ); + break; + default: + yyerror("This token is not expected here!"); + YYABORT; + } // End switch +#else + yyerror("NSEL/ASA filters not available"); + YYABORT; +#endif + + } + + | inout acl comp NUMBER { +#ifdef NSEL + uint64_t offset, mask, shift; + if ( $1.inout == INGRESS ) { + switch ($2.acl) { + case ACL: + offset = OffsetIngressAclId; + mask = MaskIngressAclId; + shift = ShiftIngressAclId; + break; + case ACE: + offset = OffsetIngressAceId; + mask = MaskIngressAceId; + shift = ShiftIngressAceId; + break; + case XACE: + offset = OffsetIngressGrpId; + mask = MaskIngressGrpId; + shift = ShiftIngressGrpId; + break; + default: + yyerror("Invalid ACL specifier"); + YYABORT; + } + } else if ( $1.inout == EGRESS && $$.acl == ACL ) { + offset = OffsetEgressAclId; + mask = MaskEgressAclId; + shift = ShiftEgressAclId; + } else { + yyerror("ingress/egress syntax error"); + YYABORT; + } + $$.self = NewBlock(offset, mask, ($4 << shift) & mask , $3.comp, FUNC_NONE, NULL ); + +#else + yyerror("NSEL/ASA filters not available"); + YYABORT; +#endif + } + + | NAT EVENT REASON { +#ifdef NSEL + if ( strncasecmp($3,"invalid", 6) == 0) { + $$.self = NewBlock(OffsetNATevent, MasNATevent, ( NEL_EVENT_INVALID << ShiftNATevent) & MasNATevent, CMP_EQ, FUNC_NONE, NULL ); + } else if( strncasecmp($3,"add", 6) == 0) { + $$.self = NewBlock(OffsetNATevent, MasNATevent, ( NEL_EVENT_ADD << ShiftNATevent) & MasNATevent, CMP_EQ, FUNC_NONE, NULL ); + } else if( strncasecmp($3,"delete", 4) == 0 || strncasecmp($3,"delete", 6) == 0) { + $$.self = NewBlock(OffsetNATevent, MasNATevent, ( NEL_EVENT_DELETE << ShiftNATevent) & MasNATevent, CMP_EQ, FUNC_NONE, NULL ); + } else { + yyerror("Unknown nat event"); + YYABORT; + } +#else + yyerror("NAT filters not available"); + YYABORT; +#endif + } + + | NAT EVENT comp NUMBER { +#ifdef NSEL + if ( $4 > 255 ) { + yyerror("Invalid event ID"); + YYABORT; + } + $$.self = NewBlock(OffsetNATevent, MasNATevent, ( $4 << ShiftNATevent) & MasNATevent, $3.comp, FUNC_NONE, NULL ); +#else + yyerror("NAT filters not available"); + YYABORT; +#endif + } + + | INGRESS VRF comp NUMBER { +#ifdef NSEL + if ( $4 > 0xFFFFFFFFLL ) { + yyerror("Invalid ingress vrf ID"); + YYABORT; + } + $$.self = NewBlock(OffsetIVRFID, MaskIVRFID, ( $4 << ShiftIVRFID) & MaskIVRFID, $3.comp, FUNC_NONE, NULL ); +#else + yyerror("NAT filters not available"); + YYABORT; +#endif + } + + | EGRESS VRF comp NUMBER { +#ifdef NSEL + if ( $4 > 0xFFFFFFFFLL ) { + yyerror("Invalid egress vrf ID"); + YYABORT; + } + $$.self = NewBlock(OffsetEVRFID, MaskEVRFID, ( $4 << ShiftEVRFID) & MaskEVRFID, $3.comp, FUNC_NONE, NULL ); +#else + yyerror("NAT filters not available"); + YYABORT; +#endif + } + + | PBLOCK START comp NUMBER { +#ifdef NSEL + if ( $4 > 65536 ) { + yyerror("Invalid port"); + YYABORT; + } + $$.self = NewBlock(OffsetPortBlock, MaskPortBlockStart, ( $4 << ShiftPortBlockStart) & MaskPortBlockStart, $3.comp, FUNC_NONE, NULL ); +#else + yyerror("NAT filters not available"); + YYABORT; +#endif + } + + | PBLOCK END comp NUMBER { +#ifdef NSEL + if ( $4 > 65536 ) { + yyerror("Invalid port"); + YYABORT; + } + $$.self = NewBlock(OffsetPortBlock, MaskPortBlockEnd, ( $4 << ShiftPortBlockEnd) & MaskPortBlockEnd, $3.comp, FUNC_NONE, NULL ); +#else + yyerror("NAT filters not available"); + YYABORT; +#endif + } + + | PBLOCK STEP comp NUMBER { +#ifdef NSEL + if ( $4 > 65536 ) { + yyerror("Invalid port"); + YYABORT; + } + $$.self = NewBlock(OffsetPortBlock, MaskPortBlockStep, ( $4 << ShiftPortBlockStep) & MaskPortBlockStep, $3.comp, FUNC_NONE, NULL ); +#else + yyerror("NAT filters not available"); + YYABORT; +#endif + } + + | PBLOCK SIZE comp NUMBER { +#ifdef NSEL + if ( $4 > 65536 ) { + yyerror("Invalid port"); + YYABORT; + } + $$.self = NewBlock(OffsetPortBlock, MaskPortBlockSize, ( $4 << ShiftPortBlockSize) & MaskPortBlockSize, $3.comp, FUNC_NONE, NULL ); +#else + yyerror("NAT filters not available"); + YYABORT; +#endif + } + + | dqual NPORT comp NUMBER { +#ifdef NSEL + if ( $4 > 65535 ) { + yyerror("Port outside of range 0..65535"); + YYABORT; + } + + switch ( $1.direction ) { + case SOURCE: + $$.self = NewBlock(OffsetXLATEPort, MaskXLATESRCPORT, ($4 << ShiftXLATESRCPORT) & MaskXLATESRCPORT, $3.comp, FUNC_NONE, NULL ); + break; + case DESTINATION: + $$.self = NewBlock(OffsetXLATEPort, MaskXLATEDSTPORT, ($4 << ShiftXLATEDSTPORT) & MaskXLATEDSTPORT, $3.comp, FUNC_NONE, NULL ); + break; + case DIR_UNSPEC: + case SOURCE_OR_DESTINATION: + $$.self = Connect_OR( + NewBlock(OffsetXLATEPort, MaskXLATESRCPORT, ($4 << ShiftXLATESRCPORT) & MaskXLATESRCPORT, $3.comp, FUNC_NONE, NULL ), + NewBlock(OffsetXLATEPort, MaskXLATEDSTPORT, ($4 << ShiftXLATEDSTPORT) & MaskXLATEDSTPORT, $3.comp, FUNC_NONE, NULL ) + ); + break; + case SOURCE_AND_DESTINATION: + $$.self = Connect_AND( + NewBlock(OffsetXLATEPort, MaskXLATESRCPORT, ($4 << ShiftXLATESRCPORT) & MaskXLATESRCPORT, $3.comp, FUNC_NONE, NULL ), + NewBlock(OffsetXLATEPort, MaskXLATEDSTPORT, ($4 << ShiftXLATEDSTPORT) & MaskXLATEDSTPORT, $3.comp, FUNC_NONE, NULL ) + ); + break; + default: + yyerror("This token is not expected here!"); + YYABORT; + } // End switch +#else + yyerror("NEL/NAT filters not available"); + YYABORT; +#endif + + } + + | dqual NIP STRING { +#ifdef NSEL + int af, bytes, ret; + + ret = parse_ip(&af, $3, IPstack, &bytes, ALLOW_LOOKUP, &num_ip); + + if ( ret == 0 ) { + yyerror("Error parsing IP address."); + YYABORT; + } + + // ret == -1 will never happen here, as ALLOW_LOOKUP is set + if ( ret == -2 ) { + // could not resolv host => 'not any' + $$.self = Invert(NewBlock(OffsetProto, 0, 0, CMP_EQ, FUNC_NONE, NULL )); + } else { + uint64_t offsets[4] = {OffsetXLATESRCv6a, OffsetXLATESRCv6b, OffsetXLATEDSTv6a, OffsetXLATEDSTv6b }; + if ( af && (( af == PF_INET && bytes != 4 ) || ( af == PF_INET6 && bytes != 16 ))) { + yyerror("incomplete IP address"); + YYABORT; + } + + switch ( $1.direction ) { + case SOURCE: + case DESTINATION: + $$.self = ChainHosts(offsets, IPstack, num_ip, $1.direction); + break; + case DIR_UNSPEC: + case SOURCE_OR_DESTINATION: { + uint32_t src = ChainHosts(offsets, IPstack, num_ip, SOURCE); + uint32_t dst = ChainHosts(offsets, IPstack, num_ip, DESTINATION); + $$.self = Connect_OR(src, dst); + } break; + case SOURCE_AND_DESTINATION: { + uint32_t src = ChainHosts(offsets, IPstack, num_ip, SOURCE); + uint32_t dst = ChainHosts(offsets, IPstack, num_ip, DESTINATION); + $$.self = Connect_AND(src, dst); + } break; + default: + yyerror("This token is not expected here!"); + YYABORT; + + } // End of switch + + } +#else + yyerror("NSEL/ASA filters not available"); + YYABORT; +#endif + } + + | dqual AS comp NUMBER { + if ( $4 > 0xfFFFFFFF ) { + yyerror("AS number of range"); + YYABORT; + } + + switch ( $1.direction ) { + case SOURCE: + $$.self = NewBlock(OffsetAS, MaskSrcAS, ($4 << ShiftSrcAS) & MaskSrcAS, $3.comp, FUNC_NONE, NULL ); + break; + case DESTINATION: + $$.self = NewBlock(OffsetAS, MaskDstAS, ($4 << ShiftDstAS) & MaskDstAS, $3.comp, FUNC_NONE, NULL); + break; + case DIR_UNSPEC: + case SOURCE_OR_DESTINATION: + $$.self = Connect_OR( + NewBlock(OffsetAS, MaskSrcAS, ($4 << ShiftSrcAS) & MaskSrcAS, $3.comp, FUNC_NONE, NULL ), + NewBlock(OffsetAS, MaskDstAS, ($4 << ShiftDstAS) & MaskDstAS, $3.comp, FUNC_NONE, NULL) + ); + break; + case SOURCE_AND_DESTINATION: + $$.self = Connect_AND( + NewBlock(OffsetAS, MaskSrcAS, ($4 << ShiftSrcAS) & MaskSrcAS, $3.comp, FUNC_NONE, NULL ), + NewBlock(OffsetAS, MaskDstAS, ($4 << ShiftDstAS) & MaskDstAS, $3.comp, FUNC_NONE, NULL) + ); + break; + case ADJ_PREV: + $$.self = NewBlock(OffsetBGPadj, MaskBGPadjPrev, ($4 << ShiftBGPadjPrev) & MaskBGPadjPrev, $3.comp, FUNC_NONE, NULL ); + break; + case ADJ_NEXT: + $$.self = NewBlock(OffsetBGPadj, MaskBGPadjNext, ($4 << ShiftBGPadjNext) & MaskBGPadjNext, $3.comp, FUNC_NONE, NULL ); + break; + default: + yyerror("This token is not expected here!"); + YYABORT; + } // End of switch + + } + + | dqual AS IN '[' ullist ']' { + struct ULongListNode *node; + ULongtree_t *root = NULL; + + if ( $1.direction == DIR_UNSPEC || $1.direction == SOURCE_OR_DESTINATION || $1.direction == SOURCE_AND_DESTINATION ) { + // src and/or dst AS + // we need a second rbtree due to different shifts for src and dst AS + root = malloc(sizeof(ULongtree_t)); + + struct ULongListNode *n; + if ( root == NULL) { + yyerror("malloc() error"); + YYABORT; + } + RB_INIT(root); + + RB_FOREACH(node, ULongtree, (ULongtree_t *)$5) { + if ( node->value > 0xFFFFFFFFLL ) { + yyerror("AS number of range"); + YYABORT; + } + if ((n = malloc(sizeof(struct ULongListNode))) == NULL) { + yyerror("malloc() error"); + YYABORT; + } + n->value = (node->value << ShiftDstAS) & MaskDstAS; + node->value = (node->value << ShiftSrcAS) & MaskSrcAS; + RB_INSERT(ULongtree, root, n); + } + } + + switch ( $1.direction ) { + case SOURCE: + RB_FOREACH(node, ULongtree, (ULongtree_t *)$5) { + node->value = (node->value << ShiftSrcAS) & MaskSrcAS; + } + $$.self = NewBlock(OffsetAS, MaskSrcAS, 0, CMP_ULLIST, FUNC_NONE, (void *)$5 ); + break; + case DESTINATION: + RB_FOREACH(node, ULongtree, (ULongtree_t *)$5) { + node->value = (node->value << ShiftDstAS) & MaskDstAS; + } + $$.self = NewBlock(OffsetAS, MaskDstAS, 0, CMP_ULLIST, FUNC_NONE, (void *)$5 ); + break; + case DIR_UNSPEC: + case SOURCE_OR_DESTINATION: + $$.self = Connect_OR( + NewBlock(OffsetAS, MaskSrcAS, 0, CMP_ULLIST, FUNC_NONE, (void *)$5 ), + NewBlock(OffsetAS, MaskDstAS, 0, CMP_ULLIST, FUNC_NONE, (void *)root ) + ); + break; + case SOURCE_AND_DESTINATION: + $$.self = Connect_AND( + NewBlock(OffsetAS, MaskSrcAS, 0, CMP_ULLIST, FUNC_NONE, (void *)$5 ), + NewBlock(OffsetAS, MaskDstAS, 0, CMP_ULLIST, FUNC_NONE, (void *)root ) + ); + break; + default: + yyerror("This token is not expected here!"); + YYABORT; + } + + } + + | dqual MASK NUMBER { + if ( $3 > 255 ) { + yyerror("Mask outside of range 0..255"); + YYABORT; + } + + switch ( $1.direction ) { + case SOURCE: + $$.self = NewBlock(OffsetMask, MaskSrcMask, ($3 << ShiftSrcMask) & MaskSrcMask, CMP_EQ, FUNC_NONE, NULL ); + break; + case DESTINATION: + $$.self = NewBlock(OffsetMask, MaskDstMask, ($3 << ShiftDstMask) & MaskDstMask, CMP_EQ, FUNC_NONE, NULL ); + break; + case DIR_UNSPEC: + case SOURCE_OR_DESTINATION: + $$.self = Connect_OR( + NewBlock(OffsetMask, MaskSrcMask, ($3 << ShiftSrcMask) & MaskSrcMask, CMP_EQ, FUNC_NONE, NULL ), + NewBlock(OffsetMask, MaskDstMask, ($3 << ShiftDstMask) & MaskDstMask, CMP_EQ, FUNC_NONE, NULL ) + ); + break; + case SOURCE_AND_DESTINATION: + $$.self = Connect_AND( + NewBlock(OffsetMask, MaskSrcMask, ($3 << ShiftSrcMask) & MaskSrcMask, CMP_EQ, FUNC_NONE, NULL ), + NewBlock(OffsetMask, MaskDstMask, ($3 << ShiftDstMask) & MaskDstMask, CMP_EQ, FUNC_NONE, NULL ) + ); + break; + default: + yyerror("This token is not expected here!"); + YYABORT; + } // End switch + + } + + | dqual NET STRING STRING { + int af, bytes, ret; + uint64_t mask[2]; + ret = parse_ip(&af, $3, IPstack, &bytes, STRICT_IP, &num_ip); + + if ( ret == 0 ) { + yyerror("Invalid IP address"); + YYABORT; + } + + if ( ret == -1 ) { + yyerror("IP address required - hostname not allowed here."); + YYABORT; + } + // ret == -2 will never happen here, as STRICT_IP is set + + if ( af != PF_INET ) { + yyerror("IP netmask syntax valid only for IPv4"); + YYABORT; + } + if ( bytes != 4 ) { + yyerror("Need complete IP address"); + YYABORT; + } + + ret = parse_ip(&af, $4, mask, &bytes, STRICT_IP, &num_ip); + if ( ret == 0 ) { + yyerror("Invalid IP address"); + YYABORT; + } + if ( ret == -1 ) { + yyerror("IP address required - hostname not allowed here."); + YYABORT; + } + // ret == -2 will never happen here, as STRICT_IP is set + + if ( af != PF_INET || bytes != 4 ) { + yyerror("Invalid netmask for IPv4 address"); + YYABORT; + } + + IPstack[0] &= mask[0]; + IPstack[1] &= mask[1]; + + switch ( $1.direction ) { + case SOURCE: + $$.self = Connect_AND( + NewBlock(OffsetSrcIPv6b, mask[1], IPstack[1] , CMP_EQ, FUNC_NONE, NULL ), + NewBlock(OffsetSrcIPv6a, mask[0], IPstack[0] , CMP_EQ, FUNC_NONE, NULL ) + ); + break; + case DESTINATION: + $$.self = Connect_AND( + NewBlock(OffsetDstIPv6b, mask[1], IPstack[1] , CMP_EQ, FUNC_NONE, NULL ), + NewBlock(OffsetDstIPv6a, mask[0], IPstack[0] , CMP_EQ, FUNC_NONE, NULL ) + ); + break; + case DIR_UNSPEC: + case SOURCE_OR_DESTINATION: + $$.self = Connect_OR( + Connect_AND( + NewBlock(OffsetSrcIPv6b, mask[1], IPstack[1] , CMP_EQ, FUNC_NONE, NULL ), + NewBlock(OffsetSrcIPv6a, mask[0], IPstack[0] , CMP_EQ, FUNC_NONE, NULL ) + ), + Connect_AND( + NewBlock(OffsetDstIPv6b, mask[1], IPstack[1] , CMP_EQ, FUNC_NONE, NULL ), + NewBlock(OffsetDstIPv6a, mask[0], IPstack[0] , CMP_EQ, FUNC_NONE, NULL ) + ) + ); + break; + case SOURCE_AND_DESTINATION: + $$.self = Connect_AND( + Connect_AND( + NewBlock(OffsetSrcIPv6b, mask[1], IPstack[1] , CMP_EQ, FUNC_NONE, NULL ), + NewBlock(OffsetSrcIPv6a, mask[0], IPstack[0] , CMP_EQ, FUNC_NONE, NULL ) + ), + Connect_AND( + NewBlock(OffsetDstIPv6b, mask[1], IPstack[1] , CMP_EQ, FUNC_NONE, NULL ), + NewBlock(OffsetDstIPv6a, mask[0], IPstack[0] , CMP_EQ, FUNC_NONE, NULL ) + ) + ); + break; + default: + /* should never happen */ + yyerror("This token is not expected here!"); + YYABORT; + } // End of switch + + } + + | dqual NET STRING '/' NUMBER { + int af, bytes, ret; + uint64_t mask[2]; + + ret = parse_ip(&af, $3, IPstack, &bytes, STRICT_IP, &num_ip); + if ( ret == 0 ) { + yyerror("Invalid IP address"); + YYABORT; + } + if ( ret == -1 ) { + yyerror("IP address required - hostname not allowed here."); + YYABORT; + } + // ret == -2 will never happen here, as STRICT_IP is set + + + if ( $5 > (bytes*8) ) { + yyerror("Too many netbits for this IP addresss"); + YYABORT; + } + + if ( af == PF_INET ) { + mask[0] = 0xffffffffffffffffLL; + mask[1] = 0xffffffffffffffffLL << ( 32 - $5 ); + } else { // PF_INET6 + if ( $5 > 64 ) { + mask[0] = 0xffffffffffffffffLL; + mask[1] = 0xffffffffffffffffLL << ( 128 - $5 ); + } else { + mask[0] = 0xffffffffffffffffLL << ( 64 - $5 ); + mask[1] = 0; + } + } + // IP aadresses are stored in network representation + mask[0] = mask[0]; + mask[1] = mask[1]; + + IPstack[0] &= mask[0]; + IPstack[1] &= mask[1]; + + switch ( $1.direction ) { + case SOURCE: + $$.self = Connect_AND( + NewBlock(OffsetSrcIPv6b, mask[1], IPstack[1] , CMP_EQ, FUNC_NONE, NULL ), + NewBlock(OffsetSrcIPv6a, mask[0], IPstack[0] , CMP_EQ, FUNC_NONE, NULL ) + ); + break; + case DESTINATION: + $$.self = Connect_AND( + NewBlock(OffsetDstIPv6b, mask[1], IPstack[1] , CMP_EQ, FUNC_NONE, NULL ), + NewBlock(OffsetDstIPv6a, mask[0], IPstack[0] , CMP_EQ, FUNC_NONE, NULL ) + ); + break; + case DIR_UNSPEC: + case SOURCE_OR_DESTINATION: + $$.self = Connect_OR( + Connect_AND( + NewBlock(OffsetSrcIPv6b, mask[1], IPstack[1] , CMP_EQ, FUNC_NONE, NULL ), + NewBlock(OffsetSrcIPv6a, mask[0], IPstack[0] , CMP_EQ, FUNC_NONE, NULL ) + ), + Connect_AND( + NewBlock(OffsetDstIPv6b, mask[1], IPstack[1] , CMP_EQ, FUNC_NONE, NULL ), + NewBlock(OffsetDstIPv6a, mask[0], IPstack[0] , CMP_EQ, FUNC_NONE, NULL ) + ) + ); + break; + case SOURCE_AND_DESTINATION: + $$.self = Connect_AND( + Connect_AND( + NewBlock(OffsetSrcIPv6b, mask[1], IPstack[1] , CMP_EQ, FUNC_NONE, NULL ), + NewBlock(OffsetSrcIPv6a, mask[0], IPstack[0] , CMP_EQ, FUNC_NONE, NULL ) + ), + Connect_AND( + NewBlock(OffsetDstIPv6b, mask[1], IPstack[1] , CMP_EQ, FUNC_NONE, NULL ), + NewBlock(OffsetDstIPv6a, mask[0], IPstack[0] , CMP_EQ, FUNC_NONE, NULL ) + ) + ); + break; + default: + yyerror("This token is not expected here!"); + YYABORT; + } // End of switch + + } + + | dqual IF NUMBER { + if ( $3 > 0xffffffffLL ) { + yyerror("Input interface number must 0..2^32"); + YYABORT; + } + + switch ( $1.direction ) { + case DIR_UNSPEC: + $$.self = Connect_OR( + NewBlock(OffsetInOut, MaskInput, ($3 << ShiftInput) & MaskInput, CMP_EQ, FUNC_NONE, NULL), + NewBlock(OffsetInOut, MaskOutput, ($3 << ShiftOutput) & MaskOutput, CMP_EQ, FUNC_NONE, NULL) + ); + break; + case DIR_IN: + $$.self = NewBlock(OffsetInOut, MaskInput, ($3 << ShiftInput) & MaskInput, CMP_EQ, FUNC_NONE, NULL); + break; + case DIR_OUT: + $$.self = NewBlock(OffsetInOut, MaskOutput, ($3 << ShiftOutput) & MaskOutput, CMP_EQ, FUNC_NONE, NULL); + break; + default: + yyerror("This token is not expected here!"); + YYABORT; + } // End of switch + + } + + | dqual VLAN NUMBER { + if ( $3 > 65535 ) { + yyerror("VLAN number of range 0..65535"); + YYABORT; + } + + switch ( $1.direction ) { + case SOURCE: + $$.self = NewBlock(OffsetVlan, MaskSrcVlan, ($3 << ShiftSrcVlan) & MaskSrcVlan, CMP_EQ, FUNC_NONE, NULL ); + break; + case DESTINATION: + $$.self = NewBlock(OffsetVlan, MaskDstVlan, ($3 << ShiftDstVlan) & MaskDstVlan, CMP_EQ, FUNC_NONE, NULL); + break; + case DIR_UNSPEC: + case SOURCE_OR_DESTINATION: + $$.self = Connect_OR( + NewBlock(OffsetVlan, MaskSrcVlan, ($3 << ShiftSrcVlan) & MaskSrcVlan, CMP_EQ, FUNC_NONE, NULL ), + NewBlock(OffsetVlan, MaskDstVlan, ($3 << ShiftDstVlan) & MaskDstVlan, CMP_EQ, FUNC_NONE, NULL) + ); + break; + case SOURCE_AND_DESTINATION: + $$.self = Connect_AND( + NewBlock(OffsetVlan, MaskSrcVlan, ($3 << ShiftSrcVlan) & MaskSrcVlan, CMP_EQ, FUNC_NONE, NULL ), + NewBlock(OffsetVlan, MaskDstVlan, ($3 << ShiftDstVlan) & MaskDstVlan, CMP_EQ, FUNC_NONE, NULL) + ); + break; + default: + yyerror("This token is not expected here!"); + YYABORT; + } // End of switch + + } + + | dqual MAC STRING { + uint64_t mac = VerifyMac($3); + if ( mac == 0 ) { + yyerror("Invalid MAC address format"); + YYABORT; + } + switch ( $1.direction ) { + case DIR_UNSPEC: { + uint32_t in, out; + in = Connect_OR( + NewBlock(OffsetInSrcMAC, MaskMac, mac, CMP_EQ, FUNC_NONE, NULL ), + NewBlock(OffsetInDstMAC, MaskMac, mac, CMP_EQ, FUNC_NONE, NULL ) + ); + out = Connect_OR( + NewBlock(OffsetOutSrcMAC, MaskMac, mac, CMP_EQ, FUNC_NONE, NULL ), + NewBlock(OffsetOutDstMAC, MaskMac, mac, CMP_EQ, FUNC_NONE, NULL ) + ); + $$.self = Connect_OR(in, out); + } break; + case DIR_IN: + $$.self = Connect_OR( + NewBlock(OffsetInSrcMAC, MaskMac, mac, CMP_EQ, FUNC_NONE, NULL ), + NewBlock(OffsetInDstMAC, MaskMac, mac, CMP_EQ, FUNC_NONE, NULL ) + ); + break; + case DIR_OUT: + $$.self = Connect_OR( + NewBlock(OffsetOutSrcMAC, MaskMac, mac, CMP_EQ, FUNC_NONE, NULL ), + NewBlock(OffsetOutDstMAC, MaskMac, mac, CMP_EQ, FUNC_NONE, NULL ) + ); + break; + case SOURCE: + $$.self = Connect_OR( + NewBlock(OffsetInSrcMAC, MaskMac, mac, CMP_EQ, FUNC_NONE, NULL ), + NewBlock(OffsetOutSrcMAC, MaskMac, mac, CMP_EQ, FUNC_NONE, NULL ) + ); + break; + case DESTINATION: + $$.self = Connect_OR( + NewBlock(OffsetInDstMAC, MaskMac, mac, CMP_EQ, FUNC_NONE, NULL ), + NewBlock(OffsetOutDstMAC, MaskMac, mac, CMP_EQ, FUNC_NONE, NULL ) + ); + break; + case IN_SRC: + $$.self = NewBlock(OffsetInSrcMAC, MaskMac, mac, CMP_EQ, FUNC_NONE, NULL ); + break; + case IN_DST: + $$.self = NewBlock(OffsetInDstMAC, MaskMac, mac, CMP_EQ, FUNC_NONE, NULL ); + break; + case OUT_SRC: + $$.self = NewBlock(OffsetOutSrcMAC, MaskMac, mac, CMP_EQ, FUNC_NONE, NULL ); + break; + case OUT_DST: + $$.self = NewBlock(OffsetOutDstMAC, MaskMac, mac, CMP_EQ, FUNC_NONE, NULL ); + break; + break; + default: + yyerror("This token is not expected here!"); + YYABORT; + } // End of switch + } + + | MPLS STRING comp NUMBER { + if ( $4 > MPLSMAX ) { + yyerror("MPLS value out of range"); + YYABORT; + } + + // search for label1 - label10 + if ( strncasecmp($2, "label", 5) == 0 ) { + uint64_t mask; + uint32_t offset, shift; + char *s = &$2[5]; + if ( s == '\0' ) { + yyerror("Missing label number"); + YYABORT; + } + int i = (int)strtol(s, (char **)NULL, 10); + + switch (i) { + case 1: + offset = OffsetMPLS12; + mask = MaskMPLSlabelOdd; + shift = ShiftMPLSlabelOdd; + break; + case 2: + offset = OffsetMPLS12; + mask = MaskMPLSlabelEven; + shift = ShiftMPLSlabelEven; + break; + case 3: + offset = OffsetMPLS34; + mask = MaskMPLSlabelOdd; + shift = ShiftMPLSlabelOdd; + break; + case 4: + offset = OffsetMPLS34; + mask = MaskMPLSlabelEven; + shift = ShiftMPLSlabelEven; + break; + case 5: + offset = OffsetMPLS56; + mask = MaskMPLSlabelOdd; + shift = ShiftMPLSlabelOdd; + break; + case 6: + offset = OffsetMPLS56; + mask = MaskMPLSlabelEven; + shift = ShiftMPLSlabelEven; + break; + case 7: + offset = OffsetMPLS78; + mask = MaskMPLSlabelOdd; + shift = ShiftMPLSlabelOdd; + break; + case 8: + offset = OffsetMPLS78; + mask = MaskMPLSlabelEven; + shift = ShiftMPLSlabelEven; + break; + case 9: + offset = OffsetMPLS910; + mask = MaskMPLSlabelOdd; + shift = ShiftMPLSlabelOdd; + break; + case 10: + offset = OffsetMPLS910; + mask = MaskMPLSlabelEven; + shift = ShiftMPLSlabelEven; + break; + default: + yyerror("MPLS label out of range 1..10"); + YYABORT; + } + $$.self = NewBlock(offset, mask, ($4 << shift) & mask, $3.comp, FUNC_NONE, NULL ); + + } else if ( strcasecmp($2, "eos") == 0 ) { + // match End of Stack label + $$.self = NewBlock(0, AnyMask, $4 << 4, $3.comp, FUNC_MPLS_EOS, NULL ); + + } else if ( strncasecmp($2, "exp", 3) == 0 ) { + uint64_t mask; + uint32_t offset, shift; + char *s = &$2[3]; + if ( s == '\0' ) { + yyerror("Missing label number"); + YYABORT; + } + int i = (int)strtol(s, (char **)NULL, 10); + + if ( $4 > 7 ) { + yyerror("MPLS exp value out of range"); + YYABORT; + } + + switch (i) { + case 1: + offset = OffsetMPLS12; + mask = MaskMPLSexpOdd; + shift = ShiftMPLSexpOdd; + break; + case 2: + offset = OffsetMPLS12; + mask = MaskMPLSexpEven; + shift = ShiftMPLSexpEven; + break; + case 3: + offset = OffsetMPLS34; + mask = MaskMPLSexpOdd; + shift = ShiftMPLSexpOdd; + break; + case 4: + offset = OffsetMPLS34; + mask = MaskMPLSexpEven; + shift = ShiftMPLSexpEven; + break; + case 5: + offset = OffsetMPLS56; + mask = MaskMPLSexpOdd; + shift = ShiftMPLSexpOdd; + break; + case 6: + offset = OffsetMPLS56; + mask = MaskMPLSexpEven; + shift = ShiftMPLSexpEven; + break; + case 7: + offset = OffsetMPLS78; + mask = MaskMPLSexpOdd; + shift = ShiftMPLSexpOdd; + break; + case 8: + offset = OffsetMPLS78; + mask = MaskMPLSexpEven; + shift = ShiftMPLSexpEven; + break; + case 9: + offset = OffsetMPLS910; + mask = MaskMPLSexpOdd; + shift = ShiftMPLSexpOdd; + break; + case 10: + offset = OffsetMPLS910; + mask = MaskMPLSexpEven; + shift = ShiftMPLSexpEven; + break; + default: + yyerror("MPLS label out of range 1..10"); + YYABORT; + } + $$.self = NewBlock(offset, mask, $4 << shift, $3.comp, FUNC_NONE, NULL ); + + } else { + yyerror("Unknown MPLS option"); + YYABORT; + } + } + | MPLS ANY NUMBER { + uint32_t *opt = malloc(sizeof(uint32_t)); + if ( $3 > MPLSMAX ) { + yyerror("MPLS value out of range"); + YYABORT; + } + if ( opt == NULL) { + yyerror("malloc() error"); + YYABORT; + } + *opt = $3 << 4; + $$.self = NewBlock(0, AnyMask, $3 << 4, CMP_EQ, FUNC_MPLS_ANY, opt ); + + } + | FWDSTAT NUMBER { + if ( $2 > 255 ) { + yyerror("Forwarding status of range 0..255"); + YYABORT; + } + $$.self = NewBlock(OffsetStatus, MaskStatus, ($2 << ShiftStatus) & MaskStatus, CMP_EQ, FUNC_NONE, NULL); + } + + | FWDSTAT STRING { + uint64_t id = Get_fwd_status_id($2); + if (id == 256 ) { + yyerror("Unknown forwarding status"); + YYABORT; + } + + $$.self = NewBlock(OffsetStatus, MaskStatus, (id << ShiftStatus) & MaskStatus, CMP_EQ, FUNC_NONE, NULL); + + } + + | DIR NUMBER { + if ( $2 > 2 ) { + yyerror("Flow direction status of range 0, 1"); + YYABORT; + } + $$.self = NewBlock(OffsetDir, MaskDir, ($2 << ShiftDir) & MaskDir, CMP_EQ, FUNC_NONE, NULL); + + } + + | DIR inout { + uint64_t dir = 0xFF; + if ( $2.inout == INGRESS ) + dir = 0; + else if ( $2.inout == EGRESS ) + dir = 1; + else { + yyerror("Flow direction status of range ingress, egress"); + YYABORT; + } + + $$.self = NewBlock(OffsetDir, MaskDir, (dir << ShiftDir) & MaskDir, CMP_EQ, FUNC_NONE, NULL); + + } + +/* iplist definition */ +iplist: STRING { + int i, af, bytes, ret; + struct IPListNode *node; + + IPlist_t *root = malloc(sizeof(IPlist_t)); + + if ( root == NULL) { + yyerror("malloc() error"); + YYABORT; + } + RB_INIT(root); + + ret = parse_ip(&af, $1, IPstack, &bytes, ALLOW_LOOKUP, &num_ip); + + if ( ret == 0 ) { + yyerror("Invalid IP address"); + YYABORT; + } + // ret == -1 will never happen here, as ALLOW_LOOKUP is set + + if ( ret != -2 ) { + if ( af && (( af == PF_INET && bytes != 4 ) || ( af == PF_INET6 && bytes != 16 ))) { + yyerror("incomplete IP address"); + YYABORT; + } + + for ( i=0; iip[0] = IPstack[2*i]; + node->ip[1] = IPstack[2*i+1]; + node->mask[0] = 0xffffffffffffffffLL; + node->mask[1] = 0xffffffffffffffffLL; + RB_INSERT(IPtree, root, node); + } + + } + $$ = (void *)root; + + } + +iplist: STRING '/' NUMBER { + int af, bytes, ret; + struct IPListNode *node; + + IPlist_t *root = malloc(sizeof(IPlist_t)); + + if ( root == NULL) { + yyerror("malloc() error"); + YYABORT; + } + RB_INIT(root); + + ret = parse_ip(&af, $1, IPstack, &bytes, STRICT_IP, &num_ip); + + if ( ret == 0 ) { + yyerror("Invalid IP address"); + YYABORT; + } + // ret == -1 will never happen here, as ALLOW_LOOKUP is set + + if ( ret != -2 ) { + if ( af && (( af == PF_INET && bytes != 4 ) || ( af == PF_INET6 && bytes != 16 ))) { + yyerror("incomplete IP address"); + YYABORT; + } + + if ((node = malloc(sizeof(struct IPListNode))) == NULL) { + yyerror("malloc() error"); + YYABORT; + } + + if ( af == PF_INET ) { + node->mask[0] = 0xffffffffffffffffLL; + node->mask[1] = 0xffffffffffffffffLL << ( 32 - $3 ); + } else { // PF_INET6 + if ( $3 > 64 ) { + node->mask[0] = 0xffffffffffffffffLL; + node->mask[1] = 0xffffffffffffffffLL << ( 128 - $3 ); + } else { + node->mask[0] = 0xffffffffffffffffLL << ( 64 - $3 ); + node->mask[1] = 0; + } + } + + node->ip[0] = IPstack[0] & node->mask[0]; + node->ip[1] = IPstack[1] & node->mask[1]; + + RB_INSERT(IPtree, root, node); + + } + $$ = (void *)root; + + } + + | iplist STRING { + int i, af, bytes, ret; + struct IPListNode *node; + + ret = parse_ip(&af, $2, IPstack, &bytes, ALLOW_LOOKUP, &num_ip); + + if ( ret == 0 ) { + yyerror("Invalid IP address"); + YYABORT; + } + if ( af && (( af == PF_INET && bytes != 4 ) || ( af == PF_INET6 && bytes != 16 ))) { + yyerror("incomplete IP address"); + YYABORT; + } + + // ret == - 2 means lookup failure + if ( ret != -2 ) { + for ( i=0; iip[0] = IPstack[2*i]; + node->ip[1] = IPstack[2*i+1]; + node->mask[0] = 0xffffffffffffffffLL; + node->mask[1] = 0xffffffffffffffffLL; + + RB_INSERT(IPtree, (IPlist_t *)$$, node); + } + } + } + | iplist ',' STRING { + int i, af, bytes, ret; + struct IPListNode *node; + + ret = parse_ip(&af, $3, IPstack, &bytes, ALLOW_LOOKUP, &num_ip); + + if ( ret == 0 ) { + yyerror("Invalid IP address"); + YYABORT; + } + if ( af && (( af == PF_INET && bytes != 4 ) || ( af == PF_INET6 && bytes != 16 ))) { + yyerror("incomplete IP address"); + YYABORT; + } + + // ret == - 2 means lookup failure + if ( ret != -2 ) { + for ( i=0; iip[0] = IPstack[2*i]; + node->ip[1] = IPstack[2*i+1]; + node->mask[0] = 0xffffffffffffffffLL; + node->mask[1] = 0xffffffffffffffffLL; + + RB_INSERT(IPtree, (IPlist_t *)$$, node); + } + } + } + + | iplist STRING '/' NUMBER { + int af, bytes, ret; + struct IPListNode *node; + + ret = parse_ip(&af, $2, IPstack, &bytes, STRICT_IP, &num_ip); + + if ( ret == 0 ) { + yyerror("Invalid IP address"); + YYABORT; + } + if ( af && (( af == PF_INET && bytes != 4 ) || ( af == PF_INET6 && bytes != 16 ))) { + yyerror("incomplete IP address"); + YYABORT; + } + + // ret == - 2 means lookup failure + if ( ret != -2 ) { + if ((node = malloc(sizeof(struct IPListNode))) == NULL) { + yyerror("malloc() error"); + YYABORT; + } + if ( af == PF_INET ) { + node->mask[0] = 0xffffffffffffffffLL; + node->mask[1] = 0xffffffffffffffffLL << ( 32 - $4 ); + } else { // PF_INET6 + if ( $4 > 64 ) { + node->mask[0] = 0xffffffffffffffffLL; + node->mask[1] = 0xffffffffffffffffLL << ( 128 - $4 ); + } else { + node->mask[0] = 0xffffffffffffffffLL << ( 64 - $4 ); + node->mask[1] = 0; + } + } + + node->ip[0] = IPstack[0] & node->mask[0]; + node->ip[1] = IPstack[1] & node->mask[1]; + + RB_INSERT(IPtree, (IPlist_t *)$$, node); + } + } + + ; + +/* ULlist definition */ +ullist: NUMBER { + struct ULongListNode *node; + + ULongtree_t *root = malloc(sizeof(ULongtree_t)); + + if ( root == NULL) { + yyerror("malloc() error"); + YYABORT; + } + RB_INIT(root); + + if ((node = malloc(sizeof(struct ULongListNode))) == NULL) { + yyerror("malloc() error"); + YYABORT; + } + node->value = $1; + + RB_INSERT(ULongtree, root, node); + $$ = (void *)root; + } + + | ullist NUMBER { + struct ULongListNode *node; + + if ((node = malloc(sizeof(struct ULongListNode))) == NULL) { + yyerror("malloc() error"); + YYABORT; + } + node->value = $2; + RB_INSERT(ULongtree, (ULongtree_t *)$$, node); + } + + | ullist ',' NUMBER { + struct ULongListNode *node; + + if ((node = malloc(sizeof(struct ULongListNode))) == NULL) { + yyerror("malloc() error"); + YYABORT; + } + node->value = $3; + RB_INSERT(ULongtree, (ULongtree_t *)$$, node); + } + + ; + +/* comparator qualifiers */ +comp: { $$.comp = CMP_EQ; } + | EQ { $$.comp = CMP_EQ; } + | LT { $$.comp = CMP_LT; } + | GT { $$.comp = CMP_GT; } + ; + +/* 'direction' qualifiers */ +dqual: { $$.direction = DIR_UNSPEC; } + | SRC { $$.direction = SOURCE; } + | DST { $$.direction = DESTINATION; } + | SRC OR DST { $$.direction = SOURCE_OR_DESTINATION; } + | DST OR SRC { $$.direction = SOURCE_OR_DESTINATION; } + | SRC AND DST { $$.direction = SOURCE_AND_DESTINATION; } + | DST AND SRC { $$.direction = SOURCE_AND_DESTINATION; } + | IN { $$.direction = DIR_IN; } + | OUT { $$.direction = DIR_OUT; } + | IN SRC { $$.direction = IN_SRC; } + | IN DST { $$.direction = IN_DST; } + | OUT SRC { $$.direction = OUT_SRC; } + | OUT DST { $$.direction = OUT_DST; } + | PREV { $$.direction = ADJ_PREV; } + | NEXT { $$.direction = ADJ_NEXT; } + ; + +inout: INGRESS { $$.inout = INGRESS; } + | EGRESS { $$.inout = EGRESS; } + ; + +acl: ACL { $$.acl = ACL; } + | ACE { $$.acl = ACE; } + | XACE { $$.acl = XACE; } + ; + +expr: term { $$ = $1.self; } + | expr OR expr { $$ = Connect_OR($1, $3); } + | expr AND expr { $$ = Connect_AND($1, $3); } + | NOT expr %prec NEGATE { $$ = Invert($2); } + | '(' expr ')' { $$ = $2; } + ; + +%% + +static void yyerror(char *msg) { + + if ( FilterFilename ) + snprintf(yyerror_buff, 255 ,"File '%s' line %d: %s at '%s'", FilterFilename, lineno, msg, yytext); + else + snprintf(yyerror_buff, 255, "Line %d: %s at '%s'", lineno, msg, yytext); + + yyerror_buff[255] = '\0'; + fprintf(stderr, "%s\n", yyerror_buff); + +} /* End of yyerror */ + +static uint32_t ChainHosts(uint64_t *offsets, uint64_t *hostlist, int num_records, int type) { +uint32_t offset_a, offset_b, i, j, block; + if ( type == SOURCE ) { + offset_a = offsets[0]; + offset_b = offsets[1]; + } else { + offset_a = offsets[2]; + offset_b = offsets[3]; + } + + i = 0; + block = Connect_AND( + NewBlock(offset_b, MaskIPv6, hostlist[i+1] , CMP_EQ, FUNC_NONE, NULL ), + NewBlock(offset_a, MaskIPv6, hostlist[i] , CMP_EQ, FUNC_NONE, NULL ) + ); + i += 2; + for ( j=1; j 17 ) + return 0; + + for (i=0; i 255 ) { + free(p); + return 0; + } + + mac = ( mac << 8 ) | (l & 0xFF ); + i++; + + if ( q ) { + r = ++q; + q = strchr(r, ':'); + } else + r = NULL; + } + + if ( i != 6 ) + return 0; + + return mac; + +} // End of VerifyMac diff --git a/bin/grammar.y.mine b/bin/grammar.y.mine new file mode 100755 index 0000000..2da1a3c --- /dev/null +++ b/bin/grammar.y.mine @@ -0,0 +1,1732 @@ +/* + * This file is part of the nfdump project. + * + * Copyright (c) 2004, SWITCH - Teleinformatikdienste fuer Lehre und Forschung + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of SWITCH nor the names of its contributors may be + * used to endorse or promote products derived from this software without + * specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 COPYRIGHT OWNER 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. + * + * $Author: peter $ + * + * $Id: grammar.y 100 2008-08-15 11:36:21Z peter $ + * + * $LastChangedRevision: 100 $ + * + * + * + */ + +%{ + +#include "config.h" + +#include +#include +#include +#include +#include +#include +#include + +#ifdef HAVE_STDINT_H +#include +#endif + +#include "nf_common.h" +#include "rbtree.h" +#include "nfdump.h" +#include "nffile.h" +#include "nftree.h" +#include "ipconv.h" +#include "util.h" + +/* + * function prototypes + */ +static void yyerror(char *msg); + +static uint32_t ChainHosts(uint64_t *hostlist, int num_records, int type); + +static uint64_t VerifyMac(char *s); + +enum { DIR_UNSPEC = 1, SOURCE, DESTINATION, SOURCE_AND_DESTINATION, SOURCE_OR_DESTINATION, DIR_IN, DIR_OUT, IN_SRC, IN_DST, OUT_SRC, OUT_DST }; + +/* var defs */ +extern int lineno; +extern char *yytext; +extern uint64_t *IPstack; +extern uint32_t StartNode; +extern uint16_t Extended; +extern int (*FilterEngine)(uint32_t *); +extern char *FilterFilename; + +static uint32_t num_ip; + +#define MPLSMAX 0x00ffffff +%} + +%union { + uint64_t value; + char *s; + FilterParam_t param; + void *list; +} + +%token ANY IP IF MAC MPLS TOS DIR FLAGS PROTO MASK HOSTNAME NET PORT FWDSTAT IN OUT SRC DST EQ LT GT +%token NUMBER STRING IDENT ALPHA_FLAGS PROTOSTR PORTNUM ICMP_TYPE ICMP_CODE ENGINE_TYPE ENGINE_ID AS PACKETS BYTES FLOWS +%token PPS BPS BPP DURATION +%token IPV4 IPV6 NEXTHOP BGPNEXTHOP ROUTER VLAN +%token NOT END +%type expr NUMBER PORTNUM ICMP_TYPE ICMP_CODE +%type STRING IDENT ALPHA_FLAGS PROTOSTR +%type dqual term comp +%type iplist ullist + +%left '+' OR +%left '*' AND +%left NEGATE + +%% +prog: /* empty */ + | expr { + StartNode = $1; + } + ; + +term: ANY { /* this is an unconditionally true expression, as a filter applies in any case */ + $$.self = NewBlock(OffsetProto, 0, 0, CMP_EQ, FUNC_NONE, NULL ); + } + + | IDENT STRING { + if ( !ScreenIdentString($2) ) { + yyerror("Illegal ident string"); + YYABORT; + } + + uint32_t index = AddIdent($2); + $$.self = NewBlock(0, 0, index, CMP_IDENT, FUNC_NONE, NULL ); + } + + | IPV4 { + $$.self = NewBlock(OffsetRecordFlags, (1LL << ShiftRecordFlags) & MaskRecordFlags, + (0LL << ShiftRecordFlags) & MaskRecordFlags, CMP_EQ, FUNC_NONE, NULL); + } + + | IPV6 { + $$.self = NewBlock(OffsetRecordFlags, (1LL << ShiftRecordFlags) & MaskRecordFlags, + (1LL << ShiftRecordFlags) & MaskRecordFlags, CMP_EQ, FUNC_NONE, NULL); + } + + | PROTO NUMBER { + int64_t proto; + proto = $2; + + if ( proto > 255 ) { + yyerror("Protocol number > 255"); + YYABORT; + } + if ( proto < 0 ) { + yyerror("Unknown protocol"); + YYABORT; + } + $$.self = NewBlock(OffsetProto, MaskProto, (proto << ShiftProto) & MaskProto, CMP_EQ, FUNC_NONE, NULL); + + } + + | PROTO STRING { + int64_t proto; + proto = Proto_num($2); + + if ( proto > 255 ) { + yyerror("Protocol number > 255"); + YYABORT; + } + if ( proto < 0 ) { + yyerror("Unknown protocol"); + YYABORT; + } + $$.self = NewBlock(OffsetProto, MaskProto, (proto << ShiftProto) & MaskProto, CMP_EQ, FUNC_NONE, NULL); + } + + | dqual PACKETS comp NUMBER { + + switch ( $$.direction ) { + case DIR_UNSPEC: + case DIR_IN: + $$.self = NewBlock(OffsetPackets, MaskPackets, $4, $3.comp, FUNC_NONE, NULL); + break; + case DIR_OUT: + $$.self = NewBlock(OffsetOutPackets, MaskPackets, $4, $3.comp, FUNC_NONE, NULL); + break; + case SOURCE: + case DESTINATION: + case SOURCE_OR_DESTINATION: + case SOURCE_AND_DESTINATION: + case IN_SRC: + case IN_DST: + case OUT_SRC: + case OUT_DST: + yyerror("This token is not expected here!"); + YYABORT; + break; + default: + /* should never happen */ + yyerror("Internal parser error"); + YYABORT; + } // End of switch + + } + + | dqual BYTES comp NUMBER { + + switch ( $$.direction ) { + case DIR_UNSPEC: + case DIR_IN: + $$.self = NewBlock(OffsetBytes, MaskBytes, $4, $3.comp, FUNC_NONE, NULL); + break; + case DIR_OUT: + $$.self = NewBlock(OffsetOutBytes, MaskBytes, $4, $3.comp, FUNC_NONE, NULL); + break; + case SOURCE: + case DESTINATION: + case SOURCE_OR_DESTINATION: + case SOURCE_AND_DESTINATION: + case IN_SRC: + case IN_DST: + case OUT_SRC: + case OUT_DST: + yyerror("This token is not expected here!"); + YYABORT; + break; + default: + /* should never happen */ + yyerror("Internal parser error"); + YYABORT; + } // End of switch + + } + + | FLOWS comp NUMBER { + $$.self = NewBlock(OffsetAggrFlows, MaskFlows, $3, $2.comp, FUNC_NONE, NULL); + } + + | PPS comp NUMBER { + $$.self = NewBlock(0, AnyMask, $3, $2.comp, FUNC_PPS, NULL); + } + + | BPS comp NUMBER { + $$.self = NewBlock(0, AnyMask, $3, $2.comp, FUNC_BPS, NULL); + } + + | BPP comp NUMBER { + $$.self = NewBlock(0, AnyMask, $3, $2.comp, FUNC_BPP, NULL); + } + + | DURATION comp NUMBER { + $$.self = NewBlock(0, AnyMask, $3, $2.comp, FUNC_DURATION, NULL); + } + + | dqual TOS comp NUMBER { + if ( $4 > 255 ) { + yyerror("TOS must be 0..255"); + YYABORT; + } + + switch ( $$.direction ) { + case DIR_UNSPEC: + case SOURCE: + $$.self = NewBlock(OffsetTos, MaskTos, ($4 << ShiftTos) & MaskTos, $3.comp, FUNC_NONE, NULL); + break; + case DESTINATION: + $$.self = NewBlock(OffsetDstTos, MaskDstTos, ($4 << ShiftDstTos) & MaskDstTos, $3.comp, FUNC_NONE, NULL); + break; + case SOURCE_OR_DESTINATION: + $$.self = Connect_OR( + NewBlock(OffsetTos, MaskTos, ($4 << ShiftTos) & MaskTos, $3.comp, FUNC_NONE, NULL), + NewBlock(OffsetDstTos, MaskDstTos, ($4 << ShiftDstTos) & MaskDstTos, $3.comp, FUNC_NONE, NULL) + ); + break; + case SOURCE_AND_DESTINATION: + $$.self = Connect_AND( + NewBlock(OffsetTos, MaskTos, ($4 << ShiftTos) & MaskTos, $3.comp, FUNC_NONE, NULL), + NewBlock(OffsetDstTos, MaskDstTos, ($4 << ShiftDstTos) & MaskDstTos, $3.comp, FUNC_NONE, NULL) + ); + break; + case DIR_IN: + case DIR_OUT: + case IN_SRC: + case IN_DST: + case OUT_SRC: + case OUT_DST: + yyerror("This token is not expected here!"); + YYABORT; + break; + default: + /* should never happen */ + yyerror("Internal parser error"); + YYABORT; + } + } + + | FLAGS comp NUMBER { + if ( $3 > 63 ) { + yyerror("Flags must be 0..63"); + YYABORT; + } + $$.self = NewBlock(OffsetFlags, MaskFlags, ($3 << ShiftFlags) & MaskFlags, $2.comp, FUNC_NONE, NULL); + } + + | FLAGS STRING { + uint64_t fl = 0; + int cnt = 0; + size_t len = strlen($2); + + if ( len > 7 ) { + yyerror("Too many flags"); + YYABORT; + } + + if ( strchr($2, 'F') ) { fl |= 1; cnt++; } + if ( strchr($2, 'S') ) { fl |= 2; cnt++; } + if ( strchr($2, 'R') ) { fl |= 4; cnt++; } + if ( strchr($2, 'P') ) { fl |= 8; cnt++; } + if ( strchr($2, 'A') ) { fl |= 16; cnt++; } + if ( strchr($2, 'U') ) { fl |= 32; cnt++; } + if ( strchr($2, 'X') ) { fl = 63; cnt++; } + + if ( cnt != len ) { + yyerror("Too many flags"); + YYABORT; + } + + $$.self = NewBlock(OffsetFlags, (fl << ShiftFlags) & MaskFlags, + (fl << ShiftFlags) & MaskFlags, CMP_FLAGS, FUNC_NONE, NULL); + } + + | dqual IP STRING { + int af, bytes, ret; + + ret = parse_ip(&af, $3, IPstack, &bytes, ALLOW_LOOKUP, &num_ip); + + if ( ret == 0 ) { + yyerror("Error parsing IP address."); + YYABORT; + } + + // ret == -1 will never happen here, as ALLOW_LOOKUP is set + if ( ret == -2 ) { + // could not resolv host => 'not any' + $$.self = Invert(NewBlock(OffsetProto, 0, 0, CMP_EQ, FUNC_NONE, NULL )); + } else { + if ( af && (( af == PF_INET && bytes != 4 ) || ( af == PF_INET6 && bytes != 16 ))) { + yyerror("incomplete IP address"); + YYABORT; + } + + switch ( $$.direction ) { + case SOURCE: + case DESTINATION: + $$.self = ChainHosts(IPstack, num_ip, $$.direction); + break; + case DIR_UNSPEC: + case SOURCE_OR_DESTINATION: { + uint32_t src = ChainHosts(IPstack, num_ip, SOURCE); + uint32_t dst = ChainHosts(IPstack, num_ip, DESTINATION); + $$.self = Connect_OR(src, dst); + } break; + case SOURCE_AND_DESTINATION: { + uint32_t src = ChainHosts(IPstack, num_ip, SOURCE); + uint32_t dst = ChainHosts(IPstack, num_ip, DESTINATION); + $$.self = Connect_AND(src, dst); + } break; + case DIR_IN: + case DIR_OUT: + case IN_SRC: + case IN_DST: + case OUT_SRC: + case OUT_DST: + yyerror("This token is not expected here!"); + YYABORT; + break; + default: + /* should never happen */ + yyerror("Internal parser error"); + YYABORT; + + } // End of switch + + } + } + + | dqual IP IN '[' iplist ']' { + + $$.direction = $1.direction; + + switch ( $$.direction ) { + case SOURCE: + $$.self = NewBlock(OffsetSrcIPv6a, MaskIPv6, 0 , CMP_IPLIST, FUNC_NONE, (void *)$5 ); + break; + case DESTINATION: + $$.self = NewBlock(OffsetDstIPv6a, MaskIPv6, 0 , CMP_IPLIST, FUNC_NONE, (void *)$5 ); + break; + case DIR_UNSPEC: + case SOURCE_OR_DESTINATION: + $$.self = Connect_OR( + NewBlock(OffsetSrcIPv6a, MaskIPv6, 0 , CMP_IPLIST, FUNC_NONE, (void *)$5 ), + NewBlock(OffsetDstIPv6a, MaskIPv6, 0 , CMP_IPLIST, FUNC_NONE, (void *)$5 ) + ); + break; + case SOURCE_AND_DESTINATION: + $$.self = Connect_AND( + NewBlock(OffsetSrcIPv6a, MaskIPv6, 0 , CMP_IPLIST, FUNC_NONE, (void *)$5 ), + NewBlock(OffsetDstIPv6a, MaskIPv6, 0 , CMP_IPLIST, FUNC_NONE, (void *)$5 ) + ); + break; + case DIR_IN: + case DIR_OUT: + case IN_SRC: + case IN_DST: + case OUT_SRC: + case OUT_DST: + yyerror("This token is not expected here!"); + YYABORT; + break; + default: + /* should never happen */ + yyerror("Internal parser error"); + YYABORT; + } + } + + | NEXTHOP IP STRING { + int af, bytes, ret; + + ret = parse_ip(&af, $3, IPstack, &bytes, STRICT_IP, &num_ip); + + if ( ret == 0 ) { + yyerror("Error parsing IP address."); + YYABORT; + } + + if ( ret == -1 ) { + yyerror("IP address required - hostname not allowed here."); + YYABORT; + } + // ret == -2 will never happen here, as STRICT_IP is set + + if ( af && (( af == PF_INET && bytes != 4 ) || ( af == PF_INET6 && bytes != 16 ))) { + yyerror("incomplete IP address"); + YYABORT; + } + + $$.self = Connect_AND( + NewBlock(OffsetNexthopv6b, MaskIPv6, IPstack[1] , CMP_EQ, FUNC_NONE, NULL ), + NewBlock(OffsetNexthopv6a, MaskIPv6, IPstack[0] , CMP_EQ, FUNC_NONE, NULL ) + ); + } + + | BGPNEXTHOP IP STRING { + int af, bytes, ret; + + ret = parse_ip(&af, $3, IPstack, &bytes, STRICT_IP, &num_ip); + + if ( ret == 0 ) { + yyerror("Error parsing IP address."); + YYABORT; + } + + if ( ret == -1 ) { + yyerror("IP address required - hostname not allowed here."); + YYABORT; + } + // ret == -2 will never happen here, as STRICT_IP is set + + if ( af && (( af == PF_INET && bytes != 4 ) || ( af == PF_INET6 && bytes != 16 ))) { + yyerror("incomplete IP address"); + YYABORT; + } + + $$.self = Connect_AND( + NewBlock(OffsetBGPNexthopv6b, MaskIPv6, IPstack[1] , CMP_EQ, FUNC_NONE, NULL ), + NewBlock(OffsetBGPNexthopv6a, MaskIPv6, IPstack[0] , CMP_EQ, FUNC_NONE, NULL ) + ); + } + + | ROUTER IP STRING { + int af, bytes, ret; + + ret = parse_ip(&af, $3, IPstack, &bytes, STRICT_IP, &num_ip); + + if ( ret == 0 ) { + yyerror("Error parsing IP address."); + YYABORT; + } + + if ( ret == -1 ) { + yyerror("IP address required - hostname not allowed here."); + YYABORT; + } + // ret == -2 will never happen here, as STRICT_IP is set + + if ( af && (( af == PF_INET && bytes != 4 ) || ( af == PF_INET6 && bytes != 16 ))) { + yyerror("incomplete IP address"); + YYABORT; + } + + $$.self = Connect_AND( + NewBlock(OffsetRouterv6b, MaskIPv6, IPstack[1] , CMP_EQ, FUNC_NONE, NULL ), + NewBlock(OffsetRouterv6a, MaskIPv6, IPstack[0] , CMP_EQ, FUNC_NONE, NULL ) + ); + } + + | dqual PORT comp NUMBER { + $$.direction = $1.direction; + if ( $4 > 65535 ) { + yyerror("Port outside of range 0..65535"); + YYABORT; + } + + switch ( $$.direction ) { + case SOURCE: + $$.self = NewBlock(OffsetPort, MaskSrcPort, ($4 << ShiftSrcPort) & MaskSrcPort, $3.comp, FUNC_NONE, NULL ); + break; + case DESTINATION: + $$.self = NewBlock(OffsetPort, MaskDstPort, ($4 << ShiftDstPort) & MaskDstPort, $3.comp, FUNC_NONE, NULL ); + break; + case DIR_UNSPEC: + case SOURCE_OR_DESTINATION: + $$.self = Connect_OR( + NewBlock(OffsetPort, MaskSrcPort, ($4 << ShiftSrcPort) & MaskSrcPort, $3.comp, FUNC_NONE, NULL ), + NewBlock(OffsetPort, MaskDstPort, ($4 << ShiftDstPort) & MaskDstPort, $3.comp, FUNC_NONE, NULL ) + ); + break; + case SOURCE_AND_DESTINATION: + $$.self = Connect_AND( + NewBlock(OffsetPort, MaskSrcPort, ($4 << ShiftSrcPort) & MaskSrcPort, $3.comp, FUNC_NONE, NULL ), + NewBlock(OffsetPort, MaskDstPort, ($4 << ShiftDstPort) & MaskDstPort, $3.comp, FUNC_NONE, NULL ) + ); + break; + case DIR_IN: + case DIR_OUT: + case IN_SRC: + case IN_DST: + case OUT_SRC: + case OUT_DST: + yyerror("This token is not expected here!"); + YYABORT; + break; + default: + /* should never happen */ + yyerror("Internal parser error"); + YYABORT; + } // End switch + + } + + | dqual PORT IN '[' ullist ']' { + struct ULongListNode *node; + ULongtree_t *root = NULL; + + $$.direction = $1.direction; + if ( $$.direction == DIR_UNSPEC || $$.direction == SOURCE_OR_DESTINATION || $$.direction == SOURCE_AND_DESTINATION ) { + // src and/or dst port + // we need a second rbtree due to different shifts for src and dst ports + root = malloc(sizeof(ULongtree_t)); + + struct ULongListNode *n; + if ( root == NULL) { + yyerror("malloc() error"); + YYABORT; + } + RB_INIT(root); + + RB_FOREACH(node, ULongtree, (ULongtree_t *)$5) { + if ((n = malloc(sizeof(struct ULongListNode))) == NULL) { + yyerror("malloc() error"); + YYABORT; + } + n->value = (node->value << ShiftDstPort) & MaskDstPort; + node->value = (node->value << ShiftSrcPort) & MaskSrcPort; + RB_INSERT(ULongtree, root, n); + } + } + + switch ( $$.direction ) { + case SOURCE: + RB_FOREACH(node, ULongtree, (ULongtree_t *)$5) { + node->value = (node->value << ShiftSrcPort) & MaskSrcPort; + } + $$.self = NewBlock(OffsetPort, MaskSrcPort, 0, CMP_ULLIST, FUNC_NONE, (void *)$5 ); + break; + case DESTINATION: + RB_FOREACH(node, ULongtree, (ULongtree_t *)$5) { + node->value = (node->value << ShiftDstPort) & MaskDstPort; + } + $$.self = NewBlock(OffsetPort, MaskDstPort, 0, CMP_ULLIST, FUNC_NONE, (void *)$5 ); + break; + case DIR_UNSPEC: + case SOURCE_OR_DESTINATION: + $$.self = Connect_OR( + NewBlock(OffsetPort, MaskSrcPort, 0, CMP_ULLIST, FUNC_NONE, (void *)$5 ), + NewBlock(OffsetPort, MaskDstPort, 0, CMP_ULLIST, FUNC_NONE, (void *)root ) + ); + break; + case SOURCE_AND_DESTINATION: + $$.self = Connect_AND( + NewBlock(OffsetPort, MaskSrcPort, 0, CMP_ULLIST, FUNC_NONE, (void *)$5 ), + NewBlock(OffsetPort, MaskDstPort, 0, CMP_ULLIST, FUNC_NONE, (void *)root ) + ); + break; + case DIR_IN: + case DIR_OUT: + case IN_SRC: + case IN_DST: + case OUT_SRC: + case OUT_DST: + yyerror("This token is not expected here!"); + YYABORT; + break; + default: + /* should never happen */ + yyerror("Internal parser error"); + YYABORT; + } // End of switch + + } + + | ICMP_TYPE NUMBER { + if ( $2 > 255 ) { + yyerror("ICMP tpye of range 0..15"); + YYABORT; + } + $$.self = Connect_AND( + // imply proto ICMP with a proto ICMP block + Connect_OR ( + NewBlock(OffsetProto, MaskProto, ((uint64_t)IPPROTO_ICMP << ShiftProto) & MaskProto, CMP_EQ, FUNC_NONE, NULL), + NewBlock(OffsetProto, MaskProto, ((uint64_t)IPPROTO_ICMPV6 << ShiftProto) & MaskProto, CMP_EQ, FUNC_NONE, NULL) + ), + NewBlock(OffsetPort, MaskICMPtype, ($2 << ShiftICMPtype) & MaskICMPtype, CMP_EQ, FUNC_NONE, NULL ) + ); + + } + + | ICMP_CODE NUMBER { + if ( $2 > 255 ) { + yyerror("ICMP code of range 0..15"); + YYABORT; + } + $$.self = Connect_AND( + // imply proto ICMP with a proto ICMP block + Connect_OR ( + NewBlock(OffsetProto, MaskProto, ((uint64_t)IPPROTO_ICMP << ShiftProto) & MaskProto, CMP_EQ, FUNC_NONE, NULL), + NewBlock(OffsetProto, MaskProto, ((uint64_t)IPPROTO_ICMPV6 << ShiftProto) & MaskProto, CMP_EQ, FUNC_NONE, NULL) + ), + NewBlock(OffsetPort, MaskICMPcode, ($2 << ShiftICMPcode) & MaskICMPcode, CMP_EQ, FUNC_NONE, NULL ) + ); + + } + + | ENGINE_TYPE comp NUMBER { + if ( $3 > 255 ) { + yyerror("Engine type of range 0..255"); + YYABORT; + } + $$.self = NewBlock(OffsetRouterID, MaskEngineType, ($3 << ShiftEngineType) & MaskEngineType, $2.comp, FUNC_NONE, NULL); + + } + + | ENGINE_ID comp NUMBER { + if ( $3 > 255 ) { + yyerror("Engine ID of range 0..255"); + YYABORT; + } + $$.self = NewBlock(OffsetRouterID, MaskEngineID, ($3 << ShiftEngineID) & MaskEngineID, $2.comp, FUNC_NONE, NULL); + + } + + | dqual AS comp NUMBER { + $$.direction = $1.direction; + if ( $4 > 0x7FFFFFFF || $4 < 0 ) { + yyerror("AS number of range"); + YYABORT; + } + + switch ( $$.direction ) { + case SOURCE: + $$.self = NewBlock(OffsetAS, MaskSrcAS, ($4 << ShiftSrcAS) & MaskSrcAS, $3.comp, FUNC_NONE, NULL ); + break; + case DESTINATION: + $$.self = NewBlock(OffsetAS, MaskDstAS, ($4 << ShiftDstAS) & MaskDstAS, $3.comp, FUNC_NONE, NULL); + break; + case DIR_UNSPEC: + case SOURCE_OR_DESTINATION: + $$.self = Connect_OR( + NewBlock(OffsetAS, MaskSrcAS, ($4 << ShiftSrcAS) & MaskSrcAS, $3.comp, FUNC_NONE, NULL ), + NewBlock(OffsetAS, MaskDstAS, ($4 << ShiftDstAS) & MaskDstAS, $3.comp, FUNC_NONE, NULL) + ); + break; + case SOURCE_AND_DESTINATION: + $$.self = Connect_AND( + NewBlock(OffsetAS, MaskSrcAS, ($4 << ShiftSrcAS) & MaskSrcAS, $3.comp, FUNC_NONE, NULL ), + NewBlock(OffsetAS, MaskDstAS, ($4 << ShiftDstAS) & MaskDstAS, $3.comp, FUNC_NONE, NULL) + ); + break; + case DIR_IN: + case DIR_OUT: + case IN_SRC: + case IN_DST: + case OUT_SRC: + case OUT_DST: + yyerror("This token is not expected here!"); + YYABORT; + break; + default: + /* should never happen */ + yyerror("Internal parser error"); + YYABORT; + } // End of switch + + } + + | dqual AS IN '[' ullist ']' { + struct ULongListNode *node; + ULongtree_t *root = NULL; + + $$.direction = $1.direction; + if ( $$.direction == DIR_UNSPEC || $$.direction == SOURCE_OR_DESTINATION || $$.direction == SOURCE_AND_DESTINATION ) { + // src and/or dst AS + // we need a second rbtree due to different shifts for src and dst AS + root = malloc(sizeof(ULongtree_t)); + + struct ULongListNode *n; + if ( root == NULL) { + yyerror("malloc() error"); + YYABORT; + } + RB_INIT(root); + + RB_FOREACH(node, ULongtree, (ULongtree_t *)$5) { + + if ((n = malloc(sizeof(struct ULongListNode))) == NULL) { + yyerror("malloc() error"); + YYABORT; + } + n->value = (node->value << ShiftDstAS) & MaskDstAS; + node->value = (node->value << ShiftSrcAS) & MaskSrcAS; + RB_INSERT(ULongtree, root, n); + } + } + + switch ( $$.direction ) { + case SOURCE: + RB_FOREACH(node, ULongtree, (ULongtree_t *)$5) { + node->value = (node->value << ShiftSrcAS) & MaskSrcAS; + } + $$.self = NewBlock(OffsetAS, MaskSrcAS, 0, CMP_ULLIST, FUNC_NONE, (void *)$5 ); + break; + case DESTINATION: + RB_FOREACH(node, ULongtree, (ULongtree_t *)$5) { + node->value = (node->value << ShiftDstAS) & MaskDstAS; + } + $$.self = NewBlock(OffsetAS, MaskDstAS, 0, CMP_ULLIST, FUNC_NONE, (void *)$5 ); + break; + case DIR_UNSPEC: + case SOURCE_OR_DESTINATION: + $$.self = Connect_OR( + NewBlock(OffsetAS, MaskSrcAS, 0, CMP_ULLIST, FUNC_NONE, (void *)$5 ), + NewBlock(OffsetAS, MaskDstAS, 0, CMP_ULLIST, FUNC_NONE, (void *)root ) + ); + break; + case SOURCE_AND_DESTINATION: + $$.self = Connect_AND( + NewBlock(OffsetAS, MaskSrcAS, 0, CMP_ULLIST, FUNC_NONE, (void *)$5 ), + NewBlock(OffsetAS, MaskDstAS, 0, CMP_ULLIST, FUNC_NONE, (void *)root ) + ); + break; + case DIR_IN: + case DIR_OUT: + case IN_SRC: + case IN_DST: + case OUT_SRC: + case OUT_DST: + yyerror("This token is not expected here!"); + YYABORT; + break; + default: + /* should never happen */ + yyerror("Internal parser error"); + YYABORT; + } + + } + + | dqual MASK NUMBER { + $$.direction = $1.direction; + if ( $3 > 255 ) { + yyerror("Mask outside of range 0..255"); + YYABORT; + } + + switch ( $$.direction ) { + case SOURCE: + $$.self = NewBlock(OffsetMask, MaskSrcMask, ($3 << ShiftSrcMask) & MaskSrcMask, CMP_EQ, FUNC_NONE, NULL ); + break; + case DESTINATION: + $$.self = NewBlock(OffsetMask, MaskDstMask, ($3 << ShiftDstMask) & MaskDstMask, CMP_EQ, FUNC_NONE, NULL ); + break; + case DIR_UNSPEC: + case SOURCE_OR_DESTINATION: + $$.self = Connect_OR( + NewBlock(OffsetMask, MaskSrcMask, ($3 << ShiftSrcMask) & MaskSrcMask, CMP_EQ, FUNC_NONE, NULL ), + NewBlock(OffsetMask, MaskDstMask, ($3 << ShiftDstMask) & MaskDstMask, CMP_EQ, FUNC_NONE, NULL ) + ); + break; + case SOURCE_AND_DESTINATION: + $$.self = Connect_AND( + NewBlock(OffsetMask, MaskSrcMask, ($3 << ShiftSrcMask) & MaskSrcMask, CMP_EQ, FUNC_NONE, NULL ), + NewBlock(OffsetMask, MaskDstMask, ($3 << ShiftDstMask) & MaskDstMask, CMP_EQ, FUNC_NONE, NULL ) + ); + break; + case DIR_IN: + case DIR_OUT: + case IN_SRC: + case IN_DST: + case OUT_SRC: + case OUT_DST: + yyerror("This token is not expected here!"); + YYABORT; + break; + default: + /* should never happen */ + yyerror("Internal parser error"); + YYABORT; + } // End switch + + } + + | dqual NET STRING STRING { + int af, bytes, ret; + uint64_t mask[2]; + ret = parse_ip(&af, $3, IPstack, &bytes, STRICT_IP, &num_ip); + + if ( ret == 0 ) { + yyerror("Invalid IP address"); + YYABORT; + } + + if ( ret == -1 ) { + yyerror("IP address required - hostname not allowed here."); + YYABORT; + } + // ret == -2 will never happen here, as STRICT_IP is set + + if ( af != PF_INET ) { + yyerror("IP netmask syntax valid only for IPv4"); + YYABORT; + } + if ( bytes != 4 ) { + yyerror("Need complete IP address"); + YYABORT; + } + + ret = parse_ip(&af, $4, mask, &bytes, STRICT_IP, &num_ip); + if ( ret == 0 ) { + yyerror("Invalid IP address"); + YYABORT; + } + if ( ret == -1 ) { + yyerror("IP address required - hostname not allowed here."); + YYABORT; + } + // ret == -2 will never happen here, as STRICT_IP is set + + if ( af != PF_INET || bytes != 4 ) { + yyerror("Invalid netmask for IPv4 address"); + YYABORT; + } + + IPstack[0] &= mask[0]; + IPstack[1] &= mask[1]; + + $$.direction = $1.direction; + + switch ( $$.direction ) { + case SOURCE: + $$.self = Connect_AND( + NewBlock(OffsetSrcIPv6b, mask[1], IPstack[1] , CMP_EQ, FUNC_NONE, NULL ), + NewBlock(OffsetSrcIPv6a, mask[0], IPstack[0] , CMP_EQ, FUNC_NONE, NULL ) + ); + break; + case DESTINATION: + $$.self = Connect_AND( + NewBlock(OffsetDstIPv6b, mask[1], IPstack[1] , CMP_EQ, FUNC_NONE, NULL ), + NewBlock(OffsetDstIPv6a, mask[0], IPstack[0] , CMP_EQ, FUNC_NONE, NULL ) + ); + break; + case DIR_UNSPEC: + case SOURCE_OR_DESTINATION: + $$.self = Connect_OR( + Connect_AND( + NewBlock(OffsetSrcIPv6b, mask[1], IPstack[1] , CMP_EQ, FUNC_NONE, NULL ), + NewBlock(OffsetSrcIPv6a, mask[0], IPstack[0] , CMP_EQ, FUNC_NONE, NULL ) + ), + Connect_AND( + NewBlock(OffsetDstIPv6b, mask[1], IPstack[1] , CMP_EQ, FUNC_NONE, NULL ), + NewBlock(OffsetDstIPv6a, mask[0], IPstack[0] , CMP_EQ, FUNC_NONE, NULL ) + ) + ); + break; + case SOURCE_AND_DESTINATION: + $$.self = Connect_AND( + Connect_AND( + NewBlock(OffsetSrcIPv6b, mask[1], IPstack[1] , CMP_EQ, FUNC_NONE, NULL ), + NewBlock(OffsetSrcIPv6a, mask[0], IPstack[0] , CMP_EQ, FUNC_NONE, NULL ) + ), + Connect_AND( + NewBlock(OffsetDstIPv6b, mask[1], IPstack[1] , CMP_EQ, FUNC_NONE, NULL ), + NewBlock(OffsetDstIPv6a, mask[0], IPstack[0] , CMP_EQ, FUNC_NONE, NULL ) + ) + ); + break; + case DIR_IN: + case DIR_OUT: + case IN_SRC: + case IN_DST: + case OUT_SRC: + case OUT_DST: + yyerror("This token is not expected here!"); + YYABORT; + break; + default: + /* should never happen */ + yyerror("Internal parser error"); + YYABORT; + } // End of switch + + } + + | dqual NET STRING '/' NUMBER { + int af, bytes, ret; + uint64_t mask[2]; + + ret = parse_ip(&af, $3, IPstack, &bytes, STRICT_IP, &num_ip); + if ( ret == 0 ) { + yyerror("Invalid IP address"); + YYABORT; + } + if ( ret == -1 ) { + yyerror("IP address required - hostname not allowed here."); + YYABORT; + } + // ret == -2 will never happen here, as STRICT_IP is set + + + if ( $5 > (bytes*8) ) { + yyerror("Too many netbits for this IP addresss"); + YYABORT; + } + + if ( af == PF_INET ) { + mask[0] = 0xffffffffffffffffLL; + mask[1] = 0xffffffffffffffffLL << ( 32 - $5 ); + } else { // PF_INET6 + if ( $5 > 64 ) { + mask[0] = 0xffffffffffffffffLL; + mask[1] = 0xffffffffffffffffLL << ( 128 - $5 ); + } else { + mask[0] = 0xffffffffffffffffLL << ( 64 - $5 ); + mask[1] = 0; + } + } + // IP aadresses are stored in network representation + mask[0] = mask[0]; + mask[1] = mask[1]; + + IPstack[0] &= mask[0]; + IPstack[1] &= mask[1]; + + $$.direction = $1.direction; + switch ( $$.direction ) { + case SOURCE: + $$.self = Connect_AND( + NewBlock(OffsetSrcIPv6b, mask[1], IPstack[1] , CMP_EQ, FUNC_NONE, NULL ), + NewBlock(OffsetSrcIPv6a, mask[0], IPstack[0] , CMP_EQ, FUNC_NONE, NULL ) + ); + break; + case DESTINATION: + $$.self = Connect_AND( + NewBlock(OffsetDstIPv6b, mask[1], IPstack[1] , CMP_EQ, FUNC_NONE, NULL ), + NewBlock(OffsetDstIPv6a, mask[0], IPstack[0] , CMP_EQ, FUNC_NONE, NULL ) + ); + break; + case DIR_UNSPEC: + case SOURCE_OR_DESTINATION: + $$.self = Connect_OR( + Connect_AND( + NewBlock(OffsetSrcIPv6b, mask[1], IPstack[1] , CMP_EQ, FUNC_NONE, NULL ), + NewBlock(OffsetSrcIPv6a, mask[0], IPstack[0] , CMP_EQ, FUNC_NONE, NULL ) + ), + Connect_AND( + NewBlock(OffsetDstIPv6b, mask[1], IPstack[1] , CMP_EQ, FUNC_NONE, NULL ), + NewBlock(OffsetDstIPv6a, mask[0], IPstack[0] , CMP_EQ, FUNC_NONE, NULL ) + ) + ); + break; + case SOURCE_AND_DESTINATION: + $$.self = Connect_AND( + Connect_AND( + NewBlock(OffsetSrcIPv6b, mask[1], IPstack[1] , CMP_EQ, FUNC_NONE, NULL ), + NewBlock(OffsetSrcIPv6a, mask[0], IPstack[0] , CMP_EQ, FUNC_NONE, NULL ) + ), + Connect_AND( + NewBlock(OffsetDstIPv6b, mask[1], IPstack[1] , CMP_EQ, FUNC_NONE, NULL ), + NewBlock(OffsetDstIPv6a, mask[0], IPstack[0] , CMP_EQ, FUNC_NONE, NULL ) + ) + ); + break; + case DIR_IN: + case DIR_OUT: + case IN_SRC: + case IN_DST: + case OUT_SRC: + case OUT_DST: + yyerror("This token is not expected here!"); + YYABORT; + break; + default: + /* should never happen */ + yyerror("Internal parser error"); + YYABORT; + } // End of switch + + } + + | dqual IF NUMBER { + if ( $3 > 65535 ) { + yyerror("Input interface number must be 0..65535"); + YYABORT; + } + + switch ( $$.direction ) { + case DIR_UNSPEC: + $$.self = Connect_OR( + NewBlock(OffsetInOut, MaskInput, ($3 << ShiftInput) & MaskInput, CMP_EQ, FUNC_NONE, NULL), + NewBlock(OffsetInOut, MaskOutput, ($3 << ShiftOutput) & MaskOutput, CMP_EQ, FUNC_NONE, NULL) + ); + break; + case DIR_IN: + $$.self = NewBlock(OffsetInOut, MaskInput, ($3 << ShiftInput) & MaskInput, CMP_EQ, FUNC_NONE, NULL); + break; + case DIR_OUT: + $$.self = NewBlock(OffsetInOut, MaskOutput, ($3 << ShiftOutput) & MaskOutput, CMP_EQ, FUNC_NONE, NULL); + break; + case SOURCE: + case DESTINATION: + case SOURCE_OR_DESTINATION: + case SOURCE_AND_DESTINATION: + case IN_SRC: + case IN_DST: + case OUT_SRC: + case OUT_DST: + yyerror("This token is not expected here!"); + YYABORT; + break; + default: + /* should never happen */ + yyerror("Internal parser error"); + YYABORT; + } // End of switch + + } + + | dqual VLAN NUMBER { + $$.direction = $1.direction; + if ( $3 > 65535 || $3 < 0 ) { + yyerror("VLAN number of range 0..65535"); + YYABORT; + } + + switch ( $$.direction ) { + case SOURCE: + $$.self = NewBlock(OffsetVlan, MaskSrcVlan, ($3 << ShiftSrcVlan) & MaskSrcVlan, CMP_EQ, FUNC_NONE, NULL ); + break; + case DESTINATION: + $$.self = NewBlock(OffsetVlan, MaskDstVlan, ($3 << ShiftDstVlan) & MaskDstVlan, CMP_EQ, FUNC_NONE, NULL); + break; + case DIR_UNSPEC: + case SOURCE_OR_DESTINATION: + $$.self = Connect_OR( + NewBlock(OffsetVlan, MaskSrcVlan, ($3 << ShiftSrcVlan) & MaskSrcVlan, CMP_EQ, FUNC_NONE, NULL ), + NewBlock(OffsetVlan, MaskDstVlan, ($3 << ShiftDstVlan) & MaskDstVlan, CMP_EQ, FUNC_NONE, NULL) + ); + break; + case SOURCE_AND_DESTINATION: + $$.self = Connect_AND( + NewBlock(OffsetVlan, MaskSrcVlan, ($3 << ShiftSrcVlan) & MaskSrcVlan, CMP_EQ, FUNC_NONE, NULL ), + NewBlock(OffsetVlan, MaskDstVlan, ($3 << ShiftDstVlan) & MaskDstVlan, CMP_EQ, FUNC_NONE, NULL) + ); + break; + case DIR_IN: + case DIR_OUT: + case IN_SRC: + case IN_DST: + case OUT_SRC: + case OUT_DST: + yyerror("This token is not expected here!"); + YYABORT; + break; + default: + /* should never happen */ + yyerror("Internal parser error"); + YYABORT; + } // End of switch + + } + + | dqual MAC STRING { + uint64_t mac = VerifyMac($3); + if ( mac == 0 ) { + yyerror("Invalid MAC address format"); + YYABORT; + } + switch ( $$.direction ) { + case DIR_UNSPEC: { + uint32_t in, out; + in = Connect_OR( + NewBlock(OffsetInSrcMAC, MaskMac, mac, CMP_EQ, FUNC_NONE, NULL ), + NewBlock(OffsetInDstMAC, MaskMac, mac, CMP_EQ, FUNC_NONE, NULL ) + ); + out = Connect_OR( + NewBlock(OffsetOutSrcMAC, MaskMac, mac, CMP_EQ, FUNC_NONE, NULL ), + NewBlock(OffsetOutDstMAC, MaskMac, mac, CMP_EQ, FUNC_NONE, NULL ) + ); + $$.self = Connect_OR(in, out); + } break; + case DIR_IN: + $$.self = Connect_OR( + NewBlock(OffsetInSrcMAC, MaskMac, mac, CMP_EQ, FUNC_NONE, NULL ), + NewBlock(OffsetInDstMAC, MaskMac, mac, CMP_EQ, FUNC_NONE, NULL ) + ); + break; + case DIR_OUT: + $$.self = Connect_OR( + NewBlock(OffsetOutSrcMAC, MaskMac, mac, CMP_EQ, FUNC_NONE, NULL ), + NewBlock(OffsetOutDstMAC, MaskMac, mac, CMP_EQ, FUNC_NONE, NULL ) + ); + break; + case SOURCE: + $$.self = Connect_OR( + NewBlock(OffsetInSrcMAC, MaskMac, mac, CMP_EQ, FUNC_NONE, NULL ), + NewBlock(OffsetOutSrcMAC, MaskMac, mac, CMP_EQ, FUNC_NONE, NULL ) + ); + break; + case DESTINATION: + $$.self = Connect_OR( + NewBlock(OffsetInDstMAC, MaskMac, mac, CMP_EQ, FUNC_NONE, NULL ), + NewBlock(OffsetOutDstMAC, MaskMac, mac, CMP_EQ, FUNC_NONE, NULL ) + ); + break; + case IN_SRC: + $$.self = NewBlock(OffsetInSrcMAC, MaskMac, mac, CMP_EQ, FUNC_NONE, NULL ); + break; + case IN_DST: + $$.self = NewBlock(OffsetInDstMAC, MaskMac, mac, CMP_EQ, FUNC_NONE, NULL ); + break; + case OUT_SRC: + $$.self = NewBlock(OffsetOutSrcMAC, MaskMac, mac, CMP_EQ, FUNC_NONE, NULL ); + break; + case OUT_DST: + $$.self = NewBlock(OffsetOutDstMAC, MaskMac, mac, CMP_EQ, FUNC_NONE, NULL ); + break; + case SOURCE_OR_DESTINATION: + case SOURCE_AND_DESTINATION: + yyerror("This token is not expected here!"); + YYABORT; + break; + default: + /* should never happen */ + yyerror("Internal parser error"); + YYABORT; + } // End of switch + } + + | MPLS STRING comp NUMBER { + if ( $4 > MPLSMAX ) { + yyerror("MPLS value out of range"); + YYABORT; + } + + // search for label1 - label10 + if ( strncasecmp($2, "label", 5) == 0 ) { + uint64_t mask; + uint32_t offset, shift; + char *s = &$2[5]; + if ( s == '\0' ) { + yyerror("Missing label number"); + YYABORT; + } + int i = (int)strtol(s, (char **)NULL, 10); + + switch (i) { + case 1: + offset = OffsetMPLS12; + mask = MaskMPLSlabelOdd; + shift = ShiftMPLSlabelOdd; + break; + case 2: + offset = OffsetMPLS12; + mask = MaskMPLSlabelEven; + shift = ShiftMPLSlabelEven; + break; + case 3: + offset = OffsetMPLS34; + mask = MaskMPLSlabelOdd; + shift = ShiftMPLSlabelOdd; + break; + case 4: + offset = OffsetMPLS34; + mask = MaskMPLSlabelEven; + shift = ShiftMPLSlabelEven; + break; + case 5: + offset = OffsetMPLS56; + mask = MaskMPLSlabelOdd; + shift = ShiftMPLSlabelOdd; + break; + case 6: + offset = OffsetMPLS56; + mask = MaskMPLSlabelEven; + shift = ShiftMPLSlabelEven; + break; + case 7: + offset = OffsetMPLS78; + mask = MaskMPLSlabelOdd; + shift = ShiftMPLSlabelOdd; + break; + case 8: + offset = OffsetMPLS78; + mask = MaskMPLSlabelEven; + shift = ShiftMPLSlabelEven; + break; + case 9: + offset = OffsetMPLS910; + mask = MaskMPLSlabelOdd; + shift = ShiftMPLSlabelOdd; + break; + case 10: + offset = OffsetMPLS910; + mask = MaskMPLSlabelEven; + shift = ShiftMPLSlabelEven; + break; + default: + yyerror("MPLS label out of range 1..10"); + YYABORT; + } + $$.self = NewBlock(offset, mask, ($4 << shift) & mask, $3.comp, FUNC_NONE, NULL ); + + } else if ( strcasecmp($2, "eos") == 0 ) { + // match End of Stack label + $$.self = NewBlock(0, AnyMask, $4 << 4, $3.comp, FUNC_MPLS_EOS, NULL ); + + } else if ( strncasecmp($2, "exp", 3) == 0 ) { + uint64_t mask; + uint32_t offset, shift; + char *s = &$2[3]; + if ( s == '\0' ) { + yyerror("Missing label number"); + YYABORT; + } + int i = (int)strtol(s, (char **)NULL, 10); + + if ( $4 < 0 || $4 > 7 ) { + yyerror("MPLS exp value out of range"); + YYABORT; + } + + switch (i) { + case 1: + offset = OffsetMPLS12; + mask = MaskMPLSexpOdd; + shift = ShiftMPLSexpOdd; + break; + case 2: + offset = OffsetMPLS12; + mask = MaskMPLSexpEven; + shift = ShiftMPLSexpEven; + break; + case 3: + offset = OffsetMPLS34; + mask = MaskMPLSexpOdd; + shift = ShiftMPLSexpOdd; + break; + case 4: + offset = OffsetMPLS34; + mask = MaskMPLSexpEven; + shift = ShiftMPLSexpEven; + break; + case 5: + offset = OffsetMPLS56; + mask = MaskMPLSexpOdd; + shift = ShiftMPLSexpOdd; + break; + case 6: + offset = OffsetMPLS56; + mask = MaskMPLSexpEven; + shift = ShiftMPLSexpEven; + break; + case 7: + offset = OffsetMPLS78; + mask = MaskMPLSexpOdd; + shift = ShiftMPLSexpOdd; + break; + case 8: + offset = OffsetMPLS78; + mask = MaskMPLSexpEven; + shift = ShiftMPLSexpEven; + break; + case 9: + offset = OffsetMPLS910; + mask = MaskMPLSexpOdd; + shift = ShiftMPLSexpOdd; + break; + case 10: + offset = OffsetMPLS910; + mask = MaskMPLSexpEven; + shift = ShiftMPLSexpEven; + break; + default: + yyerror("MPLS label out of range 1..10"); + YYABORT; + } + $$.self = NewBlock(offset, mask, $4 << shift, $3.comp, FUNC_NONE, NULL ); + + } else { + yyerror("Unknown MPLS option"); + YYABORT; + } + } + | MPLS ANY NUMBER { + uint32_t *opt = malloc(sizeof(uint32_t)); + if ( $3 > MPLSMAX ) { + yyerror("MPLS value out of range"); + YYABORT; + } + if ( opt == NULL) { + yyerror("malloc() error"); + YYABORT; + } + *opt = $3 << 4; + $$.self = NewBlock(0, AnyMask, $3 << 4, CMP_EQ, FUNC_MPLS_ANY, opt ); + + } + | FWDSTAT NUMBER { + if ( $2 > 255 ) { + yyerror("Forwarding status of range 0..255"); + YYABORT; + } + $$.self = NewBlock(OffsetStatus, MaskStatus, ($2 << ShiftStatus) & MaskStatus, CMP_EQ, FUNC_NONE, NULL); + } + + | FWDSTAT STRING { + uint64_t id = Get_fwd_status_id($2); + if (id == 256 ) { + yyerror("Unknown forwarding status"); + YYABORT; + } + + $$.self = NewBlock(OffsetStatus, MaskStatus, (id << ShiftStatus) & MaskStatus, CMP_EQ, FUNC_NONE, NULL); + + } + + | DIR NUMBER { + if ( $2 > 2 ) { + yyerror("Flow direction status of range 0, 1"); + YYABORT; + } + $$.self = NewBlock(OffsetDir, MaskDir, ($2 << ShiftDir) & MaskDir, CMP_EQ, FUNC_NONE, NULL); + + } + + | DIR STRING { + uint64_t dir = 0xFF; + if ( strcasecmp($2, "ingress") == 0 ) + dir = 0; + else if ( strcasecmp($2, "egress") == 0 ) + dir = 1; + else { + yyerror("Flow direction status of range ingress, egress"); + YYABORT; + } + + $$.self = NewBlock(OffsetDir, MaskDir, (dir << ShiftDir) & MaskDir, CMP_EQ, FUNC_NONE, NULL); + + } + +/* iplist definition */ +iplist: STRING { + int i, af, bytes, ret; + struct IPListNode *node; + + IPlist_t *root = malloc(sizeof(IPlist_t)); + + if ( root == NULL) { + yyerror("malloc() error"); + YYABORT; + } + RB_INIT(root); + + ret = parse_ip(&af, $1, IPstack, &bytes, ALLOW_LOOKUP, &num_ip); + + if ( ret == 0 ) { + yyerror("Invalid IP address"); + YYABORT; + } + // ret == -1 will never happen here, as ALLOW_LOOKUP is set + + if ( ret != -2 ) { + if ( af && (( af == PF_INET && bytes != 4 ) || ( af == PF_INET6 && bytes != 16 ))) { + yyerror("incomplete IP address"); + YYABORT; + } + + for ( i=0; iip[0] = IPstack[2*i]; + node->ip[1] = IPstack[2*i+1]; + node->mask[0] = 0xffffffffffffffffLL; + node->mask[1] = 0xffffffffffffffffLL; + RB_INSERT(IPtree, root, node); + } + + } + $$ = (void *)root; + + } + +iplist: STRING '/' NUMBER { + int af, bytes, ret; + struct IPListNode *node; + + IPlist_t *root = malloc(sizeof(IPlist_t)); + + if ( root == NULL) { + yyerror("malloc() error"); + YYABORT; + } + RB_INIT(root); + + ret = parse_ip(&af, $1, IPstack, &bytes, STRICT_IP, &num_ip); + + if ( ret == 0 ) { + yyerror("Invalid IP address"); + YYABORT; + } + // ret == -1 will never happen here, as ALLOW_LOOKUP is set + + if ( ret != -2 ) { + if ( af && (( af == PF_INET && bytes != 4 ) || ( af == PF_INET6 && bytes != 16 ))) { + yyerror("incomplete IP address"); + YYABORT; + } + + if ((node = malloc(sizeof(struct IPListNode))) == NULL) { + yyerror("malloc() error"); + YYABORT; + } + + if ( af == PF_INET ) { + node->mask[0] = 0xffffffffffffffffLL; + node->mask[1] = 0xffffffffffffffffLL << ( 32 - $3 ); + } else { // PF_INET6 + if ( $3 > 64 ) { + node->mask[0] = 0xffffffffffffffffLL; + node->mask[1] = 0xffffffffffffffffLL << ( 128 - $3 ); + } else { + node->mask[0] = 0xffffffffffffffffLL << ( 64 - $3 ); + node->mask[1] = 0; + } + } + + node->ip[0] = IPstack[0] & node->mask[0]; + node->ip[1] = IPstack[1] & node->mask[1]; + + RB_INSERT(IPtree, root, node); + + } + $$ = (void *)root; + + } + + | iplist STRING { + int i, af, bytes, ret; + struct IPListNode *node; + + ret = parse_ip(&af, $2, IPstack, &bytes, ALLOW_LOOKUP, &num_ip); + + if ( ret == 0 ) { + yyerror("Invalid IP address"); + YYABORT; + } + if ( af && (( af == PF_INET && bytes != 4 ) || ( af == PF_INET6 && bytes != 16 ))) { + yyerror("incomplete IP address"); + YYABORT; + } + + // ret == - 2 means lookup failure + if ( ret != -2 ) { + for ( i=0; iip[0] = IPstack[2*i]; + node->ip[1] = IPstack[2*i+1]; + node->mask[0] = 0xffffffffffffffffLL; + node->mask[1] = 0xffffffffffffffffLL; + + RB_INSERT(IPtree, (IPlist_t *)$$, node); + } + } + } + + | iplist STRING '/' NUMBER { + int af, bytes, ret; + struct IPListNode *node; + + ret = parse_ip(&af, $2, IPstack, &bytes, STRICT_IP, &num_ip); + + if ( ret == 0 ) { + yyerror("Invalid IP address"); + YYABORT; + } + if ( af && (( af == PF_INET && bytes != 4 ) || ( af == PF_INET6 && bytes != 16 ))) { + yyerror("incomplete IP address"); + YYABORT; + } + + // ret == - 2 means lookup failure + if ( ret != -2 ) { + if ((node = malloc(sizeof(struct IPListNode))) == NULL) { + yyerror("malloc() error"); + YYABORT; + } + if ( af == PF_INET ) { + node->mask[0] = 0xffffffffffffffffLL; + node->mask[1] = 0xffffffffffffffffLL << ( 32 - $4 ); + } else { // PF_INET6 + if ( $4 > 64 ) { + node->mask[0] = 0xffffffffffffffffLL; + node->mask[1] = 0xffffffffffffffffLL << ( 128 - $4 ); + } else { + node->mask[0] = 0xffffffffffffffffLL << ( 64 - $4 ); + node->mask[1] = 0; + } + } + + node->ip[0] = IPstack[0] & node->mask[0]; + node->ip[1] = IPstack[1] & node->mask[1]; + + RB_INSERT(IPtree, (IPlist_t *)$$, node); + } + } + + ; + +/* ULlist definition */ +ullist: NUMBER { + struct ULongListNode *node; + + if ( $1 > 65535 ) { + yyerror("Value outside of range 0..65535"); + YYABORT; + } + ULongtree_t *root = malloc(sizeof(ULongtree_t)); + + if ( root == NULL) { + yyerror("malloc() error"); + YYABORT; + } + RB_INIT(root); + + if ((node = malloc(sizeof(struct ULongListNode))) == NULL) { + yyerror("malloc() error"); + YYABORT; + } + node->value = $1; + + RB_INSERT(ULongtree, root, node); + $$ = (void *)root; + } + | ullist NUMBER { + struct ULongListNode *node; + + if ( $2 > 65535 ) { + yyerror("Value outside of range 0..65535"); + YYABORT; + } + if ((node = malloc(sizeof(struct ULongListNode))) == NULL) { + yyerror("malloc() error"); + YYABORT; + } + node->value = $2; + RB_INSERT(ULongtree, (ULongtree_t *)$$, node); + } + ; + +/* scaling qualifiers */ + +/* comparator qualifiers */ +comp: { $$.comp = CMP_EQ; } + | EQ { $$.comp = CMP_EQ; } + | LT { $$.comp = CMP_LT; } + | GT { $$.comp = CMP_GT; } + ; + +/* 'direction' qualifiers */ +dqual: { $$.direction = DIR_UNSPEC; } + | SRC { $$.direction = SOURCE; } + | DST { $$.direction = DESTINATION; } + | SRC OR DST { $$.direction = SOURCE_OR_DESTINATION; } + | DST OR SRC { $$.direction = SOURCE_OR_DESTINATION; } + | SRC AND DST { $$.direction = SOURCE_AND_DESTINATION; } + | DST AND SRC { $$.direction = SOURCE_AND_DESTINATION; } + | IN { $$.direction = DIR_IN; } + | OUT { $$.direction = DIR_OUT; } + | IN SRC { $$.direction = IN_SRC; } + | IN DST { $$.direction = IN_DST; } + | OUT SRC { $$.direction = OUT_SRC; } + | OUT DST { $$.direction = OUT_DST; } + ; + +expr: term { $$ = $1.self; } + | expr OR expr { $$ = Connect_OR($1, $3); } + | expr AND expr { $$ = Connect_AND($1, $3); } + | NOT expr %prec NEGATE { $$ = Invert($2); } + | '(' expr ')' { $$ = $2; } + ; + +%% + +static void yyerror(char *msg) { + if ( FilterFilename ) + fprintf(stderr,"File '%s' line %d: %s at '%s'\n", FilterFilename, lineno, msg, yytext); + else + fprintf(stderr,"Line %d: %s at '%s'\n", lineno, msg, yytext); +} /* End of yyerror */ + +static uint32_t ChainHosts(uint64_t *hostlist, int num_records, int type) { +uint32_t offset_a, offset_b, i, j, block; + + if ( type == SOURCE ) { + offset_a = OffsetSrcIPv6a; + offset_b = OffsetSrcIPv6b; + } else { + offset_a = OffsetDstIPv6a; + offset_b = OffsetDstIPv6b; + } + + i = 0; + block = Connect_AND( + NewBlock(offset_b, MaskIPv6, hostlist[i+1] , CMP_EQ, FUNC_NONE, NULL ), + NewBlock(offset_a, MaskIPv6, hostlist[i] , CMP_EQ, FUNC_NONE, NULL ) + ); + i += 2; + for ( j=1; j 17 ) + return 0; + + for (i=0; i 255 ) { + free(p); + return 0; + } + + mac = ( mac << 8 ) | (l & 0xFF ); + i++; + + if ( q ) { + r = ++q; + q = strchr(r, ':'); + } else + r = NULL; + } + + if ( i != 6 ) + return 0; + + return mac; + +} // End of VerifyMac + +/* + +mpls 1 == 3 +mpls label1 == 3 +mpls any == 4 + + + + + */ diff --git a/bin/heapsort_inline.c b/bin/heapsort_inline.c new file mode 100755 index 0000000..ba6b334 --- /dev/null +++ b/bin/heapsort_inline.c @@ -0,0 +1,91 @@ +/* + * Copyright (c) 2014, Peter Haag + * Copyright (c) 2009, Peter Haag + * Copyright (c) 2004-2008, SWITCH - Teleinformatikdienste fuer Lehre und Forschung + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of the author nor the names of its contributors may be + * used to endorse or promote products derived from this software without + * specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 COPYRIGHT OWNER 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. + * + * $Author: haag $ + * + * $Id: heapsort_inline.c 39 2009-11-25 08:11:15Z haag $ + * + * $LastChangedRevision: 39 $ + * + */ + +static void heapSort(SortElement_t *SortElement, uint32_t array_size, int topN); + +static inline void siftDown(SortElement_t *SortElement, uint32_t root, uint32_t bottom); + +static void heapSort(SortElement_t *SortElement, uint32_t array_size, int topN) { +int32_t i, maxindex; + + for(i = array_size - 1; i >= 0; i--) + siftDown(SortElement,array_size,i); + + /* + * we are only interested in the first top N => skip sorting the rest + * For topN == 0 -> all flows gets sorted + */ + if ( (topN >= (array_size - 1)) || topN == 0 ) + maxindex = 0; + else + maxindex = array_size - 1 - topN; + + for(i = array_size-1; i > maxindex; i-- ) { + SortElement_t temp = SortElement[0]; + SortElement[0] = SortElement[i]; + SortElement[i] = temp; + siftDown(SortElement,i,0); + } + +} // End of heapSort + +static inline void siftDown(SortElement_t *SortElement, uint32_t numbersSize, uint32_t node) { +uint32_t i, parent, child; + + parent = node; + i = parent + 1; + while( i != parent ) { + i = parent; + + // Compare with left child node + child = 2*i+1; + if( (child) < numbersSize && SortElement[child].count > SortElement[parent].count) + parent = child; + + // Compare with right child node + child = 2*i+2; + if( (child) < numbersSize && SortElement[child].count > SortElement[parent].count) + parent = child; + + if ( i != parent ) { + SortElement_t temp = SortElement[i]; + SortElement[i] = SortElement[parent]; + SortElement[parent] = temp; + } + } +} // End of siftDown diff --git a/bin/inline.c b/bin/inline.c new file mode 100644 index 0000000..3eb5c71 --- /dev/null +++ b/bin/inline.c @@ -0,0 +1,334 @@ +/* + * Copyright (c) 2014, Peter Haag + * Copyright (c) 2009, Peter Haag + * Copyright (c) 2004-2008, SWITCH - Teleinformatikdienste fuer Lehre und Forschung + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of the author nor the names of its contributors may be + * used to endorse or promote products derived from this software without + * specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 COPYRIGHT OWNER 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. + * + * $Author: haag $ + * + * $Id: inline.c 40 2009-12-16 10:41:44Z haag $ + * + * $LastChangedRevision: 40 $ + * + */ + +static inline uint16_t Get_val16(void *p); + +static inline uint32_t Get_val24(void *p); + +static inline uint32_t Get_val32(void *p); + +static inline uint64_t Get_val40(void *p); + +static inline uint64_t Get_val48(void *p); + +static inline uint64_t Get_val56(void *p); + +static inline uint64_t Get_val64(void *p); + +static inline void Put_val16(uint16_t v, void *p); + +static inline void Put_val24(uint32_t v, void *p); + +static inline void Put_val32(uint32_t v, void *p); + +// static inline void Put_val40(uint64_t v, void *p); + +static inline void Put_val48(uint64_t v, void *p); + +// static inline void Put_val56(uint64_t v, void *p); + +static inline void Put_val64(uint64_t v, void *p); + +static inline uint16_t Get_val16(void *p) { +uint8_t *in = (uint8_t *)p; +type_mask_t mask; + +#ifdef WORDS_BIGENDIAN + mask.val.val8[0] = in[0]; + mask.val.val8[1] = in[1]; +#else + mask.val.val8[0] = in[1]; + mask.val.val8[1] = in[0]; +#endif + return mask.val.val16[0]; + +} // End of Get_val16 + +static inline uint32_t Get_val24(void *p) { +uint8_t *in = (uint8_t *)p; +type_mask_t mask; + +#ifdef WORDS_BIGENDIAN + mask.val.val8[0] = 0; + mask.val.val8[1] = in[0]; + mask.val.val8[2] = in[1]; + mask.val.val8[3] = in[2]; +#else + mask.val.val8[0] = in[2]; + mask.val.val8[1] = in[1]; + mask.val.val8[2] = in[0]; + mask.val.val8[3] = 0; +#endif + return mask.val.val32[0]; + +} // End of Get_val24 + +static inline uint32_t Get_val32(void *p) { +uint8_t *in = (uint8_t *)p; +type_mask_t mask; + +#ifdef WORDS_BIGENDIAN + mask.val.val8[0] = in[0]; + mask.val.val8[1] = in[1]; + mask.val.val8[2] = in[2]; + mask.val.val8[3] = in[3]; +#else + mask.val.val8[0] = in[3]; + mask.val.val8[1] = in[2]; + mask.val.val8[2] = in[1]; + mask.val.val8[3] = in[0]; +#endif + + return mask.val.val32[0]; + +} // End of Get_val32 + +static inline uint64_t Get_val40(void *p) { +uint8_t *in = (uint8_t *)p; +type_mask_t mask; + +#ifdef WORDS_BIGENDIAN + mask.val.val8[0] = 0; + mask.val.val8[1] = 0; + mask.val.val8[2] = 0; + mask.val.val8[3] = in[0]; + mask.val.val8[4] = in[1]; + mask.val.val8[5] = in[2]; + mask.val.val8[6] = in[3]; + mask.val.val8[7] = in[4]; +#else + mask.val.val8[0] = in[4]; + mask.val.val8[1] = in[3]; + mask.val.val8[2] = in[2]; + mask.val.val8[3] = in[1]; + mask.val.val8[4] = in[0]; + mask.val.val8[5] = 0; + mask.val.val8[6] = 0; + mask.val.val8[7] = 0; +#endif + + return mask.val.val64; + +} // End of Get_val40 + +static inline uint64_t Get_val48(void *p) { +uint8_t *in = (uint8_t *)p; +type_mask_t mask; + +#ifdef WORDS_BIGENDIAN + mask.val.val8[0] = 0; + mask.val.val8[1] = 0; + mask.val.val8[2] = in[0]; + mask.val.val8[3] = in[1]; + mask.val.val8[4] = in[2]; + mask.val.val8[5] = in[3]; + mask.val.val8[6] = in[4]; + mask.val.val8[7] = in[5]; +#else + mask.val.val8[0] = in[5]; + mask.val.val8[1] = in[4]; + mask.val.val8[2] = in[3]; + mask.val.val8[3] = in[2]; + mask.val.val8[4] = in[1]; + mask.val.val8[5] = in[0]; + mask.val.val8[6] = 0; + mask.val.val8[7] = 0; +#endif + + return mask.val.val64; + +} // End of Get_val48 + +static inline uint64_t Get_val56(void *p) { +uint8_t *in = (uint8_t *)p; +type_mask_t mask; + +#ifdef WORDS_BIGENDIAN + mask.val.val8[0] = 0; + mask.val.val8[1] = in[0]; + mask.val.val8[2] = in[1]; + mask.val.val8[3] = in[2]; + mask.val.val8[4] = in[3]; + mask.val.val8[5] = in[4]; + mask.val.val8[6] = in[5]; + mask.val.val8[7] = in[6]; +#else + mask.val.val8[0] = in[6]; + mask.val.val8[1] = in[5]; + mask.val.val8[2] = in[4]; + mask.val.val8[3] = in[3]; + mask.val.val8[4] = in[2]; + mask.val.val8[5] = in[1]; + mask.val.val8[6] = in[0]; + mask.val.val8[7] = 0; +#endif + + return mask.val.val64; + +} // End of Get_val56 + +static inline uint64_t Get_val64(void *p) { +uint8_t *in = (uint8_t *)p; +type_mask_t mask; + +#ifdef WORDS_BIGENDIAN + mask.val.val8[0] = in[0]; + mask.val.val8[1] = in[1]; + mask.val.val8[2] = in[2]; + mask.val.val8[3] = in[3]; + mask.val.val8[4] = in[4]; + mask.val.val8[5] = in[5]; + mask.val.val8[6] = in[6]; + mask.val.val8[7] = in[7]; +#else + mask.val.val8[0] = in[7]; + mask.val.val8[1] = in[6]; + mask.val.val8[2] = in[5]; + mask.val.val8[3] = in[4]; + mask.val.val8[4] = in[3]; + mask.val.val8[5] = in[2]; + mask.val.val8[6] = in[1]; + mask.val.val8[7] = in[0]; +#endif + + return mask.val.val64; + +} // End of Get_val64 + +static inline void Put_val16(uint16_t v, void *p) { +uint8_t *out = (uint8_t *)p; +type_mask_t mask; + + mask.val.val16[0] = v; + out[0] = mask.val.val8[0]; + out[1] = mask.val.val8[1]; + +} // End of Put_val16 + +static inline void Put_val24(uint32_t v, void *p) { +uint8_t *out = (uint8_t *)p; +type_mask_t mask; + + mask.val.val32[0] = v; + out[0] = mask.val.val8[1]; + out[1] = mask.val.val8[2]; + out[2] = mask.val.val8[3]; + +} // End of Put_val24 + +static inline void Put_val32(uint32_t v, void *p) { +uint8_t *out = (uint8_t *)p; +type_mask_t mask; + + mask.val.val32[0] = v; + out[0] = mask.val.val8[0]; + out[1] = mask.val.val8[1]; + out[2] = mask.val.val8[2]; + out[3] = mask.val.val8[3]; + +} // End of Put_val32 + +/* + * not yet used + * +static inline void Put_val40(uint64_t v, void *p) { +uint8_t *out = (uint8_t *)p; +type_mask_t mask; + + mask.val.val64 = v; + out[0] = mask.val.val8[3]; + out[1] = mask.val.val8[4]; + out[2] = mask.val.val8[5]; + out[3] = mask.val.val8[6]; + out[4] = mask.val.val8[7]; + +} // End of Put_val40 + * + */ + +static inline void Put_val48(uint64_t v, void *p) { +uint8_t *out = (uint8_t *)p; +type_mask_t mask; + + mask.val.val64 = v; + out[0] = mask.val.val8[2]; + out[1] = mask.val.val8[3]; + out[2] = mask.val.val8[4]; + out[3] = mask.val.val8[5]; + out[4] = mask.val.val8[6]; + out[5] = mask.val.val8[7]; + +} // End of Put_val48 + +/* + * not yet used + * +static inline void Put_val56(uint64_t v, void *p) { +uint8_t *out = (uint8_t *)p; +type_mask_t mask; + + mask.val.val64 = v; + out[0] = mask.val.val8[1]; + out[1] = mask.val.val8[2]; + out[2] = mask.val.val8[3]; + out[3] = mask.val.val8[4]; + out[4] = mask.val.val8[5]; + out[5] = mask.val.val8[6]; + out[6] = mask.val.val8[7]; + +} // End of Put_val56 + * + */ + +static inline void Put_val64(uint64_t v, void *p) { +uint8_t *out = (uint8_t *)p; +type_mask_t mask; + + mask.val.val64 = v; + out[0] = mask.val.val8[0]; + out[1] = mask.val.val8[1]; + out[2] = mask.val.val8[2]; + out[3] = mask.val.val8[3]; + out[4] = mask.val.val8[4]; + out[5] = mask.val.val8[5]; + out[6] = mask.val.val8[6]; + out[7] = mask.val.val8[7]; + +} // End of Put_val64 + + diff --git a/bin/ipconv.c b/bin/ipconv.c new file mode 100644 index 0000000..a22dd88 --- /dev/null +++ b/bin/ipconv.c @@ -0,0 +1,361 @@ +/* + * Copyright (c) 2014, Peter Haag + * Copyright (c) 2009, Peter Haag + * Copyright (c) 2008-2008, SWITCH - Teleinformatikdienste fuer Lehre und Forschung + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of the author nor the names of its contributors may be + * used to endorse or promote products derived from this software without + * specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 COPYRIGHT OWNER 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. + * + * Copyright (c) 1996 by Internet Software Consortium. + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS + * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE + * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL + * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR + * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS + * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS + * SOFTWARE. + * + * + * $Author: haag $ + * + * $Id: ipconv.c 39 2009-11-25 08:11:15Z haag $ + * + * $LastChangedRevision: 39 $ + * + */ + +#include "config.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#ifdef HAVE_RESOLV_H +#include +#endif + +#ifdef HAVE_STDINT_H +#include +#endif + +#include "nffile.h" +#include "util.h" +#include "ipconv.h" + + +static int parse_ipv4(const char *src, uint32_t *dst, int *bytes); +static int parse_ipv6(const char *src, uint64_t *dst, int *bytes); +static int lookup_host(const char *hostname, uint64_t *iplist, uint32_t *num_ip ); + +int parse_ip(int *af, const char *src, uint64_t *dst, int *bytes, int lookup, uint32_t *num_ip ) { +char *alpha = "abcdefghijklmnopqrstuvwxzyABCDEFGHIJKLMNOPQRSTUVWXZY"; +uint32_t v4addr; +int ret; + + // check for IPv6 address + if ( strchr(src, ':') != NULL ) { + *af = PF_INET6; + // check for alpha chars -> hostname -> lookup + } else if ( strpbrk(src, alpha)) { + *af = 0; + if ( lookup == STRICT_IP ) + return -1; + else + return lookup_host(src, dst, num_ip ); + // it's IPv4 + } else + *af = PF_INET; + + *num_ip = 1; + switch (*af) { + case AF_INET: + ret = (parse_ipv4(src, &v4addr, bytes)); + dst[0] = 0; + dst[1] = ntohl(v4addr) & 0xffffffffLL ; + return ret; + break; + case AF_INET6: + ret = (parse_ipv6(src, dst, bytes)); + dst[0] = ntohll(dst[0]); + dst[1] = ntohll(dst[1]); + return ret; + break; + } + /* NOTREACHED */ + + return 0; +} + +static int parse_ipv4(const char *src, uint32_t *dst, int *bytes) { +static const char digits[] = "0123456789"; +int saw_digit, ch; +uint8_t tmp[4], *tp; + + saw_digit = 0; + *bytes = 0; + *(tp = tmp) = 0; + memset(tmp, 0, sizeof(tmp)); + while ((ch = *src++) != '\0') { + const char *pch; + + if ((pch = strchr(digits, ch)) != NULL) { + unsigned int new = *tp * 10 + (pch - digits); + + if (new > 255) + return (0); + if (! saw_digit) { + if (++(*bytes) > 4) + return (0); + saw_digit = 1; + } + *tp = new; + } else if (ch == '.' && saw_digit) { + if (*bytes == 4) + return (0); + *++tp = 0; + saw_digit = 0; + if ( !(*src) ) + return 0; + } else + return (0); + } + + memcpy(dst, tmp, sizeof(tmp)); + return (1); +} + +static int parse_ipv6(const char *src, uint64_t *dst, int *bytes) { +static const char xdigits_l[] = "0123456789abcdef", + xdigits_u[] = "0123456789ABCDEF"; +uint8_t tmp[16], *tp, *endp, *colonp; +const char *xdigits, *curtok; +int ch, saw_xdigit; +u_int val; + + memset((tp = tmp), '\0', sizeof(tmp)); + endp = tp + sizeof(tmp); + colonp = NULL; + /* Leading :: requires some special handling. */ + if (*src == ':') + if (*++src != ':') + return (0); + curtok = src; + saw_xdigit = 0; + val = 0; + while ((ch = *src++) != '\0') { + const char *pch; + + if ((pch = strchr((xdigits = xdigits_l), ch)) == NULL) + pch = strchr((xdigits = xdigits_u), ch); + if (pch != NULL) { + val <<= 4; + val |= (pch - xdigits); + if (val > 0xffff) + return (0); + saw_xdigit = 1; + continue; + } + if (ch == ':') { + curtok = src; + if (!saw_xdigit) { + if (colonp) + return (0); + colonp = tp; + continue; + } else if (*src == '\0') { + return (0); + } + if (tp + sizeof(uint16_t) > endp) + return (0); + *tp++ = (u_char) (val >> 8) & 0xff; + *tp++ = (u_char) val & 0xff; + saw_xdigit = 0; + val = 0; + continue; + } + if (ch == '.' && ((tp + 4) <= endp) && + parse_ipv4(curtok, (uint32_t *)tp, bytes) > 0) { + tp += 4; + saw_xdigit = 0; + break; /* '\0' was seen by parse_ipv4(). */ + } + return (0); + } + if (saw_xdigit) { + if (tp + sizeof(uint16_t) > endp) + return (0); + *tp++ = (u_char) (val >> 8) & 0xff; + *tp++ = (u_char) val & 0xff; + } + if (colonp != NULL) { + /* + * Since some memmove()'s erroneously fail to handle + * overlapping regions, we'll do the shift by hand. + */ + const int n = tp - colonp; + int i; + + for (i = 1; i <= n; i++) { + endp[- i] = colonp[n - i]; + colonp[n - i] = 0; + } + tp = endp; + } + *bytes = 16 - ( endp - tp ); + + memcpy(dst, tmp, sizeof(tmp)); + return (1); +} + +static int lookup_host(const char *hostname, uint64_t *iplist, uint32_t *num_ip ) { +struct addrinfo hints, *res, *r; +int errcode, i, len; +char addrstr[128]; +char reverse[256]; +void *ptr; + + printf("Resolving %s ...\n", hostname); + + memset (&hints, 0, sizeof (hints)); + hints.ai_family = PF_UNSPEC; + hints.ai_socktype = SOCK_STREAM; + hints.ai_flags |= AI_CANONNAME; + + errcode = getaddrinfo (hostname, NULL, &hints, &res); + if (errcode != 0) { + fprintf(stderr, "Failed to resolve IP address for %s: %s\n", hostname, gai_strerror(errno)); + return 0; + } + + // count the number of records found + *num_ip = 0; + + // remember res for later free() + r = res; + + i = 0; + while (res) { + if ( *num_ip >= MAXHOSTS ) { + printf ("Too man IP addresses in DNS response\n"); + return 1; + } + switch (res->ai_family) { + case PF_INET: + ptr = &(((struct sockaddr_in *) res->ai_addr)->sin_addr); + iplist[i++] = 0; + iplist[i++] = ntohl(*(uint32_t *)ptr) & 0xffffffffLL ; + len = sizeof(struct sockaddr_in); + break; + case AF_INET6: + ptr = &((struct sockaddr_in6 *) res->ai_addr)->sin6_addr; + iplist[i++] = ntohll(((uint64_t *)ptr)[0]); + iplist[i++] = ntohll(((uint64_t *)ptr)[1]); + len = sizeof(struct sockaddr_in6); + break; + default: { + // not handled + res = res->ai_next; + continue; + } + } + inet_ntop (res->ai_family, ptr, addrstr, 100); + addrstr[99] = '\0'; + if ( (errcode = getnameinfo(res->ai_addr, len, reverse, sizeof(reverse), NULL,0,0)) != 0 ) { + snprintf(reverse, sizeof(reverse)-1, ""); + // fprintf(stderr, "Failed to reverse lookup %s: %s\n", addrstr, gai_strerror(errcode)); + } + + printf ("IPv%d address: %s (%s)\n", res->ai_family == PF_INET6 ? 6 : 4, addrstr, reverse ); + res = res->ai_next; + (*num_ip)++; + } + + freeaddrinfo(r); + return 1; + +} // End of lookup_host + +int set_nameserver(char *ns) { +struct hostent *host; + + res_init(); + host = gethostbyname(ns); + if (host == NULL) { + (void) fprintf(stderr,"Can not resolv nameserver %s: %s\n", ns, hstrerror(h_errno)); + return 0; + } + (void) memcpy((void *)&_res.nsaddr_list[0].sin_addr, (void *)host->h_addr_list[0], (size_t)host->h_length); + _res.nscount = 1; + return 1; + +} // End of set_nameserver + + +/* +int main( int argc, char **argv ) { + +char *s, t[64]; +uint64_t anyaddr[2]; +uint32_t num_ip; +int af, ret, bytes; + + + s = argv[1]; + if (argc == 3 && !set_nameserver(argv[2]) ) + return 0; + + lookup_host(s, &num_ip); + return 0; + + ret = parse_ip(&af, s, anyaddr, &bytes); + if ( ret != 1 ) { + printf("Parse failed!\n"); + return 0; + } + + if ( af == PF_INET ) + inet_ntop(af, &(((uint32_t *)anyaddr)[3]), t, 64); + else + inet_ntop(af, anyaddr, t, 64); + + printf("Convert back: %s => %s %i bytes\n", s, t, bytes); + +} + +*/ + diff --git a/bin/ipconv.h b/bin/ipconv.h new file mode 100755 index 0000000..5d3d9e2 --- /dev/null +++ b/bin/ipconv.h @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2014, Peter Haag + * Copyright (c) 2009, Peter Haag + * Copyright (c) 2004-2008, SWITCH - Teleinformatikdienste fuer Lehre und Forschung + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of the author nor the names of its contributors may be + * used to endorse or promote products derived from this software without + * specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 COPYRIGHT OWNER 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. + * + * $Author:$ + * + * $Id:$ + * + * $LastChangedRevision:$ + * + * + */ + +#ifndef _IPCONV_H +#define _IPCONV_H 1 + +int parse_ip(int *af, const char *src, uint64_t *dst, int *bytes, int lookup, uint32_t *num_ip ); + +int set_nameserver(char *ns); + +#define MAXHOSTS 512 + +#define STRICT_IP 0 +#define ALLOW_LOOKUP 1 + +#endif //_IPCONV_H diff --git a/bin/ipfix.c b/bin/ipfix.c new file mode 100644 index 0000000..ba071ea --- /dev/null +++ b/bin/ipfix.c @@ -0,0 +1,1742 @@ +/* + * Copyright (c) 2014, Peter Haag + * Copyright (c) 2012, Peter Haag + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of the author nor the names of its contributors may be + * used to endorse or promote products derived from this software without + * specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 COPYRIGHT OWNER 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. + * + * $Author:$ + * + * $Id:$ + * + * $LastChangedRevision:$ + * + */ + +#include "config.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#ifdef HAVE_STDINT_H +#include +#endif + +#include "nffile.h" +#include "nfx.h" +#include "nfnet.h" +#include "nf_common.h" +#include "util.h" +#include "bookkeeper.h" +#include "nfxstat.h" +#include "collector.h" +#include "exporter.h" +#include "ipfix.h" + +#ifndef DEVEL +# define dbg_printf(...) /* printf(__VA_ARGS__) */ +#else +# define dbg_printf(...) printf(__VA_ARGS__) +#endif + +// a few handy macros +#define GET_FLOWSET_ID(p) (Get_val16(p)) +#define GET_FLOWSET_LENGTH(p) (Get_val16((void *)((p) + 2))) + +#define GET_TEMPLATE_ID(p) (Get_val16(p)) +#define GET_TEMPLATE_COUNT(p) (Get_val16((void *)((p) + 2))) + +#define GET_OPTION_TEMPLATE_ID(p) (Get_val16(p)) +#define GET_OPTION_TEMPLATE_FIELD_COUNT(p) (Get_val16((void *)((p) + 2))) +#define GET_OPTION_TEMPLATE_SCOPE_FIELD_COUNT(p) (Get_val16((void *)((p) + 4))) + +/* module limited globals */ + +/* + * sequence element to move data from data input to output + * a sequence exists for each IPFIX element + */ +typedef struct sequence_map_s { +/* sequence definition: + just move a certain number of bytes -> moveXX + set a certain number of output bytes to zero -> zeroXX + process input data into appropriate output -> AnyName + */ +#define nop 0 +#define move8 1 +#define move16 2 +#define move32 3 +#define move40 4 +#define move48 5 +#define move56 6 +#define move64 7 +#define move128 8 +#define move32_sampling 9 +#define move64_sampling 10 +#define move_mac 11 +#define move_mpls 12 +#define Time64Mili 13 +#define saveICMP 14 +#define zero8 15 +#define zero16 16 +#define zero32 17 +#define zero64 18 +#define zero128 19 + + uint32_t id; // sequence ID as defined above + uint16_t input_offset; // copy/process data at this input offset + uint16_t output_offset; // copy final data to this output offset + void *stack; // optionally copy data onto this stack +} sequence_map_t; + +/* + * the IPFIX template records are processed and + * for each template we create a a translation table, which contains + * all information required, to transform the data records from + * the exporter into nfdump internal data structurs. + * All templates are chained in a linked list + */ +typedef struct input_translation_s { + struct input_translation_s *next; // linked list + uint32_t flags; // flags for output record + time_t updated; // timestamp of last update/refresh + uint32_t id; // template ID of exporter domains + uint32_t input_record_size; // size of the input record + uint32_t output_record_size; // required size in nfdump format + + // tmp vars needed while processing the data record + uint64_t flow_start; // start time in msec + uint64_t flow_end; // end time in msec + uint32_t ICMP_offset; // offset of ICMP type/code in data stream + uint64_t packets; // total (in)packets - sampling corrected + uint64_t bytes; // total (in)bytes - sampling corrected + uint64_t out_packets; // total out packets - sampling corrected + uint64_t out_bytes; // total out bytes - sampling corrected +// uint32_t src_as_offset; +// uint32_t dst_as_offset; +// uint32_t sampler_offset; +// uint32_t sampler_size; +// uint32_t engine_offset; + uint32_t router_ip_offset; + uint32_t received_offset; + + // etension map infos + uint32_t extension_map_changed; // map changed while refreshing? + extension_info_t extension_info; // the extension map reflecting this template + + // sequence map information + uint32_t number_of_sequences; // number of sequences for the translate + sequence_map_t *sequence; // sequence map +} input_translation_t; + +/* + * All Obervation Domains from all exporter are stored in a linked list + * which uniquely can identify each exporter/Observation Domain + */ +typedef struct exporter_ipfix_domain_s { + struct exporter_ipfix_domain_s *next; // linkes list to next exporter + + // generic exporter information + exporter_info_record_t info; + + uint64_t packets; // number of packets sent by this exporter + uint64_t flows; // number of flow records sent by this exporter + uint32_t sequence_failure; // number of sequence failues + + // generic sampler + generic_sampler_t *sampler; + + // exporter parameters + uint32_t ExportTime; + + // Current sequence number + uint32_t PacketSequence; + + // statistics + uint64_t TemplateRecords; // stat counter + uint64_t DataRecords; // stat counter + + // linked list of all templates sent by this exporter + input_translation_t *input_translation_table; + + // in order to prevent search through all lists keep + // the last template we processed as a cache + input_translation_t *current_table; + +} exporter_ipfix_domain_t; + + +static struct ipfix_element_map_s { + uint16_t id; // IPFIX element id + uint16_t length; // type of this element ( input length ) + uint16_t out_length; // type of this element ( output length ) + uint32_t sequence; // + uint32_t zero_sequence; // + uint16_t extension; // maps into nfdump extension ID +} ipfix_element_map[] = { + {0, 0, 0}, + { IPFIX_octetDeltaCount, _8bytes, _8bytes, move64_sampling, zero64, COMMON_BLOCK }, + { IPFIX_octetDeltaCount, _4bytes, _8bytes, move32_sampling, zero64, COMMON_BLOCK }, + { IPFIX_packetDeltaCount, _8bytes, _8bytes, move64_sampling, zero64, COMMON_BLOCK }, + { IPFIX_packetDeltaCount, _4bytes, _8bytes, move32_sampling, zero64, COMMON_BLOCK }, + { IPFIX_octetTotalCount, _8bytes, _8bytes, move64_sampling, zero64, COMMON_BLOCK }, + { IPFIX_octetTotalCount, _4bytes, _8bytes, move32_sampling, zero64, COMMON_BLOCK }, + { IPFIX_packetTotalCount, _8bytes, _8bytes, move64_sampling, zero64, COMMON_BLOCK }, + { IPFIX_packetTotalCount, _4bytes, _8bytes, move32_sampling, zero64, COMMON_BLOCK }, + { IPFIX_protocolIdentifier, _1byte, _1byte, move8, zero8, COMMON_BLOCK }, + { IPFIX_ipClassOfService, _1byte, _1byte, move8, zero8, COMMON_BLOCK }, + { IPFIX_tcpControlBits, _1byte, _1byte, move8, zero8, COMMON_BLOCK }, + { IPFIX_SourceTransportPort, _2bytes, _2bytes, move16, zero16, COMMON_BLOCK }, + { IPFIX_SourceIPv4Address, _4bytes, _4bytes, move32, zero32, COMMON_BLOCK }, + { IPFIX_SourceIPv4PrefixLength, _1byte, _1byte, move8, zero8, EX_MULIPLE }, + { IPFIX_ingressInterface, _4bytes, _4bytes, move32, zero32, EX_IO_SNMP_4 }, + { IPFIX_ingressInterface, _2bytes, _2bytes, move16, zero16, EX_IO_SNMP_2 }, + { IPFIX_DestinationTransportPort, _2bytes, _2bytes, move16, zero16, COMMON_BLOCK }, + { IPFIX_DestinationIPv4Address, _4bytes, _4bytes, move32, zero32, COMMON_BLOCK }, + { IPFIX_DestinationIPv4PrefixLength, _1byte, _1byte, move8, zero8, EX_MULIPLE }, + { IPFIX_egressInterface, _4bytes, _4bytes, move32, zero32, EX_IO_SNMP_4 }, + { IPFIX_egressInterface, _2bytes, _2bytes, move16, zero16, EX_IO_SNMP_2 }, + { IPFIX_ipNextHopIPv4Address, _4bytes, _4bytes, move32, zero32, EX_NEXT_HOP_v4 }, + { IPFIX_bgpSourceAsNumber, _4bytes, _4bytes, move32, zero32, EX_AS_4 }, + { IPFIX_bgpSourceAsNumber, _2bytes, _2bytes, move16, zero16, EX_AS_2 }, + { IPFIX_bgpDestinationAsNumber, _4bytes, _4bytes, move32, zero32, EX_AS_4 }, + { IPFIX_bgpDestinationAsNumber, _2bytes, _2bytes, move16, zero16, EX_AS_2 }, + { IPFIX_bgpNextHopIPv4Address, _4bytes, _4bytes, move32, zero32, EX_NEXT_HOP_BGP_v4}, + { IPFIX_flowEndSysUpTime, _4bytes, _4bytes, nop, nop, COMMON_BLOCK }, + { IPFIX_flowStartSysUpTime, _4bytes, _4bytes, nop, nop, COMMON_BLOCK }, + { IPFIX_postOctetDeltaCount, _8bytes, _8bytes, move64, zero64, EX_OUT_BYTES_8 }, + { IPFIX_postOctetDeltaCount, _4bytes, _4bytes, move32, zero32, EX_OUT_BYTES_4 }, + { IPFIX_postPacketDeltaCount, _8bytes, _8bytes, move64, zero64, EX_OUT_PKG_8 }, + { IPFIX_postPacketDeltaCount, _4bytes, _4bytes, move32, zero32, EX_OUT_PKG_4 }, + { IPFIX_SourceIPv6Address, _16bytes, _16bytes, move128, zero128, COMMON_BLOCK }, + { IPFIX_DestinationIPv6Address, _16bytes, _16bytes, move128, zero128, COMMON_BLOCK }, + { IPFIX_SourceIPv6PrefixLength, _1byte, _1byte, move8, zero8, EX_MULIPLE }, + { IPFIX_DestinationIPv6PrefixLength, _1byte, _1byte, move8, zero8, EX_MULIPLE }, + { IPFIX_flowLabelIPv6, _4bytes, _4bytes, nop, nop, COMMON_BLOCK }, + { IPFIX_icmpTypeCodeIPv4, _2bytes, _2bytes, nop, nop, COMMON_BLOCK }, + { IPFIX_postIpClassOfService, _1byte, _1byte, move8, zero8, EX_MULIPLE }, + { IPFIX_SourceMacAddress, _6bytes, _8bytes, move_mac, zero64, EX_MAC_1}, + { IPFIX_postDestinationMacAddress, _6bytes, _8bytes, move_mac, zero64, EX_MAC_1}, + { IPFIX_vlanId, _2bytes, _2bytes, move16, zero16, EX_VLAN}, + { IPFIX_postVlanId, _2bytes, _2bytes, move16, zero16, EX_VLAN}, + { IPFIX_flowDirection, _1byte, _1byte, move8, zero8, EX_MULIPLE }, + { IPFIX_ipNextHopIPv6Address, _16bytes, _16bytes, move128, zero128, EX_NEXT_HOP_v6}, + { IPFIX_bgpNextHopIPv6Address, _16bytes, _16bytes, move128, zero128, EX_NEXT_HOP_BGP_v6}, + { IPFIX_mplsTopLabelStackSection, _3bytes, _4bytes, move_mpls, zero32, EX_MPLS}, + { IPFIX_mplsLabelStackSection2, _3bytes, _4bytes, move_mpls, zero32, EX_MPLS}, + { IPFIX_mplsLabelStackSection3, _3bytes, _4bytes, move_mpls, zero32, EX_MPLS}, + { IPFIX_mplsLabelStackSection4, _3bytes, _4bytes, move_mpls, zero32, EX_MPLS}, + { IPFIX_mplsLabelStackSection5, _3bytes, _4bytes, move_mpls, zero32, EX_MPLS}, + { IPFIX_mplsLabelStackSection6, _3bytes, _4bytes, move_mpls, zero32, EX_MPLS}, + { IPFIX_mplsLabelStackSection7, _3bytes, _4bytes, move_mpls, zero32, EX_MPLS}, + { IPFIX_mplsLabelStackSection8, _3bytes, _4bytes, move_mpls, zero32, EX_MPLS}, + { IPFIX_mplsLabelStackSection9, _3bytes, _4bytes, move_mpls, zero32, EX_MPLS}, + { IPFIX_mplsLabelStackSection10, _3bytes, _4bytes, move_mpls, zero32, EX_MPLS}, + { IPFIX_DestinationMacAddress, _6bytes, _8bytes, move_mac, zero64, EX_MAC_2}, + { IPFIX_postSourceMacAddress, _6bytes, _8bytes, move_mac, zero64, EX_MAC_2}, + { IPFIX_flowStartMilliseconds, _8bytes, _8bytes, Time64Mili, zero32, COMMON_BLOCK}, + { IPFIX_flowEndMilliseconds, _8bytes, _8bytes, Time64Mili, zero32, COMMON_BLOCK}, + {0, 0, 0} +}; + +// cache to be used while parsing a template +static struct cache_s { + struct element_param_s { + uint16_t index; + uint16_t found; + uint16_t offset; + uint16_t length; + } *lookup_info; + uint32_t max_ipfix_elements; + uint32_t *common_extensions; + +} cache; + +// module limited globals +static uint32_t processed_records; + +// externals +extern int verbose; +extern uint32_t Max_num_extensions; +extern extension_descriptor_t extension_descriptor[]; +extern uint32_t overwrite_sampling; +extern uint32_t exporter_sysid; + +// prototypes +static input_translation_t *add_translation_table(exporter_ipfix_domain_t *exporter, uint16_t id); + +static void remove_translation_table(FlowSource_t *fs, exporter_ipfix_domain_t *exporter, uint16_t id); + +static void remove_all_translation_tables(exporter_ipfix_domain_t *exporter); + +static inline exporter_ipfix_domain_t *GetExporter(FlowSource_t *fs, ipfix_header_t *ipfix_header); + +static inline uint32_t MapElement(uint16_t Type, uint16_t Length, uint16_t Offset); + +static inline void PushSequence(input_translation_t *table, uint16_t Type, uint32_t *offset, void *stack); + +static inline void Process_ipfix_templates(exporter_ipfix_domain_t *exporter, void *flowset_header, uint32_t size_left, FlowSource_t *fs); + +static inline void Process_ipfix_template_add(exporter_ipfix_domain_t *exporter, void *DataPtr, uint32_t size_left, FlowSource_t *fs); + +static inline void Process_ipfix_template_withdraw(exporter_ipfix_domain_t *exporter, void *DataPtr, uint32_t size_left, FlowSource_t *fs); + + +#include "inline.c" +#include "nffile_inline.c" + +int Init_IPFIX(void) { +int i; + + cache.lookup_info = (struct element_param_s *)calloc(65536, sizeof(struct element_param_s)); + cache.common_extensions = (uint32_t *)malloc((Max_num_extensions+1)*sizeof(uint32_t)); + if ( !cache.common_extensions || !cache.lookup_info ) { + syslog(LOG_ERR, "Process_ipfix: Panic! malloc(): %s line %d: %s", __FILE__, __LINE__, strerror (errno)); + return 0; + } + + // init the helper element table + for (i=1; ipfix_element_map[i].id != 0; i++ ) { + uint32_t Type = ipfix_element_map[i].id; + // multiple same type - save first index only + // iterate through same Types afterwards + if ( cache.lookup_info[Type].index == 0 ) + cache.lookup_info[Type].index = i; + } + cache.max_ipfix_elements = i; + + syslog(LOG_DEBUG,"Init IPFIX: Max number of IPFIX tags: %u", cache.max_ipfix_elements); + + return 1; + +} // End of Init_IPFIX + +static inline exporter_ipfix_domain_t *GetExporter(FlowSource_t *fs, ipfix_header_t *ipfix_header) { +#define IP_STRING_LEN 40 +char ipstr[IP_STRING_LEN]; +exporter_ipfix_domain_t **e = (exporter_ipfix_domain_t **)&(fs->exporter_data); +uint32_t ObservationDomain = ntohl(ipfix_header->ObservationDomain); + + while ( *e ) { + if ( (*e)->info.id == ObservationDomain && (*e)->info.version == 10 && + (*e)->info.ip.v6[0] == fs->ip.v6[0] && (*e)->info.ip.v6[1] == fs->ip.v6[1]) + return *e; + e = &((*e)->next); + } + + if ( fs->sa_family == AF_INET ) { + uint32_t _ip = htonl(fs->ip.v4); + inet_ntop(AF_INET, &_ip, ipstr, sizeof(ipstr)); + } else if ( fs->sa_family == AF_INET6 ) { + uint64_t _ip[2]; + _ip[0] = htonll(fs->ip.v6[0]); + _ip[1] = htonll(fs->ip.v6[1]); + inet_ntop(AF_INET6, &_ip, ipstr, sizeof(ipstr)); + } else { + strncpy(ipstr, "", IP_STRING_LEN); + } + + // nothing found + *e = (exporter_ipfix_domain_t *)malloc(sizeof(exporter_ipfix_domain_t)); + if ( !(*e)) { + syslog(LOG_ERR, "Process_ipfix: Panic! malloc() %s line %d: %s", __FILE__, __LINE__, strerror (errno)); + return NULL; + } + memset((void *)(*e), 0, sizeof(exporter_ipfix_domain_t)); + (*e)->info.header.type = ExporterInfoRecordType; + (*e)->info.header.size = sizeof(exporter_info_record_t); + (*e)->info.id = ObservationDomain; + (*e)->info.ip = fs->ip; + (*e)->info.sa_family = fs->sa_family; + (*e)->info.version = 10; + (*e)->info.sysid = 0; + + (*e)->TemplateRecords = 0; + (*e)->DataRecords = 0; + (*e)->sequence_failure = 0; + (*e)->next = NULL; + (*e)->sampler = NULL; + + FlushInfoExporter(fs, &((*e)->info)); + + dbg_printf("[%u] New exporter: SysID: %u, Observation domain %u from: %s\n", + ObservationDomain, (*e)->info.sysid, ObservationDomain, ipstr); + syslog(LOG_INFO, "Process_ipfix: New exporter: SysID: %u, Observation domain %u from: %s\n", + (*e)->info.sysid, ObservationDomain, ipstr); + + + return (*e); + +} // End of GetExporter + +static inline uint32_t MapElement(uint16_t Type, uint16_t Length, uint16_t Offset) { +int index; + + index = cache.lookup_info[Type].index; + if ( index ) { + while ( index && ipfix_element_map[index].id == Type ) { + if ( Length == ipfix_element_map[index].length ) { + cache.lookup_info[Type].found = 1; + cache.lookup_info[Type].offset = Offset; + cache.lookup_info[Type].length = Length; + cache.lookup_info[Type].index = index; + dbg_printf("found extension %u for type: %u, input length: %u output length: %u Extension: %u\n", + ipfix_element_map[index].extension, ipfix_element_map[index].id, + ipfix_element_map[index].length, ipfix_element_map[index].out_length, ipfix_element_map[index].extension); + return ipfix_element_map[index].extension; + } + index++; + } + } + dbg_printf("Skip unknown element type: %u, Length: %u\n", Type, Length); + + return 0; + +} // End of MapElement + +static inline input_translation_t *GetTranslationTable(exporter_ipfix_domain_t *exporter, uint16_t id) { +input_translation_t *table; + + if ( exporter->current_table && ( exporter->current_table->id == id ) ) + return exporter->current_table; + + table = exporter->input_translation_table; + while ( table ) { + if ( table->id == id ) { + exporter->current_table = table; + return table; + } + + table = table->next; + } + + dbg_printf("[%u] Get translation table %u: %s\n", exporter->info.id, id, table == NULL ? "not found" : "found"); + + exporter->current_table = table; + return table; + +} // End of GetTranslationTable + +static input_translation_t *add_translation_table(exporter_ipfix_domain_t *exporter, uint16_t id) { +input_translation_t **table; + + table = &(exporter->input_translation_table); + while ( *table ) { + table = &((*table)->next); + } + + // Allocate enough space for all potential ipfix tags, which we support + // so template refreshing may change the table size without danger of overflowing + *table = calloc(1, sizeof(input_translation_t)); + if ( !(*table) ) { + syslog(LOG_ERR, "Process_ipfix: Panic! calloc() %s line %d: %s", __FILE__, __LINE__, strerror (errno)); + return NULL; + } + (*table)->sequence = calloc(cache.max_ipfix_elements, sizeof(sequence_map_t)); + if ( !(*table)->sequence ) { + syslog(LOG_ERR, "Process_ipfix: Panic! malloc() %s line %d: %s", __FILE__, __LINE__, strerror (errno)); + return NULL; + } + + (*table)->id = id; + (*table)->next = NULL; + + dbg_printf("[%u] Get new translation table %u\n", exporter->info.id, id); + + return *table; + +} // End of add_translation_table + +static void remove_translation_table(FlowSource_t *fs, exporter_ipfix_domain_t *exporter, uint16_t id) { +input_translation_t *table, *parent; + + syslog(LOG_INFO, "Process_ipfix: [%u] Withdraw template id: %i", + exporter->info.id, id); + + parent = NULL; + table = exporter->input_translation_table; + while ( table && ( table->id != id ) ) { + parent = table; + table = table->next; + } + + if ( table == NULL ) { + syslog(LOG_ERR, "Process_ipfix: [%u] Withdraw template id: %i. translation table not found", + exporter->info.id, id); + return; + } + + dbg_printf("\n[%u] Withdraw template ID: %u\n", exporter->info.id, table->id); + + // clear table cache, if this is the table to delete + if (exporter->current_table == table) + exporter->current_table = NULL; + + if ( parent ) { + // remove table from list + parent->next = table->next; + } else { + // last table removed + exporter->input_translation_table = NULL; + } + + RemoveExtensionMap(fs, table->extension_info.map); + free(table->sequence); + free(table->extension_info.map); + free(table); + +} // End of remove_translation_table + +static void remove_all_translation_tables(exporter_ipfix_domain_t *exporter) { +input_translation_t *table, *next; + + syslog(LOG_INFO, "Process_ipfix: Withdraw all templates from observation domain %u\n", + exporter->info.id); + + table = exporter->input_translation_table; + while ( table ) { + next = table->next; + + dbg_printf("\n[%u] Withdraw template ID: %u\n", exporter->info.id, table->id); + + free(table->sequence); + free(table->extension_info.map); + free(table); + + table = next; + } + + // clear references + exporter->input_translation_table = NULL; + exporter->current_table = NULL; + +} // End of remove_all_translation_tables + +static inline void PushSequence(input_translation_t *table, uint16_t Type, uint32_t *offset, void *stack) { +uint32_t i = table->number_of_sequences; +uint32_t index = cache.lookup_info[Type].index; + + if ( table->number_of_sequences >= cache.max_ipfix_elements ) { + syslog(LOG_ERR, "Process_ipfix: Software bug! Sequence table full. at %s line %d", + __FILE__, __LINE__); + dbg_printf("Software bug! Sequence table full. at %s line %d", + __FILE__, __LINE__); + return; + } + + if ( cache.lookup_info[Type].found ) { + table->sequence[i].id = ipfix_element_map[index].sequence; + table->sequence[i].input_offset = cache.lookup_info[Type].offset; + table->sequence[i].output_offset = *offset; + table->sequence[i].stack = stack; + } else { + table->sequence[i].id = ipfix_element_map[index].zero_sequence; + table->sequence[i].input_offset = 0; + table->sequence[i].output_offset = *offset; + table->sequence[i].stack = NULL; + } + dbg_printf("Push: sequence: %u, Type: %u, length: %u, out length: %u, id: %u, in offset: %u, out offset: %u\n", + i, Type, ipfix_element_map[index].length, ipfix_element_map[index].out_length, table->sequence[i].id, + table->sequence[i].input_offset, table->sequence[i].output_offset); + table->number_of_sequences++; + (*offset) += ipfix_element_map[index].out_length; + +} // End of PushSequence + +static input_translation_t *setup_translation_table (exporter_ipfix_domain_t *exporter, uint16_t id, uint16_t input_record_size) { +input_translation_t *table; +extension_map_t *extension_map; +uint32_t i, ipv6, offset, next_extension; +size_t size_required; + + ipv6 = 0; + + table = GetTranslationTable(exporter, id); + if ( !table ) { + syslog(LOG_INFO, "Process_ipfix: [%u] Add template %u", exporter->info.id, id); + table = add_translation_table(exporter, id); + if ( !table ) { + return NULL; + } + // Add an extension map + // The number of extensions for this template is currently unknown + // Allocate enough space for all configured extensions - some may be unused later + // make sure memory is 4byte alligned + size_required = Max_num_extensions * sizeof(uint16_t) + sizeof(extension_map_t); + size_required = (size_required + 3) &~(size_t)3; + extension_map = malloc(size_required); + if ( !extension_map ) { + syslog(LOG_ERR, "Process_ipfix: Panic! malloc() error in %s line %d: %s", __FILE__, __LINE__, strerror (errno)); + return NULL; + } + extension_map->type = ExtensionMapType; + // Set size to an empty table - will be adapted later + extension_map->size = sizeof(extension_map_t); + extension_map->map_id = INIT_ID; + // packed record size still unknown at this point - will be added later + extension_map->extension_size = 0; + + table->extension_info.map = extension_map; + table->extension_map_changed = 1; + table->number_of_sequences = 0; + } else { + extension_map = table->extension_info.map; + + // reset size/extension size - it's refreshed automatically + extension_map->size = sizeof(extension_map_t); + extension_map->extension_size = 0; + + dbg_printf("[%u] Refresh template %u\n", exporter->info.id, id); + + // very noisy with somee exporters + dbg_printf("[%u] Refresh template %u\n", exporter->info.id, id); + } + // clear current table + memset((void *)table->sequence, 0, cache.max_ipfix_elements * sizeof(sequence_map_t)); + table->number_of_sequences = 0; + + table->updated = time(NULL); + // IPFIX only has 64bit counters + table->flags = 0; + SetFlag(table->flags, FLAG_PKG_64); + SetFlag(table->flags, FLAG_BYTES_64); + table->ICMP_offset = 0; +// table->sampler_offset = 0; +// table->sampler_size = 0; +// table->engine_offset = 0; + table->router_ip_offset = 0; + table->received_offset = 0; + + dbg_printf("[%u] Build sequence table %u\n", exporter->info.id, id); + + // fill table + table->id = id; + + /* + * common data block: The common record is expected in the output stream. If not available + * in the template, fill values with 0 + */ + + // All required extensions + // The order we Push all ipfix elements, must corresponde to the structure of the common record + // followed by all available extension in the extension map + offset = BYTE_OFFSET_first; + PushSequence( table, IPFIX_flowStartMilliseconds, &offset, &table->flow_start); + offset = BYTE_OFFSET_first + 4; + PushSequence( table, IPFIX_flowEndMilliseconds, &offset, &table->flow_end); + offset = BYTE_OFFSET_first + 8; + offset +=1; // Skip netflow v9 fwd status + PushSequence( table, IPFIX_tcpControlBits, &offset, NULL); + PushSequence( table, IPFIX_protocolIdentifier, &offset, NULL); + PushSequence( table, IPFIX_ipClassOfService, &offset, NULL); + + PushSequence( table, IPFIX_SourceTransportPort, &offset, NULL); + PushSequence( table, IPFIX_DestinationTransportPort, &offset, NULL); + + // skip exporter_sysid and reserved + offset += 4; + + /* IP addresss record + * This record is expected in the output stream. If not available + * in the template, assume empty v4 address. + */ + if ( cache.lookup_info[IPFIX_SourceIPv4Address].found ) { + // IPv4 addresses + PushSequence( table, IPFIX_SourceIPv4Address, &offset, NULL); + PushSequence( table, IPFIX_DestinationIPv4Address, &offset, NULL); + } else if ( cache.lookup_info[IPFIX_SourceIPv6Address].found ) { + // IPv6 addresses + PushSequence( table, IPFIX_SourceIPv6Address, &offset, NULL); + PushSequence( table, IPFIX_DestinationIPv6Address, &offset, NULL); + // mark IPv6 + SetFlag(table->flags, FLAG_IPV6_ADDR); + ipv6 = 1; + } else { + // should not happen, assume empty IPv4 addresses, zero + PushSequence( table, IPFIX_SourceIPv4Address, &offset, NULL); + PushSequence( table, IPFIX_DestinationIPv4Address, &offset, NULL); + } + + // decide between Delta or Total counters - prefer Total if available + if ( cache.lookup_info[IPFIX_packetTotalCount].found ) + PushSequence( table, IPFIX_packetTotalCount, &offset, &table->packets); + else + PushSequence( table, IPFIX_packetDeltaCount, &offset, &table->packets); + SetFlag(table->flags, FLAG_PKG_64); + + if ( cache.lookup_info[IPFIX_octetTotalCount].found ) + PushSequence( table, IPFIX_octetTotalCount, &offset, &table->bytes); + else + PushSequence( table, IPFIX_octetDeltaCount, &offset, &table->bytes); + SetFlag(table->flags, FLAG_BYTES_64); + + + // Optional extensions + next_extension = 0; + for (i=4; extension_descriptor[i].id; i++ ) { + uint32_t map_index = i; + + if ( cache.common_extensions[i] == 0 ) + continue; + + switch(i) { + case EX_IO_SNMP_2: + PushSequence( table, IPFIX_ingressInterface, &offset, NULL); + PushSequence( table, IPFIX_egressInterface, &offset, NULL); + break; + case EX_IO_SNMP_4: + PushSequence( table, IPFIX_ingressInterface, &offset, NULL); + PushSequence( table, IPFIX_egressInterface, &offset, NULL); + break; + case EX_AS_2: + PushSequence( table, IPFIX_bgpSourceAsNumber, &offset, NULL); + PushSequence( table, IPFIX_bgpDestinationAsNumber, &offset, NULL); + break; + case EX_AS_4: + PushSequence( table, IPFIX_bgpSourceAsNumber, &offset, NULL); + PushSequence( table, IPFIX_bgpDestinationAsNumber, &offset, NULL); + break; + case EX_MULIPLE: + PushSequence( table, IPFIX_postIpClassOfService, &offset, NULL); + PushSequence( table, IPFIX_flowDirection, &offset, NULL); + if ( ipv6 ) { + // IPv6 + PushSequence( table, IPFIX_SourceIPv6PrefixLength, &offset, NULL); + PushSequence( table, IPFIX_DestinationIPv6PrefixLength, &offset, NULL); + } else { + // IPv4 + PushSequence( table, IPFIX_SourceIPv4PrefixLength, &offset, NULL); + PushSequence( table, IPFIX_DestinationIPv4PrefixLength, &offset, NULL); + } + break; + case EX_NEXT_HOP_v4: + PushSequence( table, IPFIX_ipNextHopIPv4Address, &offset, NULL); + break; + case EX_NEXT_HOP_v6: + PushSequence( table, IPFIX_ipNextHopIPv6Address, &offset, NULL); + SetFlag(table->flags, FLAG_IPV6_NH); + break; + case EX_NEXT_HOP_BGP_v4: + PushSequence( table, IPFIX_bgpNextHopIPv4Address, &offset, NULL); + break; + case EX_NEXT_HOP_BGP_v6: + PushSequence( table, IPFIX_bgpNextHopIPv6Address, &offset, NULL); + SetFlag(table->flags, FLAG_IPV6_NHB); + break; + case EX_VLAN: + PushSequence( table, IPFIX_vlanId, &offset, NULL); + PushSequence( table, IPFIX_postVlanId, &offset, NULL); + break; + case EX_OUT_PKG_4: + PushSequence( table, IPFIX_postPacketDeltaCount, &offset, NULL); + break; + case EX_OUT_PKG_8: + PushSequence( table, IPFIX_postPacketDeltaCount, &offset, NULL); + break; + case EX_OUT_BYTES_4: + PushSequence( table, IPFIX_postOctetDeltaCount, &offset, NULL); + break; + case EX_OUT_BYTES_8: + PushSequence( table, IPFIX_postOctetDeltaCount, &offset, NULL); + break; + case EX_AGGR_FLOWS_8: + break; + case EX_MAC_1: + PushSequence( table, IPFIX_SourceMacAddress, &offset, NULL); + PushSequence( table, IPFIX_postDestinationMacAddress, &offset, NULL); + break; + case EX_MAC_2: + PushSequence( table, IPFIX_DestinationMacAddress, &offset, NULL); + PushSequence( table, IPFIX_postSourceMacAddress, &offset, NULL); + break; + case EX_MPLS: + PushSequence( table, IPFIX_mplsTopLabelStackSection, &offset, NULL); + PushSequence( table, IPFIX_mplsLabelStackSection2, &offset, NULL); + PushSequence( table, IPFIX_mplsLabelStackSection3, &offset, NULL); + PushSequence( table, IPFIX_mplsLabelStackSection4, &offset, NULL); + PushSequence( table, IPFIX_mplsLabelStackSection5, &offset, NULL); + PushSequence( table, IPFIX_mplsLabelStackSection6, &offset, NULL); + PushSequence( table, IPFIX_mplsLabelStackSection7, &offset, NULL); + PushSequence( table, IPFIX_mplsLabelStackSection8, &offset, NULL); + PushSequence( table, IPFIX_mplsLabelStackSection9, &offset, NULL); + PushSequence( table, IPFIX_mplsLabelStackSection10, &offset, NULL); + break; + case EX_ROUTER_IP_v4: + case EX_ROUTER_IP_v6: + if ( exporter->info.sa_family == PF_INET6 ) { + table->router_ip_offset = offset; + dbg_printf("Router IPv6: offset: %u, olen: %u\n", offset, 16 ); + // not an entry for the translateion table. + // but reserve space in the output record for IPv6 + offset += 16; + SetFlag(table->flags, FLAG_IPV6_EXP); + map_index = EX_ROUTER_IP_v6; + } else { + table->router_ip_offset = offset; + dbg_printf("Router IPv4: offset: %u, olen: %u\n", offset, 4 ); + // not an entry for the translateion table. + // but reserve space in the output record for IPv4 + offset += 4; + ClearFlag(table->flags, FLAG_IPV6_EXP); + map_index = EX_ROUTER_IP_v4; + } + break; + case EX_ROUTER_ID: + // no value in ipfix + break; + case EX_RECEIVED: + table->received_offset = offset; + dbg_printf("Received offset: %u\n", offset); + offset += 8; + break; + + } + extension_map->size += sizeof(uint16_t); + extension_map->extension_size += extension_descriptor[map_index].size; + + + // found extension in map_index must be the same as in map - otherwise map is dirty + if ( extension_map->ex_id[next_extension] != map_index ) { + // dirty map - needs to be refreshed in output stream + extension_map->ex_id[next_extension] = map_index; + table->extension_map_changed = 1; + + } + next_extension++; + + } + extension_map->ex_id[next_extension++] = 0; + + // make sure map is aligned + if ( extension_map->size & 0x3 ) { + extension_map->ex_id[next_extension] = 0; + extension_map->size = ( extension_map->size + 3 ) &~ 0x3; + } + + table->output_record_size = offset; + table->input_record_size = input_record_size; + + // for netflow historical reason, ICMP type/code goes into dst port field + // remember offset, for decoding + if ( cache.lookup_info[IPFIX_icmpTypeCodeIPv4].found && cache.lookup_info[IPFIX_icmpTypeCodeIPv4].length == 2 ) { + table->ICMP_offset = cache.lookup_info[IPFIX_icmpTypeCodeIPv4].offset; + } + +#ifdef DEVEL + if ( table->extension_map_changed ) { + printf("Extension Map id=%u changed!\n", extension_map->map_id); + } else { + printf("[%u] template %u unchanged\n", exporter->info.id, id); + } + + printf("Process_ipfix: Check extension map: id: %d, size: %u, extension_size: %u\n", + extension_map->map_id, extension_map->size, extension_map->extension_size); + { int i; + for (i=0; inumber_of_sequences; i++ ) { + printf("Sequence %i: id: %u, in offset: %u, out offset: %u, stack: %llu\n", + i, table->sequence[i].id, table->sequence[i].input_offset, table->sequence[i].output_offset, + (unsigned long long)table->sequence[i].stack); + } + printf("Flags: 0x%x\n", table->flags); + printf("Input record size: %u, output record size: %u\n", + table->input_record_size, table->output_record_size); + } + PrintExtensionMap(extension_map); +#endif + + return table; + +} // End of setup_translation_table + +static inline void Process_ipfix_templates(exporter_ipfix_domain_t *exporter, void *flowset_header, uint32_t size_left, FlowSource_t *fs) { +ipfix_template_record_t *ipfix_template_record; +void *DataPtr; +uint32_t id, count; + + size_left -= 4; // subtract message header + DataPtr = flowset_header + 4; + + ipfix_template_record = (ipfix_template_record_t *)DataPtr; + + id = ntohs(ipfix_template_record->TemplateID); + count = ntohs(ipfix_template_record->FieldCount); + + if ( count == 0 ) { + // withdraw template + Process_ipfix_template_withdraw(exporter, DataPtr, size_left, fs); + } else { + // refresh/add templates + Process_ipfix_template_add(exporter, DataPtr, size_left, fs); + } + +} // End of Process_ipfix_templates + +static inline void Process_ipfix_template_add(exporter_ipfix_domain_t *exporter, void *DataPtr, uint32_t size_left, FlowSource_t *fs) { +input_translation_t *translation_table; +ipfix_template_record_t *ipfix_template_record; +ipfix_template_elements_std_t *NextElement; +int i; +uint16_t Offset = 0; + + // a template flowset can contain multiple records ( templates ) + while ( size_left ) { + + // clear helper tables + memset((void *)cache.common_extensions, 0, (Max_num_extensions+1)*sizeof(uint32_t)); + memset((void *)cache.lookup_info, 0, 65536 * sizeof(struct element_param_s)); + for (i=1; ipfix_element_map[i].id != 0; i++ ) { + uint32_t Type = ipfix_element_map[i].id; + if ( ipfix_element_map[i].id == ipfix_element_map[i-1].id ) + continue; + cache.lookup_info[Type].index = i; + // other elements cleard be memset + } + + uint32_t id, count, size_required; + uint32_t num_extensions = 0; + + // map next record. + ipfix_template_record = (ipfix_template_record_t *)DataPtr; + size_left -= 4; + + id = ntohs(ipfix_template_record->TemplateID); + count = ntohs(ipfix_template_record->FieldCount); + + dbg_printf("\n[%u] Template ID: %u\n", exporter->info.id, id); + dbg_printf("FieldCount: %u buffersize: %u\n", count, size_left); + + // assume all elements in template are std elements. correct this value, if we find an enterprise element + size_required = 4*count; + if ( size_left < size_required ) { + // if we fail this check, this flowset must be skipped. + syslog(LOG_ERR, "Process_ipfix: [%u] Not enough data for template elements! required: %i, left: %u", + exporter->info.id, size_required, size_left); + dbg_printf("ERROR: Not enough data for template elements! required: %i, left: %u", size_required, size_left); + return; + } + + Offset = 0; + // process all elements in this record + NextElement = (ipfix_template_elements_std_t *)ipfix_template_record->elements; + for ( i=0; iType); + Length = ntohs(NextElement->Length); + Enterprise = Type & 0x8000 ? 1 : 0; + + ext_id = MapElement(Type, Length, Offset); + + // do we store this extension? enabled != 0 + // more than 1 v9 tag may map to an extension - so count this extension once only + if ( ext_id && extension_descriptor[ext_id].enabled ) { + if ( cache.common_extensions[ext_id] == 0 ) { + cache.common_extensions[ext_id] = 1; + num_extensions++; + } + } + Offset += Length; + + if ( Enterprise ) { + ipfix_template_elements_e_t *e = (ipfix_template_elements_e_t *)NextElement; + size_required += 4; // ad 4 for enterprise value + if ( size_left < size_required ) { + syslog(LOG_ERR, "Process_ipfix: [%u] Not enough data for template elements! required: %i, left: %u", + exporter->info.id, size_required, size_left); + dbg_printf("ERROR: Not enough data for template elements! required: %i, left: %u", size_required, size_left); + return; + } + dbg_printf(" [%i] Enterprise: 1, Type: %u, Length %u EnterpriseNumber: %u\n", i, Type, Length, ntohl(e->EnterpriseNumber)); + e++; + NextElement = (ipfix_template_elements_std_t *)e; + } else { + dbg_printf(" [%i] Enterprise: 0, Type: %u, Length %u\n", i, Type, Length); + NextElement++; + } + } + + dbg_printf("Processed: %u\n", size_required); + + // as the router IP address extension is not part announced in a template, we need to deal with it here + if ( extension_descriptor[EX_ROUTER_IP_v4].enabled ) { + if ( cache.common_extensions[EX_ROUTER_IP_v4] == 0 ) { + cache.common_extensions[EX_ROUTER_IP_v4] = 1; + num_extensions++; + } + dbg_printf("Add sending router IP address (%s) => Extension: %u\n", + fs->sa_family == PF_INET6 ? "ipv6" : "ipv4", EX_ROUTER_IP_v4); + } + + // XXX for now, we do not stre router ID in IPFIX + extension_descriptor[EX_ROUTER_ID].enabled = 0; + +/* + // as the router IP address extension is not part announced in a template, we need to deal with it here + if ( extension_descriptor[EX_ROUTER_ID].enabled ) { + if ( cache.common_extensions[EX_ROUTER_ID] == 0 ) { + cache.common_extensions[EX_ROUTER_ID] = 1; + num_extensions++; + } + dbg_printf("Force add router ID (engine type/ID), Extension: %u\n", EX_ROUTER_ID); + } +*/ + // as the received time is not announced in a template, we need to deal with it here + if ( extension_descriptor[EX_RECEIVED].enabled ) { + if ( cache.common_extensions[EX_RECEIVED] == 0 ) { + cache.common_extensions[EX_RECEIVED] = 1; + num_extensions++; + } + dbg_printf("Force add packet received time, Extension: %u\n", EX_RECEIVED); + } + +#ifdef DEVEL + { + int i; + for (i=4; extension_descriptor[i].id; i++ ) { + if ( cache.common_extensions[i] ) { + printf("Enabled extension: %i\n", i); + } + } + } +#endif + + translation_table = setup_translation_table(exporter, id, Offset); + if (translation_table->extension_map_changed ) { + translation_table->extension_map_changed = 0; + // refresh he map in the ouput buffer + dbg_printf("Translation Table changed! Add extension map ID: %i\n", translation_table->extension_info.map->map_id); + AddExtensionMap(fs, translation_table->extension_info.map); + dbg_printf("Translation Table added! map ID: %i\n", translation_table->extension_info.map->map_id); + } + + // update size left of this flowset + size_left -= size_required; + DataPtr = DataPtr + size_required+4; // +4 for header + if ( size_left < 4 ) { + // pading + dbg_printf("Skip %u bytes padding\n", size_left); + size_left = 0; + } + } + +} // End of Process_ipfix_template_add + +static inline void Process_ipfix_template_withdraw(exporter_ipfix_domain_t *exporter, void *DataPtr, uint32_t size_left, FlowSource_t *fs) { +ipfix_template_record_t *ipfix_template_record; + + // a template flowset can contain multiple records ( templates ) + while ( size_left ) { + uint32_t id, count; + + // map next record. + ipfix_template_record = (ipfix_template_record_t *)DataPtr; + size_left -= 4; + + id = ntohs(ipfix_template_record->TemplateID); + count = ntohs(ipfix_template_record->FieldCount); + + if ( id == IPFIX_TEMPLATE_FLOWSET_ID ) { + // withdraw all templates + remove_all_translation_tables(exporter); + ReInitExtensionMapList(fs); + } else { + remove_translation_table(fs, exporter, id); + } + + DataPtr = DataPtr + 4; + if ( size_left < 4 ) { + // pading + dbg_printf("Skip %u bytes padding\n", size_left); + size_left = 0; + } + } + +} // End of Process_ipfix_template_withdraw + +static inline void Process_ipfix_option_templates(exporter_ipfix_domain_t *exporter, void *option_template_flowset, FlowSource_t *fs) { +void *DataPtr; +uint32_t size_left, size_required, i; +// uint32_t nr_scopes, nr_options; +uint16_t id, field_count, scope_field_count, offset, sampler_id_length; +uint16_t offset_sampler_id, offset_sampler_mode, offset_sampler_interval, found_sampler; +uint16_t offset_std_sampler_interval, offset_std_sampler_algorithm, found_std_sampling; + + i = 0; // keep compiler happy + size_left = GET_FLOWSET_LENGTH(option_template_flowset) - 4; // -4 for flowset header -> id and length + if ( size_left < 6 ) { + syslog(LOG_ERR, "Process_ipfix: [%u] option template length error: size left %u too small for an options template", + exporter->info.id, size_left); + return; + } + + DataPtr = option_template_flowset + 4; + id = GET_OPTION_TEMPLATE_ID(DataPtr); + field_count = GET_OPTION_TEMPLATE_FIELD_COUNT(DataPtr); + scope_field_count = GET_OPTION_TEMPLATE_SCOPE_FIELD_COUNT(DataPtr); + DataPtr += 6; + size_left -= 6; + + if ( scope_field_count == 0 ) { + syslog(LOG_ERR, "Process_ipfx: [%u] scope field count error: length must not be zero", + exporter->info.id); + dbg_printf("scope field count error: length must not be zero\n"); + return; + } + + size_required = field_count * 2 * sizeof(uint16_t); + dbg_printf("Size left: %u, size required: %u\n", size_left, size_required); + if ( size_left < size_required ) { + syslog(LOG_ERR, "Process_ipfix: [%u] option template length error: size left %u too small for %u scopes length and %u options length", + exporter->info.id, size_left, field_count, scope_field_count); + dbg_printf("option template length error: size left %u too small for field_count %u\n", + size_left, field_count); + return; + } + + dbg_printf("Decode Option Template. id: %u, field count: %u, scope field count: %u\n", + id, field_count, scope_field_count); + + if ( scope_field_count == 0 ) { + syslog(LOG_ERR, "Process_ipfxi: [%u] scope field count error: length must not be zero", + exporter->info.id); + return; + } + + for ( i=0; iinfo.id, size_left, field_count, scope_field_count); + dbg_printf("option template length error: size left %u too small for field_count %u\n", + size_left, field_count); + return; + } + enterprise_value = Get_val32(DataPtr); + DataPtr += 4; + dbg_printf(" [%i] Enterprise: 1, scope id: %u, scope length %u enterprise value: %u\n", + i, id, length, enterprise_value); + } else { + dbg_printf(" [%i] Enterprise: 0, scope id: %u, scope length %u\n", i, id, length); + } + } + for ( ;iinfo.id, size_left, field_count, scope_field_count); + dbg_printf("option template length error: size left %u too small for field_count %u\n", + size_left, field_count); + return; + } + enterprise_value = Get_val32(DataPtr); + DataPtr += 4; + dbg_printf(" [%i] Enterprise: 1, option id: %u, option length %u enterprise value: %u\n", + i, id, length, enterprise_value); + } else { + dbg_printf(" [%i] Enterprise: 0, option id: %u, option length %u\n", i, id, length); + } + } + + sampler_id_length = 0; + offset_sampler_id = 0; + offset_sampler_mode = 0; + offset_sampler_interval = 0; + offset_std_sampler_interval = 0; + offset_std_sampler_algorithm = 0; + found_sampler = 0; + found_std_sampling = 0; + offset = 0; + +/* XXX + XXX Sampling for IPFIX not yet implemented due to lack of data and information + switch (type) { + // general sampling + case NF9_SAMPLING_INTERVAL: + offset_std_sampler_interval = offset; + found_std_sampling++; + break; + case NF9_SAMPLING_ALGORITHM: + offset_std_sampler_algorithm = offset; + found_std_sampling++; + break; + + // individual samplers + case NF9_FLOW_SAMPLER_ID: + offset_sampler_id = offset; + sampler_id_length = length; + found_sampler++; + break; + case FLOW_SAMPLER_MODE: + offset_sampler_mode = offset; + found_sampler++; + break; + case NF9_FLOW_SAMPLER_RANDOM_INTERVAL: + offset_sampler_interval = offset; + found_sampler++; + break; + } + offset += length; + if ( found_sampler == 3 ) { // need all three tags + dbg_printf("[%u] Sampling information found\n", exporter->info.id); + InsertSamplerOffset(fs, id, offset_sampler_id, sampler_id_length, offset_sampler_mode, offset_sampler_interval); + } else if ( found_std_sampling == 2 ) { // need all two tags + dbg_printf("[%u] Std sampling information found\n", exporter->info.id); + InsertStdSamplerOffset(fs, id, offset_std_sampler_interval, offset_std_sampler_algorithm); + } else { + dbg_printf("[%u] No Sampling information found\n", exporter->info.id); + } +*/ + dbg_printf("\n"); + processed_records++; + +} // End of Process_ipfix_option_templates + + +static inline void Process_ipfix_data(exporter_ipfix_domain_t *exporter, void *data_flowset, FlowSource_t *fs, input_translation_t *table ){ +uint64_t sampling_rate; +uint32_t size_left; +uint8_t *in, *out; +int i; +char *string; + + size_left = GET_FLOWSET_LENGTH(data_flowset) - 4; // -4 for data flowset header -> id and length + + // map input buffer as a byte array + in = (uint8_t *)(data_flowset + 4); // skip flowset header + + dbg_printf("[%u] Process data flowset size: %u\n", exporter->info.id, size_left); + + + // Check if sampling is announced + sampling_rate = 1; +/* ### + if ( table->sampler_offset && fs->sampler ) { + uint32_t sampler_id; + if ( table->sampler_size == 2 ) { + sampler_id = Get_val16((void *)&in[table->sampler_offset]); + } else { + sampler_id = in[table->sampler_offset]; + } + if ( fs->sampler[sampler_id] ) { + sampling_rate = fs->sampler[sampler_id]->interval; + dbg_printf("[%u] Sampling ID %u available\n", exporter->info.id, sampler_id); + dbg_printf("[%u] Sampler_offset : %u\n", exporter->info.id, table->sampler_offset); + dbg_printf("[%u] Sampler Data : %s\n", exporter->info.id, fs->sampler == NULL ? "not available" : "available"); + dbg_printf("[%u] Sampling rate: %llu\n", exporter->info.id, (long long unsigned)sampling_rate); + } else { + sampling_rate = default_sampling; + dbg_printf("[%u] Sampling ID %u not (yet) available\n", exporter->info.id, sampler_id); + } + + } else if ( fs->std_sampling.interval > 0 ) { + sampling_rate = fs->std_sampling.interval; + dbg_printf("[%u] Std sampling available for this flow source: Rate: %llu\n", exporter->info.id, (long long unsigned)sampling_rate); + } else { + sampling_rate = default_sampling; + dbg_printf("[%u] No Sampling record found\n", exporter->info.id); + } +### */ + if ( overwrite_sampling > 0 ) { + sampling_rate = overwrite_sampling; + dbg_printf("[%u] Hard overwrite sampling rate: %llu\n", exporter->info.id, (long long unsigned)sampling_rate); + } + + if ( sampling_rate != 1 ) + SetFlag(table->flags, FLAG_SAMPLED); + + while (size_left) { + common_record_t *data_record; + + if ( (size_left < table->input_record_size) ) { + if ( size_left > 3 ) { + syslog(LOG_WARNING,"Process_ipfix: Corrupt data flowset? Pad bytes: %u", size_left); + dbg_printf("Process_ipfix: Corrupt data flowset? Pad bytes: %u, table record_size: %u\n", + size_left, table->input_record_size); + } + size_left = 0; + continue; + } + + // check for enough space in output buffer + if ( !CheckBufferSpace(fs->nffile, table->output_record_size) ) { + // this should really never occur, because the buffer gets flushed ealier + syslog(LOG_ERR,"Process_ipfix: output buffer size error. Abort ipfix record processing"); + dbg_printf("Process_ipfix: output buffer size error. Abort ipfix record processing"); + return; + } + processed_records++; + exporter->PacketSequence++; + + // map file record to output buffer + data_record = (common_record_t *)fs->nffile->buff_ptr; + // map output buffer as a byte array + out = (uint8_t *)data_record; + + dbg_printf("[%u] Process data record: %u addr: %llu, in record size: %u, buffer size_left: %u\n", + exporter->info.id, processed_records, (long long unsigned)((ptrdiff_t)in - (ptrdiff_t)data_flowset), + table->input_record_size, size_left); + + // fill the data record + data_record->flags = table->flags; + data_record->size = table->output_record_size; + data_record->type = CommonRecordType; + data_record->ext_map = table->extension_info.map->map_id; + data_record->exporter_sysid = exporter->info.sysid; + data_record->reserved = 0; + + table->flow_start = 0; + table->flow_end = 0; + table->packets = 0; + table->bytes = 0; + table->out_packets = 0; + table->out_bytes = 0; + + // apply copy and processing sequence + for ( i=0; inumber_of_sequences; i++ ) { + int input_offset = table->sequence[i].input_offset; + int output_offset = table->sequence[i].output_offset; + void *stack = table->sequence[i].stack; + switch (table->sequence[i].id) { + case nop: + break; + case move8: + out[output_offset] = in[input_offset]; + break; + case move16: + *((uint16_t *)&out[output_offset]) = Get_val16((void *)&in[input_offset]); + break; + case move32: + *((uint32_t *)&out[output_offset]) = Get_val32((void *)&in[input_offset]); + break; + case move40: + /* 64bit access to potentially unaligned output buffer. use 2 x 32bit for _LP64 CPUs */ + { type_mask_t t; + + t.val.val64 = Get_val40((void *)&in[input_offset]); + *((uint32_t *)&out[output_offset]) = t.val.val32[0]; + *((uint32_t *)&out[output_offset+4]) = t.val.val32[1]; + } + break; + case move48: + /* 64bit access to potentially unaligned output buffer. use 2 x 32bit for _LP64 CPUs */ + { type_mask_t t; + t.val.val64 = Get_val48((void *)&in[input_offset]); + *((uint32_t *)&out[output_offset]) = t.val.val32[0]; + *((uint32_t *)&out[output_offset+4]) = t.val.val32[1]; + } + break; + case move56: + /* 64bit access to potentially unaligned output buffer. use 2 x 32bit for _LP64 CPUs */ + { type_mask_t t; + + t.val.val64 = Get_val56((void *)&in[input_offset]); + *((uint32_t *)&out[output_offset]) = t.val.val32[0]; + *((uint32_t *)&out[output_offset+4]) = t.val.val32[1]; + } + break; + case move64: + { type_mask_t t; + t.val.val64 = Get_val64((void *)&in[input_offset]); + + *((uint32_t *)&out[output_offset]) = t.val.val32[0]; + *((uint32_t *)&out[output_offset+4]) = t.val.val32[1]; + } break; + case move128: + /* 64bit access to potentially unaligned output buffer. use 2 x 32bit for _LP64 CPUs */ + { type_mask_t t; + + t.val.val64 = Get_val64((void *)&in[input_offset]); + *((uint32_t *)&out[output_offset]) = t.val.val32[0]; + *((uint32_t *)&out[output_offset+4]) = t.val.val32[1]; + + t.val.val64 = Get_val64((void *)&in[input_offset+8]); + *((uint32_t *)&out[output_offset+8]) = t.val.val32[0]; + *((uint32_t *)&out[output_offset+12]) = t.val.val32[1]; + } break; + case move32_sampling: + /* 64bit access to potentially unaligned output buffer. use 2 x 32bit for _LP64 CPUs */ + { type_mask_t t; + t.val.val64 = Get_val32((void *)&in[input_offset]); + t.val.val64 *= sampling_rate; + *((uint32_t *)&out[output_offset]) = t.val.val32[0]; + *((uint32_t *)&out[output_offset+4]) = t.val.val32[1]; + *(uint64_t *)stack = t.val.val64; + } break; + case move64_sampling: + /* 64bit access to potentially unaligned output buffer. use 2 x 32bit for _LP64 CPUs */ + { type_mask_t t; + t.val.val64 = Get_val64((void *)&in[input_offset]); + + t.val.val64 *= sampling_rate; + *((uint32_t *)&out[output_offset]) = t.val.val32[0]; + *((uint32_t *)&out[output_offset+4]) = t.val.val32[1]; + *(uint64_t *)stack = t.val.val64; + } break; + case Time64Mili: + { uint64_t DateMiliseconds = Get_val64((void *)&in[input_offset]); + *(uint64_t *)stack = DateMiliseconds; + + } break; + case move_mac: + /* 64bit access to potentially unaligned output buffer. use 2 x 32bit for _LP64 CPUs */ + { type_mask_t t; + + t.val.val64 = Get_val48((void *)&in[input_offset]); + *((uint32_t *)&out[output_offset]) = t.val.val32[0]; + *((uint32_t *)&out[output_offset+4]) = t.val.val32[1]; + } + break; + case zero8: + out[output_offset] = 0; + break; + case zero16: + *((uint16_t *)&out[output_offset]) = 0; + break; + case zero32: + *((uint32_t *)&out[output_offset]) = 0; + break; + case zero64: + *((uint64_t *)&out[output_offset]) = 0; + break; + case zero128: + *((uint64_t *)&out[output_offset]) = 0; + *((uint64_t *)&out[output_offset+8]) = 0; + break; + + default: + syslog(LOG_ERR, "Process_ipfix: Software bug! Unknown Sequence: %u. at %s line %d", + table->sequence[i].id, __FILE__, __LINE__); + dbg_printf("Software bug! Unknown Sequence: %u. at %s line %d\n", + table->sequence[i].id, __FILE__, __LINE__); + } + } + + // for netflow historical reason, ICMP type/code goes into dst port field + if ( data_record->prot == IPPROTO_ICMP || data_record->prot == IPPROTO_ICMPV6 ) { + if ( table->ICMP_offset ) { + data_record->srcport = 0; + data_record->dstport = Get_val16((void *)&in[table->ICMP_offset]); + } + } + + // check, if we need to store the packet received time + if ( table->received_offset ) { + type_mask_t t; + t.val.val64 = (uint64_t)((uint64_t)fs->received.tv_sec * 1000LL) + (uint64_t)((uint64_t)fs->received.tv_usec / 1000LL); + *((uint32_t *)&out[table->received_offset]) = t.val.val32[0]; + *((uint32_t *)&out[table->received_offset+4]) = t.val.val32[1]; + } + + // split first/last time into epoch/msec values + data_record->first = table->flow_start / 1000; + data_record->msec_first = table->flow_start % 1000; + + data_record->last = table->flow_end / 1000; + data_record->msec_last = table->flow_end % 1000; + + // update first_seen, last_seen + if ( table->flow_start < fs->first_seen ) + fs->first_seen = table->flow_start; + if ( table->flow_end > fs->last_seen ) + fs->last_seen = table->flow_end; + + // check if we need to record the router IP address + if ( table->router_ip_offset ) { + int output_offset = table->router_ip_offset; + if ( exporter->info.sa_family == PF_INET6 ) { + // 64bit access to potentially unaligned output buffer. use 2 x 32bit for _LP64 CPUs + type_mask_t t; + + t.val.val64 = exporter->info.ip.v6[0]; + *((uint32_t *)&out[output_offset]) = t.val.val32[0]; + *((uint32_t *)&out[output_offset+4]) = t.val.val32[1]; + + t.val.val64 = exporter->info.ip.v6[1]; + *((uint32_t *)&out[output_offset+8]) = t.val.val32[0]; + *((uint32_t *)&out[output_offset+12]) = t.val.val32[1]; + } else { + *((uint32_t *)&out[output_offset]) = exporter->info.ip.v4; + } + } + + switch (data_record->prot ) { // switch protocol of + case IPPROTO_ICMP: + fs->nffile->stat_record->numflows_icmp++; + fs->nffile->stat_record->numpackets_icmp += table->packets; + fs->nffile->stat_record->numbytes_icmp += table->bytes; + fs->nffile->stat_record->numpackets_icmp += table->out_packets; + fs->nffile->stat_record->numbytes_icmp += table->out_bytes; + break; + case IPPROTO_TCP: + fs->nffile->stat_record->numflows_tcp++; + fs->nffile->stat_record->numpackets_tcp += table->packets; + fs->nffile->stat_record->numbytes_tcp += table->bytes; + fs->nffile->stat_record->numpackets_tcp += table->out_packets; + fs->nffile->stat_record->numbytes_tcp += table->out_bytes; + break; + case IPPROTO_UDP: + fs->nffile->stat_record->numflows_udp++; + fs->nffile->stat_record->numpackets_udp += table->packets; + fs->nffile->stat_record->numbytes_udp += table->bytes; + fs->nffile->stat_record->numpackets_udp += table->out_packets; + fs->nffile->stat_record->numbytes_udp += table->out_bytes; + break; + default: + fs->nffile->stat_record->numflows_other++; + fs->nffile->stat_record->numpackets_other += table->packets; + fs->nffile->stat_record->numbytes_other += table->bytes; + fs->nffile->stat_record->numpackets_other += table->out_packets; + fs->nffile->stat_record->numbytes_other += table->out_bytes; + } + exporter->flows++; + fs->nffile->stat_record->numflows++; + fs->nffile->stat_record->numpackets += table->packets; + fs->nffile->stat_record->numbytes += table->bytes; + fs->nffile->stat_record->numpackets += table->out_packets; + fs->nffile->stat_record->numbytes += table->out_bytes; + + if ( fs->xstat ) { + uint32_t bpp = table->packets ? table->bytes/table->packets : 0; + if ( bpp > MAX_BPP ) + bpp = MAX_BPP; + if ( data_record->prot == IPPROTO_TCP ) { + fs->xstat->bpp_histogram->tcp.bpp[bpp]++; + fs->xstat->bpp_histogram->tcp.count++; + + fs->xstat->port_histogram->src_tcp.port[data_record->srcport]++; + fs->xstat->port_histogram->dst_tcp.port[data_record->dstport]++; + fs->xstat->port_histogram->src_tcp.count++; + fs->xstat->port_histogram->dst_tcp.count++; + } else if ( data_record->prot == IPPROTO_UDP ) { + fs->xstat->bpp_histogram->udp.bpp[bpp]++; + fs->xstat->bpp_histogram->udp.count++; + + fs->xstat->port_histogram->src_udp.port[data_record->srcport]++; + fs->xstat->port_histogram->dst_udp.port[data_record->dstport]++; + fs->xstat->port_histogram->src_udp.count++; + fs->xstat->port_histogram->dst_udp.count++; + } + } + + if ( verbose ) { + master_record_t master_record; + ExpandRecord_v2((common_record_t *)data_record, &(table->extension_info), &(exporter->info), &master_record); + format_file_block_record(&master_record, &string, 0); + printf("%s\n", string); + } + + fs->nffile->block_header->size += data_record->size; + fs->nffile->block_header->NumRecords++; + fs->nffile->buff_ptr = (common_record_t *)((pointer_addr_t)data_record + data_record->size); + + // advance input + size_left -= table->input_record_size; + in += table->input_record_size; + + // buffer size sanity check + if ( fs->nffile->block_header->size > BUFFSIZE ) { + // should never happen + syslog(LOG_ERR,"### Software error ###: %s line %d", __FILE__, __LINE__); + syslog(LOG_ERR,"Process ipfix: Output buffer overflow! Flush buffer and skip records."); + syslog(LOG_ERR,"Buffer size: %u > %u", fs->nffile->block_header->size, BUFFSIZE); + + // reset buffer + fs->nffile->block_header->size = 0; + fs->nffile->block_header->NumRecords = 0; + fs->nffile->buff_ptr = (void *)((pointer_addr_t)fs->nffile->block_header + sizeof(data_block_header_t) ); + return; + } + + } + +} // End of Process_ipfix_data + +void Process_IPFIX(void *in_buff, ssize_t in_buff_cnt, FlowSource_t *fs) { +exporter_ipfix_domain_t *exporter; +ssize_t size_left; +uint32_t ExportTime, ObservationDomain, Sequence, flowset_length; +ipfix_header_t *ipfix_header; +void *flowset_header; +#ifdef DEVEL +static uint32_t packet_cntr = 0; +#endif + + size_left = in_buff_cnt; + if ( size_left < IPFIX_HEADER_LENGTH ) { + syslog(LOG_ERR, "Process_ipfix: Too little data for ipfix packet: '%lli'", (long long)size_left); + return; + } + + ipfix_header = (ipfix_header_t *)in_buff; + ObservationDomain = ntohl(ipfix_header->ObservationDomain); + ExportTime = ntohl(ipfix_header->ExportTime); + Sequence = ntohl(ipfix_header->LastSequence); + + exporter = GetExporter(fs, ipfix_header); + if ( !exporter ) { + syslog(LOG_ERR,"Process_ipfix: Exporter NULL: Abort ipfix record processing"); + return; + } + exporter->packets++; + //exporter->PacketSequence = Sequence; + flowset_header = (void *)ipfix_header + IPFIX_HEADER_LENGTH; + size_left -= IPFIX_HEADER_LENGTH; + + dbg_printf("\n[%u] Next packet: %u, exported: %s, TemplateRecords: %llu, DataRecords: %llu, buffer: %li \n", + ObservationDomain, packet_cntr++, UNIX2ISO(ExportTime), (long long unsigned)exporter->TemplateRecords, + (long long unsigned)exporter->DataRecords, size_left); + + dbg_printf("[%u] Sequence: %u\n", ObservationDomain, Sequence); + + // sequence check + // 2^32 wrap is handled automatically as both counters overflow + if ( Sequence != exporter->PacketSequence ) { + if ( exporter->DataRecords != 0 ) { + // sync sequence on first data record without error report + fs->nffile->stat_record->sequence_failure++; + exporter->sequence_failure++; + dbg_printf("[%u] Sequence check failed: last seq: %u, seq %u\n", + exporter->info.id, Sequence, exporter->PacketSequence); + /* maybee to noise onbuggy exporters + syslog(LOG_ERR, "Process_ipfix [%u] Sequence error: last seq: %u, seq %u\n", + info.id, exporter->LastSequence, Sequence); + */ + } else { + dbg_printf("[%u] Sync Sequence: %u\n", exporter->info.id, Sequence); + } + exporter->PacketSequence = Sequence; + } else { + dbg_printf("[%u] Sequence check ok\n", exporter->info.id); + } + + // iterate over all set + flowset_length = 0; + while (size_left) { + uint16_t flowset_id; + + flowset_header = flowset_header + flowset_length; + + flowset_id = GET_FLOWSET_ID(flowset_header); + flowset_length = GET_FLOWSET_LENGTH(flowset_header); + + dbg_printf("Process_ipfix: Next flowset %u, length %u.\n", flowset_id, flowset_length); + + if ( flowset_length == 0 ) { + /* this should never happen, as 4 is an empty flowset + and smaller is an illegal flowset anyway ... + if it happends, we can't determine the next flowset, so skip the entire export packet + */ + syslog(LOG_ERR,"Process_ipfix: flowset zero length error."); + dbg_printf("Process_ipfix: flowset zero length error.\n"); + return; + + } + + // possible padding + if ( flowset_length <= 4 ) { + size_left = 0; + continue; + } + + if ( flowset_length > size_left ) { + syslog(LOG_ERR,"Process_ipfix: flowset length error. Expected bytes: %u > buffersize: %lli", + flowset_length, (long long)size_left); + size_left = 0; + continue; + } + + + switch (flowset_id) { + case IPFIX_TEMPLATE_FLOWSET_ID: + // Process_ipfix_templates(exporter, flowset_header, fs); + exporter->TemplateRecords++; + dbg_printf("Process template flowset, length: %u\n", flowset_length); + Process_ipfix_templates(exporter, flowset_header, flowset_length, fs); + break; + case IPFIX_OPTIONS_FLOWSET_ID: + // option_flowset = (option_template_flowset_t *)flowset_header; + exporter->TemplateRecords++; + dbg_printf("Process option template flowset, length: %u\n", flowset_length); + Process_ipfix_option_templates(exporter, flowset_header, fs); + break; + default: { + if ( flowset_id < IPFIX_MIN_RECORD_FLOWSET_ID ) { + dbg_printf("Invalid flowset id: %u. Skip flowset\n", flowset_id); + syslog(LOG_ERR,"Process_ipfix: Invalid flowset id: %u. Skip flowset", flowset_id); + } else { + input_translation_t *table; + dbg_printf("Process data flowset, length: %u\n", flowset_length); + table = GetTranslationTable(exporter, flowset_id); + if ( table ) { + Process_ipfix_data(exporter, flowset_header, fs, table); + exporter->DataRecords++; + } else if ( HasOptionTable(fs, flowset_id) ) { + // Process_ipfix_option_data(exporter, flowset_header, fs); + } else { + // maybe a flowset with option data + dbg_printf("Process ipfix: [%u] No table for id %u -> Skip record\n", + exporter->info.id, flowset_id); + } + + } + } + } // End of switch + + // next record + size_left -= flowset_length; + + } // End of while + +} // End of Process_IPFIX + diff --git a/bin/ipfix.h b/bin/ipfix.h new file mode 100644 index 0000000..71b3c6a --- /dev/null +++ b/bin/ipfix.h @@ -0,0 +1,268 @@ +/* + * Copyright (c) 2014, Peter Haag + * Copyright (c) 2009, Peter Haag + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of the author nor the names of its contributors may be + * used to endorse or promote products derived from this software without + * specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 COPYRIGHT OWNER 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. + * + * $Author:$ + * + * $Id:$ + * + * $LastChangedRevision:$ + * + */ + +#ifndef _IPFIX_H +#define _IPFIX_H 1 + +/* reference: http://tools.ietf.org/html/draft-ietf-ipfix-protocol-rfc5101bis-00 */ + +typedef struct ipfix_header { + uint16_t Version; // set to 10 for IPFIX + uint16_t Length; // Total length incl. this header. up to 65535 bytes + uint32_t ExportTime; // UNIC epoch export Time of flow. + uint32_t LastSequence; // Incremental sequence counter modulo 2^32 of all IPFIX Data Records + uint32_t ObservationDomain; // identifier , unique to the exporter +} ipfix_header_t; + +#define IPFIX_HEADER_LENGTH sizeof(ipfix_header_t) + +/* + Message Header Field Descriptions: + + Version + + Version of Flow Record format exported in this message. The value + of this field is 0x000a for the current version, incrementing by + one the version used in the NetFlow services export version 9 + [RFC3954]. + + Length + + Total length of the IPFIX Message, measured in octets, including + Message Header and Set(s). + + Export Time + + Time at which the IPFIX Message Header leaves the Exporter, + expressed in seconds since the UNIX epoch of 1 January 1970 at + 00:00 UTC, encoded as an unsigned 32-bit integer. + + Sequence Number + + Incremental sequence counter modulo 2^32 of all IPFIX Data Records + sent on this PR-SCTP stream from the current Observation Domain by + the Exporting Process. Check the specific meaning of this field + in the subsections of Section 10 when UDP or TCP is selected as + the transport protocol. This value SHOULD be used by the + Collecting Process to identify whether any IPFIX Data Records have + been missed. Template and Options Template Records do not + increase the Sequence Number. + + Observation Domain ID + + A 32-bit identifier of the Observation Domain that is locally + unique to the Exporting Process. The Exporting Process uses the + Observation Domain ID to uniquely identify to the Collecting + Process the Observation Domain that metered the Flows. It is + RECOMMENDED that this identifier also be unique per IPFIX Device. + + Collecting Processes SHOULD use the Transport Session and the + Observation Domain ID field to separate different export streams + originating from the same Exporter. The Observation Domain ID + SHOULD be 0 when no specific Observation Domain ID is relevant for + the entire IPFIX Message, for example, when exporting the + Exporting Process Statistics, or in case of a hierarchy of + Collectors when aggregated Data Records are exported. + +*/ + +/* set format: + A Set has the format shown in Figure H. The record types can be + either Template Records, Options Template Records, or Data Records. + The record types MUST NOT be mixed within a Set. + + +--------------------------------------------------+ + | Set Header | + +--------------------------------------------------+ + | record | + +--------------------------------------------------+ + | record | + +--------------------------------------------------+ + ... + +--------------------------------------------------+ + | record | + +--------------------------------------------------+ + | Padding (opt.) | + +--------------------------------------------------+ +*/ + +typedef struct set_header_s { + uint16_t SetID; // SetIDs: + // 0, 1: not used + // 2: Template Set + // 3: Options Template Set +#define IPFIX_TEMPLATE_FLOWSET_ID 2 +#define IPFIX_OPTIONS_FLOWSET_ID 3 +#define IPFIX_MIN_RECORD_FLOWSET_ID 256 + uint16_t Length; // Length of bytes incl. this header + uint32_t records[1]; // pointer to records +} set_header_t; + +/* Template Record Format + The format of the Template Record is shown in Figure J. It consists + of a Template Record Header and one or more Field Specifiers. The + definition of the Field Specifiers is given in Figure G above. + + +--------------------------------------------------+ + | Template Record Header | + +--------------------------------------------------+ + | Field Specifier | + +--------------------------------------------------+ + | Field Specifier | + +--------------------------------------------------+ + ... + +--------------------------------------------------+ + | Field Specifier | + +--------------------------------------------------+ +*/ + +typedef struct ipfix_template_record_s { + uint16_t TemplateID; // Template ID: + // 0-255 reserved for Template Sets, Options Template Sets, + // and other reserved Sets yet to be created. + // 256-65535 Template IDs of Data Sets + uint16_t FieldCount; + uint32_t elements[1]; +} ipfix_template_record_t; + +/* Standard Information Elements + 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + |0| Information Element ident. | Field Length | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +*/ +typedef struct ipfix_template_elements_std_s { + uint16_t Type; + uint16_t Length; +} ipfix_template_elements_std_t; + +/* enterprise-specific Information Elements + 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + |1| Information Element ident. | Field Length | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | Enterprise Number | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +*/ +typedef struct ipfix_template_elements_e_s { + uint16_t Type; + uint16_t Length; + uint32_t EnterpriseNumber; +} ipfix_template_elements_e_t; + +#define _1byte 1 +#define _2bytes 2 +#define _3bytes 3 +#define _4bytes 4 +#define _6bytes 6 +#define _8bytes 8 +#define _16bytes 16 + +// IPFIX std element definitios +// Flowset record types +#define IPFIX_octetDeltaCount 1 +#define IPFIX_packetDeltaCount 2 +// reserved 3 +#define IPFIX_FLOWS_AGGR 3 +#define IPFIX_protocolIdentifier 4 +#define IPFIX_ipClassOfService 5 +#define IPFIX_tcpControlBits 6 +#define IPFIX_SourceTransportPort 7 +#define IPFIX_SourceIPv4Address 8 +#define IPFIX_SourceIPv4PrefixLength 9 +#define IPFIX_ingressInterface 10 +#define IPFIX_DestinationTransportPort 11 +#define IPFIX_DestinationIPv4Address 12 +#define IPFIX_DestinationIPv4PrefixLength 13 +#define IPFIX_egressInterface 14 +#define IPFIX_ipNextHopIPv4Address 15 +#define IPFIX_bgpSourceAsNumber 16 +#define IPFIX_bgpDestinationAsNumber 17 +#define IPFIX_bgpNextHopIPv4Address 18 + +#define IPFIX_flowEndSysUpTime 21 +#define IPFIX_flowStartSysUpTime 22 +#define IPFIX_postOctetDeltaCount 23 +#define IPFIX_postPacketDeltaCount 24 +#define IPFIX_SourceIPv6Address 27 +#define IPFIX_DestinationIPv6Address 28 +#define IPFIX_SourceIPv6PrefixLength 29 +#define IPFIX_DestinationIPv6PrefixLength 30 +#define IPFIX_flowLabelIPv6 31 +#define IPFIX_icmpTypeCodeIPv4 32 +// reserved 34, 35 +// reserved 38, 39 +// reserved 48, 49, 50, 51 + +// #define IPFIX_MIN_TTL 52 +// #define IPFIX_MAX_TTL 53 +// #define IPFIX_IPV4_IDENT 54 + +#define IPFIX_postIpClassOfService 55 +#define IPFIX_SourceMacAddress 56 +#define IPFIX_postDestinationMacAddress 57 +#define IPFIX_vlanId 58 +#define IPFIX_postVlanId 59 + +#define IPFIX_flowDirection 61 +#define IPFIX_ipNextHopIPv6Address 62 +#define IPFIX_bgpNextHopIPv6Address 63 + +#define IPFIX_mplsTopLabelStackSection 70 +#define IPFIX_mplsLabelStackSection2 71 +#define IPFIX_mplsLabelStackSection3 72 +#define IPFIX_mplsLabelStackSection4 73 +#define IPFIX_mplsLabelStackSection5 74 +#define IPFIX_mplsLabelStackSection6 75 +#define IPFIX_mplsLabelStackSection7 76 +#define IPFIX_mplsLabelStackSection8 77 +#define IPFIX_mplsLabelStackSection9 78 +#define IPFIX_mplsLabelStackSection10 79 +#define IPFIX_DestinationMacAddress 80 +#define IPFIX_postSourceMacAddress 81 +#define IPFIX_octetTotalCount 85 +#define IPFIX_packetTotalCount 86 +#define IPFIX_flowStartMilliseconds 152 +#define IPFIX_flowEndMilliseconds 153 +// reserved 89 + +/* prototypes */ +int Init_IPFIX(void); + +void Process_IPFIX(void *in_buff, ssize_t in_buff_cnt, FlowSource_t *fs); + +#endif //_IPFIX_H 1 diff --git a/bin/ipfrag.c b/bin/ipfrag.c new file mode 100644 index 0000000..044c93b --- /dev/null +++ b/bin/ipfrag.c @@ -0,0 +1,302 @@ +/* + * Copyright (c) 2014, Peter Haag + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of the author nor the names of its contributors may be + * used to endorse or promote products derived from this software without + * specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 COPYRIGHT OWNER 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. + * + * $Author: phaag $ + * + * $Id: ipfrag.c 40874 2014-03-06 09:58:20Z phaag $ + * + * $LastChangedRevision: 40874 $ + * + */ + +#include "config.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "util.h" +#include "rbtree.h" +#include "ipfrag.h" + +#ifndef DEVEL +# define dbg_printf(...) /* printf(__VA_ARGS__) */ +#else +# define dbg_printf(...) printf(__VA_ARGS__) +#endif + +#define KEYLEN (offsetof(IPFragNode_t,data_size) - offsetof(IPFragNode_t, src_addr)) +static int IPFragNodeCMP(struct IPFragNode *e1, struct IPFragNode *e2); + +static struct IPFragNode *New_node(void); + +static void Free_node(struct IPFragNode *node, int free_data); + +static void Remove_node(struct IPFragNode *node); + +// Insert the IP RB tree code here +RB_GENERATE(IPFragTree, IPFragNode, entry, IPFragNodeCMP); + +static IPFragTree_t *IPFragTree; + +static int IPFragNodeCMP(struct IPFragNode *e1, struct IPFragNode *e2) { +uint32_t *a = &e1->src_addr; +uint32_t *b = &e2->src_addr; +int i; + + // 2 x sizeof(uint32_t) (8) + frag_offset == 12 + i = memcmp((void *)a, (void *)b, KEYLEN ); + return i; + +} // End of IPFragNodeCMP + +static struct IPFragNode *New_node(void) { +struct IPFragNode *node; + + node = malloc(sizeof(struct IPFragNode)); + if ( !node ) { + LogError("malloc() error in %s line %d: %s", __FILE__, __LINE__, strerror(errno) ); + return NULL; + } + memset((void *)node, 0, sizeof(struct IPFragNode)); + + node->data = malloc(IP_MAXPACKET); + if ( !node->data ) { + LogError("malloc() error in %s line %d: %s", __FILE__, __LINE__, strerror(errno) ); + free(node); + return NULL; + } + memset(node->data, 0, IP_MAXPACKET); + + node->eod = node->data; + node->data_size = 0; + + node->holes = malloc(sizeof(hole_t)); + if ( !node->holes ) { + LogError("malloc() error in %s line %d: %s", __FILE__, __LINE__, strerror(errno) ); + free(node); + return NULL; + } + node->holes->next = NULL; + node->holes->first = 0; + node->holes->last = IP_MAXPACKET; + + return node; + +} // End of New_node + +static void Free_node(struct IPFragNode *node, int free_data) { +hole_t *hole, *h; + + hole = node->holes; + while (hole) { + h = hole->next; + free(hole); + hole = h; + } + if ( free_data) + free(node->data); + free(node); + +} // End of Free_node + +static void Remove_node(struct IPFragNode *node) { +struct IPFragNode *n; + + n = RB_REMOVE(IPFragTree, IPFragTree, node); + if ( n ) { + Free_node(n, 0); + } // else - node not in tree + +} // End of Remove_node + +int IPFragTree_init(void) { + IPFragTree = malloc(sizeof(IPFragTree_t)); + if ( !IPFragTree ) { + LogError("malloc() error in %s line %d: %s", __FILE__, __LINE__, strerror(errno) ); + return 0; + } + RB_INIT(IPFragTree); + dbg_printf("IPFrag key len: %lu\n", KEYLEN); + return 1; +} // End of IPFragTree_init + +void IPFragTree_free(void) { +struct IPFragNode *node, *nxt; + + // Dump all incomplete flows to the file + for (node = RB_MIN(IPFragTree, IPFragTree); node != NULL; node = nxt) { + nxt = RB_NEXT(IPFragTree, IPFragTree, node); + RB_REMOVE(IPFragTree, IPFragTree, node); + Free_node(node, 1); + } + + free(IPFragTree); + IPFragTree = NULL; +} // End of IPFragTree_free + +void *IPFrag_tree_Update(uint32_t src, uint32_t dst, uint32_t ident, uint32_t *length, uint32_t ip_off, void *data) { +struct IPFragNode FindNode, *n; +hole_t *hole, *h, *hole_parent; +uint16_t more_fragments, first, last, max; +int found_hole; + + FindNode.src_addr = src; + FindNode.dst_addr = dst; + FindNode.ident = ident; + n = RB_FIND(IPFragTree, IPFragTree, &FindNode); + if ( !n ) { + n = New_node(); + n->src_addr = src; + n->dst_addr = dst; + n->ident = ident; + if ( RB_INSERT(IPFragTree, IPFragTree, n) ) { + // must never happen + LogError("Node insert returned existing node - Software error in %s line %d", __FILE__, __LINE__); + } + } + hole = n->holes; + hole_parent = NULL; + + first = (ip_off & IP_OFFMASK) << 3; + more_fragments = (ip_off & IP_MF) != 0 ? 1 : 0; + last = first + *length - 1; + + if ( last > IP_MAXPACKET ) { + LogError("Fragment assembly error: last > IP_MAXPACKET"); + LogError("Fraget assembly: first: %u, last: %u, MF: %u\n", first, last, more_fragments); + return NULL; + } + + // last fragment - sets max offset + found_hole = 0; + max = more_fragments == 0 ? last : 0; + dbg_printf("Fraget assembly: first: %u, last: %u, MF: %u\n", first, last, more_fragments); + while (hole) { + uint16_t hole_last; + if ( max ) { + dbg_printf("max in last fragment: %u\n", max); + // last fragment offset/length + if ( hole->last == IP_MAXPACKET ) { + // last fragment has max size + if ( max > hole->first ) { + dbg_printf("set max of last fragment: %u\n", max); + hole->last = max; + } else { + LogError("last fragment offset error - teardrop attack??"); + } + } else { + // last fragment must always be max offset + if ( max < hole->last ) { + LogError("last fragment offset error - teardrop attack??"); + } + } + } + dbg_printf("Check Hole: first: %u, last: %u\n", hole->first, hole->last); + + if ( first > hole->last ) { + hole_parent = hole; + hole = hole->next; + dbg_printf("Fragment right outside hole\n"); + continue; + } + if ( last < hole->first ) { + hole_parent = hole; + hole = hole->next; + dbg_printf("Fragment left outside hole\n"); + continue; + } + + // fragment fits into hole + found_hole = 1; + if ( last > n->data_size ) + n->data_size = last; + + hole_last = hole->last; + if ( first == hole->first ) { + dbg_printf("Fragment matches first\n"); + // fragment fits at beginning of hole + if ( last == hole->last ) { + dbg_printf("Fragment matches last\n"); + // fragment fits completly into hole - delete hole + if ( hole_parent ) { + hole_parent->next = hole->next; + } else { + n->holes = NULL; + } + free(hole); + hole = NULL; + } else { + // fragment smaller than hole + dbg_printf("Fragment smaller than hole\n"); + hole->first = last+1; + } + } else { + // fragment start within hole + dbg_printf("Fragment inside hole\n"); + hole->last = first - 1; + if ( last < hole_last ) { + // fragment ends within hole - add another hole + h = malloc(sizeof(hole_t)); + if ( !h ) { + LogError("malloc() error in %s line %d: %s", __FILE__, __LINE__, strerror(errno) ); + return NULL; + } + h->first = last + 1; + h->last = hole_last; + h->next = n->holes; + n->holes = h; + } + } + memcpy(n->data + first, data, *length); + + break; + } + + if ( !found_hole ) + LogError("No space - Fragment overlap: first: %u, last: %u\n", first, last); + + if ( n->holes == NULL ) { + void *data = n->data; + n->data_size++; + *length = n->data_size; + Remove_node(n); + dbg_printf("Datagramm complete - size: %u\n", n->data_size); + return data; + } else { + return NULL; + } + +} // End of IPFrag_tree_Update diff --git a/bin/ipfrag.h b/bin/ipfrag.h new file mode 100644 index 0000000..ca2dcb9 --- /dev/null +++ b/bin/ipfrag.h @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2014, Peter Haag + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of the author nor the names of its contributors may be + * used to endorse or promote products derived from this software without + * specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 COPYRIGHT OWNER 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. + * + * $Author: phaag $ + * + * $Id: ipfrag.h 40691 2014-03-03 11:24:22Z phaag $ + * + * $LastChangedRevision: 40691 $ + * + */ + +typedef struct hole_s { + struct hole_s *next; + uint32_t first; + uint32_t last; +} hole_t; + +struct IPFragNode { + // tree + RB_ENTRY(IPFragNode) entry; + + // flow key + // IP addr + uint32_t src_addr; + uint32_t dst_addr; + uint32_t ident; + // End of flow key + + uint32_t data_size; + // packet data + void *data; + void *eod; + hole_t *holes; +}; + +typedef struct IPFragNode IPFragNode_t; + +/* flow tree type */ +typedef RB_HEAD(IPFragTree, IPFragNode) IPFragTree_t; + +// Insert the RB prototypes here +RB_PROTOTYPE(IPFragTree, IPFragNode, entry, IPFragNodeCMP); + +int IPFragTree_init(void); + +void IPFragTree_free(void); + +void *IPFrag_tree_Update(uint32_t src, uint32_t dst, uint32_t ident, uint32_t *length, uint32_t ip_off, void *data); + diff --git a/bin/launch.c b/bin/launch.c new file mode 100644 index 0000000..4475c7e --- /dev/null +++ b/bin/launch.c @@ -0,0 +1,440 @@ +/* + * Copyright (c) 2014, Peter Haag + * Copyright (c) 2009, Peter Haag + * Copyright (c) 2004-2008, SWITCH - Teleinformatikdienste fuer Lehre und Forschung + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of the author nor the names of its contributors may be + * used to endorse or promote products derived from this software without + * specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 COPYRIGHT OWNER 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. + * + * $Author: haag $ + * + * $Id: launch.c 69 2010-09-09 07:17:43Z haag $ + * + * $LastChangedRevision: 69 $ + * + * + */ + +#include "config.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#ifdef HAVE_STDINT_H +#include +#endif + +#include "nfstatfile.h" +#include "bookkeeper.h" + +#ifdef HAVE_FTS_H +# include +#else +# include "fts_compat.h" +#define fts_children fts_children_compat +#define fts_close fts_close_compat +#define fts_open fts_open_compat +#define fts_read fts_read_compat +#define fts_set fts_set_compat +#endif + +#include "expire.h" +#include "nffile.h" +#include "nfxstat.h" +#include "collector.h" + +static int done, launch, child_exit; + +static void SignalHandler(int signal); + +static char *cmd_expand(srecord_t *InfoRecord, char *ident, char *datadir, char *process); + +static void cmd_parse(char *buf, char **args); + +static void cmd_execute(char **args); + +static void do_expire(char *datadir); + +#define MAXARGS 256 +#define MAXCMDLEN 4096 + +static void SignalHandler(int signal) { + + switch (signal) { + case SIGTERM: + // in case the process will not terminate, we + // kill the process directly after the 2nd TERM signal + if ( done > 1 ) + exit(234); + done++; + break; + case SIGHUP: + launch = 1; + break; + case SIGCHLD: + child_exit++; + break; + } + +} /* End of IntHandler */ + +/* + * Expand % placeholders in command string + * expand the memory needed in the command string and replace placeholders + * prevent endless expansion + */ +static char *cmd_expand(srecord_t *InfoRecord, char *ident, char *datadir, char *process) { +char *q, *s, tmp[16]; +int i; + + q = strdup(process); + if ( !q ) { + perror("Process cmdline"); + return NULL; + } + i = 0; + + while ( q[i] ) { + if ( (q[i] == '%') && q[i+1] ) { + // replace the %x var + switch ( q[i+1] ) { + case 'd' : + s = datadir; + break; + case 'f' : + s = InfoRecord->fname; + break; + case 't' : + s = InfoRecord->tstring; + break; + case 'u' : +#if defined __OpenBSD__ || defined __FreeBSD__ + snprintf(tmp, 16, "%i", InfoRecord->tstamp); +#else + snprintf(tmp, 16, "%li", InfoRecord->tstamp); +#endif + tmp[15] = 0; + s = tmp; + break; + case 'i' : + s = ident; + break; + default: + syslog(LOG_ERR, "Unknown format token '%%%c'\n", q[i+1]); + s = NULL; + } + if ( s ) { + q = realloc(q, strlen(q) + strlen(s)); + if ( !q ) { + perror("Process cmdline"); + return NULL; + } + // be a bit paranoid and prevent endless expansion + if ( strlen(q) > MAXCMDLEN ) { + // this is fishy + syslog(LOG_ERR, "Error: cmdline too long!\n"); + return NULL; + } + memmove(&q[i] + strlen(s), &q[i+2], strlen(&q[i+2]) + 1); // include trailing '0' in memmove + memcpy(&q[i], s, strlen(s)); + } + } + i++; + } + + return q; + +} // End of cmd_expand + +/* + * split the command in buf into individual arguments. + */ +static void cmd_parse(char *buf, char **args) { +int i, argnum; + + i = argnum = 0; + while ( (i < MAXCMDLEN) && (buf[i] != 0) ) { + + /* + * Strip whitespace. Use nulls, so + * that the previous argument is terminated + * automatically. + */ + while ( (i < MAXCMDLEN) && ((buf[i] == ' ') || (buf[i] == '\t'))) + buf[i++] = 0; + + /* + * Save the argument. + */ + if ( argnum < MAXARGS ) + args[argnum++] = &(buf[i]); + + /* + * Skip over the argument. + */ + while ( (i < MAXCMDLEN) && ((buf[i] != 0) && (buf[i] != ' ') && (buf[i] != '\t'))) + i++; + } + + if ( argnum < MAXARGS ) + args[argnum] = NULL; + + if ( (i >= MAXCMDLEN) || (argnum >= MAXARGS) ) { + // for safety reason, disable the command + args[0] = NULL; + syslog(LOG_ERR, "Launcher: Unable to parse command: '%s'", buf); + } + +} // End of cmd_parse + +/* + * cmd_execute + * spawn a child process and execute the program. + */ +static void cmd_execute(char **args) { +int pid; + + // Get a child process. + syslog(LOG_DEBUG, "Launcher: fork child."); + if ((pid = fork()) < 0) { + syslog(LOG_ERR, "Can't fork: %s", strerror(errno)); + return; + } + + if (pid == 0) { // we are the child + execvp(*args, args); + syslog(LOG_ERR, "Can't execvp: %s: %s", args[0], strerror(errno)); + _exit(1); + } + + // we are the parent + syslog(LOG_DEBUG, "Launcher: child exec done."); + /* empty */ + +} // End of cmd_execute + +static void do_expire(char *datadir) { +bookkeeper_t *books; +dirstat_t *dirstat, oldstat; +int ret, bookkeeper_stat, do_rescan; + + syslog(LOG_INFO, "Run expire on '%s'", datadir); + + do_rescan = 0; + ret = ReadStatInfo(datadir, &dirstat, CREATE_AND_LOCK); + switch (ret) { + case STATFILE_OK: + break; + case ERR_NOSTATFILE: + dirstat->low_water = 95; + case FORCE_REBUILD: + syslog(LOG_INFO, "Force rebuild stat record"); + do_rescan = 1; + break; + case ERR_FAIL: + syslog(LOG_ERR, "expire failed: can't read stat record"); + return; + /* not reached */ + break; + default: + syslog(LOG_ERR, "expire failed: unexpected return code %i reading stat record", ret); + return; + /* not reached */ + } + + bookkeeper_stat = AccessBookkeeper(&books, datadir); + if ( do_rescan ) { + RescanDir(datadir, dirstat); + if ( bookkeeper_stat == BOOKKEEPER_OK ) { + ClearBooks(books, NULL); + // release the books below + } + } + + if ( bookkeeper_stat == BOOKKEEPER_OK ) { + bookkeeper_t tmp_books; + ClearBooks(books, &tmp_books); + UpdateBookStat(dirstat, &tmp_books); + ReleaseBookkeeper(books, DETACH_ONLY); + } else { + syslog(LOG_ERR, "Error %i: can't access book keeping records", ret); + } + + syslog(LOG_INFO, "Limits: Filesize %s, Lifetime %s, Watermark: %llu%%\n", + dirstat->max_size ? ScaleValue(dirstat->max_size) : "", + dirstat->max_lifetime ? ScaleTime(dirstat->max_lifetime) : "", + (unsigned long long)dirstat->low_water); + + syslog(LOG_INFO, "Current size: %s, Current lifetime: %s, Number of files: %llu", + ScaleValue(dirstat->filesize), + ScaleTime(dirstat->last - dirstat->first), + (unsigned long long)dirstat->numfiles); + + oldstat = *dirstat; + if ( dirstat->max_size || dirstat->max_lifetime ) + ExpireDir(datadir, dirstat, dirstat->max_size, dirstat->max_lifetime, 0); + WriteStatInfo(dirstat); + + if ( (oldstat.numfiles - dirstat->numfiles) > 0 ) { + syslog(LOG_INFO, "expire completed"); + syslog(LOG_INFO, " expired files: %llu", (unsigned long long)(oldstat.numfiles - dirstat->numfiles)); + syslog(LOG_INFO, " expired time slot: %s", ScaleTime(dirstat->first - oldstat.first)); + syslog(LOG_INFO, " expired file size: %s", ScaleValue(oldstat.filesize - dirstat->filesize)); + syslog(LOG_INFO, "New size: %s, New lifetime: %s, Number of files: %llu", + ScaleValue(dirstat->filesize), + ScaleTime(dirstat->last - dirstat->first), + (unsigned long long)dirstat->numfiles); + } else { + syslog(LOG_INFO, "expire completed - nothing to expire."); + } + ReleaseStatInfo(dirstat); + +} // End of do_expire + +void launcher (char *commbuff, FlowSource_t *FlowSource, char *process, int expire) { +FlowSource_t *fs; +struct sigaction act; +char *args[MAXARGS]; +int pid, stat; +srecord_t *InfoRecord; + + InfoRecord = (srecord_t *)commbuff; + + syslog(LOG_INFO, "Launcher: Startup. auto-expire %s", expire ? "enabled" : "off" ); + done = launch = child_exit = 0; + + // process may be NULL, if we only expire data files + if ( process ) { + char *cmd = NULL; + srecord_t TestRecord; + // check for valid command expansion + strncpy(TestRecord.fname, "test", FNAME_SIZE-1); + TestRecord.fname[FNAME_SIZE-1] = 0; + strncpy(TestRecord.tstring, "200407110845", 15); + TestRecord.tstring[15] = 0; + TestRecord.tstamp = 1; + + fs = FlowSource; + while ( fs ) { + cmd = cmd_expand(&TestRecord, fs->Ident, fs->datadir, process); + if ( cmd == NULL ) { + syslog(LOG_ERR, "Launcher: ident: %s, Unable to expand command: '%s'", fs->Ident, process); + exit(255); + } + + fs = fs->next; + } + } + + /* Signal handling */ + memset((void *)&act,0,sizeof(struct sigaction)); + act.sa_handler = SignalHandler; + sigemptyset(&act.sa_mask); + act.sa_flags = 0; + sigaction(SIGCHLD, &act, NULL); // child process terminated + sigaction(SIGTERM, &act, NULL); // we are done + sigaction(SIGINT, &act, NULL); // we are done + sigaction(SIGHUP, &act, NULL); // run command + + while ( !done ) { + // sleep until we get signaled + syslog(LOG_DEBUG, "Launcher: Sleeping"); + select(0, NULL, NULL, NULL, NULL); + syslog(LOG_DEBUG, "Launcher: Wakeup"); + if ( launch ) { // SIGHUP + launch = 0; + + if ( process ) { + char *cmd = NULL; + + fs = FlowSource; + while ( fs ) { + // Expand % placeholders + cmd = cmd_expand(InfoRecord, fs->Ident, fs->datadir, process); + if ( cmd == NULL ) { + syslog(LOG_ERR, "Launcher: ident: %s, Unable to expand command: '%s'", fs->Ident, process); + continue; + } + // printf("Launcher: run command: '%s'\n", cmd); + syslog(LOG_DEBUG, "Launcher: ident: %s run command: '%s'", fs->Ident, cmd); + + // prepare args array + cmd_parse(cmd, args); + if ( args[0] ) + cmd_execute(args); + + // do not flood the system with new processes + sleep(1); + // else cmd_parse already reported the error + free(cmd); + fs = fs->next; + } + } + + fs = FlowSource; + while ( fs ) { + if ( expire ) + do_expire(fs->datadir); + fs = fs->next; + } + } + if ( child_exit ) { + syslog(LOG_INFO, "laucher child exit %d childs.", child_exit); + while ( (pid = waitpid (-1, &stat, WNOHANG)) > 0 ) { + if ( WIFEXITED(stat) ) { + syslog(LOG_DEBUG, "launcher child %i exit status: %i", pid, WEXITSTATUS(stat)); + } + if ( WIFSIGNALED(stat) ) { + syslog(LOG_WARNING, "laucher child %i died due to signal %i", pid, WTERMSIG(stat)); + } + + child_exit--; + } + syslog(LOG_INFO, "laucher waiting childs done. %d childs", child_exit); + child_exit = 0; + } + if ( done ) { + syslog(LOG_INFO, "Launcher: Terminating."); + } + } + + waitpid (-1, &stat, 0); + + // we are done + syslog(LOG_INFO, "Launcher: exit."); + +} // End of launcher + diff --git a/bin/launch.h b/bin/launch.h new file mode 100644 index 0000000..4757532 --- /dev/null +++ b/bin/launch.h @@ -0,0 +1,56 @@ +/* + * Copyright (c) 2014, Peter Haag + * Copyright (c) 2009, Peter Haag + * Copyright (c) 2004-2008, SWITCH - Teleinformatikdienste fuer Lehre und Forschung + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of the author nor the names of its contributors may be + * used to endorse or promote products derived from this software without + * specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 COPYRIGHT OWNER 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. + * + * $Author: haag $ + * + * $Id: launch.h 39 2009-11-25 08:11:15Z haag $ + * + * $LastChangedRevision: 39 $ + * + * + */ + +#ifndef _LAUNCH_H +#define _LAUNCH_H 1 + +#define FNAME_SIZE 256 +#define IDENT_SIZE 32 + +typedef struct srecord_s { + char fname[FNAME_SIZE]; // file name + char subdir[FNAME_SIZE]; // subdir name + char ident[IDENT_SIZE]; // -I ident string + char tstring[16]; // actually 12 needed e.g. 200411011230 + time_t tstamp; // UNIX time stamp +} srecord_t; + +void launcher (char *commbuff, char *datadir, char *process, int expire); + +#endif //_LAUNCH_H diff --git a/bin/lzoconf.h b/bin/lzoconf.h new file mode 100755 index 0000000..61be29c --- /dev/null +++ b/bin/lzoconf.h @@ -0,0 +1,444 @@ +/* lzoconf.h -- configuration of the LZO data compression library + + This file is part of the LZO real-time data compression library. + + Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer + All Rights Reserved. + + The LZO library 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 of + the License, or (at your option) any later version. + + The LZO library 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 the LZO library; see the file COPYING. + If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Markus F.X.J. Oberhumer + + http://www.oberhumer.com/opensource/lzo/ + */ + + +#ifndef __LZOCONF_H_INCLUDED +#define __LZOCONF_H_INCLUDED 1 + +#define LZO_VERSION 0x2080 +#define LZO_VERSION_STRING "2.08" +#define LZO_VERSION_DATE "Jun 29 2014" + +/* internal Autoconf configuration file - only used when building LZO */ +#if defined(LZO_HAVE_CONFIG_H) +# include +#endif +#include +#include + + +/*********************************************************************** +// LZO requires a conforming +************************************************************************/ + +#if !defined(CHAR_BIT) || (CHAR_BIT != 8) +# error "invalid CHAR_BIT" +#endif +#if !defined(UCHAR_MAX) || !defined(USHRT_MAX) || !defined(UINT_MAX) || !defined(ULONG_MAX) +# error "check your compiler installation" +#endif +#if (USHRT_MAX < 1) || (UINT_MAX < 1) || (ULONG_MAX < 1) +# error "your limits.h macros are broken" +#endif + +/* get OS and architecture defines */ +#ifndef __LZODEFS_H_INCLUDED +#include "lzodefs.h" +#endif + + +#ifdef __cplusplus +extern "C" { +#endif + + +/*********************************************************************** +// some core defines +************************************************************************/ + +/* memory checkers */ +#if !defined(__LZO_CHECKER) +# if defined(__BOUNDS_CHECKING_ON) +# define __LZO_CHECKER 1 +# elif defined(__CHECKER__) +# define __LZO_CHECKER 1 +# elif defined(__INSURE__) +# define __LZO_CHECKER 1 +# elif defined(__PURIFY__) +# define __LZO_CHECKER 1 +# endif +#endif + + +/*********************************************************************** +// integral and pointer types +************************************************************************/ + +/* lzo_uint must match size_t */ +#if !defined(LZO_UINT_MAX) +# if (LZO_ABI_LLP64) +# if (LZO_OS_WIN64) + typedef unsigned __int64 lzo_uint; + typedef __int64 lzo_int; +# else + typedef lzo_ullong_t lzo_uint; + typedef lzo_llong_t lzo_int; +# endif +# define LZO_SIZEOF_LZO_UINT 8 +# define LZO_UINT_MAX 0xffffffffffffffffull +# define LZO_INT_MAX 9223372036854775807LL +# define LZO_INT_MIN (-1LL - LZO_INT_MAX) +# elif (LZO_ABI_IP32L64) /* MIPS R5900 */ + typedef unsigned int lzo_uint; + typedef int lzo_int; +# define LZO_SIZEOF_LZO_UINT LZO_SIZEOF_INT +# define LZO_UINT_MAX UINT_MAX +# define LZO_INT_MAX INT_MAX +# define LZO_INT_MIN INT_MIN +# elif (ULONG_MAX >= LZO_0xffffffffL) + typedef unsigned long lzo_uint; + typedef long lzo_int; +# define LZO_SIZEOF_LZO_UINT LZO_SIZEOF_LONG +# define LZO_UINT_MAX ULONG_MAX +# define LZO_INT_MAX LONG_MAX +# define LZO_INT_MIN LONG_MIN +# else +# error "lzo_uint" +# endif +#endif + +/* The larger type of lzo_uint and lzo_uint32_t. */ +#if (LZO_SIZEOF_LZO_UINT >= 4) +# define lzo_xint lzo_uint +#else +# define lzo_xint lzo_uint32_t +#endif + +typedef int lzo_bool; + +/* sanity checks */ +LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_uint) == LZO_SIZEOF_LZO_UINT) +LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_xint) >= sizeof(lzo_uint)) +LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_xint) >= sizeof(lzo_uint32_t)) + +#ifndef __LZO_MMODEL +#define __LZO_MMODEL /*empty*/ +#endif + +/* no typedef here because of const-pointer issues */ +#define lzo_bytep unsigned char __LZO_MMODEL * +#define lzo_charp char __LZO_MMODEL * +#define lzo_voidp void __LZO_MMODEL * +#define lzo_shortp short __LZO_MMODEL * +#define lzo_ushortp unsigned short __LZO_MMODEL * +#define lzo_intp lzo_int __LZO_MMODEL * +#define lzo_uintp lzo_uint __LZO_MMODEL * +#define lzo_xintp lzo_xint __LZO_MMODEL * +#define lzo_voidpp lzo_voidp __LZO_MMODEL * +#define lzo_bytepp lzo_bytep __LZO_MMODEL * + +#define lzo_int8_tp lzo_int8_t __LZO_MMODEL * +#define lzo_uint8_tp lzo_uint8_t __LZO_MMODEL * +#define lzo_int16_tp lzo_int16_t __LZO_MMODEL * +#define lzo_uint16_tp lzo_uint16_t __LZO_MMODEL * +#define lzo_int32_tp lzo_int32_t __LZO_MMODEL * +#define lzo_uint32_tp lzo_uint32_t __LZO_MMODEL * +#if defined(lzo_int64_t) +#define lzo_int64_tp lzo_int64_t __LZO_MMODEL * +#define lzo_uint64_tp lzo_uint64_t __LZO_MMODEL * +#endif + +/* Older LZO versions used to support ancient systems and memory models + * like 16-bit MSDOS with __huge pointers and Cray PVP, but these + * obsolete configurations are not supported any longer. + */ +#if defined(__LZO_MMODEL_HUGE) +#error "__LZO_MMODEL_HUGE is unsupported" +#endif +#if (LZO_MM_PVP) +#error "LZO_MM_PVP is unsupported" +#endif +#if (LZO_SIZEOF_INT < 4) +#error "LZO_SIZEOF_INT < 4 is unsupported" +#endif +#if (__LZO_UINTPTR_T_IS_POINTER) +#error "__LZO_UINTPTR_T_IS_POINTER is unsupported" +#endif +LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(int) >= 4) +LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_uint) >= 4) +/* Strange configurations where sizeof(lzo_uint) != sizeof(size_t) should + * work but have not received much testing lately, so be strict here. + */ +LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_uint) == sizeof(size_t)) +LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_uint) == sizeof(ptrdiff_t)) +LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_uint) == sizeof(lzo_uintptr_t)) +LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(void *) == sizeof(lzo_uintptr_t)) +LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(char *) == sizeof(lzo_uintptr_t)) +LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(long *) == sizeof(lzo_uintptr_t)) +LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(void *) == sizeof(lzo_voidp)) +LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(char *) == sizeof(lzo_bytep)) + + +/*********************************************************************** +// function types +************************************************************************/ + +/* name mangling */ +#if !defined(__LZO_EXTERN_C) +# ifdef __cplusplus +# define __LZO_EXTERN_C extern "C" +# else +# define __LZO_EXTERN_C extern +# endif +#endif + +/* calling convention */ +#if !defined(__LZO_CDECL) +# define __LZO_CDECL __lzo_cdecl +#endif + +/* DLL export information */ +#if !defined(__LZO_EXPORT1) +# define __LZO_EXPORT1 /*empty*/ +#endif +#if !defined(__LZO_EXPORT2) +# define __LZO_EXPORT2 /*empty*/ +#endif + +/* __cdecl calling convention for public C and assembly functions */ +#if !defined(LZO_PUBLIC) +# define LZO_PUBLIC(_rettype) __LZO_EXPORT1 _rettype __LZO_EXPORT2 __LZO_CDECL +#endif +#if !defined(LZO_EXTERN) +# define LZO_EXTERN(_rettype) __LZO_EXTERN_C LZO_PUBLIC(_rettype) +#endif +#if !defined(LZO_PRIVATE) +# define LZO_PRIVATE(_rettype) static _rettype __LZO_CDECL +#endif + +/* function types */ +typedef int +(__LZO_CDECL *lzo_compress_t) ( const lzo_bytep src, lzo_uint src_len, + lzo_bytep dst, lzo_uintp dst_len, + lzo_voidp wrkmem ); + +typedef int +(__LZO_CDECL *lzo_decompress_t) ( const lzo_bytep src, lzo_uint src_len, + lzo_bytep dst, lzo_uintp dst_len, + lzo_voidp wrkmem ); + +typedef int +(__LZO_CDECL *lzo_optimize_t) ( lzo_bytep src, lzo_uint src_len, + lzo_bytep dst, lzo_uintp dst_len, + lzo_voidp wrkmem ); + +typedef int +(__LZO_CDECL *lzo_compress_dict_t)(const lzo_bytep src, lzo_uint src_len, + lzo_bytep dst, lzo_uintp dst_len, + lzo_voidp wrkmem, + const lzo_bytep dict, lzo_uint dict_len ); + +typedef int +(__LZO_CDECL *lzo_decompress_dict_t)(const lzo_bytep src, lzo_uint src_len, + lzo_bytep dst, lzo_uintp dst_len, + lzo_voidp wrkmem, + const lzo_bytep dict, lzo_uint dict_len ); + + +/* Callback interface. Currently only the progress indicator ("nprogress") + * is used, but this may change in a future release. */ + +struct lzo_callback_t; +typedef struct lzo_callback_t lzo_callback_t; +#define lzo_callback_p lzo_callback_t __LZO_MMODEL * + +/* malloc & free function types */ +typedef lzo_voidp (__LZO_CDECL *lzo_alloc_func_t) + (lzo_callback_p self, lzo_uint items, lzo_uint size); +typedef void (__LZO_CDECL *lzo_free_func_t) + (lzo_callback_p self, lzo_voidp ptr); + +/* a progress indicator callback function */ +typedef void (__LZO_CDECL *lzo_progress_func_t) + (lzo_callback_p, lzo_uint, lzo_uint, int); + +struct lzo_callback_t +{ + /* custom allocators (set to 0 to disable) */ + lzo_alloc_func_t nalloc; /* [not used right now] */ + lzo_free_func_t nfree; /* [not used right now] */ + + /* a progress indicator callback function (set to 0 to disable) */ + lzo_progress_func_t nprogress; + + /* INFO: the first parameter "self" of the nalloc/nfree/nprogress + * callbacks points back to this struct, so you are free to store + * some extra info in the following variables. */ + lzo_voidp user1; + lzo_xint user2; + lzo_xint user3; +}; + + +/*********************************************************************** +// error codes and prototypes +************************************************************************/ + +/* Error codes for the compression/decompression functions. Negative + * values are errors, positive values will be used for special but + * normal events. + */ +#define LZO_E_OK 0 +#define LZO_E_ERROR (-1) +#define LZO_E_OUT_OF_MEMORY (-2) /* [lzo_alloc_func_t failure] */ +#define LZO_E_NOT_COMPRESSIBLE (-3) /* [not used right now] */ +#define LZO_E_INPUT_OVERRUN (-4) +#define LZO_E_OUTPUT_OVERRUN (-5) +#define LZO_E_LOOKBEHIND_OVERRUN (-6) +#define LZO_E_EOF_NOT_FOUND (-7) +#define LZO_E_INPUT_NOT_CONSUMED (-8) +#define LZO_E_NOT_YET_IMPLEMENTED (-9) /* [not used right now] */ +#define LZO_E_INVALID_ARGUMENT (-10) +#define LZO_E_INVALID_ALIGNMENT (-11) /* pointer argument is not properly aligned */ +#define LZO_E_OUTPUT_NOT_CONSUMED (-12) +#define LZO_E_INTERNAL_ERROR (-99) + + +#ifndef lzo_sizeof_dict_t +# define lzo_sizeof_dict_t ((unsigned)sizeof(lzo_bytep)) +#endif + +/* lzo_init() should be the first function you call. + * Check the return code ! + * + * lzo_init() is a macro to allow checking that the library and the + * compiler's view of various types are consistent. + */ +#define lzo_init() __lzo_init_v2(LZO_VERSION,(int)sizeof(short),(int)sizeof(int),\ + (int)sizeof(long),(int)sizeof(lzo_uint32_t),(int)sizeof(lzo_uint),\ + (int)lzo_sizeof_dict_t,(int)sizeof(char *),(int)sizeof(lzo_voidp),\ + (int)sizeof(lzo_callback_t)) +LZO_EXTERN(int) __lzo_init_v2(unsigned,int,int,int,int,int,int,int,int,int); + +/* version functions (useful for shared libraries) */ +LZO_EXTERN(unsigned) lzo_version(void); +LZO_EXTERN(const char *) lzo_version_string(void); +LZO_EXTERN(const char *) lzo_version_date(void); +LZO_EXTERN(const lzo_charp) _lzo_version_string(void); +LZO_EXTERN(const lzo_charp) _lzo_version_date(void); + +/* string functions */ +LZO_EXTERN(int) + lzo_memcmp(const lzo_voidp a, const lzo_voidp b, lzo_uint len); +LZO_EXTERN(lzo_voidp) + lzo_memcpy(lzo_voidp dst, const lzo_voidp src, lzo_uint len); +LZO_EXTERN(lzo_voidp) + lzo_memmove(lzo_voidp dst, const lzo_voidp src, lzo_uint len); +LZO_EXTERN(lzo_voidp) + lzo_memset(lzo_voidp buf, int c, lzo_uint len); + +/* checksum functions */ +LZO_EXTERN(lzo_uint32_t) + lzo_adler32(lzo_uint32_t c, const lzo_bytep buf, lzo_uint len); +LZO_EXTERN(lzo_uint32_t) + lzo_crc32(lzo_uint32_t c, const lzo_bytep buf, lzo_uint len); +LZO_EXTERN(const lzo_uint32_tp) + lzo_get_crc32_table(void); + +/* misc. */ +LZO_EXTERN(int) _lzo_config_check(void); +typedef union { + lzo_voidp a00; lzo_bytep a01; lzo_uint a02; lzo_xint a03; lzo_uintptr_t a04; + void *a05; unsigned char *a06; unsigned long a07; size_t a08; ptrdiff_t a09; +#if defined(lzo_int64_t) + lzo_uint64_t a10; +#endif +} lzo_align_t; + +/* align a char pointer on a boundary that is a multiple of 'size' */ +LZO_EXTERN(unsigned) __lzo_align_gap(const lzo_voidp p, lzo_uint size); +#define LZO_PTR_ALIGN_UP(p,size) \ + ((p) + (lzo_uint) __lzo_align_gap((const lzo_voidp)(p),(lzo_uint)(size))) + + +/*********************************************************************** +// deprecated macros - only for backward compatibility +************************************************************************/ + +/* deprecated - use 'lzo_bytep' instead of 'lzo_byte *' */ +#define lzo_byte unsigned char +/* deprecated type names */ +#define lzo_int32 lzo_int32_t +#define lzo_uint32 lzo_uint32_t +#define lzo_int32p lzo_int32_t __LZO_MMODEL * +#define lzo_uint32p lzo_uint32_t __LZO_MMODEL * +#define LZO_INT32_MAX LZO_INT32_C(2147483647) +#define LZO_UINT32_MAX LZO_UINT32_C(4294967295) +#if defined(lzo_int64_t) +#define lzo_int64 lzo_int64_t +#define lzo_uint64 lzo_uint64_t +#define lzo_int64p lzo_int64_t __LZO_MMODEL * +#define lzo_uint64p lzo_uint64_t __LZO_MMODEL * +#define LZO_INT64_MAX LZO_INT64_C(9223372036854775807) +#define LZO_UINT64_MAX LZO_UINT64_C(18446744073709551615) +#endif +/* deprecated types */ +typedef union { lzo_bytep a; lzo_uint b; } __lzo_pu_u; +typedef union { lzo_bytep a; lzo_uint32_t b; } __lzo_pu32_u; + +#if defined(LZO_CFG_COMPAT) + +#define __LZOCONF_H 1 + +#if defined(LZO_ARCH_I086) +# define __LZO_i386 1 +#elif defined(LZO_ARCH_I386) +# define __LZO_i386 1 +#endif + +#if defined(LZO_OS_DOS16) +# define __LZO_DOS 1 +# define __LZO_DOS16 1 +#elif defined(LZO_OS_DOS32) +# define __LZO_DOS 1 +#elif defined(LZO_OS_WIN16) +# define __LZO_WIN 1 +# define __LZO_WIN16 1 +#elif defined(LZO_OS_WIN32) +# define __LZO_WIN 1 +#endif + +#define __LZO_CMODEL /*empty*/ +#define __LZO_DMODEL /*empty*/ +#define __LZO_ENTRY __LZO_CDECL +#define LZO_EXTERN_CDECL LZO_EXTERN +#define LZO_ALIGN LZO_PTR_ALIGN_UP + +#define lzo_compress_asm_t lzo_compress_t +#define lzo_decompress_asm_t lzo_decompress_t + +#endif /* LZO_CFG_COMPAT */ + + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /* already included */ + + +/* vim:set ts=4 sw=4 et: */ diff --git a/bin/lzodefs.h b/bin/lzodefs.h new file mode 100755 index 0000000..f4ae948 --- /dev/null +++ b/bin/lzodefs.h @@ -0,0 +1,2998 @@ +/* lzodefs.h -- architecture, OS and compiler specific defines + + This file is part of the LZO real-time data compression library. + + Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer + All Rights Reserved. + + The LZO library 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 of + the License, or (at your option) any later version. + + The LZO library 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 the LZO library; see the file COPYING. + If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Markus F.X.J. Oberhumer + + http://www.oberhumer.com/opensource/lzo/ + */ + + +#ifndef __LZODEFS_H_INCLUDED +#define __LZODEFS_H_INCLUDED 1 + +#if defined(__CYGWIN32__) && !defined(__CYGWIN__) +# define __CYGWIN__ __CYGWIN32__ +#endif +#if 1 && defined(__INTERIX) && defined(__GNUC__) && !defined(_ALL_SOURCE) +# define _ALL_SOURCE 1 +#endif +#if defined(__mips__) && defined(__R5900__) +# if !defined(__LONG_MAX__) +# define __LONG_MAX__ 9223372036854775807L +# endif +#endif +#if !defined(LZO_CFG_NO_DISABLE_WUNDEF) +#if defined(__ARMCC_VERSION) +# pragma diag_suppress 193 +#elif defined(__clang__) && defined(__clang_minor__) +# pragma clang diagnostic ignored "-Wundef" +#elif defined(__INTEL_COMPILER) +# pragma warning(disable: 193) +#elif defined(__KEIL__) && defined(__C166__) +# pragma warning disable = 322 +#elif defined(__GNUC__) && defined(__GNUC_MINOR__) && !defined(__PATHSCALE__) +# if ((__GNUC__-0) >= 5 || ((__GNUC__-0) == 4 && (__GNUC_MINOR__-0) >= 2)) +# pragma GCC diagnostic ignored "-Wundef" +# endif +#elif defined(_MSC_VER) && !defined(__clang__) && !defined(__INTEL_COMPILER) && !defined(__MWERKS__) +# if ((_MSC_VER-0) >= 1300) +# pragma warning(disable: 4668) +# endif +#endif +#endif +#if 0 && defined(__POCC__) && defined(_WIN32) +# if (__POCC__ >= 400) +# pragma warn(disable: 2216) +# endif +#endif +#if 0 && defined(__WATCOMC__) +# if (__WATCOMC__ >= 1050) && (__WATCOMC__ < 1060) +# pragma warning 203 9 +# endif +#endif +#if defined(__BORLANDC__) && defined(__MSDOS__) && !defined(__FLAT__) +# pragma option -h +#endif +#if !(LZO_CFG_NO_DISABLE_WCRTNONSTDC) +#ifndef _CRT_NONSTDC_NO_DEPRECATE +#define _CRT_NONSTDC_NO_DEPRECATE 1 +#endif +#ifndef _CRT_NONSTDC_NO_WARNINGS +#define _CRT_NONSTDC_NO_WARNINGS 1 +#endif +#ifndef _CRT_SECURE_NO_DEPRECATE +#define _CRT_SECURE_NO_DEPRECATE 1 +#endif +#ifndef _CRT_SECURE_NO_WARNINGS +#define _CRT_SECURE_NO_WARNINGS 1 +#endif +#endif +#if 0 +#define LZO_0xffffUL 0xfffful +#define LZO_0xffffffffUL 0xfffffffful +#else +#define LZO_0xffffUL 65535ul +#define LZO_0xffffffffUL 4294967295ul +#endif +#define LZO_0xffffL LZO_0xffffUL +#define LZO_0xffffffffL LZO_0xffffffffUL +#if (LZO_0xffffL == LZO_0xffffffffL) +# error "your preprocessor is broken 1" +#endif +#if (16ul * 16384ul != 262144ul) +# error "your preprocessor is broken 2" +#endif +#if 0 +#if (32767 >= 4294967295ul) +# error "your preprocessor is broken 3" +#endif +#if (65535u >= 4294967295ul) +# error "your preprocessor is broken 4" +#endif +#endif +#if defined(__COUNTER__) +# ifndef LZO_CFG_USE_COUNTER +# define LZO_CFG_USE_COUNTER 1 +# endif +#else +# undef LZO_CFG_USE_COUNTER +#endif +#if (UINT_MAX == LZO_0xffffL) +#if defined(__ZTC__) && defined(__I86__) && !defined(__OS2__) +# if !defined(MSDOS) +# define MSDOS 1 +# endif +# if !defined(_MSDOS) +# define _MSDOS 1 +# endif +#elif 0 && defined(__VERSION) && defined(MB_LEN_MAX) +# if (__VERSION == 520) && (MB_LEN_MAX == 1) +# if !defined(__AZTEC_C__) +# define __AZTEC_C__ __VERSION +# endif +# if !defined(__DOS__) +# define __DOS__ 1 +# endif +# endif +#endif +#endif +#if defined(_MSC_VER) && defined(M_I86HM) && (UINT_MAX == LZO_0xffffL) +# define ptrdiff_t long +# define _PTRDIFF_T_DEFINED 1 +#endif +#if (UINT_MAX == LZO_0xffffL) +# undef __LZO_RENAME_A +# undef __LZO_RENAME_B +# if defined(__AZTEC_C__) && defined(__DOS__) +# define __LZO_RENAME_A 1 +# elif defined(_MSC_VER) && defined(MSDOS) +# if (_MSC_VER < 600) +# define __LZO_RENAME_A 1 +# elif (_MSC_VER < 700) +# define __LZO_RENAME_B 1 +# endif +# elif defined(__TSC__) && defined(__OS2__) +# define __LZO_RENAME_A 1 +# elif defined(__MSDOS__) && defined(__TURBOC__) && (__TURBOC__ < 0x0410) +# define __LZO_RENAME_A 1 +# elif defined(__PACIFIC__) && defined(DOS) +# if !defined(__far) +# define __far far +# endif +# if !defined(__near) +# define __near near +# endif +# endif +# if defined(__LZO_RENAME_A) +# if !defined(__cdecl) +# define __cdecl cdecl +# endif +# if !defined(__far) +# define __far far +# endif +# if !defined(__huge) +# define __huge huge +# endif +# if !defined(__near) +# define __near near +# endif +# if !defined(__pascal) +# define __pascal pascal +# endif +# if !defined(__huge) +# define __huge huge +# endif +# elif defined(__LZO_RENAME_B) +# if !defined(__cdecl) +# define __cdecl _cdecl +# endif +# if !defined(__far) +# define __far _far +# endif +# if !defined(__huge) +# define __huge _huge +# endif +# if !defined(__near) +# define __near _near +# endif +# if !defined(__pascal) +# define __pascal _pascal +# endif +# elif (defined(__PUREC__) || defined(__TURBOC__)) && defined(__TOS__) +# if !defined(__cdecl) +# define __cdecl cdecl +# endif +# if !defined(__pascal) +# define __pascal pascal +# endif +# endif +# undef __LZO_RENAME_A +# undef __LZO_RENAME_B +#endif +#if (UINT_MAX == LZO_0xffffL) +#if defined(__AZTEC_C__) && defined(__DOS__) +# define LZO_BROKEN_CDECL_ALT_SYNTAX 1 +#elif defined(_MSC_VER) && defined(MSDOS) +# if (_MSC_VER < 600) +# define LZO_BROKEN_INTEGRAL_CONSTANTS 1 +# endif +# if (_MSC_VER < 700) +# define LZO_BROKEN_INTEGRAL_PROMOTION 1 +# define LZO_BROKEN_SIZEOF 1 +# endif +#elif defined(__PACIFIC__) && defined(DOS) +# define LZO_BROKEN_INTEGRAL_CONSTANTS 1 +#elif defined(__TURBOC__) && defined(__MSDOS__) +# if (__TURBOC__ < 0x0150) +# define LZO_BROKEN_CDECL_ALT_SYNTAX 1 +# define LZO_BROKEN_INTEGRAL_CONSTANTS 1 +# define LZO_BROKEN_INTEGRAL_PROMOTION 1 +# endif +# if (__TURBOC__ < 0x0200) +# define LZO_BROKEN_SIZEOF 1 +# endif +# if (__TURBOC__ < 0x0400) && defined(__cplusplus) +# define LZO_BROKEN_CDECL_ALT_SYNTAX 1 +# endif +#elif (defined(__PUREC__) || defined(__TURBOC__)) && defined(__TOS__) +# define LZO_BROKEN_CDECL_ALT_SYNTAX 1 +# define LZO_BROKEN_SIZEOF 1 +#endif +#endif +#if defined(__WATCOMC__) && (__WATCOMC__ < 900) +# define LZO_BROKEN_INTEGRAL_CONSTANTS 1 +#endif +#if defined(_CRAY) && defined(_CRAY1) +# define LZO_BROKEN_SIGNED_RIGHT_SHIFT 1 +#endif +#define LZO_PP_STRINGIZE(x) #x +#define LZO_PP_MACRO_EXPAND(x) LZO_PP_STRINGIZE(x) +#define LZO_PP_CONCAT0() /*empty*/ +#define LZO_PP_CONCAT1(a) a +#define LZO_PP_CONCAT2(a,b) a ## b +#define LZO_PP_CONCAT3(a,b,c) a ## b ## c +#define LZO_PP_CONCAT4(a,b,c,d) a ## b ## c ## d +#define LZO_PP_CONCAT5(a,b,c,d,e) a ## b ## c ## d ## e +#define LZO_PP_CONCAT6(a,b,c,d,e,f) a ## b ## c ## d ## e ## f +#define LZO_PP_CONCAT7(a,b,c,d,e,f,g) a ## b ## c ## d ## e ## f ## g +#define LZO_PP_ECONCAT0() LZO_PP_CONCAT0() +#define LZO_PP_ECONCAT1(a) LZO_PP_CONCAT1(a) +#define LZO_PP_ECONCAT2(a,b) LZO_PP_CONCAT2(a,b) +#define LZO_PP_ECONCAT3(a,b,c) LZO_PP_CONCAT3(a,b,c) +#define LZO_PP_ECONCAT4(a,b,c,d) LZO_PP_CONCAT4(a,b,c,d) +#define LZO_PP_ECONCAT5(a,b,c,d,e) LZO_PP_CONCAT5(a,b,c,d,e) +#define LZO_PP_ECONCAT6(a,b,c,d,e,f) LZO_PP_CONCAT6(a,b,c,d,e,f) +#define LZO_PP_ECONCAT7(a,b,c,d,e,f,g) LZO_PP_CONCAT7(a,b,c,d,e,f,g) +#define LZO_PP_EMPTY /*empty*/ +#define LZO_PP_EMPTY0() /*empty*/ +#define LZO_PP_EMPTY1(a) /*empty*/ +#define LZO_PP_EMPTY2(a,b) /*empty*/ +#define LZO_PP_EMPTY3(a,b,c) /*empty*/ +#define LZO_PP_EMPTY4(a,b,c,d) /*empty*/ +#define LZO_PP_EMPTY5(a,b,c,d,e) /*empty*/ +#define LZO_PP_EMPTY6(a,b,c,d,e,f) /*empty*/ +#define LZO_PP_EMPTY7(a,b,c,d,e,f,g) /*empty*/ +#if 1 +#define LZO_CPP_STRINGIZE(x) #x +#define LZO_CPP_MACRO_EXPAND(x) LZO_CPP_STRINGIZE(x) +#define LZO_CPP_CONCAT2(a,b) a ## b +#define LZO_CPP_CONCAT3(a,b,c) a ## b ## c +#define LZO_CPP_CONCAT4(a,b,c,d) a ## b ## c ## d +#define LZO_CPP_CONCAT5(a,b,c,d,e) a ## b ## c ## d ## e +#define LZO_CPP_CONCAT6(a,b,c,d,e,f) a ## b ## c ## d ## e ## f +#define LZO_CPP_CONCAT7(a,b,c,d,e,f,g) a ## b ## c ## d ## e ## f ## g +#define LZO_CPP_ECONCAT2(a,b) LZO_CPP_CONCAT2(a,b) +#define LZO_CPP_ECONCAT3(a,b,c) LZO_CPP_CONCAT3(a,b,c) +#define LZO_CPP_ECONCAT4(a,b,c,d) LZO_CPP_CONCAT4(a,b,c,d) +#define LZO_CPP_ECONCAT5(a,b,c,d,e) LZO_CPP_CONCAT5(a,b,c,d,e) +#define LZO_CPP_ECONCAT6(a,b,c,d,e,f) LZO_CPP_CONCAT6(a,b,c,d,e,f) +#define LZO_CPP_ECONCAT7(a,b,c,d,e,f,g) LZO_CPP_CONCAT7(a,b,c,d,e,f,g) +#endif +#define __LZO_MASK_GEN(o,b) (((((o) << ((b)-!!(b))) - (o)) << 1) + (o)*!!(b)) +#if 1 && defined(__cplusplus) +# if !defined(__STDC_CONSTANT_MACROS) +# define __STDC_CONSTANT_MACROS 1 +# endif +# if !defined(__STDC_LIMIT_MACROS) +# define __STDC_LIMIT_MACROS 1 +# endif +#endif +#if defined(__cplusplus) +# define LZO_EXTERN_C extern "C" +# define LZO_EXTERN_C_BEGIN extern "C" { +# define LZO_EXTERN_C_END } +#else +# define LZO_EXTERN_C extern +# define LZO_EXTERN_C_BEGIN /*empty*/ +# define LZO_EXTERN_C_END /*empty*/ +#endif +#if !defined(__LZO_OS_OVERRIDE) +#if (LZO_OS_FREESTANDING) +# define LZO_INFO_OS "freestanding" +#elif (LZO_OS_EMBEDDED) +# define LZO_INFO_OS "embedded" +#elif 1 && defined(__IAR_SYSTEMS_ICC__) +# define LZO_OS_EMBEDDED 1 +# define LZO_INFO_OS "embedded" +#elif defined(__CYGWIN__) && defined(__GNUC__) +# define LZO_OS_CYGWIN 1 +# define LZO_INFO_OS "cygwin" +#elif defined(__EMX__) && defined(__GNUC__) +# define LZO_OS_EMX 1 +# define LZO_INFO_OS "emx" +#elif defined(__BEOS__) +# define LZO_OS_BEOS 1 +# define LZO_INFO_OS "beos" +#elif defined(__Lynx__) +# define LZO_OS_LYNXOS 1 +# define LZO_INFO_OS "lynxos" +#elif defined(__OS400__) +# define LZO_OS_OS400 1 +# define LZO_INFO_OS "os400" +#elif defined(__QNX__) +# define LZO_OS_QNX 1 +# define LZO_INFO_OS "qnx" +#elif defined(__BORLANDC__) && defined(__DPMI32__) && (__BORLANDC__ >= 0x0460) +# define LZO_OS_DOS32 1 +# define LZO_INFO_OS "dos32" +#elif defined(__BORLANDC__) && defined(__DPMI16__) +# define LZO_OS_DOS16 1 +# define LZO_INFO_OS "dos16" +#elif defined(__ZTC__) && defined(DOS386) +# define LZO_OS_DOS32 1 +# define LZO_INFO_OS "dos32" +#elif defined(__OS2__) || defined(__OS2V2__) +# if (UINT_MAX == LZO_0xffffL) +# define LZO_OS_OS216 1 +# define LZO_INFO_OS "os216" +# elif (UINT_MAX == LZO_0xffffffffL) +# define LZO_OS_OS2 1 +# define LZO_INFO_OS "os2" +# else +# error "check your limits.h header" +# endif +#elif defined(__WIN64__) || defined(_WIN64) || defined(WIN64) +# define LZO_OS_WIN64 1 +# define LZO_INFO_OS "win64" +#elif defined(__WIN32__) || defined(_WIN32) || defined(WIN32) || defined(__WINDOWS_386__) +# define LZO_OS_WIN32 1 +# define LZO_INFO_OS "win32" +#elif defined(__MWERKS__) && defined(__INTEL__) +# define LZO_OS_WIN32 1 +# define LZO_INFO_OS "win32" +#elif defined(__WINDOWS__) || defined(_WINDOWS) || defined(_Windows) +# if (UINT_MAX == LZO_0xffffL) +# define LZO_OS_WIN16 1 +# define LZO_INFO_OS "win16" +# elif (UINT_MAX == LZO_0xffffffffL) +# define LZO_OS_WIN32 1 +# define LZO_INFO_OS "win32" +# else +# error "check your limits.h header" +# endif +#elif defined(__DOS__) || defined(__MSDOS__) || defined(_MSDOS) || defined(MSDOS) || (defined(__PACIFIC__) && defined(DOS)) +# if (UINT_MAX == LZO_0xffffL) +# define LZO_OS_DOS16 1 +# define LZO_INFO_OS "dos16" +# elif (UINT_MAX == LZO_0xffffffffL) +# define LZO_OS_DOS32 1 +# define LZO_INFO_OS "dos32" +# else +# error "check your limits.h header" +# endif +#elif defined(__WATCOMC__) +# if defined(__NT__) && (UINT_MAX == LZO_0xffffL) +# define LZO_OS_DOS16 1 +# define LZO_INFO_OS "dos16" +# elif defined(__NT__) && (__WATCOMC__ < 1100) +# define LZO_OS_WIN32 1 +# define LZO_INFO_OS "win32" +# elif defined(__linux__) || defined(__LINUX__) +# define LZO_OS_POSIX 1 +# define LZO_INFO_OS "posix" +# else +# error "please specify a target using the -bt compiler option" +# endif +#elif defined(__palmos__) +# define LZO_OS_PALMOS 1 +# define LZO_INFO_OS "palmos" +#elif defined(__TOS__) || defined(__atarist__) +# define LZO_OS_TOS 1 +# define LZO_INFO_OS "tos" +#elif defined(macintosh) && !defined(__ppc__) +# define LZO_OS_MACCLASSIC 1 +# define LZO_INFO_OS "macclassic" +#elif defined(__VMS) +# define LZO_OS_VMS 1 +# define LZO_INFO_OS "vms" +#elif (defined(__mips__) && defined(__R5900__)) || defined(__MIPS_PSX2__) +# define LZO_OS_CONSOLE 1 +# define LZO_OS_CONSOLE_PS2 1 +# define LZO_INFO_OS "console" +# define LZO_INFO_OS_CONSOLE "ps2" +#elif defined(__mips__) && defined(__psp__) +# define LZO_OS_CONSOLE 1 +# define LZO_OS_CONSOLE_PSP 1 +# define LZO_INFO_OS "console" +# define LZO_INFO_OS_CONSOLE "psp" +#else +# define LZO_OS_POSIX 1 +# define LZO_INFO_OS "posix" +#endif +#if (LZO_OS_POSIX) +# if defined(_AIX) || defined(__AIX__) || defined(__aix__) +# define LZO_OS_POSIX_AIX 1 +# define LZO_INFO_OS_POSIX "aix" +# elif defined(__FreeBSD__) +# define LZO_OS_POSIX_FREEBSD 1 +# define LZO_INFO_OS_POSIX "freebsd" +# elif defined(__hpux__) || defined(__hpux) +# define LZO_OS_POSIX_HPUX 1 +# define LZO_INFO_OS_POSIX "hpux" +# elif defined(__INTERIX) +# define LZO_OS_POSIX_INTERIX 1 +# define LZO_INFO_OS_POSIX "interix" +# elif defined(__IRIX__) || defined(__irix__) +# define LZO_OS_POSIX_IRIX 1 +# define LZO_INFO_OS_POSIX "irix" +# elif defined(__linux__) || defined(__linux) || defined(__LINUX__) +# define LZO_OS_POSIX_LINUX 1 +# define LZO_INFO_OS_POSIX "linux" +# elif defined(__APPLE__) && defined(__MACH__) +# if ((__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__-0) >= 20000) +# define LZO_OS_POSIX_DARWIN 1040 +# define LZO_INFO_OS_POSIX "darwin_iphone" +# elif ((__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__-0) >= 1040) +# define LZO_OS_POSIX_DARWIN __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ +# define LZO_INFO_OS_POSIX "darwin" +# else +# define LZO_OS_POSIX_DARWIN 1 +# define LZO_INFO_OS_POSIX "darwin" +# endif +# define LZO_OS_POSIX_MACOSX LZO_OS_POSIX_DARWIN +# elif defined(__minix__) || defined(__minix) +# define LZO_OS_POSIX_MINIX 1 +# define LZO_INFO_OS_POSIX "minix" +# elif defined(__NetBSD__) +# define LZO_OS_POSIX_NETBSD 1 +# define LZO_INFO_OS_POSIX "netbsd" +# elif defined(__OpenBSD__) +# define LZO_OS_POSIX_OPENBSD 1 +# define LZO_INFO_OS_POSIX "openbsd" +# elif defined(__osf__) +# define LZO_OS_POSIX_OSF 1 +# define LZO_INFO_OS_POSIX "osf" +# elif defined(__solaris__) || defined(__sun) +# if defined(__SVR4) || defined(__svr4__) +# define LZO_OS_POSIX_SOLARIS 1 +# define LZO_INFO_OS_POSIX "solaris" +# else +# define LZO_OS_POSIX_SUNOS 1 +# define LZO_INFO_OS_POSIX "sunos" +# endif +# elif defined(__ultrix__) || defined(__ultrix) +# define LZO_OS_POSIX_ULTRIX 1 +# define LZO_INFO_OS_POSIX "ultrix" +# elif defined(_UNICOS) +# define LZO_OS_POSIX_UNICOS 1 +# define LZO_INFO_OS_POSIX "unicos" +# else +# define LZO_OS_POSIX_UNKNOWN 1 +# define LZO_INFO_OS_POSIX "unknown" +# endif +#endif +#endif +#if (LZO_OS_DOS16 || LZO_OS_OS216 || LZO_OS_WIN16) +# if (UINT_MAX != LZO_0xffffL) +# error "unexpected configuration - check your compiler defines" +# endif +# if (ULONG_MAX != LZO_0xffffffffL) +# error "unexpected configuration - check your compiler defines" +# endif +#endif +#if (LZO_OS_DOS32 || LZO_OS_OS2 || LZO_OS_WIN32 || LZO_OS_WIN64) +# if (UINT_MAX != LZO_0xffffffffL) +# error "unexpected configuration - check your compiler defines" +# endif +# if (ULONG_MAX != LZO_0xffffffffL) +# error "unexpected configuration - check your compiler defines" +# endif +#endif +#if defined(CIL) && defined(_GNUCC) && defined(__GNUC__) +# define LZO_CC_CILLY 1 +# define LZO_INFO_CC "Cilly" +# if defined(__CILLY__) +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__CILLY__) +# else +# define LZO_INFO_CCVER "unknown" +# endif +#elif 0 && defined(SDCC) && defined(__VERSION__) && !defined(__GNUC__) +# define LZO_CC_SDCC 1 +# define LZO_INFO_CC "sdcc" +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(SDCC) +#elif defined(__PATHSCALE__) && defined(__PATHCC_PATCHLEVEL__) +# define LZO_CC_PATHSCALE (__PATHCC__ * 0x10000L + (__PATHCC_MINOR__-0) * 0x100 + (__PATHCC_PATCHLEVEL__-0)) +# define LZO_INFO_CC "Pathscale C" +# define LZO_INFO_CCVER __PATHSCALE__ +# if defined(__GNUC__) && defined(__GNUC_MINOR__) && defined(__VERSION__) +# define LZO_CC_PATHSCALE_GNUC (__GNUC__ * 0x10000L + (__GNUC_MINOR__-0) * 0x100 + (__GNUC_PATCHLEVEL__-0)) +# endif +#elif defined(__INTEL_COMPILER) && ((__INTEL_COMPILER-0) > 0) +# define LZO_CC_INTELC __INTEL_COMPILER +# define LZO_INFO_CC "Intel C" +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__INTEL_COMPILER) +# if defined(_MSC_VER) && ((_MSC_VER-0) > 0) +# define LZO_CC_INTELC_MSC _MSC_VER +# elif defined(__GNUC__) && defined(__GNUC_MINOR__) && defined(__VERSION__) +# define LZO_CC_INTELC_GNUC (__GNUC__ * 0x10000L + (__GNUC_MINOR__-0) * 0x100 + (__GNUC_PATCHLEVEL__-0)) +# endif +#elif defined(__POCC__) && defined(_WIN32) +# define LZO_CC_PELLESC 1 +# define LZO_INFO_CC "Pelles C" +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__POCC__) +#elif defined(__ARMCC_VERSION) && defined(__GNUC__) && defined(__GNUC_MINOR__) && defined(__VERSION__) +# if defined(__GNUC_PATCHLEVEL__) +# define LZO_CC_ARMCC_GNUC (__GNUC__ * 0x10000L + (__GNUC_MINOR__-0) * 0x100 + (__GNUC_PATCHLEVEL__-0)) +# else +# define LZO_CC_ARMCC_GNUC (__GNUC__ * 0x10000L + (__GNUC_MINOR__-0) * 0x100) +# endif +# define LZO_CC_ARMCC __ARMCC_VERSION +# define LZO_INFO_CC "ARM C Compiler" +# define LZO_INFO_CCVER __VERSION__ +#elif defined(__clang__) && defined(__llvm__) && defined(__VERSION__) +# if defined(__clang_major__) && defined(__clang_minor__) && defined(__clang_patchlevel__) +# define LZO_CC_CLANG (__clang_major__ * 0x10000L + (__clang_minor__-0) * 0x100 + (__clang_patchlevel__-0)) +# else +# define LZO_CC_CLANG 0x010000L +# endif +# if defined(_MSC_VER) && ((_MSC_VER-0) > 0) +# define LZO_CC_CLANG_MSC _MSC_VER +# elif defined(__GNUC__) && defined(__GNUC_MINOR__) && defined(__VERSION__) +# define LZO_CC_CLANG_GNUC (__GNUC__ * 0x10000L + (__GNUC_MINOR__-0) * 0x100 + (__GNUC_PATCHLEVEL__-0)) +# endif +# define LZO_INFO_CC "clang" +# define LZO_INFO_CCVER __VERSION__ +#elif defined(__llvm__) && defined(__GNUC__) && defined(__GNUC_MINOR__) && defined(__VERSION__) +# if defined(__GNUC_PATCHLEVEL__) +# define LZO_CC_LLVM_GNUC (__GNUC__ * 0x10000L + (__GNUC_MINOR__-0) * 0x100 + (__GNUC_PATCHLEVEL__-0)) +# else +# define LZO_CC_LLVM_GNUC (__GNUC__ * 0x10000L + (__GNUC_MINOR__-0) * 0x100) +# endif +# define LZO_CC_LLVM LZO_CC_LLVM_GNUC +# define LZO_INFO_CC "llvm-gcc" +# define LZO_INFO_CCVER __VERSION__ +#elif defined(__ACK__) && defined(_ACK) +# define LZO_CC_ACK 1 +# define LZO_INFO_CC "Amsterdam Compiler Kit C" +# define LZO_INFO_CCVER "unknown" +#elif defined(__ARMCC_VERSION) && !defined(__GNUC__) +# define LZO_CC_ARMCC __ARMCC_VERSION +# define LZO_CC_ARMCC_ARMCC __ARMCC_VERSION +# define LZO_INFO_CC "ARM C Compiler" +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__ARMCC_VERSION) +#elif defined(__AZTEC_C__) +# define LZO_CC_AZTECC 1 +# define LZO_INFO_CC "Aztec C" +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__AZTEC_C__) +#elif defined(__CODEGEARC__) +# define LZO_CC_CODEGEARC 1 +# define LZO_INFO_CC "CodeGear C" +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__CODEGEARC__) +#elif defined(__BORLANDC__) +# define LZO_CC_BORLANDC 1 +# define LZO_INFO_CC "Borland C" +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__BORLANDC__) +#elif defined(_CRAYC) && defined(_RELEASE) +# define LZO_CC_CRAYC 1 +# define LZO_INFO_CC "Cray C" +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(_RELEASE) +#elif defined(__DMC__) && defined(__SC__) +# define LZO_CC_DMC 1 +# define LZO_INFO_CC "Digital Mars C" +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__DMC__) +#elif defined(__DECC) +# define LZO_CC_DECC 1 +# define LZO_INFO_CC "DEC C" +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__DECC) +#elif (defined(__ghs) || defined(__ghs__)) && defined(__GHS_VERSION_NUMBER) && ((__GHS_VERSION_NUMBER-0) > 0) +# define LZO_CC_GHS 1 +# define LZO_INFO_CC "Green Hills C" +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__GHS_VERSION_NUMBER) +# if defined(_MSC_VER) && ((_MSC_VER-0) > 0) +# define LZO_CC_GHS_MSC _MSC_VER +# elif defined(__GNUC__) && defined(__GNUC_MINOR__) && defined(__VERSION__) +# define LZO_CC_GHS_GNUC (__GNUC__ * 0x10000L + (__GNUC_MINOR__-0) * 0x100 + (__GNUC_PATCHLEVEL__-0)) +# endif +#elif defined(__HIGHC__) +# define LZO_CC_HIGHC 1 +# define LZO_INFO_CC "MetaWare High C" +# define LZO_INFO_CCVER "unknown" +#elif defined(__HP_aCC) && ((__HP_aCC-0) > 0) +# define LZO_CC_HPACC __HP_aCC +# define LZO_INFO_CC "HP aCC" +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__HP_aCC) +#elif defined(__IAR_SYSTEMS_ICC__) +# define LZO_CC_IARC 1 +# define LZO_INFO_CC "IAR C" +# if defined(__VER__) +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__VER__) +# else +# define LZO_INFO_CCVER "unknown" +# endif +#elif defined(__IBMC__) && ((__IBMC__-0) > 0) +# define LZO_CC_IBMC __IBMC__ +# define LZO_INFO_CC "IBM C" +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__IBMC__) +#elif defined(__IBMCPP__) && ((__IBMCPP__-0) > 0) +# define LZO_CC_IBMC __IBMCPP__ +# define LZO_INFO_CC "IBM C" +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__IBMCPP__) +#elif defined(__KEIL__) && defined(__C166__) +# define LZO_CC_KEILC 1 +# define LZO_INFO_CC "Keil C" +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__C166__) +#elif defined(__LCC__) && defined(_WIN32) && defined(__LCCOPTIMLEVEL) +# define LZO_CC_LCCWIN32 1 +# define LZO_INFO_CC "lcc-win32" +# define LZO_INFO_CCVER "unknown" +#elif defined(__LCC__) +# define LZO_CC_LCC 1 +# define LZO_INFO_CC "lcc" +# if defined(__LCC_VERSION__) +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__LCC_VERSION__) +# else +# define LZO_INFO_CCVER "unknown" +# endif +#elif defined(__MWERKS__) && ((__MWERKS__-0) > 0) +# define LZO_CC_MWERKS __MWERKS__ +# define LZO_INFO_CC "Metrowerks C" +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__MWERKS__) +#elif (defined(__NDPC__) || defined(__NDPX__)) && defined(__i386) +# define LZO_CC_NDPC 1 +# define LZO_INFO_CC "Microway NDP C" +# define LZO_INFO_CCVER "unknown" +#elif defined(__PACIFIC__) +# define LZO_CC_PACIFICC 1 +# define LZO_INFO_CC "Pacific C" +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__PACIFIC__) +#elif defined(__PGI) && defined(__PGIC__) && defined(__PGIC_MINOR__) +# if defined(__PGIC_PATCHLEVEL__) +# define LZO_CC_PGI (__PGIC__ * 0x10000L + (__PGIC_MINOR__-0) * 0x100 + (__PGIC_PATCHLEVEL__-0)) +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__PGIC__) "." LZO_PP_MACRO_EXPAND(__PGIC_MINOR__) "." LZO_PP_MACRO_EXPAND(__PGIC_PATCHLEVEL__) +# else +# define LZO_CC_PGI (__PGIC__ * 0x10000L + (__PGIC_MINOR__-0) * 0x100) +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__PGIC__) "." LZO_PP_MACRO_EXPAND(__PGIC_MINOR__) ".0" +# endif +# define LZO_INFO_CC "Portland Group PGI C" +#elif defined(__PGI) && (defined(__linux__) || defined(__WIN32__)) +# define LZO_CC_PGI 1 +# define LZO_INFO_CC "Portland Group PGI C" +# define LZO_INFO_CCVER "unknown" +#elif defined(__PUREC__) && defined(__TOS__) +# define LZO_CC_PUREC 1 +# define LZO_INFO_CC "Pure C" +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__PUREC__) +#elif defined(__SC__) && defined(__ZTC__) +# define LZO_CC_SYMANTECC 1 +# define LZO_INFO_CC "Symantec C" +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__SC__) +#elif defined(__SUNPRO_C) +# define LZO_INFO_CC "SunPro C" +# if ((__SUNPRO_C-0) > 0) +# define LZO_CC_SUNPROC __SUNPRO_C +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__SUNPRO_C) +# else +# define LZO_CC_SUNPROC 1 +# define LZO_INFO_CCVER "unknown" +# endif +#elif defined(__SUNPRO_CC) +# define LZO_INFO_CC "SunPro C" +# if ((__SUNPRO_CC-0) > 0) +# define LZO_CC_SUNPROC __SUNPRO_CC +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__SUNPRO_CC) +# else +# define LZO_CC_SUNPROC 1 +# define LZO_INFO_CCVER "unknown" +# endif +#elif defined(__TINYC__) +# define LZO_CC_TINYC 1 +# define LZO_INFO_CC "Tiny C" +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__TINYC__) +#elif defined(__TSC__) +# define LZO_CC_TOPSPEEDC 1 +# define LZO_INFO_CC "TopSpeed C" +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__TSC__) +#elif defined(__WATCOMC__) +# define LZO_CC_WATCOMC 1 +# define LZO_INFO_CC "Watcom C" +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__WATCOMC__) +#elif defined(__TURBOC__) +# define LZO_CC_TURBOC 1 +# define LZO_INFO_CC "Turbo C" +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__TURBOC__) +#elif defined(__ZTC__) +# define LZO_CC_ZORTECHC 1 +# define LZO_INFO_CC "Zortech C" +# if ((__ZTC__-0) == 0x310) +# define LZO_INFO_CCVER "0x310" +# else +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__ZTC__) +# endif +#elif defined(__GNUC__) && defined(__VERSION__) +# if defined(__GNUC_MINOR__) && defined(__GNUC_PATCHLEVEL__) +# define LZO_CC_GNUC (__GNUC__ * 0x10000L + (__GNUC_MINOR__-0) * 0x100 + (__GNUC_PATCHLEVEL__-0)) +# elif defined(__GNUC_MINOR__) +# define LZO_CC_GNUC (__GNUC__ * 0x10000L + (__GNUC_MINOR__-0) * 0x100) +# else +# define LZO_CC_GNUC (__GNUC__ * 0x10000L) +# endif +# define LZO_INFO_CC "gcc" +# define LZO_INFO_CCVER __VERSION__ +#elif defined(_MSC_VER) && ((_MSC_VER-0) > 0) +# define LZO_CC_MSC _MSC_VER +# define LZO_INFO_CC "Microsoft C" +# if defined(_MSC_FULL_VER) +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(_MSC_VER) "." LZO_PP_MACRO_EXPAND(_MSC_FULL_VER) +# else +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(_MSC_VER) +# endif +#else +# define LZO_CC_UNKNOWN 1 +# define LZO_INFO_CC "unknown" +# define LZO_INFO_CCVER "unknown" +#endif +#if (LZO_CC_GNUC) && defined(__OPEN64__) +# if defined(__OPENCC__) && defined(__OPENCC_MINOR__) && defined(__OPENCC_PATCHLEVEL__) +# define LZO_CC_OPEN64 (__OPENCC__ * 0x10000L + (__OPENCC_MINOR__-0) * 0x100 + (__OPENCC_PATCHLEVEL__-0)) +# define LZO_CC_OPEN64_GNUC LZO_CC_GNUC +# endif +#endif +#if (LZO_CC_GNUC) && defined(__PCC__) +# if defined(__PCC__) && defined(__PCC_MINOR__) && defined(__PCC_MINORMINOR__) +# define LZO_CC_PCC (__PCC__ * 0x10000L + (__PCC_MINOR__-0) * 0x100 + (__PCC_MINORMINOR__-0)) +# define LZO_CC_PCC_GNUC LZO_CC_GNUC +# endif +#endif +#if 0 && (LZO_CC_MSC && (_MSC_VER >= 1200)) && !defined(_MSC_FULL_VER) +# error "LZO_CC_MSC: _MSC_FULL_VER is not defined" +#endif +#if !defined(__LZO_ARCH_OVERRIDE) && !(LZO_ARCH_GENERIC) && defined(_CRAY) +# if (UINT_MAX > LZO_0xffffffffL) && defined(_CRAY) +# if defined(_CRAYMPP) || defined(_CRAYT3D) || defined(_CRAYT3E) +# define LZO_ARCH_CRAY_MPP 1 +# elif defined(_CRAY1) +# define LZO_ARCH_CRAY_PVP 1 +# endif +# endif +#endif +#if !defined(__LZO_ARCH_OVERRIDE) +#if (LZO_ARCH_GENERIC) +# define LZO_INFO_ARCH "generic" +#elif (LZO_OS_DOS16 || LZO_OS_OS216 || LZO_OS_WIN16) +# define LZO_ARCH_I086 1 +# define LZO_INFO_ARCH "i086" +#elif defined(__aarch64__) +# define LZO_ARCH_ARM64 1 +# define LZO_INFO_ARCH "arm64" +#elif defined(__alpha__) || defined(__alpha) || defined(_M_ALPHA) +# define LZO_ARCH_ALPHA 1 +# define LZO_INFO_ARCH "alpha" +#elif (LZO_ARCH_CRAY_MPP) && (defined(_CRAYT3D) || defined(_CRAYT3E)) +# define LZO_ARCH_ALPHA 1 +# define LZO_INFO_ARCH "alpha" +#elif defined(__amd64__) || defined(__x86_64__) || defined(_M_AMD64) +# define LZO_ARCH_AMD64 1 +# define LZO_INFO_ARCH "amd64" +#elif defined(__thumb__) || (defined(_M_ARM) && defined(_M_THUMB)) +# define LZO_ARCH_ARM 1 +# define LZO_ARCH_ARM_THUMB 1 +# define LZO_INFO_ARCH "arm_thumb" +#elif defined(__IAR_SYSTEMS_ICC__) && defined(__ICCARM__) +# define LZO_ARCH_ARM 1 +# if defined(__CPU_MODE__) && ((__CPU_MODE__-0) == 1) +# define LZO_ARCH_ARM_THUMB 1 +# define LZO_INFO_ARCH "arm_thumb" +# elif defined(__CPU_MODE__) && ((__CPU_MODE__-0) == 2) +# define LZO_INFO_ARCH "arm" +# else +# define LZO_INFO_ARCH "arm" +# endif +#elif defined(__arm__) || defined(_M_ARM) +# define LZO_ARCH_ARM 1 +# define LZO_INFO_ARCH "arm" +#elif (UINT_MAX <= LZO_0xffffL) && defined(__AVR__) +# define LZO_ARCH_AVR 1 +# define LZO_INFO_ARCH "avr" +#elif defined(__avr32__) || defined(__AVR32__) +# define LZO_ARCH_AVR32 1 +# define LZO_INFO_ARCH "avr32" +#elif defined(__bfin__) +# define LZO_ARCH_BLACKFIN 1 +# define LZO_INFO_ARCH "blackfin" +#elif (UINT_MAX == LZO_0xffffL) && defined(__C166__) +# define LZO_ARCH_C166 1 +# define LZO_INFO_ARCH "c166" +#elif defined(__cris__) +# define LZO_ARCH_CRIS 1 +# define LZO_INFO_ARCH "cris" +#elif defined(__IAR_SYSTEMS_ICC__) && defined(__ICCEZ80__) +# define LZO_ARCH_EZ80 1 +# define LZO_INFO_ARCH "ez80" +#elif defined(__H8300__) || defined(__H8300H__) || defined(__H8300S__) || defined(__H8300SX__) +# define LZO_ARCH_H8300 1 +# define LZO_INFO_ARCH "h8300" +#elif defined(__hppa__) || defined(__hppa) +# define LZO_ARCH_HPPA 1 +# define LZO_INFO_ARCH "hppa" +#elif defined(__386__) || defined(__i386__) || defined(__i386) || defined(_M_IX86) || defined(_M_I386) +# define LZO_ARCH_I386 1 +# define LZO_ARCH_IA32 1 +# define LZO_INFO_ARCH "i386" +#elif (LZO_CC_ZORTECHC && defined(__I86__)) +# define LZO_ARCH_I386 1 +# define LZO_ARCH_IA32 1 +# define LZO_INFO_ARCH "i386" +#elif (LZO_OS_DOS32 && LZO_CC_HIGHC) && defined(_I386) +# define LZO_ARCH_I386 1 +# define LZO_ARCH_IA32 1 +# define LZO_INFO_ARCH "i386" +#elif defined(__ia64__) || defined(__ia64) || defined(_M_IA64) +# define LZO_ARCH_IA64 1 +# define LZO_INFO_ARCH "ia64" +#elif (UINT_MAX == LZO_0xffffL) && defined(__m32c__) +# define LZO_ARCH_M16C 1 +# define LZO_INFO_ARCH "m16c" +#elif defined(__IAR_SYSTEMS_ICC__) && defined(__ICCM16C__) +# define LZO_ARCH_M16C 1 +# define LZO_INFO_ARCH "m16c" +#elif defined(__m32r__) +# define LZO_ARCH_M32R 1 +# define LZO_INFO_ARCH "m32r" +#elif (LZO_OS_TOS) || defined(__m68k__) || defined(__m68000__) || defined(__mc68000__) || defined(__mc68020__) || defined(_M_M68K) +# define LZO_ARCH_M68K 1 +# define LZO_INFO_ARCH "m68k" +#elif (UINT_MAX == LZO_0xffffL) && defined(__C251__) +# define LZO_ARCH_MCS251 1 +# define LZO_INFO_ARCH "mcs251" +#elif (UINT_MAX == LZO_0xffffL) && defined(__C51__) +# define LZO_ARCH_MCS51 1 +# define LZO_INFO_ARCH "mcs51" +#elif defined(__IAR_SYSTEMS_ICC__) && defined(__ICC8051__) +# define LZO_ARCH_MCS51 1 +# define LZO_INFO_ARCH "mcs51" +#elif defined(__mips__) || defined(__mips) || defined(_MIPS_ARCH) || defined(_M_MRX000) +# define LZO_ARCH_MIPS 1 +# define LZO_INFO_ARCH "mips" +#elif (UINT_MAX == LZO_0xffffL) && defined(__MSP430__) +# define LZO_ARCH_MSP430 1 +# define LZO_INFO_ARCH "msp430" +#elif defined(__IAR_SYSTEMS_ICC__) && defined(__ICC430__) +# define LZO_ARCH_MSP430 1 +# define LZO_INFO_ARCH "msp430" +#elif defined(__powerpc__) || defined(__powerpc) || defined(__ppc__) || defined(__PPC__) || defined(_M_PPC) || defined(_ARCH_PPC) || defined(_ARCH_PWR) +# define LZO_ARCH_POWERPC 1 +# define LZO_INFO_ARCH "powerpc" +#elif defined(__s390__) || defined(__s390) || defined(__s390x__) || defined(__s390x) +# define LZO_ARCH_S390 1 +# define LZO_INFO_ARCH "s390" +#elif defined(__sh__) || defined(_M_SH) +# define LZO_ARCH_SH 1 +# define LZO_INFO_ARCH "sh" +#elif defined(__sparc__) || defined(__sparc) || defined(__sparcv8) +# define LZO_ARCH_SPARC 1 +# define LZO_INFO_ARCH "sparc" +#elif defined(__SPU__) +# define LZO_ARCH_SPU 1 +# define LZO_INFO_ARCH "spu" +#elif (UINT_MAX == LZO_0xffffL) && defined(__z80) +# define LZO_ARCH_Z80 1 +# define LZO_INFO_ARCH "z80" +#elif (LZO_ARCH_CRAY_PVP) +# if defined(_CRAYSV1) +# define LZO_ARCH_CRAY_SV1 1 +# define LZO_INFO_ARCH "cray_sv1" +# elif (_ADDR64) +# define LZO_ARCH_CRAY_T90 1 +# define LZO_INFO_ARCH "cray_t90" +# elif (_ADDR32) +# define LZO_ARCH_CRAY_YMP 1 +# define LZO_INFO_ARCH "cray_ymp" +# else +# define LZO_ARCH_CRAY_XMP 1 +# define LZO_INFO_ARCH "cray_xmp" +# endif +#else +# define LZO_ARCH_UNKNOWN 1 +# define LZO_INFO_ARCH "unknown" +#endif +#endif +#if 1 && (LZO_ARCH_UNKNOWN) && (LZO_OS_DOS32 || LZO_OS_OS2) +# error "FIXME - missing define for CPU architecture" +#endif +#if 1 && (LZO_ARCH_UNKNOWN) && (LZO_OS_WIN32) +# error "FIXME - missing LZO_OS_WIN32 define for CPU architecture" +#endif +#if 1 && (LZO_ARCH_UNKNOWN) && (LZO_OS_WIN64) +# error "FIXME - missing LZO_OS_WIN64 define for CPU architecture" +#endif +#if (LZO_OS_OS216 || LZO_OS_WIN16) +# define LZO_ARCH_I086PM 1 +#elif 1 && (LZO_OS_DOS16 && defined(BLX286)) +# define LZO_ARCH_I086PM 1 +#elif 1 && (LZO_OS_DOS16 && defined(DOSX286)) +# define LZO_ARCH_I086PM 1 +#elif 1 && (LZO_OS_DOS16 && LZO_CC_BORLANDC && defined(__DPMI16__)) +# define LZO_ARCH_I086PM 1 +#endif +#if (LZO_ARCH_AMD64 && !LZO_ARCH_X64) +# define LZO_ARCH_X64 1 +#elif (!LZO_ARCH_AMD64 && LZO_ARCH_X64) && defined(__LZO_ARCH_OVERRIDE) +# define LZO_ARCH_AMD64 1 +#endif +#if (LZO_ARCH_ARM64 && !LZO_ARCH_AARCH64) +# define LZO_ARCH_AARCH64 1 +#elif (!LZO_ARCH_ARM64 && LZO_ARCH_AARCH64) && defined(__LZO_ARCH_OVERRIDE) +# define LZO_ARCH_ARM64 1 +#endif +#if (LZO_ARCH_I386 && !LZO_ARCH_X86) +# define LZO_ARCH_X86 1 +#elif (!LZO_ARCH_I386 && LZO_ARCH_X86) && defined(__LZO_ARCH_OVERRIDE) +# define LZO_ARCH_I386 1 +#endif +#if (LZO_ARCH_AMD64 && !LZO_ARCH_X64) || (!LZO_ARCH_AMD64 && LZO_ARCH_X64) +# error "unexpected configuration - check your compiler defines" +#endif +#if (LZO_ARCH_ARM64 && !LZO_ARCH_AARCH64) || (!LZO_ARCH_ARM64 && LZO_ARCH_AARCH64) +# error "unexpected configuration - check your compiler defines" +#endif +#if (LZO_ARCH_I386 && !LZO_ARCH_X86) || (!LZO_ARCH_I386 && LZO_ARCH_X86) +# error "unexpected configuration - check your compiler defines" +#endif +#if (LZO_ARCH_ARM_THUMB && !LZO_ARCH_ARM) +# error "unexpected configuration - check your compiler defines" +#endif +#if (LZO_ARCH_ARM_THUMB1 && !LZO_ARCH_ARM_THUMB) +# error "unexpected configuration - check your compiler defines" +#endif +#if (LZO_ARCH_ARM_THUMB2 && !LZO_ARCH_ARM_THUMB) +# error "unexpected configuration - check your compiler defines" +#endif +#if (LZO_ARCH_ARM_THUMB1 && LZO_ARCH_ARM_THUMB2) +# error "unexpected configuration - check your compiler defines" +#endif +#if (LZO_ARCH_I086PM && !LZO_ARCH_I086) +# error "unexpected configuration - check your compiler defines" +#endif +#if (LZO_ARCH_I086) +# if (UINT_MAX != LZO_0xffffL) +# error "unexpected configuration - check your compiler defines" +# endif +# if (ULONG_MAX != LZO_0xffffffffL) +# error "unexpected configuration - check your compiler defines" +# endif +#endif +#if (LZO_ARCH_I386) +# if (UINT_MAX != LZO_0xffffL) && defined(__i386_int16__) +# error "unexpected configuration - check your compiler defines" +# endif +# if (UINT_MAX != LZO_0xffffffffL) && !defined(__i386_int16__) +# error "unexpected configuration - check your compiler defines" +# endif +# if (ULONG_MAX != LZO_0xffffffffL) +# error "unexpected configuration - check your compiler defines" +# endif +#endif +#if (LZO_ARCH_AMD64 || LZO_ARCH_I386) +# if !defined(LZO_TARGET_FEATURE_SSE2) +# if defined(__SSE2__) +# define LZO_TARGET_FEATURE_SSE2 1 +# elif defined(_MSC_VER) && ((defined(_M_IX86_FP) && ((_M_IX86_FP)+0 >= 2)) || defined(_M_AMD64)) +# define LZO_TARGET_FEATURE_SSE2 1 +# endif +# endif +# if !defined(LZO_TARGET_FEATURE_SSSE3) +# if (LZO_TARGET_FEATURE_SSE2) +# if defined(__SSSE3__) +# define LZO_TARGET_FEATURE_SSSE3 1 +# elif defined(_MSC_VER) && defined(__AVX__) +# define LZO_TARGET_FEATURE_SSSE3 1 +# endif +# endif +# endif +# if !defined(LZO_TARGET_FEATURE_SSE4_2) +# if (LZO_TARGET_FEATURE_SSSE3) +# if defined(__SSE4_2__) +# define LZO_TARGET_FEATURE_SSE4_2 1 +# endif +# endif +# endif +# if !defined(LZO_TARGET_FEATURE_AVX) +# if (LZO_TARGET_FEATURE_SSSE3) +# if defined(__AVX__) +# define LZO_TARGET_FEATURE_AVX 1 +# endif +# endif +# endif +# if !defined(LZO_TARGET_FEATURE_AVX2) +# if (LZO_TARGET_FEATURE_AVX) +# if defined(__AVX2__) +# define LZO_TARGET_FEATURE_AVX2 1 +# endif +# endif +# endif +#endif +#if (LZO_TARGET_FEATURE_SSSE3 && !(LZO_TARGET_FEATURE_SSE2)) +# error "unexpected configuration - check your compiler defines" +#endif +#if (LZO_TARGET_FEATURE_SSE4_2 && !(LZO_TARGET_FEATURE_SSSE3)) +# error "unexpected configuration - check your compiler defines" +#endif +#if (LZO_TARGET_FEATURE_AVX && !(LZO_TARGET_FEATURE_SSSE3)) +# error "unexpected configuration - check your compiler defines" +#endif +#if (LZO_TARGET_FEATURE_AVX2 && !(LZO_TARGET_FEATURE_AVX)) +# error "unexpected configuration - check your compiler defines" +#endif +#if (LZO_ARCH_ARM) +# if !defined(LZO_TARGET_FEATURE_NEON) +# if defined(__ARM_NEON__) +# define LZO_TARGET_FEATURE_NEON 1 +# endif +# endif +#elif (LZO_ARCH_ARM64) +# if !defined(LZO_TARGET_FEATURE_NEON) +# if 1 +# define LZO_TARGET_FEATURE_NEON 1 +# endif +# endif +#endif +#if 0 +#elif !defined(__LZO_MM_OVERRIDE) +#if (LZO_ARCH_I086) +#if (UINT_MAX != LZO_0xffffL) +# error "unexpected configuration - check your compiler defines" +#endif +#if defined(__TINY__) || defined(M_I86TM) || defined(_M_I86TM) +# define LZO_MM_TINY 1 +#elif defined(__HUGE__) || defined(_HUGE_) || defined(M_I86HM) || defined(_M_I86HM) +# define LZO_MM_HUGE 1 +#elif defined(__SMALL__) || defined(M_I86SM) || defined(_M_I86SM) || defined(SMALL_MODEL) +# define LZO_MM_SMALL 1 +#elif defined(__MEDIUM__) || defined(M_I86MM) || defined(_M_I86MM) +# define LZO_MM_MEDIUM 1 +#elif defined(__COMPACT__) || defined(M_I86CM) || defined(_M_I86CM) +# define LZO_MM_COMPACT 1 +#elif defined(__LARGE__) || defined(M_I86LM) || defined(_M_I86LM) || defined(LARGE_MODEL) +# define LZO_MM_LARGE 1 +#elif (LZO_CC_AZTECC) +# if defined(_LARGE_CODE) && defined(_LARGE_DATA) +# define LZO_MM_LARGE 1 +# elif defined(_LARGE_CODE) +# define LZO_MM_MEDIUM 1 +# elif defined(_LARGE_DATA) +# define LZO_MM_COMPACT 1 +# else +# define LZO_MM_SMALL 1 +# endif +#elif (LZO_CC_ZORTECHC && defined(__VCM__)) +# define LZO_MM_LARGE 1 +#else +# error "unknown LZO_ARCH_I086 memory model" +#endif +#if (LZO_OS_DOS16 || LZO_OS_OS216 || LZO_OS_WIN16) +#define LZO_HAVE_MM_HUGE_PTR 1 +#define LZO_HAVE_MM_HUGE_ARRAY 1 +#if (LZO_MM_TINY) +# undef LZO_HAVE_MM_HUGE_ARRAY +#endif +#if (LZO_CC_AZTECC || LZO_CC_PACIFICC || LZO_CC_ZORTECHC) +# undef LZO_HAVE_MM_HUGE_PTR +# undef LZO_HAVE_MM_HUGE_ARRAY +#elif (LZO_CC_DMC || LZO_CC_SYMANTECC) +# undef LZO_HAVE_MM_HUGE_ARRAY +#elif (LZO_CC_MSC && defined(_QC)) +# undef LZO_HAVE_MM_HUGE_ARRAY +# if (_MSC_VER < 600) +# undef LZO_HAVE_MM_HUGE_PTR +# endif +#elif (LZO_CC_TURBOC && (__TURBOC__ < 0x0295)) +# undef LZO_HAVE_MM_HUGE_ARRAY +#endif +#if (LZO_ARCH_I086PM) && !(LZO_HAVE_MM_HUGE_PTR) +# if (LZO_OS_DOS16) +# error "unexpected configuration - check your compiler defines" +# elif (LZO_CC_ZORTECHC) +# else +# error "unexpected configuration - check your compiler defines" +# endif +#endif +#ifdef __cplusplus +extern "C" { +#endif +#if (LZO_CC_BORLANDC && (__BORLANDC__ >= 0x0200)) + extern void __near __cdecl _AHSHIFT(void); +# define LZO_MM_AHSHIFT ((unsigned) _AHSHIFT) +#elif (LZO_CC_DMC || LZO_CC_SYMANTECC || LZO_CC_ZORTECHC) + extern void __near __cdecl _AHSHIFT(void); +# define LZO_MM_AHSHIFT ((unsigned) _AHSHIFT) +#elif (LZO_CC_MSC || LZO_CC_TOPSPEEDC) + extern void __near __cdecl _AHSHIFT(void); +# define LZO_MM_AHSHIFT ((unsigned) _AHSHIFT) +#elif (LZO_CC_TURBOC && (__TURBOC__ >= 0x0295)) + extern void __near __cdecl _AHSHIFT(void); +# define LZO_MM_AHSHIFT ((unsigned) _AHSHIFT) +#elif ((LZO_CC_AZTECC || LZO_CC_PACIFICC || LZO_CC_TURBOC) && LZO_OS_DOS16) +# define LZO_MM_AHSHIFT 12 +#elif (LZO_CC_WATCOMC) + extern unsigned char _HShift; +# define LZO_MM_AHSHIFT ((unsigned) _HShift) +#else +# error "FIXME - implement LZO_MM_AHSHIFT" +#endif +#ifdef __cplusplus +} +#endif +#endif +#elif (LZO_ARCH_C166) +#if !defined(__MODEL__) +# error "FIXME - LZO_ARCH_C166 __MODEL__" +#elif ((__MODEL__) == 0) +# define LZO_MM_SMALL 1 +#elif ((__MODEL__) == 1) +# define LZO_MM_SMALL 1 +#elif ((__MODEL__) == 2) +# define LZO_MM_LARGE 1 +#elif ((__MODEL__) == 3) +# define LZO_MM_TINY 1 +#elif ((__MODEL__) == 4) +# define LZO_MM_XTINY 1 +#elif ((__MODEL__) == 5) +# define LZO_MM_XSMALL 1 +#else +# error "FIXME - LZO_ARCH_C166 __MODEL__" +#endif +#elif (LZO_ARCH_MCS251) +#if !defined(__MODEL__) +# error "FIXME - LZO_ARCH_MCS251 __MODEL__" +#elif ((__MODEL__) == 0) +# define LZO_MM_SMALL 1 +#elif ((__MODEL__) == 2) +# define LZO_MM_LARGE 1 +#elif ((__MODEL__) == 3) +# define LZO_MM_TINY 1 +#elif ((__MODEL__) == 4) +# define LZO_MM_XTINY 1 +#elif ((__MODEL__) == 5) +# define LZO_MM_XSMALL 1 +#else +# error "FIXME - LZO_ARCH_MCS251 __MODEL__" +#endif +#elif (LZO_ARCH_MCS51) +#if !defined(__MODEL__) +# error "FIXME - LZO_ARCH_MCS51 __MODEL__" +#elif ((__MODEL__) == 1) +# define LZO_MM_SMALL 1 +#elif ((__MODEL__) == 2) +# define LZO_MM_LARGE 1 +#elif ((__MODEL__) == 3) +# define LZO_MM_TINY 1 +#elif ((__MODEL__) == 4) +# define LZO_MM_XTINY 1 +#elif ((__MODEL__) == 5) +# define LZO_MM_XSMALL 1 +#else +# error "FIXME - LZO_ARCH_MCS51 __MODEL__" +#endif +#elif (LZO_ARCH_CRAY_PVP) +# define LZO_MM_PVP 1 +#else +# define LZO_MM_FLAT 1 +#endif +#if (LZO_MM_COMPACT) +# define LZO_INFO_MM "compact" +#elif (LZO_MM_FLAT) +# define LZO_INFO_MM "flat" +#elif (LZO_MM_HUGE) +# define LZO_INFO_MM "huge" +#elif (LZO_MM_LARGE) +# define LZO_INFO_MM "large" +#elif (LZO_MM_MEDIUM) +# define LZO_INFO_MM "medium" +#elif (LZO_MM_PVP) +# define LZO_INFO_MM "pvp" +#elif (LZO_MM_SMALL) +# define LZO_INFO_MM "small" +#elif (LZO_MM_TINY) +# define LZO_INFO_MM "tiny" +#else +# error "unknown memory model" +#endif +#endif +#if !defined(__lzo_gnuc_extension__) +#if (LZO_CC_GNUC >= 0x020800ul) +# define __lzo_gnuc_extension__ __extension__ +#elif (LZO_CC_ARMCC_GNUC || LZO_CC_CLANG || LZO_CC_LLVM || LZO_CC_PATHSCALE) +# define __lzo_gnuc_extension__ __extension__ +#elif (LZO_CC_IBMC >= 600) +# define __lzo_gnuc_extension__ __extension__ +#else +#endif +#endif +#if !defined(__lzo_gnuc_extension__) +# define __lzo_gnuc_extension__ /*empty*/ +#endif +#if !defined(LZO_CFG_USE_NEW_STYLE_CASTS) && defined(__cplusplus) && 0 +# if (LZO_CC_GNUC && (LZO_CC_GNUC < 0x020800ul)) +# define LZO_CFG_USE_NEW_STYLE_CASTS 0 +# elif (LZO_CC_INTELC && (__INTEL_COMPILER < 1200)) +# define LZO_CFG_USE_NEW_STYLE_CASTS 0 +# else +# define LZO_CFG_USE_NEW_STYLE_CASTS 1 +# endif +#endif +#if !defined(LZO_CFG_USE_NEW_STYLE_CASTS) +# define LZO_CFG_USE_NEW_STYLE_CASTS 0 +#endif +#if !defined(__cplusplus) +# if defined(LZO_CFG_USE_NEW_STYLE_CASTS) +# undef LZO_CFG_USE_NEW_STYLE_CASTS +# endif +# define LZO_CFG_USE_NEW_STYLE_CASTS 0 +#endif +#if !defined(LZO_REINTERPRET_CAST) +# if (LZO_CFG_USE_NEW_STYLE_CASTS) +# define LZO_REINTERPRET_CAST(t,e) (reinterpret_cast (e)) +# endif +#endif +#if !defined(LZO_REINTERPRET_CAST) +# define LZO_REINTERPRET_CAST(t,e) ((t) (e)) +#endif +#if !defined(LZO_STATIC_CAST) +# if (LZO_CFG_USE_NEW_STYLE_CASTS) +# define LZO_STATIC_CAST(t,e) (static_cast (e)) +# endif +#endif +#if !defined(LZO_STATIC_CAST) +# define LZO_STATIC_CAST(t,e) ((t) (e)) +#endif +#if !defined(LZO_STATIC_CAST2) +# define LZO_STATIC_CAST2(t1,t2,e) LZO_STATIC_CAST(t1, LZO_STATIC_CAST(t2, e)) +#endif +#if !defined(LZO_UNCONST_CAST) +# if (LZO_CFG_USE_NEW_STYLE_CASTS) +# define LZO_UNCONST_CAST(t,e) (const_cast (e)) +# elif (LZO_HAVE_MM_HUGE_PTR) +# define LZO_UNCONST_CAST(t,e) ((t) (e)) +# elif (LZO_CC_ARMCC_GNUC || LZO_CC_CLANG || LZO_CC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE) +# define LZO_UNCONST_CAST(t,e) ((t) ((void *) ((lzo_uintptr_t) ((const void *) (e))))) +# endif +#endif +#if !defined(LZO_UNCONST_CAST) +# define LZO_UNCONST_CAST(t,e) ((t) ((void *) ((const void *) (e)))) +#endif +#if !defined(LZO_UNCONST_VOLATILE_CAST) +# if (LZO_CFG_USE_NEW_STYLE_CASTS) +# define LZO_UNCONST_VOLATILE_CAST(t,e) (const_cast (e)) +# elif (LZO_HAVE_MM_HUGE_PTR) +# define LZO_UNCONST_VOLATILE_CAST(t,e) ((t) (e)) +# elif (LZO_CC_ARMCC_GNUC || LZO_CC_CLANG || LZO_CC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE) +# define LZO_UNCONST_VOLATILE_CAST(t,e) ((t) ((volatile void *) ((lzo_uintptr_t) ((volatile const void *) (e))))) +# endif +#endif +#if !defined(LZO_UNCONST_VOLATILE_CAST) +# define LZO_UNCONST_VOLATILE_CAST(t,e) ((t) ((volatile void *) ((volatile const void *) (e)))) +#endif +#if !defined(LZO_UNVOLATILE_CAST) +# if (LZO_CFG_USE_NEW_STYLE_CASTS) +# define LZO_UNVOLATILE_CAST(t,e) (const_cast (e)) +# elif (LZO_HAVE_MM_HUGE_PTR) +# define LZO_UNVOLATILE_CAST(t,e) ((t) (e)) +# elif (LZO_CC_ARMCC_GNUC || LZO_CC_CLANG || LZO_CC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE) +# define LZO_UNVOLATILE_CAST(t,e) ((t) ((void *) ((lzo_uintptr_t) ((volatile void *) (e))))) +# endif +#endif +#if !defined(LZO_UNVOLATILE_CAST) +# define LZO_UNVOLATILE_CAST(t,e) ((t) ((void *) ((volatile void *) (e)))) +#endif +#if !defined(LZO_UNVOLATILE_CONST_CAST) +# if (LZO_CFG_USE_NEW_STYLE_CASTS) +# define LZO_UNVOLATILE_CONST_CAST(t,e) (const_cast (e)) +# elif (LZO_HAVE_MM_HUGE_PTR) +# define LZO_UNVOLATILE_CONST_CAST(t,e) ((t) (e)) +# elif (LZO_CC_ARMCC_GNUC || LZO_CC_CLANG || LZO_CC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE) +# define LZO_UNVOLATILE_CONST_CAST(t,e) ((t) ((const void *) ((lzo_uintptr_t) ((volatile const void *) (e))))) +# endif +#endif +#if !defined(LZO_UNVOLATILE_CONST_CAST) +# define LZO_UNVOLATILE_CONST_CAST(t,e) ((t) ((const void *) ((volatile const void *) (e)))) +#endif +#if !defined(LZO_PCAST) +# if (LZO_HAVE_MM_HUGE_PTR) +# define LZO_PCAST(t,e) ((t) (e)) +# endif +#endif +#if !defined(LZO_PCAST) +# define LZO_PCAST(t,e) LZO_STATIC_CAST(t, LZO_STATIC_CAST(void *, e)) +#endif +#if !defined(LZO_CCAST) +# if (LZO_HAVE_MM_HUGE_PTR) +# define LZO_CCAST(t,e) ((t) (e)) +# endif +#endif +#if !defined(LZO_CCAST) +# define LZO_CCAST(t,e) LZO_STATIC_CAST(t, LZO_STATIC_CAST(const void *, e)) +#endif +#if !defined(LZO_ICONV) +# define LZO_ICONV(t,e) LZO_STATIC_CAST(t, e) +#endif +#if !defined(LZO_ICAST) +# define LZO_ICAST(t,e) LZO_STATIC_CAST(t, e) +#endif +#if !defined(LZO_ITRUNC) +# define LZO_ITRUNC(t,e) LZO_STATIC_CAST(t, e) +#endif +#if !defined(__lzo_cte) +# if (LZO_CC_MSC || LZO_CC_WATCOMC) +# define __lzo_cte(e) ((void)0,(e)) +# elif 1 +# define __lzo_cte(e) ((void)0,(e)) +# endif +#endif +#if !defined(__lzo_cte) +# define __lzo_cte(e) (e) +#endif +#if !defined(LZO_BLOCK_BEGIN) +# define LZO_BLOCK_BEGIN do { +# define LZO_BLOCK_END } while __lzo_cte(0) +#endif +#if !defined(LZO_UNUSED) +# if (LZO_CC_BORLANDC && (__BORLANDC__ >= 0x0600)) +# define LZO_UNUSED(var) ((void) &var) +# elif (LZO_CC_BORLANDC || LZO_CC_HIGHC || LZO_CC_NDPC || LZO_CC_PELLESC || LZO_CC_TURBOC) +# define LZO_UNUSED(var) if (&var) ; else +# elif (LZO_CC_CLANG && (LZO_CC_CLANG >= 0x030200ul)) +# define LZO_UNUSED(var) ((void) &var) +# elif (LZO_CC_CLANG || LZO_CC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE) +# define LZO_UNUSED(var) ((void) var) +# elif (LZO_CC_MSC && (_MSC_VER < 900)) +# define LZO_UNUSED(var) if (&var) ; else +# elif (LZO_CC_KEILC) +# define LZO_UNUSED(var) {LZO_EXTERN_C int lzo_unused__[1-2*!(sizeof(var)>0)];} +# elif (LZO_CC_PACIFICC) +# define LZO_UNUSED(var) ((void) sizeof(var)) +# elif (LZO_CC_WATCOMC) && defined(__cplusplus) +# define LZO_UNUSED(var) ((void) var) +# else +# define LZO_UNUSED(var) ((void) &var) +# endif +#endif +#if !defined(LZO_UNUSED_FUNC) +# if (LZO_CC_BORLANDC && (__BORLANDC__ >= 0x0600)) +# define LZO_UNUSED_FUNC(func) ((void) func) +# elif (LZO_CC_BORLANDC || LZO_CC_NDPC || LZO_CC_TURBOC) +# define LZO_UNUSED_FUNC(func) if (func) ; else +# elif (LZO_CC_CLANG || LZO_CC_LLVM) +# define LZO_UNUSED_FUNC(func) ((void) &func) +# elif (LZO_CC_MSC && (_MSC_VER < 900)) +# define LZO_UNUSED_FUNC(func) if (func) ; else +# elif (LZO_CC_MSC) +# define LZO_UNUSED_FUNC(func) ((void) &func) +# elif (LZO_CC_KEILC || LZO_CC_PELLESC) +# define LZO_UNUSED_FUNC(func) {LZO_EXTERN_C int lzo_unused_func__[1-2*!(sizeof((int)func)>0)];} +# else +# define LZO_UNUSED_FUNC(func) ((void) func) +# endif +#endif +#if !defined(LZO_UNUSED_LABEL) +# if (LZO_CC_CLANG >= 0x020800ul) +# define LZO_UNUSED_LABEL(l) (__lzo_gnuc_extension__ ((void) ((const void *) &&l))) +# elif (LZO_CC_ARMCC || LZO_CC_CLANG || LZO_CC_INTELC || LZO_CC_WATCOMC) +# define LZO_UNUSED_LABEL(l) if __lzo_cte(0) goto l +# else +# define LZO_UNUSED_LABEL(l) switch (0) case 1:goto l +# endif +#endif +#if !defined(LZO_DEFINE_UNINITIALIZED_VAR) +# if 0 +# define LZO_DEFINE_UNINITIALIZED_VAR(type,var,init) type var +# elif 0 && (LZO_CC_GNUC) +# define LZO_DEFINE_UNINITIALIZED_VAR(type,var,init) type var = var +# else +# define LZO_DEFINE_UNINITIALIZED_VAR(type,var,init) type var = init +# endif +#endif +#if !defined(__lzo_inline) +#if (LZO_CC_TURBOC && (__TURBOC__ <= 0x0295)) +#elif defined(__cplusplus) +# define __lzo_inline inline +#elif defined(__STDC_VERSION__) && (__STDC_VERSION__-0 >= 199901L) +# define __lzo_inline inline +#elif (LZO_CC_BORLANDC && (__BORLANDC__ >= 0x0550)) +# define __lzo_inline __inline +#elif (LZO_CC_ARMCC_GNUC || LZO_CC_CILLY || LZO_CC_CLANG || LZO_CC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE || LZO_CC_PGI) +# define __lzo_inline __inline__ +#elif (LZO_CC_DMC) +# define __lzo_inline __inline +#elif (LZO_CC_GHS) +# define __lzo_inline __inline__ +#elif (LZO_CC_IBMC >= 600) +# define __lzo_inline __inline__ +#elif (LZO_CC_INTELC) +# define __lzo_inline __inline +#elif (LZO_CC_MWERKS && (__MWERKS__ >= 0x2405)) +# define __lzo_inline __inline +#elif (LZO_CC_MSC && (_MSC_VER >= 900)) +# define __lzo_inline __inline +#elif (LZO_CC_SUNPROC >= 0x5100) +# define __lzo_inline __inline__ +#endif +#endif +#if defined(__lzo_inline) +# ifndef __lzo_HAVE_inline +# define __lzo_HAVE_inline 1 +# endif +#else +# define __lzo_inline /*empty*/ +#endif +#if !defined(__lzo_forceinline) +#if (LZO_CC_GNUC >= 0x030200ul) +# define __lzo_forceinline __inline__ __attribute__((__always_inline__)) +#elif (LZO_CC_IBMC >= 700) +# define __lzo_forceinline __inline__ __attribute__((__always_inline__)) +#elif (LZO_CC_INTELC_MSC && (__INTEL_COMPILER >= 450)) +# define __lzo_forceinline __forceinline +#elif (LZO_CC_INTELC_GNUC && (__INTEL_COMPILER >= 800)) +# define __lzo_forceinline __inline__ __attribute__((__always_inline__)) +#elif (LZO_CC_ARMCC_GNUC || LZO_CC_CLANG || LZO_CC_LLVM || LZO_CC_PATHSCALE) +# define __lzo_forceinline __inline__ __attribute__((__always_inline__)) +#elif (LZO_CC_MSC && (_MSC_VER >= 1200)) +# define __lzo_forceinline __forceinline +#elif (LZO_CC_PGI >= 0x0d0a00ul) +# define __lzo_forceinline __inline__ __attribute__((__always_inline__)) +#elif (LZO_CC_SUNPROC >= 0x5100) +# define __lzo_forceinline __inline__ __attribute__((__always_inline__)) +#endif +#endif +#if defined(__lzo_forceinline) +# ifndef __lzo_HAVE_forceinline +# define __lzo_HAVE_forceinline 1 +# endif +#else +# define __lzo_forceinline __lzo_inline +#endif +#if !defined(__lzo_noinline) +#if 1 && (LZO_ARCH_I386) && (LZO_CC_GNUC >= 0x040000ul) && (LZO_CC_GNUC < 0x040003ul) +# define __lzo_noinline __attribute__((__noinline__,__used__)) +#elif (LZO_CC_GNUC >= 0x030200ul) +# define __lzo_noinline __attribute__((__noinline__)) +#elif (LZO_CC_IBMC >= 700) +# define __lzo_noinline __attribute__((__noinline__)) +#elif (LZO_CC_INTELC_MSC && (__INTEL_COMPILER >= 600)) +# define __lzo_noinline __declspec(noinline) +#elif (LZO_CC_INTELC_GNUC && (__INTEL_COMPILER >= 800)) +# define __lzo_noinline __attribute__((__noinline__)) +#elif (LZO_CC_ARMCC_GNUC || LZO_CC_CLANG || LZO_CC_LLVM || LZO_CC_PATHSCALE) +# define __lzo_noinline __attribute__((__noinline__)) +#elif (LZO_CC_MSC && (_MSC_VER >= 1300)) +# define __lzo_noinline __declspec(noinline) +#elif (LZO_CC_MWERKS && (__MWERKS__ >= 0x3200) && (LZO_OS_WIN32 || LZO_OS_WIN64)) +# if defined(__cplusplus) +# else +# define __lzo_noinline __declspec(noinline) +# endif +#elif (LZO_CC_PGI >= 0x0d0a00ul) +# define __lzo_noinline __attribute__((__noinline__)) +#elif (LZO_CC_SUNPROC >= 0x5100) +# define __lzo_noinline __attribute__((__noinline__)) +#endif +#endif +#if defined(__lzo_noinline) +# ifndef __lzo_HAVE_noinline +# define __lzo_HAVE_noinline 1 +# endif +#else +# define __lzo_noinline /*empty*/ +#endif +#if (__lzo_HAVE_forceinline || __lzo_HAVE_noinline) && !(__lzo_HAVE_inline) +# error "unexpected configuration - check your compiler defines" +#endif +#if !defined(__lzo_static_inline) +#if (LZO_CC_IBMC) +# define __lzo_static_inline __lzo_gnuc_extension__ static __lzo_inline +#endif +#endif +#if !defined(__lzo_static_inline) +# define __lzo_static_inline static __lzo_inline +#endif +#if !defined(__lzo_static_forceinline) +#if (LZO_CC_IBMC) +# define __lzo_static_forceinline __lzo_gnuc_extension__ static __lzo_forceinline +#endif +#endif +#if !defined(__lzo_static_forceinline) +# define __lzo_static_forceinline static __lzo_forceinline +#endif +#if !defined(__lzo_static_noinline) +#if (LZO_CC_IBMC) +# define __lzo_static_noinline __lzo_gnuc_extension__ static __lzo_noinline +#endif +#endif +#if !defined(__lzo_static_noinline) +# define __lzo_static_noinline static __lzo_noinline +#endif +#if !defined(__lzo_c99_extern_inline) +#if defined(__GNUC_GNU_INLINE__) +# define __lzo_c99_extern_inline __lzo_inline +#elif defined(__GNUC_STDC_INLINE__) +# define __lzo_c99_extern_inline extern __lzo_inline +#elif defined(__STDC_VERSION__) && (__STDC_VERSION__-0 >= 199901L) +# define __lzo_c99_extern_inline extern __lzo_inline +#endif +#if !defined(__lzo_c99_extern_inline) && (__lzo_HAVE_inline) +# define __lzo_c99_extern_inline __lzo_inline +#endif +#endif +#if defined(__lzo_c99_extern_inline) +# ifndef __lzo_HAVE_c99_extern_inline +# define __lzo_HAVE_c99_extern_inline 1 +# endif +#else +# define __lzo_c99_extern_inline /*empty*/ +#endif +#if !defined(__lzo_may_alias) +#if (LZO_CC_GNUC >= 0x030400ul) +# define __lzo_may_alias __attribute__((__may_alias__)) +#elif (LZO_CC_CLANG >= 0x020900ul) +# define __lzo_may_alias __attribute__((__may_alias__)) +#elif (LZO_CC_INTELC_GNUC && (__INTEL_COMPILER >= 1210)) && 0 +# define __lzo_may_alias __attribute__((__may_alias__)) +#elif (LZO_CC_PGI >= 0x0d0a00ul) && 0 +# define __lzo_may_alias __attribute__((__may_alias__)) +#endif +#endif +#if defined(__lzo_may_alias) +# ifndef __lzo_HAVE_may_alias +# define __lzo_HAVE_may_alias 1 +# endif +#else +# define __lzo_may_alias /*empty*/ +#endif +#if !defined(__lzo_noreturn) +#if (LZO_CC_GNUC >= 0x020700ul) +# define __lzo_noreturn __attribute__((__noreturn__)) +#elif (LZO_CC_IBMC >= 700) +# define __lzo_noreturn __attribute__((__noreturn__)) +#elif (LZO_CC_INTELC_MSC && (__INTEL_COMPILER >= 450)) +# define __lzo_noreturn __declspec(noreturn) +#elif (LZO_CC_INTELC_GNUC && (__INTEL_COMPILER >= 600)) +# define __lzo_noreturn __attribute__((__noreturn__)) +#elif (LZO_CC_ARMCC_GNUC || LZO_CC_CLANG || LZO_CC_LLVM || LZO_CC_PATHSCALE) +# define __lzo_noreturn __attribute__((__noreturn__)) +#elif (LZO_CC_MSC && (_MSC_VER >= 1200)) +# define __lzo_noreturn __declspec(noreturn) +#elif (LZO_CC_PGI >= 0x0d0a00ul) +# define __lzo_noreturn __attribute__((__noreturn__)) +#endif +#endif +#if defined(__lzo_noreturn) +# ifndef __lzo_HAVE_noreturn +# define __lzo_HAVE_noreturn 1 +# endif +#else +# define __lzo_noreturn /*empty*/ +#endif +#if !defined(__lzo_nothrow) +#if (LZO_CC_GNUC >= 0x030300ul) +# define __lzo_nothrow __attribute__((__nothrow__)) +#elif (LZO_CC_INTELC_MSC && (__INTEL_COMPILER >= 450)) && defined(__cplusplus) +# define __lzo_nothrow __declspec(nothrow) +#elif (LZO_CC_INTELC_GNUC && (__INTEL_COMPILER >= 900)) +# define __lzo_nothrow __attribute__((__nothrow__)) +#elif (LZO_CC_ARMCC_GNUC || LZO_CC_CLANG || LZO_CC_LLVM || LZO_CC_PATHSCALE) +# define __lzo_nothrow __attribute__((__nothrow__)) +#elif (LZO_CC_MSC && (_MSC_VER >= 1200)) && defined(__cplusplus) +# define __lzo_nothrow __declspec(nothrow) +#endif +#endif +#if defined(__lzo_nothrow) +# ifndef __lzo_HAVE_nothrow +# define __lzo_HAVE_nothrow 1 +# endif +#else +# define __lzo_nothrow /*empty*/ +#endif +#if !defined(__lzo_restrict) +#if (LZO_CC_GNUC >= 0x030400ul) +# define __lzo_restrict __restrict__ +#elif (LZO_CC_IBMC >= 800) && !defined(__cplusplus) +# define __lzo_restrict __restrict__ +#elif (LZO_CC_IBMC >= 1210) +# define __lzo_restrict __restrict__ +#elif (LZO_CC_INTELC_MSC && (__INTEL_COMPILER >= 600)) +#elif (LZO_CC_INTELC_GNUC && (__INTEL_COMPILER >= 600)) +# define __lzo_restrict __restrict__ +#elif (LZO_CC_ARMCC_GNUC || LZO_CC_CLANG || LZO_CC_LLVM) +# define __lzo_restrict __restrict__ +#elif (LZO_CC_MSC && (_MSC_VER >= 1400)) +# define __lzo_restrict __restrict +#elif (LZO_CC_PGI >= 0x0d0a00ul) +# define __lzo_restrict __restrict__ +#endif +#endif +#if defined(__lzo_restrict) +# ifndef __lzo_HAVE_restrict +# define __lzo_HAVE_restrict 1 +# endif +#else +# define __lzo_restrict /*empty*/ +#endif +#if !defined(__lzo_alignof) +#if (LZO_CC_ARMCC || LZO_CC_CILLY || LZO_CC_CLANG || LZO_CC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE || LZO_CC_PGI) +# define __lzo_alignof(e) __alignof__(e) +#elif (LZO_CC_GHS) && !defined(__cplusplus) +# define __lzo_alignof(e) __alignof__(e) +#elif (LZO_CC_IBMC >= 600) +# define __lzo_alignof(e) (__lzo_gnuc_extension__ __alignof__(e)) +#elif (LZO_CC_INTELC && (__INTEL_COMPILER >= 700)) +# define __lzo_alignof(e) __alignof__(e) +#elif (LZO_CC_MSC && (_MSC_VER >= 1300)) +# define __lzo_alignof(e) __alignof(e) +#elif (LZO_CC_SUNPROC >= 0x5100) +# define __lzo_alignof(e) __alignof__(e) +#endif +#endif +#if defined(__lzo_alignof) +# ifndef __lzo_HAVE_alignof +# define __lzo_HAVE_alignof 1 +# endif +#endif +#if !defined(__lzo_struct_packed) +#if (LZO_CC_CLANG && (LZO_CC_CLANG < 0x020800ul)) && defined(__cplusplus) +#elif (LZO_CC_GNUC && (LZO_CC_GNUC < 0x020700ul)) +#elif (LZO_CC_GNUC && (LZO_CC_GNUC < 0x020800ul)) && defined(__cplusplus) +#elif (LZO_CC_PCC && (LZO_CC_PCC < 0x010100ul)) +#elif (LZO_CC_SUNPROC && (LZO_CC_SUNPROC < 0x5110)) && !defined(__cplusplus) +#elif (LZO_CC_GNUC >= 0x030400ul) && !(LZO_CC_PCC_GNUC) && (LZO_ARCH_AMD64 || LZO_ARCH_I386) +# define __lzo_struct_packed(s) struct s { +# define __lzo_struct_packed_end() } __attribute__((__gcc_struct__,__packed__)); +# define __lzo_struct_packed_ma_end() } __lzo_may_alias __attribute__((__gcc_struct__,__packed__)); +#elif (LZO_CC_ARMCC || LZO_CC_CLANG || LZO_CC_GNUC || LZO_CC_INTELC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE || (LZO_CC_PGI >= 0x0d0a00ul) || (LZO_CC_SUNPROC >= 0x5100)) +# define __lzo_struct_packed(s) struct s { +# define __lzo_struct_packed_end() } __attribute__((__packed__)); +# define __lzo_struct_packed_ma_end() } __lzo_may_alias __attribute__((__packed__)); +#elif (LZO_CC_IBMC >= 700) +# define __lzo_struct_packed(s) __lzo_gnuc_extension__ struct s { +# define __lzo_struct_packed_end() } __attribute__((__packed__)); +# define __lzo_struct_packed_ma_end() } __lzo_may_alias __attribute__((__packed__)); +#elif (LZO_CC_INTELC_MSC) || (LZO_CC_MSC && (_MSC_VER >= 1300)) +# define __lzo_struct_packed(s) __pragma(pack(push,1)) struct s { +# define __lzo_struct_packed_end() } __pragma(pack(pop)); +#elif (LZO_CC_WATCOMC && (__WATCOMC__ >= 900)) +# define __lzo_struct_packed(s) _Packed struct s { +# define __lzo_struct_packed_end() }; +#endif +#endif +#if defined(__lzo_struct_packed) && !defined(__lzo_struct_packed_ma) +# define __lzo_struct_packed_ma(s) __lzo_struct_packed(s) +#endif +#if defined(__lzo_struct_packed_end) && !defined(__lzo_struct_packed_ma_end) +# define __lzo_struct_packed_ma_end() __lzo_struct_packed_end() +#endif +#if !defined(__lzo_byte_struct) +#if defined(__lzo_struct_packed) +# define __lzo_byte_struct(s,n) __lzo_struct_packed(s) unsigned char a[n]; __lzo_struct_packed_end() +# define __lzo_byte_struct_ma(s,n) __lzo_struct_packed_ma(s) unsigned char a[n]; __lzo_struct_packed_ma_end() +#elif (LZO_CC_CILLY || LZO_CC_CLANG || LZO_CC_PGI || (LZO_CC_SUNPROC >= 0x5100)) +# define __lzo_byte_struct(s,n) struct s { unsigned char a[n]; } __attribute__((__packed__)); +# define __lzo_byte_struct_ma(s,n) struct s { unsigned char a[n]; } __lzo_may_alias __attribute__((__packed__)); +#endif +#endif +#if defined(__lzo_byte_struct) && !defined(__lzo_byte_struct_ma) +# define __lzo_byte_struct_ma(s,n) __lzo_byte_struct(s,n) +#endif +#if !defined(__lzo_struct_align16) && (__lzo_HAVE_alignof) +#if (LZO_CC_GNUC && (LZO_CC_GNUC < 0x030000ul)) +#elif (LZO_CC_CLANG && (LZO_CC_CLANG < 0x020800ul)) && defined(__cplusplus) +#elif (LZO_CC_CILLY || LZO_CC_PCC) +#elif (LZO_CC_INTELC_MSC) || (LZO_CC_MSC && (_MSC_VER >= 1300)) +# define __lzo_struct_align16(s) struct __declspec(align(16)) s { +# define __lzo_struct_align16_end() }; +# define __lzo_struct_align32(s) struct __declspec(align(32)) s { +# define __lzo_struct_align32_end() }; +# define __lzo_struct_align64(s) struct __declspec(align(64)) s { +# define __lzo_struct_align64_end() }; +#elif (LZO_CC_ARMCC || LZO_CC_CLANG || LZO_CC_GNUC || (LZO_CC_IBMC >= 700) || LZO_CC_INTELC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE) +# define __lzo_struct_align16(s) struct s { +# define __lzo_struct_align16_end() } __attribute__((__aligned__(16))); +# define __lzo_struct_align32(s) struct s { +# define __lzo_struct_align32_end() } __attribute__((__aligned__(32))); +# define __lzo_struct_align64(s) struct s { +# define __lzo_struct_align64_end() } __attribute__((__aligned__(64))); +#endif +#endif +#if !defined(__lzo_union_um) +#if (LZO_CC_CLANG && (LZO_CC_CLANG < 0x020800ul)) && defined(__cplusplus) +#elif (LZO_CC_GNUC && (LZO_CC_GNUC < 0x020700ul)) +#elif (LZO_CC_GNUC && (LZO_CC_GNUC < 0x020800ul)) && defined(__cplusplus) +#elif (LZO_CC_INTELC_GNUC && (__INTEL_COMPILER < 810)) +#elif (LZO_CC_PCC && (LZO_CC_PCC < 0x010100ul)) +#elif (LZO_CC_SUNPROC && (LZO_CC_SUNPROC < 0x5110)) && !defined(__cplusplus) +#elif (LZO_CC_ARMCC || LZO_CC_CLANG || LZO_CC_GNUC || LZO_CC_INTELC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE || (LZO_CC_PGI >= 0x0d0a00ul) || (LZO_CC_SUNPROC >= 0x5100)) +# define __lzo_union_am(s) union s { +# define __lzo_union_am_end() } __lzo_may_alias; +# define __lzo_union_um(s) union s { +# define __lzo_union_um_end() } __lzo_may_alias __attribute__((__packed__)); +#elif (LZO_CC_IBMC >= 700) +# define __lzo_union_am(s) __lzo_gnuc_extension__ union s { +# define __lzo_union_am_end() } __lzo_may_alias; +# define __lzo_union_um(s) __lzo_gnuc_extension__ union s { +# define __lzo_union_um_end() } __lzo_may_alias __attribute__((__packed__)); +#elif (LZO_CC_INTELC_MSC) || (LZO_CC_MSC && (_MSC_VER >= 1300)) +# define __lzo_union_um(s) __pragma(pack(push,1)) union s { +# define __lzo_union_um_end() } __pragma(pack(pop)); +#elif (LZO_CC_WATCOMC && (__WATCOMC__ >= 900)) +# define __lzo_union_um(s) _Packed union s { +# define __lzo_union_um_end() }; +#endif +#endif +#if !defined(__lzo_union_am) +# define __lzo_union_am(s) union s { +# define __lzo_union_am_end() }; +#endif +#if !defined(__lzo_constructor) +#if (LZO_CC_GNUC >= 0x030400ul) +# define __lzo_constructor __attribute__((__constructor__,__used__)) +#elif (LZO_CC_GNUC >= 0x020700ul) +# define __lzo_constructor __attribute__((__constructor__)) +#elif (LZO_CC_INTELC_GNUC && (__INTEL_COMPILER >= 800)) +# define __lzo_constructor __attribute__((__constructor__,__used__)) +#elif (LZO_CC_ARMCC_GNUC || LZO_CC_CLANG || LZO_CC_LLVM || LZO_CC_PATHSCALE) +# define __lzo_constructor __attribute__((__constructor__)) +#endif +#endif +#if defined(__lzo_constructor) +# ifndef __lzo_HAVE_constructor +# define __lzo_HAVE_constructor 1 +# endif +#endif +#if !defined(__lzo_destructor) +#if (LZO_CC_GNUC >= 0x030400ul) +# define __lzo_destructor __attribute__((__destructor__,__used__)) +#elif (LZO_CC_GNUC >= 0x020700ul) +# define __lzo_destructor __attribute__((__destructor__)) +#elif (LZO_CC_INTELC_GNUC && (__INTEL_COMPILER >= 800)) +# define __lzo_destructor __attribute__((__destructor__,__used__)) +#elif (LZO_CC_ARMCC_GNUC || LZO_CC_CLANG || LZO_CC_LLVM || LZO_CC_PATHSCALE) +# define __lzo_destructor __attribute__((__destructor__)) +#endif +#endif +#if defined(__lzo_destructor) +# ifndef __lzo_HAVE_destructor +# define __lzo_HAVE_destructor 1 +# endif +#endif +#if (__lzo_HAVE_destructor) && !(__lzo_HAVE_constructor) +# error "unexpected configuration - check your compiler defines" +#endif +#if !defined(__lzo_likely) && !defined(__lzo_unlikely) +#if (LZO_CC_GNUC >= 0x030200ul) +# define __lzo_likely(e) (__builtin_expect(!!(e),1)) +# define __lzo_unlikely(e) (__builtin_expect(!!(e),0)) +#elif (LZO_CC_IBMC >= 1010) +# define __lzo_likely(e) (__builtin_expect(!!(e),1)) +# define __lzo_unlikely(e) (__builtin_expect(!!(e),0)) +#elif (LZO_CC_INTELC && (__INTEL_COMPILER >= 800)) +# define __lzo_likely(e) (__builtin_expect(!!(e),1)) +# define __lzo_unlikely(e) (__builtin_expect(!!(e),0)) +#elif (LZO_CC_ARMCC_GNUC || LZO_CC_CLANG || LZO_CC_LLVM || LZO_CC_PATHSCALE) +# define __lzo_likely(e) (__builtin_expect(!!(e),1)) +# define __lzo_unlikely(e) (__builtin_expect(!!(e),0)) +#endif +#endif +#if defined(__lzo_likely) +# ifndef __lzo_HAVE_likely +# define __lzo_HAVE_likely 1 +# endif +#else +# define __lzo_likely(e) (e) +#endif +#if defined(__lzo_unlikely) +# ifndef __lzo_HAVE_unlikely +# define __lzo_HAVE_unlikely 1 +# endif +#else +# define __lzo_unlikely(e) (e) +#endif +#if !defined(__lzo_static_unused_void_func) +# if 1 && (LZO_CC_ARMCC_GNUC || LZO_CC_CLANG || (LZO_CC_GNUC >= 0x020700ul) || LZO_CC_INTELC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE || LZO_CC_PGI) +# define __lzo_static_unused_void_func(f) static void __attribute__((__unused__)) f(void) +# else +# define __lzo_static_unused_void_func(f) static __lzo_inline void f(void) +# endif +#endif +#if !defined(__lzo_loop_forever) +# if (LZO_CC_IBMC) +# define __lzo_loop_forever() LZO_BLOCK_BEGIN for (;;) { ; } LZO_BLOCK_END +# else +# define __lzo_loop_forever() do { ; } while __lzo_cte(1) +# endif +#endif +#if !defined(__lzo_unreachable) +#if (LZO_CC_CLANG && (LZO_CC_CLANG >= 0x020800ul)) +# define __lzo_unreachable() __builtin_unreachable(); +#elif (LZO_CC_GNUC >= 0x040500ul) +# define __lzo_unreachable() __builtin_unreachable(); +#elif (LZO_CC_INTELC_GNUC && (__INTEL_COMPILER >= 1300)) && 1 +# define __lzo_unreachable() __builtin_unreachable(); +#endif +#endif +#if defined(__lzo_unreachable) +# ifndef __lzo_HAVE_unreachable +# define __lzo_HAVE_unreachable 1 +# endif +#else +# if 0 +# define __lzo_unreachable() ((void)0); +# else +# define __lzo_unreachable() __lzo_loop_forever(); +# endif +#endif +#ifndef __LZO_CTA_NAME +#if (LZO_CFG_USE_COUNTER) +# define __LZO_CTA_NAME(a) LZO_PP_ECONCAT2(a,__COUNTER__) +#else +# define __LZO_CTA_NAME(a) LZO_PP_ECONCAT2(a,__LINE__) +#endif +#endif +#if !defined(LZO_COMPILE_TIME_ASSERT_HEADER) +# if (LZO_CC_AZTECC || LZO_CC_ZORTECHC) +# define LZO_COMPILE_TIME_ASSERT_HEADER(e) LZO_EXTERN_C_BEGIN extern int __LZO_CTA_NAME(lzo_cta__)[1-!(e)]; LZO_EXTERN_C_END +# elif (LZO_CC_DMC || LZO_CC_SYMANTECC) +# define LZO_COMPILE_TIME_ASSERT_HEADER(e) LZO_EXTERN_C_BEGIN extern int __LZO_CTA_NAME(lzo_cta__)[1u-2*!(e)]; LZO_EXTERN_C_END +# elif (LZO_CC_TURBOC && (__TURBOC__ == 0x0295)) +# define LZO_COMPILE_TIME_ASSERT_HEADER(e) LZO_EXTERN_C_BEGIN extern int __LZO_CTA_NAME(lzo_cta__)[1-!(e)]; LZO_EXTERN_C_END +# elif (LZO_CC_CLANG && (LZO_CC_CLANG < 0x020900ul)) && defined(__cplusplus) +# define LZO_COMPILE_TIME_ASSERT_HEADER(e) LZO_EXTERN_C_BEGIN int __LZO_CTA_NAME(lzo_cta_f__)(int [1-2*!(e)]); LZO_EXTERN_C_END +# elif (LZO_CC_GNUC) && defined(__CHECKER__) && defined(__SPARSE_CHECKER__) +# define LZO_COMPILE_TIME_ASSERT_HEADER(e) LZO_EXTERN_C_BEGIN enum {__LZO_CTA_NAME(lzo_cta_e__)=1/!!(e)} __attribute__((__unused__)); LZO_EXTERN_C_END +# else +# define LZO_COMPILE_TIME_ASSERT_HEADER(e) LZO_EXTERN_C_BEGIN extern int __LZO_CTA_NAME(lzo_cta__)[1-2*!(e)]; LZO_EXTERN_C_END +# endif +#endif +#if !defined(LZO_COMPILE_TIME_ASSERT) +# if (LZO_CC_AZTECC) +# define LZO_COMPILE_TIME_ASSERT(e) {typedef int __LZO_CTA_NAME(lzo_cta_t__)[1-!(e)];} +# elif (LZO_CC_DMC || LZO_CC_PACIFICC || LZO_CC_SYMANTECC || LZO_CC_ZORTECHC) +# define LZO_COMPILE_TIME_ASSERT(e) switch(0) case 1:case !(e):break; +# elif (LZO_CC_GNUC) && defined(__CHECKER__) && defined(__SPARSE_CHECKER__) +# define LZO_COMPILE_TIME_ASSERT(e) {(void) (0/!!(e));} +# elif (LZO_CC_GNUC >= 0x040700ul) && (LZO_CFG_USE_COUNTER) && defined(__cplusplus) +# define LZO_COMPILE_TIME_ASSERT(e) {enum {__LZO_CTA_NAME(lzo_cta_e__)=1/!!(e)} __attribute__((__unused__));} +# elif (LZO_CC_GNUC >= 0x040700ul) +# define LZO_COMPILE_TIME_ASSERT(e) {typedef int __LZO_CTA_NAME(lzo_cta_t__)[1-2*!(e)] __attribute__((__unused__));} +# elif (LZO_CC_MSC && (_MSC_VER < 900)) +# define LZO_COMPILE_TIME_ASSERT(e) switch(0) case 1:case !(e):break; +# elif (LZO_CC_TURBOC && (__TURBOC__ == 0x0295)) +# define LZO_COMPILE_TIME_ASSERT(e) switch(0) case 1:case !(e):break; +# else +# define LZO_COMPILE_TIME_ASSERT(e) {typedef int __LZO_CTA_NAME(lzo_cta_t__)[1-2*!(e)];} +# endif +#endif +LZO_COMPILE_TIME_ASSERT_HEADER(1 == 1) +#if defined(__cplusplus) +extern "C" { LZO_COMPILE_TIME_ASSERT_HEADER(2 == 2) } +#endif +LZO_COMPILE_TIME_ASSERT_HEADER(3 == 3) +#if (LZO_ARCH_I086 || LZO_ARCH_I386) && (LZO_OS_DOS16 || LZO_OS_DOS32 || LZO_OS_OS2 || LZO_OS_OS216 || LZO_OS_WIN16 || LZO_OS_WIN32 || LZO_OS_WIN64) +# if (LZO_CC_GNUC || LZO_CC_HIGHC || LZO_CC_NDPC || LZO_CC_PACIFICC) +# elif (LZO_CC_DMC || LZO_CC_SYMANTECC || LZO_CC_ZORTECHC) +# define __lzo_cdecl __cdecl +# define __lzo_cdecl_atexit /*empty*/ +# define __lzo_cdecl_main __cdecl +# if (LZO_OS_OS2 && (LZO_CC_DMC || LZO_CC_SYMANTECC)) +# define __lzo_cdecl_qsort __pascal +# elif (LZO_OS_OS2 && (LZO_CC_ZORTECHC)) +# define __lzo_cdecl_qsort _stdcall +# else +# define __lzo_cdecl_qsort __cdecl +# endif +# elif (LZO_CC_WATCOMC) +# define __lzo_cdecl __cdecl +# else +# define __lzo_cdecl __cdecl +# define __lzo_cdecl_atexit __cdecl +# define __lzo_cdecl_main __cdecl +# define __lzo_cdecl_qsort __cdecl +# endif +# if (LZO_CC_GNUC || LZO_CC_HIGHC || LZO_CC_NDPC || LZO_CC_PACIFICC || LZO_CC_WATCOMC) +# elif (LZO_OS_OS2 && (LZO_CC_DMC || LZO_CC_SYMANTECC)) +# define __lzo_cdecl_sighandler __pascal +# elif (LZO_OS_OS2 && (LZO_CC_ZORTECHC)) +# define __lzo_cdecl_sighandler _stdcall +# elif (LZO_CC_MSC && (_MSC_VER >= 1400)) && defined(_M_CEE_PURE) +# define __lzo_cdecl_sighandler __clrcall +# elif (LZO_CC_MSC && (_MSC_VER >= 600 && _MSC_VER < 700)) +# if defined(_DLL) +# define __lzo_cdecl_sighandler _far _cdecl _loadds +# elif defined(_MT) +# define __lzo_cdecl_sighandler _far _cdecl +# else +# define __lzo_cdecl_sighandler _cdecl +# endif +# else +# define __lzo_cdecl_sighandler __cdecl +# endif +#elif (LZO_ARCH_I386) && (LZO_CC_WATCOMC) +# define __lzo_cdecl __cdecl +#elif (LZO_ARCH_M68K && LZO_OS_TOS && (LZO_CC_PUREC || LZO_CC_TURBOC)) +# define __lzo_cdecl cdecl +#endif +#if !defined(__lzo_cdecl) +# define __lzo_cdecl /*empty*/ +#endif +#if !defined(__lzo_cdecl_atexit) +# define __lzo_cdecl_atexit /*empty*/ +#endif +#if !defined(__lzo_cdecl_main) +# define __lzo_cdecl_main /*empty*/ +#endif +#if !defined(__lzo_cdecl_qsort) +# define __lzo_cdecl_qsort /*empty*/ +#endif +#if !defined(__lzo_cdecl_sighandler) +# define __lzo_cdecl_sighandler /*empty*/ +#endif +#if !defined(__lzo_cdecl_va) +# define __lzo_cdecl_va __lzo_cdecl +#endif +#if !(LZO_CFG_NO_WINDOWS_H) +#if !defined(LZO_HAVE_WINDOWS_H) +#if (LZO_OS_CYGWIN || (LZO_OS_EMX && defined(__RSXNT__)) || LZO_OS_WIN32 || LZO_OS_WIN64) +# if (LZO_CC_WATCOMC && (__WATCOMC__ < 1000)) +# elif (LZO_OS_WIN32 && LZO_CC_GNUC) && defined(__PW32__) +# elif ((LZO_OS_CYGWIN || defined(__MINGW32__)) && (LZO_CC_GNUC && (LZO_CC_GNUC < 0x025f00ul))) +# else +# define LZO_HAVE_WINDOWS_H 1 +# endif +#endif +#endif +#endif +#ifndef LZO_SIZEOF_SHORT +#if defined(SIZEOF_SHORT) +# define LZO_SIZEOF_SHORT (SIZEOF_SHORT) +#elif defined(__SIZEOF_SHORT__) +# define LZO_SIZEOF_SHORT (__SIZEOF_SHORT__) +#endif +#endif +#ifndef LZO_SIZEOF_INT +#if defined(SIZEOF_INT) +# define LZO_SIZEOF_INT (SIZEOF_INT) +#elif defined(__SIZEOF_INT__) +# define LZO_SIZEOF_INT (__SIZEOF_INT__) +#endif +#endif +#ifndef LZO_SIZEOF_LONG +#if defined(SIZEOF_LONG) +# define LZO_SIZEOF_LONG (SIZEOF_LONG) +#elif defined(__SIZEOF_LONG__) +# define LZO_SIZEOF_LONG (__SIZEOF_LONG__) +#endif +#endif +#ifndef LZO_SIZEOF_LONG_LONG +#if defined(SIZEOF_LONG_LONG) +# define LZO_SIZEOF_LONG_LONG (SIZEOF_LONG_LONG) +#elif defined(__SIZEOF_LONG_LONG__) +# define LZO_SIZEOF_LONG_LONG (__SIZEOF_LONG_LONG__) +#endif +#endif +#ifndef LZO_SIZEOF___INT16 +#if defined(SIZEOF___INT16) +# define LZO_SIZEOF___INT16 (SIZEOF___INT16) +#endif +#endif +#ifndef LZO_SIZEOF___INT32 +#if defined(SIZEOF___INT32) +# define LZO_SIZEOF___INT32 (SIZEOF___INT32) +#endif +#endif +#ifndef LZO_SIZEOF___INT64 +#if defined(SIZEOF___INT64) +# define LZO_SIZEOF___INT64 (SIZEOF___INT64) +#endif +#endif +#ifndef LZO_SIZEOF_VOID_P +#if defined(SIZEOF_VOID_P) +# define LZO_SIZEOF_VOID_P (SIZEOF_VOID_P) +#elif defined(__SIZEOF_POINTER__) +# define LZO_SIZEOF_VOID_P (__SIZEOF_POINTER__) +#endif +#endif +#ifndef LZO_SIZEOF_SIZE_T +#if defined(SIZEOF_SIZE_T) +# define LZO_SIZEOF_SIZE_T (SIZEOF_SIZE_T) +#elif defined(__SIZEOF_SIZE_T__) +# define LZO_SIZEOF_SIZE_T (__SIZEOF_SIZE_T__) +#endif +#endif +#ifndef LZO_SIZEOF_PTRDIFF_T +#if defined(SIZEOF_PTRDIFF_T) +# define LZO_SIZEOF_PTRDIFF_T (SIZEOF_PTRDIFF_T) +#elif defined(__SIZEOF_PTRDIFF_T__) +# define LZO_SIZEOF_PTRDIFF_T (__SIZEOF_PTRDIFF_T__) +#endif +#endif +#define __LZO_LSR(x,b) (((x)+0ul) >> (b)) +#if !defined(LZO_SIZEOF_SHORT) +# if (LZO_ARCH_CRAY_PVP) +# define LZO_SIZEOF_SHORT 8 +# elif (USHRT_MAX == LZO_0xffffL) +# define LZO_SIZEOF_SHORT 2 +# elif (__LZO_LSR(USHRT_MAX,7) == 1) +# define LZO_SIZEOF_SHORT 1 +# elif (__LZO_LSR(USHRT_MAX,15) == 1) +# define LZO_SIZEOF_SHORT 2 +# elif (__LZO_LSR(USHRT_MAX,31) == 1) +# define LZO_SIZEOF_SHORT 4 +# elif (__LZO_LSR(USHRT_MAX,63) == 1) +# define LZO_SIZEOF_SHORT 8 +# elif (__LZO_LSR(USHRT_MAX,127) == 1) +# define LZO_SIZEOF_SHORT 16 +# else +# error "LZO_SIZEOF_SHORT" +# endif +#endif +LZO_COMPILE_TIME_ASSERT_HEADER(LZO_SIZEOF_SHORT == sizeof(short)) +#if !defined(LZO_SIZEOF_INT) +# if (LZO_ARCH_CRAY_PVP) +# define LZO_SIZEOF_INT 8 +# elif (UINT_MAX == LZO_0xffffL) +# define LZO_SIZEOF_INT 2 +# elif (UINT_MAX == LZO_0xffffffffL) +# define LZO_SIZEOF_INT 4 +# elif (__LZO_LSR(UINT_MAX,7) == 1) +# define LZO_SIZEOF_INT 1 +# elif (__LZO_LSR(UINT_MAX,15) == 1) +# define LZO_SIZEOF_INT 2 +# elif (__LZO_LSR(UINT_MAX,31) == 1) +# define LZO_SIZEOF_INT 4 +# elif (__LZO_LSR(UINT_MAX,63) == 1) +# define LZO_SIZEOF_INT 8 +# elif (__LZO_LSR(UINT_MAX,127) == 1) +# define LZO_SIZEOF_INT 16 +# else +# error "LZO_SIZEOF_INT" +# endif +#endif +LZO_COMPILE_TIME_ASSERT_HEADER(LZO_SIZEOF_INT == sizeof(int)) +#if !defined(LZO_SIZEOF_LONG) +# if (ULONG_MAX == LZO_0xffffffffL) +# define LZO_SIZEOF_LONG 4 +# elif (__LZO_LSR(ULONG_MAX,7) == 1) +# define LZO_SIZEOF_LONG 1 +# elif (__LZO_LSR(ULONG_MAX,15) == 1) +# define LZO_SIZEOF_LONG 2 +# elif (__LZO_LSR(ULONG_MAX,31) == 1) +# define LZO_SIZEOF_LONG 4 +# elif (__LZO_LSR(ULONG_MAX,39) == 1) +# define LZO_SIZEOF_LONG 5 +# elif (__LZO_LSR(ULONG_MAX,63) == 1) +# define LZO_SIZEOF_LONG 8 +# elif (__LZO_LSR(ULONG_MAX,127) == 1) +# define LZO_SIZEOF_LONG 16 +# else +# error "LZO_SIZEOF_LONG" +# endif +#endif +LZO_COMPILE_TIME_ASSERT_HEADER(LZO_SIZEOF_LONG == sizeof(long)) +#if !defined(LZO_SIZEOF_LONG_LONG) && !defined(LZO_SIZEOF___INT64) +#if (LZO_SIZEOF_LONG > 0 && LZO_SIZEOF_LONG < 8) +# if defined(__LONG_MAX__) && defined(__LONG_LONG_MAX__) +# if (LZO_CC_GNUC >= 0x030300ul) +# if ((__LONG_MAX__-0) == (__LONG_LONG_MAX__-0)) +# define LZO_SIZEOF_LONG_LONG LZO_SIZEOF_LONG +# elif (__LZO_LSR(__LONG_LONG_MAX__,30) == 1) +# define LZO_SIZEOF_LONG_LONG 4 +# endif +# endif +# endif +#endif +#endif +#if !defined(LZO_SIZEOF_LONG_LONG) && !defined(LZO_SIZEOF___INT64) +#if (LZO_SIZEOF_LONG > 0 && LZO_SIZEOF_LONG < 8) +#if (LZO_ARCH_I086 && LZO_CC_DMC) +#elif (LZO_CC_CILLY) && defined(__GNUC__) +# define LZO_SIZEOF_LONG_LONG 8 +#elif (LZO_CC_ARMCC_GNUC || LZO_CC_CLANG || LZO_CC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE) +# define LZO_SIZEOF_LONG_LONG 8 +#elif ((LZO_OS_WIN32 || LZO_OS_WIN64 || defined(_WIN32)) && LZO_CC_MSC && (_MSC_VER >= 1400)) +# define LZO_SIZEOF_LONG_LONG 8 +#elif (LZO_OS_WIN64 || defined(_WIN64)) +# define LZO_SIZEOF___INT64 8 +#elif (LZO_ARCH_I386 && (LZO_CC_DMC)) +# define LZO_SIZEOF_LONG_LONG 8 +#elif (LZO_ARCH_I386 && (LZO_CC_SYMANTECC && (__SC__ >= 0x700))) +# define LZO_SIZEOF_LONG_LONG 8 +#elif (LZO_ARCH_I386 && (LZO_CC_INTELC && defined(__linux__))) +# define LZO_SIZEOF_LONG_LONG 8 +#elif (LZO_ARCH_I386 && (LZO_CC_MWERKS || LZO_CC_PELLESC || LZO_CC_PGI || LZO_CC_SUNPROC)) +# define LZO_SIZEOF_LONG_LONG 8 +#elif (LZO_ARCH_I386 && (LZO_CC_INTELC || LZO_CC_MSC)) +# define LZO_SIZEOF___INT64 8 +#elif ((LZO_OS_WIN32 || defined(_WIN32)) && (LZO_CC_MSC)) +# define LZO_SIZEOF___INT64 8 +#elif (LZO_ARCH_I386 && (LZO_CC_BORLANDC && (__BORLANDC__ >= 0x0520))) +# define LZO_SIZEOF___INT64 8 +#elif (LZO_ARCH_I386 && (LZO_CC_WATCOMC && (__WATCOMC__ >= 1100))) +# define LZO_SIZEOF___INT64 8 +#elif (LZO_CC_GHS && defined(__LLONG_BIT) && ((__LLONG_BIT-0) == 64)) +# define LZO_SIZEOF_LONG_LONG 8 +#elif (LZO_CC_WATCOMC && defined(_INTEGRAL_MAX_BITS) && ((_INTEGRAL_MAX_BITS-0) == 64)) +# define LZO_SIZEOF___INT64 8 +#elif (LZO_OS_OS400 || defined(__OS400__)) && defined(__LLP64_IFC__) +# define LZO_SIZEOF_LONG_LONG 8 +#elif (defined(__vms) || defined(__VMS)) && ((__INITIAL_POINTER_SIZE-0) == 64) +# define LZO_SIZEOF_LONG_LONG 8 +#elif (LZO_CC_SDCC) && (LZO_SIZEOF_INT == 2) +#elif 1 && defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) +# define LZO_SIZEOF_LONG_LONG 8 +#endif +#endif +#endif +#if defined(__cplusplus) && (LZO_CC_GNUC) +# if (LZO_CC_GNUC < 0x020800ul) +# undef LZO_SIZEOF_LONG_LONG +# endif +#endif +#if (LZO_CFG_NO_LONG_LONG) +# undef LZO_SIZEOF_LONG_LONG +#elif defined(__NO_LONG_LONG) +# undef LZO_SIZEOF_LONG_LONG +#elif defined(_NO_LONGLONG) +# undef LZO_SIZEOF_LONG_LONG +#endif +#if !defined(LZO_WORDSIZE) +#if (LZO_ARCH_ALPHA) +# define LZO_WORDSIZE 8 +#elif (LZO_ARCH_AMD64) +# define LZO_WORDSIZE 8 +#elif (LZO_ARCH_AVR) +# define LZO_WORDSIZE 1 +#elif (LZO_ARCH_H8300) +# if defined(__NORMAL_MODE__) +# define LZO_WORDSIZE 4 +# elif defined(__H8300H__) || defined(__H8300S__) || defined(__H8300SX__) +# define LZO_WORDSIZE 4 +# else +# define LZO_WORDSIZE 2 +# endif +#elif (LZO_ARCH_I086) +# define LZO_WORDSIZE 2 +#elif (LZO_ARCH_IA64) +# define LZO_WORDSIZE 8 +#elif (LZO_ARCH_M16C) +# define LZO_WORDSIZE 2 +#elif (LZO_ARCH_SPU) +# define LZO_WORDSIZE 4 +#elif (LZO_ARCH_Z80) +# define LZO_WORDSIZE 1 +#elif (LZO_SIZEOF_LONG == 8) && ((defined(__mips__) && defined(__R5900__)) || defined(__MIPS_PSX2__)) +# define LZO_WORDSIZE 8 +#elif (LZO_OS_OS400 || defined(__OS400__)) +# define LZO_WORDSIZE 8 +#elif (defined(__vms) || defined(__VMS)) && (__INITIAL_POINTER_SIZE+0 == 64) +# define LZO_WORDSIZE 8 +#endif +#endif +#if !defined(LZO_SIZEOF_VOID_P) +#if defined(__ILP32__) || defined(__ILP32) || defined(_ILP32) +LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(int) == 4) +LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(long) == 4) +# define LZO_SIZEOF_VOID_P 4 +#elif defined(__ILP64__) || defined(__ILP64) || defined(_ILP64) +LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(int) == 8) +LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(long) == 8) +# define LZO_SIZEOF_VOID_P 8 +#elif defined(__LLP64__) || defined(__LLP64) || defined(_LLP64) || defined(_WIN64) +LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(long) == 4) +# define LZO_SIZEOF_VOID_P 8 +#elif defined(__LP64__) || defined(__LP64) || defined(_LP64) +LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(long) == 8) +# define LZO_SIZEOF_VOID_P 8 +#elif (LZO_ARCH_AVR) +# define LZO_SIZEOF_VOID_P 2 +#elif (LZO_ARCH_C166 || LZO_ARCH_MCS51 || LZO_ARCH_MCS251 || LZO_ARCH_MSP430) +# define LZO_SIZEOF_VOID_P 2 +#elif (LZO_ARCH_H8300) +# if defined(__NORMAL_MODE__) +# define LZO_SIZEOF_VOID_P 2 +# elif defined(__H8300H__) || defined(__H8300S__) || defined(__H8300SX__) +# define LZO_SIZEOF_VOID_P 4 +# else +# define LZO_SIZEOF_VOID_P 2 +# endif +# if (LZO_CC_GNUC && (LZO_CC_GNUC < 0x040000ul)) && (LZO_SIZEOF_INT == 4) +# define LZO_SIZEOF_SIZE_T LZO_SIZEOF_INT +# define LZO_SIZEOF_PTRDIFF_T LZO_SIZEOF_INT +# endif +#elif (LZO_ARCH_I086) +# if (LZO_MM_TINY || LZO_MM_SMALL || LZO_MM_MEDIUM) +# define LZO_SIZEOF_VOID_P 2 +# elif (LZO_MM_COMPACT || LZO_MM_LARGE || LZO_MM_HUGE) +# define LZO_SIZEOF_VOID_P 4 +# else +# error "invalid LZO_ARCH_I086 memory model" +# endif +#elif (LZO_ARCH_M16C) +# if defined(__m32c_cpu__) || defined(__m32cm_cpu__) +# define LZO_SIZEOF_VOID_P 4 +# else +# define LZO_SIZEOF_VOID_P 2 +# endif +#elif (LZO_ARCH_SPU) +# define LZO_SIZEOF_VOID_P 4 +#elif (LZO_ARCH_Z80) +# define LZO_SIZEOF_VOID_P 2 +#elif (LZO_SIZEOF_LONG == 8) && ((defined(__mips__) && defined(__R5900__)) || defined(__MIPS_PSX2__)) +# define LZO_SIZEOF_VOID_P 4 +#elif (LZO_OS_OS400 || defined(__OS400__)) +# if defined(__LLP64_IFC__) +# define LZO_SIZEOF_VOID_P 8 +# define LZO_SIZEOF_SIZE_T LZO_SIZEOF_LONG +# define LZO_SIZEOF_PTRDIFF_T LZO_SIZEOF_LONG +# else +# define LZO_SIZEOF_VOID_P 16 +# define LZO_SIZEOF_SIZE_T LZO_SIZEOF_LONG +# define LZO_SIZEOF_PTRDIFF_T LZO_SIZEOF_LONG +# endif +#elif (defined(__vms) || defined(__VMS)) && (__INITIAL_POINTER_SIZE+0 == 64) +# define LZO_SIZEOF_VOID_P 8 +# define LZO_SIZEOF_SIZE_T LZO_SIZEOF_LONG +# define LZO_SIZEOF_PTRDIFF_T LZO_SIZEOF_LONG +#endif +#endif +#if !defined(LZO_SIZEOF_VOID_P) +# define LZO_SIZEOF_VOID_P LZO_SIZEOF_LONG +#endif +LZO_COMPILE_TIME_ASSERT_HEADER(LZO_SIZEOF_VOID_P == sizeof(void *)) +#if !defined(LZO_SIZEOF_SIZE_T) +#if (LZO_ARCH_I086 || LZO_ARCH_M16C) +# define LZO_SIZEOF_SIZE_T 2 +#endif +#endif +#if !defined(LZO_SIZEOF_SIZE_T) +# define LZO_SIZEOF_SIZE_T LZO_SIZEOF_VOID_P +#endif +#if defined(offsetof) +LZO_COMPILE_TIME_ASSERT_HEADER(LZO_SIZEOF_SIZE_T == sizeof(size_t)) +#endif +#if !defined(LZO_SIZEOF_PTRDIFF_T) +#if (LZO_ARCH_I086) +# if (LZO_MM_TINY || LZO_MM_SMALL || LZO_MM_MEDIUM || LZO_MM_HUGE) +# define LZO_SIZEOF_PTRDIFF_T LZO_SIZEOF_VOID_P +# elif (LZO_MM_COMPACT || LZO_MM_LARGE) +# if (LZO_CC_BORLANDC || LZO_CC_TURBOC) +# define LZO_SIZEOF_PTRDIFF_T 4 +# else +# define LZO_SIZEOF_PTRDIFF_T 2 +# endif +# else +# error "invalid LZO_ARCH_I086 memory model" +# endif +#endif +#endif +#if !defined(LZO_SIZEOF_PTRDIFF_T) +# define LZO_SIZEOF_PTRDIFF_T LZO_SIZEOF_SIZE_T +#endif +#if defined(offsetof) +LZO_COMPILE_TIME_ASSERT_HEADER(LZO_SIZEOF_PTRDIFF_T == sizeof(ptrdiff_t)) +#endif +#if !defined(LZO_WORDSIZE) +# define LZO_WORDSIZE LZO_SIZEOF_VOID_P +#endif +#if (LZO_ABI_NEUTRAL_ENDIAN) +# undef LZO_ABI_BIG_ENDIAN +# undef LZO_ABI_LITTLE_ENDIAN +#elif !(LZO_ABI_BIG_ENDIAN) && !(LZO_ABI_LITTLE_ENDIAN) +#if (LZO_ARCH_ALPHA) && (LZO_ARCH_CRAY_MPP) +# define LZO_ABI_BIG_ENDIAN 1 +#elif (LZO_ARCH_IA64) && (LZO_OS_POSIX_LINUX || LZO_OS_WIN64) +# define LZO_ABI_LITTLE_ENDIAN 1 +#elif (LZO_ARCH_ALPHA || LZO_ARCH_AMD64 || LZO_ARCH_BLACKFIN || LZO_ARCH_CRIS || LZO_ARCH_I086 || LZO_ARCH_I386 || LZO_ARCH_MSP430) +# define LZO_ABI_LITTLE_ENDIAN 1 +#elif (LZO_ARCH_AVR32 || LZO_ARCH_M68K || LZO_ARCH_S390 || LZO_ARCH_SPU) +# define LZO_ABI_BIG_ENDIAN 1 +#elif 1 && defined(__IAR_SYSTEMS_ICC__) && defined(__LITTLE_ENDIAN__) +# if (__LITTLE_ENDIAN__ == 1) +# define LZO_ABI_LITTLE_ENDIAN 1 +# else +# define LZO_ABI_BIG_ENDIAN 1 +# endif +#elif 1 && defined(__BIG_ENDIAN__) && !defined(__LITTLE_ENDIAN__) +# define LZO_ABI_BIG_ENDIAN 1 +#elif 1 && defined(__LITTLE_ENDIAN__) && !defined(__BIG_ENDIAN__) +# define LZO_ABI_LITTLE_ENDIAN 1 +#elif 1 && (LZO_ARCH_ARM) && defined(__ARMEB__) && !defined(__ARMEL__) +# define LZO_ABI_BIG_ENDIAN 1 +#elif 1 && (LZO_ARCH_ARM) && defined(__ARMEL__) && !defined(__ARMEB__) +# define LZO_ABI_LITTLE_ENDIAN 1 +#elif 1 && (LZO_ARCH_ARM && LZO_CC_ARMCC_ARMCC) +# if defined(__BIG_ENDIAN) && defined(__LITTLE_ENDIAN) +# error "unexpected configuration - check your compiler defines" +# elif defined(__BIG_ENDIAN) +# define LZO_ABI_BIG_ENDIAN 1 +# else +# define LZO_ABI_LITTLE_ENDIAN 1 +# endif +# define LZO_ABI_LITTLE_ENDIAN 1 +#elif 1 && (LZO_ARCH_ARM64) && defined(__AARCH64EB__) && !defined(__AARCH64EL__) +# define LZO_ABI_BIG_ENDIAN 1 +#elif 1 && (LZO_ARCH_ARM64) && defined(__AARCH64EL__) && !defined(__AARCH64EB__) +# define LZO_ABI_LITTLE_ENDIAN 1 +#elif 1 && (LZO_ARCH_MIPS) && defined(__MIPSEB__) && !defined(__MIPSEL__) +# define LZO_ABI_BIG_ENDIAN 1 +#elif 1 && (LZO_ARCH_MIPS) && defined(__MIPSEL__) && !defined(__MIPSEB__) +# define LZO_ABI_LITTLE_ENDIAN 1 +#endif +#endif +#if (LZO_ABI_BIG_ENDIAN) && (LZO_ABI_LITTLE_ENDIAN) +# error "unexpected configuration - check your compiler defines" +#endif +#if (LZO_ABI_BIG_ENDIAN) +# define LZO_INFO_ABI_ENDIAN "be" +#elif (LZO_ABI_LITTLE_ENDIAN) +# define LZO_INFO_ABI_ENDIAN "le" +#elif (LZO_ABI_NEUTRAL_ENDIAN) +# define LZO_INFO_ABI_ENDIAN "neutral" +#endif +#if (LZO_SIZEOF_INT == 1 && LZO_SIZEOF_LONG == 2 && LZO_SIZEOF_VOID_P == 2) +# define LZO_ABI_I8LP16 1 +# define LZO_INFO_ABI_PM "i8lp16" +#elif (LZO_SIZEOF_INT == 2 && LZO_SIZEOF_LONG == 2 && LZO_SIZEOF_VOID_P == 2) +# define LZO_ABI_ILP16 1 +# define LZO_INFO_ABI_PM "ilp16" +#elif (LZO_SIZEOF_INT == 2 && LZO_SIZEOF_LONG == 4 && LZO_SIZEOF_VOID_P == 4) +# define LZO_ABI_LP32 1 +# define LZO_INFO_ABI_PM "lp32" +#elif (LZO_SIZEOF_INT == 4 && LZO_SIZEOF_LONG == 4 && LZO_SIZEOF_VOID_P == 4) +# define LZO_ABI_ILP32 1 +# define LZO_INFO_ABI_PM "ilp32" +#elif (LZO_SIZEOF_INT == 4 && LZO_SIZEOF_LONG == 4 && LZO_SIZEOF_VOID_P == 8 && LZO_SIZEOF_SIZE_T == 8) +# define LZO_ABI_LLP64 1 +# define LZO_INFO_ABI_PM "llp64" +#elif (LZO_SIZEOF_INT == 4 && LZO_SIZEOF_LONG == 8 && LZO_SIZEOF_VOID_P == 8) +# define LZO_ABI_LP64 1 +# define LZO_INFO_ABI_PM "lp64" +#elif (LZO_SIZEOF_INT == 8 && LZO_SIZEOF_LONG == 8 && LZO_SIZEOF_VOID_P == 8) +# define LZO_ABI_ILP64 1 +# define LZO_INFO_ABI_PM "ilp64" +#elif (LZO_SIZEOF_INT == 4 && LZO_SIZEOF_LONG == 8 && LZO_SIZEOF_VOID_P == 4) +# define LZO_ABI_IP32L64 1 +# define LZO_INFO_ABI_PM "ip32l64" +#endif +#if 0 +#elif !defined(__LZO_LIBC_OVERRIDE) +#if (LZO_LIBC_NAKED) +# define LZO_INFO_LIBC "naked" +#elif (LZO_LIBC_FREESTANDING) +# define LZO_INFO_LIBC "freestanding" +#elif (LZO_LIBC_MOSTLY_FREESTANDING) +# define LZO_INFO_LIBC "mfreestanding" +#elif (LZO_LIBC_ISOC90) +# define LZO_INFO_LIBC "isoc90" +#elif (LZO_LIBC_ISOC99) +# define LZO_INFO_LIBC "isoc99" +#elif (LZO_CC_ARMCC_ARMCC) && defined(__ARMCLIB_VERSION) +# define LZO_LIBC_ISOC90 1 +# define LZO_INFO_LIBC "isoc90" +#elif defined(__dietlibc__) +# define LZO_LIBC_DIETLIBC 1 +# define LZO_INFO_LIBC "dietlibc" +#elif defined(_NEWLIB_VERSION) +# define LZO_LIBC_NEWLIB 1 +# define LZO_INFO_LIBC "newlib" +#elif defined(__UCLIBC__) && defined(__UCLIBC_MAJOR__) && defined(__UCLIBC_MINOR__) +# if defined(__UCLIBC_SUBLEVEL__) +# define LZO_LIBC_UCLIBC (__UCLIBC_MAJOR__ * 0x10000L + (__UCLIBC_MINOR__-0) * 0x100 + (__UCLIBC_SUBLEVEL__-0)) +# else +# define LZO_LIBC_UCLIBC 0x00090bL +# endif +# define LZO_INFO_LIBC "uc" "libc" +#elif defined(__GLIBC__) && defined(__GLIBC_MINOR__) +# define LZO_LIBC_GLIBC (__GLIBC__ * 0x10000L + (__GLIBC_MINOR__-0) * 0x100) +# define LZO_INFO_LIBC "glibc" +#elif (LZO_CC_MWERKS) && defined(__MSL__) +# define LZO_LIBC_MSL __MSL__ +# define LZO_INFO_LIBC "msl" +#elif 1 && defined(__IAR_SYSTEMS_ICC__) +# define LZO_LIBC_ISOC90 1 +# define LZO_INFO_LIBC "isoc90" +#else +# define LZO_LIBC_DEFAULT 1 +# define LZO_INFO_LIBC "default" +#endif +#endif +#if (LZO_ARCH_I386 && (LZO_OS_DOS32 || LZO_OS_WIN32) && (LZO_CC_DMC || LZO_CC_INTELC || LZO_CC_MSC || LZO_CC_PELLESC)) +# define LZO_ASM_SYNTAX_MSC 1 +#elif (LZO_OS_WIN64 && (LZO_CC_DMC || LZO_CC_INTELC || LZO_CC_MSC || LZO_CC_PELLESC)) +#elif (LZO_ARCH_I386 && LZO_CC_GNUC && (LZO_CC_GNUC == 0x011f00ul)) +#elif (LZO_ARCH_I386 && (LZO_CC_CLANG || LZO_CC_GNUC || LZO_CC_INTELC || LZO_CC_PATHSCALE)) +# define LZO_ASM_SYNTAX_GNUC 1 +#elif (LZO_ARCH_AMD64 && (LZO_CC_CLANG || LZO_CC_GNUC || LZO_CC_INTELC || LZO_CC_PATHSCALE)) +# define LZO_ASM_SYNTAX_GNUC 1 +#elif (LZO_CC_GNUC) +# define LZO_ASM_SYNTAX_GNUC 1 +#endif +#if (LZO_ASM_SYNTAX_GNUC) +#if (LZO_ARCH_I386 && LZO_CC_GNUC && (LZO_CC_GNUC < 0x020000ul)) +# define __LZO_ASM_CLOBBER "ax" +# define __LZO_ASM_CLOBBER_LIST_CC /*empty*/ +# define __LZO_ASM_CLOBBER_LIST_CC_MEMORY /*empty*/ +# define __LZO_ASM_CLOBBER_LIST_EMPTY /*empty*/ +#elif (LZO_CC_INTELC && (__INTEL_COMPILER < 1000)) +# define __LZO_ASM_CLOBBER "memory" +# define __LZO_ASM_CLOBBER_LIST_CC /*empty*/ +# define __LZO_ASM_CLOBBER_LIST_CC_MEMORY : "memory" +# define __LZO_ASM_CLOBBER_LIST_EMPTY /*empty*/ +#else +# define __LZO_ASM_CLOBBER "cc", "memory" +# define __LZO_ASM_CLOBBER_LIST_CC : "cc" +# define __LZO_ASM_CLOBBER_LIST_CC_MEMORY : "cc", "memory" +# define __LZO_ASM_CLOBBER_LIST_EMPTY /*empty*/ +#endif +#endif +#if (LZO_ARCH_ALPHA) +# define LZO_OPT_AVOID_UINT_INDEX 1 +#elif (LZO_ARCH_AMD64) +# define LZO_OPT_AVOID_INT_INDEX 1 +# define LZO_OPT_AVOID_UINT_INDEX 1 +# ifndef LZO_OPT_UNALIGNED16 +# define LZO_OPT_UNALIGNED16 1 +# endif +# ifndef LZO_OPT_UNALIGNED32 +# define LZO_OPT_UNALIGNED32 1 +# endif +# ifndef LZO_OPT_UNALIGNED64 +# define LZO_OPT_UNALIGNED64 1 +# endif +#elif (LZO_ARCH_ARM) +# if defined(__ARM_FEATURE_UNALIGNED) +# ifndef LZO_OPT_UNALIGNED16 +# define LZO_OPT_UNALIGNED16 1 +# endif +# ifndef LZO_OPT_UNALIGNED32 +# define LZO_OPT_UNALIGNED32 1 +# endif +# elif defined(__TARGET_ARCH_ARM) && ((__TARGET_ARCH_ARM+0) >= 7) +# ifndef LZO_OPT_UNALIGNED16 +# define LZO_OPT_UNALIGNED16 1 +# endif +# ifndef LZO_OPT_UNALIGNED32 +# define LZO_OPT_UNALIGNED32 1 +# endif +# elif defined(__TARGET_ARCH_ARM) && ((__TARGET_ARCH_ARM+0) >= 6) && !defined(__TARGET_PROFILE_M) +# ifndef LZO_OPT_UNALIGNED16 +# define LZO_OPT_UNALIGNED16 1 +# endif +# ifndef LZO_OPT_UNALIGNED32 +# define LZO_OPT_UNALIGNED32 1 +# endif +# endif +#elif (LZO_ARCH_ARM64) +# ifndef LZO_OPT_UNALIGNED16 +# define LZO_OPT_UNALIGNED16 1 +# endif +# ifndef LZO_OPT_UNALIGNED32 +# define LZO_OPT_UNALIGNED32 1 +# endif +# ifndef LZO_OPT_UNALIGNED64 +# define LZO_OPT_UNALIGNED64 1 +# endif +#elif (LZO_ARCH_CRIS) +# ifndef LZO_OPT_UNALIGNED16 +# define LZO_OPT_UNALIGNED16 1 +# endif +# ifndef LZO_OPT_UNALIGNED32 +# define LZO_OPT_UNALIGNED32 1 +# endif +#elif (LZO_ARCH_I386) +# ifndef LZO_OPT_UNALIGNED16 +# define LZO_OPT_UNALIGNED16 1 +# endif +# ifndef LZO_OPT_UNALIGNED32 +# define LZO_OPT_UNALIGNED32 1 +# endif +#elif (LZO_ARCH_IA64) +# define LZO_OPT_AVOID_INT_INDEX 1 +# define LZO_OPT_AVOID_UINT_INDEX 1 +# define LZO_OPT_PREFER_POSTINC 1 +#elif (LZO_ARCH_M68K) +# define LZO_OPT_PREFER_POSTINC 1 +# define LZO_OPT_PREFER_PREDEC 1 +# if defined(__mc68020__) && !defined(__mcoldfire__) +# ifndef LZO_OPT_UNALIGNED16 +# define LZO_OPT_UNALIGNED16 1 +# endif +# ifndef LZO_OPT_UNALIGNED32 +# define LZO_OPT_UNALIGNED32 1 +# endif +# endif +#elif (LZO_ARCH_MIPS) +# define LZO_OPT_AVOID_UINT_INDEX 1 +#elif (LZO_ARCH_POWERPC) +# define LZO_OPT_PREFER_PREINC 1 +# define LZO_OPT_PREFER_PREDEC 1 +# if (LZO_ABI_BIG_ENDIAN) +# ifndef LZO_OPT_UNALIGNED16 +# define LZO_OPT_UNALIGNED16 1 +# endif +# ifndef LZO_OPT_UNALIGNED32 +# define LZO_OPT_UNALIGNED32 1 +# endif +# if (LZO_WORDSIZE == 8) +# ifndef LZO_OPT_UNALIGNED64 +# define LZO_OPT_UNALIGNED64 1 +# endif +# endif +# endif +#elif (LZO_ARCH_S390) +# ifndef LZO_OPT_UNALIGNED16 +# define LZO_OPT_UNALIGNED16 1 +# endif +# ifndef LZO_OPT_UNALIGNED32 +# define LZO_OPT_UNALIGNED32 1 +# endif +# if (LZO_WORDSIZE == 8) +# ifndef LZO_OPT_UNALIGNED64 +# define LZO_OPT_UNALIGNED64 1 +# endif +# endif +#elif (LZO_ARCH_SH) +# define LZO_OPT_PREFER_POSTINC 1 +# define LZO_OPT_PREFER_PREDEC 1 +#endif +#ifndef LZO_CFG_NO_INLINE_ASM +#if (LZO_ABI_NEUTRAL_ENDIAN) || (LZO_ARCH_GENERIC) +# define LZO_CFG_NO_INLINE_ASM 1 +#elif (LZO_CC_LLVM) +# define LZO_CFG_NO_INLINE_ASM 1 +#endif +#endif +#if (LZO_CFG_NO_INLINE_ASM) +# undef LZO_ASM_SYNTAX_MSC +# undef LZO_ASM_SYNTAX_GNUC +# undef __LZO_ASM_CLOBBER +# undef __LZO_ASM_CLOBBER_LIST_CC +# undef __LZO_ASM_CLOBBER_LIST_CC_MEMORY +# undef __LZO_ASM_CLOBBER_LIST_EMPTY +#endif +#ifndef LZO_CFG_NO_UNALIGNED +#if (LZO_ABI_NEUTRAL_ENDIAN) || (LZO_ARCH_GENERIC) +# define LZO_CFG_NO_UNALIGNED 1 +#endif +#endif +#if (LZO_CFG_NO_UNALIGNED) +# undef LZO_OPT_UNALIGNED16 +# undef LZO_OPT_UNALIGNED32 +# undef LZO_OPT_UNALIGNED64 +#endif +#if defined(__LZO_INFOSTR_MM) +#elif (LZO_MM_FLAT) && (defined(__LZO_INFOSTR_PM) || defined(LZO_INFO_ABI_PM)) +# define __LZO_INFOSTR_MM "" +#elif defined(LZO_INFO_MM) +# define __LZO_INFOSTR_MM "." LZO_INFO_MM +#else +# define __LZO_INFOSTR_MM "" +#endif +#if defined(__LZO_INFOSTR_PM) +#elif defined(LZO_INFO_ABI_PM) +# define __LZO_INFOSTR_PM "." LZO_INFO_ABI_PM +#else +# define __LZO_INFOSTR_PM "" +#endif +#if defined(__LZO_INFOSTR_ENDIAN) +#elif defined(LZO_INFO_ABI_ENDIAN) +# define __LZO_INFOSTR_ENDIAN "." LZO_INFO_ABI_ENDIAN +#else +# define __LZO_INFOSTR_ENDIAN "" +#endif +#if defined(__LZO_INFOSTR_OSNAME) +#elif defined(LZO_INFO_OS_CONSOLE) +# define __LZO_INFOSTR_OSNAME LZO_INFO_OS "." LZO_INFO_OS_CONSOLE +#elif defined(LZO_INFO_OS_POSIX) +# define __LZO_INFOSTR_OSNAME LZO_INFO_OS "." LZO_INFO_OS_POSIX +#else +# define __LZO_INFOSTR_OSNAME LZO_INFO_OS +#endif +#if defined(__LZO_INFOSTR_LIBC) +#elif defined(LZO_INFO_LIBC) +# define __LZO_INFOSTR_LIBC "." LZO_INFO_LIBC +#else +# define __LZO_INFOSTR_LIBC "" +#endif +#if defined(__LZO_INFOSTR_CCVER) +#elif defined(LZO_INFO_CCVER) +# define __LZO_INFOSTR_CCVER " " LZO_INFO_CCVER +#else +# define __LZO_INFOSTR_CCVER "" +#endif +#define LZO_INFO_STRING \ + LZO_INFO_ARCH __LZO_INFOSTR_MM __LZO_INFOSTR_PM __LZO_INFOSTR_ENDIAN \ + " " __LZO_INFOSTR_OSNAME __LZO_INFOSTR_LIBC " " LZO_INFO_CC __LZO_INFOSTR_CCVER +#if !(LZO_CFG_SKIP_LZO_TYPES) +#if (!(LZO_SIZEOF_SHORT+0 > 0 && LZO_SIZEOF_INT+0 > 0 && LZO_SIZEOF_LONG+0 > 0)) +# error "missing defines for sizes" +#endif +#if (!(LZO_SIZEOF_PTRDIFF_T+0 > 0 && LZO_SIZEOF_SIZE_T+0 > 0 && LZO_SIZEOF_VOID_P+0 > 0)) +# error "missing defines for sizes" +#endif +#if !defined(lzo_llong_t) +#if (LZO_SIZEOF_LONG_LONG+0 > 0) +__lzo_gnuc_extension__ typedef long long lzo_llong_t__; +__lzo_gnuc_extension__ typedef unsigned long long lzo_ullong_t__; +# define lzo_llong_t lzo_llong_t__ +# define lzo_ullong_t lzo_ullong_t__ +#endif +#endif +#if !defined(lzo_int16e_t) +#if (LZO_SIZEOF_LONG == 2) +# define lzo_int16e_t long +# define lzo_uint16e_t unsigned long +#elif (LZO_SIZEOF_INT == 2) +# define lzo_int16e_t int +# define lzo_uint16e_t unsigned int +#elif (LZO_SIZEOF_SHORT == 2) +# define lzo_int16e_t short int +# define lzo_uint16e_t unsigned short int +#elif 1 && !(LZO_CFG_TYPE_NO_MODE_HI) && (LZO_CC_CLANG || (LZO_CC_GNUC >= 0x025f00ul) || LZO_CC_LLVM) + typedef int lzo_int16e_hi_t__ __attribute__((__mode__(__HI__))); + typedef unsigned int lzo_uint16e_hi_t__ __attribute__((__mode__(__HI__))); +# define lzo_int16e_t lzo_int16e_hi_t__ +# define lzo_uint16e_t lzo_uint16e_hi_t__ +#elif (LZO_SIZEOF___INT16 == 2) +# define lzo_int16e_t __int16 +# define lzo_uint16e_t unsigned __int16 +#else +#endif +#endif +#if defined(lzo_int16e_t) +# define LZO_SIZEOF_LZO_INT16E_T 2 + LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int16e_t) == 2) + LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int16e_t) == LZO_SIZEOF_LZO_INT16E_T) +#endif +#if !defined(lzo_int32e_t) +#if (LZO_SIZEOF_LONG == 4) +# define lzo_int32e_t long int +# define lzo_uint32e_t unsigned long int +#elif (LZO_SIZEOF_INT == 4) +# define lzo_int32e_t int +# define lzo_uint32e_t unsigned int +#elif (LZO_SIZEOF_SHORT == 4) +# define lzo_int32e_t short int +# define lzo_uint32e_t unsigned short int +#elif (LZO_SIZEOF_LONG_LONG == 4) +# define lzo_int32e_t lzo_llong_t +# define lzo_uint32e_t lzo_ullong_t +#elif 1 && !(LZO_CFG_TYPE_NO_MODE_SI) && (LZO_CC_CLANG || (LZO_CC_GNUC >= 0x025f00ul) || LZO_CC_LLVM) && (__INT_MAX__+0 > 2147483647L) + typedef int lzo_int32e_si_t__ __attribute__((__mode__(__SI__))); + typedef unsigned int lzo_uint32e_si_t__ __attribute__((__mode__(__SI__))); +# define lzo_int32e_t lzo_int32e_si_t__ +# define lzo_uint32e_t lzo_uint32e_si_t__ +#elif 1 && !(LZO_CFG_TYPE_NO_MODE_SI) && (LZO_CC_GNUC >= 0x025f00ul) && defined(__AVR__) && (__LONG_MAX__+0 == 32767L) + typedef int lzo_int32e_si_t__ __attribute__((__mode__(__SI__))); + typedef unsigned int lzo_uint32e_si_t__ __attribute__((__mode__(__SI__))); +# define lzo_int32e_t lzo_int32e_si_t__ +# define lzo_uint32e_t lzo_uint32e_si_t__ +# define LZO_INT32_C(c) (c##LL) +# define LZO_UINT32_C(c) (c##ULL) +#elif (LZO_SIZEOF___INT32 == 4) +# define lzo_int32e_t __int32 +# define lzo_uint32e_t unsigned __int32 +#else +#endif +#endif +#if defined(lzo_int32e_t) +# define LZO_SIZEOF_LZO_INT32E_T 4 + LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int32e_t) == 4) + LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int32e_t) == LZO_SIZEOF_LZO_INT32E_T) +#endif +#if !defined(lzo_int64e_t) +#if (LZO_SIZEOF___INT64 == 8) +# if (LZO_CC_BORLANDC) && !(LZO_CFG_TYPE_PREFER___INT64) +# define LZO_CFG_TYPE_PREFER___INT64 1 +# endif +#endif +#if (LZO_SIZEOF_INT == 8) && (LZO_SIZEOF_INT < LZO_SIZEOF_LONG) +# define lzo_int64e_t int +# define lzo_uint64e_t unsigned int +# define LZO_SIZEOF_LZO_INT64E_T LZO_SIZEOF_INT +#elif (LZO_SIZEOF_LONG == 8) +# define lzo_int64e_t long int +# define lzo_uint64e_t unsigned long int +# define LZO_SIZEOF_LZO_INT64E_T LZO_SIZEOF_LONG +#elif (LZO_SIZEOF_LONG_LONG == 8) && !(LZO_CFG_TYPE_PREFER___INT64) +# define lzo_int64e_t lzo_llong_t +# define lzo_uint64e_t lzo_ullong_t +# if (LZO_CC_BORLANDC) +# define LZO_INT64_C(c) ((c) + 0ll) +# define LZO_UINT64_C(c) ((c) + 0ull) +# elif 0 +# define LZO_INT64_C(c) (__lzo_gnuc_extension__ (c##LL)) +# define LZO_UINT64_C(c) (__lzo_gnuc_extension__ (c##ULL)) +# else +# define LZO_INT64_C(c) (c##LL) +# define LZO_UINT64_C(c) (c##ULL) +# endif +# define LZO_SIZEOF_LZO_INT64E_T LZO_SIZEOF_LONG_LONG +#elif (LZO_SIZEOF___INT64 == 8) +# define lzo_int64e_t __int64 +# define lzo_uint64e_t unsigned __int64 +# if (LZO_CC_BORLANDC) +# define LZO_INT64_C(c) ((c) + 0i64) +# define LZO_UINT64_C(c) ((c) + 0ui64) +# else +# define LZO_INT64_C(c) (c##i64) +# define LZO_UINT64_C(c) (c##ui64) +# endif +# define LZO_SIZEOF_LZO_INT64E_T LZO_SIZEOF___INT64 +#else +#endif +#endif +#if defined(lzo_int64e_t) + LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int64e_t) == 8) + LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int64e_t) == LZO_SIZEOF_LZO_INT64E_T) +#endif +#if !defined(lzo_int32l_t) +#if defined(lzo_int32e_t) +# define lzo_int32l_t lzo_int32e_t +# define lzo_uint32l_t lzo_uint32e_t +# define LZO_SIZEOF_LZO_INT32L_T LZO_SIZEOF_LZO_INT32E_T +#elif (LZO_SIZEOF_INT >= 4) && (LZO_SIZEOF_INT < LZO_SIZEOF_LONG) +# define lzo_int32l_t int +# define lzo_uint32l_t unsigned int +# define LZO_SIZEOF_LZO_INT32L_T LZO_SIZEOF_INT +#elif (LZO_SIZEOF_LONG >= 4) +# define lzo_int32l_t long int +# define lzo_uint32l_t unsigned long int +# define LZO_SIZEOF_LZO_INT32L_T LZO_SIZEOF_LONG +#else +# error "lzo_int32l_t" +#endif +#endif +#if 1 + LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int32l_t) >= 4) + LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int32l_t) == LZO_SIZEOF_LZO_INT32L_T) +#endif +#if !defined(lzo_int64l_t) +#if defined(lzo_int64e_t) +# define lzo_int64l_t lzo_int64e_t +# define lzo_uint64l_t lzo_uint64e_t +# define LZO_SIZEOF_LZO_INT64L_T LZO_SIZEOF_LZO_INT64E_T +#else +#endif +#endif +#if defined(lzo_int64l_t) + LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int64l_t) >= 8) + LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int64l_t) == LZO_SIZEOF_LZO_INT64L_T) +#endif +#if !defined(lzo_int32f_t) +#if (LZO_SIZEOF_SIZE_T >= 8) +# define lzo_int32f_t lzo_int64l_t +# define lzo_uint32f_t lzo_uint64l_t +# define LZO_SIZEOF_LZO_INT32F_T LZO_SIZEOF_LZO_INT64L_T +#else +# define lzo_int32f_t lzo_int32l_t +# define lzo_uint32f_t lzo_uint32l_t +# define LZO_SIZEOF_LZO_INT32F_T LZO_SIZEOF_LZO_INT32L_T +#endif +#endif +#if 1 + LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int32f_t) >= 4) + LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int32f_t) == LZO_SIZEOF_LZO_INT32F_T) +#endif +#if !defined(lzo_int64f_t) +#if defined(lzo_int64l_t) +# define lzo_int64f_t lzo_int64l_t +# define lzo_uint64f_t lzo_uint64l_t +# define LZO_SIZEOF_LZO_INT64F_T LZO_SIZEOF_LZO_INT64L_T +#else +#endif +#endif +#if defined(lzo_int64f_t) + LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int64f_t) >= 8) + LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int64f_t) == LZO_SIZEOF_LZO_INT64F_T) +#endif +#if !defined(lzo_intptr_t) +#if 1 && (LZO_OS_OS400 && (LZO_SIZEOF_VOID_P == 16)) +# define __LZO_INTPTR_T_IS_POINTER 1 + typedef char* lzo_intptr_t; + typedef char* lzo_uintptr_t; +# define lzo_intptr_t lzo_intptr_t +# define lzo_uintptr_t lzo_uintptr_t +# define LZO_SIZEOF_LZO_INTPTR_T LZO_SIZEOF_VOID_P +#elif (LZO_CC_MSC && (_MSC_VER >= 1300) && (LZO_SIZEOF_VOID_P == 4) && (LZO_SIZEOF_INT == 4)) + typedef __w64 int lzo_intptr_t; + typedef __w64 unsigned int lzo_uintptr_t; +# define lzo_intptr_t lzo_intptr_t +# define lzo_uintptr_t lzo_uintptr_t +# define LZO_SIZEOF_LZO_INTPTR_T LZO_SIZEOF_INT +#elif (LZO_SIZEOF_SHORT == LZO_SIZEOF_VOID_P) && (LZO_SIZEOF_INT > LZO_SIZEOF_VOID_P) +# define lzo_intptr_t short +# define lzo_uintptr_t unsigned short +# define LZO_SIZEOF_LZO_INTPTR_T LZO_SIZEOF_SHORT +#elif (LZO_SIZEOF_INT >= LZO_SIZEOF_VOID_P) && (LZO_SIZEOF_INT < LZO_SIZEOF_LONG) +# define lzo_intptr_t int +# define lzo_uintptr_t unsigned int +# define LZO_SIZEOF_LZO_INTPTR_T LZO_SIZEOF_INT +#elif (LZO_SIZEOF_LONG >= LZO_SIZEOF_VOID_P) +# define lzo_intptr_t long +# define lzo_uintptr_t unsigned long +# define LZO_SIZEOF_LZO_INTPTR_T LZO_SIZEOF_LONG +#elif (LZO_SIZEOF_LZO_INT64L_T >= LZO_SIZEOF_VOID_P) +# define lzo_intptr_t lzo_int64l_t +# define lzo_uintptr_t lzo_uint64l_t +# define LZO_SIZEOF_LZO_INTPTR_T LZO_SIZEOF_LZO_INT64L_T +#else +# error "lzo_intptr_t" +#endif +#endif +#if 1 + LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_intptr_t) >= sizeof(void *)) + LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_intptr_t) == sizeof(lzo_uintptr_t)) +#endif +#if !defined(lzo_word_t) +#if defined(LZO_WORDSIZE) && (LZO_WORDSIZE+0 > 0) +#if (LZO_WORDSIZE == LZO_SIZEOF_LZO_INTPTR_T) && !(__LZO_INTPTR_T_IS_POINTER) +# define lzo_word_t lzo_uintptr_t +# define lzo_sword_t lzo_intptr_t +# define LZO_SIZEOF_LZO_WORD_T LZO_SIZEOF_LZO_INTPTR_T +#elif (LZO_WORDSIZE == LZO_SIZEOF_LONG) +# define lzo_word_t unsigned long +# define lzo_sword_t long +# define LZO_SIZEOF_LZO_WORD_T LZO_SIZEOF_LONG +#elif (LZO_WORDSIZE == LZO_SIZEOF_INT) +# define lzo_word_t unsigned int +# define lzo_sword_t int +# define LZO_SIZEOF_LZO_WORD_T LZO_SIZEOF_INT +#elif (LZO_WORDSIZE == LZO_SIZEOF_SHORT) +# define lzo_word_t unsigned short +# define lzo_sword_t short +# define LZO_SIZEOF_LZO_WORD_T LZO_SIZEOF_SHORT +#elif (LZO_WORDSIZE == 1) +# define lzo_word_t unsigned char +# define lzo_sword_t signed char +# define LZO_SIZEOF_LZO_WORD_T 1 +#elif (LZO_WORDSIZE == LZO_SIZEOF_LZO_INT64L_T) +# define lzo_word_t lzo_uint64l_t +# define lzo_sword_t lzo_int64l_t +# define LZO_SIZEOF_LZO_WORD_T LZO_SIZEOF_LZO_INT64L_T +#elif (LZO_ARCH_SPU) && (LZO_CC_GNUC) +#if 0 + typedef unsigned lzo_word_t __attribute__((__mode__(__V16QI__))); + typedef int lzo_sword_t __attribute__((__mode__(__V16QI__))); +# define lzo_word_t lzo_word_t +# define lzo_sword_t lzo_sword_t +# define LZO_SIZEOF_LZO_WORD_T 16 +#endif +#else +# error "lzo_word_t" +#endif +#endif +#endif +#if 1 && defined(lzo_word_t) + LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_word_t) == LZO_WORDSIZE) + LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_sword_t) == LZO_WORDSIZE) +#endif +#if 1 +#define lzo_int8_t signed char +#define lzo_uint8_t unsigned char +#define LZO_SIZEOF_LZO_INT8_T 1 +LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int8_t) == 1) +LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int8_t) == sizeof(lzo_uint8_t)) +#endif +#if defined(lzo_int16e_t) +#define lzo_int16_t lzo_int16e_t +#define lzo_uint16_t lzo_uint16e_t +#define LZO_SIZEOF_LZO_INT16_T LZO_SIZEOF_LZO_INT16E_T +LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int16_t) == 2) +LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int16_t) == sizeof(lzo_uint16_t)) +#endif +#if defined(lzo_int32e_t) +#define lzo_int32_t lzo_int32e_t +#define lzo_uint32_t lzo_uint32e_t +#define LZO_SIZEOF_LZO_INT32_T LZO_SIZEOF_LZO_INT32E_T +LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int32_t) == 4) +LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int32_t) == sizeof(lzo_uint32_t)) +#endif +#if defined(lzo_int64e_t) +#define lzo_int64_t lzo_int64e_t +#define lzo_uint64_t lzo_uint64e_t +#define LZO_SIZEOF_LZO_INT64_T LZO_SIZEOF_LZO_INT64E_T +LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int64_t) == 8) +LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int64_t) == sizeof(lzo_uint64_t)) +#endif +#if 1 +#define lzo_int_least32_t lzo_int32l_t +#define lzo_uint_least32_t lzo_uint32l_t +#define LZO_SIZEOF_LZO_INT_LEAST32_T LZO_SIZEOF_LZO_INT32L_T +LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int_least32_t) >= 4) +LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int_least32_t) == sizeof(lzo_uint_least32_t)) +#endif +#if defined(lzo_int64l_t) +#define lzo_int_least64_t lzo_int64l_t +#define lzo_uint_least64_t lzo_uint64l_t +#define LZO_SIZEOF_LZO_INT_LEAST64_T LZO_SIZEOF_LZO_INT64L_T +LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int_least64_t) >= 8) +LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int_least64_t) == sizeof(lzo_uint_least64_t)) +#endif +#if 1 +#define lzo_int_fast32_t lzo_int32f_t +#define lzo_uint_fast32_t lzo_uint32f_t +#define LZO_SIZEOF_LZO_INT_FAST32_T LZO_SIZEOF_LZO_INT32F_T +LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int_fast32_t) >= 4) +LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int_fast32_t) == sizeof(lzo_uint_fast32_t)) +#endif +#if defined(lzo_int64f_t) +#define lzo_int_fast64_t lzo_int64f_t +#define lzo_uint_fast64_t lzo_uint64f_t +#define LZO_SIZEOF_LZO_INT_FAST64_T LZO_SIZEOF_LZO_INT64F_T +LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int_fast64_t) >= 8) +LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int_fast64_t) == sizeof(lzo_uint_fast64_t)) +#endif +#if !defined(LZO_INT16_C) +# if (LZO_BROKEN_INTEGRAL_CONSTANTS) && (LZO_SIZEOF_INT >= 2) +# define LZO_INT16_C(c) ((c) + 0) +# define LZO_UINT16_C(c) ((c) + 0U) +# elif (LZO_BROKEN_INTEGRAL_CONSTANTS) && (LZO_SIZEOF_LONG >= 2) +# define LZO_INT16_C(c) ((c) + 0L) +# define LZO_UINT16_C(c) ((c) + 0UL) +# elif (LZO_SIZEOF_INT >= 2) +# define LZO_INT16_C(c) (c) +# define LZO_UINT16_C(c) (c##U) +# elif (LZO_SIZEOF_LONG >= 2) +# define LZO_INT16_C(c) (c##L) +# define LZO_UINT16_C(c) (c##UL) +# else +# error "LZO_INT16_C" +# endif +#endif +#if !defined(LZO_INT32_C) +# if (LZO_BROKEN_INTEGRAL_CONSTANTS) && (LZO_SIZEOF_INT >= 4) +# define LZO_INT32_C(c) ((c) + 0) +# define LZO_UINT32_C(c) ((c) + 0U) +# elif (LZO_BROKEN_INTEGRAL_CONSTANTS) && (LZO_SIZEOF_LONG >= 4) +# define LZO_INT32_C(c) ((c) + 0L) +# define LZO_UINT32_C(c) ((c) + 0UL) +# elif (LZO_SIZEOF_INT >= 4) +# define LZO_INT32_C(c) (c) +# define LZO_UINT32_C(c) (c##U) +# elif (LZO_SIZEOF_LONG >= 4) +# define LZO_INT32_C(c) (c##L) +# define LZO_UINT32_C(c) (c##UL) +# elif (LZO_SIZEOF_LONG_LONG >= 4) +# define LZO_INT32_C(c) (c##LL) +# define LZO_UINT32_C(c) (c##ULL) +# else +# error "LZO_INT32_C" +# endif +#endif +#if !defined(LZO_INT64_C) && defined(lzo_int64l_t) +# if (LZO_BROKEN_INTEGRAL_CONSTANTS) && (LZO_SIZEOF_INT >= 8) +# define LZO_INT64_C(c) ((c) + 0) +# define LZO_UINT64_C(c) ((c) + 0U) +# elif (LZO_BROKEN_INTEGRAL_CONSTANTS) && (LZO_SIZEOF_LONG >= 8) +# define LZO_INT64_C(c) ((c) + 0L) +# define LZO_UINT64_C(c) ((c) + 0UL) +# elif (LZO_SIZEOF_INT >= 8) +# define LZO_INT64_C(c) (c) +# define LZO_UINT64_C(c) (c##U) +# elif (LZO_SIZEOF_LONG >= 8) +# define LZO_INT64_C(c) (c##L) +# define LZO_UINT64_C(c) (c##UL) +# else +# error "LZO_INT64_C" +# endif +#endif +#endif + +#endif /* already included */ + +/* vim:set ts=4 sw=4 et: */ diff --git a/bin/minilzo.c b/bin/minilzo.c new file mode 100755 index 0000000..ab2be5f --- /dev/null +++ b/bin/minilzo.c @@ -0,0 +1,6053 @@ +/* minilzo.c -- mini subset of the LZO real-time data compression library + + This file is part of the LZO real-time data compression library. + + Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer + All Rights Reserved. + + The LZO library 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 of + the License, or (at your option) any later version. + + The LZO library 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 the LZO library; see the file COPYING. + If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Markus F.X.J. Oberhumer + + http://www.oberhumer.com/opensource/lzo/ + */ + +/* + * NOTE: + * the full LZO package can be found at + * http://www.oberhumer.com/opensource/lzo/ + */ + +#define __LZO_IN_MINILZO 1 + +#if defined(LZO_CFG_FREESTANDING) +# undef MINILZO_HAVE_CONFIG_H +# define LZO_LIBC_FREESTANDING 1 +# define LZO_OS_FREESTANDING 1 +#endif + +#ifdef MINILZO_HAVE_CONFIG_H +# include +#endif +#include +#include +#if defined(MINILZO_CFG_USE_INTERNAL_LZODEFS) + +#ifndef __LZODEFS_H_INCLUDED +#define __LZODEFS_H_INCLUDED 1 + +#if defined(__CYGWIN32__) && !defined(__CYGWIN__) +# define __CYGWIN__ __CYGWIN32__ +#endif +#if 1 && defined(__INTERIX) && defined(__GNUC__) && !defined(_ALL_SOURCE) +# define _ALL_SOURCE 1 +#endif +#if defined(__mips__) && defined(__R5900__) +# if !defined(__LONG_MAX__) +# define __LONG_MAX__ 9223372036854775807L +# endif +#endif +#if !defined(LZO_CFG_NO_DISABLE_WUNDEF) +#if defined(__ARMCC_VERSION) +# pragma diag_suppress 193 +#elif defined(__clang__) && defined(__clang_minor__) +# pragma clang diagnostic ignored "-Wundef" +#elif defined(__INTEL_COMPILER) +# pragma warning(disable: 193) +#elif defined(__KEIL__) && defined(__C166__) +# pragma warning disable = 322 +#elif defined(__GNUC__) && defined(__GNUC_MINOR__) && !defined(__PATHSCALE__) +# if ((__GNUC__-0) >= 5 || ((__GNUC__-0) == 4 && (__GNUC_MINOR__-0) >= 2)) +# pragma GCC diagnostic ignored "-Wundef" +# endif +#elif defined(_MSC_VER) && !defined(__clang__) && !defined(__INTEL_COMPILER) && !defined(__MWERKS__) +# if ((_MSC_VER-0) >= 1300) +# pragma warning(disable: 4668) +# endif +#endif +#endif +#if 0 && defined(__POCC__) && defined(_WIN32) +# if (__POCC__ >= 400) +# pragma warn(disable: 2216) +# endif +#endif +#if 0 && defined(__WATCOMC__) +# if (__WATCOMC__ >= 1050) && (__WATCOMC__ < 1060) +# pragma warning 203 9 +# endif +#endif +#if defined(__BORLANDC__) && defined(__MSDOS__) && !defined(__FLAT__) +# pragma option -h +#endif +#if !(LZO_CFG_NO_DISABLE_WCRTNONSTDC) +#ifndef _CRT_NONSTDC_NO_DEPRECATE +#define _CRT_NONSTDC_NO_DEPRECATE 1 +#endif +#ifndef _CRT_NONSTDC_NO_WARNINGS +#define _CRT_NONSTDC_NO_WARNINGS 1 +#endif +#ifndef _CRT_SECURE_NO_DEPRECATE +#define _CRT_SECURE_NO_DEPRECATE 1 +#endif +#ifndef _CRT_SECURE_NO_WARNINGS +#define _CRT_SECURE_NO_WARNINGS 1 +#endif +#endif +#if 0 +#define LZO_0xffffUL 0xfffful +#define LZO_0xffffffffUL 0xfffffffful +#else +#define LZO_0xffffUL 65535ul +#define LZO_0xffffffffUL 4294967295ul +#endif +#define LZO_0xffffL LZO_0xffffUL +#define LZO_0xffffffffL LZO_0xffffffffUL +#if (LZO_0xffffL == LZO_0xffffffffL) +# error "your preprocessor is broken 1" +#endif +#if (16ul * 16384ul != 262144ul) +# error "your preprocessor is broken 2" +#endif +#if 0 +#if (32767 >= 4294967295ul) +# error "your preprocessor is broken 3" +#endif +#if (65535u >= 4294967295ul) +# error "your preprocessor is broken 4" +#endif +#endif +#if defined(__COUNTER__) +# ifndef LZO_CFG_USE_COUNTER +# define LZO_CFG_USE_COUNTER 1 +# endif +#else +# undef LZO_CFG_USE_COUNTER +#endif +#if (UINT_MAX == LZO_0xffffL) +#if defined(__ZTC__) && defined(__I86__) && !defined(__OS2__) +# if !defined(MSDOS) +# define MSDOS 1 +# endif +# if !defined(_MSDOS) +# define _MSDOS 1 +# endif +#elif 0 && defined(__VERSION) && defined(MB_LEN_MAX) +# if (__VERSION == 520) && (MB_LEN_MAX == 1) +# if !defined(__AZTEC_C__) +# define __AZTEC_C__ __VERSION +# endif +# if !defined(__DOS__) +# define __DOS__ 1 +# endif +# endif +#endif +#endif +#if defined(_MSC_VER) && defined(M_I86HM) && (UINT_MAX == LZO_0xffffL) +# define ptrdiff_t long +# define _PTRDIFF_T_DEFINED 1 +#endif +#if (UINT_MAX == LZO_0xffffL) +# undef __LZO_RENAME_A +# undef __LZO_RENAME_B +# if defined(__AZTEC_C__) && defined(__DOS__) +# define __LZO_RENAME_A 1 +# elif defined(_MSC_VER) && defined(MSDOS) +# if (_MSC_VER < 600) +# define __LZO_RENAME_A 1 +# elif (_MSC_VER < 700) +# define __LZO_RENAME_B 1 +# endif +# elif defined(__TSC__) && defined(__OS2__) +# define __LZO_RENAME_A 1 +# elif defined(__MSDOS__) && defined(__TURBOC__) && (__TURBOC__ < 0x0410) +# define __LZO_RENAME_A 1 +# elif defined(__PACIFIC__) && defined(DOS) +# if !defined(__far) +# define __far far +# endif +# if !defined(__near) +# define __near near +# endif +# endif +# if defined(__LZO_RENAME_A) +# if !defined(__cdecl) +# define __cdecl cdecl +# endif +# if !defined(__far) +# define __far far +# endif +# if !defined(__huge) +# define __huge huge +# endif +# if !defined(__near) +# define __near near +# endif +# if !defined(__pascal) +# define __pascal pascal +# endif +# if !defined(__huge) +# define __huge huge +# endif +# elif defined(__LZO_RENAME_B) +# if !defined(__cdecl) +# define __cdecl _cdecl +# endif +# if !defined(__far) +# define __far _far +# endif +# if !defined(__huge) +# define __huge _huge +# endif +# if !defined(__near) +# define __near _near +# endif +# if !defined(__pascal) +# define __pascal _pascal +# endif +# elif (defined(__PUREC__) || defined(__TURBOC__)) && defined(__TOS__) +# if !defined(__cdecl) +# define __cdecl cdecl +# endif +# if !defined(__pascal) +# define __pascal pascal +# endif +# endif +# undef __LZO_RENAME_A +# undef __LZO_RENAME_B +#endif +#if (UINT_MAX == LZO_0xffffL) +#if defined(__AZTEC_C__) && defined(__DOS__) +# define LZO_BROKEN_CDECL_ALT_SYNTAX 1 +#elif defined(_MSC_VER) && defined(MSDOS) +# if (_MSC_VER < 600) +# define LZO_BROKEN_INTEGRAL_CONSTANTS 1 +# endif +# if (_MSC_VER < 700) +# define LZO_BROKEN_INTEGRAL_PROMOTION 1 +# define LZO_BROKEN_SIZEOF 1 +# endif +#elif defined(__PACIFIC__) && defined(DOS) +# define LZO_BROKEN_INTEGRAL_CONSTANTS 1 +#elif defined(__TURBOC__) && defined(__MSDOS__) +# if (__TURBOC__ < 0x0150) +# define LZO_BROKEN_CDECL_ALT_SYNTAX 1 +# define LZO_BROKEN_INTEGRAL_CONSTANTS 1 +# define LZO_BROKEN_INTEGRAL_PROMOTION 1 +# endif +# if (__TURBOC__ < 0x0200) +# define LZO_BROKEN_SIZEOF 1 +# endif +# if (__TURBOC__ < 0x0400) && defined(__cplusplus) +# define LZO_BROKEN_CDECL_ALT_SYNTAX 1 +# endif +#elif (defined(__PUREC__) || defined(__TURBOC__)) && defined(__TOS__) +# define LZO_BROKEN_CDECL_ALT_SYNTAX 1 +# define LZO_BROKEN_SIZEOF 1 +#endif +#endif +#if defined(__WATCOMC__) && (__WATCOMC__ < 900) +# define LZO_BROKEN_INTEGRAL_CONSTANTS 1 +#endif +#if defined(_CRAY) && defined(_CRAY1) +# define LZO_BROKEN_SIGNED_RIGHT_SHIFT 1 +#endif +#define LZO_PP_STRINGIZE(x) #x +#define LZO_PP_MACRO_EXPAND(x) LZO_PP_STRINGIZE(x) +#define LZO_PP_CONCAT0() /*empty*/ +#define LZO_PP_CONCAT1(a) a +#define LZO_PP_CONCAT2(a,b) a ## b +#define LZO_PP_CONCAT3(a,b,c) a ## b ## c +#define LZO_PP_CONCAT4(a,b,c,d) a ## b ## c ## d +#define LZO_PP_CONCAT5(a,b,c,d,e) a ## b ## c ## d ## e +#define LZO_PP_CONCAT6(a,b,c,d,e,f) a ## b ## c ## d ## e ## f +#define LZO_PP_CONCAT7(a,b,c,d,e,f,g) a ## b ## c ## d ## e ## f ## g +#define LZO_PP_ECONCAT0() LZO_PP_CONCAT0() +#define LZO_PP_ECONCAT1(a) LZO_PP_CONCAT1(a) +#define LZO_PP_ECONCAT2(a,b) LZO_PP_CONCAT2(a,b) +#define LZO_PP_ECONCAT3(a,b,c) LZO_PP_CONCAT3(a,b,c) +#define LZO_PP_ECONCAT4(a,b,c,d) LZO_PP_CONCAT4(a,b,c,d) +#define LZO_PP_ECONCAT5(a,b,c,d,e) LZO_PP_CONCAT5(a,b,c,d,e) +#define LZO_PP_ECONCAT6(a,b,c,d,e,f) LZO_PP_CONCAT6(a,b,c,d,e,f) +#define LZO_PP_ECONCAT7(a,b,c,d,e,f,g) LZO_PP_CONCAT7(a,b,c,d,e,f,g) +#define LZO_PP_EMPTY /*empty*/ +#define LZO_PP_EMPTY0() /*empty*/ +#define LZO_PP_EMPTY1(a) /*empty*/ +#define LZO_PP_EMPTY2(a,b) /*empty*/ +#define LZO_PP_EMPTY3(a,b,c) /*empty*/ +#define LZO_PP_EMPTY4(a,b,c,d) /*empty*/ +#define LZO_PP_EMPTY5(a,b,c,d,e) /*empty*/ +#define LZO_PP_EMPTY6(a,b,c,d,e,f) /*empty*/ +#define LZO_PP_EMPTY7(a,b,c,d,e,f,g) /*empty*/ +#if 1 +#define LZO_CPP_STRINGIZE(x) #x +#define LZO_CPP_MACRO_EXPAND(x) LZO_CPP_STRINGIZE(x) +#define LZO_CPP_CONCAT2(a,b) a ## b +#define LZO_CPP_CONCAT3(a,b,c) a ## b ## c +#define LZO_CPP_CONCAT4(a,b,c,d) a ## b ## c ## d +#define LZO_CPP_CONCAT5(a,b,c,d,e) a ## b ## c ## d ## e +#define LZO_CPP_CONCAT6(a,b,c,d,e,f) a ## b ## c ## d ## e ## f +#define LZO_CPP_CONCAT7(a,b,c,d,e,f,g) a ## b ## c ## d ## e ## f ## g +#define LZO_CPP_ECONCAT2(a,b) LZO_CPP_CONCAT2(a,b) +#define LZO_CPP_ECONCAT3(a,b,c) LZO_CPP_CONCAT3(a,b,c) +#define LZO_CPP_ECONCAT4(a,b,c,d) LZO_CPP_CONCAT4(a,b,c,d) +#define LZO_CPP_ECONCAT5(a,b,c,d,e) LZO_CPP_CONCAT5(a,b,c,d,e) +#define LZO_CPP_ECONCAT6(a,b,c,d,e,f) LZO_CPP_CONCAT6(a,b,c,d,e,f) +#define LZO_CPP_ECONCAT7(a,b,c,d,e,f,g) LZO_CPP_CONCAT7(a,b,c,d,e,f,g) +#endif +#define __LZO_MASK_GEN(o,b) (((((o) << ((b)-!!(b))) - (o)) << 1) + (o)*!!(b)) +#if 1 && defined(__cplusplus) +# if !defined(__STDC_CONSTANT_MACROS) +# define __STDC_CONSTANT_MACROS 1 +# endif +# if !defined(__STDC_LIMIT_MACROS) +# define __STDC_LIMIT_MACROS 1 +# endif +#endif +#if defined(__cplusplus) +# define LZO_EXTERN_C extern "C" +# define LZO_EXTERN_C_BEGIN extern "C" { +# define LZO_EXTERN_C_END } +#else +# define LZO_EXTERN_C extern +# define LZO_EXTERN_C_BEGIN /*empty*/ +# define LZO_EXTERN_C_END /*empty*/ +#endif +#if !defined(__LZO_OS_OVERRIDE) +#if (LZO_OS_FREESTANDING) +# define LZO_INFO_OS "freestanding" +#elif (LZO_OS_EMBEDDED) +# define LZO_INFO_OS "embedded" +#elif 1 && defined(__IAR_SYSTEMS_ICC__) +# define LZO_OS_EMBEDDED 1 +# define LZO_INFO_OS "embedded" +#elif defined(__CYGWIN__) && defined(__GNUC__) +# define LZO_OS_CYGWIN 1 +# define LZO_INFO_OS "cygwin" +#elif defined(__EMX__) && defined(__GNUC__) +# define LZO_OS_EMX 1 +# define LZO_INFO_OS "emx" +#elif defined(__BEOS__) +# define LZO_OS_BEOS 1 +# define LZO_INFO_OS "beos" +#elif defined(__Lynx__) +# define LZO_OS_LYNXOS 1 +# define LZO_INFO_OS "lynxos" +#elif defined(__OS400__) +# define LZO_OS_OS400 1 +# define LZO_INFO_OS "os400" +#elif defined(__QNX__) +# define LZO_OS_QNX 1 +# define LZO_INFO_OS "qnx" +#elif defined(__BORLANDC__) && defined(__DPMI32__) && (__BORLANDC__ >= 0x0460) +# define LZO_OS_DOS32 1 +# define LZO_INFO_OS "dos32" +#elif defined(__BORLANDC__) && defined(__DPMI16__) +# define LZO_OS_DOS16 1 +# define LZO_INFO_OS "dos16" +#elif defined(__ZTC__) && defined(DOS386) +# define LZO_OS_DOS32 1 +# define LZO_INFO_OS "dos32" +#elif defined(__OS2__) || defined(__OS2V2__) +# if (UINT_MAX == LZO_0xffffL) +# define LZO_OS_OS216 1 +# define LZO_INFO_OS "os216" +# elif (UINT_MAX == LZO_0xffffffffL) +# define LZO_OS_OS2 1 +# define LZO_INFO_OS "os2" +# else +# error "check your limits.h header" +# endif +#elif defined(__WIN64__) || defined(_WIN64) || defined(WIN64) +# define LZO_OS_WIN64 1 +# define LZO_INFO_OS "win64" +#elif defined(__WIN32__) || defined(_WIN32) || defined(WIN32) || defined(__WINDOWS_386__) +# define LZO_OS_WIN32 1 +# define LZO_INFO_OS "win32" +#elif defined(__MWERKS__) && defined(__INTEL__) +# define LZO_OS_WIN32 1 +# define LZO_INFO_OS "win32" +#elif defined(__WINDOWS__) || defined(_WINDOWS) || defined(_Windows) +# if (UINT_MAX == LZO_0xffffL) +# define LZO_OS_WIN16 1 +# define LZO_INFO_OS "win16" +# elif (UINT_MAX == LZO_0xffffffffL) +# define LZO_OS_WIN32 1 +# define LZO_INFO_OS "win32" +# else +# error "check your limits.h header" +# endif +#elif defined(__DOS__) || defined(__MSDOS__) || defined(_MSDOS) || defined(MSDOS) || (defined(__PACIFIC__) && defined(DOS)) +# if (UINT_MAX == LZO_0xffffL) +# define LZO_OS_DOS16 1 +# define LZO_INFO_OS "dos16" +# elif (UINT_MAX == LZO_0xffffffffL) +# define LZO_OS_DOS32 1 +# define LZO_INFO_OS "dos32" +# else +# error "check your limits.h header" +# endif +#elif defined(__WATCOMC__) +# if defined(__NT__) && (UINT_MAX == LZO_0xffffL) +# define LZO_OS_DOS16 1 +# define LZO_INFO_OS "dos16" +# elif defined(__NT__) && (__WATCOMC__ < 1100) +# define LZO_OS_WIN32 1 +# define LZO_INFO_OS "win32" +# elif defined(__linux__) || defined(__LINUX__) +# define LZO_OS_POSIX 1 +# define LZO_INFO_OS "posix" +# else +# error "please specify a target using the -bt compiler option" +# endif +#elif defined(__palmos__) +# define LZO_OS_PALMOS 1 +# define LZO_INFO_OS "palmos" +#elif defined(__TOS__) || defined(__atarist__) +# define LZO_OS_TOS 1 +# define LZO_INFO_OS "tos" +#elif defined(macintosh) && !defined(__ppc__) +# define LZO_OS_MACCLASSIC 1 +# define LZO_INFO_OS "macclassic" +#elif defined(__VMS) +# define LZO_OS_VMS 1 +# define LZO_INFO_OS "vms" +#elif (defined(__mips__) && defined(__R5900__)) || defined(__MIPS_PSX2__) +# define LZO_OS_CONSOLE 1 +# define LZO_OS_CONSOLE_PS2 1 +# define LZO_INFO_OS "console" +# define LZO_INFO_OS_CONSOLE "ps2" +#elif defined(__mips__) && defined(__psp__) +# define LZO_OS_CONSOLE 1 +# define LZO_OS_CONSOLE_PSP 1 +# define LZO_INFO_OS "console" +# define LZO_INFO_OS_CONSOLE "psp" +#else +# define LZO_OS_POSIX 1 +# define LZO_INFO_OS "posix" +#endif +#if (LZO_OS_POSIX) +# if defined(_AIX) || defined(__AIX__) || defined(__aix__) +# define LZO_OS_POSIX_AIX 1 +# define LZO_INFO_OS_POSIX "aix" +# elif defined(__FreeBSD__) +# define LZO_OS_POSIX_FREEBSD 1 +# define LZO_INFO_OS_POSIX "freebsd" +# elif defined(__hpux__) || defined(__hpux) +# define LZO_OS_POSIX_HPUX 1 +# define LZO_INFO_OS_POSIX "hpux" +# elif defined(__INTERIX) +# define LZO_OS_POSIX_INTERIX 1 +# define LZO_INFO_OS_POSIX "interix" +# elif defined(__IRIX__) || defined(__irix__) +# define LZO_OS_POSIX_IRIX 1 +# define LZO_INFO_OS_POSIX "irix" +# elif defined(__linux__) || defined(__linux) || defined(__LINUX__) +# define LZO_OS_POSIX_LINUX 1 +# define LZO_INFO_OS_POSIX "linux" +# elif defined(__APPLE__) && defined(__MACH__) +# if ((__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__-0) >= 20000) +# define LZO_OS_POSIX_DARWIN 1040 +# define LZO_INFO_OS_POSIX "darwin_iphone" +# elif ((__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__-0) >= 1040) +# define LZO_OS_POSIX_DARWIN __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ +# define LZO_INFO_OS_POSIX "darwin" +# else +# define LZO_OS_POSIX_DARWIN 1 +# define LZO_INFO_OS_POSIX "darwin" +# endif +# define LZO_OS_POSIX_MACOSX LZO_OS_POSIX_DARWIN +# elif defined(__minix__) || defined(__minix) +# define LZO_OS_POSIX_MINIX 1 +# define LZO_INFO_OS_POSIX "minix" +# elif defined(__NetBSD__) +# define LZO_OS_POSIX_NETBSD 1 +# define LZO_INFO_OS_POSIX "netbsd" +# elif defined(__OpenBSD__) +# define LZO_OS_POSIX_OPENBSD 1 +# define LZO_INFO_OS_POSIX "openbsd" +# elif defined(__osf__) +# define LZO_OS_POSIX_OSF 1 +# define LZO_INFO_OS_POSIX "osf" +# elif defined(__solaris__) || defined(__sun) +# if defined(__SVR4) || defined(__svr4__) +# define LZO_OS_POSIX_SOLARIS 1 +# define LZO_INFO_OS_POSIX "solaris" +# else +# define LZO_OS_POSIX_SUNOS 1 +# define LZO_INFO_OS_POSIX "sunos" +# endif +# elif defined(__ultrix__) || defined(__ultrix) +# define LZO_OS_POSIX_ULTRIX 1 +# define LZO_INFO_OS_POSIX "ultrix" +# elif defined(_UNICOS) +# define LZO_OS_POSIX_UNICOS 1 +# define LZO_INFO_OS_POSIX "unicos" +# else +# define LZO_OS_POSIX_UNKNOWN 1 +# define LZO_INFO_OS_POSIX "unknown" +# endif +#endif +#endif +#if (LZO_OS_DOS16 || LZO_OS_OS216 || LZO_OS_WIN16) +# if (UINT_MAX != LZO_0xffffL) +# error "unexpected configuration - check your compiler defines" +# endif +# if (ULONG_MAX != LZO_0xffffffffL) +# error "unexpected configuration - check your compiler defines" +# endif +#endif +#if (LZO_OS_DOS32 || LZO_OS_OS2 || LZO_OS_WIN32 || LZO_OS_WIN64) +# if (UINT_MAX != LZO_0xffffffffL) +# error "unexpected configuration - check your compiler defines" +# endif +# if (ULONG_MAX != LZO_0xffffffffL) +# error "unexpected configuration - check your compiler defines" +# endif +#endif +#if defined(CIL) && defined(_GNUCC) && defined(__GNUC__) +# define LZO_CC_CILLY 1 +# define LZO_INFO_CC "Cilly" +# if defined(__CILLY__) +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__CILLY__) +# else +# define LZO_INFO_CCVER "unknown" +# endif +#elif 0 && defined(SDCC) && defined(__VERSION__) && !defined(__GNUC__) +# define LZO_CC_SDCC 1 +# define LZO_INFO_CC "sdcc" +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(SDCC) +#elif defined(__PATHSCALE__) && defined(__PATHCC_PATCHLEVEL__) +# define LZO_CC_PATHSCALE (__PATHCC__ * 0x10000L + (__PATHCC_MINOR__-0) * 0x100 + (__PATHCC_PATCHLEVEL__-0)) +# define LZO_INFO_CC "Pathscale C" +# define LZO_INFO_CCVER __PATHSCALE__ +# if defined(__GNUC__) && defined(__GNUC_MINOR__) && defined(__VERSION__) +# define LZO_CC_PATHSCALE_GNUC (__GNUC__ * 0x10000L + (__GNUC_MINOR__-0) * 0x100 + (__GNUC_PATCHLEVEL__-0)) +# endif +#elif defined(__INTEL_COMPILER) && ((__INTEL_COMPILER-0) > 0) +# define LZO_CC_INTELC __INTEL_COMPILER +# define LZO_INFO_CC "Intel C" +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__INTEL_COMPILER) +# if defined(_MSC_VER) && ((_MSC_VER-0) > 0) +# define LZO_CC_INTELC_MSC _MSC_VER +# elif defined(__GNUC__) && defined(__GNUC_MINOR__) && defined(__VERSION__) +# define LZO_CC_INTELC_GNUC (__GNUC__ * 0x10000L + (__GNUC_MINOR__-0) * 0x100 + (__GNUC_PATCHLEVEL__-0)) +# endif +#elif defined(__POCC__) && defined(_WIN32) +# define LZO_CC_PELLESC 1 +# define LZO_INFO_CC "Pelles C" +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__POCC__) +#elif defined(__ARMCC_VERSION) && defined(__GNUC__) && defined(__GNUC_MINOR__) && defined(__VERSION__) +# if defined(__GNUC_PATCHLEVEL__) +# define LZO_CC_ARMCC_GNUC (__GNUC__ * 0x10000L + (__GNUC_MINOR__-0) * 0x100 + (__GNUC_PATCHLEVEL__-0)) +# else +# define LZO_CC_ARMCC_GNUC (__GNUC__ * 0x10000L + (__GNUC_MINOR__-0) * 0x100) +# endif +# define LZO_CC_ARMCC __ARMCC_VERSION +# define LZO_INFO_CC "ARM C Compiler" +# define LZO_INFO_CCVER __VERSION__ +#elif defined(__clang__) && defined(__llvm__) && defined(__VERSION__) +# if defined(__clang_major__) && defined(__clang_minor__) && defined(__clang_patchlevel__) +# define LZO_CC_CLANG (__clang_major__ * 0x10000L + (__clang_minor__-0) * 0x100 + (__clang_patchlevel__-0)) +# else +# define LZO_CC_CLANG 0x010000L +# endif +# if defined(_MSC_VER) && ((_MSC_VER-0) > 0) +# define LZO_CC_CLANG_MSC _MSC_VER +# elif defined(__GNUC__) && defined(__GNUC_MINOR__) && defined(__VERSION__) +# define LZO_CC_CLANG_GNUC (__GNUC__ * 0x10000L + (__GNUC_MINOR__-0) * 0x100 + (__GNUC_PATCHLEVEL__-0)) +# endif +# define LZO_INFO_CC "clang" +# define LZO_INFO_CCVER __VERSION__ +#elif defined(__llvm__) && defined(__GNUC__) && defined(__GNUC_MINOR__) && defined(__VERSION__) +# if defined(__GNUC_PATCHLEVEL__) +# define LZO_CC_LLVM_GNUC (__GNUC__ * 0x10000L + (__GNUC_MINOR__-0) * 0x100 + (__GNUC_PATCHLEVEL__-0)) +# else +# define LZO_CC_LLVM_GNUC (__GNUC__ * 0x10000L + (__GNUC_MINOR__-0) * 0x100) +# endif +# define LZO_CC_LLVM LZO_CC_LLVM_GNUC +# define LZO_INFO_CC "llvm-gcc" +# define LZO_INFO_CCVER __VERSION__ +#elif defined(__ACK__) && defined(_ACK) +# define LZO_CC_ACK 1 +# define LZO_INFO_CC "Amsterdam Compiler Kit C" +# define LZO_INFO_CCVER "unknown" +#elif defined(__ARMCC_VERSION) && !defined(__GNUC__) +# define LZO_CC_ARMCC __ARMCC_VERSION +# define LZO_CC_ARMCC_ARMCC __ARMCC_VERSION +# define LZO_INFO_CC "ARM C Compiler" +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__ARMCC_VERSION) +#elif defined(__AZTEC_C__) +# define LZO_CC_AZTECC 1 +# define LZO_INFO_CC "Aztec C" +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__AZTEC_C__) +#elif defined(__CODEGEARC__) +# define LZO_CC_CODEGEARC 1 +# define LZO_INFO_CC "CodeGear C" +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__CODEGEARC__) +#elif defined(__BORLANDC__) +# define LZO_CC_BORLANDC 1 +# define LZO_INFO_CC "Borland C" +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__BORLANDC__) +#elif defined(_CRAYC) && defined(_RELEASE) +# define LZO_CC_CRAYC 1 +# define LZO_INFO_CC "Cray C" +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(_RELEASE) +#elif defined(__DMC__) && defined(__SC__) +# define LZO_CC_DMC 1 +# define LZO_INFO_CC "Digital Mars C" +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__DMC__) +#elif defined(__DECC) +# define LZO_CC_DECC 1 +# define LZO_INFO_CC "DEC C" +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__DECC) +#elif (defined(__ghs) || defined(__ghs__)) && defined(__GHS_VERSION_NUMBER) && ((__GHS_VERSION_NUMBER-0) > 0) +# define LZO_CC_GHS 1 +# define LZO_INFO_CC "Green Hills C" +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__GHS_VERSION_NUMBER) +# if defined(_MSC_VER) && ((_MSC_VER-0) > 0) +# define LZO_CC_GHS_MSC _MSC_VER +# elif defined(__GNUC__) && defined(__GNUC_MINOR__) && defined(__VERSION__) +# define LZO_CC_GHS_GNUC (__GNUC__ * 0x10000L + (__GNUC_MINOR__-0) * 0x100 + (__GNUC_PATCHLEVEL__-0)) +# endif +#elif defined(__HIGHC__) +# define LZO_CC_HIGHC 1 +# define LZO_INFO_CC "MetaWare High C" +# define LZO_INFO_CCVER "unknown" +#elif defined(__HP_aCC) && ((__HP_aCC-0) > 0) +# define LZO_CC_HPACC __HP_aCC +# define LZO_INFO_CC "HP aCC" +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__HP_aCC) +#elif defined(__IAR_SYSTEMS_ICC__) +# define LZO_CC_IARC 1 +# define LZO_INFO_CC "IAR C" +# if defined(__VER__) +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__VER__) +# else +# define LZO_INFO_CCVER "unknown" +# endif +#elif defined(__IBMC__) && ((__IBMC__-0) > 0) +# define LZO_CC_IBMC __IBMC__ +# define LZO_INFO_CC "IBM C" +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__IBMC__) +#elif defined(__IBMCPP__) && ((__IBMCPP__-0) > 0) +# define LZO_CC_IBMC __IBMCPP__ +# define LZO_INFO_CC "IBM C" +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__IBMCPP__) +#elif defined(__KEIL__) && defined(__C166__) +# define LZO_CC_KEILC 1 +# define LZO_INFO_CC "Keil C" +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__C166__) +#elif defined(__LCC__) && defined(_WIN32) && defined(__LCCOPTIMLEVEL) +# define LZO_CC_LCCWIN32 1 +# define LZO_INFO_CC "lcc-win32" +# define LZO_INFO_CCVER "unknown" +#elif defined(__LCC__) +# define LZO_CC_LCC 1 +# define LZO_INFO_CC "lcc" +# if defined(__LCC_VERSION__) +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__LCC_VERSION__) +# else +# define LZO_INFO_CCVER "unknown" +# endif +#elif defined(__MWERKS__) && ((__MWERKS__-0) > 0) +# define LZO_CC_MWERKS __MWERKS__ +# define LZO_INFO_CC "Metrowerks C" +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__MWERKS__) +#elif (defined(__NDPC__) || defined(__NDPX__)) && defined(__i386) +# define LZO_CC_NDPC 1 +# define LZO_INFO_CC "Microway NDP C" +# define LZO_INFO_CCVER "unknown" +#elif defined(__PACIFIC__) +# define LZO_CC_PACIFICC 1 +# define LZO_INFO_CC "Pacific C" +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__PACIFIC__) +#elif defined(__PGI) && defined(__PGIC__) && defined(__PGIC_MINOR__) +# if defined(__PGIC_PATCHLEVEL__) +# define LZO_CC_PGI (__PGIC__ * 0x10000L + (__PGIC_MINOR__-0) * 0x100 + (__PGIC_PATCHLEVEL__-0)) +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__PGIC__) "." LZO_PP_MACRO_EXPAND(__PGIC_MINOR__) "." LZO_PP_MACRO_EXPAND(__PGIC_PATCHLEVEL__) +# else +# define LZO_CC_PGI (__PGIC__ * 0x10000L + (__PGIC_MINOR__-0) * 0x100) +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__PGIC__) "." LZO_PP_MACRO_EXPAND(__PGIC_MINOR__) ".0" +# endif +# define LZO_INFO_CC "Portland Group PGI C" +#elif defined(__PGI) && (defined(__linux__) || defined(__WIN32__)) +# define LZO_CC_PGI 1 +# define LZO_INFO_CC "Portland Group PGI C" +# define LZO_INFO_CCVER "unknown" +#elif defined(__PUREC__) && defined(__TOS__) +# define LZO_CC_PUREC 1 +# define LZO_INFO_CC "Pure C" +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__PUREC__) +#elif defined(__SC__) && defined(__ZTC__) +# define LZO_CC_SYMANTECC 1 +# define LZO_INFO_CC "Symantec C" +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__SC__) +#elif defined(__SUNPRO_C) +# define LZO_INFO_CC "SunPro C" +# if ((__SUNPRO_C-0) > 0) +# define LZO_CC_SUNPROC __SUNPRO_C +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__SUNPRO_C) +# else +# define LZO_CC_SUNPROC 1 +# define LZO_INFO_CCVER "unknown" +# endif +#elif defined(__SUNPRO_CC) +# define LZO_INFO_CC "SunPro C" +# if ((__SUNPRO_CC-0) > 0) +# define LZO_CC_SUNPROC __SUNPRO_CC +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__SUNPRO_CC) +# else +# define LZO_CC_SUNPROC 1 +# define LZO_INFO_CCVER "unknown" +# endif +#elif defined(__TINYC__) +# define LZO_CC_TINYC 1 +# define LZO_INFO_CC "Tiny C" +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__TINYC__) +#elif defined(__TSC__) +# define LZO_CC_TOPSPEEDC 1 +# define LZO_INFO_CC "TopSpeed C" +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__TSC__) +#elif defined(__WATCOMC__) +# define LZO_CC_WATCOMC 1 +# define LZO_INFO_CC "Watcom C" +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__WATCOMC__) +#elif defined(__TURBOC__) +# define LZO_CC_TURBOC 1 +# define LZO_INFO_CC "Turbo C" +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__TURBOC__) +#elif defined(__ZTC__) +# define LZO_CC_ZORTECHC 1 +# define LZO_INFO_CC "Zortech C" +# if ((__ZTC__-0) == 0x310) +# define LZO_INFO_CCVER "0x310" +# else +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__ZTC__) +# endif +#elif defined(__GNUC__) && defined(__VERSION__) +# if defined(__GNUC_MINOR__) && defined(__GNUC_PATCHLEVEL__) +# define LZO_CC_GNUC (__GNUC__ * 0x10000L + (__GNUC_MINOR__-0) * 0x100 + (__GNUC_PATCHLEVEL__-0)) +# elif defined(__GNUC_MINOR__) +# define LZO_CC_GNUC (__GNUC__ * 0x10000L + (__GNUC_MINOR__-0) * 0x100) +# else +# define LZO_CC_GNUC (__GNUC__ * 0x10000L) +# endif +# define LZO_INFO_CC "gcc" +# define LZO_INFO_CCVER __VERSION__ +#elif defined(_MSC_VER) && ((_MSC_VER-0) > 0) +# define LZO_CC_MSC _MSC_VER +# define LZO_INFO_CC "Microsoft C" +# if defined(_MSC_FULL_VER) +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(_MSC_VER) "." LZO_PP_MACRO_EXPAND(_MSC_FULL_VER) +# else +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(_MSC_VER) +# endif +#else +# define LZO_CC_UNKNOWN 1 +# define LZO_INFO_CC "unknown" +# define LZO_INFO_CCVER "unknown" +#endif +#if (LZO_CC_GNUC) && defined(__OPEN64__) +# if defined(__OPENCC__) && defined(__OPENCC_MINOR__) && defined(__OPENCC_PATCHLEVEL__) +# define LZO_CC_OPEN64 (__OPENCC__ * 0x10000L + (__OPENCC_MINOR__-0) * 0x100 + (__OPENCC_PATCHLEVEL__-0)) +# define LZO_CC_OPEN64_GNUC LZO_CC_GNUC +# endif +#endif +#if (LZO_CC_GNUC) && defined(__PCC__) +# if defined(__PCC__) && defined(__PCC_MINOR__) && defined(__PCC_MINORMINOR__) +# define LZO_CC_PCC (__PCC__ * 0x10000L + (__PCC_MINOR__-0) * 0x100 + (__PCC_MINORMINOR__-0)) +# define LZO_CC_PCC_GNUC LZO_CC_GNUC +# endif +#endif +#if 0 && (LZO_CC_MSC && (_MSC_VER >= 1200)) && !defined(_MSC_FULL_VER) +# error "LZO_CC_MSC: _MSC_FULL_VER is not defined" +#endif +#if !defined(__LZO_ARCH_OVERRIDE) && !(LZO_ARCH_GENERIC) && defined(_CRAY) +# if (UINT_MAX > LZO_0xffffffffL) && defined(_CRAY) +# if defined(_CRAYMPP) || defined(_CRAYT3D) || defined(_CRAYT3E) +# define LZO_ARCH_CRAY_MPP 1 +# elif defined(_CRAY1) +# define LZO_ARCH_CRAY_PVP 1 +# endif +# endif +#endif +#if !defined(__LZO_ARCH_OVERRIDE) +#if (LZO_ARCH_GENERIC) +# define LZO_INFO_ARCH "generic" +#elif (LZO_OS_DOS16 || LZO_OS_OS216 || LZO_OS_WIN16) +# define LZO_ARCH_I086 1 +# define LZO_INFO_ARCH "i086" +#elif defined(__aarch64__) +# define LZO_ARCH_ARM64 1 +# define LZO_INFO_ARCH "arm64" +#elif defined(__alpha__) || defined(__alpha) || defined(_M_ALPHA) +# define LZO_ARCH_ALPHA 1 +# define LZO_INFO_ARCH "alpha" +#elif (LZO_ARCH_CRAY_MPP) && (defined(_CRAYT3D) || defined(_CRAYT3E)) +# define LZO_ARCH_ALPHA 1 +# define LZO_INFO_ARCH "alpha" +#elif defined(__amd64__) || defined(__x86_64__) || defined(_M_AMD64) +# define LZO_ARCH_AMD64 1 +# define LZO_INFO_ARCH "amd64" +#elif defined(__thumb__) || (defined(_M_ARM) && defined(_M_THUMB)) +# define LZO_ARCH_ARM 1 +# define LZO_ARCH_ARM_THUMB 1 +# define LZO_INFO_ARCH "arm_thumb" +#elif defined(__IAR_SYSTEMS_ICC__) && defined(__ICCARM__) +# define LZO_ARCH_ARM 1 +# if defined(__CPU_MODE__) && ((__CPU_MODE__-0) == 1) +# define LZO_ARCH_ARM_THUMB 1 +# define LZO_INFO_ARCH "arm_thumb" +# elif defined(__CPU_MODE__) && ((__CPU_MODE__-0) == 2) +# define LZO_INFO_ARCH "arm" +# else +# define LZO_INFO_ARCH "arm" +# endif +#elif defined(__arm__) || defined(_M_ARM) +# define LZO_ARCH_ARM 1 +# define LZO_INFO_ARCH "arm" +#elif (UINT_MAX <= LZO_0xffffL) && defined(__AVR__) +# define LZO_ARCH_AVR 1 +# define LZO_INFO_ARCH "avr" +#elif defined(__avr32__) || defined(__AVR32__) +# define LZO_ARCH_AVR32 1 +# define LZO_INFO_ARCH "avr32" +#elif defined(__bfin__) +# define LZO_ARCH_BLACKFIN 1 +# define LZO_INFO_ARCH "blackfin" +#elif (UINT_MAX == LZO_0xffffL) && defined(__C166__) +# define LZO_ARCH_C166 1 +# define LZO_INFO_ARCH "c166" +#elif defined(__cris__) +# define LZO_ARCH_CRIS 1 +# define LZO_INFO_ARCH "cris" +#elif defined(__IAR_SYSTEMS_ICC__) && defined(__ICCEZ80__) +# define LZO_ARCH_EZ80 1 +# define LZO_INFO_ARCH "ez80" +#elif defined(__H8300__) || defined(__H8300H__) || defined(__H8300S__) || defined(__H8300SX__) +# define LZO_ARCH_H8300 1 +# define LZO_INFO_ARCH "h8300" +#elif defined(__hppa__) || defined(__hppa) +# define LZO_ARCH_HPPA 1 +# define LZO_INFO_ARCH "hppa" +#elif defined(__386__) || defined(__i386__) || defined(__i386) || defined(_M_IX86) || defined(_M_I386) +# define LZO_ARCH_I386 1 +# define LZO_ARCH_IA32 1 +# define LZO_INFO_ARCH "i386" +#elif (LZO_CC_ZORTECHC && defined(__I86__)) +# define LZO_ARCH_I386 1 +# define LZO_ARCH_IA32 1 +# define LZO_INFO_ARCH "i386" +#elif (LZO_OS_DOS32 && LZO_CC_HIGHC) && defined(_I386) +# define LZO_ARCH_I386 1 +# define LZO_ARCH_IA32 1 +# define LZO_INFO_ARCH "i386" +#elif defined(__ia64__) || defined(__ia64) || defined(_M_IA64) +# define LZO_ARCH_IA64 1 +# define LZO_INFO_ARCH "ia64" +#elif (UINT_MAX == LZO_0xffffL) && defined(__m32c__) +# define LZO_ARCH_M16C 1 +# define LZO_INFO_ARCH "m16c" +#elif defined(__IAR_SYSTEMS_ICC__) && defined(__ICCM16C__) +# define LZO_ARCH_M16C 1 +# define LZO_INFO_ARCH "m16c" +#elif defined(__m32r__) +# define LZO_ARCH_M32R 1 +# define LZO_INFO_ARCH "m32r" +#elif (LZO_OS_TOS) || defined(__m68k__) || defined(__m68000__) || defined(__mc68000__) || defined(__mc68020__) || defined(_M_M68K) +# define LZO_ARCH_M68K 1 +# define LZO_INFO_ARCH "m68k" +#elif (UINT_MAX == LZO_0xffffL) && defined(__C251__) +# define LZO_ARCH_MCS251 1 +# define LZO_INFO_ARCH "mcs251" +#elif (UINT_MAX == LZO_0xffffL) && defined(__C51__) +# define LZO_ARCH_MCS51 1 +# define LZO_INFO_ARCH "mcs51" +#elif defined(__IAR_SYSTEMS_ICC__) && defined(__ICC8051__) +# define LZO_ARCH_MCS51 1 +# define LZO_INFO_ARCH "mcs51" +#elif defined(__mips__) || defined(__mips) || defined(_MIPS_ARCH) || defined(_M_MRX000) +# define LZO_ARCH_MIPS 1 +# define LZO_INFO_ARCH "mips" +#elif (UINT_MAX == LZO_0xffffL) && defined(__MSP430__) +# define LZO_ARCH_MSP430 1 +# define LZO_INFO_ARCH "msp430" +#elif defined(__IAR_SYSTEMS_ICC__) && defined(__ICC430__) +# define LZO_ARCH_MSP430 1 +# define LZO_INFO_ARCH "msp430" +#elif defined(__powerpc__) || defined(__powerpc) || defined(__ppc__) || defined(__PPC__) || defined(_M_PPC) || defined(_ARCH_PPC) || defined(_ARCH_PWR) +# define LZO_ARCH_POWERPC 1 +# define LZO_INFO_ARCH "powerpc" +#elif defined(__s390__) || defined(__s390) || defined(__s390x__) || defined(__s390x) +# define LZO_ARCH_S390 1 +# define LZO_INFO_ARCH "s390" +#elif defined(__sh__) || defined(_M_SH) +# define LZO_ARCH_SH 1 +# define LZO_INFO_ARCH "sh" +#elif defined(__sparc__) || defined(__sparc) || defined(__sparcv8) +# define LZO_ARCH_SPARC 1 +# define LZO_INFO_ARCH "sparc" +#elif defined(__SPU__) +# define LZO_ARCH_SPU 1 +# define LZO_INFO_ARCH "spu" +#elif (UINT_MAX == LZO_0xffffL) && defined(__z80) +# define LZO_ARCH_Z80 1 +# define LZO_INFO_ARCH "z80" +#elif (LZO_ARCH_CRAY_PVP) +# if defined(_CRAYSV1) +# define LZO_ARCH_CRAY_SV1 1 +# define LZO_INFO_ARCH "cray_sv1" +# elif (_ADDR64) +# define LZO_ARCH_CRAY_T90 1 +# define LZO_INFO_ARCH "cray_t90" +# elif (_ADDR32) +# define LZO_ARCH_CRAY_YMP 1 +# define LZO_INFO_ARCH "cray_ymp" +# else +# define LZO_ARCH_CRAY_XMP 1 +# define LZO_INFO_ARCH "cray_xmp" +# endif +#else +# define LZO_ARCH_UNKNOWN 1 +# define LZO_INFO_ARCH "unknown" +#endif +#endif +#if 1 && (LZO_ARCH_UNKNOWN) && (LZO_OS_DOS32 || LZO_OS_OS2) +# error "FIXME - missing define for CPU architecture" +#endif +#if 1 && (LZO_ARCH_UNKNOWN) && (LZO_OS_WIN32) +# error "FIXME - missing LZO_OS_WIN32 define for CPU architecture" +#endif +#if 1 && (LZO_ARCH_UNKNOWN) && (LZO_OS_WIN64) +# error "FIXME - missing LZO_OS_WIN64 define for CPU architecture" +#endif +#if (LZO_OS_OS216 || LZO_OS_WIN16) +# define LZO_ARCH_I086PM 1 +#elif 1 && (LZO_OS_DOS16 && defined(BLX286)) +# define LZO_ARCH_I086PM 1 +#elif 1 && (LZO_OS_DOS16 && defined(DOSX286)) +# define LZO_ARCH_I086PM 1 +#elif 1 && (LZO_OS_DOS16 && LZO_CC_BORLANDC && defined(__DPMI16__)) +# define LZO_ARCH_I086PM 1 +#endif +#if (LZO_ARCH_AMD64 && !LZO_ARCH_X64) +# define LZO_ARCH_X64 1 +#elif (!LZO_ARCH_AMD64 && LZO_ARCH_X64) && defined(__LZO_ARCH_OVERRIDE) +# define LZO_ARCH_AMD64 1 +#endif +#if (LZO_ARCH_ARM64 && !LZO_ARCH_AARCH64) +# define LZO_ARCH_AARCH64 1 +#elif (!LZO_ARCH_ARM64 && LZO_ARCH_AARCH64) && defined(__LZO_ARCH_OVERRIDE) +# define LZO_ARCH_ARM64 1 +#endif +#if (LZO_ARCH_I386 && !LZO_ARCH_X86) +# define LZO_ARCH_X86 1 +#elif (!LZO_ARCH_I386 && LZO_ARCH_X86) && defined(__LZO_ARCH_OVERRIDE) +# define LZO_ARCH_I386 1 +#endif +#if (LZO_ARCH_AMD64 && !LZO_ARCH_X64) || (!LZO_ARCH_AMD64 && LZO_ARCH_X64) +# error "unexpected configuration - check your compiler defines" +#endif +#if (LZO_ARCH_ARM64 && !LZO_ARCH_AARCH64) || (!LZO_ARCH_ARM64 && LZO_ARCH_AARCH64) +# error "unexpected configuration - check your compiler defines" +#endif +#if (LZO_ARCH_I386 && !LZO_ARCH_X86) || (!LZO_ARCH_I386 && LZO_ARCH_X86) +# error "unexpected configuration - check your compiler defines" +#endif +#if (LZO_ARCH_ARM_THUMB && !LZO_ARCH_ARM) +# error "unexpected configuration - check your compiler defines" +#endif +#if (LZO_ARCH_ARM_THUMB1 && !LZO_ARCH_ARM_THUMB) +# error "unexpected configuration - check your compiler defines" +#endif +#if (LZO_ARCH_ARM_THUMB2 && !LZO_ARCH_ARM_THUMB) +# error "unexpected configuration - check your compiler defines" +#endif +#if (LZO_ARCH_ARM_THUMB1 && LZO_ARCH_ARM_THUMB2) +# error "unexpected configuration - check your compiler defines" +#endif +#if (LZO_ARCH_I086PM && !LZO_ARCH_I086) +# error "unexpected configuration - check your compiler defines" +#endif +#if (LZO_ARCH_I086) +# if (UINT_MAX != LZO_0xffffL) +# error "unexpected configuration - check your compiler defines" +# endif +# if (ULONG_MAX != LZO_0xffffffffL) +# error "unexpected configuration - check your compiler defines" +# endif +#endif +#if (LZO_ARCH_I386) +# if (UINT_MAX != LZO_0xffffL) && defined(__i386_int16__) +# error "unexpected configuration - check your compiler defines" +# endif +# if (UINT_MAX != LZO_0xffffffffL) && !defined(__i386_int16__) +# error "unexpected configuration - check your compiler defines" +# endif +# if (ULONG_MAX != LZO_0xffffffffL) +# error "unexpected configuration - check your compiler defines" +# endif +#endif +#if (LZO_ARCH_AMD64 || LZO_ARCH_I386) +# if !defined(LZO_TARGET_FEATURE_SSE2) +# if defined(__SSE2__) +# define LZO_TARGET_FEATURE_SSE2 1 +# elif defined(_MSC_VER) && ((defined(_M_IX86_FP) && ((_M_IX86_FP)+0 >= 2)) || defined(_M_AMD64)) +# define LZO_TARGET_FEATURE_SSE2 1 +# endif +# endif +# if !defined(LZO_TARGET_FEATURE_SSSE3) +# if (LZO_TARGET_FEATURE_SSE2) +# if defined(__SSSE3__) +# define LZO_TARGET_FEATURE_SSSE3 1 +# elif defined(_MSC_VER) && defined(__AVX__) +# define LZO_TARGET_FEATURE_SSSE3 1 +# endif +# endif +# endif +# if !defined(LZO_TARGET_FEATURE_SSE4_2) +# if (LZO_TARGET_FEATURE_SSSE3) +# if defined(__SSE4_2__) +# define LZO_TARGET_FEATURE_SSE4_2 1 +# endif +# endif +# endif +# if !defined(LZO_TARGET_FEATURE_AVX) +# if (LZO_TARGET_FEATURE_SSSE3) +# if defined(__AVX__) +# define LZO_TARGET_FEATURE_AVX 1 +# endif +# endif +# endif +# if !defined(LZO_TARGET_FEATURE_AVX2) +# if (LZO_TARGET_FEATURE_AVX) +# if defined(__AVX2__) +# define LZO_TARGET_FEATURE_AVX2 1 +# endif +# endif +# endif +#endif +#if (LZO_TARGET_FEATURE_SSSE3 && !(LZO_TARGET_FEATURE_SSE2)) +# error "unexpected configuration - check your compiler defines" +#endif +#if (LZO_TARGET_FEATURE_SSE4_2 && !(LZO_TARGET_FEATURE_SSSE3)) +# error "unexpected configuration - check your compiler defines" +#endif +#if (LZO_TARGET_FEATURE_AVX && !(LZO_TARGET_FEATURE_SSSE3)) +# error "unexpected configuration - check your compiler defines" +#endif +#if (LZO_TARGET_FEATURE_AVX2 && !(LZO_TARGET_FEATURE_AVX)) +# error "unexpected configuration - check your compiler defines" +#endif +#if (LZO_ARCH_ARM) +# if !defined(LZO_TARGET_FEATURE_NEON) +# if defined(__ARM_NEON__) +# define LZO_TARGET_FEATURE_NEON 1 +# endif +# endif +#elif (LZO_ARCH_ARM64) +# if !defined(LZO_TARGET_FEATURE_NEON) +# if 1 +# define LZO_TARGET_FEATURE_NEON 1 +# endif +# endif +#endif +#if 0 +#elif !defined(__LZO_MM_OVERRIDE) +#if (LZO_ARCH_I086) +#if (UINT_MAX != LZO_0xffffL) +# error "unexpected configuration - check your compiler defines" +#endif +#if defined(__TINY__) || defined(M_I86TM) || defined(_M_I86TM) +# define LZO_MM_TINY 1 +#elif defined(__HUGE__) || defined(_HUGE_) || defined(M_I86HM) || defined(_M_I86HM) +# define LZO_MM_HUGE 1 +#elif defined(__SMALL__) || defined(M_I86SM) || defined(_M_I86SM) || defined(SMALL_MODEL) +# define LZO_MM_SMALL 1 +#elif defined(__MEDIUM__) || defined(M_I86MM) || defined(_M_I86MM) +# define LZO_MM_MEDIUM 1 +#elif defined(__COMPACT__) || defined(M_I86CM) || defined(_M_I86CM) +# define LZO_MM_COMPACT 1 +#elif defined(__LARGE__) || defined(M_I86LM) || defined(_M_I86LM) || defined(LARGE_MODEL) +# define LZO_MM_LARGE 1 +#elif (LZO_CC_AZTECC) +# if defined(_LARGE_CODE) && defined(_LARGE_DATA) +# define LZO_MM_LARGE 1 +# elif defined(_LARGE_CODE) +# define LZO_MM_MEDIUM 1 +# elif defined(_LARGE_DATA) +# define LZO_MM_COMPACT 1 +# else +# define LZO_MM_SMALL 1 +# endif +#elif (LZO_CC_ZORTECHC && defined(__VCM__)) +# define LZO_MM_LARGE 1 +#else +# error "unknown LZO_ARCH_I086 memory model" +#endif +#if (LZO_OS_DOS16 || LZO_OS_OS216 || LZO_OS_WIN16) +#define LZO_HAVE_MM_HUGE_PTR 1 +#define LZO_HAVE_MM_HUGE_ARRAY 1 +#if (LZO_MM_TINY) +# undef LZO_HAVE_MM_HUGE_ARRAY +#endif +#if (LZO_CC_AZTECC || LZO_CC_PACIFICC || LZO_CC_ZORTECHC) +# undef LZO_HAVE_MM_HUGE_PTR +# undef LZO_HAVE_MM_HUGE_ARRAY +#elif (LZO_CC_DMC || LZO_CC_SYMANTECC) +# undef LZO_HAVE_MM_HUGE_ARRAY +#elif (LZO_CC_MSC && defined(_QC)) +# undef LZO_HAVE_MM_HUGE_ARRAY +# if (_MSC_VER < 600) +# undef LZO_HAVE_MM_HUGE_PTR +# endif +#elif (LZO_CC_TURBOC && (__TURBOC__ < 0x0295)) +# undef LZO_HAVE_MM_HUGE_ARRAY +#endif +#if (LZO_ARCH_I086PM) && !(LZO_HAVE_MM_HUGE_PTR) +# if (LZO_OS_DOS16) +# error "unexpected configuration - check your compiler defines" +# elif (LZO_CC_ZORTECHC) +# else +# error "unexpected configuration - check your compiler defines" +# endif +#endif +#ifdef __cplusplus +extern "C" { +#endif +#if (LZO_CC_BORLANDC && (__BORLANDC__ >= 0x0200)) + extern void __near __cdecl _AHSHIFT(void); +# define LZO_MM_AHSHIFT ((unsigned) _AHSHIFT) +#elif (LZO_CC_DMC || LZO_CC_SYMANTECC || LZO_CC_ZORTECHC) + extern void __near __cdecl _AHSHIFT(void); +# define LZO_MM_AHSHIFT ((unsigned) _AHSHIFT) +#elif (LZO_CC_MSC || LZO_CC_TOPSPEEDC) + extern void __near __cdecl _AHSHIFT(void); +# define LZO_MM_AHSHIFT ((unsigned) _AHSHIFT) +#elif (LZO_CC_TURBOC && (__TURBOC__ >= 0x0295)) + extern void __near __cdecl _AHSHIFT(void); +# define LZO_MM_AHSHIFT ((unsigned) _AHSHIFT) +#elif ((LZO_CC_AZTECC || LZO_CC_PACIFICC || LZO_CC_TURBOC) && LZO_OS_DOS16) +# define LZO_MM_AHSHIFT 12 +#elif (LZO_CC_WATCOMC) + extern unsigned char _HShift; +# define LZO_MM_AHSHIFT ((unsigned) _HShift) +#else +# error "FIXME - implement LZO_MM_AHSHIFT" +#endif +#ifdef __cplusplus +} +#endif +#endif +#elif (LZO_ARCH_C166) +#if !defined(__MODEL__) +# error "FIXME - LZO_ARCH_C166 __MODEL__" +#elif ((__MODEL__) == 0) +# define LZO_MM_SMALL 1 +#elif ((__MODEL__) == 1) +# define LZO_MM_SMALL 1 +#elif ((__MODEL__) == 2) +# define LZO_MM_LARGE 1 +#elif ((__MODEL__) == 3) +# define LZO_MM_TINY 1 +#elif ((__MODEL__) == 4) +# define LZO_MM_XTINY 1 +#elif ((__MODEL__) == 5) +# define LZO_MM_XSMALL 1 +#else +# error "FIXME - LZO_ARCH_C166 __MODEL__" +#endif +#elif (LZO_ARCH_MCS251) +#if !defined(__MODEL__) +# error "FIXME - LZO_ARCH_MCS251 __MODEL__" +#elif ((__MODEL__) == 0) +# define LZO_MM_SMALL 1 +#elif ((__MODEL__) == 2) +# define LZO_MM_LARGE 1 +#elif ((__MODEL__) == 3) +# define LZO_MM_TINY 1 +#elif ((__MODEL__) == 4) +# define LZO_MM_XTINY 1 +#elif ((__MODEL__) == 5) +# define LZO_MM_XSMALL 1 +#else +# error "FIXME - LZO_ARCH_MCS251 __MODEL__" +#endif +#elif (LZO_ARCH_MCS51) +#if !defined(__MODEL__) +# error "FIXME - LZO_ARCH_MCS51 __MODEL__" +#elif ((__MODEL__) == 1) +# define LZO_MM_SMALL 1 +#elif ((__MODEL__) == 2) +# define LZO_MM_LARGE 1 +#elif ((__MODEL__) == 3) +# define LZO_MM_TINY 1 +#elif ((__MODEL__) == 4) +# define LZO_MM_XTINY 1 +#elif ((__MODEL__) == 5) +# define LZO_MM_XSMALL 1 +#else +# error "FIXME - LZO_ARCH_MCS51 __MODEL__" +#endif +#elif (LZO_ARCH_CRAY_PVP) +# define LZO_MM_PVP 1 +#else +# define LZO_MM_FLAT 1 +#endif +#if (LZO_MM_COMPACT) +# define LZO_INFO_MM "compact" +#elif (LZO_MM_FLAT) +# define LZO_INFO_MM "flat" +#elif (LZO_MM_HUGE) +# define LZO_INFO_MM "huge" +#elif (LZO_MM_LARGE) +# define LZO_INFO_MM "large" +#elif (LZO_MM_MEDIUM) +# define LZO_INFO_MM "medium" +#elif (LZO_MM_PVP) +# define LZO_INFO_MM "pvp" +#elif (LZO_MM_SMALL) +# define LZO_INFO_MM "small" +#elif (LZO_MM_TINY) +# define LZO_INFO_MM "tiny" +#else +# error "unknown memory model" +#endif +#endif +#if !defined(__lzo_gnuc_extension__) +#if (LZO_CC_GNUC >= 0x020800ul) +# define __lzo_gnuc_extension__ __extension__ +#elif (LZO_CC_ARMCC_GNUC || LZO_CC_CLANG || LZO_CC_LLVM || LZO_CC_PATHSCALE) +# define __lzo_gnuc_extension__ __extension__ +#elif (LZO_CC_IBMC >= 600) +# define __lzo_gnuc_extension__ __extension__ +#else +#endif +#endif +#if !defined(__lzo_gnuc_extension__) +# define __lzo_gnuc_extension__ /*empty*/ +#endif +#if !defined(LZO_CFG_USE_NEW_STYLE_CASTS) && defined(__cplusplus) && 0 +# if (LZO_CC_GNUC && (LZO_CC_GNUC < 0x020800ul)) +# define LZO_CFG_USE_NEW_STYLE_CASTS 0 +# elif (LZO_CC_INTELC && (__INTEL_COMPILER < 1200)) +# define LZO_CFG_USE_NEW_STYLE_CASTS 0 +# else +# define LZO_CFG_USE_NEW_STYLE_CASTS 1 +# endif +#endif +#if !defined(LZO_CFG_USE_NEW_STYLE_CASTS) +# define LZO_CFG_USE_NEW_STYLE_CASTS 0 +#endif +#if !defined(__cplusplus) +# if defined(LZO_CFG_USE_NEW_STYLE_CASTS) +# undef LZO_CFG_USE_NEW_STYLE_CASTS +# endif +# define LZO_CFG_USE_NEW_STYLE_CASTS 0 +#endif +#if !defined(LZO_REINTERPRET_CAST) +# if (LZO_CFG_USE_NEW_STYLE_CASTS) +# define LZO_REINTERPRET_CAST(t,e) (reinterpret_cast (e)) +# endif +#endif +#if !defined(LZO_REINTERPRET_CAST) +# define LZO_REINTERPRET_CAST(t,e) ((t) (e)) +#endif +#if !defined(LZO_STATIC_CAST) +# if (LZO_CFG_USE_NEW_STYLE_CASTS) +# define LZO_STATIC_CAST(t,e) (static_cast (e)) +# endif +#endif +#if !defined(LZO_STATIC_CAST) +# define LZO_STATIC_CAST(t,e) ((t) (e)) +#endif +#if !defined(LZO_STATIC_CAST2) +# define LZO_STATIC_CAST2(t1,t2,e) LZO_STATIC_CAST(t1, LZO_STATIC_CAST(t2, e)) +#endif +#if !defined(LZO_UNCONST_CAST) +# if (LZO_CFG_USE_NEW_STYLE_CASTS) +# define LZO_UNCONST_CAST(t,e) (const_cast (e)) +# elif (LZO_HAVE_MM_HUGE_PTR) +# define LZO_UNCONST_CAST(t,e) ((t) (e)) +# elif (LZO_CC_ARMCC_GNUC || LZO_CC_CLANG || LZO_CC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE) +# define LZO_UNCONST_CAST(t,e) ((t) ((void *) ((lzo_uintptr_t) ((const void *) (e))))) +# endif +#endif +#if !defined(LZO_UNCONST_CAST) +# define LZO_UNCONST_CAST(t,e) ((t) ((void *) ((const void *) (e)))) +#endif +#if !defined(LZO_UNCONST_VOLATILE_CAST) +# if (LZO_CFG_USE_NEW_STYLE_CASTS) +# define LZO_UNCONST_VOLATILE_CAST(t,e) (const_cast (e)) +# elif (LZO_HAVE_MM_HUGE_PTR) +# define LZO_UNCONST_VOLATILE_CAST(t,e) ((t) (e)) +# elif (LZO_CC_ARMCC_GNUC || LZO_CC_CLANG || LZO_CC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE) +# define LZO_UNCONST_VOLATILE_CAST(t,e) ((t) ((volatile void *) ((lzo_uintptr_t) ((volatile const void *) (e))))) +# endif +#endif +#if !defined(LZO_UNCONST_VOLATILE_CAST) +# define LZO_UNCONST_VOLATILE_CAST(t,e) ((t) ((volatile void *) ((volatile const void *) (e)))) +#endif +#if !defined(LZO_UNVOLATILE_CAST) +# if (LZO_CFG_USE_NEW_STYLE_CASTS) +# define LZO_UNVOLATILE_CAST(t,e) (const_cast (e)) +# elif (LZO_HAVE_MM_HUGE_PTR) +# define LZO_UNVOLATILE_CAST(t,e) ((t) (e)) +# elif (LZO_CC_ARMCC_GNUC || LZO_CC_CLANG || LZO_CC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE) +# define LZO_UNVOLATILE_CAST(t,e) ((t) ((void *) ((lzo_uintptr_t) ((volatile void *) (e))))) +# endif +#endif +#if !defined(LZO_UNVOLATILE_CAST) +# define LZO_UNVOLATILE_CAST(t,e) ((t) ((void *) ((volatile void *) (e)))) +#endif +#if !defined(LZO_UNVOLATILE_CONST_CAST) +# if (LZO_CFG_USE_NEW_STYLE_CASTS) +# define LZO_UNVOLATILE_CONST_CAST(t,e) (const_cast (e)) +# elif (LZO_HAVE_MM_HUGE_PTR) +# define LZO_UNVOLATILE_CONST_CAST(t,e) ((t) (e)) +# elif (LZO_CC_ARMCC_GNUC || LZO_CC_CLANG || LZO_CC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE) +# define LZO_UNVOLATILE_CONST_CAST(t,e) ((t) ((const void *) ((lzo_uintptr_t) ((volatile const void *) (e))))) +# endif +#endif +#if !defined(LZO_UNVOLATILE_CONST_CAST) +# define LZO_UNVOLATILE_CONST_CAST(t,e) ((t) ((const void *) ((volatile const void *) (e)))) +#endif +#if !defined(LZO_PCAST) +# if (LZO_HAVE_MM_HUGE_PTR) +# define LZO_PCAST(t,e) ((t) (e)) +# endif +#endif +#if !defined(LZO_PCAST) +# define LZO_PCAST(t,e) LZO_STATIC_CAST(t, LZO_STATIC_CAST(void *, e)) +#endif +#if !defined(LZO_CCAST) +# if (LZO_HAVE_MM_HUGE_PTR) +# define LZO_CCAST(t,e) ((t) (e)) +# endif +#endif +#if !defined(LZO_CCAST) +# define LZO_CCAST(t,e) LZO_STATIC_CAST(t, LZO_STATIC_CAST(const void *, e)) +#endif +#if !defined(LZO_ICONV) +# define LZO_ICONV(t,e) LZO_STATIC_CAST(t, e) +#endif +#if !defined(LZO_ICAST) +# define LZO_ICAST(t,e) LZO_STATIC_CAST(t, e) +#endif +#if !defined(LZO_ITRUNC) +# define LZO_ITRUNC(t,e) LZO_STATIC_CAST(t, e) +#endif +#if !defined(__lzo_cte) +# if (LZO_CC_MSC || LZO_CC_WATCOMC) +# define __lzo_cte(e) ((void)0,(e)) +# elif 1 +# define __lzo_cte(e) ((void)0,(e)) +# endif +#endif +#if !defined(__lzo_cte) +# define __lzo_cte(e) (e) +#endif +#if !defined(LZO_BLOCK_BEGIN) +# define LZO_BLOCK_BEGIN do { +# define LZO_BLOCK_END } while __lzo_cte(0) +#endif +#if !defined(LZO_UNUSED) +# if (LZO_CC_BORLANDC && (__BORLANDC__ >= 0x0600)) +# define LZO_UNUSED(var) ((void) &var) +# elif (LZO_CC_BORLANDC || LZO_CC_HIGHC || LZO_CC_NDPC || LZO_CC_PELLESC || LZO_CC_TURBOC) +# define LZO_UNUSED(var) if (&var) ; else +# elif (LZO_CC_CLANG && (LZO_CC_CLANG >= 0x030200ul)) +# define LZO_UNUSED(var) ((void) &var) +# elif (LZO_CC_CLANG || LZO_CC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE) +# define LZO_UNUSED(var) ((void) var) +# elif (LZO_CC_MSC && (_MSC_VER < 900)) +# define LZO_UNUSED(var) if (&var) ; else +# elif (LZO_CC_KEILC) +# define LZO_UNUSED(var) {LZO_EXTERN_C int lzo_unused__[1-2*!(sizeof(var)>0)];} +# elif (LZO_CC_PACIFICC) +# define LZO_UNUSED(var) ((void) sizeof(var)) +# elif (LZO_CC_WATCOMC) && defined(__cplusplus) +# define LZO_UNUSED(var) ((void) var) +# else +# define LZO_UNUSED(var) ((void) &var) +# endif +#endif +#if !defined(LZO_UNUSED_FUNC) +# if (LZO_CC_BORLANDC && (__BORLANDC__ >= 0x0600)) +# define LZO_UNUSED_FUNC(func) ((void) func) +# elif (LZO_CC_BORLANDC || LZO_CC_NDPC || LZO_CC_TURBOC) +# define LZO_UNUSED_FUNC(func) if (func) ; else +# elif (LZO_CC_CLANG || LZO_CC_LLVM) +# define LZO_UNUSED_FUNC(func) ((void) &func) +# elif (LZO_CC_MSC && (_MSC_VER < 900)) +# define LZO_UNUSED_FUNC(func) if (func) ; else +# elif (LZO_CC_MSC) +# define LZO_UNUSED_FUNC(func) ((void) &func) +# elif (LZO_CC_KEILC || LZO_CC_PELLESC) +# define LZO_UNUSED_FUNC(func) {LZO_EXTERN_C int lzo_unused_func__[1-2*!(sizeof((int)func)>0)];} +# else +# define LZO_UNUSED_FUNC(func) ((void) func) +# endif +#endif +#if !defined(LZO_UNUSED_LABEL) +# if (LZO_CC_CLANG >= 0x020800ul) +# define LZO_UNUSED_LABEL(l) (__lzo_gnuc_extension__ ((void) ((const void *) &&l))) +# elif (LZO_CC_ARMCC || LZO_CC_CLANG || LZO_CC_INTELC || LZO_CC_WATCOMC) +# define LZO_UNUSED_LABEL(l) if __lzo_cte(0) goto l +# else +# define LZO_UNUSED_LABEL(l) switch (0) case 1:goto l +# endif +#endif +#if !defined(LZO_DEFINE_UNINITIALIZED_VAR) +# if 0 +# define LZO_DEFINE_UNINITIALIZED_VAR(type,var,init) type var +# elif 0 && (LZO_CC_GNUC) +# define LZO_DEFINE_UNINITIALIZED_VAR(type,var,init) type var = var +# else +# define LZO_DEFINE_UNINITIALIZED_VAR(type,var,init) type var = init +# endif +#endif +#if !defined(__lzo_inline) +#if (LZO_CC_TURBOC && (__TURBOC__ <= 0x0295)) +#elif defined(__cplusplus) +# define __lzo_inline inline +#elif defined(__STDC_VERSION__) && (__STDC_VERSION__-0 >= 199901L) +# define __lzo_inline inline +#elif (LZO_CC_BORLANDC && (__BORLANDC__ >= 0x0550)) +# define __lzo_inline __inline +#elif (LZO_CC_ARMCC_GNUC || LZO_CC_CILLY || LZO_CC_CLANG || LZO_CC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE || LZO_CC_PGI) +# define __lzo_inline __inline__ +#elif (LZO_CC_DMC) +# define __lzo_inline __inline +#elif (LZO_CC_GHS) +# define __lzo_inline __inline__ +#elif (LZO_CC_IBMC >= 600) +# define __lzo_inline __inline__ +#elif (LZO_CC_INTELC) +# define __lzo_inline __inline +#elif (LZO_CC_MWERKS && (__MWERKS__ >= 0x2405)) +# define __lzo_inline __inline +#elif (LZO_CC_MSC && (_MSC_VER >= 900)) +# define __lzo_inline __inline +#elif (LZO_CC_SUNPROC >= 0x5100) +# define __lzo_inline __inline__ +#endif +#endif +#if defined(__lzo_inline) +# ifndef __lzo_HAVE_inline +# define __lzo_HAVE_inline 1 +# endif +#else +# define __lzo_inline /*empty*/ +#endif +#if !defined(__lzo_forceinline) +#if (LZO_CC_GNUC >= 0x030200ul) +# define __lzo_forceinline __inline__ __attribute__((__always_inline__)) +#elif (LZO_CC_IBMC >= 700) +# define __lzo_forceinline __inline__ __attribute__((__always_inline__)) +#elif (LZO_CC_INTELC_MSC && (__INTEL_COMPILER >= 450)) +# define __lzo_forceinline __forceinline +#elif (LZO_CC_INTELC_GNUC && (__INTEL_COMPILER >= 800)) +# define __lzo_forceinline __inline__ __attribute__((__always_inline__)) +#elif (LZO_CC_ARMCC_GNUC || LZO_CC_CLANG || LZO_CC_LLVM || LZO_CC_PATHSCALE) +# define __lzo_forceinline __inline__ __attribute__((__always_inline__)) +#elif (LZO_CC_MSC && (_MSC_VER >= 1200)) +# define __lzo_forceinline __forceinline +#elif (LZO_CC_PGI >= 0x0d0a00ul) +# define __lzo_forceinline __inline__ __attribute__((__always_inline__)) +#elif (LZO_CC_SUNPROC >= 0x5100) +# define __lzo_forceinline __inline__ __attribute__((__always_inline__)) +#endif +#endif +#if defined(__lzo_forceinline) +# ifndef __lzo_HAVE_forceinline +# define __lzo_HAVE_forceinline 1 +# endif +#else +# define __lzo_forceinline __lzo_inline +#endif +#if !defined(__lzo_noinline) +#if 1 && (LZO_ARCH_I386) && (LZO_CC_GNUC >= 0x040000ul) && (LZO_CC_GNUC < 0x040003ul) +# define __lzo_noinline __attribute__((__noinline__,__used__)) +#elif (LZO_CC_GNUC >= 0x030200ul) +# define __lzo_noinline __attribute__((__noinline__)) +#elif (LZO_CC_IBMC >= 700) +# define __lzo_noinline __attribute__((__noinline__)) +#elif (LZO_CC_INTELC_MSC && (__INTEL_COMPILER >= 600)) +# define __lzo_noinline __declspec(noinline) +#elif (LZO_CC_INTELC_GNUC && (__INTEL_COMPILER >= 800)) +# define __lzo_noinline __attribute__((__noinline__)) +#elif (LZO_CC_ARMCC_GNUC || LZO_CC_CLANG || LZO_CC_LLVM || LZO_CC_PATHSCALE) +# define __lzo_noinline __attribute__((__noinline__)) +#elif (LZO_CC_MSC && (_MSC_VER >= 1300)) +# define __lzo_noinline __declspec(noinline) +#elif (LZO_CC_MWERKS && (__MWERKS__ >= 0x3200) && (LZO_OS_WIN32 || LZO_OS_WIN64)) +# if defined(__cplusplus) +# else +# define __lzo_noinline __declspec(noinline) +# endif +#elif (LZO_CC_PGI >= 0x0d0a00ul) +# define __lzo_noinline __attribute__((__noinline__)) +#elif (LZO_CC_SUNPROC >= 0x5100) +# define __lzo_noinline __attribute__((__noinline__)) +#endif +#endif +#if defined(__lzo_noinline) +# ifndef __lzo_HAVE_noinline +# define __lzo_HAVE_noinline 1 +# endif +#else +# define __lzo_noinline /*empty*/ +#endif +#if (__lzo_HAVE_forceinline || __lzo_HAVE_noinline) && !(__lzo_HAVE_inline) +# error "unexpected configuration - check your compiler defines" +#endif +#if !defined(__lzo_static_inline) +#if (LZO_CC_IBMC) +# define __lzo_static_inline __lzo_gnuc_extension__ static __lzo_inline +#endif +#endif +#if !defined(__lzo_static_inline) +# define __lzo_static_inline static __lzo_inline +#endif +#if !defined(__lzo_static_forceinline) +#if (LZO_CC_IBMC) +# define __lzo_static_forceinline __lzo_gnuc_extension__ static __lzo_forceinline +#endif +#endif +#if !defined(__lzo_static_forceinline) +# define __lzo_static_forceinline static __lzo_forceinline +#endif +#if !defined(__lzo_static_noinline) +#if (LZO_CC_IBMC) +# define __lzo_static_noinline __lzo_gnuc_extension__ static __lzo_noinline +#endif +#endif +#if !defined(__lzo_static_noinline) +# define __lzo_static_noinline static __lzo_noinline +#endif +#if !defined(__lzo_c99_extern_inline) +#if defined(__GNUC_GNU_INLINE__) +# define __lzo_c99_extern_inline __lzo_inline +#elif defined(__GNUC_STDC_INLINE__) +# define __lzo_c99_extern_inline extern __lzo_inline +#elif defined(__STDC_VERSION__) && (__STDC_VERSION__-0 >= 199901L) +# define __lzo_c99_extern_inline extern __lzo_inline +#endif +#if !defined(__lzo_c99_extern_inline) && (__lzo_HAVE_inline) +# define __lzo_c99_extern_inline __lzo_inline +#endif +#endif +#if defined(__lzo_c99_extern_inline) +# ifndef __lzo_HAVE_c99_extern_inline +# define __lzo_HAVE_c99_extern_inline 1 +# endif +#else +# define __lzo_c99_extern_inline /*empty*/ +#endif +#if !defined(__lzo_may_alias) +#if (LZO_CC_GNUC >= 0x030400ul) +# define __lzo_may_alias __attribute__((__may_alias__)) +#elif (LZO_CC_CLANG >= 0x020900ul) +# define __lzo_may_alias __attribute__((__may_alias__)) +#elif (LZO_CC_INTELC_GNUC && (__INTEL_COMPILER >= 1210)) && 0 +# define __lzo_may_alias __attribute__((__may_alias__)) +#elif (LZO_CC_PGI >= 0x0d0a00ul) && 0 +# define __lzo_may_alias __attribute__((__may_alias__)) +#endif +#endif +#if defined(__lzo_may_alias) +# ifndef __lzo_HAVE_may_alias +# define __lzo_HAVE_may_alias 1 +# endif +#else +# define __lzo_may_alias /*empty*/ +#endif +#if !defined(__lzo_noreturn) +#if (LZO_CC_GNUC >= 0x020700ul) +# define __lzo_noreturn __attribute__((__noreturn__)) +#elif (LZO_CC_IBMC >= 700) +# define __lzo_noreturn __attribute__((__noreturn__)) +#elif (LZO_CC_INTELC_MSC && (__INTEL_COMPILER >= 450)) +# define __lzo_noreturn __declspec(noreturn) +#elif (LZO_CC_INTELC_GNUC && (__INTEL_COMPILER >= 600)) +# define __lzo_noreturn __attribute__((__noreturn__)) +#elif (LZO_CC_ARMCC_GNUC || LZO_CC_CLANG || LZO_CC_LLVM || LZO_CC_PATHSCALE) +# define __lzo_noreturn __attribute__((__noreturn__)) +#elif (LZO_CC_MSC && (_MSC_VER >= 1200)) +# define __lzo_noreturn __declspec(noreturn) +#elif (LZO_CC_PGI >= 0x0d0a00ul) +# define __lzo_noreturn __attribute__((__noreturn__)) +#endif +#endif +#if defined(__lzo_noreturn) +# ifndef __lzo_HAVE_noreturn +# define __lzo_HAVE_noreturn 1 +# endif +#else +# define __lzo_noreturn /*empty*/ +#endif +#if !defined(__lzo_nothrow) +#if (LZO_CC_GNUC >= 0x030300ul) +# define __lzo_nothrow __attribute__((__nothrow__)) +#elif (LZO_CC_INTELC_MSC && (__INTEL_COMPILER >= 450)) && defined(__cplusplus) +# define __lzo_nothrow __declspec(nothrow) +#elif (LZO_CC_INTELC_GNUC && (__INTEL_COMPILER >= 900)) +# define __lzo_nothrow __attribute__((__nothrow__)) +#elif (LZO_CC_ARMCC_GNUC || LZO_CC_CLANG || LZO_CC_LLVM || LZO_CC_PATHSCALE) +# define __lzo_nothrow __attribute__((__nothrow__)) +#elif (LZO_CC_MSC && (_MSC_VER >= 1200)) && defined(__cplusplus) +# define __lzo_nothrow __declspec(nothrow) +#endif +#endif +#if defined(__lzo_nothrow) +# ifndef __lzo_HAVE_nothrow +# define __lzo_HAVE_nothrow 1 +# endif +#else +# define __lzo_nothrow /*empty*/ +#endif +#if !defined(__lzo_restrict) +#if (LZO_CC_GNUC >= 0x030400ul) +# define __lzo_restrict __restrict__ +#elif (LZO_CC_IBMC >= 800) && !defined(__cplusplus) +# define __lzo_restrict __restrict__ +#elif (LZO_CC_IBMC >= 1210) +# define __lzo_restrict __restrict__ +#elif (LZO_CC_INTELC_MSC && (__INTEL_COMPILER >= 600)) +#elif (LZO_CC_INTELC_GNUC && (__INTEL_COMPILER >= 600)) +# define __lzo_restrict __restrict__ +#elif (LZO_CC_ARMCC_GNUC || LZO_CC_CLANG || LZO_CC_LLVM) +# define __lzo_restrict __restrict__ +#elif (LZO_CC_MSC && (_MSC_VER >= 1400)) +# define __lzo_restrict __restrict +#elif (LZO_CC_PGI >= 0x0d0a00ul) +# define __lzo_restrict __restrict__ +#endif +#endif +#if defined(__lzo_restrict) +# ifndef __lzo_HAVE_restrict +# define __lzo_HAVE_restrict 1 +# endif +#else +# define __lzo_restrict /*empty*/ +#endif +#if !defined(__lzo_alignof) +#if (LZO_CC_ARMCC || LZO_CC_CILLY || LZO_CC_CLANG || LZO_CC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE || LZO_CC_PGI) +# define __lzo_alignof(e) __alignof__(e) +#elif (LZO_CC_GHS) && !defined(__cplusplus) +# define __lzo_alignof(e) __alignof__(e) +#elif (LZO_CC_IBMC >= 600) +# define __lzo_alignof(e) (__lzo_gnuc_extension__ __alignof__(e)) +#elif (LZO_CC_INTELC && (__INTEL_COMPILER >= 700)) +# define __lzo_alignof(e) __alignof__(e) +#elif (LZO_CC_MSC && (_MSC_VER >= 1300)) +# define __lzo_alignof(e) __alignof(e) +#elif (LZO_CC_SUNPROC >= 0x5100) +# define __lzo_alignof(e) __alignof__(e) +#endif +#endif +#if defined(__lzo_alignof) +# ifndef __lzo_HAVE_alignof +# define __lzo_HAVE_alignof 1 +# endif +#endif +#if !defined(__lzo_struct_packed) +#if (LZO_CC_CLANG && (LZO_CC_CLANG < 0x020800ul)) && defined(__cplusplus) +#elif (LZO_CC_GNUC && (LZO_CC_GNUC < 0x020700ul)) +#elif (LZO_CC_GNUC && (LZO_CC_GNUC < 0x020800ul)) && defined(__cplusplus) +#elif (LZO_CC_PCC && (LZO_CC_PCC < 0x010100ul)) +#elif (LZO_CC_SUNPROC && (LZO_CC_SUNPROC < 0x5110)) && !defined(__cplusplus) +#elif (LZO_CC_GNUC >= 0x030400ul) && !(LZO_CC_PCC_GNUC) && (LZO_ARCH_AMD64 || LZO_ARCH_I386) +# define __lzo_struct_packed(s) struct s { +# define __lzo_struct_packed_end() } __attribute__((__gcc_struct__,__packed__)); +# define __lzo_struct_packed_ma_end() } __lzo_may_alias __attribute__((__gcc_struct__,__packed__)); +#elif (LZO_CC_ARMCC || LZO_CC_CLANG || LZO_CC_GNUC || LZO_CC_INTELC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE || (LZO_CC_PGI >= 0x0d0a00ul) || (LZO_CC_SUNPROC >= 0x5100)) +# define __lzo_struct_packed(s) struct s { +# define __lzo_struct_packed_end() } __attribute__((__packed__)); +# define __lzo_struct_packed_ma_end() } __lzo_may_alias __attribute__((__packed__)); +#elif (LZO_CC_IBMC >= 700) +# define __lzo_struct_packed(s) __lzo_gnuc_extension__ struct s { +# define __lzo_struct_packed_end() } __attribute__((__packed__)); +# define __lzo_struct_packed_ma_end() } __lzo_may_alias __attribute__((__packed__)); +#elif (LZO_CC_INTELC_MSC) || (LZO_CC_MSC && (_MSC_VER >= 1300)) +# define __lzo_struct_packed(s) __pragma(pack(push,1)) struct s { +# define __lzo_struct_packed_end() } __pragma(pack(pop)); +#elif (LZO_CC_WATCOMC && (__WATCOMC__ >= 900)) +# define __lzo_struct_packed(s) _Packed struct s { +# define __lzo_struct_packed_end() }; +#endif +#endif +#if defined(__lzo_struct_packed) && !defined(__lzo_struct_packed_ma) +# define __lzo_struct_packed_ma(s) __lzo_struct_packed(s) +#endif +#if defined(__lzo_struct_packed_end) && !defined(__lzo_struct_packed_ma_end) +# define __lzo_struct_packed_ma_end() __lzo_struct_packed_end() +#endif +#if !defined(__lzo_byte_struct) +#if defined(__lzo_struct_packed) +# define __lzo_byte_struct(s,n) __lzo_struct_packed(s) unsigned char a[n]; __lzo_struct_packed_end() +# define __lzo_byte_struct_ma(s,n) __lzo_struct_packed_ma(s) unsigned char a[n]; __lzo_struct_packed_ma_end() +#elif (LZO_CC_CILLY || LZO_CC_CLANG || LZO_CC_PGI || (LZO_CC_SUNPROC >= 0x5100)) +# define __lzo_byte_struct(s,n) struct s { unsigned char a[n]; } __attribute__((__packed__)); +# define __lzo_byte_struct_ma(s,n) struct s { unsigned char a[n]; } __lzo_may_alias __attribute__((__packed__)); +#endif +#endif +#if defined(__lzo_byte_struct) && !defined(__lzo_byte_struct_ma) +# define __lzo_byte_struct_ma(s,n) __lzo_byte_struct(s,n) +#endif +#if !defined(__lzo_struct_align16) && (__lzo_HAVE_alignof) +#if (LZO_CC_GNUC && (LZO_CC_GNUC < 0x030000ul)) +#elif (LZO_CC_CLANG && (LZO_CC_CLANG < 0x020800ul)) && defined(__cplusplus) +#elif (LZO_CC_CILLY || LZO_CC_PCC) +#elif (LZO_CC_INTELC_MSC) || (LZO_CC_MSC && (_MSC_VER >= 1300)) +# define __lzo_struct_align16(s) struct __declspec(align(16)) s { +# define __lzo_struct_align16_end() }; +# define __lzo_struct_align32(s) struct __declspec(align(32)) s { +# define __lzo_struct_align32_end() }; +# define __lzo_struct_align64(s) struct __declspec(align(64)) s { +# define __lzo_struct_align64_end() }; +#elif (LZO_CC_ARMCC || LZO_CC_CLANG || LZO_CC_GNUC || (LZO_CC_IBMC >= 700) || LZO_CC_INTELC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE) +# define __lzo_struct_align16(s) struct s { +# define __lzo_struct_align16_end() } __attribute__((__aligned__(16))); +# define __lzo_struct_align32(s) struct s { +# define __lzo_struct_align32_end() } __attribute__((__aligned__(32))); +# define __lzo_struct_align64(s) struct s { +# define __lzo_struct_align64_end() } __attribute__((__aligned__(64))); +#endif +#endif +#if !defined(__lzo_union_um) +#if (LZO_CC_CLANG && (LZO_CC_CLANG < 0x020800ul)) && defined(__cplusplus) +#elif (LZO_CC_GNUC && (LZO_CC_GNUC < 0x020700ul)) +#elif (LZO_CC_GNUC && (LZO_CC_GNUC < 0x020800ul)) && defined(__cplusplus) +#elif (LZO_CC_INTELC_GNUC && (__INTEL_COMPILER < 810)) +#elif (LZO_CC_PCC && (LZO_CC_PCC < 0x010100ul)) +#elif (LZO_CC_SUNPROC && (LZO_CC_SUNPROC < 0x5110)) && !defined(__cplusplus) +#elif (LZO_CC_ARMCC || LZO_CC_CLANG || LZO_CC_GNUC || LZO_CC_INTELC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE || (LZO_CC_PGI >= 0x0d0a00ul) || (LZO_CC_SUNPROC >= 0x5100)) +# define __lzo_union_am(s) union s { +# define __lzo_union_am_end() } __lzo_may_alias; +# define __lzo_union_um(s) union s { +# define __lzo_union_um_end() } __lzo_may_alias __attribute__((__packed__)); +#elif (LZO_CC_IBMC >= 700) +# define __lzo_union_am(s) __lzo_gnuc_extension__ union s { +# define __lzo_union_am_end() } __lzo_may_alias; +# define __lzo_union_um(s) __lzo_gnuc_extension__ union s { +# define __lzo_union_um_end() } __lzo_may_alias __attribute__((__packed__)); +#elif (LZO_CC_INTELC_MSC) || (LZO_CC_MSC && (_MSC_VER >= 1300)) +# define __lzo_union_um(s) __pragma(pack(push,1)) union s { +# define __lzo_union_um_end() } __pragma(pack(pop)); +#elif (LZO_CC_WATCOMC && (__WATCOMC__ >= 900)) +# define __lzo_union_um(s) _Packed union s { +# define __lzo_union_um_end() }; +#endif +#endif +#if !defined(__lzo_union_am) +# define __lzo_union_am(s) union s { +# define __lzo_union_am_end() }; +#endif +#if !defined(__lzo_constructor) +#if (LZO_CC_GNUC >= 0x030400ul) +# define __lzo_constructor __attribute__((__constructor__,__used__)) +#elif (LZO_CC_GNUC >= 0x020700ul) +# define __lzo_constructor __attribute__((__constructor__)) +#elif (LZO_CC_INTELC_GNUC && (__INTEL_COMPILER >= 800)) +# define __lzo_constructor __attribute__((__constructor__,__used__)) +#elif (LZO_CC_ARMCC_GNUC || LZO_CC_CLANG || LZO_CC_LLVM || LZO_CC_PATHSCALE) +# define __lzo_constructor __attribute__((__constructor__)) +#endif +#endif +#if defined(__lzo_constructor) +# ifndef __lzo_HAVE_constructor +# define __lzo_HAVE_constructor 1 +# endif +#endif +#if !defined(__lzo_destructor) +#if (LZO_CC_GNUC >= 0x030400ul) +# define __lzo_destructor __attribute__((__destructor__,__used__)) +#elif (LZO_CC_GNUC >= 0x020700ul) +# define __lzo_destructor __attribute__((__destructor__)) +#elif (LZO_CC_INTELC_GNUC && (__INTEL_COMPILER >= 800)) +# define __lzo_destructor __attribute__((__destructor__,__used__)) +#elif (LZO_CC_ARMCC_GNUC || LZO_CC_CLANG || LZO_CC_LLVM || LZO_CC_PATHSCALE) +# define __lzo_destructor __attribute__((__destructor__)) +#endif +#endif +#if defined(__lzo_destructor) +# ifndef __lzo_HAVE_destructor +# define __lzo_HAVE_destructor 1 +# endif +#endif +#if (__lzo_HAVE_destructor) && !(__lzo_HAVE_constructor) +# error "unexpected configuration - check your compiler defines" +#endif +#if !defined(__lzo_likely) && !defined(__lzo_unlikely) +#if (LZO_CC_GNUC >= 0x030200ul) +# define __lzo_likely(e) (__builtin_expect(!!(e),1)) +# define __lzo_unlikely(e) (__builtin_expect(!!(e),0)) +#elif (LZO_CC_IBMC >= 1010) +# define __lzo_likely(e) (__builtin_expect(!!(e),1)) +# define __lzo_unlikely(e) (__builtin_expect(!!(e),0)) +#elif (LZO_CC_INTELC && (__INTEL_COMPILER >= 800)) +# define __lzo_likely(e) (__builtin_expect(!!(e),1)) +# define __lzo_unlikely(e) (__builtin_expect(!!(e),0)) +#elif (LZO_CC_ARMCC_GNUC || LZO_CC_CLANG || LZO_CC_LLVM || LZO_CC_PATHSCALE) +# define __lzo_likely(e) (__builtin_expect(!!(e),1)) +# define __lzo_unlikely(e) (__builtin_expect(!!(e),0)) +#endif +#endif +#if defined(__lzo_likely) +# ifndef __lzo_HAVE_likely +# define __lzo_HAVE_likely 1 +# endif +#else +# define __lzo_likely(e) (e) +#endif +#if defined(__lzo_unlikely) +# ifndef __lzo_HAVE_unlikely +# define __lzo_HAVE_unlikely 1 +# endif +#else +# define __lzo_unlikely(e) (e) +#endif +#if !defined(__lzo_static_unused_void_func) +# if 1 && (LZO_CC_ARMCC_GNUC || LZO_CC_CLANG || (LZO_CC_GNUC >= 0x020700ul) || LZO_CC_INTELC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE || LZO_CC_PGI) +# define __lzo_static_unused_void_func(f) static void __attribute__((__unused__)) f(void) +# else +# define __lzo_static_unused_void_func(f) static __lzo_inline void f(void) +# endif +#endif +#if !defined(__lzo_loop_forever) +# if (LZO_CC_IBMC) +# define __lzo_loop_forever() LZO_BLOCK_BEGIN for (;;) { ; } LZO_BLOCK_END +# else +# define __lzo_loop_forever() do { ; } while __lzo_cte(1) +# endif +#endif +#if !defined(__lzo_unreachable) +#if (LZO_CC_CLANG && (LZO_CC_CLANG >= 0x020800ul)) +# define __lzo_unreachable() __builtin_unreachable(); +#elif (LZO_CC_GNUC >= 0x040500ul) +# define __lzo_unreachable() __builtin_unreachable(); +#elif (LZO_CC_INTELC_GNUC && (__INTEL_COMPILER >= 1300)) && 1 +# define __lzo_unreachable() __builtin_unreachable(); +#endif +#endif +#if defined(__lzo_unreachable) +# ifndef __lzo_HAVE_unreachable +# define __lzo_HAVE_unreachable 1 +# endif +#else +# if 0 +# define __lzo_unreachable() ((void)0); +# else +# define __lzo_unreachable() __lzo_loop_forever(); +# endif +#endif +#ifndef __LZO_CTA_NAME +#if (LZO_CFG_USE_COUNTER) +# define __LZO_CTA_NAME(a) LZO_PP_ECONCAT2(a,__COUNTER__) +#else +# define __LZO_CTA_NAME(a) LZO_PP_ECONCAT2(a,__LINE__) +#endif +#endif +#if !defined(LZO_COMPILE_TIME_ASSERT_HEADER) +# if (LZO_CC_AZTECC || LZO_CC_ZORTECHC) +# define LZO_COMPILE_TIME_ASSERT_HEADER(e) LZO_EXTERN_C_BEGIN extern int __LZO_CTA_NAME(lzo_cta__)[1-!(e)]; LZO_EXTERN_C_END +# elif (LZO_CC_DMC || LZO_CC_SYMANTECC) +# define LZO_COMPILE_TIME_ASSERT_HEADER(e) LZO_EXTERN_C_BEGIN extern int __LZO_CTA_NAME(lzo_cta__)[1u-2*!(e)]; LZO_EXTERN_C_END +# elif (LZO_CC_TURBOC && (__TURBOC__ == 0x0295)) +# define LZO_COMPILE_TIME_ASSERT_HEADER(e) LZO_EXTERN_C_BEGIN extern int __LZO_CTA_NAME(lzo_cta__)[1-!(e)]; LZO_EXTERN_C_END +# elif (LZO_CC_CLANG && (LZO_CC_CLANG < 0x020900ul)) && defined(__cplusplus) +# define LZO_COMPILE_TIME_ASSERT_HEADER(e) LZO_EXTERN_C_BEGIN int __LZO_CTA_NAME(lzo_cta_f__)(int [1-2*!(e)]); LZO_EXTERN_C_END +# elif (LZO_CC_GNUC) && defined(__CHECKER__) && defined(__SPARSE_CHECKER__) +# define LZO_COMPILE_TIME_ASSERT_HEADER(e) LZO_EXTERN_C_BEGIN enum {__LZO_CTA_NAME(lzo_cta_e__)=1/!!(e)} __attribute__((__unused__)); LZO_EXTERN_C_END +# else +# define LZO_COMPILE_TIME_ASSERT_HEADER(e) LZO_EXTERN_C_BEGIN extern int __LZO_CTA_NAME(lzo_cta__)[1-2*!(e)]; LZO_EXTERN_C_END +# endif +#endif +#if !defined(LZO_COMPILE_TIME_ASSERT) +# if (LZO_CC_AZTECC) +# define LZO_COMPILE_TIME_ASSERT(e) {typedef int __LZO_CTA_NAME(lzo_cta_t__)[1-!(e)];} +# elif (LZO_CC_DMC || LZO_CC_PACIFICC || LZO_CC_SYMANTECC || LZO_CC_ZORTECHC) +# define LZO_COMPILE_TIME_ASSERT(e) switch(0) case 1:case !(e):break; +# elif (LZO_CC_GNUC) && defined(__CHECKER__) && defined(__SPARSE_CHECKER__) +# define LZO_COMPILE_TIME_ASSERT(e) {(void) (0/!!(e));} +# elif (LZO_CC_GNUC >= 0x040700ul) && (LZO_CFG_USE_COUNTER) && defined(__cplusplus) +# define LZO_COMPILE_TIME_ASSERT(e) {enum {__LZO_CTA_NAME(lzo_cta_e__)=1/!!(e)} __attribute__((__unused__));} +# elif (LZO_CC_GNUC >= 0x040700ul) +# define LZO_COMPILE_TIME_ASSERT(e) {typedef int __LZO_CTA_NAME(lzo_cta_t__)[1-2*!(e)] __attribute__((__unused__));} +# elif (LZO_CC_MSC && (_MSC_VER < 900)) +# define LZO_COMPILE_TIME_ASSERT(e) switch(0) case 1:case !(e):break; +# elif (LZO_CC_TURBOC && (__TURBOC__ == 0x0295)) +# define LZO_COMPILE_TIME_ASSERT(e) switch(0) case 1:case !(e):break; +# else +# define LZO_COMPILE_TIME_ASSERT(e) {typedef int __LZO_CTA_NAME(lzo_cta_t__)[1-2*!(e)];} +# endif +#endif +LZO_COMPILE_TIME_ASSERT_HEADER(1 == 1) +#if defined(__cplusplus) +extern "C" { LZO_COMPILE_TIME_ASSERT_HEADER(2 == 2) } +#endif +LZO_COMPILE_TIME_ASSERT_HEADER(3 == 3) +#if (LZO_ARCH_I086 || LZO_ARCH_I386) && (LZO_OS_DOS16 || LZO_OS_DOS32 || LZO_OS_OS2 || LZO_OS_OS216 || LZO_OS_WIN16 || LZO_OS_WIN32 || LZO_OS_WIN64) +# if (LZO_CC_GNUC || LZO_CC_HIGHC || LZO_CC_NDPC || LZO_CC_PACIFICC) +# elif (LZO_CC_DMC || LZO_CC_SYMANTECC || LZO_CC_ZORTECHC) +# define __lzo_cdecl __cdecl +# define __lzo_cdecl_atexit /*empty*/ +# define __lzo_cdecl_main __cdecl +# if (LZO_OS_OS2 && (LZO_CC_DMC || LZO_CC_SYMANTECC)) +# define __lzo_cdecl_qsort __pascal +# elif (LZO_OS_OS2 && (LZO_CC_ZORTECHC)) +# define __lzo_cdecl_qsort _stdcall +# else +# define __lzo_cdecl_qsort __cdecl +# endif +# elif (LZO_CC_WATCOMC) +# define __lzo_cdecl __cdecl +# else +# define __lzo_cdecl __cdecl +# define __lzo_cdecl_atexit __cdecl +# define __lzo_cdecl_main __cdecl +# define __lzo_cdecl_qsort __cdecl +# endif +# if (LZO_CC_GNUC || LZO_CC_HIGHC || LZO_CC_NDPC || LZO_CC_PACIFICC || LZO_CC_WATCOMC) +# elif (LZO_OS_OS2 && (LZO_CC_DMC || LZO_CC_SYMANTECC)) +# define __lzo_cdecl_sighandler __pascal +# elif (LZO_OS_OS2 && (LZO_CC_ZORTECHC)) +# define __lzo_cdecl_sighandler _stdcall +# elif (LZO_CC_MSC && (_MSC_VER >= 1400)) && defined(_M_CEE_PURE) +# define __lzo_cdecl_sighandler __clrcall +# elif (LZO_CC_MSC && (_MSC_VER >= 600 && _MSC_VER < 700)) +# if defined(_DLL) +# define __lzo_cdecl_sighandler _far _cdecl _loadds +# elif defined(_MT) +# define __lzo_cdecl_sighandler _far _cdecl +# else +# define __lzo_cdecl_sighandler _cdecl +# endif +# else +# define __lzo_cdecl_sighandler __cdecl +# endif +#elif (LZO_ARCH_I386) && (LZO_CC_WATCOMC) +# define __lzo_cdecl __cdecl +#elif (LZO_ARCH_M68K && LZO_OS_TOS && (LZO_CC_PUREC || LZO_CC_TURBOC)) +# define __lzo_cdecl cdecl +#endif +#if !defined(__lzo_cdecl) +# define __lzo_cdecl /*empty*/ +#endif +#if !defined(__lzo_cdecl_atexit) +# define __lzo_cdecl_atexit /*empty*/ +#endif +#if !defined(__lzo_cdecl_main) +# define __lzo_cdecl_main /*empty*/ +#endif +#if !defined(__lzo_cdecl_qsort) +# define __lzo_cdecl_qsort /*empty*/ +#endif +#if !defined(__lzo_cdecl_sighandler) +# define __lzo_cdecl_sighandler /*empty*/ +#endif +#if !defined(__lzo_cdecl_va) +# define __lzo_cdecl_va __lzo_cdecl +#endif +#if !(LZO_CFG_NO_WINDOWS_H) +#if !defined(LZO_HAVE_WINDOWS_H) +#if (LZO_OS_CYGWIN || (LZO_OS_EMX && defined(__RSXNT__)) || LZO_OS_WIN32 || LZO_OS_WIN64) +# if (LZO_CC_WATCOMC && (__WATCOMC__ < 1000)) +# elif (LZO_OS_WIN32 && LZO_CC_GNUC) && defined(__PW32__) +# elif ((LZO_OS_CYGWIN || defined(__MINGW32__)) && (LZO_CC_GNUC && (LZO_CC_GNUC < 0x025f00ul))) +# else +# define LZO_HAVE_WINDOWS_H 1 +# endif +#endif +#endif +#endif +#ifndef LZO_SIZEOF_SHORT +#if defined(SIZEOF_SHORT) +# define LZO_SIZEOF_SHORT (SIZEOF_SHORT) +#elif defined(__SIZEOF_SHORT__) +# define LZO_SIZEOF_SHORT (__SIZEOF_SHORT__) +#endif +#endif +#ifndef LZO_SIZEOF_INT +#if defined(SIZEOF_INT) +# define LZO_SIZEOF_INT (SIZEOF_INT) +#elif defined(__SIZEOF_INT__) +# define LZO_SIZEOF_INT (__SIZEOF_INT__) +#endif +#endif +#ifndef LZO_SIZEOF_LONG +#if defined(SIZEOF_LONG) +# define LZO_SIZEOF_LONG (SIZEOF_LONG) +#elif defined(__SIZEOF_LONG__) +# define LZO_SIZEOF_LONG (__SIZEOF_LONG__) +#endif +#endif +#ifndef LZO_SIZEOF_LONG_LONG +#if defined(SIZEOF_LONG_LONG) +# define LZO_SIZEOF_LONG_LONG (SIZEOF_LONG_LONG) +#elif defined(__SIZEOF_LONG_LONG__) +# define LZO_SIZEOF_LONG_LONG (__SIZEOF_LONG_LONG__) +#endif +#endif +#ifndef LZO_SIZEOF___INT16 +#if defined(SIZEOF___INT16) +# define LZO_SIZEOF___INT16 (SIZEOF___INT16) +#endif +#endif +#ifndef LZO_SIZEOF___INT32 +#if defined(SIZEOF___INT32) +# define LZO_SIZEOF___INT32 (SIZEOF___INT32) +#endif +#endif +#ifndef LZO_SIZEOF___INT64 +#if defined(SIZEOF___INT64) +# define LZO_SIZEOF___INT64 (SIZEOF___INT64) +#endif +#endif +#ifndef LZO_SIZEOF_VOID_P +#if defined(SIZEOF_VOID_P) +# define LZO_SIZEOF_VOID_P (SIZEOF_VOID_P) +#elif defined(__SIZEOF_POINTER__) +# define LZO_SIZEOF_VOID_P (__SIZEOF_POINTER__) +#endif +#endif +#ifndef LZO_SIZEOF_SIZE_T +#if defined(SIZEOF_SIZE_T) +# define LZO_SIZEOF_SIZE_T (SIZEOF_SIZE_T) +#elif defined(__SIZEOF_SIZE_T__) +# define LZO_SIZEOF_SIZE_T (__SIZEOF_SIZE_T__) +#endif +#endif +#ifndef LZO_SIZEOF_PTRDIFF_T +#if defined(SIZEOF_PTRDIFF_T) +# define LZO_SIZEOF_PTRDIFF_T (SIZEOF_PTRDIFF_T) +#elif defined(__SIZEOF_PTRDIFF_T__) +# define LZO_SIZEOF_PTRDIFF_T (__SIZEOF_PTRDIFF_T__) +#endif +#endif +#define __LZO_LSR(x,b) (((x)+0ul) >> (b)) +#if !defined(LZO_SIZEOF_SHORT) +# if (LZO_ARCH_CRAY_PVP) +# define LZO_SIZEOF_SHORT 8 +# elif (USHRT_MAX == LZO_0xffffL) +# define LZO_SIZEOF_SHORT 2 +# elif (__LZO_LSR(USHRT_MAX,7) == 1) +# define LZO_SIZEOF_SHORT 1 +# elif (__LZO_LSR(USHRT_MAX,15) == 1) +# define LZO_SIZEOF_SHORT 2 +# elif (__LZO_LSR(USHRT_MAX,31) == 1) +# define LZO_SIZEOF_SHORT 4 +# elif (__LZO_LSR(USHRT_MAX,63) == 1) +# define LZO_SIZEOF_SHORT 8 +# elif (__LZO_LSR(USHRT_MAX,127) == 1) +# define LZO_SIZEOF_SHORT 16 +# else +# error "LZO_SIZEOF_SHORT" +# endif +#endif +LZO_COMPILE_TIME_ASSERT_HEADER(LZO_SIZEOF_SHORT == sizeof(short)) +#if !defined(LZO_SIZEOF_INT) +# if (LZO_ARCH_CRAY_PVP) +# define LZO_SIZEOF_INT 8 +# elif (UINT_MAX == LZO_0xffffL) +# define LZO_SIZEOF_INT 2 +# elif (UINT_MAX == LZO_0xffffffffL) +# define LZO_SIZEOF_INT 4 +# elif (__LZO_LSR(UINT_MAX,7) == 1) +# define LZO_SIZEOF_INT 1 +# elif (__LZO_LSR(UINT_MAX,15) == 1) +# define LZO_SIZEOF_INT 2 +# elif (__LZO_LSR(UINT_MAX,31) == 1) +# define LZO_SIZEOF_INT 4 +# elif (__LZO_LSR(UINT_MAX,63) == 1) +# define LZO_SIZEOF_INT 8 +# elif (__LZO_LSR(UINT_MAX,127) == 1) +# define LZO_SIZEOF_INT 16 +# else +# error "LZO_SIZEOF_INT" +# endif +#endif +LZO_COMPILE_TIME_ASSERT_HEADER(LZO_SIZEOF_INT == sizeof(int)) +#if !defined(LZO_SIZEOF_LONG) +# if (ULONG_MAX == LZO_0xffffffffL) +# define LZO_SIZEOF_LONG 4 +# elif (__LZO_LSR(ULONG_MAX,7) == 1) +# define LZO_SIZEOF_LONG 1 +# elif (__LZO_LSR(ULONG_MAX,15) == 1) +# define LZO_SIZEOF_LONG 2 +# elif (__LZO_LSR(ULONG_MAX,31) == 1) +# define LZO_SIZEOF_LONG 4 +# elif (__LZO_LSR(ULONG_MAX,39) == 1) +# define LZO_SIZEOF_LONG 5 +# elif (__LZO_LSR(ULONG_MAX,63) == 1) +# define LZO_SIZEOF_LONG 8 +# elif (__LZO_LSR(ULONG_MAX,127) == 1) +# define LZO_SIZEOF_LONG 16 +# else +# error "LZO_SIZEOF_LONG" +# endif +#endif +LZO_COMPILE_TIME_ASSERT_HEADER(LZO_SIZEOF_LONG == sizeof(long)) +#if !defined(LZO_SIZEOF_LONG_LONG) && !defined(LZO_SIZEOF___INT64) +#if (LZO_SIZEOF_LONG > 0 && LZO_SIZEOF_LONG < 8) +# if defined(__LONG_MAX__) && defined(__LONG_LONG_MAX__) +# if (LZO_CC_GNUC >= 0x030300ul) +# if ((__LONG_MAX__-0) == (__LONG_LONG_MAX__-0)) +# define LZO_SIZEOF_LONG_LONG LZO_SIZEOF_LONG +# elif (__LZO_LSR(__LONG_LONG_MAX__,30) == 1) +# define LZO_SIZEOF_LONG_LONG 4 +# endif +# endif +# endif +#endif +#endif +#if !defined(LZO_SIZEOF_LONG_LONG) && !defined(LZO_SIZEOF___INT64) +#if (LZO_SIZEOF_LONG > 0 && LZO_SIZEOF_LONG < 8) +#if (LZO_ARCH_I086 && LZO_CC_DMC) +#elif (LZO_CC_CILLY) && defined(__GNUC__) +# define LZO_SIZEOF_LONG_LONG 8 +#elif (LZO_CC_ARMCC_GNUC || LZO_CC_CLANG || LZO_CC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE) +# define LZO_SIZEOF_LONG_LONG 8 +#elif ((LZO_OS_WIN32 || LZO_OS_WIN64 || defined(_WIN32)) && LZO_CC_MSC && (_MSC_VER >= 1400)) +# define LZO_SIZEOF_LONG_LONG 8 +#elif (LZO_OS_WIN64 || defined(_WIN64)) +# define LZO_SIZEOF___INT64 8 +#elif (LZO_ARCH_I386 && (LZO_CC_DMC)) +# define LZO_SIZEOF_LONG_LONG 8 +#elif (LZO_ARCH_I386 && (LZO_CC_SYMANTECC && (__SC__ >= 0x700))) +# define LZO_SIZEOF_LONG_LONG 8 +#elif (LZO_ARCH_I386 && (LZO_CC_INTELC && defined(__linux__))) +# define LZO_SIZEOF_LONG_LONG 8 +#elif (LZO_ARCH_I386 && (LZO_CC_MWERKS || LZO_CC_PELLESC || LZO_CC_PGI || LZO_CC_SUNPROC)) +# define LZO_SIZEOF_LONG_LONG 8 +#elif (LZO_ARCH_I386 && (LZO_CC_INTELC || LZO_CC_MSC)) +# define LZO_SIZEOF___INT64 8 +#elif ((LZO_OS_WIN32 || defined(_WIN32)) && (LZO_CC_MSC)) +# define LZO_SIZEOF___INT64 8 +#elif (LZO_ARCH_I386 && (LZO_CC_BORLANDC && (__BORLANDC__ >= 0x0520))) +# define LZO_SIZEOF___INT64 8 +#elif (LZO_ARCH_I386 && (LZO_CC_WATCOMC && (__WATCOMC__ >= 1100))) +# define LZO_SIZEOF___INT64 8 +#elif (LZO_CC_GHS && defined(__LLONG_BIT) && ((__LLONG_BIT-0) == 64)) +# define LZO_SIZEOF_LONG_LONG 8 +#elif (LZO_CC_WATCOMC && defined(_INTEGRAL_MAX_BITS) && ((_INTEGRAL_MAX_BITS-0) == 64)) +# define LZO_SIZEOF___INT64 8 +#elif (LZO_OS_OS400 || defined(__OS400__)) && defined(__LLP64_IFC__) +# define LZO_SIZEOF_LONG_LONG 8 +#elif (defined(__vms) || defined(__VMS)) && ((__INITIAL_POINTER_SIZE-0) == 64) +# define LZO_SIZEOF_LONG_LONG 8 +#elif (LZO_CC_SDCC) && (LZO_SIZEOF_INT == 2) +#elif 1 && defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) +# define LZO_SIZEOF_LONG_LONG 8 +#endif +#endif +#endif +#if defined(__cplusplus) && (LZO_CC_GNUC) +# if (LZO_CC_GNUC < 0x020800ul) +# undef LZO_SIZEOF_LONG_LONG +# endif +#endif +#if (LZO_CFG_NO_LONG_LONG) +# undef LZO_SIZEOF_LONG_LONG +#elif defined(__NO_LONG_LONG) +# undef LZO_SIZEOF_LONG_LONG +#elif defined(_NO_LONGLONG) +# undef LZO_SIZEOF_LONG_LONG +#endif +#if !defined(LZO_WORDSIZE) +#if (LZO_ARCH_ALPHA) +# define LZO_WORDSIZE 8 +#elif (LZO_ARCH_AMD64) +# define LZO_WORDSIZE 8 +#elif (LZO_ARCH_AVR) +# define LZO_WORDSIZE 1 +#elif (LZO_ARCH_H8300) +# if defined(__NORMAL_MODE__) +# define LZO_WORDSIZE 4 +# elif defined(__H8300H__) || defined(__H8300S__) || defined(__H8300SX__) +# define LZO_WORDSIZE 4 +# else +# define LZO_WORDSIZE 2 +# endif +#elif (LZO_ARCH_I086) +# define LZO_WORDSIZE 2 +#elif (LZO_ARCH_IA64) +# define LZO_WORDSIZE 8 +#elif (LZO_ARCH_M16C) +# define LZO_WORDSIZE 2 +#elif (LZO_ARCH_SPU) +# define LZO_WORDSIZE 4 +#elif (LZO_ARCH_Z80) +# define LZO_WORDSIZE 1 +#elif (LZO_SIZEOF_LONG == 8) && ((defined(__mips__) && defined(__R5900__)) || defined(__MIPS_PSX2__)) +# define LZO_WORDSIZE 8 +#elif (LZO_OS_OS400 || defined(__OS400__)) +# define LZO_WORDSIZE 8 +#elif (defined(__vms) || defined(__VMS)) && (__INITIAL_POINTER_SIZE+0 == 64) +# define LZO_WORDSIZE 8 +#endif +#endif +#if !defined(LZO_SIZEOF_VOID_P) +#if defined(__ILP32__) || defined(__ILP32) || defined(_ILP32) +LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(int) == 4) +LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(long) == 4) +# define LZO_SIZEOF_VOID_P 4 +#elif defined(__ILP64__) || defined(__ILP64) || defined(_ILP64) +LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(int) == 8) +LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(long) == 8) +# define LZO_SIZEOF_VOID_P 8 +#elif defined(__LLP64__) || defined(__LLP64) || defined(_LLP64) || defined(_WIN64) +LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(long) == 4) +# define LZO_SIZEOF_VOID_P 8 +#elif defined(__LP64__) || defined(__LP64) || defined(_LP64) +LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(long) == 8) +# define LZO_SIZEOF_VOID_P 8 +#elif (LZO_ARCH_AVR) +# define LZO_SIZEOF_VOID_P 2 +#elif (LZO_ARCH_C166 || LZO_ARCH_MCS51 || LZO_ARCH_MCS251 || LZO_ARCH_MSP430) +# define LZO_SIZEOF_VOID_P 2 +#elif (LZO_ARCH_H8300) +# if defined(__NORMAL_MODE__) +# define LZO_SIZEOF_VOID_P 2 +# elif defined(__H8300H__) || defined(__H8300S__) || defined(__H8300SX__) +# define LZO_SIZEOF_VOID_P 4 +# else +# define LZO_SIZEOF_VOID_P 2 +# endif +# if (LZO_CC_GNUC && (LZO_CC_GNUC < 0x040000ul)) && (LZO_SIZEOF_INT == 4) +# define LZO_SIZEOF_SIZE_T LZO_SIZEOF_INT +# define LZO_SIZEOF_PTRDIFF_T LZO_SIZEOF_INT +# endif +#elif (LZO_ARCH_I086) +# if (LZO_MM_TINY || LZO_MM_SMALL || LZO_MM_MEDIUM) +# define LZO_SIZEOF_VOID_P 2 +# elif (LZO_MM_COMPACT || LZO_MM_LARGE || LZO_MM_HUGE) +# define LZO_SIZEOF_VOID_P 4 +# else +# error "invalid LZO_ARCH_I086 memory model" +# endif +#elif (LZO_ARCH_M16C) +# if defined(__m32c_cpu__) || defined(__m32cm_cpu__) +# define LZO_SIZEOF_VOID_P 4 +# else +# define LZO_SIZEOF_VOID_P 2 +# endif +#elif (LZO_ARCH_SPU) +# define LZO_SIZEOF_VOID_P 4 +#elif (LZO_ARCH_Z80) +# define LZO_SIZEOF_VOID_P 2 +#elif (LZO_SIZEOF_LONG == 8) && ((defined(__mips__) && defined(__R5900__)) || defined(__MIPS_PSX2__)) +# define LZO_SIZEOF_VOID_P 4 +#elif (LZO_OS_OS400 || defined(__OS400__)) +# if defined(__LLP64_IFC__) +# define LZO_SIZEOF_VOID_P 8 +# define LZO_SIZEOF_SIZE_T LZO_SIZEOF_LONG +# define LZO_SIZEOF_PTRDIFF_T LZO_SIZEOF_LONG +# else +# define LZO_SIZEOF_VOID_P 16 +# define LZO_SIZEOF_SIZE_T LZO_SIZEOF_LONG +# define LZO_SIZEOF_PTRDIFF_T LZO_SIZEOF_LONG +# endif +#elif (defined(__vms) || defined(__VMS)) && (__INITIAL_POINTER_SIZE+0 == 64) +# define LZO_SIZEOF_VOID_P 8 +# define LZO_SIZEOF_SIZE_T LZO_SIZEOF_LONG +# define LZO_SIZEOF_PTRDIFF_T LZO_SIZEOF_LONG +#endif +#endif +#if !defined(LZO_SIZEOF_VOID_P) +# define LZO_SIZEOF_VOID_P LZO_SIZEOF_LONG +#endif +LZO_COMPILE_TIME_ASSERT_HEADER(LZO_SIZEOF_VOID_P == sizeof(void *)) +#if !defined(LZO_SIZEOF_SIZE_T) +#if (LZO_ARCH_I086 || LZO_ARCH_M16C) +# define LZO_SIZEOF_SIZE_T 2 +#endif +#endif +#if !defined(LZO_SIZEOF_SIZE_T) +# define LZO_SIZEOF_SIZE_T LZO_SIZEOF_VOID_P +#endif +#if defined(offsetof) +LZO_COMPILE_TIME_ASSERT_HEADER(LZO_SIZEOF_SIZE_T == sizeof(size_t)) +#endif +#if !defined(LZO_SIZEOF_PTRDIFF_T) +#if (LZO_ARCH_I086) +# if (LZO_MM_TINY || LZO_MM_SMALL || LZO_MM_MEDIUM || LZO_MM_HUGE) +# define LZO_SIZEOF_PTRDIFF_T LZO_SIZEOF_VOID_P +# elif (LZO_MM_COMPACT || LZO_MM_LARGE) +# if (LZO_CC_BORLANDC || LZO_CC_TURBOC) +# define LZO_SIZEOF_PTRDIFF_T 4 +# else +# define LZO_SIZEOF_PTRDIFF_T 2 +# endif +# else +# error "invalid LZO_ARCH_I086 memory model" +# endif +#endif +#endif +#if !defined(LZO_SIZEOF_PTRDIFF_T) +# define LZO_SIZEOF_PTRDIFF_T LZO_SIZEOF_SIZE_T +#endif +#if defined(offsetof) +LZO_COMPILE_TIME_ASSERT_HEADER(LZO_SIZEOF_PTRDIFF_T == sizeof(ptrdiff_t)) +#endif +#if !defined(LZO_WORDSIZE) +# define LZO_WORDSIZE LZO_SIZEOF_VOID_P +#endif +#if (LZO_ABI_NEUTRAL_ENDIAN) +# undef LZO_ABI_BIG_ENDIAN +# undef LZO_ABI_LITTLE_ENDIAN +#elif !(LZO_ABI_BIG_ENDIAN) && !(LZO_ABI_LITTLE_ENDIAN) +#if (LZO_ARCH_ALPHA) && (LZO_ARCH_CRAY_MPP) +# define LZO_ABI_BIG_ENDIAN 1 +#elif (LZO_ARCH_IA64) && (LZO_OS_POSIX_LINUX || LZO_OS_WIN64) +# define LZO_ABI_LITTLE_ENDIAN 1 +#elif (LZO_ARCH_ALPHA || LZO_ARCH_AMD64 || LZO_ARCH_BLACKFIN || LZO_ARCH_CRIS || LZO_ARCH_I086 || LZO_ARCH_I386 || LZO_ARCH_MSP430) +# define LZO_ABI_LITTLE_ENDIAN 1 +#elif (LZO_ARCH_AVR32 || LZO_ARCH_M68K || LZO_ARCH_S390 || LZO_ARCH_SPU) +# define LZO_ABI_BIG_ENDIAN 1 +#elif 1 && defined(__IAR_SYSTEMS_ICC__) && defined(__LITTLE_ENDIAN__) +# if (__LITTLE_ENDIAN__ == 1) +# define LZO_ABI_LITTLE_ENDIAN 1 +# else +# define LZO_ABI_BIG_ENDIAN 1 +# endif +#elif 1 && defined(__BIG_ENDIAN__) && !defined(__LITTLE_ENDIAN__) +# define LZO_ABI_BIG_ENDIAN 1 +#elif 1 && defined(__LITTLE_ENDIAN__) && !defined(__BIG_ENDIAN__) +# define LZO_ABI_LITTLE_ENDIAN 1 +#elif 1 && (LZO_ARCH_ARM) && defined(__ARMEB__) && !defined(__ARMEL__) +# define LZO_ABI_BIG_ENDIAN 1 +#elif 1 && (LZO_ARCH_ARM) && defined(__ARMEL__) && !defined(__ARMEB__) +# define LZO_ABI_LITTLE_ENDIAN 1 +#elif 1 && (LZO_ARCH_ARM && LZO_CC_ARMCC_ARMCC) +# if defined(__BIG_ENDIAN) && defined(__LITTLE_ENDIAN) +# error "unexpected configuration - check your compiler defines" +# elif defined(__BIG_ENDIAN) +# define LZO_ABI_BIG_ENDIAN 1 +# else +# define LZO_ABI_LITTLE_ENDIAN 1 +# endif +# define LZO_ABI_LITTLE_ENDIAN 1 +#elif 1 && (LZO_ARCH_ARM64) && defined(__AARCH64EB__) && !defined(__AARCH64EL__) +# define LZO_ABI_BIG_ENDIAN 1 +#elif 1 && (LZO_ARCH_ARM64) && defined(__AARCH64EL__) && !defined(__AARCH64EB__) +# define LZO_ABI_LITTLE_ENDIAN 1 +#elif 1 && (LZO_ARCH_MIPS) && defined(__MIPSEB__) && !defined(__MIPSEL__) +# define LZO_ABI_BIG_ENDIAN 1 +#elif 1 && (LZO_ARCH_MIPS) && defined(__MIPSEL__) && !defined(__MIPSEB__) +# define LZO_ABI_LITTLE_ENDIAN 1 +#endif +#endif +#if (LZO_ABI_BIG_ENDIAN) && (LZO_ABI_LITTLE_ENDIAN) +# error "unexpected configuration - check your compiler defines" +#endif +#if (LZO_ABI_BIG_ENDIAN) +# define LZO_INFO_ABI_ENDIAN "be" +#elif (LZO_ABI_LITTLE_ENDIAN) +# define LZO_INFO_ABI_ENDIAN "le" +#elif (LZO_ABI_NEUTRAL_ENDIAN) +# define LZO_INFO_ABI_ENDIAN "neutral" +#endif +#if (LZO_SIZEOF_INT == 1 && LZO_SIZEOF_LONG == 2 && LZO_SIZEOF_VOID_P == 2) +# define LZO_ABI_I8LP16 1 +# define LZO_INFO_ABI_PM "i8lp16" +#elif (LZO_SIZEOF_INT == 2 && LZO_SIZEOF_LONG == 2 && LZO_SIZEOF_VOID_P == 2) +# define LZO_ABI_ILP16 1 +# define LZO_INFO_ABI_PM "ilp16" +#elif (LZO_SIZEOF_INT == 2 && LZO_SIZEOF_LONG == 4 && LZO_SIZEOF_VOID_P == 4) +# define LZO_ABI_LP32 1 +# define LZO_INFO_ABI_PM "lp32" +#elif (LZO_SIZEOF_INT == 4 && LZO_SIZEOF_LONG == 4 && LZO_SIZEOF_VOID_P == 4) +# define LZO_ABI_ILP32 1 +# define LZO_INFO_ABI_PM "ilp32" +#elif (LZO_SIZEOF_INT == 4 && LZO_SIZEOF_LONG == 4 && LZO_SIZEOF_VOID_P == 8 && LZO_SIZEOF_SIZE_T == 8) +# define LZO_ABI_LLP64 1 +# define LZO_INFO_ABI_PM "llp64" +#elif (LZO_SIZEOF_INT == 4 && LZO_SIZEOF_LONG == 8 && LZO_SIZEOF_VOID_P == 8) +# define LZO_ABI_LP64 1 +# define LZO_INFO_ABI_PM "lp64" +#elif (LZO_SIZEOF_INT == 8 && LZO_SIZEOF_LONG == 8 && LZO_SIZEOF_VOID_P == 8) +# define LZO_ABI_ILP64 1 +# define LZO_INFO_ABI_PM "ilp64" +#elif (LZO_SIZEOF_INT == 4 && LZO_SIZEOF_LONG == 8 && LZO_SIZEOF_VOID_P == 4) +# define LZO_ABI_IP32L64 1 +# define LZO_INFO_ABI_PM "ip32l64" +#endif +#if 0 +#elif !defined(__LZO_LIBC_OVERRIDE) +#if (LZO_LIBC_NAKED) +# define LZO_INFO_LIBC "naked" +#elif (LZO_LIBC_FREESTANDING) +# define LZO_INFO_LIBC "freestanding" +#elif (LZO_LIBC_MOSTLY_FREESTANDING) +# define LZO_INFO_LIBC "mfreestanding" +#elif (LZO_LIBC_ISOC90) +# define LZO_INFO_LIBC "isoc90" +#elif (LZO_LIBC_ISOC99) +# define LZO_INFO_LIBC "isoc99" +#elif (LZO_CC_ARMCC_ARMCC) && defined(__ARMCLIB_VERSION) +# define LZO_LIBC_ISOC90 1 +# define LZO_INFO_LIBC "isoc90" +#elif defined(__dietlibc__) +# define LZO_LIBC_DIETLIBC 1 +# define LZO_INFO_LIBC "dietlibc" +#elif defined(_NEWLIB_VERSION) +# define LZO_LIBC_NEWLIB 1 +# define LZO_INFO_LIBC "newlib" +#elif defined(__UCLIBC__) && defined(__UCLIBC_MAJOR__) && defined(__UCLIBC_MINOR__) +# if defined(__UCLIBC_SUBLEVEL__) +# define LZO_LIBC_UCLIBC (__UCLIBC_MAJOR__ * 0x10000L + (__UCLIBC_MINOR__-0) * 0x100 + (__UCLIBC_SUBLEVEL__-0)) +# else +# define LZO_LIBC_UCLIBC 0x00090bL +# endif +# define LZO_INFO_LIBC "uc" "libc" +#elif defined(__GLIBC__) && defined(__GLIBC_MINOR__) +# define LZO_LIBC_GLIBC (__GLIBC__ * 0x10000L + (__GLIBC_MINOR__-0) * 0x100) +# define LZO_INFO_LIBC "glibc" +#elif (LZO_CC_MWERKS) && defined(__MSL__) +# define LZO_LIBC_MSL __MSL__ +# define LZO_INFO_LIBC "msl" +#elif 1 && defined(__IAR_SYSTEMS_ICC__) +# define LZO_LIBC_ISOC90 1 +# define LZO_INFO_LIBC "isoc90" +#else +# define LZO_LIBC_DEFAULT 1 +# define LZO_INFO_LIBC "default" +#endif +#endif +#if (LZO_ARCH_I386 && (LZO_OS_DOS32 || LZO_OS_WIN32) && (LZO_CC_DMC || LZO_CC_INTELC || LZO_CC_MSC || LZO_CC_PELLESC)) +# define LZO_ASM_SYNTAX_MSC 1 +#elif (LZO_OS_WIN64 && (LZO_CC_DMC || LZO_CC_INTELC || LZO_CC_MSC || LZO_CC_PELLESC)) +#elif (LZO_ARCH_I386 && LZO_CC_GNUC && (LZO_CC_GNUC == 0x011f00ul)) +#elif (LZO_ARCH_I386 && (LZO_CC_CLANG || LZO_CC_GNUC || LZO_CC_INTELC || LZO_CC_PATHSCALE)) +# define LZO_ASM_SYNTAX_GNUC 1 +#elif (LZO_ARCH_AMD64 && (LZO_CC_CLANG || LZO_CC_GNUC || LZO_CC_INTELC || LZO_CC_PATHSCALE)) +# define LZO_ASM_SYNTAX_GNUC 1 +#elif (LZO_CC_GNUC) +# define LZO_ASM_SYNTAX_GNUC 1 +#endif +#if (LZO_ASM_SYNTAX_GNUC) +#if (LZO_ARCH_I386 && LZO_CC_GNUC && (LZO_CC_GNUC < 0x020000ul)) +# define __LZO_ASM_CLOBBER "ax" +# define __LZO_ASM_CLOBBER_LIST_CC /*empty*/ +# define __LZO_ASM_CLOBBER_LIST_CC_MEMORY /*empty*/ +# define __LZO_ASM_CLOBBER_LIST_EMPTY /*empty*/ +#elif (LZO_CC_INTELC && (__INTEL_COMPILER < 1000)) +# define __LZO_ASM_CLOBBER "memory" +# define __LZO_ASM_CLOBBER_LIST_CC /*empty*/ +# define __LZO_ASM_CLOBBER_LIST_CC_MEMORY : "memory" +# define __LZO_ASM_CLOBBER_LIST_EMPTY /*empty*/ +#else +# define __LZO_ASM_CLOBBER "cc", "memory" +# define __LZO_ASM_CLOBBER_LIST_CC : "cc" +# define __LZO_ASM_CLOBBER_LIST_CC_MEMORY : "cc", "memory" +# define __LZO_ASM_CLOBBER_LIST_EMPTY /*empty*/ +#endif +#endif +#if (LZO_ARCH_ALPHA) +# define LZO_OPT_AVOID_UINT_INDEX 1 +#elif (LZO_ARCH_AMD64) +# define LZO_OPT_AVOID_INT_INDEX 1 +# define LZO_OPT_AVOID_UINT_INDEX 1 +# ifndef LZO_OPT_UNALIGNED16 +# define LZO_OPT_UNALIGNED16 1 +# endif +# ifndef LZO_OPT_UNALIGNED32 +# define LZO_OPT_UNALIGNED32 1 +# endif +# ifndef LZO_OPT_UNALIGNED64 +# define LZO_OPT_UNALIGNED64 1 +# endif +#elif (LZO_ARCH_ARM) +# if defined(__ARM_FEATURE_UNALIGNED) +# ifndef LZO_OPT_UNALIGNED16 +# define LZO_OPT_UNALIGNED16 1 +# endif +# ifndef LZO_OPT_UNALIGNED32 +# define LZO_OPT_UNALIGNED32 1 +# endif +# elif defined(__TARGET_ARCH_ARM) && ((__TARGET_ARCH_ARM+0) >= 7) +# ifndef LZO_OPT_UNALIGNED16 +# define LZO_OPT_UNALIGNED16 1 +# endif +# ifndef LZO_OPT_UNALIGNED32 +# define LZO_OPT_UNALIGNED32 1 +# endif +# elif defined(__TARGET_ARCH_ARM) && ((__TARGET_ARCH_ARM+0) >= 6) && !defined(__TARGET_PROFILE_M) +# ifndef LZO_OPT_UNALIGNED16 +# define LZO_OPT_UNALIGNED16 1 +# endif +# ifndef LZO_OPT_UNALIGNED32 +# define LZO_OPT_UNALIGNED32 1 +# endif +# endif +#elif (LZO_ARCH_ARM64) +# ifndef LZO_OPT_UNALIGNED16 +# define LZO_OPT_UNALIGNED16 1 +# endif +# ifndef LZO_OPT_UNALIGNED32 +# define LZO_OPT_UNALIGNED32 1 +# endif +# ifndef LZO_OPT_UNALIGNED64 +# define LZO_OPT_UNALIGNED64 1 +# endif +#elif (LZO_ARCH_CRIS) +# ifndef LZO_OPT_UNALIGNED16 +# define LZO_OPT_UNALIGNED16 1 +# endif +# ifndef LZO_OPT_UNALIGNED32 +# define LZO_OPT_UNALIGNED32 1 +# endif +#elif (LZO_ARCH_I386) +# ifndef LZO_OPT_UNALIGNED16 +# define LZO_OPT_UNALIGNED16 1 +# endif +# ifndef LZO_OPT_UNALIGNED32 +# define LZO_OPT_UNALIGNED32 1 +# endif +#elif (LZO_ARCH_IA64) +# define LZO_OPT_AVOID_INT_INDEX 1 +# define LZO_OPT_AVOID_UINT_INDEX 1 +# define LZO_OPT_PREFER_POSTINC 1 +#elif (LZO_ARCH_M68K) +# define LZO_OPT_PREFER_POSTINC 1 +# define LZO_OPT_PREFER_PREDEC 1 +# if defined(__mc68020__) && !defined(__mcoldfire__) +# ifndef LZO_OPT_UNALIGNED16 +# define LZO_OPT_UNALIGNED16 1 +# endif +# ifndef LZO_OPT_UNALIGNED32 +# define LZO_OPT_UNALIGNED32 1 +# endif +# endif +#elif (LZO_ARCH_MIPS) +# define LZO_OPT_AVOID_UINT_INDEX 1 +#elif (LZO_ARCH_POWERPC) +# define LZO_OPT_PREFER_PREINC 1 +# define LZO_OPT_PREFER_PREDEC 1 +# if (LZO_ABI_BIG_ENDIAN) +# ifndef LZO_OPT_UNALIGNED16 +# define LZO_OPT_UNALIGNED16 1 +# endif +# ifndef LZO_OPT_UNALIGNED32 +# define LZO_OPT_UNALIGNED32 1 +# endif +# if (LZO_WORDSIZE == 8) +# ifndef LZO_OPT_UNALIGNED64 +# define LZO_OPT_UNALIGNED64 1 +# endif +# endif +# endif +#elif (LZO_ARCH_S390) +# ifndef LZO_OPT_UNALIGNED16 +# define LZO_OPT_UNALIGNED16 1 +# endif +# ifndef LZO_OPT_UNALIGNED32 +# define LZO_OPT_UNALIGNED32 1 +# endif +# if (LZO_WORDSIZE == 8) +# ifndef LZO_OPT_UNALIGNED64 +# define LZO_OPT_UNALIGNED64 1 +# endif +# endif +#elif (LZO_ARCH_SH) +# define LZO_OPT_PREFER_POSTINC 1 +# define LZO_OPT_PREFER_PREDEC 1 +#endif +#ifndef LZO_CFG_NO_INLINE_ASM +#if (LZO_ABI_NEUTRAL_ENDIAN) || (LZO_ARCH_GENERIC) +# define LZO_CFG_NO_INLINE_ASM 1 +#elif (LZO_CC_LLVM) +# define LZO_CFG_NO_INLINE_ASM 1 +#endif +#endif +#if (LZO_CFG_NO_INLINE_ASM) +# undef LZO_ASM_SYNTAX_MSC +# undef LZO_ASM_SYNTAX_GNUC +# undef __LZO_ASM_CLOBBER +# undef __LZO_ASM_CLOBBER_LIST_CC +# undef __LZO_ASM_CLOBBER_LIST_CC_MEMORY +# undef __LZO_ASM_CLOBBER_LIST_EMPTY +#endif +#ifndef LZO_CFG_NO_UNALIGNED +#if (LZO_ABI_NEUTRAL_ENDIAN) || (LZO_ARCH_GENERIC) +# define LZO_CFG_NO_UNALIGNED 1 +#endif +#endif +#if (LZO_CFG_NO_UNALIGNED) +# undef LZO_OPT_UNALIGNED16 +# undef LZO_OPT_UNALIGNED32 +# undef LZO_OPT_UNALIGNED64 +#endif +#if defined(__LZO_INFOSTR_MM) +#elif (LZO_MM_FLAT) && (defined(__LZO_INFOSTR_PM) || defined(LZO_INFO_ABI_PM)) +# define __LZO_INFOSTR_MM "" +#elif defined(LZO_INFO_MM) +# define __LZO_INFOSTR_MM "." LZO_INFO_MM +#else +# define __LZO_INFOSTR_MM "" +#endif +#if defined(__LZO_INFOSTR_PM) +#elif defined(LZO_INFO_ABI_PM) +# define __LZO_INFOSTR_PM "." LZO_INFO_ABI_PM +#else +# define __LZO_INFOSTR_PM "" +#endif +#if defined(__LZO_INFOSTR_ENDIAN) +#elif defined(LZO_INFO_ABI_ENDIAN) +# define __LZO_INFOSTR_ENDIAN "." LZO_INFO_ABI_ENDIAN +#else +# define __LZO_INFOSTR_ENDIAN "" +#endif +#if defined(__LZO_INFOSTR_OSNAME) +#elif defined(LZO_INFO_OS_CONSOLE) +# define __LZO_INFOSTR_OSNAME LZO_INFO_OS "." LZO_INFO_OS_CONSOLE +#elif defined(LZO_INFO_OS_POSIX) +# define __LZO_INFOSTR_OSNAME LZO_INFO_OS "." LZO_INFO_OS_POSIX +#else +# define __LZO_INFOSTR_OSNAME LZO_INFO_OS +#endif +#if defined(__LZO_INFOSTR_LIBC) +#elif defined(LZO_INFO_LIBC) +# define __LZO_INFOSTR_LIBC "." LZO_INFO_LIBC +#else +# define __LZO_INFOSTR_LIBC "" +#endif +#if defined(__LZO_INFOSTR_CCVER) +#elif defined(LZO_INFO_CCVER) +# define __LZO_INFOSTR_CCVER " " LZO_INFO_CCVER +#else +# define __LZO_INFOSTR_CCVER "" +#endif +#define LZO_INFO_STRING \ + LZO_INFO_ARCH __LZO_INFOSTR_MM __LZO_INFOSTR_PM __LZO_INFOSTR_ENDIAN \ + " " __LZO_INFOSTR_OSNAME __LZO_INFOSTR_LIBC " " LZO_INFO_CC __LZO_INFOSTR_CCVER +#if !(LZO_CFG_SKIP_LZO_TYPES) +#if (!(LZO_SIZEOF_SHORT+0 > 0 && LZO_SIZEOF_INT+0 > 0 && LZO_SIZEOF_LONG+0 > 0)) +# error "missing defines for sizes" +#endif +#if (!(LZO_SIZEOF_PTRDIFF_T+0 > 0 && LZO_SIZEOF_SIZE_T+0 > 0 && LZO_SIZEOF_VOID_P+0 > 0)) +# error "missing defines for sizes" +#endif +#if !defined(lzo_llong_t) +#if (LZO_SIZEOF_LONG_LONG+0 > 0) +__lzo_gnuc_extension__ typedef long long lzo_llong_t__; +__lzo_gnuc_extension__ typedef unsigned long long lzo_ullong_t__; +# define lzo_llong_t lzo_llong_t__ +# define lzo_ullong_t lzo_ullong_t__ +#endif +#endif +#if !defined(lzo_int16e_t) +#if (LZO_SIZEOF_LONG == 2) +# define lzo_int16e_t long +# define lzo_uint16e_t unsigned long +#elif (LZO_SIZEOF_INT == 2) +# define lzo_int16e_t int +# define lzo_uint16e_t unsigned int +#elif (LZO_SIZEOF_SHORT == 2) +# define lzo_int16e_t short int +# define lzo_uint16e_t unsigned short int +#elif 1 && !(LZO_CFG_TYPE_NO_MODE_HI) && (LZO_CC_CLANG || (LZO_CC_GNUC >= 0x025f00ul) || LZO_CC_LLVM) + typedef int lzo_int16e_hi_t__ __attribute__((__mode__(__HI__))); + typedef unsigned int lzo_uint16e_hi_t__ __attribute__((__mode__(__HI__))); +# define lzo_int16e_t lzo_int16e_hi_t__ +# define lzo_uint16e_t lzo_uint16e_hi_t__ +#elif (LZO_SIZEOF___INT16 == 2) +# define lzo_int16e_t __int16 +# define lzo_uint16e_t unsigned __int16 +#else +#endif +#endif +#if defined(lzo_int16e_t) +# define LZO_SIZEOF_LZO_INT16E_T 2 + LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int16e_t) == 2) + LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int16e_t) == LZO_SIZEOF_LZO_INT16E_T) +#endif +#if !defined(lzo_int32e_t) +#if (LZO_SIZEOF_LONG == 4) +# define lzo_int32e_t long int +# define lzo_uint32e_t unsigned long int +#elif (LZO_SIZEOF_INT == 4) +# define lzo_int32e_t int +# define lzo_uint32e_t unsigned int +#elif (LZO_SIZEOF_SHORT == 4) +# define lzo_int32e_t short int +# define lzo_uint32e_t unsigned short int +#elif (LZO_SIZEOF_LONG_LONG == 4) +# define lzo_int32e_t lzo_llong_t +# define lzo_uint32e_t lzo_ullong_t +#elif 1 && !(LZO_CFG_TYPE_NO_MODE_SI) && (LZO_CC_CLANG || (LZO_CC_GNUC >= 0x025f00ul) || LZO_CC_LLVM) && (__INT_MAX__+0 > 2147483647L) + typedef int lzo_int32e_si_t__ __attribute__((__mode__(__SI__))); + typedef unsigned int lzo_uint32e_si_t__ __attribute__((__mode__(__SI__))); +# define lzo_int32e_t lzo_int32e_si_t__ +# define lzo_uint32e_t lzo_uint32e_si_t__ +#elif 1 && !(LZO_CFG_TYPE_NO_MODE_SI) && (LZO_CC_GNUC >= 0x025f00ul) && defined(__AVR__) && (__LONG_MAX__+0 == 32767L) + typedef int lzo_int32e_si_t__ __attribute__((__mode__(__SI__))); + typedef unsigned int lzo_uint32e_si_t__ __attribute__((__mode__(__SI__))); +# define lzo_int32e_t lzo_int32e_si_t__ +# define lzo_uint32e_t lzo_uint32e_si_t__ +# define LZO_INT32_C(c) (c##LL) +# define LZO_UINT32_C(c) (c##ULL) +#elif (LZO_SIZEOF___INT32 == 4) +# define lzo_int32e_t __int32 +# define lzo_uint32e_t unsigned __int32 +#else +#endif +#endif +#if defined(lzo_int32e_t) +# define LZO_SIZEOF_LZO_INT32E_T 4 + LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int32e_t) == 4) + LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int32e_t) == LZO_SIZEOF_LZO_INT32E_T) +#endif +#if !defined(lzo_int64e_t) +#if (LZO_SIZEOF___INT64 == 8) +# if (LZO_CC_BORLANDC) && !(LZO_CFG_TYPE_PREFER___INT64) +# define LZO_CFG_TYPE_PREFER___INT64 1 +# endif +#endif +#if (LZO_SIZEOF_INT == 8) && (LZO_SIZEOF_INT < LZO_SIZEOF_LONG) +# define lzo_int64e_t int +# define lzo_uint64e_t unsigned int +# define LZO_SIZEOF_LZO_INT64E_T LZO_SIZEOF_INT +#elif (LZO_SIZEOF_LONG == 8) +# define lzo_int64e_t long int +# define lzo_uint64e_t unsigned long int +# define LZO_SIZEOF_LZO_INT64E_T LZO_SIZEOF_LONG +#elif (LZO_SIZEOF_LONG_LONG == 8) && !(LZO_CFG_TYPE_PREFER___INT64) +# define lzo_int64e_t lzo_llong_t +# define lzo_uint64e_t lzo_ullong_t +# if (LZO_CC_BORLANDC) +# define LZO_INT64_C(c) ((c) + 0ll) +# define LZO_UINT64_C(c) ((c) + 0ull) +# elif 0 +# define LZO_INT64_C(c) (__lzo_gnuc_extension__ (c##LL)) +# define LZO_UINT64_C(c) (__lzo_gnuc_extension__ (c##ULL)) +# else +# define LZO_INT64_C(c) (c##LL) +# define LZO_UINT64_C(c) (c##ULL) +# endif +# define LZO_SIZEOF_LZO_INT64E_T LZO_SIZEOF_LONG_LONG +#elif (LZO_SIZEOF___INT64 == 8) +# define lzo_int64e_t __int64 +# define lzo_uint64e_t unsigned __int64 +# if (LZO_CC_BORLANDC) +# define LZO_INT64_C(c) ((c) + 0i64) +# define LZO_UINT64_C(c) ((c) + 0ui64) +# else +# define LZO_INT64_C(c) (c##i64) +# define LZO_UINT64_C(c) (c##ui64) +# endif +# define LZO_SIZEOF_LZO_INT64E_T LZO_SIZEOF___INT64 +#else +#endif +#endif +#if defined(lzo_int64e_t) + LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int64e_t) == 8) + LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int64e_t) == LZO_SIZEOF_LZO_INT64E_T) +#endif +#if !defined(lzo_int32l_t) +#if defined(lzo_int32e_t) +# define lzo_int32l_t lzo_int32e_t +# define lzo_uint32l_t lzo_uint32e_t +# define LZO_SIZEOF_LZO_INT32L_T LZO_SIZEOF_LZO_INT32E_T +#elif (LZO_SIZEOF_INT >= 4) && (LZO_SIZEOF_INT < LZO_SIZEOF_LONG) +# define lzo_int32l_t int +# define lzo_uint32l_t unsigned int +# define LZO_SIZEOF_LZO_INT32L_T LZO_SIZEOF_INT +#elif (LZO_SIZEOF_LONG >= 4) +# define lzo_int32l_t long int +# define lzo_uint32l_t unsigned long int +# define LZO_SIZEOF_LZO_INT32L_T LZO_SIZEOF_LONG +#else +# error "lzo_int32l_t" +#endif +#endif +#if 1 + LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int32l_t) >= 4) + LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int32l_t) == LZO_SIZEOF_LZO_INT32L_T) +#endif +#if !defined(lzo_int64l_t) +#if defined(lzo_int64e_t) +# define lzo_int64l_t lzo_int64e_t +# define lzo_uint64l_t lzo_uint64e_t +# define LZO_SIZEOF_LZO_INT64L_T LZO_SIZEOF_LZO_INT64E_T +#else +#endif +#endif +#if defined(lzo_int64l_t) + LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int64l_t) >= 8) + LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int64l_t) == LZO_SIZEOF_LZO_INT64L_T) +#endif +#if !defined(lzo_int32f_t) +#if (LZO_SIZEOF_SIZE_T >= 8) +# define lzo_int32f_t lzo_int64l_t +# define lzo_uint32f_t lzo_uint64l_t +# define LZO_SIZEOF_LZO_INT32F_T LZO_SIZEOF_LZO_INT64L_T +#else +# define lzo_int32f_t lzo_int32l_t +# define lzo_uint32f_t lzo_uint32l_t +# define LZO_SIZEOF_LZO_INT32F_T LZO_SIZEOF_LZO_INT32L_T +#endif +#endif +#if 1 + LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int32f_t) >= 4) + LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int32f_t) == LZO_SIZEOF_LZO_INT32F_T) +#endif +#if !defined(lzo_int64f_t) +#if defined(lzo_int64l_t) +# define lzo_int64f_t lzo_int64l_t +# define lzo_uint64f_t lzo_uint64l_t +# define LZO_SIZEOF_LZO_INT64F_T LZO_SIZEOF_LZO_INT64L_T +#else +#endif +#endif +#if defined(lzo_int64f_t) + LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int64f_t) >= 8) + LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int64f_t) == LZO_SIZEOF_LZO_INT64F_T) +#endif +#if !defined(lzo_intptr_t) +#if 1 && (LZO_OS_OS400 && (LZO_SIZEOF_VOID_P == 16)) +# define __LZO_INTPTR_T_IS_POINTER 1 + typedef char* lzo_intptr_t; + typedef char* lzo_uintptr_t; +# define lzo_intptr_t lzo_intptr_t +# define lzo_uintptr_t lzo_uintptr_t +# define LZO_SIZEOF_LZO_INTPTR_T LZO_SIZEOF_VOID_P +#elif (LZO_CC_MSC && (_MSC_VER >= 1300) && (LZO_SIZEOF_VOID_P == 4) && (LZO_SIZEOF_INT == 4)) + typedef __w64 int lzo_intptr_t; + typedef __w64 unsigned int lzo_uintptr_t; +# define lzo_intptr_t lzo_intptr_t +# define lzo_uintptr_t lzo_uintptr_t +# define LZO_SIZEOF_LZO_INTPTR_T LZO_SIZEOF_INT +#elif (LZO_SIZEOF_SHORT == LZO_SIZEOF_VOID_P) && (LZO_SIZEOF_INT > LZO_SIZEOF_VOID_P) +# define lzo_intptr_t short +# define lzo_uintptr_t unsigned short +# define LZO_SIZEOF_LZO_INTPTR_T LZO_SIZEOF_SHORT +#elif (LZO_SIZEOF_INT >= LZO_SIZEOF_VOID_P) && (LZO_SIZEOF_INT < LZO_SIZEOF_LONG) +# define lzo_intptr_t int +# define lzo_uintptr_t unsigned int +# define LZO_SIZEOF_LZO_INTPTR_T LZO_SIZEOF_INT +#elif (LZO_SIZEOF_LONG >= LZO_SIZEOF_VOID_P) +# define lzo_intptr_t long +# define lzo_uintptr_t unsigned long +# define LZO_SIZEOF_LZO_INTPTR_T LZO_SIZEOF_LONG +#elif (LZO_SIZEOF_LZO_INT64L_T >= LZO_SIZEOF_VOID_P) +# define lzo_intptr_t lzo_int64l_t +# define lzo_uintptr_t lzo_uint64l_t +# define LZO_SIZEOF_LZO_INTPTR_T LZO_SIZEOF_LZO_INT64L_T +#else +# error "lzo_intptr_t" +#endif +#endif +#if 1 + LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_intptr_t) >= sizeof(void *)) + LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_intptr_t) == sizeof(lzo_uintptr_t)) +#endif +#if !defined(lzo_word_t) +#if defined(LZO_WORDSIZE) && (LZO_WORDSIZE+0 > 0) +#if (LZO_WORDSIZE == LZO_SIZEOF_LZO_INTPTR_T) && !(__LZO_INTPTR_T_IS_POINTER) +# define lzo_word_t lzo_uintptr_t +# define lzo_sword_t lzo_intptr_t +# define LZO_SIZEOF_LZO_WORD_T LZO_SIZEOF_LZO_INTPTR_T +#elif (LZO_WORDSIZE == LZO_SIZEOF_LONG) +# define lzo_word_t unsigned long +# define lzo_sword_t long +# define LZO_SIZEOF_LZO_WORD_T LZO_SIZEOF_LONG +#elif (LZO_WORDSIZE == LZO_SIZEOF_INT) +# define lzo_word_t unsigned int +# define lzo_sword_t int +# define LZO_SIZEOF_LZO_WORD_T LZO_SIZEOF_INT +#elif (LZO_WORDSIZE == LZO_SIZEOF_SHORT) +# define lzo_word_t unsigned short +# define lzo_sword_t short +# define LZO_SIZEOF_LZO_WORD_T LZO_SIZEOF_SHORT +#elif (LZO_WORDSIZE == 1) +# define lzo_word_t unsigned char +# define lzo_sword_t signed char +# define LZO_SIZEOF_LZO_WORD_T 1 +#elif (LZO_WORDSIZE == LZO_SIZEOF_LZO_INT64L_T) +# define lzo_word_t lzo_uint64l_t +# define lzo_sword_t lzo_int64l_t +# define LZO_SIZEOF_LZO_WORD_T LZO_SIZEOF_LZO_INT64L_T +#elif (LZO_ARCH_SPU) && (LZO_CC_GNUC) +#if 0 + typedef unsigned lzo_word_t __attribute__((__mode__(__V16QI__))); + typedef int lzo_sword_t __attribute__((__mode__(__V16QI__))); +# define lzo_word_t lzo_word_t +# define lzo_sword_t lzo_sword_t +# define LZO_SIZEOF_LZO_WORD_T 16 +#endif +#else +# error "lzo_word_t" +#endif +#endif +#endif +#if 1 && defined(lzo_word_t) + LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_word_t) == LZO_WORDSIZE) + LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_sword_t) == LZO_WORDSIZE) +#endif +#if 1 +#define lzo_int8_t signed char +#define lzo_uint8_t unsigned char +#define LZO_SIZEOF_LZO_INT8_T 1 +LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int8_t) == 1) +LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int8_t) == sizeof(lzo_uint8_t)) +#endif +#if defined(lzo_int16e_t) +#define lzo_int16_t lzo_int16e_t +#define lzo_uint16_t lzo_uint16e_t +#define LZO_SIZEOF_LZO_INT16_T LZO_SIZEOF_LZO_INT16E_T +LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int16_t) == 2) +LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int16_t) == sizeof(lzo_uint16_t)) +#endif +#if defined(lzo_int32e_t) +#define lzo_int32_t lzo_int32e_t +#define lzo_uint32_t lzo_uint32e_t +#define LZO_SIZEOF_LZO_INT32_T LZO_SIZEOF_LZO_INT32E_T +LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int32_t) == 4) +LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int32_t) == sizeof(lzo_uint32_t)) +#endif +#if defined(lzo_int64e_t) +#define lzo_int64_t lzo_int64e_t +#define lzo_uint64_t lzo_uint64e_t +#define LZO_SIZEOF_LZO_INT64_T LZO_SIZEOF_LZO_INT64E_T +LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int64_t) == 8) +LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int64_t) == sizeof(lzo_uint64_t)) +#endif +#if 1 +#define lzo_int_least32_t lzo_int32l_t +#define lzo_uint_least32_t lzo_uint32l_t +#define LZO_SIZEOF_LZO_INT_LEAST32_T LZO_SIZEOF_LZO_INT32L_T +LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int_least32_t) >= 4) +LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int_least32_t) == sizeof(lzo_uint_least32_t)) +#endif +#if defined(lzo_int64l_t) +#define lzo_int_least64_t lzo_int64l_t +#define lzo_uint_least64_t lzo_uint64l_t +#define LZO_SIZEOF_LZO_INT_LEAST64_T LZO_SIZEOF_LZO_INT64L_T +LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int_least64_t) >= 8) +LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int_least64_t) == sizeof(lzo_uint_least64_t)) +#endif +#if 1 +#define lzo_int_fast32_t lzo_int32f_t +#define lzo_uint_fast32_t lzo_uint32f_t +#define LZO_SIZEOF_LZO_INT_FAST32_T LZO_SIZEOF_LZO_INT32F_T +LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int_fast32_t) >= 4) +LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int_fast32_t) == sizeof(lzo_uint_fast32_t)) +#endif +#if defined(lzo_int64f_t) +#define lzo_int_fast64_t lzo_int64f_t +#define lzo_uint_fast64_t lzo_uint64f_t +#define LZO_SIZEOF_LZO_INT_FAST64_T LZO_SIZEOF_LZO_INT64F_T +LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int_fast64_t) >= 8) +LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int_fast64_t) == sizeof(lzo_uint_fast64_t)) +#endif +#if !defined(LZO_INT16_C) +# if (LZO_BROKEN_INTEGRAL_CONSTANTS) && (LZO_SIZEOF_INT >= 2) +# define LZO_INT16_C(c) ((c) + 0) +# define LZO_UINT16_C(c) ((c) + 0U) +# elif (LZO_BROKEN_INTEGRAL_CONSTANTS) && (LZO_SIZEOF_LONG >= 2) +# define LZO_INT16_C(c) ((c) + 0L) +# define LZO_UINT16_C(c) ((c) + 0UL) +# elif (LZO_SIZEOF_INT >= 2) +# define LZO_INT16_C(c) (c) +# define LZO_UINT16_C(c) (c##U) +# elif (LZO_SIZEOF_LONG >= 2) +# define LZO_INT16_C(c) (c##L) +# define LZO_UINT16_C(c) (c##UL) +# else +# error "LZO_INT16_C" +# endif +#endif +#if !defined(LZO_INT32_C) +# if (LZO_BROKEN_INTEGRAL_CONSTANTS) && (LZO_SIZEOF_INT >= 4) +# define LZO_INT32_C(c) ((c) + 0) +# define LZO_UINT32_C(c) ((c) + 0U) +# elif (LZO_BROKEN_INTEGRAL_CONSTANTS) && (LZO_SIZEOF_LONG >= 4) +# define LZO_INT32_C(c) ((c) + 0L) +# define LZO_UINT32_C(c) ((c) + 0UL) +# elif (LZO_SIZEOF_INT >= 4) +# define LZO_INT32_C(c) (c) +# define LZO_UINT32_C(c) (c##U) +# elif (LZO_SIZEOF_LONG >= 4) +# define LZO_INT32_C(c) (c##L) +# define LZO_UINT32_C(c) (c##UL) +# elif (LZO_SIZEOF_LONG_LONG >= 4) +# define LZO_INT32_C(c) (c##LL) +# define LZO_UINT32_C(c) (c##ULL) +# else +# error "LZO_INT32_C" +# endif +#endif +#if !defined(LZO_INT64_C) && defined(lzo_int64l_t) +# if (LZO_BROKEN_INTEGRAL_CONSTANTS) && (LZO_SIZEOF_INT >= 8) +# define LZO_INT64_C(c) ((c) + 0) +# define LZO_UINT64_C(c) ((c) + 0U) +# elif (LZO_BROKEN_INTEGRAL_CONSTANTS) && (LZO_SIZEOF_LONG >= 8) +# define LZO_INT64_C(c) ((c) + 0L) +# define LZO_UINT64_C(c) ((c) + 0UL) +# elif (LZO_SIZEOF_INT >= 8) +# define LZO_INT64_C(c) (c) +# define LZO_UINT64_C(c) (c##U) +# elif (LZO_SIZEOF_LONG >= 8) +# define LZO_INT64_C(c) (c##L) +# define LZO_UINT64_C(c) (c##UL) +# else +# error "LZO_INT64_C" +# endif +#endif +#endif + +#endif + +#endif + +#undef LZO_HAVE_CONFIG_H +#include "minilzo.h" + +#if !defined(MINILZO_VERSION) || (MINILZO_VERSION != 0x2080) +# error "version mismatch in miniLZO source files" +#endif + +#ifdef MINILZO_HAVE_CONFIG_H +# define LZO_HAVE_CONFIG_H 1 +#endif + +#ifndef __LZO_CONF_H +#define __LZO_CONF_H 1 + +#if !defined(__LZO_IN_MINILZO) +#if defined(LZO_CFG_FREESTANDING) && (LZO_CFG_FREESTANDING) +# define LZO_LIBC_FREESTANDING 1 +# define LZO_OS_FREESTANDING 1 +#endif +#if defined(LZO_CFG_EXTRA_CONFIG_HEADER) +# include LZO_CFG_EXTRA_CONFIG_HEADER +#endif +#if defined(__LZOCONF_H) || defined(__LZOCONF_H_INCLUDED) +# error "include this file first" +#endif +#include "lzo/lzoconf.h" +#if defined(LZO_CFG_EXTRA_CONFIG_HEADER2) +# include LZO_CFG_EXTRA_CONFIG_HEADER2 +#endif +#endif + +#if (LZO_VERSION < 0x2080) || !defined(__LZOCONF_H_INCLUDED) +# error "version mismatch" +#endif + +#if (LZO_CC_MSC && (_MSC_VER >= 1000 && _MSC_VER < 1100)) +# pragma warning(disable: 4702) +#endif +#if (LZO_CC_MSC && (_MSC_VER >= 1000)) +# pragma warning(disable: 4127 4701) +# pragma warning(disable: 4514 4710 4711) +#endif +#if (LZO_CC_MSC && (_MSC_VER >= 1300)) +# pragma warning(disable: 4820) +#endif +#if (LZO_CC_MSC && (_MSC_VER >= 1800)) +# pragma warning(disable: 4746) +#endif + +#if (LZO_CC_SUNPROC) +#if !defined(__cplusplus) +# pragma error_messages(off,E_END_OF_LOOP_CODE_NOT_REACHED) +# pragma error_messages(off,E_LOOP_NOT_ENTERED_AT_TOP) +# pragma error_messages(off,E_STATEMENT_NOT_REACHED) +#endif +#endif + +#if defined(__LZO_IN_MINILZO) || (LZO_CFG_FREESTANDING) +#elif 1 +# include +#else +# define LZO_WANT_ACC_INCD_H 1 +#endif +#if defined(LZO_HAVE_CONFIG_H) +# define LZO_CFG_NO_CONFIG_HEADER 1 +#endif + +#if 1 && !defined(LZO_CFG_FREESTANDING) +#if 1 && !defined(HAVE_STRING_H) +#define HAVE_STRING_H 1 +#endif +#if 1 && !defined(HAVE_MEMCMP) +#define HAVE_MEMCMP 1 +#endif +#if 1 && !defined(HAVE_MEMCPY) +#define HAVE_MEMCPY 1 +#endif +#if 1 && !defined(HAVE_MEMMOVE) +#define HAVE_MEMMOVE 1 +#endif +#if 1 && !defined(HAVE_MEMSET) +#define HAVE_MEMSET 1 +#endif +#endif + +#if 1 && defined(HAVE_STRING_H) +#include +#endif + +#if 1 || defined(lzo_int8_t) || defined(lzo_uint8_t) +LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int8_t) == 1) +LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_uint8_t) == 1) +#endif +#if 1 || defined(lzo_int16_t) || defined(lzo_uint16_t) +LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int16_t) == 2) +LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_uint16_t) == 2) +#endif +#if 1 || defined(lzo_int32_t) || defined(lzo_uint32_t) +LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int32_t) == 4) +LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_uint32_t) == 4) +#endif +#if defined(lzo_int64_t) || defined(lzo_uint64_t) +LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int64_t) == 8) +LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_uint64_t) == 8) +#endif + +#if (LZO_CFG_FREESTANDING) +# undef HAVE_MEMCMP +# undef HAVE_MEMCPY +# undef HAVE_MEMMOVE +# undef HAVE_MEMSET +#endif + +#if !(HAVE_MEMCMP) +# undef memcmp +# define memcmp(a,b,c) lzo_memcmp(a,b,c) +#else +# undef lzo_memcmp +# define lzo_memcmp(a,b,c) memcmp(a,b,c) +#endif +#if !(HAVE_MEMCPY) +# undef memcpy +# define memcpy(a,b,c) lzo_memcpy(a,b,c) +#else +# undef lzo_memcpy +# define lzo_memcpy(a,b,c) memcpy(a,b,c) +#endif +#if !(HAVE_MEMMOVE) +# undef memmove +# define memmove(a,b,c) lzo_memmove(a,b,c) +#else +# undef lzo_memmove +# define lzo_memmove(a,b,c) memmove(a,b,c) +#endif +#if !(HAVE_MEMSET) +# undef memset +# define memset(a,b,c) lzo_memset(a,b,c) +#else +# undef lzo_memset +# define lzo_memset(a,b,c) memset(a,b,c) +#endif + +#undef NDEBUG +#if (LZO_CFG_FREESTANDING) +# undef LZO_DEBUG +# define NDEBUG 1 +# undef assert +# define assert(e) ((void)0) +#else +# if !defined(LZO_DEBUG) +# define NDEBUG 1 +# endif +# include +#endif + +#if 0 && defined(__BOUNDS_CHECKING_ON) +# include +#else +# define BOUNDS_CHECKING_OFF_DURING(stmt) stmt +# define BOUNDS_CHECKING_OFF_IN_EXPR(expr) (expr) +#endif + +#if (LZO_CFG_PGO) +# undef __lzo_likely +# undef __lzo_unlikely +# define __lzo_likely(e) (e) +# define __lzo_unlikely(e) (e) +#endif + +#undef _ +#undef __ +#undef ___ +#undef ____ +#undef _p0 +#undef _p1 +#undef _p2 +#undef _p3 +#undef _p4 +#undef _s0 +#undef _s1 +#undef _s2 +#undef _s3 +#undef _s4 +#undef _ww + +#if 1 +# define LZO_BYTE(x) ((unsigned char) (x)) +#else +# define LZO_BYTE(x) ((unsigned char) ((x) & 0xff)) +#endif + +#define LZO_MAX(a,b) ((a) >= (b) ? (a) : (b)) +#define LZO_MIN(a,b) ((a) <= (b) ? (a) : (b)) +#define LZO_MAX3(a,b,c) ((a) >= (b) ? LZO_MAX(a,c) : LZO_MAX(b,c)) +#define LZO_MIN3(a,b,c) ((a) <= (b) ? LZO_MIN(a,c) : LZO_MIN(b,c)) + +#define lzo_sizeof(type) ((lzo_uint) (sizeof(type))) + +#define LZO_HIGH(array) ((lzo_uint) (sizeof(array)/sizeof(*(array)))) + +#define LZO_SIZE(bits) (1u << (bits)) +#define LZO_MASK(bits) (LZO_SIZE(bits) - 1) + +#define LZO_USIZE(bits) ((lzo_uint) 1 << (bits)) +#define LZO_UMASK(bits) (LZO_USIZE(bits) - 1) + +#if !defined(DMUL) +#if 0 + +# define DMUL(a,b) ((lzo_xint) ((lzo_uint32_t)(a) * (lzo_uint32_t)(b))) +#else +# define DMUL(a,b) ((lzo_xint) ((a) * (b))) +#endif +#endif + +#ifndef __LZO_FUNC_H +#define __LZO_FUNC_H 1 + +#if !defined(LZO_BITOPS_USE_ASM_BITSCAN) && !defined(LZO_BITOPS_USE_GNUC_BITSCAN) && !defined(LZO_BITOPS_USE_MSC_BITSCAN) +#if 1 && (LZO_ARCH_AMD64) && (LZO_CC_GNUC && (LZO_CC_GNUC < 0x040000ul)) && (LZO_ASM_SYNTAX_GNUC) +#define LZO_BITOPS_USE_ASM_BITSCAN 1 +#elif (LZO_CC_CLANG || (LZO_CC_GNUC >= 0x030400ul) || (LZO_CC_INTELC_GNUC && (__INTEL_COMPILER >= 1000)) || (LZO_CC_LLVM && (!defined(__llvm_tools_version__) || (__llvm_tools_version__+0 >= 0x010500ul)))) +#define LZO_BITOPS_USE_GNUC_BITSCAN 1 +#elif (LZO_OS_WIN32 || LZO_OS_WIN64) && ((LZO_CC_INTELC_MSC && (__INTEL_COMPILER >= 1010)) || (LZO_CC_MSC && (_MSC_VER >= 1400))) +#define LZO_BITOPS_USE_MSC_BITSCAN 1 +#if (LZO_CC_MSC) && (LZO_ARCH_AMD64 || LZO_ARCH_I386) +#include +#endif +#if (LZO_CC_MSC) && (LZO_ARCH_AMD64 || LZO_ARCH_I386) +#pragma intrinsic(_BitScanReverse) +#pragma intrinsic(_BitScanForward) +#endif +#if (LZO_CC_MSC) && (LZO_ARCH_AMD64) +#pragma intrinsic(_BitScanReverse64) +#pragma intrinsic(_BitScanForward64) +#endif +#endif +#endif + +__lzo_static_forceinline unsigned lzo_bitops_ctlz32_func(lzo_uint32_t v) +{ +#if (LZO_BITOPS_USE_MSC_BITSCAN) && (LZO_ARCH_AMD64 || LZO_ARCH_I386) + unsigned long r; (void) _BitScanReverse(&r, v); return (unsigned) r ^ 31; +#define lzo_bitops_ctlz32(v) lzo_bitops_ctlz32_func(v) +#elif (LZO_BITOPS_USE_ASM_BITSCAN) && (LZO_ARCH_AMD64 || LZO_ARCH_I386) && (LZO_ASM_SYNTAX_GNUC) + lzo_uint32_t r; + __asm__("bsr %1,%0" : "=r" (r) : "rm" (v) __LZO_ASM_CLOBBER_LIST_CC); + return (unsigned) r ^ 31; +#define lzo_bitops_ctlz32(v) lzo_bitops_ctlz32_func(v) +#elif (LZO_BITOPS_USE_GNUC_BITSCAN) && (LZO_SIZEOF_INT == 4) + unsigned r; r = (unsigned) __builtin_clz(v); return r; +#define lzo_bitops_ctlz32(v) ((unsigned) __builtin_clz(v)) +#else + LZO_UNUSED(v); return 0; +#endif +} + +#if defined(lzo_uint64_t) +__lzo_static_forceinline unsigned lzo_bitops_ctlz64_func(lzo_uint64_t v) +{ +#if (LZO_BITOPS_USE_MSC_BITSCAN) && (LZO_ARCH_AMD64) + unsigned long r; (void) _BitScanReverse64(&r, v); return (unsigned) r ^ 63; +#define lzo_bitops_ctlz64(v) lzo_bitops_ctlz64_func(v) +#elif (LZO_BITOPS_USE_ASM_BITSCAN) && (LZO_ARCH_AMD64) && (LZO_ASM_SYNTAX_GNUC) + lzo_uint64_t r; + __asm__("bsr %1,%0" : "=r" (r) : "rm" (v) __LZO_ASM_CLOBBER_LIST_CC); + return (unsigned) r ^ 63; +#define lzo_bitops_ctlz64(v) lzo_bitops_ctlz64_func(v) +#elif (LZO_BITOPS_USE_GNUC_BITSCAN) && (LZO_SIZEOF_LONG == 8) && (LZO_WORDSIZE >= 8) + unsigned r; r = (unsigned) __builtin_clzl(v); return r; +#define lzo_bitops_ctlz64(v) ((unsigned) __builtin_clzl(v)) +#elif (LZO_BITOPS_USE_GNUC_BITSCAN) && (LZO_SIZEOF_LONG_LONG == 8) && (LZO_WORDSIZE >= 8) + unsigned r; r = (unsigned) __builtin_clzll(v); return r; +#define lzo_bitops_ctlz64(v) ((unsigned) __builtin_clzll(v)) +#else + LZO_UNUSED(v); return 0; +#endif +} +#endif + +__lzo_static_forceinline unsigned lzo_bitops_cttz32_func(lzo_uint32_t v) +{ +#if (LZO_BITOPS_USE_MSC_BITSCAN) && (LZO_ARCH_AMD64 || LZO_ARCH_I386) + unsigned long r; (void) _BitScanForward(&r, v); return (unsigned) r; +#define lzo_bitops_cttz32(v) lzo_bitops_cttz32_func(v) +#elif (LZO_BITOPS_USE_ASM_BITSCAN) && (LZO_ARCH_AMD64 || LZO_ARCH_I386) && (LZO_ASM_SYNTAX_GNUC) + lzo_uint32_t r; + __asm__("bsf %1,%0" : "=r" (r) : "rm" (v) __LZO_ASM_CLOBBER_LIST_CC); + return (unsigned) r; +#define lzo_bitops_cttz32(v) lzo_bitops_cttz32_func(v) +#elif (LZO_BITOPS_USE_GNUC_BITSCAN) && (LZO_SIZEOF_INT >= 4) + unsigned r; r = (unsigned) __builtin_ctz(v); return r; +#define lzo_bitops_cttz32(v) ((unsigned) __builtin_ctz(v)) +#else + LZO_UNUSED(v); return 0; +#endif +} + +#if defined(lzo_uint64_t) +__lzo_static_forceinline unsigned lzo_bitops_cttz64_func(lzo_uint64_t v) +{ +#if (LZO_BITOPS_USE_MSC_BITSCAN) && (LZO_ARCH_AMD64) + unsigned long r; (void) _BitScanForward64(&r, v); return (unsigned) r; +#define lzo_bitops_cttz64(v) lzo_bitops_cttz64_func(v) +#elif (LZO_BITOPS_USE_ASM_BITSCAN) && (LZO_ARCH_AMD64) && (LZO_ASM_SYNTAX_GNUC) + lzo_uint64_t r; + __asm__("bsf %1,%0" : "=r" (r) : "rm" (v) __LZO_ASM_CLOBBER_LIST_CC); + return (unsigned) r; +#define lzo_bitops_cttz64(v) lzo_bitops_cttz64_func(v) +#elif (LZO_BITOPS_USE_GNUC_BITSCAN) && (LZO_SIZEOF_LONG >= 8) && (LZO_WORDSIZE >= 8) + unsigned r; r = (unsigned) __builtin_ctzl(v); return r; +#define lzo_bitops_cttz64(v) ((unsigned) __builtin_ctzl(v)) +#elif (LZO_BITOPS_USE_GNUC_BITSCAN) && (LZO_SIZEOF_LONG_LONG >= 8) && (LZO_WORDSIZE >= 8) + unsigned r; r = (unsigned) __builtin_ctzll(v); return r; +#define lzo_bitops_cttz64(v) ((unsigned) __builtin_ctzll(v)) +#else + LZO_UNUSED(v); return 0; +#endif +} +#endif + +#if 1 && (LZO_CC_ARMCC_GNUC || LZO_CC_CLANG || (LZO_CC_GNUC >= 0x020700ul) || LZO_CC_INTELC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE || LZO_CC_PGI) +static void __attribute__((__unused__)) +#else +__lzo_static_forceinline void +#endif +lzo_bitops_unused_funcs(void) +{ + LZO_UNUSED_FUNC(lzo_bitops_ctlz32_func); + LZO_UNUSED_FUNC(lzo_bitops_cttz32_func); +#if defined(lzo_uint64_t) + LZO_UNUSED_FUNC(lzo_bitops_ctlz64_func); + LZO_UNUSED_FUNC(lzo_bitops_cttz64_func); +#endif + LZO_UNUSED_FUNC(lzo_bitops_unused_funcs); +} + +#if defined(__lzo_alignof) && !(LZO_CFG_NO_UNALIGNED) +#ifndef __lzo_memops_tcheck +#define __lzo_memops_tcheck(t,a,b) ((void)0, sizeof(t) == (a) && __lzo_alignof(t) == (b)) +#endif +#endif +#ifndef lzo_memops_TU0p +#define lzo_memops_TU0p void __LZO_MMODEL * +#endif +#ifndef lzo_memops_TU1p +#define lzo_memops_TU1p unsigned char __LZO_MMODEL * +#endif +#ifndef lzo_memops_TU2p +#if (LZO_OPT_UNALIGNED16) +typedef lzo_uint16_t __lzo_may_alias lzo_memops_TU2; +#define lzo_memops_TU2p volatile lzo_memops_TU2 * +#elif defined(__lzo_byte_struct) +__lzo_byte_struct(lzo_memops_TU2_struct,2) +typedef struct lzo_memops_TU2_struct lzo_memops_TU2; +#else +struct lzo_memops_TU2_struct { unsigned char a[2]; } __lzo_may_alias; +typedef struct lzo_memops_TU2_struct lzo_memops_TU2; +#endif +#ifndef lzo_memops_TU2p +#define lzo_memops_TU2p lzo_memops_TU2 * +#endif +#endif +#ifndef lzo_memops_TU4p +#if (LZO_OPT_UNALIGNED32) +typedef lzo_uint32_t __lzo_may_alias lzo_memops_TU4; +#define lzo_memops_TU4p volatile lzo_memops_TU4 __LZO_MMODEL * +#elif defined(__lzo_byte_struct) +__lzo_byte_struct(lzo_memops_TU4_struct,4) +typedef struct lzo_memops_TU4_struct lzo_memops_TU4; +#else +struct lzo_memops_TU4_struct { unsigned char a[4]; } __lzo_may_alias; +typedef struct lzo_memops_TU4_struct lzo_memops_TU4; +#endif +#ifndef lzo_memops_TU4p +#define lzo_memops_TU4p lzo_memops_TU4 __LZO_MMODEL * +#endif +#endif +#ifndef lzo_memops_TU8p +#if (LZO_OPT_UNALIGNED64) +typedef lzo_uint64_t __lzo_may_alias lzo_memops_TU8; +#define lzo_memops_TU8p volatile lzo_memops_TU8 __LZO_MMODEL * +#elif defined(__lzo_byte_struct) +__lzo_byte_struct(lzo_memops_TU8_struct,8) +typedef struct lzo_memops_TU8_struct lzo_memops_TU8; +#else +struct lzo_memops_TU8_struct { unsigned char a[8]; } __lzo_may_alias; +typedef struct lzo_memops_TU8_struct lzo_memops_TU8; +#endif +#ifndef lzo_memops_TU8p +#define lzo_memops_TU8p lzo_memops_TU8 __LZO_MMODEL * +#endif +#endif +#ifndef lzo_memops_set_TU1p +#define lzo_memops_set_TU1p volatile lzo_memops_TU1p +#endif +#ifndef lzo_memops_move_TU1p +#define lzo_memops_move_TU1p lzo_memops_TU1p +#endif +#define LZO_MEMOPS_SET1(dd,cc) \ + LZO_BLOCK_BEGIN \ + lzo_memops_set_TU1p d__1 = (lzo_memops_set_TU1p) (lzo_memops_TU0p) (dd); \ + d__1[0] = LZO_BYTE(cc); \ + LZO_BLOCK_END +#define LZO_MEMOPS_SET2(dd,cc) \ + LZO_BLOCK_BEGIN \ + lzo_memops_set_TU1p d__2 = (lzo_memops_set_TU1p) (lzo_memops_TU0p) (dd); \ + d__2[0] = LZO_BYTE(cc); d__2[1] = LZO_BYTE(cc); \ + LZO_BLOCK_END +#define LZO_MEMOPS_SET3(dd,cc) \ + LZO_BLOCK_BEGIN \ + lzo_memops_set_TU1p d__3 = (lzo_memops_set_TU1p) (lzo_memops_TU0p) (dd); \ + d__3[0] = LZO_BYTE(cc); d__3[1] = LZO_BYTE(cc); d__3[2] = LZO_BYTE(cc); \ + LZO_BLOCK_END +#define LZO_MEMOPS_SET4(dd,cc) \ + LZO_BLOCK_BEGIN \ + lzo_memops_set_TU1p d__4 = (lzo_memops_set_TU1p) (lzo_memops_TU0p) (dd); \ + d__4[0] = LZO_BYTE(cc); d__4[1] = LZO_BYTE(cc); d__4[2] = LZO_BYTE(cc); d__4[3] = LZO_BYTE(cc); \ + LZO_BLOCK_END +#define LZO_MEMOPS_MOVE1(dd,ss) \ + LZO_BLOCK_BEGIN \ + lzo_memops_move_TU1p d__1 = (lzo_memops_move_TU1p) (lzo_memops_TU0p) (dd); \ + const lzo_memops_move_TU1p s__1 = (const lzo_memops_move_TU1p) (const lzo_memops_TU0p) (ss); \ + d__1[0] = s__1[0]; \ + LZO_BLOCK_END +#define LZO_MEMOPS_MOVE2(dd,ss) \ + LZO_BLOCK_BEGIN \ + lzo_memops_move_TU1p d__2 = (lzo_memops_move_TU1p) (lzo_memops_TU0p) (dd); \ + const lzo_memops_move_TU1p s__2 = (const lzo_memops_move_TU1p) (const lzo_memops_TU0p) (ss); \ + d__2[0] = s__2[0]; d__2[1] = s__2[1]; \ + LZO_BLOCK_END +#define LZO_MEMOPS_MOVE3(dd,ss) \ + LZO_BLOCK_BEGIN \ + lzo_memops_move_TU1p d__3 = (lzo_memops_move_TU1p) (lzo_memops_TU0p) (dd); \ + const lzo_memops_move_TU1p s__3 = (const lzo_memops_move_TU1p) (const lzo_memops_TU0p) (ss); \ + d__3[0] = s__3[0]; d__3[1] = s__3[1]; d__3[2] = s__3[2]; \ + LZO_BLOCK_END +#define LZO_MEMOPS_MOVE4(dd,ss) \ + LZO_BLOCK_BEGIN \ + lzo_memops_move_TU1p d__4 = (lzo_memops_move_TU1p) (lzo_memops_TU0p) (dd); \ + const lzo_memops_move_TU1p s__4 = (const lzo_memops_move_TU1p) (const lzo_memops_TU0p) (ss); \ + d__4[0] = s__4[0]; d__4[1] = s__4[1]; d__4[2] = s__4[2]; d__4[3] = s__4[3]; \ + LZO_BLOCK_END +#define LZO_MEMOPS_MOVE8(dd,ss) \ + LZO_BLOCK_BEGIN \ + lzo_memops_move_TU1p d__8 = (lzo_memops_move_TU1p) (lzo_memops_TU0p) (dd); \ + const lzo_memops_move_TU1p s__8 = (const lzo_memops_move_TU1p) (const lzo_memops_TU0p) (ss); \ + d__8[0] = s__8[0]; d__8[1] = s__8[1]; d__8[2] = s__8[2]; d__8[3] = s__8[3]; \ + d__8[4] = s__8[4]; d__8[5] = s__8[5]; d__8[6] = s__8[6]; d__8[7] = s__8[7]; \ + LZO_BLOCK_END +LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(*(lzo_memops_TU1p)0)==1) +#define LZO_MEMOPS_COPY1(dd,ss) LZO_MEMOPS_MOVE1(dd,ss) +#if (LZO_OPT_UNALIGNED16) +LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(*(lzo_memops_TU2p)0)==2) +#define LZO_MEMOPS_COPY2(dd,ss) \ + * (lzo_memops_TU2p) (lzo_memops_TU0p) (dd) = * (const lzo_memops_TU2p) (const lzo_memops_TU0p) (ss) +#elif defined(__lzo_memops_tcheck) +#define LZO_MEMOPS_COPY2(dd,ss) \ + LZO_BLOCK_BEGIN if (__lzo_memops_tcheck(lzo_memops_TU2,2,1)) { \ + * (lzo_memops_TU2p) (lzo_memops_TU0p) (dd) = * (const lzo_memops_TU2p) (const lzo_memops_TU0p) (ss); \ + } else { LZO_MEMOPS_MOVE2(dd,ss); } LZO_BLOCK_END +#else +#define LZO_MEMOPS_COPY2(dd,ss) LZO_MEMOPS_MOVE2(dd,ss) +#endif +#if (LZO_OPT_UNALIGNED32) +LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(*(lzo_memops_TU4p)0)==4) +#define LZO_MEMOPS_COPY4(dd,ss) \ + * (lzo_memops_TU4p) (lzo_memops_TU0p) (dd) = * (const lzo_memops_TU4p) (const lzo_memops_TU0p) (ss) +#elif defined(__lzo_memops_tcheck) +#define LZO_MEMOPS_COPY4(dd,ss) \ + LZO_BLOCK_BEGIN if (__lzo_memops_tcheck(lzo_memops_TU4,4,1)) { \ + * (lzo_memops_TU4p) (lzo_memops_TU0p) (dd) = * (const lzo_memops_TU4p) (const lzo_memops_TU0p) (ss); \ + } else { LZO_MEMOPS_MOVE4(dd,ss); } LZO_BLOCK_END +#else +#define LZO_MEMOPS_COPY4(dd,ss) LZO_MEMOPS_MOVE4(dd,ss) +#endif +#if (LZO_WORDSIZE != 8) +#define LZO_MEMOPS_COPY8(dd,ss) \ + LZO_BLOCK_BEGIN LZO_MEMOPS_COPY4(dd,ss); LZO_MEMOPS_COPY4((lzo_memops_TU1p)(lzo_memops_TU0p)(dd)+4,(const lzo_memops_TU1p)(const lzo_memops_TU0p)(ss)+4); LZO_BLOCK_END +#else +#if (LZO_OPT_UNALIGNED64) +LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(*(lzo_memops_TU8p)0)==8) +#define LZO_MEMOPS_COPY8(dd,ss) \ + * (lzo_memops_TU8p) (lzo_memops_TU0p) (dd) = * (const lzo_memops_TU8p) (const lzo_memops_TU0p) (ss) +#elif (LZO_OPT_UNALIGNED32) +#define LZO_MEMOPS_COPY8(dd,ss) \ + LZO_BLOCK_BEGIN LZO_MEMOPS_COPY4(dd,ss); LZO_MEMOPS_COPY4((lzo_memops_TU1p)(lzo_memops_TU0p)(dd)+4,(const lzo_memops_TU1p)(const lzo_memops_TU0p)(ss)+4); LZO_BLOCK_END +#elif defined(__lzo_memops_tcheck) +#define LZO_MEMOPS_COPY8(dd,ss) \ + LZO_BLOCK_BEGIN if (__lzo_memops_tcheck(lzo_memops_TU8,8,1)) { \ + * (lzo_memops_TU8p) (lzo_memops_TU0p) (dd) = * (const lzo_memops_TU8p) (const lzo_memops_TU0p) (ss); \ + } else { LZO_MEMOPS_MOVE8(dd,ss); } LZO_BLOCK_END +#else +#define LZO_MEMOPS_COPY8(dd,ss) LZO_MEMOPS_MOVE8(dd,ss) +#endif +#endif +#define LZO_MEMOPS_COPYN(dd,ss,nn) \ + LZO_BLOCK_BEGIN \ + lzo_memops_TU1p d__n = (lzo_memops_TU1p) (lzo_memops_TU0p) (dd); \ + const lzo_memops_TU1p s__n = (const lzo_memops_TU1p) (const lzo_memops_TU0p) (ss); \ + lzo_uint n__n = (nn); \ + while ((void)0, n__n >= 8) { LZO_MEMOPS_COPY8(d__n, s__n); d__n += 8; s__n += 8; n__n -= 8; } \ + if ((void)0, n__n >= 4) { LZO_MEMOPS_COPY4(d__n, s__n); d__n += 4; s__n += 4; n__n -= 4; } \ + if ((void)0, n__n > 0) do { *d__n++ = *s__n++; } while (--n__n > 0); \ + LZO_BLOCK_END + +__lzo_static_forceinline lzo_uint16_t lzo_memops_get_le16(const lzo_voidp ss) +{ + lzo_uint16_t v; +#if (LZO_ABI_LITTLE_ENDIAN) + LZO_MEMOPS_COPY2(&v, ss); +#elif (LZO_OPT_UNALIGNED16 && LZO_ARCH_POWERPC && LZO_ABI_BIG_ENDIAN) && (LZO_ASM_SYNTAX_GNUC) + const lzo_memops_TU2p s = (const lzo_memops_TU2p) ss; + unsigned long vv; + __asm__("lhbrx %0,0,%1" : "=r" (vv) : "r" (s), "m" (*s)); + v = (lzo_uint16_t) vv; +#else + const lzo_memops_TU1p s = (const lzo_memops_TU1p) ss; + v = (lzo_uint16_t) (((lzo_uint16_t)s[0]) | ((lzo_uint16_t)s[1] << 8)); +#endif + return v; +} +#if (LZO_OPT_UNALIGNED16) && (LZO_ABI_LITTLE_ENDIAN) +#define LZO_MEMOPS_GET_LE16(ss) * (const lzo_memops_TU2p) (const lzo_memops_TU0p) (ss) +#else +#define LZO_MEMOPS_GET_LE16(ss) lzo_memops_get_le16(ss) +#endif + +__lzo_static_forceinline lzo_uint32_t lzo_memops_get_le32(const lzo_voidp ss) +{ + lzo_uint32_t v; +#if (LZO_ABI_LITTLE_ENDIAN) + LZO_MEMOPS_COPY4(&v, ss); +#elif (LZO_OPT_UNALIGNED32 && LZO_ARCH_POWERPC && LZO_ABI_BIG_ENDIAN) && (LZO_ASM_SYNTAX_GNUC) + const lzo_memops_TU4p s = (const lzo_memops_TU4p) ss; + unsigned long vv; + __asm__("lwbrx %0,0,%1" : "=r" (vv) : "r" (s), "m" (*s)); + v = (lzo_uint32_t) vv; +#else + const lzo_memops_TU1p s = (const lzo_memops_TU1p) ss; + v = (lzo_uint32_t) (((lzo_uint32_t)s[0]) | ((lzo_uint32_t)s[1] << 8) | ((lzo_uint32_t)s[2] << 16) | ((lzo_uint32_t)s[3] << 24)); +#endif + return v; +} +#if (LZO_OPT_UNALIGNED32) && (LZO_ABI_LITTLE_ENDIAN) +#define LZO_MEMOPS_GET_LE32(ss) * (const lzo_memops_TU4p) (const lzo_memops_TU0p) (ss) +#else +#define LZO_MEMOPS_GET_LE32(ss) lzo_memops_get_le32(ss) +#endif + +#if (LZO_OPT_UNALIGNED64) && (LZO_ABI_LITTLE_ENDIAN) +#define LZO_MEMOPS_GET_LE64(ss) * (const lzo_memops_TU8p) (const lzo_memops_TU0p) (ss) +#endif + +__lzo_static_forceinline lzo_uint16_t lzo_memops_get_ne16(const lzo_voidp ss) +{ + lzo_uint16_t v; + LZO_MEMOPS_COPY2(&v, ss); + return v; +} +#if (LZO_OPT_UNALIGNED16) +#define LZO_MEMOPS_GET_NE16(ss) * (const lzo_memops_TU2p) (const lzo_memops_TU0p) (ss) +#else +#define LZO_MEMOPS_GET_NE16(ss) lzo_memops_get_ne16(ss) +#endif + +__lzo_static_forceinline lzo_uint32_t lzo_memops_get_ne32(const lzo_voidp ss) +{ + lzo_uint32_t v; + LZO_MEMOPS_COPY4(&v, ss); + return v; +} +#if (LZO_OPT_UNALIGNED32) +#define LZO_MEMOPS_GET_NE32(ss) * (const lzo_memops_TU4p) (const lzo_memops_TU0p) (ss) +#else +#define LZO_MEMOPS_GET_NE32(ss) lzo_memops_get_ne32(ss) +#endif + +#if (LZO_OPT_UNALIGNED64) +#define LZO_MEMOPS_GET_NE64(ss) * (const lzo_memops_TU8p) (const lzo_memops_TU0p) (ss) +#endif + +__lzo_static_forceinline void lzo_memops_put_le16(lzo_voidp dd, lzo_uint16_t vv) +{ +#if (LZO_ABI_LITTLE_ENDIAN) + LZO_MEMOPS_COPY2(dd, &vv); +#elif (LZO_OPT_UNALIGNED16 && LZO_ARCH_POWERPC && LZO_ABI_BIG_ENDIAN) && (LZO_ASM_SYNTAX_GNUC) + lzo_memops_TU2p d = (lzo_memops_TU2p) dd; + unsigned long v = vv; + __asm__("sthbrx %2,0,%1" : "=m" (*d) : "r" (d), "r" (v)); +#else + lzo_memops_TU1p d = (lzo_memops_TU1p) dd; + d[0] = LZO_BYTE((vv ) & 0xff); + d[1] = LZO_BYTE((vv >> 8) & 0xff); +#endif +} +#if (LZO_OPT_UNALIGNED16) && (LZO_ABI_LITTLE_ENDIAN) +#define LZO_MEMOPS_PUT_LE16(dd,vv) (* (lzo_memops_TU2p) (lzo_memops_TU0p) (dd) = (vv)) +#else +#define LZO_MEMOPS_PUT_LE16(dd,vv) lzo_memops_put_le16(dd,vv) +#endif + +__lzo_static_forceinline void lzo_memops_put_le32(lzo_voidp dd, lzo_uint32_t vv) +{ +#if (LZO_ABI_LITTLE_ENDIAN) + LZO_MEMOPS_COPY4(dd, &vv); +#elif (LZO_OPT_UNALIGNED32 && LZO_ARCH_POWERPC && LZO_ABI_BIG_ENDIAN) && (LZO_ASM_SYNTAX_GNUC) + lzo_memops_TU4p d = (lzo_memops_TU4p) dd; + unsigned long v = vv; + __asm__("stwbrx %2,0,%1" : "=m" (*d) : "r" (d), "r" (v)); +#else + lzo_memops_TU1p d = (lzo_memops_TU1p) dd; + d[0] = LZO_BYTE((vv ) & 0xff); + d[1] = LZO_BYTE((vv >> 8) & 0xff); + d[2] = LZO_BYTE((vv >> 16) & 0xff); + d[3] = LZO_BYTE((vv >> 24) & 0xff); +#endif +} +#if (LZO_OPT_UNALIGNED32) && (LZO_ABI_LITTLE_ENDIAN) +#define LZO_MEMOPS_PUT_LE32(dd,vv) (* (lzo_memops_TU4p) (lzo_memops_TU0p) (dd) = (vv)) +#else +#define LZO_MEMOPS_PUT_LE32(dd,vv) lzo_memops_put_le32(dd,vv) +#endif + +__lzo_static_forceinline void lzo_memops_put_ne16(lzo_voidp dd, lzo_uint16_t vv) +{ + LZO_MEMOPS_COPY2(dd, &vv); +} +#if (LZO_OPT_UNALIGNED16) +#define LZO_MEMOPS_PUT_NE16(dd,vv) (* (lzo_memops_TU2p) (lzo_memops_TU0p) (dd) = (vv)) +#else +#define LZO_MEMOPS_PUT_NE16(dd,vv) lzo_memops_put_ne16(dd,vv) +#endif + +__lzo_static_forceinline void lzo_memops_put_ne32(lzo_voidp dd, lzo_uint32_t vv) +{ + LZO_MEMOPS_COPY4(dd, &vv); +} +#if (LZO_OPT_UNALIGNED32) +#define LZO_MEMOPS_PUT_NE32(dd,vv) (* (lzo_memops_TU4p) (lzo_memops_TU0p) (dd) = (vv)) +#else +#define LZO_MEMOPS_PUT_NE32(dd,vv) lzo_memops_put_ne32(dd,vv) +#endif + +#if 1 && (LZO_CC_ARMCC_GNUC || LZO_CC_CLANG || (LZO_CC_GNUC >= 0x020700ul) || LZO_CC_INTELC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE || LZO_CC_PGI) +static void __attribute__((__unused__)) +#else +__lzo_static_forceinline void +#endif +lzo_memops_unused_funcs(void) +{ + LZO_UNUSED_FUNC(lzo_memops_get_le16); + LZO_UNUSED_FUNC(lzo_memops_get_le32); + LZO_UNUSED_FUNC(lzo_memops_get_ne16); + LZO_UNUSED_FUNC(lzo_memops_get_ne32); + LZO_UNUSED_FUNC(lzo_memops_put_le16); + LZO_UNUSED_FUNC(lzo_memops_put_le32); + LZO_UNUSED_FUNC(lzo_memops_put_ne16); + LZO_UNUSED_FUNC(lzo_memops_put_ne32); + LZO_UNUSED_FUNC(lzo_memops_unused_funcs); +} + +#endif + +#ifndef UA_SET1 +#define UA_SET1 LZO_MEMOPS_SET1 +#endif +#ifndef UA_SET2 +#define UA_SET2 LZO_MEMOPS_SET2 +#endif +#ifndef UA_SET3 +#define UA_SET3 LZO_MEMOPS_SET3 +#endif +#ifndef UA_SET4 +#define UA_SET4 LZO_MEMOPS_SET4 +#endif +#ifndef UA_MOVE1 +#define UA_MOVE1 LZO_MEMOPS_MOVE1 +#endif +#ifndef UA_MOVE2 +#define UA_MOVE2 LZO_MEMOPS_MOVE2 +#endif +#ifndef UA_MOVE3 +#define UA_MOVE3 LZO_MEMOPS_MOVE3 +#endif +#ifndef UA_MOVE4 +#define UA_MOVE4 LZO_MEMOPS_MOVE4 +#endif +#ifndef UA_MOVE8 +#define UA_MOVE8 LZO_MEMOPS_MOVE8 +#endif +#ifndef UA_COPY1 +#define UA_COPY1 LZO_MEMOPS_COPY1 +#endif +#ifndef UA_COPY2 +#define UA_COPY2 LZO_MEMOPS_COPY2 +#endif +#ifndef UA_COPY3 +#define UA_COPY3 LZO_MEMOPS_COPY3 +#endif +#ifndef UA_COPY4 +#define UA_COPY4 LZO_MEMOPS_COPY4 +#endif +#ifndef UA_COPY8 +#define UA_COPY8 LZO_MEMOPS_COPY8 +#endif +#ifndef UA_COPYN +#define UA_COPYN LZO_MEMOPS_COPYN +#endif +#ifndef UA_COPYN_X +#define UA_COPYN_X LZO_MEMOPS_COPYN +#endif +#ifndef UA_GET_LE16 +#define UA_GET_LE16 LZO_MEMOPS_GET_LE16 +#endif +#ifndef UA_GET_LE32 +#define UA_GET_LE32 LZO_MEMOPS_GET_LE32 +#endif +#ifdef LZO_MEMOPS_GET_LE64 +#ifndef UA_GET_LE64 +#define UA_GET_LE64 LZO_MEMOPS_GET_LE64 +#endif +#endif +#ifndef UA_GET_NE16 +#define UA_GET_NE16 LZO_MEMOPS_GET_NE16 +#endif +#ifndef UA_GET_NE32 +#define UA_GET_NE32 LZO_MEMOPS_GET_NE32 +#endif +#ifdef LZO_MEMOPS_GET_NE64 +#ifndef UA_GET_NE64 +#define UA_GET_NE64 LZO_MEMOPS_GET_NE64 +#endif +#endif +#ifndef UA_PUT_LE16 +#define UA_PUT_LE16 LZO_MEMOPS_PUT_LE16 +#endif +#ifndef UA_PUT_LE32 +#define UA_PUT_LE32 LZO_MEMOPS_PUT_LE32 +#endif +#ifndef UA_PUT_NE16 +#define UA_PUT_NE16 LZO_MEMOPS_PUT_NE16 +#endif +#ifndef UA_PUT_NE32 +#define UA_PUT_NE32 LZO_MEMOPS_PUT_NE32 +#endif + +#define MEMCPY8_DS(dest,src,len) \ + lzo_memcpy(dest,src,len); dest += len; src += len + +#define BZERO8_PTR(s,l,n) \ + lzo_memset((lzo_voidp)(s),0,(lzo_uint)(l)*(n)) + +#define MEMCPY_DS(dest,src,len) \ + do *dest++ = *src++; while (--len > 0) + +LZO_EXTERN(const lzo_bytep) lzo_copyright(void); + +#ifndef __LZO_PTR_H +#define __LZO_PTR_H 1 + +#ifdef __cplusplus +extern "C" { +#endif + +#if (LZO_ARCH_I086) +#error "LZO_ARCH_I086 is unsupported" +#elif (LZO_MM_PVP) +#error "LZO_MM_PVP is unsupported" +#else +#define PTR(a) ((lzo_uintptr_t) (a)) +#define PTR_LINEAR(a) PTR(a) +#define PTR_ALIGNED_4(a) ((PTR_LINEAR(a) & 3) == 0) +#define PTR_ALIGNED_8(a) ((PTR_LINEAR(a) & 7) == 0) +#define PTR_ALIGNED2_4(a,b) (((PTR_LINEAR(a) | PTR_LINEAR(b)) & 3) == 0) +#define PTR_ALIGNED2_8(a,b) (((PTR_LINEAR(a) | PTR_LINEAR(b)) & 7) == 0) +#endif + +#define PTR_LT(a,b) (PTR(a) < PTR(b)) +#define PTR_GE(a,b) (PTR(a) >= PTR(b)) +#define PTR_DIFF(a,b) (PTR(a) - PTR(b)) +#define pd(a,b) ((lzo_uint) ((a)-(b))) + +LZO_EXTERN(lzo_uintptr_t) +__lzo_ptr_linear(const lzo_voidp ptr); + +typedef union +{ + char a_char; + unsigned char a_uchar; + short a_short; + unsigned short a_ushort; + int a_int; + unsigned int a_uint; + long a_long; + unsigned long a_ulong; + lzo_int a_lzo_int; + lzo_uint a_lzo_uint; + lzo_xint a_lzo_xint; + lzo_int16_t a_lzo_int16_t; + lzo_uint16_t a_lzo_uint16_t; + lzo_int32_t a_lzo_int32_t; + lzo_uint32_t a_lzo_uint32_t; +#if defined(lzo_uint64_t) + lzo_int64_t a_lzo_int64_t; + lzo_uint64_t a_lzo_uint64_t; +#endif + size_t a_size_t; + ptrdiff_t a_ptrdiff_t; + lzo_uintptr_t a_lzo_uintptr_t; + void * a_void_p; + char * a_char_p; + unsigned char * a_uchar_p; + const void * a_c_void_p; + const char * a_c_char_p; + const unsigned char * a_c_uchar_p; + lzo_voidp a_lzo_voidp; + lzo_bytep a_lzo_bytep; + const lzo_voidp a_c_lzo_voidp; + const lzo_bytep a_c_lzo_bytep; +} +lzo_full_align_t; + +#ifdef __cplusplus +} +#endif + +#endif + +#ifndef LZO_DETERMINISTIC +#define LZO_DETERMINISTIC 1 +#endif + +#ifndef LZO_DICT_USE_PTR +#define LZO_DICT_USE_PTR 1 +#endif + +#if (LZO_DICT_USE_PTR) +# define lzo_dict_t const lzo_bytep +# define lzo_dict_p lzo_dict_t * +#else +# define lzo_dict_t lzo_uint +# define lzo_dict_p lzo_dict_t * +#endif + +#endif + +#if !defined(MINILZO_CFG_SKIP_LZO_PTR) + +LZO_PUBLIC(lzo_uintptr_t) +__lzo_ptr_linear(const lzo_voidp ptr) +{ + lzo_uintptr_t p; + +#if (LZO_ARCH_I086) +#error "LZO_ARCH_I086 is unsupported" +#elif (LZO_MM_PVP) +#error "LZO_MM_PVP is unsupported" +#else + p = (lzo_uintptr_t) PTR_LINEAR(ptr); +#endif + + return p; +} + +LZO_PUBLIC(unsigned) +__lzo_align_gap(const lzo_voidp ptr, lzo_uint size) +{ +#if (__LZO_UINTPTR_T_IS_POINTER) +#error "__LZO_UINTPTR_T_IS_POINTER is unsupported" +#else + lzo_uintptr_t p, n; + p = __lzo_ptr_linear(ptr); + n = (((p + size - 1) / size) * size) - p; +#endif + + assert(size > 0); + assert((long)n >= 0); + assert(n <= size); + return (unsigned)n; +} + +#endif +#if !defined(MINILZO_CFG_SKIP_LZO_UTIL) + +/* If you use the LZO library in a product, I would appreciate that you + * keep this copyright string in the executable of your product. + */ + +static const char __lzo_copyright[] = +#if !defined(__LZO_IN_MINLZO) + LZO_VERSION_STRING; +#else + "\r\n\n" + "LZO data compression library.\n" + "$Copyright: LZO Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer\n" + "\n" + "http://www.oberhumer.com $\n\n" + "$Id: LZO version: v" LZO_VERSION_STRING ", " LZO_VERSION_DATE " $\n" + "$Info: " LZO_INFO_STRING " $\n"; +#endif + +LZO_PUBLIC(const lzo_bytep) +lzo_copyright(void) +{ + return (const lzo_bytep) __lzo_copyright; +} + +LZO_PUBLIC(unsigned) +lzo_version(void) +{ + return LZO_VERSION; +} + +LZO_PUBLIC(const char *) +lzo_version_string(void) +{ + return LZO_VERSION_STRING; +} + +LZO_PUBLIC(const char *) +lzo_version_date(void) +{ + return LZO_VERSION_DATE; +} + +LZO_PUBLIC(const lzo_charp) +_lzo_version_string(void) +{ + return LZO_VERSION_STRING; +} + +LZO_PUBLIC(const lzo_charp) +_lzo_version_date(void) +{ + return LZO_VERSION_DATE; +} + +#define LZO_BASE 65521u +#define LZO_NMAX 5552 + +#define LZO_DO1(buf,i) s1 += buf[i]; s2 += s1 +#define LZO_DO2(buf,i) LZO_DO1(buf,i); LZO_DO1(buf,i+1) +#define LZO_DO4(buf,i) LZO_DO2(buf,i); LZO_DO2(buf,i+2) +#define LZO_DO8(buf,i) LZO_DO4(buf,i); LZO_DO4(buf,i+4) +#define LZO_DO16(buf,i) LZO_DO8(buf,i); LZO_DO8(buf,i+8) + +LZO_PUBLIC(lzo_uint32_t) +lzo_adler32(lzo_uint32_t adler, const lzo_bytep buf, lzo_uint len) +{ + lzo_uint32_t s1 = adler & 0xffff; + lzo_uint32_t s2 = (adler >> 16) & 0xffff; + unsigned k; + + if (buf == NULL) + return 1; + + while (len > 0) + { + k = len < LZO_NMAX ? (unsigned) len : LZO_NMAX; + len -= k; + if (k >= 16) do + { + LZO_DO16(buf,0); + buf += 16; + k -= 16; + } while (k >= 16); + if (k != 0) do + { + s1 += *buf++; + s2 += s1; + } while (--k > 0); + s1 %= LZO_BASE; + s2 %= LZO_BASE; + } + return (s2 << 16) | s1; +} + +#undef LZO_DO1 +#undef LZO_DO2 +#undef LZO_DO4 +#undef LZO_DO8 +#undef LZO_DO16 + +#endif +#if !defined(MINILZO_CFG_SKIP_LZO_STRING) +#undef lzo_memcmp +#undef lzo_memcpy +#undef lzo_memmove +#undef lzo_memset +#if !defined(__LZO_MMODEL_HUGE) +# undef LZO_HAVE_MM_HUGE_PTR +#endif +#define lzo_hsize_t lzo_uint +#define lzo_hvoid_p lzo_voidp +#define lzo_hbyte_p lzo_bytep +#define LZOLIB_PUBLIC(r,f) LZO_PUBLIC(r) f +#define lzo_hmemcmp lzo_memcmp +#define lzo_hmemcpy lzo_memcpy +#define lzo_hmemmove lzo_memmove +#define lzo_hmemset lzo_memset +#define __LZOLIB_HMEMCPY_CH_INCLUDED 1 +#if !defined(LZOLIB_PUBLIC) +# define LZOLIB_PUBLIC(r,f) r __LZOLIB_FUNCNAME(f) +#endif +LZOLIB_PUBLIC(int, lzo_hmemcmp) (const lzo_hvoid_p s1, const lzo_hvoid_p s2, lzo_hsize_t len) +{ +#if (LZO_HAVE_MM_HUGE_PTR) || !(HAVE_MEMCMP) + const lzo_hbyte_p p1 = LZO_STATIC_CAST(const lzo_hbyte_p, s1); + const lzo_hbyte_p p2 = LZO_STATIC_CAST(const lzo_hbyte_p, s2); + if __lzo_likely(len > 0) do + { + int d = *p1 - *p2; + if (d != 0) + return d; + p1++; p2++; + } while __lzo_likely(--len > 0); + return 0; +#else + return memcmp(s1, s2, len); +#endif +} +LZOLIB_PUBLIC(lzo_hvoid_p, lzo_hmemcpy) (lzo_hvoid_p dest, const lzo_hvoid_p src, lzo_hsize_t len) +{ +#if (LZO_HAVE_MM_HUGE_PTR) || !(HAVE_MEMCPY) + lzo_hbyte_p p1 = LZO_STATIC_CAST(lzo_hbyte_p, dest); + const lzo_hbyte_p p2 = LZO_STATIC_CAST(const lzo_hbyte_p, src); + if (!(len > 0) || p1 == p2) + return dest; + do + *p1++ = *p2++; + while __lzo_likely(--len > 0); + return dest; +#else + return memcpy(dest, src, len); +#endif +} +LZOLIB_PUBLIC(lzo_hvoid_p, lzo_hmemmove) (lzo_hvoid_p dest, const lzo_hvoid_p src, lzo_hsize_t len) +{ +#if (LZO_HAVE_MM_HUGE_PTR) || !(HAVE_MEMMOVE) + lzo_hbyte_p p1 = LZO_STATIC_CAST(lzo_hbyte_p, dest); + const lzo_hbyte_p p2 = LZO_STATIC_CAST(const lzo_hbyte_p, src); + if (!(len > 0) || p1 == p2) + return dest; + if (p1 < p2) + { + do + *p1++ = *p2++; + while __lzo_likely(--len > 0); + } + else + { + p1 += len; + p2 += len; + do + *--p1 = *--p2; + while __lzo_likely(--len > 0); + } + return dest; +#else + return memmove(dest, src, len); +#endif +} +LZOLIB_PUBLIC(lzo_hvoid_p, lzo_hmemset) (lzo_hvoid_p s, int cc, lzo_hsize_t len) +{ +#if (LZO_HAVE_MM_HUGE_PTR) || !(HAVE_MEMSET) + lzo_hbyte_p p = LZO_STATIC_CAST(lzo_hbyte_p, s); + unsigned char c = LZO_ITRUNC(unsigned char, cc); + if __lzo_likely(len > 0) do + *p++ = c; + while __lzo_likely(--len > 0); + return s; +#else + return memset(s, cc, len); +#endif +} +#undef LZOLIB_PUBLIC +#endif +#if !defined(MINILZO_CFG_SKIP_LZO_INIT) + +#if !defined(__LZO_IN_MINILZO) + +#define LZO_WANT_ACC_CHK_CH 1 +#undef LZOCHK_ASSERT + + LZOCHK_ASSERT((LZO_UINT32_C(1) << (int)(8*sizeof(LZO_UINT32_C(1))-1)) > 0) + LZOCHK_ASSERT_IS_SIGNED_T(lzo_int) + LZOCHK_ASSERT_IS_UNSIGNED_T(lzo_uint) +#if !(__LZO_UINTPTR_T_IS_POINTER) + LZOCHK_ASSERT_IS_UNSIGNED_T(lzo_uintptr_t) +#endif + LZOCHK_ASSERT(sizeof(lzo_uintptr_t) >= sizeof(lzo_voidp)) + LZOCHK_ASSERT_IS_UNSIGNED_T(lzo_xint) + +#endif +#undef LZOCHK_ASSERT + +union lzo_config_check_union { + lzo_uint a[2]; + unsigned char b[2*LZO_MAX(8,sizeof(lzo_uint))]; +#if defined(lzo_uint64_t) + lzo_uint64_t c[2]; +#endif +}; + +#if 0 +#define u2p(ptr,off) ((lzo_voidp) (((lzo_bytep)(lzo_voidp)(ptr)) + (off))) +#else +static __lzo_noinline lzo_voidp u2p(lzo_voidp ptr, lzo_uint off) +{ + return (lzo_voidp) ((lzo_bytep) ptr + off); +} +#endif + +LZO_PUBLIC(int) +_lzo_config_check(void) +{ +#if (LZO_CC_CLANG && (LZO_CC_CLANG >= 0x030100ul && LZO_CC_CLANG < 0x030300ul)) +# if 0 + volatile +# endif +#endif + union lzo_config_check_union u; + lzo_voidp p; + unsigned r = 1; + + u.a[0] = u.a[1] = 0; + p = u2p(&u, 0); + r &= ((* (lzo_bytep) p) == 0); +#if !(LZO_CFG_NO_CONFIG_CHECK) +#if (LZO_ABI_BIG_ENDIAN) + u.a[0] = u.a[1] = 0; u.b[sizeof(lzo_uint) - 1] = 128; + p = u2p(&u, 0); + r &= ((* (lzo_uintp) p) == 128); +#endif +#if (LZO_ABI_LITTLE_ENDIAN) + u.a[0] = u.a[1] = 0; u.b[0] = 128; + p = u2p(&u, 0); + r &= ((* (lzo_uintp) p) == 128); +#endif + u.a[0] = u.a[1] = 0; + u.b[0] = 1; u.b[3] = 2; + p = u2p(&u, 1); + r &= UA_GET_NE16(p) == 0; + r &= UA_GET_LE16(p) == 0; + u.b[1] = 128; + r &= UA_GET_LE16(p) == 128; + u.b[2] = 129; + r &= UA_GET_LE16(p) == LZO_UINT16_C(0x8180); +#if (LZO_ABI_BIG_ENDIAN) + r &= UA_GET_NE16(p) == LZO_UINT16_C(0x8081); +#endif +#if (LZO_ABI_LITTLE_ENDIAN) + r &= UA_GET_NE16(p) == LZO_UINT16_C(0x8180); +#endif + u.a[0] = u.a[1] = 0; + u.b[0] = 3; u.b[5] = 4; + p = u2p(&u, 1); + r &= UA_GET_NE32(p) == 0; + r &= UA_GET_LE32(p) == 0; + u.b[1] = 128; + r &= UA_GET_LE32(p) == 128; + u.b[2] = 129; u.b[3] = 130; u.b[4] = 131; + r &= UA_GET_LE32(p) == LZO_UINT32_C(0x83828180); +#if (LZO_ABI_BIG_ENDIAN) + r &= UA_GET_NE32(p) == LZO_UINT32_C(0x80818283); +#endif +#if (LZO_ABI_LITTLE_ENDIAN) + r &= UA_GET_NE32(p) == LZO_UINT32_C(0x83828180); +#endif +#if defined(UA_GET_NE64) + u.c[0] = u.c[1] = 0; + u.b[0] = 5; u.b[9] = 6; + p = u2p(&u, 1); + u.c[0] = u.c[1] = 0; + r &= UA_GET_NE64(p) == 0; +#if defined(UA_GET_LE64) + r &= UA_GET_LE64(p) == 0; + u.b[1] = 128; + r &= UA_GET_LE64(p) == 128; +#endif +#endif +#if defined(lzo_bitops_ctlz32) + { unsigned i = 0; lzo_uint32_t v; + for (v = 1; v != 0 && r == 1; v <<= 1, i++) { + r &= lzo_bitops_ctlz32(v) == 31 - i; + r &= lzo_bitops_ctlz32_func(v) == 31 - i; + }} +#endif +#if defined(lzo_bitops_ctlz64) + { unsigned i = 0; lzo_uint64_t v; + for (v = 1; v != 0 && r == 1; v <<= 1, i++) { + r &= lzo_bitops_ctlz64(v) == 63 - i; + r &= lzo_bitops_ctlz64_func(v) == 63 - i; + }} +#endif +#if defined(lzo_bitops_cttz32) + { unsigned i = 0; lzo_uint32_t v; + for (v = 1; v != 0 && r == 1; v <<= 1, i++) { + r &= lzo_bitops_cttz32(v) == i; + r &= lzo_bitops_cttz32_func(v) == i; + }} +#endif +#if defined(lzo_bitops_cttz64) + { unsigned i = 0; lzo_uint64_t v; + for (v = 1; v != 0 && r == 1; v <<= 1, i++) { + r &= lzo_bitops_cttz64(v) == i; + r &= lzo_bitops_cttz64_func(v) == i; + }} +#endif +#endif + LZO_UNUSED_FUNC(lzo_bitops_unused_funcs); + + return r == 1 ? LZO_E_OK : LZO_E_ERROR; +} + +LZO_PUBLIC(int) +__lzo_init_v2(unsigned v, int s1, int s2, int s3, int s4, int s5, + int s6, int s7, int s8, int s9) +{ + int r; + +#if defined(__LZO_IN_MINILZO) +#elif (LZO_CC_MSC && ((_MSC_VER) < 700)) +#else +#define LZO_WANT_ACC_CHK_CH 1 +#undef LZOCHK_ASSERT +#define LZOCHK_ASSERT(expr) LZO_COMPILE_TIME_ASSERT(expr) +#endif +#undef LZOCHK_ASSERT + + if (v == 0) + return LZO_E_ERROR; + + r = (s1 == -1 || s1 == (int) sizeof(short)) && + (s2 == -1 || s2 == (int) sizeof(int)) && + (s3 == -1 || s3 == (int) sizeof(long)) && + (s4 == -1 || s4 == (int) sizeof(lzo_uint32_t)) && + (s5 == -1 || s5 == (int) sizeof(lzo_uint)) && + (s6 == -1 || s6 == (int) lzo_sizeof_dict_t) && + (s7 == -1 || s7 == (int) sizeof(char *)) && + (s8 == -1 || s8 == (int) sizeof(lzo_voidp)) && + (s9 == -1 || s9 == (int) sizeof(lzo_callback_t)); + if (!r) + return LZO_E_ERROR; + + r = _lzo_config_check(); + if (r != LZO_E_OK) + return r; + + return r; +} + +#if !defined(__LZO_IN_MINILZO) + +#if (LZO_OS_WIN16 && LZO_CC_WATCOMC) && defined(__SW_BD) + +#if 0 +BOOL FAR PASCAL LibMain ( HANDLE hInstance, WORD wDataSegment, + WORD wHeapSize, LPSTR lpszCmdLine ) +#else +int __far __pascal LibMain ( int a, short b, short c, long d ) +#endif +{ + LZO_UNUSED(a); LZO_UNUSED(b); LZO_UNUSED(c); LZO_UNUSED(d); + return 1; +} + +#endif + +#endif + +#endif + +#define LZO1X 1 +#define LZO_EOF_CODE 1 +#define M2_MAX_OFFSET 0x0800 + +#if !defined(MINILZO_CFG_SKIP_LZO1X_1_COMPRESS) + +#if 1 && defined(UA_GET_LE32) +#undef LZO_DICT_USE_PTR +#define LZO_DICT_USE_PTR 0 +#undef lzo_dict_t +#define lzo_dict_t lzo_uint16_t +#endif + +#define LZO_NEED_DICT_H 1 +#ifndef D_BITS +#define D_BITS 14 +#endif +#define D_INDEX1(d,p) d = DM(DMUL(0x21,DX3(p,5,5,6)) >> 5) +#define D_INDEX2(d,p) d = (d & (D_MASK & 0x7ff)) ^ (D_HIGH | 0x1f) +#if 1 +#define DINDEX(dv,p) DM(((DMUL(0x1824429d,dv)) >> (32-D_BITS))) +#else +#define DINDEX(dv,p) DM((dv) + ((dv) >> (32-D_BITS))) +#endif + +#ifndef __LZO_CONFIG1X_H +#define __LZO_CONFIG1X_H 1 + +#if !defined(LZO1X) && !defined(LZO1Y) && !defined(LZO1Z) +# define LZO1X 1 +#endif + +#if !defined(__LZO_IN_MINILZO) +#include "lzo/lzo1x.h" +#endif + +#ifndef LZO_EOF_CODE +#define LZO_EOF_CODE 1 +#endif +#undef LZO_DETERMINISTIC + +#define M1_MAX_OFFSET 0x0400 +#ifndef M2_MAX_OFFSET +#define M2_MAX_OFFSET 0x0800 +#endif +#define M3_MAX_OFFSET 0x4000 +#define M4_MAX_OFFSET 0xbfff + +#define MX_MAX_OFFSET (M1_MAX_OFFSET + M2_MAX_OFFSET) + +#define M1_MIN_LEN 2 +#define M1_MAX_LEN 2 +#define M2_MIN_LEN 3 +#ifndef M2_MAX_LEN +#define M2_MAX_LEN 8 +#endif +#define M3_MIN_LEN 3 +#define M3_MAX_LEN 33 +#define M4_MIN_LEN 3 +#define M4_MAX_LEN 9 + +#define M1_MARKER 0 +#define M2_MARKER 64 +#define M3_MARKER 32 +#define M4_MARKER 16 + +#ifndef MIN_LOOKAHEAD +#define MIN_LOOKAHEAD (M2_MAX_LEN + 1) +#endif + +#if defined(LZO_NEED_DICT_H) + +#ifndef LZO_HASH +#define LZO_HASH LZO_HASH_LZO_INCREMENTAL_B +#endif +#define DL_MIN_LEN M2_MIN_LEN + +#ifndef __LZO_DICT_H +#define __LZO_DICT_H 1 + +#ifdef __cplusplus +extern "C" { +#endif + +#if !defined(D_BITS) && defined(DBITS) +# define D_BITS DBITS +#endif +#if !defined(D_BITS) +# error "D_BITS is not defined" +#endif +#if (D_BITS < 16) +# define D_SIZE LZO_SIZE(D_BITS) +# define D_MASK LZO_MASK(D_BITS) +#else +# define D_SIZE LZO_USIZE(D_BITS) +# define D_MASK LZO_UMASK(D_BITS) +#endif +#define D_HIGH ((D_MASK >> 1) + 1) + +#if !defined(DD_BITS) +# define DD_BITS 0 +#endif +#define DD_SIZE LZO_SIZE(DD_BITS) +#define DD_MASK LZO_MASK(DD_BITS) + +#if !defined(DL_BITS) +# define DL_BITS (D_BITS - DD_BITS) +#endif +#if (DL_BITS < 16) +# define DL_SIZE LZO_SIZE(DL_BITS) +# define DL_MASK LZO_MASK(DL_BITS) +#else +# define DL_SIZE LZO_USIZE(DL_BITS) +# define DL_MASK LZO_UMASK(DL_BITS) +#endif + +#if (D_BITS != DL_BITS + DD_BITS) +# error "D_BITS does not match" +#endif +#if (D_BITS < 6 || D_BITS > 18) +# error "invalid D_BITS" +#endif +#if (DL_BITS < 6 || DL_BITS > 20) +# error "invalid DL_BITS" +#endif +#if (DD_BITS < 0 || DD_BITS > 6) +# error "invalid DD_BITS" +#endif + +#if !defined(DL_MIN_LEN) +# define DL_MIN_LEN 3 +#endif +#if !defined(DL_SHIFT) +# define DL_SHIFT ((DL_BITS + (DL_MIN_LEN - 1)) / DL_MIN_LEN) +#endif + +#define LZO_HASH_GZIP 1 +#define LZO_HASH_GZIP_INCREMENTAL 2 +#define LZO_HASH_LZO_INCREMENTAL_A 3 +#define LZO_HASH_LZO_INCREMENTAL_B 4 + +#if !defined(LZO_HASH) +# error "choose a hashing strategy" +#endif + +#undef DM +#undef DX + +#if (DL_MIN_LEN == 3) +# define _DV2_A(p,shift1,shift2) \ + (((( (lzo_xint)((p)[0]) << shift1) ^ (p)[1]) << shift2) ^ (p)[2]) +# define _DV2_B(p,shift1,shift2) \ + (((( (lzo_xint)((p)[2]) << shift1) ^ (p)[1]) << shift2) ^ (p)[0]) +# define _DV3_B(p,shift1,shift2,shift3) \ + ((_DV2_B((p)+1,shift1,shift2) << (shift3)) ^ (p)[0]) +#elif (DL_MIN_LEN == 2) +# define _DV2_A(p,shift1,shift2) \ + (( (lzo_xint)(p[0]) << shift1) ^ p[1]) +# define _DV2_B(p,shift1,shift2) \ + (( (lzo_xint)(p[1]) << shift1) ^ p[2]) +#else +# error "invalid DL_MIN_LEN" +#endif +#define _DV_A(p,shift) _DV2_A(p,shift,shift) +#define _DV_B(p,shift) _DV2_B(p,shift,shift) +#define DA2(p,s1,s2) \ + (((((lzo_xint)((p)[2]) << (s2)) + (p)[1]) << (s1)) + (p)[0]) +#define DS2(p,s1,s2) \ + (((((lzo_xint)((p)[2]) << (s2)) - (p)[1]) << (s1)) - (p)[0]) +#define DX2(p,s1,s2) \ + (((((lzo_xint)((p)[2]) << (s2)) ^ (p)[1]) << (s1)) ^ (p)[0]) +#define DA3(p,s1,s2,s3) ((DA2((p)+1,s2,s3) << (s1)) + (p)[0]) +#define DS3(p,s1,s2,s3) ((DS2((p)+1,s2,s3) << (s1)) - (p)[0]) +#define DX3(p,s1,s2,s3) ((DX2((p)+1,s2,s3) << (s1)) ^ (p)[0]) +#define DMS(v,s) ((lzo_uint) (((v) & (D_MASK >> (s))) << (s))) +#define DM(v) DMS(v,0) + +#if (LZO_HASH == LZO_HASH_GZIP) +# define _DINDEX(dv,p) (_DV_A((p),DL_SHIFT)) + +#elif (LZO_HASH == LZO_HASH_GZIP_INCREMENTAL) +# define __LZO_HASH_INCREMENTAL 1 +# define DVAL_FIRST(dv,p) dv = _DV_A((p),DL_SHIFT) +# define DVAL_NEXT(dv,p) dv = (((dv) << DL_SHIFT) ^ p[2]) +# define _DINDEX(dv,p) (dv) +# define DVAL_LOOKAHEAD DL_MIN_LEN + +#elif (LZO_HASH == LZO_HASH_LZO_INCREMENTAL_A) +# define __LZO_HASH_INCREMENTAL 1 +# define DVAL_FIRST(dv,p) dv = _DV_A((p),5) +# define DVAL_NEXT(dv,p) \ + dv ^= (lzo_xint)(p[-1]) << (2*5); dv = (((dv) << 5) ^ p[2]) +# define _DINDEX(dv,p) ((DMUL(0x9f5f,dv)) >> 5) +# define DVAL_LOOKAHEAD DL_MIN_LEN + +#elif (LZO_HASH == LZO_HASH_LZO_INCREMENTAL_B) +# define __LZO_HASH_INCREMENTAL 1 +# define DVAL_FIRST(dv,p) dv = _DV_B((p),5) +# define DVAL_NEXT(dv,p) \ + dv ^= p[-1]; dv = (((dv) >> 5) ^ ((lzo_xint)(p[2]) << (2*5))) +# define _DINDEX(dv,p) ((DMUL(0x9f5f,dv)) >> 5) +# define DVAL_LOOKAHEAD DL_MIN_LEN + +#else +# error "choose a hashing strategy" +#endif + +#ifndef DINDEX +#define DINDEX(dv,p) ((lzo_uint)((_DINDEX(dv,p)) & DL_MASK) << DD_BITS) +#endif +#if !defined(DINDEX1) && defined(D_INDEX1) +#define DINDEX1 D_INDEX1 +#endif +#if !defined(DINDEX2) && defined(D_INDEX2) +#define DINDEX2 D_INDEX2 +#endif + +#if !defined(__LZO_HASH_INCREMENTAL) +# define DVAL_FIRST(dv,p) ((void) 0) +# define DVAL_NEXT(dv,p) ((void) 0) +# define DVAL_LOOKAHEAD 0 +#endif + +#if !defined(DVAL_ASSERT) +#if defined(__LZO_HASH_INCREMENTAL) && !defined(NDEBUG) +#if (LZO_CC_CLANG || (LZO_CC_GNUC >= 0x020700ul) || LZO_CC_LLVM) +static void __attribute__((__unused__)) +#else +static void +#endif +DVAL_ASSERT(lzo_xint dv, const lzo_bytep p) +{ + lzo_xint df; + DVAL_FIRST(df,(p)); + assert(DINDEX(dv,p) == DINDEX(df,p)); +} +#else +# define DVAL_ASSERT(dv,p) ((void) 0) +#endif +#endif + +#if (LZO_DICT_USE_PTR) +# define DENTRY(p,in) (p) +# define GINDEX(m_pos,m_off,dict,dindex,in) m_pos = dict[dindex] +#else +# define DENTRY(p,in) ((lzo_dict_t) pd(p, in)) +# define GINDEX(m_pos,m_off,dict,dindex,in) m_off = dict[dindex] +#endif + +#if (DD_BITS == 0) + +# define UPDATE_D(dict,drun,dv,p,in) dict[ DINDEX(dv,p) ] = DENTRY(p,in) +# define UPDATE_I(dict,drun,index,p,in) dict[index] = DENTRY(p,in) +# define UPDATE_P(ptr,drun,p,in) (ptr)[0] = DENTRY(p,in) + +#else + +# define UPDATE_D(dict,drun,dv,p,in) \ + dict[ DINDEX(dv,p) + drun++ ] = DENTRY(p,in); drun &= DD_MASK +# define UPDATE_I(dict,drun,index,p,in) \ + dict[ (index) + drun++ ] = DENTRY(p,in); drun &= DD_MASK +# define UPDATE_P(ptr,drun,p,in) \ + (ptr) [ drun++ ] = DENTRY(p,in); drun &= DD_MASK + +#endif + +#if (LZO_DICT_USE_PTR) + +#define LZO_CHECK_MPOS_DET(m_pos,m_off,in,ip,max_offset) \ + (m_pos == NULL || (m_off = pd(ip, m_pos)) > max_offset) + +#define LZO_CHECK_MPOS_NON_DET(m_pos,m_off,in,ip,max_offset) \ + (BOUNDS_CHECKING_OFF_IN_EXPR(( \ + m_pos = ip - (lzo_uint) PTR_DIFF(ip,m_pos), \ + PTR_LT(m_pos,in) || \ + (m_off = (lzo_uint) PTR_DIFF(ip,m_pos)) == 0 || \ + m_off > max_offset ))) + +#else + +#define LZO_CHECK_MPOS_DET(m_pos,m_off,in,ip,max_offset) \ + (m_off == 0 || \ + ((m_off = pd(ip, in) - m_off) > max_offset) || \ + (m_pos = (ip) - (m_off), 0) ) + +#define LZO_CHECK_MPOS_NON_DET(m_pos,m_off,in,ip,max_offset) \ + (pd(ip, in) <= m_off || \ + ((m_off = pd(ip, in) - m_off) > max_offset) || \ + (m_pos = (ip) - (m_off), 0) ) + +#endif + +#if (LZO_DETERMINISTIC) +# define LZO_CHECK_MPOS LZO_CHECK_MPOS_DET +#else +# define LZO_CHECK_MPOS LZO_CHECK_MPOS_NON_DET +#endif + +#ifdef __cplusplus +} +#endif + +#endif + +#endif + +#endif + +#define LZO_DETERMINISTIC !(LZO_DICT_USE_PTR) + +#ifndef DO_COMPRESS +#define DO_COMPRESS lzo1x_1_compress +#endif + +#if 1 && defined(DO_COMPRESS) && !defined(do_compress) +# define do_compress LZO_PP_ECONCAT2(DO_COMPRESS,_core) +#endif + +static __lzo_noinline lzo_uint +do_compress ( const lzo_bytep in , lzo_uint in_len, + lzo_bytep out, lzo_uintp out_len, + lzo_uint ti, lzo_voidp wrkmem) +{ + const lzo_bytep ip; + lzo_bytep op; + const lzo_bytep const in_end = in + in_len; + const lzo_bytep const ip_end = in + in_len - 20; + const lzo_bytep ii; + lzo_dict_p const dict = (lzo_dict_p) wrkmem; + + op = out; + ip = in; + ii = ip; + + ip += ti < 4 ? 4 - ti : 0; + for (;;) + { + const lzo_bytep m_pos; +#if !(LZO_DETERMINISTIC) + LZO_DEFINE_UNINITIALIZED_VAR(lzo_uint, m_off, 0); + lzo_uint m_len; + lzo_uint dindex; +next: + if __lzo_unlikely(ip >= ip_end) + break; + DINDEX1(dindex,ip); + GINDEX(m_pos,m_off,dict,dindex,in); + if (LZO_CHECK_MPOS_NON_DET(m_pos,m_off,in,ip,M4_MAX_OFFSET)) + goto literal; +#if 1 + if (m_off <= M2_MAX_OFFSET || m_pos[3] == ip[3]) + goto try_match; + DINDEX2(dindex,ip); +#endif + GINDEX(m_pos,m_off,dict,dindex,in); + if (LZO_CHECK_MPOS_NON_DET(m_pos,m_off,in,ip,M4_MAX_OFFSET)) + goto literal; + if (m_off <= M2_MAX_OFFSET || m_pos[3] == ip[3]) + goto try_match; + goto literal; + +try_match: +#if (LZO_OPT_UNALIGNED32) + if (UA_GET_NE32(m_pos) != UA_GET_NE32(ip)) +#else + if (m_pos[0] != ip[0] || m_pos[1] != ip[1] || m_pos[2] != ip[2] || m_pos[3] != ip[3]) +#endif + { +literal: + UPDATE_I(dict,0,dindex,ip,in); + ip += 1 + ((ip - ii) >> 5); + continue; + } + UPDATE_I(dict,0,dindex,ip,in); +#else + lzo_uint m_off; + lzo_uint m_len; + { + lzo_uint32_t dv; + lzo_uint dindex; +literal: + ip += 1 + ((ip - ii) >> 5); +next: + if __lzo_unlikely(ip >= ip_end) + break; + dv = UA_GET_LE32(ip); + dindex = DINDEX(dv,ip); + GINDEX(m_off,m_pos,in+dict,dindex,in); + UPDATE_I(dict,0,dindex,ip,in); + if __lzo_unlikely(dv != UA_GET_LE32(m_pos)) + goto literal; + } +#endif + + ii -= ti; ti = 0; + { + lzo_uint t = pd(ip,ii); + if (t != 0) + { + if (t <= 3) + { + op[-2] = LZO_BYTE(op[-2] | t); +#if (LZO_OPT_UNALIGNED32) + UA_COPY4(op, ii); + op += t; +#else + { do *op++ = *ii++; while (--t > 0); } +#endif + } +#if (LZO_OPT_UNALIGNED32) || (LZO_OPT_UNALIGNED64) + else if (t <= 16) + { + *op++ = LZO_BYTE(t - 3); + UA_COPY8(op, ii); + UA_COPY8(op+8, ii+8); + op += t; + } +#endif + else + { + if (t <= 18) + *op++ = LZO_BYTE(t - 3); + else + { + lzo_uint tt = t - 18; + *op++ = 0; + while __lzo_unlikely(tt > 255) + { + tt -= 255; + UA_SET1(op, 0); + op++; + } + assert(tt > 0); + *op++ = LZO_BYTE(tt); + } +#if (LZO_OPT_UNALIGNED32) || (LZO_OPT_UNALIGNED64) + do { + UA_COPY8(op, ii); + UA_COPY8(op+8, ii+8); + op += 16; ii += 16; t -= 16; + } while (t >= 16); if (t > 0) +#endif + { do *op++ = *ii++; while (--t > 0); } + } + } + } + m_len = 4; + { +#if (LZO_OPT_UNALIGNED64) + lzo_uint64_t v; + v = UA_GET_NE64(ip + m_len) ^ UA_GET_NE64(m_pos + m_len); + if __lzo_unlikely(v == 0) { + do { + m_len += 8; + v = UA_GET_NE64(ip + m_len) ^ UA_GET_NE64(m_pos + m_len); + if __lzo_unlikely(ip + m_len >= ip_end) + goto m_len_done; + } while (v == 0); + } +#if (LZO_ABI_BIG_ENDIAN) && defined(lzo_bitops_ctlz64) + m_len += lzo_bitops_ctlz64(v) / CHAR_BIT; +#elif (LZO_ABI_BIG_ENDIAN) + if ((v >> (64 - CHAR_BIT)) == 0) do { + v <<= CHAR_BIT; + m_len += 1; + } while ((v >> (64 - CHAR_BIT)) == 0); +#elif (LZO_ABI_LITTLE_ENDIAN) && defined(lzo_bitops_cttz64) + m_len += lzo_bitops_cttz64(v) / CHAR_BIT; +#elif (LZO_ABI_LITTLE_ENDIAN) + if ((v & UCHAR_MAX) == 0) do { + v >>= CHAR_BIT; + m_len += 1; + } while ((v & UCHAR_MAX) == 0); +#else + if (ip[m_len] == m_pos[m_len]) do { + m_len += 1; + } while (ip[m_len] == m_pos[m_len]); +#endif +#elif (LZO_OPT_UNALIGNED32) + lzo_uint32_t v; + v = UA_GET_NE32(ip + m_len) ^ UA_GET_NE32(m_pos + m_len); + if __lzo_unlikely(v == 0) { + do { + m_len += 4; + v = UA_GET_NE32(ip + m_len) ^ UA_GET_NE32(m_pos + m_len); + if (v != 0) + break; + m_len += 4; + v = UA_GET_NE32(ip + m_len) ^ UA_GET_NE32(m_pos + m_len); + if __lzo_unlikely(ip + m_len >= ip_end) + goto m_len_done; + } while (v == 0); + } +#if (LZO_ABI_BIG_ENDIAN) && defined(lzo_bitops_ctlz32) + m_len += lzo_bitops_ctlz32(v) / CHAR_BIT; +#elif (LZO_ABI_BIG_ENDIAN) + if ((v >> (32 - CHAR_BIT)) == 0) do { + v <<= CHAR_BIT; + m_len += 1; + } while ((v >> (32 - CHAR_BIT)) == 0); +#elif (LZO_ABI_LITTLE_ENDIAN) && defined(lzo_bitops_cttz32) + m_len += lzo_bitops_cttz32(v) / CHAR_BIT; +#elif (LZO_ABI_LITTLE_ENDIAN) + if ((v & UCHAR_MAX) == 0) do { + v >>= CHAR_BIT; + m_len += 1; + } while ((v & UCHAR_MAX) == 0); +#else + if (ip[m_len] == m_pos[m_len]) do { + m_len += 1; + } while (ip[m_len] == m_pos[m_len]); +#endif +#else + if __lzo_unlikely(ip[m_len] == m_pos[m_len]) { + do { + m_len += 1; + if (ip[m_len] != m_pos[m_len]) + break; + m_len += 1; + if (ip[m_len] != m_pos[m_len]) + break; + m_len += 1; + if (ip[m_len] != m_pos[m_len]) + break; + m_len += 1; + if (ip[m_len] != m_pos[m_len]) + break; + m_len += 1; + if (ip[m_len] != m_pos[m_len]) + break; + m_len += 1; + if (ip[m_len] != m_pos[m_len]) + break; + m_len += 1; + if (ip[m_len] != m_pos[m_len]) + break; + m_len += 1; + if __lzo_unlikely(ip + m_len >= ip_end) + goto m_len_done; + } while (ip[m_len] == m_pos[m_len]); + } +#endif + } +m_len_done: + m_off = pd(ip,m_pos); + ip += m_len; + ii = ip; + if (m_len <= M2_MAX_LEN && m_off <= M2_MAX_OFFSET) + { + m_off -= 1; +#if defined(LZO1X) + *op++ = LZO_BYTE(((m_len - 1) << 5) | ((m_off & 7) << 2)); + *op++ = LZO_BYTE(m_off >> 3); +#elif defined(LZO1Y) + *op++ = LZO_BYTE(((m_len + 1) << 4) | ((m_off & 3) << 2)); + *op++ = LZO_BYTE(m_off >> 2); +#endif + } + else if (m_off <= M3_MAX_OFFSET) + { + m_off -= 1; + if (m_len <= M3_MAX_LEN) + *op++ = LZO_BYTE(M3_MARKER | (m_len - 2)); + else + { + m_len -= M3_MAX_LEN; + *op++ = M3_MARKER | 0; + while __lzo_unlikely(m_len > 255) + { + m_len -= 255; + UA_SET1(op, 0); + op++; + } + *op++ = LZO_BYTE(m_len); + } + *op++ = LZO_BYTE(m_off << 2); + *op++ = LZO_BYTE(m_off >> 6); + } + else + { + m_off -= 0x4000; + if (m_len <= M4_MAX_LEN) + *op++ = LZO_BYTE(M4_MARKER | ((m_off >> 11) & 8) | (m_len - 2)); + else + { + m_len -= M4_MAX_LEN; + *op++ = LZO_BYTE(M4_MARKER | ((m_off >> 11) & 8)); + while __lzo_unlikely(m_len > 255) + { + m_len -= 255; + UA_SET1(op, 0); + op++; + } + *op++ = LZO_BYTE(m_len); + } + *op++ = LZO_BYTE(m_off << 2); + *op++ = LZO_BYTE(m_off >> 6); + } + goto next; + } + + *out_len = pd(op, out); + return pd(in_end,ii-ti); +} + +LZO_PUBLIC(int) +DO_COMPRESS ( const lzo_bytep in , lzo_uint in_len, + lzo_bytep out, lzo_uintp out_len, + lzo_voidp wrkmem ) +{ + const lzo_bytep ip = in; + lzo_bytep op = out; + lzo_uint l = in_len; + lzo_uint t = 0; + + while (l > 20) + { + lzo_uint ll = l; + lzo_uintptr_t ll_end; +#if 0 || (LZO_DETERMINISTIC) + ll = LZO_MIN(ll, 49152); +#endif + ll_end = (lzo_uintptr_t)ip + ll; + if ((ll_end + ((t + ll) >> 5)) <= ll_end || (const lzo_bytep)(ll_end + ((t + ll) >> 5)) <= ip + ll) + break; +#if (LZO_DETERMINISTIC) + lzo_memset(wrkmem, 0, ((lzo_uint)1 << D_BITS) * sizeof(lzo_dict_t)); +#endif + t = do_compress(ip,ll,op,out_len,t,wrkmem); + ip += ll; + op += *out_len; + l -= ll; + } + t += l; + + if (t > 0) + { + const lzo_bytep ii = in + in_len - t; + + if (op == out && t <= 238) + *op++ = LZO_BYTE(17 + t); + else if (t <= 3) + op[-2] = LZO_BYTE(op[-2] | t); + else if (t <= 18) + *op++ = LZO_BYTE(t - 3); + else + { + lzo_uint tt = t - 18; + + *op++ = 0; + while (tt > 255) + { + tt -= 255; + UA_SET1(op, 0); + op++; + } + assert(tt > 0); + *op++ = LZO_BYTE(tt); + } + UA_COPYN(op, ii, t); + op += t; + } + + *op++ = M4_MARKER | 1; + *op++ = 0; + *op++ = 0; + + *out_len = pd(op, out); + return LZO_E_OK; +} + +#endif + +#undef do_compress +#undef DO_COMPRESS +#undef LZO_HASH + +#undef LZO_TEST_OVERRUN +#undef DO_DECOMPRESS +#define DO_DECOMPRESS lzo1x_decompress + +#if !defined(MINILZO_CFG_SKIP_LZO1X_DECOMPRESS) + +#if defined(LZO_TEST_OVERRUN) +# if !defined(LZO_TEST_OVERRUN_INPUT) +# define LZO_TEST_OVERRUN_INPUT 2 +# endif +# if !defined(LZO_TEST_OVERRUN_OUTPUT) +# define LZO_TEST_OVERRUN_OUTPUT 2 +# endif +# if !defined(LZO_TEST_OVERRUN_LOOKBEHIND) +# define LZO_TEST_OVERRUN_LOOKBEHIND 1 +# endif +#endif + +#undef TEST_IP +#undef TEST_OP +#undef TEST_IP_AND_TEST_OP +#undef TEST_LB +#undef TEST_LBO +#undef NEED_IP +#undef NEED_OP +#undef TEST_IV +#undef TEST_OV +#undef HAVE_TEST_IP +#undef HAVE_TEST_OP +#undef HAVE_NEED_IP +#undef HAVE_NEED_OP +#undef HAVE_ANY_IP +#undef HAVE_ANY_OP + +#if defined(LZO_TEST_OVERRUN_INPUT) +# if (LZO_TEST_OVERRUN_INPUT >= 1) +# define TEST_IP (ip < ip_end) +# endif +# if (LZO_TEST_OVERRUN_INPUT >= 2) +# define NEED_IP(x) \ + if ((lzo_uint)(ip_end - ip) < (lzo_uint)(x)) goto input_overrun +# define TEST_IV(x) if ((x) > (lzo_uint)0 - (511)) goto input_overrun +# endif +#endif + +#if defined(LZO_TEST_OVERRUN_OUTPUT) +# if (LZO_TEST_OVERRUN_OUTPUT >= 1) +# define TEST_OP (op <= op_end) +# endif +# if (LZO_TEST_OVERRUN_OUTPUT >= 2) +# undef TEST_OP +# define NEED_OP(x) \ + if ((lzo_uint)(op_end - op) < (lzo_uint)(x)) goto output_overrun +# define TEST_OV(x) if ((x) > (lzo_uint)0 - (511)) goto output_overrun +# endif +#endif + +#if defined(LZO_TEST_OVERRUN_LOOKBEHIND) +# define TEST_LB(m_pos) if (PTR_LT(m_pos,out) || PTR_GE(m_pos,op)) goto lookbehind_overrun +# define TEST_LBO(m_pos,o) if (PTR_LT(m_pos,out) || PTR_GE(m_pos,op-(o))) goto lookbehind_overrun +#else +# define TEST_LB(m_pos) ((void) 0) +# define TEST_LBO(m_pos,o) ((void) 0) +#endif + +#if !defined(LZO_EOF_CODE) && !defined(TEST_IP) +# define TEST_IP (ip < ip_end) +#endif + +#if defined(TEST_IP) +# define HAVE_TEST_IP 1 +#else +# define TEST_IP 1 +#endif +#if defined(TEST_OP) +# define HAVE_TEST_OP 1 +#else +# define TEST_OP 1 +#endif + +#if defined(HAVE_TEST_IP) && defined(HAVE_TEST_OP) +# define TEST_IP_AND_TEST_OP (TEST_IP && TEST_OP) +#elif defined(HAVE_TEST_IP) +# define TEST_IP_AND_TEST_OP TEST_IP +#elif defined(HAVE_TEST_OP) +# define TEST_IP_AND_TEST_OP TEST_OP +#else +# define TEST_IP_AND_TEST_OP 1 +#endif + +#if defined(NEED_IP) +# define HAVE_NEED_IP 1 +#else +# define NEED_IP(x) ((void) 0) +# define TEST_IV(x) ((void) 0) +#endif +#if defined(NEED_OP) +# define HAVE_NEED_OP 1 +#else +# define NEED_OP(x) ((void) 0) +# define TEST_OV(x) ((void) 0) +#endif + +#if defined(HAVE_TEST_IP) || defined(HAVE_NEED_IP) +# define HAVE_ANY_IP 1 +#endif +#if defined(HAVE_TEST_OP) || defined(HAVE_NEED_OP) +# define HAVE_ANY_OP 1 +#endif + +#if defined(DO_DECOMPRESS) +LZO_PUBLIC(int) +DO_DECOMPRESS ( const lzo_bytep in , lzo_uint in_len, + lzo_bytep out, lzo_uintp out_len, + lzo_voidp wrkmem ) +#endif +{ + lzo_bytep op; + const lzo_bytep ip; + lzo_uint t; +#if defined(COPY_DICT) + lzo_uint m_off; + const lzo_bytep dict_end; +#else + const lzo_bytep m_pos; +#endif + + const lzo_bytep const ip_end = in + in_len; +#if defined(HAVE_ANY_OP) + lzo_bytep const op_end = out + *out_len; +#endif +#if defined(LZO1Z) + lzo_uint last_m_off = 0; +#endif + + LZO_UNUSED(wrkmem); + +#if defined(COPY_DICT) + if (dict) + { + if (dict_len > M4_MAX_OFFSET) + { + dict += dict_len - M4_MAX_OFFSET; + dict_len = M4_MAX_OFFSET; + } + dict_end = dict + dict_len; + } + else + { + dict_len = 0; + dict_end = NULL; + } +#endif + + *out_len = 0; + + op = out; + ip = in; + + NEED_IP(1); + if (*ip > 17) + { + t = *ip++ - 17; + if (t < 4) + goto match_next; + assert(t > 0); NEED_OP(t); NEED_IP(t+3); + do *op++ = *ip++; while (--t > 0); + goto first_literal_run; + } + + for (;;) + { + NEED_IP(3); + t = *ip++; + if (t >= 16) + goto match; + if (t == 0) + { + while (*ip == 0) + { + t += 255; + ip++; + TEST_IV(t); + NEED_IP(1); + } + t += 15 + *ip++; + } + assert(t > 0); NEED_OP(t+3); NEED_IP(t+6); +#if (LZO_OPT_UNALIGNED64) && (LZO_OPT_UNALIGNED32) + t += 3; + if (t >= 8) do + { + UA_COPY8(op,ip); + op += 8; ip += 8; t -= 8; + } while (t >= 8); + if (t >= 4) + { + UA_COPY4(op,ip); + op += 4; ip += 4; t -= 4; + } + if (t > 0) + { + *op++ = *ip++; + if (t > 1) { *op++ = *ip++; if (t > 2) { *op++ = *ip++; } } + } +#elif (LZO_OPT_UNALIGNED32) || (LZO_ALIGNED_OK_4) +#if !(LZO_OPT_UNALIGNED32) + if (PTR_ALIGNED2_4(op,ip)) + { +#endif + UA_COPY4(op,ip); + op += 4; ip += 4; + if (--t > 0) + { + if (t >= 4) + { + do { + UA_COPY4(op,ip); + op += 4; ip += 4; t -= 4; + } while (t >= 4); + if (t > 0) do *op++ = *ip++; while (--t > 0); + } + else + do *op++ = *ip++; while (--t > 0); + } +#if !(LZO_OPT_UNALIGNED32) + } + else +#endif +#endif +#if !(LZO_OPT_UNALIGNED32) + { + *op++ = *ip++; *op++ = *ip++; *op++ = *ip++; + do *op++ = *ip++; while (--t > 0); + } +#endif + +first_literal_run: + + t = *ip++; + if (t >= 16) + goto match; +#if defined(COPY_DICT) +#if defined(LZO1Z) + m_off = (1 + M2_MAX_OFFSET) + (t << 6) + (*ip++ >> 2); + last_m_off = m_off; +#else + m_off = (1 + M2_MAX_OFFSET) + (t >> 2) + (*ip++ << 2); +#endif + NEED_OP(3); + t = 3; COPY_DICT(t,m_off) +#else +#if defined(LZO1Z) + t = (1 + M2_MAX_OFFSET) + (t << 6) + (*ip++ >> 2); + m_pos = op - t; + last_m_off = t; +#else + m_pos = op - (1 + M2_MAX_OFFSET); + m_pos -= t >> 2; + m_pos -= *ip++ << 2; +#endif + TEST_LB(m_pos); NEED_OP(3); + *op++ = *m_pos++; *op++ = *m_pos++; *op++ = *m_pos; +#endif + goto match_done; + + for (;;) { +match: + if (t >= 64) + { +#if defined(COPY_DICT) +#if defined(LZO1X) + m_off = 1 + ((t >> 2) & 7) + (*ip++ << 3); + t = (t >> 5) - 1; +#elif defined(LZO1Y) + m_off = 1 + ((t >> 2) & 3) + (*ip++ << 2); + t = (t >> 4) - 3; +#elif defined(LZO1Z) + m_off = t & 0x1f; + if (m_off >= 0x1c) + m_off = last_m_off; + else + { + m_off = 1 + (m_off << 6) + (*ip++ >> 2); + last_m_off = m_off; + } + t = (t >> 5) - 1; +#endif +#else +#if defined(LZO1X) + m_pos = op - 1; + m_pos -= (t >> 2) & 7; + m_pos -= *ip++ << 3; + t = (t >> 5) - 1; +#elif defined(LZO1Y) + m_pos = op - 1; + m_pos -= (t >> 2) & 3; + m_pos -= *ip++ << 2; + t = (t >> 4) - 3; +#elif defined(LZO1Z) + { + lzo_uint off = t & 0x1f; + m_pos = op; + if (off >= 0x1c) + { + assert(last_m_off > 0); + m_pos -= last_m_off; + } + else + { + off = 1 + (off << 6) + (*ip++ >> 2); + m_pos -= off; + last_m_off = off; + } + } + t = (t >> 5) - 1; +#endif + TEST_LB(m_pos); assert(t > 0); NEED_OP(t+3-1); + goto copy_match; +#endif + } + else if (t >= 32) + { + t &= 31; + if (t == 0) + { + while (*ip == 0) + { + t += 255; + ip++; + TEST_OV(t); + NEED_IP(1); + } + t += 31 + *ip++; + NEED_IP(2); + } +#if defined(COPY_DICT) +#if defined(LZO1Z) + m_off = 1 + (ip[0] << 6) + (ip[1] >> 2); + last_m_off = m_off; +#else + m_off = 1 + (ip[0] >> 2) + (ip[1] << 6); +#endif +#else +#if defined(LZO1Z) + { + lzo_uint off = 1 + (ip[0] << 6) + (ip[1] >> 2); + m_pos = op - off; + last_m_off = off; + } +#elif (LZO_OPT_UNALIGNED16) && (LZO_ABI_LITTLE_ENDIAN) + m_pos = op - 1; + m_pos -= UA_GET_LE16(ip) >> 2; +#else + m_pos = op - 1; + m_pos -= (ip[0] >> 2) + (ip[1] << 6); +#endif +#endif + ip += 2; + } + else if (t >= 16) + { +#if defined(COPY_DICT) + m_off = (t & 8) << 11; +#else + m_pos = op; + m_pos -= (t & 8) << 11; +#endif + t &= 7; + if (t == 0) + { + while (*ip == 0) + { + t += 255; + ip++; + TEST_OV(t); + NEED_IP(1); + } + t += 7 + *ip++; + NEED_IP(2); + } +#if defined(COPY_DICT) +#if defined(LZO1Z) + m_off += (ip[0] << 6) + (ip[1] >> 2); +#else + m_off += (ip[0] >> 2) + (ip[1] << 6); +#endif + ip += 2; + if (m_off == 0) + goto eof_found; + m_off += 0x4000; +#if defined(LZO1Z) + last_m_off = m_off; +#endif +#else +#if defined(LZO1Z) + m_pos -= (ip[0] << 6) + (ip[1] >> 2); +#elif (LZO_OPT_UNALIGNED16) && (LZO_ABI_LITTLE_ENDIAN) + m_pos -= UA_GET_LE16(ip) >> 2; +#else + m_pos -= (ip[0] >> 2) + (ip[1] << 6); +#endif + ip += 2; + if (m_pos == op) + goto eof_found; + m_pos -= 0x4000; +#if defined(LZO1Z) + last_m_off = pd((const lzo_bytep)op, m_pos); +#endif +#endif + } + else + { +#if defined(COPY_DICT) +#if defined(LZO1Z) + m_off = 1 + (t << 6) + (*ip++ >> 2); + last_m_off = m_off; +#else + m_off = 1 + (t >> 2) + (*ip++ << 2); +#endif + NEED_OP(2); + t = 2; COPY_DICT(t,m_off) +#else +#if defined(LZO1Z) + t = 1 + (t << 6) + (*ip++ >> 2); + m_pos = op - t; + last_m_off = t; +#else + m_pos = op - 1; + m_pos -= t >> 2; + m_pos -= *ip++ << 2; +#endif + TEST_LB(m_pos); NEED_OP(2); + *op++ = *m_pos++; *op++ = *m_pos; +#endif + goto match_done; + } + +#if defined(COPY_DICT) + + NEED_OP(t+3-1); + t += 3-1; COPY_DICT(t,m_off) + +#else + + TEST_LB(m_pos); assert(t > 0); NEED_OP(t+3-1); +#if (LZO_OPT_UNALIGNED64) && (LZO_OPT_UNALIGNED32) + if (op - m_pos >= 8) + { + t += (3 - 1); + if (t >= 8) do + { + UA_COPY8(op,m_pos); + op += 8; m_pos += 8; t -= 8; + } while (t >= 8); + if (t >= 4) + { + UA_COPY4(op,m_pos); + op += 4; m_pos += 4; t -= 4; + } + if (t > 0) + { + *op++ = m_pos[0]; + if (t > 1) { *op++ = m_pos[1]; if (t > 2) { *op++ = m_pos[2]; } } + } + } + else +#elif (LZO_OPT_UNALIGNED32) || (LZO_ALIGNED_OK_4) +#if !(LZO_OPT_UNALIGNED32) + if (t >= 2 * 4 - (3 - 1) && PTR_ALIGNED2_4(op,m_pos)) + { + assert((op - m_pos) >= 4); +#else + if (t >= 2 * 4 - (3 - 1) && (op - m_pos) >= 4) + { +#endif + UA_COPY4(op,m_pos); + op += 4; m_pos += 4; t -= 4 - (3 - 1); + do { + UA_COPY4(op,m_pos); + op += 4; m_pos += 4; t -= 4; + } while (t >= 4); + if (t > 0) do *op++ = *m_pos++; while (--t > 0); + } + else +#endif + { +copy_match: + *op++ = *m_pos++; *op++ = *m_pos++; + do *op++ = *m_pos++; while (--t > 0); + } + +#endif + +match_done: +#if defined(LZO1Z) + t = ip[-1] & 3; +#else + t = ip[-2] & 3; +#endif + if (t == 0) + break; + +match_next: + assert(t > 0); assert(t < 4); NEED_OP(t); NEED_IP(t+3); +#if 0 + do *op++ = *ip++; while (--t > 0); +#else + *op++ = *ip++; + if (t > 1) { *op++ = *ip++; if (t > 2) { *op++ = *ip++; } } +#endif + t = *ip++; + } + } + +eof_found: + *out_len = pd(op, out); + return (ip == ip_end ? LZO_E_OK : + (ip < ip_end ? LZO_E_INPUT_NOT_CONSUMED : LZO_E_INPUT_OVERRUN)); + +#if defined(HAVE_NEED_IP) +input_overrun: + *out_len = pd(op, out); + return LZO_E_INPUT_OVERRUN; +#endif + +#if defined(HAVE_NEED_OP) +output_overrun: + *out_len = pd(op, out); + return LZO_E_OUTPUT_OVERRUN; +#endif + +#if defined(LZO_TEST_OVERRUN_LOOKBEHIND) +lookbehind_overrun: + *out_len = pd(op, out); + return LZO_E_LOOKBEHIND_OVERRUN; +#endif +} + +#endif + +#define LZO_TEST_OVERRUN 1 +#undef DO_DECOMPRESS +#define DO_DECOMPRESS lzo1x_decompress_safe + +#if !defined(MINILZO_CFG_SKIP_LZO1X_DECOMPRESS_SAFE) + +#if defined(LZO_TEST_OVERRUN) +# if !defined(LZO_TEST_OVERRUN_INPUT) +# define LZO_TEST_OVERRUN_INPUT 2 +# endif +# if !defined(LZO_TEST_OVERRUN_OUTPUT) +# define LZO_TEST_OVERRUN_OUTPUT 2 +# endif +# if !defined(LZO_TEST_OVERRUN_LOOKBEHIND) +# define LZO_TEST_OVERRUN_LOOKBEHIND 1 +# endif +#endif + +#undef TEST_IP +#undef TEST_OP +#undef TEST_IP_AND_TEST_OP +#undef TEST_LB +#undef TEST_LBO +#undef NEED_IP +#undef NEED_OP +#undef TEST_IV +#undef TEST_OV +#undef HAVE_TEST_IP +#undef HAVE_TEST_OP +#undef HAVE_NEED_IP +#undef HAVE_NEED_OP +#undef HAVE_ANY_IP +#undef HAVE_ANY_OP + +#if defined(LZO_TEST_OVERRUN_INPUT) +# if (LZO_TEST_OVERRUN_INPUT >= 1) +# define TEST_IP (ip < ip_end) +# endif +# if (LZO_TEST_OVERRUN_INPUT >= 2) +# define NEED_IP(x) \ + if ((lzo_uint)(ip_end - ip) < (lzo_uint)(x)) goto input_overrun +# define TEST_IV(x) if ((x) > (lzo_uint)0 - (511)) goto input_overrun +# endif +#endif + +#if defined(LZO_TEST_OVERRUN_OUTPUT) +# if (LZO_TEST_OVERRUN_OUTPUT >= 1) +# define TEST_OP (op <= op_end) +# endif +# if (LZO_TEST_OVERRUN_OUTPUT >= 2) +# undef TEST_OP +# define NEED_OP(x) \ + if ((lzo_uint)(op_end - op) < (lzo_uint)(x)) goto output_overrun +# define TEST_OV(x) if ((x) > (lzo_uint)0 - (511)) goto output_overrun +# endif +#endif + +#if defined(LZO_TEST_OVERRUN_LOOKBEHIND) +# define TEST_LB(m_pos) if (PTR_LT(m_pos,out) || PTR_GE(m_pos,op)) goto lookbehind_overrun +# define TEST_LBO(m_pos,o) if (PTR_LT(m_pos,out) || PTR_GE(m_pos,op-(o))) goto lookbehind_overrun +#else +# define TEST_LB(m_pos) ((void) 0) +# define TEST_LBO(m_pos,o) ((void) 0) +#endif + +#if !defined(LZO_EOF_CODE) && !defined(TEST_IP) +# define TEST_IP (ip < ip_end) +#endif + +#if defined(TEST_IP) +# define HAVE_TEST_IP 1 +#else +# define TEST_IP 1 +#endif +#if defined(TEST_OP) +# define HAVE_TEST_OP 1 +#else +# define TEST_OP 1 +#endif + +#if defined(HAVE_TEST_IP) && defined(HAVE_TEST_OP) +# define TEST_IP_AND_TEST_OP (TEST_IP && TEST_OP) +#elif defined(HAVE_TEST_IP) +# define TEST_IP_AND_TEST_OP TEST_IP +#elif defined(HAVE_TEST_OP) +# define TEST_IP_AND_TEST_OP TEST_OP +#else +# define TEST_IP_AND_TEST_OP 1 +#endif + +#if defined(NEED_IP) +# define HAVE_NEED_IP 1 +#else +# define NEED_IP(x) ((void) 0) +# define TEST_IV(x) ((void) 0) +#endif +#if defined(NEED_OP) +# define HAVE_NEED_OP 1 +#else +# define NEED_OP(x) ((void) 0) +# define TEST_OV(x) ((void) 0) +#endif + +#if defined(HAVE_TEST_IP) || defined(HAVE_NEED_IP) +# define HAVE_ANY_IP 1 +#endif +#if defined(HAVE_TEST_OP) || defined(HAVE_NEED_OP) +# define HAVE_ANY_OP 1 +#endif + +#if defined(DO_DECOMPRESS) +LZO_PUBLIC(int) +DO_DECOMPRESS ( const lzo_bytep in , lzo_uint in_len, + lzo_bytep out, lzo_uintp out_len, + lzo_voidp wrkmem ) +#endif +{ + lzo_bytep op; + const lzo_bytep ip; + lzo_uint t; +#if defined(COPY_DICT) + lzo_uint m_off; + const lzo_bytep dict_end; +#else + const lzo_bytep m_pos; +#endif + + const lzo_bytep const ip_end = in + in_len; +#if defined(HAVE_ANY_OP) + lzo_bytep const op_end = out + *out_len; +#endif +#if defined(LZO1Z) + lzo_uint last_m_off = 0; +#endif + + LZO_UNUSED(wrkmem); + +#if defined(COPY_DICT) + if (dict) + { + if (dict_len > M4_MAX_OFFSET) + { + dict += dict_len - M4_MAX_OFFSET; + dict_len = M4_MAX_OFFSET; + } + dict_end = dict + dict_len; + } + else + { + dict_len = 0; + dict_end = NULL; + } +#endif + + *out_len = 0; + + op = out; + ip = in; + + NEED_IP(1); + if (*ip > 17) + { + t = *ip++ - 17; + if (t < 4) + goto match_next; + assert(t > 0); NEED_OP(t); NEED_IP(t+3); + do *op++ = *ip++; while (--t > 0); + goto first_literal_run; + } + + for (;;) + { + NEED_IP(3); + t = *ip++; + if (t >= 16) + goto match; + if (t == 0) + { + while (*ip == 0) + { + t += 255; + ip++; + TEST_IV(t); + NEED_IP(1); + } + t += 15 + *ip++; + } + assert(t > 0); NEED_OP(t+3); NEED_IP(t+6); +#if (LZO_OPT_UNALIGNED64) && (LZO_OPT_UNALIGNED32) + t += 3; + if (t >= 8) do + { + UA_COPY8(op,ip); + op += 8; ip += 8; t -= 8; + } while (t >= 8); + if (t >= 4) + { + UA_COPY4(op,ip); + op += 4; ip += 4; t -= 4; + } + if (t > 0) + { + *op++ = *ip++; + if (t > 1) { *op++ = *ip++; if (t > 2) { *op++ = *ip++; } } + } +#elif (LZO_OPT_UNALIGNED32) || (LZO_ALIGNED_OK_4) +#if !(LZO_OPT_UNALIGNED32) + if (PTR_ALIGNED2_4(op,ip)) + { +#endif + UA_COPY4(op,ip); + op += 4; ip += 4; + if (--t > 0) + { + if (t >= 4) + { + do { + UA_COPY4(op,ip); + op += 4; ip += 4; t -= 4; + } while (t >= 4); + if (t > 0) do *op++ = *ip++; while (--t > 0); + } + else + do *op++ = *ip++; while (--t > 0); + } +#if !(LZO_OPT_UNALIGNED32) + } + else +#endif +#endif +#if !(LZO_OPT_UNALIGNED32) + { + *op++ = *ip++; *op++ = *ip++; *op++ = *ip++; + do *op++ = *ip++; while (--t > 0); + } +#endif + +first_literal_run: + + t = *ip++; + if (t >= 16) + goto match; +#if defined(COPY_DICT) +#if defined(LZO1Z) + m_off = (1 + M2_MAX_OFFSET) + (t << 6) + (*ip++ >> 2); + last_m_off = m_off; +#else + m_off = (1 + M2_MAX_OFFSET) + (t >> 2) + (*ip++ << 2); +#endif + NEED_OP(3); + t = 3; COPY_DICT(t,m_off) +#else +#if defined(LZO1Z) + t = (1 + M2_MAX_OFFSET) + (t << 6) + (*ip++ >> 2); + m_pos = op - t; + last_m_off = t; +#else + m_pos = op - (1 + M2_MAX_OFFSET); + m_pos -= t >> 2; + m_pos -= *ip++ << 2; +#endif + TEST_LB(m_pos); NEED_OP(3); + *op++ = *m_pos++; *op++ = *m_pos++; *op++ = *m_pos; +#endif + goto match_done; + + for (;;) { +match: + if (t >= 64) + { +#if defined(COPY_DICT) +#if defined(LZO1X) + m_off = 1 + ((t >> 2) & 7) + (*ip++ << 3); + t = (t >> 5) - 1; +#elif defined(LZO1Y) + m_off = 1 + ((t >> 2) & 3) + (*ip++ << 2); + t = (t >> 4) - 3; +#elif defined(LZO1Z) + m_off = t & 0x1f; + if (m_off >= 0x1c) + m_off = last_m_off; + else + { + m_off = 1 + (m_off << 6) + (*ip++ >> 2); + last_m_off = m_off; + } + t = (t >> 5) - 1; +#endif +#else +#if defined(LZO1X) + m_pos = op - 1; + m_pos -= (t >> 2) & 7; + m_pos -= *ip++ << 3; + t = (t >> 5) - 1; +#elif defined(LZO1Y) + m_pos = op - 1; + m_pos -= (t >> 2) & 3; + m_pos -= *ip++ << 2; + t = (t >> 4) - 3; +#elif defined(LZO1Z) + { + lzo_uint off = t & 0x1f; + m_pos = op; + if (off >= 0x1c) + { + assert(last_m_off > 0); + m_pos -= last_m_off; + } + else + { + off = 1 + (off << 6) + (*ip++ >> 2); + m_pos -= off; + last_m_off = off; + } + } + t = (t >> 5) - 1; +#endif + TEST_LB(m_pos); assert(t > 0); NEED_OP(t+3-1); + goto copy_match; +#endif + } + else if (t >= 32) + { + t &= 31; + if (t == 0) + { + while (*ip == 0) + { + t += 255; + ip++; + TEST_OV(t); + NEED_IP(1); + } + t += 31 + *ip++; + NEED_IP(2); + } +#if defined(COPY_DICT) +#if defined(LZO1Z) + m_off = 1 + (ip[0] << 6) + (ip[1] >> 2); + last_m_off = m_off; +#else + m_off = 1 + (ip[0] >> 2) + (ip[1] << 6); +#endif +#else +#if defined(LZO1Z) + { + lzo_uint off = 1 + (ip[0] << 6) + (ip[1] >> 2); + m_pos = op - off; + last_m_off = off; + } +#elif (LZO_OPT_UNALIGNED16) && (LZO_ABI_LITTLE_ENDIAN) + m_pos = op - 1; + m_pos -= UA_GET_LE16(ip) >> 2; +#else + m_pos = op - 1; + m_pos -= (ip[0] >> 2) + (ip[1] << 6); +#endif +#endif + ip += 2; + } + else if (t >= 16) + { +#if defined(COPY_DICT) + m_off = (t & 8) << 11; +#else + m_pos = op; + m_pos -= (t & 8) << 11; +#endif + t &= 7; + if (t == 0) + { + while (*ip == 0) + { + t += 255; + ip++; + TEST_OV(t); + NEED_IP(1); + } + t += 7 + *ip++; + NEED_IP(2); + } +#if defined(COPY_DICT) +#if defined(LZO1Z) + m_off += (ip[0] << 6) + (ip[1] >> 2); +#else + m_off += (ip[0] >> 2) + (ip[1] << 6); +#endif + ip += 2; + if (m_off == 0) + goto eof_found; + m_off += 0x4000; +#if defined(LZO1Z) + last_m_off = m_off; +#endif +#else +#if defined(LZO1Z) + m_pos -= (ip[0] << 6) + (ip[1] >> 2); +#elif (LZO_OPT_UNALIGNED16) && (LZO_ABI_LITTLE_ENDIAN) + m_pos -= UA_GET_LE16(ip) >> 2; +#else + m_pos -= (ip[0] >> 2) + (ip[1] << 6); +#endif + ip += 2; + if (m_pos == op) + goto eof_found; + m_pos -= 0x4000; +#if defined(LZO1Z) + last_m_off = pd((const lzo_bytep)op, m_pos); +#endif +#endif + } + else + { +#if defined(COPY_DICT) +#if defined(LZO1Z) + m_off = 1 + (t << 6) + (*ip++ >> 2); + last_m_off = m_off; +#else + m_off = 1 + (t >> 2) + (*ip++ << 2); +#endif + NEED_OP(2); + t = 2; COPY_DICT(t,m_off) +#else +#if defined(LZO1Z) + t = 1 + (t << 6) + (*ip++ >> 2); + m_pos = op - t; + last_m_off = t; +#else + m_pos = op - 1; + m_pos -= t >> 2; + m_pos -= *ip++ << 2; +#endif + TEST_LB(m_pos); NEED_OP(2); + *op++ = *m_pos++; *op++ = *m_pos; +#endif + goto match_done; + } + +#if defined(COPY_DICT) + + NEED_OP(t+3-1); + t += 3-1; COPY_DICT(t,m_off) + +#else + + TEST_LB(m_pos); assert(t > 0); NEED_OP(t+3-1); +#if (LZO_OPT_UNALIGNED64) && (LZO_OPT_UNALIGNED32) + if (op - m_pos >= 8) + { + t += (3 - 1); + if (t >= 8) do + { + UA_COPY8(op,m_pos); + op += 8; m_pos += 8; t -= 8; + } while (t >= 8); + if (t >= 4) + { + UA_COPY4(op,m_pos); + op += 4; m_pos += 4; t -= 4; + } + if (t > 0) + { + *op++ = m_pos[0]; + if (t > 1) { *op++ = m_pos[1]; if (t > 2) { *op++ = m_pos[2]; } } + } + } + else +#elif (LZO_OPT_UNALIGNED32) || (LZO_ALIGNED_OK_4) +#if !(LZO_OPT_UNALIGNED32) + if (t >= 2 * 4 - (3 - 1) && PTR_ALIGNED2_4(op,m_pos)) + { + assert((op - m_pos) >= 4); +#else + if (t >= 2 * 4 - (3 - 1) && (op - m_pos) >= 4) + { +#endif + UA_COPY4(op,m_pos); + op += 4; m_pos += 4; t -= 4 - (3 - 1); + do { + UA_COPY4(op,m_pos); + op += 4; m_pos += 4; t -= 4; + } while (t >= 4); + if (t > 0) do *op++ = *m_pos++; while (--t > 0); + } + else +#endif + { +copy_match: + *op++ = *m_pos++; *op++ = *m_pos++; + do *op++ = *m_pos++; while (--t > 0); + } + +#endif + +match_done: +#if defined(LZO1Z) + t = ip[-1] & 3; +#else + t = ip[-2] & 3; +#endif + if (t == 0) + break; + +match_next: + assert(t > 0); assert(t < 4); NEED_OP(t); NEED_IP(t+3); +#if 0 + do *op++ = *ip++; while (--t > 0); +#else + *op++ = *ip++; + if (t > 1) { *op++ = *ip++; if (t > 2) { *op++ = *ip++; } } +#endif + t = *ip++; + } + } + +eof_found: + *out_len = pd(op, out); + return (ip == ip_end ? LZO_E_OK : + (ip < ip_end ? LZO_E_INPUT_NOT_CONSUMED : LZO_E_INPUT_OVERRUN)); + +#if defined(HAVE_NEED_IP) +input_overrun: + *out_len = pd(op, out); + return LZO_E_INPUT_OVERRUN; +#endif + +#if defined(HAVE_NEED_OP) +output_overrun: + *out_len = pd(op, out); + return LZO_E_OUTPUT_OVERRUN; +#endif + +#if defined(LZO_TEST_OVERRUN_LOOKBEHIND) +lookbehind_overrun: + *out_len = pd(op, out); + return LZO_E_LOOKBEHIND_OVERRUN; +#endif +} + +#endif + +/***** End of minilzo.c *****/ diff --git a/bin/minilzo.h b/bin/minilzo.h new file mode 100755 index 0000000..7937454 --- /dev/null +++ b/bin/minilzo.h @@ -0,0 +1,94 @@ +/* minilzo.h -- mini subset of the LZO real-time data compression library + + This file is part of the LZO real-time data compression library. + + Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer + All Rights Reserved. + + The LZO library 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 of + the License, or (at your option) any later version. + + The LZO library 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 the LZO library; see the file COPYING. + If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Markus F.X.J. Oberhumer + + http://www.oberhumer.com/opensource/lzo/ + */ + +/* + * NOTE: + * the full LZO package can be found at + * http://www.oberhumer.com/opensource/lzo/ + */ + + +#ifndef __MINILZO_H +#define __MINILZO_H 1 + +#define MINILZO_VERSION 0x2080 + +#ifdef __LZOCONF_H +# error "you cannot use both LZO and miniLZO" +#endif + +#undef LZO_HAVE_CONFIG_H +#include "lzoconf.h" + +#if !defined(LZO_VERSION) || (LZO_VERSION != MINILZO_VERSION) +# error "version mismatch in header files" +#endif + + +#ifdef __cplusplus +extern "C" { +#endif + + +/*********************************************************************** +// +************************************************************************/ + +/* Memory required for the wrkmem parameter. + * When the required size is 0, you can also pass a NULL pointer. + */ + +#define LZO1X_MEM_COMPRESS LZO1X_1_MEM_COMPRESS +#define LZO1X_1_MEM_COMPRESS ((lzo_uint32_t) (16384L * lzo_sizeof_dict_t)) +#define LZO1X_MEM_DECOMPRESS (0) + + +/* compression */ +LZO_EXTERN(int) +lzo1x_1_compress ( const lzo_bytep src, lzo_uint src_len, + lzo_bytep dst, lzo_uintp dst_len, + lzo_voidp wrkmem ); + +/* decompression */ +LZO_EXTERN(int) +lzo1x_decompress ( const lzo_bytep src, lzo_uint src_len, + lzo_bytep dst, lzo_uintp dst_len, + lzo_voidp wrkmem /* NOT USED */ ); + +/* safe decompression with overrun testing */ +LZO_EXTERN(int) +lzo1x_decompress_safe ( const lzo_bytep src, lzo_uint src_len, + lzo_bytep dst, lzo_uintp dst_len, + lzo_voidp wrkmem /* NOT USED */ ); + + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /* already included */ + diff --git a/bin/netflow_pcap.c b/bin/netflow_pcap.c new file mode 100644 index 0000000..f15c813 --- /dev/null +++ b/bin/netflow_pcap.c @@ -0,0 +1,353 @@ +/* + * Copyright (c) 2014, Peter Haag + * Copyright (c) 2013, Peter Haag + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of the author nor the names of its contributors may be + * used to endorse or promote products derived from this software without + * specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 COPYRIGHT OWNER 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. + * + * $Author:$ + * + * $Id:$ + * + * $LastChangedRevision:$ + * + * + */ + +#include "config.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#ifdef HAVE_STDINT_H +#include +#endif + +#include "util.h" +#include "nffile.h" +#include "nfx.h" +#include "nfnet.h" +#include "nf_common.h" +#include "bookkeeper.h" +#include "nfxstat.h" +#include "collector.h" +#include "exporter.h" + +#include "flowtree.h" +#include "netflow_pcap.h" + +#ifndef DEVEL +# define dbg_printf(...) /* printf(__VA_ARGS__) */ +#else +# define dbg_printf(...) printf(__VA_ARGS__) +#endif + +extern int verbose; +extern extension_descriptor_t extension_descriptor[]; + +/* module limited globals */ +static extension_info_t pcap_extension_info; // common for all pcap records +static extension_map_t *pcap_extension_map; + +static uint32_t pcap_output_record_size_v4; +static uint32_t pcap_output_record_size_v6; + +typedef struct pcap_v4_block_s { + uint32_t srcaddr; + uint32_t dstaddr; + uint32_t dPkts; + uint32_t dOctets; + uint32_t data[1]; // link to next record +} __attribute__((__packed__ )) pcap_v4_block_t; +#define PCAP_V4_BLOCK_DATA_SIZE (sizeof(pcap_v4_block_t) - sizeof(uint32_t)) + +typedef struct pcap_v6_block_s { + uint64_t srcaddr[2]; + uint64_t dstaddr[2]; + uint32_t dPkts; + uint32_t dOctets; + uint32_t data[1]; // link to next record +} __attribute__((__packed__ )) pcap_v6_block_t; +#define PCAP_V6_BLOCK_DATA_SIZE (sizeof(pcap_v6_block_t) - sizeof(uint32_t)) + +// All required extension to save full pcap records +static uint16_t pcap_full_map[] = { 0 }; + +#include "nffile_inline.c" + +int Init_pcap2nf(void) { +int i, id, map_index; +int extension_size; +uint16_t map_size; + + // prepare pcap extension map + pcap_extension_info.map = NULL; + extension_size = 0; + map_size = 0; + + i=0; + while ( (id = pcap_full_map[i]) != 0 ) { + if ( extension_descriptor[id].enabled ) { + extension_size += extension_descriptor[id].size; + map_size += sizeof(uint16_t); + } + i++; + } + // extension_size contains the sum of all optional extensions + // caculate the record size + pcap_output_record_size_v4 = COMMON_RECORD_DATA_SIZE + PCAP_V4_BLOCK_DATA_SIZE + extension_size; + pcap_output_record_size_v6 = COMMON_RECORD_DATA_SIZE + PCAP_V6_BLOCK_DATA_SIZE + extension_size; + + // now the full extension map size + map_size += sizeof(extension_map_t); + + // align 32 bits + if ( ( map_size & 0x3 ) != 0 ) + map_size += 2; + + // Create a generic pcap extension map + pcap_extension_info.map = (extension_map_t *)malloc((size_t)map_size); + if ( !pcap_extension_info.map ) { + syslog(LOG_ERR, "Process_pcap: malloc() error in %s line %d: %s\n", __FILE__, __LINE__, strerror (errno)); + return 0; + } + pcap_extension_info.map->type = ExtensionMapType; + pcap_extension_info.map->size = map_size; + pcap_extension_info.map->map_id = INIT_ID; + pcap_extension_info.map->extension_size = extension_size; + + // see netflow_pcap.h for extension map description + map_index = 0; + i=0; + while ( (id = pcap_full_map[i]) != 0 ) { + if ( extension_descriptor[id].enabled ) + pcap_extension_info.map->ex_id[map_index++] = id; + i++; + } + pcap_extension_info.map->ex_id[map_index] = 0; + + pcap_extension_map = NULL; + + return 1; + +} // End of Init_pcap2nf + +int StorePcapFlow(FlowSource_t *fs, struct FlowNode *Node) { +common_record_t *common_record; +uint32_t packets, bytes, pcap_output_record_size; +uint64_t start_time, end_time; +int j, id; +char *string; +void *data_ptr; + + if ( !pcap_extension_map ) { + pcap_extension_map = (extension_map_t *)malloc(pcap_extension_info.map->size); + if ( !pcap_extension_map ) { + LogError("Process_pcap: malloc() error in %s line %d: %s\n", __FILE__, __LINE__, strerror (errno)); + return 0; + } + memcpy((void *)pcap_extension_map, (void *)pcap_extension_info.map, pcap_extension_info.map->size); + if ( !AddExtensionMap(fs, pcap_extension_map) ) { + LogError("Process_pcap: Fatal: AddExtensionMap() failed in %s line %d\n", __FILE__, __LINE__); + return 0; + } + + } + + if ( Node->version == AF_INET6 ) { + pcap_output_record_size = pcap_output_record_size_v6; + dbg_printf("Store Flow v6 node: size: %u\n", pcap_output_record_size); + } else if ( Node->version == AF_INET ) { + pcap_output_record_size = pcap_output_record_size_v4; + dbg_printf("Store Flow v4 node: size: %u\n", pcap_output_record_size); + } else { + LogError("Process_pcap: Unexpected version in %s line %d: %u\n", __FILE__, __LINE__, Node->version); + return 0; + } + + // output buffer size check for all expected records + if ( !CheckBufferSpace(fs->nffile, pcap_output_record_size) ) { + // fishy! - should never happen. maybe disk full? + LogError("Process_pcap: output buffer size error. Abort pcap record processing"); + return 0; + } + + // map output record to memory buffer + common_record = (common_record_t *)fs->nffile->buff_ptr; + + // header data + common_record->flags = 0; + common_record->type = CommonRecordType; + common_record->exporter_sysid = 0; + common_record->ext_map = pcap_extension_map->map_id; + common_record->size = pcap_output_record_size; + + // pcap common fields + common_record->srcport = Node->src_port; + common_record->dstport = Node->dst_port; + common_record->tcp_flags = Node->flags; + common_record->prot = Node->proto; + common_record->tos = 0; + common_record->fwd_status = 0; + + if ( Node->version == AF_INET6 ) { + SetFlag(common_record->flags, FLAG_IPV6_ADDR); + pcap_v6_block_t *pcap_v6_block = (pcap_v6_block_t *)common_record->data; + pcap_v6_block->srcaddr[0] = Node->src_addr.v6[0]; + pcap_v6_block->srcaddr[1] = Node->src_addr.v6[1]; + pcap_v6_block->dstaddr[0] = Node->dst_addr.v6[0]; + pcap_v6_block->dstaddr[1] = Node->dst_addr.v6[1]; + pcap_v6_block->dPkts = packets = Node->packets; + pcap_v6_block->dOctets = bytes = Node->bytes; + + data_ptr = (void *)pcap_v6_block->data; + } else { + pcap_v4_block_t *pcap_v4_block = (pcap_v4_block_t *)common_record->data; + pcap_v4_block->srcaddr = Node->src_addr.v4; + pcap_v4_block->dstaddr = Node->dst_addr.v4; + pcap_v4_block->dPkts = packets = Node->packets; + pcap_v4_block->dOctets = bytes = Node->bytes; + + data_ptr = (void *)pcap_v4_block->data; + } + + // process optional extensions + j = 0; + while ( (id = pcap_extension_map->ex_id[j]) != 0 ) { + switch (id) { + case EX_IO_SNMP_2: { // 2 byte input/output interface index + tpl_ext_4_t *tpl = (tpl_ext_4_t *)data_ptr; + tpl->input = 0; + tpl->output = 0; + data_ptr = (void *)tpl->data; + } break; + default: + // this should never happen, as pcap has no other extensions + LogError("Process_pcap: Unexpected extension %i for pcap record. Skip extension", id); + } + j++; + } + + common_record->first = Node->t_first.tv_sec; + common_record->msec_first = Node->t_first.tv_usec / 1000; + + common_record->last = Node->t_last.tv_sec; + common_record->msec_last = Node->t_last.tv_usec / 1000; + + start_time = (1000LL * (uint64_t)common_record->first) + (uint64_t)common_record->msec_first; + end_time = (1000LL * (uint64_t)common_record->last) + (uint64_t)common_record->msec_last; + + // update first_seen, last_seen + if ( start_time < fs->first_seen ) + fs->first_seen = start_time; + if ( end_time > fs->last_seen ) + fs->last_seen = end_time; + + + // Update stats + switch (common_record->prot) { + case IPPROTO_ICMP: + case IPPROTO_ICMPV6: + fs->nffile->stat_record->numflows_icmp++; + fs->nffile->stat_record->numpackets_icmp += packets; + fs->nffile->stat_record->numbytes_icmp += bytes; + // fix odd CISCO behaviour for ICMP port/type in src port + if ( common_record->srcport != 0 ) { + uint8_t *s1, *s2; + s1 = (uint8_t *)&(common_record->srcport); + s2 = (uint8_t *)&(common_record->dstport); + s2[0] = s1[1]; + s2[1] = s1[0]; + common_record->srcport = 0; + } + break; + case IPPROTO_TCP: + fs->nffile->stat_record->numflows_tcp++; + fs->nffile->stat_record->numpackets_tcp += packets; + fs->nffile->stat_record->numbytes_tcp += bytes; + break; + case IPPROTO_UDP: + fs->nffile->stat_record->numflows_udp++; + fs->nffile->stat_record->numpackets_udp += packets; + fs->nffile->stat_record->numbytes_udp += bytes; + break; + default: + fs->nffile->stat_record->numflows_other++; + fs->nffile->stat_record->numpackets_other += packets; + fs->nffile->stat_record->numbytes_other += bytes; + } + + fs->nffile->stat_record->numflows++; + fs->nffile->stat_record->numpackets += packets; + fs->nffile->stat_record->numbytes += bytes; + + if ( fs->xstat ) { + uint32_t bpp = packets ? bytes/packets : 0; + if ( bpp > MAX_BPP ) + bpp = MAX_BPP; + if ( common_record->prot == IPPROTO_TCP ) { + fs->xstat->bpp_histogram->tcp.bpp[bpp]++; + fs->xstat->bpp_histogram->tcp.count++; + + fs->xstat->port_histogram->src_tcp.port[common_record->srcport]++; + fs->xstat->port_histogram->dst_tcp.port[common_record->dstport]++; + fs->xstat->port_histogram->src_tcp.count++; + fs->xstat->port_histogram->dst_tcp.count++; + } else if ( common_record->prot == IPPROTO_UDP ) { + fs->xstat->bpp_histogram->udp.bpp[bpp]++; + fs->xstat->bpp_histogram->udp.count++; + + fs->xstat->port_histogram->src_udp.port[common_record->srcport]++; + fs->xstat->port_histogram->dst_udp.port[common_record->dstport]++; + fs->xstat->port_histogram->src_udp.count++; + fs->xstat->port_histogram->dst_udp.count++; + } + } + + if ( verbose ) { + master_record_t master_record; + ExpandRecord_v2((common_record_t *)common_record, &pcap_extension_info, NULL, &master_record); + format_file_block_record(&master_record, &string, 0); + printf("%s\n", string); + } + + // update file record size ( -> output buffer size ) + fs->nffile->block_header->NumRecords += 1; + fs->nffile->block_header->size += pcap_output_record_size; + fs->nffile->buff_ptr = data_ptr; + + return 1; + +} /* End of StorePcapFlow */ + diff --git a/bin/netflow_pcap.h b/bin/netflow_pcap.h new file mode 100644 index 0000000..b3e47b4 --- /dev/null +++ b/bin/netflow_pcap.h @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2014, Peter Haag + * Copyright (c) 2013, Peter Haag + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of the author nor the names of its contributors may be + * used to endorse or promote products derived from this software without + * specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 COPYRIGHT OWNER 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. + * + * $Author:$ + * + * $Id:$ + * + * $LastChangedRevision:$ + * + * + */ + +int Init_pcap2nf(void); + +int StorePcapFlow(FlowSource_t *fs, struct FlowNode *Node); + diff --git a/bin/netflow_v1.c b/bin/netflow_v1.c new file mode 100644 index 0000000..29fc1e2 --- /dev/null +++ b/bin/netflow_v1.c @@ -0,0 +1,538 @@ +/* + * Copyright (c) 2014, Peter Haag + * Copyright (c) 2009, Peter Haag + * Copyright (c) 2004-2008, SWITCH - Teleinformatikdienste fuer Lehre und Forschung + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of the author nor the names of its contributors may be + * used to endorse or promote products derived from this software without + * specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 COPYRIGHT OWNER 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. + * + * $Author: peter $ + * + * $Id: netflow_v1.c 30 2011-07-18 11:19:46Z peter $ + * + * $LastChangedRevision: 30 $ + * + */ + +#include "config.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#ifdef HAVE_STDINT_H +#include +#endif + +#include "util.h" +#include "nffile.h" +#include "nfx.h" +#include "nfnet.h" +#include "nf_common.h" +#include "bookkeeper.h" +#include "nfxstat.h" +#include "collector.h" +#include "exporter.h" +#include "netflow_v1.h" + +#ifndef DEVEL +# define dbg_printf(...) /* printf(__VA_ARGS__) */ +#else +# define dbg_printf(...) printf(__VA_ARGS__) +#endif + +extern int verbose; +extern extension_descriptor_t extension_descriptor[]; + +/* module limited globals */ +static extension_info_t v1_extension_info; // common for all v1 records +static uint16_t v1_output_record_size; + +// All required extension to save full v1 records +static uint16_t v1_full_map[] = { EX_IO_SNMP_2, EX_NEXT_HOP_v4, EX_ROUTER_IP_v4, EX_RECEIVED, 0 }; + +typedef struct v1_block_s { + uint32_t srcaddr; + uint32_t dstaddr; + uint32_t dPkts; + uint32_t dOctets; + uint32_t data[1]; // link to next record +} v1_block_t; +#define V1_BLOCK_DATA_SIZE (sizeof(v1_block_t) - sizeof(uint32_t)) + +typedef struct exporter_v1_s { + // identical to generic_exporter_t + struct exporter_v1_s *next; + + // generic exporter information + exporter_info_record_t info; + + uint64_t packets; // number of packets sent by this exporter + uint64_t flows; // number of flow records sent by this exporter + uint32_t sequence_failure; // number of sequence failues + + generic_sampler_t *sampler; + // End of generic_exporter_t + + // extension map + extension_map_t *extension_map; + +} exporter_v1_t; + +static inline exporter_v1_t *GetExporter(FlowSource_t *fs, netflow_v1_header_t *header); + +/* functions */ + +#include "nffile_inline.c" + +int Init_v1(void) { +int i, id, map_index; +int extension_size; +uint16_t map_size; + + // prepare v1 extension map + v1_extension_info.map = NULL; + v1_extension_info.next = NULL; + v1_extension_info.offset_cache = NULL; + v1_extension_info.ref_count = 0; + + extension_size = 0; + // default map - 0 extensions + map_size = sizeof(extension_map_t); + i=0; + dbg_printf("v1 map: map size start: %u\n", map_size); + while ( (id = v1_full_map[i]) != 0 ) { + if ( extension_descriptor[id].enabled ) { + extension_size += extension_descriptor[id].size; + map_size += sizeof(uint16_t); + dbg_printf("v1 map: enabled extension %u\n", id); + } + i++; + } + dbg_printf("v1 map: map size so far: %u\n", map_size); + + // extension_size contains the sum of all optional extensions + // caculate the record size + v1_output_record_size = COMMON_RECORD_DATA_SIZE + V1_BLOCK_DATA_SIZE + extension_size; + + // align 32 bits + if ( ( map_size & 0x3 ) != 0 ) + map_size += 2; + + // Create a generic netflow v1 extension map + v1_extension_info.map = (extension_map_t *)malloc((size_t)map_size); + if ( !v1_extension_info.map ) { + syslog(LOG_ERR, "Process_v1: malloc() error in %s line %d: %s\n", __FILE__, __LINE__, strerror (errno)); + return 0; + } + + v1_extension_info.map->type = ExtensionMapType; + v1_extension_info.map->size = map_size; + v1_extension_info.map->map_id = INIT_ID; + v1_extension_info.map->extension_size = extension_size; + + // see netflow_v1.h for extension map description + map_index = 0; + i=0; + while ( (id = v1_full_map[i]) != 0 ) { + if ( extension_descriptor[id].enabled ) + v1_extension_info.map->ex_id[map_index++] = id; + i++; + } + v1_extension_info.map->ex_id[map_index] = 0; + + return 1; +} // End of Init_v1 + +/* + * functions used for receiving netflow v1 records + */ + + +static inline exporter_v1_t *GetExporter(FlowSource_t *fs, netflow_v1_header_t *header) { +exporter_v1_t **e = (exporter_v1_t **)&(fs->exporter_data); +uint16_t version = ntohs(header->version); +#define IP_STRING_LEN 40 +char ipstr[IP_STRING_LEN]; + + // search the appropriate exporter engine + while ( *e ) { + if ( (*e)->info.version == version && + (*e)->info.ip.v6[0] == fs->ip.v6[0] && (*e)->info.ip.v6[1] == fs->ip.v6[1]) + return *e; + e = &((*e)->next); + } + + // nothing found + *e = (exporter_v1_t *)malloc(sizeof(exporter_v1_t)); + if ( !(*e)) { + syslog(LOG_ERR, "Process_v1: malloc() error in %s line %d: %s\n", __FILE__, __LINE__, strerror (errno)); + return NULL; + } + memset((void *)(*e), 0, sizeof(exporter_v1_t)); + (*e)->info.header.type = ExporterInfoRecordType; + (*e)->info.header.size = sizeof(exporter_info_record_t); + (*e)->info.version = version; + (*e)->info.id = 0; + (*e)->info.ip = fs->ip; + (*e)->info.sa_family = fs->sa_family; + (*e)->next = NULL; + (*e)->packets = 0; + (*e)->flows = 0; + (*e)->sequence_failure = 0; + (*e)->sampler = NULL; + + // copy the v1 generic extension map + (*e)->extension_map = (extension_map_t *)malloc(v1_extension_info.map->size); + if ( !(*e)->extension_map ) { + syslog(LOG_ERR, "Process_v1: malloc() error in %s line %d: %s\n", __FILE__, __LINE__, strerror (errno)); + free(*e); + *e = NULL; + return NULL; + } + memcpy((void *)(*e)->extension_map, (void *)v1_extension_info.map, v1_extension_info.map->size); + + if ( !AddExtensionMap(fs, (*e)->extension_map) ) { + // bad - we must free this map and fail - otherwise data can not be read any more + free((*e)->extension_map); + free(*e); + *e = NULL; + return NULL; + } + + (*e)->info.sysid = 0; + FlushInfoExporter(fs, &((*e)->info)); + + if ( fs->sa_family == AF_INET ) { + uint32_t _ip = htonl(fs->ip.v4); + inet_ntop(AF_INET, &_ip, ipstr, sizeof(ipstr)); + } else if ( fs->sa_family == AF_INET6 ) { + uint64_t _ip[2]; + _ip[0] = htonll(fs->ip.v6[0]); + _ip[1] = htonll(fs->ip.v6[1]); + inet_ntop(AF_INET6, &_ip, ipstr, sizeof(ipstr)); + } else { + strncpy(ipstr, "", IP_STRING_LEN); + } + + dbg_printf("New Exporter: v1 SysID: %u, Extension ID: %i, IP: %s, \n", + (*e)->info.sysid, (*e)->extension_map->map_id, ipstr); + syslog(LOG_INFO, "Process_v1: SysID: %u, New exporter: IP: %s\n", (*e)->info.sysid, ipstr); + + return (*e); + +} // End of GetExporter + +void Process_v1(void *in_buff, ssize_t in_buff_cnt, FlowSource_t *fs) { +netflow_v1_header_t *v1_header; +netflow_v1_record_t *v1_record; +exporter_v1_t *exporter; +extension_map_t *extension_map; +common_record_t *common_record; +uint64_t start_time, end_time, boot_time; +uint32_t First, Last; +uint16_t count; +uint8_t flags; +int i, done, flow_record_length; +ssize_t size_left; +char *string; + + // map v1 data structure to input buffer + v1_header = (netflow_v1_header_t *)in_buff; + + exporter = GetExporter(fs, v1_header); + if ( !exporter ) { + syslog(LOG_ERR,"Process_v1: Exporter NULL: Abort v1 record processing"); + return; + } + flags = 0; + + exporter->packets++; + + extension_map = exporter->extension_map; + flow_record_length = NETFLOW_V1_RECORD_LENGTH; + + // this many data to process + size_left = in_buff_cnt; + + common_record = fs->nffile->buff_ptr; + done = 0; + while ( !done ) { + v1_block_t *v1_block; + + /* Process header */ + + // count check + count = ntohs(v1_header->count); + if ( count > NETFLOW_V1_MAX_RECORDS ) { + syslog(LOG_ERR,"Process_v1: Unexpected record count in header: %i. Abort v1 record processing", count); + fs->nffile->buff_ptr = (void *)common_record; + return; + } + + // input buffer size check for all expected records + if ( size_left < ( NETFLOW_V1_HEADER_LENGTH + count * flow_record_length) ) { + syslog(LOG_ERR,"Process_v1: Not enough data to process v1 record. Abort v1 record processing"); + fs->nffile->buff_ptr = (void *)common_record; + return; + } + + // output buffer size check for all expected records + if ( !CheckBufferSpace(fs->nffile, count * v1_output_record_size) ) { + // fishy! - should never happen. maybe disk full? + syslog(LOG_ERR,"Process_v1: output buffer size error. Abort v1 record processing"); + return; + } + + // map output record to memory buffer + common_record = (common_record_t *)fs->nffile->buff_ptr; + v1_block = (v1_block_t *)common_record->data; + + v1_header->SysUptime = ntohl(v1_header->SysUptime); + v1_header->unix_secs = ntohl(v1_header->unix_secs); + v1_header->unix_nsecs = ntohl(v1_header->unix_nsecs); + + /* calculate boot time in msec */ + boot_time = ((uint64_t)(v1_header->unix_secs)*1000 + + ((uint64_t)(v1_header->unix_nsecs) / 1000000) ) - (uint64_t)(v1_header->SysUptime); + + // process all records + v1_record = (netflow_v1_record_t *)((pointer_addr_t)v1_header + NETFLOW_V1_HEADER_LENGTH); + + /* loop over each records associated with this header */ + for (i = 0; i < count; i++) { + pointer_addr_t bsize; + void *data_ptr; + uint8_t *s1, *s2; + int j, id; + // header data + common_record->flags = flags; + common_record->type = CommonRecordType; + common_record->exporter_sysid = exporter->info.sysid; + common_record->ext_map = extension_map->map_id; + common_record->size = v1_output_record_size; + + // v1 common fields + common_record->srcport = ntohs(v1_record->srcport); + common_record->dstport = ntohs(v1_record->dstport); + common_record->tcp_flags = v1_record->tcp_flags; + common_record->prot = v1_record->prot; + common_record->tos = v1_record->tos; + common_record->fwd_status = 0; + common_record->reserved = 0; + + // v1 typed data as fixed struct v1_block + v1_block->srcaddr = ntohl(v1_record->srcaddr); + v1_block->dstaddr = ntohl(v1_record->dstaddr); + v1_block->dPkts = ntohl(v1_record->dPkts); + v1_block->dOctets = ntohl(v1_record->dOctets); + + // process optional extensions + data_ptr = (void *)v1_block->data; + j = 0; + while ( (id = extension_map->ex_id[j]) != 0 ) { + switch (id) { + case EX_IO_SNMP_2: { // 2 byte input/output interface index + tpl_ext_4_t *tpl = (tpl_ext_4_t *)data_ptr; + tpl->input = ntohs(v1_record->input); + tpl->output = ntohs(v1_record->output); + data_ptr = (void *)tpl->data; + } break; + case EX_NEXT_HOP_v4: { // IPv4 next hop + tpl_ext_9_t *tpl = (tpl_ext_9_t *)data_ptr; + tpl->nexthop = ntohl(v1_record->nexthop); + data_ptr = (void *)tpl->data; + } break; + case EX_ROUTER_IP_v4: { // IPv4 router address + tpl_ext_23_t *tpl = (tpl_ext_23_t *)data_ptr; + tpl->router_ip = fs->ip.v4; + data_ptr = (void *)tpl->data; + ClearFlag(common_record->flags, FLAG_IPV6_EXP); + } break; + case EX_RECEIVED: { + tpl_ext_27_t *tpl = (tpl_ext_27_t *)data_ptr; + tpl->received = (uint64_t)((uint64_t)fs->received.tv_sec * 1000LL) + (uint64_t)((uint64_t)fs->received.tv_usec / 1000LL); + data_ptr = (void *)tpl->data; + } break; + + default: + // this should never happen, as v1 has no other extensions + syslog(LOG_ERR,"Process_v1: Unexpected extension %i for v1 record. Skip extension", id); + } + j++; + } + + // Time issues + First = ntohl(v1_record->First); + Last = ntohl(v1_record->Last); + + if ( First > Last ) { + /* First in msec, in case of msec overflow, between start and end */ + start_time = boot_time - 0x100000000LL + (uint64_t)First; + } else { + start_time = boot_time + (uint64_t)First; + } + + /* end time in msecs */ + end_time = (uint64_t)Last + boot_time; + + // if overflow happened after flow ended but before got exported + if ( Last > v1_header->SysUptime ) { + start_time -= 0x100000000LL; + end_time -= 0x100000000LL; + } + + common_record->first = start_time/1000; + common_record->msec_first = start_time - common_record->first*1000; + + common_record->last = end_time/1000; + common_record->msec_last = end_time - common_record->last*1000; + + // update first_seen, last_seen + if ( start_time < fs->first_seen ) + fs->first_seen = start_time; + if ( end_time > fs->last_seen ) + fs->last_seen = end_time; + + + // Update stats + switch (common_record->prot) { + case IPPROTO_ICMP: + fs->nffile->stat_record->numflows_icmp++; + fs->nffile->stat_record->numpackets_icmp += v1_block->dPkts; + fs->nffile->stat_record->numbytes_icmp += v1_block->dOctets; + // fix odd CISCO behaviour for ICMP port/type in src port + if ( common_record->srcport != 0 ) { + s1 = (uint8_t *)&(common_record->srcport); + s2 = (uint8_t *)&(common_record->dstport); + s2[0] = s1[1]; + s2[1] = s1[0]; + common_record->srcport = 0; + } + break; + case IPPROTO_TCP: + fs->nffile->stat_record->numflows_tcp++; + fs->nffile->stat_record->numpackets_tcp += v1_block->dPkts; + fs->nffile->stat_record->numbytes_tcp += v1_block->dOctets; + break; + case IPPROTO_UDP: + fs->nffile->stat_record->numflows_udp++; + fs->nffile->stat_record->numpackets_udp += v1_block->dPkts; + fs->nffile->stat_record->numbytes_udp += v1_block->dOctets; + break; + default: + fs->nffile->stat_record->numflows_other++; + fs->nffile->stat_record->numpackets_other += v1_block->dPkts; + fs->nffile->stat_record->numbytes_other += v1_block->dOctets; + } + exporter->flows++; + fs->nffile->stat_record->numflows++; + fs->nffile->stat_record->numpackets += v1_block->dPkts; + fs->nffile->stat_record->numbytes += v1_block->dOctets; + + if ( fs->xstat ) { + uint32_t bpp = v1_block->dPkts ? v1_block->dOctets/v1_block->dPkts : 0; + if ( bpp > MAX_BPP ) + bpp = MAX_BPP; + if ( common_record->prot == IPPROTO_TCP ) { + fs->xstat->bpp_histogram->tcp.bpp[bpp]++; + fs->xstat->bpp_histogram->tcp.count++; + + fs->xstat->port_histogram->src_tcp.port[common_record->srcport]++; + fs->xstat->port_histogram->dst_tcp.port[common_record->dstport]++; + fs->xstat->port_histogram->src_tcp.count++; + fs->xstat->port_histogram->dst_tcp.count++; + } else if ( common_record->prot == IPPROTO_UDP ) { + fs->xstat->bpp_histogram->udp.bpp[bpp]++; + fs->xstat->bpp_histogram->udp.count++; + + fs->xstat->port_histogram->src_udp.port[common_record->srcport]++; + fs->xstat->port_histogram->dst_udp.port[common_record->dstport]++; + fs->xstat->port_histogram->src_udp.count++; + fs->xstat->port_histogram->dst_udp.count++; + } + } + + + if ( verbose ) { + master_record_t master_record; + ExpandRecord_v2((common_record_t *)common_record, &v1_extension_info, &(exporter->info), &master_record); + format_file_block_record(&master_record, &string, 0); + printf("%s\n", string); + } + + // advance to next input flow record + v1_record = (netflow_v1_record_t *)((pointer_addr_t)v1_record + flow_record_length); + + if ( ((pointer_addr_t)data_ptr - (pointer_addr_t)common_record) != v1_output_record_size ) { + printf("Panic size check: ptr diff: %llu, record size: %u\n", (unsigned long long)((pointer_addr_t)data_ptr - (pointer_addr_t)common_record), v1_output_record_size ); + abort(); + } + // advance to next output record + common_record = (common_record_t *)data_ptr; + v1_block = (v1_block_t *)common_record->data; + + // buffer size sanity check - should never happen, but check it anyway + bsize = (pointer_addr_t)common_record - (pointer_addr_t)fs->nffile->block_header - sizeof(data_block_header_t); + if ( bsize > BUFFSIZE ) { + syslog(LOG_ERR,"### Software error ###: %s line %d", __FILE__, __LINE__); + syslog(LOG_ERR,"Process_v1: Output buffer overflow! Flush buffer and skip records."); + syslog(LOG_ERR,"Buffer size: size: %u, bsize: %llu > %u", fs->nffile->block_header->size, (unsigned long long)bsize, BUFFSIZE); + // reset buffer + fs->nffile->block_header->size = 0; + fs->nffile->block_header->NumRecords = 0; + fs->nffile->buff_ptr = (void *)((pointer_addr_t)fs->nffile->block_header + sizeof(data_block_header_t) ); + return; + } + + } // End of foreach v1 record + + // update file record size ( -> output buffer size ) + fs->nffile->block_header->NumRecords += count; + fs->nffile->block_header->size += count * v1_output_record_size; + fs->nffile->buff_ptr = (void *)common_record; + + // still to go for this many input bytes + size_left -= NETFLOW_V1_HEADER_LENGTH + count * flow_record_length; + + // next header + v1_header = (netflow_v1_header_t *)v1_record; + + // should never be < 0 + done = size_left <= 0; + + } // End of while !done + + return; + +} /* End of Process_v1 */ + diff --git a/bin/netflow_v1.h b/bin/netflow_v1.h new file mode 100644 index 0000000..7bb820c --- /dev/null +++ b/bin/netflow_v1.h @@ -0,0 +1,97 @@ +/* + * Copyright (c) 2014, Peter Haag + * Copyright (c) 2009, Peter Haag + * Copyright (c) 2004-2008, SWITCH - Teleinformatikdienste fuer Lehre und Forschung + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of the author nor the names of its contributors may be + * used to endorse or promote products derived from this software without + * specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 COPYRIGHT OWNER 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. + * + * $Author: peter $ + * + * $Id: netflow_v1.h 26 2011-07-05 18:51:25Z peter $ + * + * $LastChangedRevision: 26 $ + * + */ + +#ifndef _NETFLOW_V1_H +#define _NETFLOW_V1_H 1 + +#define NETFLOW_V1_HEADER_LENGTH 16 +#define NETFLOW_V1_RECORD_LENGTH 48 +#define NETFLOW_V1_MAX_RECORDS 24 + +/* v1 structures */ +typedef struct netflow_v1_header { + uint16_t version; + uint16_t count; + uint32_t SysUptime; + uint32_t unix_secs; + uint32_t unix_nsecs; +} netflow_v1_header_t; + +typedef struct netflow_v1_record { + uint32_t srcaddr; + uint32_t dstaddr; + uint32_t nexthop; + uint16_t input; + uint16_t output; + uint32_t dPkts; + uint32_t dOctets; + uint32_t First; + uint32_t Last; + uint16_t srcport; + uint16_t dstport; + uint16_t pad1; + uint8_t prot; + uint8_t tos; + uint8_t tcp_flags; + uint8_t pad2[7]; +} netflow_v1_record_t; + + +/* prototypes */ +int Init_v1(void); + +void Process_v1(void *in_buff, ssize_t in_buff_cnt, FlowSource_t *fs); + +/* + * Extension map for v1 + * + * Required extensions: + * + * 4 byte byte counter + * | 4byte packet counter + * | | IPv4 + * | | | + * xxxx x0 0 0 + * + * Optional extensions: + * + * 4 : 2 byte input/output interface id + * 9 : IPv4 next hop + */ + +#endif //_NETFLOW_V1_H diff --git a/bin/netflow_v5_v7.c b/bin/netflow_v5_v7.c new file mode 100644 index 0000000..36e58b6 --- /dev/null +++ b/bin/netflow_v5_v7.c @@ -0,0 +1,796 @@ +/* + * Copyright (c) 2014, Peter Haag + * Copyright (c) 2009, Peter Haag + * Copyright (c) 2004-2008, SWITCH - Teleinformatikdienste fuer Lehre und Forschung + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of the author nor the names of its contributors may be + * used to endorse or promote products derived from this software without + * specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 COPYRIGHT OWNER 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. + * + * $Author: haag $ + * + * $Id: netflow_v5_v7.c 69 2010-09-09 07:17:43Z haag $ + * + * $LastChangedRevision: 69 $ + * + */ + +#include "config.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#ifdef HAVE_STDINT_H +#include +#endif + +#include "util.h" +#include "nffile.h" +#include "nfx.h" +#include "nfnet.h" +#include "nf_common.h" +#include "bookkeeper.h" +#include "nfxstat.h" +#include "collector.h" +#include "exporter.h" +#include "netflow_v5_v7.h" + +#ifndef DEVEL +# define dbg_printf(...) /* printf(__VA_ARGS__) */ +#else +# define dbg_printf(...) printf(__VA_ARGS__) +#endif + +extern int verbose; +extern extension_descriptor_t extension_descriptor[]; +extern uint32_t default_sampling; +extern uint32_t overwrite_sampling; + +/* module limited globals */ +static extension_info_t v5_extension_info; // common for all v5 records +static uint16_t v5_output_record_size, v5_output_record_base_size; + +// All required extension to save full v5 records +static uint16_t v5_full_mapp[] = { EX_IO_SNMP_2, EX_AS_2, EX_MULIPLE, EX_NEXT_HOP_v4, EX_ROUTER_IP_v4, EX_ROUTER_ID, EX_RECEIVED, 0 }; + +// to simplify, assume blocks with 64 bit counters to check for enough buffer space +// regardless if 32 or 64 bit packet/byte counters +#define V5_BLOCK_DATA_SIZE (sizeof(ipv4_block_t) - sizeof(uint32_t) + 2 * sizeof(uint64_t)) + +typedef struct exporter_v5_s { + // identical to generic_exporter_t + struct exporter_v5_s *next; + + // generic exporter information + exporter_info_record_t info; + + uint64_t packets; // number of packets sent by this exporter + uint64_t flows; // number of flow records sent by this exporter + uint32_t sequence_failure; // number of sequence failues + + // generic sampler + generic_sampler_t *sampler; + // end of generic_exporter_t + + // sequence vars + int64_t last_sequence; + int64_t sequence, distance; + int64_t last_count; + + int first; + + // extension map + extension_map_t *extension_map; + +} exporter_v5_t; + +// for sending netflow v5 +static netflow_v5_header_t *v5_output_header; +static netflow_v5_record_t *v5_output_record; +static exporter_v5_t output_engine; + +static inline exporter_v5_t *GetExporter(FlowSource_t *fs, netflow_v5_header_t *header); + +static inline int CheckBufferSpace(nffile_t *nffile, size_t required); + +/* functions */ + +#include "nffile_inline.c" + +int Init_v5_v7_input(void) { +int i, id, map_index; +int extension_size; +uint16_t map_size; + + extension_size = 0; + // prepare v5 extension map + v5_extension_info.map = NULL; + v5_extension_info.next = NULL; + v5_extension_info.offset_cache = NULL; + v5_extension_info.ref_count = 0; + + // default map - 0 extensions + map_size = sizeof(extension_map_t); + i=0; + while ( (id = v5_full_mapp[i]) != 0 ) { + if ( extension_descriptor[id].enabled ) { + extension_size += extension_descriptor[id].size; + map_size += sizeof(uint16_t); + } + i++; + } + // extension_size contains the sum of all optional extensions + // caculate the record size without counters! + v5_output_record_base_size = COMMON_RECORD_DATA_SIZE + 8 + extension_size; // + 8 for 2 x IPv4 addr + + // align 32 bits + if ( ( map_size & 0x3 ) != 0 ) + map_size += 2; + + // Create a generic v5 extension map + v5_extension_info.map = (extension_map_t *)malloc((size_t)map_size); + if ( !v5_extension_info.map ) { + syslog(LOG_ERR, "Process_v5: malloc() error in %s line %d: %s\n", __FILE__, __LINE__, strerror (errno)); + return 0; + } + v5_extension_info.map->type = ExtensionMapType; + v5_extension_info.map->size = map_size; + v5_extension_info.map->map_id = INIT_ID; + v5_extension_info.map->extension_size = extension_size; + + // see netflow_v5_v7.h for extension map description + map_index = 0; + i=0; + while ( (id = v5_full_mapp[i]) != 0 ) { + if ( extension_descriptor[id].enabled ) + v5_extension_info.map->ex_id[map_index++] = id; + i++; + } + v5_extension_info.map->ex_id[map_index] = 0; + + return 1; +} // End of Init_v5_input + +/* + * functions used for receiving netflow v5 records + */ + + +static inline exporter_v5_t *GetExporter(FlowSource_t *fs, netflow_v5_header_t *header) { +exporter_v5_t **e = (exporter_v5_t **)&(fs->exporter_data); +generic_sampler_t *sampler; +uint16_t engine_tag = ntohs(header->engine_tag); +uint16_t version = ntohs(header->version); +#define IP_STRING_LEN 40 +char ipstr[IP_STRING_LEN]; + + // search the appropriate exporter engine + while ( *e ) { + if ( (*e)->info.version == version && (*e)->info.id == engine_tag && + (*e)->info.ip.v6[0] == fs->ip.v6[0] && (*e)->info.ip.v6[1] == fs->ip.v6[1]) + return *e; + e = &((*e)->next); + } + + // nothing found + *e = (exporter_v5_t *)malloc(sizeof(exporter_v5_t)); + if ( !(*e)) { + syslog(LOG_ERR, "Process_v5: malloc() error in %s line %d: %s\n", __FILE__, __LINE__, strerror (errno)); + return NULL; + } + memset((void *)(*e), 0, sizeof(exporter_v5_t)); + (*e)->next = NULL; + (*e)->info.header.type = ExporterInfoRecordType; + (*e)->info.header.size = sizeof(exporter_info_record_t); + (*e)->info.version = version; + (*e)->info.id = engine_tag; + (*e)->info.ip = fs->ip; + (*e)->info.sa_family = fs->sa_family; + (*e)->sequence_failure = 0; + (*e)->packets = 0; + (*e)->flows = 0; + (*e)->first = 1; + + sampler = (generic_sampler_t *)malloc(sizeof(generic_sampler_t)); + if ( !sampler ) { + syslog(LOG_ERR, "Process_v5: malloc() error in %s line %d: %s\n", __FILE__, __LINE__, strerror (errno)); + return NULL; + } + (*e)->sampler = sampler; + + sampler->info.header.type = SamplerInfoRecordype; + sampler->info.header.size = sizeof(sampler_info_record_t); + sampler->info.id = -1; + sampler->info.mode = (0xC000 & ntohs(header->sampling_interval)) >> 14; + sampler->info.interval = 0x3fff & ntohs(header->sampling_interval); + sampler->next = NULL; + + // default is global default_sampling ( user defined or unsampled => 1 ) + if ( sampler->info.interval == 0 ) + sampler->info.interval = default_sampling; + + // copy the v5 generic extension map + (*e)->extension_map = (extension_map_t *)malloc(v5_extension_info.map->size); + if ( !(*e)->extension_map ) { + syslog(LOG_ERR, "Process_v5: malloc() error in %s line %d: %s\n", __FILE__, __LINE__, strerror (errno)); + free(*e); + *e = NULL; + return NULL; + } + memcpy((void *)(*e)->extension_map, (void *)v5_extension_info.map, v5_extension_info.map->size); + + if ( !AddExtensionMap(fs, (*e)->extension_map) ) { + // bad - we must free this map and fail - otherwise data can not be read any more + free((*e)->extension_map); + free(*e); + *e = NULL; + return NULL; + } + + (*e)->info.sysid = 0; + FlushInfoExporter(fs, &((*e)->info)); + sampler->info.exporter_sysid = (*e)->info.sysid; + FlushInfoSampler(fs, &(sampler->info)); + + if ( fs->sa_family == AF_INET ) { + uint32_t _ip = htonl(fs->ip.v4); + inet_ntop(AF_INET, &_ip, ipstr, sizeof(ipstr)); + } else if ( fs->sa_family == AF_INET6 ) { + uint64_t _ip[2]; + _ip[0] = htonll(fs->ip.v6[0]); + _ip[1] = htonll(fs->ip.v6[1]); + inet_ntop(AF_INET6, &_ip, ipstr, sizeof(ipstr)); + } else { + strncpy(ipstr, "", IP_STRING_LEN); + } + + + + dbg_printf("New Exporter: v5 SysID: %u, Extension ID: %i, IP: %s, Sampling Mode: %i, Sampling Interval: %u\n", + (*e)->info.sysid, (*e)->extension_map->map_id, ipstr, sampler->info.mode ,sampler->info.interval); + syslog(LOG_INFO, "Process_v5: New exporter: SysID: %u, engine id %u, type %u, IP: %s, Sampling Mode: %i, Sampling Interval: %u\n", + (*e)->info.sysid, ( engine_tag & 0xFF ),( (engine_tag >> 8) & 0xFF ), ipstr, sampler->info.mode ,sampler->info.interval ); + + if ( overwrite_sampling > 0 ) { + sampler->info.interval = overwrite_sampling; + syslog(LOG_INFO, "Process_v5: Hard overwrite sampling rate: %u\n", sampler->info.interval); + } + + return (*e); + +} // End of GetExporter + +void Process_v5_v7(void *in_buff, ssize_t in_buff_cnt, FlowSource_t *fs) { +netflow_v5_header_t *v5_header; +netflow_v5_record_t *v5_record; +exporter_v5_t *exporter; +extension_map_t *extension_map; +common_record_t *common_record; +uint64_t start_time, end_time, boot_time; +uint32_t First, Last; +uint16_t count; +uint8_t flags; +int i, done, version, flow_record_length; +ssize_t size_left; +char *string; + + /* + * v7 is treated as v5. It differes only in the record length, for what we process. + */ + + // map v5 data structure to input buffer + v5_header = (netflow_v5_header_t *)in_buff; + + exporter = GetExporter(fs, v5_header); + if ( !exporter ) { + syslog(LOG_ERR,"Process_v5: Exporter NULL: Abort v5/v7 record processing"); + return; + } + exporter->packets++; + + // calculate record size depending on counter size + // sigh .. one day I should fix switch to 64bits + if ( exporter->sampler->info.interval == 1 ) { + flags = 0; + v5_output_record_size = v5_output_record_base_size + 8; // 2 x 4 byte counters + } else { + flags = 0; + SetFlag(flags, FLAG_SAMPLED); + SetFlag(flags, FLAG_PKG_64); + SetFlag(flags, FLAG_BYTES_64); + v5_output_record_size = v5_output_record_base_size + 16; // 2 x 8 byte counters + } + + extension_map = exporter->extension_map; + + version = ntohs(v5_header->version); + flow_record_length = version == 5 ? NETFLOW_V5_RECORD_LENGTH : NETFLOW_V7_RECORD_LENGTH; + + // this many data to process + size_left = in_buff_cnt; + + common_record = fs->nffile->buff_ptr; + done = 0; + while ( !done ) { + ipv4_block_t *ipv4_block; + + /* Process header */ + + // count check + count = ntohs(v5_header->count); + if ( count > NETFLOW_V5_MAX_RECORDS ) { + syslog(LOG_ERR,"Process_v5: Unexpected record count in header: %i. Abort v5/v7 record processing", count); + fs->nffile->buff_ptr = (void *)common_record; + return; + } + + // input buffer size check for all expected records + if ( size_left < ( NETFLOW_V5_HEADER_LENGTH + count * flow_record_length) ) { + syslog(LOG_ERR,"Process_v5: Not enough data to process v5 record. Abort v5/v7 record processing"); + fs->nffile->buff_ptr = (void *)common_record; + return; + } + + // output buffer size check for all expected records + if ( !CheckBufferSpace(fs->nffile, count * v5_output_record_size) ) { + // fishy! - should never happen. maybe disk full? + syslog(LOG_ERR,"Process_v5: output buffer size error. Abort v5/v7 record processing"); + return; + } + + // map output record to memory buffer + common_record = (common_record_t *)fs->nffile->buff_ptr; + ipv4_block = (ipv4_block_t *)common_record->data; + + // sequence check + if ( exporter->first ) { + exporter->last_sequence = ntohl(v5_header->flow_sequence); + exporter->sequence = exporter->last_sequence; + exporter->first = 0; + } else { + exporter->last_sequence = exporter->sequence; + exporter->sequence = ntohl(v5_header->flow_sequence); + exporter->distance = exporter->sequence - exporter->last_sequence; + // handle overflow + if (exporter->distance < 0) { + exporter->distance = 0xffffffff + exporter->distance +1; + } + if (exporter->distance != exporter->last_count) { +#define delta(a,b) ( (a)>(b) ? (a)-(b) : (b)-(a) ) + fs->nffile->stat_record->sequence_failure++; + exporter->sequence_failure++; + /* + syslog(LOG_ERR,"Flow v%d sequence last:%llu now:%llu mismatch. Missing: dist:%lu flows", + version, exporter->last_sequence, exporter->sequence, exporter->distance); + */ + + } + } + exporter->last_count = count; + + v5_header->SysUptime = ntohl(v5_header->SysUptime); + v5_header->unix_secs = ntohl(v5_header->unix_secs); + v5_header->unix_nsecs = ntohl(v5_header->unix_nsecs); + + /* calculate boot time in msec */ + boot_time = ((uint64_t)(v5_header->unix_secs)*1000 + + ((uint64_t)(v5_header->unix_nsecs) / 1000000) ) - (uint64_t)(v5_header->SysUptime); + + // process all records + v5_record = (netflow_v5_record_t *)((pointer_addr_t)v5_header + NETFLOW_V5_HEADER_LENGTH); + + /* loop over each records associated with this header */ + for (i = 0; i < count; i++) { + pointer_addr_t bsize; + uint64_t packets, bytes; + void *data_ptr; + uint8_t *s1, *s2; + int j, id; + // header data + common_record->flags = flags; + common_record->type = CommonRecordType; + common_record->exporter_sysid = exporter->info.sysid;; + common_record->ext_map = extension_map->map_id; + common_record->size = v5_output_record_size; + + // v5 common fields + common_record->srcport = ntohs(v5_record->srcport); + common_record->dstport = ntohs(v5_record->dstport); + common_record->tcp_flags = v5_record->tcp_flags; + common_record->prot = v5_record->prot; + common_record->tos = v5_record->tos; + common_record->fwd_status = 0; + common_record->reserved = 0; + + // v5 typed data as fixed struct v5_block + ipv4_block->srcaddr = ntohl(v5_record->srcaddr); + ipv4_block->dstaddr = ntohl(v5_record->dstaddr); + + if ( exporter->sampler->info.interval == 1 ) { + value32_t *v = (value32_t *)ipv4_block->data; + + packets = (uint64_t)ntohl(v5_record->dPkts); + bytes = (uint64_t)ntohl(v5_record->dOctets); + + v->val = packets; + v = (value32_t *)v->data; + v->val = bytes; + + data_ptr = (void *)v->data; + } else { + value64_t *v = (value64_t *)ipv4_block->data; + uint32_t *ptr = (uint32_t *)&packets; + + packets = (uint64_t)ntohl(v5_record->dPkts) * (uint64_t)exporter->sampler->info.interval; + bytes = (uint64_t)ntohl(v5_record->dOctets) * (uint64_t)exporter->sampler->info.interval; + + // pack packets in 32bit chunks + v->val.val32[0] = ptr[0]; + v->val.val32[1] = ptr[1]; + + // pack bytes in 32bit chunks + v = (value64_t *)v->data; + ptr = (uint32_t *)&bytes; + v->val.val32[0] = ptr[0]; + v->val.val32[1] = ptr[1]; + + data_ptr = (void *)v->data; + } + + // process optional extensions + j = 0; + while ( (id = extension_map->ex_id[j]) != 0 ) { + switch (id) { + case EX_IO_SNMP_2: { // 2 byte input/output interface index + tpl_ext_4_t *tpl = (tpl_ext_4_t *)data_ptr; + tpl->input = ntohs(v5_record->input); + tpl->output = ntohs(v5_record->output); + data_ptr = (void *)tpl->data; + } break; + case EX_AS_2: { // 2 byte src/dst AS number + tpl_ext_6_t *tpl = (tpl_ext_6_t *)data_ptr; + tpl->src_as = ntohs(v5_record->src_as); + tpl->dst_as = ntohs(v5_record->dst_as); + data_ptr = (void *)tpl->data; + } break; + case EX_MULIPLE: { // dst tos, direction, src/dst mask + tpl_ext_8_t *tpl = (tpl_ext_8_t *)data_ptr; + tpl->dst_tos = 0; + tpl->dir = 0; + tpl->src_mask = v5_record->src_mask; + tpl->dst_mask = v5_record->dst_mask; + data_ptr = (void *)tpl->data; + } break; + case EX_NEXT_HOP_v4: { // IPv4 next hop + tpl_ext_9_t *tpl = (tpl_ext_9_t *)data_ptr; + tpl->nexthop = ntohl(v5_record->nexthop); + data_ptr = (void *)tpl->data; + } break; + case EX_ROUTER_IP_v4: { // IPv4 router address + tpl_ext_23_t *tpl = (tpl_ext_23_t *)data_ptr; + tpl->router_ip = fs->ip.v4; + data_ptr = (void *)tpl->data; + ClearFlag(common_record->flags, FLAG_IPV6_EXP); + } break; + case EX_ROUTER_ID: { // engine type, engine ID + tpl_ext_25_t *tpl = (tpl_ext_25_t *)data_ptr; + uint16_t engine_tag = ntohs(v5_header->engine_tag); + tpl->engine_type = (engine_tag >> 8) & 0xFF; + tpl->engine_id = (engine_tag & 0xFF); + data_ptr = (void *)tpl->data; + } break; + case EX_RECEIVED: { + tpl_ext_27_t *tpl = (tpl_ext_27_t *)data_ptr; + tpl->received = (uint64_t)((uint64_t)fs->received.tv_sec * 1000LL) + (uint64_t)((uint64_t)fs->received.tv_usec / 1000LL); + data_ptr = (void *)tpl->data; + } break; + + default: + // this should never happen, as v5 has no other extensions + syslog(LOG_ERR,"Process_v5: Unexpected extension %i for v5 record. Skip extension", id); + } + j++; + } + + // Time issues + First = ntohl(v5_record->First); + Last = ntohl(v5_record->Last); + +#ifdef FIXTIMEBUG + /* + * Some users report, that they see flows, which have duration time of about 40days + * which is almost the overflow value. Investigating this, it cannot be an overflow + * and the difference is always 15160 or 15176 msec too little for a classical + * overflow. Therefore assume this must be an exporter bug + */ + if ( First > Last && ( (First - Last) < 20000) ) { + uint32_t _t; + syslog(LOG_ERR,"Process_v5: Unexpected time swap: First 0x%llx smaller than boot time: 0x%llx", start_time, boot_time); + _t= First; + First = Last; + Last = _t; + } +#endif + if ( First > Last ) { + /* First in msec, in case of msec overflow, between start and end */ + start_time = boot_time - 0x100000000LL + (uint64_t)First; + } else { + start_time = boot_time + (uint64_t)First; + } + + /* end time in msecs */ + end_time = (uint64_t)Last + boot_time; + + // if overflow happened after flow ended but before got exported + // the additional check > 100000 is required due to a CISCO IOS bug + // CSCei12353 - thanks to Bojan + if ( Last > v5_header->SysUptime && (( Last - v5_header->SysUptime) > 100000)) { + start_time -= 0x100000000LL; + end_time -= 0x100000000LL; + } + + common_record->first = start_time/1000; + common_record->msec_first = start_time - common_record->first*1000; + + common_record->last = end_time/1000; + common_record->msec_last = end_time - common_record->last*1000; + + // update first_seen, last_seen + if ( start_time < fs->first_seen ) + fs->first_seen = start_time; + if ( end_time > fs->last_seen ) + fs->last_seen = end_time; + + + // Update stats + switch (common_record->prot) { + case IPPROTO_ICMP: + fs->nffile->stat_record->numflows_icmp++; + fs->nffile->stat_record->numpackets_icmp += packets; + fs->nffile->stat_record->numbytes_icmp += bytes; + // fix odd CISCO behaviour for ICMP port/type in src port + if ( common_record->srcport != 0 ) { + s1 = (uint8_t *)&(common_record->srcport); + s2 = (uint8_t *)&(common_record->dstport); + s2[0] = s1[1]; + s2[1] = s1[0]; + common_record->srcport = 0; + } + break; + case IPPROTO_TCP: + fs->nffile->stat_record->numflows_tcp++; + fs->nffile->stat_record->numpackets_tcp += packets; + fs->nffile->stat_record->numbytes_tcp += bytes; + break; + case IPPROTO_UDP: + fs->nffile->stat_record->numflows_udp++; + fs->nffile->stat_record->numpackets_udp += packets; + fs->nffile->stat_record->numbytes_udp += bytes; + break; + default: + fs->nffile->stat_record->numflows_other++; + fs->nffile->stat_record->numpackets_other += packets; + fs->nffile->stat_record->numbytes_other += bytes; + } + exporter->flows++; + fs->nffile->stat_record->numflows++; + fs->nffile->stat_record->numpackets += packets; + fs->nffile->stat_record->numbytes += bytes; + + if ( fs->xstat ) { + uint32_t bpp = packets ? (bytes/packets) : 0; + if ( bpp > MAX_BPP ) + bpp = MAX_BPP; + if ( common_record->prot == IPPROTO_TCP ) { + fs->xstat->bpp_histogram->tcp.bpp[bpp]++; + fs->xstat->bpp_histogram->tcp.count++; + + fs->xstat->port_histogram->src_tcp.port[common_record->srcport]++; + fs->xstat->port_histogram->dst_tcp.port[common_record->dstport]++; + fs->xstat->port_histogram->src_tcp.count++; + fs->xstat->port_histogram->dst_tcp.count++; + } else if ( common_record->prot == IPPROTO_UDP ) { + fs->xstat->bpp_histogram->udp.bpp[bpp]++; + fs->xstat->bpp_histogram->udp.count++; + + fs->xstat->port_histogram->src_udp.port[common_record->srcport]++; + fs->xstat->port_histogram->dst_udp.port[common_record->dstport]++; + fs->xstat->port_histogram->src_udp.count++; + fs->xstat->port_histogram->dst_udp.count++; + } + } + + + if ( verbose ) { + master_record_t master_record; + ExpandRecord_v2((common_record_t *)common_record, &v5_extension_info, &(exporter->info), &master_record); + format_file_block_record(&master_record, &string, 0); + printf("%s\n", string); + } + + // advance to next input flow record + v5_record = (netflow_v5_record_t *)((pointer_addr_t)v5_record + flow_record_length); + + if ( ((pointer_addr_t)data_ptr - (pointer_addr_t)common_record) != v5_output_record_size ) { + printf("Panic size check: ptr diff: %llu, record size: %u\n", + (unsigned long long)((pointer_addr_t)data_ptr - (pointer_addr_t)common_record), v5_output_record_size ); + abort(); + } + // advance to next output record + common_record = (common_record_t *)data_ptr; + ipv4_block = (ipv4_block_t *)common_record->data; + + // buffer size sanity check - should never happen, but check it anyway + bsize = (pointer_addr_t)common_record - (pointer_addr_t)fs->nffile->block_header - sizeof(data_block_header_t); + if ( bsize >= BUFFSIZE ) { + syslog(LOG_ERR,"### Software error ###: %s line %d", __FILE__, __LINE__); + syslog(LOG_ERR,"Process_v5: Output buffer overflow! Flush buffer and skip records."); + syslog(LOG_ERR,"Buffer size: size: %u, bsize: %llu > %u", fs->nffile->block_header->size, (unsigned long long)bsize, BUFFSIZE); + // reset buffer + fs->nffile->block_header->size = 0; + fs->nffile->block_header->NumRecords = 0; + fs->nffile->buff_ptr = (void *)((pointer_addr_t)fs->nffile->block_header + sizeof(data_block_header_t) ); + return; + } + + } // End of foreach v5 record + + // update file record size ( -> output buffer size ) + fs->nffile->block_header->NumRecords += count; + fs->nffile->block_header->size += count * v5_output_record_size; + fs->nffile->buff_ptr = (void *)common_record; + + // still to go for this many input bytes + size_left -= NETFLOW_V5_HEADER_LENGTH + count * flow_record_length; + + // next header + v5_header = (netflow_v5_header_t *)v5_record; + + // should never be < 0 + done = size_left <= 0; + + } // End of while !done + + return; + +} /* End of Process_v5 */ + +/* + * functions used for sending netflow v5 records + */ +void Init_v5_v7_output(send_peer_t *peer) { + + v5_output_header = (netflow_v5_header_t *)peer->send_buffer; + v5_output_header->version = htons(5); + v5_output_header->SysUptime = 0; + v5_output_header->unix_secs = 0; + v5_output_header->unix_nsecs = 0; + v5_output_header->count = 0; + output_engine.first = 1; + + output_engine.sequence = 0; + output_engine.last_sequence = 0; + output_engine.last_count = 0; + output_engine.sequence_failure = 0; + v5_output_record = (netflow_v5_record_t *)((pointer_addr_t)v5_output_header + (pointer_addr_t)sizeof(netflow_v5_header_t)); + +} // End of Init_v5_v7_output + +int Add_v5_output_record(master_record_t *master_record, send_peer_t *peer) { +static uint64_t boot_time; // in msec +static int cnt; +extension_map_t *extension_map = master_record->map_ref; +uint32_t i, id, t1, t2; + + // Skip IPv6 records + if ( (master_record->flags & FLAG_IPV6_ADDR ) != 0 ) + return 0; + + if ( output_engine.first ) { // first time a record is added + // boot time is set one day back - assuming that the start time of every flow does not start ealier + boot_time = (uint64_t)(master_record->first - 86400)*1000; + v5_output_header->unix_secs = htonl(master_record->first - 86400); + cnt = 0; + output_engine.first = 0; + } + if ( cnt == 0 ) { + peer->buff_ptr = (void *)((pointer_addr_t)peer->send_buffer + NETFLOW_V5_HEADER_LENGTH); + v5_output_record = (netflow_v5_record_t *)((pointer_addr_t)v5_output_header + (pointer_addr_t)sizeof(netflow_v5_header_t)); + output_engine.sequence = output_engine.last_sequence + output_engine.last_count; + v5_output_header->flow_sequence = htonl(output_engine.sequence); + output_engine.last_sequence = output_engine.sequence; + } + + t1 = (uint32_t)(1000LL * (uint64_t)master_record->first + (uint64_t)master_record->msec_first - boot_time); + t2 = (uint32_t)(1000LL * (uint64_t)master_record->last + (uint64_t)master_record->msec_last - boot_time); + v5_output_record->First = htonl(t1); + v5_output_record->Last = htonl(t2); + + v5_output_record->srcaddr = htonl(master_record->v4.srcaddr); + v5_output_record->dstaddr = htonl(master_record->v4.dstaddr); + + v5_output_record->srcport = htons(master_record->srcport); + v5_output_record->dstport = htons(master_record->dstport); + v5_output_record->tcp_flags = master_record->tcp_flags; + v5_output_record->prot = master_record->prot; + v5_output_record->tos = master_record->tos; + + // the 64bit counters are cut down to 32 bits for v5 + v5_output_record->dPkts = htonl((uint32_t)master_record->dPkts); + v5_output_record->dOctets = htonl((uint32_t)master_record->dOctets); + + v5_output_record->input = 0; + v5_output_record->output = 0; + v5_output_record->src_as = 0; + v5_output_record->dst_as = 0; + v5_output_record->src_mask = 0; + v5_output_record->dst_mask = 0; + v5_output_record->pad1 = 0; + v5_output_record->pad2 = 0; + v5_output_record->nexthop = 0; + + i = 0; + while ( (id = extension_map->ex_id[i]) != 0 ) { + switch (id) { + case EX_IO_SNMP_2: + v5_output_record->input = htons(master_record->input); + v5_output_record->output = htons(master_record->output); + break; + case EX_AS_2: + v5_output_record->src_as = htons(master_record->srcas); + v5_output_record->dst_as = htons(master_record->dstas); + break; + case EX_MULIPLE: + v5_output_record->src_mask = master_record->src_mask; + v5_output_record->dst_mask = master_record->dst_mask; + break; + case EX_NEXT_HOP_v4: + v5_output_record->nexthop = htonl(master_record->ip_nexthop.v4); + break; + // default: Other extensions can not be sent with v5 + } + i++; + } + cnt++; + + v5_output_header->count = htons(cnt); + peer->buff_ptr = (void *)((pointer_addr_t)peer->buff_ptr + NETFLOW_V5_RECORD_LENGTH); + v5_output_record++; + if ( cnt == NETFLOW_V5_MAX_RECORDS ) { + peer->flush = 1; + output_engine.last_count = cnt; + cnt = 0; + } + + return 0; + +} // End of Add_v5_output_record diff --git a/bin/netflow_v5_v7.h b/bin/netflow_v5_v7.h new file mode 100644 index 0000000..10bc437 --- /dev/null +++ b/bin/netflow_v5_v7.h @@ -0,0 +1,149 @@ +/* + * Copyright (c) 2014, Peter Haag + * Copyright (c) 2009, Peter Haag + * Copyright (c) 2004-2008, SWITCH - Teleinformatikdienste fuer Lehre und Forschung + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of the author nor the names of its contributors may be + * used to endorse or promote products derived from this software without + * specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 COPYRIGHT OWNER 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. + * + * $Author: haag $ + * + * $Id: netflow_v5_v7.h 39 2009-11-25 08:11:15Z haag $ + * + * $LastChangedRevision: 39 $ + * + */ + +#ifndef _NETFLOW_V5_V7_H +#define _NETFLOW_V5_V7_H 1 + +#define NETFLOW_V5_HEADER_LENGTH 24 +#define NETFLOW_V5_RECORD_LENGTH 48 +#define NETFLOW_V5_MAX_RECORDS 30 + +#define NETFLOW_V7_HEADER_LENGTH 24 +#define NETFLOW_V7_RECORD_LENGTH 52 +#define NETFLOW_V7_MAX_RECORDS 28 + +/* v5 structures */ +typedef struct netflow_v5_header { + uint16_t version; + uint16_t count; + uint32_t SysUptime; + uint32_t unix_secs; + uint32_t unix_nsecs; + uint32_t flow_sequence; + uint16_t engine_tag; + uint16_t sampling_interval; +} netflow_v5_header_t; + +typedef struct netflow_v5_record { + uint32_t srcaddr; + uint32_t dstaddr; + uint32_t nexthop; + uint16_t input; + uint16_t output; + uint32_t dPkts; + uint32_t dOctets; + uint32_t First; + uint32_t Last; + uint16_t srcport; + uint16_t dstport; + uint8_t pad1; + uint8_t tcp_flags; + uint8_t prot; + uint8_t tos; + uint16_t src_as; + uint16_t dst_as; + uint8_t src_mask; + uint8_t dst_mask; + uint16_t pad2; +} netflow_v5_record_t; + + +/* v7 structures */ +typedef struct netflow_v7_header { + uint16_t version; + uint16_t count; + uint32_t SysUptime; + uint32_t unix_secs; + uint32_t unix_nsecs; + uint32_t flow_sequence; + uint32_t reserved; +} netflow_v7_header_t; + +typedef struct netflow_v7_record { + uint32_t srcaddr; + uint32_t dstaddr; + uint32_t nexthop; + uint16_t input; + uint16_t output; + uint32_t dPkts; + uint32_t dOctets; + uint32_t First; + uint32_t Last; + uint16_t srcport; + uint16_t dstport; + uint8_t flags; + uint8_t tcp_flags; + uint8_t prot; + uint8_t tos; + uint16_t src_as; + uint16_t dst_as; + uint8_t src_mask; + uint8_t dst_mask; + uint16_t pad; + uint32_t router_sc; +} netflow_v7_record_t; + +/* prototypes */ +int Init_v5_v7_input(void); + +void Process_v5_v7(void *in_buff, ssize_t in_buff_cnt, FlowSource_t *fs); + +void Init_v5_v7_output(send_peer_t *peer); + +int Add_v5_output_record(master_record_t *master_record, send_peer_t *peer); + +/* + * Extension map for v5/v7 + * + * Required extensions: + * + * 4 byte byte counter + * | 4byte packet counter + * | | IPv4 + * | | | + * xxxx x0 0 0 + * + * Optional extensions: + * + * 4 : 2 byte input/output interface id + * 6 : 2 byte src/dst as + * 8 : srcmask/dst mask dst tos = 0, dir = 0 + * 9 : IPv4 next hop + */ + +#endif //_NETFLOW_V5_V7_H diff --git a/bin/netflow_v9.c b/bin/netflow_v9.c new file mode 100644 index 0000000..b651c56 --- /dev/null +++ b/bin/netflow_v9.c @@ -0,0 +1,3064 @@ +/* + * Copyright (c) 2014, Peter Haag + * Copyright (c) 2009, Peter Haag + * Copyright (c) 2004-2008, SWITCH - Teleinformatikdienste fuer Lehre und Forschung + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of the author nor the names of its contributors may be + * used to endorse or promote products derived from this software without + * specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 COPYRIGHT OWNER 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. + * + * $Author: haag $ + * + * $Id: netflow_v9.c 55 2010-02-02 16:02:58Z haag $ + * + * $LastChangedRevision: 55 $ + * + */ + +#include "config.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#ifdef HAVE_STDINT_H +#include +#endif + +#include "nffile.h" +#include "nfx.h" +#include "nfnet.h" +#include "nf_common.h" +#include "util.h" +#include "bookkeeper.h" +#include "nfxstat.h" +#include "collector.h" +#include "exporter.h" +#include "netflow_v9.h" + +#ifndef DEVEL +# define dbg_printf(...) /* printf(__VA_ARGS__) */ +#else +# define dbg_printf(...) printf(__VA_ARGS__) +#endif + +// a few handy macros +#define GET_FLOWSET_ID(p) (Get_val16(p)) +#define GET_FLOWSET_LENGTH(p) (Get_val16((void *)((p) + 2))) + +#define GET_TEMPLATE_ID(p) (Get_val16(p)) +#define GET_TEMPLATE_COUNT(p) (Get_val16((void *)((p) + 2))) + +#define GET_OPTION_TEMPLATE_ID(p) (Get_val16(p)) +#define GET_OPTION_TEMPLATE_OPTION_SCOPE_LENGTH(p) (Get_val16((void *)((p) + 2))) +#define GET_OPTION_TEMPLATE_OPTION_LENGTH(p) (Get_val16((void *)((p) + 4))) + +#include "inline.c" + +extern int verbose; +extern extension_descriptor_t extension_descriptor[]; +extern uint32_t Max_num_extensions; +extern uint32_t default_sampling; +extern uint32_t overwrite_sampling; + +typedef struct sequence_map_s { +/* sequence definition: + just move a certain number of bytes -> moveXX + set a certain number of output bytes to zero -> zeroXX + process input data into appropriate output -> AnyName + */ +#define nop 0 +#define move8 1 +#define move16 2 +#define move32 3 +#define move40 4 +#define move48 5 +#define move56 6 +#define move64 7 +#define move96 8 +#define move128 9 +#define move32_sampling 10 +#define move64_sampling 11 +#define move_mac 12 +#define move_mpls 13 +#define move_ulatency 14 +#define move_slatency 15 +#define move_user_20 16 +#define move_user_65 17 +#define TimeMsec 18 +#define PushTimeMsec 19 +#define saveICMP 20 +#define zero8 21 +#define zero16 22 +#define zero32 23 +#define zero64 24 +#define zero96 25 +#define zero128 26 + + uint32_t id; // sequence ID as defined above + uint16_t input_offset; // copy/process data at this input offset + uint16_t output_offset; // copy final data to this output offset + void *stack; // optionally copy data onto this stack +} sequence_map_t; + + +typedef struct input_translation_s { + struct input_translation_s *next; + uint32_t flags; + time_t updated; + uint32_t id; + uint32_t input_record_size; + uint32_t output_record_size; + + // tmp vars needed while processing the data record + uint32_t ICMP_offset; // offset of ICMP type/code in data stream + uint64_t flow_start; // start time in msec + uint64_t flow_end; // end time in msec + uint64_t EventTimeMsec; // Event time in msec for NSEL/NEL + uint64_t packets; // total packets - sampling corrected + uint64_t bytes; // total bytes - sampling corrected + uint64_t out_packets; // total out packets - sampling corrected + uint64_t out_bytes; // total out bytes - sampling corrected + uint32_t sampler_offset; + uint32_t sampler_size; + uint32_t engine_offset; + uint32_t received_offset; + uint32_t router_ip_offset; + + // extension map infos + uint32_t extension_map_changed; // map changed while refreshing + extension_info_t extension_info; // the nfcap extension map, reflecting this template + + // sequence map information + uint32_t number_of_sequences; // number of sequences for the translate + sequence_map_t *sequence; // sequence map + +} input_translation_t; + +typedef struct exporter_v9_domain_s { + // identical to generic_exporter_t + struct exporter_v9_domain_s *next; + + // generic exporter information + exporter_info_record_t info; + + uint64_t packets; // number of packets sent by this exporter + uint64_t flows; // number of flow records sent by this exporter + uint32_t sequence_failure; // number of sequence failues + + // generic sampler + generic_sampler_t *sampler; + // end of generic_exporter_t + + // exporter parameters + uint64_t boot_time; + // sequence + int64_t last_sequence; + int64_t sequence; + int first; + + // sampling information: + // each flow source may have several sampler applied + // tags #48, #49, #50 + // each sampler is assinged a sampler struct + + // global sampling information #34 #35 + // stored in a sampler with id = -1; + + // translation table + input_translation_t *input_translation_table; + input_translation_t *current_table; +} exporter_v9_domain_t; + + +/* module limited globals */ +static struct v9_element_map_s { + uint16_t id; // v9 element id + char *name; // name string + uint16_t length; // type of this element ( input length ) + uint16_t out_length; // type of this element ( output length ) + uint32_t sequence; // output length + uint32_t zero_sequence; // + uint16_t extension; // maps into nfdump extension ID +} v9_element_map[] = { + {0, 0, 0}, + // packets and bytes are always stored in 64bits + { NF9_IN_BYTES, "bytes", _4bytes, _8bytes, move32_sampling, zero64, COMMON_BLOCK }, + { NF9_IN_BYTES, "bytes", _8bytes, _8bytes, move64_sampling, zero64, COMMON_BLOCK }, + { NF9_IN_PACKETS, "packets", _4bytes, _8bytes, move32_sampling, zero64, COMMON_BLOCK }, + { NF9_IN_PACKETS, "packets", _8bytes, _8bytes, move64_sampling, zero64, COMMON_BLOCK }, + + { NF9_FLOWS_AGGR, "flows", _4bytes, _4bytes, move32, zero32, EX_AGGR_FLOWS_4 }, + { NF9_FLOWS_AGGR, "flows", _8bytes, _8bytes, move64, zero64, EX_AGGR_FLOWS_8 }, + { NF9_IN_PROTOCOL, "proto", _1byte, _1byte, move8, zero8, COMMON_BLOCK }, + { NF9_SRC_TOS, "tos", _1byte, _1byte, move8, zero8, COMMON_BLOCK }, + { NF9_TCP_FLAGS, "flags", _1byte, _1byte, move8, zero8, COMMON_BLOCK }, + { NF9_L4_SRC_PORT, "src port", _2bytes, _2bytes, move16, zero16, COMMON_BLOCK }, + { NF9_IPV4_SRC_ADDR, "V4 src addr", _4bytes, _4bytes, move32, zero32, COMMON_BLOCK }, + { NF9_SRC_MASK, "V4 src mask", _1byte, _1byte, move8, zero8, EX_MULIPLE }, + { NF9_INPUT_SNMP, "input SNMP", _2bytes, _2bytes, move16, zero16, EX_IO_SNMP_2 }, + { NF9_INPUT_SNMP, "input SNMP", _4bytes, _4bytes, move32, zero32, EX_IO_SNMP_4 }, + { NF9_L4_DST_PORT, "dst port", _2bytes, _2bytes, move16, zero16, COMMON_BLOCK }, + { NF9_IPV4_DST_ADDR, "V4 dst addr", _4bytes, _4bytes, move32, zero32, COMMON_BLOCK }, + { NF9_DST_MASK, "V4 dst mask", _1byte, _1byte, move8, zero8, EX_MULIPLE }, + { NF9_OUTPUT_SNMP, "output SNMP", _2bytes, _2bytes, move16, zero16, EX_IO_SNMP_2 }, + { NF9_OUTPUT_SNMP, "output SNMP", _4bytes, _4bytes, move32, zero32, EX_IO_SNMP_4 }, + { NF9_V4_NEXT_HOP, "V4 next hop IP", _4bytes, _4bytes, move32, zero32, EX_NEXT_HOP_v4 }, + { NF9_SRC_AS, "src AS", _2bytes, _2bytes, move16, zero16, EX_AS_2 }, + { NF9_SRC_AS, "src AS", _4bytes, _4bytes, move32, zero32, EX_AS_4 }, + { NF9_DST_AS, "dst AS", _2bytes, _2bytes, move16, zero16, EX_AS_2 }, + { NF9_DST_AS, "dst AS", _4bytes, _4bytes, move32, zero32, EX_AS_4 }, + { NF9_BGP_V4_NEXT_HOP, "V4 BGP next hop", _4bytes, _4bytes, move32, zero32, EX_NEXT_HOP_BGP_v4 }, + { NF9_LAST_SWITCHED, "time sec end", _4bytes, _4bytes, move32, zero32, COMMON_BLOCK }, + { NF9_FIRST_SWITCHED, "time sec create", _4bytes, _4bytes, move32, zero32, COMMON_BLOCK }, + { NF_F_FLOW_CREATE_TIME_MSEC, "time msec start",_8bytes, _8bytes, TimeMsec, nop, COMMON_BLOCK }, + { NF_F_FLOW_END_TIME_MSEC, "time msec end", _8bytes, _8bytes, TimeMsec, nop, COMMON_BLOCK }, + { NF9_OUT_BYTES, "out bytes", _4bytes, _8bytes, move32_sampling, zero64, EX_OUT_BYTES_8 }, + { NF9_OUT_BYTES, "out bytes", _8bytes, _8bytes, move64_sampling, zero64, EX_OUT_BYTES_8 }, + { NF9_OUT_PKTS, "out packets", _4bytes, _8bytes, move32_sampling, zero64, EX_OUT_PKG_8 }, + { NF9_OUT_PKTS, "out packets", _8bytes, _8bytes, move64_sampling, zero64, EX_OUT_PKG_8 }, + { NF9_IPV6_SRC_ADDR, "V6 src addr", _16bytes, _16bytes, move128, zero128, COMMON_BLOCK }, + { NF9_IPV6_DST_ADDR, "V6 dst addr", _16bytes, _16bytes, move128, zero128, COMMON_BLOCK }, + { NF9_IPV6_SRC_MASK, "V6 src mask", _1byte, _1byte, move8, zero8, EX_MULIPLE }, + { NF9_IPV6_DST_MASK, "V6 dst mask", _1byte, _1byte, move8, zero8, EX_MULIPLE }, + /* XXX fix */ + { NF9_IPV6_FLOW_LABEL, "V6 flow label", _4bytes, _4bytes, nop, nop, COMMON_BLOCK }, + + { NF9_ICMP_TYPE, "ICMP type", _2bytes, _2bytes, nop, nop, COMMON_BLOCK }, + // sampling + { NF9_SAMPLING_INTERVAL, "sampling interval", _4bytes, _4bytes, move32, zero32, COMMON_BLOCK }, + { NF9_SAMPLING_ALGORITHM, "sampling algorithm", _1byte, _1byte, move8, zero8, COMMON_BLOCK }, + + { NF9_ENGINE_TYPE, "engine type", _1byte, _1byte, move8, zero8, EX_ROUTER_ID }, + { NF9_ENGINE_ID, "engine ID", _1byte, _1byte, move8, zero8, EX_ROUTER_ID }, + + // sampling + { NF9_FLOW_SAMPLER_ID, "sampler ID", _1byte, _1byte, nop, nop, COMMON_BLOCK }, + { NF9_FLOW_SAMPLER_ID, "sampler ID", _2bytes, _2bytes, nop, nop, COMMON_BLOCK }, + { FLOW_SAMPLER_MODE, "sampler mode", _1byte, _1byte, nop, nop, COMMON_BLOCK }, + { NF9_FLOW_SAMPLER_RANDOM_INTERVAL, "sampler rand interval", _4bytes, _4bytes, nop, nop, COMMON_BLOCK }, + + { NF9_DST_TOS, "dst tos", _1byte, _1byte, move8, zero8, COMMON_BLOCK }, + + { NF9_IN_SRC_MAC, "in src mac", _6bytes, _8bytes, move_mac, zero64, EX_MAC_1}, + { NF9_OUT_DST_MAC, "out dst mac", _6bytes, _8bytes, move_mac, zero64, EX_MAC_1}, + + { NF9_SRC_VLAN, "src vlan", _2bytes, _2bytes, move16, zero16, EX_VLAN}, + { NF9_DST_VLAN, "dst vlan", _2bytes, _2bytes, move16, zero16, EX_VLAN}, + + { NF9_DIRECTION, "direction", _1byte, _1byte, move8, zero8, EX_MULIPLE }, + + { NF9_V6_NEXT_HOP, "V6 next hop IP", _16bytes, _16bytes, move128, zero128, EX_NEXT_HOP_v6 }, + { NF9_BPG_V6_NEXT_HOP, "V6 BGP next hop", _16bytes, _16bytes, move128, zero128, EX_NEXT_HOP_BGP_v6 }, + + // mpls + { NF9_MPLS_LABEL_1, "mpls label 1", _3bytes, _4bytes, move_mpls, zero32, EX_MPLS}, + { NF9_MPLS_LABEL_2, "mpls label 2", _3bytes, _4bytes, move_mpls, zero32, EX_MPLS}, + { NF9_MPLS_LABEL_3, "mpls label 3", _3bytes, _4bytes, move_mpls, zero32, EX_MPLS}, + { NF9_MPLS_LABEL_4, "mpls label 4", _3bytes, _4bytes, move_mpls, zero32, EX_MPLS}, + { NF9_MPLS_LABEL_5, "mpls label 5", _3bytes, _4bytes, move_mpls, zero32, EX_MPLS}, + { NF9_MPLS_LABEL_6, "mpls label 6", _3bytes, _4bytes, move_mpls, zero32, EX_MPLS}, + { NF9_MPLS_LABEL_7, "mpls label 7", _3bytes, _4bytes, move_mpls, zero32, EX_MPLS}, + { NF9_MPLS_LABEL_8, "mpls label 8", _3bytes, _4bytes, move_mpls, zero32, EX_MPLS}, + { NF9_MPLS_LABEL_9, "mpls label 9", _3bytes, _4bytes, move_mpls, zero32, EX_MPLS}, + { NF9_MPLS_LABEL_10, "mpls label 10", _3bytes, _4bytes, move_mpls, zero32, EX_MPLS}, + + { NF9_IN_DST_MAC, "in dst mac", _6bytes, _8bytes, move_mac, zero64, EX_MAC_2}, + { NF9_OUT_SRC_MAC, "out src mac", _6bytes, _8bytes, move_mac, zero64, EX_MAC_2}, + + { NF9_FORWARDING_STATUS, "fwd status", _1byte, _1byte, move8, zero8, COMMON_BLOCK }, + { NF9_BGP_ADJ_NEXT_AS, "BGP next AS", _4bytes, _4bytes, move32, zero32, EX_BGPADJ }, + { NF9_BGP_ADJ_PREV_AS, "BGP prev AS", _4bytes, _4bytes, move32, zero32, EX_BGPADJ }, + + // NSEL ASA extension + // NSEL common + { NF_F_EVENT_TIME_MSEC, "ASA event time", _8bytes, _8bytes, PushTimeMsec, zero64, EX_NSEL_COMMON }, + { NF_F_CONN_ID, "ASA conn ID", _4bytes, _4bytes, move32, zero32, EX_NSEL_COMMON }, + { NF_F_FW_EVENT_84, "ASA 8.4 event", _1byte, _1byte, move8, zero8, EX_NSEL_COMMON }, + { NF_F_FW_EVENT, "ASA event", _1byte, _1byte, move8, zero8, EX_NSEL_COMMON }, + { NF_F_FW_EXT_EVENT, "ASA ext event", _2bytes, _2bytes, move16, zero16, EX_NSEL_COMMON }, + { NF_F_ICMP_TYPE, "FNF ICMP type", _1byte, _1byte, move8, zero8, EX_NSEL_COMMON }, + { NF_F_ICMP_CODE, "FNF ICMP code", _1byte, _1byte, move8, zero8, EX_NSEL_COMMON }, + { NF_F_ICMP_TYPE_IPV6, "ASA ICMP type V6", _1byte, _1byte, move8, zero8, EX_NSEL_COMMON }, + { NF_F_ICMP_CODE_IPV6, "ASA ICMP code V6", _1byte, _1byte, move8, zero8, EX_NSEL_COMMON }, + // XlATE extensions + { NF_F_XLATE_SRC_ADDR_IPV4, "ASA V4 xsrc addr", _4bytes, _4bytes, move32, zero32, EX_NSEL_XLATE_IP_v4 }, + { NF_F_XLATE_DST_ADDR_IPV4, "ASA V4 xdst addr", _4bytes, _4bytes, move32, zero32, EX_NSEL_XLATE_IP_v4 }, + { NF_F_XLATE_SRC_ADDR_IPV6, "ASA V6 xsrc addr", _16bytes, _16bytes, move128, zero128, EX_NSEL_XLATE_IP_v6 }, + { NF_F_XLATE_DST_ADDR_IPV6, "ASA V6 xdst addr", _16bytes, _16bytes, move128, zero128, EX_NSEL_XLATE_IP_v6 }, + { NF_F_XLATE_SRC_PORT, "ASA xsrc port", _2bytes, _2bytes, move16, zero16, EX_NSEL_XLATE_PORTS }, + { NF_F_XLATE_DST_PORT, "ASA xdst port", _2bytes, _2bytes, move16, zero16, EX_NSEL_XLATE_PORTS }, + // ASA 8.4 mapping + { NF_F_XLATE_SRC_ADDR_84, "ASA V4 xsrc addr", _4bytes, _4bytes, move32, zero32, EX_NSEL_XLATE_IP_v4 }, + { NF_F_XLATE_DST_ADDR_84, "ASA V4 xdst addr", _4bytes, _4bytes, move32, zero32, EX_NSEL_XLATE_IP_v4 }, + { NF_F_XLATE_SRC_PORT_84, "ASA 8.4 xsrc port", _2bytes, _2bytes, move16, zero16, EX_NSEL_XLATE_PORTS }, + { NF_F_XLATE_DST_PORT_84, "ASA 8.4 xdst port", _2bytes, _2bytes, move16, zero16, EX_NSEL_XLATE_PORTS }, + // ACL extension + { NF_F_INGRESS_ACL_ID, "ASA ingress ACL", _12bytes, _12bytes, move96, zero96, EX_NSEL_ACL }, + { NF_F_EGRESS_ACL_ID, "ASA egress ACL", _12bytes, _12bytes, move96, zero96, EX_NSEL_ACL }, + // byte count + { NF_F_FLOW_BYTES, "ASA bytes", _4bytes, _8bytes, move32_sampling, zero64, EX_NSEL_COMMON }, + { NF_F_FLOW_BYTES, "ASA bytes", _8bytes, _8bytes, move64_sampling, zero64, EX_NSEL_COMMON }, + { NF_F_FWD_FLOW_DELTA_BYTES, "ASA fwd bytes", _4bytes, _8bytes, move32_sampling, zero64, EX_NSEL_COMMON }, + { NF_F_FWD_FLOW_DELTA_BYTES, "ASA fwd bytes", _8bytes, _8bytes, move64_sampling, zero64, EX_NSEL_COMMON }, + { NF_F_REV_FLOW_DELTA_BYTES, "ASA rew bytes", _4bytes, _4bytes, move32_sampling, zero32, EX_OUT_BYTES_4 }, + { NF_F_REV_FLOW_DELTA_BYTES, "ASA rew bytes", _8bytes, _8bytes, move64_sampling, zero64, EX_OUT_BYTES_8 }, + // NSEL user names + { NF_F_USERNAME, "ASA user name 20", _20bytes, _24bytes, move_user_20, zero32, EX_NSEL_USER }, + { NF_F_USERNAME, "ASA user name 65", _65bytes, _72bytes, move_user_65, zero32, EX_NSEL_USER_MAX }, + + // NEL CISCO ASR 1000 series NAT logging + // NEL COMMON extension + { NF_N_NAT_EVENT, "NAT event", _1byte, _1byte, move8, zero8, EX_NEL_COMMON }, + { NF_N_EGRESS_VRFID, "NAT egress VRFID", _4bytes, _4bytes, move32, zero32, EX_NEL_COMMON }, + { NF_N_INGRESS_VRFID, "NAT ingress VRFID", _4bytes, _4bytes, move32, zero32, EX_NEL_COMMON }, + + // NAT Port block allocation + { NF_F_XLATE_PORT_BLOCK_START, "NAT port block start", _2bytes, _2bytes, move16, zero16, EX_PORT_BLOCK_ALLOC }, + { NF_F_XLATE_PORT_BLOCK_END, "NAT port block end", _2bytes, _2bytes, move16, zero16, EX_PORT_BLOCK_ALLOC }, + { NF_F_XLATE_PORT_BLOCK_STEP, "NAT port step size", _2bytes, _2bytes, move16, zero16, EX_PORT_BLOCK_ALLOC }, + { NF_F_XLATE_PORT_BLOCK_SIZE, "NAT port block size", _2bytes, _2bytes, move16, zero16, EX_PORT_BLOCK_ALLOC }, + + // nprobe latency extension + { NF9_NPROBE_CLIENT_NW_DELAY_USEC, "NPROBE client lat usec", _4bytes, _8bytes, move_ulatency, zero64, EX_LATENCY }, + { NF9_NPROBE_SERVER_NW_DELAY_USEC, "NPROBE server lat usec", _4bytes, _8bytes, move_ulatency, zero64, EX_LATENCY }, + { NF9_NPROBE_APPL_LATENCY_USEC, "NPROBE appl lat usec", _4bytes, _8bytes, move_ulatency, zero64, EX_LATENCY }, + { NF9_NPROBE_CLIENT_NW_DELAY_SEC, "NPROBE client lat sec", _4bytes, _8bytes, move_slatency, nop, EX_LATENCY }, + { NF9_NPROBE_SERVER_NW_DELAY_SEC, "NPROBE server lat sec", _4bytes, _8bytes, move_slatency, nop, EX_LATENCY }, + { NF9_NPROBE_APPL_LATENCY_SEC, "NPROBE appl lat sec", _4bytes, _8bytes, move_slatency, nop, EX_LATENCY }, + + {0, "NULL", 0, 0} +}; + +/* + * tmp cache while processing template records + * array index = extension id, + * value = 1 -> extension exists, 0 -> extension does not exists + */ + +static struct cache_s { + struct element_param_s { + uint16_t index; + uint16_t found; + uint16_t offset; + uint16_t length; + } *lookup_info; // 65535 element 16byte to map potentially + // all possible elements + uint32_t max_v9_elements; + uint32_t *common_extensions; + +} cache; + + +typedef struct output_templates_s { + struct output_templates_s *next; + uint32_t flags; + extension_map_t *extension_map; // extension map; + time_t time_sent; + uint32_t record_length; // length of the data record resulting from this template + uint32_t flowset_length; // length of the flowset record + template_flowset_t *template_flowset; +} output_template_t; + +#define MAX_LIFETIME 60 + +static output_template_t *output_templates; +static uint64_t boot_time; // in msec +static uint16_t template_id; +static uint32_t Max_num_v9_tags; +static uint32_t processed_records; + +/* local function prototypes */ +static void InsertSamplerOffset( FlowSource_t *fs, uint16_t id, uint16_t offset_sampler_id, uint16_t sampler_id_length, + uint16_t offset_sampler_mode, uint16_t offset_sampler_interval); + +static void InsertStdSamplerOffset( FlowSource_t *fs, uint16_t id, uint16_t offset_std_sampler_interval, + uint16_t offset_std_sampler_algorithm); + +static void InsertSampler( FlowSource_t *fs, exporter_v9_domain_t *exporter, int32_t id, uint16_t mode, uint32_t interval); + +static inline void Process_v9_templates(exporter_v9_domain_t *exporter, void *template_flowset, FlowSource_t *fs); + +static inline void Process_v9_option_templates(exporter_v9_domain_t *exporter, void *option_template_flowset, FlowSource_t *fs); + +static inline void Process_v9_data(exporter_v9_domain_t *exporter, void *data_flowset, FlowSource_t *fs, input_translation_t *table ); + +static inline void Process_v9_option_data(exporter_v9_domain_t *exporter, void *data_flowset, FlowSource_t *fs); + +static inline exporter_v9_domain_t *GetExporter(FlowSource_t *fs, uint32_t exporter_id); + +static inline input_translation_t *GetTranslationTable(exporter_v9_domain_t *exporter, uint16_t id); + +static input_translation_t *setup_translation_table (exporter_v9_domain_t *exporter, uint16_t id, uint16_t input_record_size); + +static input_translation_t *add_translation_table(exporter_v9_domain_t *exporter, uint16_t id); + +static output_template_t *GetOutputTemplate(uint32_t flags, extension_map_t *extension_map); + +static void Append_Record(send_peer_t *peer, master_record_t *master_record); + +static uint16_t Get_val16(void *p); + +static uint32_t Get_val32(void *p); + +static uint64_t Get_val64(void *p); + +/* local variables */ + + +// for sending netflow v9 +static netflow_v9_header_t *v9_output_header; + +/* functions */ + +#include "nffile_inline.c" + +int Init_v9(void) { +int i; + + output_templates = NULL; + + cache.lookup_info = (struct element_param_s *)calloc(65536, sizeof(struct element_param_s)); + cache.common_extensions = (uint32_t *)malloc((Max_num_extensions+1)*sizeof(uint32_t)); + if ( !cache.common_extensions || !cache.lookup_info ) { + syslog(LOG_ERR, "Process_v9: Panic! malloc(): %s line %d: %s", __FILE__, __LINE__, strerror (errno)); + return 0; + } + + // init the helper element table + for (i=1; v9_element_map[i].id != 0; i++ ) { + uint32_t Type = v9_element_map[i].id; + // multiple same type - save first index only + // iterate through same Types afterwards + if ( cache.lookup_info[Type].index == 0 ) + cache.lookup_info[Type].index = i; + } + cache.max_v9_elements = i; + + syslog(LOG_DEBUG,"Init v9: Max number of v9 tags: %u", cache.max_v9_elements); + + + return 1; + +} // End of Init_v9 + +static inline exporter_v9_domain_t *GetExporter(FlowSource_t *fs, uint32_t exporter_id) { +#define IP_STRING_LEN 40 +char ipstr[IP_STRING_LEN]; +exporter_v9_domain_t **e = (exporter_v9_domain_t **)&(fs->exporter_data); + + while ( *e ) { + if ( (*e)->info.id == exporter_id && (*e)->info.version == 9 && + (*e)->info.ip.v6[0] == fs->ip.v6[0] && (*e)->info.ip.v6[1] == fs->ip.v6[1]) + return *e; + e = &((*e)->next); + } + + if ( fs->sa_family == AF_INET ) { + uint32_t _ip = htonl(fs->ip.v4); + inet_ntop(AF_INET, &_ip, ipstr, sizeof(ipstr)); + } else if ( fs->sa_family == AF_INET6 ) { + uint64_t _ip[2]; + _ip[0] = htonll(fs->ip.v6[0]); + _ip[1] = htonll(fs->ip.v6[1]); + inet_ntop(AF_INET6, &_ip, ipstr, sizeof(ipstr)); + } else { + strncpy(ipstr, "", IP_STRING_LEN); + } + + // nothing found + *e = (exporter_v9_domain_t *)malloc(sizeof(exporter_v9_domain_t)); + if ( !(*e)) { + syslog(LOG_ERR, "Process_v9: Panic! malloc() %s line %d: %s", __FILE__, __LINE__, strerror (errno)); + return NULL; + } + memset((void *)(*e), 0, sizeof(exporter_v9_domain_t)); + (*e)->info.header.type = ExporterInfoRecordType; + (*e)->info.header.size = sizeof(exporter_info_record_t); + (*e)->info.version = 9; + (*e)->info.id = exporter_id; + (*e)->info.ip = fs->ip; + (*e)->info.sa_family = fs->sa_family; + (*e)->info.sysid = 0; + + (*e)->first = 1; + (*e)->sequence_failure = 0; + + (*e)->sampler = NULL; + (*e)->next = NULL; + + FlushInfoExporter(fs, &((*e)->info)); + + dbg_printf("Process_v9: New exporter: SysID: %u, Domain: %u, IP: %s\n", + (*e)->info.sysid, exporter_id, ipstr); + syslog(LOG_INFO, "Process_v9: New exporter: SysID: %u, Domain: %u, IP: %s\n", + (*e)->info.sysid, exporter_id, ipstr); + + + return (*e); + +} // End of GetExporter + +static inline uint32_t MapElement(uint16_t Type, uint16_t Length, uint16_t Offset) { +int index; + + index = cache.lookup_info[Type].index; + if ( index ) { + while ( index && v9_element_map[index].id == Type ) { + if ( Length == v9_element_map[index].length ) { + cache.lookup_info[Type].found = 1; + cache.lookup_info[Type].offset = Offset; + cache.lookup_info[Type].length = Length; + cache.lookup_info[Type].index = index; + dbg_printf("found extension %u for type: %u(%s), at index: %i, input length: %u output length: %u Extension: %u, Offset: %u\n", + v9_element_map[index].extension, v9_element_map[index].id, v9_element_map[index].name, index, + v9_element_map[index].length, v9_element_map[index].out_length, v9_element_map[index].extension, Offset); + return v9_element_map[index].extension; + } + index++; + } + } + dbg_printf("Skip unknown element type: %u, Length: %u\n", + Type, Length); + + return 0; + +} // End of MapElement + +static inline input_translation_t *GetTranslationTable(exporter_v9_domain_t *exporter, uint16_t id) { +input_translation_t *table; + + if ( exporter->current_table && ( exporter->current_table->id == id ) ) + return exporter->current_table; + + table = exporter->input_translation_table; + while ( table ) { + if ( table->id == id ) { + exporter->current_table = table; + return table; + } + + table = table->next; + } + + dbg_printf("[%u/%u] Get translation table %u: %s\n", + exporter->info.id, exporter->info.sysid, id, table == NULL ? "not found" : "found"); + + exporter->current_table = table; + return table; + +} // End of GetTranslationTable + +static input_translation_t *add_translation_table(exporter_v9_domain_t *exporter, uint16_t id) { +input_translation_t **table; + + table = &(exporter->input_translation_table); + while ( *table ) { + table = &((*table)->next); + } + + // Allocate enough space for all potential v9 tags, which we support in v9_element_map + // so template refreshing may change the table size without danger of overflowing + *table = calloc(1, sizeof(input_translation_t)); + if ( !(*table) ) { + syslog(LOG_ERR, "Process_v9: Panic! calloc() %s line %d: %s", __FILE__, __LINE__, strerror (errno)); + return NULL; + } + (*table)->sequence = calloc(cache.max_v9_elements, sizeof(sequence_map_t)); + if ( !(*table)->sequence ) { + syslog(LOG_ERR, "Process_v9: Panic! malloc() %s line %d: %s", __FILE__, __LINE__, strerror (errno)); + return NULL; + } + + (*table)->id = id; + (*table)->next = NULL; + + dbg_printf("[%u] Get new translation table %u\n", exporter->info.id, id); + + return *table; + +} // End of add_translation_table + +static inline void PushSequence(input_translation_t *table, uint16_t Type, uint32_t *offset, void *stack) { +uint32_t i = table->number_of_sequences; +uint32_t index = cache.lookup_info[Type].index; + + if ( table->number_of_sequences >= cache.max_v9_elements ) { + syslog(LOG_ERR, "Process_v9: Software bug! Sequence table full. at %s line %d", + __FILE__, __LINE__); + dbg_printf("Software bug! Sequence table full. at %s line %d", + __FILE__, __LINE__); + return; + } + + if ( cache.lookup_info[Type].found ) { + table->sequence[i].id = v9_element_map[index].sequence; + table->sequence[i].input_offset = cache.lookup_info[Type].offset; + table->sequence[i].output_offset = *offset; + table->sequence[i].stack = stack; + dbg_printf("Fill "); + } else { + table->sequence[i].id = v9_element_map[index].zero_sequence; + table->sequence[i].input_offset = 0; + table->sequence[i].output_offset = *offset; + table->sequence[i].stack = NULL; + dbg_printf("Zero "); + } + dbg_printf("Push: sequence: %u, Type: %u, length: %u, out length: %u, id: %u, in offset: %u, out offset: %u\n", + i, Type, v9_element_map[index].length, v9_element_map[index].out_length, table->sequence[i].id, + table->sequence[i].input_offset, table->sequence[i].output_offset); + table->number_of_sequences++; + (*offset) += v9_element_map[index].out_length; + +} // End of PushSequence + + +static input_translation_t *setup_translation_table (exporter_v9_domain_t *exporter, uint16_t id, uint16_t input_record_size) { +input_translation_t *table; +extension_map_t *extension_map; +uint32_t i, ipv6, offset, next_extension; +size_t size_required; + + ipv6 = 0; + + table = GetTranslationTable(exporter, id); + if ( !table ) { + syslog(LOG_INFO, "Process_v9: [%u] Add template %u", exporter->info.id, id); + dbg_printf("[%u] Add template %u\n", exporter->info.id, id); + table = add_translation_table(exporter, id); + if ( !table ) { + return NULL; + } + // Add an extension map + // The number of extensions for this template is currently unknown + // Allocate enough space for all configured extensions - some may be unused later + // make sure memory is 4byte alligned + size_required = Max_num_extensions * sizeof(uint16_t) + sizeof(extension_map_t); + size_required = (size_required + 3) &~(size_t)3; + extension_map = malloc(size_required); + if ( !extension_map ) { + syslog(LOG_ERR, "Process_v9: Panic! malloc() error in %s line %d: %s", __FILE__, __LINE__, strerror (errno)); + return NULL; + } + extension_map->type = ExtensionMapType; + // Set size to an empty table - will be updated later + extension_map->size = sizeof(extension_map_t); + extension_map->map_id = INIT_ID; + // packed record size still unknown at this point - will be added later + extension_map->extension_size = 0; + + table->extension_info.map = extension_map; + table->extension_map_changed = 1; +#ifdef DEVEL + if ( !GetTranslationTable(exporter, id) ) { + printf("*** ERROR failed to crosscheck translation table\n"); + } else { + printf("table lookup ok!\n"); + } +#endif + } else { + extension_map = table->extension_info.map; + + // reset size/extension size - it's refreshed automatically + extension_map->size = sizeof(extension_map_t); + extension_map->extension_size = 0; + + dbg_printf("[%u] Refresh template %u\n", exporter->info.id, id); + + // very noisy for some exporters + dbg_printf("[%u] Refresh template %u\n", exporter->info.id, id); + } + // clear current table + memset((void *)table->sequence, 0, cache.max_v9_elements * sizeof(sequence_map_t)); + table->number_of_sequences = 0; + + table->updated = time(NULL); + table->flags = 0; + table->flow_start = 0; + table->flow_end = 0; + table->EventTimeMsec = 0; + table->ICMP_offset = 0; + table->sampler_offset = 0; + table->sampler_size = 0; + table->engine_offset = 0; + table->received_offset = 0; + table->router_ip_offset = 0; + + dbg_printf("[%u] Fill translation table %u\n", exporter->info.id, id); + + // fill table + table->id = id; + + /* + * common data block: The common record is expected in the output stream. If not available + * in the template, fill values with 0 + */ + + // All required extensions + offset = BYTE_OFFSET_first; + if ( cache.lookup_info[NF_F_FLOW_CREATE_TIME_MSEC].found ) { + uint32_t _tmp = 0; + PushSequence( table, NF_F_FLOW_CREATE_TIME_MSEC, &_tmp, &table->flow_start); + dbg_printf("Push NF_F_FLOW_CREATE_TIME_MSEC\n"); + } + if ( cache.lookup_info[NF_F_FLOW_END_TIME_MSEC].found ) { + uint32_t _tmp = 0; + PushSequence( table, NF_F_FLOW_END_TIME_MSEC, &_tmp, &table->flow_end); + dbg_printf("Push NF_F_FLOW_END_TIME_MSEC\n"); + } + + PushSequence( table, NF9_FIRST_SWITCHED, &offset, NULL); + offset = BYTE_OFFSET_first + 4; + PushSequence( table, NF9_LAST_SWITCHED, &offset, NULL); + offset = BYTE_OFFSET_first + 8; + PushSequence( table, NF9_FORWARDING_STATUS, &offset, NULL); + + PushSequence( table, NF9_TCP_FLAGS, &offset, NULL); + PushSequence( table, NF9_IN_PROTOCOL, &offset, NULL); + PushSequence( table, NF9_SRC_TOS, &offset, NULL); + + PushSequence( table, NF9_L4_SRC_PORT, &offset, NULL); + PushSequence( table, NF9_L4_DST_PORT, &offset, NULL); + + // skip exporter_sysid and reserved + offset += 4; + + /* IP addresss record + * This record is expected in the output stream. If not available + * in the template, assume empty v4 address. + */ + if ( cache.lookup_info[NF9_IPV4_SRC_ADDR].found ) { + // IPv4 addresses + PushSequence( table, NF9_IPV4_SRC_ADDR, &offset, NULL); + PushSequence( table, NF9_IPV4_DST_ADDR, &offset, NULL); + } else if ( cache.lookup_info[NF9_IPV6_SRC_ADDR].found ) { + // IPv6 addresses + PushSequence( table, NF9_IPV6_SRC_ADDR, &offset, NULL); + PushSequence( table, NF9_IPV6_DST_ADDR, &offset, NULL); + // mark IPv6 + SetFlag(table->flags, FLAG_IPV6_ADDR); + ipv6 = 1; + } else { + // should not happen, assume empty IPv4 addresses + PushSequence( table, NF9_IPV4_SRC_ADDR, &offset, NULL); + PushSequence( table, NF9_IPV4_DST_ADDR, &offset, NULL); + } + + /* packet counter + * This record is expected in the output stream. If not available + * in the template, assume empty 4 bytes value + */ + PushSequence( table, NF9_IN_PACKETS, &offset, &table->packets); + // fix: always have 64bit counters due to possible sampling + SetFlag(table->flags, FLAG_PKG_64); + + if ( cache.lookup_info[NF_F_FLOW_BYTES].found ) { + // NSEL ASA bytes + PushSequence( table, NF_F_FLOW_BYTES, &offset, &table->bytes); + } else if ( cache.lookup_info[NF_F_FWD_FLOW_DELTA_BYTES].found ) { + // NSEL ASA 8.4 bytes + PushSequence( table, NF_F_FWD_FLOW_DELTA_BYTES, &offset, &table->bytes); + } else { + PushSequence( table, NF9_IN_BYTES, &offset, &table->bytes); + } + // fix: always have 64bit counters due to possible sampling + SetFlag(table->flags, FLAG_BYTES_64); + +#if defined NSEL || defined NEL + if ( cache.lookup_info[NF_F_FW_EVENT].found || cache.lookup_info[NF_F_FW_EVENT_84].found || + cache.lookup_info[NF_N_NAT_EVENT].found) { + SetFlag(table->flags, FLAG_EVENT); + } +#endif + + // Optional extensions + next_extension = 0; + for (i=4; i <= Max_num_extensions; i++ ) { + uint32_t map_index = i; + + if ( cache.common_extensions[i] == 0 ) + continue; + + switch(i) { + case EX_IO_SNMP_2: + PushSequence( table, NF9_INPUT_SNMP, &offset, NULL); + PushSequence( table, NF9_OUTPUT_SNMP, &offset, NULL); + break; + case EX_IO_SNMP_4: + PushSequence( table, NF9_INPUT_SNMP, &offset, NULL); + PushSequence( table, NF9_OUTPUT_SNMP, &offset, NULL); + break; + case EX_AS_2: + PushSequence( table, NF9_SRC_AS, &offset, NULL); + PushSequence( table, NF9_DST_AS, &offset, NULL); + break; + case EX_AS_4: + PushSequence( table, NF9_SRC_AS, &offset, NULL); + PushSequence( table, NF9_DST_AS, &offset, NULL); + break; + case EX_MULIPLE: + PushSequence( table, NF9_DST_TOS, &offset, NULL); + PushSequence( table, NF9_DIRECTION, &offset, NULL); + if ( ipv6 ) { + // IPv6 + PushSequence( table, NF9_IPV6_SRC_MASK, &offset, NULL); + PushSequence( table, NF9_IPV6_DST_MASK, &offset, NULL); + } else { + // IPv4 + PushSequence( table, NF9_SRC_MASK, &offset, NULL); + PushSequence( table, NF9_DST_MASK, &offset, NULL); + } + break; + case EX_NEXT_HOP_v4: + PushSequence( table, NF9_V4_NEXT_HOP, &offset, NULL); + break; + case EX_NEXT_HOP_v6: + PushSequence( table, NF9_V6_NEXT_HOP, &offset, NULL); + SetFlag(table->flags, FLAG_IPV6_NH); + break; + case EX_NEXT_HOP_BGP_v4: + PushSequence( table, NF9_BGP_V4_NEXT_HOP, &offset, NULL); + break; + case EX_NEXT_HOP_BGP_v6: + PushSequence( table, NF9_BPG_V6_NEXT_HOP, &offset, NULL); + SetFlag(table->flags, FLAG_IPV6_NHB); + break; + case EX_VLAN: + PushSequence( table, NF9_SRC_VLAN, &offset, NULL); + PushSequence( table, NF9_DST_VLAN, &offset, NULL); + break; + case EX_OUT_PKG_4: + PushSequence( table, NF9_OUT_PKTS, &offset, &table->out_packets); + break; + case EX_OUT_PKG_8: + PushSequence( table, NF9_OUT_PKTS, &offset, &table->out_packets); + break; + case EX_OUT_BYTES_4: + if ( cache.lookup_info[NF_F_REV_FLOW_DELTA_BYTES].found ) { + PushSequence( table, NF_F_REV_FLOW_DELTA_BYTES, &offset, &table->out_bytes); + } else { + PushSequence( table, NF9_OUT_BYTES, &offset, &table->out_bytes); + } + break; + case EX_OUT_BYTES_8: + if ( cache.lookup_info[NF_F_REV_FLOW_DELTA_BYTES].found ) { + PushSequence( table, NF_F_REV_FLOW_DELTA_BYTES, &offset, &table->out_bytes); + } else { + PushSequence( table, NF9_OUT_BYTES, &offset, &table->out_bytes); + } + break; + case EX_AGGR_FLOWS_4: + PushSequence( table, NF9_FLOWS_AGGR, &offset, NULL); + break; + case EX_AGGR_FLOWS_8: + PushSequence( table, NF9_FLOWS_AGGR, &offset, NULL); + break; + case EX_MAC_1: + PushSequence( table, NF9_IN_SRC_MAC, &offset, NULL); + PushSequence( table, NF9_OUT_DST_MAC, &offset, NULL); + break; + case EX_MAC_2: + PushSequence( table, NF9_IN_DST_MAC, &offset, NULL); + PushSequence( table, NF9_OUT_SRC_MAC, &offset, NULL); + break; + case EX_MPLS: + PushSequence( table, NF9_MPLS_LABEL_1, &offset, NULL); + PushSequence( table, NF9_MPLS_LABEL_2, &offset, NULL); + PushSequence( table, NF9_MPLS_LABEL_3, &offset, NULL); + PushSequence( table, NF9_MPLS_LABEL_4, &offset, NULL); + PushSequence( table, NF9_MPLS_LABEL_5, &offset, NULL); + PushSequence( table, NF9_MPLS_LABEL_6, &offset, NULL); + PushSequence( table, NF9_MPLS_LABEL_7, &offset, NULL); + PushSequence( table, NF9_MPLS_LABEL_8, &offset, NULL); + PushSequence( table, NF9_MPLS_LABEL_9, &offset, NULL); + PushSequence( table, NF9_MPLS_LABEL_10, &offset, NULL); + break; + case EX_ROUTER_IP_v4: + case EX_ROUTER_IP_v6: + if ( exporter->info.sa_family == PF_INET6 ) { + table->router_ip_offset = offset; + dbg_printf("Router IPv6: Offset: %u, olen: %u\n", offset, 16 ); + // not an entry for the translateion table. + // but reserve space in the output record for IPv6 + offset += 16; + SetFlag(table->flags, FLAG_IPV6_EXP); + map_index = EX_ROUTER_IP_v6; + } else { + table->router_ip_offset = offset; + dbg_printf("Router IPv4: Offset: %u, olen: %u\n", offset, 4 ); + // not an entry for the translateion table. + // but reserve space in the output record for IPv4 + offset += 4; + ClearFlag(table->flags, FLAG_IPV6_EXP); + map_index = EX_ROUTER_IP_v4; + } + break; + case EX_ROUTER_ID: + table->engine_offset = offset; + dbg_printf("Engine offset: %u\n", offset); + offset += 2; + dbg_printf("Skip 2 unused bytes. Next offset: %u\n", offset); + PushSequence( table, NF9_ENGINE_TYPE, &offset, NULL); + PushSequence( table, NF9_ENGINE_ID, &offset, NULL); + // unused fill element for 32bit alignment + break; + case EX_RECEIVED: + table->received_offset = offset; + dbg_printf("Received offset: %u\n", offset); + offset += 8; + break; + case EX_LATENCY: { + // it's bit of a hack, but .. sigh .. + uint32_t i = table->number_of_sequences; + + // Insert a zero64 as subsequent sequences add values + table->sequence[i].id = zero64; + table->sequence[i].input_offset = 0; + table->sequence[i].output_offset = offset; + table->sequence[i].stack = NULL; + table->number_of_sequences++; + dbg_printf("Zero latency at offset: %u\n", offset); + + PushSequence( table, NF9_NPROBE_CLIENT_NW_DELAY_SEC, &offset, NULL); + offset -= 8; + PushSequence( table, NF9_NPROBE_CLIENT_NW_DELAY_USEC, &offset, NULL); + + table->sequence[i].id = zero64; + table->sequence[i].input_offset = 0; + table->sequence[i].output_offset = offset; + table->sequence[i].stack = NULL; + table->number_of_sequences++; + dbg_printf("Zero latency at offset: %u\n", offset); + + PushSequence( table, NF9_NPROBE_SERVER_NW_DELAY_SEC, &offset, NULL); + offset -= 8; + PushSequence( table, NF9_NPROBE_SERVER_NW_DELAY_USEC, &offset, NULL); + + table->sequence[i].id = zero64; + table->sequence[i].input_offset = 0; + table->sequence[i].output_offset = offset; + table->sequence[i].stack = NULL; + table->number_of_sequences++; + dbg_printf("Zero latency at offset: %u\n", offset); + + PushSequence( table, NF9_NPROBE_APPL_LATENCY_SEC, &offset, NULL); + offset -= 8; + PushSequence( table, NF9_NPROBE_APPL_LATENCY_USEC, &offset, NULL); + + } break; + case EX_BGPADJ: + PushSequence( table, NF9_BGP_ADJ_NEXT_AS, &offset, NULL); + PushSequence( table, NF9_BGP_ADJ_PREV_AS, &offset, NULL); + break; + case EX_NSEL_COMMON: + PushSequence( table, NF_F_EVENT_TIME_MSEC, &offset, &table->EventTimeMsec); + PushSequence( table, NF_F_CONN_ID, &offset, NULL); + if ( ipv6 ) { +#ifdef WORDS_BIGENDIAN + PushSequence( table, NF_F_ICMP_TYPE_IPV6, &offset, NULL); + PushSequence( table, NF_F_ICMP_CODE_IPV6, &offset, NULL); +#else + PushSequence( table, NF_F_ICMP_CODE_IPV6, &offset, NULL); + PushSequence( table, NF_F_ICMP_TYPE_IPV6, &offset, NULL); +#endif + } else { +#ifdef WORDS_BIGENDIAN + PushSequence( table, NF_F_ICMP_TYPE, &offset, NULL); + PushSequence( table, NF_F_ICMP_CODE, &offset, NULL); +#else + PushSequence( table, NF_F_ICMP_CODE, &offset, NULL); + PushSequence( table, NF_F_ICMP_TYPE, &offset, NULL); +#endif + } + cache.lookup_info[NF_F_FW_EVENT_84].found ? + PushSequence( table, NF_F_FW_EVENT_84, &offset, NULL) : + PushSequence( table, NF_F_FW_EVENT, &offset, NULL); + offset += 1; + PushSequence( table, NF_F_FW_EXT_EVENT, &offset, NULL); + offset += 2; + break; + case EX_NSEL_XLATE_PORTS: + if ( cache.lookup_info[NF_F_XLATE_SRC_ADDR_84].found ) { + PushSequence( table, NF_F_XLATE_SRC_PORT_84, &offset, NULL); + PushSequence( table, NF_F_XLATE_DST_PORT_84, &offset, NULL); + } else { + PushSequence( table, NF_F_XLATE_SRC_PORT, &offset, NULL); + PushSequence( table, NF_F_XLATE_DST_PORT, &offset, NULL); + } + break; + case EX_NSEL_XLATE_IP_v4: + if ( cache.lookup_info[NF_F_XLATE_SRC_ADDR_84].found ) { + PushSequence( table, NF_F_XLATE_SRC_ADDR_84, &offset, NULL); + PushSequence( table, NF_F_XLATE_DST_ADDR_84, &offset, NULL); + } else { + PushSequence( table, NF_F_XLATE_SRC_ADDR_IPV4, &offset, NULL); + PushSequence( table, NF_F_XLATE_DST_ADDR_IPV4, &offset, NULL); + } + break; + case EX_NSEL_XLATE_IP_v6: + PushSequence( table, NF_F_XLATE_SRC_ADDR_IPV6, &offset, NULL); + PushSequence( table, NF_F_XLATE_DST_ADDR_IPV6, &offset, NULL); + break; + case EX_NSEL_ACL: + PushSequence( table, NF_F_INGRESS_ACL_ID, &offset, NULL); + PushSequence( table, NF_F_EGRESS_ACL_ID, &offset, NULL); + break; + case EX_NSEL_USER: + case EX_NSEL_USER_MAX: + PushSequence( table, NF_F_USERNAME, &offset, NULL); + break; + case EX_NEL_COMMON: + PushSequence( table, NF_N_NAT_EVENT, &offset, NULL); + offset += 3; + PushSequence( table, NF_N_EGRESS_VRFID, &offset, NULL); + PushSequence( table, NF_N_INGRESS_VRFID, &offset, NULL); + break; + case EX_PORT_BLOCK_ALLOC: + PushSequence( table, NF_F_XLATE_PORT_BLOCK_START, &offset, NULL); + PushSequence( table, NF_F_XLATE_PORT_BLOCK_END, &offset, NULL); + PushSequence( table, NF_F_XLATE_PORT_BLOCK_STEP, &offset, NULL); + PushSequence( table, NF_F_XLATE_PORT_BLOCK_SIZE, &offset, NULL); + break; + case EX_NEL_GLOBAL_IP_v4: + // XXX no longer used + break; + } + extension_map->size += sizeof(uint16_t); + extension_map->extension_size += extension_descriptor[map_index].size; + + // found extension in map_index must be the same as in map - otherwise map is dirty + if ( extension_map->ex_id[next_extension] != map_index ) { + // dirty map - needs to be refreshed in output stream + extension_map->ex_id[next_extension] = map_index; + table->extension_map_changed = 1; + + } + next_extension++; + + } + extension_map->ex_id[next_extension++] = 0; + + // make sure map is aligned + if ( extension_map->size & 0x3 ) { + extension_map->ex_id[next_extension] = 0; + extension_map->size = ( extension_map->size + 3 ) &~ 0x3; + } + + table->output_record_size = offset; + table->input_record_size = input_record_size; + + /* ICMP hack for v9 */ + // for netflow historical reason, ICMP type/code goes into dst port field + // remember offset, for decoding + if ( cache.lookup_info[NF9_ICMP_TYPE].found && cache.lookup_info[NF9_ICMP_TYPE].length == 2 ) { + table->ICMP_offset = cache.lookup_info[NF9_ICMP_TYPE].offset; + } + + /* Sampler ID */ + if ( cache.lookup_info[NF9_FLOW_SAMPLER_ID].found ) { + if ( cache.lookup_info[NF9_FLOW_SAMPLER_ID].length == 1 ) { + table->sampler_offset = cache.lookup_info[NF9_FLOW_SAMPLER_ID].offset; + table->sampler_size = 1; + dbg_printf("1 byte Sampling ID included at offset %u\n", table->sampler_offset); + } else if ( cache.lookup_info[NF9_FLOW_SAMPLER_ID].length == 2 ) { + table->sampler_offset = cache.lookup_info[NF9_FLOW_SAMPLER_ID].offset; + table->sampler_size = 2; + dbg_printf("2 byte Sampling ID included at offset %u\n", table->sampler_offset); + } else { + syslog(LOG_ERR, "Process_v9: Unexpected SAMPLER ID field length: %d", + cache.lookup_info[NF9_FLOW_SAMPLER_ID].length); + dbg_printf("Unexpected SAMPLER ID field length: %d", + cache.lookup_info[NF9_FLOW_SAMPLER_ID].length); + + } + } else { + dbg_printf("No Sampling ID found\n"); + } + +#ifdef DEVEL + if ( table->extension_map_changed ) { + printf("Extension Map id=%u changed!\n", extension_map->map_id); + } else { + printf("[%u] template %u unchanged\n", exporter->info.id, id); + } + + printf("Process_v9: Check extension map: id: %d, size: %u, extension_size: %u\n", + extension_map->map_id, extension_map->size, extension_map->extension_size); + { int i; + for (i=0; inumber_of_sequences; i++ ) { + printf("Sequence %i: id: %u, in offset: %u, out offset: %u, stack: %llu\n", + i, table->sequence[i].id, table->sequence[i].input_offset, table->sequence[i].output_offset, + (unsigned long long)table->sequence[i].stack); + } + printf("Flags: 0x%x\n", table->flags); + printf("Input record size: %u, output record size: %u\n", + table->input_record_size, table->output_record_size); + } + PrintExtensionMap(extension_map); +#endif + + return table; + +} // End of setup_translation_table + +static void InsertSamplerOffset( FlowSource_t *fs, uint16_t id, uint16_t offset_sampler_id, uint16_t sampler_id_length, + uint16_t offset_sampler_mode, uint16_t offset_sampler_interval) { +option_offset_t **t; + + t = &(fs->option_offset_table); + while ( *t ) { + if ( (*t)->id == id ) { // table already known to us - update data + dbg_printf("Found existing sampling info in template %i\n", id); + break; + } + + t = &((*t)->next); + } + + if ( *t == NULL ) { // new table + dbg_printf("Allocate new sampling info from template %i\n", id); + *t = (option_offset_t *)calloc(1, sizeof(option_offset_t)); + if ( !*t ) { + fprintf(stderr, "malloc() allocation error: %s\n", strerror(errno)); + return ; + } + dbg_printf("Process_v9: New sampler: ID %i, mode: %i, interval: %i\n", + offset_sampler_id, offset_sampler_mode, offset_sampler_interval); + } // else existing table + + dbg_printf("Insert/Update sampling info from template %i\n", id); + SetFlag((*t)->flags, HAS_SAMPLER_DATA); + (*t)->id = id; + (*t)->offset_id = offset_sampler_id; + (*t)->sampler_id_length = sampler_id_length; + (*t)->offset_mode = offset_sampler_mode; + (*t)->offset_interval = offset_sampler_interval; + +} // End of InsertSamplerOffset + +static void InsertStdSamplerOffset( FlowSource_t *fs, uint16_t id, uint16_t offset_std_sampler_interval, uint16_t offset_std_sampler_algorithm) { +option_offset_t **t; + + t = &(fs->option_offset_table); + while ( *t ) { + if ( (*t)->id == id ) { // table already known to us - update data + dbg_printf("Found existing std sampling info in template %i\n", id); + break; + } + + t = &((*t)->next); + } + + if ( *t == NULL ) { // new table + dbg_printf("Allocate new std sampling info from template %i\n", id); + *t = (option_offset_t *)calloc(1, sizeof(option_offset_t)); + if ( !*t ) { + fprintf(stderr, "malloc() allocation error: %s\n", strerror(errno)); + return ; + } + syslog(LOG_ERR, "Process_v9: New std sampler: interval: %i, algorithm: %i", + offset_std_sampler_interval, offset_std_sampler_algorithm); + } // else existing table + + dbg_printf("Insert/Update sampling info from template %i\n", id); + SetFlag((*t)->flags, HAS_STD_SAMPLER_DATA); + (*t)->id = id; + (*t)->offset_id = 0; + (*t)->offset_mode = 0; + (*t)->offset_interval = 0; + (*t)->offset_std_sampler_interval = offset_std_sampler_interval; + (*t)->offset_std_sampler_algorithm = offset_std_sampler_algorithm; + +} // End of InsertStdSamplerOffset + +static inline void Process_v9_templates(exporter_v9_domain_t *exporter, void *template_flowset, FlowSource_t *fs) { +void *template; +input_translation_t *translation_table; +uint16_t id, count, Offset; +uint32_t size_left, size_required, num_extensions, num_v9tags; +int i; + + size_left = GET_FLOWSET_LENGTH(template_flowset) - 4; // -4 for flowset header -> id and length + template = template_flowset + 4; // the template description begins at offset 4 + + // process all templates in flowset, as long as any bytes are left + size_required = 0; + Offset = 0; + while (size_left) { + void *p; + template = template + size_required; + + // clear helper tables + memset((void *)cache.common_extensions, 0, (Max_num_extensions+1)*sizeof(uint32_t)); + memset((void *)cache.lookup_info, 0, 65536 * sizeof(struct element_param_s)); + for (i=1; v9_element_map[i].id != 0; i++ ) { + uint32_t Type = v9_element_map[i].id; + if ( v9_element_map[i].id == v9_element_map[i-1].id ) + continue; + cache.lookup_info[Type].index = i; + // other elements cleard be memset + } + + id = GET_TEMPLATE_ID(template); + count = GET_TEMPLATE_COUNT(template); + size_required = 4 + 4 * count; // id + count = 4 bytes, and 2 x 2 bytes for each entry + + dbg_printf("\n[%u] Template ID: %u\n", exporter->info.id, id); + dbg_printf("template size: %u buffersize: %u\n", size_required, size_left); + + if ( size_left < size_required ) { + syslog(LOG_ERR, "Process_v9: [%u] buffer size error: expected %u available %u", + exporter->info.id, size_required, size_left); + size_left = 0; + continue; + } + + Offset = 0; + num_extensions = 0; // number of extensions + num_v9tags = 0; // number of optional v9 tags + + p = template + 4; // type/length pairs start at template offset 4 + for(i=0; i Extension: %u\n", + fs->sa_family == PF_INET6 ? "ipv6" : "ipv4", EX_ROUTER_IP_v4); + } + + // as the router IP address extension is not part announced in a template, we need to deal with it here + if ( extension_descriptor[EX_ROUTER_ID].enabled ) { + if ( cache.common_extensions[EX_ROUTER_ID] == 0 ) { + cache.common_extensions[EX_ROUTER_ID] = 1; + num_extensions++; + } + dbg_printf("Force add router ID (engine type/ID), Extension: %u\n", EX_ROUTER_ID); + } + + // as the received time is not announced in a template, we need to deal with it here + if ( extension_descriptor[EX_RECEIVED].enabled ) { + if ( cache.common_extensions[EX_RECEIVED] == 0 ) { + cache.common_extensions[EX_RECEIVED] = 1; + num_extensions++; + } + dbg_printf("Force add packet received time, Extension: %u\n", EX_RECEIVED); + } + + dbg_printf("Parsed %u v9 tags, total %u extensions\n", num_v9tags, num_extensions); + + +#ifdef DEVEL + { + int i; + for (i=0; i<=Max_num_extensions; i++ ) { + if ( cache.common_extensions[i] ) { + printf("Enabled extension: %2i: %s\n", i, extension_descriptor[i].description); + } + } + } +#endif + + translation_table = setup_translation_table(exporter, id, Offset); + if (translation_table->extension_map_changed ) { + translation_table->extension_map_changed = 0; + // refresh he map in the ouput buffer + dbg_printf("Translation Table changed! Add extension map ID: %i\n", translation_table->extension_info.map->map_id); + AddExtensionMap(fs, translation_table->extension_info.map); + dbg_printf("Translation Table added! map ID: %i\n", translation_table->extension_info.map->map_id); + } + size_left -= size_required; + processed_records++; + + dbg_printf("\n"); + + } // End of while size_left + +} // End of Process_v9_templates + +static inline void Process_v9_option_templates(exporter_v9_domain_t *exporter, void *option_template_flowset, FlowSource_t *fs) { +void *option_template, *p; +uint32_t size_left, nr_scopes, nr_options, i; +uint16_t id, scope_length, option_length, offset, sampler_id_length; +uint16_t offset_sampler_id, offset_sampler_mode, offset_sampler_interval, found_sampler; +uint16_t offset_std_sampler_interval, offset_std_sampler_algorithm, found_std_sampling; + + i = 0; // keep compiler happy + size_left = GET_FLOWSET_LENGTH(option_template_flowset) - 4; // -4 for flowset header -> id and length + option_template = option_template_flowset + 4; + id = GET_OPTION_TEMPLATE_ID(option_template); + scope_length = GET_OPTION_TEMPLATE_OPTION_SCOPE_LENGTH(option_template); + option_length = GET_OPTION_TEMPLATE_OPTION_LENGTH(option_template); + + if ( scope_length & 0x3 ) { + syslog(LOG_ERR, "Process_v9: [%u] scope length error: length %u not multiple of 4", + exporter->info.id, scope_length); + return; + } + + if ( option_length & 0x3 ) { + syslog(LOG_ERR, "Process_v9: [%u] option length error: length %u not multiple of 4", + exporter->info.id, option_length); + return; + } + + if ( (scope_length + option_length) > size_left ) { + syslog(LOG_ERR, "Process_v9: [%u] option template length error: size left %u too small for %u scopes length and %u options length", + exporter->info.id, size_left, scope_length, option_length); + return; + } + + nr_scopes = scope_length >> 2; + nr_options = option_length >> 2; + + dbg_printf("\n[%u] Option Template ID: %u\n", exporter->info.id, id); + dbg_printf("Scope length: %u Option length: %u\n", scope_length, option_length); + + sampler_id_length = 0; + offset_sampler_id = 0; + offset_sampler_mode = 0; + offset_sampler_interval = 0; + offset_std_sampler_interval = 0; + offset_std_sampler_algorithm = 0; + found_sampler = 0; + found_std_sampling = 0; + offset = 0; + + p = option_template + 6; // start of length/type data + for ( i=0; iinfo.id); + InsertSamplerOffset(fs, id, offset_sampler_id, sampler_id_length, offset_sampler_mode, offset_sampler_interval); + } else if ( found_std_sampling == 2 ) { // need all two tags + dbg_printf("[%u] Std sampling information found\n", exporter->info.id); + InsertStdSamplerOffset(fs, id, offset_std_sampler_interval, offset_std_sampler_algorithm); + } else { + dbg_printf("[%u] No Sampling information found\n", exporter->info.id); + } + dbg_printf("\n"); + processed_records++; + +} // End of Process_v9_option_templates + + +static inline void Process_v9_data(exporter_v9_domain_t *exporter, void *data_flowset, FlowSource_t *fs, input_translation_t *table ){ +uint64_t start_time, end_time, sampling_rate; +uint32_t size_left; +uint8_t *in, *out; +int i; +char *string; + + size_left = GET_FLOWSET_LENGTH(data_flowset) - 4; // -4 for data flowset header -> id and length + + // map input buffer as a byte array + in = (uint8_t *)(data_flowset + 4); // skip flowset header + + dbg_printf("[%u] Process data flowset size: %u\n", exporter->info.id, size_left); + + if ( table->sampler_offset ) + dbg_printf("table sampler offset: %u\n", table->sampler_offset); + dbg_printf("[%u] Exporter is 0x%llu\n", exporter->info.id, (long long unsigned)exporter); + dbg_printf("[%u] Exporter has sampler: %s\n", exporter->info.id, exporter->sampler ? "yes" : "no"); + + // Check if sampling is announced + if ( table->sampler_offset && exporter->sampler ) { + generic_sampler_t *sampler = exporter->sampler; + uint32_t sampler_id; + if ( table->sampler_size == 2 ) { + sampler_id = Get_val16((void *)&in[table->sampler_offset]); + } else { + sampler_id = in[table->sampler_offset]; + } + dbg_printf("Extract sampler: %u\n", sampler_id); + // usually not that many samplers, so following a chain is not too expensive. + while ( sampler && sampler->info.id != sampler_id ) + sampler = sampler->next; + + if ( sampler ) { + sampling_rate = sampler->info.interval; + dbg_printf("[%u] Sampling ID %u available\n", exporter->info.id, sampler_id); + dbg_printf("[%u] Sampler_offset : %u\n", exporter->info.id, table->sampler_offset); + dbg_printf("[%u] Sampler Data : %s\n", exporter->info.id, exporter->sampler == NULL ? "not available" : "available"); + dbg_printf("[%u] Sampling rate: %llu\n", exporter->info.id, (long long unsigned)sampling_rate); + } else { + sampling_rate = default_sampling; + dbg_printf("[%u] Sampling ID %u not (yet) available\n", exporter->info.id, sampler_id); + } + + } else { + generic_sampler_t *sampler = exporter->sampler; + while ( sampler && sampler->info.id != -1 ) + sampler = sampler->next; + + if ( sampler ) { + sampling_rate = sampler->info.interval; + dbg_printf("[%u] Std sampling available for this flow source: Rate: %llu\n", exporter->info.id, (long long unsigned)sampling_rate); + } else { + sampling_rate = default_sampling; + dbg_printf("[%u] No Sampling record found\n", exporter->info.id); + } + } + + if ( overwrite_sampling > 0 ) { + sampling_rate = overwrite_sampling; + dbg_printf("[%u] Hard overwrite sampling rate: %llu\n", exporter->info.id, (long long unsigned)sampling_rate); + } + + if ( sampling_rate != 1 ) + SetFlag(table->flags, FLAG_SAMPLED); + + while (size_left) { + common_record_t *data_record; + + if ( (size_left < table->input_record_size) ) { + if ( size_left > 3 ) { + syslog(LOG_WARNING,"Process_v9: Corrupt data flowset? Pad bytes: %u", size_left); + dbg_printf("Process_v9: Corrupt data flowset? Pad bytes: %u, table record_size: %u\n", + size_left, table->input_record_size); + } + size_left = 0; + continue; + } + + // check for enough space in output buffer + if ( !CheckBufferSpace(fs->nffile, table->output_record_size) ) { + // this should really never occur, because the buffer gets flushed ealier + syslog(LOG_ERR,"Process_v9: output buffer size error. Abort v9 record processing"); + dbg_printf("Process_v9: output buffer size error. Abort v9 record processing"); + return; + } + processed_records++; + + // map file record to output buffer + data_record = (common_record_t *)fs->nffile->buff_ptr; + // map output buffer as a byte array + out = (uint8_t *)data_record; + + dbg_printf("[%u] Process data record: %u addr: %llu, in record size: %u, buffer size_left: %u\n", + exporter->info.id, processed_records, (long long unsigned)((ptrdiff_t)in - (ptrdiff_t)data_flowset), + table->input_record_size, size_left); + + // fill the data record + data_record->flags = table->flags; + data_record->size = table->output_record_size; + data_record->type = CommonRecordType; + data_record->ext_map = table->extension_info.map->map_id; + data_record->exporter_sysid = exporter->info.sysid; + data_record->reserved = 0; + + table->packets = 0; + table->bytes = 0; + table->out_packets = 0; + table->out_bytes = 0; + + dbg_printf("%u] Process data record: MapID: %u\n", exporter->info.id, table->extension_info.map->map_id); + + // apply copy and processing sequence + for ( i=0; inumber_of_sequences; i++ ) { + int input_offset = table->sequence[i].input_offset; + int output_offset = table->sequence[i].output_offset; + void *stack = table->sequence[i].stack; + switch (table->sequence[i].id) { + case nop: + break; + case move8: + out[output_offset] = in[input_offset]; + break; + case move16: + *((uint16_t *)&out[output_offset]) = Get_val16((void *)&in[input_offset]); + break; + case move32: + *((uint32_t *)&out[output_offset]) = Get_val32((void *)&in[input_offset]); + break; + case move40: + /* 64bit access to potentially unaligned output buffer. use 2 x 32bit for _LP64 CPUs */ + { type_mask_t t; + + t.val.val64 = Get_val40((void *)&in[input_offset]); + *((uint32_t *)&out[output_offset]) = t.val.val32[0]; + *((uint32_t *)&out[output_offset+4]) = t.val.val32[1]; + } + break; + case move48: + /* 64bit access to potentially unaligned output buffer. use 2 x 32bit for _LP64 CPUs */ + { type_mask_t t; + t.val.val64 = Get_val48((void *)&in[input_offset]); + *((uint32_t *)&out[output_offset]) = t.val.val32[0]; + *((uint32_t *)&out[output_offset+4]) = t.val.val32[1]; + } + break; + case move56: + /* 64bit access to potentially unaligned output buffer. use 2 x 32bit for _LP64 CPUs */ + { type_mask_t t; + + t.val.val64 = Get_val56((void *)&in[input_offset]); + *((uint32_t *)&out[output_offset]) = t.val.val32[0]; + *((uint32_t *)&out[output_offset+4]) = t.val.val32[1]; + } + break; + case move64: + { type_mask_t t; + t.val.val64 = Get_val64((void *)&in[input_offset]); + + *((uint32_t *)&out[output_offset]) = t.val.val32[0]; + *((uint32_t *)&out[output_offset+4]) = t.val.val32[1]; + } break; + case move96: + { *((uint32_t *)&out[output_offset]) = Get_val32((void *)&in[input_offset]); + *((uint32_t *)&out[output_offset+4]) = Get_val32((void *)&in[input_offset+4]); + *((uint32_t *)&out[output_offset+8]) = Get_val32((void *)&in[input_offset+8]); + } break; + case move128: + /* 64bit access to potentially unaligned output buffer. use 2 x 32bit for _LP64 CPUs */ + { type_mask_t t; + + t.val.val64 = Get_val64((void *)&in[input_offset]); + *((uint32_t *)&out[output_offset]) = t.val.val32[0]; + *((uint32_t *)&out[output_offset+4]) = t.val.val32[1]; + + t.val.val64 = Get_val64((void *)&in[input_offset+8]); + *((uint32_t *)&out[output_offset+8]) = t.val.val32[0]; + *((uint32_t *)&out[output_offset+12]) = t.val.val32[1]; + } break; + case move32_sampling: + /* 64bit access to potentially unaligned output buffer. use 2 x 32bit for _LP64 CPUs */ + { type_mask_t t; + t.val.val64 = Get_val32((void *)&in[input_offset]); + t.val.val64 *= sampling_rate; + *((uint32_t *)&out[output_offset]) = t.val.val32[0]; + *((uint32_t *)&out[output_offset+4]) = t.val.val32[1]; + *(uint64_t *)stack = t.val.val64; + } break; + case move64_sampling: + /* 64bit access to potentially unaligned output buffer. use 2 x 32bit for _LP64 CPUs */ + { type_mask_t t; + t.val.val64 = Get_val64((void *)&in[input_offset]); + + t.val.val64 *= sampling_rate; + *((uint32_t *)&out[output_offset]) = t.val.val32[0]; + *((uint32_t *)&out[output_offset+4]) = t.val.val32[1]; + *(uint64_t *)stack = t.val.val64; + } break; + case move_mac: + /* 64bit access to potentially unaligned output buffer. use 2 x 32bit for _LP64 CPUs */ + { type_mask_t t; + + t.val.val64 = Get_val48((void *)&in[input_offset]); + *((uint32_t *)&out[output_offset]) = t.val.val32[0]; + *((uint32_t *)&out[output_offset+4]) = t.val.val32[1]; + } + break; + case move_mpls: + *((uint32_t *)&out[output_offset]) = Get_val24((void *)&in[input_offset]); + break; + case move_ulatency: + /* 64bit access to potentially unaligned output buffer. use 2 x 32bit for _LP64 CPUs */ + { type_mask_t t; + t.val.val32[0] = *((uint32_t *)&out[output_offset]); + t.val.val32[1] = *((uint32_t *)&out[output_offset+4]); + + t.val.val64 += Get_val32((void *)&in[input_offset]); + *((uint32_t *)&out[output_offset]) = t.val.val32[0]; + *((uint32_t *)&out[output_offset+4]) = t.val.val32[1]; + } break; + case move_slatency: + /* 64bit access to potentially unaligned output buffer. use 2 x 32bit for _LP64 CPUs */ + { type_mask_t t; + t.val.val32[0] = *((uint32_t *)&out[output_offset]); + t.val.val32[1] = *((uint32_t *)&out[output_offset+4]); + + // update sec to usec + t.val.val64 += 1000000 * Get_val32((void *)&in[input_offset]); + *((uint32_t *)&out[output_offset]) = t.val.val32[0]; + *((uint32_t *)&out[output_offset+4]) = t.val.val32[1]; + } break; + case move_user_20: + memcpy((void *)&out[output_offset],(void *)&in[input_offset],20); + out[output_offset+20] = 0; // trailing 0 for string + break; + case move_user_65: + memcpy((void *)&out[output_offset],(void *)&in[input_offset],65); + out[output_offset+65] = 0; // trailing 0 for string + break; + case TimeMsec: + { uint64_t DateMiliseconds = Get_val64((void *)&in[input_offset]); + *(uint64_t *)stack = DateMiliseconds; + } break; + case PushTimeMsec: + { type_mask_t t; + t.val.val64 = Get_val64((void *)&in[input_offset]); + *(uint64_t *)stack = t.val.val64; + + *((uint32_t *)&out[output_offset]) = t.val.val32[0]; + *((uint32_t *)&out[output_offset+4]) = t.val.val32[1]; + } break; + + // zero sequences for unavailable elements + case zero8: + out[output_offset] = 0; + break; + case zero16: + *((uint16_t *)&out[output_offset]) = 0; + break; + case zero32: + *((uint32_t *)&out[output_offset]) = 0; + break; + case zero64: { + *((uint32_t *)&out[output_offset]) = 0; + *((uint32_t *)&out[output_offset+4]) = 0; + } break; + case zero96: + { *((uint32_t *)&out[output_offset]) = 0; + *((uint32_t *)&out[output_offset+4]) = 0; + *((uint32_t *)&out[output_offset+8]) = 0; + } break; + case zero128: { + *((uint32_t *)&out[output_offset]) = 0; + *((uint32_t *)&out[output_offset+4]) = 0; + *((uint32_t *)&out[output_offset+8]) = 0; + *((uint32_t *)&out[output_offset+12]) = 0; + } break; + default: + syslog(LOG_ERR, "Process_v9: Software bug! Unknown Sequence: %u. at %s line %d", + table->sequence[i].id, __FILE__, __LINE__); + dbg_printf("Software bug! Unknown Sequence: %u. at %s line %d", + table->sequence[i].id, __FILE__, __LINE__); + } + } + + + // Ungly ICMP hack for v9, because some IOS version are lazzy + // most of them send ICMP in dst port field some don't some have both + if ( data_record->prot == IPPROTO_ICMP || data_record->prot == IPPROTO_ICMPV6 ) { + if ( table->ICMP_offset ) { + data_record->dstport = Get_val16((void *)&in[table->ICMP_offset]); + } + if ( data_record->dstport == 0 && data_record->srcport != 0 ) { + // some IOSes are even lazzier and map ICMP code in src port - ughh + data_record->dstport = data_record->srcport; + data_record->srcport = 0; + } + } + + // Check for NSEL/NEL Event time + if ( table->flow_start ) { + data_record->first = table->flow_start / 1000; + data_record->msec_first = table->flow_start % 1000; + start_time = table->flow_start; + // test for tags 152/153 + if ( table->flow_end ) { + data_record->last = table->flow_end / 1000; + data_record->msec_last = table->flow_end % 1000; + end_time = table->flow_end; + } else { + data_record->last = data_record->first; + data_record->msec_last = data_record->msec_first; + end_time = table->flow_start; + } + dbg_printf("Found time flow start MSEC: %llu\n", table->EventTimeMsec); + } else if ( table->EventTimeMsec && data_record->first == 0 ) { + data_record->first = table->EventTimeMsec / 1000; + data_record->msec_first = table->EventTimeMsec % 1000; + data_record->last = data_record->first; + data_record->msec_last = data_record->msec_first; + start_time = table->EventTimeMsec; + end_time = table->EventTimeMsec; + dbg_printf("Found Time Event MSEC: %llu\n", table->EventTimeMsec); + } else if ( data_record->first == 0 && data_record->last == 0 ) { + // hmm - a record with no time at all .. + data_record->first = 0; + data_record->msec_last = 0; + start_time = 0; + end_time = 0; + } else { + uint32_t First = data_record->first; + uint32_t Last = data_record->last; + + if ( First > Last ) + /* First in msec, in case of msec overflow, between start and end */ + start_time = exporter->boot_time - 0x100000000LL + (uint64_t)First; + else + start_time = (uint64_t)First + exporter->boot_time; + + /* end time in msecs */ + end_time = (uint64_t)Last + exporter->boot_time; + + if ( (end_time - start_time) > 0xffc00000 && table->bytes < 2000 ) { + dbg_printf("CISCO bugfix!\n"); + start_time += 0xffc00000; + } + data_record->first = start_time/1000; + data_record->msec_first = start_time - data_record->first*1000; + + data_record->last = end_time/1000; + data_record->msec_last = end_time - data_record->last*1000; + + if ( data_record->first == 0 && data_record->last == 0 ) + data_record->last = 0; + } + + // update first_seen, last_seen + if ( start_time < fs->first_seen ) + fs->first_seen = start_time; + if ( end_time > fs->last_seen ) + fs->last_seen = end_time; + + // check if we need to record the router IP address + if ( table->router_ip_offset ) { + int output_offset = table->router_ip_offset; + if ( exporter->info.sa_family == PF_INET6 ) { + /* 64bit access to potentially unaligned output buffer. use 2 x 32bit for _LP64 CPUs */ + type_mask_t t; + + t.val.val64 = exporter->info.ip.v6[0]; + *((uint32_t *)&out[output_offset]) = t.val.val32[0]; + *((uint32_t *)&out[output_offset+4]) = t.val.val32[1]; + + t.val.val64 = exporter->info.ip.v6[1]; + *((uint32_t *)&out[output_offset+8]) = t.val.val32[0]; + *((uint32_t *)&out[output_offset+12]) = t.val.val32[1]; + } else { + *((uint32_t *)&out[output_offset]) = exporter->info.ip.v4; + } + } + + // Ugly hack. CISCO never really implemented #38/#39 tags in the records - so take it from the + // header, unless some data is filled in + if ( table->engine_offset ) { + if ( *((uint32_t *)&out[table->engine_offset]) == 0 ) { + tpl_ext_25_t *tpl = (tpl_ext_25_t *)&out[table->engine_offset]; + tpl->engine_type = ( exporter->info.id >> 8 ) & 0xFF; + tpl->engine_id = exporter->info.id & 0xFF; + } + } + + // check, if we need to store the packet received time + if ( table->received_offset ) { + type_mask_t t; + t.val.val64 = (uint64_t)((uint64_t)fs->received.tv_sec * 1000LL) + (uint64_t)((uint64_t)fs->received.tv_usec / 1000LL); + *((uint32_t *)&out[table->received_offset]) = t.val.val32[0]; + *((uint32_t *)&out[table->received_offset+4]) = t.val.val32[1]; + } + + switch (data_record->prot ) { // switch protocol of + case IPPROTO_ICMP: + fs->nffile->stat_record->numflows_icmp++; + fs->nffile->stat_record->numpackets_icmp += table->packets; + fs->nffile->stat_record->numbytes_icmp += table->bytes; + fs->nffile->stat_record->numpackets_icmp += table->out_packets; + fs->nffile->stat_record->numbytes_icmp += table->out_bytes; + break; + case IPPROTO_TCP: + fs->nffile->stat_record->numflows_tcp++; + fs->nffile->stat_record->numpackets_tcp += table->packets; + fs->nffile->stat_record->numbytes_tcp += table->bytes; + fs->nffile->stat_record->numpackets_tcp += table->out_packets; + fs->nffile->stat_record->numbytes_tcp += table->out_bytes; + break; + case IPPROTO_UDP: + fs->nffile->stat_record->numflows_udp++; + fs->nffile->stat_record->numpackets_udp += table->packets; + fs->nffile->stat_record->numbytes_udp += table->bytes; + fs->nffile->stat_record->numpackets_udp += table->out_packets; + fs->nffile->stat_record->numbytes_udp += table->out_bytes; + break; + default: + fs->nffile->stat_record->numflows_other++; + fs->nffile->stat_record->numpackets_other += table->packets; + fs->nffile->stat_record->numbytes_other += table->bytes; + fs->nffile->stat_record->numpackets_other += table->out_packets; + fs->nffile->stat_record->numbytes_other += table->out_bytes; + } + exporter->flows++; + fs->nffile->stat_record->numflows++; + fs->nffile->stat_record->numpackets += table->packets; + fs->nffile->stat_record->numbytes += table->bytes; + fs->nffile->stat_record->numpackets += table->out_packets; + fs->nffile->stat_record->numbytes += table->out_bytes; + + if ( fs->xstat ) { + uint32_t bpp = table->packets ? table->bytes/table->packets : 0; + if ( bpp > MAX_BPP ) + bpp = MAX_BPP; + if ( data_record->prot == IPPROTO_TCP ) { + fs->xstat->bpp_histogram->tcp.bpp[bpp]++; + fs->xstat->bpp_histogram->tcp.count++; + + fs->xstat->port_histogram->src_tcp.port[data_record->srcport]++; + fs->xstat->port_histogram->dst_tcp.port[data_record->dstport]++; + fs->xstat->port_histogram->src_tcp.count++; + fs->xstat->port_histogram->dst_tcp.count++; + } else if ( data_record->prot == IPPROTO_UDP ) { + fs->xstat->bpp_histogram->udp.bpp[bpp]++; + fs->xstat->bpp_histogram->udp.count++; + + fs->xstat->port_histogram->src_udp.port[data_record->srcport]++; + fs->xstat->port_histogram->dst_udp.port[data_record->dstport]++; + fs->xstat->port_histogram->src_udp.count++; + fs->xstat->port_histogram->dst_udp.count++; + } + } + + if ( verbose ) { + master_record_t master_record; + ExpandRecord_v2((common_record_t *)data_record, &(table->extension_info), &(exporter->info), &master_record); + format_file_block_record(&master_record, &string, 0); + printf("%s\n", string); + } + + fs->nffile->block_header->size += data_record->size; + fs->nffile->block_header->NumRecords++; + fs->nffile->buff_ptr = (common_record_t *)((pointer_addr_t)data_record + data_record->size); + + // advance input + size_left -= table->input_record_size; + in += table->input_record_size; + + // buffer size sanity check + if ( fs->nffile->block_header->size > BUFFSIZE ) { + // should never happen + syslog(LOG_ERR,"### Software error ###: %s line %d", __FILE__, __LINE__); + syslog(LOG_ERR,"Process v9: Output buffer overflow! Flush buffer and skip records."); + syslog(LOG_ERR,"Buffer size: %u > %u", fs->nffile->block_header->size, BUFFSIZE); + + // reset buffer + fs->nffile->block_header->size = 0; + fs->nffile->block_header->NumRecords = 0; + fs->nffile->buff_ptr = (void *)((pointer_addr_t)fs->nffile->block_header + sizeof(data_block_header_t) ); + return; + } + } + +} // End of Process_v9_data + +static inline void Process_v9_option_data(exporter_v9_domain_t *exporter, void *data_flowset, FlowSource_t *fs) { +option_offset_t *offset_table; +uint32_t id; +uint8_t *in; + + id = GET_FLOWSET_ID(data_flowset); + + offset_table = fs->option_offset_table; + while ( offset_table && offset_table->id != id ) + offset_table = offset_table->next; + + if ( !offset_table ) { + // should never happen - catch it anyway + syslog(LOG_ERR, "Process_v9: Panic! - No Offset table found! : %s line %d", __FILE__, __LINE__); + return; + } + +#ifdef DEVEL + uint32_t size_left = GET_FLOWSET_LENGTH(data_flowset) - 4; // -4 for data flowset header -> id and length + dbg_printf("[%u] Process option data flowset size: %u\n", exporter->info.id, size_left); +#endif + + // map input buffer as a byte array + in = (uint8_t *)(data_flowset + 4); // skip flowset header + + if ( TestFlag(offset_table->flags, HAS_SAMPLER_DATA) ) { + int32_t id; + uint16_t mode; + uint32_t interval; + if (offset_table->sampler_id_length == 2) { + id = Get_val16((void *)&in[offset_table->offset_id]); + } else { + id = in[offset_table->offset_id]; + } + mode = in[offset_table->offset_mode]; + interval = Get_val32((void *)&in[offset_table->offset_interval]); + + dbg_printf("Extracted Sampler data:\n"); + dbg_printf("Sampler ID : %u\n", id); + dbg_printf("Sampler mode : %u\n", mode); + dbg_printf("Sampler interval: %u\n", interval); + + InsertSampler(fs, exporter, id, mode, interval); + } + + if ( TestFlag(offset_table->flags, HAS_STD_SAMPLER_DATA) ) { + int32_t id = -1; + uint16_t mode = in[offset_table->offset_std_sampler_algorithm]; + uint32_t interval = Get_val32((void *)&in[offset_table->offset_std_sampler_interval]); + + InsertSampler(fs, exporter, id, mode, interval); + + dbg_printf("Extracted Std Sampler data:\n"); + dbg_printf("Sampler ID : %u\n", id); + dbg_printf("Sampler algorithm: %u\n", mode); + dbg_printf("Sampler interval : %u\n", interval); + + syslog(LOG_INFO, "Set std sampler: algorithm: %u, interval: %u\n", + mode, interval); + dbg_printf("Set std sampler: algorithm: %u, interval: %u\n", + mode, interval); + } + processed_records++; + +} // End of Process_v9_option_data + +void Process_v9(void *in_buff, ssize_t in_buff_cnt, FlowSource_t *fs) { +exporter_v9_domain_t *exporter; +void *flowset_header; +option_template_flowset_t *option_flowset; +netflow_v9_header_t *v9_header; +int64_t distance; +uint32_t flowset_id, flowset_length, exporter_id; +ssize_t size_left; +static int pkg_num = 0; + + pkg_num++; + size_left = in_buff_cnt; + if ( size_left < NETFLOW_V9_HEADER_LENGTH ) { + syslog(LOG_ERR, "Process_v9: Too little data for v9 packet: '%lli'", (long long)size_left); + return; + } + + // map v9 data structure to input buffer + v9_header = (netflow_v9_header_t *)in_buff; + exporter_id = ntohl(v9_header->source_id); + + exporter = GetExporter(fs, exporter_id); + if ( !exporter ) { + syslog(LOG_ERR,"Process_v9: Exporter NULL: Abort v9 record processing"); + return; + } + exporter->packets++; + + /* calculate boot time in msec */ + v9_header->SysUptime = ntohl(v9_header->SysUptime); + v9_header->unix_secs = ntohl(v9_header->unix_secs); + exporter->boot_time = (uint64_t)1000 * (uint64_t)(v9_header->unix_secs) - (uint64_t)v9_header->SysUptime; + + flowset_header = (void *)v9_header + NETFLOW_V9_HEADER_LENGTH; + + size_left -= NETFLOW_V9_HEADER_LENGTH; + +#ifdef DEVEL + uint32_t expected_records = ntohs(v9_header->count); + printf("\n[%u] Next packet: %i %u records, buffer: %li \n", exporter_id, pkg_num, expected_records, size_left); +#endif + + // sequence check + if ( exporter->first ) { + exporter->last_sequence = ntohl(v9_header->sequence); + exporter->sequence = exporter->last_sequence; + exporter->first = 0; + } else { + exporter->last_sequence = exporter->sequence; + exporter->sequence = ntohl(v9_header->sequence); + distance = exporter->sequence - exporter->last_sequence; + // handle overflow + if (distance < 0) { + distance = 0xffffffff + distance +1; + } + if (distance != 1) { + exporter->sequence_failure++; + fs->nffile->stat_record->sequence_failure++; + dbg_printf("[%u] Sequence error: last seq: %lli, seq %lli dist %lli\n", + exporter->info.id, (long long)exporter->last_sequence, (long long)exporter->sequence, (long long)distance); + /* + if ( report_seq ) + syslog(LOG_ERR,"Flow sequence mismatch. Missing: %lli packets", delta(last_count,distance)); + */ + } + } + + processed_records = 0; + + // iterate over all flowsets in export packet, while there are bytes left + flowset_length = 0; + while (size_left) { + flowset_header = flowset_header + flowset_length; + + flowset_id = GET_FLOWSET_ID(flowset_header); + flowset_length = GET_FLOWSET_LENGTH(flowset_header); + + dbg_printf("[%u] Next flowset: %u, length: %u buffersize: %li addr: %llu\n", + exporter->info.id, flowset_id, flowset_length, size_left, + (long long unsigned)(flowset_header - in_buff) ); + + if ( flowset_length == 0 ) { + /* this should never happen, as 4 is an empty flowset + and smaller is an illegal flowset anyway ... + if it happends, we can't determine the next flowset, so skip the entire export packet + */ + syslog(LOG_ERR,"Process_v9: flowset zero length error."); + dbg_printf("Process_v9: flowset zero length error.\n"); + return; + } + + // possible padding + if ( flowset_length <= 4 ) { + size_left = 0; + continue; + } + + if ( flowset_length > size_left ) { + dbg_printf("flowset length error. Expected bytes: %u > buffersize: %lli", + flowset_length, (long long)size_left); + syslog(LOG_ERR,"Process_v9: flowset length error. Expected bytes: %u > buffersize: %lli", + flowset_length, (long long)size_left); + size_left = 0; + continue; + } + +#ifdef DEVEL + if ( (ptrdiff_t)fs->nffile->buff_ptr & 0x3 ) { + fprintf(stderr, "PANIC: alignment error!! \n"); + exit(255); + } +#endif + + switch (flowset_id) { + case NF9_TEMPLATE_FLOWSET_ID: + Process_v9_templates(exporter, flowset_header, fs); + break; + case NF9_OPTIONS_FLOWSET_ID: + option_flowset = (option_template_flowset_t *)flowset_header; + syslog(LOG_DEBUG,"Process_v9: Found options flowset: template %u", ntohs(option_flowset->template_id)); + Process_v9_option_templates(exporter, flowset_header, fs); + break; + default: { + input_translation_t *table; + if ( flowset_id < NF9_MIN_RECORD_FLOWSET_ID ) { + dbg_printf("Invalid flowset id: %u\n", flowset_id); + syslog(LOG_ERR,"Process_v9: Invalid flowset id: %u", flowset_id); + } else { + + dbg_printf("[%u] ID %u Data flowset\n", exporter->info.id, flowset_id); + + table = GetTranslationTable(exporter, flowset_id); + if ( table ) { + Process_v9_data(exporter, flowset_header, fs, table); + } else if ( HasOptionTable(fs, flowset_id) ) { + Process_v9_option_data(exporter, flowset_header, fs); + } else { + // maybe a flowset with option data + dbg_printf("Process v9: [%u] No table for id %u -> Skip record\n", + exporter->info.id, flowset_id); + } + } + } + } + + // next flowset + size_left -= flowset_length; + + } // End of while + +#ifdef DEVEL + if ( processed_records != expected_records ) { + syslog(LOG_ERR, "Process_v9: Processed records %u, expected %u", processed_records, expected_records); + printf("Process_v9: Processed records %u, expected %u\n", processed_records, expected_records); + } +#endif + + return; + +} /* End of Process_v9 */ + +/* + * functions for sending netflow v9 records + */ + +void Init_v9_output(send_peer_t *peer) { +int i; + + v9_output_header = (netflow_v9_header_t *)peer->send_buffer; + v9_output_header->version = htons(9); + v9_output_header->SysUptime = 0; + v9_output_header->unix_secs = 0; + v9_output_header->count = 0; + v9_output_header->source_id = htonl(1); + template_id = NF9_MIN_RECORD_FLOWSET_ID; + peer->buff_ptr = (void *)((pointer_addr_t)v9_output_header + (pointer_addr_t)sizeof(netflow_v9_header_t)); + + // set the max number of v9 tags, we support. + Max_num_v9_tags = 0; + for (i=1; v9_element_map[i].id != 0; i++ ) { + if ( v9_element_map[i].id != v9_element_map[i-1].id ) + Max_num_v9_tags++; + } + +} // End of Init_v9_output + +static output_template_t *GetOutputTemplate(uint32_t flags, extension_map_t *extension_map) { +output_template_t **t; +template_record_t *fields; +uint32_t i, count, record_length; + + t = &output_templates; + // search for the template, which corresponds to our flags and extension map + while ( *t ) { + if ( (*t)->flags == flags && (*t)->extension_map == extension_map ) + return *t; + t = &((*t)->next); + } + + // nothing found, otherwise we would not get here + *t = (output_template_t *)malloc(sizeof(output_template_t)); + if ( !(*t)) { + fprintf(stderr, "Panic! malloc() %s line %d: %s", __FILE__, __LINE__, strerror (errno)); + exit(255); + } + memset((void *)(*t), 0, sizeof(output_template_t)); + (*t)->next = NULL; + (*t)->flags = flags; + (*t)->extension_map = extension_map; + (*t)->time_sent = 0; + (*t)->template_flowset = malloc(sizeof(template_flowset_t) + ((Max_num_v9_tags * 4))); // 4 for 2 x uint16_t: type/length + + count = 0; + record_length = 0; + fields = (*t)->template_flowset->fields; + + // Fill the template flowset in the order of the common_record_t + // followed be the available extensions + fields->record[count].type = htons(NF9_FIRST_SWITCHED); + fields->record[count].length = htons(4); + record_length += 4; + count++; + + fields->record[count].type = htons(NF9_LAST_SWITCHED); + fields->record[count].length = htons(4); + record_length += 4; + count++; + + fields->record[count].type = htons(NF9_FORWARDING_STATUS); + fields->record[count].length = htons(1); + record_length += 1; + count++; + + fields->record[count].type = htons(NF9_TCP_FLAGS); + fields->record[count].length = htons(1); + record_length += 1; + count++; + + fields->record[count].type = htons(NF9_IN_PROTOCOL); + fields->record[count].length = htons(1); + record_length += 1; + count++; + + fields->record[count].type = htons(NF9_SRC_TOS); + fields->record[count].length = htons(1); + record_length += 1; + count++; + + fields->record[count].type = htons(NF9_L4_SRC_PORT); + fields->record[count].length = htons(2); + record_length += 2; + count++; + + fields->record[count].type = htons(NF9_L4_DST_PORT); + fields->record[count].length = htons(2); + record_length += 2; + count++; + + fields->record[count].type = htons(NF9_ICMP_TYPE); + fields->record[count].length = htons(2); + record_length += 2; + count++; + + // common record processed + + // fill in IP address tags + if ( (flags & FLAG_IPV6_ADDR) != 0 ) { // IPv6 addresses + fields->record[count].type = htons(NF9_IPV6_SRC_ADDR); + fields->record[count].length = htons(16); + record_length += 16; + count++; + fields->record[count].type = htons(NF9_IPV6_DST_ADDR); + fields->record[count].length = htons(16); + record_length += 16; + } else { // IPv4 addresses + fields->record[count].type = htons(NF9_IPV4_SRC_ADDR); + fields->record[count].length = htons(4); + record_length += 4; + count++; + fields->record[count].type = htons(NF9_IPV4_DST_ADDR); + fields->record[count].length = htons(4); + record_length += 4; + } + count++; + + // packet counter + fields->record[count].type = htons(NF9_IN_PACKETS); + if ( (flags & FLAG_PKG_64) != 0 ) { // 64bit packet counter + fields->record[count].length = htons(8); + record_length += 8; + } else { + fields->record[count].length = htons(4); + record_length += 4; + } + count++; + + // bytes counter + fields->record[count].type = htons(NF9_IN_BYTES); + if ( (flags & FLAG_BYTES_64) != 0 ) { // 64bit byte counter + fields->record[count].length = htons(8); + record_length += 8; + } else { + fields->record[count].length = htons(4); + record_length += 4; + } + count++; + // process extension map + i = 0; + while ( extension_map->ex_id[i] ) { + switch (extension_map->ex_id[i++]) { + // 0 - 3 should never be in an extension table so - ignore it + case 0: + case 1: + case 2: + case 3: + break; + case EX_IO_SNMP_2: + fields->record[count].type = htons(NF9_INPUT_SNMP); + fields->record[count].length = htons(2); + record_length += 2; + count++; + + fields->record[count].type = htons(NF9_OUTPUT_SNMP); + fields->record[count].length = htons(2); + record_length += 2; + count++; + break; + case EX_IO_SNMP_4: // input/output SNMP 4 byte + fields->record[count].type = htons(NF9_INPUT_SNMP); + fields->record[count].length = htons(4); + record_length += 4; + count++; + + fields->record[count].type = htons(NF9_OUTPUT_SNMP); + fields->record[count].length = htons(4); + record_length += 4; + count++; + break; + case EX_AS_2: // srcas/dstas 2 byte + fields->record[count].type = htons(NF9_SRC_AS); + fields->record[count].length = htons(2); + record_length += 2; + count++; + + fields->record[count].type = htons(NF9_DST_AS); + fields->record[count].length = htons(2); + record_length += 2; + count++; + break; + case EX_AS_4: // srcas/dstas 4 byte + fields->record[count].type = htons(NF9_SRC_AS); + fields->record[count].length = htons(4); + record_length += 4; + count++; + + fields->record[count].type = htons(NF9_DST_AS); + fields->record[count].length = htons(4); + record_length += 4; + count++; + break; + case EX_MULIPLE: { + uint16_t src_mask, dst_mask; + fields->record[count].type = htons(NF9_DST_TOS); + fields->record[count].length = htons(1); + record_length += 1; + count++; + + fields->record[count].type = htons(NF9_DIRECTION); + fields->record[count].length = htons(1); + record_length += 1; + count++; + + if ( (flags & FLAG_IPV6_ADDR) != 0 ) { // IPv6 addresses + src_mask = NF9_IPV6_SRC_MASK; + dst_mask = NF9_IPV6_DST_MASK; + } else { // IPv4 addresses + src_mask = NF9_SRC_MASK; + dst_mask = NF9_DST_MASK; + } + + fields->record[count].type = htons(src_mask); + fields->record[count].length = htons(1); + record_length += 1; + count++; + + fields->record[count].type = htons(dst_mask); + fields->record[count].length = htons(1); + record_length += 1; + count++; + } break; + case EX_NEXT_HOP_v4: + fields->record[count].type = htons(NF9_V4_NEXT_HOP); + fields->record[count].length = htons(4); + record_length += 4; + count++; + break; + case EX_NEXT_HOP_v6: + fields->record[count].type = htons(NF9_V6_NEXT_HOP); + fields->record[count].length = htons(16); + record_length += 16; + count++; + break; + case EX_NEXT_HOP_BGP_v4: + fields->record[count].type = htons(NF9_BGP_V4_NEXT_HOP); + fields->record[count].length = htons(4); + record_length += 4; + count++; + break; + case EX_NEXT_HOP_BGP_v6: + fields->record[count].type = htons(NF9_BPG_V6_NEXT_HOP); + fields->record[count].length = htons(16); + record_length += 16; + count++; + break; + case EX_VLAN: + fields->record[count].type = htons(NF9_SRC_VLAN); + fields->record[count].length = htons(2); + record_length += 2; + count++; + + fields->record[count].type = htons(NF9_DST_VLAN); + fields->record[count].length = htons(2); + record_length += 2; + count++; + break; + case EX_OUT_PKG_4: + fields->record[count].type = htons(NF9_OUT_PKTS); + fields->record[count].length = htons(4); + record_length += 4; + count++; + break; + case EX_OUT_PKG_8: + fields->record[count].type = htons(NF9_OUT_PKTS); + fields->record[count].length = htons(8); + record_length += 8; + count++; + break; + case EX_OUT_BYTES_4: + fields->record[count].type = htons(NF9_OUT_BYTES); + fields->record[count].length = htons(4); + record_length += 4; + count++; + break; + case EX_OUT_BYTES_8: + fields->record[count].type = htons(NF9_OUT_BYTES); + fields->record[count].length = htons(8); + record_length += 8; + count++; + break; + case EX_AGGR_FLOWS_4: + fields->record[count].type = htons(NF9_FLOWS_AGGR); + fields->record[count].length = htons(4); + record_length += 4; + count++; + break; + case EX_AGGR_FLOWS_8: + fields->record[count].type = htons(NF9_FLOWS_AGGR); + fields->record[count].length = htons(8); + record_length += 8; + count++; + break; + case EX_MAC_1: + fields->record[count].type = htons(NF9_IN_SRC_MAC); + fields->record[count].length = htons(6); + record_length += 6; + count++; + + fields->record[count].type = htons(NF9_OUT_DST_MAC); + fields->record[count].length = htons(6); + record_length += 6; + count++; + break; + case EX_MAC_2: + fields->record[count].type = htons(NF9_IN_DST_MAC); + fields->record[count].length = htons(6); + record_length += 6; + count++; + + fields->record[count].type = htons(NF9_OUT_SRC_MAC); + fields->record[count].length = htons(6); + record_length += 6; + count++; + break; + case EX_MPLS: + fields->record[count].type = htons(NF9_MPLS_LABEL_1); + fields->record[count].length = htons(3); + record_length += 3; + count++; + + fields->record[count].type = htons(NF9_MPLS_LABEL_2); + fields->record[count].length = htons(3); + record_length += 3; + count++; + + fields->record[count].type = htons(NF9_MPLS_LABEL_3); + fields->record[count].length = htons(3); + record_length += 3; + count++; + + fields->record[count].type = htons(NF9_MPLS_LABEL_4); + fields->record[count].length = htons(3); + record_length += 3; + count++; + + fields->record[count].type = htons(NF9_MPLS_LABEL_5); + fields->record[count].length = htons(3); + record_length += 3; + count++; + + fields->record[count].type = htons(NF9_MPLS_LABEL_6); + fields->record[count].length = htons(3); + record_length += 3; + count++; + + fields->record[count].type = htons(NF9_MPLS_LABEL_7); + fields->record[count].length = htons(3); + record_length += 3; + count++; + + fields->record[count].type = htons(NF9_MPLS_LABEL_8); + fields->record[count].length = htons(3); + record_length += 3; + count++; + + fields->record[count].type = htons(NF9_MPLS_LABEL_9); + fields->record[count].length = htons(3); + record_length += 3; + count++; + + fields->record[count].type = htons(NF9_MPLS_LABEL_10); + fields->record[count].length = htons(3); + record_length += 3; + count++; + + break; + case EX_ROUTER_ID: + fields->record[count].type = htons(NF9_ENGINE_TYPE); + fields->record[count].length = htons(1); + record_length += 1; + count++; + + fields->record[count].type = htons(NF9_ENGINE_ID); + fields->record[count].length = htons(1); + record_length += 1; + count++; + break; + case EX_BGPADJ: + fields->record[count].type = htons(NF9_BGP_ADJ_NEXT_AS); + fields->record[count].length = htons(4); + record_length += 4; + count++; + + fields->record[count].type = htons(NF9_BGP_ADJ_PREV_AS); + fields->record[count].length = htons(4); + record_length += 4; + count++; + break; + + // default: other extensions are not (yet) recognised + } + } + + (*t)->template_flowset->flowset_id = htons(NF9_TEMPLATE_FLOWSET_ID); + (*t)->flowset_length = 4 * (2+count); // + 2 for the header + + // add proper padding for 32bit boundary + if ( ((*t)->flowset_length & 0x3 ) != 0 ) + (*t)->flowset_length += (4 - ((*t)->flowset_length & 0x3 )); + (*t)->template_flowset->length = htons((*t)->flowset_length); + + (*t)->record_length = record_length; + + fields->template_id = htons(template_id++); + fields->count = htons(count); + + return *t; + +} // End of GetOutputTemplate + +static void Append_Record(send_peer_t *peer, master_record_t *master_record) { +extension_map_t *extension_map = master_record->map_ref; +uint32_t i, t1, t2; +uint16_t icmp; + + t1 = (uint32_t)(1000LL * (uint64_t)master_record->first + master_record->msec_first - boot_time); + t2 = (uint32_t)(1000LL * (uint64_t)master_record->last + master_record->msec_last - boot_time); + master_record->first = htonl(t1); + master_record->last = htonl(t2); + + master_record->srcport = htons(master_record->srcport); + master_record->dstport = htons(master_record->dstport); + + // if it's an ICMP send it in the appropriate v9 tag + if ( master_record->prot == IPPROTO_ICMP || master_record->prot == IPPROTO_ICMPV6 ) { // it's an ICMP + icmp = master_record->dstport; + master_record->dstport = 0; + } else { + icmp = 0; + } + // write the first 16 bytes of the master_record starting with first up to and including dst port + memcpy(peer->buff_ptr, (void *)&master_record->first, 16); + peer->buff_ptr = (void *)((pointer_addr_t)peer->buff_ptr + 16); + + // write ICMP type/code + memcpy(peer->buff_ptr, (void *)&icmp,2); + peer->buff_ptr = (void *)((pointer_addr_t)peer->buff_ptr + 2); + + // IP address info + if ((master_record->flags & FLAG_IPV6_ADDR) != 0 ) { // IPv6 + master_record->v6.srcaddr[0] = htonll(master_record->v6.srcaddr[0]); + master_record->v6.srcaddr[1] = htonll(master_record->v6.srcaddr[1]); + master_record->v6.dstaddr[0] = htonll(master_record->v6.dstaddr[0]); + master_record->v6.dstaddr[1] = htonll(master_record->v6.dstaddr[1]); + // keep compiler happy + // memcpy(peer->buff_ptr, master_record->v6.srcaddr, 4 * sizeof(uint64_t)); + memcpy(peer->buff_ptr, master_record->ip_union._ip_64.addr, 4 * sizeof(uint64_t)); + peer->buff_ptr = (void *)((pointer_addr_t)peer->buff_ptr + 4 * sizeof(uint64_t)); + } else { + Put_val32(htonl(master_record->v4.srcaddr), peer->buff_ptr); + peer->buff_ptr = (void *)((pointer_addr_t)peer->buff_ptr + sizeof(uint32_t)); + Put_val32(htonl(master_record->v4.dstaddr), peer->buff_ptr); + peer->buff_ptr = (void *)((pointer_addr_t)peer->buff_ptr + sizeof(uint32_t)); + } + + // packet counter + if ((master_record->flags & FLAG_PKG_64) != 0 ) { // 64bit counters + Put_val64(htonll(master_record->dPkts), peer->buff_ptr); + peer->buff_ptr = (void *)((pointer_addr_t)peer->buff_ptr + sizeof(uint64_t)); + } else { + Put_val32(htonl((uint32_t)master_record->dPkts), peer->buff_ptr); + peer->buff_ptr = (void *)((pointer_addr_t)peer->buff_ptr + sizeof(uint32_t)); + } + + // bytes counter + if ((master_record->flags & FLAG_BYTES_64) != 0 ) { // 64bit counters + Put_val64(htonll(master_record->dOctets),peer->buff_ptr); + peer->buff_ptr = (void *)((pointer_addr_t)peer->buff_ptr + sizeof(uint64_t)); + } else { + Put_val32(htonl((uint32_t)master_record->dOctets),peer->buff_ptr); + peer->buff_ptr = (void *)((pointer_addr_t)peer->buff_ptr + sizeof(uint32_t)); + } + + // send now optional extensions according the extension map + i=0; + while ( extension_map->ex_id[i] ) { + switch (extension_map->ex_id[i++]) { + // 0 - 3 should never be in an extension table so - ignore it + case 0: + case 1: + case 2: + case 3: + break; + case EX_IO_SNMP_2: { + uint16_t in, out; + + in = htons(master_record->input); + Put_val16(in, peer->buff_ptr); + peer->buff_ptr = (void *)((pointer_addr_t)peer->buff_ptr + sizeof(uint16_t)); + + out = htons(master_record->output); + Put_val16(out, peer->buff_ptr); + peer->buff_ptr = (void *)((pointer_addr_t)peer->buff_ptr + sizeof(uint16_t)); + } break; + case EX_IO_SNMP_4: + Put_val32(htonl(master_record->input), peer->buff_ptr); + peer->buff_ptr = (void *)((pointer_addr_t)peer->buff_ptr + sizeof(uint32_t)); + Put_val32(htonl(master_record->output), peer->buff_ptr); + peer->buff_ptr = (void *)((pointer_addr_t)peer->buff_ptr + sizeof(uint32_t)); + break; + case EX_AS_2: { // srcas/dstas 2 byte + uint16_t src, dst; + + src = htons(master_record->srcas); + Put_val16(src, peer->buff_ptr); + peer->buff_ptr = (void *)((pointer_addr_t)peer->buff_ptr + sizeof(uint16_t)); + + dst = htons(master_record->dstas); + Put_val16(dst, peer->buff_ptr); + peer->buff_ptr = (void *)((pointer_addr_t)peer->buff_ptr + sizeof(uint16_t)); + } break; + case EX_AS_4: // srcas/dstas 4 byte + Put_val32(htonl(master_record->srcas), peer->buff_ptr); + peer->buff_ptr = (void *)((pointer_addr_t)peer->buff_ptr + sizeof(uint32_t)); + Put_val32(htonl(master_record->dstas), peer->buff_ptr); + peer->buff_ptr = (void *)((pointer_addr_t)peer->buff_ptr + sizeof(uint32_t)); + break; + case EX_MULIPLE: { + tpl_ext_8_t *tpl = (tpl_ext_8_t *)peer->buff_ptr; + tpl->dst_tos = master_record->dst_tos; + tpl->dir = master_record->dir; + tpl->src_mask = master_record->src_mask; + tpl->dst_mask = master_record->dst_mask; + peer->buff_ptr = (void *)tpl->data; + } break; + case EX_NEXT_HOP_v4: + Put_val32(htonl(master_record->ip_nexthop.v4), peer->buff_ptr); + peer->buff_ptr = (void *)((pointer_addr_t)peer->buff_ptr + sizeof(uint32_t)); + break; + case EX_NEXT_HOP_v6: + Put_val64(htonll(master_record->ip_nexthop.v6[0]), peer->buff_ptr); + peer->buff_ptr = (void *)((pointer_addr_t)peer->buff_ptr + sizeof(uint64_t)); + Put_val64(htonll(master_record->ip_nexthop.v6[1]), peer->buff_ptr); + peer->buff_ptr = (void *)((pointer_addr_t)peer->buff_ptr + sizeof(uint64_t)); + break; + case EX_NEXT_HOP_BGP_v4: + Put_val32(htonl(master_record->bgp_nexthop.v4), peer->buff_ptr); + peer->buff_ptr = (void *)((pointer_addr_t)peer->buff_ptr + sizeof(uint32_t)); + break; + case EX_NEXT_HOP_BGP_v6: + Put_val64(htonll(master_record->bgp_nexthop.v6[0]), peer->buff_ptr); + peer->buff_ptr = (void *)((pointer_addr_t)peer->buff_ptr + sizeof(uint64_t)); + Put_val64(htonll(master_record->bgp_nexthop.v6[1]), peer->buff_ptr); + peer->buff_ptr = (void *)((pointer_addr_t)peer->buff_ptr + sizeof(uint64_t)); + break; + case EX_VLAN: + Put_val16(htons(master_record->src_vlan), peer->buff_ptr); + peer->buff_ptr = (void *)((pointer_addr_t)peer->buff_ptr + sizeof(uint16_t)); + Put_val16(htons(master_record->dst_vlan), peer->buff_ptr); + peer->buff_ptr = (void *)((pointer_addr_t)peer->buff_ptr + sizeof(uint16_t)); + break; + case EX_OUT_PKG_4: + Put_val32(htonl((uint32_t)master_record->out_pkts), peer->buff_ptr); + peer->buff_ptr = (void *)((pointer_addr_t)peer->buff_ptr + sizeof(uint32_t)); + break; + case EX_OUT_PKG_8: + Put_val64(htonll(master_record->out_pkts), peer->buff_ptr); + peer->buff_ptr = (void *)((pointer_addr_t)peer->buff_ptr + sizeof(uint64_t)); + break; + case EX_OUT_BYTES_4: + Put_val32(htonl((uint32_t)master_record->out_bytes), peer->buff_ptr); + peer->buff_ptr = (void *)((pointer_addr_t)peer->buff_ptr + sizeof(uint32_t)); + break; + case EX_OUT_BYTES_8: + Put_val64(htonll(master_record->out_bytes), peer->buff_ptr); + peer->buff_ptr = (void *)((pointer_addr_t)peer->buff_ptr + sizeof(uint64_t)); + break; + case EX_AGGR_FLOWS_4: + Put_val32(htonl(master_record->aggr_flows), peer->buff_ptr); + peer->buff_ptr = (void *)((pointer_addr_t)peer->buff_ptr + sizeof(uint32_t)); + break; + case EX_AGGR_FLOWS_8: + Put_val64(htonll(master_record->aggr_flows), peer->buff_ptr); + peer->buff_ptr = (void *)((pointer_addr_t)peer->buff_ptr + sizeof(uint64_t)); + break; + case EX_MAC_1: { + uint64_t val64; + val64 = htonll(master_record->in_src_mac); + Put_val48(val64, peer->buff_ptr); + peer->buff_ptr = (void *)((pointer_addr_t)peer->buff_ptr + 6); // 48 bits + + val64 = htonll(master_record->out_dst_mac); + Put_val48(val64, peer->buff_ptr); + peer->buff_ptr = (void *)((pointer_addr_t)peer->buff_ptr + 6); // 48 bits + + } break; + case EX_MAC_2: { + uint64_t val64; + val64 = htonll(master_record->in_dst_mac); + Put_val48(val64, peer->buff_ptr); + peer->buff_ptr = (void *)((pointer_addr_t)peer->buff_ptr + 6); // 48 bits + + val64 = htonll(master_record->out_src_mac); + Put_val48(val64, peer->buff_ptr); + peer->buff_ptr = (void *)((pointer_addr_t)peer->buff_ptr + 6); // 48 bits + + } break; + case EX_MPLS: { + uint32_t val32, i; + for ( i=0; i<10; i++ ) { + val32 = htonl(master_record->mpls_label[i]); + Put_val24(val32, peer->buff_ptr); + peer->buff_ptr = (void *)((pointer_addr_t)peer->buff_ptr + 3); // 24 bits + } + } break; + case EX_ROUTER_ID: { + uint8_t *u = (uint8_t *)peer->buff_ptr; + *u++ = master_record->engine_type; + *u++ = master_record->engine_id; + peer->buff_ptr = (void *)u; + } break; + case EX_BGPADJ: + Put_val32(htonl(master_record->bgpNextAdjacentAS), peer->buff_ptr); + peer->buff_ptr = (void *)((pointer_addr_t)peer->buff_ptr + sizeof(uint32_t)); + Put_val32(htonl(master_record->bgpPrevAdjacentAS), peer->buff_ptr); + peer->buff_ptr = (void *)((pointer_addr_t)peer->buff_ptr + sizeof(uint32_t)); + break; + + // default: ignore all other extension, as we do not understand them + } + } + +} // End of Append_Record + +int Add_v9_output_record(master_record_t *master_record, send_peer_t *peer) { +static data_flowset_t *data_flowset; +static output_template_t *template; +static uint32_t last_flags = 0; +static extension_map_t *last_map = NULL; +static int record_count, template_count, flowset_count, packet_count; +uint32_t required_size; +void *endwrite; +time_t now = time(NULL); + +#ifdef DEVEL +// char *string; +// format_file_block_record(master_record, 1, &string, 0); +// dbg_printf("%s\n", string); +#endif + + if ( !v9_output_header->unix_secs ) { // first time a record is added + // boot time is set one day back - assuming that the start time of every flow does not start ealier + boot_time = (uint64_t)(master_record->first - 86400)*1000; + v9_output_header->unix_secs = htonl(master_record->first - 86400); + v9_output_header->sequence = 0; + peer->buff_ptr = (void *)((pointer_addr_t)peer->send_buffer + NETFLOW_V9_HEADER_LENGTH); + record_count = 0; + template_count = 0; + flowset_count = 0; + packet_count = 0; + data_flowset = NULL; + + // write common blocksize from frst up to including dstas for one write (memcpy) +// common_block_size = (pointer_addr_t)&master_record->fill - (pointer_addr_t)&master_record->first; + + } else if ( flowset_count == 0 ) { // after a buffer flush + packet_count++; + v9_output_header->sequence = htonl(packet_count); + } + + if ( data_flowset ) { + // output buffer contains already a data flowset + if ( last_flags == master_record->flags && last_map == master_record->map_ref ) { + // same id as last record + // if ( now - template->time_sent > MAX_LIFETIME ) + if ( (record_count & 0xFFF) == 0 ) { // every 4096 flow records + uint16_t length = (pointer_addr_t)peer->buff_ptr - (pointer_addr_t)data_flowset; + uint8_t align = length & 0x3; + if ( align != 0 ) { + length += ( 4 - align ); + data_flowset->length = htons(length); + peer->buff_ptr += align; + } + // template refresh is needed + // terminate the current data flowset + data_flowset = NULL; + if ( (pointer_addr_t)peer->buff_ptr + template->flowset_length > (pointer_addr_t)peer->endp ) { + // not enough space for template flowset => flush buffer first + record_count = 0; + flowset_count = 0; + template_count = 0; + peer->flush = 1; + return 1; // return to flush buffer + } + memcpy(peer->buff_ptr, (void *)template->template_flowset, template->flowset_length); + peer->buff_ptr = (void *)((pointer_addr_t)peer->buff_ptr + template->flowset_length); + template->time_sent = now; + flowset_count++; + template_count++; + + // open a new data flow set at this point in the output buffer + data_flowset = (data_flowset_t *)peer->buff_ptr; + data_flowset->flowset_id = template->template_flowset->fields[0].template_id; + peer->buff_ptr = (void *)data_flowset->data; + flowset_count++; + } // else Add record + + } else { + // record with different template id + // terminate the current data flowset + uint16_t length = (pointer_addr_t)peer->buff_ptr - (pointer_addr_t)data_flowset; + uint8_t align = length & 0x3; + if ( align != 0 ) { + length += ( 4 - align ); + data_flowset->length = htons(length); + peer->buff_ptr += align; + } + data_flowset = NULL; + + last_flags = master_record->flags; + last_map = master_record->map_ref; + template = GetOutputTemplate(last_flags, master_record->map_ref); + if ( now - template->time_sent > MAX_LIFETIME ) { + // refresh template is needed + endwrite= (void *)((pointer_addr_t)peer->buff_ptr + template->flowset_length + sizeof(data_flowset_t)); + if ( endwrite > peer->endp ) { + // not enough space for template flowset => flush buffer first + record_count = 0; + flowset_count = 0; + template_count = 0; + peer->flush = 1; + return 1; // return to flush the buffer + } + memcpy(peer->buff_ptr, (void *)template->template_flowset, template->flowset_length); + peer->buff_ptr = (void *)((pointer_addr_t)peer->buff_ptr + template->flowset_length); + template->time_sent = now; + flowset_count++; + template_count++; + } + // open a new data flow set at this point in the output buffer + data_flowset = (data_flowset_t *)peer->buff_ptr; + data_flowset->flowset_id = template->template_flowset->fields[0].template_id; + peer->buff_ptr = (void *)data_flowset->data; + flowset_count++; + } + } else { + // output buffer does not contain a data flowset + peer->buff_ptr = (void *)((pointer_addr_t)v9_output_header + (pointer_addr_t)sizeof(netflow_v9_header_t)); + last_flags = master_record->flags; + last_map = master_record->map_ref; + template = GetOutputTemplate(last_flags, master_record->map_ref); + if ( now - template->time_sent > MAX_LIFETIME ) { + // refresh template + endwrite= (void *)((pointer_addr_t)peer->buff_ptr + template->flowset_length + sizeof(data_flowset_t)); + if ( endwrite > peer->endp ) { + // this must never happen! + fprintf(stderr, "Panic: Software error in %s line %d\n", __FILE__, __LINE__); + fprintf(stderr, "buffer %p, buff_ptr %p template length %x, endbuff %p\n", + peer->send_buffer, peer->buff_ptr, template->flowset_length + (uint32_t)sizeof(data_flowset_t), peer->endp ); + exit(255); + } + memcpy(peer->buff_ptr, (void *)template->template_flowset, template->flowset_length); + peer->buff_ptr = (void *)((pointer_addr_t)peer->buff_ptr + template->flowset_length); + template->time_sent = now; + flowset_count++; + template_count++; + } + // open a new data flow set at this point in the output buffer + data_flowset = (data_flowset_t *)peer->buff_ptr; + data_flowset->flowset_id = template->template_flowset->fields[0].template_id; + peer->buff_ptr = (void *)data_flowset->data; + flowset_count++; + } + // now add the record + + required_size = template->record_length; + + endwrite = (void *)((pointer_addr_t)peer->buff_ptr + required_size); + if ( endwrite > peer->endp ) { + uint16_t length = (pointer_addr_t)peer->buff_ptr - (pointer_addr_t)data_flowset; + + // flush the buffer + data_flowset->length = htons(length); + if ( length == 4 ) { // empty flowset + peer->buff_ptr = (void *)data_flowset; + } + data_flowset = NULL; + v9_output_header->count = htons(record_count+template_count); + record_count = 0; + template_count = 0; + flowset_count = 0; + peer->flush = 1; + return 1; // return to flush buffer + } + + // this was a long way up to here, now we can add the data + Append_Record(peer, master_record); + + data_flowset->length = htons((pointer_addr_t)peer->buff_ptr - (pointer_addr_t)data_flowset); + record_count++; + v9_output_header->count = htons(record_count+template_count); + + return 0; + +} // End of Add_v9_output_record + + +static void InsertSampler( FlowSource_t *fs, exporter_v9_domain_t *exporter, int32_t id, uint16_t mode, uint32_t interval) { +generic_sampler_t *sampler; + + dbg_printf("[%u] Insert Sampler: Exporter is 0x%llu\n", exporter->info.id, (long long unsigned)exporter); + if ( !exporter->sampler ) { + // no samplers so far + sampler = (generic_sampler_t *)malloc(sizeof(generic_sampler_t)); + if ( !sampler ) { + syslog(LOG_ERR, "Process_v9: Panic! malloc(): %s line %d: %s", __FILE__, __LINE__, strerror (errno)); + return; + } + + sampler->info.header.type = SamplerInfoRecordype; + sampler->info.header.size = sizeof(sampler_info_record_t); + sampler->info.exporter_sysid = exporter->info.sysid; + sampler->info.id = id; + sampler->info.mode = mode; + sampler->info.interval = interval; + sampler->next = NULL; + exporter->sampler = sampler; + + FlushInfoSampler(fs, &(sampler->info)); + syslog(LOG_INFO, "Add new sampler: ID: %i, mode: %u, interval: %u\n", + id, mode, interval); + dbg_printf("Add new sampler: ID: %i, mode: %u, interval: %u\n", + id, mode, interval); + + } else { + sampler = exporter->sampler; + while ( sampler ) { + // test for update of existing sampler + if ( sampler->info.id == id ) { + // found same sampler id - update record + syslog(LOG_INFO, "Update existing sampler id: %i, mode: %u, interval: %u\n", + id, mode, interval); + dbg_printf("Update existing sampler id: %i, mode: %u, interval: %u\n", + id, mode, interval); + + // we update only on changes + if ( mode != sampler->info.mode || interval != sampler->info.interval ) { + FlushInfoSampler(fs, &(sampler->info)); + sampler->info.mode = mode; + sampler->info.interval = interval; + } else { + dbg_printf("Sampler unchanged!\n"); + } + + break; + } + + // test for end of chain + if ( sampler->next == NULL ) { + // end of sampler chain - insert new sampler + sampler->next = (generic_sampler_t *)malloc(sizeof(generic_sampler_t)); + if ( !sampler->next ) { + syslog(LOG_ERR, "Process_v9: Panic! malloc(): %s line %d: %s", __FILE__, __LINE__, strerror (errno)); + return; + } + sampler = sampler->next; + + sampler->info.header.type = SamplerInfoRecordype; + sampler->info.header.size = sizeof(sampler_info_record_t); + sampler->info.exporter_sysid = exporter->info.sysid; + sampler->info.id = id; + sampler->info.mode = mode; + sampler->info.interval = interval; + sampler->next = NULL; + + FlushInfoSampler(fs, &(sampler->info)); + + + syslog(LOG_INFO, "Append new sampler: ID: %u, mode: %u, interval: %u\n", + id, mode, interval); + dbg_printf("Append new sampler: ID: %u, mode: %u, interval: %u\n", + id, mode, interval); + break; + } + + // advance + sampler = sampler->next; + } + + } + +} // End of InsertSampler + diff --git a/bin/netflow_v9.h b/bin/netflow_v9.h new file mode 100644 index 0000000..1bfd91a --- /dev/null +++ b/bin/netflow_v9.h @@ -0,0 +1,309 @@ +/* + * Copyright (c) 2014, Peter Haag + * Copyright (c) 2009, Peter Haag + * Copyright (c) 2004-2008, SWITCH - Teleinformatikdienste fuer Lehre und Forschung + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of the author nor the names of its contributors may be + * used to endorse or promote products derived from this software without + * specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 COPYRIGHT OWNER 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. + * + * $Author: haag $ + * + * $Id: netflow_v9.h 51 2010-01-29 09:01:54Z haag $ + * + * $LastChangedRevision: 51 $ + * + */ + +/* v9 structures */ + +/* Packet Header Field Descriptions + * + * Version + * Version of Flow Record format exported in this packet. The + * value of this field is 9 for the current version. + * + * Count + * The total number of records in the Export Packet, which is the + * sum of Options FlowSet records, Template FlowSet records, and + * Data FlowSet records. + * + * sysUpTime + * Time in milliseconds since this device was first booted. + * + * UNIX Secs + * Time in seconds since 0000 UTC 1970, at which the Export Packet + * leaves the Exporter. + * + * Sequence Number + * Incremental sequence counter of all Export Packets sent from + * the current Observation Domain by the Exporter. This value + * MUST be cumulative, and SHOULD be used by the Collector to + * identify whether any Export Packets have been missed. + * + * Source ID + * A 32-bit value that identifies the Exporter Observation Domain. + * NetFlow Collectors SHOULD use the combination of the source IP + * address and the Source ID field to separate different export + * streams originating from the same Exporter. + */ + +#ifndef _NETFLOW_V9_H +#define _NETFLOW_V9_H 1 + +typedef struct netflow_v9_header { + uint16_t version; + uint16_t count; + uint32_t SysUptime; + uint32_t unix_secs; + uint32_t sequence; + uint32_t source_id; +} netflow_v9_header_t; + +#define NETFLOW_V9_HEADER_LENGTH sizeof(netflow_v9_header_t) + +/* FlowSet ID + * FlowSet ID value of 0 is reserved for the Template FlowSet. + * Length + * Total length of this FlowSet. Because an individual Template + * FlowSet MAY contain multiple Template Records, the Length value + * MUST be used to determine the position of the next FlowSet + * record, which could be any type of FlowSet. Length is the sum + * of the lengths of the FlowSet ID, the Length itself, and all + * Template Records within this FlowSet. + * + * Template ID + * Each of the newly generated Template Records is given a unique + * Template ID. This uniqueness is local to the Observation + * Domain that generated the Template ID. Template IDs 0-255 are + * reserved for Template FlowSets, Options FlowSets, and other + * reserved FlowSets yet to be created. Template IDs of Data + * FlowSets are numbered from 256 to 65535. + * + * Field Count + * Number of fields in this Template Record. Because a Template + * FlowSet usually contains multiple Template Records, this field + * allows the Collector to determine the end of the current + * Template Record and the start of the next. + * + * Field Type + * A numeric value that represents the type of the field. Refer + * to the "Field Type Definitions" section. + * + * Field Length + * The length of the corresponding Field Type, in bytes. Refer to + * the "Field Type Definitions" section. + */ + +typedef struct template_record_s { + uint16_t template_id; + uint16_t count; + struct { + uint16_t type; + uint16_t length; + } record[1]; +} template_record_t; + +typedef struct template_flowset_s { + uint16_t flowset_id; + uint16_t length; + template_record_t fields[1]; +} template_flowset_t; + +typedef struct data_flowset_s { + uint16_t flowset_id; + uint16_t length; + uint8_t data[4]; +} data_flowset_t; + +typedef struct option_template_flowset_s { + uint16_t flowset_id; + uint16_t length; + uint16_t template_id; + uint16_t option_scope_length; + uint16_t option_length; + struct { + uint16_t type; + uint16_t length; + } record[1]; +} option_template_flowset_t; + +typedef struct common_header_s { + uint16_t flowset_id; + uint16_t length; +} common_header_t; + +#define _1byte 1 +#define _2bytes 2 +#define _3bytes 3 +#define _4bytes 4 +#define _6bytes 6 +#define _8bytes 8 +#define _12bytes 12 +#define _16bytes 16 +#define _20bytes 20 +#define _24bytes 24 +#define _65bytes 65 +#define _72bytes 72 + +#define NF9_TEMPLATE_FLOWSET_ID 0 +#define NF9_OPTIONS_FLOWSET_ID 1 +#define NF9_MIN_RECORD_FLOWSET_ID 256 + +// Flowset record types +#define NF9_IN_BYTES 1 +#define NF9_IN_PACKETS 2 +#define NF9_FLOWS_AGGR 3 +#define NF9_IN_PROTOCOL 4 +#define NF9_SRC_TOS 5 +#define NF9_TCP_FLAGS 6 +#define NF9_L4_SRC_PORT 7 +#define NF9_IPV4_SRC_ADDR 8 +#define NF9_SRC_MASK 9 +#define NF9_INPUT_SNMP 10 +#define NF9_L4_DST_PORT 11 +#define NF9_IPV4_DST_ADDR 12 +#define NF9_DST_MASK 13 +#define NF9_OUTPUT_SNMP 14 +#define NF9_V4_NEXT_HOP 15 +#define NF9_SRC_AS 16 +#define NF9_DST_AS 17 +#define NF9_BGP_V4_NEXT_HOP 18 + +#define NF9_LAST_SWITCHED 21 +#define NF9_FIRST_SWITCHED 22 +#define NF9_OUT_BYTES 23 +#define NF9_OUT_PKTS 24 + +#define NF9_IPV6_SRC_ADDR 27 +#define NF9_IPV6_DST_ADDR 28 +#define NF9_IPV6_SRC_MASK 29 +#define NF9_IPV6_DST_MASK 30 + +#define NF9_IPV6_FLOW_LABEL 31 +#define NF9_ICMP_TYPE 32 + +#define NF9_SAMPLING_INTERVAL 34 +#define NF9_SAMPLING_ALGORITHM 35 + +#define NF9_ENGINE_TYPE 38 +#define NF9_ENGINE_ID 39 + +#define NF9_FLOW_SAMPLER_ID 48 +#define FLOW_SAMPLER_MODE 49 +#define NF9_FLOW_SAMPLER_RANDOM_INTERVAL 50 + +// #define NF9_MIN_TTL 52 +// #define NF9_MAX_TTL 53 +// #define NF9_IPV4_IDENT 54 + +#define NF9_DST_TOS 55 +#define NF9_IN_SRC_MAC 56 +#define NF9_OUT_DST_MAC 57 +#define NF9_SRC_VLAN 58 +#define NF9_DST_VLAN 59 + +#define NF9_DIRECTION 61 +#define NF9_V6_NEXT_HOP 62 +#define NF9_BPG_V6_NEXT_HOP 63 +// #define NF9_V6_OPTION_HEADERS 64 + +#define NF9_MPLS_LABEL_1 70 +#define NF9_MPLS_LABEL_2 71 +#define NF9_MPLS_LABEL_3 72 +#define NF9_MPLS_LABEL_4 73 +#define NF9_MPLS_LABEL_5 74 +#define NF9_MPLS_LABEL_6 75 +#define NF9_MPLS_LABEL_7 76 +#define NF9_MPLS_LABEL_8 77 +#define NF9_MPLS_LABEL_9 78 +#define NF9_MPLS_LABEL_10 79 +#define NF9_IN_DST_MAC 80 +#define NF9_OUT_SRC_MAC 81 + + +#define NF9_FORWARDING_STATUS 89 + +#define NF9_BGP_ADJ_NEXT_AS 128 +#define NF9_BGP_ADJ_PREV_AS 129 + +// CISCO ASA NSEL extension - Network Security Event Logging +#define NF_F_FLOW_BYTES 85 +#define NF_F_CONN_ID 148 +#define NF_F_FLOW_CREATE_TIME_MSEC 152 +#define NF_F_FLOW_END_TIME_MSEC 153 +#define NF_F_ICMP_TYPE 176 +#define NF_F_ICMP_CODE 177 +#define NF_F_ICMP_TYPE_IPV6 178 +#define NF_F_ICMP_CODE_IPV6 179 +#define NF_F_FWD_FLOW_DELTA_BYTES 231 +#define NF_F_REV_FLOW_DELTA_BYTES 232 +#define NF_F_EVENT_TIME_MSEC 323 +#define NF_F_INGRESS_ACL_ID 33000 +#define NF_F_EGRESS_ACL_ID 33001 +#define NF_F_FW_EXT_EVENT 33002 +#define NF_F_USERNAME 40000 + +#define NF_F_XLATE_SRC_ADDR_IPV4 225 +#define NF_F_XLATE_DST_ADDR_IPV4 226 +#define NF_F_XLATE_SRC_PORT 227 +#define NF_F_XLATE_DST_PORT 228 +#define NF_F_XLATE_SRC_ADDR_IPV6 281 +#define NF_F_XLATE_DST_ADDR_IPV6 282 +#define NF_F_FW_EVENT 233 + +// ASA 8.4 compat elements +#define NF_F_XLATE_SRC_ADDR_84 40001 +#define NF_F_XLATE_DST_ADDR_84 40002 +#define NF_F_XLATE_SRC_PORT_84 40003 +#define NF_F_XLATE_DST_PORT_84 40004 +#define NF_F_FW_EVENT_84 40005 + +// Cisco ASR 1000 series NEL extension - Nat Event Logging +#define NF_N_NAT_EVENT 230 +#define NF_N_INGRESS_VRFID 234 +#define NF_N_EGRESS_VRFID 235 +#define NF_F_XLATE_PORT_BLOCK_START 361 +#define NF_F_XLATE_PORT_BLOCK_END 362 +#define NF_F_XLATE_PORT_BLOCK_STEP 363 +#define NF_F_XLATE_PORT_BLOCK_SIZE 364 + +// nprobe latency extensions +#define NF9_NPROBE_CLIENT_NW_DELAY_SEC 57554 +#define NF9_NPROBE_CLIENT_NW_DELAY_USEC 57555 +#define NF9_NPROBE_SERVER_NW_DELAY_SEC 57556 +#define NF9_NPROBE_SERVER_NW_DELAY_USEC 57557 +#define NF9_NPROBE_APPL_LATENCY_SEC 57558 +#define NF9_NPROBE_APPL_LATENCY_USEC 57559 + +/* prototypes */ +int Init_v9(void); + +void Process_v9(void *in_buff, ssize_t in_buff_cnt, FlowSource_t *fs); + +void Init_v9_output(send_peer_t *peer); + +int Add_v9_output_record(master_record_t *master_record, send_peer_t *peer); + +#endif //_NETFLOW_V9_H 1 diff --git a/bin/nf_common.c b/bin/nf_common.c new file mode 100644 index 0000000..1cc9c89 --- /dev/null +++ b/bin/nf_common.c @@ -0,0 +1,2887 @@ +/* + * Copyright (c) 2014, Peter Haag + * Copyright (c) 2009, Peter Haag + * Copyright (c) 2004-2008, SWITCH - Teleinformatikdienste fuer Lehre und Forschung + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of the author nor the names of its contributors may be + * used to endorse or promote products derived from this software without + * specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 COPYRIGHT OWNER 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. + * + * $Author: haag $ + * + * $Id: nf_common.c 69 2010-09-09 07:17:43Z haag $ + * + * $LastChangedRevision: 69 $ + * + */ + +#include "config.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#ifdef HAVE_STDINT_H +#include +#endif + +#include "nffile.h" +#include "nf_common.h" +#include "util.h" + +typedef void (*string_function_t)(master_record_t *, char *); + +static struct token_list_s { + string_function_t string_function; // function generation output string + char *string_buffer; // buffer for output string +} *token_list; + +static int max_token_index = 0; +static int token_index = 0; + +#define BLOCK_SIZE 32 + +static char **format_list; // ordered list of all individual strings formating the output line +static int max_format_index = 0; +static int format_index = 0; + +static int do_tag = 0; +static int long_v6 = 0; +static int scale = 1; +static double duration; + +#define STRINGSIZE 10240 +#define IP_STRING_LEN (INET6_ADDRSTRLEN) + +static char header_string[STRINGSIZE]; +static char data_string[STRINGSIZE]; + +// tag +static char tag_string[2]; + +/* prototypes */ +static inline void ICMP_Port_decode(master_record_t *r, char *string); + +static void InitFormatParser(void); + +static void AddToken(int index); + +static void AddString(char *string); + +static void String_FirstSeen(master_record_t *r, char *string); + +static void String_LastSeen(master_record_t *r, char *string); + +static void String_Received(master_record_t *r, char *string); + +static void String_Duration(master_record_t *r, char *string); + +static void String_Protocol(master_record_t *r, char *string); + +static void String_SrcAddr(master_record_t *r, char *string); + +static void String_DstAddr(master_record_t *r, char *string); + +static void String_SrcAddrPort(master_record_t *r, char *string); + +static void String_DstAddrPort(master_record_t *r, char *string); + +static void String_SrcNet(master_record_t *r, char *string); + +static void String_DstNet(master_record_t *r, char *string); + +static void String_NextHop(master_record_t *r, char *string); + +static void String_BGPNextHop(master_record_t *r, char *string); + +static void String_RouterIP(master_record_t *r, char *string); + +static void String_SrcPort(master_record_t *r, char *string); + +static void String_DstPort(master_record_t *r, char *string); + +static void String_ICMP_code(master_record_t *r, char *string); + +static void String_ICMP_type(master_record_t *r, char *string); + +static void String_SrcAS(master_record_t *r, char *string); + +static void String_DstAS(master_record_t *r, char *string); + +static void String_NextAS(master_record_t *r, char *string); + +static void String_PrevAS(master_record_t *r, char *string); + +static void String_Input(master_record_t *r, char *string); + +static void String_Output(master_record_t *r, char *string); + +static void String_InPackets(master_record_t *r, char *string); + +static void String_OutPackets(master_record_t *r, char *string); + +static void String_InBytes(master_record_t *r, char *string); + +static void String_OutBytes(master_record_t *r, char *string); + +static void String_Flows(master_record_t *r, char *string); + +static void String_Tos(master_record_t *r, char *string); + +static void String_Dir(master_record_t *r, char *string); + +static void String_SrcTos(master_record_t *r, char *string); + +static void String_DstTos(master_record_t *r, char *string); + +static void String_SrcMask(master_record_t *r, char *string); + +static void String_DstMask(master_record_t *r, char *string); + +static void String_SrcVlan(master_record_t *r, char *string); + +static void String_DstVlan(master_record_t *r, char *string); + +static void String_FwdStatus(master_record_t *r, char *string); + +static void String_Flags(master_record_t *r, char *string); + +static void String_InSrcMac(master_record_t *r, char *string); + +static void String_OutDstMac(master_record_t *r, char *string); + +static void String_InDstMac(master_record_t *r, char *string); + +static void String_OutSrcMac(master_record_t *r, char *string); + +static void String_MPLS_1(master_record_t *r, char *string); + +static void String_MPLS_2(master_record_t *r, char *string); + +static void String_MPLS_3(master_record_t *r, char *string); + +static void String_MPLS_4(master_record_t *r, char *string); + +static void String_MPLS_5(master_record_t *r, char *string); + +static void String_MPLS_6(master_record_t *r, char *string); + +static void String_MPLS_7(master_record_t *r, char *string); + +static void String_MPLS_8(master_record_t *r, char *string); + +static void String_MPLS_9(master_record_t *r, char *string); + +static void String_MPLS_10(master_record_t *r, char *string); + +static void String_MPLSs(master_record_t *r, char *string); + +static void String_Engine(master_record_t *r, char *string); + +static void String_ClientLatency(master_record_t *r, char *string); + +static void String_ServerLatency(master_record_t *r, char *string); + +static void String_AppLatency(master_record_t *r, char *string); + +static void String_bps(master_record_t *r, char *string); + +static void String_pps(master_record_t *r, char *string); + +static void String_bpp(master_record_t *r, char *string); + +static void String_ExpSysID(master_record_t *r, char *string); + +#ifdef NSEL +static void String_EventTime(master_record_t *r, char *string); + +static void String_nfc(master_record_t *r, char *string); + +static void String_evt(master_record_t *r, char *string); + +static void String_xevt(master_record_t *r, char *string); + +static void String_msec(master_record_t *r, char *string); + +static void String_iacl(master_record_t *r, char *string); + +static void String_eacl(master_record_t *r, char *string); + +static void String_xlateSrcAddr(master_record_t *r, char *string); + +static void String_xlateDstAddr(master_record_t *r, char *string); + +static void String_xlateSrcPort(master_record_t *r, char *string); + +static void String_xlateDstPort(master_record_t *r, char *string); + +static void String_xlateSrcAddrPort(master_record_t *r, char *string); + +static void String_xlateDstAddrPort(master_record_t *r, char *string); + +static void String_userName(master_record_t *r, char *string); + +static void String_ivrf(master_record_t *r, char *string); + +static void String_evrf(master_record_t *r, char *string); + +static void String_PortBlockStart(master_record_t *r, char *string); + +static void String_PortBlockEnd(master_record_t *r, char *string); + +static void String_PortBlockStep(master_record_t *r, char *string); + +static void String_PortBlockSize(master_record_t *r, char *string); + +#endif + +static struct format_token_list_s { + char *token; // token + int is_address; // is an IP address + char *header; // header line description + string_function_t string_function; // function generation output string +} format_token_list[] = { + { "%tfs", 0, "Date first seen ", String_FirstSeen }, // Start Time - first seen + { "%ts", 0, "Date first seen ", String_FirstSeen }, // Start Time - first seen + { "%te", 0, "Date last seen ", String_LastSeen }, // End Time - last seen + { "%tr", 0, "Date flow received ", String_Received }, // Received Time + { "%td", 0, " Duration", String_Duration }, // Duration + { "%exp", 0, "Exp ID", String_ExpSysID }, // Exporter SysID + { "%pr", 0, "Proto", String_Protocol }, // Protocol + { "%sa", 1, " Src IP Addr", String_SrcAddr }, // Source Address + { "%da", 1, " Dst IP Addr", String_DstAddr }, // Destination Address + { "%sn", 1, " Src Network", String_SrcNet }, // Source Address applied source netmask + { "%dn", 1, " Dst Network", String_DstNet }, // Destination Address applied source netmask + { "%nh", 1, " Next-hop IP", String_NextHop }, // Next-hop IP Address + { "%nhb", 1, " BGP next-hop IP", String_BGPNextHop }, // BGP Next-hop IP Address + { "%ra", 1, " Router IP", String_RouterIP }, // Router IP Address + { "%sap", 1, " Src IP Addr:Port ", String_SrcAddrPort }, // Source Address:Port + { "%dap", 1, " Dst IP Addr:Port ", String_DstAddrPort }, // Destination Address:Port + { "%sp", 0, "Src Pt", String_SrcPort }, // Source Port + { "%dp", 0, "Dst Pt", String_DstPort }, // Destination Port + { "%it", 0, "ICMP-T", String_ICMP_type }, // ICMP type + { "%ic", 0, "ICMP-C", String_ICMP_code }, // ICMP code + { "%sas", 0, "Src AS", String_SrcAS }, // Source AS + { "%das", 0, "Dst AS", String_DstAS }, // Destination AS + { "%nas", 0, "Next AS", String_NextAS }, // Next AS + { "%pas", 0, "Prev AS", String_PrevAS }, // Previous AS + { "%in", 0, " Input", String_Input }, // Input Interface num + { "%out", 0, "Output", String_Output }, // Output Interface num + { "%pkt", 0, " Packets", String_InPackets }, // Packets - default input - compat + { "%ipkt", 0, " In Pkt", String_InPackets }, // In Packets + { "%opkt", 0, " Out Pkt", String_OutPackets }, // Out Packets + { "%byt", 0, " Bytes", String_InBytes }, // Bytes - default input - compat + { "%ibyt", 0, " In Byte", String_InBytes }, // In Bytes + { "%obyt", 0, "Out Byte", String_OutBytes }, // In Bytes + { "%fl", 0, "Flows", String_Flows }, // Flows + { "%flg", 0, " Flags", String_Flags }, // TCP Flags + { "%tos", 0, "Tos", String_Tos }, // Tos - compat + { "%stos", 0, "STos", String_SrcTos }, // Tos - Src tos + { "%dtos", 0, "DTos", String_DstTos }, // Tos - Dst tos + { "%dir", 0, "Dir", String_Dir }, // Direction: ingress, egress + { "%smk", 0, "SMask", String_SrcMask }, // Src mask + { "%dmk", 0, "DMask", String_DstMask }, // Dst mask + { "%fwd", 0, "Fwd", String_FwdStatus }, // Forwarding Status + { "%svln", 0, "SVlan", String_SrcVlan }, // Src Vlan + { "%dvln", 0, "DVlan", String_DstVlan }, // Dst Vlan + { "%ismc", 0, " In src MAC Addr", String_InSrcMac }, // Input Src Mac Addr + { "%odmc", 0, " Out dst MAC Addr", String_OutDstMac }, // Output Dst Mac Addr + { "%idmc", 0, " In dst MAC Addr", String_InDstMac }, // Input Dst Mac Addr + { "%osmc", 0, " Out src MAC Addr", String_OutSrcMac }, // Output Src Mac Addr + { "%mpls1", 0, " MPLS lbl 1 ", String_MPLS_1 }, // MPLS Label 1 + { "%mpls2", 0, " MPLS lbl 2 ", String_MPLS_2 }, // MPLS Label 2 + { "%mpls3", 0, " MPLS lbl 3 ", String_MPLS_3 }, // MPLS Label 3 + { "%mpls4", 0, " MPLS lbl 4 ", String_MPLS_4 }, // MPLS Label 4 + { "%mpls5", 0, " MPLS lbl 5 ", String_MPLS_5 }, // MPLS Label 5 + { "%mpls6", 0, " MPLS lbl 6 ", String_MPLS_6 }, // MPLS Label 6 + { "%mpls7", 0, " MPLS lbl 7 ", String_MPLS_7 }, // MPLS Label 7 + { "%mpls8", 0, " MPLS lbl 8 ", String_MPLS_8 }, // MPLS Label 8 + { "%mpls9", 0, " MPLS lbl 9 ", String_MPLS_9 }, // MPLS Label 9 + { "%mpls10", 0, " MPLS lbl 10", String_MPLS_10 }, // MPLS Label 10 + { "%mpls", 0, " MPLS labels 1-10 ", String_MPLSs }, // All MPLS labels + // + { "%bps", 0, " bps", String_bps }, // bps - bits per second + { "%pps", 0, " pps", String_pps }, // pps - packets per second + { "%bpp", 0, " Bpp", String_bpp }, // bpp - Bytes per package + { "%eng", 0, " engine", String_Engine }, // Engine Type/ID + +#ifdef NSEL +// NSEL specifics + { "%nfc", 0, " Conn-ID", String_nfc }, // NSEL connection ID + { "%tevt", 0, "Event time ",String_EventTime }, // NSEL Flow start time + { "%evt", 0, " Event", String_evt }, // NSEL event + { "%xevt", 0, " XEvent", String_xevt }, // NSEL xevent + { "%msec", 0, " Event Time", String_msec}, // NSEL event time in msec + { "%iacl", 0, "Ingress ACL ", String_iacl}, // NSEL ingress ACL + { "%eacl", 0, "Egress ACL ", String_eacl}, // NSEL egress ACL + { "%xsa", 0, " X-late Src IP", String_xlateSrcAddr}, // NSEL XLATE src IP + { "%xda", 0, " X-late Dst IP", String_xlateDstAddr}, // NSEL XLATE dst IP + { "%xsp", 0, "XsPort", String_xlateSrcPort}, // NSEL XLATE src port + { "%xdp", 0, "XdPort", String_xlateDstPort}, // NSEL SLATE dst port + { "%xsap", 1, " X-Src IP Addr:Port ", String_xlateSrcAddrPort }, // Xlate Source Address:Port + { "%xdap", 1, " X-Dst IP Addr:Port ", String_xlateDstAddrPort }, // Xlate Destination Address:Port + { "%uname", 0, "UserName", String_userName}, // NSEL user name + +// NEL +// for v.1.6.10 compatibility, keep NEL specific addr/port format tokens + { "%nevt", 0, " Event", String_evt }, // NAT event + { "%vrf", 0, " I-VRF-ID", String_ivrf }, // NAT ivrf ID - compatible + { "%ivrf", 0, " I-VRF-ID", String_ivrf }, // NAT ivrf ID + { "%evrf", 0, " E-VRF-ID", String_evrf }, // NAT ivrf ID + { "%nsa", 0, " X-late Src IP", String_xlateSrcAddr}, // NAT XLATE src IP + { "%nda", 0, " X-late Dst IP", String_xlateDstAddr}, // NAT XLATE dst IP + { "%nsp", 0, "XsPort", String_xlateSrcPort}, // NAT XLATE src port + { "%ndp", 0, "XdPort", String_xlateDstPort}, // NAT SLATE dst port + { "%nsap", 1, " X-Src IP Addr:Port ", String_xlateSrcAddrPort },// NAT Xlate Source Address:Port + { "%ndap", 1, " X-Dst IP Addr:Port ", String_xlateDstAddrPort },// NAT Xlate Destination Address:Port + + // Port block allocation + { "%pbstart", 0, "Pb-Start", String_PortBlockStart}, // Port block start + { "%pbend", 0, "Pb-End", String_PortBlockEnd}, // Port block end + { "%pbstep", 0, "Pb-Step", String_PortBlockStep}, // Port block step + { "%pbsize", 0, "Pb-Size", String_PortBlockSize}, // Port block size +#endif + + // nprobe latency + { "%cl", 0, "C Latency", String_ClientLatency }, // client latency + { "%sl", 0, "S latency", String_ServerLatency }, // server latency + { "%al", 0, "A latency", String_AppLatency }, // app latency + + { NULL, 0, NULL, NULL } +}; + +/* each of the tokens above must not generate output strings larger than this */ +#define MAX_STRING_LENGTH 256 + +#define NumProtos 138 +#define MAX_PROTO_STR 8 +char protolist[NumProtos][MAX_PROTO_STR] = { + " 0", // 0 masked out - no protocol info - set to '0' + "ICMP ", // 1 Internet Control Message + "IGMP ", // 2 Internet Group Management + "GGP ", // 3 Gateway-to-Gateway + "IPIP ", // 4 IP in IP (encapsulation) + "ST ", // 5 Stream + "TCP ", // 6 Transmission Control + "CBT ", // 7 CBT + "EGP ", // 8 Exterior Gateway Protocol + "IGP ", // 9 any private interior gateway (used by Cisco for their IGRP) + "BBN ", // 10 BBN RCC Monitoring + "NVPII", // 11 Network Voice Protocol + "PUP ", // 12 PUP + "ARGUS", // 13 ARGUS + "ENCOM", // 14 EMCON + "XNET ", // 15 Cross Net Debugger + "CHAOS", // 16 Chaos + "UDP ", // 17 User Datagram + "MUX ", // 18 Multiplexing + "DCN ", // 19 DCN Measurement Subsystems + "HMP ", // 20 Host Monitoring + "PRM ", // 21 Packet Radio Measurement + "XNS ", // 22 XEROX NS IDP + "Trnk1", // 23 Trunk-1 + "Trnk2", // 24 Trunk-2 + "Leaf1", // 25 Leaf-1 + "Leaf2", // 26 Leaf-2 + "RDP ", // 27 Reliable Data Protocol + "IRTP ", // 28 Internet Reliable Transaction + "ISO-4", // 29 ISO Transport Protocol Class 4 + "NETBK", // 30 Bulk Data Transfer Protocol + "MFESP", // 31 MFE Network Services Protocol + "MEINP", // 32 MERIT Internodal Protocol + "DCCP ", // 33 Datagram Congestion Control Protocol + "3PC ", // 34 Third Party Connect Protocol + "IDPR ", // 35 Inter-Domain Policy Routing Protocol + "XTP ", // 36 XTP + "DDP ", // 37 Datagram Delivery Protocol + "IDPR ", // 38 IDPR Control Message Transport Proto + "TP++ ", // 39 TP++ Transport Protocol + "IL ", // 40 IL Transport Protocol + "IPv6 ", // 41 IPv6 + "SDRP ", // 42 Source Demand Routing Protocol + "Rte6 ", // 43 Routing Header for IPv6 + "Frag6", // 44 Fragment Header for IPv6 + "IDRP ", // 45 Inter-Domain Routing Protocol + "RSVP ", // 46 Reservation Protocol + "GRE ", // 47 General Routing Encapsulation + "MHRP ", // 48 Mobile Host Routing Protocol + "BNA ", // 49 BNA + "ESP ", // 50 Encap Security Payload + "AH ", // 51 Authentication Header + "INLSP", // 52 Integrated Net Layer Security TUBA + "SWIPE", // 53 IP with Encryption + "NARP ", // 54 NBMA Address Resolution Protocol + "MOBIL", // 55 IP Mobility + "TLSP ", // 56 Transport Layer Security Protocol + "SKIP ", // 57 SKIP + "ICMP6", // 58 ICMP for IPv6 + "NOHE6", // 59 No Next Header for IPv6 + "OPTS6", // 60 Destination Options for IPv6 + "HOST ", // 61 any host internal protocol + "CFTP ", // 62 CFTP + "NET ", // 63 any local network + "SATNT", // 64 SATNET and Backroom EXPAK + "KLAN ", // 65 Kryptolan + "RVD ", // 66 MIT Remote Virtual Disk Protocol + "IPPC ", // 67 Internet Pluribus Packet Core + "FS ", // 68 any distributed file system + "SATM ", // 69 SATNET Monitoring + "VISA ", // 70 VISA Protocol + "IPCV ", // 71 Internet Packet Core Utility + "CPNX ", // 72 Computer Protocol Network Executive + "CPHB ", // 73 Computer Protocol Heart Beat + "WSN ", // 74 Wang Span Network + "PVP ", // 75 Packet Video Protocol + "BSATM", // 76 Backroom SATNET Monitoring + "SUNND", // 77 SUN ND PROTOCOL-Temporary + "WBMON", // 78 WIDEBAND Monitoring + "WBEXP", // 79 WIDEBAND EXPAK + "ISOIP", // 80 ISO Internet Protocol + "VMTP ", // 81 VMTP + "SVMTP", // 82 SECURE-VMTP + "VINES", // 83 VINES + "TTP ", // 84 TTP + "NSIGP", // 85 NSFNET-IGP + "DGP ", // 86 Dissimilar Gateway Protocol + "TCP ", // 87 TCF + "EIGRP", // 88 EIGRP + "OSPF ", // 89 OSPFIGP + "S-RPC", // 90 Sprite RPC Protocol + "LARP ", // 91 Locus Address Resolution Protocol + "MTP ", // 92 Multicast Transport Protocol + "AX.25", // 93 AX.25 Frames + "IPIP ", // 94 IP-within-IP Encapsulation Protocol + "MICP ", // 95 Mobile Internetworking Control Protocol + "SCCSP", // 96 Semaphore Communications Sec. Protocol + "ETHIP", // 97 Ethernet-within-IP Encapsulation + "ENCAP", // 98 Encapsulation Header + "99 ", // 99 any private encryption scheme + "GMTP ", // 100 GMTP + "IFMP ", // 101 Ipsilon Flow Management Protocol + "PNNI ", // 102 PNNI over IP + "PIM ", // 103 Protocol Independent Multicast + "ARIS ", // 104 ARIS + "SCPS ", // 105 SCPS + "QNX ", // 106 QNX + "A/N ", // 107 Active Networks + "IPcmp", // 108 IP Payload Compression Protocol + "SNP ", // 109 Sitara Networks Protocol + "CpqPP", // 110 Compaq Peer Protocol + "IPXIP", // 111 IPX in IP + "VRRP ", // 112 Virtual Router Redundancy Protocol + "PGM ", // 113 PGM Reliable Transport Protocol + "0hop ", // 114 any 0-hop protocol + "L2TP ", // 115 Layer Two Tunneling Protocol + "DDX ", // 116 D-II Data Exchange (DDX) + "IATP ", // 117 Interactive Agent Transfer Protocol + "STP ", // 118 Schedule Transfer Protocol + "SRP ", // 119 SpectraLink Radio Protocol + "UTI ", // 120 UTI + "SMP ", // 121 Simple Message Protocol + "SM ", // 122 SM + "PTP ", // 123 Performance Transparency Protocol + "ISIS4", // 124 ISIS over IPv4 + "FIRE ", // 125 FIRE + "CRTP ", // 126 Combat Radio Transport Protocol + "CRUDP", // 127 Combat Radio User Datagram + "128 ", // 128 SSCOPMCE + "IPLT ", // 129 IPLP + "SPS ", // 130 Secure Packet Shield + "PIPE ", // 131 Private IP Encapsulation within IP + "SCTP ", // 132 Stream Control Transmission Protocol + "FC ", // 133 Fibre Channel + "134 ", // 134 RSVP-E2E-IGNORE + "MHEAD", // 135 Mobility Header + "UDP-L", // 136 UDPLite + "MPLS " // 137 MPLS-in-IP +}; + +static struct fwd_status_def_s { + uint32_t id; + char *name; +} fwd_status_def_list[] = { + { 0, "Ukwn"}, // Unknown + { 1, "Forw"}, // Normal forwarding + { 2, "Frag"}, // Fragmented + { 16, "Drop"}, // Drop + { 17, "DaclD"}, // Drop ACL deny + { 18, "Daclp"}, // Drop ACL drop + { 19, "Noroute"}, // Unroutable + { 20, "Dadj"}, // Drop Adjacency + { 21, "Dfrag"}, // Drop Fragmentation & DF set + { 22, "Dbadh"}, // Drop Bad header checksum + { 23, "Dbadtlen"}, // Drop Bad total Length + { 24, "Dbadhlen"}, // Drop Bad Header Length + { 25, "DbadTTL"}, // Drop bad TTL + { 26, "Dpolicy"}, // Drop Policer + { 27, "Dwred"}, // Drop WRED + { 28, "Drpf"}, // Drop RPF + { 29, "Dforus"}, // Drop For us + { 30, "DbadOf"}, // Drop Bad output interface + { 31, "Dhw"}, // Drop Hardware + { 128, "Term"}, // Terminate + { 129, "Tadj"}, // Terminate Punt Adjacency + { 130, "TincAdj"}, // Terminate Incomplete Adjacency + { 131, "Tforus"}, // Terminate For us + { 0, NULL} // Last entry +}; + +char *NSEL_event_string[6] = { + "IGNORE", "CREATE", "DELETE", "DENIED", "ALERT", "UPDATE" +}; + +char *NEL_event_string[3] = { + "INVALID", "ADD", "DELETE" +}; + +static char **fwd_status = NULL; + +#include "applybits_inline.c" + +/* functions */ + +int InitSymbols(void) { +int i; + + // already initialised? + if ( fwd_status ) + return 1; + + // fill fwd status cache table + fwd_status = ( char **)calloc(256, sizeof(char *)); + if ( !fwd_status ) { + fprintf(stderr, "Process_v9: Panic! malloc(): %s line %d: %s", __FILE__, __LINE__, strerror (errno)); + return 0; + } + i=0; + while ( fwd_status_def_list[i].name ) { + uint32_t j = fwd_status_def_list[i].id; + fwd_status[j] = fwd_status_def_list[i].name; + i++; + } + return 1; + +} // End of InitSymbols + +void Setv6Mode(int mode) { + long_v6 += mode; +} + +int Getv6Mode(void) { + return long_v6; +} + +void Proto_string(uint8_t protonum, char *protostr) { + + if ( protonum >= NumProtos || !scale ) { + snprintf(protostr,16,"%-5i", protonum ); + } else { + strncpy(protostr, protolist[protonum], 16); + } + +} // End of Proto_string + +int Proto_num(char *protostr) { +int i, len; + + if ( (len = strlen(protostr)) >= 6 ) + return -1; + + for ( i=0; iNumRecords, + h->size, + h->id); + *s = data_string; + +} // End of format_file_block_header + +void format_file_block_record(void *record, char ** s, int tag) { +char *_s, as[IP_STRING_LEN], ds[IP_STRING_LEN], datestr1[64], datestr2[64], datestr3[64], flags_str[16]; +char s_snet[IP_STRING_LEN], s_dnet[IP_STRING_LEN], s_proto[32]; +int i, id; +ssize_t slen, _slen; +time_t when; +struct tm *ts; +master_record_t *r = (master_record_t *)record; +extension_map_t *extension_map = r->map_ref; + + as[0] = 0; + ds[0] = 0; + if ( TestFlag(r->flags,FLAG_IPV6_ADDR ) != 0 ) { // IPv6 + uint64_t snet[2]; + uint64_t dnet[2]; + + // remember IPs for network + snet[0] = r->v6.srcaddr[0]; + snet[1] = r->v6.srcaddr[1]; + dnet[0] = r->v6.dstaddr[0]; + dnet[1] = r->v6.dstaddr[1]; + r->v6.srcaddr[0] = htonll(r->v6.srcaddr[0]); + r->v6.srcaddr[1] = htonll(r->v6.srcaddr[1]); + r->v6.dstaddr[0] = htonll(r->v6.dstaddr[0]); + r->v6.dstaddr[1] = htonll(r->v6.dstaddr[1]); + inet_ntop(AF_INET6, r->v6.srcaddr, as, sizeof(as)); + inet_ntop(AF_INET6, r->v6.dstaddr, ds, sizeof(ds)); + if ( ! long_v6 ) { + condense_v6(as); + condense_v6(ds); + } + if ( r->src_mask || r->dst_mask) { + if ( r->src_mask > 64 ) + snet[1] &= 0xffffffffffffffffLL << ( 128 - r->src_mask ); + else { + snet[1] &= 0xffffffffffffffffLL << ( 64 - r->src_mask ); + snet[1] = 0; + } + snet[0] = htonll(snet[0]); + snet[1] = htonll(snet[1]); + inet_ntop(AF_INET6, &snet, s_snet, sizeof(s_snet)); + + if ( r->dst_mask > 64 ) + dnet[1] &= 0xffffffffffffffffLL << ( 128 - r->dst_mask ); + else { + dnet[1] &= 0xffffffffffffffffLL << ( 64 - r->dst_mask ); + dnet[1] = 0; + } + dnet[0] = htonll(dnet[0]); + dnet[1] = htonll(dnet[1]); + inet_ntop(AF_INET6, &dnet, s_dnet, sizeof(s_dnet)); + if ( ! long_v6 ) { + condense_v6(s_snet); + condense_v6(s_dnet); + } + + } else { + s_snet[0] = '\0'; + s_dnet[0] = '\0'; + } + + } else { // IPv4 + uint32_t snet, dnet; + snet = r->v4.srcaddr; + dnet = r->v4.dstaddr; + r->v4.srcaddr = htonl(r->v4.srcaddr); + r->v4.dstaddr = htonl(r->v4.dstaddr); + inet_ntop(AF_INET, &r->v4.srcaddr, as, sizeof(as)); + inet_ntop(AF_INET, &r->v4.dstaddr, ds, sizeof(ds)); + if ( r->src_mask || r->dst_mask) { + snet &= 0xffffffffL << ( 32 - r->src_mask ); + snet = htonl(snet); + inet_ntop(AF_INET, &snet, s_snet, sizeof(s_snet)); + + dnet &= 0xffffffffL << ( 32 - r->dst_mask ); + dnet = htonl(dnet); + inet_ntop(AF_INET, &dnet, s_dnet, sizeof(s_dnet)); + } else { + s_snet[0] = '\0'; + s_dnet[0] = '\0'; + } + } + as[IP_STRING_LEN-1] = 0; + ds[IP_STRING_LEN-1] = 0; + + when = r->first; + ts = localtime(&when); + strftime(datestr1, 63, "%Y-%m-%d %H:%M:%S", ts); + + when = r->last; + ts = localtime(&when); + strftime(datestr2, 63, "%Y-%m-%d %H:%M:%S", ts); + + String_Flags(record, flags_str); + + _s = data_string; + slen = STRINGSIZE; + snprintf(_s, slen-1, "\n" +"Flow Record: \n" +" Flags = 0x%.2x %s, %s\n" +" export sysid = %5u\n" +" size = %5u\n" +" first = %10u [%s]\n" +" last = %10u [%s]\n" +" msec_first = %5u\n" +" msec_last = %5u\n" +" src addr = %16s\n" +" dst addr = %16s\n" +, + r->flags, TestFlag(r->flags, FLAG_EVENT) ? "EVENT" : "FLOW", + TestFlag(r->flags, FLAG_SAMPLED) ? "Sampled" : "Unsampled", r->exporter_sysid, r->size, r->first, + datestr1, r->last, datestr2, r->msec_first, r->msec_last, + as, ds ); + + _slen = strlen(data_string); + _s = data_string + _slen; + slen = STRINGSIZE - _slen; + + if ( r->prot == IPPROTO_ICMP || r->prot == IPPROTO_ICMPV6 ) { // ICMP + snprintf(_s, slen-1, +" ICMP = %2u.%-2u type.code\n", + r->icmp_type, r->icmp_code); + } else { + snprintf(_s, slen-1, +" src port = %5u\n" +" dst port = %5u\n", + r->srcport, r->dstport); + } + + _slen = strlen(data_string); + _s = data_string + _slen; + slen = STRINGSIZE - _slen; + + Proto_string(r->prot, s_proto); + + snprintf(_s, slen-1, +" fwd status = %3u\n" +" tcp flags = 0x%.2x %s\n" +" proto = %3u %s\n" +" (src)tos = %3u\n" +" (in)packets = %10llu\n" +" (in)bytes = %10llu\n", + r->fwd_status, r->tcp_flags, flags_str, r->prot, s_proto, r->tos, + (unsigned long long)r->dPkts, (unsigned long long)r->dOctets); + + _slen = strlen(data_string); + _s = data_string + _slen; + slen = STRINGSIZE - _slen; + + i = 0; + while ( (id = extension_map->ex_id[i]) != 0 ) { + if ( slen <= 20 ) { + fprintf(stderr, "String too short! Missing record data!\n"); + data_string[STRINGSIZE-1] = 0; + *s = data_string; + } + switch(id) { + case EX_IO_SNMP_2: + case EX_IO_SNMP_4: + snprintf(_s, slen-1, +" input = %5u\n" +" output = %5u\n" +, r->input, r->output); + _slen = strlen(data_string); + _s = data_string + _slen; + slen = STRINGSIZE - _slen; + break; + case EX_AS_2: + case EX_AS_4: + snprintf(_s, slen-1, +" src as = %5u\n" +" dst as = %5u\n" +, r->srcas, r->dstas); + _slen = strlen(data_string); + _s = data_string + _slen; + slen = STRINGSIZE - _slen; + break; + case EX_BGPADJ: + snprintf(_s, slen-1, +" next as = %5u\n" +" prev as = %5u\n" +, r->bgpNextAdjacentAS, r->bgpPrevAdjacentAS); + _slen = strlen(data_string); + _s = data_string + _slen; + slen = STRINGSIZE - _slen; + break; + case EX_MULIPLE: + snprintf(_s, slen-1, +" src mask = %5u %s/%u\n" +" dst mask = %5u %s/%u\n" +" dst tos = %3u\n" +" direction = %3u\n" +, r->src_mask, s_snet, r->src_mask, r->dst_mask, s_dnet, r->dst_mask, r->dst_tos, r->dir ); + _slen = strlen(data_string); + _s = data_string + _slen; + slen = STRINGSIZE - _slen; + break; + case EX_NEXT_HOP_v4: + as[0] = 0; + r->ip_nexthop.v4 = htonl(r->ip_nexthop.v4); + inet_ntop(AF_INET, &r->ip_nexthop.v4, as, sizeof(as)); + as[IP_STRING_LEN-1] = 0; + + snprintf(_s, slen-1, +" ip next hop = %16s\n" +, as); + _slen = strlen(data_string); + _s = data_string + _slen; + slen = STRINGSIZE - _slen; + + break; + case EX_NEXT_HOP_v6: + as[0] = 0; + r->ip_nexthop.v6[0] = htonll(r->ip_nexthop.v6[0]); + r->ip_nexthop.v6[1] = htonll(r->ip_nexthop.v6[1]); + inet_ntop(AF_INET6, r->ip_nexthop.v6, as, sizeof(as)); + if ( ! long_v6 ) { + condense_v6(as); + condense_v6(ds); + } + as[IP_STRING_LEN-1] = 0; + + snprintf(_s, slen-1, +" ip next hop = %16s\n" +, as); + _slen = strlen(data_string); + _s = data_string + _slen; + slen = STRINGSIZE - _slen; + break; + case EX_NEXT_HOP_BGP_v4: + as[0] = 0; + r->bgp_nexthop.v4 = htonl(r->bgp_nexthop.v4); + inet_ntop(AF_INET, &r->bgp_nexthop.v4, as, sizeof(as)); + as[IP_STRING_LEN-1] = 0; + + snprintf(_s, slen-1, +" bgp next hop = %16s\n" +, as); + _slen = strlen(data_string); + _s = data_string + _slen; + slen = STRINGSIZE - _slen; + + break; + case EX_NEXT_HOP_BGP_v6: + as[0] = 0; + r->bgp_nexthop.v6[0] = htonll(r->bgp_nexthop.v6[0]); + r->bgp_nexthop.v6[1] = htonll(r->bgp_nexthop.v6[1]); + inet_ntop(AF_INET6, r->ip_nexthop.v6, as, sizeof(as)); + if ( ! long_v6 ) { + condense_v6(as); + condense_v6(ds); + } + as[IP_STRING_LEN-1] = 0; + + snprintf(_s, slen-1, +" bgp next hop = %16s\n" +, as); + _slen = strlen(data_string); + _s = data_string + _slen; + slen = STRINGSIZE - _slen; + break; + case EX_VLAN: + snprintf(_s, slen-1, +" src vlan = %5u\n" +" dst vlan = %5u\n" +, r->src_vlan, r->dst_vlan); + _slen = strlen(data_string); + _s = data_string + _slen; + slen = STRINGSIZE - _slen; + break; + case EX_OUT_PKG_4: + case EX_OUT_PKG_8: + snprintf(_s, slen-1, +" out packets = %10llu\n" +, (long long unsigned)r->out_pkts); + _slen = strlen(data_string); + _s = data_string + _slen; + slen = STRINGSIZE - _slen; + break; + case EX_OUT_BYTES_4: + case EX_OUT_BYTES_8: + snprintf(_s, slen-1, +" out bytes = %10llu\n" +, (long long unsigned)r->out_bytes); + _slen = strlen(data_string); + _s = data_string + _slen; + slen = STRINGSIZE - _slen; + break; + case EX_AGGR_FLOWS_4: + case EX_AGGR_FLOWS_8: + snprintf(_s, slen-1, +" aggr flows = %10llu\n" +, (long long unsigned)r->aggr_flows); + _slen = strlen(data_string); + _s = data_string + _slen; + slen = STRINGSIZE - _slen; + break; + case EX_MAC_1: { + int i; + uint8_t mac1[6], mac2[6]; + + for ( i=0; i<6; i++ ) { + mac1[i] = (r->in_src_mac >> ( i*8 )) & 0xFF; + } + for ( i=0; i<6; i++ ) { + mac2[i] = (r->out_dst_mac >> ( i*8 )) & 0xFF; + } + + snprintf(_s, slen-1, +" in src mac = %.2x:%.2x:%.2x:%.2x:%.2x:%.2x\n" +" out dst mac = %.2x:%.2x:%.2x:%.2x:%.2x:%.2x\n" +, mac1[5], mac1[4], mac1[3], mac1[2], mac1[1], mac1[0], mac2[5], mac2[4], mac2[3], mac2[2], mac2[1], mac2[0] ); + _slen = strlen(data_string); + _s = data_string + _slen; + slen = STRINGSIZE - _slen; + } break; + case EX_MAC_2: { + int i; + uint8_t mac1[6], mac2[6]; + + for ( i=0; i<6; i++ ) { + mac1[i] = (r->in_dst_mac >> ( i*8 )) & 0xFF; + } + for ( i=0; i<6; i++ ) { + mac2[i] = (r->out_src_mac >> ( i*8 )) & 0xFF; + } + + snprintf(_s, slen-1, +" in dst mac = %.2x:%.2x:%.2x:%.2x:%.2x:%.2x\n" +" out src mac = %.2x:%.2x:%.2x:%.2x:%.2x:%.2x\n" +, mac1[5], mac1[4], mac1[3], mac1[2], mac1[1], mac1[0], mac2[5], mac2[4], mac2[3], mac2[2], mac2[1], mac2[0] ); + _slen = strlen(data_string); + _s = data_string + _slen; + slen = STRINGSIZE - _slen; + } break; + case EX_MPLS: { + unsigned int i; + for ( i=0; i<10; i++ ) { + snprintf(_s, slen-1, +" MPLS Lbl %2u = %8u-%1u-%1u\n", i+1 +, r->mpls_label[i] >> 4 , (r->mpls_label[i] & 0xF ) >> 1, r->mpls_label[i] & 1 ); + _slen = strlen(data_string); + _s = data_string + _slen; + slen = STRINGSIZE - _slen; + } + } break; + case EX_ROUTER_IP_v4: + as[0] = 0; + r->ip_router.v4 = htonl(r->ip_router.v4); + inet_ntop(AF_INET, &r->ip_router.v4, as, sizeof(as)); + as[IP_STRING_LEN-1] = 0; + + snprintf(_s, slen-1, +" ip router = %16s\n" +, as); + _slen = strlen(data_string); + _s = data_string + _slen; + slen = STRINGSIZE - _slen; + + break; + case EX_ROUTER_IP_v6: + as[0] = 0; + r->ip_router.v6[0] = htonll(r->ip_router.v6[0]); + r->ip_router.v6[1] = htonll(r->ip_router.v6[1]); + inet_ntop(AF_INET6, &r->ip_router.v6, as, sizeof(as)); + if ( ! long_v6 ) { + condense_v6(as); + } + as[IP_STRING_LEN-1] = 0; + + snprintf(_s, slen-1, +" ip router = %16s\n" +, as); + _slen = strlen(data_string); + _s = data_string + _slen; + slen = STRINGSIZE - _slen; + break; + case EX_LATENCY: { + double f1, f2, f3; + f1 = (double)r->client_nw_delay_usec / 1000.0; + f2 = (double)r->server_nw_delay_usec / 1000.0; + f3 = (double)r->appl_latency_usec / 1000.0; + + snprintf(_s, slen-1, +" cli latency = %9.3f ms\n" +" srv latency = %9.3f ms\n" +" app latency = %9.3f ms\n" +, f1, f2, f3); + + _slen = strlen(data_string); + _s = data_string + _slen; + slen = STRINGSIZE - _slen; + + } break; + case EX_ROUTER_ID: + snprintf(_s, slen-1, +" engine type = %5u\n" +" engine ID = %5u\n" +, r->engine_type, r->engine_id); + _slen = strlen(data_string); + _s = data_string + _slen; + slen = STRINGSIZE - _slen; + break; + case EX_RECEIVED: + when = r->received / 1000LL; + ts = localtime(&when); + strftime(datestr3, 63, "%Y-%m-%d %H:%M:%S", ts); + + snprintf(_s, slen-1, +" received at = %13llu [%s.%03llu]\n" +, (long long unsigned)r->received, datestr3, (long long unsigned)(r->received % 1000L)); + _slen = strlen(data_string); + _s = data_string + _slen; + slen = STRINGSIZE - _slen; + break; +#ifdef NSEL + case EX_NSEL_COMMON: { + char *event = "UNKNOWN"; + if ( r->event <= 5 ) { + event = NSEL_event_string[r->event]; + } + when = r->event_time / 1000LL; + ts = localtime(&when); + strftime(datestr3, 63, "%Y-%m-%d %H:%M:%S", ts); + snprintf(_s, slen-1, +" connect ID = %10u\n" +" fw event = %5u: %s\n" +" fw ext event = %5u\n" +" Event time = %13llu [%s.%03llu]\n" +, r->conn_id, r->event, event, r->fw_xevent +, (long long unsigned)r->event_time, datestr3, (long long unsigned)(r->event_time % 1000L)); + _slen = strlen(data_string); + _s = data_string + _slen; + slen = STRINGSIZE - _slen; + } break; + case EX_NEL_COMMON: { + char *event = "UNKNOWN"; + if ( r->event <= 2 ) { + event = NEL_event_string[r->event]; + } + snprintf(_s, slen-1, +" nat event = %5u: %s\n" +" ingress VRF = %10u\n" +" egress VRF = %10u\n" +, r->event, event, r->ingress_vrfid, r->egress_vrfid); + _slen = strlen(data_string); + _s = data_string + _slen; + slen = STRINGSIZE - _slen; + } break; + case EX_NSEL_XLATE_PORTS: { + snprintf(_s, slen-1, +" src xlt port = %5u\n" +" dst xlt port = %5u\n" +, r->xlate_src_port, r->xlate_dst_port ); + _slen = strlen(data_string); + _s = data_string + _slen; + slen = STRINGSIZE - _slen; + } break; + case EX_PORT_BLOCK_ALLOC: { + snprintf(_s, slen-1, +" pblock start = %5u\n" +" pblock end = %5u\n" +" pblock step = %5u\n" +" pblock size = %5u\n" +, r->block_start, r->block_end, r->block_step, r->block_size ); + _slen = strlen(data_string); + _s = data_string + _slen; + slen = STRINGSIZE - _slen; + } break; + case EX_NSEL_XLATE_IP_v4: + as[0] = 0; + ds[0] = 0; + r->xlate_src_ip.v4 = htonl(r->xlate_src_ip.v4); + r->xlate_dst_ip.v4 = htonl(r->xlate_dst_ip.v4); + inet_ntop(AF_INET, &r->xlate_src_ip.v4, as, sizeof(as)); + inet_ntop(AF_INET, &r->xlate_dst_ip.v4, ds, sizeof(ds)); + as[IP_STRING_LEN-1] = 0; + ds[IP_STRING_LEN-1] = 0; + + snprintf(_s, slen-1, +" src xlt ip = %16s\n" +" dst xlt ip = %16s\n" +, as, ds); + _slen = strlen(data_string); + _s = data_string + _slen; + slen = STRINGSIZE - _slen; + break; + case EX_NSEL_XLATE_IP_v6: + as[0] = 0; + ds[0] = 0; + r->xlate_src_ip.v6[0] = htonll(r->xlate_src_ip.v6[0]); + r->xlate_src_ip.v6[1] = htonll(r->xlate_src_ip.v6[1]); + r->xlate_dst_ip.v6[0] = htonll(r->xlate_dst_ip.v6[0]); + r->xlate_dst_ip.v6[1] = htonll(r->xlate_dst_ip.v6[1]); + inet_ntop(AF_INET6, &r->xlate_src_ip.v6, as, sizeof(as)); + inet_ntop(AF_INET6, &r->xlate_dst_ip.v6, ds, sizeof(ds)); + if ( ! long_v6 ) { + condense_v6(as); + condense_v6(ds); + } + as[IP_STRING_LEN-1] = 0; + ds[IP_STRING_LEN-1] = 0; + + snprintf(_s, slen-1, +" src xlate ip = %16s\n" +" dst xlate ip = %16s\n" +, as, ds); + _slen = strlen(data_string); + _s = data_string + _slen; + slen = STRINGSIZE - _slen; + break; + case EX_NSEL_ACL: + snprintf(_s, slen-1, +" Ingress ACL = 0x%x/0x%x/0x%x\n" +" Egress ACL = 0x%x/0x%x/0x%x\n" +, r->ingress_acl_id[0], r->ingress_acl_id[1], r->ingress_acl_id[2], + r->egress_acl_id[0], r->egress_acl_id[1], r->egress_acl_id[2]); + _slen = strlen(data_string); + _s = data_string + _slen; + slen = STRINGSIZE - _slen; + break; + case EX_NSEL_USER: + case EX_NSEL_USER_MAX: + snprintf(_s, slen-1, +" User name = %s\n" +, r->username[0] ? r->username : " "); + _slen = strlen(data_string); + _s = data_string + _slen; + slen = STRINGSIZE - _slen; + break; +#endif + default: + snprintf(_s, slen-1, "Type %u not implemented\n", id); + + } + i++; + } + + data_string[STRINGSIZE-1] = 0; + *s = data_string; + + +} // End of format_file_block_record + +void flow_record_to_pipe(void *record, char ** s, int tag) { +uint32_t sa[4], da[4]; +int af; +master_record_t *r = (master_record_t *)record; + + if ( (r->flags & FLAG_IPV6_ADDR ) != 0 ) { // IPv6 + af = PF_INET6; + } else { // IPv4 + af = PF_INET; + } + + // Make sure Endian does not screw us up + sa[0] = ( r->v6.srcaddr[0] >> 32 ) & 0xffffffffLL; + sa[1] = r->v6.srcaddr[0] & 0xffffffffLL; + sa[2] = ( r->v6.srcaddr[1] >> 32 ) & 0xffffffffLL; + sa[3] = r->v6.srcaddr[1] & 0xffffffffLL; + + da[0] = ( r->v6.dstaddr[0] >> 32 ) & 0xffffffffLL; + da[1] = r->v6.dstaddr[0] & 0xffffffffLL; + da[2] = ( r->v6.dstaddr[1] >> 32 ) & 0xffffffffLL; + da[3] = r->v6.dstaddr[1] & 0xffffffffLL; + + snprintf(data_string, STRINGSIZE-1 ,"%i|%u|%u|%u|%u|%u|%u|%u|%u|%u|%u|%u|%u|%u|%u|%u|%u|%u|%u|%u|%u|%u|%llu|%llu", + af, r->first, r->msec_first ,r->last, r->msec_last, r->prot, + sa[0], sa[1], sa[2], sa[3], r->srcport, da[0], da[1], da[2], da[3], r->dstport, + r->srcas, r->dstas, r->input, r->output, + r->tcp_flags, r->tos, (unsigned long long)r->dPkts, (unsigned long long)r->dOctets); + + data_string[STRINGSIZE-1] = 0; + + *s = data_string; + +} // End of flow_record_pipe + +void flow_record_to_csv(void *record, char ** s, int tag) { +char *_s, as[IP_STRING_LEN], ds[IP_STRING_LEN]; +char proto_str[MAX_PROTO_STR], datestr1[64], datestr2[64], datestr3[64], flags_str[16]; +char s_snet[IP_STRING_LEN], s_dnet[IP_STRING_LEN]; +ssize_t slen, _slen; +time_t when; +struct tm *ts; +master_record_t *r = (master_record_t *)record; + + as[0] = 0; + ds[0] = 0; + if ( (r->flags & FLAG_IPV6_ADDR ) != 0 ) { // IPv6 + uint64_t snet[2]; + uint64_t dnet[2]; + + // remember IPs for network + snet[0] = r->v6.srcaddr[0]; + snet[1] = r->v6.srcaddr[1]; + dnet[0] = r->v6.dstaddr[0]; + dnet[1] = r->v6.dstaddr[1]; + r->v6.srcaddr[0] = htonll(r->v6.srcaddr[0]); + r->v6.srcaddr[1] = htonll(r->v6.srcaddr[1]); + r->v6.dstaddr[0] = htonll(r->v6.dstaddr[0]); + r->v6.dstaddr[1] = htonll(r->v6.dstaddr[1]); + inet_ntop(AF_INET6, r->v6.srcaddr, as, sizeof(as)); + inet_ntop(AF_INET6, r->v6.dstaddr, ds, sizeof(ds)); + + if ( r->src_mask || r->dst_mask) { + if ( r->src_mask > 64 ) + snet[1] &= 0xffffffffffffffffLL << ( 128 - r->src_mask ); + else { + snet[1] &= 0xffffffffffffffffLL << ( 64 - r->src_mask ); + snet[1] = 0; + } + snet[0] = htonll(snet[0]); + snet[1] = htonll(snet[1]); + inet_ntop(AF_INET6, &snet, s_snet, sizeof(s_snet)); + + if ( r->dst_mask > 64 ) + dnet[1] &= 0xffffffffffffffffLL << ( 128 - r->dst_mask ); + else { + dnet[1] &= 0xffffffffffffffffLL << ( 64 - r->dst_mask ); + dnet[1] = 0; + } + dnet[0] = htonll(dnet[0]); + dnet[1] = htonll(dnet[1]); + inet_ntop(AF_INET6, &dnet, s_dnet, sizeof(s_dnet)); + + } else { + s_snet[0] = '\0'; + s_dnet[0] = '\0'; + } + + } else { // IPv4 + uint32_t snet, dnet; + snet = r->v4.srcaddr; + dnet = r->v4.dstaddr; + r->v4.srcaddr = htonl(r->v4.srcaddr); + r->v4.dstaddr = htonl(r->v4.dstaddr); + inet_ntop(AF_INET, &r->v4.srcaddr, as, sizeof(as)); + inet_ntop(AF_INET, &r->v4.dstaddr, ds, sizeof(ds)); + if ( r->src_mask || r->dst_mask) { + snet &= 0xffffffffL << ( 32 - r->src_mask ); + snet = htonl(snet); + inet_ntop(AF_INET, &snet, s_snet, sizeof(s_snet)); + + dnet &= 0xffffffffL << ( 32 - r->dst_mask ); + dnet = htonl(dnet); + inet_ntop(AF_INET, &dnet, s_dnet, sizeof(s_dnet)); + } else { + s_snet[0] = '\0'; + s_dnet[0] = '\0'; + } + } + as[IP_STRING_LEN-1] = 0; + ds[IP_STRING_LEN-1] = 0; + + when = r->first; + ts = localtime(&when); + strftime(datestr1, 63, "%Y-%m-%d %H:%M:%S", ts); + + when = r->last; + ts = localtime(&when); + strftime(datestr2, 63, "%Y-%m-%d %H:%M:%S", ts); + + duration = r->last - r->first; + duration += ((double)r->msec_last - (double)r->msec_first) / 1000.0; + + String_Flags(record, flags_str); + + if ( r->prot >= NumProtos ) { + snprintf(proto_str,MAX_PROTO_STR-1,"%u", r->prot ); + proto_str[MAX_PROTO_STR-1] = '\0'; + } else { + int i = 0;; + strncpy(proto_str, protolist[r->prot], MAX_PROTO_STR); + // remove white spaces for csv + while ( proto_str[i] ) { + if ( proto_str[i] == ' ' ) + proto_str[i] = '\0'; + i++; + } + } + + _s = data_string; + slen = STRINGSIZE; + snprintf(_s, slen-1, "%s,%s,%.3f,%s,%s,%u,%u,%s,%s,%u,%u,%llu,%llu,%llu,%llu", + datestr1, datestr2, duration, as,ds,r->srcport, r->dstport, proto_str, flags_str, + r->fwd_status, r->tos, (unsigned long long)r->dPkts, (unsigned long long)r->dOctets, + (long long unsigned)r->out_pkts, (long long unsigned)r->out_bytes + ); + + _slen = strlen(data_string); + _s += _slen; + slen -= _slen; + + // EX_IO_SNMP_2: + // EX_IO_SNMP_4: + snprintf(_s, slen-1, ",%u,%u" , r->input, r->output); + _slen = strlen(data_string); + _s = data_string + _slen; + slen = STRINGSIZE - _slen; + + // EX_AS_2: + // EX_AS_4: + snprintf(_s, slen-1, ",%u,%u", r->srcas, r->dstas); + _slen = strlen(data_string); + _s = data_string + _slen; + slen = STRINGSIZE - _slen; + + // EX_MULIPLE: + snprintf(_s, slen-1, ",%u,%u,%u,%u" , r->src_mask, r->dst_mask, r->dst_tos, r->dir ); + _slen = strlen(data_string); + _s = data_string + _slen; + slen = STRINGSIZE - _slen; + + if ( (r->flags & FLAG_IPV6_NH ) != 0 ) { // IPv6 + // EX_NEXT_HOP_v6: + as[0] = 0; + r->ip_nexthop.v6[0] = htonll(r->ip_nexthop.v6[0]); + r->ip_nexthop.v6[1] = htonll(r->ip_nexthop.v6[1]); + inet_ntop(AF_INET6, r->ip_nexthop.v6, as, sizeof(as)); + as[IP_STRING_LEN-1] = 0; + + snprintf(_s, slen-1, ",%s", as); + _slen = strlen(data_string); + _s = data_string + _slen; + slen = STRINGSIZE - _slen; + + } else { + // EX_NEXT_HOP_v4: + as[0] = 0; + r->ip_nexthop.v4 = htonl(r->ip_nexthop.v4); + inet_ntop(AF_INET, &r->ip_nexthop.v4, as, sizeof(as)); + as[IP_STRING_LEN-1] = 0; + + snprintf(_s, slen-1, ",%s", as); + _slen = strlen(data_string); + _s = data_string + _slen; + slen = STRINGSIZE - _slen; + } + + if ( (r->flags & FLAG_IPV6_NH ) != 0 ) { // IPv6 + // EX_NEXT_HOP_BGP_v6: + as[0] = 0; + r->bgp_nexthop.v6[0] = htonll(r->bgp_nexthop.v6[0]); + r->bgp_nexthop.v6[1] = htonll(r->bgp_nexthop.v6[1]); + inet_ntop(AF_INET6, r->ip_nexthop.v6, as, sizeof(as)); + as[IP_STRING_LEN-1] = 0; + + snprintf(_s, slen-1, ",%s", as); + _slen = strlen(data_string); + _s = data_string + _slen; + slen = STRINGSIZE - _slen; + + } else { + // EX_NEXT_HOP_BGP_v4: + as[0] = 0; + r->bgp_nexthop.v4 = htonl(r->bgp_nexthop.v4); + inet_ntop(AF_INET, &r->bgp_nexthop.v4, as, sizeof(as)); + as[IP_STRING_LEN-1] = 0; + + snprintf(_s, slen-1, ",%s", as); + _slen = strlen(data_string); + _s = data_string + _slen; + slen = STRINGSIZE - _slen; + + } + + // EX_VLAN: + snprintf(_s, slen-1, ",%u,%u", r->src_vlan, r->dst_vlan); + _slen = strlen(data_string); + _s = data_string + _slen; + slen = STRINGSIZE - _slen; + + + /* already in default output: + EX_OUT_PKG_4: + EX_OUT_PKG_8: + EX_OUT_BYTES_4: + EX_OUT_BYTES_8: + */ + + // case EX_MAC_1: + { + int i; + uint8_t mac1[6], mac2[6]; + + for ( i=0; i<6; i++ ) { + mac1[i] = (r->in_src_mac >> ( i*8 )) & 0xFF; + } + for ( i=0; i<6; i++ ) { + mac2[i] = (r->out_dst_mac >> ( i*8 )) & 0xFF; + } + + snprintf(_s, slen-1, ",%.2x:%.2x:%.2x:%.2x:%.2x:%.2x,%.2x:%.2x:%.2x:%.2x:%.2x:%.2x", + mac1[5], mac1[4], mac1[3], mac1[2], mac1[1], mac1[0], + mac2[5], mac2[4], mac2[3], mac2[2], mac2[1], mac2[0] ); + _slen = strlen(data_string); + _s = data_string + _slen; + slen = STRINGSIZE - _slen; + } + + // EX_MAC_2: + { + int i; + uint8_t mac1[6], mac2[6]; + + for ( i=0; i<6; i++ ) { + mac1[i] = (r->in_dst_mac >> ( i*8 )) & 0xFF; + } + for ( i=0; i<6; i++ ) { + mac2[i] = (r->out_src_mac >> ( i*8 )) & 0xFF; + } + + snprintf(_s, slen-1, ",%.2x:%.2x:%.2x:%.2x:%.2x:%.2x,%.2x:%.2x:%.2x:%.2x:%.2x:%.2x", + mac1[5], mac1[4], mac1[3], mac1[2], mac1[1], mac1[0], + mac2[5], mac2[4], mac2[3], mac2[2], mac2[1], mac2[0] ); + _slen = strlen(data_string); + _s = data_string + _slen; + slen = STRINGSIZE - _slen; + } + + // EX_MPLS: + { + unsigned int i; + for ( i=0; i<10; i++ ) { + snprintf(_s, slen-1, ",%u-%1u-%1u", + r->mpls_label[i] >> 4 , (r->mpls_label[i] & 0xF ) >> 1, r->mpls_label[i] & 1 ); + _slen = strlen(data_string); + _s = data_string + _slen; + slen = STRINGSIZE - _slen; + } + } + + { + double f1, f2, f3; + f1 = (double)r->client_nw_delay_usec / 1000.0; + f2 = (double)r->server_nw_delay_usec / 1000.0; + f3 = (double)r->appl_latency_usec / 1000.0; + + snprintf(_s, slen-1, +",%9.3f,%9.3f,%9.3f", f1, f2, f3); + + _slen = strlen(data_string); + _s = data_string + _slen; + slen = STRINGSIZE - _slen; + } + + + // EX_ROUTER_IP_v4: + if ( (r->flags & FLAG_IPV6_EXP ) != 0 ) { // IPv6 + // EX_NEXT_HOP_v6: + as[0] = 0; + r->ip_router.v6[0] = htonll(r->ip_router.v6[0]); + r->ip_router.v6[1] = htonll(r->ip_router.v6[1]); + inet_ntop(AF_INET6, r->ip_router.v6, as, sizeof(as)); + as[IP_STRING_LEN-1] = 0; + + snprintf(_s, slen-1, ",%s", as); + _slen = strlen(data_string); + _s = data_string + _slen; + slen = STRINGSIZE - _slen; + + } else { + // EX_NEXT_HOP_v4: + as[0] = 0; + r->ip_router.v4 = htonl(r->ip_router.v4); + inet_ntop(AF_INET, &r->ip_router.v4, as, sizeof(as)); + as[IP_STRING_LEN-1] = 0; + + snprintf(_s, slen-1, ",%s", as); + _slen = strlen(data_string); + _s = data_string + _slen; + slen = STRINGSIZE - _slen; + } + + // EX_ROUTER_ID + snprintf(_s, slen-1, ",%u/%u", r->engine_type, r->engine_id); + _slen = strlen(data_string); + _s = data_string + _slen; + slen = STRINGSIZE - _slen; + + // Exporter SysID + snprintf(_s, slen-1, ",%u", r->exporter_sysid); + _slen = strlen(data_string); + _s = data_string + _slen; + slen = STRINGSIZE - _slen; + + // Date flow received + when = r->received / 1000LL; + ts = localtime(&when); + strftime(datestr3, 63, ",%Y-%m-%d %H:%M:%S", ts); + + snprintf(_s, slen-1, "%s.%03llu", datestr3, (long long unsigned)r->received % 1000LL); + _slen = strlen(data_string); + _s = data_string + _slen; + slen = STRINGSIZE - _slen; + + // snprintf(_s, slen-1, "\n"); + data_string[STRINGSIZE-1] = 0; + *s = data_string; + + +} // End of flow_record_to_csv + +void flow_record_to_null(void *record, char ** s, int tag) { + // empty - do not list any flows +} // End of flow_record_to_null + +void format_special(void *record, char ** s, int tag) { +master_record_t *r = (master_record_t *)record; +int i, index; + + do_tag = tag; + tag_string[0] = do_tag ? TAG_CHAR : '\0'; + tag_string[1] = '\0'; + + duration = r->last - r->first; + duration += ((double)r->msec_last - (double)r->msec_first) / 1000.0; + for ( i=0; i= max_token_index ) { // no slot available - expand table + max_token_index += BLOCK_SIZE; + token_list = (struct token_list_s *)realloc(token_list, max_token_index * sizeof(struct token_list_s)); + if ( !token_list ) { + fprintf(stderr, "Memory allocation error in %s line %d: %s\n", __FILE__, __LINE__, strerror(errno) ); + exit(255); + } + } + token_list[token_index].string_function = format_token_list[index].string_function; + token_list[token_index].string_buffer = malloc(MAX_STRING_LENGTH); + if ( !token_list[token_index].string_buffer ) { + fprintf(stderr, "Memory allocation error in %s line %d: %s\n", __FILE__, __LINE__, strerror(errno) ); + exit(255); + } + + AddString(token_list[token_index].string_buffer); + token_index++; + +} // End of AddToken + +/* Add either a static string or the memory for a variable string from a token to the list */ +static void AddString(char *string) { + + if ( !string ) { + fprintf(stderr, "Panic! NULL string in %s line %d: %s\n", __FILE__, __LINE__, strerror(errno) ); + exit(255); + } + + if ( format_index >= max_format_index ) { // no slot available - expand table + max_format_index += BLOCK_SIZE; + format_list = (char **)realloc(format_list, max_format_index * sizeof(char *)); + if ( !format_list ) { + fprintf(stderr, "Memory allocation error in %s line %d: %s\n", __FILE__, __LINE__, strerror(errno) ); + exit(255); + } + } + format_list[format_index++] = string; + +} // End of AddString + +static char* RecursiveReplace(char *format, printmap_t *printmap) { +int i = 0; + + while ( printmap[i].printmode ) { + char *s, *r; + // check for printmode string + s = strstr(format, printmap[i].printmode); + if ( s && printmap[i].Format && s != format ) { + int len = strlen(printmap[i].printmode); + if ( !isalpha((int)s[len]) ) { + s--; + if ( s[0] == '%' ) { + int newlen = strlen(format) + strlen(printmap[i].Format); + r = malloc(newlen); + if ( !r ) { + LogError("malloc() allocation error in %s line %d: %s\n", __FILE__, __LINE__, strerror(errno) ); + exit(255); + } + s[0] = '\0'; + snprintf(r, newlen, "%s%s%s", format, printmap[i].Format, &(s[len+1]) ); + r[newlen-1] = '\0'; + free(format); + format = r; + } + } + } + i++; + } + + return format; + +} // End of RecursiveReplace + +int ParseOutputFormat(char *format, int plain_numbers, printmap_t *printmap) { +char *c, *s, *h; +int i, remaining; + + scale = plain_numbers == 0; + + InitFormatParser(); + + s = strdup(format); + if ( !s ) { + fprintf(stderr, "Memory allocation error in %s line %d: %s\n", __FILE__, __LINE__, strerror(errno) ); + exit(255); + } + s = RecursiveReplace(s, printmap); + c = s; + + h = header_string; + *h = '\0'; + while ( *c ) { + if ( *c == '%' ) { // it's a token from format_token_list + i = 0; + remaining = strlen(c); + while ( format_token_list[i].token ) { // sweep through the list + int len = strlen(format_token_list[i].token); + + // a token is separated by either a space, another token, or end of string + if ( remaining >= len && !isalpha((int)c[len]) ) { + // separator found a expected position + char p = c[len]; // save separator; + c[len] = '\0'; + if ( strncmp(format_token_list[i].token, c, len) == 0 ) { // token found + AddToken(i); + if ( long_v6 && format_token_list[i].is_address ) + snprintf(h, STRINGSIZE-1-strlen(h), "%23s%s", "", format_token_list[i].header); + else + snprintf(h, STRINGSIZE-1-strlen(h), "%s", format_token_list[i].header); + h += strlen(h); + c[len] = p; + c += len; + break; + } else { + c[len] = p; + } + } + i++; + } + if ( format_token_list[i].token == NULL ) { + fprintf(stderr, "Output format parse error at: %s\n", c); + free(s); + return 0; + } + } else { // it's a static string + /* a static string goes up to next '%' or end of string */ + char *p = strchr(c, '%'); + char format[16]; + if ( p ) { + // p points to next '%' token + *p = '\0'; + AddString(strdup(c)); + snprintf(format, 15, "%%%zus", strlen(c)); + format[15] = '\0'; + snprintf(h, STRINGSIZE-1-strlen(h), format, ""); + h += strlen(h); + *p = '%'; + c = p; + } else { + // static string up to end of format string + AddString(strdup(c)); + snprintf(format, 15, "%%%zus", strlen(c)); + format[15] = '\0'; + snprintf(h, STRINGSIZE-1-strlen(h), format, ""); + h += strlen(h); + *c = '\0'; + } + } + } + + free(s); + return 1; + +} // End of ParseOutputFormat + +void condense_v6(char *s) { +size_t len = strlen(s); +char *p, *q; + + if ( len <= 16 ) + return; + + // orig: 2001:620:1000:cafe:20e:35ff:fec0:fed5 len = 37 + // condensed: 2001:62..e0:fed5 + p = s + 7; + *p++ = '.'; + *p++ = '.'; + q = s + len - 7; + while ( *q ) { + *p++ = *q++; + } + *p = 0; + +} // End of condense_v6 + +static inline void ICMP_Port_decode(master_record_t *r, char *string) { + + if ( r->prot == IPPROTO_ICMP || r->prot == IPPROTO_ICMPV6 ) { // ICMP + snprintf(string, MAX_STRING_LENGTH-1, "%u.%u", r->icmp_type, r->icmp_code); + } else { // dst port + snprintf(string, MAX_STRING_LENGTH-1, "%u", r->dstport); + } + string[MAX_STRING_LENGTH-1] = '\0'; + +} // End of ICMP_Port_decode + +/* functions, which create the individual strings for the output line */ +static void String_FirstSeen(master_record_t *r, char *string) { +time_t tt; +struct tm * ts; +char *s; + + tt = r->first; + ts = localtime(&tt); + strftime(string, MAX_STRING_LENGTH-1, "%Y-%m-%d %H:%M:%S", ts); + s = string + strlen(string); + snprintf(s, MAX_STRING_LENGTH-strlen(string)-1,".%03u", r->msec_first); + string[MAX_STRING_LENGTH-1] = '\0'; + +} // End of String_FirstSeen + +static void String_LastSeen(master_record_t *r, char *string) { +time_t tt; +struct tm * ts; +char *s; + + tt = r->last; + ts = localtime(&tt); + strftime(string, MAX_STRING_LENGTH-1, "%Y-%m-%d %H:%M:%S", ts); + s = string + strlen(string); + snprintf(s, MAX_STRING_LENGTH-strlen(string)-1,".%03u", r->msec_last); + string[MAX_STRING_LENGTH-1] = '\0'; + +} // End of String_LastSeen + +static void String_Received(master_record_t *r, char *string) { +time_t tt; +struct tm * ts; +char *s; + + tt = r->received / 1000LL; + ts = localtime(&tt); + strftime(string, MAX_STRING_LENGTH-1, "%Y-%m-%d %H:%M:%S", ts); + s = string + strlen(string); + snprintf(s, MAX_STRING_LENGTH-strlen(string)-1,".%03llu", r->received % 1000LL); + string[MAX_STRING_LENGTH-1] = '\0'; + +} // End of String_Received + +#ifdef NSEL +static void String_EventTime(master_record_t *r, char *string) { +time_t tt; +struct tm * ts; +char *s; + + tt = r->event_time / 1000LL; + ts = localtime(&tt); + strftime(string, MAX_STRING_LENGTH-1, "%Y-%m-%d %H:%M:%S", ts); + s = string + strlen(string); + snprintf(s, MAX_STRING_LENGTH-strlen(string)-1,".%03llu", r->event_time % 1000LL); + string[MAX_STRING_LENGTH-1] = '\0'; + +} // End of String_EventTime +#endif + +static void String_Duration(master_record_t *r, char *string) { + + snprintf(string, MAX_STRING_LENGTH-1 ,"%9.3f", duration); + string[MAX_STRING_LENGTH-1] = '\0'; + +} // End of String_Duration + +static void String_Protocol(master_record_t *r, char *string) { +char s[16]; + + Proto_string(r->prot, s); + snprintf(string, MAX_STRING_LENGTH-1 ,"%s", s); + string[MAX_STRING_LENGTH-1] = '\0'; + +} // End of String_Protocol + +static void String_SrcAddr(master_record_t *r, char *string) { +char tmp_str[IP_STRING_LEN]; + + tmp_str[0] = 0; + if ( (r->flags & FLAG_IPV6_ADDR ) != 0 ) { // IPv6 + uint64_t ip[2]; + + ip[0] = htonll(r->v6.srcaddr[0]); + ip[1] = htonll(r->v6.srcaddr[1]); + inet_ntop(AF_INET6, ip, tmp_str, sizeof(tmp_str)); + if ( ! long_v6 ) { + condense_v6(tmp_str); + } + } else { // IPv4 + uint32_t ip; + ip = htonl(r->v4.srcaddr); + inet_ntop(AF_INET, &ip, tmp_str, sizeof(tmp_str)); + } + tmp_str[IP_STRING_LEN-1] = 0; + if ( long_v6 ) + snprintf(string, MAX_STRING_LENGTH-1, "%s%39s", tag_string, tmp_str); + else + snprintf(string, MAX_STRING_LENGTH-1, "%s%16s", tag_string, tmp_str); + + string[MAX_STRING_LENGTH-1] = 0; + + +} // End of String_SrcAddr + +static void String_SrcAddrPort(master_record_t *r, char *string) { +char tmp_str[IP_STRING_LEN], portchar; + + tmp_str[0] = 0; + if ( (r->flags & FLAG_IPV6_ADDR ) != 0 ) { // IPv6 + uint64_t ip[2]; + + ip[0] = htonll(r->v6.srcaddr[0]); + ip[1] = htonll(r->v6.srcaddr[1]); + inet_ntop(AF_INET6, ip, tmp_str, sizeof(tmp_str)); + if ( ! long_v6 ) { + condense_v6(tmp_str); + } + portchar = '.'; + } else { // IPv4 + uint32_t ip; + ip = htonl(r->v4.srcaddr); + inet_ntop(AF_INET, &ip, tmp_str, sizeof(tmp_str)); + portchar = ':'; + } + tmp_str[IP_STRING_LEN-1] = 0; + + if ( long_v6 ) + snprintf(string, MAX_STRING_LENGTH-1, "%s%39s%c%-5i", tag_string, tmp_str, portchar, r->srcport); + else + snprintf(string, MAX_STRING_LENGTH-1, "%s%16s%c%-5i", tag_string, tmp_str, portchar, r->srcport); + + string[MAX_STRING_LENGTH-1] = 0; + +} // End of String_SrcAddrPort + +static void String_DstAddr(master_record_t *r, char *string) { +char tmp_str[IP_STRING_LEN]; + + tmp_str[0] = 0; + if ( (r->flags & FLAG_IPV6_ADDR ) != 0 ) { // IPv6 + uint64_t ip[2]; + + ip[0] = htonll(r->v6.dstaddr[0]); + ip[1] = htonll(r->v6.dstaddr[1]); + inet_ntop(AF_INET6, ip, tmp_str, sizeof(tmp_str)); + if ( ! long_v6 ) { + condense_v6(tmp_str); + } + } else { // IPv4 + uint32_t ip; + ip = htonl(r->v4.dstaddr); + inet_ntop(AF_INET, &ip, tmp_str, sizeof(tmp_str)); + } + tmp_str[IP_STRING_LEN-1] = 0; + if ( long_v6 ) + snprintf(string, MAX_STRING_LENGTH-1, "%s%39s", tag_string, tmp_str); + else + snprintf(string, MAX_STRING_LENGTH-1, "%s%16s", tag_string, tmp_str); + + string[MAX_STRING_LENGTH-1] = 0; + + +} // End of String_DstAddr + + +static void String_NextHop(master_record_t *r, char *string) { +char tmp_str[IP_STRING_LEN]; + + tmp_str[0] = 0; + if ( (r->flags & FLAG_IPV6_NH ) != 0 ) { // IPv6 + uint64_t ip[2]; + + ip[0] = htonll(r->ip_nexthop.v6[0]); + ip[1] = htonll(r->ip_nexthop.v6[1]); + inet_ntop(AF_INET6, ip, tmp_str, sizeof(tmp_str)); + if ( ! long_v6 ) { + condense_v6(tmp_str); + } + } else { // IPv4 + uint32_t ip; + ip = htonl(r->ip_nexthop.v4); + inet_ntop(AF_INET, &ip, tmp_str, sizeof(tmp_str)); + } + tmp_str[IP_STRING_LEN-1] = 0; + if ( long_v6 ) + snprintf(string, MAX_STRING_LENGTH-1, "%s%39s", tag_string, tmp_str); + else + snprintf(string, MAX_STRING_LENGTH-1, "%s%16s", tag_string, tmp_str); + + string[MAX_STRING_LENGTH-1] = 0; + + +} // End of String_NextHop + +static void String_BGPNextHop(master_record_t *r, char *string) { +char tmp_str[IP_STRING_LEN]; + + tmp_str[0] = 0; + if ( (r->flags & FLAG_IPV6_NH ) != 0 ) { // IPv6 + uint64_t ip[2]; + + ip[0] = htonll(r->bgp_nexthop.v6[0]); + ip[1] = htonll(r->bgp_nexthop.v6[1]); + inet_ntop(AF_INET6, ip, tmp_str, sizeof(tmp_str)); + if ( ! long_v6 ) { + condense_v6(tmp_str); + } + } else { // IPv4 + uint32_t ip; + ip = htonl(r->bgp_nexthop.v4); + inet_ntop(AF_INET, &ip, tmp_str, sizeof(tmp_str)); + } + tmp_str[IP_STRING_LEN-1] = 0; + if ( long_v6 ) + snprintf(string, MAX_STRING_LENGTH-1, "%s%39s", tag_string, tmp_str); + else + snprintf(string, MAX_STRING_LENGTH-1, "%s%16s", tag_string, tmp_str); + + string[MAX_STRING_LENGTH-1] = 0; + + +} // End of String_NextHop + +static void String_RouterIP(master_record_t *r, char *string) { +char tmp_str[IP_STRING_LEN]; + + tmp_str[0] = 0; + if ( (r->flags & FLAG_IPV6_EXP ) != 0 ) { // IPv6 + uint64_t ip[2]; + + ip[0] = htonll(r->ip_router.v6[0]); + ip[1] = htonll(r->ip_router.v6[1]); + inet_ntop(AF_INET6, ip, tmp_str, sizeof(tmp_str)); + if ( ! long_v6 ) { + condense_v6(tmp_str); + } + } else { // IPv4 + uint32_t ip; + ip = htonl(r->ip_router.v4); + inet_ntop(AF_INET, &ip, tmp_str, sizeof(tmp_str)); + } + tmp_str[IP_STRING_LEN-1] = 0; + if ( long_v6 ) + snprintf(string, MAX_STRING_LENGTH-1, "%s%39s", tag_string, tmp_str); + else + snprintf(string, MAX_STRING_LENGTH-1, "%s%16s", tag_string, tmp_str); + + string[MAX_STRING_LENGTH-1] = 0; + + +} // End of String_RouterIP + + +static void String_DstAddrPort(master_record_t *r, char *string) { +char tmp_str[IP_STRING_LEN], portchar; +char icmp_port[MAX_STRING_LENGTH]; + + tmp_str[0] = 0; + if ( (r->flags & FLAG_IPV6_ADDR ) != 0 ) { // IPv6 + uint64_t ip[2]; + + ip[0] = htonll(r->v6.dstaddr[0]); + ip[1] = htonll(r->v6.dstaddr[1]); + inet_ntop(AF_INET6, ip, tmp_str, sizeof(tmp_str)); + if ( ! long_v6 ) { + condense_v6(tmp_str); + } + portchar = '.'; + } else { // IPv4 + uint32_t ip; + ip = htonl(r->v4.dstaddr); + inet_ntop(AF_INET, &ip, tmp_str, sizeof(tmp_str)); + portchar = ':'; + } + tmp_str[IP_STRING_LEN-1] = 0; + ICMP_Port_decode(r, icmp_port); + + if ( long_v6 ) + snprintf(string, MAX_STRING_LENGTH-1, "%s%39s%c%-5s", tag_string, tmp_str, portchar, icmp_port); + else + snprintf(string, MAX_STRING_LENGTH-1, "%s%16s%c%-5s", tag_string, tmp_str, portchar, icmp_port); + + string[MAX_STRING_LENGTH-1] = 0; + +} // End of String_DstAddrPort + +static void String_SrcNet(master_record_t *r, char *string) { +char tmp_str[IP_STRING_LEN]; + + ApplyNetMaskBits(r, 1); + + tmp_str[0] = 0; + if ( (r->flags & FLAG_IPV6_ADDR ) != 0 ) { // IPv6 + uint64_t ip[2]; + + ip[0] = htonll(r->v6.srcaddr[0]); + ip[1] = htonll(r->v6.srcaddr[1]); + inet_ntop(AF_INET6, ip, tmp_str, sizeof(tmp_str)); + if ( ! long_v6 ) { + condense_v6(tmp_str); + } + } else { // IPv4 + uint32_t ip; + ip = htonl(r->v4.srcaddr); + inet_ntop(AF_INET, &ip, tmp_str, sizeof(tmp_str)); + } + tmp_str[IP_STRING_LEN-1] = 0; + if ( long_v6 ) + snprintf(string, MAX_STRING_LENGTH-1, "%s%39s/%-2u", tag_string, tmp_str, r->src_mask ); + else + snprintf(string, MAX_STRING_LENGTH-1, "%s%16s/%-2u", tag_string, tmp_str, r->src_mask ); + + string[MAX_STRING_LENGTH-1] = 0; + + +} // End of String_SrcNet + +static void String_DstNet(master_record_t *r, char *string) { +char tmp_str[IP_STRING_LEN]; + + ApplyNetMaskBits(r, 2); + + tmp_str[0] = 0; + if ( (r->flags & FLAG_IPV6_ADDR ) != 0 ) { // IPv6 + uint64_t ip[2]; + + ip[0] = htonll(r->v6.dstaddr[0]); + ip[1] = htonll(r->v6.dstaddr[1]); + inet_ntop(AF_INET6, ip, tmp_str, sizeof(tmp_str)); + if ( ! long_v6 ) { + condense_v6(tmp_str); + } + } else { // IPv4 + uint32_t ip; + ip = htonl(r->v4.dstaddr); + inet_ntop(AF_INET, &ip, tmp_str, sizeof(tmp_str)); + } + tmp_str[IP_STRING_LEN-1] = 0; + if ( long_v6 ) + snprintf(string, MAX_STRING_LENGTH-1, "%s%39s/%-2u", tag_string, tmp_str, r->dst_mask ); + else + snprintf(string, MAX_STRING_LENGTH-1, "%s%16s/%-2u", tag_string, tmp_str, r->dst_mask ); + + string[MAX_STRING_LENGTH-1] = 0; + + +} // End of String_DstNet + +static void String_SrcPort(master_record_t *r, char *string) { + + snprintf(string, MAX_STRING_LENGTH-1 ,"%6u", r->srcport); + string[MAX_STRING_LENGTH-1] = '\0'; + +} // End of String_SrcPort + +static void String_DstPort(master_record_t *r, char *string) { +char tmp[MAX_STRING_LENGTH]; + + ICMP_Port_decode(r, tmp); + snprintf(string, MAX_STRING_LENGTH-1 ,"%6s", tmp); + string[MAX_STRING_LENGTH-1] = '\0'; + +} // End of String_DstPort + +static void String_ICMP_type(master_record_t *r, char *string) { + uint8_t type; + + type = ( r->prot == IPPROTO_ICMP || r->prot == IPPROTO_ICMPV6 ) ? r->icmp_type : 0; + snprintf(string, MAX_STRING_LENGTH-1, "%6u", type); + string[MAX_STRING_LENGTH-1] = 0; + +} // End of String_ICMP_type + +static void String_ICMP_code(master_record_t *r, char *string) { + uint8_t code; + + code = ( r->prot == IPPROTO_ICMP || r->prot == IPPROTO_ICMPV6 ) ? r->icmp_code : 0; + snprintf(string, MAX_STRING_LENGTH-1, "%6u", code); + string[MAX_STRING_LENGTH-1] = 0; + +} // End of String_ICMP_code + +static void String_SrcAS(master_record_t *r, char *string) { + + snprintf(string, MAX_STRING_LENGTH-1 ,"%6u", r->srcas); + string[MAX_STRING_LENGTH-1] = '\0'; + +} // End of String_SrcAS + +static void String_DstAS(master_record_t *r, char *string) { + + snprintf(string, MAX_STRING_LENGTH-1 ,"%6u", r->dstas); + string[MAX_STRING_LENGTH-1] = '\0'; + +} // End of String_DstAS + +static void String_NextAS(master_record_t *r, char *string) { + + snprintf(string, MAX_STRING_LENGTH-1 ," %6u", r->bgpNextAdjacentAS); + string[MAX_STRING_LENGTH-1] = '\0'; + +} // End of String_NextAS + +static void String_PrevAS(master_record_t *r, char *string) { + + snprintf(string, MAX_STRING_LENGTH-1 ," %6u", r->bgpPrevAdjacentAS); + string[MAX_STRING_LENGTH-1] = '\0'; + +} // End of String_PrevAS + +static void String_Input(master_record_t *r, char *string) { + + snprintf(string, MAX_STRING_LENGTH-1 ,"%6u", r->input); + string[MAX_STRING_LENGTH-1] = '\0'; + +} // End of String_Input + +static void String_Output(master_record_t *r, char *string) { + + snprintf(string, MAX_STRING_LENGTH-1 ,"%6u", r->output); + string[MAX_STRING_LENGTH-1] = '\0'; + +} // End of String_Output + +static void String_InPackets(master_record_t *r, char *string) { +char s[NUMBER_STRING_SIZE]; + + format_number(r->dPkts, s, scale, FIXED_WIDTH); + snprintf(string, MAX_STRING_LENGTH-1 ,"%8s", s); + string[MAX_STRING_LENGTH-1] = '\0'; + +} // End of String_InPackets + +static void String_OutPackets(master_record_t *r, char *string) { +char s[NUMBER_STRING_SIZE]; + + format_number(r->out_pkts, s, scale, FIXED_WIDTH); + snprintf(string, MAX_STRING_LENGTH-1 ,"%8s", s); + string[MAX_STRING_LENGTH-1] = '\0'; + +} // End of String_OutPackets + +static void String_InBytes(master_record_t *r, char *string) { +char s[NUMBER_STRING_SIZE]; + + format_number(r->dOctets, s, scale, FIXED_WIDTH); + snprintf(string, MAX_STRING_LENGTH-1 ,"%8s", s); + string[MAX_STRING_LENGTH-1] = '\0'; + +} // End of String_InBytes + +static void String_OutBytes(master_record_t *r, char *string) { +char s[NUMBER_STRING_SIZE]; + + format_number(r->out_bytes, s, scale, FIXED_WIDTH); + snprintf(string, MAX_STRING_LENGTH-1 ,"%8s", s); + string[MAX_STRING_LENGTH-1] = '\0'; + +} // End of String_OutBytes + +static void String_Flows(master_record_t *r, char *string) { + + // snprintf(string, MAX_STRING_LENGTH-1 ,"%5llu", r->aggr_flows ? (unsigned long long)r->aggr_flows : 1 ); + snprintf(string, MAX_STRING_LENGTH-1 ,"%5llu", (unsigned long long)r->aggr_flows ); + string[MAX_STRING_LENGTH-1] = '\0'; + +} // End of String_Flows + +static void String_Tos(master_record_t *r, char *string) { + + snprintf(string, MAX_STRING_LENGTH-1 ,"%3u", r->tos); + string[MAX_STRING_LENGTH-1] = '\0'; + +} // End of String_Tos + +static void String_SrcTos(master_record_t *r, char *string) { + + snprintf(string, MAX_STRING_LENGTH-1 ,"%4u", r->tos); + string[MAX_STRING_LENGTH-1] = '\0'; + +} // End of String_SrcTos + +static void String_DstTos(master_record_t *r, char *string) { + + snprintf(string, MAX_STRING_LENGTH-1 ,"%4u", r->dst_tos); + string[MAX_STRING_LENGTH-1] = '\0'; + +} // End of String_DstTos + +static void String_SrcMask(master_record_t *r, char *string) { + + snprintf(string, MAX_STRING_LENGTH-1 ,"%5u", r->src_mask); + string[MAX_STRING_LENGTH-1] = '\0'; + +} // End of String_SrcMask + +static void String_DstMask(master_record_t *r, char *string) { + + snprintf(string, MAX_STRING_LENGTH-1 ,"%5u", r->dst_mask); + string[MAX_STRING_LENGTH-1] = '\0'; + +} // End of String_DstMask + +static void String_SrcVlan(master_record_t *r, char *string) { + + snprintf(string, MAX_STRING_LENGTH-1 ,"%5u", r->src_vlan); + string[MAX_STRING_LENGTH-1] = '\0'; + +} // End of String_SrcVlan + +static void String_DstVlan(master_record_t *r, char *string) { + + snprintf(string, MAX_STRING_LENGTH-1 ,"%5u", r->dst_vlan); + string[MAX_STRING_LENGTH-1] = '\0'; + +} // End of String_DstVlan + +static void String_Dir(master_record_t *r, char *string) { + + snprintf(string, MAX_STRING_LENGTH-1 ,"%3c", r->dir ? 'E' : 'I' ); + string[MAX_STRING_LENGTH-1] = '\0'; + +} // End of String_Dir + +static void String_FwdStatus(master_record_t *r, char *string) { + + snprintf(string, MAX_STRING_LENGTH-1 ,"%3u", r->fwd_status); + string[MAX_STRING_LENGTH-1] = '\0'; + +} // End of String_FwdStatus + +static void String_Flags(master_record_t *r, char *string) { + + // if record contains unusuall flags, print the flags in hex as 0x.. number + if ( r->tcp_flags > 63 ) { + snprintf(string, 7, " 0x%2x\n", r->tcp_flags ); + } else { + string[0] = r->tcp_flags & 32 ? 'U' : '.'; + string[1] = r->tcp_flags & 16 ? 'A' : '.'; + string[2] = r->tcp_flags & 8 ? 'P' : '.'; + string[3] = r->tcp_flags & 4 ? 'R' : '.'; + string[4] = r->tcp_flags & 2 ? 'S' : '.'; + string[5] = r->tcp_flags & 1 ? 'F' : '.'; + } + string[6] = '\0'; + +} // End of String_Flags + +static void String_InSrcMac(master_record_t *r, char *string) { +int i; +uint8_t mac[6]; + + for ( i=0; i<6; i++ ) { + mac[i] = (r->in_src_mac >> ( i*8 )) & 0xFF; + } + snprintf(string, MAX_STRING_LENGTH-1 ,"%.2x:%.2x:%.2x:%.2x:%.2x:%.2x", mac[5], mac[4], mac[3], mac[2], mac[1], mac[0]); + string[MAX_STRING_LENGTH-1] = '\0'; + +} // End of String_InSrcMac + +static void String_OutDstMac(master_record_t *r, char *string) { +int i; +uint8_t mac[6]; + + for ( i=0; i<6; i++ ) { + mac[i] = (r->out_dst_mac >> ( i*8 )) & 0xFF; + } + snprintf(string, MAX_STRING_LENGTH-1 ,"%.2x:%.2x:%.2x:%.2x:%.2x:%.2x", mac[5], mac[4], mac[3], mac[2], mac[1], mac[0]); + string[MAX_STRING_LENGTH-1] = '\0'; + +} // End of String_OutDstMac + +static void String_InDstMac(master_record_t *r, char *string) { +int i; +uint8_t mac[6]; + + for ( i=0; i<6; i++ ) { + mac[i] = (r->in_dst_mac >> ( i*8 )) & 0xFF; + } + snprintf(string, MAX_STRING_LENGTH-1 ,"%.2x:%.2x:%.2x:%.2x:%.2x:%.2x", mac[5], mac[4], mac[3], mac[2], mac[1], mac[0]); + string[MAX_STRING_LENGTH-1] = '\0'; + +} // End of String_InDstMac + +static void String_OutSrcMac(master_record_t *r, char *string) { +int i; +uint8_t mac[6]; + + for ( i=0; i<6; i++ ) { + mac[i] = (r->out_src_mac >> ( i*8 )) & 0xFF; + } + snprintf(string, MAX_STRING_LENGTH-1 ,"%.2x:%.2x:%.2x:%.2x:%.2x:%.2x", mac[5], mac[4], mac[3], mac[2], mac[1], mac[0]); + string[MAX_STRING_LENGTH-1] = '\0'; + +} // End of String_OutSrcMac + +static void String_MPLS_1(master_record_t *r, char *string) { + + snprintf(string, MAX_STRING_LENGTH-1 ,"%8u-%1u-%1u", + r->mpls_label[0] >> 4 , (r->mpls_label[0] & 0xF ) >> 1, r->mpls_label[0] & 1); + string[MAX_STRING_LENGTH-1] = '\0'; + +} // End of String_MPLS + +static void String_MPLS_2(master_record_t *r, char *string) { + + snprintf(string, MAX_STRING_LENGTH-1 ,"%8u-%1u-%1u", + r->mpls_label[1] >> 4 , (r->mpls_label[1] & 0xF ) >> 1, r->mpls_label[1] & 1); + string[MAX_STRING_LENGTH-1] = '\0'; + +} // End of String_MPLS + +static void String_MPLS_3(master_record_t *r, char *string) { + + snprintf(string, MAX_STRING_LENGTH-1 ,"%8u-%1u-%1u", + r->mpls_label[2] >> 4 , (r->mpls_label[2] & 0xF ) >> 1, r->mpls_label[2] & 1); + string[MAX_STRING_LENGTH-1] = '\0'; + +} // End of String_MPLS + +static void String_MPLS_4(master_record_t *r, char *string) { + + snprintf(string, MAX_STRING_LENGTH-1 ,"%8u-%1u-%1u", + r->mpls_label[3] >> 4 , (r->mpls_label[3] & 0xF ) >> 1, r->mpls_label[3] & 1); + string[MAX_STRING_LENGTH-1] = '\0'; + +} // End of String_MPLS + +static void String_MPLS_5(master_record_t *r, char *string) { + + snprintf(string, MAX_STRING_LENGTH-1 ,"%8u-%1u-%1u", + r->mpls_label[4] >> 4 , (r->mpls_label[4] & 0xF ) >> 1, r->mpls_label[4] & 1); + string[MAX_STRING_LENGTH-1] = '\0'; + +} // End of String_MPLS + +static void String_MPLS_6(master_record_t *r, char *string) { + + snprintf(string, MAX_STRING_LENGTH-1 ,"%8u-%1u-%1u", + r->mpls_label[5] >> 4 , (r->mpls_label[5] & 0xF ) >> 1, r->mpls_label[5] & 1); + string[MAX_STRING_LENGTH-1] = '\0'; + +} // End of String_MPLS + +static void String_MPLS_7(master_record_t *r, char *string) { + + snprintf(string, MAX_STRING_LENGTH-1 ,"%8u-%1u-%1u", + r->mpls_label[6] >> 4 , (r->mpls_label[6] & 0xF ) >> 1, r->mpls_label[6] & 1); + string[MAX_STRING_LENGTH-1] = '\0'; + +} // End of String_MPLS + +static void String_MPLS_8(master_record_t *r, char *string) { + + snprintf(string, MAX_STRING_LENGTH-1 ,"%8u-%1u-%1u", + r->mpls_label[7] >> 4 , (r->mpls_label[7] & 0xF ) >> 1, r->mpls_label[7] & 1); + string[MAX_STRING_LENGTH-1] = '\0'; + +} // End of String_MPLS + +static void String_MPLS_9(master_record_t *r, char *string) { + + snprintf(string, MAX_STRING_LENGTH-1 ,"%8u-%1u-%1u", + r->mpls_label[8] >> 4 , (r->mpls_label[8] & 0xF ) >> 1, r->mpls_label[8] & 1); + string[MAX_STRING_LENGTH-1] = '\0'; + +} // End of String_MPLS + +static void String_MPLS_10(master_record_t *r, char *string) { + + snprintf(string, MAX_STRING_LENGTH-1 ,"%8u-%1u-%1u", + r->mpls_label[9] >> 4 , (r->mpls_label[9] & 0xF ) >> 1, r->mpls_label[9] & 1); + string[MAX_STRING_LENGTH-1] = '\0'; + +} // End of String_MPLS + +static void String_MPLSs(master_record_t *r, char *string) { + + snprintf(string, MAX_STRING_LENGTH-1 ,"%8u-%1u-%1u %8u-%1u-%1u %8u-%1u-%1u %8u-%1u-%1u %8u-%1u-%1u %8u-%1u-%1u %8u-%1u-%1u %8u-%1u-%1u %8u-%1u-%1u %8u-%1u-%1u ", + r->mpls_label[0] >> 4 , (r->mpls_label[0] & 0xF ) >> 1, r->mpls_label[0] & 1, + r->mpls_label[1] >> 4 , (r->mpls_label[1] & 0xF ) >> 1, r->mpls_label[1] & 1, + r->mpls_label[2] >> 4 , (r->mpls_label[2] & 0xF ) >> 1, r->mpls_label[2] & 1, + r->mpls_label[3] >> 4 , (r->mpls_label[3] & 0xF ) >> 1, r->mpls_label[3] & 1, + r->mpls_label[4] >> 4 , (r->mpls_label[4] & 0xF ) >> 1, r->mpls_label[4] & 1, + r->mpls_label[5] >> 4 , (r->mpls_label[5] & 0xF ) >> 1, r->mpls_label[5] & 1, + r->mpls_label[6] >> 4 , (r->mpls_label[6] & 0xF ) >> 1, r->mpls_label[6] & 1, + r->mpls_label[7] >> 4 , (r->mpls_label[7] & 0xF ) >> 1, r->mpls_label[7] & 1, + r->mpls_label[8] >> 4 , (r->mpls_label[8] & 0xF ) >> 1, r->mpls_label[8] & 1, + r->mpls_label[9] >> 4 , (r->mpls_label[9] & 0xF ) >> 1, r->mpls_label[9] & 1 + ); + string[MAX_STRING_LENGTH-1] = '\0'; + +} // End of String_MPLSs + +static void String_Engine(master_record_t *r, char *string) { + + snprintf(string, MAX_STRING_LENGTH-1 ,"%3u/%-3u", r->engine_type, r->engine_id); + string[MAX_STRING_LENGTH-1] = '\0'; + +} // End of String_Engine + +static void String_ClientLatency(master_record_t *r, char *string) { +double latency; + + latency = (double)r->client_nw_delay_usec / 1000.0; + snprintf(string, MAX_STRING_LENGTH-1 ,"%9.3f", latency); + string[MAX_STRING_LENGTH-1] = '\0'; + +} // End of String_ClientLatency + +static void String_ServerLatency(master_record_t *r, char *string) { +double latency; + + latency = (double)r->server_nw_delay_usec / 1000.0; + snprintf(string, MAX_STRING_LENGTH-1 ,"%9.3f", latency); + string[MAX_STRING_LENGTH-1] = '\0'; + +} // End of String_ServerLatency + +static void String_AppLatency(master_record_t *r, char *string) { +double latency; + + latency = (double)r->appl_latency_usec / 1000.0; + snprintf(string, MAX_STRING_LENGTH-1 ,"%9.3f", latency); + string[MAX_STRING_LENGTH-1] = '\0'; + +} // End of String_AppLatency + +static void String_bps(master_record_t *r, char *string) { +uint64_t bps; +char s[NUMBER_STRING_SIZE]; + + if ( duration ) { + bps = (( r->dOctets << 3 ) / duration); // bits per second. ( >> 3 ) -> * 8 to convert octets into bits + } else { + bps = 0; + } + format_number(bps, s, scale, FIXED_WIDTH); + snprintf(string, MAX_STRING_LENGTH-1 ,"%8s", s); + string[MAX_STRING_LENGTH-1] = '\0'; + +} // End of String_bps + +static void String_pps(master_record_t *r, char *string) { +uint64_t pps; +char s[NUMBER_STRING_SIZE]; + + if ( duration ) { + pps = r->dPkts / duration; // packets per second + } else { + pps = 0; + } + format_number(pps, s, scale, FIXED_WIDTH); + snprintf(string, MAX_STRING_LENGTH-1 ,"%8s", s); + string[MAX_STRING_LENGTH-1] = '\0'; + +} // End of String_Duration + +static void String_bpp(master_record_t *r, char *string) { +uint32_t Bpp; + + string[MAX_STRING_LENGTH-1] = '\0'; + + if ( r->dPkts ) + Bpp = r->dOctets / r->dPkts; // Bytes per Packet + else + Bpp = 0; + snprintf(string, MAX_STRING_LENGTH-1 ,"%6u", Bpp); + string[MAX_STRING_LENGTH-1] = '\0'; + +} // End of String_bpp + +static void String_ExpSysID(master_record_t *r, char *string) { + + string[MAX_STRING_LENGTH-1] = '\0'; + + snprintf(string, MAX_STRING_LENGTH-1 ,"%6u", r->exporter_sysid); + string[MAX_STRING_LENGTH-1] = '\0'; + +} // End of String_ExpSysID + +#ifdef NSEL +static void String_nfc(master_record_t *r, char *string) { + + snprintf(string, MAX_STRING_LENGTH-1, "%10u", r->conn_id); + string[MAX_STRING_LENGTH-1] = '\0'; + +} // End of String_nfc + +static void String_evt(master_record_t *r, char *string) { + + if ( r->event_flag == FW_EVENT ) { + switch(r->event) { + case 0: + snprintf(string, MAX_STRING_LENGTH-1 ,"%3s", "IGNORE"); + break; + case 1: + snprintf(string, MAX_STRING_LENGTH-1 ,"%6s", "CREATE"); + break; + case 2: + snprintf(string, MAX_STRING_LENGTH-1 ,"%6s", "DELETE"); + break; + case 3: + snprintf(string, MAX_STRING_LENGTH-1 ,"%6s", "DENIED"); + break; + case 4: + snprintf(string, MAX_STRING_LENGTH-1 ,"%6s", "ALERT"); + break; + case 5: + snprintf(string, MAX_STRING_LENGTH-1 ,"%6s", "UPDATE"); + break; + default: + snprintf(string, MAX_STRING_LENGTH-1 ,"%6s", "UNKNOW"); + } + } else { + switch(r->event) { + case 0: + snprintf(string, MAX_STRING_LENGTH-1 ,"%3s", "INVALID"); + break; + case 1: + snprintf(string, MAX_STRING_LENGTH-1 ,"%6s", "ADD"); + break; + case 2: + snprintf(string, MAX_STRING_LENGTH-1 ,"%6s", "DELETE"); + break; + default: + snprintf(string, MAX_STRING_LENGTH-1 ,"%6s", "UNKNOW"); + } + } + string[MAX_STRING_LENGTH-1] = '\0'; + +} // End of String_evt + + +static void String_xevt(master_record_t *r, char *string) { + + switch( r->fw_xevent) { + case 0: + snprintf(string, MAX_STRING_LENGTH-1 ,"%7s", "Ignore"); + break; + case 1001: + snprintf(string,MAX_STRING_LENGTH-1,"%7s","I-ACL"); + break; + case 1002: + snprintf(string,MAX_STRING_LENGTH-1,"%7s","E-ACL"); + break; + case 1003: + snprintf(string,MAX_STRING_LENGTH-1,"%7s","Adap"); + break; + case 1004: + snprintf(string,MAX_STRING_LENGTH-1,"%7s","No Syn"); + break; + default: + snprintf(string,MAX_STRING_LENGTH-1,"%7u",r->fw_xevent); + } + string[MAX_STRING_LENGTH-1] = '\0'; + +} // End of String_xevt + +static void String_msec(master_record_t *r, char *string) { + unsigned long long etime; + + etime = 1000LL * (unsigned long long)r->first + (unsigned long long)r->msec_first; + snprintf(string, MAX_STRING_LENGTH-1,"%13llu", etime); + string[MAX_STRING_LENGTH-1] = '\0'; + +} // End of String_msec + +static void String_iacl(master_record_t *r, char *string) { + + snprintf(string, MAX_STRING_LENGTH-1, "0x%-8x 0x%-8x 0x%-8x", + r->ingress_acl_id[0], r->ingress_acl_id[1], r->ingress_acl_id[2]); + string[MAX_STRING_LENGTH-1] = 0; + +} // End of String_iacl + +static void String_eacl(master_record_t *r, char *string) { + + snprintf(string, MAX_STRING_LENGTH-1, "%10u %10u %10u", + r->egress_acl_id[0], r->egress_acl_id[1], r->egress_acl_id[2]); + + string[MAX_STRING_LENGTH-1] = 0; + +} // End of String_eacl + +static void String_xlateSrcAddr(master_record_t *r, char *string) { +char tmp_str[IP_STRING_LEN]; + + tmp_str[0] = 0; + if ( (r->xlate_flags & 1 ) != 0 ) { // IPv6 + uint64_t ip[2]; + + ip[0] = htonll(r->xlate_src_ip.v6[0]); + ip[1] = htonll(r->xlate_src_ip.v6[1]); + inet_ntop(AF_INET6, ip, tmp_str, sizeof(tmp_str)); + if ( ! long_v6 ) { + condense_v6(tmp_str); + } + } else { // IPv4 + uint32_t ip; + ip = htonl(r->xlate_src_ip.v4); + inet_ntop(AF_INET, &ip, tmp_str, sizeof(tmp_str)); + } + tmp_str[IP_STRING_LEN-1] = 0; + if ( long_v6 ) + snprintf(string, MAX_STRING_LENGTH-1, "%s%39s", tag_string, tmp_str); + else + snprintf(string, MAX_STRING_LENGTH-1, "%s%16s", tag_string, tmp_str); + + string[MAX_STRING_LENGTH-1] = 0; + +} // End of String_xlateSrcAddr + +static void String_xlateDstAddr(master_record_t *r, char *string) { +char tmp_str[IP_STRING_LEN]; + + tmp_str[0] = 0; + if ( (r->xlate_flags & 1 ) != 0 ) { // IPv6 + uint64_t ip[2]; + + ip[0] = htonll(r->xlate_dst_ip.v6[0]); + ip[1] = htonll(r->xlate_dst_ip.v6[1]); + inet_ntop(AF_INET6, ip, tmp_str, sizeof(tmp_str)); + if ( ! long_v6 ) { + condense_v6(tmp_str); + } + } else { // IPv4 + uint32_t ip; + ip = htonl(r->xlate_dst_ip.v4); + inet_ntop(AF_INET, &ip, tmp_str, sizeof(tmp_str)); + } + tmp_str[IP_STRING_LEN-1] = 0; + if ( long_v6 ) + snprintf(string, MAX_STRING_LENGTH-1, "%s%39s", tag_string, tmp_str); + else + snprintf(string, MAX_STRING_LENGTH-1, "%s%16s", tag_string, tmp_str); + + string[MAX_STRING_LENGTH-1] = 0; + +} // End of String_xlateDstAddr + +static void String_xlateSrcPort(master_record_t *r, char *string) { + + snprintf(string, MAX_STRING_LENGTH-1 ,"%6u", r->xlate_src_port); + string[MAX_STRING_LENGTH-1] = '\0'; + +} // End of String_xlateSrcPort + +static void String_xlateDstPort(master_record_t *r, char *string) { + + snprintf(string, MAX_STRING_LENGTH-1 ,"%6u", r->xlate_dst_port); + string[MAX_STRING_LENGTH-1] = '\0'; + +} // End of String_xlateDstPort + +static void String_xlateSrcAddrPort(master_record_t *r, char *string) { +char tmp_str[IP_STRING_LEN], portchar; + + tmp_str[0] = 0; + if ( (r->xlate_flags & 1 ) != 0 ) { // IPv6 + uint64_t ip[2]; + + ip[0] = htonll(r->xlate_src_ip.v6[0]); + ip[1] = htonll(r->xlate_src_ip.v6[1]); + inet_ntop(AF_INET6, ip, tmp_str, sizeof(tmp_str)); + if ( ! long_v6 ) { + condense_v6(tmp_str); + } + + portchar = '.'; + } else { // IPv4 + uint32_t ip; + ip = htonl(r->xlate_src_ip.v4); + inet_ntop(AF_INET, &ip, tmp_str, sizeof(tmp_str)); + + portchar = ':'; + } + tmp_str[IP_STRING_LEN-1] = 0; + + if ( long_v6 ) + snprintf(string, MAX_STRING_LENGTH-1, "%s%39s%c%-5i", tag_string, tmp_str, portchar, r->xlate_src_port); + else + snprintf(string, MAX_STRING_LENGTH-1, "%s%16s%c%-5i", tag_string, tmp_str, portchar, r->xlate_src_port); + + string[MAX_STRING_LENGTH-1] = 0; + +} // End of String_xlateSrcAddrPort + +static void String_xlateDstAddrPort(master_record_t *r, char *string) { +char tmp_str[IP_STRING_LEN], portchar; + + tmp_str[0] = 0; + if ( (r->xlate_flags & 1 ) != 0 ) { // IPv6 + uint64_t ip[2]; + + ip[0] = htonll(r->xlate_dst_ip.v6[0]); + ip[1] = htonll(r->xlate_dst_ip.v6[1]); + inet_ntop(AF_INET6, ip, tmp_str, sizeof(tmp_str)); + if ( ! long_v6 ) { + condense_v6(tmp_str); + } + + portchar = '.'; + } else { // IPv4 + uint32_t ip; + ip = htonl(r->xlate_dst_ip.v4); + inet_ntop(AF_INET, &ip, tmp_str, sizeof(tmp_str)); + + portchar = ':'; + } + tmp_str[IP_STRING_LEN-1] = 0; + + if ( long_v6 ) + snprintf(string, MAX_STRING_LENGTH-1, "%s%39s%c%-5i", tag_string, tmp_str, portchar, r->xlate_dst_port); + else + snprintf(string, MAX_STRING_LENGTH-1, "%s%16s%c%-5i", tag_string, tmp_str, portchar, r->xlate_dst_port); + + string[MAX_STRING_LENGTH-1] = 0; + + +} // End of String_xlateDstAddrPort + +static void String_userName(master_record_t *r, char *string) { + + if ( r->username[0] == '\0' ) + snprintf(string, MAX_STRING_LENGTH-1 ,"%s", ""); + else + snprintf(string, MAX_STRING_LENGTH-1 ,"%s", r->username); + + string[MAX_STRING_LENGTH-1] = '\0'; + +} // End of String_userName + +static void String_ivrf(master_record_t *r, char *string) { + + snprintf(string, MAX_STRING_LENGTH-1, "%10u", r->ingress_vrfid); + string[MAX_STRING_LENGTH-1] = '\0'; + +} // End of String_ivrf + +static void String_evrf(master_record_t *r, char *string) { + + snprintf(string, MAX_STRING_LENGTH-1, "%10u", r->egress_vrfid); + string[MAX_STRING_LENGTH-1] = '\0'; + +} // End of String_evrf + +static void String_PortBlockStart(master_record_t *r, char *string) { + + snprintf(string, MAX_STRING_LENGTH-1 ,"%7u", r->block_start); + string[MAX_STRING_LENGTH-1] = '\0'; + +} // End of String_PortBlockStart + +static void String_PortBlockEnd(master_record_t *r, char *string) { + + snprintf(string, MAX_STRING_LENGTH-1 ,"%7u", r->block_end); + string[MAX_STRING_LENGTH-1] = '\0'; + +} // End of String_PortBlockEnd + +static void String_PortBlockStep(master_record_t *r, char *string) { + + snprintf(string, MAX_STRING_LENGTH-1 ,"%7u", r->block_step); + string[MAX_STRING_LENGTH-1] = '\0'; + +} // End of String_PortBlockStep + +static void String_PortBlockSize(master_record_t *r, char *string) { + + snprintf(string, MAX_STRING_LENGTH-1 ,"%7u", r->block_size); + string[MAX_STRING_LENGTH-1] = '\0'; + +} // End of String_PortBlockSize + + +#endif diff --git a/bin/nf_common.h b/bin/nf_common.h new file mode 100644 index 0000000..02f27e0 --- /dev/null +++ b/bin/nf_common.h @@ -0,0 +1,122 @@ +/* + * Copyright (c) 2014, Peter Haag + * Copyright (c) 2009, Peter Haag + * Copyright (c) 2004-2008, SWITCH - Teleinformatikdienste fuer Lehre und Forschung + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of the author nor the names of its contributors may be + * used to endorse or promote products derived from this software without + * specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 COPYRIGHT OWNER 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. + * + * $Author: haag $ + * + * $Id: nf_common.h 39 2009-11-25 08:11:15Z haag $ + * + * $LastChangedRevision: 39 $ + * + * + */ + +#ifndef _NF_COMMON_H +#define _NF_COMMON_H 1 + + +typedef void (*printer_t)(void *, char **, int); + +#if ( SIZEOF_VOID_P == 8 ) +typedef uint64_t pointer_addr_t; +#else +typedef uint32_t pointer_addr_t; +#endif + +typedef struct msec_time_s { + time_t sec; + uint16_t msec; +} msec_time_tt; + +/* common minimum netflow header for all versions */ +typedef struct common_flow_header { + uint16_t version; + uint16_t count; +} common_flow_header_t; + +typedef struct printmap_s { + char *printmode; // name of the output format + printer_t func; // name of the function, which prints the record + char *Format; // output format definition +} printmap_t; + +#define NSEL_EVENT_IGNORE 0LL +#define NSEL_EVENT_CREATE 1LL +#define NSEL_EVENT_DELETE 2LL +#define NSEL_EVENT_DENIED 3LL +#define NSEL_EVENT_ALERT 4LL +#define NSEL_EVENT_UPDATE 5LL + +#define NEL_EVENT_INVALID 0LL +#define NEL_EVENT_ADD 1LL +#define NEL_EVENT_DELETE 2LL + +/* prototypes */ + +int InitSymbols(void); + +void Setv6Mode(int mode); + +int Getv6Mode(void); + +int Proto_num(char *protostr); + +void format_file_block_header(void *header, char **s, int tag); + +char *format_csv_header(void); + +char *get_record_header(void); + +void set_record_header(void); + +void format_file_block_record(void *record, char **s, int tag); + +void flow_record_to_pipe(void *record, char ** s, int tag); + +void flow_record_to_csv(void *record, char ** s, int tag); + +void flow_record_to_null(void *record, char ** s, int tag); + +int ParseOutputFormat(char *format, int plain_numbers, printmap_t *printmap); + +void format_special(void *record, char ** s, int tag); + + +uint32_t Get_fwd_status_id(char *status); + +char *Get_fwd_status_name(uint32_t id); + +void Proto_string(uint8_t protonum, char *protostr); + +void condense_v6(char *s); + +#define TAG_CHAR '' + +#endif //_NF_COMMON_H + diff --git a/bin/nfanon.c b/bin/nfanon.c new file mode 100755 index 0000000..61e124e --- /dev/null +++ b/bin/nfanon.c @@ -0,0 +1,483 @@ +/* + * Copyright (c) 2014, Peter Haag + * Copyright (c) 2009, Peter Haag + * Copyright (c) 2004-2008, SWITCH - Teleinformatikdienste fuer Lehre und Forschung + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of the author nor the names of its contributors may be + * used to endorse or promote products derived from this software without + * specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 COPYRIGHT OWNER 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. + * + * $Author: haag $ + * + * $Id:$ + * + * $LastChangedRevision: 48 $ + * + * + */ + +#include "config.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#ifdef HAVE_STDINT_H +#include +#endif + +#include "nffile.h" +#include "nfx.h" +#include "util.h" +#include "flist.h" +#include "panonymizer.h" + +#if ( SIZEOF_VOID_P == 8 ) +typedef uint64_t pointer_addr_t; +#else +typedef uint32_t pointer_addr_t; +#endif + +// module limited globals +extension_map_list_t *extension_map_list; + +/* Function Prototypes */ +static void usage(char *name); + +static inline void AnonRecord(master_record_t *master_record); + +static void process_data(void *wfile); + +/* Functions */ + +#define NEED_PACKRECORD 1 +#include "nffile_inline.c" +#undef NEED_PACKRECORD + +static void usage(char *name) { + printf("usage %s [options] \n" + "-h\t\tthis text you see right here\n" + "-K \tAnonymize IP addressses using CryptoPAn with key .\n" + "-r\t\tread input from file\n" + "-M \tRead input from multiple directories.\n" + "-R \tRead input from sequence of files.\n" + "-w \tName of output file. Defaults to input file.\n" + , name); +} /* usage */ + +static inline void AnonRecord(master_record_t *master_record) { +extension_map_t *extension_map = master_record->map_ref; +int i; + + // Required extension 1 - IP addresses + if ( (master_record->flags & FLAG_IPV6_ADDR) != 0 ) { // IPv6 + // IPv6 + uint64_t anon_ip[2]; + anonymize_v6(master_record->v6.srcaddr, anon_ip); + master_record->v6.srcaddr[0] = anon_ip[0]; + master_record->v6.srcaddr[1] = anon_ip[1]; + + anonymize_v6(master_record->v6.dstaddr, anon_ip); + master_record->v6.dstaddr[0] = anon_ip[0]; + master_record->v6.dstaddr[1] = anon_ip[1]; + + } else { + // IPv4 + master_record->v4.srcaddr = anonymize(master_record->v4.srcaddr); + master_record->v4.dstaddr = anonymize(master_record->v4.dstaddr); + } + + // Process optional extensions + i=0; + while ( extension_map->ex_id[i] ) { + switch (extension_map->ex_id[i++]) { + case EX_AS_2: // srcas/dstas 2 byte + master_record->srcas = 0; + master_record->dstas = 0; + break; + case EX_AS_4: // srcas/dstas 4 byte + master_record->srcas = 0; + master_record->dstas = 0; + break; + case EX_NEXT_HOP_v4: + master_record->ip_nexthop.v4 = anonymize(master_record->ip_nexthop.v4); + break; + case EX_NEXT_HOP_v6: { + uint64_t anon_ip[2]; + anonymize_v6(master_record->ip_nexthop.v6, anon_ip); + master_record->ip_nexthop.v6[0] = anon_ip[0]; + master_record->ip_nexthop.v6[1] = anon_ip[1]; + } break; + case EX_NEXT_HOP_BGP_v4: + master_record->bgp_nexthop.v4 = anonymize(master_record->bgp_nexthop.v4); + break; + case EX_NEXT_HOP_BGP_v6: { + uint64_t anon_ip[2]; + anonymize_v6(master_record->bgp_nexthop.v6, anon_ip); + master_record->bgp_nexthop.v6[0] = anon_ip[0]; + master_record->bgp_nexthop.v6[1] = anon_ip[1]; + } break; + case EX_ROUTER_IP_v4: + master_record->ip_router.v4 = anonymize(master_record->ip_router.v4); + break; + case EX_ROUTER_IP_v6: { + uint64_t anon_ip[2]; + anonymize_v6(master_record->ip_router.v6, anon_ip); + master_record->ip_router.v6[0] = anon_ip[0]; + master_record->ip_router.v6[1] = anon_ip[1]; + } break; +#ifdef NSEL + case EX_NSEL_XLATE_IP_v4: + master_record->xlate_src_ip.v4 = anonymize(master_record->xlate_src_ip.v4); + master_record->xlate_dst_ip.v4 = anonymize(master_record->xlate_dst_ip.v4); + break; + case EX_NSEL_XLATE_IP_v6: { + uint64_t anon_ip[2]; + anonymize_v6(master_record->xlate_src_ip.v6, anon_ip); + master_record->xlate_src_ip.v6[0] = anon_ip[0]; + master_record->xlate_src_ip.v6[1] = anon_ip[1]; + anonymize_v6(master_record->xlate_dst_ip.v6, anon_ip); + master_record->xlate_dst_ip.v6[0] = anon_ip[0]; + master_record->xlate_dst_ip.v6[1] = anon_ip[1]; + } break; +#endif + } + } + +} // End of AnonRecord + + +static void process_data(void *wfile) { +master_record_t master_record; +common_record_t *flow_record; +nffile_t *nffile_r; +nffile_t *nffile_w; +int i, done, ret, cnt, verbose; +char outfile[MAXPATHLEN], *cfile; +#ifdef COMPAT15 +int v1_map_done = 0; +#endif + + + setbuf(stderr, NULL); + cnt = 1; + verbose = 1; + + // Get the first file handle + nffile_r = GetNextFile(NULL, 0, 0); + if ( !nffile_r ) { + LogError("GetNextFile() error in %s line %d: %s\n", __FILE__, __LINE__, strerror(errno) ); + return; + } + if ( nffile_r == EMPTY_LIST ) { + LogError("Empty file list. No files to process\n"); + return; + } + + cfile = GetCurrentFilename(); + if ( !cfile ) { + if ( nffile_r->fd == 0 ) { // stdin + outfile[0] = '-'; + outfile[1] = '\0'; + verbose = 0; + } else { + LogError("(NULL) input file name error in %s line %d\n", __FILE__, __LINE__); + return; + } + } else { + // prepare output file + snprintf(outfile,MAXPATHLEN-1, "%s-tmp", cfile); + outfile[MAXPATHLEN-1] = '\0'; + if ( verbose ) + fprintf(stderr, " %i Processing %s\r", cnt++, cfile); + } + + if ( wfile ) + nffile_w = OpenNewFile(wfile, NULL, FILE_IS_COMPRESSED(nffile_r), 1, NULL); + else + nffile_w = OpenNewFile(outfile, NULL, FILE_IS_COMPRESSED(nffile_r), 1, NULL); + + if ( !nffile_w ) { + if ( nffile_r ) { + CloseFile(nffile_r); + DisposeFile(nffile_r); + } + return; + } + + memcpy((void *)nffile_w->stat_record, (void *)nffile_r->stat_record, sizeof(stat_record_t)); + + done = 0; + while ( !done ) { + // get next data block from file + ret = ReadBlock(nffile_r); + + switch (ret) { + case NF_CORRUPT: + case NF_ERROR: + if ( ret == NF_CORRUPT ) + LogError("Skip corrupt data file '%s'\n",GetCurrentFilename()); + else + LogError("Read error in file '%s': %s\n",GetCurrentFilename(), strerror(errno) ); + // fall through - get next file in chain + case NF_EOF: { + nffile_t *next; + if ( nffile_w->block_header->NumRecords ) { + if ( WriteBlock(nffile_w) <= 0 ) { + LogError("Failed to write output buffer to disk: '%s'" , strerror(errno)); + } + } + if ( wfile == NULL ) { + CloseUpdateFile(nffile_w, nffile_r->file_header->ident); + if ( rename(outfile, cfile) < 0 ) { + LogError("\nrename() error in %s line %d: %s\n", __FILE__, __LINE__, strerror(errno) ); + LogError("Abort processing.\n"); + return; + } + } + + next = GetNextFile(nffile_r, 0, 0); + if ( next == EMPTY_LIST ) { + done = 1; + continue; + } + if ( next == NULL ) { + LogError("Unexpected end of file list\n"); + done = 1; + continue; + } + + cfile = GetCurrentFilename(); + if ( !cfile ) { + LogError("(NULL) input file name error in %s line %d\n", __FILE__, __LINE__); + return; + } + LogError(" %i Processing %s\r", cnt++, cfile); + + if ( wfile == NULL ) { + snprintf(outfile,MAXPATHLEN-1, "%s-tmp", cfile); + outfile[MAXPATHLEN-1] = '\0'; + + nffile_w = OpenNewFile(outfile, nffile_w, FILE_IS_COMPRESSED(nffile_r), 1, NULL); + if ( !nffile_w ) { + if ( nffile_r ) { + CloseFile(nffile_r); + DisposeFile(nffile_r); + } + return; + } + memcpy((void *)nffile_w->stat_record, (void *)&nffile_r->stat_record, sizeof(stat_record_t)); + } else { + SumStatRecords(nffile_w->stat_record, nffile_r->stat_record); + } + + // continue with next file + continue; + + } break; // not really needed + } + +#ifdef COMPAT15 + if ( nffile_r->block_header->id == DATA_BLOCK_TYPE_1 ) { + common_record_v1_t *v1_record = (common_record_v1_t *)nffile_r->buff_ptr; + // create an extension map for v1 blocks + if ( v1_map_done == 0 ) { + extension_map_t *map = malloc(sizeof(extension_map_t) + 2 * sizeof(uint16_t) ); + if ( ! map ) { + LogError("malloc() error in %s line %d: %s\n", __FILE__, __LINE__, strerror(errno) ); + exit(255); + } + map->type = ExtensionMapType; + map->size = sizeof(extension_map_t) + 2 * sizeof(uint16_t); + map->map_id = 0; + map->ex_id[0] = EX_IO_SNMP_2; + map->ex_id[1] = EX_AS_2; + map->ex_id[2] = 0; + + Insert_Extension_Map(extension_map_list, map); + AppendToBuffer(nffile_w, (void *)map, map->size); + + v1_map_done = 1; + } + + // convert the records to v2 + for ( i=0; i < nffile_r->block_header->NumRecords; i++ ) { + common_record_t *v2_record = (common_record_t *)v1_record; + Convert_v1_to_v2((void *)v1_record); + // now we have a v2 record -> use size of v2_record->size + v1_record = (common_record_v1_t *)((pointer_addr_t)v1_record + v2_record->size); + } + nffile_r->block_header->id = DATA_BLOCK_TYPE_2; + } +#endif + + if ( nffile_r->block_header->id == Large_BLOCK_Type ) { + // skip + continue; + } + + if ( nffile_r->block_header->id != DATA_BLOCK_TYPE_2 ) { + fprintf(stderr, "Can't process block type %u. Skip block.\n", nffile_r->block_header->id); + continue; + } + + flow_record = nffile_r->buff_ptr; + for ( i=0; i < nffile_r->block_header->NumRecords; i++ ) { + switch ( flow_record->type ) { + case CommonRecordV0Type: + case CommonRecordType: { + uint32_t map_id = flow_record->ext_map; + if ( extension_map_list->slot[map_id] == NULL ) { + LogError("Corrupt data file! No such extension map id: %u. Skip record", flow_record->ext_map ); + } else { + ExpandRecord_v2( flow_record, extension_map_list->slot[flow_record->ext_map], NULL, &master_record); + + // update number of flows matching a given map + extension_map_list->slot[map_id]->ref_count++; + + AnonRecord(&master_record); + PackRecord(&master_record, nffile_w); + } + + } break; + case ExtensionMapType: { + extension_map_t *map = (extension_map_t *)flow_record; + + if ( Insert_Extension_Map(extension_map_list, map) ) { + // flush new map + } // else map already known and flushed + AppendToBuffer(nffile_w, (void *)map, map->size); + + } break; + case ExporterRecordType: + case SamplerRecordype: + case ExporterInfoRecordType: + case ExporterStatRecordType: + case SamplerInfoRecordype: + // Silently skip exporter/sampler records + break; + + default: { + fprintf(stderr, "Skip unknown record type %i\n", flow_record->type); + } + } + // Advance pointer by number of bytes for netflow record + flow_record = (common_record_t *)((pointer_addr_t)flow_record + flow_record->size); + + } // for all records + + } // while + + PackExtensionMapList(extension_map_list); + if ( wfile != NULL ) + CloseUpdateFile(nffile_w, nffile_r->file_header->ident); + + if ( nffile_r ) { + CloseFile(nffile_r); + DisposeFile(nffile_r); + } + + DisposeFile(nffile_w); + + LogError("\n"); + LogError("Processed %i files.\n", --cnt); + +} // End of process_data + + +int main( int argc, char **argv ) { +char *rfile, *Rfile, *wfile, *Mdirs; +int c; +char CryptoPAnKey[32]; + + rfile = Rfile = Mdirs = wfile = NULL; + while ((c = getopt(argc, argv, "K:L:r:M:R:w:")) != EOF) { + switch (c) { + case 'h': + usage(argv[0]); + exit(0); + break; + break; + case 'K': + if ( !ParseCryptoPAnKey(optarg, CryptoPAnKey) ) { + fprintf(stderr, "Invalid key '%s' for CryptoPAn!\n", optarg); + exit(255); + } + PAnonymizer_Init((uint8_t *)CryptoPAnKey); + break; + case 'L': + if ( !InitLog("argv[0]", optarg) ) + exit(255); + break; + case 'r': + rfile = optarg; + if ( strcmp(rfile, "-") == 0 ) + rfile = NULL; + break; + case 'M': + Mdirs = optarg; + break; + case 'R': + Rfile = optarg; + break; + case 'w': + wfile = optarg; + break; + default: + usage(argv[0]); + exit(0); + } + } + + if ( rfile && Rfile ) { + fprintf(stderr, "-r and -R are mutually exclusive. Please specify either -r or -R\n"); + exit(255); + } + if ( Mdirs && !(rfile || Rfile) ) { + fprintf(stderr, "-M needs either -r or -R to specify the file or file list. Add '-R .' for all files in the directories.\n"); + exit(255); + } + + extension_map_list = InitExtensionMaps(NEEDS_EXTENSION_LIST); + + SetupInputFileSequence(Mdirs, rfile, Rfile); + + process_data(wfile); + + FreeExtensionMaps(extension_map_list); + + return 0; +} diff --git a/bin/nfcapd.c b/bin/nfcapd.c new file mode 100644 index 0000000..779709a --- /dev/null +++ b/bin/nfcapd.c @@ -0,0 +1,1236 @@ +/* + * Copyright (c) 2014, Peter Haag + * Copyright (c) 2009, Peter Haag + * Copyright (c) 2004-2008, SWITCH - Teleinformatikdienste fuer Lehre und Forschung + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of the author nor the names of its contributors may be + * used to endorse or promote products derived from this software without + * specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 COPYRIGHT OWNER 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. + * + * $Author: haag $ + * + * $Id: nfcapd.c 51 2010-01-29 09:01:54Z haag $ + * + * $LastChangedRevision: 51 $ + * + * + */ + +/* + * Because NetFlow export uses UDP to send export datagrams, it is possible + * for datagrams to be lost. To determine whether flow export information has + * been lost, Version 5, Version 7, and Version 8 headers contain a flow + * sequence number. The sequence number is equal to the sequence number of the + * previous datagram plus the number of flows in the previous datagram. After + * receiving a new datagram, the receiving application can subtract the expected + * sequence number from the sequence number in the header to derive the number + * of missed flows. + */ + +#include "config.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#ifdef PCAP +#include "pcap_reader.h" +#endif + +#ifdef HAVE_STDINT_H +#include +#endif + +#include "util.h" +#include "nffile.h" +#include "nfx.h" +#include "nf_common.h" +#include "nfnet.h" +#include "flist.h" +#include "nfstatfile.h" +#include "bookkeeper.h" +#include "nfxstat.h" +#include "collector.h" +#include "exporter.h" +#include "netflow_v1.h" +#include "netflow_v5_v7.h" +#include "netflow_v9.h" +#include "ipfix.h" + +#ifdef HAVE_FTS_H +# include +#else +# include "fts_compat.h" +#define fts_children fts_children_compat +#define fts_close fts_close_compat +#define fts_open fts_open_compat +#define fts_read fts_read_compat +#define fts_set fts_set_compat +#endif + +#include "expire.h" + +#define DEFAULTCISCOPORT "9995" +#define DEFAULTHOSTNAME "127.0.0.1" +#define SENDSOCK_BUFFSIZE 200000 + +#ifndef DEVEL +# define dbg_printf(...) /* printf(__VA_ARGS__) */ +#else +# define dbg_printf(...) printf(__VA_ARGS__) +#endif + +/* globals */ +caddr_t shmem; +int verbose = 0; + +extern uint32_t default_sampling; // the default sampling rate when nothing else applies. set by -S +extern uint32_t overwrite_sampling; // unconditionally overwrite sampling rate with given sampling rate -S + +// Define a generic type to get data from socket or pcap file +typedef ssize_t (*packet_function_t)(int, void *, size_t, int, struct sockaddr *, socklen_t *); + +/* module limited globals */ +static FlowSource_t *FlowSource; + +static int done, launcher_alive, periodic_trigger, launcher_pid; + +static const char *nfdump_version = VERSION; + + +/* Local function Prototypes */ +static void usage(char *name); + +static void kill_launcher(int pid); + +static void IntHandler(int signal); + +static inline FlowSource_t *GetFlowSource(struct sockaddr_storage *ss); + +static void daemonize(void); + +static void SetPriv(char *userid, char *groupid ); + +static void run(packet_function_t receive_packet, int socket, send_peer_t peer, + time_t twin, time_t t_begin, int report_seq, int use_subdirs, int compress, int do_xstat); + +/* Functions */ +static void usage(char *name) { + printf("usage %s [options] \n" + "-h\t\tthis text you see right here\n" + "-u userid\tChange user to username\n" + "-g groupid\tChange group to groupname\n" + "-w\t\tSync file rotation with next 5min (default) interval\n" + "-t interval\tset the interval to rotate nfcapd files\n" + "-b host\t\tbind socket to host/IP addr\n" + "-j mcastgroup\tJoin multicast group \n" + "-p portnum\tlisten on port portnum\n" + "-l basdir \tset the output directory. (no default) \n" + "-S subdir\tSub directory format. see nfcapd(1) for format\n" + "-I Ident\tset the ident string for stat file. (default 'none')\n" + "-H Add port histogram data to flow file.(default 'no')\n" + "-n Ident,IP,logdir\tAdd this flow source - multiple streams\n" + "-P pidfile\tset the PID file\n" + "-R IP[/port]\tRepeat incoming packets to IP address/port\n" + "-s rate\tset default sampling rate (default 1)\n" + "-x process\tlaunch process after a new file becomes available\n" + "-z\t\tCompress flows in output file.\n" + "-B bufflen\tSet socket buffer to bufflen bytes\n" + "-e\t\tExpire data at each cycle.\n" + "-D\t\tFork to background\n" + "-E\t\tPrint extended format of netflow data. for debugging purpose only.\n" + "-T\t\tInclude extension tags in records.\n" + "-4\t\tListen on IPv4 (default).\n" + "-6\t\tListen on IPv6.\n" + "-V\t\tPrint version and exit.\n" + , name); +} // End of usage + +void kill_launcher(int pid) { +int stat, i; +pid_t ret; + + if ( pid == 0 ) + return; + + if ( launcher_alive ) { + LogInfo("Signal launcher[%i] to terminate.", pid); + kill(pid, SIGTERM); + + // wait for launcher to teminate + for ( i=0; i= LAUNCHER_TIMEOUT ) { + LogError("Laucher does not want to terminate - signal again"); + kill(pid, SIGTERM); + sleep(1); + } + } else { + LogError("launcher[%i] already dead.", pid); + } + + if ( (ret = waitpid (pid, &stat, 0)) == -1 ) { + LogError("wait for launcher failed: %s %i", strerror(errno), ret); + } else { + if ( WIFEXITED(stat) ) { + LogInfo("launcher exit status: %i", WEXITSTATUS(stat)); + } + if ( WIFSIGNALED(stat) ) { + LogError("launcher terminated due to signal %i", WTERMSIG(stat)); + } + } + +} // End of kill_launcher + +static void IntHandler(int signal) { + + switch (signal) { + case SIGALRM: + periodic_trigger = 1; + break; + case SIGHUP: + case SIGINT: + case SIGTERM: + done = 1; + break; + case SIGCHLD: + launcher_alive = 0; + break; + default: + // ignore everything we don't know + break; + } + +} /* End of IntHandler */ + + +static void daemonize(void) { +int fd; + switch (fork()) { + case 0: + // child + break; + case -1: + // error + fprintf(stderr, "fork() error: %s\n", strerror(errno)); + exit(0); + break; + default: + // parent + _exit(0); + } + + if (setsid() < 0) { + fprintf(stderr, "setsid() error: %s\n", strerror(errno)); + exit(0); + } + + // Double fork + switch (fork()) { + case 0: + // child + break; + case -1: + // error + fprintf(stderr, "fork() error: %s\n", strerror(errno)); + exit(0); + break; + default: + // parent + _exit(0); + } + + fd = open("/dev/null", O_RDONLY); + if (fd != 0) { + dup2(fd, 0); + close(fd); + } + fd = open("/dev/null", O_WRONLY); + if (fd != 1) { + dup2(fd, 1); + close(fd); + } + fd = open("/dev/null", O_WRONLY); + if (fd != 2) { + dup2(fd, 2); + close(fd); + } + +} // End of daemonize + +static void SetPriv(char *userid, char *groupid ) { +struct passwd *pw_entry; +struct group *gr_entry; +uid_t myuid, newuid, newgid; +int err; + + if ( userid == 0 && groupid == 0 ) + return; + + newuid = newgid = 0; + myuid = getuid(); + if ( myuid != 0 ) { + LogError("Only root wants to change uid/gid"); + fprintf(stderr, "ERROR: Only root wants to change uid/gid\n"); + exit(255); + } + + if ( userid ) { + pw_entry = getpwnam(userid); + newuid = pw_entry ? pw_entry->pw_uid : atol(userid); + + if ( newuid == 0 ) { + fprintf (stderr,"Invalid user '%s'\n", userid); + exit(255); + } + } + + if ( groupid ) { + gr_entry = getgrnam(groupid); + newgid = gr_entry ? gr_entry->gr_gid : atol(groupid); + + if ( newgid == 0 ) { + fprintf (stderr,"Invalid group '%s'\n", groupid); + exit(255); + } + + err = setgid(newgid); + if ( err ) { + LogError("Can't set group id %ld for group '%s': %s", (long)newgid, groupid, strerror(errno)); + fprintf (stderr,"Can't set group id %ld for group '%s': %s\n", (long)newgid, groupid, strerror(errno)); + exit(255); + } + + } + + if ( newuid ) { + err = setuid(newuid); + if ( err ) { + LogError("Can't set user id %ld for user '%s': %s", (long)newuid, userid, strerror(errno)); + fprintf (stderr,"Can't set user id %ld for user '%s': %s\n", (long)newuid, userid, strerror(errno)); + exit(255); + } + } + +} // End of SetPriv + +#include "nffile_inline.c" +#include "collector_inline.c" + +static void run(packet_function_t receive_packet, int socket, send_peer_t peer, + time_t twin, time_t t_begin, int report_seq, int use_subdirs, int compress, int do_xstat) { +common_flow_header_t *nf_header; +FlowSource_t *fs; +struct sockaddr_storage nf_sender; +socklen_t nf_sender_size = sizeof(nf_sender); +time_t t_start, t_now; +uint64_t export_packets; +uint32_t blast_cnt, blast_failures, ignored_packets; +uint16_t version; +ssize_t cnt; +void *in_buff; +int err; +char *string; +srecord_t *commbuff; + + if ( !Init_v1() || !Init_v5_v7_input() || !Init_v9() || !Init_IPFIX() ) + return; + + in_buff = malloc(NETWORK_INPUT_BUFF_SIZE); + if ( !in_buff ) { + LogError("malloc() allocation error in %s line %d: %s\n", __FILE__, __LINE__, strerror(errno) ); + return; + } + + // init vars + commbuff = (srecord_t *)shmem; + nf_header = (common_flow_header_t *)in_buff; + + // Init each netflow source output data buffer + fs = FlowSource; + while ( fs ) { + + // prepare file + fs->nffile = OpenNewFile(fs->current, NULL, compress, 0, NULL); + if ( !fs->nffile ) { + return; + } + if ( do_xstat ) { + fs->xstat = InitXStat(fs->nffile); + if ( !fs->xstat ) + return; + } + // init vars + fs->bad_packets = 0; + fs->first_seen = 0xffffffffffffLL; + fs->last_seen = 0; + + // next source + fs = fs->next; + } + + export_packets = blast_cnt = blast_failures = 0; + t_start = t_begin; + + cnt = 0; + periodic_trigger = 0; + ignored_packets = 0; + + // wake up at least at next time slot (twin) + some Overdue time + alarm(t_start + twin + OVERDUE_TIME - time(NULL)); + /* + * Main processing loop: + * this loop, continues until done = 1, set by the signal handler + * The while loop will be breaked by the periodic file renaming code + * for proper cleanup + */ + while ( 1 ) { + struct timeval tv; + + /* read next bunch of data into beginn of input buffer */ + if ( !done) { +#ifdef PCAP + // Debug code to read from pcap file, or from socket + cnt = receive_packet(socket, in_buff, NETWORK_INPUT_BUFF_SIZE , 0, + (struct sockaddr *)&nf_sender, &nf_sender_size); + + // in case of reading from file EOF => -2 + if ( cnt == -2 ) + done = 1; +#else + cnt = recvfrom (socket, in_buff, NETWORK_INPUT_BUFF_SIZE , 0, + (struct sockaddr *)&nf_sender, &nf_sender_size); +#endif + + if ( cnt == -1 && errno != EINTR ) { + LogError("ERROR: recvfrom: %s", strerror(errno)); + continue; + } + + if ( peer.hostname ) { + ssize_t len; + len = sendto(peer.sockfd, in_buff, cnt, 0, (struct sockaddr *)&(peer.addr), peer.addrlen); + if ( len < 0 ) { + LogError("ERROR: sendto(): %s", strerror(errno)); + } + } + } + + /* Periodic file renaming, if time limit reached or if we are done. */ + // t_now = time(NULL); + gettimeofday(&tv, NULL); + t_now = tv.tv_sec; + + if ( ((t_now - t_start) >= twin) || done ) { + char subfilename[64]; + struct tm *now; + char *subdir; + + alarm(0); + now = localtime(&t_start); + + // prepare sub dir hierarchy + if ( use_subdirs ) { + subdir = GetSubDir(now); + if ( !subdir ) { + // failed to generate subdir path - put flows into base directory + LogError("Failed to create subdir path!"); + + // failed to generate subdir path - put flows into base directory + subdir = NULL; + snprintf(subfilename, 63, "nfcapd.%i%02i%02i%02i%02i", + now->tm_year + 1900, now->tm_mon + 1, now->tm_mday, now->tm_hour, now->tm_min); + } else { + snprintf(subfilename, 63, "%s/nfcapd.%i%02i%02i%02i%02i", subdir, + now->tm_year + 1900, now->tm_mon + 1, now->tm_mday, now->tm_hour, now->tm_min); + } + } else { + subdir = NULL; + snprintf(subfilename, 63, "nfcapd.%i%02i%02i%02i%02i", + now->tm_year + 1900, now->tm_mon + 1, now->tm_mday, now->tm_hour, now->tm_min); + } + subfilename[63] = '\0'; + + // for each flow source update the stats, close the file and re-initialize the new file + fs = FlowSource; + while ( fs ) { + char nfcapd_filename[MAXPATHLEN]; + char error[255]; + nffile_t *nffile = fs->nffile; + + if ( verbose ) { + // Dump to stdout + format_file_block_header(nffile->block_header, &string, 0); + printf("%s\n", string); + } + + if ( nffile->block_header->NumRecords ) { + // flush current buffer to disc + if ( WriteBlock(nffile) <= 0 ) + LogError("Ident: %s, failed to write output buffer to disk: '%s'" , fs->Ident, strerror(errno)); + } // else - no new records in current block + + + // prepare filename + snprintf(nfcapd_filename, MAXPATHLEN-1, "%s/%s", fs->datadir, subfilename); + nfcapd_filename[MAXPATHLEN-1] = '\0'; + + // update stat record + // if no flows were collected, fs->last_seen is still 0 + // set first_seen to start of this time slot, with twin window size. + if ( fs->last_seen == 0 ) { + fs->first_seen = (uint64_t)1000 * (uint64_t)t_start; + fs->last_seen = (uint64_t)1000 * (uint64_t)(t_start + twin); + } + nffile->stat_record->first_seen = fs->first_seen/1000; + nffile->stat_record->msec_first = fs->first_seen - nffile->stat_record->first_seen*1000; + nffile->stat_record->last_seen = fs->last_seen/1000; + nffile->stat_record->msec_last = fs->last_seen - nffile->stat_record->last_seen*1000; + + if ( fs->xstat ) { + if ( WriteExtraBlock(nffile, fs->xstat->block_header ) <= 0 ) + LogError("Ident: %s, failed to write xstat buffer to disk: '%s'" , fs->Ident, strerror(errno)); + + ResetPortHistogram(fs->xstat->port_histogram); + ResetBppHistogram(fs->xstat->bpp_histogram); + } + + // Flush Exporter Stat to file + FlushExporterStats(fs); + // Close file + CloseUpdateFile(nffile, fs->Ident); + + if ( subdir && !SetupSubDir(fs->datadir, subdir, error, 255) ) { + // in this case the flows get lost! - the rename will fail + // but this should not happen anyway, unless i/o problems, inode problems etc. + LogError("Ident: %s, Failed to create sub hier directories: %s", fs->Ident, error ); + } + + // if rename fails, we are in big trouble, as we need to get rid of the old .current file + // otherwise, we will loose flows and can not continue collecting new flows + err = rename(fs->current, nfcapd_filename); + if ( err ) { + LogError("Ident: %s, Can't rename dump file: %s", fs->Ident, strerror(errno)); + LogError("Ident: %s, Serious Problem! Fix manually", fs->Ident); + if ( launcher_pid ) + commbuff->failed = 1; + + // we do not update the books here, as the file failed to rename properly + // otherwise the books may be wrong + } else { + struct stat fstat; + if ( launcher_pid ) + commbuff->failed = 0; + + // Update books + stat(nfcapd_filename, &fstat); + UpdateBooks(fs->bookkeeper, t_start, 512*fstat.st_blocks); + } + + // log stats + LogInfo("Ident: '%s' Flows: %llu, Packets: %llu, Bytes: %llu, Sequence Errors: %u, Bad Packets: %u", + fs->Ident, (unsigned long long)nffile->stat_record->numflows, (unsigned long long)nffile->stat_record->numpackets, + (unsigned long long)nffile->stat_record->numbytes, nffile->stat_record->sequence_failure, fs->bad_packets); + + // reset stats + fs->bad_packets = 0; + fs->first_seen = 0xffffffffffffLL; + fs->last_seen = 0; + + if ( !done ) { + nffile = OpenNewFile(fs->current, nffile, compress, 0, NULL); + if ( !nffile ) { + LogError("killed due to fatal error: ident: %s", fs->Ident); + break; + } + /* XXX needs fixing */ + if ( fs->xstat ) { + // to be implemented + } + } + + // Dump all extension maps and exporters to the buffer + FlushStdRecords(fs); + + // next flow source + fs = fs->next; + } // end of while (fs) + + // All flow sources updated - signal launcher if required + if ( launcher_pid ) { + // Signal launcher + + // prepare filename for %f expansion + strncpy(commbuff->fname, subfilename, FNAME_SIZE-1); + commbuff->fname[FNAME_SIZE-1] = 0; + snprintf(commbuff->tstring, 16, "%i%02i%02i%02i%02i", + now->tm_year + 1900, now->tm_mon + 1, now->tm_mday, now->tm_hour, now->tm_min); + commbuff->tstring[15] = 0; + commbuff->tstamp = t_start; + if ( subdir ) + strncpy(commbuff->subdir, subdir, FNAME_SIZE); + else + commbuff->subdir[0] = '\0'; + + if ( launcher_alive ) { + LogInfo("Signal launcher"); + kill(launcher_pid, SIGHUP); + } else + LogError("ERROR: Launcher did unexpectedly!"); + + } + + LogInfo("Total ignored packets: %u", ignored_packets); + ignored_packets = 0; + + if ( done ) + break; + + // update alarm for next cycle + t_start += twin; + /* t_start = filename time stamp: begin of slot + * + twin = end of next time interval + * + OVERDUE_TIME = if no data is collected, this is at latest to act + * - t_now = difference value to now + */ + alarm(t_start + twin + OVERDUE_TIME - t_now); + + } + + /* check for error condition or done . errno may only be EINTR */ + if ( cnt < 0 ) { + if ( periodic_trigger ) { + // alarm triggered, no new flow data + periodic_trigger = 0; + continue; + } + if ( done ) + // signaled to terminate - exit from loop + break; + else { + /* this should never be executed as it should be caught in other places */ + LogError("error condition in '%s', line '%d', cnt: %i", __FILE__, __LINE__ ,(int)cnt); + continue; + } + } + + /* enough data? */ + if ( cnt == 0 ) + continue; + + // get flow source record for current packet, identified by sender IP address + fs = GetFlowSource(&nf_sender); + if ( fs == NULL ) { + fs = AddDynamicSource(&FlowSource, &nf_sender); + if ( fs == NULL ) { + LogError("Skip UDP packet. Ignored packets so far %u packets", ignored_packets); + ignored_packets++; + continue; + } + if ( InitBookkeeper(&fs->bookkeeper, fs->datadir, getpid(), launcher_pid) != BOOKKEEPER_OK ) { + LogError("Failed to initialise bookkeeper for new source"); + // fatal error + return; + } + fs->nffile = OpenNewFile(fs->current, NULL, compress, 0, NULL); + if ( !fs->nffile ) { + LogError("Failed to open new collector file"); + return; + } + } + + /* check for too little data - cnt must be > 0 at this point */ + if ( cnt < sizeof(common_flow_header_t) ) { + LogError("Ident: %s, Data length error: too little data for common netflow header. cnt: %i",fs->Ident, (int)cnt); + fs->bad_packets++; + continue; + } + + fs->received = tv; + /* Process data - have a look at the common header */ + version = ntohs(nf_header->version); + switch (version) { + case 1: + Process_v1(in_buff, cnt, fs); + break; + case 5: // fall through + case 7: + Process_v5_v7(in_buff, cnt, fs); + break; + case 9: + Process_v9(in_buff, cnt, fs); + break; + case 10: + Process_IPFIX(in_buff, cnt, fs); + break; + case 255: + // blast test header + if ( verbose ) { + uint16_t count = ntohs(nf_header->count); + if ( blast_cnt != count ) { + // LogError("Missmatch blast check: Expected %u got %u\n", blast_cnt, count); + blast_cnt = count; + blast_failures++; + } else { + blast_cnt++; + } + if ( blast_cnt == 65535 ) { + fprintf(stderr, "Total missed packets: %u\n", blast_failures); + done = 1; + } + break; + } + default: + // data error, while reading data from socket + LogError("Ident: %s, Error reading netflow header: Unexpected netflow version %i", fs->Ident, version); + fs->bad_packets++; + continue; + + // not reached + break; + } + // each Process_xx function has to process the entire input buffer, therefore it's empty now. + export_packets++; + + // flush current buffer to disc + if ( fs->nffile->block_header->size > BUFFSIZE ) { + // fishy! - we already wrote into someone elses memory! - I'm sorry + // reset output buffer - data may be lost, as we don not know, where it happen + fs->nffile->block_header->size = 0; + fs->nffile->block_header->NumRecords = 0; + fs->nffile->buff_ptr = (void *)((pointer_addr_t)fs->nffile->block_header + sizeof(data_block_header_t) ); + LogError("### Software bug ### Ident: %s, output buffer overflow: expect memory inconsitency", fs->Ident); + } + } + + if ( verbose && blast_failures ) { + fprintf(stderr, "Total missed packets: %u\n", blast_failures); + } + free(in_buff); + + fs = FlowSource; + while ( fs ) { + DisposeFile(fs->nffile); + fs = fs->next; + } + +} /* End of run */ + +int main(int argc, char **argv) { + +char *bindhost, *filter, *datadir, pidstr[32], *launch_process; +char *userid, *groupid, *checkptr, *listenport, *mcastgroup, *extension_tags; +char *Ident, *dynsrcdir, pidfile[MAXPATHLEN]; +struct stat fstat; +packet_function_t receive_packet; +send_peer_t peer; +FlowSource_t *fs; +struct sigaction act; +int family, bufflen; +time_t twin, t_start; +int sock, synctime, do_daemonize, expire, report_sequence, do_xstat; +int subdir_index, sampling_rate, compress; +int c; +#ifdef PCAP +char *pcap_file; + + pcap_file = NULL; +#endif + + receive_packet = recvfrom; + verbose = synctime = do_daemonize = 0; + bufflen = 0; + family = AF_UNSPEC; + launcher_pid = 0; + launcher_alive = 0; + report_sequence = 0; + listenport = DEFAULTCISCOPORT; + bindhost = NULL; + mcastgroup = NULL; + pidfile[0] = 0; + filter = NULL; + launch_process = NULL; + userid = groupid = NULL; + twin = TIME_WINDOW; + datadir = NULL; + subdir_index = 0; + expire = 0; + sampling_rate = 1; + compress = 0; + do_xstat = 0; + memset((void *)&peer, 0, sizeof(send_peer_t)); + peer.family = AF_UNSPEC; + Ident = "none"; + FlowSource = NULL; + extension_tags = DefaultExtensions; + dynsrcdir = NULL; + + while ((c = getopt(argc, argv, "46ef:whEVI:DB:b:j:l:M:n:p:P:R:S:s:T:t:x:Xru:g:z")) != EOF) { + switch (c) { + case 'h': + usage(argv[0]); + exit(0); + break; + case 'u': + userid = optarg; + break; + case 'g': + groupid = optarg; + break; + case 'e': + expire = 1; + break; + case 'f': { +#ifdef PCAP + struct stat fstat; + pcap_file = optarg; + stat(pcap_file, &fstat); + if ( !S_ISREG(fstat.st_mode) ) { + fprintf(stderr, "Not a regular file: %s\n", pcap_file); + exit(254); + } +#else + fprintf(stderr, "PCAP reader not compiled! Option ignored!\n"); +#endif + } break; + case 'E': + verbose = 1; + Setv6Mode(1); + break; + case 'V': + printf("%s: Version: %s\n",argv[0], nfdump_version); + exit(0); + break; + case 'X': + do_xstat = 1; + break; + case 'D': + do_daemonize = 1; + break; + case 'I': + Ident = strdup(optarg); + break; + case 'M': + dynsrcdir = strdup(optarg); + if ( strlen(dynsrcdir) > MAXPATHLEN ) { + fprintf(stderr, "ERROR: Path too long!\n"); + exit(255); + } + if ( stat(dynsrcdir, &fstat) < 0 ) { + fprintf(stderr, "stat() failed on %s: %s\n", dynsrcdir, strerror(errno)); + exit(255); + } + if ( !(fstat.st_mode & S_IFDIR) ) { + fprintf(stderr, "No such directory: %s\n", dynsrcdir); + break; + } + if ( !SetDynamicSourcesDir(&FlowSource, dynsrcdir) ) { + fprintf(stderr, "-l, -M and -n are mutually exclusive\n"); + break; + } + break; + case 'n': + if ( AddFlowSource(&FlowSource, optarg) != 1 ) + exit(255); + break; + case 'w': + synctime = 1; + break; + case 'B': + bufflen = strtol(optarg, &checkptr, 10); + if ( (checkptr != NULL && *checkptr == 0) && bufflen > 0 ) + break; + fprintf(stderr,"Argument error for -B\n"); + exit(255); + case 'b': + bindhost = optarg; + break; + case 'j': + mcastgroup = optarg; + break; + case 'p': + listenport = optarg; + break; + case 'P': + if ( optarg[0] == '/' ) { // absolute path given + strncpy(pidfile, optarg, MAXPATHLEN-1); + } else { // path relative to current working directory + char tmp[MAXPATHLEN]; + if ( !getcwd(tmp, MAXPATHLEN-1) ) { + fprintf(stderr, "Failed to get current working directory: %s\n", strerror(errno)); + exit(255); + } + tmp[MAXPATHLEN-1] = 0; + snprintf(pidfile, MAXPATHLEN - 1 - strlen(tmp), "%s/%s", tmp, optarg); + } + // pidfile now absolute path + pidfile[MAXPATHLEN-1] = 0; + break; + case 'R': { + char *p = strchr(optarg, '/'); + if ( p ) { + *p++ = '\0'; + peer.port = strdup(p); + } else { + peer.port = DEFAULTCISCOPORT; + } + peer.hostname = strdup(optarg); + + break; } + case 'r': + report_sequence = 1; + break; + case 's': + // a negative sampling rate is set as the overwrite sampling rate + sampling_rate = (int)strtol(optarg, (char **)NULL, 10); + if ( (sampling_rate == 0 ) || + (sampling_rate < 0 && sampling_rate < -10000000) || + (sampling_rate > 0 && sampling_rate > 10000000) ) { + fprintf(stderr, "Invalid sampling rate: %s\n", optarg); + exit(255); + } + break; + case 'T': { + size_t len = strlen(optarg); + extension_tags = optarg; + if ( len == 0 || len > 128 ) { + fprintf(stderr, "Extension length error. Unexpected option '%s'\n", extension_tags); + exit(255); + } + break; } + case 'l': + datadir = optarg; + if ( strlen(datadir) > MAXPATHLEN ) { + fprintf(stderr, "ERROR: Path too long!\n"); + exit(255); + } + if ( stat(datadir, &fstat) < 0 ) { + fprintf(stderr, "stat() failed on %s: %s\n", datadir, strerror(errno)); + exit(255); + } + if ( !(fstat.st_mode & S_IFDIR) ) { + fprintf(stderr, "No such directory: %s\n", datadir); + break; + } + break; + case 'S': + subdir_index = atoi(optarg); + break; + case 't': + twin = atoi(optarg); + if ( twin <= 0 ) { + fprintf(stderr, "ERROR: time frame <= 0\n"); + exit(255); + } + if (twin < 60) { + fprintf(stderr, "WARNING, Very small time frame - < 60s!\n"); + } + break; + case 'x': + launch_process = optarg; + break; + case 'z': + compress = 1; + break; + case '4': + if ( family == AF_UNSPEC ) + family = AF_INET; + else { + fprintf(stderr, "ERROR, Accepts only one protocol IPv4 or IPv6!\n"); + exit(255); + } + break; + case '6': + if ( family == AF_UNSPEC ) + family = AF_INET6; + else { + fprintf(stderr, "ERROR, Accepts only one protocol IPv4 or IPv6!\n"); + exit(255); + } + break; + default: + usage(argv[0]); + exit(255); + } + } + + if ( FlowSource == NULL && datadir == NULL && dynsrcdir == NULL ) { + fprintf(stderr, "ERROR, Missing -n (-l/-I) or -M source definitions\n"); + exit(255); + } + if ( FlowSource == NULL && datadir != NULL && !AddDefaultFlowSource(&FlowSource, Ident, datadir) ) { + fprintf(stderr, "Failed to add default data collector directory\n"); + exit(255); + } + + if ( bindhost && mcastgroup ) { + fprintf(stderr, "ERROR, -b and -j are mutually exclusive!!\n"); + exit(255); + } + + if ( do_daemonize && !InitLog(argv[0], SYSLOG_FACILITY)) { + exit(255); + } + + InitExtensionMaps(NO_EXTENSION_LIST); + SetupExtensionDescriptors(strdup(extension_tags)); + + // Debug code to read from pcap file +#ifdef PCAP + sock = 0; + if ( pcap_file ) { + printf("Setup pcap reader\n"); + setup_packethandler(pcap_file, NULL); + receive_packet = NextPacket; + } else +#endif + if ( mcastgroup ) + sock = Multicast_receive_socket (mcastgroup, listenport, family, bufflen); + else + sock = Unicast_receive_socket(bindhost, listenport, family, bufflen ); + + if ( sock == -1 ) { + fprintf(stderr,"Terminated due to errors.\n"); + exit(255); + } + + if ( peer.hostname ) { + peer.sockfd = Unicast_send_socket (peer.hostname, peer.port, peer.family, bufflen, + &peer.addr, &peer.addrlen ); + if ( peer.sockfd <= 0 ) + exit(255); + LogInfo("Replay flows to host: %s port: %s", peer.hostname, peer.port); + } + + if ( sampling_rate < 0 ) { + default_sampling = -sampling_rate; + overwrite_sampling = default_sampling; + } else { + default_sampling = sampling_rate; + } + + SetPriv(userid, groupid); + + if ( subdir_index && !InitHierPath(subdir_index) ) { + close(sock); + exit(255); + } + + // check if pid file exists and if so, if a process with registered pid is running + if ( strlen(pidfile) ) { + int pidf; + pidf = open(pidfile, O_RDONLY, 0); + if ( pidf > 0 ) { + // pid file exists + char s[32]; + ssize_t len; + len = read(pidf, (void *)s, 31); + close(pidf); + s[31] = '\0'; + if ( len < 0 ) { + fprintf(stderr, "read() error existing pid file: %s\n", strerror(errno)); + exit(255); + } else { + unsigned long pid = atol(s); + if ( pid == 0 ) { + // garbage - use this file + unlink(pidfile); + } else { + if ( kill(pid, 0) == 0 ) { + // process exists + fprintf(stderr, "A process with pid %lu registered in pidfile %s is already running!\n", + pid, strerror(errno)); + exit(255); + } else { + // no such process - use this file + unlink(pidfile); + } + } + } + } else { + if ( errno != ENOENT ) { + fprintf(stderr, "open() error existing pid file: %s\n", strerror(errno)); + exit(255); + } // else errno == ENOENT - no file - this is fine + } + } + + if (argc - optind > 1) { + usage(argv[0]); + close(sock); + exit(255); + } else { + /* user specified a pcap filter */ + filter = argv[optind]; + } + + + t_start = time(NULL); + if ( synctime ) + t_start = t_start - ( t_start % twin); + + if ( do_daemonize ) { + verbose = 0; + daemonize(); + } + if (strlen(pidfile)) { + pid_t pid = getpid(); + int pidf = open(pidfile, O_RDWR|O_TRUNC|O_CREAT, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); + if ( pidf == -1 ) { + LogError("Error opening pid file: '%s' %s", pidfile, strerror(errno)); + close(sock); + exit(255); + } + snprintf(pidstr,31,"%lu\n", (unsigned long)pid); + if ( write(pidf, pidstr, strlen(pidstr)) <= 0 ) { + LogError("Error write pid file: '%s' %s", pidfile, strerror(errno)); + } + close(pidf); + } + + done = 0; + if ( launch_process || expire ) { + // for efficiency reason, the process collecting the data + // and the process launching processes, when a new file becomes + // available are separated. Communication is done using signals + // as well as shared memory + // prepare shared memory + shmem = mmap(0, sizeof(srecord_t), PROT_READ | PROT_WRITE, MAP_ANON | MAP_SHARED, -1, 0); + if ( shmem == (caddr_t)-1 ) { + LogError("mmap() error: %s", strerror(errno)); + close(sock); + exit(255); + } + + launcher_pid = fork(); + switch (launcher_pid) { + case 0: + // child + close(sock); + launcher((char *)shmem, FlowSource, launch_process, expire); + _exit(0); + break; + case -1: + LogError("fork() error: %s", strerror(errno)); + if ( strlen(pidfile) ) + unlink(pidfile); + exit(255); + break; + default: + // parent + launcher_alive = 1; + LogInfo("Launcher[%i] forked", launcher_pid); + } + } + + fs = FlowSource; + while ( fs ) { + if ( InitBookkeeper(&fs->bookkeeper, fs->datadir, getpid(), launcher_pid) != BOOKKEEPER_OK ) { + LogError("initialize bookkeeper failed."); + + // release all already allocated bookkeepers + fs = FlowSource; + while ( fs && fs->bookkeeper ) { + ReleaseBookkeeper(fs->bookkeeper, DESTROY_BOOKKEEPER); + fs = fs->next; + } + close(sock); + if ( launcher_pid ) + kill_launcher(launcher_pid); + if ( strlen(pidfile) ) + unlink(pidfile); + exit(255); + } + + // Init the extension map list + if ( !InitExtensionMapList(fs) ) { + // error message goes to syslog + exit(255); + } + + fs = fs->next; + } + + /* Signal handling */ + memset((void *)&act,0,sizeof(struct sigaction)); + act.sa_handler = IntHandler; + sigemptyset(&act.sa_mask); + act.sa_flags = 0; + sigaction(SIGTERM, &act, NULL); + sigaction(SIGINT, &act, NULL); + sigaction(SIGHUP, &act, NULL); + sigaction(SIGALRM, &act, NULL); + sigaction(SIGCHLD, &act, NULL); + + LogInfo("Startup."); + run(receive_packet, sock, peer, twin, t_start, report_sequence, subdir_index, compress, do_xstat); + close(sock); + kill_launcher(launcher_pid); + + fs = FlowSource; + while ( fs && fs->bookkeeper ) { + dirstat_t *dirstat; + // if we do not auto expire and there is a stat file, update the stats before we leave + if ( expire == 0 && ReadStatInfo(fs->datadir, &dirstat, LOCK_IF_EXISTS) == STATFILE_OK ) { + UpdateBookStat(dirstat, fs->bookkeeper); + WriteStatInfo(dirstat); + LogInfo("Updating statinfo in directory '%s'", datadir); + } + + ReleaseBookkeeper(fs->bookkeeper, DESTROY_BOOKKEEPER); + fs = fs->next; + } + + LogInfo("Terminating nfcapd."); + EndLog(); + + if ( strlen(pidfile) ) + unlink(pidfile); + + return 0; + +} /* End of main */ diff --git a/bin/nfdump.c b/bin/nfdump.c new file mode 100644 index 0000000..35fabf1 --- /dev/null +++ b/bin/nfdump.c @@ -0,0 +1,1236 @@ +/* + * Copyright (c) 2014, Peter Haag + * Copyright (c) 2009, Peter Haag + * Copyright (c) 2004-2008, SWITCH - Teleinformatikdienste fuer Lehre und Forschung + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of the author nor the names of its contributors may be + * used to endorse or promote products derived from this software without + * specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 COPYRIGHT OWNER 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. + * + * $Author: haag $ + * + * $Id: nfdump.c 69 2010-09-09 07:17:43Z haag $ + * + * $LastChangedRevision: 69 $ + * + * + */ + +#include "config.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#ifdef HAVE_STDINT_H +#include +#endif + +#include "nffile.h" +#include "nfx.h" +#include "nfnet.h" +#include "bookkeeper.h" +#include "nfxstat.h" +#include "collector.h" +#include "exporter.h" +#include "nf_common.h" +#include "netflow_v5_v7.h" +#include "netflow_v9.h" +#include "rbtree.h" +#include "nftree.h" +#include "nfprof.h" +#include "nfdump.h" +#include "nflowcache.h" +#include "nfstat.h" +#include "nfexport.h" +#include "ipconv.h" +#include "util.h" +#include "flist.h" + +/* hash parameters */ +#define NumPrealloc 128000 + +#define AGGR_SIZE 7 + +/* Global Variables */ +FilterEngine_data_t *Engine; + +extern char *FilterFilename; +extern uint32_t loopcnt; + +#ifdef COMPAT15 +extern extension_descriptor_t extension_descriptor[]; +#endif + +/* Local Variables */ +const char *nfdump_version = VERSION; + +static uint64_t total_bytes; +static uint32_t total_flows; +static uint32_t skipped_blocks; +static uint32_t is_anonymized; +static time_t t_first_flow, t_last_flow; +static char Ident[IDENTLEN]; + + +int hash_hit = 0; +int hash_miss = 0; +int hash_skip = 0; + +extension_map_list_t *extension_map_list; + +extern generic_exporter_t **exporter_list; +/* + * Output Formats: + * User defined output formats can be compiled into nfdump, for easy access + * The format has the same syntax as describe in nfdump(1) -o fmt: + * + * A format description consists of a single line containing arbitrary strings + * and format specifier as described below: + * + * %ts // Start Time - first seen + * %te // End Time - last seen + * %td // Duration + * %pr // Protocol + * %sa // Source Address + * %da // Destination Address + * %sap // Source Address:Port + * %dap // Destination Address:Port + * %sp // Source Port + * %dp // Destination Port + * %nh // Next-hop IP Address + * %nhb // BGP Next-hop IP Address + * %sas // Source AS + * %das // Destination AS + * %in // Input Interface num + * %out // Output Interface num + * %pkt // Packets - default input + * %ipkt // Input Packets + * %opkt // Output Packets + * %byt // Bytes - default input + * %ibyt // Input Bytes + * %obyt // Output Bytes + * %fl // Flows + * %flg // TCP Flags + * %tos // Tos - Default src + * %stos // Src Tos + * %dtos // Dst Tos + * %dir // Direction: ingress, egress + * %smk // Src mask + * %dmk // Dst mask + * %fwd // Forwarding Status + * %svln // Src Vlan + * %dvln // Dst Vlan + * %ismc // Input Src Mac Addr + * %odmc // Output Dst Mac Addr + * %idmc // Output Src Mac Addr + * %osmc // Input Dst Mac Addr + * %mpls1 // MPLS label 1 + * %mpls2 // MPLS label 2 + * %mpls3 // MPLS label 3 + * %mpls4 // MPLS label 4 + * %mpls5 // MPLS label 5 + * %mpls6 // MPLS label 6 + * %mpls7 // MPLS label 7 + * %mpls8 // MPLS label 8 + * %mpls9 // MPLS label 9 + * %mpls10 // MPLS label 10 + * + * %bps // bps - bits per second + * %pps // pps - packets per second + * %bpp // bps - Bytes per package + * + * The nfdump standard output formats line, long and extended are defined as follows: + */ + +#define FORMAT_line "%ts %td %pr %sap -> %dap %pkt %byt %fl" + +#define FORMAT_long "%ts %td %pr %sap -> %dap %flg %tos %pkt %byt %fl" + +#define FORMAT_extended "%ts %td %pr %sap -> %dap %flg %tos %pkt %byt %pps %bps %bpp %fl" + +#define FORMAT_biline "%ts %td %pr %sap <-> %dap %opkt %ipkt %obyt %ibyt %fl" + +#define FORMAT_bilong "%ts %td %pr %sap <-> %dap %flg %tos %opkt %ipkt %obyt %ibyt %fl" + +#define FORMAT_nsel "%ts %evt %xevt %pr %sap -> %dap %xsap -> %xdap %ibyt %obyt" + +#define FORMAT_nel "%ts %nevt %pr %sap -> %dap %nsap -> %ndap" + +#ifdef NSEL +# define DefaultMode "nsel" +#else +# define DefaultMode "line" +#endif + +/* The appropriate header line is compiled automatically. + * + * For each defined output format a v6 long format automatically exists as well e.g. + * line -> line6, long -> long6, extended -> extended6 + * v6 long formats need more space to print IP addresses, as IPv6 addresses are printed in full length, + * where as in standard output format IPv6 addresses are condensed for better readability. + * + * Define your own output format and compile it into nfdumnp: + * 1. Define your output format string. + * 2. Test the format using standard syntax -o "fmt:" + * 3. Create a #define statement for your output format, similar than the standard output formats above. + * 4. Add another line into the printmap[] struct below BEFORE the last NULL line for you format: + * { "formatname", format_special, FORMAT_definition, NULL }, + * The first parameter is the name of your format as recognized on the command line as -o + * The second parameter is always 'format_special' - the printing function. + * The third parameter is your format definition as defined in #define. + * The forth parameter is always NULL for user defined formats. + * 5. Recompile nfdump + */ + +// Assign print functions for all output options -o +// Teminated with a NULL record +printmap_t printmap[] = { + { "raw", format_file_block_record, NULL }, + { "line", format_special, FORMAT_line }, + { "long", format_special, FORMAT_long }, + { "extended", format_special, FORMAT_extended }, + { "biline", format_special, FORMAT_biline }, + { "bilong", format_special, FORMAT_bilong }, + { "pipe", flow_record_to_pipe, NULL }, + { "csv", flow_record_to_csv, NULL }, + { "null", flow_record_to_null, NULL }, +#ifdef NSEL + { "nsel", format_special, FORMAT_nsel }, + { "nel", format_special, FORMAT_nel }, +#endif + +// add your formats here + +// This is always the last line + { NULL, NULL, NULL } +}; + +// For automatic output format generation in case of custom aggregation +#define AggrPrependFmt "%ts %td " +#define AggrAppendFmt "%pkt %byt %bps %bpp %fl" + +// compare at most 16 chars +#define MAXMODELEN 16 + +/* Function Prototypes */ +static void usage(char *name); + +static void PrintSummary(stat_record_t *stat_record, int plain_numbers, int csv_output); + +static stat_record_t process_data(char *wfile, int element_stat, int flow_stat, int sort_flows, + printer_t print_header, printer_t print_record, time_t twin_start, time_t twin_end, + uint64_t limitflows, int tag, int compress, int do_xstat); + +/* Functions */ + +#include "nfdump_inline.c" +#include "nffile_inline.c" + +static void usage(char *name) { + printf("usage %s [options] [\"filter\"]\n" + "-h\t\tthis text you see right here\n" + "-V\t\tPrint version and exit.\n" + "-a\t\tAggregate netflow data.\n" + "-A [/net]\tHow to aggregate: ',' sep list of tags see nfdump(1)\n" + "\t\tor subnet aggregation: srcip4/24, srcip6/64.\n" + "-b\t\tAggregate netflow records as bidirectional flows.\n" + "-B\t\tAggregate netflow records as bidirectional flows - Guess direction.\n" + "-r \tread input from file\n" + "-w \twrite output to file\n" + "-f\t\tread netflow filter from file\n" + "-n\t\tDefine number of top N for stat or sorted output.\n" + "-c\t\tLimit number of records to read from source(es)\n" + "-D \tUse nameserver for host lookup.\n" + "-N\t\tPrint plain numbers\n" + "-s [/]\tGenerate statistics for any valid record element.\n" + "\t\tand ordered by : packets, bytes, flows, bps pps and bpp.\n" + "-q\t\tQuiet: Do not print the header and bottom stat lines.\n" + "-H Add xstat histogram data to flow file.(default 'no')\n" + "-i \tChange Ident to in file given by -r.\n" + "-j \tCompress/Uncompress file.\n" + "-z\t\tCompress flows in output file. Used in combination with -w.\n" + "-l \tSet limit on packets for line and packed output format.\n" + "\t\tkey: 32 character string or 64 digit hex string starting with 0x.\n" + "-L \tSet limit on bytes for line and packed output format.\n" + "-I \t\tPrint netflow summary statistics info from file, specified by -r.\n" + "-M \tRead input from multiple directories.\n" + "\t\t/dir/dir1:dir2:dir3 Read the same files from '/dir/dir1' '/dir/dir2' and '/dir/dir3'.\n" + "\t\trequests either -r filename or -R firstfile:lastfile without pathnames\n" + "-m\t\tdepricated\n" + "-O Sort order for aggregated flows - tstart, tend, flows, packets bps pps bbp etc.\n" + "-R \tRead input from sequence of files.\n" + "\t\t/any/dir Read all files in that directory.\n" + "\t\t/dir/file Read all files beginning with 'file'.\n" + "\t\t/dir/file1:file2: Read all files from 'file1' to file2.\n" + "-o \tUse to print out netflow records:\n" + "\t\t raw Raw record dump.\n" + "\t\t line Standard output line format.\n" + "\t\t long Standard output line format with additional fields.\n" + "\t\t extended Even more information.\n" + "\t\t csv ',' separated, machine parseable output format.\n" + "\t\t pipe '|' separated legacy machine parseable output format.\n" + "\t\t\tmode may be extended by '6' for full IPv6 listing. e.g.long6, extended6.\n" + "-E \tPrint exporter ans sampling info for collected flows.\n" + "-v \tverify netflow data file. Print version and blocks.\n" + "-x \tverify extension records in netflow data file.\n" + "-X\t\tDump Filtertable and exit (debug option).\n" + "-Z\t\tCheck filter syntax and exit.\n" + "-t