--- pads-1.2.orig/Makefile.am +++ pads-1.2/Makefile.am @@ -1,4 +1,4 @@ -## $Id: Makefile.am,v 1.1 2005/02/10 05:53:42 mattshelton Exp $ +## $Id: Makefile.am,v 1.2 2005/11/02 23:56:12 jfs Exp $ AUTOMAKE_OPTIONS=foreign no-dependencies SUBDIRS = doc etc lib src EXTRA_DIST = COPYING --- pads-1.2.orig/config.guess +++ pads-1.2/config.guess @@ -1,9 +1,10 @@ #! /bin/sh # Attempt to guess a canonical system name. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. +# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 +# Free Software Foundation, Inc. -timestamp='2004-09-07' +timestamp='2009-12-30' # 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 @@ -17,23 +18,25 @@ # # 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. +# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA +# 02110-1301, 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. -# Originally written by Per Bothner . -# Please send patches to . Submit a context -# diff and a properly formatted ChangeLog entry. + +# Originally written by Per Bothner. Please send patches (context +# diff format) to and include a ChangeLog +# entry. # # 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 build system type. +# You can get the latest version of this script from: +# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD me=`echo "$0" | sed -e 's,.*/,,'` @@ -53,8 +56,9 @@ GNU config.guess ($timestamp) Originally written by Per Bothner. -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 -Free Software Foundation, Inc. +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, +2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free +Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -66,11 +70,11 @@ while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) - echo "$timestamp" ; exit 0 ;; + echo "$timestamp" ; exit ;; --version | -v ) - echo "$version" ; exit 0 ;; + echo "$version" ; exit ;; --help | --h* | -h ) - echo "$usage"; exit 0 ;; + echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. @@ -104,7 +108,7 @@ trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; : ${TMPDIR=/tmp} ; - { tmp=`(umask 077 && mktemp -d -q "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || + { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; @@ -123,7 +127,7 @@ ;; ,,*) CC_FOR_BUILD=$CC ;; ,*,*) CC_FOR_BUILD=$HOST_CC ;; -esac ;' +esac ; set_cc_for_build= ;' # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 1994-08-24) @@ -158,6 +162,7 @@ arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; + sh5el) machine=sh5le-unknown ;; *) machine=${UNAME_MACHINE_ARCH}-unknown ;; esac # The Operating System including object format, if it has switched @@ -166,7 +171,7 @@ arm*|i386|m68k|ns32k|sh3*|sparc|vax) eval $set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ - | grep __ELF__ >/dev/null + | grep -q __ELF__ then # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). # Return netbsd for either. FIX? @@ -196,55 +201,23 @@ # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. echo "${machine}-${os}${release}" - exit 0 ;; - amd64:OpenBSD:*:*) - echo x86_64-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - amiga:OpenBSD:*:*) - echo m68k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - cats:OpenBSD:*:*) - echo arm-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - hp300:OpenBSD:*:*) - echo m68k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - luna88k:OpenBSD:*:*) - echo m88k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - mac68k:OpenBSD:*:*) - echo m68k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - macppc:OpenBSD:*:*) - echo powerpc-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - mvme68k:OpenBSD:*:*) - echo m68k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - mvme88k:OpenBSD:*:*) - echo m88k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - mvmeppc:OpenBSD:*:*) - echo powerpc-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - sgi:OpenBSD:*:*) - echo mips64-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - sun3:OpenBSD:*:*) - echo m68k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; + exit ;; *:OpenBSD:*:*) - echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; + UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` + echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} + exit ;; *:ekkoBSD:*:*) echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} - exit 0 ;; + exit ;; + *:SolidBSD:*:*) + echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} + exit ;; macppc:MirBSD:*:*) - echo powerppc-unknown-mirbsd${UNAME_RELEASE} - exit 0 ;; + echo powerpc-unknown-mirbsd${UNAME_RELEASE} + exit ;; *:MirBSD:*:*) echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} - exit 0 ;; + exit ;; alpha:OSF1:*:*) case $UNAME_RELEASE in *4.0) @@ -297,37 +270,43 @@ # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - exit 0 ;; + exit ;; Alpha\ *:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # Should we change UNAME_MACHINE based on the output of uname instead # of the specific Alpha model? echo alpha-pc-interix - exit 0 ;; + exit ;; 21064:Windows_NT:50:3) echo alpha-dec-winnt3.5 - exit 0 ;; + exit ;; Amiga*:UNIX_System_V:4.0:*) echo m68k-unknown-sysv4 - exit 0;; + exit ;; *:[Aa]miga[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-amigaos - exit 0 ;; + exit ;; *:[Mm]orph[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-morphos - exit 0 ;; + exit ;; *:OS/390:*:*) echo i370-ibm-openedition - exit 0 ;; + exit ;; + *:z/VM:*:*) + echo s390-ibm-zvmoe + exit ;; *:OS400:*:*) echo powerpc-ibm-os400 - exit 0 ;; + exit ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} - exit 0;; + exit ;; + arm:riscos:*:*|arm:RISCOS:*:*) + echo arm-unknown-riscos + exit ;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) echo hppa1.1-hitachi-hiuxmpp - exit 0;; + exit ;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. if test "`(/bin/universe) 2>/dev/null`" = att ; then @@ -335,32 +314,51 @@ else echo pyramid-pyramid-bsd fi - exit 0 ;; + exit ;; NILE*:*:*:dcosx) echo pyramid-pyramid-svr4 - exit 0 ;; + exit ;; DRS?6000:unix:4.0:6*) echo sparc-icl-nx6 - exit 0 ;; - DRS?6000:UNIX_SV:4.2*:7*) + exit ;; + DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) case `/usr/bin/uname -p` in - sparc) echo sparc-icl-nx7 && exit 0 ;; + sparc) echo sparc-icl-nx7; exit ;; esac ;; + s390x:SunOS:*:*) + echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; sun4H:SunOS:5.*:*) echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit 0 ;; + exit ;; 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 ;; + exit ;; + i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) + echo i386-pc-auroraux${UNAME_RELEASE} + exit ;; + i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) + eval $set_cc_for_build + SUN_ARCH="i386" + # If there is a compiler, see if it is configured for 64-bit objects. + # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. + # This test works for both compilers. + if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then + if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ + (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_64BIT_ARCH >/dev/null + then + SUN_ARCH="x86_64" + fi + fi + echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; 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 ;; + exit ;; sun4*:SunOS:*:*) case "`/usr/bin/arch -k`" in Series*|S4*) @@ -369,10 +367,10 @@ 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 ;; + exit ;; sun3*:SunOS:*:*) echo m68k-sun-sunos${UNAME_RELEASE} - exit 0 ;; + exit ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 @@ -384,10 +382,10 @@ echo sparc-sun-sunos${UNAME_RELEASE} ;; esac - exit 0 ;; + exit ;; aushp:SunOS:*:*) echo sparc-auspex-sunos${UNAME_RELEASE} - exit 0 ;; + exit ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not # "atarist" or "atariste" at least should have a processor @@ -398,40 +396,40 @@ # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} - exit 0 ;; + exit ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} - exit 0 ;; + exit ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} - exit 0 ;; + exit ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) echo m68k-milan-mint${UNAME_RELEASE} - exit 0 ;; + exit ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) echo m68k-hades-mint${UNAME_RELEASE} - exit 0 ;; + exit ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) echo m68k-unknown-mint${UNAME_RELEASE} - exit 0 ;; + exit ;; m68k:machten:*:*) echo m68k-apple-machten${UNAME_RELEASE} - exit 0 ;; + exit ;; powerpc:machten:*:*) echo powerpc-apple-machten${UNAME_RELEASE} - exit 0 ;; + exit ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 - exit 0 ;; + exit ;; RISC*:ULTRIX:*:*) echo mips-dec-ultrix${UNAME_RELEASE} - exit 0 ;; + exit ;; VAX*:ULTRIX*:*:*) echo vax-dec-ultrix${UNAME_RELEASE} - exit 0 ;; + exit ;; 2020:CLIX:*:* | 2430:CLIX:*:*) echo clipper-intergraph-clix${UNAME_RELEASE} - exit 0 ;; + exit ;; mips:*:*:UMIPS | mips:*:*:RISCos) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c @@ -455,32 +453,33 @@ exit (-1); } EOF - $CC_FOR_BUILD -o $dummy $dummy.c \ - && $dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \ - && exit 0 + $CC_FOR_BUILD -o $dummy $dummy.c && + dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && + SYSTEM_NAME=`$dummy $dummyarg` && + { echo "$SYSTEM_NAME"; exit; } echo mips-mips-riscos${UNAME_RELEASE} - exit 0 ;; + exit ;; Motorola:PowerMAX_OS:*:*) echo powerpc-motorola-powermax - exit 0 ;; + exit ;; Motorola:*:4.3:PL8-*) echo powerpc-harris-powermax - exit 0 ;; + exit ;; Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) echo powerpc-harris-powermax - exit 0 ;; + exit ;; Night_Hawk:Power_UNIX:*:*) echo powerpc-harris-powerunix - exit 0 ;; + exit ;; m88k:CX/UX:7*:*) echo m88k-harris-cxux7 - exit 0 ;; + exit ;; m88k:*:4*:R4*) echo m88k-motorola-sysv4 - exit 0 ;; + exit ;; m88k:*:3*:R3*) echo m88k-motorola-sysv3 - exit 0 ;; + exit ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` @@ -496,29 +495,29 @@ else echo i586-dg-dgux${UNAME_RELEASE} fi - exit 0 ;; + exit ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) echo m88k-dolphin-sysv3 - exit 0 ;; + exit ;; M88*:*:R3*:*) # Delta 88k system running SVR3 echo m88k-motorola-sysv3 - exit 0 ;; + exit ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) echo m88k-tektronix-sysv3 - exit 0 ;; + exit ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) echo m68k-tektronix-bsd - exit 0 ;; + exit ;; *:IRIX*:*:*) echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` - exit 0 ;; + exit ;; ????????: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 ' + echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id + exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) echo i386-ibm-aix - exit 0 ;; + exit ;; ia64:AIX:*:*) if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` @@ -526,7 +525,7 @@ IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} - exit 0 ;; + exit ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then eval $set_cc_for_build @@ -541,15 +540,19 @@ exit(0); } EOF - $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0 - echo rs6000-ibm-aix3.2.5 + if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` + then + echo "$SYSTEM_NAME" + else + echo rs6000-ibm-aix3.2.5 + fi 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:*:[45]) + exit ;; + *:AIX:*:[456]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 @@ -562,28 +565,28 @@ IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${IBM_ARCH}-ibm-aix${IBM_REV} - exit 0 ;; + exit ;; *:AIX:*:*) echo rs6000-ibm-aix - exit 0 ;; + exit ;; ibmrt:4.4BSD:*|romp-ibm:BSD:*) echo romp-ibm-bsd4.4 - exit 0 ;; + exit ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to - exit 0 ;; # report: romp-ibm BSD 4.3 + exit ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) echo rs6000-bull-bosx - exit 0 ;; + exit ;; DPX/2?00:B.O.S.:*:*) echo m68k-bull-sysv3 - exit 0 ;; + exit ;; 9000/[34]??:4.3bsd:1.*:*) echo m68k-hp-bsd - exit 0 ;; + exit ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) echo m68k-hp-bsd4.4 - exit 0 ;; + exit ;; 9000/[34678]??:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` case "${UNAME_MACHINE}" in @@ -645,9 +648,19 @@ esac if [ ${HP_ARCH} = "hppa2.0w" ] then - # avoid double evaluation of $set_cc_for_build - test -n "$CC_FOR_BUILD" || eval $set_cc_for_build - if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E -) | grep __LP64__ >/dev/null + eval $set_cc_for_build + + # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating + # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler + # generating 64-bit code. GNU and HP use different nomenclature: + # + # $ CC_FOR_BUILD=cc ./config.guess + # => hppa2.0w-hp-hpux11.23 + # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess + # => hppa64-hp-hpux11.23 + + if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | + grep -q __LP64__ then HP_ARCH="hppa2.0w" else @@ -655,11 +668,11 @@ fi fi echo ${HP_ARCH}-hp-hpux${HPUX_REV} - exit 0 ;; + exit ;; ia64:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` echo ia64-hp-hpux${HPUX_REV} - exit 0 ;; + exit ;; 3050*:HI-UX:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c @@ -687,216 +700,248 @@ exit (0); } EOF - $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0 + $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && + { echo "$SYSTEM_NAME"; exit; } echo unknown-hitachi-hiuxwe2 - exit 0 ;; + exit ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) echo hppa1.1-hp-bsd - exit 0 ;; + exit ;; 9000/8??:4.3bsd:*:*) echo hppa1.0-hp-bsd - exit 0 ;; + exit ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) echo hppa1.0-hp-mpeix - exit 0 ;; + exit ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) echo hppa1.1-hp-osf - exit 0 ;; + exit ;; hp8??:OSF1:*:*) echo hppa1.0-hp-osf - exit 0 ;; + exit ;; i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then echo ${UNAME_MACHINE}-unknown-osf1mk else echo ${UNAME_MACHINE}-unknown-osf1 fi - exit 0 ;; + exit ;; parisc*:Lites*:*:*) echo hppa1.1-hp-lites - exit 0 ;; + exit ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd - exit 0 ;; + exit ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi - exit 0 ;; + exit ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) echo c34-convex-bsd - exit 0 ;; + exit ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) echo c38-convex-bsd - exit 0 ;; + exit ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd - exit 0 ;; + exit ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit 0 ;; + exit ;; CRAY*[A-Z]90:*:*:*) echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ -e 's/\.[^.]*$/.X/' - exit 0 ;; + exit ;; CRAY*TS:*:*:*) echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit 0 ;; + exit ;; CRAY*T3E:*:*:*) echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit 0 ;; + exit ;; CRAY*SV1:*:*:*) echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit 0 ;; + exit ;; *:UNICOS/mp:*:*) echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit 0 ;; + exit ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" - exit 0 ;; + exit ;; 5000:UNIX_System_V:4.*:*) FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" - exit 0 ;; + exit ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} - exit 0 ;; + exit ;; sparc*:BSD/OS:*:*) echo sparc-unknown-bsdi${UNAME_RELEASE} - exit 0 ;; + exit ;; *:BSD/OS:*:*) echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} - exit 0 ;; + exit ;; *:FreeBSD:*:*) - echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` - exit 0 ;; + case ${UNAME_MACHINE} in + pc98) + echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + amd64) + echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + *) + echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + esac + exit ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin - exit 0 ;; - i*:MINGW*:*) + exit ;; + *:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 - exit 0 ;; + exit ;; + i*:windows32*:*) + # uname -m includes "-pc" on this system. + echo ${UNAME_MACHINE}-mingw32 + exit ;; i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 - exit 0 ;; - x86:Interix*:[34]*) - echo i586-pc-interix${UNAME_RELEASE}|sed -e 's/\..*//' - exit 0 ;; + exit ;; + *:Interix*:*) + case ${UNAME_MACHINE} in + x86) + echo i586-pc-interix${UNAME_RELEASE} + exit ;; + authenticamd | genuineintel | EM64T) + echo x86_64-unknown-interix${UNAME_RELEASE} + exit ;; + IA64) + echo ia64-unknown-interix${UNAME_RELEASE} + exit ;; + esac ;; [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) echo i${UNAME_MACHINE}-pc-mks - exit 0 ;; + exit ;; + 8664:Windows_NT:*) + echo x86_64-pc-mks + exit ;; i*:Windows_NT*:* | Pentium*:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we # UNAME_MACHINE based on the output of uname instead of i386? echo i586-pc-interix - exit 0 ;; + exit ;; i*:UWIN*:*) echo ${UNAME_MACHINE}-pc-uwin - exit 0 ;; + exit ;; + amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) + echo x86_64-unknown-cygwin + exit ;; p*:CYGWIN*:*) echo powerpcle-unknown-cygwin - exit 0 ;; + exit ;; prep*:SunOS:5.*:*) echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit 0 ;; + exit ;; *:GNU:*:*) # the GNU system echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` - exit 0 ;; + exit ;; *:GNU/*:*:*) # other systems with GNU libc and userland echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu - exit 0 ;; + exit ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix - exit 0 ;; + exit ;; + alpha:Linux:*:*) + case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in + EV5) UNAME_MACHINE=alphaev5 ;; + EV56) UNAME_MACHINE=alphaev56 ;; + PCA56) UNAME_MACHINE=alphapca56 ;; + PCA57) UNAME_MACHINE=alphapca56 ;; + EV6) UNAME_MACHINE=alphaev6 ;; + EV67) UNAME_MACHINE=alphaev67 ;; + EV68*) UNAME_MACHINE=alphaev68 ;; + esac + objdump --private-headers /bin/sh | grep -q ld.so.1 + if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi + echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} + exit ;; arm*:Linux:*:*) + eval $set_cc_for_build + if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ARM_EABI__ + then + echo ${UNAME_MACHINE}-unknown-linux-gnu + else + echo ${UNAME_MACHINE}-unknown-linux-gnueabi + fi + exit ;; + avr32*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu - exit 0 ;; + exit ;; cris:Linux:*:*) echo cris-axis-linux-gnu - exit 0 ;; + exit ;; crisv32:Linux:*:*) echo crisv32-axis-linux-gnu - exit 0 ;; + exit ;; frv:Linux:*:*) echo frv-unknown-linux-gnu - exit 0 ;; + exit ;; + i*86:Linux:*:*) + LIBC=gnu + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #ifdef __dietlibc__ + LIBC=dietlibc + #endif +EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'` + echo "${UNAME_MACHINE}-pc-linux-${LIBC}" + exit ;; ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu - exit 0 ;; + exit ;; m32r*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu - exit 0 ;; + exit ;; m68*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu - exit 0 ;; - mips:Linux:*:*) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #undef CPU - #undef mips - #undef mipsel - #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) - CPU=mipsel - #else - #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) - CPU=mips - #else - CPU= - #endif - #endif -EOF - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=` - test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0 - ;; - mips64:Linux:*:*) + exit ;; + mips:Linux:*:* | mips64:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU - #undef mips64 - #undef mips64el + #undef ${UNAME_MACHINE} + #undef ${UNAME_MACHINE}el #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) - CPU=mips64el + CPU=${UNAME_MACHINE}el #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) - CPU=mips64 + CPU=${UNAME_MACHINE} #else CPU= #endif #endif EOF - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=` - test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0 + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` + test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } ;; - ppc:Linux:*:*) - echo powerpc-unknown-linux-gnu - exit 0 ;; - ppc64:Linux:*:*) - echo powerpc64-unknown-linux-gnu - exit 0 ;; - alpha:Linux:*:*) - case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in - EV5) UNAME_MACHINE=alphaev5 ;; - EV56) UNAME_MACHINE=alphaev56 ;; - PCA56) UNAME_MACHINE=alphapca56 ;; - PCA57) UNAME_MACHINE=alphapca56 ;; - EV6) UNAME_MACHINE=alphaev6 ;; - EV67) UNAME_MACHINE=alphaev67 ;; - EV68*) UNAME_MACHINE=alphaev68 ;; - esac - objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null - if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi - echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} - exit 0 ;; + or32:Linux:*:*) + echo or32-unknown-linux-gnu + exit ;; + padre:Linux:*:*) + echo sparc-unknown-linux-gnu + exit ;; + parisc64:Linux:*:* | hppa64:Linux:*:*) + echo hppa64-unknown-linux-gnu + exit ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in @@ -904,87 +949,40 @@ PA8*) echo hppa2.0-unknown-linux-gnu ;; *) echo hppa-unknown-linux-gnu ;; esac - exit 0 ;; - parisc64:Linux:*:* | hppa64:Linux:*:*) - echo hppa64-unknown-linux-gnu - exit 0 ;; + exit ;; + ppc64:Linux:*:*) + echo powerpc64-unknown-linux-gnu + exit ;; + ppc:Linux:*:*) + echo powerpc-unknown-linux-gnu + exit ;; s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux - exit 0 ;; + exit ;; sh64*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu - exit 0 ;; + exit ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu - exit 0 ;; + exit ;; sparc:Linux:*:* | sparc64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu - exit 0 ;; + exit ;; + vax:Linux:*:*) + echo ${UNAME_MACHINE}-dec-linux-gnu + exit ;; x86_64:Linux:*:*) echo x86_64-unknown-linux-gnu - exit 0 ;; - i*86:Linux:*:*) - # The BFD linker knows what the default object file format is, so - # first see if it will tell us. cd to the root directory to prevent - # problems with other programs or directories called `ld' in the path. - # Set LC_ALL=C to ensure ld outputs messages in English. - ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \ - | sed -ne '/supported targets:/!d - s/[ ][ ]*/ /g - s/.*supported targets: *// - s/ .*// - p'` - case "$ld_supported_targets" in - elf32-i386) - TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" - ;; - a.out-i386-linux) - echo "${UNAME_MACHINE}-pc-linux-gnuaout" - exit 0 ;; - coff-i386) - echo "${UNAME_MACHINE}-pc-linux-gnucoff" - exit 0 ;; - "") - # Either a pre-BFD a.out linker (linux-gnuoldld) or - # one that does not give us useful --help. - echo "${UNAME_MACHINE}-pc-linux-gnuoldld" - exit 0 ;; - esac - # Determine whether the default compiler is a.out or elf - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #include - #ifdef __ELF__ - # ifdef __GLIBC__ - # if __GLIBC__ >= 2 - LIBC=gnu - # else - LIBC=gnulibc1 - # endif - # else - LIBC=gnulibc1 - # endif - #else - #ifdef __INTEL_COMPILER - LIBC=gnu - #else - LIBC=gnuaout - #endif - #endif - #ifdef __dietlibc__ - LIBC=dietlibc - #endif -EOF - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=` - test x"${LIBC}" != x && echo "${UNAME_MACHINE}-pc-linux-${LIBC}" && exit 0 - test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0 - ;; + exit ;; + xtensa*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; i*86:DYNIX/ptx:4*:*) # 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. echo i386-sequent-sysv4 - exit 0 ;; + exit ;; i*86:UNIX_SV:4.2MP:2.*) # Unixware is an offshoot of SVR4, but it has its own version # number series starting with 2... @@ -992,27 +990,27 @@ # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} - exit 0 ;; + exit ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. echo ${UNAME_MACHINE}-pc-os2-emx - exit 0 ;; + exit ;; i*86:XTS-300:*:STOP) echo ${UNAME_MACHINE}-unknown-stop - exit 0 ;; + exit ;; i*86:atheos:*:*) echo ${UNAME_MACHINE}-unknown-atheos - exit 0 ;; - i*86:syllable:*:*) + exit ;; + i*86:syllable:*:*) echo ${UNAME_MACHINE}-pc-syllable - exit 0 ;; - i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) + exit ;; + i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) echo i386-unknown-lynxos${UNAME_RELEASE} - exit 0 ;; + exit ;; i*86:*DOS:*:*) echo ${UNAME_MACHINE}-pc-msdosdjgpp - exit 0 ;; + exit ;; i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then @@ -1020,15 +1018,16 @@ else echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} fi - exit 0 ;; - i*86:*:5:[78]*) + exit ;; + i*86:*:5:[678]*) + # UnixWare 7.x, OpenUNIX and OpenServer 6. case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} - exit 0 ;; + exit ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /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 ;; + exit ;; mini*:CTIX:SYS*5:*) # "miniframe" echo m68010-convergent-sysv - exit 0 ;; + exit ;; mc68k:UNIX:SYSTEM5:3.51m) echo m68k-convergent-sysv - exit 0 ;; + exit ;; M680?0:D-NIX:5.3:*) echo m68k-diab-dnix - exit 0 ;; + exit ;; M68*:*:R3V[5678]*:*) - test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;; + test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*: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 + && { echo i486-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ - && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;; + && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ - && echo i486-ncr-sysv4 && exit 0 ;; + && { echo i486-ncr-sysv4; exit; } ;; + NCR*:*:4.2:* | MPRAS*:*:4.2:*) + OS_REL='.3' + 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; } + /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ + && { echo i586-ncr-sysv4.3${OS_REL}; exit; } + /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ + && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) echo m68k-unknown-lynxos${UNAME_RELEASE} - exit 0 ;; + exit ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 - exit 0 ;; + exit ;; TSUNAMI:LynxOS:2.*:*) echo sparc-unknown-lynxos${UNAME_RELEASE} - exit 0 ;; + exit ;; rs6000:LynxOS:2.*:*) echo rs6000-unknown-lynxos${UNAME_RELEASE} - exit 0 ;; - PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*) + exit ;; + PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) echo powerpc-unknown-lynxos${UNAME_RELEASE} - exit 0 ;; + exit ;; SM[BE]S:UNIX_SV:*:*) echo mips-dde-sysv${UNAME_RELEASE} - exit 0 ;; + exit ;; RM*:ReliantUNIX-*:*:*) echo mips-sni-sysv4 - exit 0 ;; + exit ;; RM*:SINIX-*:*:*) echo mips-sni-sysv4 - exit 0 ;; + exit ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` @@ -1120,69 +1132,94 @@ else echo ns32k-sni-sysv fi - exit 0 ;; + exit ;; PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says echo i586-unisys-sysv4 - exit 0 ;; + exit ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm echo hppa1.1-stratus-sysv4 - exit 0 ;; + exit ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. echo i860-stratus-sysv4 - exit 0 ;; + exit ;; + i*86:VOS:*:*) + # From Paul.Green@stratus.com. + echo ${UNAME_MACHINE}-stratus-vos + exit ;; *:VOS:*:*) # From Paul.Green@stratus.com. echo hppa1.1-stratus-vos - exit 0 ;; + exit ;; mc68*:A/UX:*:*) echo m68k-apple-aux${UNAME_RELEASE} - exit 0 ;; + exit ;; news*:NEWS-OS:6*:*) echo mips-sony-newsos6 - exit 0 ;; + exit ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if [ -d /usr/nec ]; then echo mips-nec-sysv${UNAME_RELEASE} else echo mips-unknown-sysv${UNAME_RELEASE} fi - exit 0 ;; + exit ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. echo powerpc-be-beos - exit 0 ;; + exit ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. echo powerpc-apple-beos - exit 0 ;; + exit ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. echo i586-pc-beos - exit 0 ;; + exit ;; + BePC:Haiku:*:*) # Haiku running on Intel PC compatible. + echo i586-pc-haiku + exit ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux${UNAME_RELEASE} - exit 0 ;; + exit ;; SX-5:SUPER-UX:*:*) echo sx5-nec-superux${UNAME_RELEASE} - exit 0 ;; + exit ;; SX-6:SUPER-UX:*:*) echo sx6-nec-superux${UNAME_RELEASE} - exit 0 ;; + exit ;; + SX-7:SUPER-UX:*:*) + echo sx7-nec-superux${UNAME_RELEASE} + exit ;; + SX-8:SUPER-UX:*:*) + echo sx8-nec-superux${UNAME_RELEASE} + exit ;; + SX-8R:SUPER-UX:*:*) + echo sx8r-nec-superux${UNAME_RELEASE} + exit ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody${UNAME_RELEASE} - exit 0 ;; + exit ;; *:Rhapsody:*:*) echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} - exit 0 ;; + exit ;; *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown case $UNAME_PROCESSOR in - *86) UNAME_PROCESSOR=i686 ;; + i386) + eval $set_cc_for_build + if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then + if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ + (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_64BIT_ARCH >/dev/null + then + UNAME_PROCESSOR="x86_64" + fi + fi ;; unknown) UNAME_PROCESSOR=powerpc ;; esac echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} - exit 0 ;; + exit ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` if test "$UNAME_PROCESSOR" = "x86"; then @@ -1190,22 +1227,25 @@ UNAME_MACHINE=pc fi echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} - exit 0 ;; + exit ;; *:QNX:*:4*) echo i386-pc-qnx - exit 0 ;; + exit ;; + NSE-?:NONSTOP_KERNEL:*:*) + echo nse-tandem-nsk${UNAME_RELEASE} + exit ;; NSR-?:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk${UNAME_RELEASE} - exit 0 ;; + exit ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux - exit 0 ;; + exit ;; BS2000:POSIX*:*:*) echo bs2000-siemens-sysv - exit 0 ;; + exit ;; DS/*:UNIX_System_V:*:*) echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} - exit 0 ;; + exit ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 @@ -1216,38 +1256,50 @@ UNAME_MACHINE="$cputype" fi echo ${UNAME_MACHINE}-unknown-plan9 - exit 0 ;; + exit ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 - exit 0 ;; + exit ;; *:TENEX:*:*) echo pdp10-unknown-tenex - exit 0 ;; + exit ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) echo pdp10-dec-tops20 - exit 0 ;; + exit ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) echo pdp10-xkl-tops20 - exit 0 ;; + exit ;; *:TOPS-20:*:*) echo pdp10-unknown-tops20 - exit 0 ;; + exit ;; *:ITS:*:*) echo pdp10-unknown-its - exit 0 ;; + exit ;; SEI:*:*:SEIUX) echo mips-sei-seiux${UNAME_RELEASE} - exit 0 ;; + exit ;; *:DragonFly:*:*) echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` - exit 0 ;; + exit ;; *:*VMS:*:*) UNAME_MACHINE=`(uname -p) 2>/dev/null` case "${UNAME_MACHINE}" in - A*) echo alpha-dec-vms && exit 0 ;; - I*) echo ia64-dec-vms && exit 0 ;; - V*) echo vax-dec-vms && exit 0 ;; - esac + A*) echo alpha-dec-vms ; exit ;; + I*) echo ia64-dec-vms ; exit ;; + V*) echo vax-dec-vms ; exit ;; + esac ;; + *:XENIX:*:SysV) + echo i386-pc-xenix + exit ;; + i*86:skyos:*:*) + echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' + exit ;; + i*86:rdos:*:*) + echo ${UNAME_MACHINE}-pc-rdos + exit ;; + i*86:AROS:*:*) + echo ${UNAME_MACHINE}-pc-aros + exit ;; esac #echo '(No uname command or uname output not recognized.)' 1>&2 @@ -1279,7 +1331,7 @@ #endif #if defined (__arm) && defined (__acorn) && defined (__unix) - printf ("arm-acorn-riscix"); exit (0); + printf ("arm-acorn-riscix\n"); exit (0); #endif #if defined (hp300) && !defined (hpux) @@ -1368,11 +1420,12 @@ } EOF -$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && $dummy && exit 0 +$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && + { echo "$SYSTEM_NAME"; exit; } # Apollos put the system type in the environment. -test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; } +test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } # Convex versions that predate uname can use getsysinfo(1) @@ -1381,22 +1434,22 @@ case `getsysinfo -f cpu_type` in c1*) echo c1-convex-bsd - exit 0 ;; + exit ;; c2*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi - exit 0 ;; + exit ;; c34*) echo c34-convex-bsd - exit 0 ;; + exit ;; c38*) echo c38-convex-bsd - exit 0 ;; + exit ;; c4*) echo c4-convex-bsd - exit 0 ;; + exit ;; esac fi @@ -1407,7 +1460,9 @@ the operating system you are using. It is advised that you download the most up to date version of the config scripts from - ftp://ftp.gnu.org/pub/gnu/config/ + http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD +and + http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD If the version you run ($0) is already up to date, please send the following data and any information you think might be --- pads-1.2.orig/configure +++ pads-1.2/configure @@ -3679,7 +3679,8 @@ done -LDFLAGS="${LDFLAGS} `pcre-config --libs`" +#http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=632102 +LIBS="${LIBS} `pcre-config --libs`" echo "$as_me:$LINENO: checking for pcre_compile in -lpcre" >&5 echo $ECHO_N "checking for pcre_compile in -lpcre... $ECHO_C" >&6 if test "${ac_cv_lib_pcre_pcre_compile+set}" = set; then --- pads-1.2.orig/config.sub +++ pads-1.2/config.sub @@ -1,9 +1,10 @@ #! /bin/sh # Configuration validation subroutine script. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. +# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 +# Free Software Foundation, Inc. -timestamp='2004-08-29' +timestamp='2010-01-22' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software @@ -21,22 +22,26 @@ # # 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. - +# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA +# 02110-1301, 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. + # Please send patches to . Submit a context -# diff and a properly formatted ChangeLog entry. +# diff and a properly formatted GNU ChangeLog entry. # # 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. +# You can get the latest version of this script from: +# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD + # 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. @@ -70,8 +75,9 @@ version="\ GNU config.sub ($timestamp) -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 -Free Software Foundation, Inc. +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, +2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free +Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -83,11 +89,11 @@ while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) - echo "$timestamp" ; exit 0 ;; + echo "$timestamp" ; exit ;; --version | -v ) - echo "$version" ; exit 0 ;; + echo "$version" ; exit ;; --help | --h* | -h ) - echo "$usage"; exit 0 ;; + echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. @@ -99,7 +105,7 @@ *local*) # First pass through any local machine types. echo $1 - exit 0;; + exit ;; * ) break ;; @@ -118,8 +124,10 @@ # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in - nto-qnx* | linux-gnu* | linux-dietlibc | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | \ - kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*) + nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \ + uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \ + kopensolaris*-gnu* | \ + storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; @@ -145,10 +153,13 @@ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ - -apple | -axis | -knuth | -cray) + -apple | -axis | -knuth | -cray | -microblaze) os= basic_machine=$1 ;; + -bluegene*) + os=-cnk + ;; -sim | -cisco | -oki | -wec | -winbond) os= basic_machine=$1 @@ -170,6 +181,10 @@ -hiux*) os=-hiuxwe2 ;; + -sco6) + os=-sco5v6 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; -sco5) os=-sco3.2v5 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` @@ -186,6 +201,10 @@ # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; + -sco5v6*) + # 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/'` @@ -230,22 +249,28 @@ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ - | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \ + | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \ + | bfin \ | c4x | clipper \ | d10v | d30v | dlx | dsp16xx \ - | fr30 | frv \ + | fido | fr30 | frv \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ - | m32r | m32rle | m68000 | m68k | m88k | mcore \ + | lm32 \ + | m32c | m32r | m32rle | m68000 | m68k | m88k \ + | maxq | mb | microblaze | mcore | mep | metag \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ - | mips64vr | mips64vrel \ + | mips64octeon | mips64octeonel \ | mips64orion | mips64orionel \ + | mips64r5900 | mips64r5900el \ + | mips64vr | mips64vrel \ | mips64vr4100 | mips64vr4100el \ | mips64vr4300 | mips64vr4300el \ | mips64vr5000 | mips64vr5000el \ + | mips64vr5900 | mips64vr5900el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ | mipsisa64 | mipsisa64el \ @@ -254,30 +279,40 @@ | mipsisa64sr71k | mipsisa64sr71kel \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ + | moxie \ + | mt \ | msp430 \ + | nios | nios2 \ | ns16k | ns32k \ - | openrisc | or32 \ + | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ | pyramid \ - | sh | sh[1234] | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \ + | rx \ + | score \ + | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ - | sparc | sparc64 | sparc86x | sparclet | sparclite | sparcv8 | sparcv9 | sparcv9b \ - | strongarm \ + | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ + | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ + | spu | strongarm \ | tahoe | thumb | tic4x | tic80 | tron \ + | ubicom32 \ | v850 | v850e \ | we32k \ - | x86 | xscale | xstormy16 | xtensa \ - | z8k) + | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \ + | z8k | z80) basic_machine=$basic_machine-unknown ;; - m6811 | m68hc11 | m6812 | m68hc12) + m6811 | m68hc11 | m6812 | m68hc12 | picochip) # Motorola 68HC11/12. basic_machine=$basic_machine-unknown os=-none ;; m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) ;; + ms1) + basic_machine=mt-unknown + ;; # We use `pc' rather than `unknown' # because (1) that's what they normally are, and @@ -297,28 +332,32 @@ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ - | avr-* \ - | bs2000-* \ + | avr-* | avr32-* \ + | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | elxsi-* \ - | f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \ + | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* | iq2000-* \ - | m32r-* | m32rle-* \ + | lm32-* \ + | m32c-* | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ - | m88110-* | m88k-* | mcore-* \ + | m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ - | mips64vr-* | mips64vrel-* \ + | mips64octeon-* | mips64octeonel-* \ | mips64orion-* | mips64orionel-* \ + | mips64r5900-* | mips64r5900el-* \ + | mips64vr-* | mips64vrel-* \ | mips64vr4100-* | mips64vr4100el-* \ | mips64vr4300-* | mips64vr4300el-* \ | mips64vr5000-* | mips64vr5000el-* \ + | mips64vr5900-* | mips64vr5900el-* \ | mipsisa32-* | mipsisa32el-* \ | mipsisa32r2-* | mipsisa32r2el-* \ | mipsisa64-* | mipsisa64el-* \ @@ -327,26 +366,35 @@ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipstx39-* | mipstx39el-* \ | mmix-* \ + | mt-* \ | msp430-* \ + | nios-* | nios2-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ | pyramid-* \ - | romp-* | rs6000-* \ - | sh-* | sh[1234]-* | sh[23]e-* | sh[34]eb-* | shbe-* \ + | romp-* | rs6000-* | rx-* \ + | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ - | sparc-* | sparc64-* | sparc86x-* | sparclet-* | sparclite-* \ - | sparcv8-* | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \ + | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ + | sparclite-* \ + | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \ | tahoe-* | thumb-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ + | tile-* | tilegx-* \ | tron-* \ + | ubicom32-* \ | v850-* | v850e-* | vax-* \ | we32k-* \ - | x86-* | x86_64-* | xps100-* | xscale-* | xstormy16-* \ - | xtensa-* \ + | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \ + | xstormy16-* | xtensa*-* \ | ymp-* \ - | z8k-*) + | z8k-* | z80-*) + ;; + # Recognize the basic CPU types without company name, with glob match. + xtensa*) + basic_machine=$basic_machine-unknown ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. @@ -410,6 +458,10 @@ basic_machine=m68k-apollo os=-bsd ;; + aros) + basic_machine=i386-pc + os=-aros + ;; aux) basic_machine=m68k-apple os=-aux @@ -418,10 +470,26 @@ basic_machine=ns32k-sequent os=-dynix ;; + blackfin) + basic_machine=bfin-unknown + os=-linux + ;; + blackfin-*) + basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` + os=-linux + ;; + bluegene*) + basic_machine=powerpc-ibm + os=-cnk + ;; c90) basic_machine=c90-cray os=-unicos ;; + cegcc) + basic_machine=arm-unknown + os=-cegcc + ;; convex-c1) basic_machine=c1-convex os=-bsd @@ -450,8 +518,8 @@ basic_machine=craynv-cray os=-unicosmp ;; - cr16c) - basic_machine=cr16c-unknown + cr16) + basic_machine=cr16-unknown os=-elf ;; crds | unos) @@ -489,6 +557,14 @@ basic_machine=m88k-motorola os=-sysv3 ;; + dicos) + basic_machine=i686-pc + os=-dicos + ;; + djgpp) + basic_machine=i586-pc + os=-msdosdjgpp + ;; dpx20 | dpx20-*) basic_machine=rs6000-bull os=-bosx @@ -639,6 +715,14 @@ basic_machine=m68k-isi os=-sysv ;; + m68knommu) + basic_machine=m68k-unknown + os=-linux + ;; + m68knommu-*) + basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'` + os=-linux + ;; m88k-omron*) basic_machine=m88k-omron ;; @@ -650,10 +734,17 @@ basic_machine=ns32k-utek os=-sysv ;; + microblaze) + basic_machine=microblaze-xilinx + ;; mingw32) basic_machine=i386-pc os=-mingw32 ;; + mingw32ce) + basic_machine=arm-unknown + os=-mingw32ce + ;; miniframe) basic_machine=m68000-convergent ;; @@ -679,6 +770,9 @@ basic_machine=i386-pc os=-msdos ;; + ms1-*) + basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` + ;; mvs) basic_machine=i370-ibm os=-mvs @@ -754,9 +848,8 @@ basic_machine=hppa1.1-oki os=-proelf ;; - or32 | or32-*) + openrisc | openrisc-*) basic_machine=or32-unknown - os=-coff ;; os400) basic_machine=powerpc-ibm @@ -778,6 +871,14 @@ basic_machine=i860-intel os=-osf ;; + parisc) + basic_machine=hppa-unknown + os=-linux + ;; + parisc-*) + basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'` + os=-linux + ;; pbd) basic_machine=sparc-tti ;; @@ -787,6 +888,12 @@ pc532 | pc532-*) basic_machine=ns32k-pc532 ;; + pc98) + basic_machine=i386-pc + ;; + pc98-*) + basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; pentium | p5 | k5 | k6 | nexgen | viac3) basic_machine=i586-pc ;; @@ -843,6 +950,10 @@ basic_machine=i586-unknown os=-pw32 ;; + rdos) + basic_machine=i386-pc + os=-rdos + ;; rom68k) basic_machine=m68k-rom68k os=-coff @@ -869,6 +980,10 @@ sb1el) basic_machine=mipsisa64sb1el-unknown ;; + sde) + basic_machine=mipsisa32-sde + os=-elf + ;; sei) basic_machine=mips-sei os=-seiux @@ -880,6 +995,9 @@ basic_machine=sh-hitachi os=-hms ;; + sh5el) + basic_machine=sh5le-unknown + ;; sh64) basic_machine=sh64-unknown ;; @@ -969,6 +1087,15 @@ basic_machine=tic6x-unknown os=-coff ;; + # This must be matched before tile*. + tilegx*) + basic_machine=tilegx-unknown + os=-linux-gnu + ;; + tile*) + basic_machine=tile-unknown + os=-linux-gnu + ;; tx39) basic_machine=mipstx39-unknown ;; @@ -1029,6 +1156,10 @@ basic_machine=hppa1.1-winbond os=-proelf ;; + xbox) + basic_machine=i686-pc + os=-mingw32 + ;; xps | xps100) basic_machine=xps100-honeywell ;; @@ -1040,6 +1171,10 @@ basic_machine=z8k-unknown os=-sim ;; + z80-*-coff) + basic_machine=z80-unknown + os=-sim + ;; none) basic_machine=none-none os=-none @@ -1078,13 +1213,10 @@ we32k) basic_machine=we32k-att ;; - sh3 | sh4 | sh[34]eb | sh[1234]le | sh[23]ele) + sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) basic_machine=sh-unknown ;; - sh64) - basic_machine=sh64-unknown - ;; - sparc | sparcv8 | sparcv9 | sparcv9b) + sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) basic_machine=sparc-sun ;; cydra) @@ -1131,6 +1263,9 @@ # First match some system type aliases # that might get confused with valid system types. # -solaris* is a basic system type, with this one exception. + -auroraux) + os=-auroraux + ;; -solaris1 | -solaris1.*) os=`echo $os | sed -e 's|solaris1|sunos4|'` ;; @@ -1151,26 +1286,30 @@ # 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* \ + | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ + | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ + | -sym* | -kopensolaris* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ - | -aos* \ + | -aos* | -aros* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ - | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* | -openbsd* \ + | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ + | -openbsd* | -solidbsd* \ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ - | -chorusos* | -chorusrdb* \ + | -chorusos* | -chorusrdb* | -cegcc* \ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ - | -mingw32* | -linux-gnu* | -linux-uclibc* | -uxpv* | -beos* | -mpeix* | -udk* \ + | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \ + | -uxpv* | -beos* | -mpeix* | -udk* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ - | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly*) + | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ + | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) @@ -1188,7 +1327,7 @@ os=`echo $os | sed -e 's|nto|nto-qnx|'` ;; -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ - | -windows* | -osx | -abug | -netware* | -os9* | -beos* \ + | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) ;; -mac*) @@ -1297,6 +1436,14 @@ -kaos*) os=-kaos ;; + -zvmoe) + os=-zvmoe + ;; + -dicos*) + os=-dicos + ;; + -nacl*) + ;; -none) ;; *) @@ -1319,6 +1466,12 @@ # system, and we'll never get to this point. case $basic_machine in + score-*) + os=-elf + ;; + spu-*) + os=-elf + ;; *-acorn) os=-riscix1.2 ;; @@ -1328,9 +1481,9 @@ arm*-semi) os=-aout ;; - c4x-* | tic4x-*) - os=-coff - ;; + c4x-* | tic4x-*) + os=-coff + ;; # This must come before the *-dec entry. pdp10-*) os=-tops20 @@ -1356,6 +1509,9 @@ m68*-cisco) os=-aout ;; + mep-*) + os=-elf + ;; mips*-cisco) os=-elf ;; @@ -1374,6 +1530,9 @@ *-be) os=-beos ;; + *-haiku) + os=-haiku + ;; *-ibm) os=-aix ;; @@ -1482,7 +1641,7 @@ -sunos*) vendor=sun ;; - -aix*) + -cnk*|-aix*) vendor=ibm ;; -beos*) @@ -1545,7 +1704,7 @@ esac echo $basic_machine$os -exit 0 +exit # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) --- pads-1.2.orig/lib/Makefile.am +++ pads-1.2/lib/Makefile.am @@ -1,3 +1,3 @@ -## $Id: Makefile.am,v 1.2 2005/02/13 17:54:58 mattshelton Exp $ +## $Id: Makefile.am,v 1.2 2005/11/02 23:56:12 jfs Exp $ AUTOMAKE_OPTIONS=foreign no-dependencies SUBDIRS = bstring --- pads-1.2.orig/lib/bstring/Makefile.in +++ pads-1.2/lib/bstring/Makefile.in @@ -153,7 +153,7 @@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ -# $Id: Makefile.am,v 1.1 2005/02/13 17:54:58 mattshelton Exp $ +# $Id: Makefile.in,v 1.2 2005/11/02 23:56:12 jfs Exp $ AUTOMAKE_OPTIONS = foreign no-dependencies noinst_LIBRARIES = libbstring.a libbstring_a_SOURCES = bstrlib.c bstrlib.h bstraux.c bstraux.h util.c util.h --- pads-1.2.orig/lib/bstring/util.h +++ pads-1.2/lib/bstring/util.h @@ -22,10 +22,13 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * - * $Id: util.h,v 1.1 2005/02/13 17:54:58 mattshelton Exp $ + * $Id: util.h,v 1.2 2005/11/02 23:56:12 jfs Exp $ * **************************************************************************/ +#ifndef _BSTRING_UTIL_H +#define _BSTRING_UTIL_H + /* INCLUDES ---------------------------------------- */ #include "bstrlib.h" @@ -33,3 +36,5 @@ int bltrim (bstring string); int brtrim (bstring string); int btrim (bstring string); + +#endif --- pads-1.2.orig/lib/bstring/Makefile.am +++ pads-1.2/lib/bstring/Makefile.am @@ -1,4 +1,4 @@ -# $Id: Makefile.am,v 1.1 2005/02/13 17:54:58 mattshelton Exp $ +# $Id: Makefile.am,v 1.2 2005/11/02 23:56:12 jfs Exp $ AUTOMAKE_OPTIONS=foreign no-dependencies noinst_LIBRARIES = libbstring.a libbstring_a_SOURCES = bstrlib.c bstrlib.h bstraux.c bstraux.h util.c util.h --- pads-1.2.orig/lib/bstring/util.c +++ pads-1.2/lib/bstring/util.c @@ -21,7 +21,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * - * $Id: util.c,v 1.1 2005/02/13 17:54:58 mattshelton Exp $ + * $Id: util.c,v 1.2 2005/11/02 23:56:12 jfs Exp $ * **************************************************************************/ #include "util.h" --- pads-1.2.orig/src/identification.c +++ pads-1.2/src/identification.c @@ -22,7 +22,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * - * $Id: identification.c,v 1.5 2005/05/14 20:14:34 mattshelton Exp $ + * $Id: identification.c,v 1.3 2005/11/02 23:56:12 jfs Exp $ * **************************************************************************/ #include "identification.h" @@ -73,7 +73,7 @@ bdestroy(filename); bdestroy(filedata); bstrListDestroy(lines); - close(fp); + fclose(fp); return 0; } @@ -101,7 +101,7 @@ /* Check to see if this line has something to read. */ if (line->data[0] == '\0' || line->data[0] == '#') - return; + return 0; /* Split Line */ if ((raw_sig = bsplit(line, ',')) == NULL) @@ -265,7 +265,6 @@ Signature *list = signature_list; int rc; int ovector[15]; - int i; bstring app; while (list != NULL) { @@ -416,7 +415,7 @@ printf("2a: %s\n", bdata(list->title.app)); printf("2b: %s\n", bdata(list->title.ver)); printf("2c: %s\n", bdata(list->title.misc)); - printf("3: %s\n", list->regex); + printf("3: %s\n", (char *) list->regex); printf("\n"); i++; --- pads-1.2.orig/src/configuration.h +++ pads-1.2/src/configuration.h @@ -23,11 +23,13 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * - * $Id: configuration.h,v 1.2 2005/02/18 05:50:19 mattshelton Exp $ + * $Id: configuration.h,v 1.3 2005/11/02 23:56:12 jfs Exp $ * **************************************************************************/ +#ifndef _PADS_CONFIGURATION_H /* DEFINES ----------------------------------------- */ +#define _PADS_CONFIGURATION_H 1 #ifdef LINUX #ifndef __FAVOR_BSD #define __FAVOR_BSD @@ -39,10 +41,11 @@ /* INCLUDES ---------------------------------------- */ -#include "global.h" - #include +#include "global.h" +#include "util.h" #include "bstring/bstrlib.h" +#include "bstring/util.h" /* PROTOTYPES -------------------------------------- */ void init_configuration (bstring conf_file); @@ -51,3 +54,4 @@ /* External Prototypes */ int activate_output_plugin (bstring name, bstring args); +#endif --- pads-1.2.orig/src/pads.h +++ pads-1.2/src/pads.h @@ -22,11 +22,13 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * - * $Id: pads.h,v 1.4 2005/03/11 01:04:12 mattshelton Exp $ + * $Id: pads.h,v 1.3 2005/11/02 23:56:12 jfs Exp $ * **************************************************************************/ +#ifndef _PADS_H /* DEFINES ----------------------------------------- */ +#define _PADS_H 1 #ifdef LINUX #ifndef __FAVOR_BSD #define __FAVOR_BSD @@ -46,7 +48,12 @@ #include #include "global.h" - +#include "util.h" +#include "output/output.h" +#include "configuration.h" +#include "identification.h" +#include "mac-resolution.h" +#include "monnet.h" /* TYPEDEFS ---------------------------------------- */ typedef void (*proc_t)(const struct pcap_pkthdr *, const u_char *); @@ -61,6 +68,7 @@ void init_pads(void); void main_pads(void); void end_pads(void); +int process_cmdline (int, char **); void sig_term_handler(int signal); void sig_int_handler(int signal); @@ -71,5 +79,6 @@ void process_eth (const struct pcap_pkthdr* pkthdr, const u_char* packet); void process_sll (const struct pcap_pkthdr* pkthdr, const u_char* packet); +#endif /* vim:expandtab:cindent:smartindent:ts=4:tw=0:sw=4: */ --- pads-1.2.orig/src/packet.h +++ pads-1.2/src/packet.h @@ -22,7 +22,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * - * $Id: packet.h,v 1.1 2005/02/10 06:05:05 mattshelton Exp $ + * $Id: packet.h,v 1.3 2005/11/02 23:56:12 jfs Exp $ * **************************************************************************/ #ifdef HAVE_CONFIG_H @@ -42,6 +42,10 @@ /* INCLUDES ---------------------------------------- */ #include "global.h" +#include "storage.h" +#include "monnet.h" +#include "identification.h" +#include "output/output.h" #include #include --- pads-1.2.orig/src/util.h +++ pads-1.2/src/util.h @@ -21,24 +21,28 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * - * $Id: util.h,v 1.4 2005/02/22 16:09:25 mattshelton Exp $ + * $Id: util.h,v 1.3 2005/11/02 23:56:12 jfs Exp $ * **************************************************************************/ +#ifndef _PADS_UTIL_H /* INCLUDES ---------------------------------------- */ +#define _PADS_UTIL_H 1 +#include #include #include #include #include +#include #include #include #include #include "global.h" +#include "pads.h" /* PROTOTYPES -------------------------------------- */ void strip_comment (char *string); -int chomp (char *string, int size); void daemonize (void); void init_pid_file (bstring pid_file, bstring user, bstring group); char *copy_argv(register char **argv); @@ -56,3 +60,4 @@ char *hex2mac(unsigned const char *mac); /* GLOBALS ----------------------------------------- */ +#endif --- pads-1.2.orig/src/storage.c +++ pads-1.2/src/storage.c @@ -21,7 +21,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * - * $Id: storage.c,v 1.3 2005/02/16 01:47:35 mattshelton Exp $ + * $Id: storage.c,v 1.2 2005/11/02 23:56:12 jfs Exp $ * **************************************************************************/ #include "storage.h" @@ -467,7 +467,7 @@ printf("-- Begin Asset Database --\n"); rec = asset_list; while (rec != NULL) { - printf("%d: %s,%d,%d,%d,%s,%s,%d\n", + printf("%d: %s,%d,%d,%ld,%s,%s,%d\n", id, inet_ntoa(rec->ip_addr), ntohs(rec->port), rec->proto, rec->discovered, bdata(rec->service), bdata(rec->application), @@ -481,8 +481,8 @@ id = 0; arp = arp_asset_list; while (arp != NULL) { - printf("%d: %s,%s,%d\n", id, inet_ntoa(arp->ip_addr), - ether_ntoa(&arp->mac_addr), arp->discovered); + printf("%d: %s,%s,%ld\n", id, inet_ntoa(arp->ip_addr), + hex2mac(arp->mac_addr), arp->discovered); arp = arp->next; id++; } --- pads-1.2.orig/src/packet.c +++ pads-1.2/src/packet.c @@ -22,7 +22,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * - * $Id: packet.c,v 1.3 2005/02/16 01:47:35 mattshelton Exp $ + * $Id: packet.c,v 1.2 2005/11/02 23:56:12 jfs Exp $ * **************************************************************************/ #include "packet.h" --- pads-1.2.orig/src/Makefile.am +++ pads-1.2/src/Makefile.am @@ -1,4 +1,4 @@ -## $Id: Makefile.am,v 1.3 2005/02/17 16:29:54 mattshelton Exp $ +## $Id: Makefile.am,v 1.2 2005/11/02 23:56:12 jfs Exp $ AUTOMAKE_OPTIONS=foreign no-dependencies bin_PROGRAMS = pads pads_SOURCES = pads.c pads.h \ --- pads-1.2.orig/src/configuration.c +++ pads-1.2/src/configuration.c @@ -22,7 +22,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * - * $Id: configuration.c,v 1.3 2005/04/27 13:50:29 mattshelton Exp $ + * $Id: configuration.c,v 1.3 2005/11/02 23:56:12 jfs Exp $ * **************************************************************************/ #include "configuration.h" @@ -59,7 +59,7 @@ /* Clean Up */ bdestroy(filedata); bstrListDestroy(lines); - close(fp); + fclose(fp); } /* ---------------------------------------------------------- --- pads-1.2.orig/src/global.h +++ pads-1.2/src/global.h @@ -22,9 +22,12 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * - * $Id: global.h,v 1.7 2005/04/27 13:45:47 mattshelton Exp $ + * $Id: global.h,v 1.3 2005/11/02 23:56:12 jfs Exp $ * **************************************************************************/ + +#ifndef _PADS_GLOBAL_H +#define _PADS_GLOBAL_H 1 #ifdef HAVE_CONFIG_H #include "config.h" #endif @@ -158,5 +161,6 @@ /* GLOBAL VARIABLES -------------------------------- */ extern GC gc; +#endif /* vim:expandtab:cindent:smartindent:ts=4:tw=0:sw=4: */ --- pads-1.2.orig/src/pads.c +++ pads-1.2/src/pads.c @@ -22,7 +22,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * - * $Id: pads.c,v 1.10 2005/06/15 22:00:40 mattshelton Exp $ + * $Id: pads.c,v 1.3 2005/11/02 23:56:12 jfs Exp $ * **************************************************************************/ #include "pads.h" @@ -187,7 +187,6 @@ /* Daemon Mode: fork child process */ if (gc.daemon_mode) { daemonize(); - init_pid_file(gc.pid_file, gc.priv_user, gc.priv_group); } /* Signal Trapping */ @@ -376,7 +375,7 @@ int ch; /* Process Command Line Arguments */ - while ((ch = getopt(argc, argv, "c:d:Dg:hi:n:r:u:UvVw:")) != -1) { + while ((ch = getopt(argc, argv, "c:d:Dg:hi:n:r:u:UvVw:p:")) != -1) { switch (ch) { case 'c': gc.conf_file = blk2bstr(optarg, strlen(optarg)); @@ -478,9 +477,10 @@ main(int argc, char *argv[]) { /* Variables */ - int i; - struct pcap_pkthdr header; /* The header that pcap gives us */ - const u_char *packet; /* The actual packet */ + /* Unused: */ + /* int i; */ + /* struct pcap_pkthdr header; */ /* The header that pcap gives us */ + /* const u_char *packet; */ /* The actual packet */ /* Copy Command Line Args */ prog_argc = argc; --- pads-1.2.orig/src/identification.h +++ pads-1.2/src/identification.h @@ -22,15 +22,20 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * - * $Id: identification.h,v 1.2 2005/02/13 18:28:28 mattshelton Exp $ + * $Id: identification.h,v 1.3 2005/11/02 23:56:12 jfs Exp $ * **************************************************************************/ +#ifndef _PADS_IDENTIFICATION_H /* INCLUDES ---------------------------------------- */ +#define _PADS_IDENTIFICATION_H 1 #include #include #include "global.h" +#include "util.h" +#include "storage.h" +#include "output/output.h" #include #include @@ -50,3 +55,4 @@ #endif /* DEBUG */ /* GLOBALS ----------------------------------------- */ +#endif --- pads-1.2.orig/src/storage.h +++ pads-1.2/src/storage.h @@ -22,20 +22,25 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * - * $Id: storage.h,v 1.2 2005/02/16 01:47:35 mattshelton Exp $ + * $Id: storage.h,v 1.3 2005/11/02 23:56:12 jfs Exp $ * **************************************************************************/ +#ifndef _PADS_STORAGE_H /* INCLUDES ---------------------------------------- */ +#define _PADS_STORAGE_H 1 #include #include #include #include #include "global.h" +#include "mac-resolution.h" +#include #include #include +#include /* DEFINES ----------------------------------------- */ @@ -67,3 +72,4 @@ /* GLOBALS ----------------------------------------- */ +#endif --- pads-1.2.orig/src/util.c +++ pads-1.2/src/util.c @@ -22,7 +22,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * - * $Id: util.c,v 1.6 2005/03/11 01:31:15 mattshelton Exp $ + * $Id: util.c,v 1.4 2005/11/02 23:56:12 jfs Exp $ * **************************************************************************/ #include "util.h" @@ -48,29 +48,6 @@ } /* ---------------------------------------------------------- - * FUNCTION : chomp - * DESCRIPTION : This function is similar to Perl's 'chomp' - * : command. It will strip off the '\n' - * : closest to the end of the string. - * INPUT : 0 - String - * : 1 - Size of String - * RETURN : 0 - '\n' removed - * : 1 - '\n' was never there - * ---------------------------------------------------------- */ -int -chomp (char *string, int size) -{ - for (size; size >= 0; size--) { - if (string[size] == '\n') { - string[size] = '\0'; - return 1; - } - } - - return 0; -} - -/* ---------------------------------------------------------- * FUNCTION : daemonize * DESCRIPTION : This function will place the application in * : the background. @@ -83,7 +60,6 @@ pid_t pid; printf("[-] Daemonizing...\n"); - pid = fork(); if (pid > 0) { /* Parent */ @@ -95,6 +71,9 @@ } else { /* Child */ setsid(); + init_pid_file(gc.pid_file, gc.priv_user, gc.priv_group); + fflush(stdout); + fflush(stderr); close(0); close(1); close(2); @@ -117,16 +96,16 @@ struct passwd *this_user; /* Default PID File */ - if (gc.pid_file->slen >= 0) - gc.pid_file = bfromcstr("/var/run/pads.pid"); + if (pid_file == NULL) + pid_file = bfromcstr("/var/run/pads.pid"); /* Create PID File */ - if ((fp = fopen(bdata(gc.pid_file), "w")) != NULL) { + if ((fp = fopen(bdata(pid_file), "w")) != NULL) { pid = (int) getpid(); fprintf(fp, "%d\n", pid); fclose(fp); } else { - err_message("Unable to create PID file (%s).\n", bdata(gc.pid_file)); + err_message("Unable to create PID file (%s).\n", bdata(pid_file)); } /* Change PID File's Ownership */ @@ -137,7 +116,7 @@ err_message("'%s' group does not appear to exist.", bdata(group)); if ((this_user = getpwnam(bdata(user))) == NULL) err_message("'%s' user does not appear to exist.", bdata(user)); - if ((chown(pid_file, this_user->pw_uid, this_group->gr_gid)) != 0) + if ((chown(bdata(pid_file), this_user->pw_uid, this_group->gr_gid)) != 0) err_message("Unable to change PID file's ownership."); } --- pads-1.2.orig/src/monnet.c +++ pads-1.2/src/monnet.c @@ -24,7 +24,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * - * $Id: monnet.c,v 1.3 2005/02/17 16:29:14 mattshelton Exp $ + * $Id: monnet.c,v 1.2 2005/11/02 23:56:12 jfs Exp $ * **************************************************************************/ #include "monnet.h" @@ -45,7 +45,6 @@ { int i = 0; char network[16], netmask[3], tmp[16]; - struct in_addr in_net; /* Make sure something was defined. */ if (cmdline == NULL) --- pads-1.2.orig/src/mac-resolution.h +++ pads-1.2/src/mac-resolution.h @@ -26,15 +26,18 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * - * $Id: mac-resolution.h,v 1.3 2005/02/16 01:47:35 mattshelton Exp $ + * $Id: mac-resolution.h,v 1.3 2005/11/02 23:56:12 jfs Exp $ * **************************************************************************/ +#ifndef _PADS_MAC_RESOLUTION_H /* DEFINES ----------------------------------------- */ +#define _PADS_MAC_RESOLUTION_H 1 /* INCLUDES ---------------------------------------- */ #include #include "global.h" +#include "util.h" /* PROTOTYPES -------------------------------------- */ @@ -47,3 +50,5 @@ #ifdef DEBUG void show_vendor (void); #endif /* DEBUG */ + +#endif --- pads-1.2.orig/src/monnet.h +++ pads-1.2/src/monnet.h @@ -21,15 +21,20 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * - * $Id: monnet.h,v 1.1 2005/02/10 06:05:05 mattshelton Exp $ + * $Id: monnet.h,v 1.3 2005/11/02 23:56:12 jfs Exp $ * **************************************************************************/ +#ifndef _PADS_MONNET_H /* INCLUDES ---------------------------------------- */ +#define _PADS_MONNET_H 1 #include +#include #include +#include #include +#include "util.h" /* DATA STRUCTURES --------------------------------- */ struct mon_net { @@ -47,3 +52,4 @@ /* GLOBALS ----------------------------------------- */ +#endif --- pads-1.2.orig/src/pads-report.pl +++ pads-1.2/src/pads-report.pl @@ -26,7 +26,7 @@ my $version = '1.2'; my $date = '06/17/05'; # -# $Id: pads-report.pl,v 1.2 2005/06/15 22:10:41 mattshelton Exp $ +# $Id: pads-report.pl,v 1.2 2005/11/02 23:56:12 jfs Exp $ # # --------------------------------------------------------------------- use strict; --- pads-1.2.orig/src/mac-resolution.c +++ pads-1.2/src/mac-resolution.c @@ -26,7 +26,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * - * $Id: mac-resolution.c,v 1.5 2005/05/14 20:15:21 mattshelton Exp $ + * $Id: mac-resolution.c,v 1.3 2005/11/02 23:56:12 jfs Exp $ * **************************************************************************/ #ifndef DISABLE_VENDOR @@ -79,7 +79,7 @@ bdestroy(filedata); if (lines != NULL) bstrListDestroy(lines); - close(fp); + fclose(fp); return 0; } @@ -99,8 +99,6 @@ char vendor[80]; int m1, m2, m3; - int pos; - /* Parse out the contents of the line. */ if (sscanf(bdata(line), "%02X:%02X:%02X %80[^,\n],\n", &m1, &m2, &m3, vendor) != 4) return -1; @@ -215,7 +213,7 @@ list = vendor_list; while(list != NULL) { - printf("Mac: %s\nVendor: %s\n\n", list->mac, bdata(list->vendor)); + printf("Mac: %d\nVendor: %s\n\n", list->mac, bdata(list->vendor)); list = list->next; } } --- pads-1.2.orig/src/output/output.h +++ pads-1.2/src/output/output.h @@ -22,11 +22,13 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * - * $Id: output.h,v 1.3 2005/02/18 05:39:09 mattshelton Exp $ + * $Id: output.h,v 1.3 2005/11/02 23:56:12 jfs Exp $ * **************************************************************************/ +#ifndef _PADS_OUTPUT_H /* DEFINES ----------------------------------------- */ +#define _PADS_OUTPUT_H 1 #ifdef LINUX #ifndef __FAVOR_BSD #define __FAVOR_BSD @@ -41,7 +43,7 @@ #include #include "global.h" - +#include "storage.h" /* DATA STRUCTURES --------------------------------- */ @@ -70,6 +72,9 @@ /* PROTOTYPES -------------------------------------- */ void init_output(); +int setup_output_screen (void); +int setup_output_csv (void); +int setup_output_fifo (void); int register_output_plugin (OutputPlugin *plugin); int activate_output_plugin (bstring name, bstring args); int print_asset (struct in_addr ip_addr, u_int16_t port, unsigned short proto); @@ -77,3 +82,4 @@ int print_stat(struct in_addr ip_addr, u_int16_t port, unsigned short proto); void end_output (void); +#endif --- pads-1.2.orig/src/output/Makefile.in +++ pads-1.2/src/output/Makefile.in @@ -153,7 +153,7 @@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ -# $Id: Makefile.am,v 1.1 2005/02/10 06:05:06 mattshelton Exp $ +# $Id: Makefile.in,v 1.2 2005/11/02 23:56:12 jfs Exp $ AUTOMAKE_OPTIONS = foreign no-dependencies noinst_LIBRARIES = liboutput.a liboutput_a_SOURCES = output.c output.h \ --- pads-1.2.orig/src/output/output-fifo.c +++ pads-1.2/src/output/output-fifo.c @@ -1,12 +1,12 @@ /************************************************************************* * output-fifo.c * - * Matt Shelton + * Matt Shelton * * This output module will write data to a FIFO named pipe. This will * allow external applications access to PADS data in real-time. * - * Copyright (C) 2004 Matt Shelton + * Copyright (C) 2004, 2005 Matt Shelton * * 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 @@ -22,7 +22,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * - * $Id: output-fifo.c,v 1.6 2005/02/22 16:09:25 mattshelton Exp $ + * $Id: output-fifo.c,v 1.3 2005/11/02 23:56:12 jfs Exp $ * **************************************************************************/ #include "output-fifo.h" @@ -38,10 +38,10 @@ * begin with an action_id field. This field will allow different types * of output to be written to the FIFO. * - * action_id action - * 01 TCP / ICMP Asset Discovered - * 02 ARP Asset Discovered - * 03 TCP / ICMP Statistic Information + * action_id action + * 01 TCP / ICMP Asset Discovered + * 02 ARP Asset Discovered + * 03 TCP / ICMP Statistic Information * * The following lines contains an example of the data written to the * FIFO: @@ -55,18 +55,17 @@ OutputFIFOConf output_fifo_conf; /* ---------------------------------------------------------- - * FUNCTION : setup_output_fifo - * DESCRIPTION : This function will register the output - * : plugin. - * INPUT : None! - * RETURN : 0 - Success - * : -1 - Error + * FUNCTION : setup_output_fifo + * DESCRIPTION : This function will register the output + * : plugin. + * INPUT : None! + * RETURN : 0 - Success + * : -1 - Error * ---------------------------------------------------------- */ int setup_output_fifo (void) { OutputPlugin *plugin; - bstring name; /* Allocate and setup plugin data record. */ plugin = (OutputPlugin*)malloc(sizeof(OutputPlugin)); @@ -79,33 +78,29 @@ /* Register plugin with input module. */ if ((register_output_plugin(plugin)) == -1) { - if (plugin != NULL) - free(plugin); - log_message("warning: 'register_output_plugin' in function 'setup_output_fifo' failed."); + if (plugin != NULL) + free(plugin); + log_message("warning: 'register_output_plugin' in function 'setup_output_fifo' failed."); } return 0; } /* ---------------------------------------------------------- - * FUNCTION : init_output_fifo - * DESCRIPTION : This function will initialize the FIFO - * : file. - * INPUT : 0 - FIFO filename - * RETURN : None! + * FUNCTION : init_output_fifo + * DESCRIPTION : This function will initialize the FIFO + * : file. + * INPUT : 0 - FIFO filename + * RETURN : None! * --------------------------------------------------------- */ int init_output_fifo (bstring fifo_file) { - FILE *fp; - register u_int len = 0; - char *filename; - verbose_message("Initializing FIFO output plugin."); /* Make sure report_file isn't NULL. */ if (fifo_file == NULL) - fifo_file = bstrcpy(bfromcstr("pads.fifo")); + fifo_file = bstrcpy(bfromcstr("pads.fifo")); output_fifo_conf.filename = bstrcpy(fifo_file); @@ -113,110 +108,110 @@ verbose_message("Open FIFO File\n"); if ((output_fifo_conf.file = fopen(bdata(fifo_file), "w+")) == NULL) - err_message("Unable to open FIFO file (%s)!\n", bdata(fifo_file)); + err_message("Unable to open FIFO file (%s)!\n", bdata(fifo_file)); - return; + return 0; } /* ---------------------------------------------------------- - * FUNCTION : print_asset_fifo - * DESCRIPTION : This function will print an asset to the - * : FIFO file. - * INPUT : 0 - Port - * : 1 - IP Address - * : 2 - Protocol - * : 3 - Service - * : 4 - Application - * : 5 - Discovered - * RETURN : 0 - Success - * : -1 - Error + * FUNCTION : print_asset_fifo + * DESCRIPTION : This function will print an asset to the + * : FIFO file. + * INPUT : 0 - Port + * : 1 - IP Address + * : 2 - Protocol + * : 3 - Service + * : 4 - Application + * : 5 - Discovered + * RETURN : 0 - Success + * : -1 - Error * ---------------------------------------------------------- */ int print_asset_fifo (Asset *rec) { if (output_fifo_conf.file != NULL) { - if (gc.hide_unknowns == 0 || ((biseq(rec->service, bfromcstr("unknown")) != 0) && - (biseq(rec->application, bfromcstr("unknown")) != 0))) { - fprintf(output_fifo_conf.file, "01,%s,%d,%d,%s,%s,%d\n", - inet_ntoa(rec->ip_addr), ntohs(rec->port), rec->proto, bdata(rec->service), - bdata(rec->application), rec->discovered); - fflush(output_fifo_conf.file); - } + if (gc.hide_unknowns == 0 || ((biseq(rec->service, bfromcstr("unknown")) != 0) && + (biseq(rec->application, bfromcstr("unknown")) != 0))) { + fprintf(output_fifo_conf.file, "01,%s,%d,%d,%s,%s,%ld\n", + inet_ntoa(rec->ip_addr), ntohs(rec->port), rec->proto, bdata(rec->service), + bdata(rec->application), rec->discovered); + fflush(output_fifo_conf.file); + } } else { - fprintf(stderr, "[!] ERROR: File handle not open!\n"); - return -1; + fprintf(stderr, "[!] ERROR: File handle not open!\n"); + return -1; } return 0; } /* ---------------------------------------------------------- - * FUNCTION : print_arp_asset_fifo - * DESCRIPTION : This function will print an ARP asset to - * : the FIFO file. - * INPUT : 0 - IP Address - * : 1 - MAC Address - * RETURN : 0 - Success - * : -1 - Error + * FUNCTION : print_arp_asset_fifo + * DESCRIPTION : This function will print an ARP asset to + * : the FIFO file. + * INPUT : 0 - IP Address + * : 1 - MAC Address + * RETURN : 0 - Success + * : -1 - Error * ---------------------------------------------------------- */ int print_arp_asset_fifo (ArpAsset *rec) { /* Print to File */ if (output_fifo_conf.file != NULL) { - if (rec->mac_resolved != NULL) { - fprintf(output_fifo_conf.file, "02,%s,%s,%s,%d\n", inet_ntoa(rec->ip_addr), - rec->mac_resolved, hex2mac(&rec->mac_addr), rec->discovered); - } else { - fprintf(output_fifo_conf.file, "02,%s,unknown,%s,%d\n", inet_ntoa(rec->ip_addr), - hex2mac(&rec->mac_addr), rec->discovered); - } + if (rec->mac_resolved != NULL) { + fprintf(output_fifo_conf.file, "02,%s,%s,%s,%ld\n", inet_ntoa(rec->ip_addr), + (char *)rec->mac_resolved, hex2mac(rec->mac_addr), rec->discovered); + } else { + fprintf(output_fifo_conf.file, "02,%s,unknown,%s,%ld\n", inet_ntoa(rec->ip_addr), + hex2mac(rec->mac_addr), rec->discovered); + } - fflush(output_fifo_conf.file); + fflush(output_fifo_conf.file); } else { - fprintf(stderr, "[!] ERROR: File handle not open!\n"); - return -1; + fprintf(stderr, "[!] ERROR: File handle not open!\n"); + return -1; } return 0; } /* ---------------------------------------------------------- - * FUNCTION : print_stat_fifo - * DESCRIPTION : This function will print statistic - * : information to the FIFO file. - * INPUT : 0 - IP Address - * : 1 - Port - * : 2 - Protocol - * RETURN : 0 - Success - * : -1 - Error + * FUNCTION : print_stat_fifo + * DESCRIPTION : This function will print statistic + * : information to the FIFO file. + * INPUT : 0 - IP Address + * : 1 - Port + * : 2 - Protocol + * RETURN : 0 - Success + * : -1 - Error * ---------------------------------------------------------- */ int print_stat_fifo (Asset *rec) { if (output_fifo_conf.file != NULL) { - fprintf(output_fifo_conf.file, "03,%s,%d,%d,%d\n", - inet_ntoa(rec->ip_addr), ntohs(rec->port), rec->proto, time(NULL)); - fflush(output_fifo_conf.file); + fprintf(output_fifo_conf.file, "03,%s,%d,%d,%ld\n", + inet_ntoa(rec->ip_addr), ntohs(rec->port), rec->proto, time(NULL)); + fflush(output_fifo_conf.file); } else { - fprintf(stderr, "[!] ERROR: File handle not open!\n"); - return -1; + fprintf(stderr, "[!] ERROR: File handle not open!\n"); + return -1; } return 0; } /* ---------------------------------------------------------- - * FUNCTION : end_output_fifo - * DESCRIPTION : This function will free the memory declared - * : by the fifo output module. - * INPUT : None - * OUTPUT : 0 - Success - * : -1 - Error + * FUNCTION : end_output_fifo + * DESCRIPTION : This function will free the memory declared + * : by the fifo output module. + * INPUT : None + * OUTPUT : 0 - Success + * : -1 - Error * ---------------------------------------------------------- */ int -end_output_fifo () +end_output_fifo (void) { verbose_message("Ending CSV Output Plugin."); @@ -225,8 +220,10 @@ /* Clean Up */ if (output_fifo_conf.filename) - bdestroy(output_fifo_conf.filename); + bdestroy(output_fifo_conf.filename); return 0; } +/* vim:expandtab:cindent:smartindent:ts=4:tw=0:sw=4: + */ --- pads-1.2.orig/src/output/Makefile.am +++ pads-1.2/src/output/Makefile.am @@ -1,4 +1,4 @@ -# $Id: Makefile.am,v 1.1 2005/02/10 06:05:06 mattshelton Exp $ +# $Id: Makefile.am,v 1.2 2005/11/02 23:56:12 jfs Exp $ AUTOMAKE_OPTIONS=foreign no-dependencies noinst_LIBRARIES = liboutput.a liboutput_a_SOURCES = output.c output.h \ --- pads-1.2.orig/src/output/output.c +++ pads-1.2/src/output/output.c @@ -22,7 +22,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * - * $Id: output.c,v 1.3 2005/02/18 05:39:09 mattshelton Exp $ + * $Id: output.c,v 1.3 2005/11/02 23:56:12 jfs Exp $ * **************************************************************************/ #include "output.h" @@ -149,7 +149,7 @@ /* Make sure that a record was found. */ if (rec == NULL) - return; + return 1; /* Cycle through output plugins and print to those that are active. */ head = output_plugin_list; @@ -199,7 +199,7 @@ /* Make sure that a record was found. */ if (rec == NULL) - return; + return 1; /* Cycle through output plugins and print to those that are active. */ head = output_plugin_list; @@ -298,8 +298,12 @@ #ifdef DEBUG int debug_output_list (void) { - OutputPluginList *head, *head2; - OutputPlugin *tmp, *tmp2; + OutputPluginList *head; + OutputPlugin *tmp; + /* Unused: + * OutputPluginList *head2; + * OutputPlugin *tmp2; + */ int i = 1; printf("output_plugin_list:\n"); --- pads-1.2.orig/src/output/output-fifo.h +++ pads-1.2/src/output/output-fifo.h @@ -22,11 +22,13 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * - * $Id: output-fifo.h,v 1.3 2005/02/18 05:39:09 mattshelton Exp $ + * $Id: output-fifo.h,v 1.3 2005/11/02 23:56:12 jfs Exp $ * **************************************************************************/ +#ifndef _PSAD_OUTPUT_FIFO_H /* DEFINES ----------------------------------------- */ +#define _PSAD_OUTPUT_FIFO_H 1 #ifdef LINUX #ifndef __FAVOR_BSD #define __FAVOR_BSD @@ -40,9 +42,12 @@ /* INCLUDES ---------------------------------------- */ #include #include +#include +#include #include "output.h" +#include "util.h" /* TYPEDEFS ---------------------------------------- */ typedef struct _OutputFIFOConf @@ -62,3 +67,4 @@ int print_stat_fifo (Asset *rec); int end_output_fifo (void); +#endif --- pads-1.2.orig/src/output/output-screen.c +++ pads-1.2/src/output/output-screen.c @@ -21,7 +21,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * - * $Id: output-screen.c,v 1.5 2005/02/22 16:09:25 mattshelton Exp $ + * $Id: output-screen.c,v 1.2 2005/11/02 23:56:12 jfs Exp $ * **************************************************************************/ #include "output-screen.h" @@ -38,7 +38,6 @@ setup_output_screen (void) { OutputPlugin *plugin; - bstring name; /* Allocate and setup plugin data record. */ plugin = (OutputPlugin*)malloc(sizeof(OutputPlugin)); --- pads-1.2.orig/src/output/output-csv.c +++ pads-1.2/src/output/output-csv.c @@ -1,11 +1,11 @@ /************************************************************************* * output-csv.c * - * Matt Shelton + * Matt Shelton * * This output module writes PADS data to a CSV file. * - * Copyright (C) 2004 Matt Shelton + * Copyright (C) 2004, 2005 Matt Shelton * * 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 @@ -21,7 +21,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * - * $Id: output-csv.c,v 1.6 2005/02/22 16:09:25 mattshelton Exp $ + * $Id: output-csv.c,v 1.3 2005/11/02 23:56:12 jfs Exp $ * **************************************************************************/ #include "output-csv.h" @@ -29,18 +29,17 @@ OutputCSVConf output_csv_conf; /* ---------------------------------------------------------- - * FUNCTION : setup_output_csv - * DESCRIPTION : This function will register the output - * : plugin. - * INPUT : None! - * RETURN : 0 - Success - * : -1 - Error + * FUNCTION : setup_output_csv + * DESCRIPTION : This function will register the output + * : plugin. + * INPUT : None! + * RETURN : 0 - Success + * : -1 - Error * ---------------------------------------------------------- */ int setup_output_csv (void) { OutputPlugin *plugin; - bstring name; /* Allocate and setup plugin data record. */ plugin = (OutputPlugin*)malloc(sizeof(OutputPlugin)); @@ -53,22 +52,22 @@ /* Register plugin with input module. */ if ((register_output_plugin(plugin)) == -1) { - if (plugin != NULL) - free(plugin); - log_message("warning: 'register_output_plugin' in function 'setup_output_csv' failed."); + if (plugin != NULL) + free(plugin); + log_message("warning: 'register_output_plugin' in function 'setup_output_csv' failed."); } return 0; } /* ---------------------------------------------------------- - * FUNCTION : init_output_csv - * DESCRIPTION : This function will initialize the output - * : CSV file. If the file already exists, it - * : will read in the file and add each asset - * : to the asset data structure. - * INPUT : 0 - CSV filename - * RETURN : None! + * FUNCTION : init_output_csv + * DESCRIPTION : This function will initialize the output + * : CSV file. If the file already exists, it + * : will read in the file and add each asset + * : to the asset data structure. + * INPUT : 0 - CSV filename + * RETURN : None! * --------------------------------------------------------- */ int init_output_csv (bstring filename) @@ -79,44 +78,44 @@ /* Make sure filename isn't NULL. */ if (filename != NULL) - output_csv_conf.filename = bstrcpy(filename); + output_csv_conf.filename = bstrcpy(filename); else - output_csv_conf.filename = bstrcpy(bfromcstr("assets.csv")); + output_csv_conf.filename = bstrcpy(bfromcstr("assets.csv")); /* Check to see if *filename exists. */ if ((fp = fopen(bdata(output_csv_conf.filename), "r")) == NULL) { - /* File does not exist, create new.. */ - if ((output_csv_conf.file = fopen(bdata(output_csv_conf.filename), "w")) != NULL) { - fprintf(output_csv_conf.file, "asset,port,proto,service,application,discovered\n"); - - } else { - err_message("Cannot open file %s!", bdata(output_csv_conf.filename)); - } + /* File does not exist, create new.. */ + if ((output_csv_conf.file = fopen(bdata(output_csv_conf.filename), "w")) != NULL) { + fprintf(output_csv_conf.file, "asset,port,proto,service,application,discovered\n"); + + } else { + err_message("Cannot open file %s!", bdata(output_csv_conf.filename)); + } } else { - /* File does exist, read it into data structure. */ - fclose(fp); - read_report_file(); - - /* Open file and assign it to the global FILE pointer. */ - if ((output_csv_conf.file = fopen(bdata(output_csv_conf.filename), "a")) == NULL) { - err_message("Cannot open file %s!", bdata(output_csv_conf.filename)); - } + /* File does exist, read it into data structure. */ + fclose(fp); + read_report_file(); + + /* Open file and assign it to the global FILE pointer. */ + if ((output_csv_conf.file = fopen(bdata(output_csv_conf.filename), "a")) == NULL) { + err_message("Cannot open file %s!", bdata(output_csv_conf.filename)); + } } - return; + return 0; } /* ---------------------------------------------------------- - * FUNCTION : read_report_file - * DESCRIPTION : This function will read in a specified - * : report CSV file. It will then break a part - * : the line and add the assets to the - * : specified asset data structure. - * INPUT : None - * RETURN : None + * FUNCTION : read_report_file + * DESCRIPTION : This function will read in a specified + * : report CSV file. It will then break a part + * : the line and add the assets to the + * : specified asset data structure. + * INPUT : None + * RETURN : None * ---------------------------------------------------------- */ void read_report_file (void) @@ -130,30 +129,30 @@ /* Open Signature File */ if ((fp = fopen(bdata(output_csv_conf.filename), "r")) == NULL) { - err_message("Unable to open CSV file - %s", bdata(output_csv_conf.filename)); + err_message("Unable to open CSV file - %s", bdata(output_csv_conf.filename)); } /* Read file into 'filedata' and process it accordingly. */ filedata = bread ((bNread) fread, fp); if ((lines = bsplit(filedata, '\n')) != NULL) { - for (i = 0; i < lines->qty; i++) { - parse_raw_report(lines->entry[i]); - } + for (i = 0; i < lines->qty; i++) { + parse_raw_report(lines->entry[i]); + } } /* Clean Up */ bdestroy(filedata); bstrListDestroy(lines); - close(fp); + fclose(fp); } /* ---------------------------------------------------------- - * FUNCTION : parse_raw_report - * DESCRIPTION : This function will parse through a single - * : line of the CSV file. - * INPUT : 0 - Raw Line - * RETURN : 0 - Sucess - * : -1 - Error + * FUNCTION : parse_raw_report + * DESCRIPTION : This function will parse through a single + * : line of the CSV file. + * INPUT : 0 - Raw Line + * RETURN : 0 - Sucess + * : -1 - Error * ---------------------------------------------------------- */ int parse_raw_report (bstring line) @@ -172,37 +171,37 @@ /* Check to see if this line has something to read. */ if (line->data[0] == '\0' || line->data[0] == '#') - return; + return 0; /* Break line apart. */ if ((list = bsplit(line, ',')) == NULL) - return -1; + return -1; /* Check to see if this line contains the header. */ if ((biseqcstr(list->entry[0], "asset")) == 1) { - if (list != NULL) - bstrListDestroy(list); - return -1; + if (list != NULL) + bstrListDestroy(list); + return -1; } /* Place data from 'list' into temporary data storage. */ if ((inet_aton(bdata(list->entry[0]), &ip_addr)) == -1) - ret = -1; + ret = -1; if ((port = htons(atoi(bdata(list->entry[1])))) == -1) - ret = -1; + ret = -1; if ((proto = atoi(bdata(list->entry[2]))) == -1) - ret = -1; + ret = -1; if ((service = bstrcpy(list->entry[3])) == NULL) - ret = -1; + ret = -1; if ((application = bstrcpy(list->entry[4])) == NULL) ret = -1; if ((discovered = atol(bdata(list->entry[5]))) == -1) - ret = -1; + ret = -1; /* Make sure that this line contains 'good' data. */ if (service->slen == 0 || application->slen == 0 || discovered <= 0) @@ -210,95 +209,95 @@ /* Add Asset to Data Structure */ if (proto == 0 && ret != -1) { - /* ARP */ - mac2hex(bdata(application), mac_addr, MAC_LEN); - add_arp_asset(ip_addr, mac_addr, discovered); + /* ARP */ + mac2hex(bdata(application), mac_addr, MAC_LEN); + add_arp_asset(ip_addr, mac_addr, discovered); } else { - /* Everything Else */ - add_asset(ip_addr, port, proto, service, application, discovered); + /* Everything Else */ + add_asset(ip_addr, port, proto, service, application, discovered); } // Clean Up if (list != NULL) - bstrListDestroy(list); + bstrListDestroy(list); if (service != NULL) - bdestroy(service); + bdestroy(service); if (application != NULL) - bdestroy(application); + bdestroy(application); return ret; } /* ---------------------------------------------------------- - * FUNCTION : print_asset_csv - * DESCRIPTION : This function will print an asset to the - * : CSV file. - * INPUT : 0 - Port - * : 1 - IP Address - * : 2 - Protocol - * : 3 - Service - * : 4 - Application - * : 5 - Discovered - * RETURN : 0 - Success - * : -1 - Failure + * FUNCTION : print_asset_csv + * DESCRIPTION : This function will print an asset to the + * : CSV file. + * INPUT : 0 - Port + * : 1 - IP Address + * : 2 - Protocol + * : 3 - Service + * : 4 - Application + * : 5 - Discovered + * RETURN : 0 - Success + * : -1 - Failure * ---------------------------------------------------------- */ int print_asset_csv (Asset *rec) { if (output_csv_conf.file != NULL) { - if (gc.hide_unknowns == 0 || ((biseqcstr(rec->service, "unknown") != 0) && - (biseqcstr(rec->application, "unknown") != 0))) { - fprintf(output_csv_conf.file, "%s,%d,%d,%s,%s,%d\n", - inet_ntoa(rec->ip_addr), ntohs(rec->port), rec->proto, bdata(rec->service), - bdata(rec->application), rec->discovered); - fflush(output_csv_conf.file); - } + if (gc.hide_unknowns == 0 || ((biseqcstr(rec->service, "unknown") != 0) && + (biseqcstr(rec->application, "unknown") != 0))) { + fprintf(output_csv_conf.file, "%s,%d,%d,%s,%s,%ld\n", + inet_ntoa(rec->ip_addr), ntohs(rec->port), rec->proto, bdata(rec->service), + bdata(rec->application), rec->discovered); + fflush(output_csv_conf.file); + } } else { - fprintf(stderr, "[!] ERROR: File handle not open!\n"); - return -1; + fprintf(stderr, "[!] ERROR: File handle not open!\n"); + return -1; } return 0; } /* ---------------------------------------------------------- - * FUNCTION : print_arp_asset_csv - * DESCRIPTION : This function will print an ARP asset to - * : the CSV file. - * INPUT : 0 - IP Address - * : 1 - MAC Address - * : 2 - MAC Resolved - * RETURN : 0 - Success - * : -1 - Error + * FUNCTION : print_arp_asset_csv + * DESCRIPTION : This function will print an ARP asset to + * : the CSV file. + * INPUT : 0 - IP Address + * : 1 - MAC Address + * : 2 - MAC Resolved + * RETURN : 0 - Success + * : -1 - Error * ---------------------------------------------------------- */ int print_arp_asset_csv (ArpAsset *rec) { /* Print to File */ if (output_csv_conf.file != NULL) { - if (rec->mac_resolved != NULL) { - fprintf(output_csv_conf.file, "%s,0,0,ARP (%s),%s,%d\n", inet_ntoa(rec->ip_addr), - bdata(rec->mac_resolved), hex2mac(rec->mac_addr), rec->discovered); - } else { - fprintf(output_csv_conf.file, "%s,0,0,ARP,%s,%d\n", inet_ntoa(rec->ip_addr), - hex2mac(rec->mac_addr), rec->discovered); - } + if (rec->mac_resolved != NULL) { + fprintf(output_csv_conf.file, "%s,0,0,ARP (%s),%s,%ld\n", inet_ntoa(rec->ip_addr), + bdata(rec->mac_resolved), hex2mac(rec->mac_addr), rec->discovered); + } else { + fprintf(output_csv_conf.file, "%s,0,0,ARP,%s,%ld\n", inet_ntoa(rec->ip_addr), + hex2mac(rec->mac_addr), rec->discovered); + } - fflush(output_csv_conf.file); + fflush(output_csv_conf.file); } else { - fprintf(stderr, "[!] ERROR: File handle not open!\n"); - return -1; + fprintf(stderr, "[!] ERROR: File handle not open!\n"); + return -1; } return 0; } /* ---------------------------------------------------------- - * FUNCTION : end_output_csv - * DESCRIPTION : This function will free the memory declared - * : by the screen output module. - * INPUT : None! - * OUTPUT : None! + * FUNCTION : end_output_csv + * DESCRIPTION : This function will free the memory declared + * : by the screen output module. + * INPUT : None! + * OUTPUT : None! * ---------------------------------------------------------- */ int end_output_csv () @@ -307,9 +306,13 @@ verbose_message("Closing CSV File."); if (output_csv_conf.file != NULL) - fclose(output_csv_conf.file); + fclose(output_csv_conf.file); if (output_csv_conf.filename != NULL) - bdestroy(output_csv_conf.filename); + bdestroy(output_csv_conf.filename); + + return 0; } +/* vim:expandtab:cindent:smartindent:ts=4:tw=0:sw=4: + */ --- pads-1.2.orig/src/output/output-screen.h +++ pads-1.2/src/output/output-screen.h @@ -22,11 +22,13 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * - * $Id: output-screen.h,v 1.3 2005/02/18 05:39:09 mattshelton Exp $ + * $Id: output-screen.h,v 1.3 2005/11/02 23:56:12 jfs Exp $ * **************************************************************************/ +#ifndef _PADS_OUTPUT_SCREEN_H /* DEFINES ----------------------------------------- */ +#define _PADS_OUTPUT_SCREEN_H 1 #ifdef LINUX #ifndef __FAVOR_BSD #define __FAVOR_BSD @@ -39,8 +41,10 @@ /* INCLUDES ---------------------------------------- */ #include +#include #include "output.h" +#include "util.h" /* TYPEDEFS ---------------------------------------- */ @@ -56,3 +60,5 @@ int print_asset_screen (Asset *rec); int print_arp_asset_screen (ArpAsset *rec); int end_output_screen (void); + +#endif --- pads-1.2.orig/src/output/output-csv.h +++ pads-1.2/src/output/output-csv.h @@ -22,11 +22,13 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * - * $Id: output-csv.h,v 1.3 2005/02/18 05:39:09 mattshelton Exp $ + * $Id: output-csv.h,v 1.3 2005/11/02 23:56:12 jfs Exp $ * **************************************************************************/ +#ifndef _PADS_OUTPUT_CSV_H /* DEFINES ----------------------------------------- */ +#define _PADS_OUTPUT_CSV_H 1 #ifdef LINUX #ifndef __FAVOR_BSD #define __FAVOR_BSD @@ -39,8 +41,11 @@ /* INCLUDES ---------------------------------------- */ #include +#include +#include #include "output.h" +#include "util.h" /* TYPEDEFS ---------------------------------------- */ @@ -64,3 +69,4 @@ int print_arp_asset_csv (ArpAsset *rec); int end_output_csv (void); +#endif --- pads-1.2.orig/debian/pads.postrm +++ pads-1.2/debian/pads.postrm @@ -0,0 +1,11 @@ +#!/bin/sh -e + +if [ "$1" = "purge" ] ; then + rm -f /var/lib/pads/* +fi + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + --- pads-1.2.orig/debian/compat +++ pads-1.2/debian/compat @@ -0,0 +1 @@ +5 --- pads-1.2.orig/debian/watch +++ pads-1.2/debian/watch @@ -0,0 +1,2 @@ +version=3 +http://sf.net/passive/ pads-([\d+\.]+|\d+).tar.gz debian uupdate --- pads-1.2.orig/debian/pads.default +++ pads-1.2/debian/pads.default @@ -0,0 +1,5 @@ +# defaults file for pads daemon mode + +# default daemon options +OPTS="-D -c /etc/pads/pads.conf" + --- pads-1.2.orig/debian/TODO +++ pads-1.2/debian/TODO @@ -0,0 +1,10 @@ +TODO for PADS +------------- + +- Configure init script w/ debconf to configure the interface and network?) + +- w/ debconf to configure the interface and network? + +- The manpage needs to be reviewed, it references some manpages + which are not available (pads-archive could be a separate package). + --- pads-1.2.orig/debian/rules +++ pads-1.2/debian/rules @@ -0,0 +1,85 @@ +#!/usr/bin/make -f +# -*- makefile -*- + +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 + +# These are used for cross-compiling and for saving the configure script +# from having to guess our platform (since we know it already) +DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) +DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) + + +CFLAGS = -Wall -g + +ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) + CFLAGS += -O0 +else + CFLAGS += -O2 +endif + +config.status: configure + dh_testdir + CFLAGS="$(CFLAGS)" ./configure --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) --prefix=/usr --mandir=\$${prefix}/share/man --infodir=\$${prefix}/share/info --sysconfdir=/etc/pads + + +build: build-stamp + +build-stamp: config.status + dh_testdir + $(MAKE) + touch build-stamp + +clean: + dh_testdir + dh_testroot + rm -f build-stamp + [ ! -f Makefile ] || $(MAKE) distclean +ifneq "$(wildcard /usr/share/misc/config.sub)" "" + cp -f /usr/share/misc/config.sub config.sub +endif +ifneq "$(wildcard /usr/share/misc/config.guess)" "" + cp -f /usr/share/misc/config.guess config.guess +endif + dh_clean + +install: build + dh_testdir + dh_testroot + dh_clean -k + dh_installdirs + + # Add here commands to install the package into debian/pads. + cd src && $(MAKE) install DESTDIR=$(CURDIR)/debian/pads + cd etc && $(MAKE) install DESTDIR=$(CURDIR)/debian/pads + # docs are installed via pads.docs + # manpages are installed via pads.manpages + + +# Build architecture-independent files here. +binary-indep: build install +# We have nothing to do by default. + +# Build architecture-dependent files here. +binary-arch: build install + dh_testdir + dh_testroot + dh_installchangelogs doc/ChangeLog + dh_installdocs + dh_installexamples +# dh_installlogrotate + dh_installinit +# dh_installcron + dh_installman + dh_link + dh_strip + dh_compress + dh_fixperms + dh_installdeb + dh_shlibdeps + dh_gencontrol + dh_md5sums + dh_builddeb + +binary: binary-indep binary-arch +.PHONY: build clean binary-indep binary-arch binary install --- pads-1.2.orig/debian/control +++ pads-1.2/debian/control @@ -0,0 +1,25 @@ +Source: pads +Section: net +Priority: optional +Maintainer: Ubuntu Developers +XSBC-Original-Maintainer: David Gil +Uploaders: Javier Fernandez-Sanguino Pen~a +Build-Depends: debhelper (>= 5.0.0), libpcre3-dev, libpcap0.8-dev +Standards-Version: 3.7.3 +Homepage: http://passive.sourceforge.net +Vcs-Cvs: -d:pserver:anonymous@passive.cvs.sf.net:/cvsroot/passive +Vcs-Browser: http://passive.cvs.sf.net/passive/pads/ + +Package: pads +Architecture: any +Depends: ${shlibs:Depends}, lsb-base (>= 3.0-6) +Description: Passive Asset Detection System + Pads is a signature based detection engine used to passively + detect network assets. It can determine which systems are + alive in the network as well as the services they make use + of. It is designed to complement IDS technology by providing + context to IDS alerts. Unlike other tools, like nmap, it will + not generate any network traffic which makes it useful to + run both on network capture files and promiscuous mode + interfaces. + --- pads-1.2.orig/debian/pads.docs +++ pads-1.2/debian/pads.docs @@ -0,0 +1,3 @@ +doc/AUTHORS +doc/CREDITS +doc/README --- pads-1.2.orig/debian/pads.dirs +++ pads-1.2/debian/pads.dirs @@ -0,0 +1,4 @@ +usr/bin/ +usr/share/doc/pads +var/lib/pads +etc/pads --- pads-1.2.orig/debian/README +++ pads-1.2/debian/README @@ -0,0 +1,10 @@ + +Please note that pads is no longer being maintained upstream by its original +author. + +A fork of PADS can be found at https://github.com/gamelinux/pads but it has +not been evaluated yet. It might be used to update Debian's version. + + +-- Javier Fernandez-Sanguino +Sun, 12 Jun 2011 18:12:00 +0200 --- pads-1.2.orig/debian/pads.init +++ pads-1.2/debian/pads.init @@ -0,0 +1,121 @@ +#! /bin/sh + +### BEGIN INIT INFO +# Provides: pads +# Required-Start: $network $local_fs $remote_fs +# Required-Stop: $network $local_fs $remote_fs +# Should-Start: $syslog +# Should-Stop: $syslog +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: Passive asset detection system +# Description: Signature based detection engine used to passively +# detect network assets. +### END INIT INFO + +set -e + +. /lib/lsb/init-functions + +PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin +DESC="Passive Asset Detection System" +NAME=pads +DAEMON=/usr/bin/$NAME +PIDFILE=/var/run/$NAME.pid +SCRIPTNAME=/etc/init.d/$NAME + +# Gracefully exit if the package has been removed. +test -x $DAEMON || exit 0 + +# Default options +OPTS="-D -c /etc/pads/pads.conf" + +# Read config file if it is present. +if [ -r /etc/default/$NAME ] +then + . /etc/default/$NAME +fi + +running() { + if [ -f "$PIDFILE" ] && \ + [ "x`pidof -s $NAME`" = "x`cat $PIDFILE 2> /dev/null`" ] + then + return 0 + fi + return 1 +} + +# +# Function that starts the daemon/service. +# +d_start() { + start-stop-daemon --start --quiet --pidfile $PIDFILE \ + --exec $DAEMON -- $OPTS > /dev/null +} + +# +# Function that stops the daemon/service. +# +d_stop() { + start-stop-daemon --stop --quiet --pidfile $PIDFILE \ + --name $NAME +} + +# +# Function that sends a SIGHUP to the daemon/service. +# +d_reload() { + start-stop-daemon --stop --quiet --pidfile $PIDFILE \ + --name $NAME --signal 1 +} + +case "$1" in + start) + log_daemon_msg "Starting $DESC" "$NAME" + if running ; then + log_progress_msg "(already running)" + log_end_msg 0 + exit 0 + fi + if d_start ; then + log_end_msg $? + else + log_end_msg $? + fi + ;; + stop) + log_daemon_msg "Stopping $DESC" "$NAME" + if ! running; then + log_progress_msg "not running" + log_end_msg 0 + exit 0 + fi + if d_stop ; then + log_end_msg $? + else + log_end_msg $? + exit 0 + fi + ;; + status) + log_daemon_msg "Checking status of $DESC" "$NAME" + if running ; then + log_progress_msg "running" + log_end_msg $? + else + log_progress_msg "not running" + log_end_msg $? + fi + ;; + restart|reload|force-reload) + $0 stop + sleep 1 + $0 start + ;; + *) + echo "Usage: $SCRIPTNAME {start|stop|status|restart|reload|force-reload}" >&2 + exit 1 + ;; +esac + +exit 0 --- pads-1.2.orig/debian/copyright +++ pads-1.2/debian/copyright @@ -0,0 +1,39 @@ +This package was debianized by David Gil and +Javier Fernandez-Sanguino on +Mon, 20 Jun 2005 16:52:31 +0200. + +It was downloaded from http://passive.sourceforge.net/ + +Copyright Holder: (c) 2004 Matt Shelton + +This code also includes source files part of the bstring string library. +The bstring code was written by Paul Hsieh in 2002-2004, and is covered by +the BSD open source license. + +License: + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This package 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; version 2 dated June, 1991. + + This package 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 package; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. + +On Debian GNU/Linux systems, the complete text of version 2 of the GNU General +Public License can be found in `/usr/share/common-licenses/GPL-2'. + + The bstring library is distributed under the BSD license + +On Debian GNU/Linux systems, the complete text of the BSD License +can be found in `/usr/share/common-licenses/BSD'. --- pads-1.2.orig/debian/changelog +++ pads-1.2/debian/changelog @@ -0,0 +1,130 @@ +pads (1.2-11ubuntu1) oneiric; urgency=low + + * patch configure to use LIBS instead of LD_FLAGS + - fixes build with ld --as-needed (LP: #770979) + + -- Julian Taylor Sun, 21 Aug 2011 16:37:01 +0200 + +pads (1.2-11) unstable; urgency=low + + * Update maintainer's email address + * src/util.c: + - Flush stdout/stderr before child process closes them, preventing a + segfault + - Fix the pid file code so that it does not segfault if no name is + explicitly set + - Make the PID file always have the children (not parent's) pid + These changes are based on the patch provided by David J. Bianco in the + sourceforge bug id #1731419 + (LP: #282590) + * src/pads.c: Fix the process_cmdline funcion so that the -p option is + properly recognised (Sourceforge bug 1267011) + * debian/README: Indicate that the Sourceforge version is not being + maintained + * Lintian fixes: + - doc/pads.8: Fix error from man by indenting apostrophe + - debian/copyright: Point to version 2 and indicate that the license is + "GPL version 2 or later" + + -- Javier Fernandez-Sanguino Pen~a Sun, 12 Jun 2011 18:11:04 +0200 + +pads (1.2-10) unstable; urgency=low + + * Fixed bashism (Closes: #476763) + + -- David Gil Mon, 12 May 2008 14:59:17 +0200 + +pads (1.2-9) unstable; urgency=low + + * debian/pads.init: + + gracefully exit if the daemon is not running when trying to stop it + (Fixed bug "cannot upgrade when pads is not running", Closes: #474165) + + use pidof -s instead of standalone pidof for checking running process + + -- David Gil Fri, 04 Apr 2008 09:23:50 +0200 + +pads (1.2-8) unstable; urgency=low + + * debian/pads.init: Make init script LSB-compliant: + + add LSB header (Closes: #468882) + + new action status (requested into policy, see #291148). + * debian/watch: Fixed watch file (Closes: #450027). + * debian/control: + + Added Homepage and Vcs-{Cvs,Browser} control fields. + + Update to policy version 3.7.3 (no changes). + + Use debhelper compat level 5, update debhelper build-depend + * debian/{rules,compat}: Removed DH_COMPAT environment variable in + debian/rules. Created a debian/compat file instead. + * debian/rules: don't ignore all erros doing make distclean + + -- David Gil Tue, 01 Apr 2008 10:16:11 +0200 + +pads (1.2-7) unstable; urgency=low + + * Modified default daemon options to "-D -c /etc/pads/pads.conf" + * Pointed output plugins to /var/lib/pads/ directory. + * Switched the init script to lsb-base + * Updated FSF address + * Added watch file + + -- David Gil Sat, 05 Nov 2005 16:26:57 +0100 + +pads (1.2-6) unstable; urgency=low + + * Small change to the TODO + * Prefedined OPTS if /etc/default/pads does not exist + + -- Javier Fernandez-Sanguino Pen~a Tue, 26 Jul 2005 19:54:34 +0200 + +pads (1.2-5) unstable; urgency=low + + * Added init script file: + - debian/pads.init: initscript file for pads. + - debian/pads.default: default options for pads daemon mode. + - debian/pads.dirs: added /var/lib/pads/ directory. + - debian/rules: use dh_installinit. + - debian/pads.postrm: remove all files under /var/lib/pads. + * Changed my e-mail address. + + -- David Gil Mon, 18 Jul 2005 19:43:27 +0200 + +pads (1.2-4) unstable; urgency=low + + * Code taken from upstream CVS: + - Fixed several compile warnings. + - Adjusted all documentation and man pages to be 72 characters wide. + - Identation updated in output plugins. + * Bump Standards-Version to 3.6.2 (no policy-related changes needed). + + -- David Gil Sat, 16 Jul 2005 17:59:53 +0200 + +pads (1.2-3) unstable; urgency=low + + * Use etc's Makefile to install configuration files + * Fixed segmentation fault running pads in daemon mode + + -- David Gil Thu, 23 Jun 2005 15:00:26 +0200 + +pads (1.2-2) unstable; urgency=low + + * Removed autotools-dev from Build-Deps + * Cleaned up debian/rules + * Added a TODO under debian/ + * Use src's Makefile to install + * Slight improvements to debian/control + * Added Homepage: to debian/control + * Added the BSD license to debian/copyright as it is the license used + by the bstring library included in this package + * Added myself to the Uploaders: field + * Fixed warnings under src/ (introducing some new along the way) which + involves many changes in headers so that they can be safely included + from other headers. + + -- Javier Fernandez-Sanguino Pen~a Mon, 20 Jun 2005 23:04:36 +0200 + +pads (1.2-1) unstable; urgency=low + + * Initial Release. + + -- David Gil Mon, 20 Jun 2005 16:52:31 +0200 + --- pads-1.2.orig/debian/pads.manpages +++ pads-1.2/debian/pads.manpages @@ -0,0 +1,3 @@ +doc/pads-report.8 +doc/pads.8 +doc/pads.conf.8 --- pads-1.2.orig/doc/pads.8 +++ pads-1.2/doc/pads.8 @@ -20,7 +20,7 @@ .\" along with this program; if not, write to the Free Software .\" Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. .\" -.\" $Id: pads.8,v 1.2 2005/06/15 21:57:51 mattshelton Exp $ +.\" $Id: pads.8,v 1.2 2005/11/02 23:56:12 jfs Exp $ .TH PADS 8 2005/06/17 .SH NAME @@ -49,23 +49,23 @@ .SH DESCRIPTION -PADS is a libpcap based detection engine used to passively detect network -assets. It is designed to complement IDS technology by providing context to -IDS alerts. +PADS is a libpcap based detection engine used to passively detect +network assets. It is designed to complement IDS technology by +providing context to IDS alerts. Goals: -- Passive: Records and identifies traffic seen on a network without actively - "scanning" a system. There will never be a packet sent from the pads - application. - -- Portable: Has the ability to be placed easily on a remote system. Does not - require additional external libraries other than those associated with - libpcap. - -- Lightweight: Logging is sent to a simple CSV file. There is no need for a - database or other data repository installed on the local machine. All - correlation is done outside of the pads program. +- Passive: Records and identifies traffic seen on a network without + actively "scanning" a system. There will never be a packet sent from + the pads application. + +- Portable: Has the ability to be placed easily on a remote system. + Does not require additional external libraries other than those + associated with libpcap. + +- Lightweight: Logging is sent to a simple CSV file. There is no need + for a database or other data repository installed on the local + machine. All correlation is done outside of the pads program. .SH OPTIONS .IP -h @@ -75,18 +75,18 @@ Run PADS in the background (daemon mode). .IP "-d file" -Dump banner data into a libpcap formatted file. This feature will dump the -matched packet or the first 4 packets of an unmatched connection into a -specified file. This can be used to further identify a service and also aid -with signature development. - -Please keep in mind that this feature must be compiled into the application in -order to use it. This can be done by adding '--enable-banner-grab' to the -'configure' step. +Dump banner data into a libpcap formatted file. This feature will dump +the matched packet or the first 4 packets of an unmatched connection +into a specified file. This can be used to further identify a service +and also aid with signature development. + +Please keep in mind that this feature must be compiled into the +application in order to use it. This can be done by adding +\'--enable-banner-grab' to the 'configure' step. .IP "-g group" -This switch allows you to specify a group that PADS will drop to after the -libpcap interface has been initialized. +This switch allows you to specify a group that PADS will drop to after +the libpcap interface has been initialized. .IP -h Display help @@ -95,28 +95,28 @@ Specify an interface to be used. .IP "-n network list" -Specify a set of networks to be monitored. Only assets that exist within -these networks will be recorded. The networks should be specified in the -following format: \fI +Specify a set of networks to be monitored. Only assets that exist +within these networks will be recorded. The networks should be +specified in the following format: \fI 10.10.10.0/24,192.168.0.0/16 \fP. .IP "-p pid file" -This switch allows you to specify a PID file to be used in conjunction with -daemon (-D) mode. +This switch allows you to specify a PID file to be used in conjunction +with daemon (-D) mode. .IP "-r file" Read packets from a libpcap formatted file. .IP "-u user" -This switch allows you to specify a user that PADS will drop to after the -libpcap interface has been initialized. +This switch allows you to specify a user that PADS will drop to after +the libpcap interface has been initialized. .IP "-w file" Dump data into a file other than assets.csv. .IP "\fI expression\fP" -selects which packets will be processed. Please see \fI tcpdump(1)\fP for -details on the libpcap primitives. +selects which packets will be processed. Please see \fI tcpdump(1)\fP +for details on the libpcap primitives. .SH SEE ALSO pads.conf(8), pads-report(8), pads-archiver(8), tcpdump(8), pcre(3) @@ -129,3 +129,5 @@ .SH AUTHORS Matt Shelton + +.\" vim:tw=72 expandtab: --- pads-1.2.orig/doc/ChangeLog +++ pads-1.2/doc/ChangeLog @@ -1,5 +1,5 @@ Passive Asset Detection System -$Id: ChangeLog,v 1.2 2005/06/15 22:06:52 mattshelton Exp $ +$Id: ChangeLog,v 1.2 2005/11/02 23:56:12 jfs Exp $ ------------------------------------------ v1.2 * Banner Grab Feature - This feature will drop the banners of services into a --- pads-1.2.orig/doc/Makefile.am +++ pads-1.2/doc/Makefile.am @@ -1,4 +1,4 @@ -## $Id: Makefile.am,v 1.2 2005/06/15 21:58:49 mattshelton Exp $ +## $Id: Makefile.am,v 1.2 2005/11/02 23:56:12 jfs Exp $ AUTOMAKE_OPTIONS=foreign no-dependencies EXTRA_DIST = AUTHORS ChangeLog COPYING CREDITS INSTALL pads.8 pads.conf.8 pads-report.8 README --- pads-1.2.orig/doc/pads.conf.8 +++ pads-1.2/doc/pads.conf.8 @@ -20,7 +20,7 @@ .\" along with this program; if not, write to the Free Software .\" Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. .\" -.\" $Id: pads.conf.8,v 1.1 2005/06/15 21:57:12 mattshelton Exp $ +.\" $Id: pads.conf.8,v 1.2 2005/11/02 23:56:12 jfs Exp $ .TH pads.conf 8 2005/06/17 .SH NAME @@ -34,7 +34,8 @@ .SH PARAMETERS .IP "daemon [0/1]" -his parameter determines whether the application will go into the background. +his parameter determines whether the application will go into the +background. 0 = Disable, 1 = Enable .IP "pid_file " @@ -57,21 +58,21 @@ This contains the name of the interface PADS will listen to. .IP "filter " -This value contains a libpcap filter to be applied to the PADS session. For -example, to filter only SSH traffice, specify "filter 'port 22'". +This value contains a libpcap filter to be applied to the PADS session. +For example, to filter only SSH traffice, specify "filter 'port 22'". .IP "network " -This string contains a comma seperated list of networks to be monitored. Only -assets found in these networks will be recorded. For example, "network -192.168.0.0/24,192.168.1.0/24,10.10.10.0/24". +This string contains a comma seperated list of networks to be monitored. +Only assets found in these networks will be recorded. For example, + "network 192.168.0.0/24,192.168.1.0/24,10.10.10.0/24". .IP "output screen" This output plugin displays PADS data to the screen. When using the configuration file, it defaults to off. .IP "output csv: " -This output plugin writes PADS data to a CSV file. Optionally, a CSV filename -can be specified as an argument. +This output plugin writes PADS data to a CSV file. Optionally, a CSV +filename can be specified as an argument. .IP "output fifo: " This output plugin writes PADS data to a FIFO file. Optionally, a FIFO @@ -88,3 +89,5 @@ .SH AUTHORS Matt Shelton + +.\" vim:tw=72 expandtab: --- pads-1.2.orig/doc/README +++ pads-1.2/doc/README @@ -4,45 +4,55 @@ Goals: -- Passive: Records and identifies traffic seen on a network without actively "scanning" a system. - There will never be a packet sent from the pads applications. - -- Portable: Has the ability to be placed easily on a remote system. Does not require additional - external libraries other than those associated with libpcap. - -- Lightweight: Logging is sent to a simple CSV file. There is no need for a database or other data - repository installed on the local machine. All correlation is done outside of the pads program. +- Passive: Records and identifies traffic seen on a network without + actively "scanning" a system. There will never be a packet sent from + the pads applications. + +- Portable: Has the ability to be placed easily on a remote system. + Does not require additional external libraries other than those + associated with libpcap. + +- Lightweight: Logging is sent to a simple CSV file. There is no need + for a database or other data repository installed on the local + machine. All correlation is done outside of the pads program. Description: -Asset management is an important factor in information security. A good security administrator should -keep track of all devices attached to the network. Even though active scanners such as nmap and Nessus -are valuable tools, sometimes it necessary to identify network devices in a passive manner. Pads was -developed to sit along side the promiscuous interface of an IDS device. It will listen to network traffic -and attempt to identify the applications running on the network. +Asset management is an important factor in information security. A good +security administrator should keep track of all devices attached to the +network. Even though active scanners such as nmap and Nessus are +valuable tools, sometimes it necessary to identify network devices in a +passive manner. Pads was developed to sit along side the promiscuous +interface of an IDS device. It will listen to network traffic and +attempt to identify the applications running on the network. Author's Notes: -By day I am an IDS analyst for a managed security provider. One of the challenges I face on a daily -basis is the inability to obtain customer asset data, particularly with the larger customers. This -information is critical not only for analysis but also device placement and tuning. - -Many IDS deployments consist of a device with two interfaces. One interface contains a promiscuous -link to a remote network and the other link is for management and lives in the DMZ. This makes -active network scanners, like nmap, useless because the IDS team does not have anything but a one -way link into the network. They can only listen to traffic, not produce anything. - -Pads was developed to solve this problem. It is modeled after my favorite scanning tool nmap, -specifically the .-sV. option. Unlike nmap, it will not generate any traffic while mapping the -network. Unfortunately, this method is potentially less accurate than active scanning but is often -necessary in an IDS environment. - -As mentioned earlier, I am an IDS analyst by day. I see programming as a tool to aid me in my job. -This project was developed outside of work since I do not get paid to code. It was written to -fulfill a need for me. Hopefully others within the community will also get the chance to benefit -from it. +By day I am an IDS analyst for a managed security provider. One of the +challenges I face on a daily basis is the inability to obtain customer +asset data, particularly with the larger customers. This information is +critical not only for analysis but also device placement and tuning. + +Many IDS deployments consist of a device with two interfaces. One +interface contains a promiscuous link to a remote network and the other +link is for management and lives in the DMZ. This makes active network +scanners, like nmap, useless because the IDS team does not have anything +but a one way link into the network. They can only listen to traffic, +not produce anything. + +Pads was developed to solve this problem. It is modeled after my +favorite scanning tool nmap, specifically the .-sV. option. Unlike +nmap, it will not generate any traffic while mapping the network. +Unfortunately, this method is potentially less accurate than active +scanning but is often necessary in an IDS environment. + +As mentioned earlier, I am an IDS analyst by day. I see programming as +a tool to aid me in my job. This project was developed outside of work +since I do not get paid to code. It was written to fulfill a need for +me. Hopefully others within the community will also get the chance to +benefit from it. Usage: @@ -63,26 +73,30 @@ -V : Version -w : Dump data into file other than assets.csv. -Additional arguments will be processed as a libpcap filter. For example, -the following command will not only use interface hme1 but will also only -search for assets on port 22: +Additional arguments will be processed as a libpcap filter. For +example, the following command will not only use interface hme1 but will +also only search for assets on port 22: pads -i hme1 port 22 Misc: -Regular expression support is provided by the PCRE library package, which is open source software, -written by Philip Hazel, and copyright by the University of Cambridge, England. It can be found on -the following FTP site: - ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/ +Regular expression support is provided by the PCRE library package, +which is open source software, written by Philip Hazel, and copyright by +the University of Cambridge, England. It can be found on the following +FTP site: + ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/ Feedback: -Please let me know if you have constuctive feedback, need help, or have a bug / issue with the -application. For the time being, please contact me at matt@mattshelton.com. +Please let me know if you have constuctive feedback, need help, or have +a bug / issue with the application. For the time being, please contact +me at matt@mattshelton.com. Thanks, Matt Shelton -$Id: README,v 1.2 2005/06/15 22:09:34 mattshelton Exp $ +-- +vim:expandtab:sw=4:ts=4:tw=72: +$Id: README,v 1.2 2005/11/02 23:56:12 jfs Exp $ --- pads-1.2.orig/doc/pads-report.8 +++ pads-1.2/doc/pads-report.8 @@ -20,7 +20,7 @@ .\" along with this program; if not, write to the Free Software .\" Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. .\" -.\" $Id: pads-report.8,v 1.2 2005/06/15 22:02:19 mattshelton Exp $ +.\" $Id: pads-report.8,v 1.2 2005/11/02 23:56:12 jfs Exp $ .TH PADS 8 2005/06/17 .SH NAME @@ -35,8 +35,9 @@ .SH DESCRIPTION -pads-report is a Perl based reporting module to be used with Passive Asset Detection System (PADS). It will take -a raw PADS data file and process it into a readable text report. +pads-report is a Perl based reporting module to be used with Passive +Asset Detection System (PADS). It will take a raw PADS data file and +process it into a readable text report. .SH OPTIONS .IP -h @@ -46,8 +47,8 @@ Do not convert IP addresses to names. .IP -p -Do not convert RFC 1918 IP addresses to names. The \fI -n\fP option will -override this option. +Do not convert RFC 1918 IP addresses to names. The \fI -n\fP option +will override this option. .IP "-r file" Read packets from a libpcap formatted file. @@ -66,3 +67,5 @@ .SH AUTHORS Matt Shelton + +.\" vim:tw=72 expandtab: --- pads-1.2.orig/doc/INSTALL +++ pads-1.2/doc/INSTALL @@ -2,27 +2,34 @@ ------------ To install PADS, execute the following standard 'autoconf' commands: - ./configure - make - make install - -Optionally, run './configure --help' for additional command line options. The following -options may be used: - ---disable-vendor : This option will disable MAC vendor resolution. This will - : speed up the application. - ---enable-banner-grab : Compile in the banner grabbing feature. This feature will - : dump the asset banners into a libpcap-formatted file. This - : feature will help further identify services and will aid in - : signature development. Please keep in mind that this will - : slow down performance + ./configure + make + make install + +Optionally, run './configure --help' for additional command line +options. The following options may be used: + +--disable-vendor : This option will disable MAC vendor + : resolution. This will : speed up the + : application. + +--enable-banner-grab : Compile in the banner grabbing feature. This + : feature will : dump the asset banners into a + : libpcap-formatted file. This feature will + : help further identify services and will aid in + : signature development. Please keep in mind + : that this will : slow down performance + +--use-native-pcre : Use the existing PCRE libraries instead of the + : ones included. This will shrink the size of + : the executable. ---use-native-pcre : Use the existing PCRE libraries instead of the ones included. - : This will shrink the size of the executable. - -The libpcap library must be installed before you compile pads. It can be downloaded from -http://www.tcpdump.org. +The libpcap library must be installed before you compile pads. It can +be downloaded from http://www.tcpdump.org. Matt Shelton matt@mattshelton.com + +-- +vim:expandtab:tw=72 +$Id: INSTALL,v 1.2 2005/11/02 23:56:12 jfs Exp $ --- pads-1.2.orig/etc/pads-signature-list +++ pads-1.2/etc/pads-signature-list @@ -19,7 +19,7 @@ # surrounding /'s. The signature should have one or two sets of ()'s # depending on the Version Info field. # -# $Id: pads-signature-list,v 1.1 2005/02/10 06:05:03 mattshelton Exp $ +# $Id: pads-signature-list,v 1.2 2005/11/02 23:56:12 jfs Exp $ # ############################################################################ ssh,v/OpenSSH/$2/Protocol $1/,SSH-([.\d]+)-OpenSSH[_-](\S+) --- pads-1.2.orig/etc/Makefile.am +++ pads-1.2/etc/Makefile.am @@ -1,4 +1,4 @@ -## $Id: Makefile.am,v 1.2 2005/05/14 20:13:20 mattshelton Exp $ +## $Id: Makefile.am,v 1.2 2005/11/02 23:56:12 jfs Exp $ AUTOMAKE_OPTIONS=foreign no-dependencies EXTRA_DIST = pads* --- pads-1.2.orig/etc/pads.conf +++ pads-1.2/etc/pads.conf @@ -7,7 +7,7 @@ # This file contains configuration parameters for the PADS application. Please # visit http://passive.sourceforge.net for further information. # -# $Id: pads.conf,v 1.5 2005/05/21 16:35:11 mattshelton Exp $ +# $Id: pads.conf,v 1.3 2005/11/06 16:09:54 dgil-guest Exp $ # # ------------------------------------------------------------------------------ @@ -68,10 +68,10 @@ # ------------------------- # This output plugin writes PADS data to a CSV file. Optionally, a CSV filename # can be specified as an argument. -output csv: assets.csv +output csv: /var/lib/pads/assets.csv # output: fifo # ------------------------- # This output plugin writes PADS data to a FIFO file. Optionally, a FIFO # filename can be specified as an argument. -#output fifo: pads.fifo +#output fifo: /var/lib/pads/pads.fifo --- pads-1.2.orig/etc/pads-ether-codes +++ pads-1.2/etc/pads-ether-codes @@ -5,7 +5,7 @@ # This file contains vendor codes used to map MAC addresses to vendor # names. It was taken from the Ettercap. # -# $Id: pads-ether-codes,v 1.1 2005/02/10 06:05:01 mattshelton Exp $ +# $Id: pads-ether-codes,v 1.2 2005/11/02 23:56:12 jfs Exp $ # ############################################################################