updated on Thu Jan 26 16:09:46 UTC 2012
[aur-mirror.git] / pads / pads-patch-deb.diff
blob7df0574853e88026ac2bf416264c4dfe5a08c817
1 diff -ur pads-1.2/config.guess pads-1.2.mod//config.guess
2 --- pads-1.2/config.guess 2004-09-29 07:15:05.000000000 +0200
3 +++ pads-1.2.mod//config.guess 2010-12-19 14:27:38.706667834 +0100
4 @@ -1,9 +1,10 @@
5 #! /bin/sh
6 # Attempt to guess a canonical system name.
7 # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
8 -# 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
9 +# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
10 +# Free Software Foundation, Inc.
12 -timestamp='2004-09-07'
13 +timestamp='2008-01-23'
15 # This file is free software; you can redistribute it and/or modify it
16 # under the terms of the GNU General Public License as published by
17 @@ -17,13 +18,15 @@
19 # You should have received a copy of the GNU General Public License
20 # along with this program; if not, write to the Free Software
21 -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22 +# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
23 +# 02110-1301, USA.
25 # As a special exception to the GNU General Public License, if you
26 # distribute this file as part of a program that contains a
27 # configuration script generated by Autoconf, you may include it under
28 # the same distribution terms that you use for the rest of that program.
31 # Originally written by Per Bothner <per@bothner.com>.
32 # Please send patches to <config-patches@gnu.org>. Submit a context
33 # diff and a properly formatted ChangeLog entry.
34 @@ -53,8 +56,8 @@
35 GNU config.guess ($timestamp)
37 Originally written by Per Bothner.
38 -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
39 -Free Software Foundation, Inc.
40 +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
41 +2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
43 This is free software; see the source for copying conditions. There is NO
44 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
45 @@ -66,11 +69,11 @@
46 while test $# -gt 0 ; do
47 case $1 in
48 --time-stamp | --time* | -t )
49 - echo "$timestamp" ; exit 0 ;;
50 + echo "$timestamp" ; exit ;;
51 --version | -v )
52 - echo "$version" ; exit 0 ;;
53 + echo "$version" ; exit ;;
54 --help | --h* | -h )
55 - echo "$usage"; exit 0 ;;
56 + echo "$usage"; exit ;;
57 -- ) # Stop option processing
58 shift; break ;;
59 - ) # Use stdin as input.
60 @@ -104,7 +107,7 @@
61 trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
62 trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
63 : ${TMPDIR=/tmp} ;
64 - { tmp=`(umask 077 && mktemp -d -q "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
65 + { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
66 { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
67 { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
68 { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
69 @@ -123,7 +126,7 @@
71 ,,*) CC_FOR_BUILD=$CC ;;
72 ,*,*) CC_FOR_BUILD=$HOST_CC ;;
73 -esac ;'
74 +esac ; set_cc_for_build= ;'
76 # This is needed to find uname on a Pyramid OSx when run in the BSD universe.
77 # (ghazi@noc.rutgers.edu 1994-08-24)
78 @@ -158,6 +161,7 @@
79 arm*) machine=arm-unknown ;;
80 sh3el) machine=shl-unknown ;;
81 sh3eb) machine=sh-unknown ;;
82 + sh5el) machine=sh5le-unknown ;;
83 *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
84 esac
85 # The Operating System including object format, if it has switched
86 @@ -196,55 +200,23 @@
87 # contains redundant information, the shorter form:
88 # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
89 echo "${machine}-${os}${release}"
90 - exit 0 ;;
91 - amd64:OpenBSD:*:*)
92 - echo x86_64-unknown-openbsd${UNAME_RELEASE}
93 - exit 0 ;;
94 - amiga:OpenBSD:*:*)
95 - echo m68k-unknown-openbsd${UNAME_RELEASE}
96 - exit 0 ;;
97 - cats:OpenBSD:*:*)
98 - echo arm-unknown-openbsd${UNAME_RELEASE}
99 - exit 0 ;;
100 - hp300:OpenBSD:*:*)
101 - echo m68k-unknown-openbsd${UNAME_RELEASE}
102 - exit 0 ;;
103 - luna88k:OpenBSD:*:*)
104 - echo m88k-unknown-openbsd${UNAME_RELEASE}
105 - exit 0 ;;
106 - mac68k:OpenBSD:*:*)
107 - echo m68k-unknown-openbsd${UNAME_RELEASE}
108 - exit 0 ;;
109 - macppc:OpenBSD:*:*)
110 - echo powerpc-unknown-openbsd${UNAME_RELEASE}
111 - exit 0 ;;
112 - mvme68k:OpenBSD:*:*)
113 - echo m68k-unknown-openbsd${UNAME_RELEASE}
114 - exit 0 ;;
115 - mvme88k:OpenBSD:*:*)
116 - echo m88k-unknown-openbsd${UNAME_RELEASE}
117 - exit 0 ;;
118 - mvmeppc:OpenBSD:*:*)
119 - echo powerpc-unknown-openbsd${UNAME_RELEASE}
120 - exit 0 ;;
121 - sgi:OpenBSD:*:*)
122 - echo mips64-unknown-openbsd${UNAME_RELEASE}
123 - exit 0 ;;
124 - sun3:OpenBSD:*:*)
125 - echo m68k-unknown-openbsd${UNAME_RELEASE}
126 - exit 0 ;;
127 + exit ;;
128 *:OpenBSD:*:*)
129 - echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE}
130 - exit 0 ;;
131 + UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
132 + echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
133 + exit ;;
134 *:ekkoBSD:*:*)
135 echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
136 - exit 0 ;;
137 + exit ;;
138 + *:SolidBSD:*:*)
139 + echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
140 + exit ;;
141 macppc:MirBSD:*:*)
142 - echo powerppc-unknown-mirbsd${UNAME_RELEASE}
143 - exit 0 ;;
144 + echo powerpc-unknown-mirbsd${UNAME_RELEASE}
145 + exit ;;
146 *:MirBSD:*:*)
147 echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
148 - exit 0 ;;
149 + exit ;;
150 alpha:OSF1:*:*)
151 case $UNAME_RELEASE in
152 *4.0)
153 @@ -297,37 +269,43 @@
154 # A Xn.n version is an unreleased experimental baselevel.
155 # 1.2 uses "1.2" for uname -r.
156 echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
157 - exit 0 ;;
158 + exit ;;
159 Alpha\ *:Windows_NT*:*)
160 # How do we know it's Interix rather than the generic POSIX subsystem?
161 # Should we change UNAME_MACHINE based on the output of uname instead
162 # of the specific Alpha model?
163 echo alpha-pc-interix
164 - exit 0 ;;
165 + exit ;;
166 21064:Windows_NT:50:3)
167 echo alpha-dec-winnt3.5
168 - exit 0 ;;
169 + exit ;;
170 Amiga*:UNIX_System_V:4.0:*)
171 echo m68k-unknown-sysv4
172 - exit 0;;
173 + exit ;;
174 *:[Aa]miga[Oo][Ss]:*:*)
175 echo ${UNAME_MACHINE}-unknown-amigaos
176 - exit 0 ;;
177 + exit ;;
178 *:[Mm]orph[Oo][Ss]:*:*)
179 echo ${UNAME_MACHINE}-unknown-morphos
180 - exit 0 ;;
181 + exit ;;
182 *:OS/390:*:*)
183 echo i370-ibm-openedition
184 - exit 0 ;;
185 + exit ;;
186 + *:z/VM:*:*)
187 + echo s390-ibm-zvmoe
188 + exit ;;
189 *:OS400:*:*)
190 echo powerpc-ibm-os400
191 - exit 0 ;;
192 + exit ;;
193 arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
194 echo arm-acorn-riscix${UNAME_RELEASE}
195 - exit 0;;
196 + exit ;;
197 + arm:riscos:*:*|arm:RISCOS:*:*)
198 + echo arm-unknown-riscos
199 + exit ;;
200 SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
201 echo hppa1.1-hitachi-hiuxmpp
202 - exit 0;;
203 + exit ;;
204 Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
205 # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
206 if test "`(/bin/universe) 2>/dev/null`" = att ; then
207 @@ -335,32 +313,32 @@
208 else
209 echo pyramid-pyramid-bsd
211 - exit 0 ;;
212 + exit ;;
213 NILE*:*:*:dcosx)
214 echo pyramid-pyramid-svr4
215 - exit 0 ;;
216 + exit ;;
217 DRS?6000:unix:4.0:6*)
218 echo sparc-icl-nx6
219 - exit 0 ;;
220 - DRS?6000:UNIX_SV:4.2*:7*)
221 + exit ;;
222 + DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
223 case `/usr/bin/uname -p` in
224 - sparc) echo sparc-icl-nx7 && exit 0 ;;
225 + sparc) echo sparc-icl-nx7; exit ;;
226 esac ;;
227 sun4H:SunOS:5.*:*)
228 echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
229 - exit 0 ;;
230 + exit ;;
231 sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
232 echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
233 - exit 0 ;;
234 - i86pc:SunOS:5.*:*)
235 + exit ;;
236 + i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
237 echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
238 - exit 0 ;;
239 + exit ;;
240 sun4*:SunOS:6*:*)
241 # According to config.sub, this is the proper way to canonicalize
242 # SunOS6. Hard to guess exactly what SunOS6 will be like, but
243 # it's likely to be more like Solaris than SunOS4.
244 echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
245 - exit 0 ;;
246 + exit ;;
247 sun4*:SunOS:*:*)
248 case "`/usr/bin/arch -k`" in
249 Series*|S4*)
250 @@ -369,10 +347,10 @@
251 esac
252 # Japanese Language versions have a version number like `4.1.3-JL'.
253 echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
254 - exit 0 ;;
255 + exit ;;
256 sun3*:SunOS:*:*)
257 echo m68k-sun-sunos${UNAME_RELEASE}
258 - exit 0 ;;
259 + exit ;;
260 sun*:*:4.2BSD:*)
261 UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
262 test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
263 @@ -384,10 +362,10 @@
264 echo sparc-sun-sunos${UNAME_RELEASE}
266 esac
267 - exit 0 ;;
268 + exit ;;
269 aushp:SunOS:*:*)
270 echo sparc-auspex-sunos${UNAME_RELEASE}
271 - exit 0 ;;
272 + exit ;;
273 # The situation for MiNT is a little confusing. The machine name
274 # can be virtually everything (everything which is not
275 # "atarist" or "atariste" at least should have a processor
276 @@ -398,40 +376,40 @@
277 # be no problem.
278 atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
279 echo m68k-atari-mint${UNAME_RELEASE}
280 - exit 0 ;;
281 + exit ;;
282 atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
283 echo m68k-atari-mint${UNAME_RELEASE}
284 - exit 0 ;;
285 + exit ;;
286 *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
287 echo m68k-atari-mint${UNAME_RELEASE}
288 - exit 0 ;;
289 + exit ;;
290 milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
291 echo m68k-milan-mint${UNAME_RELEASE}
292 - exit 0 ;;
293 + exit ;;
294 hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
295 echo m68k-hades-mint${UNAME_RELEASE}
296 - exit 0 ;;
297 + exit ;;
298 *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
299 echo m68k-unknown-mint${UNAME_RELEASE}
300 - exit 0 ;;
301 + exit ;;
302 m68k:machten:*:*)
303 echo m68k-apple-machten${UNAME_RELEASE}
304 - exit 0 ;;
305 + exit ;;
306 powerpc:machten:*:*)
307 echo powerpc-apple-machten${UNAME_RELEASE}
308 - exit 0 ;;
309 + exit ;;
310 RISC*:Mach:*:*)
311 echo mips-dec-mach_bsd4.3
312 - exit 0 ;;
313 + exit ;;
314 RISC*:ULTRIX:*:*)
315 echo mips-dec-ultrix${UNAME_RELEASE}
316 - exit 0 ;;
317 + exit ;;
318 VAX*:ULTRIX*:*:*)
319 echo vax-dec-ultrix${UNAME_RELEASE}
320 - exit 0 ;;
321 + exit ;;
322 2020:CLIX:*:* | 2430:CLIX:*:*)
323 echo clipper-intergraph-clix${UNAME_RELEASE}
324 - exit 0 ;;
325 + exit ;;
326 mips:*:*:UMIPS | mips:*:*:RISCos)
327 eval $set_cc_for_build
328 sed 's/^ //' << EOF >$dummy.c
329 @@ -455,32 +433,33 @@
330 exit (-1);
333 - $CC_FOR_BUILD -o $dummy $dummy.c \
334 - && $dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \
335 - && exit 0
336 + $CC_FOR_BUILD -o $dummy $dummy.c &&
337 + dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` &&
338 + SYSTEM_NAME=`$dummy $dummyarg` &&
339 + { echo "$SYSTEM_NAME"; exit; }
340 echo mips-mips-riscos${UNAME_RELEASE}
341 - exit 0 ;;
342 + exit ;;
343 Motorola:PowerMAX_OS:*:*)
344 echo powerpc-motorola-powermax
345 - exit 0 ;;
346 + exit ;;
347 Motorola:*:4.3:PL8-*)
348 echo powerpc-harris-powermax
349 - exit 0 ;;
350 + exit ;;
351 Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
352 echo powerpc-harris-powermax
353 - exit 0 ;;
354 + exit ;;
355 Night_Hawk:Power_UNIX:*:*)
356 echo powerpc-harris-powerunix
357 - exit 0 ;;
358 + exit ;;
359 m88k:CX/UX:7*:*)
360 echo m88k-harris-cxux7
361 - exit 0 ;;
362 + exit ;;
363 m88k:*:4*:R4*)
364 echo m88k-motorola-sysv4
365 - exit 0 ;;
366 + exit ;;
367 m88k:*:3*:R3*)
368 echo m88k-motorola-sysv3
369 - exit 0 ;;
370 + exit ;;
371 AViiON:dgux:*:*)
372 # DG/UX returns AViiON for all architectures
373 UNAME_PROCESSOR=`/usr/bin/uname -p`
374 @@ -496,29 +475,29 @@
375 else
376 echo i586-dg-dgux${UNAME_RELEASE}
378 - exit 0 ;;
379 + exit ;;
380 M88*:DolphinOS:*:*) # DolphinOS (SVR3)
381 echo m88k-dolphin-sysv3
382 - exit 0 ;;
383 + exit ;;
384 M88*:*:R3*:*)
385 # Delta 88k system running SVR3
386 echo m88k-motorola-sysv3
387 - exit 0 ;;
388 + exit ;;
389 XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
390 echo m88k-tektronix-sysv3
391 - exit 0 ;;
392 + exit ;;
393 Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
394 echo m68k-tektronix-bsd
395 - exit 0 ;;
396 + exit ;;
397 *:IRIX*:*:*)
398 echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
399 - exit 0 ;;
400 + exit ;;
401 ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
402 - echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id
403 - exit 0 ;; # Note that: echo "'`uname -s`'" gives 'AIX '
404 + echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id
405 + exit ;; # Note that: echo "'`uname -s`'" gives 'AIX '
406 i*86:AIX:*:*)
407 echo i386-ibm-aix
408 - exit 0 ;;
409 + exit ;;
410 ia64:AIX:*:*)
411 if [ -x /usr/bin/oslevel ] ; then
412 IBM_REV=`/usr/bin/oslevel`
413 @@ -526,7 +505,7 @@
414 IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
416 echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
417 - exit 0 ;;
418 + exit ;;
419 *:AIX:2:3)
420 if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
421 eval $set_cc_for_build
422 @@ -541,15 +520,19 @@
423 exit(0);
426 - $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0
427 - echo rs6000-ibm-aix3.2.5
428 + if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy`
429 + then
430 + echo "$SYSTEM_NAME"
431 + else
432 + echo rs6000-ibm-aix3.2.5
433 + fi
434 elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
435 echo rs6000-ibm-aix3.2.4
436 else
437 echo rs6000-ibm-aix3.2
439 - exit 0 ;;
440 - *:AIX:*:[45])
441 + exit ;;
442 + *:AIX:*:[456])
443 IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
444 if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
445 IBM_ARCH=rs6000
446 @@ -562,28 +545,28 @@
447 IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
449 echo ${IBM_ARCH}-ibm-aix${IBM_REV}
450 - exit 0 ;;
451 + exit ;;
452 *:AIX:*:*)
453 echo rs6000-ibm-aix
454 - exit 0 ;;
455 + exit ;;
456 ibmrt:4.4BSD:*|romp-ibm:BSD:*)
457 echo romp-ibm-bsd4.4
458 - exit 0 ;;
459 + exit ;;
460 ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and
461 echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to
462 - exit 0 ;; # report: romp-ibm BSD 4.3
463 + exit ;; # report: romp-ibm BSD 4.3
464 *:BOSX:*:*)
465 echo rs6000-bull-bosx
466 - exit 0 ;;
467 + exit ;;
468 DPX/2?00:B.O.S.:*:*)
469 echo m68k-bull-sysv3
470 - exit 0 ;;
471 + exit ;;
472 9000/[34]??:4.3bsd:1.*:*)
473 echo m68k-hp-bsd
474 - exit 0 ;;
475 + exit ;;
476 hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
477 echo m68k-hp-bsd4.4
478 - exit 0 ;;
479 + exit ;;
480 9000/[34678]??:HP-UX:*:*)
481 HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
482 case "${UNAME_MACHINE}" in
483 @@ -645,9 +628,19 @@
484 esac
485 if [ ${HP_ARCH} = "hppa2.0w" ]
486 then
487 - # avoid double evaluation of $set_cc_for_build
488 - test -n "$CC_FOR_BUILD" || eval $set_cc_for_build
489 - if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E -) | grep __LP64__ >/dev/null
490 + eval $set_cc_for_build
492 + # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
493 + # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler
494 + # generating 64-bit code. GNU and HP use different nomenclature:
496 + # $ CC_FOR_BUILD=cc ./config.guess
497 + # => hppa2.0w-hp-hpux11.23
498 + # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
499 + # => hppa64-hp-hpux11.23
501 + if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
502 + grep __LP64__ >/dev/null
503 then
504 HP_ARCH="hppa2.0w"
505 else
506 @@ -655,11 +648,11 @@
509 echo ${HP_ARCH}-hp-hpux${HPUX_REV}
510 - exit 0 ;;
511 + exit ;;
512 ia64:HP-UX:*:*)
513 HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
514 echo ia64-hp-hpux${HPUX_REV}
515 - exit 0 ;;
516 + exit ;;
517 3050*:HI-UX:*:*)
518 eval $set_cc_for_build
519 sed 's/^ //' << EOF >$dummy.c
520 @@ -687,158 +680,192 @@
521 exit (0);
524 - $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0
525 + $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` &&
526 + { echo "$SYSTEM_NAME"; exit; }
527 echo unknown-hitachi-hiuxwe2
528 - exit 0 ;;
529 + exit ;;
530 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
531 echo hppa1.1-hp-bsd
532 - exit 0 ;;
533 + exit ;;
534 9000/8??:4.3bsd:*:*)
535 echo hppa1.0-hp-bsd
536 - exit 0 ;;
537 + exit ;;
538 *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
539 echo hppa1.0-hp-mpeix
540 - exit 0 ;;
541 + exit ;;
542 hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
543 echo hppa1.1-hp-osf
544 - exit 0 ;;
545 + exit ;;
546 hp8??:OSF1:*:*)
547 echo hppa1.0-hp-osf
548 - exit 0 ;;
549 + exit ;;
550 i*86:OSF1:*:*)
551 if [ -x /usr/sbin/sysversion ] ; then
552 echo ${UNAME_MACHINE}-unknown-osf1mk
553 else
554 echo ${UNAME_MACHINE}-unknown-osf1
556 - exit 0 ;;
557 + exit ;;
558 parisc*:Lites*:*:*)
559 echo hppa1.1-hp-lites
560 - exit 0 ;;
561 + exit ;;
562 C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
563 echo c1-convex-bsd
564 - exit 0 ;;
565 + exit ;;
566 C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
567 if getsysinfo -f scalar_acc
568 then echo c32-convex-bsd
569 else echo c2-convex-bsd
571 - exit 0 ;;
572 + exit ;;
573 C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
574 echo c34-convex-bsd
575 - exit 0 ;;
576 + exit ;;
577 C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
578 echo c38-convex-bsd
579 - exit 0 ;;
580 + exit ;;
581 C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
582 echo c4-convex-bsd
583 - exit 0 ;;
584 + exit ;;
585 CRAY*Y-MP:*:*:*)
586 echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
587 - exit 0 ;;
588 + exit ;;
589 CRAY*[A-Z]90:*:*:*)
590 echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
591 | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
592 -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
593 -e 's/\.[^.]*$/.X/'
594 - exit 0 ;;
595 + exit ;;
596 CRAY*TS:*:*:*)
597 echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
598 - exit 0 ;;
599 + exit ;;
600 CRAY*T3E:*:*:*)
601 echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
602 - exit 0 ;;
603 + exit ;;
604 CRAY*SV1:*:*:*)
605 echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
606 - exit 0 ;;
607 + exit ;;
608 *:UNICOS/mp:*:*)
609 echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
610 - exit 0 ;;
611 + exit ;;
612 F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
613 FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
614 FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
615 FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
616 echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
617 - exit 0 ;;
618 + exit ;;
619 5000:UNIX_System_V:4.*:*)
620 FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
621 FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
622 echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
623 - exit 0 ;;
624 + exit ;;
625 i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
626 echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
627 - exit 0 ;;
628 + exit ;;
629 sparc*:BSD/OS:*:*)
630 echo sparc-unknown-bsdi${UNAME_RELEASE}
631 - exit 0 ;;
632 + exit ;;
633 *:BSD/OS:*:*)
634 echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
635 - exit 0 ;;
636 + exit ;;
637 *:FreeBSD:*:*)
638 - echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
639 - exit 0 ;;
640 + case ${UNAME_MACHINE} in
641 + pc98)
642 + echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
643 + amd64)
644 + echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
645 + *)
646 + echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
647 + esac
648 + exit ;;
649 i*:CYGWIN*:*)
650 echo ${UNAME_MACHINE}-pc-cygwin
651 - exit 0 ;;
652 - i*:MINGW*:*)
653 + exit ;;
654 + *:MINGW*:*)
655 echo ${UNAME_MACHINE}-pc-mingw32
656 - exit 0 ;;
657 + exit ;;
658 + i*:windows32*:*)
659 + # uname -m includes "-pc" on this system.
660 + echo ${UNAME_MACHINE}-mingw32
661 + exit ;;
662 i*:PW*:*)
663 echo ${UNAME_MACHINE}-pc-pw32
664 - exit 0 ;;
665 - x86:Interix*:[34]*)
666 - echo i586-pc-interix${UNAME_RELEASE}|sed -e 's/\..*//'
667 - exit 0 ;;
668 + exit ;;
669 + *:Interix*:[3456]*)
670 + case ${UNAME_MACHINE} in
671 + x86)
672 + echo i586-pc-interix${UNAME_RELEASE}
673 + exit ;;
674 + EM64T | authenticamd)
675 + echo x86_64-unknown-interix${UNAME_RELEASE}
676 + exit ;;
677 + IA64)
678 + echo ia64-unknown-interix${UNAME_RELEASE}
679 + exit ;;
680 + esac ;;
681 [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
682 echo i${UNAME_MACHINE}-pc-mks
683 - exit 0 ;;
684 + exit ;;
685 i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
686 # How do we know it's Interix rather than the generic POSIX subsystem?
687 # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
688 # UNAME_MACHINE based on the output of uname instead of i386?
689 echo i586-pc-interix
690 - exit 0 ;;
691 + exit ;;
692 i*:UWIN*:*)
693 echo ${UNAME_MACHINE}-pc-uwin
694 - exit 0 ;;
695 + exit ;;
696 + amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
697 + echo x86_64-unknown-cygwin
698 + exit ;;
699 p*:CYGWIN*:*)
700 echo powerpcle-unknown-cygwin
701 - exit 0 ;;
702 + exit ;;
703 prep*:SunOS:5.*:*)
704 echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
705 - exit 0 ;;
706 + exit ;;
707 *:GNU:*:*)
708 # the GNU system
709 echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
710 - exit 0 ;;
711 + exit ;;
712 *:GNU/*:*:*)
713 # other systems with GNU libc and userland
714 echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
715 - exit 0 ;;
716 + exit ;;
717 i*86:Minix:*:*)
718 echo ${UNAME_MACHINE}-pc-minix
719 - exit 0 ;;
720 + exit ;;
721 arm*:Linux:*:*)
722 + eval $set_cc_for_build
723 + if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
724 + | grep -q __ARM_EABI__
725 + then
726 + echo ${UNAME_MACHINE}-unknown-linux-gnu
727 + else
728 + echo ${UNAME_MACHINE}-unknown-linux-gnueabi
729 + fi
730 + exit ;;
731 + avr32*:Linux:*:*)
732 echo ${UNAME_MACHINE}-unknown-linux-gnu
733 - exit 0 ;;
734 + exit ;;
735 cris:Linux:*:*)
736 echo cris-axis-linux-gnu
737 - exit 0 ;;
738 + exit ;;
739 crisv32:Linux:*:*)
740 echo crisv32-axis-linux-gnu
741 - exit 0 ;;
742 + exit ;;
743 frv:Linux:*:*)
744 echo frv-unknown-linux-gnu
745 - exit 0 ;;
746 + exit ;;
747 ia64:Linux:*:*)
748 echo ${UNAME_MACHINE}-unknown-linux-gnu
749 - exit 0 ;;
750 + exit ;;
751 m32r*:Linux:*:*)
752 echo ${UNAME_MACHINE}-unknown-linux-gnu
753 - exit 0 ;;
754 + exit ;;
755 m68*:Linux:*:*)
756 echo ${UNAME_MACHINE}-unknown-linux-gnu
757 - exit 0 ;;
758 + exit ;;
759 mips:Linux:*:*)
760 eval $set_cc_for_build
761 sed 's/^ //' << EOF >$dummy.c
762 @@ -855,8 +882,12 @@
763 #endif
764 #endif
766 - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
767 - test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0
768 + eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
769 + /^CPU/{
770 + s: ::g
772 + }'`"
773 + test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
775 mips64:Linux:*:*)
776 eval $set_cc_for_build
777 @@ -874,15 +905,22 @@
778 #endif
779 #endif
781 - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
782 - test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0
783 + eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
784 + /^CPU/{
785 + s: ::g
787 + }'`"
788 + test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
790 + or32:Linux:*:*)
791 + echo or32-unknown-linux-gnu
792 + exit ;;
793 ppc:Linux:*:*)
794 echo powerpc-unknown-linux-gnu
795 - exit 0 ;;
796 + exit ;;
797 ppc64:Linux:*:*)
798 echo powerpc64-unknown-linux-gnu
799 - exit 0 ;;
800 + exit ;;
801 alpha:Linux:*:*)
802 case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
803 EV5) UNAME_MACHINE=alphaev5 ;;
804 @@ -896,7 +934,7 @@
805 objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null
806 if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
807 echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
808 - exit 0 ;;
809 + exit ;;
810 parisc:Linux:*:* | hppa:Linux:*:*)
811 # Look for CPU level
812 case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
813 @@ -904,25 +942,31 @@
814 PA8*) echo hppa2.0-unknown-linux-gnu ;;
815 *) echo hppa-unknown-linux-gnu ;;
816 esac
817 - exit 0 ;;
818 + exit ;;
819 parisc64:Linux:*:* | hppa64:Linux:*:*)
820 echo hppa64-unknown-linux-gnu
821 - exit 0 ;;
822 + exit ;;
823 s390:Linux:*:* | s390x:Linux:*:*)
824 echo ${UNAME_MACHINE}-ibm-linux
825 - exit 0 ;;
826 + exit ;;
827 sh64*:Linux:*:*)
828 echo ${UNAME_MACHINE}-unknown-linux-gnu
829 - exit 0 ;;
830 + exit ;;
831 sh*:Linux:*:*)
832 echo ${UNAME_MACHINE}-unknown-linux-gnu
833 - exit 0 ;;
834 + exit ;;
835 sparc:Linux:*:* | sparc64:Linux:*:*)
836 echo ${UNAME_MACHINE}-unknown-linux-gnu
837 - exit 0 ;;
838 + exit ;;
839 + vax:Linux:*:*)
840 + echo ${UNAME_MACHINE}-dec-linux-gnu
841 + exit ;;
842 x86_64:Linux:*:*)
843 echo x86_64-unknown-linux-gnu
844 - exit 0 ;;
845 + exit ;;
846 + xtensa*:Linux:*:*)
847 + echo ${UNAME_MACHINE}-unknown-linux-gnu
848 + exit ;;
849 i*86:Linux:*:*)
850 # The BFD linker knows what the default object file format is, so
851 # first see if it will tell us. cd to the root directory to prevent
852 @@ -940,15 +984,15 @@
854 a.out-i386-linux)
855 echo "${UNAME_MACHINE}-pc-linux-gnuaout"
856 - exit 0 ;;
857 + exit ;;
858 coff-i386)
859 echo "${UNAME_MACHINE}-pc-linux-gnucoff"
860 - exit 0 ;;
861 + exit ;;
863 # Either a pre-BFD a.out linker (linux-gnuoldld) or
864 # one that does not give us useful --help.
865 echo "${UNAME_MACHINE}-pc-linux-gnuoldld"
866 - exit 0 ;;
867 + exit ;;
868 esac
869 # Determine whether the default compiler is a.out or elf
870 eval $set_cc_for_build
871 @@ -965,7 +1009,7 @@
872 LIBC=gnulibc1
873 # endif
874 #else
875 - #ifdef __INTEL_COMPILER
876 + #if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC)
877 LIBC=gnu
878 #else
879 LIBC=gnuaout
880 @@ -975,16 +1019,23 @@
881 LIBC=dietlibc
882 #endif
884 - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`
885 - test x"${LIBC}" != x && echo "${UNAME_MACHINE}-pc-linux-${LIBC}" && exit 0
886 - test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0
887 + eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
888 + /^LIBC/{
889 + s: ::g
891 + }'`"
892 + test x"${LIBC}" != x && {
893 + echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
894 + exit
896 + test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; }
898 i*86:DYNIX/ptx:4*:*)
899 # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
900 # earlier versions are messed up and put the nodename in both
901 # sysname and nodename.
902 echo i386-sequent-sysv4
903 - exit 0 ;;
904 + exit ;;
905 i*86:UNIX_SV:4.2MP:2.*)
906 # Unixware is an offshoot of SVR4, but it has its own version
907 # number series starting with 2...
908 @@ -992,27 +1043,27 @@
909 # I just have to hope. -- rms.
910 # Use sysv4.2uw... so that sysv4* matches it.
911 echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
912 - exit 0 ;;
913 + exit ;;
914 i*86:OS/2:*:*)
915 # If we were able to find `uname', then EMX Unix compatibility
916 # is probably installed.
917 echo ${UNAME_MACHINE}-pc-os2-emx
918 - exit 0 ;;
919 + exit ;;
920 i*86:XTS-300:*:STOP)
921 echo ${UNAME_MACHINE}-unknown-stop
922 - exit 0 ;;
923 + exit ;;
924 i*86:atheos:*:*)
925 echo ${UNAME_MACHINE}-unknown-atheos
926 - exit 0 ;;
927 - i*86:syllable:*:*)
928 + exit ;;
929 + i*86:syllable:*:*)
930 echo ${UNAME_MACHINE}-pc-syllable
931 - exit 0 ;;
932 + exit ;;
933 i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
934 echo i386-unknown-lynxos${UNAME_RELEASE}
935 - exit 0 ;;
936 + exit ;;
937 i*86:*DOS:*:*)
938 echo ${UNAME_MACHINE}-pc-msdosdjgpp
939 - exit 0 ;;
940 + exit ;;
941 i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
942 UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
943 if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
944 @@ -1020,15 +1071,16 @@
945 else
946 echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
948 - exit 0 ;;
949 - i*86:*:5:[78]*)
950 + exit ;;
951 + i*86:*:5:[678]*)
952 + # UnixWare 7.x, OpenUNIX and OpenServer 6.
953 case `/bin/uname -X | grep "^Machine"` in
954 *486*) UNAME_MACHINE=i486 ;;
955 *Pentium) UNAME_MACHINE=i586 ;;
956 *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
957 esac
958 echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
959 - exit 0 ;;
960 + exit ;;
961 i*86:*:3.2:*)
962 if test -f /usr/options/cb.name; then
963 UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
964 @@ -1046,73 +1098,73 @@
965 else
966 echo ${UNAME_MACHINE}-pc-sysv32
968 - exit 0 ;;
969 + exit ;;
970 pc:*:*:*)
971 # Left here for compatibility:
972 # uname -m prints for DJGPP always 'pc', but it prints nothing about
973 # the processor, so we play safe by assuming i386.
974 echo i386-pc-msdosdjgpp
975 - exit 0 ;;
976 + exit ;;
977 Intel:Mach:3*:*)
978 echo i386-pc-mach3
979 - exit 0 ;;
980 + exit ;;
981 paragon:*:*:*)
982 echo i860-intel-osf1
983 - exit 0 ;;
984 + exit ;;
985 i860:*:4.*:*) # i860-SVR4
986 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
987 echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
988 else # Add other i860-SVR4 vendors below as they are discovered.
989 echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4
991 - exit 0 ;;
992 + exit ;;
993 mini*:CTIX:SYS*5:*)
994 # "miniframe"
995 echo m68010-convergent-sysv
996 - exit 0 ;;
997 + exit ;;
998 mc68k:UNIX:SYSTEM5:3.51m)
999 echo m68k-convergent-sysv
1000 - exit 0 ;;
1001 + exit ;;
1002 M680?0:D-NIX:5.3:*)
1003 echo m68k-diab-dnix
1004 - exit 0 ;;
1005 + exit ;;
1006 M68*:*:R3V[5678]*:*)
1007 - test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;;
1008 + test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;
1009 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)
1010 OS_REL=''
1011 test -r /etc/.relid \
1012 && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
1013 /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
1014 - && echo i486-ncr-sysv4.3${OS_REL} && exit 0
1015 + && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
1016 /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
1017 - && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;;
1018 + && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
1019 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
1020 /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
1021 - && echo i486-ncr-sysv4 && exit 0 ;;
1022 + && { echo i486-ncr-sysv4; exit; } ;;
1023 m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
1024 echo m68k-unknown-lynxos${UNAME_RELEASE}
1025 - exit 0 ;;
1026 + exit ;;
1027 mc68030:UNIX_System_V:4.*:*)
1028 echo m68k-atari-sysv4
1029 - exit 0 ;;
1030 + exit ;;
1031 TSUNAMI:LynxOS:2.*:*)
1032 echo sparc-unknown-lynxos${UNAME_RELEASE}
1033 - exit 0 ;;
1034 + exit ;;
1035 rs6000:LynxOS:2.*:*)
1036 echo rs6000-unknown-lynxos${UNAME_RELEASE}
1037 - exit 0 ;;
1038 + exit ;;
1039 PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*)
1040 echo powerpc-unknown-lynxos${UNAME_RELEASE}
1041 - exit 0 ;;
1042 + exit ;;
1043 SM[BE]S:UNIX_SV:*:*)
1044 echo mips-dde-sysv${UNAME_RELEASE}
1045 - exit 0 ;;
1046 + exit ;;
1047 RM*:ReliantUNIX-*:*:*)
1048 echo mips-sni-sysv4
1049 - exit 0 ;;
1050 + exit ;;
1051 RM*:SINIX-*:*:*)
1052 echo mips-sni-sysv4
1053 - exit 0 ;;
1054 + exit ;;
1055 *:SINIX-*:*:*)
1056 if uname -p 2>/dev/null >/dev/null ; then
1057 UNAME_MACHINE=`(uname -p) 2>/dev/null`
1058 @@ -1120,69 +1172,81 @@
1059 else
1060 echo ns32k-sni-sysv
1062 - exit 0 ;;
1063 + exit ;;
1064 PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
1065 # says <Richard.M.Bartel@ccMail.Census.GOV>
1066 echo i586-unisys-sysv4
1067 - exit 0 ;;
1068 + exit ;;
1069 *:UNIX_System_V:4*:FTX*)
1070 # From Gerald Hewes <hewes@openmarket.com>.
1071 # How about differentiating between stratus architectures? -djm
1072 echo hppa1.1-stratus-sysv4
1073 - exit 0 ;;
1074 + exit ;;
1075 *:*:*:FTX*)
1076 # From seanf@swdc.stratus.com.
1077 echo i860-stratus-sysv4
1078 - exit 0 ;;
1079 + exit ;;
1080 + i*86:VOS:*:*)
1081 + # From Paul.Green@stratus.com.
1082 + echo ${UNAME_MACHINE}-stratus-vos
1083 + exit ;;
1084 *:VOS:*:*)
1085 # From Paul.Green@stratus.com.
1086 echo hppa1.1-stratus-vos
1087 - exit 0 ;;
1088 + exit ;;
1089 mc68*:A/UX:*:*)
1090 echo m68k-apple-aux${UNAME_RELEASE}
1091 - exit 0 ;;
1092 + exit ;;
1093 news*:NEWS-OS:6*:*)
1094 echo mips-sony-newsos6
1095 - exit 0 ;;
1096 + exit ;;
1097 R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
1098 if [ -d /usr/nec ]; then
1099 echo mips-nec-sysv${UNAME_RELEASE}
1100 else
1101 echo mips-unknown-sysv${UNAME_RELEASE}
1103 - exit 0 ;;
1104 + exit ;;
1105 BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only.
1106 echo powerpc-be-beos
1107 - exit 0 ;;
1108 + exit ;;
1109 BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only.
1110 echo powerpc-apple-beos
1111 - exit 0 ;;
1112 + exit ;;
1113 BePC:BeOS:*:*) # BeOS running on Intel PC compatible.
1114 echo i586-pc-beos
1115 - exit 0 ;;
1116 + exit ;;
1117 SX-4:SUPER-UX:*:*)
1118 echo sx4-nec-superux${UNAME_RELEASE}
1119 - exit 0 ;;
1120 + exit ;;
1121 SX-5:SUPER-UX:*:*)
1122 echo sx5-nec-superux${UNAME_RELEASE}
1123 - exit 0 ;;
1124 + exit ;;
1125 SX-6:SUPER-UX:*:*)
1126 echo sx6-nec-superux${UNAME_RELEASE}
1127 - exit 0 ;;
1128 + exit ;;
1129 + SX-7:SUPER-UX:*:*)
1130 + echo sx7-nec-superux${UNAME_RELEASE}
1131 + exit ;;
1132 + SX-8:SUPER-UX:*:*)
1133 + echo sx8-nec-superux${UNAME_RELEASE}
1134 + exit ;;
1135 + SX-8R:SUPER-UX:*:*)
1136 + echo sx8r-nec-superux${UNAME_RELEASE}
1137 + exit ;;
1138 Power*:Rhapsody:*:*)
1139 echo powerpc-apple-rhapsody${UNAME_RELEASE}
1140 - exit 0 ;;
1141 + exit ;;
1142 *:Rhapsody:*:*)
1143 echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
1144 - exit 0 ;;
1145 + exit ;;
1146 *:Darwin:*:*)
1147 UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
1148 case $UNAME_PROCESSOR in
1149 - *86) UNAME_PROCESSOR=i686 ;;
1150 unknown) UNAME_PROCESSOR=powerpc ;;
1151 esac
1152 echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
1153 - exit 0 ;;
1154 + exit ;;
1155 *:procnto*:*:* | *:QNX:[0123456789]*:*)
1156 UNAME_PROCESSOR=`uname -p`
1157 if test "$UNAME_PROCESSOR" = "x86"; then
1158 @@ -1190,22 +1254,25 @@
1159 UNAME_MACHINE=pc
1161 echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
1162 - exit 0 ;;
1163 + exit ;;
1164 *:QNX:*:4*)
1165 echo i386-pc-qnx
1166 - exit 0 ;;
1167 + exit ;;
1168 + NSE-?:NONSTOP_KERNEL:*:*)
1169 + echo nse-tandem-nsk${UNAME_RELEASE}
1170 + exit ;;
1171 NSR-?:NONSTOP_KERNEL:*:*)
1172 echo nsr-tandem-nsk${UNAME_RELEASE}
1173 - exit 0 ;;
1174 + exit ;;
1175 *:NonStop-UX:*:*)
1176 echo mips-compaq-nonstopux
1177 - exit 0 ;;
1178 + exit ;;
1179 BS2000:POSIX*:*:*)
1180 echo bs2000-siemens-sysv
1181 - exit 0 ;;
1182 + exit ;;
1183 DS/*:UNIX_System_V:*:*)
1184 echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
1185 - exit 0 ;;
1186 + exit ;;
1187 *:Plan9:*:*)
1188 # "uname -m" is not consistent, so use $cputype instead. 386
1189 # is converted to i386 for consistency with other x86
1190 @@ -1216,38 +1283,47 @@
1191 UNAME_MACHINE="$cputype"
1193 echo ${UNAME_MACHINE}-unknown-plan9
1194 - exit 0 ;;
1195 + exit ;;
1196 *:TOPS-10:*:*)
1197 echo pdp10-unknown-tops10
1198 - exit 0 ;;
1199 + exit ;;
1200 *:TENEX:*:*)
1201 echo pdp10-unknown-tenex
1202 - exit 0 ;;
1203 + exit ;;
1204 KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
1205 echo pdp10-dec-tops20
1206 - exit 0 ;;
1207 + exit ;;
1208 XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
1209 echo pdp10-xkl-tops20
1210 - exit 0 ;;
1211 + exit ;;
1212 *:TOPS-20:*:*)
1213 echo pdp10-unknown-tops20
1214 - exit 0 ;;
1215 + exit ;;
1216 *:ITS:*:*)
1217 echo pdp10-unknown-its
1218 - exit 0 ;;
1219 + exit ;;
1220 SEI:*:*:SEIUX)
1221 echo mips-sei-seiux${UNAME_RELEASE}
1222 - exit 0 ;;
1223 + exit ;;
1224 *:DragonFly:*:*)
1225 echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
1226 - exit 0 ;;
1227 + exit ;;
1228 *:*VMS:*:*)
1229 UNAME_MACHINE=`(uname -p) 2>/dev/null`
1230 case "${UNAME_MACHINE}" in
1231 - A*) echo alpha-dec-vms && exit 0 ;;
1232 - I*) echo ia64-dec-vms && exit 0 ;;
1233 - V*) echo vax-dec-vms && exit 0 ;;
1234 - esac
1235 + A*) echo alpha-dec-vms ; exit ;;
1236 + I*) echo ia64-dec-vms ; exit ;;
1237 + V*) echo vax-dec-vms ; exit ;;
1238 + esac ;;
1239 + *:XENIX:*:SysV)
1240 + echo i386-pc-xenix
1241 + exit ;;
1242 + i*86:skyos:*:*)
1243 + echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//'
1244 + exit ;;
1245 + i*86:rdos:*:*)
1246 + echo ${UNAME_MACHINE}-pc-rdos
1247 + exit ;;
1248 esac
1250 #echo '(No uname command or uname output not recognized.)' 1>&2
1251 @@ -1279,7 +1355,7 @@
1252 #endif
1254 #if defined (__arm) && defined (__acorn) && defined (__unix)
1255 - printf ("arm-acorn-riscix"); exit (0);
1256 + printf ("arm-acorn-riscix\n"); exit (0);
1257 #endif
1259 #if defined (hp300) && !defined (hpux)
1260 @@ -1368,11 +1444,12 @@
1264 -$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && $dummy && exit 0
1265 +$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` &&
1266 + { echo "$SYSTEM_NAME"; exit; }
1268 # Apollos put the system type in the environment.
1270 -test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; }
1271 +test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; }
1273 # Convex versions that predate uname can use getsysinfo(1)
1275 @@ -1381,22 +1458,22 @@
1276 case `getsysinfo -f cpu_type` in
1277 c1*)
1278 echo c1-convex-bsd
1279 - exit 0 ;;
1280 + exit ;;
1281 c2*)
1282 if getsysinfo -f scalar_acc
1283 then echo c32-convex-bsd
1284 else echo c2-convex-bsd
1286 - exit 0 ;;
1287 + exit ;;
1288 c34*)
1289 echo c34-convex-bsd
1290 - exit 0 ;;
1291 + exit ;;
1292 c38*)
1293 echo c38-convex-bsd
1294 - exit 0 ;;
1295 + exit ;;
1296 c4*)
1297 echo c4-convex-bsd
1298 - exit 0 ;;
1299 + exit ;;
1300 esac
1303 @@ -1407,7 +1484,9 @@
1304 the operating system you are using. It is advised that you
1305 download the most up to date version of the config scripts from
1307 - ftp://ftp.gnu.org/pub/gnu/config/
1308 + http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
1309 +and
1310 + http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
1312 If the version you run ($0) is already up to date, please
1313 send the following data and any information you think might be
1314 diff -ur pads-1.2/config.sub pads-1.2.mod//config.sub
1315 --- pads-1.2/config.sub 2004-09-29 07:15:05.000000000 +0200
1316 +++ pads-1.2.mod//config.sub 2010-12-19 14:27:38.723334500 +0100
1317 @@ -1,9 +1,10 @@
1318 #! /bin/sh
1319 # Configuration validation subroutine script.
1320 # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
1321 -# 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
1322 +# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
1323 +# Free Software Foundation, Inc.
1325 -timestamp='2004-08-29'
1326 +timestamp='2008-01-16'
1328 # This file is (in principle) common to ALL GNU software.
1329 # The presence of a machine in this file suggests that SOME GNU software
1330 @@ -21,14 +22,15 @@
1332 # You should have received a copy of the GNU General Public License
1333 # along with this program; if not, write to the Free Software
1334 -# Foundation, Inc., 59 Temple Place - Suite 330,
1335 -# Boston, MA 02111-1307, USA.
1337 +# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
1338 +# 02110-1301, USA.
1340 # As a special exception to the GNU General Public License, if you
1341 # distribute this file as part of a program that contains a
1342 # configuration script generated by Autoconf, you may include it under
1343 # the same distribution terms that you use for the rest of that program.
1346 # Please send patches to <config-patches@gnu.org>. Submit a context
1347 # diff and a properly formatted ChangeLog entry.
1349 @@ -70,8 +72,8 @@
1350 version="\
1351 GNU config.sub ($timestamp)
1353 -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
1354 -Free Software Foundation, Inc.
1355 +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
1356 +2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
1358 This is free software; see the source for copying conditions. There is NO
1359 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
1360 @@ -83,11 +85,11 @@
1361 while test $# -gt 0 ; do
1362 case $1 in
1363 --time-stamp | --time* | -t )
1364 - echo "$timestamp" ; exit 0 ;;
1365 + echo "$timestamp" ; exit ;;
1366 --version | -v )
1367 - echo "$version" ; exit 0 ;;
1368 + echo "$version" ; exit ;;
1369 --help | --h* | -h )
1370 - echo "$usage"; exit 0 ;;
1371 + echo "$usage"; exit ;;
1372 -- ) # Stop option processing
1373 shift; break ;;
1374 - ) # Use stdin as input.
1375 @@ -99,7 +101,7 @@
1376 *local*)
1377 # First pass through any local machine types.
1378 echo $1
1379 - exit 0;;
1380 + exit ;;
1383 break ;;
1384 @@ -118,8 +120,9 @@
1385 # Here we must recognize all the valid KERNEL-OS combinations.
1386 maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
1387 case $maybe_os in
1388 - nto-qnx* | linux-gnu* | linux-dietlibc | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | \
1389 - kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*)
1390 + nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \
1391 + uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \
1392 + storm-chaos* | os2-emx* | rtmk-nova*)
1393 os=-$maybe_os
1394 basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
1396 @@ -170,6 +173,10 @@
1397 -hiux*)
1398 os=-hiuxwe2
1400 + -sco6)
1401 + os=-sco5v6
1402 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
1403 + ;;
1404 -sco5)
1405 os=-sco3.2v5
1406 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
1407 @@ -186,6 +193,10 @@
1408 # Don't forget version if it is 3.2v4 or newer.
1409 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
1411 + -sco5v6*)
1412 + # Don't forget version if it is 3.2v4 or newer.
1413 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
1414 + ;;
1415 -sco*)
1416 os=-sco3.2v2
1417 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
1418 @@ -230,14 +241,16 @@
1419 | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
1420 | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
1421 | am33_2.0 \
1422 - | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \
1423 + | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \
1424 + | bfin \
1425 | c4x | clipper \
1426 | d10v | d30v | dlx | dsp16xx \
1427 - | fr30 | frv \
1428 + | fido | fr30 | frv \
1429 | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
1430 | i370 | i860 | i960 | ia64 \
1431 | ip2k | iq2000 \
1432 - | m32r | m32rle | m68000 | m68k | m88k | mcore \
1433 + | m32c | m32r | m32rle | m68000 | m68k | m88k \
1434 + | maxq | mb | microblaze | mcore | mep \
1435 | mips | mipsbe | mipseb | mipsel | mipsle \
1436 | mips16 \
1437 | mips64 | mips64el \
1438 @@ -246,6 +259,7 @@
1439 | mips64vr4100 | mips64vr4100el \
1440 | mips64vr4300 | mips64vr4300el \
1441 | mips64vr5000 | mips64vr5000el \
1442 + | mips64vr5900 | mips64vr5900el \
1443 | mipsisa32 | mipsisa32el \
1444 | mipsisa32r2 | mipsisa32r2el \
1445 | mipsisa64 | mipsisa64el \
1446 @@ -254,20 +268,24 @@
1447 | mipsisa64sr71k | mipsisa64sr71kel \
1448 | mipstx39 | mipstx39el \
1449 | mn10200 | mn10300 \
1450 + | mt \
1451 | msp430 \
1452 + | nios | nios2 \
1453 | ns16k | ns32k \
1454 - | openrisc | or32 \
1455 + | or32 \
1456 | pdp10 | pdp11 | pj | pjl \
1457 | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
1458 | pyramid \
1459 - | sh | sh[1234] | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \
1460 + | score \
1461 + | sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
1462 | sh64 | sh64le \
1463 - | sparc | sparc64 | sparc86x | sparclet | sparclite | sparcv8 | sparcv9 | sparcv9b \
1464 - | strongarm \
1465 + | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
1466 + | sparcv8 | sparcv9 | sparcv9b | sparcv9v \
1467 + | spu | strongarm \
1468 | tahoe | thumb | tic4x | tic80 | tron \
1469 | v850 | v850e \
1470 | we32k \
1471 - | x86 | xscale | xstormy16 | xtensa \
1472 + | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \
1473 | z8k)
1474 basic_machine=$basic_machine-unknown
1476 @@ -278,6 +296,9 @@
1478 m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
1480 + ms1)
1481 + basic_machine=mt-unknown
1482 + ;;
1484 # We use `pc' rather than `unknown'
1485 # because (1) that's what they normally are, and
1486 @@ -297,20 +318,20 @@
1487 | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
1488 | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
1489 | arm-* | armbe-* | armle-* | armeb-* | armv*-* \
1490 - | avr-* \
1491 - | bs2000-* \
1492 + | avr-* | avr32-* \
1493 + | bfin-* | bs2000-* \
1494 | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
1495 | clipper-* | craynv-* | cydra-* \
1496 | d10v-* | d30v-* | dlx-* \
1497 | elxsi-* \
1498 - | f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \
1499 + | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
1500 | h8300-* | h8500-* \
1501 | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
1502 | i*86-* | i860-* | i960-* | ia64-* \
1503 | ip2k-* | iq2000-* \
1504 - | m32r-* | m32rle-* \
1505 + | m32c-* | m32r-* | m32rle-* \
1506 | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
1507 - | m88110-* | m88k-* | mcore-* \
1508 + | m88110-* | m88k-* | maxq-* | mcore-* \
1509 | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
1510 | mips16-* \
1511 | mips64-* | mips64el-* \
1512 @@ -319,6 +340,7 @@
1513 | mips64vr4100-* | mips64vr4100el-* \
1514 | mips64vr4300-* | mips64vr4300el-* \
1515 | mips64vr5000-* | mips64vr5000el-* \
1516 + | mips64vr5900-* | mips64vr5900el-* \
1517 | mipsisa32-* | mipsisa32el-* \
1518 | mipsisa32r2-* | mipsisa32r2el-* \
1519 | mipsisa64-* | mipsisa64el-* \
1520 @@ -327,27 +349,34 @@
1521 | mipsisa64sr71k-* | mipsisa64sr71kel-* \
1522 | mipstx39-* | mipstx39el-* \
1523 | mmix-* \
1524 + | mt-* \
1525 | msp430-* \
1526 + | nios-* | nios2-* \
1527 | none-* | np1-* | ns16k-* | ns32k-* \
1528 | orion-* \
1529 | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
1530 | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
1531 | pyramid-* \
1532 | romp-* | rs6000-* \
1533 - | sh-* | sh[1234]-* | sh[23]e-* | sh[34]eb-* | shbe-* \
1534 + | sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
1535 | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
1536 - | sparc-* | sparc64-* | sparc86x-* | sparclet-* | sparclite-* \
1537 - | sparcv8-* | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \
1538 + | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
1539 + | sparclite-* \
1540 + | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \
1541 | tahoe-* | thumb-* \
1542 | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
1543 | tron-* \
1544 | v850-* | v850e-* | vax-* \
1545 | we32k-* \
1546 - | x86-* | x86_64-* | xps100-* | xscale-* | xstormy16-* \
1547 - | xtensa-* \
1548 + | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \
1549 + | xstormy16-* | xtensa*-* \
1550 | ymp-* \
1551 | z8k-*)
1553 + # Recognize the basic CPU types without company name, with glob match.
1554 + xtensa*)
1555 + basic_machine=$basic_machine-unknown
1556 + ;;
1557 # Recognize the various machine names and aliases which stand
1558 # for a CPU type and a company and sometimes even an OS.
1559 386bsd)
1560 @@ -418,6 +447,14 @@
1561 basic_machine=ns32k-sequent
1562 os=-dynix
1564 + blackfin)
1565 + basic_machine=bfin-unknown
1566 + os=-linux
1567 + ;;
1568 + blackfin-*)
1569 + basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
1570 + os=-linux
1571 + ;;
1572 c90)
1573 basic_machine=c90-cray
1574 os=-unicos
1575 @@ -450,8 +487,8 @@
1576 basic_machine=craynv-cray
1577 os=-unicosmp
1579 - cr16c)
1580 - basic_machine=cr16c-unknown
1581 + cr16)
1582 + basic_machine=cr16-unknown
1583 os=-elf
1585 crds | unos)
1586 @@ -489,6 +526,10 @@
1587 basic_machine=m88k-motorola
1588 os=-sysv3
1590 + djgpp)
1591 + basic_machine=i586-pc
1592 + os=-msdosdjgpp
1593 + ;;
1594 dpx20 | dpx20-*)
1595 basic_machine=rs6000-bull
1596 os=-bosx
1597 @@ -639,6 +680,14 @@
1598 basic_machine=m68k-isi
1599 os=-sysv
1601 + m68knommu)
1602 + basic_machine=m68k-unknown
1603 + os=-linux
1604 + ;;
1605 + m68knommu-*)
1606 + basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'`
1607 + os=-linux
1608 + ;;
1609 m88k-omron*)
1610 basic_machine=m88k-omron
1612 @@ -654,6 +703,10 @@
1613 basic_machine=i386-pc
1614 os=-mingw32
1616 + mingw32ce)
1617 + basic_machine=arm-unknown
1618 + os=-mingw32ce
1619 + ;;
1620 miniframe)
1621 basic_machine=m68000-convergent
1623 @@ -679,6 +732,9 @@
1624 basic_machine=i386-pc
1625 os=-msdos
1627 + ms1-*)
1628 + basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
1629 + ;;
1630 mvs)
1631 basic_machine=i370-ibm
1632 os=-mvs
1633 @@ -754,9 +810,8 @@
1634 basic_machine=hppa1.1-oki
1635 os=-proelf
1637 - or32 | or32-*)
1638 + openrisc | openrisc-*)
1639 basic_machine=or32-unknown
1640 - os=-coff
1642 os400)
1643 basic_machine=powerpc-ibm
1644 @@ -778,6 +833,14 @@
1645 basic_machine=i860-intel
1646 os=-osf
1648 + parisc)
1649 + basic_machine=hppa-unknown
1650 + os=-linux
1651 + ;;
1652 + parisc-*)
1653 + basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'`
1654 + os=-linux
1655 + ;;
1656 pbd)
1657 basic_machine=sparc-tti
1659 @@ -787,6 +850,12 @@
1660 pc532 | pc532-*)
1661 basic_machine=ns32k-pc532
1663 + pc98)
1664 + basic_machine=i386-pc
1665 + ;;
1666 + pc98-*)
1667 + basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
1668 + ;;
1669 pentium | p5 | k5 | k6 | nexgen | viac3)
1670 basic_machine=i586-pc
1672 @@ -843,6 +912,10 @@
1673 basic_machine=i586-unknown
1674 os=-pw32
1676 + rdos)
1677 + basic_machine=i386-pc
1678 + os=-rdos
1679 + ;;
1680 rom68k)
1681 basic_machine=m68k-rom68k
1682 os=-coff
1683 @@ -869,6 +942,10 @@
1684 sb1el)
1685 basic_machine=mipsisa64sb1el-unknown
1687 + sde)
1688 + basic_machine=mipsisa32-sde
1689 + os=-elf
1690 + ;;
1691 sei)
1692 basic_machine=mips-sei
1693 os=-seiux
1694 @@ -880,6 +957,9 @@
1695 basic_machine=sh-hitachi
1696 os=-hms
1698 + sh5el)
1699 + basic_machine=sh5le-unknown
1700 + ;;
1701 sh64)
1702 basic_machine=sh64-unknown
1704 @@ -969,6 +1049,10 @@
1705 basic_machine=tic6x-unknown
1706 os=-coff
1708 + tile*)
1709 + basic_machine=tile-unknown
1710 + os=-linux-gnu
1711 + ;;
1712 tx39)
1713 basic_machine=mipstx39-unknown
1715 @@ -1029,6 +1113,10 @@
1716 basic_machine=hppa1.1-winbond
1717 os=-proelf
1719 + xbox)
1720 + basic_machine=i686-pc
1721 + os=-mingw32
1722 + ;;
1723 xps | xps100)
1724 basic_machine=xps100-honeywell
1726 @@ -1078,13 +1166,10 @@
1727 we32k)
1728 basic_machine=we32k-att
1730 - sh3 | sh4 | sh[34]eb | sh[1234]le | sh[23]ele)
1731 + sh[1234] | sh[24]a | sh[34]eb | sh[1234]le | sh[23]ele)
1732 basic_machine=sh-unknown
1734 - sh64)
1735 - basic_machine=sh64-unknown
1736 - ;;
1737 - sparc | sparcv8 | sparcv9 | sparcv9b)
1738 + sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
1739 basic_machine=sparc-sun
1741 cydra)
1742 @@ -1157,20 +1242,23 @@
1743 | -aos* \
1744 | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
1745 | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
1746 - | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* | -openbsd* \
1747 + | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
1748 + | -openbsd* | -solidbsd* \
1749 | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
1750 | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
1751 | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
1752 | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
1753 | -chorusos* | -chorusrdb* \
1754 | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
1755 - | -mingw32* | -linux-gnu* | -linux-uclibc* | -uxpv* | -beos* | -mpeix* | -udk* \
1756 + | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \
1757 + | -uxpv* | -beos* | -mpeix* | -udk* \
1758 | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
1759 | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
1760 | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
1761 | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
1762 | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
1763 - | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly*)
1764 + | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
1765 + | -skyos* | -haiku* | -rdos* | -toppers* | -drops*)
1766 # Remember, each alternative MUST END IN *, to match a version number.
1768 -qnx*)
1769 @@ -1188,7 +1276,7 @@
1770 os=`echo $os | sed -e 's|nto|nto-qnx|'`
1772 -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
1773 - | -windows* | -osx | -abug | -netware* | -os9* | -beos* \
1774 + | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \
1775 | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
1777 -mac*)
1778 @@ -1297,6 +1385,9 @@
1779 -kaos*)
1780 os=-kaos
1782 + -zvmoe)
1783 + os=-zvmoe
1784 + ;;
1785 -none)
1788 @@ -1319,6 +1410,12 @@
1789 # system, and we'll never get to this point.
1791 case $basic_machine in
1792 + score-*)
1793 + os=-elf
1794 + ;;
1795 + spu-*)
1796 + os=-elf
1797 + ;;
1798 *-acorn)
1799 os=-riscix1.2
1801 @@ -1328,9 +1425,9 @@
1802 arm*-semi)
1803 os=-aout
1805 - c4x-* | tic4x-*)
1806 - os=-coff
1807 - ;;
1808 + c4x-* | tic4x-*)
1809 + os=-coff
1810 + ;;
1811 # This must come before the *-dec entry.
1812 pdp10-*)
1813 os=-tops20
1814 @@ -1356,6 +1453,9 @@
1815 m68*-cisco)
1816 os=-aout
1818 + mep-*)
1819 + os=-elf
1820 + ;;
1821 mips*-cisco)
1822 os=-elf
1824 @@ -1374,6 +1474,9 @@
1825 *-be)
1826 os=-beos
1828 + *-haiku)
1829 + os=-haiku
1830 + ;;
1831 *-ibm)
1832 os=-aix
1834 @@ -1545,7 +1648,7 @@
1835 esac
1837 echo $basic_machine$os
1838 -exit 0
1839 +exit
1841 # Local variables:
1842 # eval: (add-hook 'write-file-hooks 'time-stamp)
1843 diff -ur pads-1.2/doc/ChangeLog pads-1.2.mod//doc/ChangeLog
1844 --- pads-1.2/doc/ChangeLog 2005-06-16 00:06:52.000000000 +0200
1845 +++ pads-1.2.mod//doc/ChangeLog 2010-12-19 14:27:38.843334500 +0100
1846 @@ -1,5 +1,5 @@
1847 Passive Asset Detection System
1848 -$Id: ChangeLog,v 1.2 2005/06/15 22:06:52 mattshelton Exp $
1849 +$Id: ChangeLog,v 1.2 2005/11/02 23:56:12 jfs Exp $
1850 ------------------------------------------
1851 v1.2
1852 * Banner Grab Feature - This feature will drop the banners of services into a
1853 diff -ur pads-1.2/doc/INSTALL pads-1.2.mod//doc/INSTALL
1854 --- pads-1.2/doc/INSTALL 2005-02-10 07:05:01.000000000 +0100
1855 +++ pads-1.2.mod//doc/INSTALL 2010-12-19 14:27:38.856667834 +0100
1856 @@ -2,27 +2,34 @@
1857 ------------
1858 To install PADS, execute the following standard 'autoconf' commands:
1860 - ./configure
1861 - make
1862 - make install
1864 -Optionally, run './configure --help' for additional command line options. The following
1865 -options may be used:
1867 ---disable-vendor : This option will disable MAC vendor resolution. This will
1868 - : speed up the application.
1870 ---enable-banner-grab : Compile in the banner grabbing feature. This feature will
1871 - : dump the asset banners into a libpcap-formatted file. This
1872 - : feature will help further identify services and will aid in
1873 - : signature development. Please keep in mind that this will
1874 - : slow down performance
1875 + ./configure
1876 + make
1877 + make install
1879 +Optionally, run './configure --help' for additional command line
1880 +options. The following options may be used:
1882 +--disable-vendor : This option will disable MAC vendor
1883 + : resolution. This will : speed up the
1884 + : application.
1886 +--enable-banner-grab : Compile in the banner grabbing feature. This
1887 + : feature will : dump the asset banners into a
1888 + : libpcap-formatted file. This feature will
1889 + : help further identify services and will aid in
1890 + : signature development. Please keep in mind
1891 + : that this will : slow down performance
1893 +--use-native-pcre : Use the existing PCRE libraries instead of the
1894 + : ones included. This will shrink the size of
1895 + : the executable.
1897 ---use-native-pcre : Use the existing PCRE libraries instead of the ones included.
1898 - : This will shrink the size of the executable.
1900 -The libpcap library must be installed before you compile pads. It can be downloaded from
1901 -http://www.tcpdump.org.
1902 +The libpcap library must be installed before you compile pads. It can
1903 +be downloaded from http://www.tcpdump.org.
1905 Matt Shelton
1906 matt@mattshelton.com
1909 +vim:expandtab:tw=72
1910 +$Id: INSTALL,v 1.2 2005/11/02 23:56:12 jfs Exp $
1911 diff -ur pads-1.2/doc/Makefile.am pads-1.2.mod//doc/Makefile.am
1912 --- pads-1.2/doc/Makefile.am 2005-06-15 23:58:49.000000000 +0200
1913 +++ pads-1.2.mod//doc/Makefile.am 2010-12-19 14:27:38.856667834 +0100
1914 @@ -1,4 +1,4 @@
1915 -## $Id: Makefile.am,v 1.2 2005/06/15 21:58:49 mattshelton Exp $
1916 +## $Id: Makefile.am,v 1.2 2005/11/02 23:56:12 jfs Exp $
1917 AUTOMAKE_OPTIONS=foreign no-dependencies
1918 EXTRA_DIST = AUTHORS ChangeLog COPYING CREDITS INSTALL pads.8 pads.conf.8 pads-report.8 README
1920 diff -ur pads-1.2/doc/pads.8 pads-1.2.mod//doc/pads.8
1921 --- pads-1.2/doc/pads.8 2005-06-15 23:57:51.000000000 +0200
1922 +++ pads-1.2.mod//doc/pads.8 2010-12-19 14:27:38.856667834 +0100
1923 @@ -20,7 +20,7 @@
1924 .\" along with this program; if not, write to the Free Software
1925 .\" Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
1927 -.\" $Id: pads.8,v 1.2 2005/06/15 21:57:51 mattshelton Exp $
1928 +.\" $Id: pads.8,v 1.2 2005/11/02 23:56:12 jfs Exp $
1929 .TH PADS 8 2005/06/17
1931 .SH NAME
1932 @@ -49,23 +49,23 @@
1934 .SH DESCRIPTION
1936 -PADS is a libpcap based detection engine used to passively detect network
1937 -assets. It is designed to complement IDS technology by providing context to
1938 -IDS alerts.
1939 +PADS is a libpcap based detection engine used to passively detect
1940 +network assets. It is designed to complement IDS technology by
1941 +providing context to IDS alerts.
1943 Goals:
1945 -- Passive: Records and identifies traffic seen on a network without actively
1946 - "scanning" a system. There will never be a packet sent from the pads
1947 - application.
1949 -- Portable: Has the ability to be placed easily on a remote system. Does not
1950 - require additional external libraries other than those associated with
1951 - libpcap.
1953 -- Lightweight: Logging is sent to a simple CSV file. There is no need for a
1954 - database or other data repository installed on the local machine. All
1955 - correlation is done outside of the pads program.
1956 +- Passive: Records and identifies traffic seen on a network without
1957 + actively "scanning" a system. There will never be a packet sent from
1958 + the pads application.
1960 +- Portable: Has the ability to be placed easily on a remote system.
1961 + Does not require additional external libraries other than those
1962 + associated with libpcap.
1964 +- Lightweight: Logging is sent to a simple CSV file. There is no need
1965 + for a database or other data repository installed on the local
1966 + machine. All correlation is done outside of the pads program.
1968 .SH OPTIONS
1969 .IP -h
1970 @@ -75,18 +75,18 @@
1971 Run PADS in the background (daemon mode).
1973 .IP "-d file"
1974 -Dump banner data into a libpcap formatted file. This feature will dump the
1975 -matched packet or the first 4 packets of an unmatched connection into a
1976 -specified file. This can be used to further identify a service and also aid
1977 -with signature development.
1979 -Please keep in mind that this feature must be compiled into the application in
1980 -order to use it. This can be done by adding '--enable-banner-grab' to the
1981 -'configure' step.
1982 +Dump banner data into a libpcap formatted file. This feature will dump
1983 +the matched packet or the first 4 packets of an unmatched connection
1984 +into a specified file. This can be used to further identify a service
1985 +and also aid with signature development.
1987 +Please keep in mind that this feature must be compiled into the
1988 +application in order to use it. This can be done by adding
1989 +'--enable-banner-grab' to the 'configure' step.
1991 .IP "-g group"
1992 -This switch allows you to specify a group that PADS will drop to after the
1993 -libpcap interface has been initialized.
1994 +This switch allows you to specify a group that PADS will drop to after
1995 +the libpcap interface has been initialized.
1997 .IP -h
1998 Display help
1999 @@ -95,28 +95,28 @@
2000 Specify an interface to be used.
2002 .IP "-n network list"
2003 -Specify a set of networks to be monitored. Only assets that exist within
2004 -these networks will be recorded. The networks should be specified in the
2005 -following format: \fI
2006 +Specify a set of networks to be monitored. Only assets that exist
2007 +within these networks will be recorded. The networks should be
2008 +specified in the following format: \fI
2009 10.10.10.0/24,192.168.0.0/16 \fP.
2011 .IP "-p pid file"
2012 -This switch allows you to specify a PID file to be used in conjunction with
2013 -daemon (-D) mode.
2014 +This switch allows you to specify a PID file to be used in conjunction
2015 +with daemon (-D) mode.
2017 .IP "-r file"
2018 Read packets from a libpcap formatted file.
2020 .IP "-u user"
2021 -This switch allows you to specify a user that PADS will drop to after the
2022 -libpcap interface has been initialized.
2023 +This switch allows you to specify a user that PADS will drop to after
2024 +the libpcap interface has been initialized.
2026 .IP "-w file"
2027 Dump data into a file other than assets.csv.
2029 .IP "\fI expression\fP"
2030 -selects which packets will be processed. Please see \fI tcpdump(1)\fP for
2031 -details on the libpcap primitives.
2032 +selects which packets will be processed. Please see \fI tcpdump(1)\fP
2033 +for details on the libpcap primitives.
2035 .SH SEE ALSO
2036 pads.conf(8), pads-report(8), pads-archiver(8), tcpdump(8), pcre(3)
2037 @@ -129,3 +129,5 @@
2039 .SH AUTHORS
2040 Matt Shelton <matt@mattshelton.com>
2042 +.\" vim:tw=72 expandtab:
2043 diff -ur pads-1.2/doc/pads.conf.8 pads-1.2.mod//doc/pads.conf.8
2044 --- pads-1.2/doc/pads.conf.8 2005-06-15 23:57:12.000000000 +0200
2045 +++ pads-1.2.mod//doc/pads.conf.8 2010-12-19 14:27:38.856667834 +0100
2046 @@ -20,7 +20,7 @@
2047 .\" along with this program; if not, write to the Free Software
2048 .\" Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
2050 -.\" $Id: pads.conf.8,v 1.1 2005/06/15 21:57:12 mattshelton Exp $
2051 +.\" $Id: pads.conf.8,v 1.2 2005/11/02 23:56:12 jfs Exp $
2052 .TH pads.conf 8 2005/06/17
2054 .SH NAME
2055 @@ -34,7 +34,8 @@
2057 .SH PARAMETERS
2058 .IP "daemon [0/1]"
2059 -his parameter determines whether the application will go into the background.
2060 +his parameter determines whether the application will go into the
2061 +background.
2062 0 = Disable, 1 = Enable
2064 .IP "pid_file <file>"
2065 @@ -57,21 +58,21 @@
2066 This contains the name of the interface PADS will listen to.
2068 .IP "filter <filter>"
2069 -This value contains a libpcap filter to be applied to the PADS session. For
2070 -example, to filter only SSH traffice, specify "filter 'port 22'".
2071 +This value contains a libpcap filter to be applied to the PADS session.
2072 +For example, to filter only SSH traffice, specify "filter 'port 22'".
2074 .IP "network <network>"
2075 -This string contains a comma seperated list of networks to be monitored. Only
2076 -assets found in these networks will be recorded. For example, "network
2077 -192.168.0.0/24,192.168.1.0/24,10.10.10.0/24".
2078 +This string contains a comma seperated list of networks to be monitored.
2079 +Only assets found in these networks will be recorded. For example,
2080 + "network 192.168.0.0/24,192.168.1.0/24,10.10.10.0/24".
2082 .IP "output screen"
2083 This output plugin displays PADS data to the screen. When using the
2084 configuration file, it defaults to off.
2086 .IP "output csv: <filename>"
2087 -This output plugin writes PADS data to a CSV file. Optionally, a CSV filename
2088 -can be specified as an argument.
2089 +This output plugin writes PADS data to a CSV file. Optionally, a CSV
2090 +filename can be specified as an argument.
2092 .IP "output fifo: <filename>"
2093 This output plugin writes PADS data to a FIFO file. Optionally, a FIFO
2094 @@ -88,3 +89,5 @@
2096 .SH AUTHORS
2097 Matt Shelton <matt@mattshelton.com>
2099 +.\" vim:tw=72 expandtab:
2100 diff -ur pads-1.2/doc/pads-report.8 pads-1.2.mod//doc/pads-report.8
2101 --- pads-1.2/doc/pads-report.8 2005-06-16 00:02:19.000000000 +0200
2102 +++ pads-1.2.mod//doc/pads-report.8 2010-12-19 14:27:38.856667834 +0100
2103 @@ -20,7 +20,7 @@
2104 .\" along with this program; if not, write to the Free Software
2105 .\" Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
2107 -.\" $Id: pads-report.8,v 1.2 2005/06/15 22:02:19 mattshelton Exp $
2108 +.\" $Id: pads-report.8,v 1.2 2005/11/02 23:56:12 jfs Exp $
2109 .TH PADS 8 2005/06/17
2111 .SH NAME
2112 @@ -35,8 +35,9 @@
2114 .SH DESCRIPTION
2116 -pads-report is a Perl based reporting module to be used with Passive Asset Detection System (PADS). It will take
2117 -a raw PADS data file and process it into a readable text report.
2118 +pads-report is a Perl based reporting module to be used with Passive
2119 +Asset Detection System (PADS). It will take a raw PADS data file and
2120 +process it into a readable text report.
2122 .SH OPTIONS
2123 .IP -h
2124 @@ -46,8 +47,8 @@
2125 Do not convert IP addresses to names.
2127 .IP -p
2128 -Do not convert RFC 1918 IP addresses to names. The \fI -n\fP option will
2129 -override this option.
2130 +Do not convert RFC 1918 IP addresses to names. The \fI -n\fP option
2131 +will override this option.
2133 .IP "-r file"
2134 Read packets from a libpcap formatted file.
2135 @@ -66,3 +67,5 @@
2137 .SH AUTHORS
2138 Matt Shelton <matt@mattshelton.com>
2140 +.\" vim:tw=72 expandtab:
2141 diff -ur pads-1.2/doc/README pads-1.2.mod//doc/README
2142 --- pads-1.2/doc/README 2005-06-16 00:09:34.000000000 +0200
2143 +++ pads-1.2.mod//doc/README 2010-12-19 14:27:38.843334500 +0100
2144 @@ -4,45 +4,55 @@
2146 Goals:
2148 -- Passive: Records and identifies traffic seen on a network without actively "scanning" a system.
2149 - There will never be a packet sent from the pads applications.
2151 -- Portable: Has the ability to be placed easily on a remote system. Does not require additional
2152 - external libraries other than those associated with libpcap.
2154 -- Lightweight: Logging is sent to a simple CSV file. There is no need for a database or other data
2155 - repository installed on the local machine. All correlation is done outside of the pads program.
2156 +- Passive: Records and identifies traffic seen on a network without
2157 + actively "scanning" a system. There will never be a packet sent from
2158 + the pads applications.
2160 +- Portable: Has the ability to be placed easily on a remote system.
2161 + Does not require additional external libraries other than those
2162 + associated with libpcap.
2164 +- Lightweight: Logging is sent to a simple CSV file. There is no need
2165 + for a database or other data repository installed on the local
2166 + machine. All correlation is done outside of the pads program.
2169 Description:
2171 -Asset management is an important factor in information security. A good security administrator should
2172 -keep track of all devices attached to the network. Even though active scanners such as nmap and Nessus
2173 -are valuable tools, sometimes it necessary to identify network devices in a passive manner. Pads was
2174 -developed to sit along side the promiscuous interface of an IDS device. It will listen to network traffic
2175 -and attempt to identify the applications running on the network.
2176 +Asset management is an important factor in information security. A good
2177 +security administrator should keep track of all devices attached to the
2178 +network. Even though active scanners such as nmap and Nessus are
2179 +valuable tools, sometimes it necessary to identify network devices in a
2180 +passive manner. Pads was developed to sit along side the promiscuous
2181 +interface of an IDS device. It will listen to network traffic and
2182 +attempt to identify the applications running on the network.
2185 Author's Notes:
2187 -By day I am an IDS analyst for a managed security provider. One of the challenges I face on a daily
2188 -basis is the inability to obtain customer asset data, particularly with the larger customers. This
2189 -information is critical not only for analysis but also device placement and tuning.
2191 -Many IDS deployments consist of a device with two interfaces. One interface contains a promiscuous
2192 -link to a remote network and the other link is for management and lives in the DMZ. This makes
2193 -active network scanners, like nmap, useless because the IDS team does not have anything but a one
2194 -way link into the network. They can only listen to traffic, not produce anything.
2196 -Pads was developed to solve this problem. It is modeled after my favorite scanning tool nmap,
2197 -specifically the .-sV. option. Unlike nmap, it will not generate any traffic while mapping the
2198 -network. Unfortunately, this method is potentially less accurate than active scanning but is often
2199 -necessary in an IDS environment.
2201 -As mentioned earlier, I am an IDS analyst by day. I see programming as a tool to aid me in my job.
2202 -This project was developed outside of work since I do not get paid to code. It was written to
2203 -fulfill a need for me. Hopefully others within the community will also get the chance to benefit
2204 -from it.
2205 +By day I am an IDS analyst for a managed security provider. One of the
2206 +challenges I face on a daily basis is the inability to obtain customer
2207 +asset data, particularly with the larger customers. This information is
2208 +critical not only for analysis but also device placement and tuning.
2210 +Many IDS deployments consist of a device with two interfaces. One
2211 +interface contains a promiscuous link to a remote network and the other
2212 +link is for management and lives in the DMZ. This makes active network
2213 +scanners, like nmap, useless because the IDS team does not have anything
2214 +but a one way link into the network. They can only listen to traffic,
2215 +not produce anything.
2217 +Pads was developed to solve this problem. It is modeled after my
2218 +favorite scanning tool nmap, specifically the .-sV. option. Unlike
2219 +nmap, it will not generate any traffic while mapping the network.
2220 +Unfortunately, this method is potentially less accurate than active
2221 +scanning but is often necessary in an IDS environment.
2223 +As mentioned earlier, I am an IDS analyst by day. I see programming as
2224 +a tool to aid me in my job. This project was developed outside of work
2225 +since I do not get paid to code. It was written to fulfill a need for
2226 +me. Hopefully others within the community will also get the chance to
2227 +benefit from it.
2230 Usage:
2231 @@ -63,26 +73,30 @@
2232 -V : Version
2233 -w <file> : Dump data into file other than assets.csv.
2235 -Additional arguments will be processed as a libpcap filter. For example,
2236 -the following command will not only use interface hme1 but will also only
2237 -search for assets on port 22:
2238 +Additional arguments will be processed as a libpcap filter. For
2239 +example, the following command will not only use interface hme1 but will
2240 +also only search for assets on port 22:
2242 pads -i hme1 port 22
2244 Misc:
2246 -Regular expression support is provided by the PCRE library package, which is open source software,
2247 -written by Philip Hazel, and copyright by the University of Cambridge, England. It can be found on
2248 -the following FTP site:
2249 - ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/
2250 +Regular expression support is provided by the PCRE library package,
2251 +which is open source software, written by Philip Hazel, and copyright by
2252 +the University of Cambridge, England. It can be found on the following
2253 +FTP site:
2254 + ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/
2257 Feedback:
2259 -Please let me know if you have constuctive feedback, need help, or have a bug / issue with the
2260 -application. For the time being, please contact me at matt@mattshelton.com.
2261 +Please let me know if you have constuctive feedback, need help, or have
2262 +a bug / issue with the application. For the time being, please contact
2263 +me at matt@mattshelton.com.
2265 Thanks,
2266 Matt Shelton
2268 -$Id: README,v 1.2 2005/06/15 22:09:34 mattshelton Exp $
2270 +vim:expandtab:sw=4:ts=4:tw=72:
2271 +$Id: README,v 1.2 2005/11/02 23:56:12 jfs Exp $
2272 diff -ur pads-1.2/etc/Makefile.am pads-1.2.mod//etc/Makefile.am
2273 --- pads-1.2/etc/Makefile.am 2005-05-14 22:13:20.000000000 +0200
2274 +++ pads-1.2.mod//etc/Makefile.am 2010-12-19 14:27:38.743334500 +0100
2275 @@ -1,4 +1,4 @@
2276 -## $Id: Makefile.am,v 1.2 2005/05/14 20:13:20 mattshelton Exp $
2277 +## $Id: Makefile.am,v 1.2 2005/11/02 23:56:12 jfs Exp $
2278 AUTOMAKE_OPTIONS=foreign no-dependencies
2279 EXTRA_DIST = pads*
2281 diff -ur pads-1.2/etc/pads.conf pads-1.2.mod//etc/pads.conf
2282 --- pads-1.2/etc/pads.conf 2005-05-21 18:35:11.000000000 +0200
2283 +++ pads-1.2.mod//etc/pads.conf 2010-12-19 14:27:38.743334500 +0100
2284 @@ -7,7 +7,7 @@
2285 # This file contains configuration parameters for the PADS application. Please
2286 # visit http://passive.sourceforge.net for further information.
2288 -# $Id: pads.conf,v 1.5 2005/05/21 16:35:11 mattshelton Exp $
2289 +# $Id: pads.conf,v 1.3 2005/11/06 16:09:54 dgil-guest Exp $
2291 # ------------------------------------------------------------------------------
2293 @@ -68,10 +68,10 @@
2294 # -------------------------
2295 # This output plugin writes PADS data to a CSV file. Optionally, a CSV filename
2296 # can be specified as an argument.
2297 -output csv: assets.csv
2298 +output csv: /var/lib/pads/assets.csv
2300 # output: fifo
2301 # -------------------------
2302 # This output plugin writes PADS data to a FIFO file. Optionally, a FIFO
2303 # filename can be specified as an argument.
2304 -#output fifo: pads.fifo
2305 +#output fifo: /var/lib/pads/pads.fifo
2306 diff -ur pads-1.2/etc/pads-ether-codes pads-1.2.mod//etc/pads-ether-codes
2307 --- pads-1.2/etc/pads-ether-codes 2005-02-10 07:05:01.000000000 +0100
2308 +++ pads-1.2.mod//etc/pads-ether-codes 2010-12-19 14:27:38.740001167 +0100
2309 @@ -5,7 +5,7 @@
2310 # This file contains vendor codes used to map MAC addresses to vendor
2311 # names. It was taken from the Ettercap.
2313 -# $Id: pads-ether-codes,v 1.1 2005/02/10 06:05:01 mattshelton Exp $
2314 +# $Id: pads-ether-codes,v 1.2 2005/11/02 23:56:12 jfs Exp $
2316 ############################################################################
2318 diff -ur pads-1.2/etc/pads-signature-list pads-1.2.mod//etc/pads-signature-list
2319 --- pads-1.2/etc/pads-signature-list 2005-02-10 07:05:03.000000000 +0100
2320 +++ pads-1.2.mod//etc/pads-signature-list 2010-12-19 14:27:38.743334500 +0100
2321 @@ -19,7 +19,7 @@
2322 # surrounding /'s. The signature should have one or two sets of ()'s
2323 # depending on the Version Info field.
2325 -# $Id: pads-signature-list,v 1.1 2005/02/10 06:05:03 mattshelton Exp $
2326 +# $Id: pads-signature-list,v 1.2 2005/11/02 23:56:12 jfs Exp $
2328 ############################################################################
2329 ssh,v/OpenSSH/$2/Protocol $1/,SSH-([.\d]+)-OpenSSH[_-](\S+)
2330 diff -ur pads-1.2/lib/bstring/Makefile.am pads-1.2.mod//lib/bstring/Makefile.am
2331 --- pads-1.2/lib/bstring/Makefile.am 2005-02-13 18:54:58.000000000 +0100
2332 +++ pads-1.2.mod//lib/bstring/Makefile.am 2010-12-19 14:27:38.730001168 +0100
2333 @@ -1,4 +1,4 @@
2334 -# $Id: Makefile.am,v 1.1 2005/02/13 17:54:58 mattshelton Exp $
2335 +# $Id: Makefile.am,v 1.2 2005/11/02 23:56:12 jfs Exp $
2336 AUTOMAKE_OPTIONS=foreign no-dependencies
2337 noinst_LIBRARIES = libbstring.a
2338 libbstring_a_SOURCES = bstrlib.c bstrlib.h bstraux.c bstraux.h util.c util.h
2339 diff -ur pads-1.2/lib/bstring/Makefile.in pads-1.2.mod//lib/bstring/Makefile.in
2340 --- pads-1.2/lib/bstring/Makefile.in 2005-06-16 05:40:05.000000000 +0200
2341 +++ pads-1.2.mod//lib/bstring/Makefile.in 2010-12-19 14:27:38.730001168 +0100
2342 @@ -153,7 +153,7 @@
2343 sysconfdir = @sysconfdir@
2344 target_alias = @target_alias@
2346 -# $Id: Makefile.am,v 1.1 2005/02/13 17:54:58 mattshelton Exp $
2347 +# $Id: Makefile.in,v 1.2 2005/11/02 23:56:12 jfs Exp $
2348 AUTOMAKE_OPTIONS = foreign no-dependencies
2349 noinst_LIBRARIES = libbstring.a
2350 libbstring_a_SOURCES = bstrlib.c bstrlib.h bstraux.c bstraux.h util.c util.h
2351 diff -ur pads-1.2/lib/bstring/util.c pads-1.2.mod//lib/bstring/util.c
2352 --- pads-1.2/lib/bstring/util.c 2005-02-13 18:54:58.000000000 +0100
2353 +++ pads-1.2.mod//lib/bstring/util.c 2010-12-19 14:27:38.723334500 +0100
2354 @@ -21,7 +21,7 @@
2355 * along with this program; if not, write to the Free Software
2356 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
2358 - * $Id: util.c,v 1.1 2005/02/13 17:54:58 mattshelton Exp $
2359 + * $Id: util.c,v 1.2 2005/11/02 23:56:12 jfs Exp $
2361 **************************************************************************/
2362 #include "util.h"
2363 diff -ur pads-1.2/lib/bstring/util.h pads-1.2.mod//lib/bstring/util.h
2364 --- pads-1.2/lib/bstring/util.h 2005-02-13 18:54:58.000000000 +0100
2365 +++ pads-1.2.mod//lib/bstring/util.h 2010-12-19 14:27:38.730001168 +0100
2366 @@ -22,10 +22,13 @@
2367 * along with this program; if not, write to the Free Software
2368 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
2370 - * $Id: util.h,v 1.1 2005/02/13 17:54:58 mattshelton Exp $
2371 + * $Id: util.h,v 1.2 2005/11/02 23:56:12 jfs Exp $
2373 **************************************************************************/
2375 +#ifndef _BSTRING_UTIL_H
2376 +#define _BSTRING_UTIL_H
2378 /* INCLUDES ---------------------------------------- */
2379 #include "bstrlib.h"
2381 @@ -33,3 +36,5 @@
2382 int bltrim (bstring string);
2383 int brtrim (bstring string);
2384 int btrim (bstring string);
2386 +#endif
2387 diff -ur pads-1.2/lib/Makefile.am pads-1.2.mod//lib/Makefile.am
2388 --- pads-1.2/lib/Makefile.am 2005-02-13 18:54:58.000000000 +0100
2389 +++ pads-1.2.mod//lib/Makefile.am 2010-12-19 14:27:38.723334500 +0100
2390 @@ -1,3 +1,3 @@
2391 -## $Id: Makefile.am,v 1.2 2005/02/13 17:54:58 mattshelton Exp $
2392 +## $Id: Makefile.am,v 1.2 2005/11/02 23:56:12 jfs Exp $
2393 AUTOMAKE_OPTIONS=foreign no-dependencies
2394 SUBDIRS = bstring
2395 diff -ur pads-1.2/Makefile.am pads-1.2.mod//Makefile.am
2396 --- pads-1.2/Makefile.am 2005-02-10 06:53:42.000000000 +0100
2397 +++ pads-1.2.mod//Makefile.am 2010-12-19 14:27:38.723334500 +0100
2398 @@ -1,4 +1,4 @@
2399 -## $Id: Makefile.am,v 1.1 2005/02/10 05:53:42 mattshelton Exp $
2400 +## $Id: Makefile.am,v 1.2 2005/11/02 23:56:12 jfs Exp $
2401 AUTOMAKE_OPTIONS=foreign no-dependencies
2402 SUBDIRS = doc etc lib src
2403 EXTRA_DIST = COPYING
2404 diff -ur pads-1.2/src/configuration.c pads-1.2.mod//src/configuration.c
2405 --- pads-1.2/src/configuration.c 2005-04-27 15:50:29.000000000 +0200
2406 +++ pads-1.2.mod//src/configuration.c 2010-12-19 14:27:38.773334500 +0100
2407 @@ -22,7 +22,7 @@
2408 * along with this program; if not, write to the Free Software
2409 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
2411 - * $Id: configuration.c,v 1.3 2005/04/27 13:50:29 mattshelton Exp $
2412 + * $Id: configuration.c,v 1.3 2005/11/02 23:56:12 jfs Exp $
2414 **************************************************************************/
2415 #include "configuration.h"
2416 @@ -59,7 +59,7 @@
2417 /* Clean Up */
2418 bdestroy(filedata);
2419 bstrListDestroy(lines);
2420 - close(fp);
2421 + fclose(fp);
2424 /* ----------------------------------------------------------
2425 diff -ur pads-1.2/src/configuration.h pads-1.2.mod//src/configuration.h
2426 --- pads-1.2/src/configuration.h 2005-02-18 06:50:19.000000000 +0100
2427 +++ pads-1.2.mod//src/configuration.h 2010-12-19 14:27:38.783334500 +0100
2428 @@ -23,11 +23,13 @@
2429 * along with this program; if not, write to the Free Software
2430 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
2432 - * $Id: configuration.h,v 1.2 2005/02/18 05:50:19 mattshelton Exp $
2433 + * $Id: configuration.h,v 1.3 2005/11/02 23:56:12 jfs Exp $
2435 **************************************************************************/
2437 +#ifndef _PADS_CONFIGURATION_H
2438 /* DEFINES ----------------------------------------- */
2439 +#define _PADS_CONFIGURATION_H 1
2440 #ifdef LINUX
2441 #ifndef __FAVOR_BSD
2442 #define __FAVOR_BSD
2443 @@ -39,10 +41,11 @@
2446 /* INCLUDES ---------------------------------------- */
2447 -#include "global.h"
2449 #include <stdio.h>
2450 +#include "global.h"
2451 +#include "util.h"
2452 #include "bstring/bstrlib.h"
2453 +#include "bstring/util.h"
2455 /* PROTOTYPES -------------------------------------- */
2456 void init_configuration (bstring conf_file);
2457 @@ -51,3 +54,4 @@
2459 /* External Prototypes */
2460 int activate_output_plugin (bstring name, bstring args);
2461 +#endif
2462 diff -ur pads-1.2/src/global.h pads-1.2.mod//src/global.h
2463 --- pads-1.2/src/global.h 2005-04-27 15:45:47.000000000 +0200
2464 +++ pads-1.2.mod//src/global.h 2010-12-19 14:27:38.783334500 +0100
2465 @@ -22,9 +22,12 @@
2466 * along with this program; if not, write to the Free Software
2467 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
2469 - * $Id: global.h,v 1.7 2005/04/27 13:45:47 mattshelton Exp $
2470 + * $Id: global.h,v 1.3 2005/11/02 23:56:12 jfs Exp $
2472 **************************************************************************/
2474 +#ifndef _PADS_GLOBAL_H
2475 +#define _PADS_GLOBAL_H 1
2476 #ifdef HAVE_CONFIG_H
2477 #include "config.h"
2478 #endif
2479 @@ -158,5 +161,6 @@
2480 /* GLOBAL VARIABLES -------------------------------- */
2481 extern GC gc;
2483 +#endif
2484 /* vim:expandtab:cindent:smartindent:ts=4:tw=0:sw=4:
2486 diff -ur pads-1.2/src/identification.c pads-1.2.mod//src/identification.c
2487 --- pads-1.2/src/identification.c 2005-05-14 22:14:34.000000000 +0200
2488 +++ pads-1.2.mod//src/identification.c 2010-12-19 14:27:38.783334500 +0100
2489 @@ -22,7 +22,7 @@
2490 * along with this program; if not, write to the Free Software
2491 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
2493 - * $Id: identification.c,v 1.5 2005/05/14 20:14:34 mattshelton Exp $
2494 + * $Id: identification.c,v 1.3 2005/11/02 23:56:12 jfs Exp $
2496 **************************************************************************/
2497 #include "identification.h"
2498 @@ -73,7 +73,7 @@
2499 bdestroy(filename);
2500 bdestroy(filedata);
2501 bstrListDestroy(lines);
2502 - close(fp);
2503 + fclose(fp);
2505 return 0;
2507 @@ -101,7 +101,7 @@
2509 /* Check to see if this line has something to read. */
2510 if (line->data[0] == '\0' || line->data[0] == '#')
2511 - return;
2512 + return 0;
2514 /* Split Line */
2515 if ((raw_sig = bsplit(line, ',')) == NULL)
2516 @@ -265,7 +265,6 @@
2517 Signature *list = signature_list;
2518 int rc;
2519 int ovector[15];
2520 - int i;
2521 bstring app;
2523 while (list != NULL) {
2524 @@ -416,7 +415,7 @@
2525 printf("2a: %s\n", bdata(list->title.app));
2526 printf("2b: %s\n", bdata(list->title.ver));
2527 printf("2c: %s\n", bdata(list->title.misc));
2528 - printf("3: %s\n", list->regex);
2529 + printf("3: %s\n", (char *) list->regex);
2530 printf("\n");
2532 i++;
2533 diff -ur pads-1.2/src/identification.h pads-1.2.mod//src/identification.h
2534 --- pads-1.2/src/identification.h 2005-02-13 19:28:28.000000000 +0100
2535 +++ pads-1.2.mod//src/identification.h 2010-12-19 14:27:38.763334501 +0100
2536 @@ -22,15 +22,20 @@
2537 * along with this program; if not, write to the Free Software
2538 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
2540 - * $Id: identification.h,v 1.2 2005/02/13 18:28:28 mattshelton Exp $
2541 + * $Id: identification.h,v 1.3 2005/11/02 23:56:12 jfs Exp $
2543 **************************************************************************/
2545 +#ifndef _PADS_IDENTIFICATION_H
2546 /* INCLUDES ---------------------------------------- */
2547 +#define _PADS_IDENTIFICATION_H 1
2548 #include <stdio.h>
2549 #include <signal.h>
2551 #include "global.h"
2552 +#include "util.h"
2553 +#include "storage.h"
2554 +#include "output/output.h"
2556 #include <netinet/ip.h>
2557 #include <netinet/tcp.h>
2558 @@ -50,3 +55,4 @@
2559 #endif /* DEBUG */
2561 /* GLOBALS ----------------------------------------- */
2562 +#endif
2563 diff -ur pads-1.2/src/mac-resolution.c pads-1.2.mod//src/mac-resolution.c
2564 --- pads-1.2/src/mac-resolution.c 2005-05-14 22:15:21.000000000 +0200
2565 +++ pads-1.2.mod//src/mac-resolution.c 2010-12-19 14:27:38.763334501 +0100
2566 @@ -26,7 +26,7 @@
2567 * along with this program; if not, write to the Free Software
2568 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
2570 - * $Id: mac-resolution.c,v 1.5 2005/05/14 20:15:21 mattshelton Exp $
2571 + * $Id: mac-resolution.c,v 1.3 2005/11/02 23:56:12 jfs Exp $
2573 **************************************************************************/
2574 #ifndef DISABLE_VENDOR
2575 @@ -79,7 +79,7 @@
2576 bdestroy(filedata);
2577 if (lines != NULL)
2578 bstrListDestroy(lines);
2579 - close(fp);
2580 + fclose(fp);
2582 return 0;
2584 @@ -99,8 +99,6 @@
2585 char vendor[80];
2586 int m1, m2, m3;
2588 - int pos;
2590 /* Parse out the contents of the line. */
2591 if (sscanf(bdata(line), "%02X:%02X:%02X %80[^,\n],\n", &m1, &m2, &m3, vendor) != 4)
2592 return -1;
2593 @@ -215,7 +213,7 @@
2594 list = vendor_list;
2596 while(list != NULL) {
2597 - printf("Mac: %s\nVendor: %s\n\n", list->mac, bdata(list->vendor));
2598 + printf("Mac: %d\nVendor: %s\n\n", list->mac, bdata(list->vendor));
2599 list = list->next;
2602 diff -ur pads-1.2/src/mac-resolution.h pads-1.2.mod//src/mac-resolution.h
2603 --- pads-1.2/src/mac-resolution.h 2005-02-16 02:47:35.000000000 +0100
2604 +++ pads-1.2.mod//src/mac-resolution.h 2010-12-19 14:27:38.783334500 +0100
2605 @@ -26,15 +26,18 @@
2606 * along with this program; if not, write to the Free Software
2607 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
2609 - * $Id: mac-resolution.h,v 1.3 2005/02/16 01:47:35 mattshelton Exp $
2610 + * $Id: mac-resolution.h,v 1.3 2005/11/02 23:56:12 jfs Exp $
2612 **************************************************************************/
2614 +#ifndef _PADS_MAC_RESOLUTION_H
2615 /* DEFINES ----------------------------------------- */
2616 +#define _PADS_MAC_RESOLUTION_H 1
2618 /* INCLUDES ---------------------------------------- */
2619 #include <stdio.h>
2620 #include "global.h"
2621 +#include "util.h"
2624 /* PROTOTYPES -------------------------------------- */
2625 @@ -47,3 +50,5 @@
2626 #ifdef DEBUG
2627 void show_vendor (void);
2628 #endif /* DEBUG */
2630 +#endif
2631 diff -ur pads-1.2/src/Makefile.am pads-1.2.mod//src/Makefile.am
2632 --- pads-1.2/src/Makefile.am 2005-02-17 17:29:54.000000000 +0100
2633 +++ pads-1.2.mod//src/Makefile.am 2010-12-19 14:27:38.773334500 +0100
2634 @@ -1,4 +1,4 @@
2635 -## $Id: Makefile.am,v 1.3 2005/02/17 16:29:54 mattshelton Exp $
2636 +## $Id: Makefile.am,v 1.2 2005/11/02 23:56:12 jfs Exp $
2637 AUTOMAKE_OPTIONS=foreign no-dependencies
2638 bin_PROGRAMS = pads
2639 pads_SOURCES = pads.c pads.h \
2640 diff -ur pads-1.2/src/monnet.c pads-1.2.mod//src/monnet.c
2641 --- pads-1.2/src/monnet.c 2005-02-17 17:29:14.000000000 +0100
2642 +++ pads-1.2.mod//src/monnet.c 2010-12-19 14:27:38.773334500 +0100
2643 @@ -24,7 +24,7 @@
2644 * along with this program; if not, write to the Free Software
2645 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
2647 - * $Id: monnet.c,v 1.3 2005/02/17 16:29:14 mattshelton Exp $
2648 + * $Id: monnet.c,v 1.2 2005/11/02 23:56:12 jfs Exp $
2650 **************************************************************************/
2651 #include "monnet.h"
2652 @@ -45,7 +45,6 @@
2654 int i = 0;
2655 char network[16], netmask[3], tmp[16];
2656 - struct in_addr in_net;
2658 /* Make sure something was defined. */
2659 if (cmdline == NULL)
2660 diff -ur pads-1.2/src/monnet.h pads-1.2.mod//src/monnet.h
2661 --- pads-1.2/src/monnet.h 2005-02-10 07:05:05.000000000 +0100
2662 +++ pads-1.2.mod//src/monnet.h 2010-12-19 14:27:38.743334500 +0100
2663 @@ -21,15 +21,20 @@
2664 * along with this program; if not, write to the Free Software
2665 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
2667 - * $Id: monnet.h,v 1.1 2005/02/10 06:05:05 mattshelton Exp $
2668 + * $Id: monnet.h,v 1.3 2005/11/02 23:56:12 jfs Exp $
2670 **************************************************************************/
2672 +#ifndef _PADS_MONNET_H
2673 /* INCLUDES ---------------------------------------- */
2674 +#define _PADS_MONNET_H 1
2675 #include <stdio.h>
2676 +#include <stdlib.h>
2677 #include <sys/types.h>
2678 +#include <arpa/inet.h>
2679 #include <netinet/in.h>
2681 +#include "util.h"
2683 /* DATA STRUCTURES --------------------------------- */
2684 struct mon_net {
2685 @@ -47,3 +52,4 @@
2688 /* GLOBALS ----------------------------------------- */
2689 +#endif
2690 diff -ur pads-1.2/src/output/Makefile.am pads-1.2.mod//src/output/Makefile.am
2691 --- pads-1.2/src/output/Makefile.am 2005-02-10 07:05:06.000000000 +0100
2692 +++ pads-1.2.mod//src/output/Makefile.am 2010-12-19 14:27:38.823334501 +0100
2693 @@ -1,4 +1,4 @@
2694 -# $Id: Makefile.am,v 1.1 2005/02/10 06:05:06 mattshelton Exp $
2695 +# $Id: Makefile.am,v 1.2 2005/11/02 23:56:12 jfs Exp $
2696 AUTOMAKE_OPTIONS=foreign no-dependencies
2697 noinst_LIBRARIES = liboutput.a
2698 liboutput_a_SOURCES = output.c output.h \
2699 diff -ur pads-1.2/src/output/Makefile.in pads-1.2.mod//src/output/Makefile.in
2700 --- pads-1.2/src/output/Makefile.in 2005-06-16 05:40:05.000000000 +0200
2701 +++ pads-1.2.mod//src/output/Makefile.in 2010-12-19 14:27:38.810001166 +0100
2702 @@ -153,7 +153,7 @@
2703 sysconfdir = @sysconfdir@
2704 target_alias = @target_alias@
2706 -# $Id: Makefile.am,v 1.1 2005/02/10 06:05:06 mattshelton Exp $
2707 +# $Id: Makefile.in,v 1.2 2005/11/02 23:56:12 jfs Exp $
2708 AUTOMAKE_OPTIONS = foreign no-dependencies
2709 noinst_LIBRARIES = liboutput.a
2710 liboutput_a_SOURCES = output.c output.h \
2711 diff -ur pads-1.2/src/output/output.c pads-1.2.mod//src/output/output.c
2712 --- pads-1.2/src/output/output.c 2005-02-18 06:39:09.000000000 +0100
2713 +++ pads-1.2.mod//src/output/output.c 2010-12-19 14:27:38.823334501 +0100
2714 @@ -22,7 +22,7 @@
2715 * along with this program; if not, write to the Free Software
2716 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
2718 - * $Id: output.c,v 1.3 2005/02/18 05:39:09 mattshelton Exp $
2719 + * $Id: output.c,v 1.3 2005/11/02 23:56:12 jfs Exp $
2721 **************************************************************************/
2722 #include "output.h"
2723 @@ -149,7 +149,7 @@
2725 /* Make sure that a record was found. */
2726 if (rec == NULL)
2727 - return;
2728 + return 1;
2730 /* Cycle through output plugins and print to those that are active. */
2731 head = output_plugin_list;
2732 @@ -199,7 +199,7 @@
2734 /* Make sure that a record was found. */
2735 if (rec == NULL)
2736 - return;
2737 + return 1;
2739 /* Cycle through output plugins and print to those that are active. */
2740 head = output_plugin_list;
2741 @@ -298,8 +298,12 @@
2742 #ifdef DEBUG
2743 int debug_output_list (void)
2745 - OutputPluginList *head, *head2;
2746 - OutputPlugin *tmp, *tmp2;
2747 + OutputPluginList *head;
2748 + OutputPlugin *tmp;
2749 + /* Unused:
2750 + * OutputPluginList *head2;
2751 + * OutputPlugin *tmp2;
2752 + */
2753 int i = 1;
2755 printf("output_plugin_list:\n");
2756 diff -ur pads-1.2/src/output/output-csv.c pads-1.2.mod//src/output/output-csv.c
2757 --- pads-1.2/src/output/output-csv.c 2005-02-22 17:09:25.000000000 +0100
2758 +++ pads-1.2.mod//src/output/output-csv.c 2010-12-19 14:27:38.810001166 +0100
2759 @@ -1,11 +1,11 @@
2760 /*************************************************************************
2761 * output-csv.c
2763 - * Matt Shelton <matt@mattshelton.com>
2764 + * Matt Shelton <matt@mattshelton.com>
2766 * This output module writes PADS data to a CSV file.
2768 - * Copyright (C) 2004 Matt Shelton <matt@mattshelton.com>
2769 + * Copyright (C) 2004, 2005 Matt Shelton <matt@mattshelton.com>
2771 * This program is free software; you can redistribute it and/or modify
2772 * it under the terms of the GNU General Public License as published by
2773 @@ -21,7 +21,7 @@
2774 * along with this program; if not, write to the Free Software
2775 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
2777 - * $Id: output-csv.c,v 1.6 2005/02/22 16:09:25 mattshelton Exp $
2778 + * $Id: output-csv.c,v 1.3 2005/11/02 23:56:12 jfs Exp $
2780 **************************************************************************/
2781 #include "output-csv.h"
2782 @@ -29,18 +29,17 @@
2783 OutputCSVConf output_csv_conf;
2785 /* ----------------------------------------------------------
2786 - * FUNCTION : setup_output_csv
2787 - * DESCRIPTION : This function will register the output
2788 - * : plugin.
2789 - * INPUT : None!
2790 - * RETURN : 0 - Success
2791 - * : -1 - Error
2792 + * FUNCTION : setup_output_csv
2793 + * DESCRIPTION : This function will register the output
2794 + * : plugin.
2795 + * INPUT : None!
2796 + * RETURN : 0 - Success
2797 + * : -1 - Error
2798 * ---------------------------------------------------------- */
2800 setup_output_csv (void)
2802 OutputPlugin *plugin;
2803 - bstring name;
2805 /* Allocate and setup plugin data record. */
2806 plugin = (OutputPlugin*)malloc(sizeof(OutputPlugin));
2807 @@ -53,22 +52,22 @@
2809 /* Register plugin with input module. */
2810 if ((register_output_plugin(plugin)) == -1) {
2811 - if (plugin != NULL)
2812 - free(plugin);
2813 - log_message("warning: 'register_output_plugin' in function 'setup_output_csv' failed.");
2814 + if (plugin != NULL)
2815 + free(plugin);
2816 + log_message("warning: 'register_output_plugin' in function 'setup_output_csv' failed.");
2819 return 0;
2822 /* ----------------------------------------------------------
2823 - * FUNCTION : init_output_csv
2824 - * DESCRIPTION : This function will initialize the output
2825 - * : CSV file. If the file already exists, it
2826 - * : will read in the file and add each asset
2827 - * : to the asset data structure.
2828 - * INPUT : 0 - CSV filename
2829 - * RETURN : None!
2830 + * FUNCTION : init_output_csv
2831 + * DESCRIPTION : This function will initialize the output
2832 + * : CSV file. If the file already exists, it
2833 + * : will read in the file and add each asset
2834 + * : to the asset data structure.
2835 + * INPUT : 0 - CSV filename
2836 + * RETURN : None!
2837 * --------------------------------------------------------- */
2839 init_output_csv (bstring filename)
2840 @@ -79,44 +78,44 @@
2842 /* Make sure filename isn't NULL. */
2843 if (filename != NULL)
2844 - output_csv_conf.filename = bstrcpy(filename);
2845 + output_csv_conf.filename = bstrcpy(filename);
2846 else
2847 - output_csv_conf.filename = bstrcpy(bfromcstr("assets.csv"));
2848 + output_csv_conf.filename = bstrcpy(bfromcstr("assets.csv"));
2850 /* Check to see if *filename exists. */
2851 if ((fp = fopen(bdata(output_csv_conf.filename), "r")) == NULL) {
2853 - /* File does not exist, create new.. */
2854 - if ((output_csv_conf.file = fopen(bdata(output_csv_conf.filename), "w")) != NULL) {
2855 - fprintf(output_csv_conf.file, "asset,port,proto,service,application,discovered\n");
2857 - } else {
2858 - err_message("Cannot open file %s!", bdata(output_csv_conf.filename));
2860 + /* File does not exist, create new.. */
2861 + if ((output_csv_conf.file = fopen(bdata(output_csv_conf.filename), "w")) != NULL) {
2862 + fprintf(output_csv_conf.file, "asset,port,proto,service,application,discovered\n");
2864 + } else {
2865 + err_message("Cannot open file %s!", bdata(output_csv_conf.filename));
2868 } else {
2870 - /* File does exist, read it into data structure. */
2871 - fclose(fp);
2872 - read_report_file();
2874 - /* Open file and assign it to the global FILE pointer. */
2875 - if ((output_csv_conf.file = fopen(bdata(output_csv_conf.filename), "a")) == NULL) {
2876 - err_message("Cannot open file %s!", bdata(output_csv_conf.filename));
2878 + /* File does exist, read it into data structure. */
2879 + fclose(fp);
2880 + read_report_file();
2882 + /* Open file and assign it to the global FILE pointer. */
2883 + if ((output_csv_conf.file = fopen(bdata(output_csv_conf.filename), "a")) == NULL) {
2884 + err_message("Cannot open file %s!", bdata(output_csv_conf.filename));
2888 - return;
2889 + return 0;
2892 /* ----------------------------------------------------------
2893 - * FUNCTION : read_report_file
2894 - * DESCRIPTION : This function will read in a specified
2895 - * : report CSV file. It will then break a part
2896 - * : the line and add the assets to the
2897 - * : specified asset data structure.
2898 - * INPUT : None
2899 - * RETURN : None
2900 + * FUNCTION : read_report_file
2901 + * DESCRIPTION : This function will read in a specified
2902 + * : report CSV file. It will then break a part
2903 + * : the line and add the assets to the
2904 + * : specified asset data structure.
2905 + * INPUT : None
2906 + * RETURN : None
2907 * ---------------------------------------------------------- */
2908 void
2909 read_report_file (void)
2910 @@ -130,30 +129,30 @@
2912 /* Open Signature File */
2913 if ((fp = fopen(bdata(output_csv_conf.filename), "r")) == NULL) {
2914 - err_message("Unable to open CSV file - %s", bdata(output_csv_conf.filename));
2915 + err_message("Unable to open CSV file - %s", bdata(output_csv_conf.filename));
2918 /* Read file into 'filedata' and process it accordingly. */
2919 filedata = bread ((bNread) fread, fp);
2920 if ((lines = bsplit(filedata, '\n')) != NULL) {
2921 - for (i = 0; i < lines->qty; i++) {
2922 - parse_raw_report(lines->entry[i]);
2924 + for (i = 0; i < lines->qty; i++) {
2925 + parse_raw_report(lines->entry[i]);
2929 /* Clean Up */
2930 bdestroy(filedata);
2931 bstrListDestroy(lines);
2932 - close(fp);
2933 + fclose(fp);
2936 /* ----------------------------------------------------------
2937 - * FUNCTION : parse_raw_report
2938 - * DESCRIPTION : This function will parse through a single
2939 - * : line of the CSV file.
2940 - * INPUT : 0 - Raw Line
2941 - * RETURN : 0 - Sucess
2942 - * : -1 - Error
2943 + * FUNCTION : parse_raw_report
2944 + * DESCRIPTION : This function will parse through a single
2945 + * : line of the CSV file.
2946 + * INPUT : 0 - Raw Line
2947 + * RETURN : 0 - Sucess
2948 + * : -1 - Error
2949 * ---------------------------------------------------------- */
2951 parse_raw_report (bstring line)
2952 @@ -172,37 +171,37 @@
2954 /* Check to see if this line has something to read. */
2955 if (line->data[0] == '\0' || line->data[0] == '#')
2956 - return;
2957 + return 0;
2959 /* Break line apart. */
2960 if ((list = bsplit(line, ',')) == NULL)
2961 - return -1;
2962 + return -1;
2964 /* Check to see if this line contains the header. */
2965 if ((biseqcstr(list->entry[0], "asset")) == 1) {
2966 - if (list != NULL)
2967 - bstrListDestroy(list);
2968 - return -1;
2969 + if (list != NULL)
2970 + bstrListDestroy(list);
2971 + return -1;
2974 /* Place data from 'list' into temporary data storage. */
2975 if ((inet_aton(bdata(list->entry[0]), &ip_addr)) == -1)
2976 - ret = -1;
2977 + ret = -1;
2979 if ((port = htons(atoi(bdata(list->entry[1])))) == -1)
2980 - ret = -1;
2981 + ret = -1;
2983 if ((proto = atoi(bdata(list->entry[2]))) == -1)
2984 - ret = -1;
2985 + ret = -1;
2987 if ((service = bstrcpy(list->entry[3])) == NULL)
2988 - ret = -1;
2989 + ret = -1;
2991 if ((application = bstrcpy(list->entry[4])) == NULL)
2992 ret = -1;
2994 if ((discovered = atol(bdata(list->entry[5]))) == -1)
2995 - ret = -1;
2996 + ret = -1;
2998 /* Make sure that this line contains 'good' data. */
2999 if (service->slen == 0 || application->slen == 0 || discovered <= 0)
3000 @@ -210,95 +209,95 @@
3002 /* Add Asset to Data Structure */
3003 if (proto == 0 && ret != -1) {
3004 - /* ARP */
3005 - mac2hex(bdata(application), mac_addr, MAC_LEN);
3006 - add_arp_asset(ip_addr, mac_addr, discovered);
3007 + /* ARP */
3008 + mac2hex(bdata(application), mac_addr, MAC_LEN);
3009 + add_arp_asset(ip_addr, mac_addr, discovered);
3010 } else {
3011 - /* Everything Else */
3012 - add_asset(ip_addr, port, proto, service, application, discovered);
3013 + /* Everything Else */
3014 + add_asset(ip_addr, port, proto, service, application, discovered);
3017 // Clean Up
3018 if (list != NULL)
3019 - bstrListDestroy(list);
3020 + bstrListDestroy(list);
3021 if (service != NULL)
3022 - bdestroy(service);
3023 + bdestroy(service);
3024 if (application != NULL)
3025 - bdestroy(application);
3026 + bdestroy(application);
3028 return ret;
3031 /* ----------------------------------------------------------
3032 - * FUNCTION : print_asset_csv
3033 - * DESCRIPTION : This function will print an asset to the
3034 - * : CSV file.
3035 - * INPUT : 0 - Port
3036 - * : 1 - IP Address
3037 - * : 2 - Protocol
3038 - * : 3 - Service
3039 - * : 4 - Application
3040 - * : 5 - Discovered
3041 - * RETURN : 0 - Success
3042 - * : -1 - Failure
3043 + * FUNCTION : print_asset_csv
3044 + * DESCRIPTION : This function will print an asset to the
3045 + * : CSV file.
3046 + * INPUT : 0 - Port
3047 + * : 1 - IP Address
3048 + * : 2 - Protocol
3049 + * : 3 - Service
3050 + * : 4 - Application
3051 + * : 5 - Discovered
3052 + * RETURN : 0 - Success
3053 + * : -1 - Failure
3054 * ---------------------------------------------------------- */
3056 print_asset_csv (Asset *rec)
3058 if (output_csv_conf.file != NULL) {
3059 - if (gc.hide_unknowns == 0 || ((biseqcstr(rec->service, "unknown") != 0) &&
3060 - (biseqcstr(rec->application, "unknown") != 0))) {
3061 - fprintf(output_csv_conf.file, "%s,%d,%d,%s,%s,%d\n",
3062 - inet_ntoa(rec->ip_addr), ntohs(rec->port), rec->proto, bdata(rec->service),
3063 - bdata(rec->application), rec->discovered);
3064 - fflush(output_csv_conf.file);
3066 + if (gc.hide_unknowns == 0 || ((biseqcstr(rec->service, "unknown") != 0) &&
3067 + (biseqcstr(rec->application, "unknown") != 0))) {
3068 + fprintf(output_csv_conf.file, "%s,%d,%d,%s,%s,%ld\n",
3069 + inet_ntoa(rec->ip_addr), ntohs(rec->port), rec->proto, bdata(rec->service),
3070 + bdata(rec->application), rec->discovered);
3071 + fflush(output_csv_conf.file);
3073 } else {
3074 - fprintf(stderr, "[!] ERROR: File handle not open!\n");
3075 - return -1;
3076 + fprintf(stderr, "[!] ERROR: File handle not open!\n");
3077 + return -1;
3080 return 0;
3083 /* ----------------------------------------------------------
3084 - * FUNCTION : print_arp_asset_csv
3085 - * DESCRIPTION : This function will print an ARP asset to
3086 - * : the CSV file.
3087 - * INPUT : 0 - IP Address
3088 - * : 1 - MAC Address
3089 - * : 2 - MAC Resolved
3090 - * RETURN : 0 - Success
3091 - * : -1 - Error
3092 + * FUNCTION : print_arp_asset_csv
3093 + * DESCRIPTION : This function will print an ARP asset to
3094 + * : the CSV file.
3095 + * INPUT : 0 - IP Address
3096 + * : 1 - MAC Address
3097 + * : 2 - MAC Resolved
3098 + * RETURN : 0 - Success
3099 + * : -1 - Error
3100 * ---------------------------------------------------------- */
3102 print_arp_asset_csv (ArpAsset *rec)
3104 /* Print to File */
3105 if (output_csv_conf.file != NULL) {
3106 - if (rec->mac_resolved != NULL) {
3107 - fprintf(output_csv_conf.file, "%s,0,0,ARP (%s),%s,%d\n", inet_ntoa(rec->ip_addr),
3108 - bdata(rec->mac_resolved), hex2mac(rec->mac_addr), rec->discovered);
3109 - } else {
3110 - fprintf(output_csv_conf.file, "%s,0,0,ARP,%s,%d\n", inet_ntoa(rec->ip_addr),
3111 - hex2mac(rec->mac_addr), rec->discovered);
3113 + if (rec->mac_resolved != NULL) {
3114 + fprintf(output_csv_conf.file, "%s,0,0,ARP (%s),%s,%ld\n", inet_ntoa(rec->ip_addr),
3115 + bdata(rec->mac_resolved), hex2mac(rec->mac_addr), rec->discovered);
3116 + } else {
3117 + fprintf(output_csv_conf.file, "%s,0,0,ARP,%s,%ld\n", inet_ntoa(rec->ip_addr),
3118 + hex2mac(rec->mac_addr), rec->discovered);
3121 - fflush(output_csv_conf.file);
3122 + fflush(output_csv_conf.file);
3123 } else {
3124 - fprintf(stderr, "[!] ERROR: File handle not open!\n");
3125 - return -1;
3126 + fprintf(stderr, "[!] ERROR: File handle not open!\n");
3127 + return -1;
3130 return 0;
3133 /* ----------------------------------------------------------
3134 - * FUNCTION : end_output_csv
3135 - * DESCRIPTION : This function will free the memory declared
3136 - * : by the screen output module.
3137 - * INPUT : None!
3138 - * OUTPUT : None!
3139 + * FUNCTION : end_output_csv
3140 + * DESCRIPTION : This function will free the memory declared
3141 + * : by the screen output module.
3142 + * INPUT : None!
3143 + * OUTPUT : None!
3144 * ---------------------------------------------------------- */
3146 end_output_csv ()
3147 @@ -307,9 +306,13 @@
3148 verbose_message("Closing CSV File.");
3150 if (output_csv_conf.file != NULL)
3151 - fclose(output_csv_conf.file);
3152 + fclose(output_csv_conf.file);
3154 if (output_csv_conf.filename != NULL)
3155 - bdestroy(output_csv_conf.filename);
3156 + bdestroy(output_csv_conf.filename);
3158 + return 0;
3161 +/* vim:expandtab:cindent:smartindent:ts=4:tw=0:sw=4:
3162 + */
3163 diff -ur pads-1.2/src/output/output-csv.h pads-1.2.mod//src/output/output-csv.h
3164 --- pads-1.2/src/output/output-csv.h 2005-02-18 06:39:09.000000000 +0100
3165 +++ pads-1.2.mod//src/output/output-csv.h 2010-12-19 14:27:38.823334501 +0100
3166 @@ -22,11 +22,13 @@
3167 * along with this program; if not, write to the Free Software
3168 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
3170 - * $Id: output-csv.h,v 1.3 2005/02/18 05:39:09 mattshelton Exp $
3171 + * $Id: output-csv.h,v 1.3 2005/11/02 23:56:12 jfs Exp $
3173 **************************************************************************/
3175 +#ifndef _PADS_OUTPUT_CSV_H
3176 /* DEFINES ----------------------------------------- */
3177 +#define _PADS_OUTPUT_CSV_H 1
3178 #ifdef LINUX
3179 #ifndef __FAVOR_BSD
3180 #define __FAVOR_BSD
3181 @@ -39,8 +41,11 @@
3183 /* INCLUDES ---------------------------------------- */
3184 #include <stdio.h>
3185 +#include <stdlib.h>
3186 +#include <arpa/inet.h>
3188 #include "output.h"
3189 +#include "util.h"
3192 /* TYPEDEFS ---------------------------------------- */
3193 @@ -64,3 +69,4 @@
3194 int print_arp_asset_csv (ArpAsset *rec);
3195 int end_output_csv (void);
3197 +#endif
3198 diff -ur pads-1.2/src/output/output-fifo.c pads-1.2.mod//src/output/output-fifo.c
3199 --- pads-1.2/src/output/output-fifo.c 2005-02-22 17:09:25.000000000 +0100
3200 +++ pads-1.2.mod//src/output/output-fifo.c 2010-12-19 14:27:38.796667834 +0100
3201 @@ -1,12 +1,12 @@
3202 /*************************************************************************
3203 * output-fifo.c
3205 - * Matt Shelton <matt@mattshelton.com>
3206 + * Matt Shelton <matt@mattshelton.com>
3208 * This output module will write data to a FIFO named pipe. This will
3209 * allow external applications access to PADS data in real-time.
3211 - * Copyright (C) 2004 Matt Shelton <matt@mattshelton.com>
3212 + * Copyright (C) 2004, 2005 Matt Shelton <matt@mattshelton.com>
3214 * This program is free software; you can redistribute it and/or modify
3215 * it under the terms of the GNU General Public License as published by
3216 @@ -22,7 +22,7 @@
3217 * along with this program; if not, write to the Free Software
3218 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
3220 - * $Id: output-fifo.c,v 1.6 2005/02/22 16:09:25 mattshelton Exp $
3221 + * $Id: output-fifo.c,v 1.3 2005/11/02 23:56:12 jfs Exp $
3223 **************************************************************************/
3224 #include "output-fifo.h"
3225 @@ -38,10 +38,10 @@
3226 * begin with an action_id field. This field will allow different types
3227 * of output to be written to the FIFO.
3229 - * action_id action
3230 - * 01 TCP / ICMP Asset Discovered
3231 - * 02 ARP Asset Discovered
3232 - * 03 TCP / ICMP Statistic Information
3233 + * action_id action
3234 + * 01 TCP / ICMP Asset Discovered
3235 + * 02 ARP Asset Discovered
3236 + * 03 TCP / ICMP Statistic Information
3238 * The following lines contains an example of the data written to the
3239 * FIFO:
3240 @@ -55,18 +55,17 @@
3241 OutputFIFOConf output_fifo_conf;
3243 /* ----------------------------------------------------------
3244 - * FUNCTION : setup_output_fifo
3245 - * DESCRIPTION : This function will register the output
3246 - * : plugin.
3247 - * INPUT : None!
3248 - * RETURN : 0 - Success
3249 - * : -1 - Error
3250 + * FUNCTION : setup_output_fifo
3251 + * DESCRIPTION : This function will register the output
3252 + * : plugin.
3253 + * INPUT : None!
3254 + * RETURN : 0 - Success
3255 + * : -1 - Error
3256 * ---------------------------------------------------------- */
3258 setup_output_fifo (void)
3260 OutputPlugin *plugin;
3261 - bstring name;
3263 /* Allocate and setup plugin data record. */
3264 plugin = (OutputPlugin*)malloc(sizeof(OutputPlugin));
3265 @@ -79,33 +78,29 @@
3267 /* Register plugin with input module. */
3268 if ((register_output_plugin(plugin)) == -1) {
3269 - if (plugin != NULL)
3270 - free(plugin);
3271 - log_message("warning: 'register_output_plugin' in function 'setup_output_fifo' failed.");
3272 + if (plugin != NULL)
3273 + free(plugin);
3274 + log_message("warning: 'register_output_plugin' in function 'setup_output_fifo' failed.");
3277 return 0;
3280 /* ----------------------------------------------------------
3281 - * FUNCTION : init_output_fifo
3282 - * DESCRIPTION : This function will initialize the FIFO
3283 - * : file.
3284 - * INPUT : 0 - FIFO filename
3285 - * RETURN : None!
3286 + * FUNCTION : init_output_fifo
3287 + * DESCRIPTION : This function will initialize the FIFO
3288 + * : file.
3289 + * INPUT : 0 - FIFO filename
3290 + * RETURN : None!
3291 * --------------------------------------------------------- */
3293 init_output_fifo (bstring fifo_file)
3295 - FILE *fp;
3296 - register u_int len = 0;
3297 - char *filename;
3299 verbose_message("Initializing FIFO output plugin.");
3301 /* Make sure report_file isn't NULL. */
3302 if (fifo_file == NULL)
3303 - fifo_file = bstrcpy(bfromcstr("pads.fifo"));
3304 + fifo_file = bstrcpy(bfromcstr("pads.fifo"));
3306 output_fifo_conf.filename = bstrcpy(fifo_file);
3308 @@ -113,110 +108,110 @@
3310 verbose_message("Open FIFO File\n");
3311 if ((output_fifo_conf.file = fopen(bdata(fifo_file), "w+")) == NULL)
3312 - err_message("Unable to open FIFO file (%s)!\n", bdata(fifo_file));
3313 + err_message("Unable to open FIFO file (%s)!\n", bdata(fifo_file));
3315 - return;
3316 + return 0;
3319 /* ----------------------------------------------------------
3320 - * FUNCTION : print_asset_fifo
3321 - * DESCRIPTION : This function will print an asset to the
3322 - * : FIFO file.
3323 - * INPUT : 0 - Port
3324 - * : 1 - IP Address
3325 - * : 2 - Protocol
3326 - * : 3 - Service
3327 - * : 4 - Application
3328 - * : 5 - Discovered
3329 - * RETURN : 0 - Success
3330 - * : -1 - Error
3331 + * FUNCTION : print_asset_fifo
3332 + * DESCRIPTION : This function will print an asset to the
3333 + * : FIFO file.
3334 + * INPUT : 0 - Port
3335 + * : 1 - IP Address
3336 + * : 2 - Protocol
3337 + * : 3 - Service
3338 + * : 4 - Application
3339 + * : 5 - Discovered
3340 + * RETURN : 0 - Success
3341 + * : -1 - Error
3342 * ---------------------------------------------------------- */
3344 print_asset_fifo (Asset *rec)
3346 if (output_fifo_conf.file != NULL) {
3347 - if (gc.hide_unknowns == 0 || ((biseq(rec->service, bfromcstr("unknown")) != 0) &&
3348 - (biseq(rec->application, bfromcstr("unknown")) != 0))) {
3349 - fprintf(output_fifo_conf.file, "01,%s,%d,%d,%s,%s,%d\n",
3350 - inet_ntoa(rec->ip_addr), ntohs(rec->port), rec->proto, bdata(rec->service),
3351 - bdata(rec->application), rec->discovered);
3352 - fflush(output_fifo_conf.file);
3354 + if (gc.hide_unknowns == 0 || ((biseq(rec->service, bfromcstr("unknown")) != 0) &&
3355 + (biseq(rec->application, bfromcstr("unknown")) != 0))) {
3356 + fprintf(output_fifo_conf.file, "01,%s,%d,%d,%s,%s,%ld\n",
3357 + inet_ntoa(rec->ip_addr), ntohs(rec->port), rec->proto, bdata(rec->service),
3358 + bdata(rec->application), rec->discovered);
3359 + fflush(output_fifo_conf.file);
3361 } else {
3362 - fprintf(stderr, "[!] ERROR: File handle not open!\n");
3363 - return -1;
3364 + fprintf(stderr, "[!] ERROR: File handle not open!\n");
3365 + return -1;
3368 return 0;
3371 /* ----------------------------------------------------------
3372 - * FUNCTION : print_arp_asset_fifo
3373 - * DESCRIPTION : This function will print an ARP asset to
3374 - * : the FIFO file.
3375 - * INPUT : 0 - IP Address
3376 - * : 1 - MAC Address
3377 - * RETURN : 0 - Success
3378 - * : -1 - Error
3379 + * FUNCTION : print_arp_asset_fifo
3380 + * DESCRIPTION : This function will print an ARP asset to
3381 + * : the FIFO file.
3382 + * INPUT : 0 - IP Address
3383 + * : 1 - MAC Address
3384 + * RETURN : 0 - Success
3385 + * : -1 - Error
3386 * ---------------------------------------------------------- */
3388 print_arp_asset_fifo (ArpAsset *rec)
3390 /* Print to File */
3391 if (output_fifo_conf.file != NULL) {
3392 - if (rec->mac_resolved != NULL) {
3393 - fprintf(output_fifo_conf.file, "02,%s,%s,%s,%d\n", inet_ntoa(rec->ip_addr),
3394 - rec->mac_resolved, hex2mac(&rec->mac_addr), rec->discovered);
3395 - } else {
3396 - fprintf(output_fifo_conf.file, "02,%s,unknown,%s,%d\n", inet_ntoa(rec->ip_addr),
3397 - hex2mac(&rec->mac_addr), rec->discovered);
3399 + if (rec->mac_resolved != NULL) {
3400 + fprintf(output_fifo_conf.file, "02,%s,%s,%s,%ld\n", inet_ntoa(rec->ip_addr),
3401 + (char *)rec->mac_resolved, hex2mac(rec->mac_addr), rec->discovered);
3402 + } else {
3403 + fprintf(output_fifo_conf.file, "02,%s,unknown,%s,%ld\n", inet_ntoa(rec->ip_addr),
3404 + hex2mac(rec->mac_addr), rec->discovered);
3407 - fflush(output_fifo_conf.file);
3408 + fflush(output_fifo_conf.file);
3409 } else {
3410 - fprintf(stderr, "[!] ERROR: File handle not open!\n");
3411 - return -1;
3412 + fprintf(stderr, "[!] ERROR: File handle not open!\n");
3413 + return -1;
3416 return 0;
3419 /* ----------------------------------------------------------
3420 - * FUNCTION : print_stat_fifo
3421 - * DESCRIPTION : This function will print statistic
3422 - * : information to the FIFO file.
3423 - * INPUT : 0 - IP Address
3424 - * : 1 - Port
3425 - * : 2 - Protocol
3426 - * RETURN : 0 - Success
3427 - * : -1 - Error
3428 + * FUNCTION : print_stat_fifo
3429 + * DESCRIPTION : This function will print statistic
3430 + * : information to the FIFO file.
3431 + * INPUT : 0 - IP Address
3432 + * : 1 - Port
3433 + * : 2 - Protocol
3434 + * RETURN : 0 - Success
3435 + * : -1 - Error
3436 * ---------------------------------------------------------- */
3438 print_stat_fifo (Asset *rec)
3440 if (output_fifo_conf.file != NULL) {
3441 - fprintf(output_fifo_conf.file, "03,%s,%d,%d,%d\n",
3442 - inet_ntoa(rec->ip_addr), ntohs(rec->port), rec->proto, time(NULL));
3443 - fflush(output_fifo_conf.file);
3444 + fprintf(output_fifo_conf.file, "03,%s,%d,%d,%ld\n",
3445 + inet_ntoa(rec->ip_addr), ntohs(rec->port), rec->proto, time(NULL));
3446 + fflush(output_fifo_conf.file);
3448 } else {
3449 - fprintf(stderr, "[!] ERROR: File handle not open!\n");
3450 - return -1;
3451 + fprintf(stderr, "[!] ERROR: File handle not open!\n");
3452 + return -1;
3455 return 0;
3458 /* ----------------------------------------------------------
3459 - * FUNCTION : end_output_fifo
3460 - * DESCRIPTION : This function will free the memory declared
3461 - * : by the fifo output module.
3462 - * INPUT : None
3463 - * OUTPUT : 0 - Success
3464 - * : -1 - Error
3465 + * FUNCTION : end_output_fifo
3466 + * DESCRIPTION : This function will free the memory declared
3467 + * : by the fifo output module.
3468 + * INPUT : None
3469 + * OUTPUT : 0 - Success
3470 + * : -1 - Error
3471 * ---------------------------------------------------------- */
3473 -end_output_fifo ()
3474 +end_output_fifo (void)
3476 verbose_message("Ending CSV Output Plugin.");
3478 @@ -225,8 +220,10 @@
3480 /* Clean Up */
3481 if (output_fifo_conf.filename)
3482 - bdestroy(output_fifo_conf.filename);
3483 + bdestroy(output_fifo_conf.filename);
3485 return 0;
3488 +/* vim:expandtab:cindent:smartindent:ts=4:tw=0:sw=4:
3489 + */
3490 diff -ur pads-1.2/src/output/output-fifo.h pads-1.2.mod//src/output/output-fifo.h
3491 --- pads-1.2/src/output/output-fifo.h 2005-02-18 06:39:09.000000000 +0100
3492 +++ pads-1.2.mod//src/output/output-fifo.h 2010-12-19 14:27:38.833334500 +0100
3493 @@ -22,11 +22,13 @@
3494 * along with this program; if not, write to the Free Software
3495 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
3497 - * $Id: output-fifo.h,v 1.3 2005/02/18 05:39:09 mattshelton Exp $
3498 + * $Id: output-fifo.h,v 1.3 2005/11/02 23:56:12 jfs Exp $
3500 **************************************************************************/
3502 +#ifndef _PSAD_OUTPUT_FIFO_H
3503 /* DEFINES ----------------------------------------- */
3504 +#define _PSAD_OUTPUT_FIFO_H 1
3505 #ifdef LINUX
3506 #ifndef __FAVOR_BSD
3507 #define __FAVOR_BSD
3508 @@ -40,9 +42,12 @@
3509 /* INCLUDES ---------------------------------------- */
3510 #include <stdio.h>
3511 #include <sys/stat.h>
3512 +#include <arpa/inet.h>
3513 +#include <time.h>
3515 #include "output.h"
3517 +#include "util.h"
3519 /* TYPEDEFS ---------------------------------------- */
3520 typedef struct _OutputFIFOConf
3521 @@ -62,3 +67,4 @@
3522 int print_stat_fifo (Asset *rec);
3523 int end_output_fifo (void);
3525 +#endif
3526 diff -ur pads-1.2/src/output/output.h pads-1.2.mod//src/output/output.h
3527 --- pads-1.2/src/output/output.h 2005-02-18 06:39:09.000000000 +0100
3528 +++ pads-1.2.mod//src/output/output.h 2010-12-19 14:27:38.823334501 +0100
3529 @@ -22,11 +22,13 @@
3530 * along with this program; if not, write to the Free Software
3531 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
3533 - * $Id: output.h,v 1.3 2005/02/18 05:39:09 mattshelton Exp $
3534 + * $Id: output.h,v 1.3 2005/11/02 23:56:12 jfs Exp $
3536 **************************************************************************/
3538 +#ifndef _PADS_OUTPUT_H
3539 /* DEFINES ----------------------------------------- */
3540 +#define _PADS_OUTPUT_H 1
3541 #ifdef LINUX
3542 #ifndef __FAVOR_BSD
3543 #define __FAVOR_BSD
3544 @@ -41,7 +43,7 @@
3545 #include <stdio.h>
3547 #include "global.h"
3549 +#include "storage.h"
3551 /* DATA STRUCTURES --------------------------------- */
3553 @@ -70,6 +72,9 @@
3555 /* PROTOTYPES -------------------------------------- */
3556 void init_output();
3557 +int setup_output_screen (void);
3558 +int setup_output_csv (void);
3559 +int setup_output_fifo (void);
3560 int register_output_plugin (OutputPlugin *plugin);
3561 int activate_output_plugin (bstring name, bstring args);
3562 int print_asset (struct in_addr ip_addr, u_int16_t port, unsigned short proto);
3563 @@ -77,3 +82,4 @@
3564 int print_stat(struct in_addr ip_addr, u_int16_t port, unsigned short proto);
3565 void end_output (void);
3567 +#endif
3568 diff -ur pads-1.2/src/output/output-screen.c pads-1.2.mod//src/output/output-screen.c
3569 --- pads-1.2/src/output/output-screen.c 2005-02-22 17:09:25.000000000 +0100
3570 +++ pads-1.2.mod//src/output/output-screen.c 2010-12-19 14:27:38.823334501 +0100
3571 @@ -21,7 +21,7 @@
3572 * along with this program; if not, write to the Free Software
3573 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
3575 - * $Id: output-screen.c,v 1.5 2005/02/22 16:09:25 mattshelton Exp $
3576 + * $Id: output-screen.c,v 1.2 2005/11/02 23:56:12 jfs Exp $
3578 **************************************************************************/
3579 #include "output-screen.h"
3580 @@ -38,7 +38,6 @@
3581 setup_output_screen (void)
3583 OutputPlugin *plugin;
3584 - bstring name;
3586 /* Allocate and setup plugin data record. */
3587 plugin = (OutputPlugin*)malloc(sizeof(OutputPlugin));
3588 diff -ur pads-1.2/src/output/output-screen.h pads-1.2.mod//src/output/output-screen.h
3589 --- pads-1.2/src/output/output-screen.h 2005-02-18 06:39:09.000000000 +0100
3590 +++ pads-1.2.mod//src/output/output-screen.h 2010-12-19 14:27:38.796667834 +0100
3591 @@ -22,11 +22,13 @@
3592 * along with this program; if not, write to the Free Software
3593 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
3595 - * $Id: output-screen.h,v 1.3 2005/02/18 05:39:09 mattshelton Exp $
3596 + * $Id: output-screen.h,v 1.3 2005/11/02 23:56:12 jfs Exp $
3598 **************************************************************************/
3600 +#ifndef _PADS_OUTPUT_SCREEN_H
3601 /* DEFINES ----------------------------------------- */
3602 +#define _PADS_OUTPUT_SCREEN_H 1
3603 #ifdef LINUX
3604 #ifndef __FAVOR_BSD
3605 #define __FAVOR_BSD
3606 @@ -39,8 +41,10 @@
3608 /* INCLUDES ---------------------------------------- */
3609 #include <stdio.h>
3610 +#include <arpa/inet.h>
3612 #include "output.h"
3613 +#include "util.h"
3616 /* TYPEDEFS ---------------------------------------- */
3617 @@ -56,3 +60,5 @@
3618 int print_asset_screen (Asset *rec);
3619 int print_arp_asset_screen (ArpAsset *rec);
3620 int end_output_screen (void);
3622 +#endif
3623 diff -ur pads-1.2/src/packet.c pads-1.2.mod//src/packet.c
3624 --- pads-1.2/src/packet.c 2005-02-16 02:47:35.000000000 +0100
3625 +++ pads-1.2.mod//src/packet.c 2010-12-19 14:27:38.773334500 +0100
3626 @@ -22,7 +22,7 @@
3627 * along with this program; if not, write to the Free Software
3628 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
3630 - * $Id: packet.c,v 1.3 2005/02/16 01:47:35 mattshelton Exp $
3631 + * $Id: packet.c,v 1.2 2005/11/02 23:56:12 jfs Exp $
3633 **************************************************************************/
3634 #include "packet.h"
3635 diff -ur pads-1.2/src/packet.h pads-1.2.mod//src/packet.h
3636 --- pads-1.2/src/packet.h 2005-02-10 07:05:05.000000000 +0100
3637 +++ pads-1.2.mod//src/packet.h 2010-12-19 14:27:38.746667833 +0100
3638 @@ -22,7 +22,7 @@
3639 * along with this program; if not, write to the Free Software
3640 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
3642 - * $Id: packet.h,v 1.1 2005/02/10 06:05:05 mattshelton Exp $
3643 + * $Id: packet.h,v 1.3 2005/11/02 23:56:12 jfs Exp $
3645 **************************************************************************/
3646 #ifdef HAVE_CONFIG_H
3647 @@ -42,6 +42,10 @@
3649 /* INCLUDES ---------------------------------------- */
3650 #include "global.h"
3651 +#include "storage.h"
3652 +#include "monnet.h"
3653 +#include "identification.h"
3654 +#include "output/output.h"
3656 #include <netinet/ip.h>
3657 #include <netinet/tcp.h>
3658 diff -ur pads-1.2/src/pads.c pads-1.2.mod//src/pads.c
3659 --- pads-1.2/src/pads.c 2005-06-16 00:00:40.000000000 +0200
3660 +++ pads-1.2.mod//src/pads.c 2010-12-19 14:27:38.763334501 +0100
3661 @@ -22,7 +22,7 @@
3662 * along with this program; if not, write to the Free Software
3663 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
3665 - * $Id: pads.c,v 1.10 2005/06/15 22:00:40 mattshelton Exp $
3666 + * $Id: pads.c,v 1.3 2005/11/02 23:56:12 jfs Exp $
3668 **************************************************************************/
3669 #include "pads.h"
3670 @@ -478,9 +478,10 @@
3671 main(int argc, char *argv[])
3673 /* Variables */
3674 - int i;
3675 - struct pcap_pkthdr header; /* The header that pcap gives us */
3676 - const u_char *packet; /* The actual packet */
3677 + /* Unused: */
3678 + /* int i; */
3679 + /* struct pcap_pkthdr header; */ /* The header that pcap gives us */
3680 + /* const u_char *packet; */ /* The actual packet */
3682 /* Copy Command Line Args */
3683 prog_argc = argc;
3684 diff -ur pads-1.2/src/pads.h pads-1.2.mod//src/pads.h
3685 --- pads-1.2/src/pads.h 2005-03-11 02:04:12.000000000 +0100
3686 +++ pads-1.2.mod//src/pads.h 2010-12-19 14:27:38.773334500 +0100
3687 @@ -22,11 +22,13 @@
3688 * along with this program; if not, write to the Free Software
3689 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
3691 - * $Id: pads.h,v 1.4 2005/03/11 01:04:12 mattshelton Exp $
3692 + * $Id: pads.h,v 1.3 2005/11/02 23:56:12 jfs Exp $
3694 **************************************************************************/
3696 +#ifndef _PADS_H
3697 /* DEFINES ----------------------------------------- */
3698 +#define _PADS_H 1
3699 #ifdef LINUX
3700 #ifndef __FAVOR_BSD
3701 #define __FAVOR_BSD
3702 @@ -46,7 +48,12 @@
3703 #include <time.h>
3705 #include "global.h"
3707 +#include "util.h"
3708 +#include "output/output.h"
3709 +#include "configuration.h"
3710 +#include "identification.h"
3711 +#include "mac-resolution.h"
3712 +#include "monnet.h"
3714 /* TYPEDEFS ---------------------------------------- */
3715 typedef void (*proc_t)(const struct pcap_pkthdr *, const u_char *);
3716 @@ -61,6 +68,7 @@
3717 void init_pads(void);
3718 void main_pads(void);
3719 void end_pads(void);
3720 +int process_cmdline (int, char **);
3722 void sig_term_handler(int signal);
3723 void sig_int_handler(int signal);
3724 @@ -71,5 +79,6 @@
3725 void process_eth (const struct pcap_pkthdr* pkthdr, const u_char* packet);
3726 void process_sll (const struct pcap_pkthdr* pkthdr, const u_char* packet);
3728 +#endif
3729 /* vim:expandtab:cindent:smartindent:ts=4:tw=0:sw=4:
3731 diff -ur pads-1.2/src/pads-report.pl pads-1.2.mod//src/pads-report.pl
3732 --- pads-1.2/src/pads-report.pl 2005-06-16 00:10:41.000000000 +0200
3733 +++ pads-1.2.mod//src/pads-report.pl 2010-12-19 14:27:38.763334501 +0100
3734 @@ -26,7 +26,7 @@
3735 my $version = '1.2';
3736 my $date = '06/17/05';
3738 -# $Id: pads-report.pl,v 1.2 2005/06/15 22:10:41 mattshelton Exp $
3739 +# $Id: pads-report.pl,v 1.2 2005/11/02 23:56:12 jfs Exp $
3741 # ---------------------------------------------------------------------
3742 use strict;
3743 diff -ur pads-1.2/src/storage.c pads-1.2.mod//src/storage.c
3744 --- pads-1.2/src/storage.c 2005-02-16 02:47:35.000000000 +0100
3745 +++ pads-1.2.mod//src/storage.c 2010-12-19 14:27:38.796667834 +0100
3746 @@ -21,7 +21,7 @@
3747 * along with this program; if not, write to the Free Software
3748 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
3750 - * $Id: storage.c,v 1.3 2005/02/16 01:47:35 mattshelton Exp $
3751 + * $Id: storage.c,v 1.2 2005/11/02 23:56:12 jfs Exp $
3753 **************************************************************************/
3754 #include "storage.h"
3755 @@ -467,7 +467,7 @@
3756 printf("-- Begin Asset Database --\n");
3757 rec = asset_list;
3758 while (rec != NULL) {
3759 - printf("%d: %s,%d,%d,%d,%s,%s,%d\n",
3760 + printf("%d: %s,%d,%d,%ld,%s,%s,%d\n",
3761 id, inet_ntoa(rec->ip_addr), ntohs(rec->port),
3762 rec->proto, rec->discovered,
3763 bdata(rec->service), bdata(rec->application),
3764 @@ -481,8 +481,8 @@
3765 id = 0;
3766 arp = arp_asset_list;
3767 while (arp != NULL) {
3768 - printf("%d: %s,%s,%d\n", id, inet_ntoa(arp->ip_addr),
3769 - ether_ntoa(&arp->mac_addr), arp->discovered);
3770 + printf("%d: %s,%s,%ld\n", id, inet_ntoa(arp->ip_addr),
3771 + hex2mac(arp->mac_addr), arp->discovered);
3772 arp = arp->next;
3773 id++;
3775 diff -ur pads-1.2/src/storage.h pads-1.2.mod//src/storage.h
3776 --- pads-1.2/src/storage.h 2005-02-16 02:47:35.000000000 +0100
3777 +++ pads-1.2.mod//src/storage.h 2010-12-19 14:27:38.773334500 +0100
3778 @@ -22,20 +22,25 @@
3779 * along with this program; if not, write to the Free Software
3780 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
3782 - * $Id: storage.h,v 1.2 2005/02/16 01:47:35 mattshelton Exp $
3783 + * $Id: storage.h,v 1.3 2005/11/02 23:56:12 jfs Exp $
3785 **************************************************************************/
3787 +#ifndef _PADS_STORAGE_H
3788 /* INCLUDES ---------------------------------------- */
3789 +#define _PADS_STORAGE_H 1
3790 #include <unistd.h>
3791 #include <stdio.h>
3792 #include <signal.h>
3793 #include <time.h>
3795 #include "global.h"
3796 +#include "mac-resolution.h"
3798 +#include <arpa/inet.h>
3799 #include <netinet/ip.h>
3800 #include <netinet/tcp.h>
3801 +#include <netinet/ether.h>
3804 /* DEFINES ----------------------------------------- */
3805 @@ -67,3 +72,4 @@
3808 /* GLOBALS ----------------------------------------- */
3809 +#endif
3810 diff -ur pads-1.2/src/util.c pads-1.2.mod//src/util.c
3811 --- pads-1.2/src/util.c 2005-03-11 02:31:15.000000000 +0100
3812 +++ pads-1.2.mod//src/util.c 2010-12-19 14:27:38.743334500 +0100
3813 @@ -22,7 +22,7 @@
3814 * along with this program; if not, write to the Free Software
3815 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
3817 - * $Id: util.c,v 1.6 2005/03/11 01:31:15 mattshelton Exp $
3818 + * $Id: util.c,v 1.4 2005/11/02 23:56:12 jfs Exp $
3820 **************************************************************************/
3821 #include "util.h"
3822 @@ -48,29 +48,6 @@
3825 /* ----------------------------------------------------------
3826 - * FUNCTION : chomp
3827 - * DESCRIPTION : This function is similar to Perl's 'chomp'
3828 - * : command. It will strip off the '\n'
3829 - * : closest to the end of the string.
3830 - * INPUT : 0 - String
3831 - * : 1 - Size of String
3832 - * RETURN : 0 - '\n' removed
3833 - * : 1 - '\n' was never there
3834 - * ---------------------------------------------------------- */
3835 -int
3836 -chomp (char *string, int size)
3838 - for (size; size >= 0; size--) {
3839 - if (string[size] == '\n') {
3840 - string[size] = '\0';
3841 - return 1;
3845 - return 0;
3848 -/* ----------------------------------------------------------
3849 * FUNCTION : daemonize
3850 * DESCRIPTION : This function will place the application in
3851 * : the background.
3852 @@ -117,7 +94,7 @@
3853 struct passwd *this_user;
3855 /* Default PID File */
3856 - if (gc.pid_file->slen >= 0)
3857 + if (!gc.pid_file)
3858 gc.pid_file = bfromcstr("/var/run/pads.pid");
3860 /* Create PID File */
3861 @@ -137,7 +114,7 @@
3862 err_message("'%s' group does not appear to exist.", bdata(group));
3863 if ((this_user = getpwnam(bdata(user))) == NULL)
3864 err_message("'%s' user does not appear to exist.", bdata(user));
3865 - if ((chown(pid_file, this_user->pw_uid, this_group->gr_gid)) != 0)
3866 + if ((chown((char *)pid_file, this_user->pw_uid, this_group->gr_gid)) != 0)
3867 err_message("Unable to change PID file's ownership.");
3870 diff -ur pads-1.2/src/util.h pads-1.2.mod//src/util.h
3871 --- pads-1.2/src/util.h 2005-02-22 17:09:25.000000000 +0100
3872 +++ pads-1.2.mod//src/util.h 2010-12-19 14:27:38.763334501 +0100
3873 @@ -21,24 +21,28 @@
3874 * along with this program; if not, write to the Free Software
3875 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
3877 - * $Id: util.h,v 1.4 2005/02/22 16:09:25 mattshelton Exp $
3878 + * $Id: util.h,v 1.3 2005/11/02 23:56:12 jfs Exp $
3880 **************************************************************************/
3882 +#ifndef _PADS_UTIL_H
3883 /* INCLUDES ---------------------------------------- */
3884 +#define _PADS_UTIL_H 1
3885 +#include <unistd.h>
3886 #include <stdio.h>
3887 #include <stdarg.h>
3888 #include <sys/types.h>
3889 #include <strings.h>
3890 +#include <ctype.h>
3891 #include <grp.h>
3892 #include <pwd.h>
3893 #include <syslog.h>
3895 #include "global.h"
3896 +#include "pads.h"
3898 /* PROTOTYPES -------------------------------------- */
3899 void strip_comment (char *string);
3900 -int chomp (char *string, int size);
3901 void daemonize (void);
3902 void init_pid_file (bstring pid_file, bstring user, bstring group);
3903 char *copy_argv(register char **argv);
3904 @@ -56,3 +60,4 @@
3905 char *hex2mac(unsigned const char *mac);
3907 /* GLOBALS ----------------------------------------- */
3908 +#endif