nstreams/0040755000076600007660000000000007524025304012251 5ustar renaudrenaudnstreams/CVS/0040755000076600007660000000000007142234256012710 5ustar renaudrenaudnstreams/CVS/Root0100644000076600007660000000006107142234255013547 0ustar renaudrenaud:pserver:anonymous@cvs.nessus.org:/usr/local/cvs nstreams/CVS/Repository0100644000076600007660000000003007142234255014777 0ustar renaudrenaud/usr/local/cvs/nstreams nstreams/CVS/Entries0100644000076600007660000000077307142234256014250 0ustar renaudrenaud/.root-dir/1.1.1.1/Wed Jul 26 16:18:01 2000// /CHANGES/1.2/Thu Aug 3 09:16:20 2000// /LICENSE/1.1.1.1/Wed Jul 26 16:18:01 2000// /Makefile/1.1.1.1/Wed Jul 26 16:18:01 2000// /aclocal.m4/1.1.1.1/Wed Jul 26 16:18:01 2000// /config.guess/1.1.1.1/Wed Jul 26 16:18:01 2000// /config.sub/1.1.1.1/Wed Jul 26 16:18:01 2000// /configure/1.2/Tue Aug 1 09:57:19 2000// /configure.in/1.2/Tue Aug 1 09:57:19 2000// /install-sh/1.1.1.1/Wed Jul 26 16:18:01 2000// /nstreams.tmpl.in/1.1.1.1/Wed Jul 26 16:18:01 2000// D nstreams/CVS/Entries.Log0100644000076600007660000000005207142234256014756 0ustar renaudrenaudA D/docs//// A D/includes//// A D/src//// nstreams/docs/0040755000076600007660000000000007142234256013205 5ustar renaudrenaudnstreams/docs/CVS/0040755000076600007660000000000007142234256013640 5ustar renaudrenaudnstreams/docs/CVS/Root0100644000076600007660000000006107142234256014500 0ustar renaudrenaud:pserver:anonymous@cvs.nessus.org:/usr/local/cvs nstreams/docs/CVS/Repository0100644000076600007660000000003507142234256015735 0ustar renaudrenaud/usr/local/cvs/nstreams/docs nstreams/docs/CVS/Entries0100644000076600007660000000023507142234256015171 0ustar renaudrenaud/nstreams-networks/1.1.1.1/Wed Jul 26 16:18:01 2000// /nstreams-services/1.1.1.1/Wed Jul 26 16:18:01 2000// /nstreams.1/1.1.1.1/Wed Jul 26 16:18:01 2000// D nstreams/docs/nstreams-networks0100644000076600007660000000026307137607471016643 0ustar renaudrenaud# # nstreams Networks sample file # # Rule : first match, first taken. # private-admin:192.168.1.1/29 private-network:192.168.0.0/16 cybercable:212.198.0.0/16 internet:0.0.0.0/0 nstreams/docs/nstreams-services0100644000076600007660000000504307137607471016613 0ustar renaudrenaud# Syntax : # # service name:server port/proto:client port # # Popular icmp codes # icmp-echo-request:8/icmp:0 icmp-echo-reply:0/icmp:0 icmp-unreach:3/icmp:0-255 icmp-time exceeded in transit:11/icmp:0 # # FTP # ftp-data:20/tcp:1024-65535 ftp:21/tcp:1024-65535 # # SSH # ssh-unix:22/tcp:1010-1023 ssh (version 2 or windows or masqueraded):22/tcp:1024-65535 ssh-random:22/tcp:1-1023 # # Telnet # telnet:23/tcp:any # # SMTP # smtp:25/tcp:any # # Time # time:37/udp:1024-65535 # # nicname (whois) # nicname:43/tcp:1024-65535 # # # DNS (both udp and tcp) # dns:53/udp:any dns-tcp:53/tcp:any # # DHCP # bootps:67/udp:68 bootpc:68/udp:67 # # Gopher # gopher:70/tcp:1024-65535 # # Finger # finger:79/tcp:1024-65535 # # HTTP # http:80/tcp:1024-65535 # # pop3 # pop3:110/tcp:any # # RPC portmap # rpc-portmapper:111/udp:any # # ident # ident:113/tcp:any # # nntp # nntp:119/tcp:1024-65535 # # Network Time Protocol # ntp:123/tcp:any ntp:123/udp:any # # NetBIOS # #netbios-ns (tcp):137/tcp:1024-65535 netbios-ns (udp):137/udp:1024-65535 netbios-ns (udp):137/udp:137 #netbios-dgm (tcp):138/tcp:1024-65535 netbios-dgm (udp):138/udp:1024-65535 netbios-dgm (udp):138/udp:138 netbios-ssn (tcp):139/tcp:1024-65535 #netbios-ssn (udp):139/udp:1024-65535 # # IMAP # imap:143/tcp:1024-65535 # # SNMP # snmp:161/tcp:1024-65535 snmp-udp:161/udp:1024-65535 # # SSL # https:443/tcp:1024-65535 # # Syslog # syslog:514/udp:514 syslog-cisco:514/udp:1024-65535 # # Printer # printer:515/tcp:1-1023 # # NFS # nfs:2049/udp:1024-65535 # # standalone cvs # cvs-pserver:2401/tcp:1024-65535 # # ICQ or terabase # icq (or terabase):4000/tcp:1024-65535 # # Internet Relay Chat # irc:6665-6670/tcp:1024-65535 # # Real Audio # real-audio-tcp:7070/tcp:1024-65535 # # http proxy # http-proxy:8080/tcp:1024-65535 # # Popular Windows backdoors # (deactivated because you usually do not want to # see this traffic on your network) # #backorifice 1.x (windows backdoor):31337/udp:1024-65535 #hack'a'tack (windows backdoor):31789/udp:31790 #deepthroat (windows backdoor):2140,3150/udp:any #netsphere (windows backdoor):30100/tcp:any #netsphere-ftp (windows backdoor):30102/tcp:any #gatecrasher (windows backdoor):6969/tcp:any #portal of doom (windows backdoor):10067,10167/tcp:any #girlfriend (windows backdoor):21554/tcp:any #EvilFTP (windows backdoor):23456/tcp:any #phAse Zero (windows backdoor):555/tcp:any #SubSeven (windows backdoor):1243,6711,6776/tcp:any # # BSD passive ftpd ports # #bsd-passive-ftp:49152-65535/tcp:1024-65535 # # unix traceroute # #traceroute:33434-33700/udp:1025-65535 nstreams/docs/nstreams.10100644000076600007660000001216107137607471015130 0ustar renaudrenaud.TH nstreams 1 "July 1999" "nstreams" "Users Manuals" .SH NAME network streams - a tcpdump output analyzer .SH SYNOPSIS .B nstreams [ -v ] [ -c .I "nstreams-services" ] [ -n .I nstreams-networks_file ] [ -N [ -i ] [ -I ]] [ -r ] [ -O output [ -D iface ] [ -Y ]] [ -u ] [ -U ] [ -B ] [ -f .I "tcpdump_file" ] [ -l ] [ .I "tcpdump output" ] .SH DESCRIPTION .B nstreams is a utility designed to identify the IP streams that are occuring on a network from a non-user friendly tcpdump output of several megabytes. This is especially useful when you plan to install a firewall but if you do not know the nstreams that the network users are generating (http, real audio, and more...). .B nstreams can read the tcpdump output directly from stdin, or from a file. It can even generate the configuration file of your firewall, using the -O option. .SH OPTIONS .IP "-c " The path to an alternate nstreams service file. This file is used to identify each protocol. See the .B "services file" section later in this manual page. .IP "-n " The path to an alternate nstreams network file. This file is used to identify which hosts belong to which network. See the .B "networks file" section later in this manual page. .IP "-f " The path to the file to read data from. This file must have been generated using 'tcpdump -w filename'. .IP "-l " Listen directly on interface . This avoids the use of tcpdump. .IP -N print the networks names instead of the hosts IP addresses. The intra-network traffic will not be shown. Use this option twice to show the networks IP address instead of their names. .IP -i Also show the intra-network traffic (must be used with -N) .IP -I Only show the intra-network traffic (must be used with -N) .IP -r be redundant. That is, the same streams will be printed each time they appear in the dump. .IP -v print version number and exit. .IP "-O " output type. You can use this option to generate your firewall startup script. Do nstreams -h to see the supported output types. .IP "-D " interface to apply to output onto. Must be used with -O. .IP "-Y" The firewall rules that will be generated will deny all packets coming from the outside trying to establish connections to the inside. If you system is not serving anything, then it's safe to turn on this option. .IP "-u" Do not print the unknown streams .IP "-U" Only print the unknown streams .IP "-B" Show broadcasts and networks .SH USAGE Let tcpdump(1) run some time on your network (like one week), and save its output in a file, by doing : .br tcpdump -l -n > output .br or .br tcpdump -w filename .br Then, feed .B nstreams with this output file, and it will turn it into a easily-readable file which will help you to write efficient firewall filters. You may also do : .br tcpdump -l -n | nstreams .br or .br nstreams -f filename (if you used tcpdump -w) .br .SH "THE SERVICES FILE" The service file contains the description of each protocol, as well as their name. Its syntax is : .br protocol_name:server_port(s)/{udp,tcp}:client_ports(s) .br or : .br protocol_name:type(s)/icmp:code(s) Whereas : .IP protocol_name is the name of the protocol described. This name may contain any character, including space, except ':'. .IP server_port(s) is the range of ports used by the server. Usually, you will want to define one server port only, but you may enter any range you want. .IP ip_protocol is the IP protocol that this protocol is lying onto. Acceptable values are .I tcp and .I udp .IP client_port(s) is the range of ports that the client may use. You can set this to .I any or, for more accurate results, to ports ranges, like '1-1024,2048-4096'. .br The rules are : 'first match, first taken'. .SH "SERVICE FILE EXAMPLE" Using this syntax, you would declare the ssh protocol by : .br ssh-unix:22/tcp:1000-1023 .br Because the Unix version of the ssh client uses a privileged port to connect onto the ssh server which listens on port 22. .SH "THE NETWORKS FILE" The networks file is used to define sets and subsets of hosts (also known as networks). This avoids redundancy in the output file. The syntax format for this file is : .br network name:ip/mask .br Whereas the network name is whatever you want, the IP is the ip of the network, and the mask is the CIDR netmask of the network. The rule is 'first match, first taken'. .SH "NETWORKS FILE EXAMPLE" admin:192.168.19.0/29 .br whole_subnet:192.168.0.0/16 .br internet:0.0.0.0/0 .SH LIMITS \(bu nstreams can only parse the output of 'tcpdump -n' \(bu Even though the output of nstreams is easier to read than the one of tcpdump, it is still not easily readable. Use sort(1) on the nstream output to get a more readable file. \(bu This program could have been written in perl .SH FILES /etc/nstreams-services .br /etc/nstreams-networks .SH "SEE ALSO" tcpdump(1) .SH "AUTHORS" Concept : Herve Schauer Consultants - http://www.hsc.fr .br Coding : Renaud Deraison .SH "BUG REPORTS" Please send all your bug reports with the detail of your configuration to Renaud Deraison nstreams/.root-dir0100654000076600007660000000000007137607471014010 0ustar renaudrenaudnstreams/CHANGES0100644000076600007660000000131407524025304013240 0ustar renaudrenaud$Id: CHANGES,v 1.2 2000/08/03 09:16:20 renaud Exp $ What's new in version 1.0.3 : - Applied patch from Guillaume Morin which solved some sigsegv issues What's new in version 1.0.1 : - fixed a bug in -l mode What's new in version 0.99.3 : - corrected a bug in the handling of /32 adresses - corrected a bug with the -N option, when a IP would not match any network. What's new in version 0.99.2 : - corrected a possible segfault when nstreams was invoked with the -l option - modified parse_tcpdump.c so that it can now read RedHat's 6.1 tcpdump output while being backward compatible with the other tcpdumps - bug fixed in configure and in Makefile nstreams/LICENSE0100644000076600007660000003536707137607471013304 0ustar renaudrenaud GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 675 Mass Ave, Cambridge, MA 02139, USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. nstreams/Makefile0100644000076600007660000000132207137607471013717 0ustar renaudrenaudinclude nstreams.tmpl all : nstreams nstreams : cd src && ${MAKE} clean : cd src && ${MAKE} clean install : all $(INSTALL) -m 0755 -d ${prefix}/bin $(INSTALL) -m 0755 src/nstreams ${prefix}/bin $(INSTALL) -m 0755 -d ${prefix}/man $(INSTALL) -m 0755 -d ${prefix}/man/man1 $(INSTALL) -m 0444 docs/nstreams.1 ${prefix}/man/man1/ if [ -f ${prefix}/etc/nstreams-services ]; then mv ${prefix}/etc/nstreams-services ${prefix}/etc/nstreams-services.old;fi $(INSTALL) -m 0644 docs/nstreams-services ${prefix}/etc/nstreams-services $(INSTALL) -m 0644 docs/nstreams-networks ${prefix}/etc/nstreams-networks.sample distclean : clean rm -f includes/config.h config.cache config.status config.log nstreams.tmpl nstreams/aclocal.m40100644000076600007660000004027007137607471014124 0ustar renaudrenauddnl aclocal.m4 generated automatically by aclocal 1.2f dnl Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc. dnl This Makefile.in is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl This program is distributed in the hope that it will be useful, dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A dnl PARTICULAR PURPOSE. # Do all the work for Automake. This macro actually does too much -- # some checks are only needed if your package does certain things. # But this isn't really a big deal. # serial 1 dnl Usage: dnl AM_INIT_AUTOMAKE(package,version, [no-define]) AC_DEFUN(AM_INIT_AUTOMAKE, [AC_REQUIRE([AM_PROG_INSTALL]) PACKAGE=[$1] AC_SUBST(PACKAGE) VERSION=[$2] AC_SUBST(VERSION) dnl test to see if srcdir already configured if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) fi ifelse([$3],, AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE") AC_DEFINE_UNQUOTED(VERSION, "$VERSION")) AC_REQUIRE([AM_SANITY_CHECK]) AC_REQUIRE([AC_ARG_PROGRAM]) dnl FIXME This is truly gross. missing_dir=`cd $ac_aux_dir && pwd` AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir) AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir) AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir) AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir) AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir) AC_REQUIRE([AC_PROG_MAKE_SET])]) # serial 1 AC_DEFUN(AM_PROG_INSTALL, [AC_REQUIRE([AC_PROG_INSTALL]) test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' AC_SUBST(INSTALL_SCRIPT)dnl ]) # # Check to make sure that the build environment is sane. # AC_DEFUN(AM_SANITY_CHECK, [AC_MSG_CHECKING([whether build environment is sane]) # Just in case sleep 1 echo timestamp > conftestfile # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null` if test "[$]*" = "X"; then # -L didn't work. set X `ls -t $srcdir/configure conftestfile` fi if test "[$]*" != "X $srcdir/configure conftestfile" \ && test "[$]*" != "X conftestfile $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken alias in your environment]) fi test "[$]2" = conftestfile ) then # Ok. : else AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi rm -f conftest* AC_MSG_RESULT(yes)]) dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY) dnl The program must properly implement --version. AC_DEFUN(AM_MISSING_PROG, [AC_MSG_CHECKING(for working $2) # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. if ($2 --version) < /dev/null > /dev/null 2>&1; then $1=$2 AC_MSG_RESULT(found) else $1="$3/missing $2" AC_MSG_RESULT(missing) fi AC_SUBST($1)]) # Like AC_CONFIG_HEADER, but automatically create stamp file. AC_DEFUN(AM_CONFIG_HEADER, [AC_PREREQ([2.12]) AC_CONFIG_HEADER([$1]) dnl When config.status generates a header, we must update the stamp-h file. dnl This file resides in the same directory as the config header dnl that is generated. We must strip everything past the first ":", dnl and everything past the last "/". AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>, <>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>, <>; do case " <<$>>CONFIG_HEADERS " in *" <<$>>am_file "*<<)>> echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx ;; esac am_indx=`expr "<<$>>am_indx" + 1` done<<>>dnl>>) changequote([,]))]) # serial 24 AM_PROG_LIBTOOL AC_DEFUN(AM_PROG_LIBTOOL, [AC_REQUIRE([AM_ENABLE_SHARED])dnl AC_REQUIRE([AM_ENABLE_STATIC])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_PROG_RANLIB])dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AM_PROG_LD])dnl AC_REQUIRE([AM_PROG_NM])dnl AC_REQUIRE([AC_PROG_LN_S])dnl dnl # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' AC_SUBST(LIBTOOL)dnl # Check for any special flags to pass to ltconfig. libtool_flags= test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared" test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static" test "$silent" = yes && libtool_flags="$libtool_flags --silent" test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc" test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld" # Some flags need to be propagated to the compiler or linker for good # libtool support. case "$host" in *-*-irix6*) # Find out which ABI we are using. echo '[#]line __oline__ "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case "`/usr/bin/file conftest.o`" in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. CFLAGS="$CFLAGS -belf" ;; esac # Actually configure libtool. ac_aux_dir is where install-sh is found. CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \ LD="$LD" NM="$NM" RANLIB="$RANLIB" LN_S="$LN_S" \ ${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig \ $libtool_flags --no-verify $ac_aux_dir/ltmain.sh $host \ || AC_MSG_ERROR([libtool configure failed]) ]) # AM_ENABLE_SHARED - implement the --enable-shared flag # Usage: AM_ENABLE_SHARED[(DEFAULT)] # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to # `yes'. AC_DEFUN(AM_ENABLE_SHARED, [define([AM_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl AC_ARG_ENABLE(shared, changequote(<<, >>)dnl << --enable-shared build shared libraries [default=>>AM_ENABLE_SHARED_DEFAULT] changequote([, ])dnl [ --enable-shared=PKGS only build shared libraries if the current package appears as an element in the PKGS list], [p=${PACKAGE-default} case "$enableval" in yes) enable_shared=yes ;; no) enable_shared=no ;; *) enable_shared=no # Look at the argument we got. We use all the common list separators. IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:," for pkg in $enableval; do if test "X$pkg" = "X$p"; then enable_shared=yes fi done IFS="$ac_save_ifs" ;; esac], enable_shared=AM_ENABLE_SHARED_DEFAULT)dnl ]) # AM_DISABLE_SHARED - set the default shared flag to --disable-shared AC_DEFUN(AM_DISABLE_SHARED, [AM_ENABLE_SHARED(no)]) # AM_DISABLE_STATIC - set the default static flag to --disable-static AC_DEFUN(AM_DISABLE_STATIC, [AM_ENABLE_STATIC(no)]) # AM_ENABLE_STATIC - implement the --enable-static flag # Usage: AM_ENABLE_STATIC[(DEFAULT)] # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to # `yes'. AC_DEFUN(AM_ENABLE_STATIC, [define([AM_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl AC_ARG_ENABLE(static, changequote(<<, >>)dnl << --enable-static build static libraries [default=>>AM_ENABLE_STATIC_DEFAULT] changequote([, ])dnl [ --enable-static=PKGS only build shared libraries if the current package appears as an element in the PKGS list], [p=${PACKAGE-default} case "$enableval" in yes) enable_static=yes ;; no) enable_static=no ;; *) enable_static=no # Look at the argument we got. We use all the common list separators. IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:," for pkg in $enableval; do if test "X$pkg" = "X$p"; then enable_static=yes fi done IFS="$ac_save_ifs" ;; esac], enable_static=AM_ENABLE_STATIC_DEFAULT)dnl ]) # AM_PROG_LD - find the path to the GNU or non-GNU linker AC_DEFUN(AM_PROG_LD, [AC_ARG_WITH(gnu-ld, [ --with-gnu-ld assume the C compiler uses GNU ld [default=no]], test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no) AC_REQUIRE([AC_PROG_CC]) ac_prog=ld if test "$ac_cv_prog_gcc" = yes; then # Check if gcc -print-prog-name=ld gives a path. AC_MSG_CHECKING([for ld used by GCC]) ac_prog=`($CC -print-prog-name=ld) 2>&5` case "$ac_prog" in # Accept absolute paths. /* | [A-Za-z]:\\*) test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then AC_MSG_CHECKING([for GNU ld]) else AC_MSG_CHECKING([for non-GNU ld]) fi AC_CACHE_VAL(ac_cv_path_LD, [if test -z "$LD"; then IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" for ac_dir in $PATH; do test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog"; then ac_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some GNU ld's only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then test "$with_gnu_ld" != no && break else test "$with_gnu_ld" != yes && break fi fi done IFS="$ac_save_ifs" else ac_cv_path_LD="$LD" # Let the user override the test with a path. fi]) LD="$ac_cv_path_LD" if test -n "$LD"; then AC_MSG_RESULT($LD) else AC_MSG_RESULT(no) fi test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH]) AC_SUBST(LD) AM_PROG_LD_GNU ]) AC_DEFUN(AM_PROG_LD_GNU, [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], ac_cv_prog_gnu_ld, [# I'd rather use --version here, but apparently some GNU ld's only accept -v. if $LD -v 2>&1 &5; then ac_cv_prog_gnu_ld=yes else ac_cv_prog_gnu_ld=no fi]) ]) # AM_PROG_NM - find the path to a BSD-compatible name lister AC_DEFUN(AM_PROG_NM, [AC_MSG_CHECKING([for BSD-compatible nm]) AC_CACHE_VAL(ac_cv_path_NM, [case "$NM" in /* | [A-Za-z]:\\*) ac_cv_path_NM="$NM" # Let the user override the test with a path. ;; *) IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" for ac_dir in /usr/ucb /usr/ccs/bin $PATH /bin; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/nm; then # Check to see if the nm accepts a BSD-compat flag. # Adding the `sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then ac_cv_path_NM="$ac_dir/nm -B" elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then ac_cv_path_NM="$ac_dir/nm -p" else ac_cv_path_NM="$ac_dir/nm" fi break fi done IFS="$ac_save_ifs" test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm ;; esac]) NM="$ac_cv_path_NM" AC_MSG_RESULT([$NM]) AC_SUBST(NM) ]) # Add --enable-maintainer-mode option to configure. # From Jim Meyering # serial 1 AC_DEFUN(AM_MAINTAINER_MODE, [AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) dnl maintainer-mode is disabled by default AC_ARG_ENABLE(maintainer-mode, [ --enable-maintainer-mode enable make rules and dependencies not useful (and sometimes confusing) to the casual installer], USE_MAINTAINER_MODE=$enableval, USE_MAINTAINER_MODE=no) AC_MSG_RESULT($USE_MAINTAINER_MODE) if test $USE_MAINTAINER_MODE = yes; then MAINT= else MAINT='#M#' fi AC_SUBST(MAINT)dnl ] ) # Configure paths for GTK+ # Owen Taylor 97-11-3 dnl AM_PATH_GTK([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]]) dnl Test for GTK, and define GTK_CFLAGS and GTK_LIBS dnl AC_DEFUN(AM_PATH_GTK, [dnl dnl Get the cflags and libraries from the gtk-config script dnl AC_PATH_PROG(GTK_CONFIG, gtk-config, no) min_gtk_version=ifelse([$1], ,0.99.7,$1) AC_MSG_CHECKING(for GTK - version >= $min_gtk_version) no_gtk="" if test "$GTK_CONFIG" != "no" ; then GTK_CFLAGS=`$GTK_CONFIG --cflags` GTK_LIBS=`$GTK_CONFIG --libs` ac_save_CFLAGS="$CFLAGS" ac_save_LIBS="$LIBS" CFLAGS="$CFLAGS $GTK_CFLAGS" LIBS="$LIBS $GTK_LIBS" dnl dnl Now check if the installed GTK is sufficiently new. (Also sanity dnl checks the results of gtk-config to some extent dnl AC_TRY_RUN([ #include #include int main () { int major, minor, micro; if (sscanf("$min_gtk_version", "%d.%d.%d", &major, &minor, µ) != 3) { printf("%s, bad version string\n", "$min_gtk_version"); exit(1); } return !((gtk_major_version > major) || ((gtk_major_version == major) && (gtk_minor_version > minor)) || ((gtk_major_version == major) && (gtk_minor_version == minor) && (gtk_micro_version >= micro))); } ],, no_gtk=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"]) CFLAGS="$ac_save_CFLAGS" LIBS="$ac_save_LIBS" else no_gtk=yes fi if test "x$no_gtk" = x ; then AC_MSG_RESULT(yes) ifelse([$2], , :, [$2]) else AC_MSG_RESULT(no) GTK_CFLAGS="" GTK_LIBS="" ifelse([$3], , :, [$3]) fi AC_SUBST(GTK_CFLAGS) AC_SUBST(GTK_LIBS) ]) # serial 1 # @defmac AC_PROG_CC_STDC # @maindex PROG_CC_STDC # @ovindex CC # If the C compiler in not in ANSI C mode by default, try to add an option # to output variable @code{CC} to make it so. This macro tries various # options that select ANSI C on some system or another. It considers the # compiler to be in ANSI C mode if it handles function prototypes correctly. # # If you use this macro, you should check after calling it whether the C # compiler has been set to accept ANSI C; if not, the shell variable # @code{am_cv_prog_cc_stdc} is set to @samp{no}. If you wrote your source # code in ANSI C, you can make an un-ANSIfied copy of it by using the # program @code{ansi2knr}, which comes with Ghostscript. # @end defmac AC_DEFUN(AM_PROG_CC_STDC, [AC_REQUIRE([AC_PROG_CC]) AC_BEFORE([$0], [AC_C_INLINE]) AC_BEFORE([$0], [AC_C_CONST]) dnl Force this before AC_PROG_CPP. Some cpp's, eg on HPUX, require dnl a magic option to avoid problems with ANSI preprocessor commands dnl like #elif. dnl FIXME: can't do this because then AC_AIX won't work due to a dnl circular dependency. dnl AC_BEFORE([$0], [AC_PROG_CPP]) AC_MSG_CHECKING(for ${CC-cc} option to accept ANSI C) AC_CACHE_VAL(am_cv_prog_cc_stdc, [am_cv_prog_cc_stdc=no ac_save_CC="$CC" # Don't try gcc -ansi; that turns off useful extensions and # breaks some systems' header files. # AIX -qlanglvl=ansi # Ultrix and OSF/1 -std1 # HP-UX -Aa -D_HPUX_SOURCE # SVR4 -Xc -D__EXTENSIONS__ for ac_arg in "" -qlanglvl=ansi -std1 "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" AC_TRY_COMPILE( [#include #include #include #include /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; ], [ return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ], [am_cv_prog_cc_stdc="$ac_arg"; break]) done CC="$ac_save_CC" ]) if test -z "$am_cv_prog_cc_stdc"; then AC_MSG_RESULT([none needed]) else AC_MSG_RESULT($am_cv_prog_cc_stdc) fi case "x$am_cv_prog_cc_stdc" in x|xno) ;; *) CC="$CC $am_cv_prog_cc_stdc" ;; esac ]) nstreams/config.guess0100755000076600007660000005204707137607471014611 0ustar renaudrenaud#! /bin/sh # Attempt to guess a canonical system name. # Copyright (C) 1992, 93, 94, 95, 96, 1997 Free Software Foundation, Inc. # # This file 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. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Written by Per Bothner . # The master version of this file is at the FSF in /home/gd/gnu/lib. # # This script attempts to guess a canonical system name similar to # config.sub. If it succeeds, it prints the system name on stdout, and # exits with 0. Otherwise, it exits with 1. # # The plan is that this can be called by configure scripts if you # don't specify an explicit system type (host/target name). # # Only a few systems have been added to this list; please add others # (but try to keep the structure clean). # # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 8/24/94.) if (test -f /.attbin/uname) >/dev/null 2>&1 ; then PATH=$PATH:/.attbin ; export PATH fi UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown trap 'rm -f dummy.c dummy.o dummy; exit 1' 1 2 15 # Note: order is significant - the case branches are not exclusive. case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in alpha:OSF1:*:*) # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. echo alpha-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//'` exit 0 ;; 21064:Windows_NT:50:3) echo alpha-dec-winnt3.5 exit 0 ;; Amiga*:UNIX_System_V:4.0:*) echo m68k-cbm-sysv4 exit 0;; amiga:NetBSD:*:*) echo m68k-cbm-netbsd${UNAME_RELEASE} exit 0 ;; amiga:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; arc64:OpenBSD:*:*) echo mips64el-unknown-openbsd${UNAME_RELEASE} exit 0 ;; arc:OpenBSD:*:*) echo mipsel-unknown-openbsd${UNAME_RELEASE} exit 0 ;; hkmips:OpenBSD:*:*) echo mips-unknown-openbsd${UNAME_RELEASE} exit 0 ;; pmax:OpenBSD:*:*) echo mipsel-unknown-openbsd${UNAME_RELEASE} exit 0 ;; sgi:OpenBSD:*:*) echo mips-unknown-openbsd${UNAME_RELEASE} exit 0 ;; wgrisc:OpenBSD:*:*) echo mipsel-unknown-openbsd${UNAME_RELEASE} exit 0 ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} exit 0;; SR2?01:HI-UX/MPP:*:*) echo hppa1.1-hitachi-hiuxmpp exit 0;; Pyramid*:OSx*:*:*|MIS*:OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. if test "`(/bin/universe) 2>/dev/null`" = att ; then echo pyramid-pyramid-sysv3 else echo pyramid-pyramid-bsd fi exit 0 ;; NILE:*:*:dcosx) echo pyramid-pyramid-svr4 exit 0 ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; i86pc:SunOS:5.*:*) echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; sun4*:SunOS:*:*) case "`/usr/bin/arch -k`" in Series*|S4*) UNAME_RELEASE=`uname -v` ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` exit 0 ;; sun3*:SunOS:*:*) echo m68k-sun-sunos${UNAME_RELEASE} exit 0 ;; aushp:SunOS:*:*) echo sparc-auspex-sunos${UNAME_RELEASE} exit 0 ;; atari*:NetBSD:*:*) echo m68k-atari-netbsd${UNAME_RELEASE} exit 0 ;; atari*:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; sun3*:NetBSD:*:*) echo m68k-sun-netbsd${UNAME_RELEASE} exit 0 ;; sun3*:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; mac68k:NetBSD:*:*) echo m68k-apple-netbsd${UNAME_RELEASE} exit 0 ;; mac68k:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; mvme68k:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; mvme88k:OpenBSD:*:*) echo m88k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; powerpc:machten:*:*) echo powerpc-apple-machten${UNAME_RELEASE} exit 0 ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 exit 0 ;; RISC*:ULTRIX:*:*) echo mips-dec-ultrix${UNAME_RELEASE} exit 0 ;; VAX*:ULTRIX*:*:*) echo vax-dec-ultrix${UNAME_RELEASE} exit 0 ;; 2020:CLIX:*:*) echo clipper-intergraph-clix${UNAME_RELEASE} exit 0 ;; mips:*:*:UMIPS | mips:*:*:RISCos) sed 's/^ //' << EOF >dummy.c int main (argc, argv) int argc; char **argv; { #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_SVR4) printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); #endif #endif exit (-1); } EOF ${CC-cc} dummy.c -o dummy \ && ./dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \ && rm dummy.c dummy && exit 0 rm -f dummy.c dummy echo mips-mips-riscos${UNAME_RELEASE} exit 0 ;; Night_Hawk:Power_UNIX:*:*) echo powerpc-harris-powerunix exit 0 ;; m88k:CX/UX:7*:*) echo m88k-harris-cxux7 exit 0 ;; m88k:*:4*:R4*) echo m88k-motorola-sysv4 exit 0 ;; m88k:*:3*:R3*) echo m88k-motorola-sysv3 exit 0 ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` if [ $UNAME_PROCESSOR = mc88100 -o $UNAME_PROCESSOR = mc88110 ] ; then if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx \ -o ${TARGET_BINARY_INTERFACE}x = x ] ; then echo m88k-dg-dgux${UNAME_RELEASE} else echo m88k-dg-dguxbcs${UNAME_RELEASE} fi else echo i586-dg-dgux${UNAME_RELEASE} fi exit 0 ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) echo m88k-dolphin-sysv3 exit 0 ;; M88*:*:R3*:*) # Delta 88k system running SVR3 echo m88k-motorola-sysv3 exit 0 ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) echo m88k-tektronix-sysv3 exit 0 ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) echo m68k-tektronix-bsd exit 0 ;; *:IRIX*:*:*) echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` exit 0 ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id exit 0 ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i?86:AIX:*:*) echo i386-ibm-aix exit 0 ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then sed 's/^ //' << EOF >dummy.c #include main() { if (!__power_pc()) exit(1); puts("powerpc-ibm-aix3.2.5"); exit(0); } EOF ${CC-cc} dummy.c -o dummy && ./dummy && rm dummy.c dummy && exit 0 rm -f dummy.c dummy echo rs6000-ibm-aix3.2.5 elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then echo rs6000-ibm-aix3.2.4 else echo rs6000-ibm-aix3.2 fi exit 0 ;; *:AIX:*:4) if /usr/sbin/lsattr -EHl proc0 | grep POWER >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc fi if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=4.${UNAME_RELEASE} fi echo ${IBM_ARCH}-ibm-aix${IBM_REV} exit 0 ;; *:AIX:*:*) echo rs6000-ibm-aix exit 0 ;; ibmrt:4.4BSD:*|romp-ibm:BSD:*) echo romp-ibm-bsd4.4 exit 0 ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC NetBSD and echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to exit 0 ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) echo rs6000-bull-bosx exit 0 ;; DPX/2?00:B.O.S.:*:*) echo m68k-bull-sysv3 exit 0 ;; 9000/[34]??:4.3bsd:1.*:*) echo m68k-hp-bsd exit 0 ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) echo m68k-hp-bsd4.4 exit 0 ;; 9000/[3478]??:HP-UX:*:*) case "${UNAME_MACHINE}" in 9000/31? ) HP_ARCH=m68000 ;; 9000/[34]?? ) HP_ARCH=m68k ;; 9000/7?? | 9000/8?[1679] ) HP_ARCH=hppa1.1 ;; 9000/8?? ) HP_ARCH=hppa1.0 ;; esac HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` echo ${HP_ARCH}-hp-hpux${HPUX_REV} exit 0 ;; 3050*:HI-UX:*:*) sed 's/^ //' << EOF >dummy.c #include int main () { long cpu = sysconf (_SC_CPU_VERSION); /* The order matters, because CPU_IS_HP_MC68K erroneously returns true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct results, however. */ if (CPU_IS_PA_RISC (cpu)) { switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; default: puts ("hppa-hitachi-hiuxwe2"); break; } } else if (CPU_IS_HP_MC68K (cpu)) puts ("m68k-hitachi-hiuxwe2"); else puts ("unknown-hitachi-hiuxwe2"); exit (0); } EOF ${CC-cc} dummy.c -o dummy && ./dummy && rm dummy.c dummy && exit 0 rm -f dummy.c dummy echo unknown-hitachi-hiuxwe2 exit 0 ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) echo hppa1.1-hp-bsd exit 0 ;; 9000/8??:4.3bsd:*:*) echo hppa1.0-hp-bsd exit 0 ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) echo hppa1.1-hp-osf exit 0 ;; hp8??:OSF1:*:*) echo hppa1.0-hp-osf exit 0 ;; i?86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then echo ${UNAME_MACHINE}-unknown-osf1mk else echo ${UNAME_MACHINE}-unknown-osf1 fi exit 0 ;; parisc*:Lites*:*:*) echo hppa1.1-hp-lites exit 0 ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd exit 0 ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit 0 ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) echo c34-convex-bsd exit 0 ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) echo c38-convex-bsd exit 0 ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd exit 0 ;; CRAY*X-MP:*:*:*) echo xmp-cray-unicos exit 0 ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos${UNAME_RELEASE} exit 0 ;; CRAY*[A-Z]90:*:*:*) echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ exit 0 ;; CRAY*TS:*:*:*) echo t90-cray-unicos${UNAME_RELEASE} exit 0 ;; CRAY-2:*:*:*) echo cray2-cray-unicos exit 0 ;; F300:UNIX_System_V:*:*) FUJITSU_SYS=`uname -p | tr [A-Z] [a-z] | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` echo "f300-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit 0 ;; F301:UNIX_System_V:*:*) echo f301-fujitsu-uxpv`echo $UNAME_RELEASE | sed 's/ .*//'` exit 0 ;; hp3[0-9][05]:NetBSD:*:*) echo m68k-hp-netbsd${UNAME_RELEASE} exit 0 ;; hp300:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; i?86:BSD/386:*:* | *:BSD/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} exit 0 ;; *:FreeBSD:*:*) echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit 0 ;; *:NetBSD:*:*) echo ${UNAME_MACHINE}-unknown-netbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` exit 0 ;; *:OpenBSD:*:*) echo ${UNAME_MACHINE}-unknown-openbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` exit 0 ;; i*:CYGWIN*:*) echo i386-pc-cygwin32 exit 0 ;; p*:CYGWIN*:*) echo powerpcle-unknown-cygwin32 exit 0 ;; prep*:SunOS:5.*:*) echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; *:GNU:*:*) echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` exit 0 ;; *:Linux:*:*) # The BFD linker knows what the default object file format is, so # first see if it will tell us. ld_help_string=`ld --help 2>&1` if echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations: elf_i.86"; then echo "${UNAME_MACHINE}-pc-linux-gnu" ; exit 0 elif echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations: i.86linux"; then echo "${UNAME_MACHINE}-pc-linux-gnuaout" ; exit 0 elif echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations: i.86coff"; then echo "${UNAME_MACHINE}-pc-linux-gnucoff" ; exit 0 elif echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations: m68kelf"; then echo "${UNAME_MACHINE}-unknown-linux-gnu" ; exit 0 elif echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations: m68klinux"; then echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 elif echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations: elf32ppc"; then echo "powerpc-unknown-linux-gnu" ; exit 0 elif test "${UNAME_MACHINE}" = "alpha" ; then echo alpha-unknown-linux-gnu ; exit 0 elif test "${UNAME_MACHINE}" = "sparc" ; then echo sparc-unknown-linux-gnu ; exit 0 elif test "${UNAME_MACHINE}" = "mips" ; then cat >dummy.c </dev/null && ./dummy "${UNAME_MACHINE}" && rm dummy.c dummy && exit 0 rm -f dummy.c dummy else # Either a pre-BFD a.out linker (linux-gnuoldld) or one that does not give us # useful --help. Gcc wants to distinguish between linux-gnuoldld and linux-gnuaout. test ! -d /usr/lib/ldscripts/. \ && echo "${UNAME_MACHINE}-pc-linux-gnuoldld" && exit 0 # Determine whether the default compiler is a.out or elf cat >dummy.c </dev/null && ./dummy "${UNAME_MACHINE}" && rm dummy.c dummy && exit 0 rm -f dummy.c dummy fi ;; # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. earlier versions # are messed up and put the nodename in both sysname and nodename. i?86:DYNIX/ptx:4*:*) echo i386-sequent-sysv4 exit 0 ;; i?86:*:4.*:* | i?86:SYSTEM_V:4.*:*) if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then echo ${UNAME_MACHINE}-univel-sysv${UNAME_RELEASE} else echo ${UNAME_MACHINE}-pc-sysv${UNAME_RELEASE} fi exit 0 ;; i?86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then UNAME_REL=`(/bin/uname -X|egrep Release|sed -e 's/.*= //')` (/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486 (/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) \ && UNAME_MACHINE=i586 echo ${UNAME_MACHINE}-pc-sco$UNAME_REL else echo ${UNAME_MACHINE}-pc-sysv32 fi exit 0 ;; Intel:Mach:3*:*) echo i386-pc-mach3 exit 0 ;; paragon:*:*:*) echo i860-intel-osf1 exit 0 ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 fi exit 0 ;; mini*:CTIX:SYS*5:*) # "miniframe" echo m68010-convergent-sysv exit 0 ;; M68*:*:R3V[567]*:*) test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;; 3[34]??:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 4850:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && echo i486-ncr-sysv4.3${OS_REL} && exit 0 /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && echo i486-ncr-sysv4 && exit 0 ;; m68*:LynxOS:2.*:*) echo m68k-unknown-lynxos${UNAME_RELEASE} exit 0 ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit 0 ;; i?86:LynxOS:2.*:*) echo i386-unknown-lynxos${UNAME_RELEASE} exit 0 ;; TSUNAMI:LynxOS:2.*:*) echo sparc-unknown-lynxos${UNAME_RELEASE} exit 0 ;; rs6000:LynxOS:2.*:* | PowerPC:LynxOS:2.*:*) echo rs6000-unknown-lynxos${UNAME_RELEASE} exit 0 ;; SM[BE]S:UNIX_SV:*:*) echo mips-dde-sysv${UNAME_RELEASE} exit 0 ;; RM*:SINIX-*:*:*) echo mips-sni-sysv4 exit 0 ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` echo ${UNAME_MACHINE}-sni-sysv4 else echo ns32k-sni-sysv fi exit 0 ;; PENTIUM:CPunix:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says echo i586-unisys-sysv4 exit 0 ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm echo hppa1.1-stratus-sysv4 exit 0 ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. echo i860-stratus-sysv4 exit 0 ;; mc68*:A/UX:*:*) echo m68k-apple-aux${UNAME_RELEASE} exit 0 ;; R3000:*System_V*:*:* | R4000:UNIX_SYSV:*:*) if [ -d /usr/nec ]; then echo mips-nec-sysv${UNAME_RELEASE} else echo mips-unknown-sysv${UNAME_RELEASE} fi exit 0 ;; esac #echo '(No uname command or uname output not recognized.)' 1>&2 #echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 cat >dummy.c < # include #endif main () { #if defined (sony) #if defined (MIPSEB) /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, I don't know.... */ printf ("mips-sony-bsd\n"); exit (0); #else #include printf ("m68k-sony-newsos%s\n", #ifdef NEWSOS4 "4" #else "" #endif ); exit (0); #endif #endif #if defined (__arm) && defined (__acorn) && defined (__unix) printf ("arm-acorn-riscix"); exit (0); #endif #if defined (hp300) && !defined (hpux) printf ("m68k-hp-bsd\n"); exit (0); #endif #if defined (NeXT) #if !defined (__ARCHITECTURE__) #define __ARCHITECTURE__ "m68k" #endif int version; version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); exit (0); #endif #if defined (MULTIMAX) || defined (n16) #if defined (UMAXV) printf ("ns32k-encore-sysv\n"); exit (0); #else #if defined (CMU) printf ("ns32k-encore-mach\n"); exit (0); #else printf ("ns32k-encore-bsd\n"); exit (0); #endif #endif #endif #if defined (__386BSD__) printf ("i386-pc-bsd\n"); exit (0); #endif #if defined (sequent) #if defined (i386) printf ("i386-sequent-dynix\n"); exit (0); #endif #if defined (ns32000) printf ("ns32k-sequent-dynix\n"); exit (0); #endif #endif #if defined (_SEQUENT_) struct utsname un; uname(&un); if (strncmp(un.version, "V2", 2) == 0) { printf ("i386-sequent-ptx2\n"); exit (0); } if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ printf ("i386-sequent-ptx1\n"); exit (0); } printf ("i386-sequent-ptx\n"); exit (0); #endif #if defined (vax) #if !defined (ultrix) printf ("vax-dec-bsd\n"); exit (0); #else printf ("vax-dec-ultrix\n"); exit (0); #endif #endif #if defined (alliant) && defined (i860) printf ("i860-alliant-bsd\n"); exit (0); #endif exit (1); } EOF ${CC-cc} dummy.c -o dummy 2>/dev/null && ./dummy && rm dummy.c dummy && exit 0 rm -f dummy.c dummy # Apollos put the system type in the environment. test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; } # Convex versions that predate uname can use getsysinfo(1) if [ -x /usr/convex/getsysinfo ] then case `getsysinfo -f cpu_type` in c1*) echo c1-convex-bsd exit 0 ;; c2*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit 0 ;; c34*) echo c34-convex-bsd exit 0 ;; c38*) echo c38-convex-bsd exit 0 ;; c4*) echo c4-convex-bsd exit 0 ;; esac fi #echo '(Unable to guess system type)' 1>&2 exit 1 nstreams/config.sub0100755000076600007660000004600507137607471014251 0ustar renaudrenaud#! /bin/sh # Configuration validation subroutine script, version 1.1. # Copyright (C) 1991, 92, 93, 94, 95, 1996 Free Software Foundation, Inc. # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software # can handle that machine. It does not imply ALL GNU software can. # # This file 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. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, # Boston, MA 02111-1307, USA. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. # If it is invalid, we print an error message on stderr and exit with code 1. # Otherwise, we print the canonical config type on stdout and succeed. # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases # that are meaningful with *any* GNU software. # Each package is responsible for reporting which valid configurations # it does not support. The user should be able to distinguish # a failure to support a valid configuration from a meaningless # configuration. # The goal of this file is to map all the various variations of a given # machine specification into a single specification in the form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or in some cases, the newer four-part form: # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. if [ x$1 = x ] then echo Configuration name missing. 1>&2 echo "Usage: $0 CPU-MFR-OPSYS" 1>&2 echo "or $0 ALIAS" 1>&2 echo where ALIAS is a recognized configuration type. 1>&2 exit 1 fi # First pass through any local machine types. case $1 in *local*) echo $1 exit 0 ;; *) ;; esac # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in linux-gnu*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; *) basic_machine=`echo $1 | sed 's/-[^-]*$//'` if [ $basic_machine != $1 ] then os=`echo $1 | sed 's/.*-/-/'` else os=; fi ;; esac ### Let's recognize common machines as not being operating systems so ### that things like config.sub decstation-3100 work. We also ### recognize some manufacturers as not being operating systems, so we ### can provide default operating systems below. case $os in -sun*os*) # Prevent following clause from handling this invalid input. ;; -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ -apple) os= basic_machine=$1 ;; -hiux*) os=-hiuxwe2 ;; -sco5) os=sco3.2v5 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco4) os=-sco3.2v4 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2.[4-9]*) os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2v[4-9]*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco*) os=-sco3.2v2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -isc) os=-isc2.2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -clix*) basic_machine=clipper-intergraph ;; -isc*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -lynx*) os=-lynxos ;; -ptx*) basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` ;; -windowsnt*) os=`echo $os | sed -e 's/windowsnt/winnt/'` ;; -psos*) os=-psos ;; esac # Decode aliases for certain CPU-COMPANY combinations. case $basic_machine in # Recognize the basic CPU types without company name. # Some are omitted here because they have special meanings below. tahoe | i860 | m32r | m68k | m68000 | m88k | ns32k | arm \ | arme[lb] | pyramid | mn10300 \ | tron | a29k | 580 | i960 | h8300 | hppa | hppa1.0 | hppa1.1 \ | alpha | we32k | ns16k | clipper | i370 | sh \ | powerpc | powerpcle | 1750a | dsp16xx | mips64 | mipsel \ | pdp11 | mips64el | mips64orion | mips64orionel \ | sparc | sparclet | sparclite | sparc64) basic_machine=$basic_machine-unknown ;; # We use `pc' rather than `unknown' # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. i[3456]86) basic_machine=$basic_machine-pc ;; # Object if more than one company name word. *-*-*) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; # Recognize the basic CPU types with company name. vax-* | tahoe-* | i[3456]86-* | i860-* | m32r-* | m68k-* | m68000-* \ | m88k-* | sparc-* | ns32k-* | fx80-* | arm-* | c[123]* \ | mips-* | pyramid-* | tron-* | a29k-* | romp-* | rs6000-* | power-* \ | none-* | 580-* | cray2-* | h8300-* | i960-* | xmp-* | ymp-* \ | hppa-* | hppa1.0-* | hppa1.1-* | alpha-* | we32k-* | cydra-* | ns16k-* \ | pn-* | np1-* | xps100-* | clipper-* | orion-* | sparclite-* \ | pdp11-* | sh-* | powerpc-* | powerpcle-* | sparc64-* | mips64-* | mipsel-* \ | mips64el-* | mips64orion-* | mips64orionel-* | f301-*) ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) basic_machine=m68000-att ;; 3b*) basic_machine=we32k-att ;; alliant | fx80) basic_machine=fx80-alliant ;; altos | altos3068) basic_machine=m68k-altos ;; am29k) basic_machine=a29k-none os=-bsd ;; amdahl) basic_machine=580-amdahl os=-sysv ;; amiga | amiga-*) basic_machine=m68k-cbm ;; amigados) basic_machine=m68k-cbm os=-amigados ;; amigaunix | amix) basic_machine=m68k-cbm os=-sysv4 ;; apollo68) basic_machine=m68k-apollo os=-sysv ;; aux) basic_machine=m68k-apple os=-aux ;; balance) basic_machine=ns32k-sequent os=-dynix ;; convex-c1) basic_machine=c1-convex os=-bsd ;; convex-c2) basic_machine=c2-convex os=-bsd ;; convex-c32) basic_machine=c32-convex os=-bsd ;; convex-c34) basic_machine=c34-convex os=-bsd ;; convex-c38) basic_machine=c38-convex os=-bsd ;; cray | ymp) basic_machine=ymp-cray os=-unicos ;; cray2) basic_machine=cray2-cray os=-unicos ;; [ctj]90-cray) basic_machine=c90-cray os=-unicos ;; crds | unos) basic_machine=m68k-crds ;; da30 | da30-*) basic_machine=m68k-da30 ;; decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) basic_machine=mips-dec ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) basic_machine=m68k-motorola ;; delta88) basic_machine=m88k-motorola os=-sysv3 ;; dpx20 | dpx20-*) basic_machine=rs6000-bull os=-bosx ;; dpx2* | dpx2*-bull) basic_machine=m68k-bull os=-sysv3 ;; ebmon29k) basic_machine=a29k-amd os=-ebmon ;; elxsi) basic_machine=elxsi-elxsi os=-bsd ;; encore | umax | mmax) basic_machine=ns32k-encore ;; fx2800) basic_machine=i860-alliant ;; genix) basic_machine=ns32k-ns ;; gmicro) basic_machine=tron-gmicro os=-sysv ;; h3050r* | hiux*) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; h8300hms) basic_machine=h8300-hitachi os=-hms ;; harris) basic_machine=m88k-harris os=-sysv3 ;; hp300-*) basic_machine=m68k-hp ;; hp300bsd) basic_machine=m68k-hp os=-bsd ;; hp300hpux) basic_machine=m68k-hp os=-hpux ;; hp9k2[0-9][0-9] | hp9k31[0-9]) basic_machine=m68000-hp ;; hp9k3[2-9][0-9]) basic_machine=m68k-hp ;; hp9k7[0-9][0-9] | hp7[0-9][0-9] | hp9k8[0-9]7 | hp8[0-9]7) basic_machine=hppa1.1-hp ;; hp9k8[0-9][0-9] | hp8[0-9][0-9]) basic_machine=hppa1.0-hp ;; hppa-next) os=-nextstep3 ;; i370-ibm* | ibm*) basic_machine=i370-ibm os=-mvs ;; # I'm not sure what "Sysv32" means. Should this be sysv3.2? i[3456]86v32) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv32 ;; i[3456]86v4*) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv4 ;; i[3456]86v) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv ;; i[3456]86sol2) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-solaris2 ;; iris | iris4d) basic_machine=mips-sgi case $os in -irix*) ;; *) os=-irix4 ;; esac ;; isi68 | isi) basic_machine=m68k-isi os=-sysv ;; m88k-omron*) basic_machine=m88k-omron ;; magnum | m3230) basic_machine=mips-mips os=-sysv ;; merlin) basic_machine=ns32k-utek os=-sysv ;; miniframe) basic_machine=m68000-convergent ;; mipsel*-linux*) basic_machine=mipsel-unknown os=-linux ;; mips*-linux*) basic_machine=mips-unknown os=-linux ;; mips3*-*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` ;; mips3*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown ;; ncr3000) basic_machine=i486-ncr os=-sysv4 ;; news | news700 | news800 | news900) basic_machine=m68k-sony os=-newsos ;; news1000) basic_machine=m68030-sony os=-newsos ;; news-3600 | risc-news) basic_machine=mips-sony os=-newsos ;; next | m*-next ) basic_machine=m68k-next case $os in -nextstep* ) ;; -ns2*) os=-nextstep2 ;; *) os=-nextstep3 ;; esac ;; nh3000) basic_machine=m68k-harris os=-cxux ;; nh[45]000) basic_machine=m88k-harris os=-cxux ;; nindy960) basic_machine=i960-intel os=-nindy ;; np1) basic_machine=np1-gould ;; pa-hitachi) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; paragon) basic_machine=i860-intel os=-osf ;; pbd) basic_machine=sparc-tti ;; pbb) basic_machine=m68k-tti ;; pc532 | pc532-*) basic_machine=ns32k-pc532 ;; pentium | p5) basic_machine=i586-intel ;; pentiumpro | p6) basic_machine=i686-intel ;; pentium-* | p5-*) basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumpro-* | p6-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; k5) # We don't have specific support for AMD's K5 yet, so just call it a Pentium basic_machine=i586-amd ;; nexen) # We don't have specific support for Nexgen yet, so just call it a Pentium basic_machine=i586-nexgen ;; pn) basic_machine=pn-gould ;; power) basic_machine=rs6000-ibm ;; ppc) basic_machine=powerpc-unknown ;; ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppcle | powerpclittle | ppc-le | powerpc-little) basic_machine=powerpcle-unknown ;; ppcle-* | powerpclittle-*) basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ps2) basic_machine=i386-ibm ;; rm[46]00) basic_machine=mips-siemens ;; rtpc | rtpc-*) basic_machine=romp-ibm ;; sequent) basic_machine=i386-sequent ;; sh) basic_machine=sh-hitachi os=-hms ;; sps7) basic_machine=m68k-bull os=-sysv2 ;; spur) basic_machine=spur-unknown ;; sun2) basic_machine=m68000-sun ;; sun2os3) basic_machine=m68000-sun os=-sunos3 ;; sun2os4) basic_machine=m68000-sun os=-sunos4 ;; sun3os3) basic_machine=m68k-sun os=-sunos3 ;; sun3os4) basic_machine=m68k-sun os=-sunos4 ;; sun4os3) basic_machine=sparc-sun os=-sunos3 ;; sun4os4) basic_machine=sparc-sun os=-sunos4 ;; sun4sol2) basic_machine=sparc-sun os=-solaris2 ;; sun3 | sun3-*) basic_machine=m68k-sun ;; sun4) basic_machine=sparc-sun ;; sun386 | sun386i | roadrunner) basic_machine=i386-sun ;; symmetry) basic_machine=i386-sequent os=-dynix ;; tower | tower-32) basic_machine=m68k-ncr ;; udi29k) basic_machine=a29k-amd os=-udi ;; ultra3) basic_machine=a29k-nyu os=-sym1 ;; vaxv) basic_machine=vax-dec os=-sysv ;; vms) basic_machine=vax-dec os=-vms ;; vpp*|vx|vx-*) basic_machine=f301-fujitsu ;; vxworks960) basic_machine=i960-wrs os=-vxworks ;; vxworks68) basic_machine=m68k-wrs os=-vxworks ;; vxworks29k) basic_machine=a29k-wrs os=-vxworks ;; xmp) basic_machine=xmp-cray os=-unicos ;; xps | xps100) basic_machine=xps100-honeywell ;; none) basic_machine=none-none os=-none ;; # Here we handle the default manufacturer of certain CPU types. It is in # some cases the only manufacturer, in others, it is the most popular. mips) if [ x$os = x-linux ]; then basic_machine=mips-unknown else basic_machine=mips-mips fi ;; romp) basic_machine=romp-ibm ;; rs6000) basic_machine=rs6000-ibm ;; vax) basic_machine=vax-dec ;; pdp11) basic_machine=pdp11-dec ;; we32k) basic_machine=we32k-att ;; sparc) basic_machine=sparc-sun ;; cydra) basic_machine=cydra-cydrome ;; orion) basic_machine=orion-highlevel ;; orion105) basic_machine=clipper-highlevel ;; *) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; esac # Here we canonicalize certain aliases for manufacturers. case $basic_machine in *-digital*) basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` ;; *-commodore*) basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` ;; *) ;; esac # Decode manufacturer-specific aliases for certain operating systems. if [ x"$os" != x"" ] then case $os in # First match some system type aliases # that might get confused with valid system types. # -solaris* is a basic system type, with this one exception. -solaris1 | -solaris1.*) os=`echo $os | sed -e 's|solaris1|sunos4|'` ;; -solaris) os=-solaris2 ;; -unixware* | svr4*) os=-sysv4 ;; -gnu/linux*) os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` ;; # First accept the basic system types. # The portable systems comes first. # Each alternative MUST END IN A *, to match a version number. # -sysv* is not here because it comes later, after sysvr4. -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ | -amigados* | -msdos* | -newsos* | -unicos* | -aof* | -aos* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -netbsd* | -openbsd* | -freebsd* | -riscix* \ | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -cygwin32* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -linux-gnu* | -uxpv*) # Remember, each alternative MUST END IN *, to match a version number. ;; -linux*) os=`echo $os | sed -e 's|linux|linux-gnu|'` ;; -sunos5*) os=`echo $os | sed -e 's|sunos5|solaris2|'` ;; -sunos6*) os=`echo $os | sed -e 's|sunos6|solaris3|'` ;; -osfrose*) os=-osfrose ;; -osf*) os=-osf ;; -utek*) os=-bsd ;; -dynix*) os=-bsd ;; -acis*) os=-aos ;; -ctix* | -uts*) os=-sysv ;; -ns2 ) os=-nextstep2 ;; # Preserve the version number of sinix5. -sinix5.*) os=`echo $os | sed -e 's|sinix|sysv|'` ;; -sinix*) os=-sysv4 ;; -triton*) os=-sysv3 ;; -oss*) os=-sysv3 ;; -svr4) os=-sysv4 ;; -svr3) os=-sysv3 ;; -sysvr4) os=-sysv4 ;; # This must come after -sysvr4. -sysv*) ;; -xenix) os=-xenix ;; -none) ;; *) # Get rid of the `-' at the beginning of $os. os=`echo $os | sed 's/[^-]*-//'` echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 exit 1 ;; esac else # Here we handle the default operating systems that come with various machines. # The value should be what the vendor currently ships out the door with their # machine or put another way, the most popular os provided with the machine. # Note that if you're going to try to match "-MANUFACTURER" here (say, # "-sun"), then you have to tell the case statement up towards the top # that MANUFACTURER isn't an operating system. Otherwise, code above # will signal an error saying that MANUFACTURER isn't an operating # system, and we'll never get to this point. case $basic_machine in *-acorn) os=-riscix1.2 ;; arm*-semi) os=-aout ;; pdp11-*) os=-none ;; *-dec | vax-*) os=-ultrix4.2 ;; m68*-apollo) os=-domain ;; i386-sun) os=-sunos4.0.2 ;; m68000-sun) os=-sunos3 # This also exists in the configure program, but was not the # default. # os=-sunos4 ;; *-tti) # must be before sparc entry or we get the wrong os. os=-sysv3 ;; sparc-* | *-sun) os=-sunos4.1.1 ;; *-ibm) os=-aix ;; *-hp) os=-hpux ;; *-hitachi) os=-hiux ;; i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) os=-sysv ;; *-cbm) os=-amigados ;; *-dg) os=-dgux ;; *-dolphin) os=-sysv3 ;; m68k-ccur) os=-rtu ;; m88k-omron*) os=-luna ;; *-next ) os=-nextstep ;; *-sequent) os=-ptx ;; *-crds) os=-unos ;; *-ns) os=-genix ;; i370-*) os=-mvs ;; *-next) os=-nextstep3 ;; *-gould) os=-sysv ;; *-highlevel) os=-bsd ;; *-encore) os=-bsd ;; *-sgi) os=-irix ;; *-siemens) os=-sysv4 ;; *-masscomp) os=-rtu ;; f301-fujitsu) os=-uxpv ;; *) os=-none ;; esac fi # Here we handle the case where we know the os, and the CPU type, but not the # manufacturer. We pick the logical manufacturer. vendor=unknown case $basic_machine in *-unknown) case $os in -riscix*) vendor=acorn ;; -sunos*) vendor=sun ;; -aix*) vendor=ibm ;; -hpux*) vendor=hp ;; -hiux*) vendor=hitachi ;; -unos*) vendor=crds ;; -dgux*) vendor=dg ;; -luna*) vendor=omron ;; -genix*) vendor=ns ;; -mvs*) vendor=ibm ;; -ptx*) vendor=sequent ;; -vxsim* | -vxworks*) vendor=wrs ;; -aux*) vendor=apple ;; esac basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` ;; esac echo $basic_machine$os nstreams/configure0100755000076600007660000014352407141517377014201 0ustar renaudrenaud#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated automatically using autoconf version 2.13 # Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. # # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. # Defaults: ac_help= ac_default_prefix=/usr/local # Any additions from configure.in: ac_default_prefix="/usr/local" # Initialize some variables set by options. # The variables have the same names as the options, with # dashes changed to underlines. build=NONE cache_file=./config.cache exec_prefix=NONE host=NONE no_create= nonopt=NONE no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= target=NONE verbose= x_includes=NONE x_libraries=NONE bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datadir='${prefix}/share' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' libdir='${exec_prefix}/lib' includedir='${prefix}/include' oldincludedir='/usr/include' infodir='${prefix}/info' mandir='${prefix}/man' # Initialize some other variables. subdirs= MFLAGS= MAKEFLAGS= SHELL=${CONFIG_SHELL-/bin/sh} # Maximum number of lines to put in a shell here document. ac_max_here_lines=12 ac_prev= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval "$ac_prev=\$ac_option" ac_prev= continue fi case "$ac_option" in -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;; *) ac_optarg= ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case "$ac_option" in -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir="$ac_optarg" ;; -build | --build | --buil | --bui | --bu) ac_prev=build ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build="$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" ;; -datadir | --datadir | --datadi | --datad | --data | --dat | --da) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ | --da=*) datadir="$ac_optarg" ;; -disable-* | --disable-*) ac_feature=`echo $ac_option|sed -e 's/-*disable-//'` # Reject names that are not valid shell variable names. if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } fi ac_feature=`echo $ac_feature| sed 's/-/_/g'` eval "enable_${ac_feature}=no" ;; -enable-* | --enable-*) ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'` # Reject names that are not valid shell variable names. if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } fi ac_feature=`echo $ac_feature| sed 's/-/_/g'` case "$ac_option" in *=*) ;; *) ac_optarg=yes ;; esac eval "enable_${ac_feature}='$ac_optarg'" ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix="$ac_optarg" ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he) # 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 << EOF Usage: configure [options] [host] Options: [defaults in brackets after descriptions] Configuration: --cache-file=FILE cache test results in FILE --help print this message --no-create do not create output files --quiet, --silent do not print \`checking...' messages --version print the version of autoconf that created configure Directory and file names: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [same as prefix] --bindir=DIR user executables in DIR [EPREFIX/bin] --sbindir=DIR system admin executables in DIR [EPREFIX/sbin] --libexecdir=DIR program executables in DIR [EPREFIX/libexec] --datadir=DIR read-only architecture-independent data in DIR [PREFIX/share] --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data in DIR [PREFIX/com] --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var] --libdir=DIR object code libraries in DIR [EPREFIX/lib] --includedir=DIR C header files in DIR [PREFIX/include] --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include] --infodir=DIR info documentation in DIR [PREFIX/info] --mandir=DIR man documentation in DIR [PREFIX/man] --srcdir=DIR find the sources in DIR [configure dir or ..] --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 EOF cat << EOF Host type: --build=BUILD configure for building on BUILD [BUILD=HOST] --host=HOST configure for HOST [guessed] --target=TARGET configure for TARGET [TARGET=HOST] Features and packages: --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --x-includes=DIR X include files are in DIR --x-libraries=DIR X library files are in DIR EOF if test -n "$ac_help"; then echo "--enable and --with options recognized:$ac_help" fi exit 0 ;; -host | --host | --hos | --ho) ac_prev=host ;; -host=* | --host=* | --hos=* | --ho=*) host="$ac_optarg" ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir="$ac_optarg" ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir="$ac_optarg" ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir="$ac_optarg" ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir="$ac_optarg" ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst \ | --locals | --local | --loca | --loc | --lo) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* \ | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) localstatedir="$ac_optarg" ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir="$ac_optarg" ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir="$ac_optarg" ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix="$ac_optarg" ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix="$ac_optarg" ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix="$ac_optarg" ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name="$ac_optarg" ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir="$ac_optarg" ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir="$ac_optarg" ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site="$ac_optarg" ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir="$ac_optarg" ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir="$ac_optarg" ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target="$ac_optarg" ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers) echo "configure generated by autoconf version 2.13" exit 0 ;; -with-* | --with-*) ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'` # Reject names that are not valid shell variable names. if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } fi ac_package=`echo $ac_package| sed 's/-/_/g'` case "$ac_option" in *=*) ;; *) ac_optarg=yes ;; esac eval "with_${ac_package}='$ac_optarg'" ;; -without-* | --without-*) ac_package=`echo $ac_option|sed -e 's/-*without-//'` # Reject names that are not valid shell variable names. if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } fi ac_package=`echo $ac_package| sed 's/-/_/g'` eval "with_${ac_package}=no" ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes="$ac_optarg" ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries="$ac_optarg" ;; -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; } ;; *) if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then echo "configure: warning: $ac_option: invalid host type" 1>&2 fi if test "x$nonopt" != xNONE; then { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } fi nonopt="$ac_option" ;; esac done if test -n "$ac_prev"; then { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; } fi trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 # File descriptor usage: # 0 standard input # 1 file creation # 2 errors and warnings # 3 some systems may open it to /dev/tty # 4 used on the Kubota Titan # 6 checking for... messages and results # 5 compiler messages saved in config.log if test "$silent" = yes; then exec 6>/dev/null else exec 6>&1 fi exec 5>./config.log echo "\ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. " 1>&5 # Strip out --no-create and --no-recursion so they do not pile up. # Also quote any args containing shell metacharacters. ac_configure_args= for ac_arg do case "$ac_arg" in -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c) ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;; *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*) ac_configure_args="$ac_configure_args '$ac_arg'" ;; *) ac_configure_args="$ac_configure_args $ac_arg" ;; esac done # NLS nuisances. # Only set these to C if already set. These must not be set unconditionally # because not all systems understand e.g. LANG=C (notably SCO). # Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'! # Non-C LC_CTYPE values break the ctype check. if test "${LANG+set}" = set; then LANG=C; export LANG; fi if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -rf conftest* confdefs.h # AIX cpp loses on an empty file, so make sure it contains at least a newline. echo > confdefs.h # A filename unique to this package, relative to the directory that # configure is in, which we can look for to find out if srcdir is correct. ac_unique_file=.root-dir # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then its parent. ac_prog=$0 ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'` test "x$ac_confdir" = "x$ac_prog" && ac_confdir=. srcdir=$ac_confdir if test ! -r $srcdir/$ac_unique_file; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r $srcdir/$ac_unique_file; then if test "$ac_srcdir_defaulted" = yes; then { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; } else { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; } fi fi srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'` # Prefer explicitly selected file to automatically selected ones. if test -z "$CONFIG_SITE"; then if test "x$prefix" != xNONE; then CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" else CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" fi fi for ac_site_file in $CONFIG_SITE; do if test -r "$ac_site_file"; then echo "loading site script $ac_site_file" . "$ac_site_file" fi done if test -r "$cache_file"; then echo "loading cache $cache_file" . $cache_file else echo "creating cache $cache_file" > $cache_file fi ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. ac_cpp='$CPP $CPPFLAGS' ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' cross_compiling=$ac_cv_prog_cc_cross ac_exeext= ac_objext=o if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then ac_n= ac_c=' ' ac_t=' ' else ac_n=-n ac_c= ac_t= fi else ac_n= ac_c='\c' ac_t= fi # From configure.in Revision: 1.1.1.1 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 fi done if test -z "$ac_aux_dir"; then { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; } fi ac_config_guess=$ac_aux_dir/config.guess ac_config_sub=$ac_aux_dir/config.sub ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. # Do some error checking and defaulting for the host and target type. # The inputs are: # configure --host=HOST --target=TARGET --build=BUILD NONOPT # # The rules are: # 1. You are not allowed to specify --host, --target, and nonopt at the # same time. # 2. Host defaults to nonopt. # 3. If nonopt is not specified, then host defaults to the current host, # as determined by config.guess. # 4. Target and build default to nonopt. # 5. If nonopt is not specified, then target and build default to host. # The aliases save the names the user supplied, while $host etc. # will get canonicalized. case $host---$target---$nonopt in NONE---*---* | *---NONE---* | *---*---NONE) ;; *) { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } ;; esac # Make sure we can run config.sub. if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then : else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; } fi echo $ac_n "checking host system type""... $ac_c" 1>&6 echo "configure:573: checking host system type" >&5 host_alias=$host case "$host_alias" in NONE) case $nonopt in NONE) if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then : else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; } fi ;; *) host_alias=$nonopt ;; esac ;; esac host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias` host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` echo "$ac_t""$host" 1>&6 echo $ac_n "checking target system type""... $ac_c" 1>&6 echo "configure:594: checking target system type" >&5 target_alias=$target case "$target_alias" in NONE) case $nonopt in NONE) target_alias=$host_alias ;; *) target_alias=$nonopt ;; esac ;; esac target=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $target_alias` target_cpu=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` target_vendor=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` target_os=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` echo "$ac_t""$target" 1>&6 echo $ac_n "checking build system type""... $ac_c" 1>&6 echo "configure:612: checking build system type" >&5 build_alias=$build case "$build_alias" in NONE) case $nonopt in NONE) build_alias=$host_alias ;; *) build_alias=$nonopt ;; esac ;; esac build=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $build_alias` build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` echo "$ac_t""$build" 1>&6 test "$host_alias" != "$target_alias" && test "$program_prefix$program_suffix$program_transform_name" = \ NONENONEs,x,x, && program_prefix=${target_alias}- ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. ac_cpp='$CPP $CPPFLAGS' ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' cross_compiling=$ac_cv_prog_cc_cross PWDD=`pwd` # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 echo "configure:651: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" ac_dummy="$PATH" for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then ac_cv_prog_CC="gcc" break fi done IFS="$ac_save_ifs" fi fi CC="$ac_cv_prog_CC" if test -n "$CC"; then echo "$ac_t""$CC" 1>&6 else echo "$ac_t""no" 1>&6 fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 echo "configure:681: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" ac_prog_rejected=no ac_dummy="$PATH" for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" break fi done IFS="$ac_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 $# -gt 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift set dummy "$ac_dir/$ac_word" "$@" shift ac_cv_prog_CC="$@" fi fi fi fi CC="$ac_cv_prog_CC" if test -n "$CC"; then echo "$ac_t""$CC" 1>&6 else echo "$ac_t""no" 1>&6 fi if test -z "$CC"; then case "`uname -s`" in *win32* | *WIN32*) # Extract the first word of "cl", so it can be a program name with args. set dummy cl; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 echo "configure:732: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" ac_dummy="$PATH" for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then ac_cv_prog_CC="cl" break fi done IFS="$ac_save_ifs" fi fi CC="$ac_cv_prog_CC" if test -n "$CC"; then echo "$ac_t""$CC" 1>&6 else echo "$ac_t""no" 1>&6 fi ;; esac fi test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; } fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 echo "configure:764: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. ac_cpp='$CPP $CPPFLAGS' ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' cross_compiling=$ac_cv_prog_cc_cross cat > conftest.$ac_ext << EOF #line 775 "configure" #include "confdefs.h" main(){return(0);} EOF if { (eval echo configure:780: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ac_cv_prog_cc_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then ac_cv_prog_cc_cross=no else ac_cv_prog_cc_cross=yes fi else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_prog_cc_works=no fi rm -fr conftest* ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. ac_cpp='$CPP $CPPFLAGS' ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' cross_compiling=$ac_cv_prog_cc_cross echo "$ac_t""$ac_cv_prog_cc_works" 1>&6 if test $ac_cv_prog_cc_works = no; then { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 echo "configure:806: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 cross_compiling=$ac_cv_prog_cc_cross echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 echo "configure:811: checking whether we are using GNU C" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.c <&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gcc=yes else ac_cv_prog_gcc=no fi fi echo "$ac_t""$ac_cv_prog_gcc" 1>&6 if test $ac_cv_prog_gcc = yes; then GCC=yes else GCC= fi ac_test_CFLAGS="${CFLAGS+set}" ac_save_CFLAGS="$CFLAGS" CFLAGS= echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 echo "configure:839: checking whether ${CC-cc} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else echo 'void f(){}' > conftest.c if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then ac_cv_prog_cc_g=yes else ac_cv_prog_cc_g=no fi rm -f conftest* fi echo "$ac_t""$ac_cv_prog_cc_g" 1>&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 echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 echo "configure:871: checking whether ${MAKE-make} sets \${MAKE}" >&5 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftestmake <<\EOF all: @echo 'ac_maketemp="${MAKE}"' EOF # GNU make sometimes prints "make[1]: Entering...", which would confuse us. eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=` if test -n "$ac_maketemp"; then eval ac_cv_prog_make_${ac_make}_set=yes else eval ac_cv_prog_make_${ac_make}_set=no fi rm -f conftestmake fi if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then echo "$ac_t""yes" 1>&6 SET_MAKE= else echo "$ac_t""no" 1>&6 SET_MAKE="MAKE=${MAKE-make}" fi # 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 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 echo "configure:909: checking for a BSD compatible install" >&5 if test -z "$INSTALL"; then if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" for ac_dir in $PATH; do # Account for people who put trailing slashes in PATH elements. case "$ac_dir/" in /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do if test -f $ac_dir/$ac_prog; then if test $ac_prog = install && grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : else ac_cv_path_install="$ac_dir/$ac_prog -c" break 2 fi fi done ;; esac done IFS="$ac_save_IFS" fi if test "${ac_cv_path_install+set}" = set; then INSTALL="$ac_cv_path_install" else # As a last resort, use the slow shell script. We don't cache a # path for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the path is relative. INSTALL="$ac_install_sh" fi fi echo "$ac_t""$INSTALL" 1>&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_PROGRAM}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 echo "configure:962: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else # This must be in double quotes, not single quotes, because CPP may get # substituted into the Makefile and "${CC-cc}" will confuse make. CPP="${CC-cc} -E" # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" { (eval echo configure:983: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : else echo "$ac_err" >&5 echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" { (eval echo configure:1000: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : else echo "$ac_err" >&5 echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* CPP="${CC-cc} -nologo -E" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" { (eval echo configure:1017: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : else echo "$ac_err" >&5 echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* CPP=/lib/cpp fi rm -f conftest* fi rm -f conftest* fi rm -f conftest* ac_cv_prog_CPP="$CPP" fi CPP="$ac_cv_prog_CPP" else ac_cv_prog_CPP="$CPP" fi echo "$ac_t""$CPP" 1>&6 for ac_hdr in errno.h sys/types.h netinet/in.h sys/socket.h netdb.h \ arpa/inet.h string.h signal.h netinet/in_systm.h sys/types.h sys/time.h \ unistd.h ctype.h getopt.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 echo "configure:1047: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" { (eval echo configure:1057: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* eval "ac_cv_header_$ac_safe=yes" else echo "$ac_err" >&5 echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_header_$ac_safe=no" fi rm -f conftest* fi if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then echo "$ac_t""yes" 1>&6 ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` cat >> confdefs.h <&6 fi done CFLAGS="$CFLAGS -I/usr/include/pcap" echo $ac_n "checking for pcap_open_live in -lpcap""... $ac_c" 1>&6 echo "configure:1088: checking for pcap_open_live in -lpcap" >&5 ac_lib_var=`echo pcap'_'pcap_open_live | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-lpcap $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=no" fi rm -f conftest* LIBS="$ac_save_LIBS" fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 ac_tr_lib=HAVE_LIB`echo pcap | sed -e 's/[^a-zA-Z0-9_]/_/g' \ -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` cat >> confdefs.h <&6 { echo "configure: error: "*** You need the pcap library"" 1>&2; exit 1; } fi test "$prefix" = NONE && prefix=/usr/local sysconfdir=${prefix}/etc cat >> confdefs.h <> confdefs.h <&6 echo "configure:1149: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func(); int main() { /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$ac_func) || defined (__stub___$ac_func) choke me #else $ac_func(); #endif ; return 0; } EOF if { (eval echo configure:1177: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_func_$ac_func=no" fi rm -f conftest* fi if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then echo "$ac_t""yes" 1>&6 ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` cat >> confdefs.h <&6 fi done trap '' 1 2 15 cat > confcache <<\EOF # 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. It is not useful on other systems. # If it contains results you don't want to keep, you may remove or edit it. # # By default, configure uses ./config.cache as the cache file, # creating it if it does not exist already. You can give configure # the --cache-file=FILE option to use a different cache file; that is # what configure does when it calls configure scripts in # subdirectories, so they share the cache. # Giving --cache-file=/dev/null disables caching, for debugging configure. # config.status only pays attention to the cache file if you give it the # --recheck option to rerun configure. # EOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, don't put newlines in cache variables' values. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. (set) 2>&1 | case `(ac_space=' '; set | grep ac_space) 2>&1` in *ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote substitution # turns \\\\ into \\, and sed turns \\ into \). sed -n \ -e "s/'/'\\\\''/g" \ -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p" ;; *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p' ;; esac >> confcache if cmp -s $cache_file confcache; then : else if test -w $cache_file; then echo "updating cache $cache_file" cat confcache > $cache_file else echo "not updating unwritable cache $cache_file" fi fi rm -f confcache trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' # Any assignment to VPATH causes Sun make to only execute # the first set of double-colon rules, so remove it if not needed. # If there is a colon in the path, we need to keep it. if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d' fi trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15 DEFS=-DHAVE_CONFIG_H # Without the "./", some shells look in PATH for config.status. : ${CONFIG_STATUS=./config.status} echo creating $CONFIG_STATUS rm -f $CONFIG_STATUS cat > $CONFIG_STATUS </dev/null | sed 1q`: # # $0 $ac_configure_args # # Compiler output produced by configure, useful for debugging # configure, is in ./config.log if it exists. ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]" for ac_option do case "\$ac_option" in -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion" exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;; -version | --version | --versio | --versi | --vers | --ver | --ve | --v) echo "$CONFIG_STATUS generated by autoconf version 2.13" exit 0 ;; -help | --help | --hel | --he | --h) echo "\$ac_cs_usage"; exit 0 ;; *) echo "\$ac_cs_usage"; exit 1 ;; esac done ac_given_srcdir=$srcdir ac_given_INSTALL="$INSTALL" trap 'rm -fr `echo "nstreams.tmpl includes/config.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 EOF cat >> $CONFIG_STATUS < conftest.subs <<\\CEOF $ac_vpsub $extrasub s%@SHELL@%$SHELL%g s%@CFLAGS@%$CFLAGS%g s%@CPPFLAGS@%$CPPFLAGS%g s%@CXXFLAGS@%$CXXFLAGS%g s%@FFLAGS@%$FFLAGS%g s%@DEFS@%$DEFS%g s%@LDFLAGS@%$LDFLAGS%g s%@LIBS@%$LIBS%g s%@exec_prefix@%$exec_prefix%g s%@prefix@%$prefix%g s%@program_transform_name@%$program_transform_name%g s%@bindir@%$bindir%g s%@sbindir@%$sbindir%g s%@libexecdir@%$libexecdir%g s%@datadir@%$datadir%g s%@sysconfdir@%$sysconfdir%g s%@sharedstatedir@%$sharedstatedir%g s%@localstatedir@%$localstatedir%g s%@libdir@%$libdir%g s%@includedir@%$includedir%g s%@oldincludedir@%$oldincludedir%g s%@infodir@%$infodir%g s%@mandir@%$mandir%g s%@host@%$host%g s%@host_alias@%$host_alias%g s%@host_cpu@%$host_cpu%g s%@host_vendor@%$host_vendor%g s%@host_os@%$host_os%g s%@target@%$target%g s%@target_alias@%$target_alias%g s%@target_cpu@%$target_cpu%g s%@target_vendor@%$target_vendor%g s%@target_os@%$target_os%g s%@build@%$build%g s%@build_alias@%$build_alias%g s%@build_cpu@%$build_cpu%g s%@build_vendor@%$build_vendor%g s%@build_os@%$build_os%g s%@CC@%$CC%g s%@SET_MAKE@%$SET_MAKE%g s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g s%@INSTALL_DATA@%$INSTALL_DATA%g s%@CPP@%$CPP%g s%@PWDD@%$PWDD%g CEOF EOF cat >> $CONFIG_STATUS <<\EOF # Split the substitutions into bite-sized pieces for seds with # small command number limits, like on Digital OSF/1 and HP-UX. ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script. ac_file=1 # Number of current file. ac_beg=1 # First line for current file. ac_end=$ac_max_sed_cmds # Line after last line for current file. ac_more_lines=: ac_sed_cmds="" while $ac_more_lines; do if test $ac_beg -gt 1; then sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file else sed "${ac_end}q" conftest.subs > conftest.s$ac_file fi if test ! -s conftest.s$ac_file; then ac_more_lines=false rm -f conftest.s$ac_file else if test -z "$ac_sed_cmds"; then ac_sed_cmds="sed -f conftest.s$ac_file" else ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file" fi ac_file=`expr $ac_file + 1` ac_beg=$ac_end ac_end=`expr $ac_end + $ac_max_sed_cmds` fi done if test -z "$ac_sed_cmds"; then ac_sed_cmds=cat fi EOF cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". case "$ac_file" in *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; *) ac_file_in="${ac_file}.in" ;; esac # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories. # Remove last slash and all that follows it. Not all systems have dirname. ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then # The file is in a subdirectory. test ! -d "$ac_dir" && mkdir "$ac_dir" ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`" # A "../" for each directory in $ac_dir_suffix. ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'` else ac_dir_suffix= ac_dots= fi case "$ac_given_srcdir" in .) srcdir=. if test -z "$ac_dots"; then top_srcdir=. else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;; /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;; *) # Relative path. srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix" top_srcdir="$ac_dots$ac_given_srcdir" ;; esac case "$ac_given_INSTALL" in [/$]*) INSTALL="$ac_given_INSTALL" ;; *) INSTALL="$ac_dots$ac_given_INSTALL" ;; esac echo creating "$ac_file" rm -f "$ac_file" configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure." case "$ac_file" in *Makefile*) ac_comsub="1i\\ # $configure_input" ;; *) ac_comsub= ;; esac ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` sed -e "$ac_comsub s%@configure_input@%$configure_input%g s%@srcdir@%$srcdir%g s%@top_srcdir@%$top_srcdir%g s%@INSTALL@%$INSTALL%g " $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file fi; done rm -f conftest.s* # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where # NAME is the cpp macro being defined and VALUE is the value it is being given. # # ac_d sets the value in "#define NAME VALUE" lines. ac_dA='s%^\([ ]*\)#\([ ]*define[ ][ ]*\)' ac_dB='\([ ][ ]*\)[^ ]*%\1#\2' ac_dC='\3' ac_dD='%g' # ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE". ac_uA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' ac_uB='\([ ]\)%\1#\2define\3' ac_uC=' ' ac_uD='\4%g' # ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE". ac_eA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' ac_eB='$%\1#\2define\3' ac_eC=' ' ac_eD='%g' if test "${CONFIG_HEADERS+set}" != set; then EOF cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF fi for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". case "$ac_file" in *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; *) ac_file_in="${ac_file}.in" ;; esac echo creating $ac_file rm -f conftest.frag conftest.in conftest.out ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` cat $ac_file_inputs > conftest.in EOF # Transform confdefs.h into a sed script conftest.vals that substitutes # the proper values into config.h.in to produce config.h. And first: # Protect against being on the right side of a sed subst in config.status. # Protect against being in an unquoted here document in config.status. rm -f conftest.vals cat > conftest.hdr <<\EOF s/[\\&%]/\\&/g s%[\\$`]%\\&%g s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp s%ac_d%ac_u%gp s%ac_u%ac_e%gp EOF sed -n -f conftest.hdr confdefs.h > conftest.vals rm -f conftest.hdr # This sed command replaces #undef with comments. This is necessary, for # example, in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. cat >> conftest.vals <<\EOF s%^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */% EOF # Break up conftest.vals because some shells have a limit on # the size of here documents, and old seds have small limits too. rm -f conftest.tail while : do ac_lines=`grep -c . conftest.vals` # grep -c gives empty output for an empty file on some AIX systems. if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi # Write a limited-size here document to conftest.frag. echo ' cat > conftest.frag <> $CONFIG_STATUS sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS echo 'CEOF sed -f conftest.frag conftest.in > conftest.out rm -f conftest.in mv conftest.out conftest.in ' >> $CONFIG_STATUS sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail rm -f conftest.vals mv conftest.tail conftest.vals done rm -f conftest.vals cat >> $CONFIG_STATUS <<\EOF rm -f conftest.frag conftest.h echo "/* $ac_file. Generated automatically by configure. */" > conftest.h cat conftest.in >> conftest.h rm -f conftest.in if cmp -s $ac_file conftest.h 2>/dev/null; then echo "$ac_file is unchanged" rm -f conftest.h else # Remove last slash and all that follows it. Not all systems have dirname. ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then # The file is in a subdirectory. test ! -d "$ac_dir" && mkdir "$ac_dir" fi rm -f $ac_file mv conftest.h $ac_file fi fi; done EOF cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF exit 0 EOF chmod +x $CONFIG_STATUS rm -fr confdefs* $ac_clean_files test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1 nstreams/configure.in0100644000076600007660000000162507141517377014576 0ustar renaudrenauddnl dnl autoconf script for nstreams dnl AC_INIT(.root-dir) AC_REVISION($Revision: 1.2 $)dnl AC_CANONICAL_SYSTEM dnl Set up the main lines of the config script AC_CONFIG_HEADER(includes/config.h) AC_PREFIX_DEFAULT("/usr/local") AC_LANG_C PWDD=`pwd` dnl Check for several programs AC_PROG_CC AC_PROG_MAKE_SET AC_PROG_INSTALL AC_CHECK_HEADERS(errno.h sys/types.h netinet/in.h sys/socket.h netdb.h \ arpa/inet.h string.h signal.h netinet/in_systm.h sys/types.h sys/time.h \ unistd.h ctype.h getopt.h) CFLAGS="$CFLAGS -I/usr/include/pcap" AC_CHECK_LIB(pcap, pcap_open_live,,AC_ERROR("*** You need the pcap library")) test "$prefix" = NONE && prefix=/usr/local sysconfdir=${prefix}/etc AC_DEFINE_UNQUOTED(ETC_NSTREAMS_NETWORKS, "${prefix}/etc/nstreams-networks") AC_DEFINE_UNQUOTED(ETC_NSTREAMS_SERVICES, "${prefix}/etc/nstreams-services") AC_CHECK_FUNCS(bzero inet_ntoa) AC_SUBST(PWDD) AC_OUTPUT(nstreams.tmpl) nstreams/install-sh0100755000076600007660000001124407137607471014267 0ustar renaudrenaud#! /bin/sh # # install - install a program, script, or datafile # This comes from X11R5. # # Calling this script install-sh is preferred over install.sh, to prevent # `make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. # # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit="${DOITPROG-}" # put in absolute paths if you don't have them in your path; or use env. vars. mvprog="${MVPROG-mv}" cpprog="${CPPROG-cp}" chmodprog="${CHMODPROG-chmod}" chownprog="${CHOWNPROG-chown}" chgrpprog="${CHGRPPROG-chgrp}" stripprog="${STRIPPROG-strip}" rmprog="${RMPROG-rm}" mkdirprog="${MKDIRPROG-mkdir}" tranformbasename="" transform_arg="" instcmd="$mvprog" chmodcmd="$chmodprog 0755" chowncmd="" chgrpcmd="" stripcmd="" rmcmd="$rmprog -f" mvcmd="$mvprog" src="" dst="" dir_arg="" while [ x"$1" != x ]; do case $1 in -c) instcmd="$cpprog" shift continue;; -d) dir_arg=true shift continue;; -m) chmodcmd="$chmodprog $2" shift shift continue;; -o) chowncmd="$chownprog $2" shift shift continue;; -g) chgrpcmd="$chgrpprog $2" shift shift continue;; -s) stripcmd="$stripprog" shift continue;; -t=*) transformarg=`echo $1 | sed 's/-t=//'` shift continue;; -b=*) transformbasename=`echo $1 | sed 's/-b=//'` shift continue;; *) if [ x"$src" = x ] then src=$1 else # this colon is to work around a 386BSD /bin/sh bug : dst=$1 fi shift continue;; esac done if [ x"$src" = x ] then echo "install: no input file specified" exit 1 else true fi if [ x"$dir_arg" != x ]; then dst=$src src="" if [ -d $dst ]; then instcmd=: else instcmd=mkdir fi else # Waiting for this to be detected by the "$instcmd $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if [ -f $src -o -d $src ] then true else echo "install: $src does not exist" exit 1 fi if [ x"$dst" = x ] then echo "install: no destination specified" exit 1 else true fi # If destination is a directory, append the input filename; if your system # does not like double slashes in filenames, you may need to add some logic if [ -d $dst ] then dst="$dst"/`basename $src` else true fi fi ## this sed command emulates the dirname command dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` # Make sure that the destination directory exists. # this part is taken from Noah Friedman's mkinstalldirs script # Skip lots of stat calls in the usual case. if [ ! -d "$dstdir" ]; then defaultIFS=' ' IFS="${IFS-${defaultIFS}}" oIFS="${IFS}" # Some sh's can't handle IFS=/ for some reason. IFS='%' set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'` IFS="${oIFS}" pathcomp='' while [ $# -ne 0 ] ; do pathcomp="${pathcomp}${1}" shift if [ ! -d "${pathcomp}" ] ; then $mkdirprog "${pathcomp}" else true fi pathcomp="${pathcomp}/" done fi if [ x"$dir_arg" != x ] then $doit $instcmd $dst && if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi && if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi && if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi && if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi else # If we're going to rename the final executable, determine the name now. if [ x"$transformarg" = x ] then dstfile=`basename $dst` else dstfile=`basename $dst $transformbasename | sed $transformarg`$transformbasename fi # don't allow the sed command to completely eliminate the filename if [ x"$dstfile" = x ] then dstfile=`basename $dst` else true fi # Make a temp file name in the proper directory. dsttmp=$dstdir/#inst.$$# # Move or copy the file name to the temp name $doit $instcmd $src $dsttmp && trap "rm -f ${dsttmp}" 0 && # and set any options; do chmod last to preserve setuid bits # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $instcmd $src $dsttmp" command. if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi && if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi && if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi && if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi && # Now rename the file to the real destination. $doit $rmcmd -f $dstdir/$dstfile && $doit $mvcmd $dsttmp $dstdir/$dstfile fi && exit 0 nstreams/nstreams.tmpl.in0100644000076600007660000000077307137607471015427 0ustar renaudrenaudtop_builddir=@PWDD@ rootdir=@PWDD@ SHELL = /bin/sh # Autoconf installation directories prefix=@prefix@ exec_prefix=@exec_prefix@ bindir=@bindir@ sbindir=@sbindir@ libexecdir=@libexecdir@ datadir=@datadir@ sysconfdir=@sysconfdir@ sharedstatedir=@sharedstatedir@ localstatedir=@localstatedir@ libdir=@libdir@ includedir=@includedir@ oldincludedir=@oldincludedir@ infodir=@infodir@ mandir=@mandir@ CC=@CC@ CFLAGS=@CFLAGS@ $(CWARN) -I$(includedir) -I$(rootdir)/includes DEFS=$(CFLAGS) INSTALL=./install-sh -c nstreams/includes/0040755000076600007660000000000007524025165014064 5ustar renaudrenaudnstreams/includes/CVS/0040755000076600007660000000000007142234435014515 5ustar renaudrenaudnstreams/includes/CVS/Root0100644000076600007660000000006107142234256015356 0ustar renaudrenaud:pserver:anonymous@cvs.nessus.org:/usr/local/cvs nstreams/includes/CVS/Repository0100644000076600007660000000004107142234256016610 0ustar renaudrenaud/usr/local/cvs/nstreams/includes nstreams/includes/CVS/Entries0100644000076600007660000000013507142234435016045 0ustar renaudrenaud/includes.h/1.1.1.1/Wed Jul 26 16:18:01 2000// /config.h.in/1.2/Thu Aug 3 09:19:24 2000// D nstreams/includes/config.h.in0100644000076600007660000000113307524025164016101 0ustar renaudrenaud#ifndef __FILTER_RULES__CONFIG_H__ #define __FILTER_RULES__CONFIG_H__ #undef HAVE_ERRNO_H #undef HAVE_SYS_TYPES_H #undef HAVE_NETINET_IN_H #undef HAVE_SYS_SOCKET_H #undef HAVE_NETDB_H #undef HAVE_ARPA_INET_H #undef HAVE_STRING_H #undef HAVE_SIGNAL_H #undef HAVE_PCAP_H #undef HAVE_NETINET_IN_SYSTM_H #undef HAVE_SYS_TYPES_H #undef HAVE_SYS_TIME_H #undef HAVE_UNISTD_H #undef HAVE_GETOPT_H #undef HAVE_CTYPE_H #undef HAVE_BZERO #undef HAVE_INET_ATON #ifndef HAVE_BZERO #define bzero(b,y) memset(b,0,y) #endif #define VERSION "1.0.3" #undef ETC_NSTREAMS_NETWORKS #undef ETC_NSTREAMS_SERVICES #endif nstreams/includes/includes.h0100644000076600007660000000157607137607471016057 0ustar renaudrenaud#ifndef IPCHECK_INCLUDES_H__ #define IPCHECK_INCLUDES_H__ #include #include #include #ifdef HAVE_ERRNO_H #include #endif #ifdef HAVE_SYS_TYPES_H #include #endif #ifdef HAVE_NETINET_IN_H #include #endif #ifdef HAVE_SYS_SOCKET_H #include #endif #ifdef HAVE_NETDB_H #include #endif #ifdef HAVE_ARPA_INET_H #include #endif #ifdef HAVE_STRING_H #include #endif #ifdef HAVE_SIGNAL_H #include #endif #ifdef HAVE_NETINET_IN_SYSTM_H #include #endif #ifdef HAVE_SYS_TYPES_H #include #endif #ifdef HAVE_SYS_TIME_H #include #endif #ifdef HAVE_UNISTD_H #include #endif #ifdef HAVE_GETOPT_H #include #else extern char * optarg; #endif #ifdef HAVE_CTYPE_H #include #endif #endif nstreams/src/0040755000076600007660000000000007445155732013053 5ustar renaudrenaudnstreams/src/CVS/0040755000076600007660000000000007142234257013500 5ustar renaudrenaudnstreams/src/CVS/Root0100644000076600007660000000006107142234256014337 0ustar renaudrenaud:pserver:anonymous@cvs.nessus.org:/usr/local/cvs nstreams/src/CVS/Repository0100644000076600007660000000003407142234256015573 0ustar renaudrenaud/usr/local/cvs/nstreams/src nstreams/src/CVS/Entries0100644000076600007660000000136007142234257015031 0ustar renaudrenaud/Makefile/1.1.1.1/Wed Jul 26 16:18:01 2000// /cache.c/1.1.1.1/Wed Jul 26 16:18:01 2000// /cache.h/1.1.1.1/Wed Jul 26 16:18:01 2000// /config_rules.c/1.1.1.1/Wed Jul 26 16:18:01 2000// /config_rules.h/1.1.1.1/Wed Jul 26 16:18:01 2000// /networks.c/1.1.1.1/Wed Jul 26 16:18:01 2000// /networks.h/1.1.1.1/Wed Jul 26 16:18:01 2000// /nstreams.c/1.2/Tue Aug 1 09:58:11 2000// /output.c/1.1.1.1/Wed Jul 26 16:18:01 2000// /output.h/1.1.1.1/Wed Jul 26 16:18:01 2000// /parse_tcpdump.c/1.1.1.1/Wed Jul 26 16:18:01 2000// /parse_tcpdump.h/1.1.1.1/Wed Jul 26 16:18:01 2000// /ports.c/1.1.1.1/Wed Jul 26 16:18:01 2000// /ports.h/1.1.1.1/Wed Jul 26 16:18:01 2000// /read_pcap.c/1.1.1.1/Wed Jul 26 16:18:01 2000// /read_pcap.h/1.1.1.1/Wed Jul 26 16:18:01 2000// D nstreams/src/Makefile0100654000076600007660000000130207137607471014505 0ustar renaudrenaudinclude ../nstreams.tmpl OBJS=nstreams.o parse_tcpdump.o config_rules.o ports.o cache.o \ networks.o output.o read_pcap.o COMPILE=$(CC) $(CFLAGS) LIBS=-lpcap all : nstreams nstreams : $(OBJS) $(COMPILE) $(OBJS) -o nstreams $(LIBS) nstreams.o : nstreams.c $(COMPILE) -c nstreams.c parse_tcpdump.o : parse_tcpdump.c $(COMPILE) -c parse_tcpdump.c read_pcap.o : read_pcap.c $(COMPILE) -c read_pcap.c config_rules.o : config_rules.c $(COMPILE) -c config_rules.c ports.o : ports.c $(COMPILE) -c ports.c cache.o : cache.c $(COMPILE) -c cache.c networks.o : networks.c $(COMPILE) -c networks.c output.o : output.c output.h $(COMPILE) -c output.c clean : rm -f $(OBJS) nstreams nstreams/src/cache.c0100644000076600007660000000514407445155377014270 0ustar renaudrenaud/* nstreams * Copyright (C) 1999 Herve Schauer Consultants and Renaud Deraison * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * */ /* * $Id: cache.c,v 1.1.1.1 2000/07/26 16:18:01 renaud Exp $ * * Author : Renaud Deraison * */ #include #include "parse_tcpdump.h" #include "cache.h" /* * The 'cache' is used to determine whether we should * print a stream on the screen or not (no need to say the * same thing twice). * * The 'cache' structure is a simply linked list. Because the order is not * important, we add elements in front of the list. */ /* * returns 1 if the stream in 'dump' is already present * in the cache */ int present_in_cache(cache, name, dump) struct cache * cache; char * name; struct tcpdump * dump; { while(cache) { if((cache->proto == dump->proto) && !strcmp(name, cache->name)) { /* * the prototype between dump and cache are the * same, and so is the service name. We only have * to check for the addresses */ if((cache->src.s_addr == dump->src.s_addr)) { /* * check that the streams have at least one port in * common */ if(cache->dst.s_addr == dump->dst.s_addr){ /* * Only pay attention to the server port * for non icmp streams */ if(dump->proto != IPPROTO_ICMP) { if(dump->ports[1]==cache->dport)return(1); } else if(dump->ports[0] == cache->sport)return(1); } } } cache = cache->next; } return(0); } /* * add the stream in 'dump' in the cache. */ void add_in_cache(pcache, name, dump) struct cache ** pcache; char * name; struct tcpdump * dump; { struct cache * toadd; toadd = (struct cache *) malloc(sizeof(struct cache)); toadd->name = name; toadd->src.s_addr = dump->src.s_addr; toadd->dst.s_addr = dump->dst.s_addr; toadd->sport = dump->ports[0]; toadd->dport = dump->ports[1]; toadd->proto = dump->proto; toadd->next = *pcache; *pcache = toadd; } nstreams/src/cache.h0100644000076600007660000000047307445155377014275 0ustar renaudrenaud#ifndef CACHE_H__ #define CACHE_H__ struct cache { char * name; struct in_addr src; struct in_addr dst; u_short sport; u_short dport; int proto; struct cache * next; }; int present_in_cache(struct cache *, char *, struct tcpdump *); void add_in_cache(struct cache **, char *, struct tcpdump *); #endif nstreams/src/config_rules.c0100644000076600007660000001416007524025142015662 0ustar renaudrenaud/* nstreams * Copyright (C) 1999 Herve Schauer Consultants and Renaud Deraison * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * */ /* * $Id: config_rules.c,v 1.1.1.1 2000/07/26 16:18:01 renaud Exp $ * * Author : Renaud Deraison * */ #include #include "parse_tcpdump.h" #include "ports.h" #include "config_rules.h" /* * This part of the source is in charge of reading /etc/nstreams-services * and to determine whether a stream matches a given service or not */ /* * get the rule that matches the properties of the stream */ struct config_rules * get_rule(cr, dump) struct config_rules * cr; struct tcpdump * dump; { while(cr) { if(cr->proto == dump->proto) /* * first check that the prototypes are the * same */ { int s = 0,d = 0; /* s = source, d = dest */ /* * check that the first end of the stream matches either the * source (s) or the destination (d) */ if((s=port_in_ports(dump->ports[0], cr->sports, cr->num_sport))|| (d=port_in_ports(dump->ports[0], cr->dports, cr->num_dport))) { if((dump->proto == IPPROTO_ICMP)&&d){ /* don't mix types and codes with ICMP */ cr=cr->next; continue; } /* * and check that the other end matches the other end */ if(port_in_ports(dump->ports[1], s?cr->dports:cr->sports, s?cr->num_dport:cr->num_sport)) { if(s) { if((dump->flags != TCP_SYN)) { /* don't mix ICMP */ if(dump->proto != IPPROTO_ICMP) { /* * We need to swap the source and the destination, since * we found it the other way * * 'src' must be the server, and 'dst' the client * */ struct in_addr t; int port; t.s_addr = dump->src.s_addr; port = dump->ports[0]; dump->ports[0] = dump->ports[1]; dump->ports[1] = port; dump->src.s_addr = dump->dst.s_addr; dump->dst.s_addr = t.s_addr; } } else { cr = cr->next; continue; } } /* ok, found. Return it */ return(cr); } } } cr = cr->next; } /* no rule match this one */ return(NULL); } /* * Initialize the rules table. We use a caching technique * in ports.c to reduce memory consumption. And this works :) */ struct config_rules * read_config(fd) FILE *fd; { struct config_rules * cr, *c, *old=NULL; char * str; char * any = "1-65535"; c = cr = malloc(sizeof(struct config_rules)); bzero(cr, sizeof(struct config_rules)); str = malloc(1024); bzero(str, 1024); while(fgets(str, 1023, fd)) { /* str : one line in our configuration file */ char * s = str; /* skip the first spaces and/or tabs */ while((s[0]==' ')||(s[0]=='\t'))s++; /* remove the carriage returns */ while(strlen(s) && ((s[strlen(s)-1]=='\n')||(s[strlen(s)-1]=='\r')))s[strlen(s)-1]=0; /* remove the trailing spaces */ while(strlen(s) && ((s[strlen(s)-1]==' ')||(s[strlen(s)-1]=='\t')))s[strlen(s)-1]=0; /* * Treat this entry if and only if it's not a comment * (not starting by '#') */ if((s[0]!='#')&&(strlen(s)>1)) { /* * the syntax of the configuration file is * 'servicename:ports/proto:ports' */ char * t = strchr(s, ':'); /* * t points on the first ':'. that is, * t = ':ports/proto:ports' */ if(!t){ printf("Syntax error in the configuration file:\n\t%s\n", str); exit(1); } /* * end the string */ t[0]=0; /* * Copy the service name. */ c->name = strdup(s); /* * restore the string */ t[0]=':'; /* * s=t+1, that is 'ports/proto:ports' */ s = t+1; t = strchr(s, '/'); /* * t = '/proto:ports' */ if(!t){ printf("Syntax error in the configuration file:\n\t%s\n", str); exit(1); } t[0]=0; /* * s = 'ports'. Do a expression-to-array conversion */ c->sports = getports(s, &c->num_sport); if(strcmp(s, "any"))c->asc_sports = strdup(s); else c->asc_sports = strdup(any); /* restore the string */ t[0]='/'; s=t+1; /* * s = 'proto:ports' */ /* * t = ':ports' */ t = strchr(s, ':'); if(!t){ printf("Syntax error in the configuration file:\n\t%s\n", str); exit(1); } t[0]=0; /* * do a char * to int conversion */ if(!strcmp(s,"tcp"))c->proto = IPPROTO_TCP; else if(!strcmp(s, "udp"))c->proto = IPPROTO_UDP; else if(!strcmp(s, "icmp"))c->proto = IPPROTO_ICMP; else { printf("Unknown protocol '%s'\n",s); exit(1); } t[0]=':'; s=t+1; /* * s = ports */ c->dports = getports(s, &c->num_dport); if(strcmp(s, "any"))c->asc_dports = strdup(s); else c->asc_dports = strdup(any); /* * Done. Prepare space for the other * entries in the configuration file */ c->next = malloc(sizeof(struct config_rules)); bzero(c->next, sizeof(struct config_rules)); old = c; /* * sanity check */ if(c->proto != IPPROTO_ICMP) { if((port_in_ports(0, c->dports, c->num_dport))|| (port_in_ports(0, c->sports, c->num_sport))) { printf("Error. You specified a null port for an tcp or udp prototype\n"); printf("Offending line : '%s'\n", str); exit(1); } } c = c->next; } } /* * since we allocated memory ahead of time, * the last entry is not used */ if(old) { free(old->next); old->next = NULL; } free(str); return(cr); } nstreams/src/config_rules.h0100644000076600007660000000054707137607471015706 0ustar renaudrenaud#ifndef CONFIG_H____ #define CONFIG_H____ struct config_rules { char * name; u_short * sports; int num_sport; int proto; u_short * dports; int num_dport; char * asc_sports; char * asc_dports; struct config_rules * next; }; struct config_rules * get_rule(struct config_rules *, struct tcpdump *); struct config_rules * read_config(FILE *); #endif nstreams/src/networks.c0100644000076600007660000001302307524025142015054 0ustar renaudrenaud/* nstreams * Copyright (C) 1999 Herve Schauer Consultants and Renaud Deraison * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * */ /* * $Id: networks.c,v 1.1.1.1 2000/07/26 16:18:01 renaud Exp $ * * Author : Renaud Deraison * * * Network management routines. This file contains mainly functions * which determine if a given host belongs to a given network, * and the function which reads /etc/nstreams-networks. * */ #include #include "networks.h" /* * return the network address. * * ie : 192.168.1.12/24 --> 192.168.1.0 */ struct in_addr get_net(addr, mask) struct in_addr addr; int mask; { struct in_addr net_a; net_a.s_addr = ntohl(addr.s_addr) >> (32 - mask); net_a.s_addr = htonl(net_a.s_addr << (32 - mask)); return(net_a); } /* * returns the broadcast address of a network. * * ie : 192.168.1.12/24 --> 192.168.1.255 */ struct in_addr get_broadcast(addr, mask) struct in_addr addr; int mask; { struct in_addr net_a; net_a.s_addr = (ntohl(addr.s_addr) >> (32 - mask)) + 1; net_a.s_addr = htonl((net_a.s_addr << (32 - mask)) - 1); return(net_a); } /* * Read the networks file. */ struct network * read_networks(fd) FILE * fd; { struct network * ret = malloc(sizeof(struct network)); char * str = malloc(1024); struct network * n = ret; struct network * old = NULL; bzero(str, 1024); bzero(ret, sizeof(struct network)); while((fgets(str, 1023, fd))) { char * s = str; char * t; /* * skip the first spaces and tabs */ while((s[0]==' ')||(s[0]=='\t'))s++; /* suppress the trailing garbage */ while(strlen(s) && ( (s[strlen(s)-1]=='\n')||(s[strlen(s)-1]=='\r')|| (s[strlen(s)-1]==' ') || (s[strlen(s)-1]=='\t')))s[strlen(s)-1]=0; /* * process this line if and only if it's not a comment */ if((s[0]!='#') && (strlen(s)>1)) { /* * the network file line format is : * 'name:ip/netmask' */ /* * t = ':ip/netmask' */ t = strchr(s, ':'); if(!t){ printf("Syntax error in the networks file : \n"); printf("%s", str); exit(1); } /* * end the line */ t[0]=0; /* * copy the name of the network */ n->name = strdup(s); /* * restore the line */ t[0] = ':'; /* * s = 'ip/mask' */ s = t+1; /* * t = /mask */ t = strchr(s, '/'); /* * if no netmask is specified, then * consider it's 32 */ if(!t)n->mask = 32; else { /* t+1 = 'mask' */ n->mask = atoi(t+1); /* finish the line */ t[0]=0; } /* * s = 'addess' */ inet_aton(s, &n->addr); /* * convert the IP to the network IP (using the * mask */ n->addr = get_net(n->addr, n->mask); /* * and have a copy of the ascii version of the network * IP around */ n->asc_addr = strdup(inet_ntoa(n->addr)); old = n; /* prepare memory for the next entry */ n->next = malloc(sizeof(struct network)); n = n->next; } } if(old){ /* delete the last entry */ free(old->next); old->next = NULL; } free(str); return(ret); } /* * returns the mask of the network */ int get_network_mask(nets, name, numeric) struct network * nets; char * name; int numeric; { while(nets) { if(numeric){if(!strcmp(nets->asc_addr, name))return(nets->mask);} else if(!strcmp(nets->name, name))return(nets->mask); nets = nets->next; } return(32); } /* * get the name of the network to which the * ip belongs */ char * ip_to_network(nets, ip,numeric) struct network * nets; struct in_addr ip; int numeric; { struct in_addr i; struct network * match = NULL; /* * in ip_to_network() we want the name of the * network, not just a /32 host. So, we use * which will contain the first occurence of * the network that matches the IP, and if no better * has been found, we return it */ while(nets) { if(!nets->mask && !match){ if(numeric)return(nets->asc_addr); else return(nets->name); } i.s_addr = ip.s_addr; ip = get_net(ip, nets->mask); if(ip.s_addr == nets->addr.s_addr){ #ifdef USELESS_FEATURE if(nets->mask == 32)match = nets; else #endif { if(numeric)return(nets->asc_addr); else return(nets->name); } } nets = nets->next; ip.s_addr = i.s_addr; } if(match) { if(numeric)return(match->asc_addr); else return(match->name); } /* * Nothing matched - return the IP */ return(inet_ntoa(ip)); } /* * get the IP of the network . * If is set to 1, then return * the IP adress of the network in ascii */ struct in_addr get_network_ip(nets, name,numeric) struct network * nets; char * name; int numeric; { struct in_addr nothing; nothing.s_addr = 0; while(nets) { if(numeric){if(!strcmp(nets->asc_addr, name))return(nets->addr);} else if(!strcmp(nets->name, name))return(nets->addr); nets = nets->next; } return(nothing); } nstreams/src/networks.h0100644000076600007660000000073007137607471015075 0ustar renaudrenaud#ifndef NETWORKS_H__ #define NETWORKS_H__ struct network { char * name; char * asc_addr; struct in_addr addr; int mask; struct network * next; }; struct network * read_networks(FILE *); char * ip_to_network(struct network*, struct in_addr,int); struct in_addr get_network_ip(struct network*, char *,int); int get_network_mask(struct network *, char *,int); struct in_addr get_net(struct in_addr, int); struct in_addr get_broadcast(struct in_addr, int); #endif nstreams/src/nstreams.c0100644000076600007660000002673207524025142015047 0ustar renaudrenaud/* nstreams * Copyright (C) 1999 Herve Schauer Consultants and Renaud Deraison * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * */ /* * $Id: nstreams.c,v 1.2 2000/08/01 09:58:11 renaud Exp $ * * Network Streams -- a tcpdump analyzer tool. * * (C) 1999 Renaud Deraison and Hervé Schauer Consultant -- http://www.hsc.fr * */ #include #include "parse_tcpdump.h" #include "config_rules.h" #include "cache.h" #include "networks.h" #include "output.h" #include "read_pcap.h" #include /* * Declaration of the 'data to struct tcpdump' type */ typedef struct tcpdump*(*parser_func_t)(char *); /* * list of the supported output formats */ char * formats = "\t\tipfw ipchains nstreams"; /* * Global variables */ int reject_syn = 0; int opt_u = 0; int opt_U = 0; int opt_B = 0; int signal_received = 0; /* * print the command line options and * quit */ void usage() { printf("Usage : nstreams [-v] [-c ]\ [ -n ] [ -N [ -i ] [ -I ]]\ [ -O [ -D ] [ -Y ]] [ -u ] [ -U ] [ -B ] [ -f file ]...\n"); printf("\t-c : the nstreams services file\n"); printf("\t-n : the nstreams networks file\n"); printf("\t-v : version\n"); printf("\t-N : show networks, not IP addresses (use twice to show nets IPs)\n"); printf("\t-r : redundancy (show several times the same streams)\n"); printf("\t-O : output format. The currently supported formats are \n%s\n", formats); printf("\t-u : do not print unknown streams\n"); printf("\t-U : only print unknown streams\n"); printf("\t-B : notify of broadcasts and networks\n"); printf("\t-l : listen directly on interface \n"); printf("\t-f : read a tcpdump output file\n"); printf("\n"); printf("\t-O additional options : \n"); printf("\t\t-D : apply the rules to (ie: eth0)\n"); printf("\t\t-Y : reject packets that attempt to establish a connection from\n"); printf("\t\t the outside\n\n"); printf("\t-N additional options : \n"); printf("\t\t-i : show intra-network traffic\n"); printf("\t\t-I : only show intra-network traffic\n"); exit(1); } /* * show the version number * and quit */ void version() { printf("This is nstreams %s\n", VERSION); printf("Copyright (C) 1999 Renaud Deraison \n"); printf(" and Hervé Schauer Consultants -- http://www.hsc.fr\n"); printf("\n\n"); exit(0); } void signal_handler(int signum) { signal_received = 1; } /* * select the output function for the given * format. See output.c for details */ output_func_t output_function(name) char * name; { if(!strcmp(name, "ipfw"))return(ipfw_output); if(!strcmp(name, "nstreams"))return(standard_output); if(!strcmp(name, "ipchains"))return(ipchains_output); else { printf("Output '%s' not supported\n", name); exit(1); } return(NULL); } int main(argc, argv) int argc; char * argv[]; { output_func_t output_func; /* function in charge of the output */ pcap_t * pcap = NULL; char * config_file = ETC_NSTREAMS_SERVICES; char * networks = ETC_NSTREAMS_NETWORKS; /* the name of the tcpdump file -- if any */ char * dump_file = NULL; /* * pcap errbuf */ char * pcap_err = malloc(PCAP_ERRBUF_SIZE); int offset; /* datalink size */ struct pcap_pkthdr hdr; /* * conf : configuration file * net_conf : networks file * fd : the entry file */ FILE * conf, * net_conf, *fd; char * str; struct config_rules * cr; struct cache * cache = NULL; struct network * nets = NULL; parser_func_t parser; /* * command line options */ int c; int r = 0; /* redundant output */ int n = 0; /* show by network */ int O = 0; /* output */ int i = 0; /* show intra network traffic */ int I = 0; /* show only intra network traffic */ int D = 0; /* apply the ruls to the interface */ int f = 0; /* read a tcpdump output file */ int l = 0; /* listen on an interface */ char * iface = NULL; char * iface_listen = NULL; char * output_name = NULL; parser = parse_tcpdump_line; /* * process the command line options */ while((c=getopt(argc, argv, "f:BuUc:n:NvhrO:iID:Yl:"))!=-1) { switch(c) { case 'f' : if(!optarg)usage(); dump_file = strdup(optarg); f++; /* * Change the parser to the pcap parser */ parser = parse_pcap_entry; break; case 'B' : /* show broadcast */ opt_B++; break; case 'c' : /* -c config file */ if(!optarg)usage(); config_file = strdup(optarg); break; case 'N': /* show networks */ n++; break; case 'n': /* -n networks-file */ if(!optarg)usage(); networks = strdup(optarg); n++; break; case 'v' : /* show version number */ version(); break; case 'h' : /* help */ usage(); break; case 'u' : /* don't print unknown streams */ opt_u++; break; case 'U' : /* only print unknown streams */ opt_U++; break; case 'r' : /* -r[edundant] */ r++; break; case 'O' : /* -O format (ouput) */ O++; if(!optarg)usage(); output_name = strdup(optarg); break; case 'D': D++; if(!optarg)usage(); iface = strdup(optarg); break; case 'i' : /* -Ni : also show intranet traffic */ i++; break; case 'I' : /* -NI only show intranet traffic */ I++; break; case 'Y' : reject_syn++; break; case 'l' : if(!optarg)usage(); l++;f++; /* * Change the parser to the pcap parser */ parser = parse_pcap_entry; iface_listen = strdup(optarg); break; default : if(!argv[optind])usage(); if(argv[optind] && argv[optind][0]=='-')usage(); break; } } /* * Signal handler */ signal(SIGTERM, signal_handler); signal(SIGINT, signal_handler); /* * open the configuration file (/etc/nstreams-services) */ if(!(conf = fopen(config_file, "r"))) { printf("Could not open %s\n", config_file); perror("open "); exit(1); } /* * Sanity check */ if((i || I)&&!n){ printf("-i and -I options must be used with -N\n"); exit(1); } /* * -O must be used with -NN - set -N to -NN silently */ if(O && n)n++; /* * -D must be used with -O */ if(D && !O){ printf("-D must be used with -O\n"); exit(1); } /* * -Y must be used with -O */ if(reject_syn && !O) { printf("-Y must be used with -O\n"); exit(1); } /* * -u et -U can't be used at the same time */ if(opt_u && opt_U) { printf("-u and -U can not be used altogether\n"); exit(1); } /* * the output is done via a function we * point onto */ if(!O)output_func = standard_output; else output_func = output_function(output_name); if((!dump_file) && (argc > optind))dump_file = argv[optind]; /* * open the networks file */ if(!(net_conf = fopen(networks, "r"))) { if(n){ printf("Could not open %s\n", networks); perror("open "); exit(1); } } else { /* * initialize the list of networks. */ nets = read_networks(net_conf); fclose(net_conf); } /* * open the entry file, if we got a name for it, * or use stdin */ if(dump_file||l) { if(!f && !l) /* not a tcpdump output file */ { if(!(fd = fopen(dump_file, "r"))) { printf("Could not open %s\n", dump_file); perror("open "); exit(1); } } else { f++; if(l) { pcap = pcap_open_live(iface_listen, 1500, 1, 1000, pcap_err); if(!pcap) { fprintf(stderr, "Could not open interface %s - %s\n", iface_listen, pcap_err); exit(1); } } else { /* * tcpdump output file that we must open using the * libpcap functions */ pcap = pcap_open_offline(dump_file, pcap_err); if(!pcap) { fprintf(stderr, "Could not open %s - %s\n", dump_file, pcap_err); exit(1); } } switch(pcap_datalink(pcap)) { case DLT_EN10MB: offset = 14; break; case DLT_IEEE802: offset = 22; break; case DLT_NULL: offset = 4; break; case DLT_SLIP: #if (__FreeBSD__ || OPENBSD || NETBSD || BSDI) offset = 16; #else offset = 24; /* Anyone use this??? */ #endif break; case DLT_PPP: #if (__FreeBSD__ || OPENBSD || NETBSD || BSDI) offset = 4; #else #ifdef SOLARIS offset = 8; #else offset = 24; /* Anyone use this? */ #endif /* ifdef solaris */ #endif /* if freebsd || openbsd || netbsd || bsdi */ break; case DLT_RAW: offset = 0; break; } } } else fd = stdin; /* * initialize the configuration, according to /etc/nstreams-services */ cr = read_config(conf); fclose(conf); /* * Tell the output function we start */ (*output_func)(NULL, OP_START); /* XXX */ while(!signal_received) { struct tcpdump * dump; struct config_rules *c; char buffer[1024]; char *str; /* * Depending on the input we were given, there are * differents way to read it */ if(!f) { str = fgets(buffer, 1023, fd); if (!str) break; } else { str = (char*)pcap_next(pcap, &hdr); if(str) str+=offset; else continue; /* pcap_next returned NULL, no packet arrived */ } /* * translate the string to a * structure we understand. The conversion * may return NULL if the protocol is unsupported * (arp), or if an error occured */ dump = (*parser)(str); if(dump) { char * name = "unknown"; if(dump->proto) { c = get_rule(cr, dump); if( r || !present_in_cache(cache, c?c->name:name, dump)) { struct output * output = make_output(nets, dump->src, dump->dst, dump->ports[0], dump->ports[1], dump->proto, c, n,iface); char * name = "unknown"; int intra = 0; /* * don't show the intra-network traffic * except if we are asked to */ if(output->ia_dst.s_addr == output->ia_src.s_addr) { if(!(i+I)){ free(dump); free_output(output); continue; } else intra++; output->ia_dst.s_addr = dump->dst.s_addr; output->ia_src.s_addr = dump->src.s_addr; free(output->src); free(output->dst); output->src = strdup(inet_ntoa(dump->src)); output->dst = strdup(inet_ntoa(dump->dst)); } else { dump->src.s_addr = output->ia_src.s_addr; dump->dst.s_addr = output->ia_dst.s_addr; } if(c)name = c->name; /* * only print the stream if it has not been printed * already (or if -r has been set) */ if(!present_in_cache(cache, name, dump)||r) { if(!r){ /* * if this stream has been identified, then we * put it in the cache */ if(c)add_in_cache(&cache, c->name, dump); else add_in_cache(&cache, "unknown", dump); } if(I){if(intra)(*output_func)(output,0);} else (*output_func)(output,0); } free_output(output); } fflush(stdout); } free(dump); } } if(pcap)pcap_close(pcap); (*output_func)(NULL, OP_END); return(0); } nstreams/src/output.c0100644000076600007660000002314207445155377014563 0ustar renaudrenaud/* nstreams * Copyright (C) 1999 Herve Schauer Consultants and Renaud Deraison * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * */ /* * $Id: output.c,v 1.1.1.1 2000/07/26 16:18:01 renaud Exp $ * * Author : Renaud Deraison * */ #include #include "parse_tcpdump.h" #include "config_rules.h" #include "networks.h" #include "output.h" extern int reject_syn; extern int opt_u; extern int opt_U; extern int opt_B; char * int2proto(proto) int proto; { return(proto==IPPROTO_TCP ? "tcp": proto==IPPROTO_UDP ? "udp": proto==IPPROTO_ICMP ? "icmp":NULL); } /* * free the memory allocated by make_output() */ void free_output(output) struct output * output; { free(output->serv_name); free(output->src); free(output->dst); free(output->sports); free(output->dports); free(output); } struct output * make_output(nets, src, dst, sport, dport, proto, rule,shownet,iface) struct network * nets; struct in_addr src; struct in_addr dst; int sport, dport, proto; struct config_rules * rule; int shownet; char * iface; { struct output * ret = malloc(sizeof(struct output)); if(rule)ret->serv_name = strdup(rule->name); else ret->serv_name = strdup("unknown"); ret->sport = sport; ret->dport = dport; ret->ia_sorig.s_addr = src.s_addr; ret->ia_dorig.s_addr = dst.s_addr; if(shownet) { ret->src = strdup(ip_to_network(nets, src,shownet>1)); ret->dst = strdup(ip_to_network(nets,dst, shownet>1)); ret->ia_src = get_network_ip(nets, ret->src,shownet>1); ret->ia_dst = get_network_ip(nets, ret->dst, shownet>1); ret->smask = get_network_mask(nets, ret->src, shownet>1); ret->dmask = get_network_mask(nets, ret->dst, shownet>1); ret->s_bcast = get_broadcast(ret->ia_src, ret->smask); ret->d_bcast = get_broadcast(ret->ia_dst, ret->dmask); } else { ret->src = strdup(inet_ntoa(src)); ret->dst = strdup(inet_ntoa(dst)); ret->ia_src.s_addr = src.s_addr; ret->ia_dst.s_addr = dst.s_addr; ret->smask = ret->dmask = 32; } ret->proto = proto; ret->asc_proto = int2proto(proto); if(rule) { if(ret->proto != IPPROTO_ICMP) { ret->sports = strdup(rule->asc_dports); ret->dports = strdup(rule->asc_sports); } else { ret->sports = strdup(rule->asc_sports); ret->dports = strdup(rule->asc_dports); } } else { ret->sports = malloc(10); sprintf(ret->sports, "%d", ret->sport); ret->sports = realloc(ret->sports, strlen(ret->sports)+1); ret->dports = malloc(10); sprintf(ret->dports, "%d", ret->dport); ret->dports = realloc(ret->dports, strlen(ret->dports)+1); } ret->show_net = shownet; ret->iface = iface; return(ret); } /* * The different outputs -- ipfw, ipchains and bare nstreams * * Note that ipchains and ipfw do not pay attention to the device * except if explicitely told so. */ /* * ipfw */ void ipfw_output(output, status) struct output * output; int status; { switch(status) { case OP_START : /* initialize the firewall script */ printf("#!/bin/sh\n"); printf("# Flush the old rules : \nipfw -f flush\n\n"); printf("# Accept the traffic going to the loopback :\n"); printf("ipfw add allow all from localhost to localhost via lo0\n"); printf("\n# The streams start here :\n\n\n"); break; case OP_END : printf("\n# Deny everything else\n"); printf("ipfw add deny all from any to any\n"); break; default : /* * man ipfw for details */ if(output->proto == IPPROTO_ICMP){ printf("#\n# Accept %s :\n#\n", output->serv_name); printf("ipfw add allow %s from %s/%d to %s/%d icmptypes %s", output->asc_proto, output->src, output->smask, output->dst, output->dmask, output->sports); if(output->iface)printf(" via %s", output->iface); printf("\n\n"); } else { int unknown = !strcmp(output->serv_name, "unknown"); if(unknown && opt_u)return; if(!unknown && opt_U)return; printf("#\n# Accept %s : \n#\n\n",output->serv_name); /* * Inside --> Outside */ printf("# Inside -> Outside\n"); printf("ipfw add allow %s from %s/%d %s to %s/%d %s out", output->asc_proto, output->src,output->smask, output->sports, output->dst, output->dmask,output->dports); if(output->iface)printf(" via %s", output->iface); printf("\n\n"); /* * Outside --> Inside */ printf("# Outside -> Inside\n"); if(reject_syn && (output->proto == IPPROTO_TCP)) { printf("# Reject connections from the outside : \n"); printf("ipfw add deny %s from %s/%d %s to %s/%d %s in setup\n", output->asc_proto, output->dst,output->dmask, output->dports, output->src, output->smask,output->sports); printf("# Accept already established connections : \n"); } printf("ipfw add allow %s from %s/%d %s to %s/%d %s in", output->asc_proto, output->dst,output->dmask, output->dports, output->src, output->smask,output->sports); if(output->iface)printf(" via %s", output->iface); printf("\n\n\n"); } break; } } /* * ipchains */ void ipchains_output(output, status) struct output * output; int status; { switch(status) { case OP_START : printf("#!/bin/sh\n\n"); printf("# Flushing old rules\n"); printf("ipchains -F\n"); printf("ipchains -X\n"); printf("\n# Setting default policy\n"); printf("ipchains -P input DENY\n"); printf("ipchains -P output DENY\n"); printf("ipchains -P forward DENY\n"); printf("# Add here your local forward, like : \n"); printf("# ipchains -A forward -s 192.168.1.0/24 -d 0.0.0.0/0 -j MASQ\n"); printf("\n# Accepting all packets on all local(s) interface(s)\n"); printf("ipchains -A input -i lo -j ACCEPT\n"); printf("ipchains -A output -i lo -j ACCEPT\n"); printf("ipchains -A forward -i lo -j ACCEPT\n"); printf("\n# Streams start here :\n\n\n"); break; case OP_END : break; default : { char * c_sports = strdup(output->sports); char * c_dports = strdup(output->dports); char *t; /* ipchains has a dumb port range syntax */ while((t=strchr(c_sports, '-')))t[0]=':'; while((t=strchr(c_dports, '-')))t[0]=':'; /* man ipchains for details */ if(output->proto == IPPROTO_ICMP){ printf("# %s - You should delete one of these two lines\n",output->serv_name); printf("ipchains -A input -p %s -s %s/%d -d %s/%d --icmp-type %d", output->asc_proto, output->src, output->smask, output->dst, output->dmask, output->sport); if(output->iface)printf(" -i %s", output->iface); printf("\n"); printf("ipchains -A output -p %s -s %s/%d -d %s/%d --icmp-type %d", output->asc_proto, output->src, output->smask, output->dst, output->dmask, output->sport); if(output->iface)printf(" -i %s", output->iface); printf("\n\n"); } else { int unknown = !strcmp(output->serv_name, "unknown"); if(unknown && opt_u)return; if(!unknown && opt_U)return; printf("# Accept %s\n\n", output->serv_name); /* * Outside --> inside */ printf("#\n# Outside -> Inside\n#\n"); printf("ipchains -A input -s %s/%d %s -d %s/%d %s -p %s -j ACCEPT", output->dst, output->dmask, c_dports, output->src, output->smask, c_sports, output->asc_proto); if(output->iface)printf(" -i %s", output->iface); if(reject_syn && (output->proto == IPPROTO_TCP)) printf(" ! -y"); printf("\n"); /* * Inside --> Outside */ printf("#\n# Inside -> Outside\n#\n"); printf("ipchains -A output -s %s/%d %s -d %s/%d %s -p %s -j ACCEPT", output->src, output->smask, c_sports, output->dst, output->dmask, c_dports, output->asc_proto); if(output->iface)printf(" -i %s", output->iface); printf("\n\n"); } free(c_sports); free(c_dports); } } } void standard_output(output, status) struct output * output; int status; { if(status)return; if(!strcmp(output->serv_name, "unknown")) { if(!opt_u) { printf("Unknown %s traffic between %s:%d and %s:%d\n", output->asc_proto, output->src, output->sport, output->dst, output->dport); } } else if(!opt_U){ if(output->show_net>1)printf("%s traffic between %s/%d and %s/%d\n", output->serv_name, output->src, output->smask, output->dst, output->dmask); else { char * bcast = " (broadcast)"; char * net = " (network)"; char * s, *d; char * empty = ""; if(opt_B && (output->ia_sorig.s_addr == output->s_bcast.s_addr)&& (output->smask <32))s = bcast; else { struct in_addr net_a = get_net(output->ia_src, output->smask); if(opt_B && (output->ia_sorig.s_addr == net_a.s_addr)&& (output->smask < 32)&& (output->smask > 0))s=net; else s = empty; } if(opt_B && (output->ia_dorig.s_addr == output->d_bcast.s_addr)&& (output->dmask < 32))d = bcast; else { struct in_addr net_a = get_net(output->ia_dst, output->dmask); if(opt_B && (output->ia_dorig.s_addr == net_a.s_addr)&& (output->dmask < 32)&& (output->smask > 0))d=net; else d = empty; } printf("%s traffic between %s%s and %s%s\n", output->serv_name, output->src,s, output->dst,d); } } } nstreams/src/output.h0100644000076600007660000000226207137607471014563 0ustar renaudrenaud#ifndef __OUTPUT_H__ #define __OUTPUT_H__ struct output { char * serv_name; /* service name */ int sport; /* source port */ int dport; /* destination port */ char * src; /* source IP (in ascii) */ char * dst; /* dest IP (in ascii ) */ struct in_addr ia_src; /* source IP */ struct in_addr ia_dst; /* dest IP */ struct in_addr s_bcast; /* broadcast of the source */ struct in_addr d_bcast; /* broadcast of the dest */ struct in_addr ia_sorig;/* original ip */ struct in_addr ia_dorig;/* original ip */ int smask; /* source netmask */ int dmask; /* dest netmask */ int proto; /* prototype */ char * asc_proto; /* prototype in ascii */ char * sports; char * dports; int show_net; char * iface; }; #define OP_START 1 #define OP_END 2 typedef void(*output_func_t)(struct output *,int); void free_output(struct output *); struct output * make_output( struct network *, struct in_addr,struct in_addr, int,int,int, struct config_rules *,int, char *); void standard_output(struct output *, int); void ipfw_output(struct output *, int); void ipchains_output(struct output *, int); #endif nstreams/src/parse_tcpdump.c0100644000076600007660000001175307137607471016071 0ustar renaudrenaud/* nstreams * Copyright (C) 1999 Herve Schauer Consultants and Renaud Deraison * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * */ /* * $Id: parse_tcpdump.c,v 1.1.1.1 2000/07/26 16:18:01 renaud Exp $ * * Author : Renaud Deraison * */ #include #include "parse_tcpdump.h" /* * returns the number of dots in a string */ static int count_dots(str) char * str; { int r = 0; while((str=strchr(str, '.'))){ r++;str=str+1; } return(r); } /* * converts 1.2.3.4.5 to {1.2.3.4, port = 5} */ static struct in_addr ascaddr2intaddr(addr, port, proto) char * addr; int * port; char * proto; { int num = count_dots(addr); struct in_addr ret; if(num==4) { char *s = strrchr(addr, '.'); int p; s[0]=0; p = atoi(s+1); if(!p && strcmp(s+1, "0")) { struct servent * se = getservbyname(s+1, proto); if(se) { *port = ntohs(se->s_port); } } else *port = p; } inet_aton(addr, &ret); return(ret); } /* * Returns whether 'c' is a valid TCP * flag */ static int is_tcp_flag(c) char c; { if((c=='.')|| (c=='S')|| (c=='P')|| (c=='F')|| (c=='R'))return(1); else return(0); } static int tcp_flag(c) char c; { if(c=='.')return(0); if(c=='S')return(TCP_SYN); if(c=='P')return(TCP_PUSH); if(c=='F')return(TCP_FIN); if(c=='R')return(TCP_RST); return(0); } struct tcpdump * parse_tcpdump_line(orig) char * orig; { char *s, *t; struct tcpdump * ret; char * src, *dst; char * str = strdup(orig); #ifdef DEBUG printf("%s\n", str); #endif ret = malloc(sizeof(struct tcpdump)); bzero(ret, sizeof(struct tcpdump)); /* * Identify the SOURCE address */ s = (char*)strchr(str, ' '); if(!s){ free(str); free(ret); return(NULL); } t = strchr(s+1, ' '); if(!t){ free(str); free(ret); return(NULL); } t[0] = 0; if((s[1]=='>')||(s[1]=='<')){ s+=2; t[0]=' '; t = strchr(t+1, ' '); if(t)t[0]=0; } src = strdup(s+1); /* * Identify the DEST address */ t = strchr(t+1, '>'); if(!t){ free(str); free(ret); return(NULL); } t+=2; s = strchr(t, ':'); if(!s){ free(str); free(ret); return(NULL); } s[0]=0; s+=2; dst = strdup(t); #ifdef DEBUG printf("-> %s:%d\n", inet_ntoa(ret->src), ret->ports[0]); printf("-> %s:%d\n", inet_ntoa(ret->dst), ret->ports[1]); #endif /* * Identify the protocol */ if(is_tcp_flag(s[0])){ ret->flags = tcp_flag(s[0]); if(is_tcp_flag(s[1])){ ret->flags |= tcp_flag(s[1]); if(is_tcp_flag(s[2]))ret->flags |= tcp_flag(s[2]); } if(strstr(s, " ack "))ret->flags |= TCP_ACK; ret->proto = IPPROTO_TCP; #ifdef DEBUG printf("Protocol : TCP\n"); #endif } else if(ret->ports[0]){ ret->proto = IPPROTO_UDP; #ifdef DEBUG printf("Protocol : UDP\n"); #endif } else if(!strncmp(s, "icmp", 4)){ char * t; t = strchr(s, ':'); if(t) { t+=2; if(!strncmp(t, "echo", strlen("echo"))) { char *s = strchr(t, ' '); if(s) { s++; if(!strncmp(s, "request", strlen("request"))){ ret->type = NS_ICMP_ECHO_REQUEST; ret->code = 0; } if(!strncmp(s, "reply", strlen("reply"))){ ret->type = NS_ICMP_ECHO_REPLY; ret->code = 0; } } #ifdef DEBUG else printf("Parse error : %s -- unknown echo type\n", t); #endif } else if(!strncmp(t, "time exceeded in-transit", strlen("time exceeded in-transit"))) { ret->type = NS_ICMP_TIMXCEED; ret->code = NS_ICMP_TIMXCEED_IN_TRANSIT; } else if(!strncmp(t, "host ", strlen("host "))|| !strncmp(t, "net ", strlen("net "))) { char *v; if(!strncmp(t, "net ", strlen("net ")))v = t + strlen("net "); else v = t + strlen("host "); v = strchr(v, ' '); if(v) { v++; if(!strncmp(v, "unreachable", strlen("unreachable"))) { ret->type = NS_ICMP_UNREACH; ret->code = 0; /* not implemented yet */ } } } else { char *d = strrchr(t, ' '); if(!strncmp(d+1, "unreachable", strlen("unreachable"))) { ret->type = NS_ICMP_UNREACH; ret->code = 0; /* very likely to be a given udp port */ } } } ret->proto = IPPROTO_ICMP; #ifdef DEBUG printf("Protocol : ICMP\n"); #endif } #ifdef BE_VERBOSE else { printf("%s", orig); printf("---> Unknown protocol\n"); } #endif ret->src = ascaddr2intaddr(src, &ret->ports[0], int2proto(ret->proto)); ret->dst = ascaddr2intaddr(dst, &ret->ports[1], int2proto(ret->proto)); free(src); free(dst); free(str); return(ret); } nstreams/src/parse_tcpdump.h0100644000076600007660000000115207137607471016066 0ustar renaudrenaud#ifndef PARSE_TCPDUMP_H__ #define PARSE_TCPDUMP_H__ struct tcpdump { struct in_addr src; struct in_addr dst; int proto; u_short ports[2]; /* sport and dport (udp/tcp), type & code (icmp) */ int flags; }; /* * TCP flags */ #define TCP_FIN 0x01 #define TCP_SYN 0x02 #define TCP_RST 0x04 #define TCP_PUSH 0x08 #define TCP_ACK 0x10 #define TCP_URG 0x20 #define type ports[0] #define code ports[1] #define NS_ICMP_ECHO_REQUEST 8 #define NS_ICMP_ECHO_REPLY 0 #define NS_ICMP_UNREACH 3 #define NS_ICMP_TIMXCEED 11 #define NS_ICMP_TIMXCEED_IN_TRANSIT 0 struct tcpdump * parse_tcpdump_line(char *); #endif nstreams/src/ports.c0100644000076600007660000001254107137607471014366 0ustar renaudrenaud/* nstreams * Copyright (C) 1999 Herve Schauer Consultants and Renaud Deraison * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * */ /* * $Id: ports.c,v 1.1.1.1 2000/07/26 16:18:01 renaud Exp $ * * Author : Renaud Deraison * * * This file contains function that regard ports. Especially : * * - functions to convert strings to array of ports * - functions to NOT create twice the same array * of ports (to save memory) * - functions to determine quickly whether a value is * in an array */ #include #include "ports.h" /* * This structure is used to save memory, as you'll * see later in this file */ struct port_range { char * name; int num; u_short * data; struct port_range * next; }; struct port_range * PortRange = NULL; /* * Entry point to convert a string to an array * of port without wasting memory. * * How this works (there's nothing smart, don't * hold your breath) * * Since our arrays of ports are read-only, and since * each one can take up to 128KB, we have an handy * structure which keeps track of the conversion * we made, as well as their results. So, if * we happen to have twice the same port range * (very likely), then the second time, we will * determine we have already converted this, and we * will return the pointer we created before. * */ u_short * getports(char * expr, int * num) { int n=0; u_short * ret=NULL; struct port_range * pr; struct port_range * p; /* * did we already convert this expression to an array * of ports ? */ if(PortRange) { struct port_range * pr = PortRange; while(pr) { if(!strcmp(pr->name, expr)) { /* * We did. So we return what we had converted the * first time */ *num = pr->num; return(pr->data); } pr = pr->next; } } /* * we have never converted this expression to * an array of port. Let's do it. */ ret = getpts(expr, &n); /* * add the result of this conversion to * our structure */ pr = malloc(sizeof(struct port_range)); bzero(pr, sizeof(struct port_range)); pr->name = strdup(expr); pr->data = ret; pr->num = n; if(!PortRange)PortRange = pr; else { p = PortRange; while(p->next)p=p->next; p->next = pr; } *num=n; return(ret); } /* * comparison function used in qsort() */ int compar(const void* a, const void* b) { u_short *aa = (u_short*)a; u_short *bb = (u_short*)b; return(*aa-*bb); } /* * getpts() * * This function is (c) Fyodor and was taken from * his excellent and outstanding scanner Nmap * See http://www.insecure.org/nmap/ for details about * Nmap */ static char * all = "1-65535"; /* Convert a string like "-100,200-1024,3000-4000,60000-" into an array of port numbers*/ unsigned short *getpts(char *origexpr, int * num) { int exlen ; char *p,*q; unsigned short *tmp, *ports; int i=0, j=0,start,end; char *expr; char *mem; if(!strcmp(origexpr, "any"))origexpr = all; expr = strdup(origexpr); exlen = strlen(origexpr); mem = expr; ports = malloc(65536 * sizeof(short)); for(;j < exlen; j++) if (expr[j] != ' ') expr[i++] = expr[j]; expr[i] = '\0'; exlen = i; i=0; while((p = (char *)strchr(expr,','))) { *p = '\0'; if (*expr == '-') {start = 1; end = atoi(expr+ 1);} else { start = end = atoi(expr); if ((q = (char*)strchr(expr,'-')) && *(q+1) ) end = atoi(q + 1); else if (q && !*(q+1)) end = 65535; } if(start < 0)start = 0; if(start > end){ return(NULL); /* invalid spec */ } for(j=start; j <= end; j++) ports[i++] = j; expr = p + 1; } if (*expr == '-') { start = 1; end = atoi(expr+ 1); } else { start = end = atoi(expr); if ((q = (char*)strchr(expr,'-')) && *(q+1) ) end = atoi(q+1); else if (q && !*(q+1)) end = 65535; } if (start < 0 || start > end) return(NULL); for(j=start; j <= end; j++) ports[i++] = j; tmp = realloc(ports, (i+1) * sizeof(short)); *num = i; qsort(tmp, i, sizeof(u_short), compar); free(mem); return tmp; } /* * Determine is is in , recursively. In less than 15 * comparisons for 65535 elements. */ int rec_pip(port, ports, s, e) u_short port; u_short * ports; int s, e; { if(s==e)return(ports[s]==port); else { int mid = (e + s) / 2; if(port > ports[mid])return(rec_pip(port, ports, mid+1, e)); else return(rec_pip(port, ports, s, mid)); } } /* * is a port in our port list ? * * We use the function rec_pip(), which is * recursive, and which will determine if * a port is present by dichotomy. * */ int port_in_ports(port, ports, len) u_short port; u_short * ports; int len; { int mid = (len-1) / 2; int ret; if(port > ports[mid])ret = rec_pip(port, ports, mid, len); else ret = rec_pip(port, ports, 0, mid); return(ret); } nstreams/src/ports.h0100644000076600007660000000023407137607471014367 0ustar renaudrenaud#ifndef PORTS_H__ #define PORTS_H__ int port_in_ports(u_short, u_short *, int); u_short * getports(char *, int *); u_short * getpts(char *, int *); #endif nstreams/src/read_pcap.c0100644000076600007660000000674607137607471015147 0ustar renaudrenaud/* nstreams * Copyright (C) 1999 Herve Schauer Consultants and Renaud Deraison * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * */ /* * $Id: read_pcap.c,v 1.1.1.1 2000/07/26 16:18:01 renaud Exp $ */ #include #include #include "parse_tcpdump.h" struct bogus_iphdr { #ifndef WORDS_BIGENDIAN unsigned int ihl:4; unsigned int version:4; #else unsigned int version:4; unsigned int ihl:4; #endif u_char tos; u_short tot_len; u_short id; u_short frag_off; u_char ttl; u_char protocol; u_short check; u_int saddr; u_int daddr; }; /* * pcap packet to a tcpdump struct */ struct tcpdump * parse_pcap_entry(data) u_char * data; { struct tcpdump * ret = malloc(sizeof(struct tcpdump)); struct bogus_iphdr * ip = (struct bogus_iphdr*)(data); bzero(ret, sizeof(*ret)); /* * Check that we have an IPv4 packet */ if(ip->version!=0x04)goto stop; #ifdef DEBUG #define UNFIX(x) ntohs(x) printf("\tip_hl : %d\n", ip->ihl); printf("\tip_v : %d\n", ip->version); printf("\tip_tos: %d\n", ip->tos); printf("\tip_len: %d\n", UNFIX(ip->tot_len)); printf("\tip_id : %d\n", ip->id); printf("\tip_off: %d\n", UNFIX(ip->frag_off)); printf("\tip_ttl: %d\n", ip->ttl); switch(ip->protocol) { case IPPROTO_TCP : printf("\tip_p : IPPROTO_TCP (%d)\n", ip->protocol); break; case IPPROTO_UDP : printf("\tip_p : IPPROTO_UDP (%d)\n", ip->protocol); break; case IPPROTO_ICMP: printf("\tip_p : IPPROTO_ICMP (%d)\n", ip->protocol); break; default : printf("\tip_p : %d\n", ip->protocol); break; } printf("\tip_sum: 0x%x\n", ip->check); printf("\n"); printf("data[20] : %d\n", data[20]); #endif /* * Get the source and destination adresses */ ret->src.s_addr = ip->saddr; ret->dst.s_addr = ip->daddr; ret->proto = ip->protocol; switch(ret->proto) { case IPPROTO_TCP : { struct bogus_tcphdr * tcp = (struct bogus_tcphdr*)(data + ip->ihl*4); u_short * sport, * dport; u_char * flags; /* * read the source and destination ports, then * the TCP flags */ sport = (u_short*)(data + ip->ihl*4); dport = (u_short*)(data + ip->ihl*4 + 2); flags = (u_char*)(data + ip->ihl*4 + 13); ret->ports[0] = ntohs(*sport); ret->ports[1] = ntohs(*dport); ret->flags = *flags; break; } case IPPROTO_UDP : { u_short * sport, * dport; sport = (u_short*)(data + ip->ihl*4); dport = (u_short*)(data + ip->ihl*4 + sizeof(u_short)); ret->ports[0] = ntohs(*sport); ret->ports[1] = ntohs(*dport); break; } case IPPROTO_ICMP : { u_char * t, * c; t = (data + (ip->ihl*4)); c = (data + (ip->ihl*4) + sizeof(char)); ret->ports[0] = *t; ret->ports[1] = *c; break; } } return(ret); stop : free(ret); return(NULL); } nstreams/src/read_pcap.h0100644000076600007660000000014007137607471015132 0ustar renaudrenaud#ifndef READ_PCAP_H__ #define READ_PCAP_H__ struct tcpdump * parse_pcap_entry(char *); #endif