Firewalk004070000017500001750000000000000755464102500116635ustar00routerouteFirewalk/man004075500017500001750000000000000746625110000124415ustar00routerouteFirewalk/man/CVS004075500017500001750000000000000747031664500131075ustar00routerouteFirewalk/man/CVS/Root010064400017500001750000000000170746625110000140140ustar00routeroute/usr/local/CVS Firewalk/man/CVS/Repository010064400017500001750000000000240746625110000152460ustar00routerouteFirewalk-latest/man Firewalk/man/CVS/Entries010064400017500001750000000000550747031664500145170ustar00routeroute/firewalk.8/1.2/Tue May 14 23:28:37 2002// D Firewalk/man/firewalk.8010064400017500001750000000102200747031664500144200ustar00routeroute.\" $Id: firewalk.8,v 1.2 2002/05/14 23:28:37 route Exp $: firewalk.1,v 1.1.1.1 2001/03/30 19:14:33 route Exp $ .\" .\" Firewalk 5.0 .\" Firewalk manpage .\" .\" Copyright (c) 1998 - 2002 Mike D. Schiffman .\" Copyright (c) 1998, 1999 David E. Goldsmith .\" http://www.packetfactory.net/firewalk .\" .\" All rights reserved. .\" .TH FIREWALK 8 "04.20.2002" "firewalk" .SH NAME firewalk \- Active Reconnaissance Network Security Tool with Extreme Prejudice .SH SYNOPSIS .B firewalk [\-dhinprSsTtvx] target_gateway metric .if n .ti +5n .SH DESCRIPTION Firewalk is an active reconnaissance network security tool that attempts to determine what layer 4 protocols a given IP forwarding device will pass. Firewalk works by sending out TCP or UDP packets with a TTL one greater than the targeted gateway. If the gateway allows the traffic, it will forward the packets to the next hop where they will expire and elicit an ICMP_TIME_EXCEEDED message. If the gateway hostdoes not allow the traffic, it will likely drop the packets on the floor and we will see no response. To get the correct IP TTL that will result in expired packets one beyond the gateway we need to ramp up hop-counts. We do this in the same manner that traceroute works. Once we have the gateway hopcount (at that point the scan is said to be `bound`) we can begin our scan. It is significant to note the fact that the ultimate destination host does not have to be reached. It just needs to be somewhere downstream, on the other side of the gateway, from the scanning host. Please see http://www.wiley.com/cda/product/0,,0471205443,00.html for more information on Firewalking and networking security tools in general. .SH COMMAND-LINE OPTIONS If an option takes an argument, it procedes the option letter, with the default in parenthesis. .TP 15 .B \-d 1-65535 (34434) Specify the initial destination port to use during the network discovery (aka TTL ramping) phase. .TP .B \-h Program help. .TP .B \-i interface_name Specify interface to use. Only neccessary on multi-homed machines. .TP .B \-n Do not resolve IP addresses into hostnames. This saves a DNS lookup and speeds the scans (mainly during network discovery). .TP .B \-P 1-2000 (0) Set a network writing pause which may be neccessary to keep the program from flooding the network. .TP .B \-p TCP, UDP (UDP) Type of scan to perform. .TP .B \-r Strict RFC 793 compliance. This only comes into play when doing a TCP scan when your packets have an expire vector of one and your metric host is one hop from your gateway. Since the packets will reach their destination, they will not expire, so we look for terminal responses. For a TCP port in the listen state, we will get back a SYN|ACK with the ACK as our SEQ + 1. However, for a closed port, the response is stack dependent. If the host is RFC compliant we will receive an RST|ACK with the ACK as our SEQ + 1. However, if the host is not compliant (ie: microsoft) then the best we can do is inverse tuple matching (which is the default). .TP .B \-S 1-65535,... (1-130,139,1025) Specify the ports for the scan. Ports may be specified in ranges, delimited by dashes, and multiple ranges may be specified, delimited by commas. Ommiting the terminating port number is shorthand for 65535. .TP .B \-s 1-65535 (53) Specify the source port for the scan (both phases). .TP .B \-T 1-2000 (2) Network packet reading timeout. This is the time firewalk will spend waiting for a response before timing out. .TP .B \-t 1-25 (1) Set the initial IP time to live (TTL) value. If a target gateway is known to be (at least) n hops from the source host, the TTL can be preloaded to facilitate a faster scan. .TP .B \-v Dump program version and exit. .TP .B \-x expire vector (1) The expire vector is the number of hops that the scanning probes will expire, past the gateway host. The binding hopcount is the hopcount of the gateway + the expire vector. .TP .SH COMMAND-LINE EXAMPLES .LP .SH CAVEATS .LP .SH SEE ALSO .LP traceroute(8), tracerx(8), pcap(3), libnet(3), dnet(3) .SH AUTHOR .LP Mike D. Schiffman .SH BUGS .LP Please send bug reports to mike@infonexus.com Firewalk/src004075500017500001750000000000000755464102400124635ustar00routerouteFirewalk/src/CVS004075500017500001750000000000000747040213600131125ustar00routerouteFirewalk/src/CVS/Root010064400017500001750000000000170746625110000140300ustar00routeroute/usr/local/CVS Firewalk/src/CVS/Repository010064400017500001750000000000240746625110000152620ustar00routerouteFirewalk-latest/src Firewalk/src/CVS/Entries010064400017500001750000000011540747040213600145230ustar00routeroute/packet_build.c/1.2/Tue May 14 00:17:52 2002// /packet_filter.c/1.2/Tue May 14 00:17:52 2002// /packet_inject.c/1.2/Tue May 14 00:17:52 2002// /util.c/1.2/Tue May 14 00:17:52 2002// /packet_verify.c/1.3/Tue May 14 20:20:39 2002// /Makefile.am/1.3/Tue May 14 23:28:37 2002// /Makefile.in/1.4/Tue May 14 23:28:37 2002// /firewalk.c/1.2/Tue May 14 23:28:37 2002// /packet_capture.c/1.4/Tue May 14 23:28:37 2002// /init.c/1.5/Wed May 15 06:46:54 2002// /main.c/1.6/Wed May 15 06:46:54 2002// /packet_update.c/1.3/Wed May 15 06:46:54 2002// /report.c/1.4/Wed May 15 06:46:54 2002// /signal.c/1.4/Wed May 15 06:46:54 2002// D Firewalk/src/Makefile.am010064400017500001750000000012620747031664500146010ustar00routeroute# $Id: Makefile.am,v 1.3 2002/05/14 23:28:37 route Exp $ # # Firewalk automake information file # Copyright (c) 1998 - 2002 Mike D. Schiffman # All rights reserved. # # Process this file with automake to produce a Makefile.in script. include $(top_srcdir)/Makefile.am.common sbin_PROGRAMS = firewalk firewalk_SOURCES = init.c \ firewalk.c \ main.c \ packet_build.c \ packet_capture.c \ packet_filter.c \ packet_inject.c \ packet_update.c \ packet_verify.c \ report.c \ signal.c \ util.c all: cp firewalk $(top_srcdir) strip $(top_srcdir)/firewalk clean: rm -f $(top_srcdir)/firewalk distclean: rm -f $(top_srcdir)/firewalk Firewalk/src/Makefile.in010064400017500001750000000205050747031664500146130ustar00routeroute# Makefile.in generated automatically by automake 1.4-p5 from Makefile.am # Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. # $Id: Makefile.in,v 1.4 2002/05/14 23:28:37 route Exp $ # # Firewalk automake information file # Copyright (c) 1998 - 2002 Mike D. Schiffman # All rights reserved. # # Process this file with automake to produce a Makefile.in script. # $Id: Makefile.in,v 1.4 2002/05/14 23:28:37 route Exp $ # # Firewalk automake information file # Copyright (c) 1998 - 2002 Mike D. Schiffman # All rights reserved. # SHELL = @SHELL@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ bindir = @bindir@ sbindir = @sbindir@ libexecdir = @libexecdir@ datadir = @datadir@ sysconfdir = @sysconfdir@ sharedstatedir = @sharedstatedir@ localstatedir = @localstatedir@ libdir = @libdir@ infodir = @infodir@ mandir = @mandir@ includedir = @includedir@ oldincludedir = /usr/include DESTDIR = pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = .. ACLOCAL = @ACLOCAL@ AUTOCONF = @AUTOCONF@ AUTOMAKE = @AUTOMAKE@ AUTOHEADER = @AUTOHEADER@ INSTALL = @INSTALL@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS) INSTALL_DATA = @INSTALL_DATA@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ transform = @program_transform_name@ NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_alias = @build_alias@ build_triplet = @build@ host_alias = @host_alias@ host_triplet = @host@ target_alias = @target_alias@ target_triplet = @target@ ADDITIONAL_LIBS = @ADDITIONAL_LIBS@ CC = @CC@ FIREWALK_VERSION = @FIREWALK_VERSION@ MAKEINFO = @MAKEINFO@ PACKAGE = @PACKAGE@ VERSION = @VERSION@ AUTOMAKE_OPTIONS = foreign no-dependencies DISTCLEANFILES = *~ sbin_PROGRAMS = firewalk firewalk_SOURCES = init.c firewalk.c main.c packet_build.c packet_capture.c packet_filter.c packet_inject.c packet_update.c packet_verify.c report.c signal.c util.c mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = ../include/config.h CONFIG_CLEAN_FILES = PROGRAMS = $(sbin_PROGRAMS) DEFS = @DEFS@ -I. -I$(srcdir) -I../include CPPFLAGS = @CPPFLAGS@ LDFLAGS = @LDFLAGS@ LIBS = @LIBS@ firewalk_OBJECTS = init.o firewalk.o main.o packet_build.o \ packet_capture.o packet_filter.o packet_inject.o packet_update.o \ packet_verify.o report.o signal.o util.o firewalk_LDADD = $(LDADD) firewalk_DEPENDENCIES = firewalk_LDFLAGS = CFLAGS = @CFLAGS@ COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ DIST_COMMON = Makefile.am Makefile.in DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) TAR = tar GZIP_ENV = --best SOURCES = $(firewalk_SOURCES) OBJECTS = $(firewalk_OBJECTS) all: all-redirect .SUFFIXES: .SUFFIXES: .S .c .o .s $(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) $(top_srcdir)/Makefile.am.common cd $(top_srcdir) && $(AUTOMAKE) --foreign src/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status cd $(top_builddir) \ && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status mostlyclean-sbinPROGRAMS: clean-sbinPROGRAMS: -test -z "$(sbin_PROGRAMS)" || rm -f $(sbin_PROGRAMS) distclean-sbinPROGRAMS: maintainer-clean-sbinPROGRAMS: install-sbinPROGRAMS: $(sbin_PROGRAMS) @$(NORMAL_INSTALL) $(mkinstalldirs) $(DESTDIR)$(sbindir) @list='$(sbin_PROGRAMS)'; for p in $$list; do \ if test -f $$p; then \ echo " $(INSTALL_PROGRAM) $$p $(DESTDIR)$(sbindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`"; \ $(INSTALL_PROGRAM) $$p $(DESTDIR)$(sbindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \ else :; fi; \ done uninstall-sbinPROGRAMS: @$(NORMAL_UNINSTALL) list='$(sbin_PROGRAMS)'; for p in $$list; do \ rm -f $(DESTDIR)$(sbindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \ done .c.o: $(COMPILE) -c $< .s.o: $(COMPILE) -c $< .S.o: $(COMPILE) -c $< mostlyclean-compile: -rm -f *.o core *.core clean-compile: distclean-compile: -rm -f *.tab.c maintainer-clean-compile: firewalk: $(firewalk_OBJECTS) $(firewalk_DEPENDENCIES) @rm -f firewalk $(LINK) $(firewalk_LDFLAGS) $(firewalk_OBJECTS) $(firewalk_LDADD) $(LIBS) tags: TAGS ID: $(HEADERS) $(SOURCES) $(LISP) list='$(SOURCES) $(HEADERS)'; \ unique=`for i in $$list; do echo $$i; done | \ awk ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ here=`pwd` && cd $(srcdir) \ && mkid -f$$here/ID $$unique $(LISP) TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS)'; \ unique=`for i in $$list; do echo $$i; done | \ awk ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \ || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS) mostlyclean-tags: clean-tags: distclean-tags: -rm -f TAGS ID maintainer-clean-tags: distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) subdir = src distdir: $(DISTFILES) @for file in $(DISTFILES); do \ d=$(srcdir); \ if test -d $$d/$$file; then \ cp -pr $$d/$$file $(distdir)/$$file; \ else \ test -f $(distdir)/$$file \ || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ || cp -p $$d/$$file $(distdir)/$$file || :; \ fi; \ done info-am: info: info-am dvi-am: dvi: dvi-am check-am: all-am check: check-am installcheck-am: installcheck: installcheck-am install-exec-am: install-sbinPROGRAMS install-exec: install-exec-am install-data-am: install-data: install-data-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am install: install-am uninstall-am: uninstall-sbinPROGRAMS uninstall: uninstall-am all-am: Makefile $(PROGRAMS) all-redirect: all-am install-strip: $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install installdirs: $(mkinstalldirs) $(DESTDIR)$(sbindir) mostlyclean-generic: clean-generic: distclean-generic: -rm -f Makefile $(CONFIG_CLEAN_FILES) -rm -f config.cache config.log stamp-h stamp-h[0-9]* -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) maintainer-clean-generic: mostlyclean-am: mostlyclean-sbinPROGRAMS mostlyclean-compile \ mostlyclean-tags mostlyclean-generic mostlyclean: mostlyclean-am clean-am: clean-sbinPROGRAMS clean-compile clean-tags clean-generic \ mostlyclean-am clean: clean-am distclean-am: distclean-sbinPROGRAMS distclean-compile distclean-tags \ distclean-generic clean-am distclean: distclean-am maintainer-clean-am: maintainer-clean-sbinPROGRAMS \ maintainer-clean-compile maintainer-clean-tags \ maintainer-clean-generic distclean-am @echo "This command is intended for maintainers to use;" @echo "it deletes files that may require special tools to rebuild." maintainer-clean: maintainer-clean-am .PHONY: mostlyclean-sbinPROGRAMS distclean-sbinPROGRAMS \ clean-sbinPROGRAMS maintainer-clean-sbinPROGRAMS uninstall-sbinPROGRAMS \ install-sbinPROGRAMS mostlyclean-compile distclean-compile \ clean-compile maintainer-clean-compile tags mostlyclean-tags \ distclean-tags clean-tags maintainer-clean-tags distdir info-am info \ dvi-am dvi check check-am installcheck-am installcheck install-exec-am \ install-exec install-data-am install-data install-am install \ uninstall-am uninstall all-redirect all-am all installdirs \ mostlyclean-generic distclean-generic clean-generic \ maintainer-clean-generic clean mostlyclean distclean maintainer-clean all: cp firewalk $(top_srcdir) strip $(top_srcdir)/firewalk clean: rm -f $(top_srcdir)/firewalk distclean: rm -f $(top_srcdir)/firewalk # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: Firewalk/src/init.c010064400017500001750000000175570747040213600136610ustar00routeroute/* * $Id: init.c,v 1.5 2002/05/15 06:46:54 route Exp $ * * Firewalk 5.0 * init.c - Main loop driver initialization * * Copyright (c) 1998 - 2002 Mike D. Schiffman * Copyright (c) 1998, 1999 David E. Goldsmith * http://www.packetfactory.net/firewalk * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #if (HAVE_CONFIG_H) #include "../include/config.h" #endif #include "../include/firewalk.h" int fw_init_context(struct firepack **fp, char *errbuf) { *fp = (struct firepack *)malloc(sizeof(struct firepack)); if (*fp == NULL) { snprintf(errbuf, FW_ERRBUF_SIZE, "malloc(): %s", strerror(errno)); return (-1); } memset(*fp, 0, sizeof(struct firepack)); /* set defaults here */ (*fp)->ttl = 1; /* initial probe IP TTL */ (*fp)->sport = 53; /* source port (TCP and UDP) */ (*fp)->dport = 33434; /* ala traceroute */ (*fp)->protocol = IPPROTO_UDP; (*fp)->id = getpid(); (*fp)->pcap_timeout = FW_REPLY_TIMEOUT; (*fp)->xv = 1; (*fp)->flags |= FW_RESOLVE; /* setup our signal handler to handle a ctrl-c */ if (catch_sig(SIGINT, catch_sigint) == -1) { snprintf(errbuf, FW_ERRBUF_SIZE, "catch_sig(): %s", strerror(errno)); return (-1); } return (1); } int fw_init_net(struct firepack **fp, char *gw, char *m, char *port_list) { #if HAVE_BPF int one; #endif char errbuf[PCAP_ERRBUF_SIZE]; /* get a libnet context */ (*fp)->l = libnet_init(LIBNET_LINK, (*fp)->device, errbuf); if ((*fp)->l == NULL) { snprintf((*fp)->errbuf, FW_ERRBUF_SIZE, "libnet_init(): %s", errbuf); return (-1); } /* get our device if the user didn't specify one*/ if ((*fp)->device == NULL) { (*fp)->device = libnet_getdevice((*fp)->l); } /* get the source address of our outgoing interface */ (*fp)->sin.sin_addr.s_addr = libnet_get_ipaddr4((*fp)->l); /* setup the target gateway */ if (((*fp)->gateway = libnet_name2addr4((*fp)->l, gw, 1)) == -1) { snprintf((*fp)->errbuf, FW_ERRBUF_SIZE, "libnet_name2addr4(): %s (target gateway: %s)", libnet_geterror((*fp)->l), gw); return (-1); } /* setup the metric */ if (((*fp)->metric = libnet_name2addr4((*fp)->l, m, 1)) == -1) { snprintf((*fp)->errbuf, FW_ERRBUF_SIZE, "libnet_name2addr4(): %s (metric: %s)", libnet_geterror((*fp)->l), m); return (-1); } /* sanity check */ if ((*fp)->gateway == (*fp)->metric) { snprintf((*fp)->errbuf, FW_ERRBUF_SIZE, "target gateway and metric cannot be the same"); return (-1); } /* get our port list stuff situated */ if (libnet_plist_chain_new((*fp)->l, &(*fp)->plist, port_list == NULL ? strdup(FW_DEFAULT_PORT_LIST) : port_list) == -1) { snprintf((*fp)->errbuf, FW_ERRBUF_SIZE, "libnet_plist_chain_new(): %s\n", libnet_geterror((*fp)->l)); return (-1); } /* get a pcap context */ (*fp)->p = pcap_open_live((*fp)->device, FW_SNAPLEN, 0, 0, errbuf); if (((*fp)->p) == NULL) { snprintf((*fp)->errbuf, FW_ERRBUF_SIZE, "pcap_open_live(): %s", errbuf); return (-1); } #if HAVE_BPF /* * BPF, by default, will buffer packets inside the kernel until * either the timer expires (which we do not use) or when the buffer * fills up. This is not sufficient for us since we could miss * responses to our probes. So we set BIOCIMMEDIATE to tell BPF * to return immediately when it gets a packet. This is pretty much * the same behavior we see with Linux which returns every time it * sees a packet. This is less than efficient since we're spending * more time interrupting the kernel, but hey, we gotta get our * work done! */ one = 1; if (ioctl(pcap_fileno((*fp)->p), BIOCIMMEDIATE, &one) < 0) { snprintf((*fp)->errbuf, FW_ERRBUF_SIZE, "ioctl(): BIOCIMMEDIATE: %s", strerror(errno)); return (-1); } #endif /* get the datalink size */ switch (pcap_datalink((*fp)->p)) { case DLT_SLIP: (*fp)->packet_offset = 0x10; break; case DLT_RAW: (*fp)->packet_offset = 0x00; break; case DLT_PPP: (*fp)->packet_offset = 0x04; break; case DLT_EN10MB: default: (*fp)->packet_offset = 0x0e; break; } /* * Set pcap filter and determine outgoing packet size. The filter * will be determined by the scanning protocol: * UDP scan: * icmp[0] == 11 or icmp[0] == 3 or udp * TCP scan: * icmp[0] == 11 or icmp[0] == 3 or tcp[14] == 0x12 or tcp[14] \ * == 0x4 or tcp[14] == 0x14 */ switch ((*fp)->protocol) { case IPPROTO_UDP: if (fw_set_pcap_filter(FW_BPF_FILTER_UDP, fp) == -1) { /* err msg set in fw_set_pcap_filter() */ return (-1); } /* IP + UDP */ (*fp)->packet_size = LIBNET_IPV4_H + LIBNET_UDP_H; break; case IPPROTO_TCP: if (fw_set_pcap_filter(FW_BPF_FILTER_TCP, fp) == -1) { /* err msg set in fw_set_pcap_filter() */ return (-1); } /* IP + TCP */ (*fp)->packet_size = LIBNET_IPV4_H + LIBNET_TCP_H; /* randomize the TCP sequence number */ libnet_seed_prand((*fp)->l); (*fp)->seq = libnet_get_prand(LIBNET_PRu32); break; default: sprintf((*fp)->errbuf, "fw_init_network(): unsupported protocol"); return (-1); } /* * Build a probe packet template. We'll use this packet template * over and over for each write to the network, modifying certain * fields (IP TTL, UDP/TCP ports and of course checksums as we go). */ if (fw_packet_build_probe(fp) == -1) { /* error msg set in fw_packet_build_probe() */ return (-1); } return (1); } void fw_shutdown(struct firepack **fp) { if (*fp) { if ((*fp)->p) { pcap_close((*fp)->p); } if ((*fp)->l) { libnet_destroy((*fp)->l); } if ((*fp)->plist) { libnet_plist_chain_free((*fp)->plist); } free(*fp); *fp = NULL; } } /* EOF */ Firewalk/src/main.c010064400017500001750000000150400747056752200136360ustar00routeroute/* * $Id: main.c,v 1.6 2002/05/15 06:46:54 route Exp $ * * Firewalk 5.0 * main.c - Main control logic * * Copyright (c) 1998 - 2002 Mike D. Schiffman * Copyright (c) 1998, 1999 David E. Goldsmith * http://www.packetfactory.net/firewalk * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #if (HAVE_CONFIG_H) #include "../include/config.h" #endif #include "../include/firewalk.h" #include "../version.h" int main(int argc, char *argv[]) { int c; struct firepack *fp; char *port_list = NULL; char errbuf[FW_ERRBUF_SIZE]; printf("Firewalk 5.0 [gateway ACL scanner]\n"); /* * Initialize the main control context. We keep all of our * program state here and this is used by just about every * function in the program. */ if (fw_init_context(&fp, errbuf) == -1) { fprintf(stderr, "fw_init_control(): %s\n", errbuf); goto done; } /* process commandline arguments */ while ((c = getopt(argc, argv, "d:fhi:no:p:rS:s:T:t:vx:")) != EOF) { switch (c) { case 'd': /* destination port to use during ramping phase */ fp->dport = fw_str2int(optarg, "ramping destination port", FW_PORT_MIN, FW_PORT_MAX); break; case 'f': /* stack fingerprint of each host */ fp->flags |= FW_FINGERPRINT; break; case 'h': /* program help */ usage(argv[0]); break; case 'i': /* interface */ fp->device = optarg; break; case 'n': /* do not use names */ fp->flags &= ~FW_RESOLVE; break; case 'p': /* select firewalk protocol */ fp->protocol = fw_prot_select(optarg); break; case 'r': /* Strict RFC adherence */ fp->flags |= FW_STRICT_RFC; break; case 'S': /* scan these ports */ port_list = optarg; break; case 's': /* source port */ fp->sport = fw_str2int(optarg, "source port", FW_PORT_MIN, FW_PORT_MAX); break; case 'T': /* time to wait for packets from other end */ fp->pcap_timeout = fw_str2int(optarg, "read timer", FW_PCAP_TIMEOUT_MIN, FW_PCAP_TIMEOUT_MAX); break; case 't': /* set initial IP TTL */ fp->ttl = fw_str2int(optarg, "initial TTL", FW_IP_HOP_MIN, FW_IP_HOP_MAX); break; case 'v': /* version */ printf(FW_BANNER "version : %s\n", VERSION); goto done; case 'x': /* expire vector */ fp->xv = fw_str2int(optarg, "expire vector", FW_XV_MIN, FW_XV_MAX); break; default: usage(argv[0]); } } c = argc - optind; if (c != 2) { /* * We should only have two arguments at this point, the target * gateway and the metric. */ usage(argv[0]); } /* initialize the network components */ if (fw_init_net(&fp, argv[optind], argv[optind + 1], port_list) == -1) { fprintf(stderr, "fw_init_network(): %s\n", fp->errbuf); goto done; } printf("Firewalk state initialization completed successfully.\n"); /* execute scan: phase one, and hopefully phase two */ switch (firewalk(&fp)) { case -1: case FW_SERIOUS_ERROR: /* grievous error of some sort */ fprintf(stderr, "firewalk(): %s\n", fp->errbuf); break; case FW_ABORT_SCAN: /* hop count exceeded or metric en route */ fprintf(stderr, "Scan aborted: %s.\n", fp->errbuf); break; case FW_USER_INTERRUPT: fprintf(stderr, "Scan aborted by user.\n"); break; default: printf("\nScan completed successfully.\n"); break; } done: fw_report_stats(&fp); fw_shutdown(&fp); /* we should probably record proper exit status */ return (EXIT_SUCCESS); } void usage(u_char *argv0) { fprintf(stderr, "Usage : %s [options] target_gateway metric\n" "\t\t [-d %d - %d] destination port to use (ramping phase)\n" "\t\t [-h] program help\n" "\t\t [-i device] interface\n" "\t\t [-n] do not resolve IP addresses into hostnames\n" "\t\t [-p TCP | UDP] firewalk protocol\n" "\t\t [-r] strict RFC adherence\n" "\t\t [-S x - y, z] port range to scan\n" "\t\t [-s %d - %d] source port\n" "\t\t [-T 1 - 1000] packet read timeout in ms\n" "\t\t [-t 1 - %d] IP time to live\n" "\t\t [-v] program version\n" "\t\t [-x 1 - %d] expire vector\n" "\n", argv0, FW_PORT_MIN, FW_PORT_MAX, FW_PORT_MIN, FW_PORT_MAX, FW_IP_HOP_MAX, FW_XV_MAX); exit(EXIT_SUCCESS); } /* EOF */ Firewalk/src/packet_build.c010064400017500001750000000163100747005366000153320ustar00routeroute/* * $Id: packet_build.c,v 1.2 2002/05/14 00:17:52 route Exp $ * * Firewalk 5.0 * packet_build.c - Packet construction code * * Copyright (c) 1998 - 2002 Mike D. Schiffman * Copyright (c) 1998, 1999 David E. Goldsmith * http://www.packetfactory.net/firewalk * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #if (HAVE_CONFIG_H) #include "../include/config.h" #endif #include "../include/firewalk.h" int fw_packet_build_probe(struct firepack **fp) { arp_t *a; route_t *r; struct arp_entry arp; struct route_entry route; /* first build our transport layer header */ switch ((*fp)->protocol) { case IPPROTO_UDP: if (fw_packet_build_udp(fp) == -1) { /* error msg set in fw_packet_build_udp() */ return (-1); } break; case IPPROTO_TCP: if (fw_packet_build_tcp(fp) == -1) { /* error msg set in fw_packet_build_tcp() */ return (-1); } break; default: sprintf((*fp)->errbuf, "fw_packet_build_probe(): unknown protocol"); return (-1); } /* build our IPv4 header */ (*fp)->ip = libnet_build_ipv4( (*fp)->packet_size, /* packetlength */ 0, /* IP tos */ (*fp)->id, /* IP id */ 0, /* IP frag bits */ (*fp)->ttl, /* IP time to live */ (*fp)->protocol, /* transport protocol */ 0, /* checksum */ (*fp)->sin.sin_addr.s_addr, /* IP source */ (*fp)->metric, /* IP destination */ NULL, /* IP payload */ 0, /* IP payload size */ (*fp)->l, /* libnet context */ 0); /* No saved ptag */ if ((*fp)->ip == -1) { snprintf((*fp)->errbuf, FW_ERRBUF_SIZE, "libnet_build_ipv4() %s", libnet_geterror((*fp)->l)); return (-1); } /* * Now we need to get the MAC address of our first hop gateway. * Dnet to the rescue! We start by doing a route table lookup * to determine the IP address we use to get to the * destination host (the metric). */ r = route_open(); if (r == NULL) { snprintf((*fp)->errbuf, FW_ERRBUF_SIZE, "route_open()"); route_close(r); return (-1); } /* convert the metric address to dnet's native addr_t format */ if (addr_aton(libnet_addr2name4((*fp)->metric, 0), &route.route_dst) < 0) { snprintf((*fp)->errbuf, FW_ERRBUF_SIZE, "addr_aton()"); route_close(r); return (-1); } /* get the route entry telling us how to reach the metric */ if (route_get(r, &route) < 0) { snprintf((*fp)->errbuf, FW_ERRBUF_SIZE, "route_get()"); route_close(r); return (-1); } route_close(r); a = arp_open(); if (a == NULL) { snprintf((*fp)->errbuf, FW_ERRBUF_SIZE, "arp_open()"); return (-1); } /* get the MAC of the first hop gateway */ arp.arp_pa = route.route_gw; if (arp_get(a, &arp) < 0) { snprintf((*fp)->errbuf, FW_ERRBUF_SIZE, "route_get()"); arp_close(a); return (-1); } arp_close(a); /* build our ethernet header */ if (libnet_autobuild_ethernet( (u_char *)&arp.arp_ha.addr_eth, ETHERTYPE_IP, (*fp)->l) == -1) { snprintf((*fp)->errbuf, FW_ERRBUF_SIZE, "libnet_autobuild_ethernet() %s", libnet_geterror((*fp)->l)); arp_close(a); return (-1); } return (1); } int fw_packet_build_udp(struct firepack **fp) { /* build a UDP header */ (*fp)->udp = libnet_build_udp( (*fp)->sport, /* source UDP port */ (*fp)->dport, /* dest UDP port */ (*fp)->packet_size - LIBNET_IPV4_H, /* UDP size */ 0, /* checksum */ NULL, /* IP payload */ 0, /* IP payload size */ (*fp)->l, /* libnet context */ 0); /* No saved ptag */ if ((*fp)->udp == -1) { snprintf((*fp)->errbuf, FW_ERRBUF_SIZE, "libnet_build_udp() %s", libnet_geterror((*fp)->l)); return (-1); } return (1); } int fw_packet_build_tcp(struct firepack **fp) { /* build a TCP header */ (*fp)->tcp = libnet_build_tcp( (*fp)->sport, /* source TCP port */ (*fp)->dport, /* dest TCP port */ (*fp)->seq, /* sequence number */ 0L, /* ACK number */ TH_SYN, /* control flags */ 1024, /* window size */ 0, /* checksum */ 0, /* urgent */ (*fp)->packet_size - LIBNET_IPV4_H, /* TCP size */ NULL, /* IP payload */ 0, /* IP payload size */ (*fp)->l, /* libnet context */ 0); /* No saved ptag */ if ((*fp)->tcp == -1) { snprintf((*fp)->errbuf, FW_ERRBUF_SIZE, "libnet_build_tcp() %s", libnet_geterror((*fp)->l)); return (-1); } return (1); } /* EOF */ Firewalk/src/packet_capture.c010064400017500001750000000146250747031664500157120ustar00routeroute/* * $Id: packet_capture.c,v 1.4 2002/05/14 23:28:37 route Exp $ * * Firewalk 5.0 * packet_capture.c - Packet capturing routines * * Copyright (c) 1998 - 2002 Mike D. Schiffman * Copyright (c) 1998, 1999 David E. Goldsmith * http://www.packetfactory.net/firewalk * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #if (HAVE_CONFIG_H) #include "../include/config.h" #endif #include "../include/firewalk.h" int loop = 1; int fw_packet_capture(struct firepack **fp) { int pcap_fd, c, timed_out; fd_set read_set; struct timeval timeout; struct pcap_pkthdr pc_hdr; timeout.tv_sec = (*fp)->pcap_timeout; timeout.tv_usec = 0; pcap_fd = pcap_fileno((*fp)->p); FD_ZERO(&read_set); FD_SET(pcap_fd, &read_set); for (timed_out = 0; !timed_out && loop; ) { c = select(pcap_fd + 1, &read_set, 0, 0, &timeout); switch (c) { case -1: snprintf((*fp)->errbuf, FW_ERRBUF_SIZE, "select() %s", strerror(errno)); return (-1); case 0: timed_out = 1; continue; default: if (FD_ISSET(pcap_fd, &read_set) == 0) { timed_out = 1; continue; } /* fall through to read the packet */ } (*fp)->packet = (u_char *)pcap_next((*fp)->p, &pc_hdr); if ((*fp)->packet == NULL) { /* no NULL packets please */ continue; } (*fp)->stats.packets_caught++; /* * Submit the packet for verification first based on scan type, * If we're not bound, we're still in phase one and need to * verify the ramping response. If we are bound, we're in * phase two and we need to verify the terminal response. * Then process the response from the verification engine. * Report to the user if necessary and update the packet * statistics. */ switch (!(((*fp)->flags) & FW_BOUND) ? fw_packet_verify_ramp(fp) : fw_packet_verify_scan(fp)) { case FW_PACKET_IS_TTL_EX_EN_ROUTE: /* RAMPING: TTL expired en route to gateway (standard) */ fw_report(FW_PACKET_IS_TTL_EX_EN_ROUTE, fp); (*fp)->stats.packets_caught_interesting++; return (FW_PACKET_IS_TTL_EX_EN_ROUTE); case FW_PACKET_IS_UNREACH_EN_ROUTE: /* RAMPING: Unreachable en route to gateway (uncommon) */ fw_report(FW_PACKET_IS_UNREACH_EN_ROUTE, fp); (*fp)->stats.packets_caught_interesting++; return (FW_PACKET_IS_TTL_EX_EN_ROUTE); case FW_PACKET_IS_TERMINAL_TTL_EX: /* RAMPING: TTL expired at destination (rare) */ fw_report(FW_PACKET_IS_TERMINAL_TTL_EX, fp); (*fp)->stats.packets_caught_interesting++; return (FW_PACKET_IS_TERMINAL_TTL_EX); case FW_PACKET_IS_TERMINAL_UNREACH: /* RAMPING: Unreachable at destination (uncommon) */ fw_report(FW_PACKET_IS_TERMINAL_UNREACH, fp); (*fp)->stats.packets_caught_interesting++; return (FW_PACKET_IS_TERMINAL_UNREACH); case FW_PACKET_IS_TERMINAL_SYNACK: fw_report(FW_PACKET_IS_TERMINAL_SYNACK, fp); (*fp)->stats.packets_caught_interesting++; return (FW_PACKET_IS_TERMINAL_SYNACK); case FW_PACKET_IS_TERMINAL_RST: fw_report(FW_PACKET_IS_TERMINAL_RST, fp); (*fp)->stats.packets_caught_interesting++; return (FW_PACKET_IS_TERMINAL_RST); case FW_PORT_IS_OPEN_SYNACK: /* SCANNING: A response from an open TCP port */ fw_report(FW_PORT_IS_OPEN_SYNACK, fp); (*fp)->stats.packets_caught_interesting++; return (FW_PORT_IS_OPEN_SYNACK); case FW_PORT_IS_OPEN_RST: /* SCANNING: A response from a closed TCP port */ fw_report(FW_PORT_IS_OPEN_RST, fp); (*fp)->stats.packets_caught_interesting++; return (FW_PORT_IS_OPEN_RST); case FW_PORT_IS_OPEN_UNREACH: /* SCANNING: A port unreachable response */ fw_report(FW_PORT_IS_OPEN_UNREACH, fp); (*fp)->stats.packets_caught_interesting++; return (FW_PORT_IS_OPEN_UNREACH); case FW_PORT_IS_OPEN_TTL_EX: /* SCANNING: A TTL expired */ fw_report(FW_PORT_IS_OPEN_TTL_EX, fp); (*fp)->stats.packets_caught_interesting++; return (FW_PORT_IS_OPEN_TTL_EX); case FW_PACKET_IS_BORING: default: continue; } } if (!loop) { return (FW_USER_INTERRUPT); } /* * If we get here, the scan timed out. We either dropped a packet * somewhere or there is some filtering going on. */ printf("*no response*\n"); fflush(stdout); return (FW_NO_REPLY); } /* EOF */ Firewalk/src/packet_filter.c010064400017500001750000000051660747005366000155270ustar00routeroute/* * $Id: packet_filter.c,v 1.2 2002/05/14 00:17:52 route Exp $ * * Firewalk 5.0 * packet_filter.c - Packet filtering code * * Copyright (c) 1998 - 2002 Mike D. Schiffman * Copyright (c) 1998, 1999 David E. Goldsmith * http://www.packetfactory.net/firewalk * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #if (HAVE_CONFIG_H) #include "../include/config.h" #endif #include "../include/firewalk.h" int fw_set_pcap_filter(char *filter, struct firepack **fp) { struct bpf_program filter_code; bpf_u_int32 local_net, netmask; char errbuf[PCAP_ERRBUF_SIZE]; /* get the subnet mask of the interface */ if (pcap_lookupnet((*fp)->device, &local_net, &netmask, errbuf) == -1) { snprintf((*fp)->errbuf, FW_ERRBUF_SIZE, "pcap_lookupnet(): %s", errbuf); return (-1); } /* compile the BPF filter code */ if (pcap_compile((*fp)->p, &filter_code, filter, 1, netmask) == -1) { snprintf((*fp)->errbuf, FW_ERRBUF_SIZE, "pcap_compile(): %s", pcap_geterr((*fp)->p)); return (-1); } /* apply the filter to the interface */ if (pcap_setfilter((*fp)->p, &filter_code) == -1) { snprintf((*fp)->errbuf, FW_ERRBUF_SIZE, "pcap_setfilter(): %s", pcap_geterr((*fp)->p)); return (-1); } return (1); } /* EOF */ Firewalk/src/packet_inject.c010064400017500001750000000041330747005366000155070ustar00routeroute/* * $Id: packet_inject.c,v 1.2 2002/05/14 00:17:52 route Exp $ * * Firewalk 5.0 * packet_inject.c - Packet injection code * * Copyright (c) 1998 - 2002 Mike D. Schiffman * Copyright (c) 1998, 1999 David E. Goldsmith * http://www.packetfactory.net/firewalk * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #if (HAVE_CONFIG_H) #include "../include/config.h" #endif #include "../include/firewalk.h" int fw_packet_inject(struct firepack **fp) { int n; n = libnet_write((*fp)->l); switch (n) { case -1: (*fp)->stats.packets_err++; snprintf((*fp)->errbuf, FW_ERRBUF_SIZE, "libnet_write() %s", libnet_geterror((*fp)->l)); return (-1); default: (*fp)->stats.packets_sent++; return (1); } } /* EOF */ Firewalk/src/packet_update.c010064400017500001750000000125100747040213600155070ustar00routeroute/* * $Id: packet_update.c,v 1.3 2002/05/15 06:46:54 route Exp $ * * Firewalk 5.0 * packet_update.c - Packet updating code * * Copyright (c) 1998 - 2002 Mike D. Schiffman * Copyright (c) 1998, 1999 David E. Goldsmith * http://www.packetfactory.net/firewalk * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #if (HAVE_CONFIG_H) #include "../include/config.h" #endif #include "../include/firewalk.h" int fw_packet_update_probe(struct firepack **fp, u_short cport) { if (!((*fp)->flags & FW_BOUND)) { /* phase one: just update IP TTL */ (*fp)->ttl++; } else { /* phase two; update port scanning probe */ switch ((*fp)->protocol) { case IPPROTO_TCP: (*fp)->dport = cport; (*fp)->tcp = libnet_build_tcp( (*fp)->sport, /* source TCP port */ (*fp)->dport, /* dest TCP port */ (*fp)->seq, /* sequence number */ 0L, /* ACK number */ TH_SYN, /* control flags */ 1024, /* window size */ 0, /* checksum */ 0, /* urgent */ (*fp)->packet_size - LIBNET_IPV4_H, /* packet size */ NULL, /* payload */ 0, /* payload size */ (*fp)->l, /* libnet context */ (*fp)->tcp); /* TCP ptag */ if ((*fp)->tcp == -1) { snprintf((*fp)->errbuf, FW_ERRBUF_SIZE, "libnet_build_tcp() %s", libnet_geterror((*fp)->l)); return (-1); } break; case IPPROTO_UDP: (*fp)->dport = cport; (*fp)->udp = libnet_build_udp( (*fp)->sport, /* source UDP port */ (*fp)->dport, /* dest UDP port */ (*fp)->packet_size - LIBNET_IPV4_H, /* size */ 0, /* checksum */ NULL, /* payload */ 0, /* payload size */ (*fp)->l, /* libnet context */ (*fp)->udp); /* udp ptag */ if ((*fp)->udp == -1) { snprintf((*fp)->errbuf, FW_ERRBUF_SIZE, "libnet_build_udp() %s", libnet_geterror((*fp)->l)); return (-1); } break; } } (*fp)->ip = libnet_build_ipv4( (*fp)->packet_size, /* packetlength */ 0, /* IP tos */ (*fp)->id, /* IP id */ 0, /* IP frag bits */ (*fp)->ttl, /* IP time to live */ (*fp)->protocol, /* transport protocol */ 0, /* checksum */ (*fp)->sin.sin_addr.s_addr, /* IP source */ (*fp)->metric, /* IP destination */ NULL, /* IP payload */ 0, /* IP payload size */ (*fp)->l, /* libnet context */ (*fp)->ip); /* ip ptag */ if ((*fp)->ip == -1) { snprintf((*fp)->errbuf, FW_ERRBUF_SIZE, "libnet_build_ipv4() %s", libnet_geterror((*fp)->l)); return (-1); } return (1); } /* EOF */ Firewalk/src/packet_verify.c010064400017500001750000000250740747027062700155520ustar00routeroute/* * $Id: packet_verify.c,v 1.3 2002/05/14 20:20:39 route Exp $ * * Firewalk 5.0 * packet_verify.c - Packet verification code * * Copyright (c) 1998 - 2002 Mike D. Schiffman * Copyright (c) 1998, 1999 David E. Goldsmith * http://www.packetfactory.net/firewalk * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #if (HAVE_CONFIG_H) #include "../include/config.h" #endif #include "../include/firewalk.h" int fw_packet_verify_ramp(struct firepack **fp) { struct libnet_ipv4_hdr *ip_hdr; struct libnet_icmpv4_hdr *icmp_hdr; struct libnet_ipv4_hdr *o_ip_hdr; struct libnet_tcp_hdr *tcp_hdr; /* point to the IP header */ ip_hdr = (struct libnet_ipv4_hdr *) ((*fp)->packet + (*fp)->packet_offset); if (ip_hdr->ip_src.s_addr == (*fp)->sin.sin_addr.s_addr) { /* packets we send are of no interest to us here. */ return (FW_PACKET_IS_BORING); } switch (ip_hdr->ip_p) { case IPPROTO_ICMP: icmp_hdr = (struct libnet_icmpv4_hdr *) ((*fp)->packet + (*fp)->packet_offset + LIBNET_IPV4_H); switch (icmp_hdr->icmp_type) { case ICMP_TIMXCEED: if (icmp_hdr->icmp_code != ICMP_TIMXCEED_INTRANS) { /* * Packet was from an expired IP frag queue * reassembly timer. Nothing we want. */ break; } case ICMP_UNREACH: /* * Point to the original IPv4 header inside the ICMP * message's payload. An IPv4 header is * LIBNET_IPV4_H bytes long and both ICMP unreachable * and time exeeed headers are 8 bytes. */ o_ip_hdr = (struct libnet_ipv4_hdr *) ((*fp)->packet + (*fp)->packet_offset + LIBNET_IPV4_H + 8); /* * Check the IP header of the packet that caused the * unreachable for our markings which include: * Original IP ID: set to the process id. * Original IP source address: our source address. */ if (!FW_IS_OURS(o_ip_hdr, fp)) { break; } if (ip_hdr->ip_src.s_addr == (*fp)->metric) { /* * ICMP response from our metric. This ends * our scan since we've reached the metric * before the target gateway. */ return ((icmp_hdr->icmp_type == ICMP_TIMXCEED) ? FW_PACKET_IS_TERMINAL_TTL_EX : FW_PACKET_IS_TERMINAL_UNREACH); } if (ip_hdr->ip_src.s_addr == (*fp)->gateway) { /* * Response from our target gateway. */ (*fp)->flags |= FW_BOUND; } /* * If we get to this point, the packet is an * ICMP response from an intermediate router. */ return ((icmp_hdr->icmp_type == ICMP_TIMXCEED) ? FW_PACKET_IS_TTL_EX_EN_ROUTE : FW_PACKET_IS_UNREACH_EN_ROUTE); break; default: break; } case IPPROTO_TCP: if ((*fp)->protocol != IPPROTO_TCP) { /* * We're only interested in TCP packets if this is a * TCP-based scan. */ break; } tcp_hdr = (struct libnet_tcp_hdr *) ((*fp)->packet + (*fp)->packet_offset + LIBNET_IPV4_H); if (!(tcp_hdr->th_flags & TH_SYN) && !(tcp_hdr->th_flags & TH_RST)) { /* * We only care about SYN|ACK and RST|ACK packets. * The rest can burn. */ break; } if ((*fp)->flags & FW_STRICT_RFC) { /* * Strict RFC compliance dictates that an RST or * an SYN|ACK will have our SEQ + 1 as the ACK number * also, the RST will have the ACK bit set). This is of * course, assuming the packet is ours. */ if (ntohl(tcp_hdr->th_ack) != (*fp)->seq + 1) { break; } } if (ntohs(tcp_hdr->th_dport) == (*fp)->sport && ntohs(tcp_hdr->th_sport) == (*fp)->dport) { /* this is most likely a response to our SYN probe */ return (((tcp_hdr->th_flags & TH_SYN) ? FW_PACKET_IS_TERMINAL_SYNACK : FW_PACKET_IS_TERMINAL_RST)); } break; } return (FW_PACKET_IS_BORING); } int fw_packet_verify_scan(struct firepack **fp) { struct libnet_ipv4_hdr *ip_hdr; struct libnet_icmpv4_hdr *icmp_hdr; struct libnet_ipv4_hdr *o_ip_hdr; struct libnet_tcp_hdr *tcp_hdr; ip_hdr = (struct libnet_ipv4_hdr *)((*fp)->packet + (*fp)->packet_offset); if (ip_hdr->ip_src.s_addr == (*fp)->sin.sin_addr.s_addr) { /* packets we send are of no interest to us here. */ return (FW_PACKET_IS_BORING); } switch (ip_hdr->ip_p) { case IPPROTO_ICMP: icmp_hdr = (struct libnet_icmpv4_hdr *) ((*fp)->packet + (*fp)->packet_offset + LIBNET_IPV4_H); switch (icmp_hdr->icmp_type) { case ICMP_TIMXCEED: if (icmp_hdr->icmp_code != ICMP_TIMXCEED_INTRANS) { /* * Packet was from an expired IP frag queue * reassembly timer. Nothing we want. */ break; } case ICMP_UNREACH: /* * Point to the original IPv4 header inside the ICMP * message's payload. An IPv4 header is * LIBNET_IPV4_H bytes long and both ICMP unreachable * and time exeeed headers are 8 bytes. */ o_ip_hdr = (struct libnet_ipv4_hdr *) ((*fp)->packet + (*fp)->packet_offset + LIBNET_IPV4_H + 8); /* * Check the IP header of the packet that caused the * unreachable for our markings which include: * Original IP ID: set to the process id. * Original IP source address: our source address. */ if (FW_IS_OURS(o_ip_hdr, fp)) { /* the packet made it through the filter */ return ((icmp_hdr->icmp_type == ICMP_TIMXCEED) ? FW_PORT_IS_OPEN_TTL_EX : FW_PORT_IS_OPEN_UNREACH); } break; default: break; } case IPPROTO_TCP: if ((*fp)->protocol != IPPROTO_TCP) { /* * We're only interested in TCP packets if this is a * TCP-based scan. */ break; } tcp_hdr = (struct libnet_tcp_hdr *) ((*fp)->packet + (*fp)->packet_offset + LIBNET_IPV4_H); /* * We only care about SYN|ACK and RST|ACK packets. * The rest can burn. */ if (!(tcp_hdr->th_flags & TH_SYN) && !(tcp_hdr->th_flags & TH_RST)) { break; } if ((*fp)->flags & FW_STRICT_RFC) { /* * Strict RFC compliance dictates that an RST or * an SYN|ACK will have our SEQ + 1 as the ACK number * also, the RST will have the ACK bit set). This is of * course, assuming the packet is ours. */ if (ntohl(tcp_hdr->th_ack) != (*fp)->seq + 1) { break; } } if (ntohs(tcp_hdr->th_dport) == (*fp)->sport && ntohs(tcp_hdr->th_sport) == (*fp)->dport) { /* the packet made it through the filter */ return (((tcp_hdr->th_flags & TH_SYN) ? FW_PORT_IS_OPEN_SYNACK : FW_PORT_IS_OPEN_RST)); } break; default: break; } return (FW_PACKET_IS_BORING); } /* EOF */ Firewalk/src/report.c010064400017500001750000000130440747040213600142140ustar00routeroute/* * $Id: report.c,v 1.4 2002/05/15 06:46:54 route Exp $ * * Firewalk 5.0 * report.c - Reporting code * * Copyright (c) 1998 - 2002 Mike D. Schiffman * Copyright (c) 1998, 1999 David E. Goldsmith * http://www.packetfactory.net/firewalk * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #if (HAVE_CONFIG_H) #include "../include/config.h" #endif #include "../include/firewalk.h" #include "../include/unreachables.h" void fw_report(int class, struct firepack **fp) { struct libnet_ipv4_hdr *ip_hdr; ip_hdr = (struct libnet_ipv4_hdr *) ((*fp)->packet + (*fp)->packet_offset); if (((*fp)->flags & FW_BOUND) && ip_hdr->ip_src.s_addr == (*fp)->metric) { /* adjacent target gateway and metric */ printf("A! "); } switch (class) { case FW_PACKET_IS_TTL_EX_EN_ROUTE: printf("expired [%s]\n", libnet_addr2name4(ip_hdr->ip_src.s_addr, ((*fp)->flags) & FW_RESOLVE)); break; case FW_PACKET_IS_UNREACH_EN_ROUTE: printf("unreach %s [%s]\n", fw_get_unreach_code(fp), libnet_addr2name4(ip_hdr->ip_src.s_addr, ((*fp)->flags) & FW_RESOLVE)); break; case FW_PACKET_IS_TERMINAL_TTL_EX: printf("terimnal (expired) [%s]\n", libnet_addr2name4(ip_hdr->ip_src.s_addr, ((*fp)->flags) & FW_RESOLVE)); break; case FW_PACKET_IS_TERMINAL_UNREACH: printf("terminal (unreach %s) [%s]\n", fw_get_unreach_code(fp), libnet_addr2name4(ip_hdr->ip_src.s_addr, ((*fp)->flags) & FW_RESOLVE)); break; case FW_PACKET_IS_TERMINAL_SYNACK: printf("terminal (synack) [%s]\n", libnet_addr2name4(ip_hdr->ip_src.s_addr, ((*fp)->flags) & FW_RESOLVE)); break; case FW_PACKET_IS_TERMINAL_RST: printf("terminal (rst) [%s]\n", libnet_addr2name4(ip_hdr->ip_src.s_addr, ((*fp)->flags) & FW_RESOLVE)); break; case FW_PORT_IS_OPEN_SYNACK: printf("open (port listen) [%s]\n", libnet_addr2name4(ip_hdr->ip_src.s_addr, ((*fp)->flags) & FW_RESOLVE)); (*fp)->stats.ports_open++; break; case FW_PORT_IS_OPEN_RST: printf("open (port not listen) [%s]\n", libnet_addr2name4(ip_hdr->ip_src.s_addr, ((*fp)->flags) & FW_RESOLVE)); (*fp)->stats.ports_open++; break; case FW_PORT_IS_OPEN_UNREACH: printf("unknown (unreach %s) [%s]\n", fw_get_unreach_code(fp), libnet_addr2name4(ip_hdr->ip_src.s_addr, ((*fp)->flags) & FW_RESOLVE)); (*fp)->stats.ports_unknown++; break; case FW_PORT_IS_OPEN_TTL_EX: printf("open (expired) [%s]\n", libnet_addr2name4(ip_hdr->ip_src.s_addr, ((*fp)->flags) & FW_RESOLVE)); (*fp)->stats.ports_open++; break; default: break; } } void fw_report_stats(struct firepack **fp) { printf("\nTotal packets sent: %ld\n" "Total packet errors: %ld\n" "Total packets caught %ld\n" "Total packets caught of interest %d\n" "Total ports scanned %d\n" "Total ports open: %d\n" "Total ports unknown: %d\n", (*fp)->stats.packets_sent, (*fp)->stats.packets_err, (*fp)->stats.packets_caught, (*fp)->stats.packets_caught_interesting, (*fp)->stats.ports_total, (*fp)->stats.ports_open, (*fp)->stats.ports_unknown); } char * fw_get_unreach_code(struct firepack **fp) { struct libnet_icmpv4_hdr *icmp_hdr; icmp_hdr = (struct libnet_icmpv4_hdr *) ((*fp)->packet + (*fp)->packet_offset + LIBNET_IPV4_H); if (icmp_hdr->icmp_code > 15) { return ("Unknown unreachable code"); } return (unreachables[icmp_hdr->icmp_code]); } /* EOF */ Firewalk/src/signal.c010064400017500001750000000041430747040213600141560ustar00routeroute/* * $Id: signal.c,v 1.4 2002/05/15 06:46:54 route Exp $ * * Firewalk 5.0 * signal.c - Signal handling code * * Copyright (c) 1998 - 2002 Mike D. Schiffman * Copyright (c) 1998, 1999 David E. Goldsmith * http://www.packetfactory.net/firewalk * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #if (HAVE_CONFIG_H) #include "../include/config.h" #endif #include "../include/firewalk.h" extern int loop; int catch_sig(int signo, void (*handler)()) { struct sigaction action; /* install the new handler */ action.sa_handler = handler; /* unblock all other signals */ sigemptyset(&action.sa_mask); action.sa_flags = 0; if (sigaction(signo, &action, NULL) == -1) { return (-1); } else { return (1); } } void catch_sigint(int nil) { loop = 0; } /* EOF */ Firewalk/src/util.c010064400017500001750000000065070747005366000136700ustar00routeroute/* * $Id: util.c,v 1.2 2002/05/14 00:17:52 route Exp $ * * Firewalk 5.0 * util.c - Misc routines * * Copyright (c) 1998 - 2002 Mike D. Schiffman * Copyright (c) 1998, 1999 David E. Goldsmith * http://www.packetfactory.net/firewalk * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #if (HAVE_CONFIG_H) #include "../include/config.h" #endif #include #include "../include/firewalk.h" int fw_str2int(register const char *str, register const char *what, register int min, register int max) { register const char *cp; register int val; char *ep; if (str[0] == '0' && (str[1] == 'x' || str[1] == 'X')) { cp = str + 2; val = (int)strtol(cp, &ep, 16); } else { val = (int)strtol(str, &ep, 10); } if (*ep != '\0') { fprintf(stderr, "\"%s\" bad value for %s \n", str, what); exit(EXIT_FAILURE); } if (val < min && min >= 0) { if (min == 0) { fprintf(stderr, "%s must be >= %d\n", what, min); return (-1); } else { fprintf(stderr, "%s must be > %d\n", what, min - 1); exit(EXIT_FAILURE); } } if (val > max && max >= 0) { fprintf(stderr, "%s must be <= %d\n", what, max); exit(EXIT_FAILURE); } return (val); } int fw_prot_select(char *protocol) { char *supp_protocols[] = {"UDP", "TCP", 0}; int i; for (i = 0; supp_protocols[i]; i++) { if ((!strcasecmp(supp_protocols[i], protocol))) { switch (i) { case 0: /* UDP */ return (IPPROTO_UDP); case 1: /* TCP */ return (IPPROTO_TCP); default: fprintf(stderr, "unsupported protocol: %s\n", protocol); exit(EXIT_FAILURE); } } } fprintf(stderr, "unsupported protocol: %s\n", protocol); return (-1); } /* EOF */ Firewalk/src/firewalk.c010064400017500001750000000164720747056751100145260ustar00routeroute/* * $Id: firewalk.c,v 1.2 2002/05/14 23:28:37 route Exp $ * * Firewalk 5.0 * firewalk.c - Scanning driver * * Copyright (c) 1998 - 2002 Mike D. Schiffman * Copyright (c) 1998, 1999 David E. Goldsmith * http://www.packetfactory.net/firewalk * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #if (HAVE_CONFIG_H) #include "../include/config.h" #endif #include "../include/firewalk.h" int firewalk(struct firepack **fp) { int done, i, j; u_short bport, cport, eport; /* inform the user what's what */ printf("%s-based scan.\n", (*fp)->protocol == IPPROTO_TCP ? "TCP" : "UDP"); printf("Ramping phase source port: %d, destination port: %d\n", (*fp)->sport, (*fp)->dport); if ((*fp)->flags & FW_STRICT_RFC && (*fp)->protocol == IPPROTO_TCP) { printf("Using strict RFC adherence.\n"); } printf("Hotfoot through %s using %s as a metric.\n", libnet_addr2name4(((*fp)->gateway), ((*fp)->flags) & FW_RESOLVE), libnet_addr2name4(((*fp)->metric), ((*fp)->flags) & FW_RESOLVE)); /* * PHASE ONE: Firewalk hopcount ramping * A standard Traceroute-style IP expiry scan is initiated towards * the metric, with the intent being to find how many hops away the * target gateway is from the scanning host. We'll increment the * hopcounter and update packet template each pass through the loop. */ printf("Ramping Phase:\n"); for (done = 0, i = 0; !done && i < FW_IP_HOP_MAX; i++) { /* send a series of probes (currently only one) */ for (j = 0; j < 1; j++) { fprintf(stderr, "%2d (TTL %2d): ", i + 1, (*fp)->ttl); if (fw_packet_inject(fp) == -1) { /* * Perhaps this write error was transient. We'll hope * for the best. Inform the user and continue. */ fprintf(stderr, "fw_packet_inject(): %s\n", (*fp)->errbuf); continue; } switch (fw_packet_capture(fp)) { case FW_PACKET_IS_UNREACH_EN_ROUTE: case FW_PACKET_IS_TTL_EX_EN_ROUTE: if ((*fp)->flags & FW_BOUND) { printf("Binding host reached.\n"); done = 1; } break; case FW_PACKET_IS_TERMINAL_TTL_EX: case FW_PACKET_IS_TERMINAL_UNREACH: case FW_PACKET_IS_TERMINAL_SYNACK: case FW_PACKET_IS_TERMINAL_RST: /* any terminal response will end phase one */ done = 1; break; case -1: case FW_SERIOUS_ERROR: /* err msg set in fw_packet_capture() */ return (FW_SERIOUS_ERROR); case FW_USER_INTERRUPT: /* user hit ctrl-c */ return (FW_USER_INTERRUPT); } } if (!done) { if (fw_packet_update_probe(fp, 0) == -1) { /* error msg set in fw_packet_update_probe */ return (-1); } } } if (done && !((*fp)->flags & FW_BOUND)) { /* * If we're "done" but not "bound" then we hit the metric * before we hit the target gateway. This means the target * gateway is not en route to the metric. Game's over kids. */ sprintf((*fp)->errbuf, "metric responded before target; must not be en route"); return (FW_ABORT_SCAN); } if (!done) { /* if we fall through down here, we've exceeded our hopcount */ sprintf((*fp)->errbuf, "hopcount exceeded"); return (FW_ABORT_SCAN); } /* * PHASE TWO: Firewalk scanning * A series of probes are sent from to the metric with the bound IP * TTL. If a given probe is accepted through the target gateway's * ACL, we will receive an ICMP TTL expired in transit from the * binding host If we receive no response after the timeout expires, * it is assumed the probe violated the ACL on the target and was * dropped. */ (*fp)->ttl += (*fp)->xv; printf("Scan bound at %d hops.\n", (*fp)->ttl); printf("Scanning Phase: \n"); for (done = 0, i = 0; !done; i++) { if (!libnet_plist_chain_next_pair((*fp)->plist, &bport, &eport)) { /* we've exhausted our portlist and we're done */ done = 1; continue; } while (!(bport > eport) && bport != 0) { cport = bport++; if (fw_packet_update_probe(fp, cport) == -1) { /* error msg set in fw_packet_update_probe */ return (-1); } /* send a series of probes (currently only one) */ for (j = 0; j < 1; j++) { fprintf(stderr, "port %3d: ", cport); (*fp)->stats.ports_total++; if (fw_packet_inject(fp) == -1) { /* * Perhaps this write error was transient. We'll * hope for the best. Inform the user and continue. */ fprintf(stderr, "fw_packet_inject(): %s\n", (*fp)->errbuf); continue; } /* we don't care what the return value is this time */ switch(fw_packet_capture(fp)) { case FW_USER_INTERRUPT: return (FW_USER_INTERRUPT); case -1: case FW_SERIOUS_ERROR: /* err msg set in fw_packet_capture() */ return (FW_SERIOUS_ERROR); default: /* empty */ } } } } return (1); } /* EOF */ Firewalk/CVS004075500017500001750000000000000747031664500123345ustar00routerouteFirewalk/CVS/Root010064400017500001750000000000200746625110000132330ustar00routeroute/usr/local/CVS/ Firewalk/CVS/Repository010064400017500001750000000000200746625110000144670ustar00routerouteFirewalk-latest Firewalk/CVS/Entries010064400017500001750000000014450747031664500137500ustar00routeroute/BUGS/1.1.1.1/Wed May 8 16:28:34 2002// /Makefile.am/1.1.1.1/Wed May 8 16:28:34 2002// /TODO/1.1.1.1/Wed May 8 16:28:34 2002// /VERSION/1.1.1.1/Wed May 8 16:28:34 2002// /aclocal.m4/1.1.1.1/Wed May 8 16:28:34 2002// /config.guess/1.1.1.1/Wed May 8 16:28:34 2002// /config.sub/1.1.1.1/Wed May 8 16:28:34 2002// /install-sh/1.1.1.1/Wed May 8 16:28:34 2002// /missing/1.1.1.1/Wed May 8 16:28:34 2002// /mkinstalldirs/1.1.1.1/Wed May 8 16:28:34 2002// /version.h.in/1.1.1.1/Wed May 8 16:28:34 2002// D/include//// D/man//// D/src//// /Makefile.am.common/1.2/Fri May 10 00:03:53 2002// /acconfig.h/1.3/Tue May 14 00:17:52 2002// /configure/1.3/Mon May 13 04:11:56 2002// /configure.in/1.3/Tue May 14 00:17:52 2002// /Makefile.in/1.5/Tue May 14 23:28:37 2002// /README/1.2/Tue May 14 23:28:37 2002// Firewalk/include004075500017500001750000000000000755464102300133165ustar00routerouteFirewalk/include/CVS004075500017500001750000000000000747040213600137465ustar00routerouteFirewalk/include/CVS/Root010064400017500001750000000000170746625110000146640ustar00routeroute/usr/local/CVS Firewalk/include/CVS/Repository010064400017500001750000000000300746625110000161130ustar00routerouteFirewalk-latest/include Firewalk/include/CVS/Entries010064400017500001750000000003440747040213600153570ustar00routeroute/stamp-h.in/1.1.1.1/Wed May 8 16:28:34 2002// /stamp-h1/1.1.1.1/Wed May 8 16:28:34 2002// /config.h.in/1.3/Tue May 14 00:17:52 2002// /unreachables.h/1.2/Tue May 14 23:28:37 2002// /firewalk.h/1.6/Wed May 15 06:46:54 2002// D Firewalk/include/config.h.in010064400017500001750000000020760747005366000154230ustar00routeroute/* include/config.h.in. Generated automatically from configure.in by autoheader. */ /* dnl $Id: config.h.in,v 1.3 2002/05/14 00:17:52 route Exp $ dnl dnl Firewalk autoconfiguration acconfig.h file dnl Copyright (c) 1998 - 2002 Mike D. Schiffman dnl All rights reserved. dnl dnl Process this file with autoheader to produce a config.h file. dnl */ #undef HAVE_SOLARIS #undef HAVE_BPF /* Define if you have the `dnet' library (-ldnet). */ #undef HAVE_LIBDNET /* Define if you have the `net' library (-lnet). */ #undef HAVE_LIBNET /* Define if you have the `nsl' library (-lnsl). */ #undef HAVE_LIBNSL /* Define if you have the `pcap' library (-lpcap). */ #undef HAVE_LIBPCAP /* Define if you have the `socket' library (-lsocket). */ #undef HAVE_LIBSOCKET /* Define if you have the `strerror' function. */ #undef HAVE_STRERROR /* Name of package */ #undef PACKAGE /* Define if you have the ANSI C header files. */ #undef STDC_HEADERS /* Version number of package */ #undef VERSION /* Define to empty if `const' does not conform to ANSI C. */ #undef const Firewalk/include/firewalk.h010064400017500001750000000241720747040213600153520ustar00routeroute/* * $Id: firewalk.h,v 1.6 2002/05/15 06:46:54 route Exp $ * * Firewalk 5.0 * firewalk.h - Interface * * Copyright (c) 1998 - 2002 Mike D. Schiffman * Copyright (c) 1998, 1999 David E. Goldsmith * http://www.packetfactory.net/firewalk * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #ifndef _FIREWALK_H #define _FIREWALK_H #include #include #include #include #include #define FW_BANNER "Firewalk (c) 2002 Mike D. Schiffman \ \nhttp://www.packetfactory.net/firewalk\n\ for more information.\n" /* responses for the ramping phase */ #define FW_NO_REPLY 0x00 #define FW_PACKET_IS_BORING 0x01 #define FW_PACKET_IS_TTL_EX_EN_ROUTE 0x02 #define FW_PACKET_IS_UNREACH_EN_ROUTE 0x03 #define FW_PACKET_IS_TERMINAL_TTL_EX 0x04 #define FW_PACKET_IS_TERMINAL_UNREACH 0x05 #define FW_PACKET_IS_TERMINAL_SYNACK 0x06 #define FW_PACKET_IS_TERMINAL_RST 0x07 /* responses for the scanning phase */ #define FW_PORT_IS_OPEN_SYNACK 0x08 #define FW_PORT_IS_OPEN_RST 0x09 #define FW_PORT_IS_OPEN_UNREACH 0x0a #define FW_PORT_IS_OPEN_TTL_EX 0x0b /* misc responses */ #define FW_ABORT_SCAN 0xfd #define FW_USER_INTERRUPT 0xfe #define FW_SERIOUS_ERROR 0xff /* default libpcap timeout */ #define FW_REPLY_TIMEOUT 0x02 /* snapshot length */ #define FW_SNAPLEN 0x60 #define FW_DEFAULT_PORT_LIST "1-130,139,1025" /* various minimums and maximums */ #define FW_PORT_MAX 0xffff #define FW_PORT_MIN 0x00 #define FW_PCAP_TIMEOUT_MAX 0x3e8 #define FW_PCAP_TIMEOUT_MIN 0x01 #define FW_IP_HOP_MAX 0x19 #define FW_IP_HOP_MIN 0x01 #define FW_XV_MAX 0x08 #define FW_XV_MIN 0x01 /* BPF filter strings */ #define FW_BPF_FILTER_UDP "icmp[0] == 11 or icmp[0] == 3 or udp" #define FW_BPF_FILTER_TCP "icmp[0] == 11 or icmp[0] == 3 or tcp[13] ==\ 0x12 or tcp[13] == 0x4 or tcp[13] == 0x14" /* checks if an IP packet inside of ICMP error message is ours */ #define FW_IS_OURS(ip, fp) \ (ntohs(ip->ip_id) == \ (*fp)->id && ip->ip_src.s_addr == \ (*fp)->sin.sin_addr.s_addr) !=0 /* firewalk statistics structure */ struct firepack_stats { u_short ports_total; /* number of ports scanned */ u_short ports_open; /* open ports */ u_short ports_unknown; /* unknown ports */ u_long packets_sent; /* packets sent */ u_long packets_err; /* packets errors */ u_long packets_caught; /* packets we caught total */ u_short packets_caught_interesting; /* packets we cared about */ }; /* main monolithic firewalk context structure */ struct firepack { char *device; /* interface */ u_char *packet; /* packet captured from the wire */ pcap_t *p; /* libpcap context */ libnet_t *l; /* libnet context */ libnet_plist_t *plist; /* linked list of ports */ u_short ttl; /* starting IP TTL */ u_short sport; /* source port */ u_short dport; /* ramping destination port */ u_short id; /* firepack packet ID */ u_short packet_size; /* outgoing packet size */ u_char xv; /* expiry vector */ u_char flags; /* internal flags used by the program */ #define FW_RESOLVE 0x01 /* resolve IP addresses */ #define FW_STRICT_RFC 0x02 /* strict RFC 793 compliance */ #define FW_BOUND 0x04 /* bound scan */ #define FW_FINGERPRINT 0x08 /* fingerprint (TCP only) */ int packet_offset; /* IP packet offset */ int protocol; /* firewalking protocol to use */ int pcap_timeout; /* packet capturing timeout */ u_long gateway; /* gateway to probe */ u_long metric; /* metric host */ u_long seq; /* TCP sequence number used */ libnet_ptag_t ip; /* ip ptag */ libnet_ptag_t udp; /* udp ptag */ libnet_ptag_t tcp; /* tcp ptag */ libnet_ptag_t icmp; /* icmp ptag */ struct sockaddr_in sin; /* socket address structure */ struct firepack_stats stats; /* stats */ #define FW_ERRBUF_SIZE 0x100 /* 256 bytes */ char errbuf[FW_ERRBUF_SIZE]; /* errors here */ }; /* initializes firewalk context */ int /* 1 on success -1 or failure */ fw_init_context( struct firepack **, /* firewalk context */ char * ); /* initialize firewalk networking primitives */ int /* 1 on success -1 or failure */ fw_init_net( struct firepack **, /* firewalk context */ char *, /* target gateway */ char *, /* metric */ char * /* port list or NULL */ ); /* ramping/scanning driver */ int firewalk( struct firepack ** /* firewalk context */ ); /* build initial probe template */ int /* 1 on success -1 or failure */ fw_packet_build_probe( struct firepack ** /* firewalk context */ ); /* build UDP header */ int /* 1 on success -1 or failure */ fw_packet_build_udp( struct firepack ** /* firewalk context */ ); /* build TCP header */ int /* 1 on success -1 or failure */ fw_packet_build_tcp( struct firepack ** /* firewalk context */ ); /* build ICMP header */ int /* 1 on success -1 or failure */ fw_packet_build_icmp( struct firepack ** /* firewalk context */ ); /* capture packet from network */ int /* -1 on failure or packet code */ fw_packet_capture( struct firepack ** /* firewalk context */ ); /* sets libpcap BPF filter */ int /* 1 on success -1 or failure */ fw_set_pcap_filter( char *, /* filter code to install */ struct firepack ** /* firewalk context */ ); /* injects packet to network */ int /* 1 on success -1 or failure */ fw_packet_inject( struct firepack ** /* firewalk context */ ); /* updates packet template */ int /* 1 on success -1 or failure */ fw_packet_update_probe( struct firepack **, /* firewalk context */ u_short /* 0 for ramping cport for scanning */ ); /* verifies a ramping response */ int /* packet code */ fw_packet_verify_ramp( struct firepack ** /* firewalk context */ ); /* verifies a scanning response */ int /* packet code */ fw_packet_verify_scan( struct firepack ** /* firewalk context */ ); /* writes info to the user */ void fw_report( int, /* packet class */ struct firepack ** /* firewalk context */ ); /* looks up the ICMP unreachable code of a response */ char * /* unreachable code */ fw_get_unreach_code( struct firepack ** /* firewalk context */ ); /* report statistics to the user */ void fw_report_stats( struct firepack ** /* firewalk context */ ); /* installs a new signal handler for a specified signal */ int /* 1 on success -1 or failure */ catch_sig( int, /* signal to catch */ void (*)() /* new signal handler */ ); /* handles SIGINT from user */ void catch_sigint( int /* unused */ ); /* converts a string to an int within the bounds specified */ int fw_str2int( register const char *, /* value to convert */ register const char *, /* canonical definition */ register int, /* minimum */ register int); /* maximum */ /* coverts canonical protocol to integer representation */ int /* -1 on failure or protocol */ fw_prot_select( char * /* protocol */ ); /* shutdown firewalk */ void fw_shutdown( struct firepack ** /* firewalk context */ ); /* dump usage */ void usage( u_char * /* argv[0] */ ); #endif /* _FIREWALK_H */ /* EOF */ Firewalk/include/stamp-h1010064400017500001750000000000120746625111100147350ustar00routeroutetimestamp Firewalk/include/unreachables.h010064400017500001750000000043050747031664500162070ustar00routeroute/* * $Id: unreachables.h,v 1.2 2002/05/14 23:28:37 route Exp $ * * Firewalk 5.0 * unreachables.h - ICMP unreachable codes * * Copyright (c) 1998 - 2002 Mike D. Schiffman * Copyright (c) 1998, 1999 David E. Goldsmith * http://www.packetfactory.net/firewalk * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #ifndef _FW_UNREACHABLES_H #define _FW_UNREACHABLES_H char *unreachables[] = { "ICMP_UNREACH_NET", "ICMP_UNREACH_HOST", "ICMP_UNREACH_PROTOCOL", "ICMP_UNREACH_PORT", "ICMP_UNREACH_NEEDFRAG", "ICMP_UNREACH_SRCFAIL", "ICMP_UNREACH_NET_UNKNOWN", "ICMP_UNREACH_HOST_UNKNOWN", "ICMP_UNREACH_ISOLATED", "ICMP_UNREACH_NET_PROHIB", "ICMP_UNREACH_HOST_PROHIB", "ICMP_UNREACH_TOSNET", "ICMP_UNREACH_TOSHOST", "ICMP_UNREACH_FILTER_PROHIB", "ICMP_UNREACH_HOST_PRECEDENCE", "ICMP_UNREACH_PRECEDENCE_CUTOFF", 0 }; #endif /* _FW_UNREACHABLES_H */ /* EOF */ Firewalk/include/stamp-h010064400017500001750000000000120755464065000146640ustar00routeroutetimestamp Firewalk/include/stamp-h.in010064400017500001750000000000000746625106200152630ustar00routerouteFirewalk/VERSION010064400017500001750000000000040746625106200130130ustar00routeroute5.0 Firewalk/acconfig.h010064400017500001750000000005000747005366000136650ustar00routeroute/* dnl $Id: acconfig.h,v 1.3 2002/05/14 00:17:52 route Exp $ dnl dnl Firewalk autoconfiguration acconfig.h file dnl Copyright (c) 1998 - 2002 Mike D. Schiffman dnl All rights reserved. dnl dnl Process this file with autoheader to produce a config.h file. dnl */ #undef HAVE_SOLARIS #undef HAVE_BPF Firewalk/SOURCE010064400017500001750000002362420747031673000127040ustar00routeroute/* * $Id: firewalk.h,v 1.5 2002/05/14 23:28:37 route Exp $ * * Firewalk 5.0 * firewalk.h - Interface * * Copyright (c) 1998 - 2002 Mike D. Schiffman * Copyright (c) 1998, 1999 David E. Goldsmith * http://www.packetfactory.net/firewalk * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #ifndef _FIREWALK_H #define _FIREWALK_H #include #include #include #include #include #define FW_BANNER "Firewalk (c) 2002 Mike D. Schiffman \ \nhttp://www.packetfactory.net/firewalk\n\ for more information.\n" /* responses for the ramping phase */ #define FW_NO_REPLY 0x00 #define FW_PACKET_IS_BORING 0x01 #define FW_PACKET_IS_TTL_EX_EN_ROUTE 0x02 #define FW_PACKET_IS_UNREACH_EN_ROUTE 0x03 #define FW_PACKET_IS_TERMINAL_TTL_EX 0x04 #define FW_PACKET_IS_TERMINAL_UNREACH 0x05 #define FW_PACKET_IS_TERMINAL_SYNACK 0x06 #define FW_PACKET_IS_TERMINAL_RST 0x07 /* responses for the scanning phase */ #define FW_PORT_IS_OPEN_SYNACK 0x08 #define FW_PORT_IS_OPEN_RST 0x09 #define FW_PORT_IS_OPEN_UNREACH 0x0a #define FW_PORT_IS_OPEN_TTL_EX 0x0b /* misc responses */ #define FW_ABORT_SCAN 0xfd #define FW_USER_INTERRUPT 0xfe #define FW_SERIOUS_ERROR 0xff /* default libpcap timeout */ #define FW_REPLY_TIMEOUT 0x02 /* snapshot length */ #define FW_SNAPLEN 0x60 #define FW_DEFAULT_PORT_LIST "1-130,139,1025" /* various minimums and maximums */ #define FW_PORT_MAX 0xffff #define FW_PORT_MIN 0x00 #define FW_PCAP_TIMEOUT_MAX 0x3e8 #define FW_PCAP_TIMEOUT_MIN 0x01 #define FW_IP_HOP_MAX 0x19 #define FW_IP_HOP_MIN 0x01 #define FW_XV_MAX 0x08 #define FW_XV_MIN 0x01 /* BPF filter strings */ #define FW_BPF_FILTER_UDP "icmp[0] == 11 or icmp[0] == 3 or udp" #define FW_BPF_FILTER_TCP "icmp[0] == 11 or icmp[0] == 3 or tcp[13] ==\ 0x12 or tcp[13] == 0x4 or tcp[13] == 0x14" /* checks if an IP packet inside of ICMP error message is ours */ #define FW_IS_OURS(ip, fp) \ (ntohs(ip->ip_id) == \ (*fp)->id && ip->ip_src.s_addr == \ (*fp)->sin.sin_addr.s_addr) !=0 /* firewalk statistics structure */ struct firepack_stats { u_short ports_total; /* number of ports scanned */ u_short ports_open; /* open ports */ u_short ports_unknown; /* unknown ports */ u_long packets_sent; /* packets sent */ u_long packets_err; /* packets errors */ u_long packets_caught; /* packets we caught total */ u_short packets_caught_interesting; /* packets we cared about */ }; /* main monolithic firewalk context structure */ struct firepack { char *device; /* interface */ u_char *packet; /* packet captured from the wire */ pcap_t *p; /* libpcap context */ libnet_t *l; /* libnet context */ libnet_plist_t *plist; /* linked list of ports */ u_short ttl; /* starting IP TTL */ u_short sport; /* source port */ u_short dport; /* ramping destination port */ u_short id; /* firepack packet ID */ u_short packet_size; /* outgoing packet size */ u_char xv; /* expiry vector */ u_char flags; /* internal flags used by the program */ #define FW_RESOLVE 0x01 /* resolve IP addresses */ #define FW_STRICT_RFC 0x02 /* strict RFC 793 compliance */ #define FW_BOUND 0x04 /* bound scan */ #define FW_FINGERPRINT 0x08 /* fingerprint (TCP only) */ int packet_offset; /* IP packet offset */ int protocol; /* firewalking protocol to use */ int pcap_timeout; /* packet capturing timeout */ u_long gateway; /* gateway to probe */ u_long metric; /* metric host */ u_long seq; /* TCP sequence number used */ libnet_ptag_t ip; /* ip ptag */ libnet_ptag_t udp; /* udp ptag */ libnet_ptag_t tcp; /* tcp ptag */ libnet_ptag_t icmp; /* icmp ptag */ struct sockaddr_in sin; /* socket address structure */ struct firepack_stats stats; /* stats */ #define FW_ERRBUF_SIZE 0x100 /* 256 bytes */ char errbuf[FW_ERRBUF_SIZE]; /* errors here */ }; /* initializes firewalk context */ int /* 1 on success -1 or failure */ fw_init_context( struct firepack **, /* firewalk context */ char * ); /* initialize firewalk networking primitives */ int /* 1 on success -1 or failure */ fw_init_net( struct firepack **, /* firewalk context */ char *, /* target gateway */ char *, /* metric */ char * /* port list or NULL */ ); /* ramping/scanning driver */ int firewalk( struct firepack ** /* firewalk context */ ); /* build initial probe template */ int /* 1 on success -1 or failure */ fw_packet_build_probe( struct firepack ** /* firewalk context */ ); /* build UDP header */ int /* 1 on success -1 or failure */ fw_packet_build_udp( struct firepack ** /* firewalk context */ ); /* build TCP header */ int /* 1 on success -1 or failure */ fw_packet_build_tcp( struct firepack ** /* firewalk context */ ); /* build ICMP header */ int /* 1 on success -1 or failure */ fw_packet_build_icmp( struct firepack ** /* firewalk context */ ); /* capture packet from network */ int /* -1 on failure or packet code */ fw_packet_capture( struct firepack ** /* firewalk context */ ); /* sets libpcap BPF filter */ int /* 1 on success -1 or failure */ fw_set_pcap_filter( char *, /* filter code to install */ struct firepack ** /* firewalk context */ ); /* injects packet to network */ int /* 1 on success -1 or failure */ fw_packet_inject( struct firepack ** /* firewalk context */ ); /* updates packet template */ int /* 1 on success -1 or failure */ fw_packet_update_probe( struct firepack **, /* firewalk context */ u_short /* 0 for ramping, cport for scanning */ ); /* verifies a ramping response */ int /* packet code */ fw_packet_verify_ramp( struct firepack ** /* firewalk context */ ); /* verifies a scanning response */ int /* packet code */ fw_packet_verify_scan( struct firepack ** /* firewalk context */ ); /* writes info to the user */ void fw_report( int, /* packet class */ struct firepack ** /* firewalk context */ ); /* looks up the ICMP unreachable code of a response */ char * /* unreachable code */ fw_get_unreach_code( struct firepack ** /* firewalk context */ ); /* report statistics to the user */ void fw_report_stats( struct firepack ** /* firewalk context */ ); /* installs a new signal handler for a specified signal */ int /* 1 on success -1 or failure */ catch_sig( int, /* signal to catch */ void (*)() /* new signal handler */ ); /* handles SIGINT from user */ void catch_sigint( int /* unused */ ); /* converts a string to an int within the bounds specified */ int fw_str2int( register const char *, /* value to convert */ register const char *, /* canonical definition */ register int, /* minimum */ register int); /* maximum */ /* coverts canonical protocol to integer representation */ int /* -1 on failure or protocol */ fw_prot_select( char * /* protocol */ ); /* shutdown firewalk */ void fw_shutdown( struct firepack ** /* firewalk context */ ); /* dump usage */ void usage( u_char * /* argv[0] */ ); #endif /* _FIREWALK_H */ /* EOF */ /* * $Id: unreachables.h,v 1.2 2002/05/14 23:28:37 route Exp $ * * Firewalk 5.0 * unreachables.h - ICMP unreachable codes * * Copyright (c) 1998 - 2002 Mike D. Schiffman * Copyright (c) 1998, 1999 David E. Goldsmith * http://www.packetfactory.net/firewalk * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #ifndef _FW_UNREACHABLES_H #define _FW_UNREACHABLES_H char *unreachables[] = { "ICMP_UNREACH_NET", "ICMP_UNREACH_HOST", "ICMP_UNREACH_PROTOCOL", "ICMP_UNREACH_PORT", "ICMP_UNREACH_NEEDFRAG", "ICMP_UNREACH_SRCFAIL", "ICMP_UNREACH_NET_UNKNOWN", "ICMP_UNREACH_HOST_UNKNOWN", "ICMP_UNREACH_ISOLATED", "ICMP_UNREACH_NET_PROHIB", "ICMP_UNREACH_HOST_PROHIB", "ICMP_UNREACH_TOSNET", "ICMP_UNREACH_TOSHOST", "ICMP_UNREACH_FILTER_PROHIB", "ICMP_UNREACH_HOST_PRECEDENCE", "ICMP_UNREACH_PRECEDENCE_CUTOFF", 0 }; #endif /* _FW_UNREACHABLES_H */ /* EOF */ /* * $Id: firewalk.c,v 1.2 2002/05/14 23:28:37 route Exp $ * * Firewalk 5.0 * firewalk.c - Scanning driver * * Copyright (c) 1998 - 2002 Mike D. Schiffman * Copyright (c) 1998, 1999 David E. Goldsmith * http://www.packetfactory.net/firewalk * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #if (HAVE_CONFIG_H) #include "../include/config.h" #endif #include "../include/firewalk.h" int firewalk(struct firepack **fp) { int done, i, j; u_short bport, cport, eport; /* inform the user what's what */ printf("%s-based scan.\n", (*fp)->protocol == IPPROTO_TCP ? "TCP" : "UDP"); printf("Ramping phase source port: %d, destination port: %d\n", (*fp)->sport, (*fp)->dport); if ((*fp)->flags & FW_STRICT_RFC && (*fp)->protocol == IPPROTO_TCP) { printf("Using strict RFC adherence.\n"); } printf("Hotfoot through %s using %s as a metric.\n", libnet_addr2name4(((*fp)->gateway), ((*fp)->flags) & FW_RESOLVE), libnet_addr2name4(((*fp)->metric), ((*fp)->flags) & FW_RESOLVE)); /* * PHASE ONE: Firewalk hopcount ramping * A standard Traceroute-style IP expiry scan is initiated towards * the metric, with the intent being to find how many hops away the * target gateway is from the scanning host. We'll increment the * hopcounter and update packet template each pass through the loop. */ printf("Ramping Phase:\n"); for (done = 0, i = 0; !done && i < FW_IP_HOP_MAX; i++) { /* send a series of probes (currently only one) */ for (j = 0; j < 1; j++) { fprintf(stderr, "%2d (TTL %2d): ", i + 1, (*fp)->ttl); if (fw_packet_inject(fp) == -1) { /* * Perhaps this write error was transient. We'll hope * for the best. Inform the user and continue. */ fprintf(stderr, "fw_packet_inject(): %s\n", (*fp)->errbuf); continue; } switch (fw_packet_capture(fp)) { case FW_PACKET_IS_UNREACH_EN_ROUTE: case FW_PACKET_IS_TTL_EX_EN_ROUTE: if ((*fp)->flags & FW_BOUND) { printf("Binding host reached.\n"); done = 1; } break; case FW_PACKET_IS_TERMINAL_TTL_EX: case FW_PACKET_IS_TERMINAL_UNREACH: case FW_PACKET_IS_TERMINAL_SYNACK: case FW_PACKET_IS_TERMINAL_RST: /* any terminal response will end phase one */ done = 1; break; case -1: case FW_SERIOUS_ERROR: /* err msg set in fw_packet_capture() */ return (FW_SERIOUS_ERROR); case FW_USER_INTERRUPT: /* user hit ctrl-c */ return (FW_USER_INTERRUPT); } } if (!done) { if (fw_packet_update_probe(fp, 0) == -1) { /* error msg set in fw_packet_update_probe */ return (-1); } } } if (done && !((*fp)->flags & FW_BOUND)) { /* * If we're "done" but not "bound" then we hit the metric * before we hit the target gateway. This means the target * gateway is not en route to the metric. Game's over kids. */ sprintf((*fp)->errbuf, "metric responded before target; must not be en route"); return (FW_ABORT_SCAN); } if (!done) { /* if we fall through down here, we've exceeded our hopcount */ sprintf((*fp)->errbuf, "hopcount exceeded"); return (FW_ABORT_SCAN); } /* * PHASE TWO: Firewalk scanning * A series of probes are sent from to the metric with the bound IP * TTL. If a given probe is accepted through the target gateway's * ACL, we will receive an ICMP TTL expired in transit from the * binding host If we receive no response after the timeout expires, * it is assumed the probe violated the ACL on the target and was * dropped. */ (*fp)->ttl += (*fp)->xv; printf("Scan bound at %d hops.\n", (*fp)->ttl); printf("Scanning Phase: \n"); for (done = 0, i = 0; !done; i++) { if (!libnet_plist_chain_next_pair((*fp)->plist, &bport, &eport)) { /* we've exhausted our portlist and we're done */ done = 1; continue; } while (!(bport > eport) && bport != 0) { cport = bport++; if (fw_packet_update_probe(fp, cport) == -1) { /* error msg set in fw_packet_update_probe */ return (-1); } /* send a series of probes (currently only one) */ for (j = 0; j < 1; j++) { fprintf(stderr, "port %3d: ", cport); (*fp)->stats.ports_total++; if (fw_packet_inject(fp) == -1) { /* * Perhaps this write error was transient. We'll * hope for the best. Inform the user and continue. */ fprintf(stderr, "fw_packet_inject(): %s\n", (*fp)->errbuf); continue; } /* we don't care what the return value is this time */ switch(fw_packet_capture(fp)) { case FW_USER_INTERRUPT: return (FW_USER_INTERRUPT); case -1: case FW_SERIOUS_ERROR: /* err msg set in fw_packet_capture() */ return (FW_SERIOUS_ERROR); default: /* empty */ } } } } return (1); } /* EOF */ /* * $Id: init.c,v 1.4 2002/05/14 23:28:37 route Exp $ * * Firewalk 5.0 * init.c - Main loop driver initialization * * Copyright (c) 1998 - 2002 Mike D. Schiffman * Copyright (c) 1998, 1999 David E. Goldsmith * http://www.packetfactory.net/firewalk * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #if (HAVE_CONFIG_H) #include "../include/config.h" #endif #include "../include/firewalk.h" int fw_init_context(struct firepack **fp, char *errbuf) { *fp = (struct firepack *)malloc(sizeof(struct firepack)); if (*fp == NULL) { snprintf(errbuf, FW_ERRBUF_SIZE, "malloc(): %s", strerror(errno)); return (-1); } memset(*fp, 0, sizeof(struct firepack)); /* set defaults here */ (*fp)->ttl = 1; /* initial probe IP TTL */ (*fp)->sport = 53; /* source port (TCP and UDP) */ (*fp)->dport = 33434; /* ala traceroute */ (*fp)->protocol = IPPROTO_UDP; (*fp)->id = getpid(); (*fp)->pcap_timeout = FW_REPLY_TIMEOUT; (*fp)->xv = 1; (*fp)->flags |= FW_RESOLVE; /* setup our signal handler to handle a ctrl-c */ if (catch_sig(SIGINT, catch_sigint) == -1) { snprintf(errbuf, FW_ERRBUF_SIZE, "catch_sig(): %s", strerror(errno)); return (-1); } return (1); } int fw_init_net(struct firepack **fp, char *gw, char *m, char *port_list) { #if HAVE_BPF int one; #endif char errbuf[PCAP_ERRBUF_SIZE]; /* get a libnet context */ (*fp)->l = libnet_init(LIBNET_LINK, (*fp)->device, errbuf); if ((*fp)->l == NULL) { snprintf((*fp)->errbuf, FW_ERRBUF_SIZE, "libnet_init(): %s", errbuf); return (-1); } /* get our device if the user didn't specify one*/ if ((*fp)->device == NULL) { (*fp)->device = libnet_getdevice((*fp)->l); } /* get the source address of our outgoing interface */ (*fp)->sin.sin_addr.s_addr = libnet_get_ipaddr4((*fp)->l); /* setup the target gateway */ if (((*fp)->gateway = libnet_name2addr4((*fp)->l, gw, 1)) == -1) { snprintf((*fp)->errbuf, FW_ERRBUF_SIZE, "libnet_name2addr4(): %s (target gateway: %s)", libnet_geterror((*fp)->l), gw); return (-1); } /* setup the metric */ if (((*fp)->metric = libnet_name2addr4((*fp)->l, m, 1)) == -1) { snprintf((*fp)->errbuf, FW_ERRBUF_SIZE, "libnet_name2addr4(): %s (metric: %s)", libnet_geterror((*fp)->l), m); return (-1); } /* sanity check */ if ((*fp)->gateway == (*fp)->metric) { snprintf((*fp)->errbuf, FW_ERRBUF_SIZE, "target gateway and metric cannot be the same"); return (-1); } /* get our port list stuff situated */ if (libnet_plist_chain_new((*fp)->l, &(*fp)->plist, port_list == NULL ? strdup(FW_DEFAULT_PORT_LIST) : port_list) == -1) { snprintf((*fp)->errbuf, FW_ERRBUF_SIZE, "libnet_plist_chain_new(): %s\n", libnet_geterror((*fp)->l)); return (-1); } /* get a pcap context */ (*fp)->p = pcap_open_live((*fp)->device, FW_SNAPLEN, 0, 0, errbuf); if (((*fp)->p) == NULL) { snprintf((*fp)->errbuf, FW_ERRBUF_SIZE, "pcap_open_live(): %s", errbuf); return (-1); } #if HAVE_BPF /* * BPF, by default, will buffer packets inside the kernel until * either the timer expires (which we do not use) or when the buffer * fills up. This is not sufficient for us since we could miss * responses to our probes. So we set BIOCIMMEDIATE to tell BPF * to return immediately when it gets a packet. This is pretty much * the same behavior we see with Linux which returns every time it * sees a packet. This is less than efficient since we're spending * more time interrupting the kernel, but hey, we gotta get our * work done! */ one = 1; if (ioctl(pcap_fileno((*fp)->p), BIOCIMMEDIATE, &one) < 0) { snprintf((*fp)->errbuf, FW_ERRBUF_SIZE, "ioctl(): BIOCIMMEDIATE: %s", strerror(errno)); return (-1); } #endif /* get the datalink size */ switch (pcap_datalink((*fp)->p)) { case DLT_SLIP: (*fp)->packet_offset = 0x10; break; case DLT_RAW: (*fp)->packet_offset = 0x00; break; case DLT_PPP: (*fp)->packet_offset = 0x04; break; case DLT_EN10MB: default: (*fp)->packet_offset = 0x0e; break; } /* * Set pcap filter and determine outgoing packet size. The filter * will be determined by the scanning protocol: * UDP scan: * icmp[0] == 11 or icmp[0] == 3 or udp * TCP scan: * icmp[0] == 11 or icmp[0] == 3 or tcp[14] == 0x12 or tcp[14] \ * == 0x4 or tcp[14] == 0x14 */ switch ((*fp)->protocol) { case IPPROTO_UDP: if (fw_set_pcap_filter(FW_BPF_FILTER_UDP, fp) == -1) { /* err msg set in fw_set_pcap_filter() */ return (-1); } /* IP + UDP */ (*fp)->packet_size = LIBNET_IPV4_H + LIBNET_UDP_H; break; case IPPROTO_TCP: if (fw_set_pcap_filter(FW_BPF_FILTER_TCP, fp) == -1) { /* err msg set in fw_set_pcap_filter() */ return (-1); } /* IP + TCP */ (*fp)->packet_size = LIBNET_IPV4_H + LIBNET_TCP_H; /* randomize the TCP sequence number */ libnet_seed_prand((*fp)->l); (*fp)->seq = libnet_get_prand(LIBNET_PRu32); break; default: sprintf((*fp)->errbuf, "fw_init_network(): unsupported protocol"); return (-1); } /* * Build a probe packet template. We'll use this packet template * over and over for each write to the network, modifying certain * fields (IP TTL, UDP/TCP ports and of course checksums as we go). */ if (fw_packet_build_probe(fp) == -1) { /* error msg set in fw_packet_build_probe() */ return (-1); } return (1); } void fw_shutdown(struct firepack **fp) { if (*fp) { if ((*fp)->p) { pcap_close((*fp)->p); } if ((*fp)->l) { libnet_destroy((*fp)->l); } if ((*fp)->plist) { libnet_plist_chain_free((*fp)->plist); } free(*fp); *fp = NULL; } } /* EOF */ /* * $Id: main.c,v 1.5 2002/05/14 23:28:37 route Exp $ * * Firewalk 5.0 * main.c - Main control logic * * Copyright (c) 1998 - 2002 Mike D. Schiffman * Copyright (c) 1998, 1999 David E. Goldsmith * http://www.packetfactory.net/firewalk * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #if (HAVE_CONFIG_H) #include "../include/config.h" #endif #include "../include/firewalk.h" #include "../version.h" int main(int argc, char *argv[]) { int c; struct firepack *fp; char *port_list = NULL; char errbuf[FW_ERRBUF_SIZE]; printf("Firewalk 5.0 [gateway ACL scanner]\n"); /* * Initialize the main control context. We keep all of our * program state here and this is used by just about every * function in the program. */ if (fw_init_context(&fp, errbuf) == -1) { fprintf(stderr, "fw_init_control(): %s\n", errbuf); goto done; } /* process commandline arguments */ while ((c = getopt(argc, argv, "d:fhi:no:p:rS:s:T:t:vx:")) != EOF) { switch (c) { case 'd': /* destination port to use during ramping phase */ fp->dport = fw_str2int(optarg, "ramping destination port", FW_PORT_MIN, FW_PORT_MAX); break; case 'f': /* stack fingerprint of each host */ fp->flags |= FW_FINGERPRINT; break; case 'h': /* program help */ usage(argv[0]); break; case 'i': /* interface */ fp->device = optarg; break; case 'n': /* do not use names */ fp->flags &= ~FW_RESOLVE; break; case 'p': /* select firewalk protocol */ fp->protocol = fw_prot_select(optarg); break; case 'r': /* Strict RFC adherence */ fp->flags |= FW_STRICT_RFC; break; case 'S': /* scan these ports */ port_list = optarg; break; case 's': /* source port */ fp->sport = fw_str2int(optarg, "source port", FW_PORT_MIN, FW_PORT_MAX); break; case 'T': /* time to wait for packets from other end */ fp->pcap_timeout = fw_str2int(optarg, "read timer", FW_PCAP_TIMEOUT_MIN, FW_PCAP_TIMEOUT_MAX); break; case 't': /* set initial IP TTL */ fp->ttl = fw_str2int(optarg, "initial TTL", FW_IP_HOP_MIN, FW_IP_HOP_MAX); break; case 'v': /* version */ printf(FW_BANNER "version : %s\n", VERSION); goto done; case 'x': /* expire vector */ fp->xv = fw_str2int(optarg, "expire vector", FW_XV_MIN, FW_XV_MAX); break; default: usage(argv[0]); } } c = argc - optind; if (c != 2) { /* * We should only have two arguments at this point, the target * gateway and the metric. */ usage(argv[0]); } /* initialize the network components */ if (fw_init_net(&fp, argv[optind], argv[optind + 1], port_list) == -1) { fprintf(stderr, "fw_init_network(): %s\n", fp->errbuf); goto done; } printf("Firewalk state initialization completed successfully.\n"); /* execute scan: phase one, and hopefully phase two */ switch (firewalk(&fp)) { case -1: case FW_SERIOUS_ERROR: /* grievous error of some sort */ fprintf(stderr, "firewalk(): %s\n", fp->errbuf); break; case FW_ABORT_SCAN: /* hop count exceeded or metric en route */ fprintf(stderr, "Scan aborted: %s.\n", fp->errbuf); break; case FW_USER_INTERRUPT: fprintf(stderr, "Scan aborted by user.\n"); break; default: printf("\nScan completed successfully.\n"); break; } done: fw_report_stats(&fp); fw_shutdown(&fp); /* we should probably record proper exit status */ return (EXIT_SUCCESS); } void usage(u_char *argv0) { fprintf(stderr, "Usage : %s [options] target_gateway metric\n" "\t\t [-d %d - %d] destination port to use (ramping phase)\n" "\t\t [-h] program help\n" "\t\t [-i device] interface\n" "\t\t [-n] do not resolve IP addresses into hostnames\n" "\t\t [-p TCP | UDP] firewalk protocol\n" "\t\t [-r] strict RFC adherence\n" "\t\t [-S x - y, z] port range to scan\n" "\t\t [-s %d - %d] source port\n" "\t\t [-T 1 - 1000] packet read timeout in ms\n" "\t\t [-t 1 - %d] IP time to live\n" "\t\t [-v] program version\n" "\t\t [-x 1 - %d] expire vector\n" "\n", argv0, FW_PORT_MIN, FW_PORT_MAX, FW_PORT_MIN, FW_PORT_MAX, FW_IP_HOP_MAX, FW_XV_MAX); exit(EXIT_SUCCESS); } /* EOF */ /* * $Id: packet_build.c,v 1.2 2002/05/14 00:17:52 route Exp $ * * Firewalk 5.0 * packet_build.c - Packet construction code * * Copyright (c) 1998 - 2002 Mike D. Schiffman * Copyright (c) 1998, 1999 David E. Goldsmith * http://www.packetfactory.net/firewalk * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #if (HAVE_CONFIG_H) #include "../include/config.h" #endif #include "../include/firewalk.h" int fw_packet_build_probe(struct firepack **fp) { arp_t *a; route_t *r; struct arp_entry arp; struct route_entry route; /* first build our transport layer header */ switch ((*fp)->protocol) { case IPPROTO_UDP: if (fw_packet_build_udp(fp) == -1) { /* error msg set in fw_packet_build_udp() */ return (-1); } break; case IPPROTO_TCP: if (fw_packet_build_tcp(fp) == -1) { /* error msg set in fw_packet_build_tcp() */ return (-1); } break; default: sprintf((*fp)->errbuf, "fw_packet_build_probe(): unknown protocol"); return (-1); } /* build our IPv4 header */ (*fp)->ip = libnet_build_ipv4( (*fp)->packet_size, /* packetlength */ 0, /* IP tos */ (*fp)->id, /* IP id */ 0, /* IP frag bits */ (*fp)->ttl, /* IP time to live */ (*fp)->protocol, /* transport protocol */ 0, /* checksum */ (*fp)->sin.sin_addr.s_addr, /* IP source */ (*fp)->metric, /* IP destination */ NULL, /* IP payload */ 0, /* IP payload size */ (*fp)->l, /* libnet context */ 0); /* No saved ptag */ if ((*fp)->ip == -1) { snprintf((*fp)->errbuf, FW_ERRBUF_SIZE, "libnet_build_ipv4() %s", libnet_geterror((*fp)->l)); return (-1); } /* * Now we need to get the MAC address of our first hop gateway. * Dnet to the rescue! We start by doing a route table lookup * to determine the IP address we use to get to the * destination host (the metric). */ r = route_open(); if (r == NULL) { snprintf((*fp)->errbuf, FW_ERRBUF_SIZE, "route_open()"); route_close(r); return (-1); } /* convert the metric address to dnet's native addr_t format */ if (addr_aton(libnet_addr2name4((*fp)->metric, 0), &route.route_dst) < 0) { snprintf((*fp)->errbuf, FW_ERRBUF_SIZE, "addr_aton()"); route_close(r); return (-1); } /* get the route entry telling us how to reach the metric */ if (route_get(r, &route) < 0) { snprintf((*fp)->errbuf, FW_ERRBUF_SIZE, "route_get()"); route_close(r); return (-1); } route_close(r); a = arp_open(); if (a == NULL) { snprintf((*fp)->errbuf, FW_ERRBUF_SIZE, "arp_open()"); return (-1); } /* get the MAC of the first hop gateway */ arp.arp_pa = route.route_gw; if (arp_get(a, &arp) < 0) { snprintf((*fp)->errbuf, FW_ERRBUF_SIZE, "route_get()"); arp_close(a); return (-1); } arp_close(a); /* build our ethernet header */ if (libnet_autobuild_ethernet( (u_char *)&arp.arp_ha.addr_eth, ETHERTYPE_IP, (*fp)->l) == -1) { snprintf((*fp)->errbuf, FW_ERRBUF_SIZE, "libnet_autobuild_ethernet() %s", libnet_geterror((*fp)->l)); arp_close(a); return (-1); } return (1); } int fw_packet_build_udp(struct firepack **fp) { /* build a UDP header */ (*fp)->udp = libnet_build_udp( (*fp)->sport, /* source UDP port */ (*fp)->dport, /* dest UDP port */ (*fp)->packet_size - LIBNET_IPV4_H, /* UDP size */ 0, /* checksum */ NULL, /* IP payload */ 0, /* IP payload size */ (*fp)->l, /* libnet context */ 0); /* No saved ptag */ if ((*fp)->udp == -1) { snprintf((*fp)->errbuf, FW_ERRBUF_SIZE, "libnet_build_udp() %s", libnet_geterror((*fp)->l)); return (-1); } return (1); } int fw_packet_build_tcp(struct firepack **fp) { /* build a TCP header */ (*fp)->tcp = libnet_build_tcp( (*fp)->sport, /* source TCP port */ (*fp)->dport, /* dest TCP port */ (*fp)->seq, /* sequence number */ 0L, /* ACK number */ TH_SYN, /* control flags */ 1024, /* window size */ 0, /* checksum */ 0, /* urgent */ (*fp)->packet_size - LIBNET_IPV4_H, /* TCP size */ NULL, /* IP payload */ 0, /* IP payload size */ (*fp)->l, /* libnet context */ 0); /* No saved ptag */ if ((*fp)->tcp == -1) { snprintf((*fp)->errbuf, FW_ERRBUF_SIZE, "libnet_build_tcp() %s", libnet_geterror((*fp)->l)); return (-1); } return (1); } /* EOF */ /* * $Id: packet_capture.c,v 1.4 2002/05/14 23:28:37 route Exp $ * * Firewalk 5.0 * packet_capture.c - Packet capturing routines * * Copyright (c) 1998 - 2002 Mike D. Schiffman * Copyright (c) 1998, 1999 David E. Goldsmith * http://www.packetfactory.net/firewalk * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #if (HAVE_CONFIG_H) #include "../include/config.h" #endif #include "../include/firewalk.h" int loop = 1; int fw_packet_capture(struct firepack **fp) { int pcap_fd, c, timed_out; fd_set read_set; struct timeval timeout; struct pcap_pkthdr pc_hdr; timeout.tv_sec = (*fp)->pcap_timeout; timeout.tv_usec = 0; pcap_fd = pcap_fileno((*fp)->p); FD_ZERO(&read_set); FD_SET(pcap_fd, &read_set); for (timed_out = 0; !timed_out && loop; ) { c = select(pcap_fd + 1, &read_set, 0, 0, &timeout); switch (c) { case -1: snprintf((*fp)->errbuf, FW_ERRBUF_SIZE, "select() %s", strerror(errno)); return (-1); case 0: timed_out = 1; continue; default: if (FD_ISSET(pcap_fd, &read_set) == 0) { timed_out = 1; continue; } /* fall through to read the packet */ } (*fp)->packet = (u_char *)pcap_next((*fp)->p, &pc_hdr); if ((*fp)->packet == NULL) { /* no NULL packets please */ continue; } (*fp)->stats.packets_caught++; /* * Submit the packet for verification first based on scan type, * If we're not bound, we're still in phase one and need to * verify the ramping response. If we are bound, we're in * phase two and we need to verify the terminal response. * Then process the response from the verification engine. * Report to the user if necessary and update the packet * statistics. */ switch (!(((*fp)->flags) & FW_BOUND) ? fw_packet_verify_ramp(fp) : fw_packet_verify_scan(fp)) { case FW_PACKET_IS_TTL_EX_EN_ROUTE: /* RAMPING: TTL expired en route to gateway (standard) */ fw_report(FW_PACKET_IS_TTL_EX_EN_ROUTE, fp); (*fp)->stats.packets_caught_interesting++; return (FW_PACKET_IS_TTL_EX_EN_ROUTE); case FW_PACKET_IS_UNREACH_EN_ROUTE: /* RAMPING: Unreachable en route to gateway (uncommon) */ fw_report(FW_PACKET_IS_UNREACH_EN_ROUTE, fp); (*fp)->stats.packets_caught_interesting++; return (FW_PACKET_IS_TTL_EX_EN_ROUTE); case FW_PACKET_IS_TERMINAL_TTL_EX: /* RAMPING: TTL expired at destination (rare) */ fw_report(FW_PACKET_IS_TERMINAL_TTL_EX, fp); (*fp)->stats.packets_caught_interesting++; return (FW_PACKET_IS_TERMINAL_TTL_EX); case FW_PACKET_IS_TERMINAL_UNREACH: /* RAMPING: Unreachable at destination (uncommon) */ fw_report(FW_PACKET_IS_TERMINAL_UNREACH, fp); (*fp)->stats.packets_caught_interesting++; return (FW_PACKET_IS_TERMINAL_UNREACH); case FW_PACKET_IS_TERMINAL_SYNACK: fw_report(FW_PACKET_IS_TERMINAL_SYNACK, fp); (*fp)->stats.packets_caught_interesting++; return (FW_PACKET_IS_TERMINAL_SYNACK); case FW_PACKET_IS_TERMINAL_RST: fw_report(FW_PACKET_IS_TERMINAL_RST, fp); (*fp)->stats.packets_caught_interesting++; return (FW_PACKET_IS_TERMINAL_RST); case FW_PORT_IS_OPEN_SYNACK: /* SCANNING: A response from an open TCP port */ fw_report(FW_PORT_IS_OPEN_SYNACK, fp); (*fp)->stats.packets_caught_interesting++; return (FW_PORT_IS_OPEN_SYNACK); case FW_PORT_IS_OPEN_RST: /* SCANNING: A response from a closed TCP port */ fw_report(FW_PORT_IS_OPEN_RST, fp); (*fp)->stats.packets_caught_interesting++; return (FW_PORT_IS_OPEN_RST); case FW_PORT_IS_OPEN_UNREACH: /* SCANNING: A port unreachable response */ fw_report(FW_PORT_IS_OPEN_UNREACH, fp); (*fp)->stats.packets_caught_interesting++; return (FW_PORT_IS_OPEN_UNREACH); case FW_PORT_IS_OPEN_TTL_EX: /* SCANNING: A TTL expired */ fw_report(FW_PORT_IS_OPEN_TTL_EX, fp); (*fp)->stats.packets_caught_interesting++; return (FW_PORT_IS_OPEN_TTL_EX); case FW_PACKET_IS_BORING: default: continue; } } if (!loop) { return (FW_USER_INTERRUPT); } /* * If we get here, the scan timed out. We either dropped a packet * somewhere or there is some filtering going on. */ printf("*no response*\n"); fflush(stdout); return (FW_NO_REPLY); } /* EOF */ /* * $Id: packet_filter.c,v 1.2 2002/05/14 00:17:52 route Exp $ * * Firewalk 5.0 * packet_filter.c - Packet filtering code * * Copyright (c) 1998 - 2002 Mike D. Schiffman * Copyright (c) 1998, 1999 David E. Goldsmith * http://www.packetfactory.net/firewalk * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #if (HAVE_CONFIG_H) #include "../include/config.h" #endif #include "../include/firewalk.h" int fw_set_pcap_filter(char *filter, struct firepack **fp) { struct bpf_program filter_code; bpf_u_int32 local_net, netmask; char errbuf[PCAP_ERRBUF_SIZE]; /* get the subnet mask of the interface */ if (pcap_lookupnet((*fp)->device, &local_net, &netmask, errbuf) == -1) { snprintf((*fp)->errbuf, FW_ERRBUF_SIZE, "pcap_lookupnet(): %s", errbuf); return (-1); } /* compile the BPF filter code */ if (pcap_compile((*fp)->p, &filter_code, filter, 1, netmask) == -1) { snprintf((*fp)->errbuf, FW_ERRBUF_SIZE, "pcap_compile(): %s", pcap_geterr((*fp)->p)); return (-1); } /* apply the filter to the interface */ if (pcap_setfilter((*fp)->p, &filter_code) == -1) { snprintf((*fp)->errbuf, FW_ERRBUF_SIZE, "pcap_setfilter(): %s", pcap_geterr((*fp)->p)); return (-1); } return (1); } /* EOF */ /* * $Id: packet_inject.c,v 1.2 2002/05/14 00:17:52 route Exp $ * * Firewalk 5.0 * packet_inject.c - Packet injection code * * Copyright (c) 1998 - 2002 Mike D. Schiffman * Copyright (c) 1998, 1999 David E. Goldsmith * http://www.packetfactory.net/firewalk * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #if (HAVE_CONFIG_H) #include "../include/config.h" #endif #include "../include/firewalk.h" int fw_packet_inject(struct firepack **fp) { int n; n = libnet_write((*fp)->l); switch (n) { case -1: (*fp)->stats.packets_err++; snprintf((*fp)->errbuf, FW_ERRBUF_SIZE, "libnet_write() %s", libnet_geterror((*fp)->l)); return (-1); default: (*fp)->stats.packets_sent++; return (1); } } /* EOF */ /* * $Id: packet_update.c,v 1.2 2002/05/14 00:17:52 route Exp $ * * Firewalk 5.0 * packet_update.c - Packet updating code * * Copyright (c) 1998 - 2002 Mike D. Schiffman * Copyright (c) 1998, 1999 David E. Goldsmith * http://www.packetfactory.net/firewalk * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #if (HAVE_CONFIG_H) #include "../include/config.h" #endif #include "../include/firewalk.h" int fw_packet_update_probe(struct firepack **fp, u_short cport) { if (!((*fp)->flags & FW_BOUND)) { /* phase one: just update IP TTL */ (*fp)->ttl++; } else { /* phase two; update port scanning probe */ switch ((*fp)->protocol) { case IPPROTO_TCP: (*fp)->dport = cport; (*fp)->tcp = libnet_build_tcp( (*fp)->sport, /* source TCP port */ (*fp)->dport, /* dest TCP port */ (*fp)->seq, /* sequence number */ 0L, /* ACK number */ TH_SYN, /* control flags */ 1024, /* window size */ 0, /* checksum */ 0, /* urgent */ (*fp)->packet_size - LIBNET_IPV4_H, /* packet size */ NULL, /* payload */ 0, /* payload size */ (*fp)->l, /* libnet context */ (*fp)->tcp); /* TCP ptag */ if ((*fp)->tcp == -1) { snprintf((*fp)->errbuf, FW_ERRBUF_SIZE, "libnet_build_tcp() %s", libnet_geterror((*fp)->l)); return (-1); } break; case IPPROTO_UDP: (*fp)->dport = cport; (*fp)->udp = libnet_build_udp( (*fp)->sport, /* source UDP port */ (*fp)->dport, /* dest UDP port */ (*fp)->packet_size - LIBNET_IPV4_H, /* size */ 0, /* checksum */ NULL, /* payload */ 0, /* payload size */ (*fp)->l, /* libnet context */ (*fp)->udp); /* udp ptag */ if ((*fp)->udp == -1) { snprintf((*fp)->errbuf, FW_ERRBUF_SIZE, "libnet_build_udp() %s", libnet_geterror((*fp)->l)); return (-1); } break; } } (*fp)->ip = libnet_build_ipv4( (*fp)->packet_size, /* packetlength */ 0, /* IP tos */ (*fp)->id, /* IP id */ 0, /* IP frag bits */ (*fp)->ttl, /* IP time to live */ (*fp)->protocol, /* transport protocol */ 0, /* checksum */ (*fp)->sin.sin_addr.s_addr, /* IP source */ (*fp)->metric, /* IP destination */ NULL, /* IP payload */ 0, /* IP payload size */ (*fp)->l, /* libnet context */ (*fp)->ip); /* ip ptag */ if ((*fp)->ip == -1) { snprintf((*fp)->errbuf, FW_ERRBUF_SIZE, "libnet_build_ipv4() %s", libnet_geterror((*fp)->l)); return (-1); } return (1); } /* EOF */ /* * $Id: packet_verify.c,v 1.3 2002/05/14 20:20:39 route Exp $ * * Firewalk 5.0 * packet_verify.c - Packet verification code * * Copyright (c) 1998 - 2002 Mike D. Schiffman * Copyright (c) 1998, 1999 David E. Goldsmith * http://www.packetfactory.net/firewalk * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #if (HAVE_CONFIG_H) #include "../include/config.h" #endif #include "../include/firewalk.h" int fw_packet_verify_ramp(struct firepack **fp) { struct libnet_ipv4_hdr *ip_hdr; struct libnet_icmpv4_hdr *icmp_hdr; struct libnet_ipv4_hdr *o_ip_hdr; struct libnet_tcp_hdr *tcp_hdr; /* point to the IP header */ ip_hdr = (struct libnet_ipv4_hdr *) ((*fp)->packet + (*fp)->packet_offset); if (ip_hdr->ip_src.s_addr == (*fp)->sin.sin_addr.s_addr) { /* packets we send are of no interest to us here. */ return (FW_PACKET_IS_BORING); } switch (ip_hdr->ip_p) { case IPPROTO_ICMP: icmp_hdr = (struct libnet_icmpv4_hdr *) ((*fp)->packet + (*fp)->packet_offset + LIBNET_IPV4_H); switch (icmp_hdr->icmp_type) { case ICMP_TIMXCEED: if (icmp_hdr->icmp_code != ICMP_TIMXCEED_INTRANS) { /* * Packet was from an expired IP frag queue * reassembly timer. Nothing we want. */ break; } case ICMP_UNREACH: /* * Point to the original IPv4 header inside the ICMP * message's payload. An IPv4 header is * LIBNET_IPV4_H bytes long and both ICMP unreachable * and time exeeed headers are 8 bytes. */ o_ip_hdr = (struct libnet_ipv4_hdr *) ((*fp)->packet + (*fp)->packet_offset + LIBNET_IPV4_H + 8); /* * Check the IP header of the packet that caused the * unreachable for our markings which include: * Original IP ID: set to the process id. * Original IP source address: our source address. */ if (!FW_IS_OURS(o_ip_hdr, fp)) { break; } if (ip_hdr->ip_src.s_addr == (*fp)->metric) { /* * ICMP response from our metric. This ends * our scan since we've reached the metric * before the target gateway. */ return ((icmp_hdr->icmp_type == ICMP_TIMXCEED) ? FW_PACKET_IS_TERMINAL_TTL_EX : FW_PACKET_IS_TERMINAL_UNREACH); } if (ip_hdr->ip_src.s_addr == (*fp)->gateway) { /* * Response from our target gateway. */ (*fp)->flags |= FW_BOUND; } /* * If we get to this point, the packet is an * ICMP response from an intermediate router. */ return ((icmp_hdr->icmp_type == ICMP_TIMXCEED) ? FW_PACKET_IS_TTL_EX_EN_ROUTE : FW_PACKET_IS_UNREACH_EN_ROUTE); break; default: break; } case IPPROTO_TCP: if ((*fp)->protocol != IPPROTO_TCP) { /* * We're only interested in TCP packets if this is a * TCP-based scan. */ break; } tcp_hdr = (struct libnet_tcp_hdr *) ((*fp)->packet + (*fp)->packet_offset + LIBNET_IPV4_H); if (!(tcp_hdr->th_flags & TH_SYN) && !(tcp_hdr->th_flags & TH_RST)) { /* * We only care about SYN|ACK and RST|ACK packets. * The rest can burn. */ break; } if ((*fp)->flags & FW_STRICT_RFC) { /* * Strict RFC compliance dictates that an RST or * an SYN|ACK will have our SEQ + 1 as the ACK number * also, the RST will have the ACK bit set). This is of * course, assuming the packet is ours. */ if (ntohl(tcp_hdr->th_ack) != (*fp)->seq + 1) { break; } } if (ntohs(tcp_hdr->th_dport) == (*fp)->sport && ntohs(tcp_hdr->th_sport) == (*fp)->dport) { /* this is most likely a response to our SYN probe */ return (((tcp_hdr->th_flags & TH_SYN) ? FW_PACKET_IS_TERMINAL_SYNACK : FW_PACKET_IS_TERMINAL_RST)); } break; } return (FW_PACKET_IS_BORING); } int fw_packet_verify_scan(struct firepack **fp) { struct libnet_ipv4_hdr *ip_hdr; struct libnet_icmpv4_hdr *icmp_hdr; struct libnet_ipv4_hdr *o_ip_hdr; struct libnet_tcp_hdr *tcp_hdr; ip_hdr = (struct libnet_ipv4_hdr *)((*fp)->packet + (*fp)->packet_offset); if (ip_hdr->ip_src.s_addr == (*fp)->sin.sin_addr.s_addr) { /* packets we send are of no interest to us here. */ return (FW_PACKET_IS_BORING); } switch (ip_hdr->ip_p) { case IPPROTO_ICMP: icmp_hdr = (struct libnet_icmpv4_hdr *) ((*fp)->packet + (*fp)->packet_offset + LIBNET_IPV4_H); switch (icmp_hdr->icmp_type) { case ICMP_TIMXCEED: if (icmp_hdr->icmp_code != ICMP_TIMXCEED_INTRANS) { /* * Packet was from an expired IP frag queue * reassembly timer. Nothing we want. */ break; } case ICMP_UNREACH: /* * Point to the original IPv4 header inside the ICMP * message's payload. An IPv4 header is * LIBNET_IPV4_H bytes long and both ICMP unreachable * and time exeeed headers are 8 bytes. */ o_ip_hdr = (struct libnet_ipv4_hdr *) ((*fp)->packet + (*fp)->packet_offset + LIBNET_IPV4_H + 8); /* * Check the IP header of the packet that caused the * unreachable for our markings which include: * Original IP ID: set to the process id. * Original IP source address: our source address. */ if (FW_IS_OURS(o_ip_hdr, fp)) { /* the packet made it through the filter */ return ((icmp_hdr->icmp_type == ICMP_TIMXCEED) ? FW_PORT_IS_OPEN_TTL_EX : FW_PORT_IS_OPEN_UNREACH); } break; default: break; } case IPPROTO_TCP: if ((*fp)->protocol != IPPROTO_TCP) { /* * We're only interested in TCP packets if this is a * TCP-based scan. */ break; } tcp_hdr = (struct libnet_tcp_hdr *) ((*fp)->packet + (*fp)->packet_offset + LIBNET_IPV4_H); /* * We only care about SYN|ACK and RST|ACK packets. * The rest can burn. */ if (!(tcp_hdr->th_flags & TH_SYN) && !(tcp_hdr->th_flags & TH_RST)) { break; } if ((*fp)->flags & FW_STRICT_RFC) { /* * Strict RFC compliance dictates that an RST or * an SYN|ACK will have our SEQ + 1 as the ACK number * also, the RST will have the ACK bit set). This is of * course, assuming the packet is ours. */ if (ntohl(tcp_hdr->th_ack) != (*fp)->seq + 1) { break; } } if (ntohs(tcp_hdr->th_dport) == (*fp)->sport && ntohs(tcp_hdr->th_sport) == (*fp)->dport) { /* the packet made it through the filter */ return (((tcp_hdr->th_flags & TH_SYN) ? FW_PORT_IS_OPEN_SYNACK : FW_PORT_IS_OPEN_RST)); } break; default: break; } return (FW_PACKET_IS_BORING); } /* EOF */ /* * $Id: report.c,v 1.3 2002/05/14 23:28:37 route Exp $ * * Firewalk 5.0 * report.c - Reporting code * * Copyright (c) 1998 - 2002 Mike D. Schiffman * Copyright (c) 1998, 1999 David E. Goldsmith * http://www.packetfactory.net/firewalk * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #if (HAVE_CONFIG_H) #include "../include/config.h" #endif #include "../include/firewalk.h" #include "../include/unreachables.h" void fw_report(int class, struct firepack **fp) { struct libnet_ipv4_hdr *ip_hdr; ip_hdr = (struct libnet_ipv4_hdr *)((*fp)->packet + (*fp)->packet_offset); if (((*fp)->flags & FW_BOUND) && ip_hdr->ip_src.s_addr == (*fp)->metric) { /* adjacent target gateway and metric */ printf("A! "); } switch (class) { case FW_PACKET_IS_TTL_EX_EN_ROUTE: printf("expired [%s]\n", libnet_addr2name4(ip_hdr->ip_src.s_addr, ((*fp)->flags) & FW_RESOLVE)); break; case FW_PACKET_IS_UNREACH_EN_ROUTE: printf("unreach %s [%s]\n", fw_get_unreach_code(fp), libnet_addr2name4(ip_hdr->ip_src.s_addr, ((*fp)->flags) & FW_RESOLVE)); break; case FW_PACKET_IS_TERMINAL_TTL_EX: printf("terimnal (expired) [%s]\n", libnet_addr2name4(ip_hdr->ip_src.s_addr, ((*fp)->flags) & FW_RESOLVE)); break; case FW_PACKET_IS_TERMINAL_UNREACH: printf("terminal (unreach %s) [%s]\n", fw_get_unreach_code(fp), libnet_addr2name4(ip_hdr->ip_src.s_addr, ((*fp)->flags) & FW_RESOLVE)); break; case FW_PACKET_IS_TERMINAL_SYNACK: printf("terminal (synack) [%s]\n", libnet_addr2name4(ip_hdr->ip_src.s_addr, ((*fp)->flags) & FW_RESOLVE)); break; case FW_PACKET_IS_TERMINAL_RST: printf("terminal (rst) [%s]\n", libnet_addr2name4(ip_hdr->ip_src.s_addr, ((*fp)->flags) & FW_RESOLVE)); break; case FW_PORT_IS_OPEN_SYNACK: printf("open (port listen) [%s]\n", libnet_addr2name4(ip_hdr->ip_src.s_addr, ((*fp)->flags) & FW_RESOLVE)); (*fp)->stats.ports_open++; break; case FW_PORT_IS_OPEN_RST: printf("open (port not listen) [%s]\n", libnet_addr2name4(ip_hdr->ip_src.s_addr, ((*fp)->flags) & FW_RESOLVE)); (*fp)->stats.ports_open++; break; case FW_PORT_IS_OPEN_UNREACH: printf("unknown (unreach %s) [%s]\n", fw_get_unreach_code(fp), libnet_addr2name4(ip_hdr->ip_src.s_addr, ((*fp)->flags) & FW_RESOLVE)); (*fp)->stats.ports_unknown++; break; case FW_PORT_IS_OPEN_TTL_EX: printf("open (expired) [%s]\n", libnet_addr2name4(ip_hdr->ip_src.s_addr, ((*fp)->flags) & FW_RESOLVE)); (*fp)->stats.ports_open++; break; default: break; } } void fw_report_stats(struct firepack **fp) { printf("\nTotal packets sent: %ld\n" "Total packet errors: %ld\n" "Total packets caught %ld\n" "Total packets caught of interest %d\n" "Total ports scanned %d\n" "Total ports open: %d\n" "Total ports unknown: %d\n", (*fp)->stats.packets_sent, (*fp)->stats.packets_err, (*fp)->stats.packets_caught, (*fp)->stats.packets_caught_interesting, (*fp)->stats.ports_total, (*fp)->stats.ports_open, (*fp)->stats.ports_unknown); } char * fw_get_unreach_code(struct firepack **fp) { struct libnet_icmpv4_hdr *icmp_hdr; icmp_hdr = (struct libnet_icmpv4_hdr *) ((*fp)->packet + (*fp)->packet_offset + LIBNET_IPV4_H); if (icmp_hdr->icmp_code > 15) { return ("Unknown unreachable code"); } return (unreachables[icmp_hdr->icmp_code]); } /* EOF */ /* * $Id: signal.c,v 1.3 2002/05/14 00:17:52 route Exp $ * * Firewalk 5.0 * signal.c - Signal handling code * * Copyright (c) 1998 - 2002 Mike D. Schiffman * Copyright (c) 1998, 1999 David E. Goldsmith * http://www.packetfactory.net/firewalk * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #if (HAVE_CONFIG_H) #include "../include/config.h" #endif #include "../include/firewalk.h" extern int loop; int catch_sig(int signo, void (*handler)()) { struct sigaction action; /* install the new handler */ action.sa_handler = handler; /* unblock all other signals */ sigemptyset(&action.sa_mask); action.sa_flags = 0; if (sigaction(signo, &action, NULL) == -1) { return (-1); } else { return (1); } } void catch_sigint(int nil) { loop = 0; } /* EOF */ /* * $Id: util.c,v 1.2 2002/05/14 00:17:52 route Exp $ * * Firewalk 5.0 * util.c - Misc routines * * Copyright (c) 1998 - 2002 Mike D. Schiffman * Copyright (c) 1998, 1999 David E. Goldsmith * http://www.packetfactory.net/firewalk * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #if (HAVE_CONFIG_H) #include "../include/config.h" #endif #include #include "../include/firewalk.h" int fw_str2int(register const char *str, register const char *what, register int min, register int max) { register const char *cp; register int val; char *ep; if (str[0] == '0' && (str[1] == 'x' || str[1] == 'X')) { cp = str + 2; val = (int)strtol(cp, &ep, 16); } else { val = (int)strtol(str, &ep, 10); } if (*ep != '\0') { fprintf(stderr, "\"%s\" bad value for %s \n", str, what); exit(EXIT_FAILURE); } if (val < min && min >= 0) { if (min == 0) { fprintf(stderr, "%s must be >= %d\n", what, min); return (-1); } else { fprintf(stderr, "%s must be > %d\n", what, min - 1); exit(EXIT_FAILURE); } } if (val > max && max >= 0) { fprintf(stderr, "%s must be <= %d\n", what, max); exit(EXIT_FAILURE); } return (val); } int fw_prot_select(char *protocol) { char *supp_protocols[] = {"UDP", "TCP", 0}; int i; for (i = 0; supp_protocols[i]; i++) { if ((!strcasecmp(supp_protocols[i], protocol))) { switch (i) { case 0: /* UDP */ return (IPPROTO_UDP); case 1: /* TCP */ return (IPPROTO_TCP); default: fprintf(stderr, "unsupported protocol: %s\n", protocol); exit(EXIT_FAILURE); } } } fprintf(stderr, "unsupported protocol: %s\n", protocol); return (-1); } /* EOF */ Firewalk/config.guess010064400017500001750000000476220746625106200143010ustar00routeroute#! /bin/sh # Attempt to guess a canonical system name. # Copyright (C) 1992, 93, 94, 95, 1996 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-cbm-openbsd${UNAME_RELEASE} exit 0 ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} 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-atari-openbsd${UNAME_RELEASE} exit 0 ;; sun3*:NetBSD:*:*) echo m68k-sun-netbsd${UNAME_RELEASE} exit 0 ;; sun3*:OpenBSD:*:*) echo m68k-sun-openbsd${UNAME_RELEASE} exit 0 ;; mac68k:NetBSD:*:*) echo m68k-apple-netbsd${UNAME_RELEASE} exit 0 ;; mac68k:OpenBSD:*:*) echo m68k-apple-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 ;; 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 ;; hp3[0-9][05]:OpenBSD:*:*) echo m68k-hp-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 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 ;; *: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 ;; PENTIUM:CPunix:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says echo i586-unisys-sysv4 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 Firewalk/config.sub010064400017500001750000000454440746625106200137440ustar00routeroute#! /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 | m68k | m68000 | m88k | ns32k | arm \ | arme[lb] | pyramid \ | 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-* | 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 ;; 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) basic_machine=mips-mips ;; 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 Firewalk/configure010075500017500001750000003462730747031652400136770ustar00routeroute#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by Autoconf 2.52. # # Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001 # Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits # Sed expression to map a string onto a valid variable name. as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g" # Sed expression to map a string onto a valid CPP name. as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g" # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then set -o posix fi # Name of the executable. as_me=`echo "$0" |sed 's,.*[\\/],,'` if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then # We could just check for DJGPP; but this test a) works b) is more generic # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). if test -f conf$$.exe; then # Don't use ln at all; we don't have any links as_ln_s='cp -p' else as_ln_s='ln -s' fi elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.file as_executable_p="test -f" # Support unset when possible. if (FOO=FOO; unset FOO) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # NLS nuisances. $as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; } $as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; } $as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; } $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; } $as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; } $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; } $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; } $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; } # IFS # We need space, tab and new line, in precisely that order. as_nl=' ' IFS=" $as_nl" # CDPATH. $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; } # Name of the host. # hostname on some systems (SVR3.2, Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` exec 6>&1 # # Initializations. # ac_default_prefix=/usr/local cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= SHELL=${CONFIG_SHELL-/bin/sh} # Maximum number of lines to put in a shell here document. # This variable seems obsolete. It should probably be removed, and # only ac_max_sed_lines should be used. : ${ac_max_here_lines=38} ac_unique_file="src/main.c" ac_default_prefix=/usr/local # Initialize some variables set by options. ac_init_help= ac_init_version=false # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datadir='${prefix}/share' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' libdir='${exec_prefix}/lib' includedir='${prefix}/include' oldincludedir='/usr/include' infodir='${prefix}/info' mandir='${prefix}/man' # Identity of this package. PACKAGE_NAME= PACKAGE_TARNAME= PACKAGE_VERSION= PACKAGE_STRING= PACKAGE_BUGREPORT= ac_prev= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval "$ac_prev=\$ac_option" ac_prev= continue fi ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'` # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_option in -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad | --data | --dat | --da) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ | --da=*) datadir=$ac_optarg ;; -disable-* | --disable-*) ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/-/_/g'` eval "enable_$ac_feature=no" ;; -enable-* | --enable-*) ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/-/_/g'` case $ac_option in *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; *) ac_optarg=yes ;; esac eval "enable_$ac_feature='$ac_optarg'" ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst \ | --locals | --local | --loca | --loc | --lo) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* \ | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package| sed 's/-/_/g'` case $ac_option in *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; *) ac_optarg=yes ;; esac eval "with_$ac_package='$ac_optarg'" ;; -without-* | --without-*) ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/-/_/g'` eval "with_$ac_package=no" ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) { echo "$as_me: error: unrecognized option: $ac_option Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 { (exit 1); exit 1; }; } ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` eval "$ac_envvar='$ac_optarg'" export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` { echo "$as_me: error: missing argument to $ac_option" >&2 { (exit 1); exit 1; }; } fi # Be sure to have absolute paths. for ac_var in exec_prefix prefix do eval ac_val=$`echo $ac_var` case $ac_val in [\\/$]* | ?:[\\/]* | NONE | '' ) ;; *) { echo "$as_me: error: expected an absolute path for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; };; esac done # Be sure to have absolute paths. for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \ localstatedir libdir includedir oldincludedir infodir mandir do eval ac_val=$`echo $ac_var` case $ac_val in [\\/$]* | ?:[\\/]* ) ;; *) { echo "$as_me: error: expected an absolute path for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; };; esac done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. build=$build_alias host=$host_alias target=$target_alias # FIXME: should be removed in autoconf 3.0. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. If a cross compiler is detected then cross compile mode will be used." >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then its parent. ac_prog=$0 ac_confdir=`echo "$ac_prog" | sed 's%[\\/][^\\/][^\\/]*$%%'` test "x$ac_confdir" = "x$ac_prog" && ac_confdir=. srcdir=$ac_confdir if test ! -r $srcdir/$ac_unique_file; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r $srcdir/$ac_unique_file; then if test "$ac_srcdir_defaulted" = yes; then { echo "$as_me: error: cannot find sources in $ac_confdir or .." >&2 { (exit 1); exit 1; }; } else { echo "$as_me: error: cannot find sources in $srcdir" >&2 { (exit 1); exit 1; }; } fi fi srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'` ac_env_build_alias_set=${build_alias+set} ac_env_build_alias_value=$build_alias ac_cv_env_build_alias_set=${build_alias+set} ac_cv_env_build_alias_value=$build_alias ac_env_host_alias_set=${host_alias+set} ac_env_host_alias_value=$host_alias ac_cv_env_host_alias_set=${host_alias+set} ac_cv_env_host_alias_value=$host_alias ac_env_target_alias_set=${target_alias+set} ac_env_target_alias_value=$target_alias ac_cv_env_target_alias_set=${target_alias+set} ac_cv_env_target_alias_value=$target_alias ac_env_CC_set=${CC+set} ac_env_CC_value=$CC ac_cv_env_CC_set=${CC+set} ac_cv_env_CC_value=$CC ac_env_CFLAGS_set=${CFLAGS+set} ac_env_CFLAGS_value=$CFLAGS ac_cv_env_CFLAGS_set=${CFLAGS+set} ac_cv_env_CFLAGS_value=$CFLAGS ac_env_LDFLAGS_set=${LDFLAGS+set} ac_env_LDFLAGS_value=$LDFLAGS ac_cv_env_LDFLAGS_set=${LDFLAGS+set} ac_cv_env_LDFLAGS_value=$LDFLAGS ac_env_CPPFLAGS_set=${CPPFLAGS+set} ac_env_CPPFLAGS_value=$CPPFLAGS ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set} ac_cv_env_CPPFLAGS_value=$CPPFLAGS ac_env_CPP_set=${CPP+set} ac_env_CPP_value=$CPP ac_cv_env_CPP_set=${CPP+set} ac_cv_env_CPP_value=$CPP # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat < if you have libraries in a nonstandard directory CPPFLAGS C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory CPP C preprocessor Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. EOF fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. ac_popdir=`pwd` for ac_subdir in : $ac_subdirs_all; do test "x$ac_subdir" = x: && continue cd $ac_subdir # A "../" for each directory in /$ac_subdir. ac_dots=`echo $ac_subdir | sed 's,^\./,,;s,[^/]$,&/,;s,[^/]*/,../,g'` case $srcdir in .) # No --srcdir option. We are building in place. ac_sub_srcdir=$srcdir ;; [\\/]* | ?:[\\/]* ) # Absolute path. ac_sub_srcdir=$srcdir/$ac_subdir ;; *) # Relative path. ac_sub_srcdir=$ac_dots$srcdir/$ac_subdir ;; esac # Check for guested configure; otherwise get Cygnus style configure. if test -f $ac_sub_srcdir/configure.gnu; then echo $SHELL $ac_sub_srcdir/configure.gnu --help=recursive elif test -f $ac_sub_srcdir/configure; then echo $SHELL $ac_sub_srcdir/configure --help=recursive elif test -f $ac_sub_srcdir/configure.ac || test -f $ac_sub_srcdir/configure.in; then echo $ac_configure --help else echo "$as_me: WARNING: no configuration information is in $ac_subdir" >&2 fi cd $ac_popdir done fi test -n "$ac_init_help" && exit 0 if $ac_init_version; then cat <<\EOF Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. EOF exit 0 fi exec 5>config.log cat >&5 </dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` hostinfo = `(hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` PATH = $PATH _ASUNAME } >&5 cat >&5 <\?\"\']*) ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" ac_sep=" " ;; *) ac_configure_args="$ac_configure_args$ac_sep$ac_arg" ac_sep=" " ;; esac # Get rid of the leading space. done # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. trap 'exit_status=$? # Save into config.log some information that might help in debugging. echo >&5 echo "## ----------------- ##" >&5 echo "## Cache variables. ##" >&5 echo "## ----------------- ##" >&5 echo >&5 # The following way of writing the cache mishandles newlines in values, { (set) 2>&1 | case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in *ac_space=\ *) sed -n \ "s/'"'"'/'"'"'\\\\'"'"''"'"'/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p" ;; *) sed -n \ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" ;; esac; } >&5 sed "/^$/d" confdefs.h >conftest.log if test -s conftest.log; then echo >&5 echo "## ------------ ##" >&5 echo "## confdefs.h. ##" >&5 echo "## ------------ ##" >&5 echo >&5 cat conftest.log >&5 fi (echo; echo) >&5 test "$ac_signal" != 0 && echo "$as_me: caught signal $ac_signal" >&5 echo "$as_me: exit $exit_status" >&5 rm -rf conftest* confdefs* core core.* *.core conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -rf conftest* confdefs.h # AIX cpp loses on an empty file, so make sure it contains at least a newline. echo >confdefs.h # Let the site file select an alternate cache file if it wants to. # Prefer explicitly selected file to automatically selected ones. if test -z "$CONFIG_SITE"; then if test "x$prefix" != xNONE; then CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" else CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" fi fi for ac_site_file in $CONFIG_SITE; do if test -r "$ac_site_file"; then { echo "$as_me:830: loading site script $ac_site_file" >&5 echo "$as_me: loading site script $ac_site_file" >&6;} cat "$ac_site_file" >&5 . "$ac_site_file" fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special # files actually), so we avoid doing that. if test -f "$cache_file"; then { echo "$as_me:841: loading cache $cache_file" >&5 echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . $cache_file;; *) . ./$cache_file;; esac fi else { echo "$as_me:849: creating cache $cache_file" >&5 echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in `(set) 2>&1 | sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val="\$ac_cv_env_${ac_var}_value" eval ac_new_val="\$ac_env_${ac_var}_value" case $ac_old_set,$ac_new_set in set,) { echo "$as_me:865: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { echo "$as_me:869: error: \`$ac_var' was not set in the previous run" >&5 echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then { echo "$as_me:875: error: \`$ac_var' has changed since the previous run:" >&5 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} { echo "$as_me:877: former value: $ac_old_val" >&5 echo "$as_me: former value: $ac_old_val" >&2;} { echo "$as_me:879: current value: $ac_new_val" >&5 echo "$as_me: current value: $ac_new_val" >&2;} ac_cache_corrupted=: fi;; esac # Pass precious variables to config.status. It doesn't matter if # we pass some twice (in addition to the command line arguments). if test "$ac_new_set" = set; then case $ac_new_val in *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ac_configure_args="$ac_configure_args '$ac_arg'" ;; *) ac_configure_args="$ac_configure_args $ac_var=$ac_new_val" ;; esac fi done if $ac_cache_corrupted; then { echo "$as_me:898: error: changes in the environment can compromise the build" >&5 echo "$as_me: error: changes in the environment can compromise the build" >&2;} { { echo "$as_me:900: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} { (exit 1); exit 1; }; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in *c*,-n*) ECHO_N= ECHO_C=' ' ECHO_T=' ' ;; *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; *) ECHO_N= ECHO_C='\c' ECHO_T= ;; esac echo "#! $SHELL" >conftest.sh echo "exit 0" >>conftest.sh chmod +x conftest.sh if { (echo "$as_me:920: PATH=\".;.\"; conftest.sh") >&5 (PATH=".;."; conftest.sh) 2>&5 ac_status=$? echo "$as_me:923: \$? = $ac_status" >&5 (exit $ac_status); }; then ac_path_separator=';' else ac_path_separator=: fi PATH_SEPARATOR="$ac_path_separator" rm -f conftest.sh FIREWALK_VERSION=`cat VERSION` echo "$as_me:933: result: beginning autoconfiguration process for firewalk-$FIREWALK_VERSION..." >&5 echo "${ECHO_T}beginning autoconfiguration process for firewalk-$FIREWALK_VERSION..." >&6 ac_aux_dir= for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do if test -f $ac_dir/install-sh; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f $ac_dir/install.sh; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break elif test -f $ac_dir/shtool; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then { { echo "$as_me:952: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5 echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;} { (exit 1); exit 1; }; } fi ac_config_guess="$SHELL $ac_aux_dir/config.guess" ac_config_sub="$SHELL $ac_aux_dir/config.sub" ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure. # Make sure we can run config.sub. $ac_config_sub sun4 >/dev/null 2>&1 || { { echo "$as_me:962: error: cannot run $ac_config_sub" >&5 echo "$as_me: error: cannot run $ac_config_sub" >&2;} { (exit 1); exit 1; }; } echo "$as_me:966: checking build system type" >&5 echo $ECHO_N "checking build system type... $ECHO_C" >&6 if test "${ac_cv_build+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_build_alias=$build_alias test -z "$ac_cv_build_alias" && ac_cv_build_alias=`$ac_config_guess` test -z "$ac_cv_build_alias" && { { echo "$as_me:975: error: cannot guess build type; you must specify one" >&5 echo "$as_me: error: cannot guess build type; you must specify one" >&2;} { (exit 1); exit 1; }; } ac_cv_build=`$ac_config_sub $ac_cv_build_alias` || { { echo "$as_me:979: error: $ac_config_sub $ac_cv_build_alias failed." >&5 echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed." >&2;} { (exit 1); exit 1; }; } fi echo "$as_me:984: result: $ac_cv_build" >&5 echo "${ECHO_T}$ac_cv_build" >&6 build=$ac_cv_build build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` echo "$as_me:991: checking host system type" >&5 echo $ECHO_N "checking host system type... $ECHO_C" >&6 if test "${ac_cv_host+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_host_alias=$host_alias test -z "$ac_cv_host_alias" && ac_cv_host_alias=$ac_cv_build_alias ac_cv_host=`$ac_config_sub $ac_cv_host_alias` || { { echo "$as_me:1000: error: $ac_config_sub $ac_cv_host_alias failed" >&5 echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;} { (exit 1); exit 1; }; } fi echo "$as_me:1005: result: $ac_cv_host" >&5 echo "${ECHO_T}$ac_cv_host" >&6 host=$ac_cv_host host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` echo "$as_me:1012: checking target system type" >&5 echo $ECHO_N "checking target system type... $ECHO_C" >&6 if test "${ac_cv_target+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_target_alias=$target_alias test "x$ac_cv_target_alias" = "x" && ac_cv_target_alias=$ac_cv_host_alias ac_cv_target=`$ac_config_sub $ac_cv_target_alias` || { { echo "$as_me:1021: error: $ac_config_sub $ac_cv_target_alias failed" >&5 echo "$as_me: error: $ac_config_sub $ac_cv_target_alias failed" >&2;} { (exit 1); exit 1; }; } fi echo "$as_me:1026: result: $ac_cv_target" >&5 echo "${ECHO_T}$ac_cv_target" >&6 target=$ac_cv_target target_cpu=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` target_vendor=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` target_os=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` # The aliases save the names the user supplied, while $host etc. # will get canonicalized. test -n "$target_alias" && test "$program_prefix$program_suffix$program_transform_name" = \ NONENONEs,x,x, && program_prefix=${target_alias}- # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. echo "$as_me:1052: checking for a BSD compatible install" >&5 echo $ECHO_N "checking for a BSD compatible install... $ECHO_C" >&6 if test -z "$INSTALL"; then if test "${ac_cv_path_install+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_save_IFS=$IFS; IFS=$ac_path_separator for ac_dir in $PATH; do IFS=$ac_save_IFS # Account for people who put trailing slashes in PATH elements. case $ac_dir/ in / | ./ | .// | /cC/* \ | /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* \ | /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do if $as_executable_p "$ac_dir/$ac_prog"; then if test $ac_prog = install && grep dspmsg "$ac_dir/$ac_prog" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$ac_dir/$ac_prog" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else ac_cv_path_install="$ac_dir/$ac_prog -c" break 2 fi fi done ;; esac done fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. We don't cache a # path for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the path is relative. INSTALL=$ac_install_sh fi fi echo "$as_me:1101: result: $INSTALL" >&5 echo "${ECHO_T}$INSTALL" >&6 # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' echo "$as_me:1112: checking whether build environment is sane" >&5 echo $ECHO_N "checking whether build environment is sane... $ECHO_C" >&6 # Just in case sleep 1 echo timestamp > 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". { { echo "$as_me:1135: error: ls -t appears to fail. Make sure there is not a broken alias in your environment" >&5 echo "$as_me: error: ls -t appears to fail. Make sure there is not a broken alias in your environment" >&2;} { (exit 1); exit 1; }; } fi test "$2" = conftestfile ) then # Ok. : else { { echo "$as_me:1148: error: newly created file is older than distributed files! Check your system clock" >&5 echo "$as_me: error: newly created file is older than distributed files! Check your system clock" >&2;} { (exit 1); exit 1; }; } fi rm -f conftest* echo "$as_me:1155: result: yes" >&5 echo "${ECHO_T}yes" >&6 test "$program_prefix" != NONE && program_transform_name="s,^,$program_prefix,;$program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && program_transform_name="s,\$,$program_suffix,;$program_transform_name" # Double any \ or $. echo might interpret backslashes. # By default was `s,x,x', remove it if useless. cat <<\_ACEOF >conftest.sed s/[\\$]/&&/g;s/;s,x,x,$// _ACEOF program_transform_name=`echo $program_transform_name | sed -f conftest.sed` rm conftest.sed echo "$as_me:1170: checking whether ${MAKE-make} sets \${MAKE}" >&5 echo $ECHO_N "checking whether ${MAKE-make} sets \${MAKE}... $ECHO_C" >&6 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,./+-,__p_,'` if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.make <<\EOF all: @echo 'ac_maketemp="${MAKE}"' EOF # GNU make sometimes prints "make[1]: Entering...", which would confuse us. eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=` if test -n "$ac_maketemp"; then eval ac_cv_prog_make_${ac_make}_set=yes else eval ac_cv_prog_make_${ac_make}_set=no fi rm -f conftest.make fi if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then echo "$as_me:1190: result: yes" >&5 echo "${ECHO_T}yes" >&6 SET_MAKE= else echo "$as_me:1194: result: no" >&5 echo "${ECHO_T}no" >&6 SET_MAKE="MAKE=${MAKE-make}" fi PACKAGE=firewalk VERSION=$FIREWALK_VERSION if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then { { echo "$as_me:1204: error: source directory already configured; run \"make distclean\" there first" >&5 echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;} { (exit 1); exit 1; }; } fi cat >>confdefs.h <>confdefs.h <&5 echo $ECHO_N "checking for working aclocal... $ECHO_C" >&6 # 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 (aclocal --version) < /dev/null > /dev/null 2>&1; then ACLOCAL=aclocal echo "$as_me:1225: result: found" >&5 echo "${ECHO_T}found" >&6 else ACLOCAL="$missing_dir/missing aclocal" echo "$as_me:1229: result: missing" >&5 echo "${ECHO_T}missing" >&6 fi echo "$as_me:1233: checking for working autoconf" >&5 echo $ECHO_N "checking for working autoconf... $ECHO_C" >&6 # 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 (autoconf --version) < /dev/null > /dev/null 2>&1; then AUTOCONF=autoconf echo "$as_me:1240: result: found" >&5 echo "${ECHO_T}found" >&6 else AUTOCONF="$missing_dir/missing autoconf" echo "$as_me:1244: result: missing" >&5 echo "${ECHO_T}missing" >&6 fi echo "$as_me:1248: checking for working automake" >&5 echo $ECHO_N "checking for working automake... $ECHO_C" >&6 # 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 (automake --version) < /dev/null > /dev/null 2>&1; then AUTOMAKE=automake echo "$as_me:1255: result: found" >&5 echo "${ECHO_T}found" >&6 else AUTOMAKE="$missing_dir/missing automake" echo "$as_me:1259: result: missing" >&5 echo "${ECHO_T}missing" >&6 fi echo "$as_me:1263: checking for working autoheader" >&5 echo $ECHO_N "checking for working autoheader... $ECHO_C" >&6 # 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 (autoheader --version) < /dev/null > /dev/null 2>&1; then AUTOHEADER=autoheader echo "$as_me:1270: result: found" >&5 echo "${ECHO_T}found" >&6 else AUTOHEADER="$missing_dir/missing autoheader" echo "$as_me:1274: result: missing" >&5 echo "${ECHO_T}missing" >&6 fi echo "$as_me:1278: checking for working makeinfo" >&5 echo $ECHO_N "checking for working makeinfo... $ECHO_C" >&6 # 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 (makeinfo --version) < /dev/null > /dev/null 2>&1; then MAKEINFO=makeinfo echo "$as_me:1285: result: found" >&5 echo "${ECHO_T}found" >&6 else MAKEINFO="$missing_dir/missing makeinfo" echo "$as_me:1289: result: missing" >&5 echo "${ECHO_T}missing" >&6 fi ac_config_headers="$ac_config_headers include/config.h" ac_config_commands="$ac_config_commands default-1" ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 echo "$as_me:1305: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_save_IFS=$IFS; IFS=$ac_path_separator ac_dummy="$PATH" for ac_dir in $ac_dummy; do IFS=$ac_save_IFS test -z "$ac_dir" && ac_dir=. $as_executable_p "$ac_dir/$ac_word" || continue ac_cv_prog_CC="${ac_tool_prefix}gcc" echo "$as_me:1320: found $ac_dir/$ac_word" >&5 break done fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:1328: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:1331: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo "$as_me:1340: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else ac_save_IFS=$IFS; IFS=$ac_path_separator ac_dummy="$PATH" for ac_dir in $ac_dummy; do IFS=$ac_save_IFS test -z "$ac_dir" && ac_dir=. $as_executable_p "$ac_dir/$ac_word" || continue ac_cv_prog_ac_ct_CC="gcc" echo "$as_me:1355: found $ac_dir/$ac_word" >&5 break done fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then echo "$as_me:1363: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else echo "$as_me:1366: result: no" >&5 echo "${ECHO_T}no" >&6 fi CC=$ac_ct_CC else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 echo "$as_me:1379: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_save_IFS=$IFS; IFS=$ac_path_separator ac_dummy="$PATH" for ac_dir in $ac_dummy; do IFS=$ac_save_IFS test -z "$ac_dir" && ac_dir=. $as_executable_p "$ac_dir/$ac_word" || continue ac_cv_prog_CC="${ac_tool_prefix}cc" echo "$as_me:1394: found $ac_dir/$ac_word" >&5 break done fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:1402: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:1405: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo "$as_me:1414: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else ac_save_IFS=$IFS; IFS=$ac_path_separator ac_dummy="$PATH" for ac_dir in $ac_dummy; do IFS=$ac_save_IFS test -z "$ac_dir" && ac_dir=. $as_executable_p "$ac_dir/$ac_word" || continue ac_cv_prog_ac_ct_CC="cc" echo "$as_me:1429: found $ac_dir/$ac_word" >&5 break done fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then echo "$as_me:1437: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else echo "$as_me:1440: result: no" >&5 echo "${ECHO_T}no" >&6 fi CC=$ac_ct_CC else CC="$ac_cv_prog_CC" fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo "$as_me:1453: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no ac_save_IFS=$IFS; IFS=$ac_path_separator ac_dummy="$PATH" for ac_dir in $ac_dummy; do IFS=$ac_save_IFS test -z "$ac_dir" && ac_dir=. $as_executable_p "$ac_dir/$ac_word" || continue if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" echo "$as_me:1473: found $ac_dir/$ac_word" >&5 break done if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift set dummy "$ac_dir/$ac_word" ${1+"$@"} shift ac_cv_prog_CC="$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:1495: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:1498: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 echo "$as_me:1509: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_save_IFS=$IFS; IFS=$ac_path_separator ac_dummy="$PATH" for ac_dir in $ac_dummy; do IFS=$ac_save_IFS test -z "$ac_dir" && ac_dir=. $as_executable_p "$ac_dir/$ac_word" || continue ac_cv_prog_CC="$ac_tool_prefix$ac_prog" echo "$as_me:1524: found $ac_dir/$ac_word" >&5 break done fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:1532: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:1535: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo "$as_me:1548: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else ac_save_IFS=$IFS; IFS=$ac_path_separator ac_dummy="$PATH" for ac_dir in $ac_dummy; do IFS=$ac_save_IFS test -z "$ac_dir" && ac_dir=. $as_executable_p "$ac_dir/$ac_word" || continue ac_cv_prog_ac_ct_CC="$ac_prog" echo "$as_me:1563: found $ac_dir/$ac_word" >&5 break done fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then echo "$as_me:1571: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else echo "$as_me:1574: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$ac_ct_CC" && break done CC=$ac_ct_CC fi fi test -z "$CC" && { { echo "$as_me:1586: error: no acceptable cc found in \$PATH" >&5 echo "$as_me: error: no acceptable cc found in \$PATH" >&2;} { (exit 1); exit 1; }; } # Provide some information about the compiler. echo "$as_me:1591:" \ "checking for C compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (eval echo "$as_me:1594: \"$ac_compiler --version &5\"") >&5 (eval $ac_compiler --version &5) 2>&5 ac_status=$? echo "$as_me:1597: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:1599: \"$ac_compiler -v &5\"") >&5 (eval $ac_compiler -v &5) 2>&5 ac_status=$? echo "$as_me:1602: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:1604: \"$ac_compiler -V &5\"") >&5 (eval $ac_compiler -V &5) 2>&5 ac_status=$? echo "$as_me:1607: \$? = $ac_status" >&5 (exit $ac_status); } cat >conftest.$ac_ext <<_ACEOF #line 1611 "configure" #include "confdefs.h" int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.exe" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. echo "$as_me:1627: checking for C compiler default output" >&5 echo $ECHO_N "checking for C compiler default output... $ECHO_C" >&6 ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` if { (eval echo "$as_me:1630: \"$ac_link_default\"") >&5 (eval $ac_link_default) 2>&5 ac_status=$? echo "$as_me:1633: \$? = $ac_status" >&5 (exit $ac_status); }; then # Find the output, starting from the most likely. This scheme is # not robust to junk in `.', hence go to wildcards (a.*) only as a last # resort. for ac_file in `ls a.exe conftest.exe 2>/dev/null; ls a.out conftest 2>/dev/null; ls a.* conftest.* 2>/dev/null`; do case $ac_file in *.$ac_ext | *.o | *.obj | *.xcoff | *.tds | *.d | *.pdb ) ;; a.out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` # FIXME: I believe we export ac_cv_exeext for Libtool --akim. export ac_cv_exeext break;; * ) break;; esac done else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 { { echo "$as_me:1656: error: C compiler cannot create executables" >&5 echo "$as_me: error: C compiler cannot create executables" >&2;} { (exit 77); exit 77; }; } fi ac_exeext=$ac_cv_exeext echo "$as_me:1662: result: $ac_file" >&5 echo "${ECHO_T}$ac_file" >&6 # Check the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. echo "$as_me:1667: checking whether the C compiler works" >&5 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6 # FIXME: These cross compiler hacks should be removed for Autoconf 3.0 # If not cross compiling, check that we can run a simple program. if test "$cross_compiling" != yes; then if { ac_try='./$ac_file' { (eval echo "$as_me:1673: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:1676: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { echo "$as_me:1683: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'." >&5 echo "$as_me: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'." >&2;} { (exit 1); exit 1; }; } fi fi fi echo "$as_me:1691: result: yes" >&5 echo "${ECHO_T}yes" >&6 rm -f a.out a.exe conftest$ac_cv_exeext ac_clean_files=$ac_clean_files_save # Check the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. echo "$as_me:1698: checking whether we are cross compiling" >&5 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6 echo "$as_me:1700: result: $cross_compiling" >&5 echo "${ECHO_T}$cross_compiling" >&6 echo "$as_me:1703: checking for executable suffix" >&5 echo $ECHO_N "checking for executable suffix... $ECHO_C" >&6 if { (eval echo "$as_me:1705: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:1708: \$? = $ac_status" >&5 (exit $ac_status); }; then # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in `(ls conftest.exe; ls conftest; ls conftest.*) 2>/dev/null`; do case $ac_file in *.$ac_ext | *.o | *.obj | *.xcoff | *.tds | *.d | *.pdb ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` export ac_cv_exeext break;; * ) break;; esac done else { { echo "$as_me:1724: error: cannot compute EXEEXT: cannot compile and link" >&5 echo "$as_me: error: cannot compute EXEEXT: cannot compile and link" >&2;} { (exit 1); exit 1; }; } fi rm -f conftest$ac_cv_exeext echo "$as_me:1730: result: $ac_cv_exeext" >&5 echo "${ECHO_T}$ac_cv_exeext" >&6 rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT echo "$as_me:1736: checking for object suffix" >&5 echo $ECHO_N "checking for object suffix... $ECHO_C" >&6 if test "${ac_cv_objext+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line 1742 "configure" #include "confdefs.h" int main () { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { (eval echo "$as_me:1754: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:1757: \$? = $ac_status" >&5 (exit $ac_status); }; then for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 { { echo "$as_me:1769: error: cannot compute OBJEXT: cannot compile" >&5 echo "$as_me: error: cannot compute OBJEXT: cannot compile" >&2;} { (exit 1); exit 1; }; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi echo "$as_me:1776: result: $ac_cv_objext" >&5 echo "${ECHO_T}$ac_cv_objext" >&6 OBJEXT=$ac_cv_objext ac_objext=$OBJEXT echo "$as_me:1780: checking whether we are using the GNU C compiler" >&5 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6 if test "${ac_cv_c_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line 1786 "configure" #include "confdefs.h" int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:1801: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:1804: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:1807: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:1810: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_compiler_gnu=no fi rm -f conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi echo "$as_me:1822: result: $ac_cv_c_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6 GCC=`test $ac_compiler_gnu = yes && echo yes` ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS CFLAGS="-g" echo "$as_me:1828: checking whether $CC accepts -g" >&5 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6 if test "${ac_cv_prog_cc_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line 1834 "configure" #include "confdefs.h" int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:1846: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:1849: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:1852: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:1855: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_prog_cc_g=no fi rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:1865: result: $ac_cv_prog_cc_g" >&5 echo "${ECHO_T}$ac_cv_prog_cc_g" >&6 if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi # Some people use a C++ compiler to compile C. Since we use `exit', # in C++ we need to declare it. In case someone uses the same compiler # for both compiling C and C++ we need to have the C++ compiler decide # the declaration of exit, since it's the most demanding environment. cat >conftest.$ac_ext <<_ACEOF #ifndef __cplusplus choke me #endif _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:1892: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:1895: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:1898: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:1901: \$? = $ac_status" >&5 (exit $ac_status); }; }; then for ac_declaration in \ ''\ '#include ' \ 'extern "C" void std::exit (int) throw (); using std::exit;' \ 'extern "C" void std::exit (int); using std::exit;' \ 'extern "C" void exit (int) throw ();' \ 'extern "C" void exit (int);' \ 'void exit (int);' do cat >conftest.$ac_ext <<_ACEOF #line 1913 "configure" #include "confdefs.h" #include $ac_declaration int main () { exit (42); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:1926: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:1929: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:1932: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:1935: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 continue fi rm -f conftest.$ac_objext conftest.$ac_ext cat >conftest.$ac_ext <<_ACEOF #line 1945 "configure" #include "confdefs.h" $ac_declaration int main () { exit (42); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:1957: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:1960: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:1963: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:1966: \$? = $ac_status" >&5 (exit $ac_status); }; }; then break else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext conftest.$ac_ext done rm -f conftest* if test -n "$ac_declaration"; then echo '#ifdef __cplusplus' >>confdefs.h echo $ac_declaration >>confdefs.h echo '#endif' >>confdefs.h fi else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu echo "$as_me:1998: checking how to run the C preprocessor" >&5 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if test "${ac_cv_prog_CPP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF #line 2019 "configure" #include "confdefs.h" #include Syntax error _ACEOF if { (eval echo "$as_me:2024: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? egrep -v '^ *\+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:2030: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then : else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether non-existent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF #line 2053 "configure" #include "confdefs.h" #include _ACEOF if { (eval echo "$as_me:2057: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? egrep -v '^ *\+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:2063: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi echo "$as_me:2100: result: $CPP" >&5 echo "${ECHO_T}$CPP" >&6 ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF #line 2110 "configure" #include "confdefs.h" #include Syntax error _ACEOF if { (eval echo "$as_me:2115: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? egrep -v '^ *\+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:2121: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then : else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether non-existent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF #line 2144 "configure" #include "confdefs.h" #include _ACEOF if { (eval echo "$as_me:2148: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? egrep -v '^ *\+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:2154: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { echo "$as_me:2182: error: C preprocessor \"$CPP\" fails sanity check" >&5 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check" >&2;} { (exit 1); exit 1; }; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test $ac_cv_c_compiler_gnu = yes; then echo "$as_me:2194: checking whether $CC needs -traditional" >&5 echo $ECHO_N "checking whether $CC needs -traditional... $ECHO_C" >&6 if test "${ac_cv_prog_gcc_traditional+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_pattern="Autoconf.*'x'" cat >conftest.$ac_ext <<_ACEOF #line 2201 "configure" #include "confdefs.h" #include Autoconf TIOCGETP _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | egrep "$ac_pattern" >/dev/null 2>&1; then ac_cv_prog_gcc_traditional=yes else ac_cv_prog_gcc_traditional=no fi rm -f conftest* if test $ac_cv_prog_gcc_traditional = no; then cat >conftest.$ac_ext <<_ACEOF #line 2216 "configure" #include "confdefs.h" #include Autoconf TCGETA _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | egrep "$ac_pattern" >/dev/null 2>&1; then ac_cv_prog_gcc_traditional=yes fi rm -f conftest* fi fi echo "$as_me:2229: result: $ac_cv_prog_gcc_traditional" >&5 echo "${ECHO_T}$ac_cv_prog_gcc_traditional" >&6 if test $ac_cv_prog_gcc_traditional = yes; then CC="$CC -traditional" fi fi if test "$GCC" = yes ; then CFLAGS="$CFLAGS -Wall" fi echo "$as_me:2240: checking for libnet_build_ipv4 in -lnet" >&5 echo $ECHO_N "checking for libnet_build_ipv4 in -lnet... $ECHO_C" >&6 if test "${ac_cv_lib_net_libnet_build_ipv4+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lnet $LIBS" cat >conftest.$ac_ext <<_ACEOF #line 2248 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char libnet_build_ipv4 (); int main () { libnet_build_ipv4 (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:2267: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:2270: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:2273: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:2276: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_net_libnet_build_ipv4=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_lib_net_libnet_build_ipv4=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:2287: result: $ac_cv_lib_net_libnet_build_ipv4" >&5 echo "${ECHO_T}$ac_cv_lib_net_libnet_build_ipv4" >&6 if test $ac_cv_lib_net_libnet_build_ipv4 = yes; then cat >>confdefs.h <&5 echo "$as_me: error: We need libnet 1.1.0 or better. http://www.packetfactory.net" >&2;} { (exit 1); exit 1; }; } fi echo "$as_me:2302: checking for pcap_open_live in -lpcap" >&5 echo $ECHO_N "checking for pcap_open_live in -lpcap... $ECHO_C" >&6 if test "${ac_cv_lib_pcap_pcap_open_live+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lpcap $LIBS" cat >conftest.$ac_ext <<_ACEOF #line 2310 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char pcap_open_live (); int main () { pcap_open_live (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:2329: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:2332: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:2335: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:2338: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_pcap_pcap_open_live=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_lib_pcap_pcap_open_live=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:2349: result: $ac_cv_lib_pcap_pcap_open_live" >&5 echo "${ECHO_T}$ac_cv_lib_pcap_pcap_open_live" >&6 if test $ac_cv_lib_pcap_pcap_open_live = yes; then cat >>confdefs.h <&5 echo "$as_me: error: No libpcap? http://www.tcpdump.org." >&2;} { (exit 1); exit 1; }; } fi echo "$as_me:2364: checking for arp_get in -ldnet" >&5 echo $ECHO_N "checking for arp_get in -ldnet... $ECHO_C" >&6 if test "${ac_cv_lib_dnet_arp_get+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldnet $LIBS" cat >conftest.$ac_ext <<_ACEOF #line 2372 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char arp_get (); int main () { arp_get (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:2391: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:2394: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:2397: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:2400: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_dnet_arp_get=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_lib_dnet_arp_get=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:2411: result: $ac_cv_lib_dnet_arp_get" >&5 echo "${ECHO_T}$ac_cv_lib_dnet_arp_get" >&6 if test $ac_cv_lib_dnet_arp_get = yes; then cat >>confdefs.h <&5 echo "$as_me: error: No libdnet? http://libdnet.sourceforge.net." >&2;} { (exit 1); exit 1; }; } fi echo "$as_me:2426: checking for ANSI C header files" >&5 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 if test "${ac_cv_header_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line 2432 "configure" #include "confdefs.h" #include #include #include #include _ACEOF if { (eval echo "$as_me:2440: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? egrep -v '^ *\+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:2446: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_cv_header_stdc=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_header_stdc=no fi rm -f conftest.err conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF #line 2468 "configure" #include "confdefs.h" #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | egrep "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF #line 2486 "configure" #include "confdefs.h" #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | egrep "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : else cat >conftest.$ac_ext <<_ACEOF #line 2507 "configure" #include "confdefs.h" #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:2533: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:2536: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:2538: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:2541: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_header_stdc=no fi rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi fi echo "$as_me:2554: result: $ac_cv_header_stdc" >&5 echo "${ECHO_T}$ac_cv_header_stdc" >&6 if test $ac_cv_header_stdc = yes; then cat >>confdefs.h <<\EOF #define STDC_HEADERS 1 EOF fi echo "$as_me:2564: checking for $CC option to accept ANSI C" >&5 echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6 if test "${ac_cv_prog_cc_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_prog_cc_stdc=no ac_save_CC=$CC cat >conftest.$ac_ext <<_ACEOF #line 2572 "configure" #include "confdefs.h" #include #include #include #include /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF # Don't try gcc -ansi; that turns off useful extensions and # breaks some systems' header files. # AIX -qlanglvl=ansi # Ultrix and OSF/1 -std1 # HP-UX 10.20 and later -Ae # HP-UX older versions -Aa -D_HPUX_SOURCE # SVR4 -Xc -D__EXTENSIONS__ for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" rm -f conftest.$ac_objext if { (eval echo "$as_me:2621: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:2624: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:2627: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:2630: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_prog_cc_stdc=$ac_arg break else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext done rm -f conftest.$ac_ext conftest.$ac_objext CC=$ac_save_CC fi case "x$ac_cv_prog_cc_stdc" in x|xno) echo "$as_me:2647: result: none needed" >&5 echo "${ECHO_T}none needed" >&6 ;; *) echo "$as_me:2650: result: $ac_cv_prog_cc_stdc" >&5 echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6 CC="$CC $ac_cv_prog_cc_stdc" ;; esac echo "$as_me:2655: checking for an ANSI C-conforming const" >&5 echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6 if test "${ac_cv_c_const+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line 2661 "configure" #include "confdefs.h" int main () { /* FIXME: Include the comments suggested by Paul. */ #ifndef __cplusplus /* Ultrix mips cc rejects this. */ typedef int charset[2]; const charset x; /* SunOS 4.1.1 cc rejects this. */ char const *const *ccp; char **p; /* NEC SVR4.0.2 mips cc rejects this. */ struct point {int x, y;}; static struct point const zero = {0,0}; /* AIX XL C 1.02.0.0 rejects this. It does not let you subtract one const X* pointer from another in an arm of an if-expression whose if-part is not a constant expression */ const char *g = "string"; ccp = &g + (g ? g-g : 0); /* HPUX 7.0 cc rejects these. */ ++ccp; p = (char**) ccp; ccp = (char const *const *) p; { /* SCO 3.2v4 cc rejects this. */ char *t; char const *s = 0 ? (char *) 0 : (char const *) 0; *t++ = 0; } { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ int x[] = {25, 17}; const int *foo = &x[0]; ++foo; } { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ typedef const int *iptr; iptr p = 0; ++p; } { /* AIX XL C 1.02.0.0 rejects this saying "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ struct s { int j; const int *ap[3]; }; struct s *b; b->j = 5; } { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ const int foo = 10; } #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:2719: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:2722: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:2725: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:2728: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_c_const=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_c_const=no fi rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:2738: result: $ac_cv_c_const" >&5 echo "${ECHO_T}$ac_cv_c_const" >&6 if test $ac_cv_c_const = no; then cat >>confdefs.h <<\EOF #define const EOF fi for ac_func in strerror do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` echo "$as_me:2751: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 if eval "test \"\${$as_ac_var+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line 2757 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. */ #include /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func (); char (*f) (); int main () { /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$ac_func) || defined (__stub___$ac_func) choke me #else f = $ac_func; #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:2788: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:2791: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:2794: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:2797: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:2807: result: `eval echo '${'$as_ac_var'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <&5 echo $ECHO_N "checking for bpf... $ECHO_C" >&6 if test -r /dev/bpf0 ; then cat >>confdefs.h <<\EOF #define HAVE_BPF 1 EOF echo "$as_me:2825: result: yes" >&5 echo "${ECHO_T}yes" >&6 elif test -c /dev/bpf0 ; then # check again in case not readable cat >>confdefs.h <<\EOF #define HAVE_BPF 1 EOF echo "$as_me:2832: result: yes" >&5 echo "${ECHO_T}yes" >&6 else echo "$as_me:2835: result: no" >&5 echo "${ECHO_T}no" >&6 fi case "$target_os" in *solaris*) cat >>confdefs.h <<\EOF #define HAVE_SOLARIS 1 EOF echo "$as_me:2846: checking for socket in -lsocket" >&5 echo $ECHO_N "checking for socket in -lsocket... $ECHO_C" >&6 if test "${ac_cv_lib_socket_socket+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsocket $LIBS" cat >conftest.$ac_ext <<_ACEOF #line 2854 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char socket (); int main () { socket (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:2873: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:2876: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:2879: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:2882: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_socket_socket=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_lib_socket_socket=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:2893: result: $ac_cv_lib_socket_socket" >&5 echo "${ECHO_T}$ac_cv_lib_socket_socket" >&6 if test $ac_cv_lib_socket_socket = yes; then cat >>confdefs.h <&5 echo "$as_me: error: libsocket not found." >&2;} { (exit 1); exit 1; }; } fi echo "$as_me:2908: checking for gethostbyname in -lnsl" >&5 echo $ECHO_N "checking for gethostbyname in -lnsl... $ECHO_C" >&6 if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lnsl $LIBS" cat >conftest.$ac_ext <<_ACEOF #line 2916 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char gethostbyname (); int main () { gethostbyname (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:2935: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:2938: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:2941: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:2944: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_nsl_gethostbyname=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_lib_nsl_gethostbyname=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:2955: result: $ac_cv_lib_nsl_gethostbyname" >&5 echo "${ECHO_T}$ac_cv_lib_nsl_gethostbyname" >&6 if test $ac_cv_lib_nsl_gethostbyname = yes; then cat >>confdefs.h <&5 echo "$as_me: error: libnsl not found." >&2;} { (exit 1); exit 1; }; } fi ADDITIONAL_LIBS='-lsocket -lnsl' ;; esac ac_config_files="$ac_config_files Makefile src/Makefile version.h" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overriden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, don't put newlines in cache variables' values. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. { (set) 2>&1 | case `(ac_space=' '; set | grep ac_space) 2>&1` in *ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote # substitution turns \\\\ into \\, and sed turns \\ into \). sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n \ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" ;; esac; } | sed ' t clear : clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ : end' >>confcache if cmp -s $cache_file confcache; then :; else if test -w $cache_file; then test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file" cat confcache >$cache_file else echo "not updating unwritable cache $cache_file" fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' # VPATH may cause trouble with some makes, so we remove $(srcdir), # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=/{ s/:*\$(srcdir):*/:/; s/:*\${srcdir}:*/:/; s/:*@srcdir@:*/:/; s/^\([^=]*=[ ]*\):*/\1/; s/:*$//; s/^[^=]*=[ ]*$//; }' fi DEFS=-DHAVE_CONFIG_H : ${CONFIG_STATUS=./config.status} ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { echo "$as_me:3055: creating $CONFIG_STATUS" >&5 echo "$as_me: creating $CONFIG_STATUS" >&6;} cat >$CONFIG_STATUS <<_ACEOF #! $SHELL # Generated automatically by configure. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false SHELL=\${CONFIG_SHELL-$SHELL} ac_cs_invocation="\$0 \$@" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then set -o posix fi # Name of the executable. as_me=`echo "$0" |sed 's,.*[\\/],,'` if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then # We could just check for DJGPP; but this test a) works b) is more generic # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). if test -f conf$$.exe; then # Don't use ln at all; we don't have any links as_ln_s='cp -p' else as_ln_s='ln -s' fi elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.file as_executable_p="test -f" # Support unset when possible. if (FOO=FOO; unset FOO) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # NLS nuisances. $as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; } $as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; } $as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; } $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; } $as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; } $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; } $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; } $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; } # IFS # We need space, tab and new line, in precisely that order. as_nl=' ' IFS=" $as_nl" # CDPATH. $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; } exec 6>&1 _ACEOF # Files that config.status was made for. if test -n "$ac_config_files"; then echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS fi if test -n "$ac_config_headers"; then echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS fi if test -n "$ac_config_links"; then echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS fi if test -n "$ac_config_commands"; then echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS fi cat >>$CONFIG_STATUS <<\EOF ac_cs_usage="\ \`$as_me' instantiates files from templates according to the current configuration. Usage: $0 [OPTIONS] [FILE]... -h, --help print this help, then exit -V, --version print version number, then exit -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Configuration commands: $config_commands Report bugs to ." EOF cat >>$CONFIG_STATUS <>$CONFIG_STATUS <<\EOF # If no file are specified by the user, then we need to provide default # value. By we need to know if files were specified by the user. ac_need_defaults=: while test $# != 0 do case $1 in --*=*) ac_option=`expr "x$1" : 'x\([^=]*\)='` ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'` shift set dummy "$ac_option" "$ac_optarg" ${1+"$@"} shift ;; -*);; *) # This is not an option, so the user has probably given explicit # arguments. ac_need_defaults=false;; esac case $1 in # Handling of the options. EOF cat >>$CONFIG_STATUS <>$CONFIG_STATUS <<\EOF --version | --vers* | -V ) echo "$ac_cs_version"; exit 0 ;; --he | --h) # Conflict between --help and --header { { echo "$as_me:3231: error: ambiguous option: $1 Try \`$0 --help' for more information." >&5 echo "$as_me: error: ambiguous option: $1 Try \`$0 --help' for more information." >&2;} { (exit 1); exit 1; }; };; --help | --hel | -h ) echo "$ac_cs_usage"; exit 0 ;; --debug | --d* | -d ) debug=: ;; --file | --fil | --fi | --f ) shift CONFIG_FILES="$CONFIG_FILES $1" ac_need_defaults=false;; --header | --heade | --head | --hea ) shift CONFIG_HEADERS="$CONFIG_HEADERS $1" ac_need_defaults=false;; # This is an error. -*) { { echo "$as_me:3250: error: unrecognized option: $1 Try \`$0 --help' for more information." >&5 echo "$as_me: error: unrecognized option: $1 Try \`$0 --help' for more information." >&2;} { (exit 1); exit 1; }; } ;; *) ac_config_targets="$ac_config_targets $1" ;; esac shift done exec 5>>config.log cat >&5 << _ACEOF ## ----------------------- ## ## Running config.status. ## ## ----------------------- ## This file was extended by $as_me 2.52, executed with CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS > $ac_cs_invocation on `(hostname || uname -n) 2>/dev/null | sed 1q` _ACEOF EOF cat >>$CONFIG_STATUS <>$CONFIG_STATUS <<\EOF for ac_config_target in $ac_config_targets do case "$ac_config_target" in # Handling of arguments. "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;; "src/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; "version.h" ) CONFIG_FILES="$CONFIG_FILES version.h" ;; "default-1" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default-1" ;; "include/config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS include/config.h" ;; *) { { echo "$as_me:3297: error: invalid argument: $ac_config_target" >&5 echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands fi # Create a temporary directory, and hook for its removal unless debugging. $debug || { trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0 trap '{ (exit 1); exit 1; }' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. : ${TMPDIR=/tmp} { tmp=`(umask 077 && mktemp -d -q "$TMPDIR/csXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { tmp=$TMPDIR/cs$$-$RANDOM (umask 077 && mkdir $tmp) } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 { (exit 1); exit 1; } } EOF cat >>$CONFIG_STATUS <\$tmp/subs.sed <<\\CEOF s,@SHELL@,$SHELL,;t t s,@exec_prefix@,$exec_prefix,;t t s,@prefix@,$prefix,;t t s,@program_transform_name@,$program_transform_name,;t t s,@bindir@,$bindir,;t t s,@sbindir@,$sbindir,;t t s,@libexecdir@,$libexecdir,;t t s,@datadir@,$datadir,;t t s,@sysconfdir@,$sysconfdir,;t t s,@sharedstatedir@,$sharedstatedir,;t t s,@localstatedir@,$localstatedir,;t t s,@libdir@,$libdir,;t t s,@includedir@,$includedir,;t t s,@oldincludedir@,$oldincludedir,;t t s,@infodir@,$infodir,;t t s,@mandir@,$mandir,;t t s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t s,@build_alias@,$build_alias,;t t s,@host_alias@,$host_alias,;t t s,@target_alias@,$target_alias,;t t s,@ECHO_C@,$ECHO_C,;t t s,@ECHO_N@,$ECHO_N,;t t s,@ECHO_T@,$ECHO_T,;t t s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t s,@DEFS@,$DEFS,;t t s,@LIBS@,$LIBS,;t t s,@build@,$build,;t t s,@build_cpu@,$build_cpu,;t t s,@build_vendor@,$build_vendor,;t t s,@build_os@,$build_os,;t t s,@host@,$host,;t t s,@host_cpu@,$host_cpu,;t t s,@host_vendor@,$host_vendor,;t t s,@host_os@,$host_os,;t t s,@target@,$target,;t t s,@target_cpu@,$target_cpu,;t t s,@target_vendor@,$target_vendor,;t t s,@target_os@,$target_os,;t t s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t s,@INSTALL_DATA@,$INSTALL_DATA,;t t s,@PACKAGE@,$PACKAGE,;t t s,@VERSION@,$VERSION,;t t s,@ACLOCAL@,$ACLOCAL,;t t s,@AUTOCONF@,$AUTOCONF,;t t s,@AUTOMAKE@,$AUTOMAKE,;t t s,@AUTOHEADER@,$AUTOHEADER,;t t s,@MAKEINFO@,$MAKEINFO,;t t s,@SET_MAKE@,$SET_MAKE,;t t s,@FIREWALK_VERSION@,$FIREWALK_VERSION,;t t s,@CC@,$CC,;t t s,@CFLAGS@,$CFLAGS,;t t s,@LDFLAGS@,$LDFLAGS,;t t s,@CPPFLAGS@,$CPPFLAGS,;t t s,@ac_ct_CC@,$ac_ct_CC,;t t s,@EXEEXT@,$EXEEXT,;t t s,@OBJEXT@,$OBJEXT,;t t s,@CPP@,$CPP,;t t s,@ADDITIONAL_LIBS@,$ADDITIONAL_LIBS,;t t CEOF EOF cat >>$CONFIG_STATUS <<\EOF # Split the substitutions into bite-sized pieces for seds with # small command number limits, like on Digital OSF/1 and HP-UX. ac_max_sed_lines=48 ac_sed_frag=1 # Number of current file. ac_beg=1 # First line for current file. ac_end=$ac_max_sed_lines # Line after last line for current file. ac_more_lines=: ac_sed_cmds= while $ac_more_lines; do if test $ac_beg -gt 1; then sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag else sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag fi if test ! -s $tmp/subs.frag; then ac_more_lines=false else # The purpose of the label and of the branching condition is to # speed up the sed processing (if there are no `@' at all, there # is no need to browse any of the substitutions). # These are the two extra sed commands mentioned above. (echo ':t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed if test -z "$ac_sed_cmds"; then ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed" else ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed" fi ac_sed_frag=`expr $ac_sed_frag + 1` ac_beg=$ac_end ac_end=`expr $ac_end + $ac_max_sed_lines` fi done if test -z "$ac_sed_cmds"; then ac_sed_cmds=cat fi fi # test -n "$CONFIG_FILES" EOF cat >>$CONFIG_STATUS <<\EOF for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". case $ac_file in - | *:- | *:-:* ) # input from stdin cat >$tmp/stdin ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; * ) ac_file_in=$ac_file.in ;; esac # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories. ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then { case "$ac_dir" in [\\/]* | ?:[\\/]* ) as_incr_dir=;; *) as_incr_dir=.;; esac as_dummy="$ac_dir" for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do case $as_mkdir_dir in # Skip DOS drivespec ?:) as_incr_dir=$as_mkdir_dir ;; *) as_incr_dir=$as_incr_dir/$as_mkdir_dir test -d "$as_incr_dir" || mkdir "$as_incr_dir" ;; esac done; } ac_dir_suffix="/`echo $ac_dir|sed 's,^\./,,'`" # A "../" for each directory in $ac_dir_suffix. ac_dots=`echo "$ac_dir_suffix" | sed 's,/[^/]*,../,g'` else ac_dir_suffix= ac_dots= fi case $srcdir in .) ac_srcdir=. if test -z "$ac_dots"; then ac_top_srcdir=. else ac_top_srcdir=`echo $ac_dots | sed 's,/$,,'` fi ;; [\\/]* | ?:[\\/]* ) ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ;; *) # Relative path. ac_srcdir=$ac_dots$srcdir$ac_dir_suffix ac_top_srcdir=$ac_dots$srcdir ;; esac case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_dots$INSTALL ;; esac if test x"$ac_file" != x-; then { echo "$as_me:3526: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} rm -f "$ac_file" fi # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated automatically by config.status. */ configure_input="Generated automatically from `echo $ac_file_in | sed 's,.*/,,'` by configure." # First look for the input files in the build tree, otherwise in the # src tree. ac_file_inputs=`IFS=: for f in $ac_file_in; do case $f in -) echo $tmp/stdin ;; [\\/$]*) # Absolute (can't be DOS-style, as IFS=:) test -f "$f" || { { echo "$as_me:3544: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } echo $f;; *) # Relative if test -f "$f"; then # Build tree echo $f elif test -f "$srcdir/$f"; then # Source tree echo $srcdir/$f else # /dev/null tree { { echo "$as_me:3557: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } fi;; esac done` || { (exit 1); exit 1; } EOF cat >>$CONFIG_STATUS <>$CONFIG_STATUS <<\EOF :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s,@configure_input@,$configure_input,;t t s,@srcdir@,$ac_srcdir,;t t s,@top_srcdir@,$ac_top_srcdir,;t t s,@INSTALL@,$ac_INSTALL,;t t " $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out rm -f $tmp/stdin if test x"$ac_file" != x-; then mv $tmp/out $ac_file else cat $tmp/out rm -f $tmp/out fi done EOF cat >>$CONFIG_STATUS <<\EOF # # CONFIG_HEADER section. # # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where # NAME is the cpp macro being defined and VALUE is the value it is being given. # # ac_d sets the value in "#define NAME VALUE" lines. ac_dA='s,^\([ ]*\)#\([ ]*define[ ][ ]*\)' ac_dB='[ ].*$,\1#\2' ac_dC=' ' ac_dD=',;t' # ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE". ac_uA='s,^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' ac_uB='$,\1#\2define\3' ac_uC=' ' ac_uD=',;t' for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". case $ac_file in - | *:- | *:-:* ) # input from stdin cat >$tmp/stdin ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; * ) ac_file_in=$ac_file.in ;; esac test x"$ac_file" != x- && { echo "$as_me:3618: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} # First look for the input files in the build tree, otherwise in the # src tree. ac_file_inputs=`IFS=: for f in $ac_file_in; do case $f in -) echo $tmp/stdin ;; [\\/$]*) # Absolute (can't be DOS-style, as IFS=:) test -f "$f" || { { echo "$as_me:3629: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } echo $f;; *) # Relative if test -f "$f"; then # Build tree echo $f elif test -f "$srcdir/$f"; then # Source tree echo $srcdir/$f else # /dev/null tree { { echo "$as_me:3642: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } fi;; esac done` || { (exit 1); exit 1; } # Remove the trailing spaces. sed 's/[ ]*$//' $ac_file_inputs >$tmp/in EOF # Transform confdefs.h into two sed scripts, `conftest.defines' and # `conftest.undefs', that substitutes the proper values into # config.h.in to produce config.h. The first handles `#define' # templates, and the second `#undef' templates. # And first: Protect against being on the right side of a sed subst in # config.status. Protect against being in an unquoted here document # in config.status. rm -f conftest.defines conftest.undefs # Using a here document instead of a string reduces the quoting nightmare. # Putting comments in sed scripts is not portable. # # `end' is used to avoid that the second main sed command (meant for # 0-ary CPP macros) applies to n-ary macro definitions. # See the Autoconf documentation for `clear'. cat >confdef2sed.sed <<\EOF s/[\\&,]/\\&/g s,[\\$`],\\&,g t clear : clear s,^[ ]*#[ ]*define[ ][ ]*\(\([^ (][^ (]*\)([^)]*)\)[ ]*\(.*\)$,${ac_dA}\2${ac_dB}\1${ac_dC}\3${ac_dD},gp t end s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp : end EOF # If some macros were called several times there might be several times # the same #defines, which is useless. Nevertheless, we may not want to # sort them, since we want the *last* AC-DEFINE to be honored. uniq confdefs.h | sed -n -f confdef2sed.sed >conftest.defines sed 's/ac_d/ac_u/g' conftest.defines >conftest.undefs rm -f confdef2sed.sed # This sed command replaces #undef with comments. This is necessary, for # example, in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. cat >>conftest.undefs <<\EOF s,^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */, EOF # Break up conftest.defines because some shells have a limit on the size # of here documents, and old seds have small limits too (100 cmds). echo ' # Handle all the #define templates only if necessary.' >>$CONFIG_STATUS echo ' if egrep "^[ ]*#[ ]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS echo ' # If there are no defines, we may have an empty if/fi' >>$CONFIG_STATUS echo ' :' >>$CONFIG_STATUS rm -f conftest.tail while grep . conftest.defines >/dev/null do # Write a limited-size here document to $tmp/defines.sed. echo ' cat >$tmp/defines.sed <>$CONFIG_STATUS # Speed up: don't consider the non `#define' lines. echo '/^[ ]*#[ ]*define/!b' >>$CONFIG_STATUS # Work around the forget-to-reset-the-flag bug. echo 't clr' >>$CONFIG_STATUS echo ': clr' >>$CONFIG_STATUS sed ${ac_max_here_lines}q conftest.defines >>$CONFIG_STATUS echo 'CEOF sed -f $tmp/defines.sed $tmp/in >$tmp/out rm -f $tmp/in mv $tmp/out $tmp/in ' >>$CONFIG_STATUS sed 1,${ac_max_here_lines}d conftest.defines >conftest.tail rm -f conftest.defines mv conftest.tail conftest.defines done rm -f conftest.defines echo ' fi # egrep' >>$CONFIG_STATUS echo >>$CONFIG_STATUS # Break up conftest.undefs because some shells have a limit on the size # of here documents, and old seds have small limits too (100 cmds). echo ' # Handle all the #undef templates' >>$CONFIG_STATUS rm -f conftest.tail while grep . conftest.undefs >/dev/null do # Write a limited-size here document to $tmp/undefs.sed. echo ' cat >$tmp/undefs.sed <>$CONFIG_STATUS # Speed up: don't consider the non `#undef' echo '/^[ ]*#[ ]*undef/!b' >>$CONFIG_STATUS # Work around the forget-to-reset-the-flag bug. echo 't clr' >>$CONFIG_STATUS echo ': clr' >>$CONFIG_STATUS sed ${ac_max_here_lines}q conftest.undefs >>$CONFIG_STATUS echo 'CEOF sed -f $tmp/undefs.sed $tmp/in >$tmp/out rm -f $tmp/in mv $tmp/out $tmp/in ' >>$CONFIG_STATUS sed 1,${ac_max_here_lines}d conftest.undefs >conftest.tail rm -f conftest.undefs mv conftest.tail conftest.undefs done rm -f conftest.undefs cat >>$CONFIG_STATUS <<\EOF # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated automatically by config.status. */ if test x"$ac_file" = x-; then echo "/* Generated automatically by configure. */" >$tmp/config.h else echo "/* $ac_file. Generated automatically by configure. */" >$tmp/config.h fi cat $tmp/in >>$tmp/config.h rm -f $tmp/in if test x"$ac_file" != x-; then if cmp -s $ac_file $tmp/config.h 2>/dev/null; then { echo "$as_me:3759: $ac_file is unchanged" >&5 echo "$as_me: $ac_file is unchanged" >&6;} else ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then { case "$ac_dir" in [\\/]* | ?:[\\/]* ) as_incr_dir=;; *) as_incr_dir=.;; esac as_dummy="$ac_dir" for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do case $as_mkdir_dir in # Skip DOS drivespec ?:) as_incr_dir=$as_mkdir_dir ;; *) as_incr_dir=$as_incr_dir/$as_mkdir_dir test -d "$as_incr_dir" || mkdir "$as_incr_dir" ;; esac done; } fi rm -f $ac_file mv $tmp/config.h $ac_file fi else cat $tmp/config.h rm -f $tmp/config.h fi done EOF cat >>$CONFIG_STATUS <<\EOF # # CONFIG_COMMANDS section. # for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue ac_dest=`echo "$ac_file" | sed 's,:.*,,'` ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'` case $ac_dest in default-1 ) test -z "$CONFIG_HEADERS" || echo timestamp > include/stamp-h ;; esac done EOF cat >>$CONFIG_STATUS <<\EOF { (exit 0); exit 0; } EOF chmod +x $CONFIG_STATUS ac_clean_files=$ac_clean_files_save # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: exec 5>/dev/null $SHELL $CONFIG_STATUS || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || { (exit 1); exit 1; } fi Firewalk/configure.in010064400017500001750000000064700747005366000142700ustar00routeroute# $Id: configure.in,v 1.3 2002/05/14 00:17:52 route Exp $ # # Firewalk 5.0 # Firewalk autoconfiguration information file # # Copyright (c) 1998 - 2002 Mike D. Schiffman # Copyright (c) 1998, 1999 David E. Goldsmith # http://www.packetfactory.net/firewalk # # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # 2. Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # # THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE # ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS # OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. # # # Process this file with autoconf to produce a configure script. AC_INIT(src/main.c) FIREWALK_VERSION=`cat VERSION` AC_MSG_RESULT(beginning autoconfiguration process for firewalk-$FIREWALK_VERSION...) AC_CANONICAL_SYSTEM AM_INIT_AUTOMAKE(firewalk, $FIREWALK_VERSION) AM_CONFIG_HEADER(include/config.h) AC_SUBST(FIREWALK_VERSION) AC_PREFIX_DEFAULT(/usr/local) dnl dnl Use these compiler flags unless overridden at the command line. dnl dnl dnl Check for typedefs, structures, and compiler characteristics dnl AC_PROG_CC AC_PROG_GCC_TRADITIONAL if test "$GCC" = yes ; then CFLAGS="$CFLAGS -Wall" fi dnl dnl Checks for libraries. dnl AC_CHECK_LIB(net, libnet_build_ipv4, , AC_MSG_ERROR(We need libnet 1.1.0 or better. http://www.packetfactory.net)) AC_CHECK_LIB(pcap, pcap_open_live, , AC_MSG_ERROR(No libpcap? http://www.tcpdump.org.)) AC_CHECK_LIB(dnet, arp_get, , AC_MSG_ERROR(No libdnet? http://libdnet.sourceforge.net.)) dnl dnl Checks for header files. dnl AC_HEADER_STDC dnl dnl Checks for typedefs, structures, and compiler characteristics. dnl AC_C_CONST dnl dnl Checks for library functions. dnl AC_CHECK_FUNCS(strerror) AC_MSG_CHECKING(for bpf) if test -r /dev/bpf0 ; then AC_DEFINE(HAVE_BPF) AC_MSG_RESULT(yes) elif test -c /dev/bpf0 ; then # check again in case not readable AC_DEFINE(HAVE_BPF) AC_MSG_RESULT(yes) else AC_MSG_RESULT(no) fi dnl dnl Sets OS specific CPP directives. dnl case "$target_os" in *solaris*) AC_DEFINE(HAVE_SOLARIS) AC_CHECK_LIB(socket, socket, , AC_MSG_ERROR(libsocket not found.)) AC_CHECK_LIB(nsl, gethostbyname, , AC_MSG_ERROR(libnsl not found.)) AC_SUBST(ADDITIONAL_LIBS) ADDITIONAL_LIBS='-lsocket -lnsl' ;; esac AC_OUTPUT(Makefile src/Makefile version.h) dnl EOF Firewalk/install-sh010075500017500001750000000127210746625106200137600ustar00routeroute#! /bin/sh # # install - install a program, script, or datafile # This comes from X11R5 (mit/util/scripts/install.sh). # # Copyright 1991 by the Massachusetts Institute of Technology # # Permission to use, copy, modify, distribute, and sell this software and its # documentation for any purpose is hereby granted without fee, provided that # the above copyright notice appear in all copies and that both that # copyright notice and this permission notice appear in supporting # documentation, and that the name of M.I.T. not be used in advertising or # publicity pertaining to distribution of the software without specific, # written prior permission. M.I.T. makes no representations about the # suitability of this software for any purpose. It is provided "as is" # without express or implied warranty. # # Calling this script install-sh is preferred over install.sh, to prevent # `make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. It can only install one file at a time, a restriction # shared with many OS's install programs. # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit="${DOITPROG-}" # put in absolute paths if you don't have them in your path; or use env. vars. mvprog="${MVPROG-mv}" cpprog="${CPPROG-cp}" chmodprog="${CHMODPROG-chmod}" chownprog="${CHOWNPROG-chown}" chgrpprog="${CHGRPPROG-chgrp}" stripprog="${STRIPPROG-strip}" rmprog="${RMPROG-rm}" mkdirprog="${MKDIRPROG-mkdir}" transformbasename="" transform_arg="" instcmd="$cpprog" 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 Firewalk/missing010075500017500001750000000212310746625106200133470ustar00routeroute#! /bin/sh # Common stub for a few missing GNU programs while installing. # Copyright 1996, 1997, 1999, 2000 Free Software Foundation, Inc. # Originally by Fran,cois Pinard , 1996. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. if test $# -eq 0; then echo 1>&2 "Try \`$0 --help' for more information" exit 1 fi run=: # In the cases where this matters, `missing' is being run in the # srcdir already. if test -f configure.ac; then configure_ac=configure.ac else configure_ac=configure.in fi case "$1" in --run) # Try to run requested program, and just exit if it succeeds. run= shift "$@" && exit 0 ;; esac # If it does not exist, or fails to run (possibly an outdated version), # try to emulate it. case "$1" in -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an error status if there is no known handling for PROGRAM. Options: -h, --help display this help and exit -v, --version output version information and exit --run try to run the given command, and emulate it if it fails Supported PROGRAM values: aclocal touch file \`aclocal.m4' autoconf touch file \`configure' autoheader touch file \`config.h.in' automake touch all \`Makefile.in' files bison create \`y.tab.[ch]', if possible, from existing .[ch] flex create \`lex.yy.c', if possible, from existing .c help2man touch the output file lex create \`lex.yy.c', if possible, from existing .c makeinfo touch the output file tar try tar, gnutar, gtar, then tar without non-portable flags yacc create \`y.tab.[ch]', if possible, from existing .[ch]" ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) echo "missing 0.3 - GNU automake" ;; -*) echo 1>&2 "$0: Unknown \`$1' option" echo 1>&2 "Try \`$0 --help' for more information" exit 1 ;; aclocal) echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified \`acinclude.m4' or \`${configure_ac}'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." touch aclocal.m4 ;; autoconf) echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified \`${configure_ac}'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." touch configure ;; autoheader) echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified \`acconfig.h' or \`${configure_ac}'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` test -z "$files" && files="config.h" touch_files= for f in $files; do case "$f" in *:*) touch_files="$touch_files "`echo "$f" | sed -e 's/^[^:]*://' -e 's/:.*//'`;; *) touch_files="$touch_files $f.in";; esac done touch $touch_files ;; automake) echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." find . -type f -name Makefile.am -print | sed 's/\.am$/.in/' | while read f; do touch "$f"; done ;; bison|yacc) echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified a \`.y' file. You may need the \`Bison' package in order for those modifications to take effect. You can get \`Bison' from any GNU archive site." rm -f y.tab.c y.tab.h if [ $# -ne 1 ]; then eval LASTARG="\${$#}" case "$LASTARG" in *.y) SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` if [ -f "$SRCFILE" ]; then cp "$SRCFILE" y.tab.c fi SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` if [ -f "$SRCFILE" ]; then cp "$SRCFILE" y.tab.h fi ;; esac fi if [ ! -f y.tab.h ]; then echo >y.tab.h fi if [ ! -f y.tab.c ]; then echo 'main() { return 0; }' >y.tab.c fi ;; lex|flex) echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified a \`.l' file. You may need the \`Flex' package in order for those modifications to take effect. You can get \`Flex' from any GNU archive site." rm -f lex.yy.c if [ $# -ne 1 ]; then eval LASTARG="\${$#}" case "$LASTARG" in *.l) SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` if [ -f "$SRCFILE" ]; then cp "$SRCFILE" lex.yy.c fi ;; esac fi if [ ! -f lex.yy.c ]; then echo 'main() { return 0; }' >lex.yy.c fi ;; help2man) echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified a dependency of a manual page. You may need the \`Help2man' package in order for those modifications to take effect. You can get \`Help2man' from any GNU archive site." file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` if test -z "$file"; then file=`echo "$*" | sed -n 's/.*--output=\([^ ]*\).*/\1/p'` fi if [ -f "$file" ]; then touch $file else test -z "$file" || exec >$file echo ".ab help2man is required to generate this page" exit 1 fi ;; makeinfo) if test -z "$run" && (makeinfo --version) > /dev/null 2>&1; then # We have makeinfo, but it failed. exit 1 fi echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified a \`.texi' or \`.texinfo' file, or any other file indirectly affecting the aspect of the manual. The spurious call might also be the consequence of using a buggy \`make' (AIX, DU, IRIX). You might want to install the \`Texinfo' package or the \`GNU make' package. Grab either from any GNU archive site." file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` if test -z "$file"; then file=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $file` fi touch $file ;; tar) shift if test -n "$run"; then echo 1>&2 "ERROR: \`tar' requires --run" exit 1 fi # We have already tried tar in the generic part. # Look for gnutar/gtar before invocation to avoid ugly error # messages. if (gnutar --version > /dev/null 2>&1); then gnutar ${1+"$@"} && exit 0 fi if (gtar --version > /dev/null 2>&1); then gtar ${1+"$@"} && exit 0 fi firstarg="$1" if shift; then case "$firstarg" in *o*) firstarg=`echo "$firstarg" | sed s/o//` tar "$firstarg" ${1+"$@"} && exit 0 ;; esac case "$firstarg" in *h*) firstarg=`echo "$firstarg" | sed s/h//` tar "$firstarg" ${1+"$@"} && exit 0 ;; esac fi echo 1>&2 "\ WARNING: I can't seem to be able to run \`tar' with the given arguments. You may want to install GNU tar or Free paxutils, or check the command line arguments." exit 1 ;; *) echo 1>&2 "\ WARNING: \`$1' is needed, and you do not seem to have it handy on your system. You might have modified some files without having the proper tools for further handling them. Check the \`README' file, it often tells you about the needed prerequirements for installing this package. You may also peek at any GNU archive site, in case some other package would contain this missing \`$1' program." exit 1 ;; esac exit 0 Firewalk/mkinstalldirs010075500017500001750000000013270746625106200145620ustar00routeroute#! /bin/sh # mkinstalldirs --- make directory hierarchy # Author: Noah Friedman # Created: 1993-05-16 # Public domain # $Id: mkinstalldirs,v 1.1.1.1 2002/05/08 16:28:34 route Exp $ errstatus=0 for file do set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` shift pathcomp= for d do pathcomp="$pathcomp$d" case "$pathcomp" in -* ) pathcomp=./$pathcomp ;; esac if test ! -d "$pathcomp"; then echo "mkdir $pathcomp" mkdir "$pathcomp" || lasterr=$? if test ! -d "$pathcomp"; then errstatus=$lasterr fi fi pathcomp="$pathcomp/" done done exit $errstatus # mkinstalldirs ends here Firewalk/version.h.in010064400017500001750000000002040746625106200142100ustar00routeroute/* * $Id: version.h.in,v 1.1.1.1 2002/05/08 16:28:34 route Exp $ * @configure_input@ */ #define VERSION "@FIREWALK_VERSION@" Firewalk/aclocal.m4010064400017500001750000000104750747013042400136110ustar00routeroutednl aclocal.m4 generated automatically by aclocal 1.4-p5 dnl Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc. dnl This file 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([AC_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", [Name of package]) AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])) 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])]) # # 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([,]))]) Firewalk/BUGS010064400017500001750000000013240746625106200124340ustar00routeroute=============================================================================== $Id: BUGS,v 1.1.1.1 2002/05/08 16:28:34 route Exp $ FIREWALK 5.0 (c) 1998 - 2002 Mike D. Schiffman http://www.packetfactory.net/firewalk =============================================================================== 5.0 BUG LIST - When doing a UDP scan if the target is adjacent to the metric we will get all sorts of unpredictable results. This is because the packet is reaching the metric host with a TTL of 0, which apparently not all routers and Internet hosts handle the same. Firewalk will alert you to this with the "A!" mnemonic. EOF Firewalk/Makefile.am010064400017500001750000000002300746701252400137770ustar00routeroute## $Id: Makefile.am,v 1.1.1.1 2002/05/08 16:28:34 route Exp $ include $(top_srcdir)/Makefile.am.common SUBDIRS = src EXTRA_DIST = Makefile.am.common Firewalk/Makefile.am.common010064400017500001750000000004050746660715100152770ustar00routeroute# $Id: Makefile.am.common,v 1.2 2002/05/10 00:03:53 route Exp $ # # Firewalk automake information file # Copyright (c) 1998 - 2002 Mike D. Schiffman # All rights reserved. # AUTOMAKE_OPTIONS = foreign no-dependencies DISTCLEANFILES = *~ Firewalk/Makefile.in010064400017500001750000000262560747031664500140350ustar00routeroute# Makefile.in generated automatically by automake 1.4-p5 from Makefile.am # Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. # $Id: Makefile.in,v 1.5 2002/05/14 23:28:37 route Exp $ # # Firewalk automake information file # Copyright (c) 1998 - 2002 Mike D. Schiffman # All rights reserved. # SHELL = @SHELL@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ bindir = @bindir@ sbindir = @sbindir@ libexecdir = @libexecdir@ datadir = @datadir@ sysconfdir = @sysconfdir@ sharedstatedir = @sharedstatedir@ localstatedir = @localstatedir@ libdir = @libdir@ infodir = @infodir@ mandir = @mandir@ includedir = @includedir@ oldincludedir = /usr/include DESTDIR = pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = . ACLOCAL = @ACLOCAL@ AUTOCONF = @AUTOCONF@ AUTOMAKE = @AUTOMAKE@ AUTOHEADER = @AUTOHEADER@ INSTALL = @INSTALL@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS) INSTALL_DATA = @INSTALL_DATA@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ transform = @program_transform_name@ NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_alias = @build_alias@ build_triplet = @build@ host_alias = @host_alias@ host_triplet = @host@ target_alias = @target_alias@ target_triplet = @target@ ADDITIONAL_LIBS = @ADDITIONAL_LIBS@ CC = @CC@ FIREWALK_VERSION = @FIREWALK_VERSION@ MAKEINFO = @MAKEINFO@ PACKAGE = @PACKAGE@ VERSION = @VERSION@ AUTOMAKE_OPTIONS = foreign no-dependencies DISTCLEANFILES = *~ SUBDIRS = src EXTRA_DIST = Makefile.am.common ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = ./include/config.h CONFIG_CLEAN_FILES = version.h DIST_COMMON = README Makefile.am Makefile.in TODO acconfig.h aclocal.m4 \ config.guess config.sub configure configure.in include/config.h.in \ include/stamp-h.in install-sh missing mkinstalldirs version.h.in DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) TAR = tar GZIP_ENV = --best all: all-redirect .SUFFIXES: $(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) $(top_srcdir)/Makefile.am.common cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status cd $(top_builddir) \ && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status $(ACLOCAL_M4): configure.in cd $(srcdir) && $(ACLOCAL) config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck $(srcdir)/configure: $(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES) cd $(srcdir) && $(AUTOCONF) include/config.h: include/stamp-h @if test ! -f $@; then \ rm -f include/stamp-h; \ $(MAKE) include/stamp-h; \ else :; fi include/stamp-h: $(srcdir)/include/config.h.in $(top_builddir)/config.status cd $(top_builddir) \ && CONFIG_FILES= CONFIG_HEADERS=include/config.h \ $(SHELL) ./config.status @echo timestamp > include/stamp-h 2> /dev/null $(srcdir)/include/config.h.in: $(srcdir)/include/stamp-h.in @if test ! -f $@; then \ rm -f $(srcdir)/include/stamp-h.in; \ $(MAKE) $(srcdir)/include/stamp-h.in; \ else :; fi $(srcdir)/include/stamp-h.in: $(top_srcdir)/configure.in $(ACLOCAL_M4) acconfig.h cd $(top_srcdir) && $(AUTOHEADER) @echo timestamp > $(srcdir)/include/stamp-h.in 2> /dev/null mostlyclean-hdr: clean-hdr: distclean-hdr: -rm -f include/config.h maintainer-clean-hdr: version.h: $(top_builddir)/config.status version.h.in cd $(top_builddir) && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. # To change the values of `make' variables: instead of editing Makefiles, # (1) if the variable is set in `config.status', edit `config.status' # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. @SET_MAKE@ all-recursive install-data-recursive install-exec-recursive \ installdirs-recursive install-recursive uninstall-recursive \ check-recursive installcheck-recursive info-recursive dvi-recursive: @set fnord $(MAKEFLAGS); amf=$$2; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" mostlyclean-recursive clean-recursive distclean-recursive \ maintainer-clean-recursive: @set fnord $(MAKEFLAGS); amf=$$2; \ dot_seen=no; \ rev=''; list='$(SUBDIRS)'; for subdir in $$list; do \ rev="$$subdir $$rev"; \ test "$$subdir" != "." || dot_seen=yes; \ true; \ done; \ test "$$dot_seen" = "no" && rev=". $$rev"; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done tags: TAGS ID: $(HEADERS) $(SOURCES) $(LISP) list='$(SOURCES) $(HEADERS)'; \ unique=`for i in $$list; do echo $$i; done | \ awk ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ here=`pwd` && cd $(srcdir) \ && mkid -f$$here/ID $$unique $(LISP) TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP) tags=; \ here=`pwd`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS)'; \ unique=`for i in $$list; do echo $$i; done | \ awk ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \ || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS) mostlyclean-tags: clean-tags: distclean-tags: -rm -f TAGS ID maintainer-clean-tags: distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another # tarfile. distcheck: dist -rm -rf $(distdir) GZIP=$(GZIP_ENV) $(TAR) zxf $(distdir).tar.gz mkdir $(distdir)/=build mkdir $(distdir)/=inst dc_install_base=`cd $(distdir)/=inst && pwd`; \ cd $(distdir)/=build \ && ../configure --srcdir=.. --prefix=$$dc_install_base \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ && $(MAKE) $(AM_MAKEFLAGS) dist -rm -rf $(distdir) @banner="$(distdir).tar.gz is ready for distribution"; \ dashes=`echo "$$banner" | sed s/./=/g`; \ echo "$$dashes"; \ echo "$$banner"; \ echo "$$dashes" dist: distdir -chmod -R a+r $(distdir) GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir) -rm -rf $(distdir) dist-all: distdir -chmod -R a+r $(distdir) GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir) -rm -rf $(distdir) distdir: $(DISTFILES) -rm -rf $(distdir) mkdir $(distdir) -chmod 777 $(distdir) @for file in $(DISTFILES); do \ d=$(srcdir); \ if test -d $$d/$$file; then \ cp -pr $$d/$$file $(distdir)/$$file; \ else \ test -f $(distdir)/$$file \ || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ || cp -p $$d/$$file $(distdir)/$$file || :; \ fi; \ done for subdir in $(SUBDIRS); do \ if test "$$subdir" = .; then :; else \ test -d $(distdir)/$$subdir \ || mkdir $(distdir)/$$subdir \ || exit 1; \ chmod 777 $(distdir)/$$subdir; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir=../$(distdir) distdir=../$(distdir)/$$subdir distdir) \ || exit 1; \ fi; \ done info-am: info: info-recursive dvi-am: dvi: dvi-recursive check-am: all-am check: check-recursive installcheck-am: installcheck: installcheck-recursive install-exec-am: install-exec: install-exec-recursive install-data-am: install-data: install-data-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am install: install-recursive uninstall-am: uninstall: uninstall-recursive all-am: Makefile all-redirect: all-recursive install-strip: $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install installdirs: installdirs-recursive installdirs-am: mostlyclean-generic: clean-generic: distclean-generic: -rm -f Makefile $(CONFIG_CLEAN_FILES) -rm -f config.cache config.log stamp-h stamp-h[0-9]* -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) maintainer-clean-generic: mostlyclean-am: mostlyclean-hdr mostlyclean-tags mostlyclean-generic mostlyclean: mostlyclean-recursive clean-am: clean-hdr clean-tags clean-generic mostlyclean-am clean: clean-recursive distclean-am: distclean-hdr distclean-tags distclean-generic clean-am distclean: distclean-recursive -rm -f config.status maintainer-clean-am: maintainer-clean-hdr maintainer-clean-tags \ maintainer-clean-generic distclean-am @echo "This command is intended for maintainers to use;" @echo "it deletes files that may require special tools to rebuild." maintainer-clean: maintainer-clean-recursive -rm -f config.status .PHONY: mostlyclean-hdr distclean-hdr clean-hdr maintainer-clean-hdr \ install-data-recursive uninstall-data-recursive install-exec-recursive \ uninstall-exec-recursive installdirs-recursive uninstalldirs-recursive \ all-recursive check-recursive installcheck-recursive info-recursive \ dvi-recursive mostlyclean-recursive distclean-recursive clean-recursive \ maintainer-clean-recursive tags tags-recursive mostlyclean-tags \ distclean-tags clean-tags maintainer-clean-tags distdir info-am info \ dvi-am dvi check check-am installcheck-am installcheck install-exec-am \ install-exec install-data-am install-data install-am install \ uninstall-am uninstall all-redirect all-am all installdirs-am \ installdirs mostlyclean-generic distclean-generic clean-generic \ maintainer-clean-generic clean mostlyclean distclean maintainer-clean # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: Firewalk/README010064400017500001750000000021170755464117700126420ustar00routeroute=============================================================================== $Id: README,v 1.2 2002/05/14 23:28:37 route Exp $ FIREWALK 5.0 (c) 1998 - 2002 Mike D. Schiffman http://www.packetfactory.net/firewalk =============================================================================== 5.0 README Firewalk is now fully and completely documented both in theory, practice and line by line of code in my book: "Building Open Source Network Security Tools" published by Wiley. You may pick it up here: http://www.amazon.com/exec/obidos/tg/detail/-/0471205443/qid=1035158109/sr=8-1/ref=sr_8_1/102-4873217-0082545?v=glance&n=507846 More information here: http://www.wiley.com/cda/product/0,,0471205443,00.html Installation: ------------- You'll need: - a recent libpcap release (http://www.tcpdump.org) - libnet 1.1.0 or better (http://www.packetfactory.net/libnet) Build and install these. 0. nroff -man man/firewalk.8 | less 1. ./configure && make && make install EOF Firewalk/TODO010064400017500001750000000007530746625106200124460ustar00routeroute=============================================================================== $Id: TODO,v 1.1.1.1 2002/05/08 16:28:34 route Exp $ FIREWALK 5.0 (c) 1998 - 2002 Mike D. Schiffman http://www.packetfactory.net/firewalk =============================================================================== TODO LIST - Parallel scanning operations - Flexible and robust reporting - Firewall and host fingerprinting EOF