summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTar Committer <tar@ocjtech.us>2004-01-12 03:17:26 +0000
committerTar Committer <tar@ocjtech.us>2004-01-12 03:17:26 +0000
commit989312339ea2e16579803a48700628c5469e327a (patch)
tree967ee77195819d70f2dc675444e92340bb98e0d6
parentff168ecfe045c690c24d5bbc5a3062bf9d64120c (diff)
downloadrancid-989312339ea2e16579803a48700628c5469e327a.tar.gz
rancid-989312339ea2e16579803a48700628c5469e327a.tar.xz
rancid-989312339ea2e16579803a48700628c5469e327a.zip
Imported from rancid-2.3.rc1.tar.gz.rancid-2.3.rc1
-rw-r--r--CHANGES161
-rw-r--r--COPYING22
-rw-r--r--FAQ143
-rw-r--r--Makefile.am51
-rw-r--r--Makefile.in637
-rw-r--r--README132
-rw-r--r--README.lg79
-rw-r--r--Todo74
-rw-r--r--UPGRADING85
-rw-r--r--acconfig.h78
-rw-r--r--aclocal.m41080
-rw-r--r--bin/Makefile.am103
-rw-r--r--bin/Makefile.in746
-rw-r--r--bin/alogin.in84
-rw-r--r--bin/arancid.in25
-rw-r--r--bin/blogin.in85
-rw-r--r--bin/brancid.in20
-rw-r--r--[-rwxr-xr-x]bin/cat5rancid.in31
-rw-r--r--[-rwxr-xr-x]bin/clogin.in156
-rw-r--r--[-rwxr-xr-x]bin/control_rancid.in79
-rw-r--r--bin/cssrancid.in660
-rw-r--r--[-rwxr-xr-x]bin/elogin.in44
-rw-r--r--bin/env.in48
-rw-r--r--[-rwxr-xr-x]bin/erancid.in23
-rw-r--r--[-rwxr-xr-x]bin/f10rancid.in31
-rw-r--r--[-rwxr-xr-x]bin/flogin.in95
-rw-r--r--bin/fnrancid.in275
-rw-r--r--[-rwxr-xr-x]bin/francid.in25
-rw-r--r--[-rwxr-xr-x]bin/hlogin.in92
-rw-r--r--bin/hpuifilter.c (renamed from bin/hpfilter.c)29
-rw-r--r--[-rwxr-xr-x]bin/hrancid.in32
-rw-r--r--bin/htlogin.in492
-rw-r--r--bin/htrancid.in266
-rw-r--r--bin/jerancid.in645
-rw-r--r--[-rwxr-xr-x]bin/jlogin.in50
-rw-r--r--[-rwxr-xr-x]bin/jrancid.in102
-rw-r--r--[-rwxr-xr-x]bin/lg.cgi.in (renamed from util/lg/lg.cgi.in)334
-rw-r--r--[-rwxr-xr-x]bin/lgform.cgi.in (renamed from util/lg/lgform.cgi.in)116
-rw-r--r--[-rwxr-xr-x]bin/mrancid.in30
-rw-r--r--bin/nlogin.in524
-rw-r--r--bin/nrancid.in302
-rw-r--r--bin/nslogin.in642
-rw-r--r--bin/nsrancid.in313
-rw-r--r--[-rwxr-xr-x]bin/par.in17
-rwxr-xr-xbin/prancid.in569
-rw-r--r--[-rwxr-xr-x]bin/rancid-cvs.in (renamed from bin/create_cvs.in)27
-rw-r--r--[-rwxr-xr-x]bin/rancid-fe.in51
-rw-r--r--[-rwxr-xr-x]bin/rancid-run.in (renamed from bin/do-diffs.in)36
-rw-r--r--[-rwxr-xr-x]bin/rancid.in445
-rwxr-xr-xbin/rename.in113
-rw-r--r--bin/rivlogin.in1005
-rw-r--r--bin/rivrancid.in344
-rw-r--r--[-rwxr-xr-x]bin/rrancid.in23
-rw-r--r--bin/tntlogin.in528
-rw-r--r--bin/tntrancid.in292
-rw-r--r--[-rwxr-xr-x]bin/xrancid.in64
-rwxr-xr-xbin/zrancid.in411
-rw-r--r--cloginrc.sample16
-rwxr-xr-xconfigure8383
-rw-r--r--configure.in122
-rwxr-xr-xdepcomp520
-rw-r--r--etc/Makefile.am77
-rw-r--r--etc/Makefile.in375
-rw-r--r--etc/lg.conf.sample.in188
-rw-r--r--etc/rancid.conf.sample.in59
-rw-r--r--include/Makefile.am24
-rw-r--r--include/Makefile.in411
-rw-r--r--include/config.h165
-rw-r--r--include/config.h.in143
-rw-r--r--include/stamp-h.in1
-rw-r--r--include/version.h2
-rw-r--r--include/version.h.in2
-rwxr-xr-xinstall-sh443
-rw-r--r--man/Makefile.am71
-rw-r--r--man/Makefile.in444
-rw-r--r--man/clogin.159
-rw-r--r--man/cloginrc.557
-rw-r--r--man/control_rancid.112
-rw-r--r--man/cssrancid.11
-rw-r--r--man/fnrancid.11
-rw-r--r--man/htlogin.11
-rw-r--r--man/htrancid.11
-rw-r--r--man/jerancid.11
-rw-r--r--man/lg.conf.5.in45
-rw-r--r--man/lg_intro.1.in2
-rw-r--r--man/nlogin.11
-rw-r--r--man/nrancid.11
-rw-r--r--man/nslogin.11
-rw-r--r--man/nsrancid.11
-rw-r--r--man/par.110
-rw-r--r--man/prancid.11
-rw-r--r--man/rancid-cvs.1 (renamed from man/create_cvs.1)24
-rw-r--r--man/rancid-run.1 (renamed from man/do-diffs.1)36
-rw-r--r--man/rancid.148
-rw-r--r--man/rancid.conf.5.in (renamed from man/env.5.in)93
-rw-r--r--man/rancid_intro.152
-rw-r--r--man/rivlogin.11
-rw-r--r--man/rivrancid.11
-rw-r--r--man/router.db.551
-rw-r--r--man/tntlogin.11
-rw-r--r--man/tntrancid.11
-rw-r--r--man/zrancid.11
-rwxr-xr-xmissing212
-rwxr-xr-xmkinstalldirs149
-rw-r--r--share/Makefile.am53
-rw-r--r--share/Makefile.in401
-rw-r--r--share/README.misc24
-rw-r--r--share/cisco-load.exp (renamed from util/cisco-load.exp)19
-rw-r--r--share/cisco-reload.exp (renamed from util/cisco-reload.exp)18
-rw-r--r--share/downreport.in81
-rw-r--r--[-rwxr-xr-x]share/getipacctg (renamed from util/getipacctg.in)34
-rw-r--r--share/index.html (renamed from util/lg/index.html)3
-rw-r--r--share/lgnotes.html (renamed from util/lg/lgnotes.html)0
-rw-r--r--[-rwxr-xr-x]share/rtrfilter.in (renamed from util/rtrfilter.in)22
-rw-r--r--util/Makefile.in37
-rw-r--r--util/README9
-rwxr-xr-xutil/configure990
-rw-r--r--util/configure.in26
-rwxr-xr-xutil/downreport.in62
-rw-r--r--util/lg/Makefile.in43
-rw-r--r--util/lg/README76
-rwxr-xr-xutil/lg/configure991
-rw-r--r--util/lg/configure.in27
-rw-r--r--util/lg/lg.conf.in105
-rw-r--r--util/rtrfilter.README14
125 files changed, 21151 insertions, 7161 deletions
diff --git a/CHANGES b/CHANGES
index 2795e3f..fb139cf 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,156 @@
+2.3.rc1
+ The following files have been moved to make rancid more
+ install/pkg/port/rpm friendly.
+ *** bin/env has been moved to etc/rancid.conf ***
+ *** bin/hpfilter has been renamed hpuifilter ***
+ *** util/lg/lg.conf has been moved to etc/lg.conf ***
+ *** util/lg/lg*.cgi have been moved to bin/lg*cgi ***
+ Note: existing configuration files are *NOT* copied/moved for you
+
+ bin/rename is no longer shipped with rancid
+
+ rancid.conf: add LOGDIR variable - see rancid.conf(5)
+
+ rancid: add show spe version and parse FRU show diag output
+ - from Yuval Ben-Ari.
+
+ add option --enable-adminmail-plus to configure
+
+ jrancid: collect show chassis alarms
+
+ rancid: skip show vlan for (3550|4500|7600) - from Andrew Fort
+
+ rancid: collect 6500 slave sup bootflash - from Andrew Fort
+
+ rancid: show diag updates for 1700, 3700, etc - help from Michael Haba
+
+ The Extreme does not have an 'enable' level, so make sure
+ you have 'set autoenable' for it in your .cloginrc so clogin
+ will work.
+
+ add Cisco CSS support - from Wedge Martin
+
+ *login: add cloginrc sshcmd directive - idea from steve neighorn
+
+ rancid: IOS show version changes w/ 12.3 - from Yuval Ben-Ari
+
+ support for hitachi routers - from Mohacsi Janos
+
+ strip WS around router.db fields - from Alastair Galloway
+
+ add goveling of 2600 mainboard port adapter info
+
+ *login: also check LOGNAME for default username - from Fredrik Thulin
+
+ jerancid: add matches for "Please wait" to all functions -
+ reported by Dave Mack
+
+ fnrancid: Fortigate support - from D. Pfleger
+
+ nlogin: Fix prompt groveling when running a cluster - from D. Pfleger
+
+ nrancid: filter "set admin user" - from D. Pfleger
+
+ rancid: do both 'write term' and 'show running-config' and
+ keep the output from the first one that works. As cisco
+ phases out 'write term', this will keep things working.
+
+ jerancid: filter host ... ftp, encrypted passwords oscillate - reported
+ by Dave Mack.
+
+ rivlogin: add "User:" as a possible username prompt (u_prompt) for
+ some platforms - from Adam Rothschild
+
+ cat 3500 s/n and pix failover license - from Rob Evans
+
+ recognize cisco ContentEngine - from Rob Evans
+
+ Juniper ERX (jerancid) support, based on 5.0 - thanks to Dan Pfleger,
+ Richard Russman, Zaid, Mike Baker, and Mark Nguyen
+
+ rancid: drop the "suggested action" portion of GSR LC/RP ROM upgrade
+ warnings. Cisco keeps changing the format; it just is not worth the
+ aggrevation.
+
+ study causes missed command somehow in redhat9 - from David King
+
+ filter port security mac entries, from Arnold Nipper
+
+ add Procket Networks support, "prancid"
+
+ filter ipsec keys in rancid & jrancid.
+
+ rancid: collect show idprom backplane (6500 cmd); this could collect
+ more - request from jared mauch
+
+ rancid: order all 'ip host' commands.
+
+ rancid: collect show rsp chassis-info
+
+ rancid: filter HSRP auth and SSA key-string reversable passwords
+
+ lg: set query/command list in lg.conf, thus allowing individual cmds
+ to {dis,en}abled, and add some multicast and ipv6 queries all of which
+ are disabled by default (for lack of testing) - from Janos Mohacsi
+
+ cat5rancid: collect 'write term all' for cats that support it - tested
+ by terry kennedy and joe rizzo
+
+ cat5rancid: regularize escaping of regex operators in switch prompt
+
+ nsrancid: include "get log setting", as suggested by gael canal.
+
+ add manpage note about log_user with -s, from mail list discussion
+
+ xrancid: Handle end of ssh connection a bit better.
+
+ jrancid: skip master/backup re msgs
+
+ *rancid: escape regex chars found in prompt
+
+ xrancid: also collect 'show configuration detail'
+
+ hlogin: allow the port to be specified for method ssh and
+ add path to hlogin to env(PATH) for locating hpfilter
+
+ hpfilter: allow >2 arguments so that telnet port number can be passed.
+
+ rancid: gsr RP slot warning is only 1 line - Russell Heilling
+
+ add zrancid to handle zebra routing s/w
+
+ add riverstone support - from Jim Meehan. thanks to Hong Luo for
+ access to a riverstone to test. Kevin Chan reports that this works
+ for Cabletron routers with more recent s/w (~v9.0.3).
+
+ jrancid: fix handling of reversible keys such that trailing text is
+ not removed
+
+ rancid: slave/redundancy stuff - from stephen griffin
+
+ rancid: show version bootstrap format changed in 12.0(23)S
+
+ rancid: make sure we filter PIX pager prompts
+
+ xrancid: make xrancid work when the extreme has pending changes.
+
+ netscaler support - from Anshuman Kanwar.
+
+ netscreen firewall support - from Stephen Gill
+
+ rancid: include additional cpu info from show version in !CPU: line.
+
+ lucent tnt support - from Richard Vander Reyden
+
+ rancid: skip consecutive comment lines. on some access servers the
+ number of comment lines oscillate.
+
+ lg.conf: add LG_STYLE variable for style sheet - from Janos Mohacsi
+
+ also install the FAQ - good idea from Janos Mohacsi's freshport
+
+ rancid: filter 'cable shared-secret'
+
2.2.2
*login: fix handling of userprompt et al so that {}'s are used in
.cloginrc as they are with every other .cloginrc directive.
@@ -77,7 +230,7 @@
alogin: misplaced brace caused improper return from proc login
relax the check ping and traceroute check of hostname arguments such
- that non-fqdn hosts are allowed. ie: just check that arg chars are
+ that non-fqdn hosts are allowed. i.e.: just check that arg chars are
valid dns chars and leave the resolve errors to the router.
Add initial support for Force10.
@@ -217,9 +370,9 @@
can be used within configuration mode. note: this turns $prompt into
a regexp, WRT -s scripts and -re option for expect's.
- add -Evar=x option to pass variables to scripts. eg:
+ add -Evar=x option to pass variables to scripts. e.g.:
clogin -Evariable=something router...
- clogin -Evariable=a,b,c [ie: an array/list which user splits]
+ clogin -Evariable=a,b,c [i.e.: an array/list which user splits]
2.2b2
fix jlogin's password/userpassword functionality which broke when
@@ -277,7 +430,7 @@
add man pages
- collect 'sh vlan' on cat 6000 - afort@staff.webcentral.com.au
+ collect 'sh vlan' on cat 6000 - afort@choqolat.org
Add 'show vtp status' for the 3500XLs as well.
diff --git a/COPYING b/COPYING
index 639e792..888b207 100644
--- a/COPYING
+++ b/COPYING
@@ -1,18 +1,22 @@
##
-## Copyright (C) 1997-2001 by Henry Kilmer, Erik Sherk and Pete Whiting.
+## Copyright (C) 1997-2004 by Terrapin Communications, Inc.
## All rights reserved.
##
-## This software may be freely copied, modified and redistributed without
-## fee for non-commerical purposes provided that this copyright notice is
-## preserved intact on all copies and modified copies.
+## This software may be freely copied, modified and redistributed
+## without fee for non-commerical purposes provided that this license
+## remains intact and unmodified with any RANCID distribution.
##
## There is no warranty or other guarantee of fitness of this software.
-## It is provided solely "as is". The author(s) disclaim(s) all
+## It is provided solely "as is". The author(s) disclaim(s) all
## responsibility and liability with respect to this software's usage
## or its effect upon hardware, computer systems, other software, or
## anything else.
##
-
-# bin/rename - is from CPAN by lwall.
-# util/lg - the original looking glass is by Ed Kern, provided by
-# permission and modified beyond recognition of the original
+## Except where noted otherwise, rancid was written by and is maintained by
+## Henry Kilmer, John Heasley, Andrew Partan, Pete Whiting, and Austin Schutz.
+##
+#
+# The login expect scripts were based on Erik Sherk's gwtn, by permission.
+#
+# bin/lg - the original looking glass software was written by Ed Kern,
+# provided by permission and modified beyond recognition.
diff --git a/FAQ b/FAQ
index 7cda952..210700e 100644
--- a/FAQ
+++ b/FAQ
@@ -1,20 +1,65 @@
-Frequently Asked Questions about rancid - last updated 20011121.
+Frequently Asked Questions about rancid - last updated 20040107.
+
+This FAQ contains information that may not apply directly to versions of
+rancid prior to 2.3. It also contains paths containing tags such as
+<PREFIX>, which refer to paths that are site-specific and are determined
+by how rancid is or was configured at installation time. These are explained
+briefly in the configure --help output. Below are the defaults used in
+rancid.
+
+ PREFIX configure --prefix= option. default: /usr/local/rancid
+ EPREFIX configure --exec-prefix= option. default: <PREFIX>
+ BINDIR configure --bindir= option. default: <EPREFIX>/bin
+ The location of clogin, etc.
+ SYSCONFDIR configure --sysconfdir option. default: <PREFIX>/etc
+ The location of rancid.conf, etc.
+ LOCALSTATEDIR configure --localstatedir option. default: <PREFIX>/var
+ The location of the CVS repository, log files, etc.
1) Platform specific
Q. I have a Cisco Catalyst 6500 series switch running the IOS (NOT catOS)
software, is the router.db device type cisco or cat5?
-A. A catalyst running IOS is type "cisco". See the router.db(5) manual page.
+A. A catalyst running IOS is type "cisco". The 'show version' output will
+ have banner including a phrase similar to "Cisco Internetwork Operating
+ System Software". See the router.db(5) manual page.
+
+Q. I have Hybrid Cisco switch, like a cat5k with an RSM. How do I collect
+ both the routing engine and switch configurations?
+A. Recommended way is to use two entries in the router.db, one for each.
+ For example:
+ cat5k_rsm.domain.com:cisco:up
+ cat5k_sw.domain.com:cat5:up
Q. I have a Cisco ??? on which collection stopped working, but clogin works
as expected.
A. Check if 'write term' produces output. Some IOS combined with large
configs and low free memory produce zero 'write term' output, esp. combined
- with a memory leak. The device will have to be rebooted or upgraded.
+ with a memory leak. The device will have to be rebooted and/or upgraded.
+
+Q. I have a Cisco Catalyst switch. clogin connects, but after receiving the
+ prompt, it stalls until it times out. Why?
+A. This may be due to your prompt. CatOS does not include an implicit '>' in
+ it's prompt, like IOS does. clogin looks for '>' during login, so specify
+ your prompt with a trailing '>'. Also see cat5rancid(1). For example:
+ cat5k>
+ cat5k> enable
+ Password:
+ cat5k> (enable)
+
+Q. Polling a ZebOS box fails from cron, but is successful from the command-
+ line.
+A. This is the tty/pty handling of either your O/S or ZebOS. Supposedly,
+ changing the TERM in <SYSCONFDIR>/rancid.conf to the following seems to
+ fix it.
+ TERM=vt100;export TERM
+ COLUMNS=160; LINES=48; export COLUMNS LINES
2) CVS and filesystem permissions
+ WARNING: Be careful when mucking around with the repository!
+
Q. I am new to CVS, where can I find additional information?
A. The manual page for CVS is quite complete, but can be be overwhelming even
for someone familiar with RCS. There are some excellent resources on the
@@ -23,31 +68,31 @@ A. The manual page for CVS is quite complete, but can be be overwhelming even
Q. Errors are showing up in the logs like:
cvs [diff aborted]: there is no version here; run 'cvs checkout' first
A. The directory was not imported into CVS properly or was not properly checked
- out afterward, so CVS control files or directories do not exist. create_cvs
+ out afterward, so CVS control files or directories do not exist. rancid-cvs
should always be used to create the directories and perform the CVS work.
If it is just the directories that have been created manually, save a copy of
- the router.db file, then remove the group's directory, use create_cvs, and
+ the router.db file, then remove the group's directory, use rancid-cvs, and
replace the router.db file. If the CVS import was also performed manually,
- cd to <BASEDIR> and use 'cvs co <rancid group>' to create all the CVS
+ cd to <LOCALSTATEDIR> and use 'cvs co <rancid group>' to create all the CVS
control bits.
Q. I keep receiving the same diff for a (or set of) devices, but I know the
data is not changing repeatedly. Why?
-A. This is most likely either a CVS or filesystem permissions problem. Check
- the log file from the last run for that group first; it may provide the
+A. This is probably a CVS or filesystem permissions problem. Check the log
+ file from the last run for that group for clues first; it may provide the
exact cause.
Note: It is very important the following be done as the user who normally
runs the rancid collection from cron.
- Check the cvs status of the device's file. eg:
+ Check the cvs status of the device's file. example:
guelah [2704] cvs status rtr.shrubbery.net
===================================================================
File: yogi.shrubbery.net Status: Up-to-date
Working revision: 1.197 Tue Jul 10 15:41:16 2001
- Repository revision: 1.197 /user/local/rancid/CVS/shrubbery/configs/rtr.shrubbery.net,v
+ Repository revision: 1.197 /usr/local/rancid/var/CVS/shrubbery/configs/rtr.shrubbery.net,v
Sticky Tag: (none)
Sticky Date: (none)
Sticky Options: (none)
@@ -55,19 +100,20 @@ A. This is most likely either a CVS or filesystem permissions problem. Check
The Status: should be Up-to-date. If the status is "Unknown", then somehow
the file has been created without being cvs add'ed. This should be
corrected by removing that device's entry from the group's router.db file,
- run do-diffs, replace the entry in router.db, and run do-diffs again.
+ run rancid-run, replace the entry in router.db, and run rancid-run again.
If the Status is anything else, someone has most likely been touching the
files manually. Sane state can be achieved by removing the file and running
cvs update <file> to get a fresh copy from the repository.
Check the ownership and permissions of the file and directory and the
- directory and file in the cvs repository (/usr/local/rancid/CVS/). They
- should be owned by the user who runs do-diffs from cron. At the very least,
- the directory and files should be writable by the rancid user. Group and
- world permissions will determined by the umask (default 027), which is set
- in /usr/local/rancid/bin/env. Likely the easiest way to fix the ownership
- on the cvs repository is chown -R <rancid user> /usr/local/rancid/CVS
+ directory and file in the cvs repository (<LOCALSTATEDIR>/CVS/). They
+ should be owned by the user who runs rancid-run from cron. At the very
+ least, the directory and files should be writable by the rancid user. Group
+ and world permissions will determined by the umask (default 027), which is
+ set in <SYSCONFDIR>/rancid.conf. Likely the easiest way to fix the
+ ownership on the cvs repository is
+ chown -R <rancid user> <LOCALSTATEDIR>/CVS <LOCALSTATEDIR>/<GROUPS>
Q. I am renaming a device but would like the retain the history in CVS. How
is this done?
@@ -75,11 +121,11 @@ A. CVS does not provide a way (AFAIK) to rename files or to rename or delete
directories. The best way is to copy the CVS repository file manually
like this (disclaimer: BE VERY CAREFUL mucking around with the repository):
% su - rancid_user
- % cd /usr/local/rancid
+ % cd <LOCALSTATEDIR>
% echo "new_device_name:device_type:up" >> GROUP/router.db
% cp -p CVS/GROUP/configs/old_device_name,v \
CVS/GROUP/configs/new_device_name,v
- where GROUP is the name of the rancid group the device is a member of.
+ where GROUP is the name of the rancid group that the device is a member of.
Rancid will pick-up the new file with a CVS update the next time it runs.
Once the renaming is complete, remove the old name from the router.db file
and leave the CVS clean-up of the old filename to rancid.
@@ -88,13 +134,23 @@ A. CVS does not provide a way (AFAIK) to rename files or to rename or delete
history, the same procedure would work. Substituting the new group name
appropriately.
+Q. I am removing a group and would like to remove all traces of it from the
+ rancid directory and the CVS repository. How is this done?
+A. As far as I know, CVS does not provide a way to remove directories. First,
+ remove the group from <SYSCONFDIR>/rancid.conf. If rancid is running,
+ wait for it to complete. Then just recursively remove the
+ directory. For example, a group named "fubar":
+ % su - rancid_user
+ % cd <LOCALSTATEDIR>
+ % rm -rf fubar CVS/fubar
+
3) General
Q. I have a (set of) device(s) on which collection fails. How can I debug
this?
A. Our usual diagnostic procedure for this is:
- - Make sure that the appropriate *login (eg: clogin for cisco) works.
+ - Make sure that the appropriate *login (example: clogin for cisco) works.
This tests to make sure you don't have routing or firewall issues, DNS
or hostname errors, that your .cloginrc is correct, your banner does
not have some character that *login does not like, and that the *login
@@ -103,7 +159,7 @@ A. Our usual diagnostic procedure for this is:
clogin cisco_router
Should login to cisco_router and produce a router prompt that you can
- use normally, as if clogin were not used (ie: telnet cisco_router).
+ use normally, as if clogin were not used (i.e.: telnet cisco_router).
- See if commands can be executed on the router via clogin. This will
exercise the *login functionality needed for rancid. For example:
@@ -129,8 +185,8 @@ A. Our usual diagnostic procedure for this is:
router.db file is correct and check the group's last log file for errors.
Q. Are there any characters in the banner that rancid has problems with OR
- I changed the device's command prompt?
-A. The trickest part about clogin (et al) is recognizing the prompt
+ I changed the device's command prompt and now collection is failing?
+A. The trickiest part about clogin (et al) is recognizing the prompt
correctly. clogin looks for '>' and '#' to figure out if it is logged
in or in enable mode. So if you have a '>' or '#' in your login banner
(other other motd), then clogin gets all confused and will not be
@@ -138,8 +194,49 @@ A. The trickest part about clogin (et al) is recognizing the prompt
Don't use '>' or '#' in your prompt or in your banner or other motd.
+Q. I use <BINDIR>/*login -c to run commands on multiple boxes. Sometimes
+ these are commands that take secondary input, like a filename. How can
+ enter the data for that secondary prompt?
+A. Two methods will work. Write an expect script to be used with clogin's
+ -s option, for which a few examples come with rancid like cisco-load.exp.
+ OR provide all the input in one command with the -c option like so:
+ Router#clear counters
+ Clear "show interface" counters on all interfaces [confirm]
+ Router#
+
+ clogin -c 'clear counters\n'
+ The specific return (\n) will be entered after 'clear counters' followed
+ by the normal return after the command.
+
+Q. I would like to collect device configurations every hour, but only receive
+ diffs every Nth collection or every N hours. Is this possible?
+A. Certainly, but rancid does not provide such a mechanism natively. Two
+ approaches are recommended:
+
+ 1) Using your preferred mail-list software, add a list with a digest
+ and configure your MTA (example: sendmail) to send diffs to the
+ list. Configure the mail-list software to force the digest at the
+ interval desired. This allows folks to choose which type they
+ prefer, after each collection or every N hours.
+
+ This method also provides easy methods to archive the diff mail and
+ retrieve previous diffs.
+
+ 2) Write a script to send diffs, which saves the time it last ran
+ and passes this to the -D option of CVS.
+
+ Obviously, the first option is the cleanest and most featureful, which is
+ why the script mention in the second option is not provided.
+
Q. I'm still stuck on this problem. Where can I get more help?
A. A discussion list is available, rancid-discuss@shrubbery.net. You must
be a subscriber to post. Subscribe like this:
shell% echo "subscribe" | mail rancid-discuss-request@shrubbery.net
+
+Q. What else can I do with rancid?
+A. The possibilities are endless...rancid is non-toxic when applied properly.
+ see Joe Abley and Stephen Stuart's NANOG presentation:
+ http://www.nanog.org/mtg-0210/abley.html
+ or our NANOG presentation:
+ http://www.shrubbery.net/rancid/NANOG29/
diff --git a/Makefile.am b/Makefile.am
index 6ad5316..df32f4f 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,28 +1,41 @@
## Process this file with automake to produce Makefile.in
+## A Makefile.in is supplied, in case you do not have automake.
+
+## $Id: Makefile.am,v 1.19 2004/01/10 22:47:29 heas Exp $
+##
+## Copyright (C) 1997-2004 by Terrapin Communications, Inc.
+## All rights reserved.
+##
+## This software may be freely copied, modified and redistributed
+## without fee for non-commerical purposes provided that this license
+## remains intact and unmodified with any RANCID distribution.
+##
+## There is no warranty or other guarantee of fitness of this software.
+## It is provided solely "as is". The author(s) disclaim(s) all
+## responsibility and liability with respect to this software's usage
+## or its effect upon hardware, computer systems, other software, or
+## anything else.
+##
+## Except where noted otherwise, rancid was written by and is maintained by
+## Henry Kilmer, John Heasley, Andrew Partan, and Pete Whiting.
+##
AUTOMAKE_OPTIONS=foreign no-dependencies
@SET_MAKE@
-EXTRA_DIST = BUGS CHANGES COPYING FAQ README Todo cloginrc.sample configure \
- install-sh \
- mkinstalldirs Makefile.in Todo
+pkgdata_DATA = COPYING CHANGES FAQ README README.lg UPGRADING cloginrc.sample
+EXTRA_DIST = BUGS Todo configure install-sh \
+ mkinstalldirs Makefile.in Todo $(pkgdata_DATA)
#DIST_COMMON =
# '.' is here (and at the beginnging of the macro) so that distclean-recursive
-# will run make distclean in . after the other dirs (preserving Makefile)
-SUBDIRS = . include bin man util
-
-all:
-
-# install-exec-local:
-# $(mkinstalldirs) $(prefix) $(prefix)/bin $(prefix)/man $(prefix)/util $(prefix)/util/lg
-
-install-exec-local:
- $(mkinstalldirs) $(prefix)/util $(prefix)/util/lg
-
-install:
- for file in CHANGES README cloginrc.sample ; do \
- $(INSTALL_DATA) $$file $(prefix); \
- done
-
+# will run make distclean in . after the other dirs (preserving Makefile) and
+# mkinstalldirs will create the install destination before descending into
+# the subdirs.
+SUBDIRS = . include etc bin man share
+
+# sysconfdir is here because etc/Makefile uses a script to be careful about
+# installing rancid.conf, not over-writing an existing one.
+install-data-hook:
+ $(mkinstalldirs) $(prefix) $(localstatedir) $(sysconfdir);
diff --git a/Makefile.in b/Makefile.in
index 52e2caa..2c7c59e 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -1,6 +1,8 @@
-# Makefile.in generated automatically by automake 1.4-p5 from Makefile.am
+# Makefile.in generated by automake 1.8 from Makefile.am.
+# @configure_input@
-# Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc.
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
+# Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@@ -10,127 +12,231 @@
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
-
-SHELL = @SHELL@
+@SET_MAKE@
srcdir = @srcdir@
top_srcdir = @top_srcdir@
VPATH = @srcdir@
-prefix = @prefix@
-exec_prefix = @exec_prefix@
-
-bindir = @bindir@
-sbindir = @sbindir@
-libexecdir = @libexecdir@
-datadir = @datadir@
-sysconfdir = @sysconfdir@
-sharedstatedir = @sharedstatedir@
-localstatedir = @localstatedir@
-libdir = @libdir@
-infodir = @infodir@
-mandir = @mandir@
-includedir = @includedir@
-oldincludedir = /usr/include
-
-DESTDIR =
-
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
-
top_builddir = .
-
-ACLOCAL = @ACLOCAL@
-AUTOCONF = @AUTOCONF@
-AUTOMAKE = @AUTOMAKE@
-AUTOHEADER = @AUTOHEADER@
-
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
INSTALL = @INSTALL@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS)
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-transform = @program_transform_name@
-
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
+subdir = .
+DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \
+ $(srcdir)/Makefile.in $(top_srcdir)/configure COPYING \
+ acconfig.h configure configure.in depcomp install-sh missing \
+ mkinstalldirs
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
+ $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
+ configure.lineno
+mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
+CONFIG_HEADER = $(top_builddir)/include/config.h
+CONFIG_CLEAN_FILES =
+depcomp =
+am__depfiles_maybe =
+SOURCES =
+DIST_SOURCES =
+RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
+ html-recursive info-recursive install-data-recursive \
+ install-exec-recursive install-info-recursive \
+ install-recursive installcheck-recursive installdirs-recursive \
+ pdf-recursive ps-recursive uninstall-info-recursive \
+ uninstall-recursive
+am__installdirs = $(DESTDIR)$(pkgdatadir)
+pkgdataDATA_INSTALL = $(INSTALL_DATA)
+DATA = $(pkgdata_DATA)
+ETAGS = etags
+CTAGS = ctags
+DIST_SUBDIRS = $(SUBDIRS)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+distdir = $(PACKAGE)-$(VERSION)
+top_distdir = $(distdir)
+am__remove_distdir = \
+ { test ! -d $(distdir) \
+ || { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \
+ && rm -fr $(distdir); }; }
+DIST_ARCHIVES = $(distdir).tar.gz
+GZIP_ENV = --best
+distuninstallcheck_listfiles = find . -type f -print
+distcleancheck_listfiles = find . -type f -print
+ACLOCAL = @ACLOCAL@
+ADMINMAILPLUS = @ADMINMAILPLUS@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
COMM = @COMM@
CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
CVS = @CVS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
DIFF = @DIFF@
DIFF_CMD = @DIFF_CMD@
DIRNAME = @DIRNAME@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
ENV_PATH = @ENV_PATH@
+EXEEXT = @EXEEXT@
EXPECT_PATH = @EXPECT_PATH@
FIND = @FIND@
GREP = @GREP@
ID = @ID@
-INST_PROGS = @INST_PROGS@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
LG_PING_CMD = @LG_PING_CMD@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LTLIBOBJS = @LTLIBOBJS@
MAILPLUS = @MAILPLUS@
-MAINT = @MAINT@
MAKE = @MAKE@
MAKEINFO = @MAKEINFO@
MKDIR = @MKDIR@
+OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
PERLV = @PERLV@
PERLV_PATH = @PERLV_PATH@
PING_PATH = @PING_PATH@
-RD_BIN_DATAS = @RD_BIN_DATAS@
-RD_BIN_PROGS = @RD_BIN_PROGS@
-RD_UTIL_LG_PROGS = @RD_UTIL_LG_PROGS@
-RD_UTIL_PROGS = @RD_UTIL_PROGS@
RSH = @RSH@
SENDMAIL = @SENDMAIL@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
SORT = @SORT@
SSH = @SSH@
+STRIP = @STRIP@
TAR = @TAR@
TELNET = @TELNET@
TOUCH = @TOUCH@
U = @U@
VERSION = @VERSION@
-
+ac_ct_CC = @ac_ct_CC@
+ac_ct_STRIP = @ac_ct_STRIP@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+bindir = @bindir@
+build_alias = @build_alias@
+datadir = @datadir@
+exec_prefix = @exec_prefix@
+host_alias = @host_alias@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
AUTOMAKE_OPTIONS = foreign no-dependencies
-
-EXTRA_DIST = BUGS CHANGES COPYING FAQ README Todo cloginrc.sample configure install-sh mkinstalldirs Makefile.in Todo
+pkgdata_DATA = COPYING CHANGES FAQ README README.lg UPGRADING cloginrc.sample
+EXTRA_DIST = BUGS Todo configure install-sh \
+ mkinstalldirs Makefile.in Todo $(pkgdata_DATA)
#DIST_COMMON =
# '.' is here (and at the beginnging of the macro) so that distclean-recursive
-# will run make distclean in . after the other dirs (preserving Makefile)
-SUBDIRS = . include bin man util
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
-CONFIG_HEADER = ./include/config.h
-CONFIG_CLEAN_FILES =
-DIST_COMMON = README COPYING Makefile.am Makefile.in acinclude.m4 \
-aclocal.m4 configure configure.in install-sh missing mkinstalldirs
-
+# will run make distclean in . after the other dirs (preserving Makefile) and
+# mkinstalldirs will create the install destination before descending into
+# the subdirs.
+SUBDIRS = . include etc bin man share
+all: all-recursive
-DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
-
-GZIP_ENV = --best
-all: all-redirect
.SUFFIXES:
-$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
- cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile
-
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
- cd $(top_builddir) \
- && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status
-
-$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ configure.in acinclude.m4
- cd $(srcdir) && $(ACLOCAL)
-
-config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+am--refresh:
+ @:
+$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ echo ' cd $(srcdir) && $(AUTOMAKE) --foreign '; \
+ cd $(srcdir) && $(AUTOMAKE) --foreign \
+ && exit 0; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --foreign Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ echo ' $(SHELL) ./config.status'; \
+ $(SHELL) ./config.status;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
$(SHELL) ./config.status --recheck
-$(srcdir)/configure: @MAINTAINER_MODE_TRUE@$(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES)
+
+$(top_srcdir)/configure: $(am__configure_deps)
cd $(srcdir) && $(AUTOCONF)
+$(ACLOCAL_M4): $(am__aclocal_m4_deps)
+ cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
+uninstall-info-am:
+install-pkgdataDATA: $(pkgdata_DATA)
+ @$(NORMAL_INSTALL)
+ $(mkdir_p) $(DESTDIR)$(pkgdatadir)
+ @list='$(pkgdata_DATA)'; for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ f="`echo $$p | sed -e 's|^.*/||'`"; \
+ echo " $(pkgdataDATA_INSTALL) $$d$$p $(DESTDIR)$(pkgdatadir)/$$f"; \
+ $(pkgdataDATA_INSTALL) $$d$$p $(DESTDIR)$(pkgdatadir)/$$f; \
+ done
+
+uninstall-pkgdataDATA:
+ @$(NORMAL_UNINSTALL)
+ @list='$(pkgdata_DATA)'; for p in $$list; do \
+ f="`echo $$p | sed -e 's|^.*/||'`"; \
+ echo " rm -f $(DESTDIR)$(pkgdatadir)/$$f"; \
+ rm -f $(DESTDIR)$(pkgdatadir)/$$f; \
+ done
# This directory's subdirectories are mostly independent; you can cd
# into them and run `make' without going through this Makefile.
@@ -138,13 +244,8 @@ $(srcdir)/configure: @MAINTAINER_MODE_TRUE@$(srcdir)/configure.in $(ACLOCAL_M4)
# (1) if the variable is set in `config.status', edit `config.status'
# (which will cause the Makefiles to be regenerated when you run `make');
# (2) otherwise, pass the desired values on the `make' command line.
-
-@SET_MAKE@
-
-all-recursive install-data-recursive install-exec-recursive \
-installdirs-recursive install-recursive uninstall-recursive \
-check-recursive installcheck-recursive info-recursive dvi-recursive:
- @set fnord $(MAKEFLAGS); amf=$$2; \
+$(RECURSIVE_TARGETS):
+ @set fnord $$MAKEFLAGS; amf=$$2; \
dot_seen=no; \
target=`echo $@ | sed s/-recursive//`; \
list='$(SUBDIRS)'; for subdir in $$list; do \
@@ -164,13 +265,18 @@ check-recursive installcheck-recursive info-recursive dvi-recursive:
mostlyclean-recursive clean-recursive distclean-recursive \
maintainer-clean-recursive:
- @set fnord $(MAKEFLAGS); amf=$$2; \
+ @set fnord $$MAKEFLAGS; amf=$$2; \
dot_seen=no; \
- rev=''; list='$(SUBDIRS)'; for subdir in $$list; do \
- rev="$$subdir $$rev"; \
- test "$$subdir" != "." || dot_seen=yes; \
+ case "$@" in \
+ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+ *) list='$(SUBDIRS)' ;; \
+ esac; \
+ rev=''; for subdir in $$list; do \
+ if test "$$subdir" = "."; then :; else \
+ rev="$$subdir $$rev"; \
+ fi; \
done; \
- test "$$dot_seen" = "no" && rev=". $$rev"; \
+ rev="$$rev ."; \
target=`echo $@ | sed s/-recursive//`; \
for subdir in $$rev; do \
echo "Making $$target in $$subdir"; \
@@ -186,178 +292,313 @@ tags-recursive:
list='$(SUBDIRS)'; for subdir in $$list; do \
test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
done
+ctags-recursive:
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+ done
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ mkid -fID $$unique
tags: TAGS
-TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP)
+TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
+ if (etags --etags-include --version) >/dev/null 2>&1; then \
+ include_option=--etags-include; \
+ else \
+ include_option=--include; \
+ fi; \
list='$(SUBDIRS)'; for subdir in $$list; do \
- if test "$$subdir" = .; then :; else \
- test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \
- fi; \
+ if test "$$subdir" = .; then :; else \
+ test -f $$subdir/TAGS && \
+ tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
+ fi; \
done; \
- list='$(SOURCES) $(HEADERS)'; \
- unique=`for i in $$list; do echo $$i; done | \
- awk ' { files[$$0] = 1; } \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
- test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \
- || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS)
-
-mostlyclean-tags:
+ test -z "$(ETAGS_ARGS)$$tags$$unique" \
+ || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$tags $$unique
+ctags: CTAGS
+CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ test -z "$(CTAGS_ARGS)$$tags$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$tags $$unique
-clean-tags:
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && cd $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) $$here
distclean-tags:
- -rm -f TAGS ID
-
-maintainer-clean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-distdir = $(PACKAGE)-$(VERSION)
-top_distdir = $(distdir)
-
-# This target untars the dist file and tries a VPATH configuration. Then
-# it guarantees that the distribution is self-contained by making another
-# tarfile.
-distcheck: dist
- -rm -rf $(distdir)
- GZIP=$(GZIP_ENV) $(TAR) zxf $(distdir).tar.gz
- mkdir $(distdir)/=build
- mkdir $(distdir)/=inst
- dc_install_base=`cd $(distdir)/=inst && pwd`; \
- cd $(distdir)/=build \
- && ../configure --srcdir=.. --prefix=$$dc_install_base \
- && $(MAKE) $(AM_MAKEFLAGS) \
- && $(MAKE) $(AM_MAKEFLAGS) dvi \
- && $(MAKE) $(AM_MAKEFLAGS) check \
- && $(MAKE) $(AM_MAKEFLAGS) install \
- && $(MAKE) $(AM_MAKEFLAGS) installcheck \
- && $(MAKE) $(AM_MAKEFLAGS) dist
- -rm -rf $(distdir)
- @banner="$(distdir).tar.gz is ready for distribution"; \
- dashes=`echo "$$banner" | sed s/./=/g`; \
- echo "$$dashes"; \
- echo "$$banner"; \
- echo "$$dashes"
-dist: distdir
- -chmod -R a+r $(distdir)
- GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir)
- -rm -rf $(distdir)
-dist-all: distdir
- -chmod -R a+r $(distdir)
- GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir)
- -rm -rf $(distdir)
distdir: $(DISTFILES)
- -rm -rf $(distdir)
+ $(am__remove_distdir)
mkdir $(distdir)
- -chmod 777 $(distdir)
- @for file in $(DISTFILES); do \
- d=$(srcdir); \
+ $(mkdir_p) $(distdir)/bin $(distdir)/include $(distdir)/share
+ @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+ list='$(DISTFILES)'; for file in $$list; do \
+ case $$file in \
+ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+ esac; \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+ dir="/$$dir"; \
+ $(mkdir_p) "$(distdir)$$dir"; \
+ else \
+ dir=''; \
+ fi; \
if test -d $$d/$$file; then \
- cp -pr $$d/$$file $(distdir)/$$file; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+ fi; \
+ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
else \
test -f $(distdir)/$$file \
- || ln $$d/$$file $(distdir)/$$file 2> /dev/null \
- || cp -p $$d/$$file $(distdir)/$$file || :; \
+ || cp -p $$d/$$file $(distdir)/$$file \
+ || exit 1; \
fi; \
done
- for subdir in $(SUBDIRS); do \
+ list='$(SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
- test -d $(distdir)/$$subdir \
- || mkdir $(distdir)/$$subdir \
+ test -d "$(distdir)/$$subdir" \
+ || mkdir "$(distdir)/$$subdir" \
|| exit 1; \
- chmod 777 $(distdir)/$$subdir; \
- (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir=../$(distdir) distdir=../$(distdir)/$$subdir distdir) \
+ (cd $$subdir && \
+ $(MAKE) $(AM_MAKEFLAGS) \
+ top_distdir="../$(top_distdir)" \
+ distdir="../$(distdir)/$$subdir" \
+ distdir) \
|| exit 1; \
fi; \
done
-info-am:
-info: info-recursive
-dvi-am:
-dvi: dvi-recursive
+ -find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \
+ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
+ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \
+ ! -type d ! -perm -444 -exec $(SHELL) $(install_sh) -c -m a+r {} {} \; \
+ || chmod -R a+r $(distdir)
+dist-gzip: distdir
+ $(AMTAR) chof - $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
+ $(am__remove_distdir)
+
+dist-bzip2: distdir
+ $(AMTAR) chof - $(distdir) | bzip2 -9 -c >$(distdir).tar.bz2
+ $(am__remove_distdir)
+
+dist-tarZ: distdir
+ $(AMTAR) chof - $(distdir) | compress -c >$(distdir).tar.Z
+ $(am__remove_distdir)
+
+dist-shar: distdir
+ shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
+ $(am__remove_distdir)
+
+dist-zip: distdir
+ -rm -f $(distdir).zip
+ zip -rq $(distdir).zip $(distdir)
+ $(am__remove_distdir)
+
+dist dist-all: distdir
+ $(AMTAR) chof - $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
+ $(am__remove_distdir)
+
+# This target untars the dist file and tries a VPATH configuration. Then
+# it guarantees that the distribution is self-contained by making another
+# tarfile.
+distcheck: dist
+ case '$(DIST_ARCHIVES)' in \
+ *.tar.gz*) \
+ GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(AMTAR) xf - ;;\
+ *.tar.bz2*) \
+ bunzip2 -c $(distdir).tar.bz2 | $(AMTAR) xf - ;;\
+ *.tar.Z*) \
+ uncompress -c $(distdir).tar.Z | $(AMTAR) xf - ;;\
+ *.shar.gz*) \
+ GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | unshar ;;\
+ *.zip*) \
+ unzip $(distdir).zip ;;\
+ esac
+ chmod -R a-w $(distdir); chmod a+w $(distdir)
+ mkdir $(distdir)/_build
+ mkdir $(distdir)/_inst
+ chmod a-w $(distdir)
+ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
+ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
+ && cd $(distdir)/_build \
+ && ../configure --srcdir=.. --prefix="$$dc_install_base" \
+ $(DISTCHECK_CONFIGURE_FLAGS) \
+ && $(MAKE) $(AM_MAKEFLAGS) \
+ && $(MAKE) $(AM_MAKEFLAGS) dvi \
+ && $(MAKE) $(AM_MAKEFLAGS) check \
+ && $(MAKE) $(AM_MAKEFLAGS) install \
+ && $(MAKE) $(AM_MAKEFLAGS) installcheck \
+ && $(MAKE) $(AM_MAKEFLAGS) uninstall \
+ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \
+ distuninstallcheck \
+ && chmod -R a-w "$$dc_install_base" \
+ && ({ \
+ (cd ../.. && $(mkdir_p) "$$dc_destdir") \
+ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \
+ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \
+ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \
+ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \
+ } || { rm -rf "$$dc_destdir"; exit 1; }) \
+ && rm -rf "$$dc_destdir" \
+ && $(MAKE) $(AM_MAKEFLAGS) dist \
+ && rm -rf $(DIST_ARCHIVES) \
+ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck
+ $(am__remove_distdir)
+ @(echo "$(distdir) archives ready for distribution: "; \
+ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
+ sed -e '1{h;s/./=/g;p;x;}' -e '$${p;x;}'
+distuninstallcheck:
+ @cd $(distuninstallcheck_dir) \
+ && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \
+ || { echo "ERROR: files left after uninstall:" ; \
+ if test -n "$(DESTDIR)"; then \
+ echo " (check DESTDIR support)"; \
+ fi ; \
+ $(distuninstallcheck_listfiles) ; \
+ exit 1; } >&2
+distcleancheck: distclean
+ @if test '$(srcdir)' = . ; then \
+ echo "ERROR: distcleancheck can only run from a VPATH build" ; \
+ exit 1 ; \
+ fi
+ @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \
+ || { echo "ERROR: files left in build directory after distclean:" ; \
+ $(distcleancheck_listfiles) ; \
+ exit 1; } >&2
check-am: all-am
check: check-recursive
-installcheck-am:
-installcheck: installcheck-recursive
-install-exec-am: install-exec-local
+all-am: Makefile $(DATA)
+installdirs: installdirs-recursive
+installdirs-am:
+ $(mkdir_p) $(DESTDIR)$(pkgdatadir)
+install: install-recursive
install-exec: install-exec-recursive
-
-install-data-am:
install-data: install-data-recursive
+uninstall: uninstall-recursive
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-install: install-recursive
-uninstall-am:
-uninstall: uninstall-recursive
-all-am: Makefile
-all-redirect: all-recursive
-install-strip:
- $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install
-installdirs: installdirs-recursive
-installdirs-am:
-
+installcheck: installcheck-recursive
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
mostlyclean-generic:
clean-generic:
distclean-generic:
- -rm -f Makefile $(CONFIG_CLEAN_FILES)
- -rm -f config.cache config.log stamp-h stamp-h[0-9]*
+ -rm -f $(CONFIG_CLEAN_FILES)
maintainer-clean-generic:
-mostlyclean-am: mostlyclean-tags mostlyclean-generic
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-recursive
-mostlyclean: mostlyclean-recursive
+clean-am: clean-generic mostlyclean-am
-clean-am: clean-tags clean-generic mostlyclean-am
+distclean: distclean-recursive
+ -rm -f $(am__CONFIG_DISTCLEAN_FILES)
+ -rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-tags
-clean: clean-recursive
+dvi: dvi-recursive
-distclean-am: distclean-tags distclean-generic clean-am
+dvi-am:
-distclean: distclean-recursive
- -rm -f config.status
+html: html-recursive
-maintainer-clean-am: maintainer-clean-tags maintainer-clean-generic \
- distclean-am
- @echo "This command is intended for maintainers to use;"
- @echo "it deletes files that may require special tools to rebuild."
+info: info-recursive
+
+info-am:
+
+install-data-am: install-pkgdataDATA
+ @$(NORMAL_INSTALL)
+ $(MAKE) $(AM_MAKEFLAGS) install-data-hook
+
+install-exec-am:
+
+install-info: install-info-recursive
+
+install-man:
+
+installcheck-am:
maintainer-clean: maintainer-clean-recursive
- -rm -f config.status
-
-.PHONY: install-data-recursive uninstall-data-recursive \
-install-exec-recursive uninstall-exec-recursive installdirs-recursive \
-uninstalldirs-recursive all-recursive check-recursive \
-installcheck-recursive info-recursive dvi-recursive \
-mostlyclean-recursive distclean-recursive clean-recursive \
-maintainer-clean-recursive tags tags-recursive mostlyclean-tags \
-distclean-tags clean-tags maintainer-clean-tags distdir info-am info \
-dvi-am dvi check check-am installcheck-am installcheck \
-install-exec-local install-exec-am install-exec install-data-am \
-install-data install-am install uninstall-am uninstall all-redirect \
-all-am all installdirs-am installdirs mostlyclean-generic \
-distclean-generic clean-generic maintainer-clean-generic clean \
-mostlyclean distclean maintainer-clean
+ -rm -f $(am__CONFIG_DISTCLEAN_FILES)
+ -rm -rf $(top_srcdir)/autom4te.cache
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+mostlyclean: mostlyclean-recursive
-@SET_MAKE@
+mostlyclean-am: mostlyclean-generic
-all:
+pdf: pdf-recursive
-# install-exec-local:
-# $(mkinstalldirs) $(prefix) $(prefix)/bin $(prefix)/man $(prefix)/util $(prefix)/util/lg
+pdf-am:
-install-exec-local:
- $(mkinstalldirs) $(prefix)/util $(prefix)/util/lg
+ps: ps-recursive
-install:
- for file in CHANGES README cloginrc.sample ; do \
- $(INSTALL_DATA) $$file $(prefix); \
- done
+ps-am:
+
+uninstall-am: uninstall-info-am uninstall-pkgdataDATA
+
+uninstall-info: uninstall-info-recursive
+
+.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am am--refresh check \
+ check-am clean clean-generic clean-recursive ctags \
+ ctags-recursive dist dist-all dist-bzip2 dist-gzip dist-shar \
+ dist-tarZ dist-zip distcheck distclean distclean-generic \
+ distclean-recursive distclean-tags distcleancheck distdir \
+ distuninstallcheck dvi dvi-am html html-am info info-am \
+ install install-am install-data install-data-am install-exec \
+ install-exec-am install-info install-info-am install-man \
+ install-pkgdataDATA install-strip installcheck installcheck-am \
+ installdirs installdirs-am maintainer-clean \
+ maintainer-clean-generic maintainer-clean-recursive \
+ mostlyclean mostlyclean-generic mostlyclean-recursive pdf \
+ pdf-am ps ps-am tags tags-recursive uninstall uninstall-am \
+ uninstall-info-am uninstall-pkgdataDATA
+
+
+@SET_MAKE@
+# sysconfdir is here because etc/Makefile uses a script to be careful about
+# installing rancid.conf, not over-writing an existing one.
+install-data-hook:
+ $(mkinstalldirs) $(prefix) $(localstatedir) $(sysconfdir);
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
diff --git a/README b/README
index cce631c..3fd7fe7 100644
--- a/README
+++ b/README
@@ -1,14 +1,26 @@
Rancid is a "Really Awesome New Cisco confIg Differ" developed to
maintain CVS controlled copies of router configs.
+*** The Following Information is Very Important ****
+Rancid 2.3 introduces a new directory layout. It has been changed to more
+closely follow the standard path hierarchy, which is defined by the FHS
+standard and autoconf, and/or make these locations more easily configurable
+within rancid.
+
+The obvious advantage of this is making rancid more easily packagable; i.e.:
+NetBSD pkgsrc, FreeBSD port, Linux RPM, etc.
+
+Please please please please read the UPGRADING file for more information.
+**********
+
The following is the packing list for Rancid. .in is stripped from
the files below by configure with substitutions completed:
README This file.
CHANGES List of changes to Rancid.
-Todo partial list of what needs to be done.
-env.in Environment settings needed.
-do-diffs.in Script designed to be run from cron calling control_rancid.
+Todo Partial list of what needs to be done.
+rancid.conf.in Environment settings needed.
+rancid-run.in Script designed to be run from cron calling control_rancid.
control_rancid.in
Builds router list, calls rancid on each router and
handles cvs routines.
@@ -21,6 +33,7 @@ francid.in Runs commands on foundry switches and processes the output.
hrancid.in Runs commands on hp procurve switches and processes the output.
jrancid.in Runs commands on juniper routers and processes the output.
mrancid.in Runs commands on MRT daemons and processes the output.
+nrancid.in Runs commands on netscreen routers and processes the output.
rrancid.in Runs commands on redback routers and processes the output.
xrancid.in Runs commands on extreme switches and processes the output.
cat5rancid.in Runs commands on cisco Cat switches and processes the output.
@@ -43,12 +56,13 @@ jlogin.in Expect script that logs into juniper routers similarly to
.cloginrc TCL commands to set passwords, usernames etc. used by clogin
and jlogin.
par.in Parallel processing of commands - any commands.
-rename.in Perl script to rename files.
-create_cvs.in Creates all of the CVS and config directories.
-hpfilter.c HP procurve login filter - see end of hlogin(1).
+rancid-cvs.in Creates all of the CVS and config directories.
+hpuifilter.c HP procurve login filter - see end of hlogin(1).
+etc/ Configuration file samples
+etc/lg.conf.sample
+etc/rancid.conf.sample
man/ man pages
-util/ utilities / contribs
-util/lg looking glass
+share/ Readmes, samples, utilities, contribs, etc
The following are included as part of the installation tools:
@@ -58,41 +72,53 @@ install-sh GNU autoconf shell script to simulate BSD style install
mkinstalldirs GNU autoconf shell script to make installation directories
rancid will also need to have the following packages:
-cvs code revision system available from prep.ai.mit.edu:/pub/gnu
-gnudiff gnudiff provides the uni-diff (-u) option. if you do not have
- gnudiff, configure will set-up rancid to use 'diff -c' or
- 'diff -C'.
+cvs Code revision system available from prep.ai.mit.edu:/pub/gnu
+gnudiff gnudiff provides the uni-diff (-u) option. If you do not have
+ a diff that supports -u, configure will set-up rancid to use
+ 'diff -c' or 'diff -C'.
perl5 perl version 5 or greater available from www.cpan.org
-expect http://expect.nist.gov/ we highly suggest that you stick to
- expect 5.24.1 (or so). this seems to work best. note that
- you have to have the accompanying tcl &/ tk.
-tcl required by expect.
+expect http://expect.nist.gov/ We highly suggest that you stick to
+ expect 5.24.1 (or so). This seems to work best. Note that
+ you need to have the accompanying tcl &/ tk.
+tcl Required by expect.
-Bill Fenner has a cgi script for interacting with CVS repositories via
-a web interface. This provides a great way to view rancid diffs and
-full configs, especially for those unfamiliar with cvs. The package is
-not included, but can be found here:
+Bill Fenner (now maintained by others) has a cgi script for interacting
+with CVS repositories via a web interface. This provides a great way to
+view rancid diffs and full configs, especially for those unfamiliar with
+cvs. The package is not included, but can be found here:
- http://www.freebsd.org/~fenner/cvsweb/cvsweb-1.0.tar.gz
+ http://www.freebsd.org/projects/cvsweb.html
Quick Installation Guide (an example):
1) ./configure [--prefix=<basedir>]
- By default, All rancid crud will be installed under /usr/local/rancid.
- This can be overridden with the --prefix option. E.g.:
+ By default, rancid will be installed under /usr/local/rancid (the default
+ "prefix"). This can be overridden with the --prefix option. E.g.:
./configure --prefix=/home/rancid
- see ./configure --help for other configure options.
+ Rancid uses autoconf's "localstatedir" as the location of it's logs,
+ CVS respository, and directories where it's groups are placed. The user
+ who will run rancid (from cron, etc) will need write access to these
+ directories. By default, this is <prefix>/var, or /home/rancid/var
+ following the example above.
+
+ We realize that this is not optimal, but it follows the standards. We
+ suggest that this be altered to include the package name, like so:
- The user who will run rancid must have write permission in this
- directory.
+ ./configure --prefix=/home/rancid \
+ --localstatedir=/home/rancid/var/rancid
+
+ The user who will run rancid must have write permission in "localstatedir".
+
+ See ./configure --help for other configure options.
2) make install
-3) Modify <basedir>/bin/env. The variable LIST_OF_GROUPS is a
- space delimited list of router "groups". E.g.:
+3) Modify <sysconfdir>/rancid.conf (e.g.: <basedir>/etc/rancid.conf). The
+ variable LIST_OF_GROUPS is a space delimited list of router "groups".
+ E.g.:
LIST_OF_GROUPS="backbone aggregation switches"
4) Put .cloginrc in the home directory of the user who will run rancid.
@@ -106,9 +132,9 @@ Quick Installation Guide (an example):
Note: the juniper user you use *must* log into a cli shell (which
is the default on a juniper).
- See the file cloginrc.sample, located in <basedir>, for examples and
- good starting point. Also take a look at the cloginrc manual page,
- 'man -M <basedir>/man cloginrc'.
+ See the file cloginrc.sample, located in <datadir> (<basedir>/share/rancid),
+ for examples and good starting point. Also take a look at the cloginrc
+ manual page, 'man -M <basedir>/man cloginrc'.
6) Modify /etc/aliases
Rancid sends the diffs and other administrative emails to rancid-<GROUP>
@@ -127,24 +153,28 @@ Quick Installation Guide (an example):
addresses mentioned above to "rancid+". See sendmail's operation manual
for more information on handling of '+'.
-7) Run create_cvs.
+ The --enable-adminmail-plus configure option will set each of the
+ "rancid-admin-" addresses mentioned above to "rancid-admin+". If this
+ option is not used, the value of --enable-mail-plus is assumed. That is,
+ the addresses will be "rancid+", if it is specified.
+
+7) Run rancid-cvs.
This creates all of the necessary directories and config files for
each of the groups in LIST_OF_GROUPS and imports them into CVS. This
will also be run each time a new group is added. Do not create the
- directories or CVS repository manually, allow create_cvs do it. Also see
- 'man -M <basedir>/man create_cvs'.
+ directories or CVS repository manually, allow rancid-cvs do it. Also see
+ 'man -M <basedir>/man rancid-cvs'.
8) For each "group", modify the router.db file in the group directory.
The file is of the form "router:mfg:state" where "router" is
the name (we use FQDN) of the router, mfg is the manufacturer
- from the set of
- (alteon|baynet|cat5|cisco|extreme|ezt3|force10|foundry|hp|juniper|redback),
- and "state" is either up or down. Each router listed as "up"
- will have the configuration grabbed. Note: manufacturer cat5
- is intended only for cisco catalyst switches running catalyst (not
+ from the set of (cat5|cisco|juniper) (see router.db.5 for a complete
+ list and description), and "state" is either up or down. Each router
+ listed as "up" will have the configuration grabbed. Note: manufacturer
+ cat5 is intended only for cisco catalyst switches running catalyst (not
IOS) code.
- eg <basedir>/<group>/router.db:
+ e.g.: <localstatedir>/<group>/router.db:
cisco-router.domain.com:cisco:up
adc-mux.domain.com:ezt3:up
foundry-switch-router.domain.com:foundry:up
@@ -152,28 +182,28 @@ Quick Installation Guide (an example):
redback-dsl-router.domain.com:redback:down
extreme-switch.domain.com:extreme:down
-9) For first-time users or new installations, run bin/do-diffs (with no
+9) For first-time users or new installations, run bin/rancid-run (with no
arguments) and check the resulting log file(s) (in logs/*) for errors.
Repeat until there are no errors.
-10) Put do-diffs in cron to be called however often you want it to
- run for each group (do-diffs [<GROUP>]). If you run it less
- often than once/hour, check the setting of OLDTIME in bin/env.
+10) Put rancid-run in cron to be called however often you want it to
+ run for each group (rancid-run [<GROUP>]). If you run it less
+ often than once/hour, check the setting of OLDTIME in etc/rancid.conf.
E.g.:
# run config differ hourly
- 1 * * * * <BASEDIR>/bin/do-diffs
+ 1 * * * * <BASEDIR>/bin/rancid-run
# clean out config differ logs
- 50 23 * * * /usr/bin/find <BASEDIR>/logs -type f -mtime +2 -exec rm {} \;
+ 50 23 * * * /usr/bin/find <localstatedir>/logs -type f -mtime +2 -exec rm {} \;
11) Note: If you are using any of these programs (other than
- do-diffs) out of cron, make sure that you set your $PATH
+ rancid-run) out of cron, make sure that you set your $PATH
correctly so that they work. E.g.: if you are using clogin,
it can call id, telnet, ssh, and/or rsh.
configure already makes sure that $PATH is set correctly in
- bin/env for do-diffs, so you could use the $PATH from there. eg:
+ etc/rancid.conf for rancid-run, so you could use the $PATH from there. e.g.:
- 50 23 * * * . /usr/local/rancid/bin/env; clogin -c 'sh vers' router
+ 50 23 * * * . <sysconfdir>/rancid.conf; clogin -c 'sh vers' router
12) Send any bugs, suggestions or updates to rancid@shrubbery.net.
See the web page at http://www.shrubbery.net/rancid. We have
@@ -198,10 +228,10 @@ Patch-ID# 105786-11
Keywords: security ip tcp_priv_stream routing ip_enable_group_ifs ndd
Synopsis: SunOS 5.6: /kernel/drv/ip patch
-another possibile contributor is expect/tcl. we've noticed that expect
+Another possibile contributor is expect/tcl. We've noticed that expect
5.24.1 (possibly 5.28.*) and whatever tcl happens to compile with it,
seems to not exhibit this problem, while 5.32.* appears to on linux and
-solaris but not on netbsd 1.5. see www.shrubbery.net/rancid for additional
+solaris but not on netbsd 1.5. See www.shrubbery.net/rancid for additional
notes on this.
-Hank
diff --git a/README.lg b/README.lg
new file mode 100644
index 0000000..d66d1f1
--- /dev/null
+++ b/README.lg
@@ -0,0 +1,79 @@
+This is a looking glass based on Ed Kern's which used to be available on
+http://nitrous.digex.net/. This version supports cisco, juniper, and
+foundry, using rancid's [cfj]login to login (so rcmd is not necessary,
+it can use telnet, ssh, or rsh), and has some additional commands
+implemented. There are a few cisco commands where either no juniper or
+foundry equivalent exists or we have not had time to implement yet.
+
+packing list:
+README This file.
+index.html often the default document the server will load, contains
+ an html redirect to load lgform.cgi
+lg.conf looking glass configuration file
+lg.cgi work horse of the looking glass
+lgform.cgi front-end form for the looking glass engine
+lgnotes.html user info for the looking glass
+
+The looking glass requires the CGI and LockFile-Simple perl modules.
+these can be retrieved from CPAN, http://www.cpan.org/. CGI's home is
+ftp://ftp-genome.wi.mit.edu/pub/software/WWW/. It also requires
+the POSIX module (for strftime) and Sys::Syslog, which I believe comes
+with perl5 and/or are converted with h2ph(1).
+
+basic installation instructions:
+
+The configure and make install process will make variable substitutions
+and install the looking glass bits. Assuming configure was run without
+directory options, such as --prefix, the default install prefix is
+/usr/local/rancid. So, the bits will be installed in
+/usr/local/rancid/etc/lg.conf, /usr/local/rancid/bin, and
+/usr/local/rancid/share/rancid (i.e.: <prefix>/etc/lg.conf, etc.).
+
+1) Make the scripts and html files available to your server (httpd) by
+ creating a directory in your server's document root directory
+ (apache's httpd.conf "DocumentRoot" variable). For example:
+
+ mkdir /usr/local/htdocs/lg
+
+ Then either:
+ - copy the files <PREFIX>/share/rancid/{index.html,lgnotes.html} and
+ <PREFIX>/bin/{lg.cgi,lgform.cgi} to /usr/local/htdocs/lg
+ OR
+ - create symlinks from /usr/local/htdocs/lg to each of these files.
+
+ Note on links: if you use symlinks, you have to configure apache to
+ allow following symlinks. e.g.:
+ % cat /usr/local/htdocs/lg/.htaccess
+ Options FollowSymLinks ExecCGI
+
+ Note on index.html: index.html is typically the default file loaded
+ when a url ends with a '/'. index.html can be used to redirect this
+ to lgform.cgi using a netscape meta refresh. Though this is supported
+ by many browsers, it is supposedly netscape specific and non-standard.
+ In apache, the same thing can be acheived by altering the default
+ directory index like this:
+
+ % cat /usr/local/htdocs/lg/.htaccess
+ DirectoryIndex lgform.cgi
+
+2) The looking glass scripts need to be able to find and read lg.conf. By
+ default it is installed as <SYSCONFDIR>/lg.conf (<PREFIX>/etc/lg.conf)
+ and the scripts will first look in their CWD (Current Working Directory)
+ and then <SYSCONFDIR>/lg.conf, if it does not exist in the CWD. However,
+ the LG_CONF environment variable can be used to move it elsewhere.
+
+ To get LG_CONF into the CGI enviroment, you can use SetEnvIf in apache's
+ httpd.conf. For example:
+ SetEnvIf Request_URI "\/lg/.*.cgi" LG_CONF=/usr/local/htdocs/lg/lg.conf
+
+3) Edit <SYSCONFIGDIR>/lg.conf (usually <PREFIX>/etc/lg.conf). See lg.conf(5)
+ for additional information.
+
+4) Set-up cron jobs to rotate the log file and clean out old cache files.
+ See LG_CACHE_DIR & LG_LOG in lg.conf. Something like (YMMV):
+
+ # rotate lookingglass log
+ #0 0 * * * cd /usr/local/htdocs/lg/tmp; /usr/local/etc/savelog -m 666 -c14 lg.log
+ 0 0 * * * cd /usr/local/htdocs/lg/tmp; /bin/mv lg.log lg.log.0
+ # clean out the lookingglass cache
+ 0 0 * * * cd /usr/local/htdocs/lg/tmp; /usr/local/bin/find . -type f -maxdepth 1 \( \! -name lg.log\* \) -mtime +1 -exec rm -f {} \;
diff --git a/Todo b/Todo
index 87b2520..97ded87 100644
--- a/Todo
+++ b/Todo
@@ -1,19 +1,34 @@
+- could the cloginrc match function do a longest-match search instead of
+ first match?
+- look at Andreas Dahl's Brocade switch collection scripts
+- noenable should handle a value properly. i.e.: 1 == noenable, 0 == enable or
+ perhaps don't clear the -noenable cmd-line option. the manpage needs to be
+ fixed as well. see msg from fred jordan.
+- recent hp procurve s/w does not seem have show flash or show module
+- would like to have a "pre-login-sequence" cloginrc directive, see
+ rancid-disuss message from mike ethridge 16/may
+- would like to have a "timeout" cloginrc directive
+- would like to have a ssh "passphrase" cloginrc directive
+- would like to have a "login_option" cloginrc directive to specify arbitrary
+ command-line options
+- possibly a "debug" (exp_internal 1 ?) cloginrc directive? *login -d flag
+ for same? warning about filling logs?
+- on 6500, show boot and show bootvar produce the same output and both appear
+ in the crunched config. should one be filtered?
- fix varargs for knf in util.c
- isis filtering for foundry?
-- extreme v6.2.x need 'show configuration detail' to get full config but
- does not work on older vers
-- hlogin (hp procurve) needs to adjust it's PATH to find hpfilter
-- hlogin hangs when the procurve is does not ask for passwords
-- util/ tool to prune cvs versions, excluding those with tags, by (all but
+- hlogin hangs when the procurve does not ask for passwords
+- hlogin does not work with ssh, needs to alloc a pty?
+- share/ tool to prune cvs versions, excluding those with tags, by (all but
latest | keep N versions | keep N days/months/years)
-- extreme collections lose when the config on the switch is in an unsaved
- state, probably due to the prompt changing or rather how clogin formulates
- the prompt used by expect{ -re }'s.
- extreme collection fails for tacacs-enabled boxen due to diffs in UI - blech!
+- xrancid should collect both of these:
+ show configuration
+ show configuration detail
- FILTER_PWDS knob is not implemented in alteon, bay, ezt3 or redback due to
lack of h/w to test against. need help from the community.
- should par's -c override an input files' : cmd?
-- *login should emmit "clogin error:" or "*login error:" to make matches for
+- should *login emmit "clogin error:" or "*login error:" to make matches for
login failures definitive?
- would like hpfilter to be more friendly to interactive logins
- rancid with zebra? via vtysh?
@@ -34,6 +49,45 @@
- rancid needs to treat the 3600s like the 7Ks and 12Ks...
Also, need to allow 12012s, and force 700s to not be treated like 7Ks.
- clogin/jlogin rsh is munged
-- LG {requested} additions
+- LG should sort routers
+- LG {requested} command additions
- show controllers T3 (data)
- handle redback in the looking glass
+ - show ip as-path-access-list
+ - show access-list
+ - show ip community-list
+ - show ip route-map
+- prancid - lots of GC'ing to be done
+- prancid - sort logging file by filename. e.g.:
+ logging file messages facility kernel level debugging
+ logging file log facility any level debugging
+ logging file log archive files 10 size 10m
+ logging file messages archive files 10 size 10m
+ then, sort by facility, e.g.:
+ logging file messages facility kernel level debugging
+ logging file messages facility authorization level debugging
+- should we add CVS ID header to saved configs? configurable option? - idea
+ from andrew fort
+- cat 2900 extra info
+ <hostname> uptime is 3 weeks, 3 days, 14 hours, 17 minutes
+ System returned to ROM by power-on
+ System restarted at 15:21:54 UTC Mon Sep 30 2002
+ System image file is "flash:c2950-i6q4l2-mz.121-9.EA1d.bin"
+
+ cisco WS-C2950-24 (RC32300) processor (revision B0) with 20821K bytes of memory.
+ Processor board ID FHK0619X2RN
+ Last reset from system-reset
+ Running Standard Image
+ 24 FastEthernet/IEEE 802.3 interface(s)
+
+ 32K bytes of flash-simulated non-volatile configuration memory.
+ Base ethernet MAC Address: 00:09:B7:50:DE:C0
+ Motherboard assembly number: 73-5781-10
+ Power supply part number: 34-0965-01
+ Motherboard serial number: FOC061903JF
+ Power supply serial number: DAB061735H4
+ Model revision number: B0
+ Motherboard revision number: A0
+ Model number: WS-C2950-24
+ System serial number: FHK0619X2RN
+ Configuration register is 0xF
diff --git a/UPGRADING b/UPGRADING
new file mode 100644
index 0000000..3724331
--- /dev/null
+++ b/UPGRADING
@@ -0,0 +1,85 @@
+Rancid 2.3 introduces a new directory layout. It has been changed to more
+closely follow the standard path hierarchy, which is defined by the FHS
+standard and autoconf, and/or make these locations more easily configurable
+within rancid.
+
+The obvious advantage of this is making rancid more easily packagable; i.e.:
+NetBSD pkgsrc, FreeBSD port, Linux RPM, etc.
+
+Make sure your rancid repository is quiet before upgrading; disable rancid
+cron jobs, wait for running jobs to complete, etc.
+
+Autoconf defines the following (see configure --help):
+ Installation directories:
+ --prefix=PREFIX install architecture-independent files in PREFIX
+ [/usr/local/rancid]
+ --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
+ [PREFIX]
+
+ Fine tuning of the installation directories:
+ --bindir=DIR user executables [EPREFIX/bin]
+ --sbindir=DIR system admin executables [EPREFIX/sbin]
+ --libexecdir=DIR program executables [EPREFIX/libexec]
+ --datadir=DIR read-only architecture-independent data [PREFIX/share]
+ --sysconfdir=DIR read-only single-machine data [PREFIX/etc]
+ --localstatedir=DIR modifiable single-machine data [PREFIX/var]
+ --mandir=DIR man documentation [PREFIX/man]
+
+ Also defined, though not mentioned above, is:
+ pkgdatadir same as datadir, but datadir/rancid
+
+File and directory movement:
+ bin/env the rancid configuration file has moved to
+ sysconfdir/rancid.conf
+ util/lg/lg.conf the looking glass configuration has moved to
+ sysconfdir/lg.conf
+ util/lg/lg.cgi
+ util/lg/lgform.cgi the looking glass CGI scripts have moved to bindir
+ util/lg/* the remainder of looking glass html, README, etc
+ files have moved to pkgdatadir
+ util/* misc examples, scripts, etc have moved to pkgdatadir
+ cloginrc.sample moved to pkgdatadir
+
+For those upgrading, there is one basic choice to make; to move your CVS
+repository and logs or not. Prior to rancid 2.3, these were placed in
+<PREFIX>. They are now in "localstatedir". The user who runs rancid will
+need write access to this directory.
+
+To maintain the same location as was used prior to rancid 2.3, provide
+the --localstatedir option to configure. e.g.:
+
+ ./configure --localstatedir=/usr/local/rancid
+
+/usr/local/rancid is, and has been, the default <PREFIX>.
+
+To move them elsewhere, accept the default (e.g.: /usr/local/rancid/var) or
+specify your own and move the existing directories. e.g.:
+
+ ./configure --localstatedir=/var/rancid
+ make install
+ edit <SYSCONFDIR>/rancid.conf # merge with your old bin/env
+ # configuration file
+ mv /usr/local/rancid/logs /var/rancid
+ mv /usr/local/rancid/CVS /var/rancid
+ cd /var/rancid
+ su - rancid_user
+ /bin/sh
+ . <SYSCONFDIR>/rancid.conf
+ for grp in $LIST_OF_GROUPS; do
+ cvs -d /var/rancid/CVS co $grp
+ done
+
+Note that the first rancid-run will send messages about routers being added,
+marked up or down, etc., because the routers.{all,down,up} will have been
+lost. Afterward, it will be back to normal.
+
+Note also that any non-rancid files that may have been placed in these CVS
+trees will be lost. You have been warned.
+
+*** We strongly suggest that if a DIR used as the install prefix, as in
+ --prefix=DIR, is not dedicated to rancid that "/rancid" should be
+ appended to the --localstatedir, as in the example above.
+
+Note that not all operating systems have a mv command that will move
+directories across file systems. It may be necessary to use 'cp -r' or
+'tar cf - <GROUPS> | (cd <SYSCONFDIR>; tar xpf -)'.
diff --git a/acconfig.h b/acconfig.h
new file mode 100644
index 0000000..87d5f53
--- /dev/null
+++ b/acconfig.h
@@ -0,0 +1,78 @@
+#ifndef CONFIG_H
+#define CONFIG_H 1
+
+@TOP@
+
+@BOTTOM@
+
+#ifndef __P
+# if STDC_HEADERS
+# define __P(a) a
+# else
+# define __P(a) ()
+# endif
+#endif
+
+#define BUF_SZ LINE_MAX /* (increments of) size of bufs */
+
+#if HAVE_STDLIB_H
+# include <stdlib.h>
+#endif
+
+#if HAVE_UNISTD_H
+# include <unistd.h>
+# include <sys/types.h>
+#elif HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
+
+#if HAVE_ERRNO_H
+# include <errno.h>
+#endif
+extern int errno;
+
+#if HAVE_STRING_H
+# include <string.h>
+#endif
+#if HAVE_STRINGS_H
+# include <strings.h>
+#endif
+
+#if ! HAVE_STRERROR
+# define strerror(n) sys_errlist[n];
+#endif
+
+#if HAVE_SYS_WAIT_H
+# include <sys/wait.h>
+#endif
+#ifndef WEXITSTATUS
+# define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
+#endif
+#ifndef WIFEXITED
+# define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
+#endif
+
+#if HAVE_MEMSET
+# define bzero(p,s) memset(p, 0, s)
+# define bcopy(s,d,l) memcpy(d, s, l)
+#endif
+
+#if HAVE_INDEX && ! HAVE_STRCHR
+# define index(s,c) strchr(s,c)
+#endif
+
+#if HAVE_SYSEXITS_H
+# include <sysexits.h>
+#else
+ /* missing sysexits.h */
+# define EX_OK 0
+# define EX_USAGE 64 /* command line usage error */
+# define EX_NOINPUT 66 /* cannot open input */
+# define EX_TEMPFAIL 75 /* temp failure */
+# define EX_OSERR 71 /* system error */
+# define EX_CANTCREAT 73 /* can't create (user) output file */
+# define EX_IOERR 74 /* input/output error */
+# define EX_CONFIG 78 /* configuration error */
+#endif
+
+#endif /* CONFIG_H */
diff --git a/aclocal.m4 b/aclocal.m4
index c6f5608..42590ae 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -1,72 +1,857 @@
-dnl aclocal.m4 generated automatically by aclocal 1.4-p5
+# generated automatically by aclocal 1.8 -*- Autoconf -*-
-dnl Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc.
-dnl This file is free software; the Free Software Foundation
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
+# Free Software Foundation, Inc.
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
-dnl This program is distributed in the hope that it will be useful,
-dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-dnl PARTICULAR PURPOSE.
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
-AUTOMAKE_OPTIONS=no-dependencies foreign
+# -*- Autoconf -*-
+# Copyright (C) 2002, 2003 Free Software Foundation, Inc.
+# Generated from amversion.in; do not edit by hand.
-# Do all the work for Automake. This macro actually does too much --
-# some checks are only needed if your package does certain things.
-# But this isn't really a big deal.
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
-# serial 1
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+
+# AM_AUTOMAKE_VERSION(VERSION)
+# ----------------------------
+# Automake X.Y traces this macro to ensure aclocal.m4 has been
+# generated from the m4 files accompanying Automake X.Y.
+AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version="1.8"])
+
+# AM_SET_CURRENT_AUTOMAKE_VERSION
+# -------------------------------
+# Call AM_AUTOMAKE_VERSION so it can be traced.
+# This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
+AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
+ [AM_AUTOMAKE_VERSION([1.8])])
+
+# AM_AUX_DIR_EXPAND
+
+# Copyright (C) 2001, 2003 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+# 02111-1307, USA.
+
+# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
+# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to
+# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
+#
+# Of course, Automake must honor this variable whenever it calls a
+# tool from the auxiliary directory. The problem is that $srcdir (and
+# therefore $ac_aux_dir as well) can be either absolute or relative,
+# depending on how configure is run. This is pretty annoying, since
+# it makes $ac_aux_dir quite unusable in subdirectories: in the top
+# source directory, any form will work fine, but in subdirectories a
+# relative path needs to be adjusted first.
+#
+# $ac_aux_dir/missing
+# fails when called from a subdirectory if $ac_aux_dir is relative
+# $top_srcdir/$ac_aux_dir/missing
+# fails if $ac_aux_dir is absolute,
+# fails when called from a subdirectory in a VPATH build with
+# a relative $ac_aux_dir
+#
+# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
+# are both prefixed by $srcdir. In an in-source build this is usually
+# harmless because $srcdir is `.', but things will broke when you
+# start a VPATH build or use an absolute $srcdir.
+#
+# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
+# iff we strip the leading $srcdir from $ac_aux_dir. That would be:
+# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
+# and then we would define $MISSING as
+# MISSING="\${SHELL} $am_aux_dir/missing"
+# This will work as long as MISSING is not called from configure, because
+# unfortunately $(top_srcdir) has no meaning in configure.
+# However there are other variables, like CC, which are often used in
+# configure, and could therefore not use this "fixed" $ac_aux_dir.
+#
+# Another solution, used here, is to always expand $ac_aux_dir to an
+# absolute PATH. The drawback is that using absolute paths prevent a
+# configured tree to be moved without reconfiguration.
+
+AC_DEFUN([AM_AUX_DIR_EXPAND],
+[dnl Rely on autoconf to set up CDPATH properly.
+AC_PREREQ([2.50])dnl
+# expand $ac_aux_dir to an absolute path
+am_aux_dir=`cd $ac_aux_dir && pwd`
+])
+
+# AM_CONDITIONAL -*- Autoconf -*-
+
+# Copyright (C) 1997, 2000, 2001, 2003 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+# 02111-1307, USA.
+
+# serial 6
+
+# AM_CONDITIONAL(NAME, SHELL-CONDITION)
+# -------------------------------------
+# Define a conditional.
+AC_DEFUN([AM_CONDITIONAL],
+[AC_PREREQ(2.52)dnl
+ ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])],
+ [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
+AC_SUBST([$1_TRUE])
+AC_SUBST([$1_FALSE])
+if $2; then
+ $1_TRUE=
+ $1_FALSE='#'
+else
+ $1_TRUE='#'
+ $1_FALSE=
+fi
+AC_CONFIG_COMMANDS_PRE(
+[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
+ AC_MSG_ERROR([conditional "$1" was never defined.
+Usually this means the macro was only invoked conditionally.])
+fi])])
+
+# serial 5 -*- Autoconf -*-
+
+# Copyright (C) 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+# 02111-1307, USA.
+
+
+# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
+# written in clear, in which case automake, when reading aclocal.m4,
+# will think it sees a *use*, and therefore will trigger all it's
+# C support machinery. Also note that it means that autoscan, seeing
+# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
+
+
+
+# _AM_DEPENDENCIES(NAME)
+# ----------------------
+# See how the compiler implements dependency checking.
+# NAME is "CC", "CXX", "GCJ", or "OBJC".
+# We try a few techniques and use that to set a single cache variable.
+#
+# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
+# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
+# dependency, and given that the user is not expected to run this macro,
+# just rely on AC_PROG_CC.
+AC_DEFUN([_AM_DEPENDENCIES],
+[AC_REQUIRE([AM_SET_DEPDIR])dnl
+AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
+AC_REQUIRE([AM_MAKE_INCLUDE])dnl
+AC_REQUIRE([AM_DEP_TRACK])dnl
+
+ifelse([$1], CC, [depcc="$CC" am_compiler_list=],
+ [$1], CXX, [depcc="$CXX" am_compiler_list=],
+ [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
+ [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'],
+ [depcc="$$1" am_compiler_list=])
+
+AC_CACHE_CHECK([dependency style of $depcc],
+ [am_cv_$1_dependencies_compiler_type],
+[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+ # We make a subdir and do the tests there. Otherwise we can end up
+ # making bogus files that we don't know about and never remove. For
+ # instance it was reported that on HP-UX the gcc test will end up
+ # making a dummy file named `D' -- because `-MD' means `put the output
+ # in D'.
+ mkdir conftest.dir
+ # Copy depcomp to subdir because otherwise we won't find it if we're
+ # using a relative directory.
+ cp "$am_depcomp" conftest.dir
+ cd conftest.dir
+ # We will build objects and dependencies in a subdirectory because
+ # it helps to detect inapplicable dependency modes. For instance
+ # both Tru64's cc and ICC support -MD to output dependencies as a
+ # side effect of compilation, but ICC will put the dependencies in
+ # the current directory while Tru64 will put them in the object
+ # directory.
+ mkdir sub
+
+ am_cv_$1_dependencies_compiler_type=none
+ if test "$am_compiler_list" = ""; then
+ am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
+ fi
+ for depmode in $am_compiler_list; do
+ # Setup a source with many dependencies, because some compilers
+ # like to wrap large dependency lists on column 80 (with \), and
+ # we should not choose a depcomp mode which is confused by this.
+ #
+ # We need to recreate these files for each test, as the compiler may
+ # overwrite some of them when testing with obscure command lines.
+ # This happens at least with the AIX C compiler.
+ : > sub/conftest.c
+ for i in 1 2 3 4 5 6; do
+ echo '#include "conftst'$i'.h"' >> sub/conftest.c
+ : > sub/conftst$i.h
+ done
+ echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+
+ case $depmode in
+ nosideeffect)
+ # after this tag, mechanisms are not by side-effect, so they'll
+ # only be used when explicitly requested
+ if test "x$enable_dependency_tracking" = xyes; then
+ continue
+ else
+ break
+ fi
+ ;;
+ none) break ;;
+ esac
+ # We check with `-c' and `-o' for the sake of the "dashmstdout"
+ # mode. It turns out that the SunPro C++ compiler does not properly
+ # handle `-M -o', and we need to detect this.
+ if depmode=$depmode \
+ source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
+ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+ $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
+ >/dev/null 2>conftest.err &&
+ grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+ grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
+ ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+ # icc doesn't choke on unknown options, it will just issue warnings
+ # (even with -Werror). So we grep stderr for any message
+ # that says an option was ignored.
+ if grep 'ignoring option' conftest.err >/dev/null 2>&1; then :; else
+ am_cv_$1_dependencies_compiler_type=$depmode
+ break
+ fi
+ fi
+ done
+
+ cd ..
+ rm -rf conftest.dir
+else
+ am_cv_$1_dependencies_compiler_type=none
+fi
+])
+AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
+AM_CONDITIONAL([am__fastdep$1], [
+ test "x$enable_dependency_tracking" != xno \
+ && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
+])
+
+
+# AM_SET_DEPDIR
+# -------------
+# Choose a directory name for dependency files.
+# This macro is AC_REQUIREd in _AM_DEPENDENCIES
+AC_DEFUN([AM_SET_DEPDIR],
+[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
+AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
+])
+
+
+# AM_DEP_TRACK
+# ------------
+AC_DEFUN([AM_DEP_TRACK],
+[AC_ARG_ENABLE(dependency-tracking,
+[ --disable-dependency-tracking Speeds up one-time builds
+ --enable-dependency-tracking Do not reject slow dependency extractors])
+if test "x$enable_dependency_tracking" != xno; then
+ am_depcomp="$ac_aux_dir/depcomp"
+ AMDEPBACKSLASH='\'
+fi
+AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
+AC_SUBST([AMDEPBACKSLASH])
+])
+
+# Generate code to set up dependency tracking. -*- Autoconf -*-
+
+# Copyright (C) 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+# 02111-1307, USA.
+
+#serial 2
+
+# _AM_OUTPUT_DEPENDENCY_COMMANDS
+# ------------------------------
+AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
+[for mf in $CONFIG_FILES; do
+ # Strip MF so we end up with the name of the file.
+ mf=`echo "$mf" | sed -e 's/:.*$//'`
+ # Check whether this is an Automake generated Makefile or not.
+ # We used to match only the files named `Makefile.in', but
+ # some people rename them; so instead we look at the file content.
+ # Grep'ing the first line is not enough: some people post-process
+ # each Makefile.in and add a new line on top of each file to say so.
+ # So let's grep whole file.
+ if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then
+ dirpart=`AS_DIRNAME("$mf")`
+ else
+ continue
+ fi
+ grep '^DEP_FILES *= *[[^ @%:@]]' < "$mf" > /dev/null || continue
+ # Extract the definition of DEP_FILES from the Makefile without
+ # running `make'.
+ DEPDIR=`sed -n -e '/^DEPDIR = / s///p' < "$mf"`
+ test -z "$DEPDIR" && continue
+ # When using ansi2knr, U may be empty or an underscore; expand it
+ U=`sed -n -e '/^U = / s///p' < "$mf"`
+ test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR"
+ # We invoke sed twice because it is the simplest approach to
+ # changing $(DEPDIR) to its actual value in the expansion.
+ for file in `sed -n -e '
+ /^DEP_FILES = .*\\\\$/ {
+ s/^DEP_FILES = //
+ :loop
+ s/\\\\$//
+ p
+ n
+ /\\\\$/ b loop
+ p
+ }
+ /^DEP_FILES = / s/^DEP_FILES = //p' < "$mf" | \
+ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
+ # Make sure the directory exists.
+ test -f "$dirpart/$file" && continue
+ fdir=`AS_DIRNAME(["$file"])`
+ AS_MKDIR_P([$dirpart/$fdir])
+ # echo "creating $dirpart/$file"
+ echo '# dummy' > "$dirpart/$file"
+ done
+done
+])# _AM_OUTPUT_DEPENDENCY_COMMANDS
+
+
+# AM_OUTPUT_DEPENDENCY_COMMANDS
+# -----------------------------
+# This macro should only be invoked once -- use via AC_REQUIRE.
+#
+# This code is only required when automatic dependency tracking
+# is enabled. FIXME. This creates each `.P' file that we will
+# need in order to bootstrap the dependency handling code.
+AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
+[AC_CONFIG_COMMANDS([depfiles],
+ [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
+ [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
+])
+
+# Do all the work for Automake. -*- Autoconf -*-
+
+# This macro actually does too much some checks are only needed if
+# your package does certain things. But this isn't really a big deal.
+
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
+# Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+# 02111-1307, USA.
-dnl Usage:
-dnl AM_INIT_AUTOMAKE(package,version, [no-define])
+# serial 11
+# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
+# AM_INIT_AUTOMAKE([OPTIONS])
+# -----------------------------------------------
+# The call with PACKAGE and VERSION arguments is the old style
+# call (pre autoconf-2.50), which is being phased out. PACKAGE
+# and VERSION should now be passed to AC_INIT and removed from
+# the call to AM_INIT_AUTOMAKE.
+# We support both call styles for the transition. After
+# the next Automake release, Autoconf can make the AC_INIT
+# arguments mandatory, and then we can depend on a new Autoconf
+# release and drop the old call support.
AC_DEFUN([AM_INIT_AUTOMAKE],
-[AC_REQUIRE([AC_PROG_INSTALL])
-PACKAGE=[$1]
-AC_SUBST(PACKAGE)
-VERSION=[$2]
-AC_SUBST(VERSION)
-dnl test to see if srcdir already configured
-if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
+[AC_PREREQ([2.58])dnl
+dnl Autoconf wants to disallow AM_ names. We explicitly allow
+dnl the ones we care about.
+m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
+AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
+AC_REQUIRE([AC_PROG_INSTALL])dnl
+# test to see if srcdir already configured
+if test "`cd $srcdir && pwd`" != "`pwd`" &&
+ test -f $srcdir/config.status; then
AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
fi
-ifelse([$3],,
-AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
-AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package]))
-AC_REQUIRE([AM_SANITY_CHECK])
-AC_REQUIRE([AC_ARG_PROGRAM])
-dnl FIXME This is truly gross.
-missing_dir=`cd $ac_aux_dir && pwd`
-AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
-AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
-AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
-AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
-AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
-AC_REQUIRE([AC_PROG_MAKE_SET])])
+
+# test whether we have cygpath
+if test -z "$CYGPATH_W"; then
+ if (cygpath --version) >/dev/null 2>/dev/null; then
+ CYGPATH_W='cygpath -w'
+ else
+ CYGPATH_W=echo
+ fi
+fi
+AC_SUBST([CYGPATH_W])
+
+# Define the identity of the package.
+dnl Distinguish between old-style and new-style calls.
+m4_ifval([$2],
+[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
+ AC_SUBST([PACKAGE], [$1])dnl
+ AC_SUBST([VERSION], [$2])],
+[_AM_SET_OPTIONS([$1])dnl
+ AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
+ AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
+
+_AM_IF_OPTION([no-define],,
+[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
+ AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
+
+# Some tools Automake needs.
+AC_REQUIRE([AM_SANITY_CHECK])dnl
+AC_REQUIRE([AC_ARG_PROGRAM])dnl
+AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
+AM_MISSING_PROG(AUTOCONF, autoconf)
+AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
+AM_MISSING_PROG(AUTOHEADER, autoheader)
+AM_MISSING_PROG(MAKEINFO, makeinfo)
+AM_MISSING_PROG(AMTAR, tar)
+AM_PROG_INSTALL_SH
+AM_PROG_INSTALL_STRIP
+AC_REQUIRE([AM_PROG_MKDIR_P])dnl
+# We need awk for the "check" target. The system "awk" is bad on
+# some platforms.
+AC_REQUIRE([AC_PROG_AWK])dnl
+AC_REQUIRE([AC_PROG_MAKE_SET])dnl
+AC_REQUIRE([AM_SET_LEADING_DOT])dnl
+
+_AM_IF_OPTION([no-dependencies],,
+[AC_PROVIDE_IFELSE([AC_PROG_CC],
+ [_AM_DEPENDENCIES(CC)],
+ [define([AC_PROG_CC],
+ defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
+AC_PROVIDE_IFELSE([AC_PROG_CXX],
+ [_AM_DEPENDENCIES(CXX)],
+ [define([AC_PROG_CXX],
+ defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
+])
+])
+
+
+# When config.status generates a header, we must update the stamp-h file.
+# This file resides in the same directory as the config header
+# that is generated. The stamp files are numbered to have different names.
+
+# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
+# loop where config.status creates the headers, so we can generate
+# our stamp files there.
+AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
+[# Compute $1's index in $config_headers.
+_am_stamp_count=1
+for _am_header in $config_headers :; do
+ case $_am_header in
+ $1 | $1:* )
+ break ;;
+ * )
+ _am_stamp_count=`expr $_am_stamp_count + 1` ;;
+ esac
+done
+echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count])
+
+# AM_PROG_INSTALL_SH
+# ------------------
+# Define $install_sh.
+
+# Copyright (C) 2001, 2003 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+# 02111-1307, USA.
+
+AC_DEFUN([AM_PROG_INSTALL_SH],
+[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+install_sh=${install_sh-"$am_aux_dir/install-sh"}
+AC_SUBST(install_sh)])
+
+# -*- Autoconf -*-
+# Copyright (C) 2003 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+# 02111-1307, USA.
+
+# serial 1
+
+# Check whether the underlying file-system supports filenames
+# with a leading dot. For instance MS-DOS doesn't.
+AC_DEFUN([AM_SET_LEADING_DOT],
+[rm -rf .tst 2>/dev/null
+mkdir .tst 2>/dev/null
+if test -d .tst; then
+ am__leading_dot=.
+else
+ am__leading_dot=_
+fi
+rmdir .tst 2>/dev/null
+AC_SUBST([am__leading_dot])])
+
+# Check to see how 'make' treats includes. -*- Autoconf -*-
+
+# Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+# 02111-1307, USA.
+
+# serial 2
+
+# AM_MAKE_INCLUDE()
+# -----------------
+# Check to see how make treats includes.
+AC_DEFUN([AM_MAKE_INCLUDE],
+[am_make=${MAKE-make}
+cat > confinc << 'END'
+am__doit:
+ @echo done
+.PHONY: am__doit
+END
+# If we don't find an include directive, just comment out the code.
+AC_MSG_CHECKING([for style of include used by $am_make])
+am__include="#"
+am__quote=
+_am_result=none
+# First try GNU make style include.
+echo "include confinc" > confmf
+# We grep out `Entering directory' and `Leaving directory'
+# messages which can occur if `w' ends up in MAKEFLAGS.
+# In particular we don't look at `^make:' because GNU make might
+# be invoked under some other name (usually "gmake"), in which
+# case it prints its new name instead of `make'.
+if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
+ am__include=include
+ am__quote=
+ _am_result=GNU
+fi
+# Now try BSD make style include.
+if test "$am__include" = "#"; then
+ echo '.include "confinc"' > confmf
+ if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
+ am__include=.include
+ am__quote="\""
+ _am_result=BSD
+ fi
+fi
+AC_SUBST([am__include])
+AC_SUBST([am__quote])
+AC_MSG_RESULT([$_am_result])
+rm -f confinc confmf
+])
+
+# -*- Autoconf -*-
+
+
+# Copyright (C) 1997, 1999, 2000, 2001, 2003 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+# 02111-1307, USA.
+
+# serial 3
+
+# AM_MISSING_PROG(NAME, PROGRAM)
+# ------------------------------
+AC_DEFUN([AM_MISSING_PROG],
+[AC_REQUIRE([AM_MISSING_HAS_RUN])
+$1=${$1-"${am_missing_run}$2"}
+AC_SUBST($1)])
+
+
+# AM_MISSING_HAS_RUN
+# ------------------
+# Define MISSING if not defined so far and test if it supports --run.
+# If it does, set am_missing_run to use it, otherwise, to nothing.
+AC_DEFUN([AM_MISSING_HAS_RUN],
+[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
+# Use eval to expand $SHELL
+if eval "$MISSING --run true"; then
+ am_missing_run="$MISSING --run "
+else
+ am_missing_run=
+ AC_MSG_WARN([`missing' script is too old or missing])
+fi
+])
+
+# AM_PROG_MKDIR_P
+# ---------------
+# Check whether `mkdir -p' is supported, fallback to mkinstalldirs otherwise.
+
+# Copyright (C) 2003 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+# 02111-1307, USA.
+
+AC_DEFUN([AM_PROG_MKDIR_P],
+[if mkdir -m 0755 -p -- . 2>/dev/null; then
+ mkdir_p='mkdir -m 0755 -p --'
+else
+ # On NextStep and OpenStep, the `mkdir' command does not
+ # recognize any option. It will interpret all options as
+ # directories to create, and then abort because `.' already
+ # exists.
+ for d in ./-m ./0755 ./-p ./--;
+ do
+ test -d $d && rmdir $d
+ done
+ # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists.
+ if test -f "$ac_aux_dir/mkinstalldirs"; then
+ mkdir_p='$(mkinstalldirs) -m 0755'
+ else
+ mkdir_p='$(install_sh) -m 0755 -d'
+ fi
+fi
+AC_SUBST([mkdir_p])])
+
+# Helper functions for option handling. -*- Autoconf -*-
+
+# Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+# 02111-1307, USA.
+
+# serial 2
+
+# _AM_MANGLE_OPTION(NAME)
+# -----------------------
+AC_DEFUN([_AM_MANGLE_OPTION],
+[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
+
+# _AM_SET_OPTION(NAME)
+# ------------------------------
+# Set option NAME. Presently that only means defining a flag for this option.
+AC_DEFUN([_AM_SET_OPTION],
+[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
+
+# _AM_SET_OPTIONS(OPTIONS)
+# ----------------------------------
+# OPTIONS is a space-separated list of Automake options.
+AC_DEFUN([_AM_SET_OPTIONS],
+[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
+
+# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
+# -------------------------------------------
+# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
+AC_DEFUN([_AM_IF_OPTION],
+[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
+
+
+# Copyright (C) 1996, 1997, 1998, 2000, 2001, 2002, 2003
+# Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+# 02111-1307, USA.
+
+# serial 3
+
+AC_DEFUN([AM_C_PROTOTYPES],
+[AC_REQUIRE([AC_C_PROTOTYPES])
+if test "$ac_cv_prog_cc_stdc" != no; then
+ U= ANSI2KNR=
+else
+ U=_ ANSI2KNR=./ansi2knr
+fi
+# Ensure some checks needed by ansi2knr itself.
+AC_REQUIRE([AC_HEADER_STDC])
+AC_CHECK_HEADERS(string.h)
+AC_SUBST(U)dnl
+AC_SUBST(ANSI2KNR)dnl
+])
+
+AU_DEFUN([fp_C_PROTOTYPES], [AM_C_PROTOTYPES])
#
# Check to make sure that the build environment is sane.
#
+# Copyright (C) 1996, 1997, 2000, 2001, 2003 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+# 02111-1307, USA.
+
+# serial 3
+
+# AM_SANITY_CHECK
+# ---------------
AC_DEFUN([AM_SANITY_CHECK],
[AC_MSG_CHECKING([whether build environment is sane])
# Just in case
sleep 1
-echo timestamp > conftestfile
+echo timestamp > conftest.file
# Do `set' in a subshell so we don't clobber the current shell's
# arguments. Must try -L first in case configure is actually a
# symlink; some systems play weird games with the mod time of symlinks
# (eg FreeBSD returns the mod time of the symlink's containing
# directory).
if (
- set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
- if test "[$]*" = "X"; then
+ set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
+ if test "$[*]" = "X"; then
# -L didn't work.
- set X `ls -t $srcdir/configure conftestfile`
+ set X `ls -t $srcdir/configure conftest.file`
fi
- if test "[$]*" != "X $srcdir/configure conftestfile" \
- && test "[$]*" != "X conftestfile $srcdir/configure"; then
+ rm -f conftest.file
+ if test "$[*]" != "X $srcdir/configure conftest.file" \
+ && test "$[*]" != "X conftest.file $srcdir/configure"; then
# If neither matched, then we have a broken ls. This can happen
# if, for instance, CONFIG_SHELL is bash and it inherits a
@@ -76,7 +861,7 @@ if (
alias in your environment])
fi
- test "[$]2" = conftestfile
+ test "$[2]" = conftest.file
)
then
# Ok.
@@ -85,188 +870,45 @@ else
AC_MSG_ERROR([newly created file is older than distributed files!
Check your system clock])
fi
-rm -f conftest*
AC_MSG_RESULT(yes)])
-dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
-dnl The program must properly implement --version.
-AC_DEFUN([AM_MISSING_PROG],
-[AC_MSG_CHECKING(for working $2)
-# Run test in a subshell; some versions of sh will print an error if
-# an executable is not found, even if stderr is redirected.
-# Redirect stdin to placate older versions of autoconf. Sigh.
-if ($2 --version) < /dev/null > /dev/null 2>&1; then
- $1=$2
- AC_MSG_RESULT(found)
-else
- $1="$3/missing $2"
- AC_MSG_RESULT(missing)
-fi
-AC_SUBST($1)])
+# AM_PROG_INSTALL_STRIP
-# Like AC_CONFIG_HEADER, but automatically create stamp file.
-
-AC_DEFUN([AM_CONFIG_HEADER],
-[AC_PREREQ([2.12])
-AC_CONFIG_HEADER([$1])
-dnl When config.status generates a header, we must update the stamp-h file.
-dnl This file resides in the same directory as the config header
-dnl that is generated. We must strip everything past the first ":",
-dnl and everything past the last "/".
-AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl
-ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>,
-<<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>,
-<<am_indx=1
-for am_file in <<$1>>; do
- case " <<$>>CONFIG_HEADERS " in
- *" <<$>>am_file "*<<)>>
- echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx
- ;;
- esac
- am_indx=`expr "<<$>>am_indx" + 1`
-done<<>>dnl>>)
-changequote([,]))])
+# Copyright (C) 2001, 2003 Free Software Foundation, Inc.
-# Add --enable-maintainer-mode option to configure.
-# From Jim Meyering
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
-# serial 1
-
-AC_DEFUN([AM_MAINTAINER_MODE],
-[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
- dnl maintainer-mode is disabled by default
- AC_ARG_ENABLE(maintainer-mode,
-[ --enable-maintainer-mode enable make rules and dependencies not useful
- (and sometimes confusing) to the casual installer],
- USE_MAINTAINER_MODE=$enableval,
- USE_MAINTAINER_MODE=no)
- AC_MSG_RESULT($USE_MAINTAINER_MODE)
- AM_CONDITIONAL(MAINTAINER_MODE, test $USE_MAINTAINER_MODE = yes)
- MAINT=$MAINTAINER_MODE_TRUE
- AC_SUBST(MAINT)dnl
-]
-)
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
-# Define a conditional.
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+# 02111-1307, USA.
-AC_DEFUN([AM_CONDITIONAL],
-[AC_SUBST($1_TRUE)
-AC_SUBST($1_FALSE)
-if $2; then
- $1_TRUE=
- $1_FALSE='#'
-else
- $1_TRUE='#'
- $1_FALSE=
-fi])
-
-
-# serial 1
-
-AC_DEFUN([AM_C_PROTOTYPES],
-[AC_REQUIRE([AM_PROG_CC_STDC])
-AC_REQUIRE([AC_PROG_CPP])
-AC_MSG_CHECKING([for function prototypes])
-if test "$am_cv_prog_cc_stdc" != no; then
- AC_MSG_RESULT(yes)
- AC_DEFINE(PROTOTYPES,1,[Define if compiler has function prototypes])
- U= ANSI2KNR=
-else
- AC_MSG_RESULT(no)
- U=_ ANSI2KNR=./ansi2knr
- # Ensure some checks needed by ansi2knr itself.
- AC_HEADER_STDC
- AC_CHECK_HEADERS(string.h)
+# One issue with vendor `install' (even GNU) is that you can't
+# specify the program used to strip binaries. This is especially
+# annoying in cross-compiling environments, where the build's strip
+# is unlikely to handle the host's binaries.
+# Fortunately install-sh will honor a STRIPPROG variable, so we
+# always use install-sh in `make install-strip', and initialize
+# STRIPPROG with the value of the STRIP variable (set by the user).
+AC_DEFUN([AM_PROG_INSTALL_STRIP],
+[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
+# Installed binaries are usually stripped using `strip' when the user
+# run `make install-strip'. However `strip' might not be the right
+# tool to use in cross-compilation environments, therefore Automake
+# will honor the `STRIP' environment variable to overrule this program.
+dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
+if test "$cross_compiling" != no; then
+ AC_CHECK_TOOL([STRIP], [strip], :)
fi
-AC_SUBST(U)dnl
-AC_SUBST(ANSI2KNR)dnl
-])
-
-
-# serial 1
-
-# @defmac AC_PROG_CC_STDC
-# @maindex PROG_CC_STDC
-# @ovindex CC
-# If the C compiler in not in ANSI C mode by default, try to add an option
-# to output variable @code{CC} to make it so. This macro tries various
-# options that select ANSI C on some system or another. It considers the
-# compiler to be in ANSI C mode if it handles function prototypes correctly.
-#
-# If you use this macro, you should check after calling it whether the C
-# compiler has been set to accept ANSI C; if not, the shell variable
-# @code{am_cv_prog_cc_stdc} is set to @samp{no}. If you wrote your source
-# code in ANSI C, you can make an un-ANSIfied copy of it by using the
-# program @code{ansi2knr}, which comes with Ghostscript.
-# @end defmac
-
-AC_DEFUN([AM_PROG_CC_STDC],
-[AC_REQUIRE([AC_PROG_CC])
-AC_BEFORE([$0], [AC_C_INLINE])
-AC_BEFORE([$0], [AC_C_CONST])
-dnl Force this before AC_PROG_CPP. Some cpp's, eg on HPUX, require
-dnl a magic option to avoid problems with ANSI preprocessor commands
-dnl like #elif.
-dnl FIXME: can't do this because then AC_AIX won't work due to a
-dnl circular dependency.
-dnl AC_BEFORE([$0], [AC_PROG_CPP])
-AC_MSG_CHECKING(for ${CC-cc} option to accept ANSI C)
-AC_CACHE_VAL(am_cv_prog_cc_stdc,
-[am_cv_prog_cc_stdc=no
-ac_save_CC="$CC"
-# Don't try gcc -ansi; that turns off useful extensions and
-# breaks some systems' header files.
-# AIX -qlanglvl=ansi
-# Ultrix and OSF/1 -std1
-# HP-UX -Aa -D_HPUX_SOURCE
-# SVR4 -Xc -D__EXTENSIONS__
-for ac_arg in "" -qlanglvl=ansi -std1 "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
-do
- CC="$ac_save_CC $ac_arg"
- AC_TRY_COMPILE(
-[#include <stdarg.h>
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
-struct buf { int x; };
-FILE * (*rcsopen) (struct buf *, struct stat *, int);
-static char *e (p, i)
- char **p;
- int i;
-{
- return p[i];
-}
-static char *f (char * (*g) (char **, int), char **p, ...)
-{
- char *s;
- va_list v;
- va_start (v,p);
- s = g (p, va_arg (v,int));
- va_end (v);
- return s;
-}
-int test (int i, double x);
-struct s1 {int (*f) (int a);};
-struct s2 {int (*f) (double a);};
-int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
-int argc;
-char **argv;
-], [
-return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
-],
-[am_cv_prog_cc_stdc="$ac_arg"; break])
-done
-CC="$ac_save_CC"
-])
-if test -z "$am_cv_prog_cc_stdc"; then
- AC_MSG_RESULT([none needed])
-else
- AC_MSG_RESULT($am_cv_prog_cc_stdc)
-fi
-case "x$am_cv_prog_cc_stdc" in
- x|xno) ;;
- *) CC="$CC $am_cv_prog_cc_stdc" ;;
-esac
-])
+INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
+AC_SUBST([INSTALL_STRIP_PROGRAM])])
+m4_include([acinclude.m4])
diff --git a/bin/Makefile.am b/bin/Makefile.am
index 67c8966..21fac52 100644
--- a/bin/Makefile.am
+++ b/bin/Makefile.am
@@ -1,26 +1,46 @@
## Process this file with automake to produce Makefile.in
## A Makefile.in is supplied, in case you do not have automake.
-## Copyright (C) 1997-2001 by Henry Kilmer, Erik Sherk and Pete Whiting.
+## $Id: Makefile.am,v 1.28 2004/01/11 07:15:23 hank Exp $
+##
+## Copyright (C) 1997-2004 by Terrapin Communications, Inc.
## All rights reserved.
##
-## This software may be freely copied, modified and redistributed without
-## fee for non-commerical purposes provided that this copyright notice is
-## preserved intact on all copies and modified copies.
+## This software may be freely copied, modified and redistributed
+## without fee for non-commerical purposes provided that this license
+## remains intact and unmodified with any RANCID distribution.
##
## There is no warranty or other guarantee of fitness of this software.
-## It is provided solely "as is". The author(s) disclaim(s) all
+## It is provided solely "as is". The author(s) disclaim(s) all
## responsibility and liability with respect to this software's usage
## or its effect upon hardware, computer systems, other software, or
## anything else.
+##
+## Except where noted otherwise, rancid was written by and is maintained by
+## Henry Kilmer, John Heasley, Andrew Partan, Pete Whiting, and Austin Schutz.
+##
#AUTOMAKE_OPTIONS=foreign no-dependencies
AUTOMAKE_OPTIONS=foreign
-PREFIX = @prefix@
+bin_PROGRAMS = hpuifilter
+bin_SCRIPTS = cat5rancid control_rancid \
+ alogin arancid clogin blogin brancid cssrancid \
+ elogin erancid f10rancid flogin francid fnrancid \
+ jlogin jrancid jerancid \
+ hlogin hrancid htlogin htrancid \
+ mrancid nlogin nrancid nslogin nsrancid par prancid \
+ rancid rancid-fe rivlogin rivrancid rrancid \
+ tntlogin tntrancid xrancid zrancid
+
+bin_SCRIPTS += lg.cgi lgform.cgi rancid-cvs rancid-run
+EXTRA_DIST= lg.cgi.in lgform.cgi.in rancid-cvs.in rancid-run.in
+#dist_bin_SCRIPTS= $(bin_SCRIPTS:%=%.in)
+
+CLEANFILES= lg.cgi lgform.cgi rancid-cvs rancid-run
+#CLEANFILES= $(bin_SCRIPTS)
-bin_PROGRAMS = hpfilter
-hpfilter_SOURCES = hpfilter.c
+hpuifilter_SOURCES = hpuifilter.c
#CPPFLAGS += @PG_CPPFLAGS@
#INCLUDES += -I$(top_srcdir)/include @PG_CPPFLAGS@
@@ -35,35 +55,46 @@ YFLAGS = -d
# no idea why automake doesnt clean these targets
#CLEANFILES= y.tab.c y.tab.h lex.yy.c conf.h conf.c conflex.c
-BIN_PROGS=@RD_BIN_PROGS@
-BIN_DATAS=@RD_BIN_DATAS@
-
-install: all
- for prog in $(BIN_PROGS) ; do \
- $(INSTALL) $$prog $(bindir); \
- done; \
- if test -f $(bindir)/env ; then \
- echo "WARNING: *** $(bindir)/env exists: installing as env.new."; \
- echo " *** review env.new for new/deprecated switches"; \
- $(INSTALL_DATA) env $(bindir)/env.new; \
- else \
- $(INSTALL_DATA) env $(bindir); \
- fi
-# BIN_DATAS are empty at the moment.
-# for prog in $(BIN_DATAS) ; do \
-# $(INSTALL_DATA) $$prog $(PREFIX)/bin; \
-# done; \
-
#clean:
# rm -f Makefile env $(BIN_DATAS) $(BIN_PROGS)
-#distclean: clean
-# rm -f config.log config.status
+# auto_edit does the autoconf variable substitution. This allows the
+# substitution to have the full expansion of the variables, e.g.: $sysconfdir
+# will be /prefix/etc instead of ${prefix}/etc.
+#
+# This is a bit of a PITA, but is the method recommended by the autoconf
+# documentation.
+auto_edit = sed \
+ -e 's,@prefix\@,$(prefix),g' \
+ -e 's,@localstatedir\@,$(localstatedir),g' \
+ -e 's,@sysconfdir\@,$(sysconfdir),g' \
+ -e 's,@EXPECT_PATH\@,$(EXPECT_PATH),g' \
+ -e 's,@PERLV\@,$(PERLV),g' \
+ -e 's,@PERLV_PATH\@,$(PERLV_PATH),g' \
+ -e 's,@LG_PING_CMD\@,$(LG_PING_CMD),g' \
+ -e 's,@ADMINMAILPLUS\@,$(ADMINMAILPLUS),g' \
+ -e 's,@MAILPLUS\@,$(MAILPLUS),g'
+
+lg.cgi: Makefile $(srcdir)/lg.cgi.in
+ rm -f lg.cgi lg.cgi.tmp; \
+ $(auto_edit) $(srcdir)/lg.cgi.in >lg.cgi.tmp; \
+ chmod +x lg.cgi.tmp; \
+ mv lg.cgi.tmp lg.cgi
+
+lgform.cgi: Makefile $(srcdir)/lgform.cgi.in
+ rm -f lgform.cgi lgform.cgi.tmp; \
+ $(auto_edit) $(srcdir)/lgform.cgi.in >lgform.cgi.tmp; \
+ chmod +x lgform.cgi.tmp; \
+ mv lgform.cgi.tmp lgform.cgi
+
+rancid-cvs: Makefile $(srcdir)/rancid-cvs.in
+ rm -f rancid-cvs rancid-cvs.tmp; \
+ $(auto_edit) $(srcdir)/rancid-cvs.in >rancid-cvs.tmp; \
+ chmod +x rancid-cvs.tmp; \
+ mv rancid-cvs.tmp rancid-cvs
-#distdir:
-# for file in Makefile.in configure.in env.in $(BIN_DATAS:=.in) ; do \
-# $(INSTALL_DATA) $$file $(distdir); \
-# done
-# for file in configure $(BIN_PROGS:=.in) ; do \
-# $(INSTALL) $$file $(distdir); \
-# done
+rancid-run: Makefile $(srcdir)/rancid-run.in
+ rm -f rancid-run rancid-run.tmp; \
+ $(auto_edit) $(srcdir)/rancid-run.in >rancid-run.tmp; \
+ chmod +x rancid-run.tmp; \
+ mv rancid-run.tmp rancid-run
diff --git a/bin/Makefile.in b/bin/Makefile.in
index ad98aa8..eedc795 100644
--- a/bin/Makefile.in
+++ b/bin/Makefile.in
@@ -1,6 +1,8 @@
-# Makefile.in generated automatically by automake 1.4-p5 from Makefile.am
+# Makefile.in generated by automake 1.8 from Makefile.am.
+# @configure_input@
-# Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc.
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
+# Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@@ -10,397 +12,595 @@
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
-#AUTOMAKE_OPTIONS=foreign no-dependencies
+@SET_MAKE@
-SHELL = @SHELL@
+SOURCES = $(hpuifilter_SOURCES)
srcdir = @srcdir@
top_srcdir = @top_srcdir@
VPATH = @srcdir@
-prefix = @prefix@
-exec_prefix = @exec_prefix@
-
-bindir = @bindir@
-sbindir = @sbindir@
-libexecdir = @libexecdir@
-datadir = @datadir@
-sysconfdir = @sysconfdir@
-sharedstatedir = @sharedstatedir@
-localstatedir = @localstatedir@
-libdir = @libdir@
-infodir = @infodir@
-mandir = @mandir@
-includedir = @includedir@
-oldincludedir = /usr/include
-
-DESTDIR =
-
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
-
top_builddir = ..
-
-ACLOCAL = @ACLOCAL@
-AUTOCONF = @AUTOCONF@
-AUTOMAKE = @AUTOMAKE@
-AUTOHEADER = @AUTOHEADER@
-
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
INSTALL = @INSTALL@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS)
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-transform = @program_transform_name@
-
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
+bin_PROGRAMS = hpuifilter$(EXEEXT)
+subdir = bin
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+ $(srcdir)/alogin.in $(srcdir)/arancid.in $(srcdir)/blogin.in \
+ $(srcdir)/brancid.in $(srcdir)/cat5rancid.in \
+ $(srcdir)/clogin.in $(srcdir)/control_rancid.in \
+ $(srcdir)/cssrancid.in $(srcdir)/elogin.in \
+ $(srcdir)/erancid.in $(srcdir)/f10rancid.in \
+ $(srcdir)/flogin.in $(srcdir)/fnrancid.in $(srcdir)/francid.in \
+ $(srcdir)/hlogin.in $(srcdir)/hrancid.in $(srcdir)/htlogin.in \
+ $(srcdir)/htrancid.in $(srcdir)/jerancid.in \
+ $(srcdir)/jlogin.in $(srcdir)/jrancid.in $(srcdir)/mrancid.in \
+ $(srcdir)/nlogin.in $(srcdir)/nrancid.in $(srcdir)/nslogin.in \
+ $(srcdir)/nsrancid.in $(srcdir)/par.in $(srcdir)/prancid.in \
+ $(srcdir)/rancid-fe.in $(srcdir)/rancid.in \
+ $(srcdir)/rivlogin.in $(srcdir)/rivrancid.in \
+ $(srcdir)/rrancid.in $(srcdir)/tntlogin.in \
+ $(srcdir)/tntrancid.in $(srcdir)/xrancid.in \
+ $(srcdir)/zrancid.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
+ $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
+CONFIG_HEADER = $(top_builddir)/include/config.h
+CONFIG_CLEAN_FILES = control_rancid par rancid-fe alogin arancid \
+ blogin brancid cat5rancid clogin rancid cssrancid elogin \
+ erancid f10rancid flogin francid fnrancid jlogin jrancid \
+ jerancid hlogin hrancid htlogin htrancid mrancid nlogin \
+ nrancid nslogin nsrancid prancid rivlogin rivrancid rrancid \
+ tntlogin tntrancid xrancid zrancid
+am__installdirs = $(DESTDIR)$(bindir) $(DESTDIR)$(bindir)
+binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
+PROGRAMS = $(bin_PROGRAMS)
+am_hpuifilter_OBJECTS = hpuifilter.$(OBJEXT)
+hpuifilter_OBJECTS = $(am_hpuifilter_OBJECTS)
+hpuifilter_LDADD = $(LDADD)
+binSCRIPT_INSTALL = $(INSTALL_SCRIPT)
+SCRIPTS = $(bin_SCRIPTS)
+DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/include
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+@AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/hpuifilter.Po
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+SOURCES = $(hpuifilter_SOURCES)
+DIST_SOURCES = $(hpuifilter_SOURCES)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+ADMINMAILPLUS = @ADMINMAILPLUS@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+
+#CPPFLAGS += @PG_CPPFLAGS@
+#INCLUDES += -I$(top_srcdir)/include @PG_CPPFLAGS@
+#INCLUDES += -I$(top_srcdir)/include
+
+#CFLAGS += -g
+CFLAGS = -g -O0
COMM = @COMM@
CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
CVS = @CVS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
DIFF = @DIFF@
DIFF_CMD = @DIFF_CMD@
DIRNAME = @DIRNAME@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
ENV_PATH = @ENV_PATH@
+EXEEXT = @EXEEXT@
EXPECT_PATH = @EXPECT_PATH@
FIND = @FIND@
GREP = @GREP@
ID = @ID@
-INST_PROGS = @INST_PROGS@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
LG_PING_CMD = @LG_PING_CMD@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LTLIBOBJS = @LTLIBOBJS@
MAILPLUS = @MAILPLUS@
-MAINT = @MAINT@
MAKE = @MAKE@
MAKEINFO = @MAKEINFO@
MKDIR = @MKDIR@
+OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
PERLV = @PERLV@
PERLV_PATH = @PERLV_PATH@
PING_PATH = @PING_PATH@
-RD_BIN_DATAS = @RD_BIN_DATAS@
-RD_BIN_PROGS = @RD_BIN_PROGS@
-RD_UTIL_LG_PROGS = @RD_UTIL_LG_PROGS@
-RD_UTIL_PROGS = @RD_UTIL_PROGS@
RSH = @RSH@
SENDMAIL = @SENDMAIL@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
SORT = @SORT@
SSH = @SSH@
+STRIP = @STRIP@
TAR = @TAR@
TELNET = @TELNET@
TOUCH = @TOUCH@
U = @U@
VERSION = @VERSION@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_STRIP = @ac_ct_STRIP@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+bindir = @bindir@
+build_alias = @build_alias@
+datadir = @datadir@
+exec_prefix = @exec_prefix@
+host_alias = @host_alias@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+#AUTOMAKE_OPTIONS=foreign no-dependencies
AUTOMAKE_OPTIONS = foreign
-
-PREFIX = @prefix@
-
-bin_PROGRAMS = hpfilter
-hpfilter_SOURCES = hpfilter.c
-
-#CPPFLAGS += @PG_CPPFLAGS@
-#INCLUDES += -I$(top_srcdir)/include @PG_CPPFLAGS@
-#INCLUDES += -I$(top_srcdir)/include
-
-#CFLAGS += -g
-CFLAGS = -g -O0
-
+bin_SCRIPTS = cat5rancid control_rancid \
+ alogin arancid clogin blogin brancid cssrancid \
+ elogin erancid f10rancid flogin francid fnrancid \
+ jlogin jrancid jerancid \
+ hlogin hrancid htlogin htrancid \
+ mrancid nlogin nrancid nslogin nsrancid par prancid \
+ rancid rancid-fe rivlogin rivrancid rrancid \
+ tntlogin tntrancid xrancid zrancid\
+lg.cgi lgform.cgi rancid-cvs rancid-run
+EXTRA_DIST = lg.cgi.in lgform.cgi.in rancid-cvs.in rancid-run.in
+#dist_bin_SCRIPTS= $(bin_SCRIPTS:%=%.in)
+CLEANFILES = lg.cgi lgform.cgi rancid-cvs rancid-run
+#CLEANFILES= $(bin_SCRIPTS)
+hpuifilter_SOURCES = hpuifilter.c
YFLAGS = -d
#LFLAGS = -i
# no idea why automake doesnt clean these targets
#CLEANFILES= y.tab.c y.tab.h lex.yy.c conf.h conf.c conflex.c
-BIN_PROGS = @RD_BIN_PROGS@
-BIN_DATAS = @RD_BIN_DATAS@
-mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
-CONFIG_HEADER = ../include/config.h
-CONFIG_CLEAN_FILES = alogin arancid blogin brancid cat5rancid clogin \
-control_rancid create_cvs do-diffs elogin env erancid f10rancid flogin \
-francid jlogin jrancid hlogin hrancid mrancid par rancid-fe rancid \
-rename rrancid xrancid
-PROGRAMS = $(bin_PROGRAMS)
-
-
-DEFS = @DEFS@ -I. -I$(srcdir) -I../include
-CPPFLAGS = @CPPFLAGS@
-LDFLAGS = @LDFLAGS@
-LIBS = @LIBS@
-hpfilter_OBJECTS = hpfilter.o
-hpfilter_LDADD = $(LDADD)
-hpfilter_DEPENDENCIES =
-hpfilter_LDFLAGS =
-COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-CCLD = $(CC)
-LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@
-DIST_COMMON = Makefile.am Makefile.in alogin.in arancid.in blogin.in \
-brancid.in cat5rancid.in clogin.in control_rancid.in create_cvs.in \
-do-diffs.in elogin.in env.in erancid.in f10rancid.in flogin.in \
-francid.in hlogin.in hrancid.in jlogin.in jrancid.in mrancid.in par.in \
-rancid-fe.in rancid.in rename.in rrancid.in xrancid.in
-
-
-DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
+#clean:
+# rm -f Makefile env $(BIN_DATAS) $(BIN_PROGS)
-GZIP_ENV = --best
-SOURCES = $(hpfilter_SOURCES)
-OBJECTS = $(hpfilter_OBJECTS)
+# auto_edit does the autoconf variable substitution. This allows the
+# substitution to have the full expansion of the variables, e.g.: $sysconfdir
+# will be /prefix/etc instead of ${prefix}/etc.
+#
+# This is a bit of a PITA, but is the method recommended by the autoconf
+# documentation.
+auto_edit = sed \
+ -e 's,@prefix\@,$(prefix),g' \
+ -e 's,@localstatedir\@,$(localstatedir),g' \
+ -e 's,@sysconfdir\@,$(sysconfdir),g' \
+ -e 's,@EXPECT_PATH\@,$(EXPECT_PATH),g' \
+ -e 's,@PERLV\@,$(PERLV),g' \
+ -e 's,@PERLV_PATH\@,$(PERLV_PATH),g' \
+ -e 's,@LG_PING_CMD\@,$(LG_PING_CMD),g' \
+ -e 's,@ADMINMAILPLUS\@,$(ADMINMAILPLUS),g' \
+ -e 's,@MAILPLUS\@,$(MAILPLUS),g'
+
+all: all-am
-all: all-redirect
.SUFFIXES:
-.SUFFIXES: .S .c .o .s
-$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
- cd $(top_srcdir) && $(AUTOMAKE) --foreign --include-deps bin/Makefile
-
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
- cd $(top_builddir) \
- && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
-
-alogin: $(top_builddir)/config.status alogin.in
- cd $(top_builddir) && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
-arancid: $(top_builddir)/config.status arancid.in
- cd $(top_builddir) && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
-blogin: $(top_builddir)/config.status blogin.in
- cd $(top_builddir) && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
-brancid: $(top_builddir)/config.status brancid.in
- cd $(top_builddir) && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
-cat5rancid: $(top_builddir)/config.status cat5rancid.in
- cd $(top_builddir) && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
-clogin: $(top_builddir)/config.status clogin.in
- cd $(top_builddir) && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
-control_rancid: $(top_builddir)/config.status control_rancid.in
- cd $(top_builddir) && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
-create_cvs: $(top_builddir)/config.status create_cvs.in
- cd $(top_builddir) && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
-do-diffs: $(top_builddir)/config.status do-diffs.in
- cd $(top_builddir) && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
-elogin: $(top_builddir)/config.status elogin.in
- cd $(top_builddir) && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
-env: $(top_builddir)/config.status env.in
- cd $(top_builddir) && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
-erancid: $(top_builddir)/config.status erancid.in
- cd $(top_builddir) && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
-f10rancid: $(top_builddir)/config.status f10rancid.in
- cd $(top_builddir) && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
-flogin: $(top_builddir)/config.status flogin.in
- cd $(top_builddir) && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
-francid: $(top_builddir)/config.status francid.in
- cd $(top_builddir) && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
-jlogin: $(top_builddir)/config.status jlogin.in
- cd $(top_builddir) && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
-jrancid: $(top_builddir)/config.status jrancid.in
- cd $(top_builddir) && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
-hlogin: $(top_builddir)/config.status hlogin.in
- cd $(top_builddir) && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
-hrancid: $(top_builddir)/config.status hrancid.in
- cd $(top_builddir) && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
-mrancid: $(top_builddir)/config.status mrancid.in
- cd $(top_builddir) && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
-par: $(top_builddir)/config.status par.in
- cd $(top_builddir) && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
-rancid-fe: $(top_builddir)/config.status rancid-fe.in
- cd $(top_builddir) && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
-rancid: $(top_builddir)/config.status rancid.in
- cd $(top_builddir) && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
-rename: $(top_builddir)/config.status rename.in
- cd $(top_builddir) && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
-rrancid: $(top_builddir)/config.status rrancid.in
- cd $(top_builddir) && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
-xrancid: $(top_builddir)/config.status xrancid.in
- cd $(top_builddir) && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
-
-mostlyclean-binPROGRAMS:
-
-clean-binPROGRAMS:
- -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
-
-distclean-binPROGRAMS:
-
-maintainer-clean-binPROGRAMS:
-
+.SUFFIXES: .c .o .obj
+$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+ && exit 0; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign bin/Makefile'; \
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --foreign bin/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+control_rancid: $(top_builddir)/config.status $(srcdir)/control_rancid.in
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
+par: $(top_builddir)/config.status $(srcdir)/par.in
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
+rancid-fe: $(top_builddir)/config.status $(srcdir)/rancid-fe.in
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
+alogin: $(top_builddir)/config.status $(srcdir)/alogin.in
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
+arancid: $(top_builddir)/config.status $(srcdir)/arancid.in
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
+blogin: $(top_builddir)/config.status $(srcdir)/blogin.in
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
+brancid: $(top_builddir)/config.status $(srcdir)/brancid.in
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
+cat5rancid: $(top_builddir)/config.status $(srcdir)/cat5rancid.in
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
+clogin: $(top_builddir)/config.status $(srcdir)/clogin.in
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
+rancid: $(top_builddir)/config.status $(srcdir)/rancid.in
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
+cssrancid: $(top_builddir)/config.status $(srcdir)/cssrancid.in
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
+elogin: $(top_builddir)/config.status $(srcdir)/elogin.in
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
+erancid: $(top_builddir)/config.status $(srcdir)/erancid.in
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
+f10rancid: $(top_builddir)/config.status $(srcdir)/f10rancid.in
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
+flogin: $(top_builddir)/config.status $(srcdir)/flogin.in
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
+francid: $(top_builddir)/config.status $(srcdir)/francid.in
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
+fnrancid: $(top_builddir)/config.status $(srcdir)/fnrancid.in
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
+jlogin: $(top_builddir)/config.status $(srcdir)/jlogin.in
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
+jrancid: $(top_builddir)/config.status $(srcdir)/jrancid.in
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
+jerancid: $(top_builddir)/config.status $(srcdir)/jerancid.in
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
+hlogin: $(top_builddir)/config.status $(srcdir)/hlogin.in
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
+hrancid: $(top_builddir)/config.status $(srcdir)/hrancid.in
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
+htlogin: $(top_builddir)/config.status $(srcdir)/htlogin.in
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
+htrancid: $(top_builddir)/config.status $(srcdir)/htrancid.in
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
+mrancid: $(top_builddir)/config.status $(srcdir)/mrancid.in
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
+nlogin: $(top_builddir)/config.status $(srcdir)/nlogin.in
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
+nrancid: $(top_builddir)/config.status $(srcdir)/nrancid.in
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
+nslogin: $(top_builddir)/config.status $(srcdir)/nslogin.in
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
+nsrancid: $(top_builddir)/config.status $(srcdir)/nsrancid.in
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
+prancid: $(top_builddir)/config.status $(srcdir)/prancid.in
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
+rivlogin: $(top_builddir)/config.status $(srcdir)/rivlogin.in
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
+rivrancid: $(top_builddir)/config.status $(srcdir)/rivrancid.in
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
+rrancid: $(top_builddir)/config.status $(srcdir)/rrancid.in
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
+tntlogin: $(top_builddir)/config.status $(srcdir)/tntlogin.in
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
+tntrancid: $(top_builddir)/config.status $(srcdir)/tntrancid.in
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
+xrancid: $(top_builddir)/config.status $(srcdir)/xrancid.in
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
+zrancid: $(top_builddir)/config.status $(srcdir)/zrancid.in
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
install-binPROGRAMS: $(bin_PROGRAMS)
@$(NORMAL_INSTALL)
- $(mkinstalldirs) $(DESTDIR)$(bindir)
+ $(mkdir_p) $(DESTDIR)$(bindir)
@list='$(bin_PROGRAMS)'; for p in $$list; do \
- if test -f $$p; then \
- echo " $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`"; \
- $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \
+ p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+ if test -f $$p \
+ ; then \
+ f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
+ echo " $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) $$p $(DESTDIR)$(bindir)/$$f"; \
+ $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) $$p $(DESTDIR)$(bindir)/$$f || exit 1; \
else :; fi; \
done
uninstall-binPROGRAMS:
@$(NORMAL_UNINSTALL)
- list='$(bin_PROGRAMS)'; for p in $$list; do \
- rm -f $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \
+ @list='$(bin_PROGRAMS)'; for p in $$list; do \
+ f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
+ echo " rm -f $(DESTDIR)$(bindir)/$$f"; \
+ rm -f $(DESTDIR)$(bindir)/$$f; \
done
-.c.o:
- $(COMPILE) -c $<
-
-.s.o:
- $(COMPILE) -c $<
+clean-binPROGRAMS:
+ -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
+hpuifilter$(EXEEXT): $(hpuifilter_OBJECTS) $(hpuifilter_DEPENDENCIES)
+ @rm -f hpuifilter$(EXEEXT)
+ $(LINK) $(hpuifilter_LDFLAGS) $(hpuifilter_OBJECTS) $(hpuifilter_LDADD) $(LIBS)
+install-binSCRIPTS: $(bin_SCRIPTS)
+ @$(NORMAL_INSTALL)
+ $(mkdir_p) $(DESTDIR)$(bindir)
+ @list='$(bin_SCRIPTS)'; for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ if test -f $$d$$p; then \
+ f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \
+ echo " $(binSCRIPT_INSTALL) $$d$$p $(DESTDIR)$(bindir)/$$f"; \
+ $(binSCRIPT_INSTALL) $$d$$p $(DESTDIR)$(bindir)/$$f; \
+ else :; fi; \
+ done
-.S.o:
- $(COMPILE) -c $<
+uninstall-binSCRIPTS:
+ @$(NORMAL_UNINSTALL)
+ @list='$(bin_SCRIPTS)'; for p in $$list; do \
+ f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \
+ echo " rm -f $(DESTDIR)$(bindir)/$$f"; \
+ rm -f $(DESTDIR)$(bindir)/$$f; \
+ done
mostlyclean-compile:
- -rm -f *.o core *.core
-
-clean-compile:
+ -rm -f *.$(OBJEXT)
distclean-compile:
-rm -f *.tab.c
-maintainer-clean-compile:
-
-hpfilter: $(hpfilter_OBJECTS) $(hpfilter_DEPENDENCIES)
- @rm -f hpfilter
- $(LINK) $(hpfilter_LDFLAGS) $(hpfilter_OBJECTS) $(hpfilter_LDADD) $(LIBS)
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hpuifilter.Po@am__quote@
+.c.o:
+@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(COMPILE) -c $<
+
+.c.obj:
+@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
+uninstall-info-am:
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ mkid -fID $$unique
tags: TAGS
-TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP)
+TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
- list='$(SOURCES) $(HEADERS)'; \
- unique=`for i in $$list; do echo $$i; done | \
- awk ' { files[$$0] = 1; } \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
- test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \
- || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS)
-
-mostlyclean-tags:
+ test -z "$(ETAGS_ARGS)$$tags$$unique" \
+ || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$tags $$unique
+ctags: CTAGS
+CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ test -z "$(CTAGS_ARGS)$$tags$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$tags $$unique
-clean-tags:
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && cd $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) $$here
distclean-tags:
- -rm -f TAGS ID
-
-maintainer-clean-tags:
-
-distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
-
-subdir = bin
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
distdir: $(DISTFILES)
- @for file in $(DISTFILES); do \
- d=$(srcdir); \
+ @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+ list='$(DISTFILES)'; for file in $$list; do \
+ case $$file in \
+ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+ esac; \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+ dir="/$$dir"; \
+ $(mkdir_p) "$(distdir)$$dir"; \
+ else \
+ dir=''; \
+ fi; \
if test -d $$d/$$file; then \
- cp -pr $$d/$$file $(distdir)/$$file; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+ fi; \
+ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
else \
test -f $(distdir)/$$file \
- || ln $$d/$$file $(distdir)/$$file 2> /dev/null \
- || cp -p $$d/$$file $(distdir)/$$file || :; \
+ || cp -p $$d/$$file $(distdir)/$$file \
+ || exit 1; \
fi; \
done
-
-info-am:
-info: info-am
-dvi-am:
-dvi: dvi-am
check-am: all-am
check: check-am
-installcheck-am:
-installcheck: installcheck-am
-install-exec-am: install-binPROGRAMS
+all-am: Makefile $(PROGRAMS) $(SCRIPTS)
+installdirs:
+ $(mkdir_p) $(DESTDIR)$(bindir) $(DESTDIR)$(bindir)
+install: install-am
install-exec: install-exec-am
-
-install-data-am:
install-data: install-data-am
+uninstall: uninstall-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-install: install-am
-uninstall-am: uninstall-binPROGRAMS
-uninstall: uninstall-am
-all-am: Makefile $(PROGRAMS)
-all-redirect: all-am
-install-strip:
- $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install
-installdirs:
- $(mkinstalldirs) $(DESTDIR)$(bindir)
-
+installcheck: installcheck-am
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
mostlyclean-generic:
clean-generic:
+ -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
distclean-generic:
- -rm -f Makefile $(CONFIG_CLEAN_FILES)
- -rm -f config.cache config.log stamp-h stamp-h[0-9]*
+ -rm -f $(CONFIG_CLEAN_FILES)
maintainer-clean-generic:
-mostlyclean-am: mostlyclean-binPROGRAMS mostlyclean-compile \
- mostlyclean-tags mostlyclean-generic
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
-mostlyclean: mostlyclean-am
+clean-am: clean-binPROGRAMS clean-generic mostlyclean-am
-clean-am: clean-binPROGRAMS clean-compile clean-tags clean-generic \
- mostlyclean-am
+distclean: distclean-am
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+ distclean-tags
-clean: clean-am
+dvi: dvi-am
-distclean-am: distclean-binPROGRAMS distclean-compile distclean-tags \
- distclean-generic clean-am
+dvi-am:
-distclean: distclean-am
+html: html-am
-maintainer-clean-am: maintainer-clean-binPROGRAMS \
- maintainer-clean-compile maintainer-clean-tags \
- maintainer-clean-generic distclean-am
- @echo "This command is intended for maintainers to use;"
- @echo "it deletes files that may require special tools to rebuild."
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-exec-am: install-binPROGRAMS install-binSCRIPTS
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
maintainer-clean: maintainer-clean-am
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
-.PHONY: mostlyclean-binPROGRAMS distclean-binPROGRAMS clean-binPROGRAMS \
-maintainer-clean-binPROGRAMS uninstall-binPROGRAMS install-binPROGRAMS \
-mostlyclean-compile distclean-compile clean-compile \
-maintainer-clean-compile tags mostlyclean-tags distclean-tags \
-clean-tags maintainer-clean-tags distdir info-am info dvi-am dvi check \
-check-am installcheck-am installcheck install-exec-am install-exec \
-install-data-am install-data install-am install uninstall-am uninstall \
-all-redirect all-am all installdirs mostlyclean-generic \
-distclean-generic clean-generic maintainer-clean-generic clean \
-mostlyclean distclean maintainer-clean
-
-
-install: all
- for prog in $(BIN_PROGS) ; do \
- $(INSTALL) $$prog $(bindir); \
- done; \
- if test -f $(bindir)/env ; then \
- echo "WARNING: *** $(bindir)/env exists: installing as env.new."; \
- echo " *** review env.new for new/deprecated switches"; \
- $(INSTALL_DATA) env $(bindir)/env.new; \
- else \
- $(INSTALL_DATA) env $(bindir); \
- fi
-# BIN_DATAS are empty at the moment.
-# for prog in $(BIN_DATAS) ; do \
-# $(INSTALL_DATA) $$prog $(PREFIX)/bin; \
-# done; \
+mostlyclean: mostlyclean-am
-#clean:
-# rm -f Makefile env $(BIN_DATAS) $(BIN_PROGS)
+mostlyclean-am: mostlyclean-compile mostlyclean-generic
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-binPROGRAMS uninstall-binSCRIPTS \
+ uninstall-info-am
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \
+ clean-generic ctags distclean distclean-compile \
+ distclean-generic distclean-tags distdir dvi dvi-am html \
+ html-am info info-am install install-am install-binPROGRAMS \
+ install-binSCRIPTS install-data install-data-am install-exec \
+ install-exec-am install-info install-info-am install-man \
+ install-strip installcheck installcheck-am installdirs \
+ maintainer-clean maintainer-clean-generic mostlyclean \
+ mostlyclean-compile mostlyclean-generic pdf pdf-am ps ps-am \
+ tags uninstall uninstall-am uninstall-binPROGRAMS \
+ uninstall-binSCRIPTS uninstall-info-am
+
+
+lg.cgi: Makefile $(srcdir)/lg.cgi.in
+ rm -f lg.cgi lg.cgi.tmp; \
+ $(auto_edit) $(srcdir)/lg.cgi.in >lg.cgi.tmp; \
+ chmod +x lg.cgi.tmp; \
+ mv lg.cgi.tmp lg.cgi
-#distclean: clean
-# rm -f config.log config.status
+lgform.cgi: Makefile $(srcdir)/lgform.cgi.in
+ rm -f lgform.cgi lgform.cgi.tmp; \
+ $(auto_edit) $(srcdir)/lgform.cgi.in >lgform.cgi.tmp; \
+ chmod +x lgform.cgi.tmp; \
+ mv lgform.cgi.tmp lgform.cgi
-#distdir:
-# for file in Makefile.in configure.in env.in $(BIN_DATAS:=.in) ; do \
-# $(INSTALL_DATA) $$file $(distdir); \
-# done
-# for file in configure $(BIN_PROGS:=.in) ; do \
-# $(INSTALL) $$file $(distdir); \
-# done
+rancid-cvs: Makefile $(srcdir)/rancid-cvs.in
+ rm -f rancid-cvs rancid-cvs.tmp; \
+ $(auto_edit) $(srcdir)/rancid-cvs.in >rancid-cvs.tmp; \
+ chmod +x rancid-cvs.tmp; \
+ mv rancid-cvs.tmp rancid-cvs
+rancid-run: Makefile $(srcdir)/rancid-run.in
+ rm -f rancid-run rancid-run.tmp; \
+ $(auto_edit) $(srcdir)/rancid-run.in >rancid-run.tmp; \
+ chmod +x rancid-run.tmp; \
+ mv rancid-run.tmp rancid-run
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
diff --git a/bin/alogin.in b/bin/alogin.in
index 03f12ca..91623fb 100644
--- a/bin/alogin.in
+++ b/bin/alogin.in
@@ -1,21 +1,26 @@
-#!@EXPECT_PATH@ --
+#! @EXPECT_PATH@ --
##
+## $Id: alogin.in,v 1.22 2004/01/11 05:39:15 heas Exp $
##
-## Copyright (C) 1997-2001 by Henry Kilmer, Erik Sherk and Pete Whiting.
+## Copyright (C) 1997-2004 by Terrapin Communications, Inc.
## All rights reserved.
##
-## This software may be freely copied, modified and redistributed without
-## fee for non-commerical purposes provided that this copyright notice is
-## preserved intact on all copies and modified copies.
+## This software may be freely copied, modified and redistributed
+## without fee for non-commerical purposes provided that this license
+## remains intact and unmodified with any RANCID distribution.
##
## There is no warranty or other guarantee of fitness of this software.
-## It is provided solely "as is". The author(s) disclaim(s) all
+## It is provided solely "as is". The author(s) disclaim(s) all
## responsibility and liability with respect to this software's usage
## or its effect upon hardware, computer systems, other software, or
## anything else.
##
+## Except where noted otherwise, rancid was written by and is maintained by
+## Henry Kilmer, John Heasley, Andrew Partan, Pete Whiting, and Austin Schutz.
##
#
+# The login expect scripts were based on Erik Sherk's gwtn, by permission.
+#
# alogin - Alteon WebOS switch login
#
# afort@choqolat.org is responsible for this particular mess
@@ -39,8 +44,9 @@ set do_command 0
set do_script 0
# The default is to automatically enable
set enable 1
-# The default is that you login non-enabled (tacacs can have you login already enabled)
-set autoenable 0
+# The default is that you login non-enabled (tacacs can have you login already
+# enabled)
+set avautoenable 0
# The default is to look in the password file to find the passwords. This
# tracks if we receive them on the command line.
set do_passwd 1
@@ -50,12 +56,14 @@ if {[ info exists env(CISCO_USER) ] } {
set default_user $env(CISCO_USER)
} elseif {[ info exists env(USER) ]} {
set default_user $env(USER)
+} elseif {[ info exists env(LOGNAME) ]} {
+ set default_user $env(LOGNAME)
} else {
# This uses "id" which I think is portable. At least it has existed
# (without options) on all machines/OSes I've been on recently -
# unlike whoami or id -nu.
if [ catch {exec id} reason ] {
- send_error "Error: could not exec id: $reason\n"
+ send_error "\nError: could not exec id: $reason\n"
exit 1
}
regexp {\(([^)]*)} "$reason" junk default_user
@@ -95,7 +103,7 @@ for {set i 0} {$i < $argc} {incr i} {
incr i
set E$varname $varvalue
} else {
- send_user "Error: invalid format for -E in $arg\n"
+ send_user "\nError: invalid format for -E in $arg\n"
exit 1
}
# Enable Password
@@ -118,7 +126,7 @@ for {set i 0} {$i < $argc} {incr i} {
set sfile [ lindex $argv $i ]
}
if { ! [ file readable $sfile ] } {
- send_user "Error: Can't read $sfile\n"
+ send_user "\nError: Can't read $sfile\n"
exit 1
}
set do_script 1
@@ -160,12 +168,12 @@ for {set i 0} {$i < $argc} {incr i} {
set do_command 1
# Do we enable?
} -noenable {
- # ignore -noenable
+ # ignore -noenable
# Does tacacs automatically enable us?
} -autoenable {
- # ignore -autoenable
+ # ignore -autoenable
} -* {
- send_user "Error: Unknown argument! $arg\n"
+ send_user "\nError: Unknown argument! $arg\n"
send_user $usage
exit 1
} default {
@@ -175,7 +183,7 @@ for {set i 0} {$i < $argc} {incr i} {
}
# Process routers...no routers listed is an error.
if { $i == $argc } {
- send_user "Error: $usage"
+ send_user "\nError: $usage"
}
# Only be quiet if we are running a script (it can log its output
@@ -241,16 +249,16 @@ proc find {var router} {
proc source_password_file { password_file } {
global env
if { ! [file exists $password_file] } {
- send_user "Error: password file ($password_file) does not exist\n"
+ send_user "\nError: password file ($password_file) does not exist\n"
exit 1
}
file stat $password_file fileinfo
if { [expr ($fileinfo(mode) & 007)] != 0000 } {
- send_user "Error: $password_file must not be world readable/writable\n"
+ send_user "\nError: $password_file must not be world readable/writable\n"
exit 1
}
if [ catch {source $password_file} reason ] {
- send_user "Error: $reason\n"
+ send_user "\nError: $reason\n"
exit 1
}
}
@@ -258,7 +266,7 @@ proc source_password_file { password_file } {
# Log into the router.
proc login { router user userpswd passwd prompt cmethod cyphertype } {
global spawn_id in_proc do_command do_script
- global u_prompt p_prompt
+ global u_prompt p_prompt sshcmd
set in_proc 1
set uprompt_seen 0
@@ -277,17 +285,17 @@ proc login { router user userpswd passwd prompt cmethod cyphertype } {
exit 1
}
} elseif ![string compare $prog "ssh"] {
- if [ catch {spawn ssh -c $cyphertype -x -l $user $router} reason ] {
- send_user "Error: ssh failed: $reason\n"
+ if [ catch {spawn $sshcmd -c $cyphertype -x -l $user $router} reason ] {
+ send_user "\nError: $sshcmd failed: $reason\n"
exit 1
}
} elseif ![string compare $prog "rsh"] {
if [ catch {spawn rsh -l $user $router} reason ] {
- send_user "Error: rsh failed: $reason\n"
+ send_user "\nError: rsh failed: $reason\n"
exit 1
}
} else {
- puts "ERROR: unknown connection method: $prog"
+ puts "\nError: unknown connection method: $prog"
return 1
}
incr progs -1
@@ -319,17 +327,17 @@ proc login { router user userpswd passwd prompt cmethod cyphertype } {
close; wait
sleep 0.3
expect eof
- send_user "Error: Connection Refused\n"; wait; return 1
- } eof { send_user "Error: Couldn't login\n"; wait; return 1
+ send_user "\nError: Connection Refused\n"; wait; return 1
+ } eof { send_user "\nError: Couldn't login\n"; wait; return 1
} "Unknown host\r\n" {
expect eof
- send_user "Error: Unknown host\n"; wait; return 1
+ send_user "\nError: Unknown host\n"; wait; return 1
} "Host is unreachable" {
expect eof
- send_user "Error: Host Unreachable!\n"; wait; return 1
+ send_user "\nError: Host Unreachable!\n"; wait; return 1
} "No address associated with name" {
expect eof
- send_user "Error: Unknown host\n"; wait; return 1
+ send_user "\nError: Unknown host\n"; wait; return 1
}
-re "(Host key not found |The authenticity of host .* be established).*\(yes\/no\)\?" {
send "yes\r"
@@ -362,10 +370,10 @@ proc login { router user userpswd passwd prompt cmethod cyphertype } {
send "y\r"
exp_continue
}
- "Password incorrect" { send_user "Error: Check your password for $router\n";
+ "Password incorrect" { send_user "\nError: Check your password for $router\n";
catch {close}; wait; return 1 }
-re "$prompt" { break; }
- denied { send_user "Error: Check your passwd for $router\n"
+ denied { send_user "\nError: Check your passwd for $router\n"
catch {close}; wait; return 1
}
"\r\n" { exp_continue; }
@@ -439,10 +447,10 @@ foreach router [lrange $argv $i end] {
if { $do_passwd } {
set pswd [find password $router]
if { [llength $pswd] == 0 } {
- send_user "Error - no password for $router in $password_file.\n"
+ send_user "\nError - no password for $router in $password_file.\n"
continue
}
- set passwd [lindex $pswd 0]
+ set passwd [join [lindex $pswd 0] ""]
}
# Figure out username
@@ -450,7 +458,7 @@ foreach router [lrange $argv $i end] {
# command line username
set ruser $username
} else {
- set ruser [find user $router]
+ set ruser [join [find user $router] ""]
if { "$ruser" == "" } { set ruser $default_user }
}
@@ -459,7 +467,7 @@ foreach router [lrange $argv $i end] {
# command line username
set userpswd $userpasswd
} else {
- set userpswd [find userpassword $router]
+ set userpswd [join [find userpassword $router] ""]
if { "$userpswd" == "" } { set userpswd $passwd }
}
@@ -468,13 +476,13 @@ foreach router [lrange $argv $i end] {
if { "$u_prompt" == "" } {
set u_prompt "(Username|login| Login):"
} else {
- set u_prompt [lindex $u_prompt 0]
+ set u_prompt [join [lindex $u_prompt 0] ""]
}
set p_prompt [find passprompt $router]
if { "$p_prompt" == "" } {
set p_prompt "\[Pp]assword:"
} else {
- set p_prompt [lindex $p_prompt 0]
+ set p_prompt [join [lindex $p_prompt 0] ""]
}
# Figure out cypher type
@@ -490,6 +498,10 @@ foreach router [lrange $argv $i end] {
set cmethod [find method $router]
if { "$cmethod" == "" } { set cmethod {{telnet} {ssh}} }
+ # Figure out the SSH executable name
+ set sshcmd [find sshcmd $router]
+ if { "$sshcmd" == "" } { set sshcmd {ssh} }
+
# Login to the router
if {[login $router $ruser $userpswd $passwd $prompt $cmethod $cyphertype]} {
continue
diff --git a/bin/arancid.in b/bin/arancid.in
index f51a6c3..a2bf1ef 100644
--- a/bin/arancid.in
+++ b/bin/arancid.in
@@ -1,23 +1,26 @@
-#!@PERLV_PATH@
+#! @PERLV_PATH@
+##
+## $Id: arancid.in,v 1.14 2004/01/11 03:49:13 heas Exp $
##
## Hacked version of rancid for Alteon WebOS switches
## tested with: ad3 v8.1.18
## afort@choqolat.org (andrew fort)
##
-##
-## Copyright (C) 1997-2001 by Henry Kilmer.
+## Copyright (C) 1997-2004 by Terrapin Communications, Inc.
## All rights reserved.
##
-## This software may be freely copied, modified and redistributed without
-## fee for non-commerical purposes provided that this copyright notice is
-## preserved intact on all copies and modified copies.
+## This software may be freely copied, modified and redistributed
+## without fee for non-commerical purposes provided that this license
+## remains intact and unmodified with any RANCID distribution.
##
## There is no warranty or other guarantee of fitness of this software.
-## It is provided solely "as is". The author(s) disclaim(s) all
+## It is provided solely "as is". The author(s) disclaim(s) all
## responsibility and liability with respect to this software's usage
## or its effect upon hardware, computer systems, other software, or
## anything else.
##
+## Except where noted otherwise, rancid was written by and is maintained by
+## Henry Kilmer, John Heasley, Andrew Partan, Pete Whiting, and Austin Schutz.
##
#
# RANCID - Really Awesome New Cisco confIg Differ
@@ -27,7 +30,7 @@
# usage: arancid [-d] [-l] [-f filename | $host]
#
use Getopt::Std;
-getopts('dflm');
+getopts('dfl');
$log = $opt_l;
$debug = $opt_d;
$file = $opt_f;
@@ -240,7 +243,11 @@ TOP: while(<INPUT>) {
while (/>>.*$prompt\s*($cmds_regexp)\s*$/) {
$cmd = $1;
- if (!defined($prompt)) {$prompt = ($_ =~ /^([^#]+#)/)[0]; }
+ if (!defined($prompt)) {
+ $prompt = ($_ =~ /^([^#]+#)/)[0];
+ $prompt =~ s/([][}{)(\\])/\\$1/g;
+ print STDERR ("PROMPT MATCH: $prompt\n") if ($debug);
+ }
print STDERR ("HIT COMMAND:$_") if ($debug);
if (!defined($commands{$cmd})) {
print STDERR "$host: found unexpected command - \"$cmd\"\n";
diff --git a/bin/blogin.in b/bin/blogin.in
index 23bf97c..92d2e8c 100644
--- a/bin/blogin.in
+++ b/bin/blogin.in
@@ -1,26 +1,33 @@
-#!@EXPECT_PATH@ --
+#! @EXPECT_PATH@ --
##
+## $Id: blogin.in,v 1.22 2004/01/11 05:39:15 heas Exp $
##
-## Copyright (C) 1997-2001 by Henry Kilmer, Erik Sherk and Pete Whiting.
+## Copyright (C) 1997-2004 by Terrapin Communications, Inc.
## All rights reserved.
##
-## This software may be freely copied, modified and redistributed without
-## fee for non-commerical purposes provided that this copyright notice is
-## preserved intact on all copies and modified copies.
+## This software may be freely copied, modified and redistributed
+## without fee for non-commerical purposes provided that this license
+## remains intact and unmodified with any RANCID distribution.
##
## There is no warranty or other guarantee of fitness of this software.
-## It is provided solely "as is". The author(s) disclaim(s) all
+## It is provided solely "as is". The author(s) disclaim(s) all
## responsibility and liability with respect to this software's usage
## or its effect upon hardware, computer systems, other software, or
## anything else.
##
+## Except where noted otherwise, rancid was written by and is maintained by
+## Henry Kilmer, John Heasley, Andrew Partan, Pete Whiting, and Austin Schutz.
##
#
+# The login expect scripts were based on Erik Sherk's gwtn, by permission.
+#
# blogin - Bay Networks(Nortel) login
#
-# Unlike the Cisco's, there is no enable function on the Bay's.
-# Instead there are seperate User and Manager accounts. A 'system' command
-# exists, which i am told does nothing.
+# Unlike the Cisco's, there is no enable function on the Bay's. Instead
+# there are seperate User and Manager accounts. A 'system' command exists,
+# which I am told does nothing.
+#
+# The "bcc>" prompt changes to "box#", not "bcc#" after the config command.
#
# Usage line
@@ -40,8 +47,9 @@ set do_command 0
set do_script 0
# The default is to automatically enable
set enable 0
-# The default is that you login non-enabled (tacacs can have you login already enabled)
-set autoenable 0
+# The default is that you login non-enabled (tacacs can have you login already
+# enabled)
+set avautoenable 0
# The default is to look in the password file to find the passwords. This
# tracks if we receive them on the command line.
set do_passwd 1
@@ -52,6 +60,8 @@ if {[ info exists env(CISCO_USER) ] } {
set default_user $env(CISCO_USER)
} elseif {[ info exists env(USER) ]} {
set default_user $env(USER)
+} elseif {[ info exists env(LOGNAME) ]} {
+ set default_user $env(LOGNAME)
} else {
# This uses "id" which I think is portable. At least it has existed
# (without options) on all machines/OSes I've been on recently -
@@ -107,7 +117,7 @@ for {set i 0} {$i < $argc} {incr i} {
if {[ regexp .\[E\](.+)=(.+) $arg ignore varname varvalue]} {
set E$varname $varvalue
} else {
- send_user "Error: invalid format for -E in $arg\n"
+ send_user "\nError: invalid format for -E in $arg\n"
exit 1
}
# Enable Password
@@ -176,7 +186,7 @@ for {set i 0} {$i < $argc} {incr i} {
set enable 0
# Does tacacs automatically enable us?
} -autoenable {
- set autoenable 1
+ set avautoenable 1
set enable 0
} -* {
send_user "\nError: Unknown argument! $arg\n"
@@ -272,7 +282,7 @@ proc source_password_file { password_file } {
# Log into the router.
proc login { router user userpswd passwd enapasswd prompt cmethod cyphertype } {
global spawn_id in_proc do_command do_script
- global u_prompt p_prompt e_prompt
+ global u_prompt p_prompt e_prompt sshcmd
set in_proc 1
# try each of the connection methods in $cmethod until one is successful
@@ -290,8 +300,8 @@ proc login { router user userpswd passwd enapasswd prompt cmethod cyphertype } {
exit 1
}
} elseif ![string compare $prog "ssh"] {
- if [ catch {spawn ssh -c $cyphertype -x -l $user $router} reason ] {
- send_user "\nError: ssh failed: $reason\n"
+ if [ catch {spawn $sshcmd -c $cyphertype -x -l $user $router} reason ] {
+ send_user "\nError: $sshcmd failed: $reason\n"
exit 1
}
} elseif ![string compare $prog "rsh"] {
@@ -408,10 +418,13 @@ proc do_enable { enauser enapasswd } {
-re "$e_prompt" { send "$enapasswd\r"; exp_continue}
"#" { set prompt "#" }
"(enable)" { set prompt "> (enable) " }
- denied { send_user "\nError: Check your Enable passwd\n"; return 1}
- "% Bad passwords" { send_user "\nError: Check your Enable passwd\n"
- return 1
- }
+ denied { send_user "\nError: Check your Enable passwd\n"
+ return 1
+ }
+ "% Bad passwords" {
+ send_user "\nError: Check your Enable passwd\n"
+ return 1
+ }
}
# We set the prompt variable (above) so script files don't need
# to know what it is.
@@ -440,7 +453,7 @@ proc run_commands { prompt command } {
expect {
-re "^\[^\n\r *]*$reprompt" {}
-re "^\[^\n\r]*$reprompt." { exp_continue }
- -re "\[\n\r]" { exp_continue }
+ -re "\[\n\r]+" { exp_continue }
}
}
} else {
@@ -448,7 +461,7 @@ proc run_commands { prompt command } {
expect {
-re "^\[^\n\r *]*$reprompt" {}
-re "^\[^\n\r]*$reprompt." { exp_continue }
- -re "\[\n\r]" { exp_continue }
+ -re "\[\n\r]+" { exp_continue }
}
}
send "logout\r"
@@ -473,7 +486,9 @@ foreach router [lrange $argv $i end] {
# Since autoenable is off by default, if we have it defined, it
# was done on the command line. If it is not specifically set on the
# command line, check the password file.
- if $autoenable {
+ if $avautoenable {
+ set autoenable 1
+ set enable 0
set prompt "#"
} else {
set ae [find autoenable $router]
@@ -496,15 +511,15 @@ foreach router [lrange $argv $i end] {
if { $do_passwd || $do_enapasswd } {
set pswd [find password $router]
if { [llength $pswd] == 0 } {
- send_user "Error - no password for $router in $password_file.\n"
+ send_user "\nError - no password for $router in $password_file.\n"
continue
}
if { $do_enapasswd && $autoenable == 0 && [llength $pswd] < 2 } {
- send_user "Error - no enable password for $router in $password_file.\n"
+ send_user "\nError - no enable password for $router in $password_file.\n"
continue
}
- set passwd [lindex $pswd 0]
- set enapasswd [lindex $pswd 1]
+ set passwd [join [lindex $pswd 0] ""]
+ set enapasswd [join [lindex $pswd 1] ""]
}
# Figure out username
@@ -512,7 +527,7 @@ foreach router [lrange $argv $i end] {
# command line username
set ruser $username
} else {
- set ruser [find user $router]
+ set ruser [join [find user $router] ""]
if { "$ruser" == "" } { set ruser $default_user }
}
@@ -521,7 +536,7 @@ foreach router [lrange $argv $i end] {
# command line username
set userpswd $userpasswd
} else {
- set userpswd [find userpassword $router]
+ set userpswd [join [find userpassword $router] ""]
if { "$userpswd" == "" } { set userpswd $passwd }
}
@@ -530,7 +545,7 @@ foreach router [lrange $argv $i end] {
# command line enausername
set enauser $enausername
} else {
- set enauser [find enauser $router]
+ set enauser [join [find enauser $router] ""]
if { "$enauser" == "" } { set enauser $ruser }
}
@@ -539,19 +554,19 @@ foreach router [lrange $argv $i end] {
if { "$u_prompt" == "" } {
set u_prompt "(Username|login|user name):"
} else {
- set u_prompt [lindex $u_prompt 0]
+ set u_prompt [join [lindex $u_prompt 0] ""]
}
set p_prompt [find passprompt $router]
if { "$p_prompt" == "" } {
set p_prompt "(\[Pp]assword|passwd):"
} else {
- set p_prompt [lindex $p_prompt 0]
+ set p_prompt [join [lindex $p_prompt 0] ""]
}
set e_prompt [find enableprompt $router]
if { "$e_prompt" == "" } {
set e_prompt "\[Pp]assword:"
} else {
- set e_prompt [lindex $e_prompt 0]
+ set e_prompt [join [lindex $e_prompt 0] ""]
}
# Figure out cypher type
@@ -567,6 +582,10 @@ foreach router [lrange $argv $i end] {
set cmethod [find method $router]
if { "$cmethod" == "" } { set cmethod {{telnet}} }
+ # Figure out the SSH executable name
+ set sshcmd [find sshcmd $router]
+ if { "$sshcmd" == "" } { set sshcmd {ssh} }
+
# Login to the router
if {[login $router $ruser $userpswd $passwd $enapasswd $prompt $cmethod $cyphertype]} {
continue
diff --git a/bin/brancid.in b/bin/brancid.in
index 2ea7e3b..c2e602e 100644
--- a/bin/brancid.in
+++ b/bin/brancid.in
@@ -1,20 +1,23 @@
-#!@PERLV_PATH@
+#! @PERLV_PATH@
##
+## $Id: brancid.in,v 1.16 2004/01/11 03:49:13 heas Exp $
## hacked version of Hank's rancid - this one tries to deal with Bay's.
##
-## Copyright (C) 1997-2001 by Henry Kilmer.
+## Copyright (C) 1997-2004 by Terrapin Communications, Inc.
## All rights reserved.
##
-## This software may be freely copied, modified and redistributed without
-## fee for non-commerical purposes provided that this copyright notice is
-## preserved intact on all copies and modified copies.
+## This software may be freely copied, modified and redistributed
+## without fee for non-commerical purposes provided that this license
+## remains intact and unmodified with any RANCID distribution.
##
## There is no warranty or other guarantee of fitness of this software.
-## It is provided solely "as is". The author(s) disclaim(s) all
+## It is provided solely "as is". The author(s) disclaim(s) all
## responsibility and liability with respect to this software's usage
## or its effect upon hardware, computer systems, other software, or
## anything else.
##
+## Except where noted otherwise, rancid was written by and is maintained by
+## Henry Kilmer, John Heasley, Andrew Partan, Pete Whiting, and Austin Schutz.
##
#
# RANCID - Really Awesome New Cisco confIg Differ
@@ -22,7 +25,7 @@
# usage: rancid [-d] [-l] [-f filename | $host]
#
use Getopt::Std;
-getopts('dflm');
+getopts('dfl');
$log = $opt_l;
$debug = $opt_d;
$file = $opt_f;
@@ -246,7 +249,8 @@ TOP: while(<INPUT>) {
$cmd = $1;
if (!defined($prompt)) {
$prompt = ($_ =~ /^([^>]+>)/)[0];
- $prompt =~ s/([][])/\\$1/g;
+ $prompt =~ s/([][}{)(\\])/\\$1/g;
+ print STDERR ("PROMPT MATCH: $prompt\n") if ($debug);
}
print STDERR ("HIT COMMAND:$_") if ($debug);
if (! defined($commands{$cmd})) {
diff --git a/bin/cat5rancid.in b/bin/cat5rancid.in
index c8219d8..f1214a1 100755..100644
--- a/bin/cat5rancid.in
+++ b/bin/cat5rancid.in
@@ -1,19 +1,22 @@
-#!@PERLV_PATH@
+#! @PERLV_PATH@
##
+## $Id: cat5rancid.in,v 1.36 2004/01/11 03:49:13 heas Exp $
##
-## Copyright (C) 1997-2001 by Henry Kilmer.
+## Copyright (C) 1997-2004 by Terrapin Communications, Inc.
## All rights reserved.
##
-## This software may be freely copied, modified and redistributed without
-## fee for non-commerical purposes provided that this copyright notice is
-## preserved intact on all copies and modified copies.
+## This software may be freely copied, modified and redistributed
+## without fee for non-commerical purposes provided that this license
+## remains intact and unmodified with any RANCID distribution.
##
## There is no warranty or other guarantee of fitness of this software.
-## It is provided solely "as is". The author(s) disclaim(s) all
+## It is provided solely "as is". The author(s) disclaim(s) all
## responsibility and liability with respect to this software's usage
## or its effect upon hardware, computer systems, other software, or
## anything else.
##
+## Except where noted otherwise, rancid was written by and is maintained by
+## Henry Kilmer, John Heasley, Andrew Partan, Pete Whiting, and Austin Schutz.
##
#
# RANCID - Really Awesome New Cisco confIg Differ
@@ -21,7 +24,7 @@
# usage: rancid [-d] [-l] [-f filename | $host]
#
use Getopt::Std;
-getopts('dflm');
+getopts('dfl');
$log = $opt_l;
$debug = $opt_d;
$file = $opt_f;
@@ -783,7 +786,7 @@ sub ShowPortIfindex {
}
}
-# This routine processes a "write term"
+# This routine processes a "write term {all}"
sub WriteTerm {
print STDERR " In WriteTerm: $_" if ($debug);
@@ -791,7 +794,10 @@ sub WriteTerm {
while (<INPUT>) {
tr/\015//d;
last if (/^$prompt/);
+ last if (/^Unknown host /); # error when write term all
+ # is not supported
next if (/^\.+$/ | /^$/);
+ return(0) if ($found_end);
/Non-Volatile memory is in use/ && return(-1); # NvRAM is locked
# skip the crap
next if (/^This command shows non-default configurations only./i);
@@ -862,6 +868,7 @@ sub WriteTerm {
next;
}
/fair-queue individual-limit/ && next;
+ /^set port security \d+\/\d+ \S+-\S+\-/ && next;
# sort ip explicit-paths.
if (/^ip explicit-path name (\S+)/) {
my($key) = $1;
@@ -995,6 +1002,7 @@ sub DoNothing {print STDOUT;}
'dir sup-microcode:' => "DirSlotN",
'show module' => "ShowModule",
'show port ifindex' => "ShowPortIfindex",
+ 'write term all' => "WriteTerm",
'write term' => "WriteTerm"
);
# keys() doesnt return things in the order entered and the order of the
@@ -1010,6 +1018,7 @@ sub DoNothing {print STDOUT;}
"dir sup-microcode:",
"show module",
"show port ifindex",
+ "write term all",
"write term"
);
$cisco_cmds=join(";",@commands);
@@ -1062,7 +1071,11 @@ TOP: while(<INPUT>) {
}
while (/> \(enable\)\s*($cmds_regexp)\s*$/) {
$cmd = $1;
- if (!defined($prompt)) {$prompt = ($_ =~ /^([^>]+>)/)[0]; }
+ if (!defined($prompt)) {
+ $prompt = ($_ =~ /^([^>]+>)/)[0];
+ $prompt =~ s/([][}{)(\\])/\\$1/g;
+ print STDERR ("PROMPT MATCH: $prompt\n") if ($debug);
+ }
print STDERR ("HIT COMMAND:$_") if ($debug);
if (! defined($commands{$cmd})) {
print STDERR "$host: found unexpected command - \"$cmd\"\n";
diff --git a/bin/clogin.in b/bin/clogin.in
index c026699..281d634 100755..100644
--- a/bin/clogin.in
+++ b/bin/clogin.in
@@ -1,21 +1,26 @@
-#!@EXPECT_PATH@ --
+#! @EXPECT_PATH@ --
##
+## $Id: clogin.in,v 1.72 2004/01/11 05:39:15 heas Exp $
##
-## Copyright (C) 1997-2001 by Henry Kilmer, Erik Sherk and Pete Whiting.
+## Copyright (C) 1997-2004 by Terrapin Communications, Inc.
## All rights reserved.
##
-## This software may be freely copied, modified and redistributed without
-## fee for non-commerical purposes provided that this copyright notice is
-## preserved intact on all copies and modified copies.
+## This software may be freely copied, modified and redistributed
+## without fee for non-commerical purposes provided that this license
+## remains intact and unmodified with any RANCID distribution.
##
## There is no warranty or other guarantee of fitness of this software.
-## It is provided solely "as is". The author(s) disclaim(s) all
+## It is provided solely "as is". The author(s) disclaim(s) all
## responsibility and liability with respect to this software's usage
## or its effect upon hardware, computer systems, other software, or
## anything else.
##
+## Except where noted otherwise, rancid was written by and is maintained by
+## Henry Kilmer, John Heasley, Andrew Partan, Pete Whiting, and Austin Schutz.
##
#
+# The login expect scripts were based on Erik Sherk's gwtn, by permission.
+#
# clogin - Cisco login
#
# Most options are intuitive for logging into a Cisco router.
@@ -43,8 +48,9 @@ set do_command 0
set do_script 0
# The default is to automatically enable
set enable 1
-# The default is that you login non-enabled (tacacs can have you login already enabled)
-set autoenable 0
+# The default is that you login non-enabled (tacacs can have you login already
+# enabled)
+set avautoenable 0
# The default is to look in the password file to find the passwords. This
# tracks if we receive them on the command line.
set do_passwd 1
@@ -57,6 +63,8 @@ if {[ info exists env(CISCO_USER) ] } {
set default_user $env(CISCO_USER)
} elseif {[ info exists env(USER) ]} {
set default_user $env(USER)
+} elseif {[ info exists env(LOGNAME) ]} {
+ set default_user $env(LOGNAME)
} else {
# This uses "id" which I think is portable. At least it has existed
# (without options) on all machines/OSes I've been on recently -
@@ -112,7 +120,7 @@ for {set i 0} {$i < $argc} {incr i} {
if {[ regexp .\[E\](.+)=(.+) $arg ignore varname varvalue]} {
set E$varname $varvalue
} else {
- send_user "Error: invalid format for -E in $arg\n"
+ send_user "\nError: invalid format for -E in $arg\n"
exit 1
}
# Enable Password
@@ -184,7 +192,7 @@ for {set i 0} {$i < $argc} {incr i} {
set enable 0
# Does tacacs automatically enable us?
} -autoenable {
- set autoenable 1
+ set avautoenable 1
set enable 0
} -* {
send_user "\nError: Unknown argument! $arg\n"
@@ -280,7 +288,7 @@ proc source_password_file { password_file } {
# Log into the router.
proc login { router user userpswd passwd enapasswd cmethod cyphertype } {
global spawn_id in_proc do_command do_script platform
- global prompt u_prompt p_prompt e_prompt
+ global prompt u_prompt p_prompt e_prompt sshcmd
set in_proc 1
set uprompt_seen 0
@@ -299,8 +307,8 @@ proc login { router user userpswd passwd enapasswd cmethod cyphertype } {
exit 1
}
} elseif ![string compare $prog "ssh"] {
- if [ catch {spawn ssh -c $cyphertype -x -l $user $router} reason ] {
- send_user "\nError: ssh failed: $reason\n"
+ if [ catch {spawn $sshcmd -c $cyphertype -x -l $user $router} reason ] {
+ send_user "\nError: $sshcmd failed: $reason\n"
exit 1
}
} elseif ![string compare $prog "rsh"] {
@@ -344,24 +352,32 @@ proc login { router user userpswd passwd enapasswd cmethod cyphertype } {
# then it will just send the passwd.
# if telnet fails with connection refused, try ssh
expect {
- -re "(Connection refused|Secure connection \[^\n\r]+ refused|Connection closed by)" {
+ -re "(Connection refused|Secure connection \[^\n\r]+ refused)" {
+ catch {close}; wait
+ if !$progs {
+ send_user "\nError: Connection Refused ($prog): $router\n"
+ return 1
+ }
+ }
+ -re "(Connection closed by|Connection to \[^\n\r]+ closed)" {
catch {close}; wait
if !$progs {
- send_user "\nError: Connection Refused ($prog)\n"; return 1
+ send_user "\nError: Connection closed ($prog): $router\n"
+ return 1
}
}
- eof { send_user "\nError: Couldn't login\n"; wait; return 1 }
+ eof { send_user "\nError: Couldn't login: $router\n"; wait; return 1 }
-nocase "unknown host\r" {
catch {close};
- send_user "\nError: Unknown host\n"; wait; return 1
+ send_user "\nError: Unknown host $router\n"; wait; return 1
}
"Host is unreachable" {
catch {close};
- send_user "\nError: Host Unreachable!\n"; wait; return 1
+ send_user "\nError: Host Unreachable: $router\n"; wait; return 1
}
"No address associated with name" {
catch {close};
- send_user "\nError: Unknown host\n"; wait; return 1
+ send_user "\nError: Unknown host $router\n"; wait; return 1
}
-re "(Host key not found |The authenticity of host .* be established).*\(yes\/no\)\?" {
send "yes\r"
@@ -387,6 +403,12 @@ proc login { router user userpswd passwd enapasswd cmethod cyphertype } {
send_user "\nError: Check your passwd for $router\n"
return 1
}
+ -re "^Enter Selection: " {
+ # Catalyst 1900s have some lame menu. Enter
+ # K to reach a command-line.
+ send "K\r"
+ exp_continue;
+ }
-re "@\[^\r\n]+ $p_prompt" {
# ssh pwd prompt
sleep 1
@@ -407,9 +429,9 @@ proc login { router user userpswd passwd enapasswd cmethod cyphertype } {
}
exp_continue
}
- "$prompt" { break; }
+ -re "$prompt" { break; }
"Login invalid" {
- send_user "\nError: Invalid login\n";
+ send_user "\nError: Invalid login: $router\n";
catch {close}; wait; return 1
}
}
@@ -431,10 +453,19 @@ proc do_enable { enauser enapasswd } {
-re "$e_prompt" { send "$enapasswd\r"; exp_continue}
"#" { set prompt "#" }
"(enable)" { set prompt "> (enable) " }
- denied { send_user "\nError: Check your Enable passwd\n"; return 1}
- "% Bad passwords" { send_user "\nError: Check your Enable passwd\n"
- return 1
- }
+ "denied" {
+ # % Access denied - from local auth
+ send_user "\nError: Check your Enable passwd\n";
+ return 1
+ }
+ "% Error in authentication" {
+ send_user "\nError: Check your Enable passwd\n"
+ return 1
+ }
+ "% Bad passwords" {
+ send_user "\nError: Check your Enable passwd\n"
+ return 1
+ }
}
# We set the prompt variable (above) so script files don't need
# to know what it is.
@@ -449,16 +480,19 @@ proc run_commands { prompt command } {
# If the prompt is (enable), then we are on a switch and the
# command is "set length 0"; otherwise its "term length 0".
- # skip if its an extreme.
+ # skip if its an extreme (since the pager can not be disabled on a
+ # per-vty basis).
if { [ string compare "extreme" "$platform" ] } {
if [ regexp -- ".*> .*enable" "$prompt" ] {
send "set length 0\r"
} else {
send "term length 0\r"
}
- regsub -all "\[)(]" $prompt {\\&} reprompt
- # match cisco config mode prompts too, but not for catalyst ie: (enable)
- regsub -all "\[#>]$" $reprompt {(\\([^\\r\\n]+\\))?&} reprompt
+ # escape any parens in the prompt, such as "(enable)"
+ regsub -all {[)(]} $prompt {\\&} reprompt
+ # match cisco config mode prompts too, such as router(config-if)#,
+ # but catalyst does not change in this fashion.
+ regsub -all {^(.{1,14}).*([#>])$} $reprompt {\1([^#>\r\n]+)?[#>](\\([^)\\r\\n]+\\))?} reprompt
expect {
-re $reprompt {}
-re "\[\n\r]+" { exp_continue }
@@ -466,6 +500,7 @@ proc run_commands { prompt command } {
} else {
regsub -all "\[)(]" $prompt {\\&} reprompt
}
+
# this is the only way i see to get rid of more prompts in o/p..grrrrr
log_user 0
# Is this a multi-command?
@@ -540,11 +575,18 @@ proc run_commands { prompt command } {
send "quit\r"
}
expect {
+ -re "^\[^\n\r *]*$reprompt" {
+ # the Cisco CE and Jnx ERX
+ # return to non-enabled mode
+ # on exit in enabled mode.
+ send "exit\r"
+ exp_continue;
+ }
"Do you wish to save your configuration changes" {
send "n\r"
exp_continue
}
- "\n" { exp_continue }
+ -re "\[\n\r]+" { exp_continue }
timeout { return 0 }
eof { return 0 }
}
@@ -564,14 +606,16 @@ foreach router [lrange $argv $i end] {
# Since autoenable is off by default, if we have it defined, it
# was done on the command line. If it is not specifically set on the
# command line, check the password file.
- if $autoenable {
- set prompt "#"
+ if $avautoenable {
+ set autoenable 1
+ set enable 0
+ set prompt "(#| \\(enable\\))"
} else {
set ae [find autoenable $router]
if { "$ae" == "1" } {
set autoenable 1
set enable 0
- set prompt "#"
+ set prompt "(#| \\(enable\\))"
} else {
set autoenable 0
set prompt ">"
@@ -587,15 +631,15 @@ foreach router [lrange $argv $i end] {
if { $do_passwd || $do_enapasswd } {
set pswd [find password $router]
if { [llength $pswd] == 0 } {
- send_user "Error: no password for $router in $password_file.\n"
+ send_user "\nError: no password for $router in $password_file.\n"
continue
}
if { $enable && $do_enapasswd && $autoenable == 0 && [llength $pswd] < 2 } {
- send_user "Error: no enable password for $router in $password_file.\n"
+ send_user "\nError: no enable password for $router in $password_file.\n"
continue
}
- set passwd [lindex $pswd 0]
- set enapasswd [lindex $pswd 1]
+ set passwd [join [lindex $pswd 0] ""]
+ set enapasswd [join [lindex $pswd 1] ""]
}
# Figure out username
@@ -603,7 +647,7 @@ foreach router [lrange $argv $i end] {
# command line username
set ruser $username
} else {
- set ruser [find user $router]
+ set ruser [join [find user $router] ""]
if { "$ruser" == "" } { set ruser $default_user }
}
@@ -612,7 +656,7 @@ foreach router [lrange $argv $i end] {
# command line username
set userpswd $userpasswd
} else {
- set userpswd [find userpassword $router]
+ set userpswd [join [find userpassword $router] ""]
if { "$userpswd" == "" } { set userpswd $passwd }
}
@@ -621,7 +665,7 @@ foreach router [lrange $argv $i end] {
# command line enausername
set enauser $enausername
} else {
- set enauser [find enauser $router]
+ set enauser [join [find enauser $router] ""]
if { "$enauser" == "" } { set enauser $ruser }
}
@@ -630,34 +674,38 @@ foreach router [lrange $argv $i end] {
if { "$u_prompt" == "" } {
set u_prompt "(Username|Login|login|user name):"
} else {
- set u_prompt [lindex $u_prompt 0]
+ set u_prompt [join [lindex $u_prompt 0] ""]
}
set p_prompt [find passprompt $router]
if { "$p_prompt" == "" } {
set p_prompt "(\[Pp]assword|passwd):"
} else {
- set p_prompt [lindex $p_prompt 0]
+ set p_prompt [join [lindex $p_prompt 0] ""]
}
set e_prompt [find enableprompt $router]
if { "$e_prompt" == "" } {
set e_prompt "\[Pp]assword:"
} else {
- set e_prompt [lindex $e_prompt 0]
+ set e_prompt [join [lindex $e_prompt 0] ""]
}
# Figure out cypher type
if {[info exists cypher]} {
- # command line cypher type
- set cyphertype $cypher
+ # command line cypher type
+ set cyphertype $cypher
} else {
- set cyphertype [find cyphertype $router]
- if { "$cyphertype" == "" } { set cyphertype "3des" }
+ set cyphertype [find cyphertype $router]
+ if { "$cyphertype" == "" } { set cyphertype "3des" }
}
# Figure out connection method
set cmethod [find method $router]
if { "$cmethod" == "" } { set cmethod {{telnet} {ssh}} }
+ # Figure out the SSH executable name
+ set sshcmd [find sshcmd $router]
+ if { "$sshcmd" == "" } { set sshcmd {ssh} }
+
# Login to the router
if {[login $router $ruser $userpswd $passwd $enapasswd $cmethod $cyphertype]} {
continue
@@ -675,16 +723,20 @@ foreach router [lrange $argv $i end] {
expect {
-re "\[\r\n]+" { exp_continue; }
-re "^(.+:)1 $prompt" { # stoopid extreme cmd-line numbers and
- # prompt based on state of config changes
+ # prompt based on state of config changes,
+ # which may have an * at the beginning.
set junk $expect_out(1,string)
regsub -all "^\\\* " $expect_out(1,string) {} junk
- set prompt ".? ?$junk\[0-9]+ $prompt";
+ set prompt ".? ?$junk\[0-9]+ $expect_out(2,string)";
set platform "extreme"
}
-re "^.+$prompt" { set junk $expect_out(0,string);
- regsub -all "\[\]\[]" $junk {\\&} prompt; }
- -re "^.+> \\\(enable\\\)" { set junk $expect_out(0,string);
- regsub -all "\[\]\[]" $junk {\\&} prompt; }
+ regsub -all "\[\]\[]" $junk {\\&} prompt;
+ }
+ -re "^.+> \\\(enable\\\)" {
+ set junk $expect_out(0,string);
+ regsub -all "\[\]\[]" $junk {\\&} prompt;
+ }
}
if { $do_command } {
diff --git a/bin/control_rancid.in b/bin/control_rancid.in
index 42f14ae..f51a21b 100755..100644
--- a/bin/control_rancid.in
+++ b/bin/control_rancid.in
@@ -1,19 +1,22 @@
-#!/bin/sh
+#! /bin/sh
##
+## $Id: control_rancid.in,v 1.61 2004/01/11 05:25:13 hank Exp $
##
-## Copyright (C) 1996-2001 by Henry Kilmer.
+## Copyright (C) 1997-2004 by Terrapin Communications, Inc.
## All rights reserved.
##
-## This software may be freely copied, modified and redistributed without
-## fee for non-commerical purposes provided that this copyright notice is
-## preserved intact on all copies and modified copies.
+## This software may be freely copied, modified and redistributed
+## without fee for non-commerical purposes provided that this license
+## remains intact and unmodified with any RANCID distribution.
##
## There is no warranty or other guarantee of fitness of this software.
-## It is provided solely "as is". The author(s) disclaim(s) all
+## It is provided solely "as is". The author(s) disclaim(s) all
## responsibility and liability with respect to this software's usage
## or its effect upon hardware, computer systems, other software, or
## anything else.
##
+## Except where noted otherwise, rancid was written by and is maintained by
+## Henry Kilmer, John Heasley, Andrew Partan, Pete Whiting, and Austin Schutz.
##
#
# control_rancid $GROUP
@@ -80,6 +83,7 @@ trap 'rm -fr $TMP;' 1 2 15
# the receipient(s) of diffs
mailrcpt=${mailrcpt:-"@MAILPLUS@$GROUP"}; export mailrcpt
+adminmailrcpt=${mailrcpt:-"@ADMINMAILPLUS@$GROUP"}; export adminmailrcpt
# Number of things par should run in parallel.
PAR_COUNT=${PAR_COUNT:-5}
@@ -88,14 +92,14 @@ PAR_COUNT=${PAR_COUNT:-5}
if [ ! -d $DIR ]
then
echo "$DIR does not exist."
- echo "Run bin/create_cvs $GROUP to make all of the needed directories."
+ echo "Run bin/rancid-cvs $GROUP to make all of the needed directories."
(
- echo "To: @MAILPLUS@admin-$GROUP"
+ echo "To: $adminmailrcpt"
echo "Subject: no $GROUP directory"
echo "Precedence: bulk"
echo ""
echo "$DIR does not exist."
- echo "Run bin/create_cvs $GROUP to make all of the needed directories."
+ echo "Run bin/rancid-cvs $GROUP to make all of the needed directories."
) | sendmail -t
exit 1
fi
@@ -116,7 +120,7 @@ rm -f $TMP
if [ ! -f $DIR/router.db ]
then
(
- echo "To: @MAILPLUS@admin-$GROUP"
+ echo "To: $adminmailrcpt"
echo "Subject: no $GROUP/router.db file"
echo "Precedence: bulk"
echo ""
@@ -132,16 +136,17 @@ fi
cd $DIR
trap 'rm -fr routers.db routers.all.new routers.down.new routers.up.new \
routers.mail routers.added routers.deleted $TMP;' 1 2 15
-grep -v '^#' router.db > routers.db
-cut -d: -f1,2 routers.db | sort -u > routers.all.new
+sed -e '/^#/d' -e 's/^ *//' -e 's/ *$//' -e 's/ *: */:/g' router.db |
+ sort -u > routers.db
+cut -d: -f1,2 routers.db > routers.all.new
if [ ! -f routers.all ] ; then touch routers.all; fi
diff routers.all routers.all.new > /dev/null 2>&1; RALL=$?
@PERLV@ -F: -ane '{($F[0] =~ tr@A-Z@a-z@,print $_)
- if ($F[2] !~ /^up$/i);}' routers.db | sort -u > routers.down.new
+ if ($F[2] !~ /^up$/i);}' routers.db > routers.down.new
if [ ! -f routers.down ] ; then touch routers.down; fi
diff routers.down routers.down.new > /dev/null 2>&1; RDOWN=$?
@PERLV@ -F: -ane '{($F[0] =~ tr@A-Z@a-z@,print "$F[0]:$F[1]\n")
- if ($F[2] =~ /^up$/i);}' routers.db | sort -u > routers.up.new
+ if ($F[2] =~ /^up$/i);}' routers.db > routers.up.new
if [ ! -f routers.up ] ; then touch routers.up; fi
diff routers.up routers.up.new > /dev/null 2>&1; RUP=$?
@@ -207,7 +212,7 @@ then
if [ -s routers.mail ] ; then
(
- echo "To: @MAILPLUS@admin-$GROUP"
+ echo "To: $adminmailrcpt"
echo "Subject: changes in $GROUP routers"
echo "Precedence: bulk"
echo ""
@@ -236,9 +241,18 @@ then
cd $DIR
fi
-mv routers.all.new routers.all
-mv routers.down.new routers.down
-mv routers.up.new routers.up
+mv -f routers.all.new routers.all
+if [ $? -ne 0 ]; then
+ echo "Error: could not rename routers.all.new"
+fi
+mv -f routers.down.new routers.down
+if [ $? -ne 0 ]; then
+ echo "Error: could not rename routers.down.new"
+fi
+mv -f routers.up.new routers.up
+if [ $? -ne 0 ]; then
+ echo "Error: could not rename routers.up.new"
+fi
rm -f routers.db
trap 'rm -fr $TMP;' 1 2 15
@@ -290,6 +304,7 @@ cd $DIR/configs
# The number of processes running at any given time can be
# tailored to the specific installation.
+echo ""
echo "Trying to get all of the configs."
par -q -n $PAR_COUNT -c "rancid-fe \{}" $devlistfile
@@ -331,19 +346,27 @@ do
done
echo
-# Make sure that all of the new configs are not empty.
-for config in *.new
-do
- if [ ! -s $config ]
+# Make sure that no empty configs are accepted. Those that are non-empty
+# are renamed from device_name.new -> device_name.
+for router in `cat $devlistfile`
+do
+ OFS=$IFS
+ IFS=':'
+ set $router
+ IFS=$OFS
+ router=$1;
+
+ if [ ! -s $router.new ]
then
- rm -f $config
+ rm -f $router.new
+ else
+ mv $router.new $router
+ if [ $? -ne 0 ]; then
+ echo "Error: could not rename $router.new to $router"
+ fi
fi
done
-# Now that we have the new configs, rename them to their proper
-# name.
-rename 's/.new$//' *.new
-
# This has been different for different machines...
# Diff the directory and then checkin.
trap 'rm -fr $TMP $TMP.diff $DIR/routers.single;' 1 2 15
@@ -387,7 +410,7 @@ fi
if [ -s $DIR/routers.failed ]
then
(
- echo "To: @MAILPLUS@admin-$GROUP"
+ echo "To: $adminmailrcpt"
echo "Subject: config fetcher problems - $GROUP"
echo "Precedence: bulk"
echo ""
diff --git a/bin/cssrancid.in b/bin/cssrancid.in
new file mode 100644
index 0000000..27049df
--- /dev/null
+++ b/bin/cssrancid.in
@@ -0,0 +1,660 @@
+#! @PERLV_PATH@
+##
+## $Id: cssrancid.in,v 1.4 2004/01/11 03:49:13 heas Exp $
+##
+## Copyright (C) 1997-2004 by Terrapin Communications, Inc.
+## All rights reserved.
+##
+## This software may be freely copied, modified and redistributed
+## without fee for non-commerical purposes provided that this license
+## remains intact and unmodified with any RANCID distribution.
+##
+## There is no warranty or other guarantee of fitness of this software.
+## It is provided solely "as is". The author(s) disclaim(s) all
+## responsibility and liability with respect to this software's usage
+## or its effect upon hardware, computer systems, other software, or
+## anything else.
+##
+## Except where noted otherwise, rancid was written by and is maintained by
+## Henry Kilmer, John Heasley, Andrew Partan, Pete Whiting, and Austin Schutz.
+##
+#
+# RANCID - Really Awesome New Cisco confIg Differ
+#
+# usage: rancid [-d] [-l] [-f filename | $host]
+#
+use Getopt::Std;
+getopts('dfl');
+$log = $opt_l;
+$debug = $opt_d;
+$file = $opt_f;
+$host = $ARGV[0];
+$clean_run = 0;
+$found_end = 0;
+$timeo = 90; # clogin timeout in seconds
+
+my(%filter_pwds); # password filtering mode
+
+# This routine is used to print out the router configuration
+sub ProcessHistory {
+ my($new_hist_tag,$new_command,$command_string,@string)=(@_);
+ if((($new_hist_tag ne $hist_tag) || ($new_command ne $command))
+ && defined %history) {
+ print eval "$command \%history";
+ undef %history;
+ }
+ if (($new_hist_tag) && ($new_command) && ($command_string)) {
+ if ($history{$command_string}) {
+ $history{$command_string} = "$history{$command_string}@string";
+ } else {
+ $history{$command_string} = "@string";
+ }
+ } elsif (($new_hist_tag) && ($new_command)) {
+ $history{++$#history} = "@string";
+ } else {
+ print "@string";
+ }
+ $hist_tag = $new_hist_tag;
+ $command = $new_command;
+ 1;
+}
+
+sub numerically { $a <=> $b; }
+
+# This is a sort routine that will sort numerically on the
+# keys of a hash as if it were a normal array.
+sub keynsort {
+ local(%lines)=@_;
+ local($i) = 0;
+ local(@sorted_lines);
+ foreach $key (sort numerically keys(%lines)) {
+ $sorted_lines[$i] = $lines{$key};
+ $i++;
+ }
+ @sorted_lines;
+}
+
+# This is a sort routine that will sort on the
+# keys of a hash as if it were a normal array.
+sub keysort {
+ local(%lines)=@_;
+ local($i) = 0;
+ local(@sorted_lines);
+ foreach $key (sort keys(%lines)) {
+ $sorted_lines[$i] = $lines{$key};
+ $i++;
+ }
+ @sorted_lines;
+}
+
+# This is a sort routine that will sort on the
+# values of a hash as if it were a normal array.
+sub valsort{
+ local(%lines)=@_;
+ local($i) = 0;
+ local(@sorted_lines);
+ foreach $key (sort values %lines) {
+ $sorted_lines[$i] = $key;
+ $i++;
+ }
+ @sorted_lines;
+}
+
+# This is a numerical sort routine (ascending).
+sub numsort {
+ local(%lines)=@_;
+ local($i) = 0;
+ local(@sorted_lines);
+ foreach $num (sort {$a <=> $b} keys %lines) {
+ $sorted_lines[$i] = $lines{$num};
+ $i++;
+ }
+ @sorted_lines;
+}
+
+# This is a sort routine that will sort on the
+# ip address when the ip address is anywhere in
+# the strings.
+sub ipsort {
+ local(%lines)=@_;
+ local($i) = 0;
+ local(@sorted_lines);
+ foreach $addr (sort sortbyipaddr keys %lines) {
+ $sorted_lines[$i] = $lines{$addr};
+ $i++;
+ }
+ @sorted_lines;
+}
+
+# These two routines will sort based upon IP addresses
+sub ipaddrval {
+ my(@a) = ($_[0] =~ m#^(\d+)\.(\d+)\.(\d+)\.(\d+)$#);
+ $a[3]+256*($a[2]+256*($a[1]+256*$a[0]));
+}
+sub sortbyipaddr {
+ &ipaddrval($a) <=> &ipaddrval($b);
+}
+
+# This routine parses "show version"
+sub ShowVersion {
+ print STDERR " In ShowVersion: $_" if ($debug);
+
+ while (<INPUT>) {
+ tr/\015//d;
+ study;
+ last if(/^$prompt/);
+ next if(/^(\s*|\s*$cmd\s*)$/);
+ return(-1) if (/command authorization failed/i);
+ if (/^Slave in slot (\d+) is running/) {
+ $slave = " Slave:";
+ next;
+ }
+ /^Cisco Secure PIX /i &&
+ ProcessHistory("COMMENTS","keysort","F1", "!Image: $_") && next;
+ /^IOS .* Software \(([A-Za-z-0-9]*)\), .*Version\s+(.*)$/ &&
+ ProcessHistory("COMMENTS","keysort","F1",
+ "!Image:$slave Software: $1, $2\n") && next;
+ /^([A-Za-z-0-9_]*) Synced to mainline version: (.*)$/ &&
+ ProcessHistory("COMMENTS","keysort","F2",
+ "!Image:$slave $1 Synced to mainline version: $2\n") && next;
+ /^Compiled (.*)$/ &&
+ ProcessHistory("COMMENTS","keysort","F3",
+ "!Image:$slave Compiled: $1\n") && next;
+ /^ROM: (System )?Bootstrap.*(Version.*)$/ &&
+ ProcessHistory("COMMENTS","keysort","G1",
+ "!ROM Bootstrap: $2\n") && next;
+ if (/^Hardware:\s+(.*), (.* RAM), CPU (.*)$/) {
+ ProcessHistory("COMMENTS","keysort","A1",
+ "!Chassis type: $1 - a PIX\n");
+ ProcessHistory("COMMENTS","keysort","A2",
+ "!CPU: $3\n");
+ ProcessHistory("COMMENTS","keysort","B1", "!Memory: $2\n");
+ }
+ /^Serial Number:\s+(.*)$/ &&
+ ProcessHistory("COMMENTS","keysort","C1", "!$_") && next;
+ /^Activation Key:\s+(.*)$/ &&
+ ProcessHistory("COMMENTS","keysort","C2", "!$_") && next;
+ /^ROM: \d+ Bootstrap .*(Version.*)$/ &&
+ ProcessHistory("COMMENTS","keysort","G2",
+ "!ROM Image: Bootstrap $1\n!\n") && next;
+ /^ROM: .*(Version.*)$/ &&
+ ProcessHistory("COMMENTS","keysort","G3","!ROM Image: $1\n") && next;
+ /^BOOTFLASH: .*(Version.*)$/ &&
+ ProcessHistory("COMMENTS","keysort","G4","!BOOTFLASH: $1\n") && next;
+ /^BOOTLDR: .*(Version.*)$/ &&
+ ProcessHistory("COMMENTS","keysort","G4","!BOOTLDR: $1\n") && next;
+ /^System image file is "([^\"]*)", booted via (\S*)/ &&
+ ProcessHistory("COMMENTS","keysort","F4","!Image: booted $1\n") &&
+ next;
+ /^System image file is "([^\"]*)"$/ &&
+ ProcessHistory("COMMENTS","keysort","F5","!Image: $1\n") && next;
+ if (/(\S+)\s+\((\S+)\)\s+processor.*with (\S+[kK]) bytes/) {
+ my($proc) = $1;
+ my($cpu) = $2;
+ my($mem) = $3;
+ my($device) = "router";
+ $type = "CSS";
+ print STDERR "TYPE = $type\n" if ($debug);
+ ProcessHistory("COMMENTS","keysort","A1",
+ "!Chassis type:$slave $proc - a $type $device\n");
+ ProcessHistory("COMMENTS","keysort","B1",
+ "!Memory:$slave main $mem\n");
+ ProcessHistory("COMMENTS","keysort","A3","!CPU:$slave $cpu\n");
+ next;
+ }
+ if (/(\S+) Silicon\s*Switch Processor/) {
+ if (!defined($C0)) {
+ $C0=1; ProcessHistory("COMMENTS","keysort","C0","!\n");
+ }
+ ProcessHistory("COMMENTS","keysort","C2","!SSP: $1\n");
+ $ssp = 1;
+ $sspmem = $1;
+ next;
+ }
+ /^(\d+[kK]) bytes of multibus/ &&
+ ProcessHistory("COMMENTS","keysort","B2",
+ "!Memory: multibus $1\n") && next;
+ /^(\d+[kK]) bytes of non-volatile/ &&
+ ProcessHistory("COMMENTS","keysort","B3",
+ "!Memory: nvram $1\n") && next;
+ /^(\d+[kK]) bytes of flash memory/ &&
+ ProcessHistory("COMMENTS","keysort","B5","!Memory: flash $1\n") &&
+ next;
+ /^(\d+[kK]) bytes of .*flash partition/ &&
+ ProcessHistory("COMMENTS","keysort","B6",
+ "!Memory: flash partition $1\n") && next;
+ /^(\d+[kK]) bytes of Flash internal/ &&
+ ProcessHistory("COMMENTS","keysort","B4",
+ "!Memory: bootflash $1\n") && next;
+ if(/^(\d+[kK]) bytes of (Flash|ATA)?.*PCMCIA .*(slot|disk) ?(\d)/i) {
+ ProcessHistory("COMMENTS","keysort","B7",
+ "!Memory: pcmcia $2 $3$4 $1\n");
+ next;
+ }
+ if(/^WARNING/) {
+ if (!defined($I0)) {
+ $I0=1;
+ ProcessHistory("COMMENTS","keysort","I0","!\n");
+ }
+ ProcessHistory("COMMENTS","keysort","I1","! $_");
+ # The line after the WARNING is what to do about it.
+ $_ = <INPUT>; tr/\015//d;
+ ProcessHistory("COMMENTS","keysort","I1","! $_");
+ }
+ if (/^Configuration register is (.*)$/) {
+ $config_register=$1;
+ next;
+ }
+ }
+ return(0);
+}
+
+
+# Dummy routine to set term length....
+sub TermLength {
+ # Dummy subroutine.. need to set term length differently for CSS
+ # boxes as term length 0 doesnt work correctly. POS.
+ return(0);
+}
+
+# Dummy routine to copy profile...
+sub CopyProfile {
+ ## Because the term length gets changed twice, the stupid
+ ## box will ask you to save or discard changes. This prompt
+ ## of couse breaks the interaction... strangely enough tho
+ ## in a failover environment, only the secondary behaves this
+ ## way.. the primary lets you log out and does not complain.
+ return(0);
+}
+
+
+# This routine parses "show boot"
+sub ShowBoot {
+ # Pick up boot variables if 7000/7200/7500/12000/2900/3500;
+ # otherwise pick up bootflash.
+ print STDERR " In ShowBoot: $_" if ($debug);
+
+ while (<INPUT>) {
+ tr/\015//d;
+ last if (/^$prompt/);
+ next if (/^(\s*|\s*$cmd\s*)$/);
+ return(1) if /^\s*\^\s*$/;
+ return(-1) if (/command authorization failed/i);
+ return(1) if /Ambiguous command/i;
+ # return(1) if /(Invalid input detected|Type help or )/;
+ return(1) if /(Open device \S+ failed|Error opening \S+:)/;
+ next if /CONFGEN variable/;
+ if (!defined($H0)) {
+ $H0=1; ProcessHistory("COMMENTS","keysort","H0","!\n");
+ }
+ if ($type !~ /^(12[04]|7)/) {
+ if ($type !~ /^(29|35)00/) {
+ ProcessHistory("COMMENTS","keysort","H2","!BootFlash: $_");
+ } else {
+ ProcessHistory("COMMENTS","keysort","H1","!Variable: $_");
+ }
+ } elsif (/variable/) {
+ ProcessHistory("COMMENTS","keysort","H1","!Variable: $_");
+ }
+ }
+ ProcessHistory("COMMENTS","","","!\n");
+ return(0);
+}
+
+
+# This routine processes a "show run"
+sub ShowRun {
+ print STDERR " In ShowRun: $_" if ($debug);
+ my($lineauto) = 0;
+
+ while (<INPUT>) {
+ tr/\015//d;
+ study;
+ last if(/^$prompt/);
+ return(-1) if (/command authorization failed/i);
+ # the pager can not be disabled per-session on the PIX
+ s/^<-+ More -+>\s*//;
+ /Non-Volatile memory is in use/ && return(-1); # NvRAM is locked
+ $lineauto = 0 if (/^[^ ]/);
+ # skip the crap
+ if (/^(##+$|(Building|Current) configuration)/i) {
+ while (<INPUT>) {
+ next if (/^Current configuration\s*:/i);
+ next if (/^:/);
+ next if (/^([%!].*|\s*)$/);
+ next if (/^ip add.*ipv4:/); # band-aid for 3620 12.0S
+ last;
+ }
+ if (defined($config_register)) {
+ ProcessHistory("","","","!\nconfig-register $config_register\n");
+ }
+ tr/\015//d;
+ }
+ # some versions have other crap mixed in with the bits in the
+ # block above
+ /^! (Last configuration|NVRAM config last)/ && next;
+ ## CSS specific....
+ /Generated on/ && next;
+
+ # Dog gone Cool matches to process the rest of the config
+ /^tftp-server flash / && next; # kill any tftp remains
+ /^ntp clock-period / && next; # kill ntp clock-period
+ /^ length / && next; # kill length on serial lines
+ /^ width / && next; # kill width on serial lines
+ $lineauto = 1 if /^ modem auto/;
+ /^ speed / && $lineauto && next; # kill speed on serial lines
+ /^ clockrate / && next; # kill clockrate on serial interfaces
+ if (/^(enable )?(password|passwd) / && $filter_pwds >= 1) {
+ ProcessHistory("ENABLE","","","!$1$2 <removed>\n");
+ next;
+ }
+ if (/^(enable secret) / && $filter_pwds >= 2) {
+ ProcessHistory("ENABLE","","","!$1 <removed>\n");
+ next;
+ }
+ if (/^username (\S+)(\s.*)? secret /) {
+ if ($filter_pwds >= 2) {
+ ProcessHistory("USER","keysort","$1","!username $1$2 secret <removed>\n");
+ } else {
+ ProcessHistory("USER","keysort","$1","$_");
+ }
+ next;
+ }
+ if (/^username (\S+)(\s.*)? password ((\d) \S+|\S+)/) {
+ if ($filter_pwds == 2) {
+ ProcessHistory("USER","keysort","$1","!username $1$2 password <removed>\n");
+ } elsif ($filter_pwds == 1 && $4 ne "5"){
+ ProcessHistory("USER","keysort","$1","!username $1$2 password <removed>\n");
+ } else {
+ ProcessHistory("USER","keysort","$1","$_");
+ }
+ next;
+ }
+ if (/^(\s*)password / && $filter_pwds >= 1) {
+ ProcessHistory("LINE-PASS","","","!$1password <removed>\n");
+ next;
+ }
+ if (/^\s*neighbor (\S*) password / && $filter_pwds >= 1) {
+ ProcessHistory("","","","! neighbor $1 password <removed>\n");
+ next;
+ }
+ if (/^(ppp .* password) 7 .*/ && $filter_pwds >= 1) {
+ ProcessHistory("","","","!$1 <removed>\n"); next;
+ }
+ if (/^(ip ftp password) / && $filter_pwds >= 1) {
+ ProcessHistory("","","","!$1 <removed>\n"); next;
+ }
+ if (/^( ip ospf authentication-key) / && $filter_pwds >= 1) {
+ ProcessHistory("","","","!$1 <removed>\n"); next;
+ }
+ # isis passwords appear to be completely plain-text
+ if (/^\s+isis password (\S+)( .*)?/ && $filter_pwds >= 1) {
+ ProcessHistory("","","","!isis password <removed>$2\n"); next;
+ }
+ if (/^\s+(domain-password|area-password) (\S+)( .*)?/
+ && $filter_pwds >= 1) {
+ ProcessHistory("","","","!$1 <removed>$2\n"); next;
+ }
+ # this is reversable, despite 'md5' in the cmd
+ if (/^( ip ospf message-digest-key \d+ md5) / && $filter_pwds >= 1) {
+ ProcessHistory("","","","!$1 <removed>\n"); next;
+ }
+ if (/^((crypto )?isakmp key) \S+ / && $filter_pwds >= 1) {
+ ProcessHistory("","","","!$1 <removed> $'"); next;
+ }
+ # i am told these are plain-text on the PIX
+ if (/^(vpdn username \S+ password)/ && $filter_pwds >= 1) {
+ ProcessHistory("","","","!$1 <removed>\n"); next;
+ }
+ /fair-queue individual-limit/ && next;
+ # sort ip explicit-paths.
+ if (/^ip explicit-path name (\S+)/) {
+ my($key) = $1;
+ my($expath) = $_;
+ while (<INPUT>) {
+ tr/\015//d;
+ last if (/^$prompt/);
+ last if (/^$prompt/ || ! /^(ip explicit-path name |[ !])/);
+ if (/^ip explicit-path name (\S+)/) {
+ ProcessHistory("EXPATH","keysort","$key","$expath");
+ $key = $1;
+ $expath = $_;
+ } else {
+ $expath .= $_;
+ }
+ }
+ ProcessHistory("EXPATH","keysort","$key","$expath");
+ }
+ # sort route-maps
+ if (/^route-map (\S+)/) {
+ my($key) = $1;
+ my($routemap) = $_;
+ while (<INPUT>) {
+ tr/\015//d;
+ last if (/^$prompt/ || ! /^(route-map |[ !])/);
+ if (/^route-map (\S+)/) {
+ ProcessHistory("ROUTEMAP","keysort","$key","$routemap");
+ $key = $1;
+ $routemap = $_;
+ } else {
+ $routemap .= $_;
+ }
+ }
+ ProcessHistory("ROUTEMAP","keysort","$key","$routemap");
+ }
+ # filter out any RCS/CVS tags to avoid confusing local CVS storage
+ s/\$(Revision|Id):/ $1:/;
+ # order access-lists
+ /^access-list\s+(\d\d?)\s+(\S+)\s+(\S+)/ &&
+ ProcessHistory("ACL $1 $2","ipsort","$3","$_") && next;
+ # order extended access-lists
+ /^access-list\s+(\d\d\d)\s+(\S+)\s+ip\s+host\s+(\S+)/ &&
+ ProcessHistory("EACL $1 $2","ipsort","$3","$_") && next;
+ /^access-list\s+(\d\d\d)\s+(\S+)\s+ip\s+(\d\S+)/ &&
+ ProcessHistory("EACL $1 $2","ipsort","$3","$_") && next;
+ /^access-list\s+(\d\d\d)\s+(\S+)\s+ip\s+any/ &&
+ ProcessHistory("EACL $1 $2","ipsort","0.0.0.0","$_") && next;
+ # order arp lists
+ /^arp\s+(\d+\.\d+\.\d+\.\d+)\s+/ &&
+ ProcessHistory("ARP","ipsort","$1","$_") && next;
+ /^ip prefix-list\s+(\S+)\s+seq\s+(\d+)\s+(permit|deny)\s+(\d\S+)(\/.*)$/ &&
+ ProcessHistory("PACL $1 $3","ipsort","$4","ip prefix-list $1 $3 $4$5\n")
+ && next;
+ # order logging statements
+ /^logging (\d+\.\d+\.\d+\.\d+)/ &&
+ ProcessHistory("LOGGING","ipsort","$1","$_") && next;
+ # order/prune snmp-server host statements
+ # we only prune lines of the form
+ # snmp-server host a.b.c.d <community>
+ if (/^snmp-server host (\d+\.\d+\.\d+\.\d+) /) {
+ if (defined($ENV{'NOCOMMSTR'})) {
+ my($ip) = $1;
+ my($line) = "snmp-server host $ip";
+ my(@tokens) = split(' ', $');
+ my($token);
+ while ($token = shift(@tokens)) {
+ if ($token eq 'version') {
+ $line .= " " . join(' ', ($token, shift(@tokens)));
+ } elsif ($token =~ /^(informs?|traps?|(no)?auth)$/) {
+ $line .= " " . $token;
+ } else {
+ $line = "!$line " . join(' ', ("<removed>", join(' ',@tokens)));
+ last;
+ }
+ }
+ ProcessHistory("SNMPSERVERHOST","ipsort","$ip","$line\n");
+ } else {
+ ProcessHistory("SNMPSERVERHOST","ipsort","$1","$_");
+ }
+ next;
+ }
+ if (/^(snmp-server community) (\S+)/) {
+ if (defined($ENV{'NOCOMMSTR'})) {
+ ProcessHistory("SNMPSERVERCOMM","keysort","$_","!$1 <removed>$'") && next;
+ } else {
+ ProcessHistory("SNMPSERVERCOMM","keysort","$_","$_") && next;
+ }
+ }
+ # order/prune tacacs/radius server statements
+ if (/^(tacacs-server|radius-server) key / && $filter_pwds >= 1) {
+ ProcessHistory("","","","!$1 key <removed>\n"); next;
+ }
+ # order clns host statements
+ /^clns host \S+ (\S+)/ &&
+ ProcessHistory("CLNS","keysort","$1","$_") && next;
+ # order alias statements
+ /^alias / && ProcessHistory("ALIAS","keysort","$_","$_") && next;
+ # delete ntp auth password - this md5 is a reversable too
+ if (/^(ntp authentication-key \d+ md5) / && $filter_pwds >= 1) {
+ ProcessHistory("","","","!$1 <removed>\n"); next;
+ }
+ # order ntp peers/servers
+ if (/^ntp (server|peer) (\d+)\.(\d+)\.(\d+)\.(\d+)/) {
+ $sortkey = sprintf("$1 %03d%03d%03d%03d",$2,$3,$4,$5);
+ ProcessHistory("NTP","keysort",$sortkey,"$_");
+ next;
+ }
+ # order ip host line statements
+ /^ip host line(\d+)/ &&
+ ProcessHistory("IPHOST","numsort","$1","$_") && next;
+ # order ip nat source static statements
+ /^ip nat (\S+) source static (\S+)/ &&
+ ProcessHistory("IP NAT $1","ipsort","$2","$_") && next;
+ # order atm map-list statements
+ /^\s+ip\s+(\d+\.\d+\.\d+\.\d+)\s+atm-vc/ &&
+ ProcessHistory("ATM map-list","ipsort","$1","$_") && next;
+ # order ip rcmd lines
+ /^ip rcmd/ && ProcessHistory("RCMD","keysort","$_","$_") && next;
+
+ # system controller
+ /^syscon address (\S*) (\S*)/ &&
+ ProcessHistory("","","","!syscon address $1 <removed>\n") &&
+ next;
+ if (/^syscon password (\S*)/ && $filter_pwds >= 1) {
+ ProcessHistory("","","","!syscon password <removed>\n");
+ next;
+ }
+
+ # catch anything that wasnt matched above.
+ ProcessHistory("","","","$_");
+ # end of config. the ": " game is for the PIX
+ if (/^(: +)?end$/ || /CSS.*#/ || /$prompt/ ) {
+ $found_end = 1;
+ return(1);
+ }
+ }
+ return(0);
+}
+
+# dummy function
+sub DoNothing {print STDOUT;}
+
+# Main
+%commands=(
+ 'term length 65535' => "TermLength",
+ 'copy profile user-profile' => "CopyProfile",
+ 'show version' => "ShowVersion",
+ 'show boot' => "ShowBoot",
+ 'show run' => "ShowRun"
+);
+# keys() doesnt return things in the order entered and the order of the
+# cmds is important (show version first and show run last). pita
+@commands=(
+ "term length 65535",
+ "copy profile user-profile",
+ "show version",
+ "show boot",
+ "show run"
+);
+$cisco_cmds=join(";",@commands);
+$cmds_regexp=join("|",@commands);
+
+open(OUTPUT,">$host.new") || die "Can't open $host.new for writing: $!\n";
+select(OUTPUT);
+# make OUTPUT unbuffered if debugging
+if ($debug) { $| = 1; }
+
+if ($file) {
+ print STDERR "opening file $host\n" if ($debug);
+ print STDOUT "opening file $host\n" if ($log);
+ open(INPUT,"<$host") || die "open failed for $host: $!\n";
+} else {
+ print STDERR "executing clogin -t $timeo -c\"$cisco_cmds\" $host\n" if ($debug);
+ print STDOUT "executing clogin -t $timeo -c\"$cisco_cmds\" $host\n" if ($log);
+ if (defined($ENV{NOPIPE})) {
+ system "clogin -t $timeo -c \"$cisco_cmds\" $host </dev/null > $host.raw 2>&1" || die "clogin failed for $host: $!\n";
+ open(INPUT, "< $host.raw") || die "clogin failed for $host: $!\n";
+ } else {
+ open(INPUT,"clogin -t $timeo -c \"$cisco_cmds\" $host </dev/null |") || die "clogin failed for $host: $!\n";
+ }
+}
+
+# determine password filtering mode
+if ($ENV{"FILTER_PWDS"} =~ /no/i) {
+ $filter_pwds = 0;
+} elsif ($ENV{"FILTER_PWDS"} =~ /all/i) {
+ $filter_pwds = 2;
+} else {
+ $filter_pwds = 1;
+}
+
+ProcessHistory("","","","!RANCID-CONTENT-TYPE: cisco-css\n!\n");
+ProcessHistory("COMMENTS","keysort","B0","!\n");
+ProcessHistory("COMMENTS","keysort","F0","!\n");
+ProcessHistory("COMMENTS","keysort","G0","!\n");
+
+TOP: while(<INPUT>) {
+ tr/\015//d;
+ if (/\#\s?exit/) {
+ $clean_run=1;
+ last;
+ }
+ if (/^Error:/) {
+ print STDOUT ("$host clogin error: $_");
+ print STDERR ("$host clogin error: $_") if ($debug);
+ $clean_run=0;
+ last;
+ }
+ while (/#\s*($cmds_regexp)\s*$/) {
+ $cmd = $1;
+ if (!defined($prompt)) {$prompt = ($_ =~ /^([^#]+#)/)[0]; }
+ print STDERR ("HIT COMMAND:$_") if ($debug);
+ if (! defined($commands{$cmd})) {
+ print STDERR "$host: found unexpected command - \"$cmd\"\n";
+ # $clean_run = 0;
+ # last TOP;
+ next TOP;
+ } else {
+ $rval = &{$commands{$cmd}};
+ delete($commands{$cmd});
+ if ($rval == -1) {
+ $clean_run = 0;
+ last TOP;
+ }
+ }
+ }
+}
+print STDOUT "Done $logincmd: $_\n" if ($log);
+# Flush History
+ProcessHistory("","","","");
+# Cleanup
+close(INPUT);
+close(OUTPUT);
+
+if (defined($ENV{NOPIPE})) {
+ unlink("$host.raw") if (! $debug);
+}
+
+# check for completeness
+if (scalar(%commands) || !$clean_run || !$found_end) {
+ if (scalar(%commands)) {
+ printf(STDOUT "$host: missed cmd(s): %s\n", join(',', keys(%commands)));
+ printf(STDERR "$host: missed cmd(s): %s\n", join(',', keys(%commands))) if ($debug);
+ }
+ if (!$clean_run || !$found_end) {
+ print STDOUT "$host: End of run not found\n";
+ print STDERR "$host: End of run not found\n" if ($debug);
+ system("/usr/bin/tail -1 $host.new");
+ }
+ unlink "$host.new" if (! $debug);
+}
diff --git a/bin/elogin.in b/bin/elogin.in
index 1b647fa..651d7fb 100755..100644
--- a/bin/elogin.in
+++ b/bin/elogin.in
@@ -1,19 +1,22 @@
-#!@EXPECT_PATH@ --
+#! @EXPECT_PATH@ --
##
+## $Id: elogin.in,v 1.27 2004/01/11 05:39:15 heas Exp $
##
-## Copyright (C) 1997-2001 by Henry Kilmer, Erik Sherk and Pete Whiting.
+## Copyright (C) 1997-2004 by Terrapin Communications, Inc.
## All rights reserved.
##
-## This software may be freely copied, modified and redistributed without
-## fee for non-commerical purposes provided that this copyright notice is
-## preserved intact on all copies and modified copies.
+## This software may be freely copied, modified and redistributed
+## without fee for non-commerical purposes provided that this license
+## remains intact and unmodified with any RANCID distribution.
##
## There is no warranty or other guarantee of fitness of this software.
-## It is provided solely "as is". The author(s) disclaim(s) all
+## It is provided solely "as is". The author(s) disclaim(s) all
## responsibility and liability with respect to this software's usage
## or its effect upon hardware, computer systems, other software, or
## anything else.
##
+## Except where noted otherwise, rancid was written by and is maintained by
+## Henry Kilmer, John Heasley, Andrew Partan, Pete Whiting, and Austin Schutz.
##
#
# elogin - ADC EZT3 login
@@ -38,8 +41,9 @@ set do_command 0
set do_script 0
# The default is to automatically enable
set enable 1
-# The default is that you login non-enabled (tacacs can have you login already enabled)
-set autoenable 0
+# The default is that you login non-enabled (tacacs can have you login already
+# enabled)
+set avautoenable 0
# The default is to look in the password file to find the passwords. This
# tracks if we receive them on the command line.
set do_passwd 1
@@ -49,6 +53,8 @@ if {[ info exists env(CISCO_USER) ] } {
set default_user $env(CISCO_USER)
} elseif {[ info exists env(USER) ]} {
set default_user $env(USER)
+} elseif {[ info exists env(LOGNAME) ]} {
+ set default_user $env(LOGNAME)
} else {
# This uses "id" which I think is portable. At least it has existed
# (without options) on all machines/OSes I've been on recently -
@@ -101,7 +107,7 @@ for {set i 0} {$i < $argc} {incr i} {
if {[ regexp .\[E\](.+)=(.+) $arg ignore varname varvalue]} {
set E$varname $varvalue
} else {
- send_user "Error: invalid format for -E in $arg\n"
+ send_user "\nError: invalid format for -E in $arg\n"
exit 1
}
# Enable Password
@@ -166,10 +172,10 @@ for {set i 0} {$i < $argc} {incr i} {
set do_command 1
# Do we enable?
} -noenable {
- # ignore -noenable
+ # ignore -noenable
# Does tacacs automatically enable us?
} -autoenable {
- # ignore -autoenable
+ # ignore -autoenable
} -* {
send_user "\nError: Unknown argument! $arg\n"
send_user $usage
@@ -406,17 +412,17 @@ foreach router [lrange $argv $i end] {
# Figure out prompt.
set prompt "Active) > "
- set autoenable 1
- set enable 0
+ set autoenable 1
+ set enable 0
# Figure out passwords
if { $do_passwd } {
set pswd [find password $router]
if { [llength $pswd] == 0 } {
- send_user "Error: no password for $router in $password_file.\n"
+ send_user "\nError: no password for $router in $password_file.\n"
continue
}
- set passwd [lindex $pswd 0]
+ set passwd [join [lindex $pswd 0] ""]
}
# Figure out username
@@ -424,7 +430,7 @@ foreach router [lrange $argv $i end] {
# command line username
set ruser $username
} else {
- set ruser [find user $router]
+ set ruser [join [find user $router] ""]
if { "$ruser" == "" } { set ruser $default_user }
}
@@ -433,7 +439,7 @@ foreach router [lrange $argv $i end] {
# command line username
set userpswd $userpasswd
} else {
- set userpswd [find userpassword $router]
+ set userpswd [join [find userpassword $router] ""]
if { "$userpswd" == "" } { set userpswd $passwd }
}
@@ -442,13 +448,13 @@ foreach router [lrange $argv $i end] {
if { "$u_prompt" == "" } {
set u_prompt "(Username|login| Login):"
} else {
- set u_prompt [lindex $u_prompt 0]
+ set u_prompt [join [lindex $u_prompt 0] ""]
}
set p_prompt [find passprompt $router]
if { "$p_prompt" == "" } {
set p_prompt "\[Pp]assword:"
} else {
- set p_prompt [lindex $p_prompt 0]
+ set p_prompt [join [lindex $p_prompt 0] ""]
}
# Figure out cypher type
diff --git a/bin/env.in b/bin/env.in
deleted file mode 100644
index e3c2ba4..0000000
--- a/bin/env.in
+++ /dev/null
@@ -1,48 +0,0 @@
-#
-# This file setups up the environment used for rancid. see env(5)
-#
-# This will be site specific
-#
-TERM=network;export TERM
-#
-# Under $BASEDIR, there will be a bin directory for the rancid programs,
-# a log directory for the logs from rancid and a directory for each group
-# of routers (LIST_OF_GROUPS). In addition to these directories, there
-# will be the CVS repositories as well.
-# use a full path (no sym-links) for BASEDIR. some versions of CVS seemingly
-# don't take kindly to sym-links.
-#
-TMPDIR=/tmp; export TMPDIR
-BASEDIR=@prefix@; export BASEDIR
-PATH=$BASEDIR/bin:@ENV_PATH@; export PATH
-CVSROOT=$BASEDIR/CVS; export CVSROOT
-#
-# if NOPIPE is set, temp files will be used instead of a cmd pipe during
-# collection from the router(s).
-#NOPIPE=YES; export NOPIPE
-#
-# FILTER_PWDS determines which passwords are filtered from configs by the
-# value set (NO | YES | ALL). see env(5).
-#FILTER_PWDS=YES; export FILTER_PWDS
-#
-# if NOCOMMSTR is set, snmp community strings will be stripped from the configs
-#NOCOMMSTR=YES; export NOCOMMSTR
-#
-# How many hours to go by before complaining about routers that
-# can not be reached. The value should be greater than the number
-# of hours between your do-diffs cron job.
-OLDTIME=4; export OLDTIME
-#
-# The number of devices to collect simultaneously.
-#PAR_COUNT=5; export PAR_COUNT
-#
-# list of rancid groups
-LIST_OF_GROUPS="sl joebobisp"
-#
-# For each group, define a list of people to receive the diffs.
-# in sendmail's /etc/aliases.
-# rancid-group: joe,moe@foo
-# rancid-group-admin: hostmaster
-# be sure to read ../README regarding aliases.
-#
-umask 027
diff --git a/bin/erancid.in b/bin/erancid.in
index 01a6268..20da43d 100755..100644
--- a/bin/erancid.in
+++ b/bin/erancid.in
@@ -1,22 +1,22 @@
-#!@PERLV_PATH@
+#! @PERLV_PATH@
##
-## Hacked version of rancid for ADC EZT3 series muxes. Only tested
-## with switch software 1.50 so far - terry@tmk.com
+## $Id: erancid.in,v 1.18 2004/01/11 03:49:13 heas Exp $
##
-##
-## Copyright (C) 1997-2001 by Henry Kilmer.
+## Copyright (C) 1997-2004 by Terrapin Communications, Inc.
## All rights reserved.
##
-## This software may be freely copied, modified and redistributed without
-## fee for non-commerical purposes provided that this copyright notice is
-## preserved intact on all copies and modified copies.
+## This software may be freely copied, modified and redistributed
+## without fee for non-commerical purposes provided that this license
+## remains intact and unmodified with any RANCID distribution.
##
## There is no warranty or other guarantee of fitness of this software.
-## It is provided solely "as is". The author(s) disclaim(s) all
+## It is provided solely "as is". The author(s) disclaim(s) all
## responsibility and liability with respect to this software's usage
## or its effect upon hardware, computer systems, other software, or
## anything else.
##
+## Except where noted otherwise, rancid was written by and is maintained by
+## Henry Kilmer, John Heasley, Andrew Partan, Pete Whiting, and Austin Schutz.
##
#
# RANCID - Really Awesome New Cisco confIg Differ
@@ -24,7 +24,7 @@
# usage: rancid [-d] [-l] [-f filename | $host]
#
use Getopt::Std;
-getopts('dflm');
+getopts('dfl');
$log = $opt_l;
$debug = $opt_d;
$file = $opt_f;
@@ -268,7 +268,8 @@ while(<INPUT>) {
$cmd = $1;
if (!defined($prompt)) {
$prompt = ($_ =~ /^([^#]+#)/)[0];
- $prompt =~ s/([}{)(\\])/\\$1/g;
+ $prompt =~ s/([][}{)(\\])/\\$1/g;
+ print STDERR ("PROMPT MATCH: $prompt\n") if ($debug);
}
print STDERR ("HIT COMMAND:$_") if ($debug);
if (! defined($commands{$cmd})) {
diff --git a/bin/f10rancid.in b/bin/f10rancid.in
index 06528c5..2c4e485 100755..100644
--- a/bin/f10rancid.in
+++ b/bin/f10rancid.in
@@ -1,28 +1,32 @@
-#!@PERLV_PATH@
+#! @PERLV_PATH@
##
-## This version of rancid tries to deal with Force10s.
+## $Id: f10rancid.in,v 1.11 2004/01/11 03:49:13 heas Exp $
##
-## Copyright (C) 1997-2001 by Henry Kilmer.
+## Copyright (C) 1997-2004 by Terrapin Communications, Inc.
## All rights reserved.
##
-## This software may be freely copied, modified and redistributed without
-## fee for non-commerical purposes provided that this copyright notice is
-## preserved intact on all copies and modified copies.
+## This software may be freely copied, modified and redistributed
+## without fee for non-commerical purposes provided that this license
+## remains intact and unmodified with any RANCID distribution.
##
## There is no warranty or other guarantee of fitness of this software.
-## It is provided solely "as is". The author(s) disclaim(s) all
+## It is provided solely "as is". The author(s) disclaim(s) all
## responsibility and liability with respect to this software's usage
## or its effect upon hardware, computer systems, other software, or
## anything else.
##
+## Except where noted otherwise, rancid was written by and is maintained by
+## Henry Kilmer, John Heasley, Andrew Partan, Pete Whiting, and Austin Schutz.
##
#
+# This version of rancid tries to deal with Force10s.
+#
# RANCID - Really Awesome New Cisco confIg Differ
#
# usage: rancid [-d] [-l] [-f filename | $host]
#
use Getopt::Std;
-getopts('dflm');
+getopts('dfl');
$log = $opt_l;
$debug = $opt_d;
$file = $opt_f;
@@ -139,7 +143,6 @@ sub ShowVersion {
while (<INPUT>) {
tr/\015//d;
- study;
last if(/^$prompt/);
next if(/^(\s*|\s*$cmd\s*)$/);
return(-1) if (/command authorization failed/i);
@@ -479,7 +482,6 @@ sub ShowContAll {
while (<INPUT>) {
tr/\015//d;
- study;
last if (/^$prompt/);
next if (/^(\s*|\s*$cmd\s*)$/);
# return(1) if ($type =~ /^(12[40]|7[05])/);
@@ -583,7 +585,6 @@ sub ShowDiagbus {
while (<INPUT>) {
tr/\015//d;
- study;
last if (/^$prompt/);
next if (/^(\s*|\s*$cmd\s*)$/);
#return(1) if ($type !~ /^7[05]/);
@@ -670,7 +671,6 @@ sub ShowDiag {
while (<INPUT>) {
tr/\015//d;
- study;
last if (/^$prompt/);
next if (/^(\s*|\s*$cmd\s*)$/);
# return(1) if ($type !~ /^(12[40]|720|36|26)/);
@@ -882,7 +882,6 @@ sub WriteTerm {
while (<INPUT>) {
tr/\015//d;
- study;
last if(/^$prompt/);
return(-1) if (/command authorization failed/i);
# the pager can not be disabled per-session on the PIX
@@ -1216,7 +1215,11 @@ TOP: while(<INPUT>) {
}
while (/#\s*($cmds_regexp)\s*$/) {
$cmd = $1;
- if (!defined($prompt)) {$prompt = ($_ =~ /^([^#]+#)/)[0]; }
+ if (!defined($prompt)) {
+ $prompt = ($_ =~ /^([^#]+#)/)[0];
+ $prompt =~ s/([][}{)(\\])/\\$1/g;
+ print STDERR ("PROMPT MATCH: $prompt\n") if ($debug);
+ }
print STDERR ("HIT COMMAND:$_") if ($debug);
if (! defined($commands{$cmd})) {
print STDERR "$host: found unexpected command - \"$cmd\"\n";
diff --git a/bin/flogin.in b/bin/flogin.in
index 1a34068..169e522 100755..100644
--- a/bin/flogin.in
+++ b/bin/flogin.in
@@ -1,21 +1,26 @@
-#!@EXPECT_PATH@ --
+#! @EXPECT_PATH@ --
##
+## $Id: flogin.in,v 1.32 2004/01/11 05:39:15 heas Exp $
##
-## Copyright (C) 1997-2001 by Henry Kilmer, Erik Sherk and Pete Whiting.
+## Copyright (C) 1997-2004 by Terrapin Communications, Inc.
## All rights reserved.
##
-## This software may be freely copied, modified and redistributed without
-## fee for non-commerical purposes provided that this copyright notice is
-## preserved intact on all copies and modified copies.
-##
+## This software may be freely copied, modified and redistributed
+## without fee for non-commerical purposes provided that this license
+## remains intact and unmodified with any RANCID distribution.
+##
## There is no warranty or other guarantee of fitness of this software.
-## It is provided solely "as is". The author(s) disclaim(s) all
+## It is provided solely "as is". The author(s) disclaim(s) all
## responsibility and liability with respect to this software's usage
## or its effect upon hardware, computer systems, other software, or
## anything else.
##
+## Except where noted otherwise, rancid was written by and is maintained by
+## Henry Kilmer, John Heasley, Andrew Partan, Pete Whiting, and Austin Schutz.
##
#
+# The login expect scripts were based on Erik Sherk's gwtn, by permission.
+#
# flogin - foundry login
#
# Most options are intuitive for logging into a foundry switch.
@@ -46,8 +51,9 @@ set do_command 0
set do_script 0
# The default is to automatically enable
set enable 1
-# The default is that you login non-enabled (tacacs can have you login already enabled)
-set autoenable 0
+# The default is that you login non-enabled (tacacs can have you login already
+# enabled)
+set avautoenable 0
# The default is to look in the password file to find the passwords. This
# tracks if we receive them on the command line.
set do_passwd 1
@@ -58,6 +64,8 @@ if {[ info exists env(CISCO_USER) ] } {
set default_user $env(CISCO_USER)
} elseif {[ info exists env(USER) ]} {
set default_user $env(USER)
+} elseif {[ info exists env(LOGNAME) ]} {
+ set default_user $env(LOGNAME)
} else {
# This uses "id" which I think is portable. At least it has existed
# (without options) on all machines/OSes I've been on recently -
@@ -113,7 +121,7 @@ for {set i 0} {$i < $argc} {incr i} {
if {[ regexp .\[E\](.+)=(.+) $arg ignore varname varvalue]} {
set E$varname $varvalue
} else {
- send_user "Error: invalid format for -E in $arg\n"
+ send_user "\nError: invalid format for -E in $arg\n"
exit 1
}
# Enable Password
@@ -181,7 +189,7 @@ for {set i 0} {$i < $argc} {incr i} {
set enable 0
# Does tacacs automatically enable us?
} -autoenable {
- set autoenable 1
+ set avautoenable 1
set enable 0
} -* {
send_user "\nError: Unknown argument! $arg\n"
@@ -277,7 +285,7 @@ proc source_password_file { password_file } {
# Log into the router.
proc login { router user userpswd passwd enapasswd cmethod cyphertype } {
global spawn_id in_proc do_command do_script platform
- global prompt u_prompt p_prompt e_prompt
+ global prompt u_prompt p_prompt e_prompt sshcmd
set in_proc 1
set uprompt_seen 0
@@ -296,8 +304,8 @@ proc login { router user userpswd passwd enapasswd cmethod cyphertype } {
exit 1
}
} elseif ![string compare $prog "ssh"] {
- if [ catch {spawn ssh -c $cyphertype -x -l $user $router} reason ] {
- send_user "\nError: ssh failed: $reason\n"
+ if [ catch {spawn $sshcmd -c $cyphertype -x -l $user $router} reason ] {
+ send_user "\nError: $sshcmd failed: $reason\n"
exit 1
}
} elseif ![string compare $prog "rsh"] {
@@ -341,24 +349,39 @@ proc login { router user userpswd passwd enapasswd cmethod cyphertype } {
# then it will just send the passwd.
# if telnet fails with connection refused, try ssh
expect {
- -re "(Connection refused|Secure connection \[^\n\r]+ refused|Connection closed by|Telnet server disabled)" {
+ -re "(Connection refused|Secure connection \[^\n\r]+ refused)" {
+ catch {close}; wait
+ if !$progs {
+ send_user "\nError: Connection Refused ($prog): $router\n"
+ return 1
+ }
+ }
+ -re "(Connection closed by|Connection to \[^\n\r]+ closed)" {
catch {close}; wait
if !$progs {
- send_user "\nError: Connection Refused ($prog)\n"; return 1
+ send_user "\nError: Connection closed ($prog): $router\n"
+ return 1
+ }
+ }
+ -re "Telnet server disabled" {
+ catch {close}; wait
+ if !$progs {
+ send_user "\nError: Connection Refused ($prog): $router\n"
+ return 1
}
}
eof { send_user "\nError: Couldn't login\n"; wait; return 1 }
-nocase "unknown host\r" {
catch {close};
- send_user "\nError: Unknown host\n"; wait; return 1
+ send_user "\nError: Unknown host $router\n"; wait; return 1
}
"Host is unreachable" {
catch {close};
- send_user "\nError: Host Unreachable!\n"; wait; return 1
+ send_user "\nError: Host Unreachable: $router\n"; wait; return 1
}
"No address associated with name" {
catch {close};
- send_user "\nError: Unknown host\n"; wait; return 1
+ send_user "\nError: Unknown host $router\n"; wait; return 1
}
-re "(Host key not found |The authenticity of host .* be established).*\(yes\/no\)\?" {
send "yes\r"
@@ -406,7 +429,7 @@ proc login { router user userpswd passwd enapasswd cmethod cyphertype } {
}
"$prompt" { break; }
"Login invalid" {
- send_user "\nError: Invalid login\n";
+ send_user "\nError: Invalid login: $router\n";
catch {close}; wait; return 1
}
}
@@ -432,6 +455,10 @@ proc do_enable { enauser enapasswd } {
denied { send_user "\nError: Check your Enable passwd\n";
return 1
}
+ "Incorrect username or password" {
+ send_user "\nError: Check your Enable passwd\n";
+ return 1
+ }
"% Bad passwords" { send_user "\nError: Check your Enable passwd\n";
return 1
}
@@ -496,7 +523,9 @@ foreach router [lrange $argv $i end] {
# Since autoenable is off by default, if we have it defined, it
# was done on the command line. If it is not specifically set on the
# command line, check the password file.
- if $autoenable {
+ if $avautoenable {
+ set autoenable 1
+ set enable 0
set prompt "#"
} else {
set ae [find autoenable $router]
@@ -514,15 +543,15 @@ foreach router [lrange $argv $i end] {
if { $do_passwd || $do_enapasswd } {
set pswd [find password $router]
if { [llength $pswd] == 0 } {
- send_user "Error: no password for $router in $password_file.\n"
+ send_user "\nError: no password for $router in $password_file.\n"
continue
}
if { $enable && $do_enapasswd && $autoenable == 0 && [llength $pswd] < 2 } {
- send_user "Error: no enable password for $router in $password_file.\n"
+ send_user "\nError: no enable password for $router in $password_file.\n"
continue
}
- set passwd [lindex $pswd 0]
- set enapasswd [lindex $pswd 1]
+ set passwd [join [lindex $pswd 0] ""]
+ set enapasswd [join [lindex $pswd 1] ""]
}
# Figure out username
@@ -530,7 +559,7 @@ foreach router [lrange $argv $i end] {
# command line username
set ruser $username
} else {
- set ruser [find user $router]
+ set ruser [join [find user $router] ""]
if { "$ruser" == "" } { set ruser $default_user }
}
@@ -539,7 +568,7 @@ foreach router [lrange $argv $i end] {
# command line username
set userpswd $userpasswd
} else {
- set userpswd [find userpassword $router]
+ set userpswd [join [find userpassword $router] ""]
if { "$userpswd" == "" } { set userpswd $passwd }
}
@@ -548,7 +577,7 @@ foreach router [lrange $argv $i end] {
# command line enausername
set enauser $enausername
} else {
- set enauser [find enauser $router]
+ set enauser [join [find enauser $router] ""]
if { "$enauser" == "" } { set enauser $ruser }
}
@@ -557,19 +586,19 @@ foreach router [lrange $argv $i end] {
if { "$u_prompt" == "" } {
set u_prompt "(Username|login|Name|User Name):"
} else {
- set u_prompt [lindex $u_prompt 0]
+ set u_prompt [join [lindex $u_prompt 0] ""]
}
set p_prompt [find passprompt $router]
if { "$p_prompt" == "" } {
set p_prompt "(\[Pp]assword):"
} else {
- set p_prompt [lindex $p_prompt 0]
+ set p_prompt [join [lindex $p_prompt 0] ""]
}
set e_prompt [find enableprompt $router]
if { "$e_prompt" == "" } {
set e_prompt "\[Pp]assword:"
} else {
- set e_prompt [lindex $e_prompt 0]
+ set e_prompt [join [lindex $e_prompt 0] ""]
}
# Figure out cypher tpye
@@ -585,6 +614,10 @@ foreach router [lrange $argv $i end] {
set cmethod [find method $router]
if { "$cmethod" == "" } { set cmethod {{telnet} {ssh}} }
+ # Figure out the SSH executable name
+ set sshcmd [find sshcmd $router]
+ if { "$sshcmd" == "" } { set sshcmd {ssh} }
+
# Login to the router
if {[login $router $ruser $userpswd $passwd $enapasswd $cmethod $cyphertype]} {
continue
diff --git a/bin/fnrancid.in b/bin/fnrancid.in
new file mode 100644
index 0000000..815227b
--- /dev/null
+++ b/bin/fnrancid.in
@@ -0,0 +1,275 @@
+#! @PERLV_PATH@
+##
+## $Id: fnrancid.in,v 1.3 2004/01/11 03:49:13 heas Exp $
+##
+## Copyright (C) 1997-2004 by Terrapin Communications, Inc.
+## All rights reserved.
+##
+## This software may be freely copied, modified and redistributed
+## without fee for non-commerical purposes provided that this license
+## remains intact and unmodified with any RANCID distribution.
+##
+## There is no warranty or other guarantee of fitness of this software.
+## It is provided solely "as is". The author(s) disclaim(s) all
+## responsibility and liability with respect to this software's usage
+## or its effect upon hardware, computer systems, other software, or
+## anything else.
+##
+## Except where noted otherwise, rancid was written by and is maintained by
+## Henry Kilmer, John Heasley, Andrew Partan, Pete Whiting, and Austin Schutz.
+##
+#
+# A library built on Stephen Gill's Netscreen stuff to accomodate
+# the Fortinet product line. [d_pfleger@juniper.net]
+#
+# RANCID - Really Awesome New Cisco confIg Differ
+#
+# usage: rancid [-d] [-l] [-f filename | $host]
+#
+use Getopt::Std;
+getopts('dfl');
+$log = $opt_l;
+$debug = $opt_d;
+#$debug = 1;
+$file = $opt_f;
+$host = $ARGV[0];
+$found_end = 0;
+$timeo = 90; # nlogin timeout in seconds
+
+my(%filter_pwds); # password filtering mode
+
+# This routine is used to print out the router configuration
+sub ProcessHistory {
+ my($new_hist_tag,$new_command,$command_string,@string)=(@_);
+ if((($new_hist_tag ne $hist_tag) || ($new_command ne $command))
+ && defined %history) {
+ print eval "$command \%history";
+ undef %history;
+ }
+ if (($new_hist_tag) && ($new_command) && ($command_string)) {
+ if ($history{$command_string}) {
+ $history{$command_string} = "$history{$command_string}@string";
+ } else {
+ $history{$command_string} = "@string";
+ }
+ } elsif (($new_hist_tag) && ($new_command)) {
+ $history{++$#history} = "@string";
+ } else {
+ print "@string";
+ }
+ $hist_tag = $new_hist_tag;
+ $command = $new_command;
+ 1;
+}
+
+sub numerically { $a <=> $b; }
+
+# This is a sort routing that will sort numerically on the
+# keys of a hash as if it were a normal array.
+sub keynsort {
+ local(%lines)=@_;
+ local($i) = 0;
+ local(@sorted_lines);
+ foreach $key (sort numerically keys(%lines)) {
+ $sorted_lines[$i] = $lines{$key};
+ $i++;
+ }
+ @sorted_lines;
+}
+
+# This is a sort routing that will sort on the
+# keys of a hash as if it were a normal array.
+sub keysort {
+ local(%lines)=@_;
+ local($i) = 0;
+ local(@sorted_lines);
+ foreach $key (sort keys(%lines)) {
+ $sorted_lines[$i] = $lines{$key};
+ $i++;
+ }
+ @sorted_lines;
+}
+
+# This is a sort routing that will sort on the
+# values of a hash as if it were a normal array.
+sub valsort{
+ local(%lines)=@_;
+ local($i) = 0;
+ local(@sorted_lines);
+ foreach $key (sort values %lines) {
+ $sorted_lines[$i] = $key;
+ $i++;
+ }
+ @sorted_lines;
+}
+
+# This is a numerical sort routing (ascending).
+sub numsort {
+ local(%lines)=@_;
+ local($i) = 0;
+ local(@sorted_lines);
+ foreach $num (sort {$a <=> $b} keys %lines) {
+ $sorted_lines[$i] = $lines{$num};
+ $i++;
+ }
+ @sorted_lines;
+}
+
+# This is a sort routine that will sort on the
+# ip address when the ip address is anywhere in
+# the strings.
+sub ipsort {
+ local(%lines)=@_;
+ local($i) = 0;
+ local(@sorted_lines);
+ foreach $addr (sort sortbyipaddr keys %lines) {
+ $sorted_lines[$i] = $lines{$addr};
+ $i++;
+ }
+ @sorted_lines;
+}
+
+# These two routines will sort based upon IP addresses
+sub ipaddrval {
+ my(@a) = ($_[0] =~ m#^(\d+)\.(\d+)\.(\d+)\.(\d+)$#);
+ $a[3]+256*($a[2]+256*($a[1]+256*$a[0]));
+}
+sub sortbyipaddr {
+ &ipaddrval($a) <=> &ipaddrval($b);
+}
+
+# This routine parses "get system"
+sub GetSystem {
+ print STDERR " In GetSystem: $_" if ($debug);
+
+ while (<INPUT>) {
+ tr/\015//d;
+ next if /^\s*$/;
+ last if(/$prompt/);
+ ProcessHistory("","","","$_");
+ #print STDOUT "$_";
+ }
+ print STDOUT "Vendor: $vendor";
+ ProcessHistory("SYSTEM","","","\n");
+ return(0);
+}
+
+sub GetFile {
+ print STDERR " In GetFile: $_" if ($debug);
+ while (<INPUT>) {
+ last if(/$prompt/);
+ }
+ ProcessHistory("FILE","","","\n");
+ return(0);
+}
+
+sub GetConf {
+ print STDERR " In GetConf: $_" if ($debug);
+ while (<INPUT>) {
+ tr/\015//d;
+ next if /^\s*$/;
+ last if(/$prompt/);
+ if (/(^set.*)('Enc .*')(.*)/) {
+ ProcessHistory("ENC","","","!$1 'Enc **encoding removed**' $3\n");
+ next;
+ }
+ ProcessHistory("","","","$_");
+ #print STDOUT "$_";
+ }
+ $found_end=1;
+ return(1);
+}
+
+# dummy function
+sub DoNothing {print STDOUT;}
+
+# Main
+%commands=(
+ 'get system status' => "GetSystem",
+ 'get conf' => "GetConf"
+);
+# keys() doesnt return things in the order entered and the order of the
+# cmds is important. pita
+@commands=(
+ "get system status",
+ "get conf"
+);
+$cisco_cmds=join(";",@commands);
+$cmds_regexp=join("|",@commands);
+
+open(OUTPUT,">$host.new") || die "Can't open $host.new for writing: $!\n";
+select(OUTPUT);
+# make OUTPUT unbuffered if debugging
+if ($debug) { $| = 1; }
+
+if ($file) {
+ print STDERR "opening file $host\n" if ($debug);
+ print STDOUT "opening file $host\n" if ($log);
+ open(INPUT,"<$host") || die "open failed for $host: $!\n"; } else {
+ print STDERR "executing nlogin -t $timeo -c\"$cisco_cmds\" $host\n" if ($debug);
+ print STDOUT "executing nlogin -t $timeo -c\"$cisco_cmds\" $host\n" if ($log);
+ if (defined($ENV{NOPIPE})) {
+ system "nlogin -t $timeo -c \"$cisco_cmds\" $host </dev/null > $host.raw 2>&1" || die "nlogin failed for $host: $!\n";
+ open(INPUT, "< $host.raw") || die "nlogin failed for $host: $!\n";
+ } else {
+ open(INPUT,"nlogin -t $timeo -c \"$cisco_cmds\" $host </dev/null |") || die "nlogin failed for $host: $!\n";
+ }
+}
+
+# determine password filtering mode
+if ($ENV{"FILTER_PWDS"} =~ /no/i) {
+ $filter_pwds = 0;
+} elsif ($ENV{"FILTER_PWDS"} =~ /all/i) {
+ $filter_pwds = 2;
+} else {
+ $filter_pwds = 1;
+}
+
+ProcessHistory("","","","!RANCID-CONTENT-TYPE: Fortigate\n\n");
+TOP: while(<INPUT>) {
+ tr/\015//d;
+ if (/^Error:/) {
+ print STDOUT ("$host nlogin error: $_");
+ print STDERR ("$host nlogin error: $_") if ($debug);
+ last;
+ }
+ while (/>\s*($cmds_regexp)\s*$/) {
+ $cmd = $1;
+ if (!defined($prompt)) { $prompt = " >\s*"; }
+ print STDERR ("HIT COMMAND:$_") if ($debug);
+ if (!defined($commands{$cmd})) {
+ print STDERR "$host: found unexpected command - \"$cmd\"\n";
+ last TOP;
+ }
+ $rval = &{$commands{$cmd}};
+ delete($commands{$cmd});
+ if ($rval == -1) {
+ last TOP;
+ }
+ }
+}
+print STDOUT "Done $logincmd: $_\n" if ($log);
+# Flush History
+ProcessHistory("","","","");
+# Cleanup
+close(INPUT);
+close(OUTPUT);
+
+if (defined($ENV{NOPIPE})) {
+ unlink("$host.raw") if (! $debug);
+}
+
+# check for completeness
+if (scalar(%commands) || !$found_end) {
+ if (scalar(%commands)) {
+ printf(STDOUT "$host: missed cmd(s): %s\n", join(',', keys(%commands)));
+ printf(STDERR "$host: missed cmd(s): %s\n", join(',', keys(%commands))) if ($debug);
+ }
+ if (!$found_end) {
+ print STDOUT "$found_end: found end\n";
+ print STDOUT "$host: End of run not found\n";
+ print STDERR "$host: End of run not found\n" if ($debug);
+ system("/usr/bin/tail -1 $host.new");
+ }
+ unlink "$host.new" if (! $debug);
+}
diff --git a/bin/francid.in b/bin/francid.in
index b03052e..e1fd284 100755..100644
--- a/bin/francid.in
+++ b/bin/francid.in
@@ -1,29 +1,33 @@
-#!@PERLV_PATH@
+#! @PERLV_PATH@
##
-## Amazingly hacked version of Hank's rancid - this one tries to
-## deal with foundrys and foundrys OEM'd by HP as Procurves.
+## $Id: francid.in,v 1.26 2004/01/11 03:49:13 heas Exp $
##
-## Copyright (C) 1997-2001 by Henry Kilmer.
+## Copyright (C) 1997-2004 by Terrapin Communications, Inc.
## All rights reserved.
##
-## This software may be freely copied, modified and redistributed without
-## fee for non-commerical purposes provided that this copyright notice is
-## preserved intact on all copies and modified copies.
+## This software may be freely copied, modified and redistributed
+## without fee for non-commerical purposes provided that this license
+## remains intact and unmodified with any RANCID distribution.
##
## There is no warranty or other guarantee of fitness of this software.
-## It is provided solely "as is". The author(s) disclaim(s) all
+## It is provided solely "as is". The author(s) disclaim(s) all
## responsibility and liability with respect to this software's usage
## or its effect upon hardware, computer systems, other software, or
## anything else.
##
+## Except where noted otherwise, rancid was written by and is maintained by
+## Henry Kilmer, John Heasley, Andrew Partan, Pete Whiting, and Austin Schutz.
##
#
+# Amazingly hacked version of Hank's rancid - this one tries to
+# deal with foundrys and foundrys OEM'd by HP as Procurves.
+#
# RANCID - Really Awesome New Cisco confIg Differ
#
# usage: rancid [-d] [-l] [-f filename | $host]
#
use Getopt::Std;
-getopts('dflm');
+getopts('dfl');
$log = $opt_l;
$debug = $opt_d;
$file = $opt_f;
@@ -376,7 +380,8 @@ TOP: while(<INPUT>) {
$cmd = $1;
if (!defined($prompt)) {
$prompt = ($_ =~ /^([^#]+#)/)[0];
- $prompt =~ s/([}{)(\\])/\\$1/g;
+ $prompt =~ s/([][}{)(\\])/\\$1/g;
+ print STDERR ("PROMPT MATCH: $prompt\n") if ($debug);
}
print STDERR ("HIT COMMAND:$_") if ($debug);
if (! defined($commands{$cmd})) {
diff --git a/bin/hlogin.in b/bin/hlogin.in
index 917ea83..6af11b4 100755..100644
--- a/bin/hlogin.in
+++ b/bin/hlogin.in
@@ -1,21 +1,26 @@
-#!@EXPECT_PATH@ --
+#! @EXPECT_PATH@ --
##
+## $Id: hlogin.in,v 1.21 2004/01/11 05:39:15 heas Exp $
##
-## Copyright (C) 1997-2001 by Henry Kilmer, Erik Sherk and Pete Whiting.
+## Copyright (C) 1997-2004 by Terrapin Communications, Inc.
## All rights reserved.
##
-## This software may be freely copied, modified and redistributed without
-## fee for non-commerical purposes provided that this copyright notice is
-## preserved intact on all copies and modified copies.
+## This software may be freely copied, modified and redistributed
+## without fee for non-commerical purposes provided that this license
+## remains intact and unmodified with any RANCID distribution.
##
## There is no warranty or other guarantee of fitness of this software.
-## It is provided solely "as is". The author(s) disclaim(s) all
+## It is provided solely "as is". The author(s) disclaim(s) all
## responsibility and liability with respect to this software's usage
## or its effect upon hardware, computer systems, other software, or
## anything else.
##
+## Except where noted otherwise, rancid was written by and is maintained by
+## Henry Kilmer, John Heasley, Andrew Partan, Pete Whiting, and Austin Schutz.
##
#
+# The login expect scripts were based on Erik Sherk's gwtn, by permission.
+#
# hlogin - hp login
#
# Most options are intuitive for logging into a Cisco router.
@@ -43,8 +48,9 @@ set do_command 0
set do_script 0
# The default is to automatically enable
set enable 1
-# The default is that you login non-enabled (tacacs can have you login already enabled)
-set autoenable 0
+# The default is that you login non-enabled (tacacs can have you login already
+# enabled)
+set avautoenable 0
# The default is to look in the password file to find the passwords. This
# tracks if we receive them on the command line.
set do_passwd 1
@@ -57,6 +63,8 @@ if {[ info exists env(CISCO_USER) ] } {
set default_user $env(CISCO_USER)
} elseif {[ info exists env(USER) ]} {
set default_user $env(USER)
+} elseif {[ info exists env(LOGNAME) ]} {
+ set default_user $env(LOGNAME)
} else {
# This uses "id" which I think is portable. At least it has existed
# (without options) on all machines/OSes I've been on recently -
@@ -112,7 +120,7 @@ for {set i 0} {$i < $argc} {incr i} {
if {[ regexp .\[E\](.+)=(.+) $arg ignore varname varvalue]} {
set E$varname $varvalue
} else {
- send_user "Error: invalid format for -E in $arg\n"
+ send_user "\nError: invalid format for -E in $arg\n"
exit 1
}
# Enable Password
@@ -281,30 +289,35 @@ proc source_password_file { password_file } {
# Log into the router.
proc login { router user userpswd passwd enapasswd cmethod cyphertype } {
global spawn_id in_proc do_command do_script platform
- global prompt u_prompt p_prompt e_prompt
+ global prompt u_prompt p_prompt e_prompt sshcmd
set in_proc 1
# try each of the connection methods in $cmethod until one is successful
set progs [llength $cmethod]
foreach prog [lrange $cmethod 0 end] {
+ regexp {(telnet|ssh)(:([^[:space:]]+))*} $prog command suffix junk port
if [string match "telnet*" $prog] {
- regexp {telnet(:([^[:space:]]+))*} $prog command suffix port
if {"$port" == ""} {
- set retval [ catch {spawn hpfilter telnet $router} reason ]
+ set retval [ catch {spawn hpuifilter telnet $router} reason ]
} else {
- set retval [ catch {spawn hpfilter telnet $router $port} reason ]
+ set retval [ catch {spawn hpuifilter telnet $router $port} reason ]
}
if { $retval } {
send_user "\nError: telnet failed: $reason\n"
exit 1
}
- } elseif ![string compare $prog "ssh"] {
- if [ catch {spawn hpfilter ssh -c $cyphertype -x -l $user $router} reason ] {
- send_user "\nError: ssh failed: $reason\n"
+ } elseif [string match "ssh*" $prog] {
+ if {"$port" == ""} {
+ set retval [ catch {spawn hpuifilter $sshcmd -c $cyphertype -x -l $user $router} reason ]
+ } else {
+ set retval [ catch {spawn hpuifilter $sshcmd -c $cyphertype -p $port -x -l $user $router} reason ]
+ }
+ if { $retval } {
+ send_user "\nError: $sshcmd failed: $reason\n"
exit 1
}
} elseif ![string compare $prog "rsh"] {
- if [ catch {spawn hpfilter rsh -l $user $router} reason ] {
+ if [ catch {spawn hpuifilter rsh -l $user $router} reason ] {
send_user "\nError: rsh failed: $reason\n"
exit 1
}
@@ -353,14 +366,17 @@ proc login { router user userpswd passwd enapasswd cmethod cyphertype } {
if !$progs {
send_user "\nError: Connection Refused ($prog)\n"; return 1
}
- } eof { send_user "\nError: Couldn't login\n"; wait; return 1
- } -nocase "unknown host\r" {
+ }
+ eof { send_user "\nError: Couldn't login\n"; wait; return 1 }
+ -nocase "unknown host\r" {
catch {close};
send_user "\nError: Unknown host\n"; wait; return 1
- } "Host is unreachable" {
+ }
+ "Host is unreachable" {
catch {close};
send_user "\nError: Host Unreachable!\n"; wait; return 1
- } "No address associated with name" {
+ }
+ "No address associated with name" {
catch {close};
send_user "\nError: Unknown host\n"; wait; return 1
}
@@ -542,7 +558,9 @@ foreach router [lrange $argv $i end] {
# Since autoenable is off by default, if we have it defined, it
# was done on the command line. If it is not specifically set on the
# command line, check the password file.
- if $autoenable {
+ if $avautoenable {
+ set autoenable 1
+ set enable 0
set prompt "#"
} else {
set ae [find autoenable $router]
@@ -565,15 +583,15 @@ foreach router [lrange $argv $i end] {
if { $do_passwd || $do_enapasswd } {
set pswd [find password $router]
if { [llength $pswd] == 0 } {
- send_user "Error: no password for $router in $password_file.\n"
+ send_user "\nError: no password for $router in $password_file.\n"
continue
}
if { $enable && $do_enapasswd && $autoenable == 0 && [llength $pswd] < 2 } {
- send_user "Error: no enable password for $router in $password_file.\n"
+ send_user "\nError: no enable password for $router in $password_file.\n"
continue
}
- set passwd [lindex $pswd 0]
- set enapasswd [lindex $pswd 1]
+ set passwd [join [lindex $pswd 0] ""]
+ set enapasswd [join [lindex $pswd 1] ""]
}
# Figure out username
@@ -581,7 +599,7 @@ foreach router [lrange $argv $i end] {
# command line username
set ruser $username
} else {
- set ruser [find user $router]
+ set ruser [join [find user $router] ""]
if { "$ruser" == "" } { set ruser $default_user }
}
@@ -590,7 +608,7 @@ foreach router [lrange $argv $i end] {
# command line username
set userpswd $userpasswd
} else {
- set userpswd [find userpassword $router]
+ set userpswd [join [find userpassword $router] ""]
if { "$userpswd" == "" } { set userpswd $passwd }
}
@@ -599,7 +617,7 @@ foreach router [lrange $argv $i end] {
# command line enausername
set enauser $enausername
} else {
- set enauser [find enauser $router]
+ set enauser [join [find enauser $router] ""]
if { "$enauser" == "" } { set enauser $ruser }
}
@@ -608,19 +626,19 @@ foreach router [lrange $argv $i end] {
if { "$u_prompt" == "" } {
set u_prompt "(Username|login|user name):"
} else {
- set u_prompt [lindex $u_prompt 0]
+ set u_prompt [join [lindex $u_prompt 0] ""]
}
set p_prompt [find passprompt $router]
if { "$p_prompt" == "" } {
set p_prompt "(\[Pp]assword|passwd):"
} else {
- set p_prompt [lindex $p_prompt 0]
+ set p_prompt [join [lindex $p_prompt 0] ""]
}
set e_prompt [find enableprompt $router]
if { "$e_prompt" == "" } {
set e_prompt "\[Pp]assword:"
} else {
- set e_prompt [lindex $e_prompt 0]
+ set e_prompt [join [lindex $e_prompt 0] ""]
}
# Figure out cypher type
@@ -636,6 +654,16 @@ foreach router [lrange $argv $i end] {
set cmethod [find method $router]
if { "$cmethod" == "" } { set cmethod {{telnet} {ssh}} }
+ # Figure out the SSH executable name
+ set sshcmd [find sshcmd $router]
+ if { "$sshcmd" == "" } { set sshcmd {ssh} }
+
+ # Adjust our path to find hpuifilter
+ regexp {(.*)/[^/]+} $argv0 junk hpf_path
+ if { "$hpf_path" != "" && "$hpf_path" != "." } {
+ append env(PATH) ":$hpf_path"
+ }
+
# Login to the router
if {[login $router $ruser $userpswd $passwd $enapasswd $cmethod $cyphertype]} {
continue
diff --git a/bin/hpfilter.c b/bin/hpuifilter.c
index 83d799e..8f7005a 100644
--- a/bin/hpfilter.c
+++ b/bin/hpuifilter.c
@@ -1,21 +1,26 @@
/*
- * Copyright (C) 1997-2002 by Henry Kilmer, Erik Sherk and Pete Whiting.
+ * $Id: hpuifilter.c,v 1.17 2004/01/11 03:49:13 heas Exp $
+ *
+ * Copyright (C) 1997-2004 by Terrapin Communications, Inc.
* All rights reserved.
*
- * This software may be freely copied, modified and redistributed without
- * fee for non-commerical purposes provided that this copyright notice is
- * preserved intact on all copies and modified copies.
+ * This software may be freely copied, modified and redistributed
+ * without fee for non-commerical purposes provided that this license
+ * remains intact and unmodified with any RANCID distribution.
*
* There is no warranty or other guarantee of fitness of this software.
- * It is provided solely "as is". The author(s) disclaim(s) all
+ * It is provided solely "as is". The author(s) disclaim(s) all
* responsibility and liability with respect to this software's usage
* or its effect upon hardware, computer systems, other software, or
* anything else.
*
+ * Except where noted otherwise, rancid was written by and is maintained by
+ * Henry Kilmer, John Heasley, Andrew Partan, Pete Whiting, and Austin Schutz.
*
- * run telnet or ssh to connect to device specified on the command line. the
+ * Run telnet or ssh to connect to device specified on the command line. The
* point of hpfilter is to filter all the bloody vt100 (curses) escape codes
- * that the HP procurve switches belch and make hlogin a real bitch.
+ * that the HP procurve switches belch out, which are a real bitch to handle
+ * in hlogin.
*/
#define DFLT_TO 60 /* default timeout */
@@ -83,7 +88,7 @@ main(int argc, char **argv)
return(EX_USAGE);
}
- if (argc - optind != 2) {
+ if (argc - optind < 2) {
usage();
return(EX_USAGE);
}
@@ -382,16 +387,14 @@ void
usage(void)
{
fprintf(stderr,
-"usage: %s [-hv] <telnet|ssh> <hostname>
-", progname);
+"usage: %s [-hv] <telnet|ssh> [<ssh options>] <hostname> [<telnet_port>]\n",
+ progname);
return;
}
void
vers(void)
{
- fprintf(stderr,
-"%s: %s version %s
-", progname, package, version);
+ fprintf(stderr, "%s: %s version %s\n", progname, package, version);
return;
}
diff --git a/bin/hrancid.in b/bin/hrancid.in
index d0bcc55..fa048ce 100755..100644
--- a/bin/hrancid.in
+++ b/bin/hrancid.in
@@ -1,29 +1,33 @@
-#!@PERLV_PATH@
+#! @PERLV_PATH@
##
-## Amazingly hacked version of Hank's rancid - this one tries to
-## deal with HP procurves.
+## $Id: hrancid.in,v 1.17 2004/01/11 03:49:13 heas Exp $
##
-## Copyright (C) 1997-2001 by Henry Kilmer.
+## Copyright (C) 1997-2004 by Terrapin Communications, Inc.
## All rights reserved.
##
-## This software may be freely copied, modified and redistributed without
-## fee for non-commerical purposes provided that this copyright notice is
-## preserved intact on all copies and modified copies.
+## This software may be freely copied, modified and redistributed
+## without fee for non-commerical purposes provided that this license
+## remains intact and unmodified with any RANCID distribution.
##
## There is no warranty or other guarantee of fitness of this software.
-## It is provided solely "as is". The author(s) disclaim(s) all
+## It is provided solely "as is". The author(s) disclaim(s) all
## responsibility and liability with respect to this software's usage
## or its effect upon hardware, computer systems, other software, or
## anything else.
##
+## Except where noted otherwise, rancid was written by and is maintained by
+## Henry Kilmer, John Heasley, Andrew Partan, Pete Whiting, and Austin Schutz.
##
#
+# Amazingly hacked version of Hank's rancid - this one tries to
+# deal with HP procurves.
+#
# RANCID - Really Awesome New Cisco confIg Differ
#
# usage: rancid [-d] [-l] [-f filename | $host]
#
use Getopt::Std;
-getopts('dflm');
+getopts('dfl');
$log = $opt_l;
$debug = $opt_d;
$file = $opt_f;
@@ -334,7 +338,7 @@ sub WriteTerm {
ProcessHistory("","","",";$_") && next;
- # the rest are from rancid (ie: cisco), but suspect they will someday
+ # the rest are from rancid (i.e.: cisco), but suspect they will someday
# be applicable or close to it.
/^tftp-server flash / && next; # kill any tftp remains
@@ -493,8 +497,12 @@ TOP: while(<INPUT>) {
}
while (/#\s*($cmds_regexp)\s*$/) {
$cmd = $1;
- if (!defined($prompt)) {$prompt = ($_ =~ /^([^#]+)/)[0];
- $prompt .= "[#>]"; }
+ if (!defined($prompt)) {
+ $prompt = ($_ =~ /^([^#]+)/)[0];
+ $prompt =~ s/([][}{)(\\])/\\$1/g;
+ $prompt .= "[#>]";
+ print STDERR ("PROMPT MATCH: $prompt\n") if ($debug);
+ }
print STDERR ("HIT COMMAND:$_") if ($debug);
if (! defined($commands{$cmd})) {
print STDERR "$host: found unexpected command - \"$cmd\"\n";
diff --git a/bin/htlogin.in b/bin/htlogin.in
new file mode 100644
index 0000000..8e9c5f5
--- /dev/null
+++ b/bin/htlogin.in
@@ -0,0 +1,492 @@
+#! @EXPECT_PATH@ --
+##
+## $Id: htlogin.in,v 1.7 2004/01/11 05:39:15 heas Exp $
+##
+## Copyright (C) 1997-2004 by Terrapin Communications, Inc.
+## All rights reserved.
+##
+## This software may be freely copied, modified and redistributed
+## without fee for non-commerical purposes provided that this license
+## remains intact and unmodified with any RANCID distribution.
+##
+## There is no warranty or other guarantee of fitness of this software.
+## It is provided solely "as is". The author(s) disclaim(s) all
+## responsibility and liability with respect to this software's usage
+## or its effect upon hardware, computer systems, other software, or
+## anything else.
+##
+## Except where noted otherwise, rancid was written by and is maintained by
+## Henry Kilmer, John Heasley, Andrew Partan, Pete Whiting, and Austin Schutz.
+##
+#
+# The login expect scripts were based on Erik Sherk's gwtn, by permission.
+#
+# htlogin - Hitachi router login
+#
+# Most options are intuitive for logging into an Hitachi router login.
+#
+
+# Usage line
+set usage "Usage: $argv0 \[-noenable\] \[-c command\] \
+\[-Evar=x\] \[-f cloginrc-file\] \[-p user-password\] \
+\[-s script-file\] \[-t timeout\] \[-u username\] \
+\[-v vty-password\] \[-w enable-username\] \[-x command-file\] \
+\[-y ssh_cypher_type\] router \[router...\]\n"
+
+# env(CLOGIN) may contain:
+# x == do not set xterm banner or name
+
+# Password file
+set password_file $env(HOME)/.cloginrc
+# Default is to login to the router
+set do_command 0
+set do_script 0
+# The default is to automatically enable
+set enable 1
+# The default is that you login non-enabled (tacacs can have you login already
+# enabled)
+set avautoenable 0
+# The default is to look in the password file to find the passwords. This
+# tracks if we receive them on the command line.
+set do_passwd 1
+
+# Find the user in the ENV, or use the unix userid.
+if {[ info exists env(CISCO_USER) ] } {
+ set default_user $env(CISCO_USER)
+} elseif {[ info exists env(USER) ]} {
+ set default_user $env(USER)
+} elseif {[ info exists env(LOGNAME) ]} {
+ set default_user $env(LOGNAME)
+} else {
+ # This uses "id" which I think is portable. At least it has existed
+ # (without options) on all machines/OSes I've been on recently -
+ # unlike whoami or id -nu.
+ if [ catch {exec id} reason ] {
+ send_error "\nError: could not exec id: $reason\n"
+ exit 1
+ }
+ regexp {\(([^)]*)} "$reason" junk default_user
+}
+
+# Sometimes routers take awhile to answer (the default is 10 sec)
+set timeout 45
+
+# Process the command line
+for {set i 0} {$i < $argc} {incr i} {
+ set arg [lindex $argv $i]
+
+ switch -glob -- $arg {
+ # Username
+ -u* -
+ -U* {
+ if {! [ regexp .\[uU\](.+) $arg ignore user]} {
+ incr i
+ set username [ lindex $argv $i ]
+ }
+ # VTY Password
+ } -p* -
+ -P* {
+ if {! [ regexp .\[pP\](.+) $arg ignore userpasswd]} {
+ incr i
+ set userpasswd [ lindex $argv $i ]
+ }
+ set do_passwd 0
+ # VTY Password
+ } -v* -
+ -v* {
+ if {! [ regexp .\[vV\](.+) $arg ignore passwd]} {
+ incr i
+ set passwd [ lindex $argv $i ]
+ }
+ set do_passwd 0
+ # Enable Username
+ } -w* -
+ -W* {
+ # ignore -w
+ # Environment variable to pass to -s scripts
+ } -E*
+ {
+ if {[ regexp .\[E\](.+)=(.+) $arg ignore varname varvalue]} {
+ set E$varname $varvalue
+ } else {
+ send_user "Error: invalid format for -E in $arg\n"
+ exit 1
+ }
+ # Enable Password
+ } -e*
+ {
+ # ignore -e
+ # Command to run.
+ } -c* -
+ -C* {
+ if {! [ regexp .\[cC\](.+) $arg ignore command]} {
+ incr i
+ set command [ lindex $argv $i ]
+ }
+ set do_command 1
+ # Expect script to run.
+ } -s* -
+ -S* {
+ if {! [ regexp .\[sS\](.+) $arg ignore sfile]} {
+ incr i
+ set sfile [ lindex $argv $i ]
+ }
+ if { ! [ file readable $sfile ] } {
+ send_user "\nError: Can't read $sfile\n"
+ exit 1
+ }
+ set do_script 1
+ # 'ssh -c' cypher type
+ } -y* -
+ -Y* {
+ if {! [ regexp .\[eE\](.+) $arg ignore cypher]} {
+ incr i
+ set cypher [ lindex $argv $i ]
+ }
+ # alternate cloginrc file
+ } -f* -
+ -F* {
+ if {! [ regexp .\[fF\](.+) $arg ignore password_file]} {
+ incr i
+ set password_file [ lindex $argv $i ]
+ }
+ # Timeout
+ } -t* -
+ -T* {
+ if {! [ regexp .\[tT\](.+) $arg ignore timeout]} {
+ incr i
+ set timeout [ lindex $argv $i ]
+ }
+ # Command file
+ } -x* -
+ -X {
+ if {! [ regexp .\[xX\](.+) $arg ignore cmd_file]} {
+ incr i
+ set cmd_file [ lindex $argv $i ]
+ }
+ if [ catch {set cmd_fd [open $cmd_file r]} reason ] {
+ send_user "\nError: $reason\n"
+ exit 1
+ }
+ set cmd_text [read $cmd_fd]
+ close $cmd_fd
+ set command [join [split $cmd_text \n] \;]
+ set do_command 1
+ # Do we enable?
+ } -noenable {
+ # ignore -noenable
+ # Does tacacs automatically enable us?
+ } -autoenable {
+ # ignore -autoenable
+ } -* {
+ send_user "\nError: Unknown argument! $arg\n"
+ send_user $usage
+ exit 1
+ } default {
+ break
+ }
+ }
+}
+# Process routers...no routers listed is an error.
+if { $i == $argc } {
+ send_user "\nError: $usage"
+}
+
+# Only be quiet if we are running a script (it can log its output
+# on its own)
+if { $do_script } {
+ log_user 0
+} else {
+ log_user 1
+}
+
+#
+# Done configuration/variable setting. Now run with it...
+#
+
+# Sets Xterm title if interactive...if its an xterm and the user cares
+proc label { host } {
+ global env
+ # if CLOGIN has an 'x' in it, don't set the xterm name/banner
+ if [info exists env(CLOGIN)] {
+ if {[string first "x" $env(CLOGIN)] != -1} { return }
+ }
+ # take host from ENV(TERM)
+ if [info exists env(TERM)] {
+ if [regexp \^(xterm|vs) $env(TERM) ignore ] {
+ send_user "\033]1;[lindex [split $host "."] 0]\a"
+ send_user "\033]2;$host\a"
+ }
+ }
+}
+
+# This is a helper function to make the password file easier to
+# maintain. Using this the password file has the form:
+# add password sl* pete cow
+# add password at* steve
+# add password * hanky-pie
+proc add {var args} { global int_$var ; lappend int_$var $args}
+proc include {args} {
+ global env
+ regsub -all "(^{|}$)" $args {} args
+ if { [ regexp "^/" $args ignore ] == 0 } {
+ set args $env(HOME)/$args
+ }
+ source_password_file $args
+}
+
+proc find {var router} {
+ upvar int_$var list
+ if { [info exists list] } {
+ foreach line $list {
+ if { [string match [lindex $line 0] $router ] } {
+ return [lrange $line 1 end]
+ }
+ }
+ }
+ return {}
+}
+
+# Loads the password file. Note that as this file is tcl, and that
+# it is sourced, the user better know what to put in there, as it
+# could install more than just password info... I will assume however,
+# that a "bad guy" could just as easy put such code in the clogin
+# script, so I will leave .cloginrc as just an extention of that script
+proc source_password_file { password_file } {
+ global env
+ if { ! [file exists $password_file] } {
+ send_user "\nError: password file ($password_file) does not exist\n"
+ exit 1
+ }
+ file stat $password_file fileinfo
+ if { [expr ($fileinfo(mode) & 007)] != 0000 } {
+ send_user "\nError: $password_file must not be world readable/writable\n"
+ exit 1
+ }
+ if [ catch {source $password_file} reason ] {
+ send_user "\nError: $reason\n"
+ exit 1
+ }
+}
+
+# Log into the router.
+proc login { router user userpswd passwd prompt cmethod cyphertype } {
+ global spawn_id in_proc do_command do_script
+ global u_prompt p_prompt
+ set in_proc 1
+ set uprompt_seen 0
+
+ # try each of the connection methods in $cmethod until one is successful
+ set progs [llength $cmethod]
+ foreach prog [lrange $cmethod 0 end] {
+ if [string match "telnet*" $prog] {
+ regexp {telnet(:([^[:space:]]+))*} $prog command suffix port
+ if {"$port" == ""} {
+ set retval [ catch {spawn telnet $router} reason ]
+ } else {
+ set retval [ catch {spawn telnet $router $port} reason ]
+ }
+ if { $retval } {
+ send_user "\nError: telnet failed: $reason\n"
+ exit 1
+ }
+ } else {
+ puts "\nError: unknown connection method: $prog"
+ return 1
+ }
+ incr progs -1
+ sleep 0.3
+
+ # This helps cleanup each expect clause.
+ expect_after {
+ timeout {
+ send_user "\nError: TIMEOUT reached\n"
+ catch {close}; wait
+ if { $in_proc} {
+ return 1
+ } else {
+ continue
+ }
+ } eof {
+ send_user "\nError: EOF received\n"
+ catch {close}; wait
+ if { $in_proc} {
+ return 1
+ } else {
+ continue
+ }
+ }
+ }
+
+ expect {
+ "Connection refused" {
+ close; wait
+ sleep 0.3
+ expect eof
+ send_user "\nError: Connection Refused\n"; wait; return 1
+ } eof { send_user "\nError: Couldn't login\n"; wait; return 1
+ } "Unknown host\r\n" {
+ expect eof
+ send_user "\nError: Unknown host\n"; wait; return 1
+ } "Host is unreachable" {
+ expect eof
+ send_user "\nError: Host Unreachable!\n"; wait; return 1
+ } "No address associated with name" {
+ expect eof
+ send_user "\nError: Unknown host\n"; wait; return 1
+ }
+ -re "$u_prompt" {
+ send "$user\r"
+ set uprompt_seen 1
+ exp_continue
+ }
+ -re "$p_prompt" {
+ sleep 1
+ if {$uprompt_seen == 1} {
+ send "$userpswd\r"
+ } else {
+ send "$passwd\r"
+ }
+ exp_continue
+ }
+ "Password incorrect" { send_user "\nError: Check your password for $router\n";
+ catch {close}; wait; return 1
+ }
+ "$prompt" { break; }
+ denied { send_user "\nError: Check your passwd for $router\n"
+ catch {close}; wait; return 1
+ }
+ "\r\n" { exp_continue; }
+ }
+ }
+ set in_proc 0
+ return 0
+}
+
+# Run commands given on the command line.
+proc run_commands { prompt command } {
+ global in_proc
+ set in_proc 1
+
+ # Is this a multi-command?
+ if [ string match "*\;*" "$command" ] {
+ set commands [split $command \;]
+ set num_commands [llength $commands]
+
+ for {set i 0} {$i < $num_commands} { incr i} {
+ send "[lindex $commands $i]\r"
+ expect {
+ -re "^\[^\n\r]*$prompt" {}
+ -re "^\[^\n\r *]*$prompt" {}
+ -re "\[\n\r]" { exp_continue }
+ }
+ }
+ } else {
+ send "$command\r"
+ expect {
+ -re "^\[^\n\r]*$prompt" {}
+ -re "^\[^\n\r *]*$prompt" {}
+ -re "\[\n\r]" { exp_continue }
+ }
+ }
+ send "exit\r"
+ expect {
+ "\n" { exp_continue }
+ timeout { return 0 }
+ eof { return 0 }
+ }
+ set in_proc 0
+}
+
+#
+# For each router... (this is main loop)
+#
+source_password_file $password_file
+set in_proc 0
+foreach router [lrange $argv $i end] {
+ set router [string tolower $router]
+ send_user "$router\n"
+
+ # Figure out prompt.
+ set prompt "command: "
+ set autoenable 1
+ set enable 0
+
+ # Figure out passwords
+ if { $do_passwd } {
+ set pswd [find password $router]
+ if { [llength $pswd] == 0 } {
+ send_user "Error: no password for $router in $password_file.\n"
+ continue
+ }
+ set passwd [join [lindex $pswd 0] ""]
+ }
+
+ # Figure out username
+ if {[info exists username]} {
+ # command line username
+ set ruser $username
+ } else {
+ set ruser [join [find user $router] ""]
+ if { "$ruser" == "" } { set ruser $default_user }
+ }
+
+ # Figure out username's password (if different from the vty password)
+ if {[info exists userpasswd]} {
+ # command line username
+ set userpswd $userpasswd
+ } else {
+ set userpswd [join [find userpassword $router] ""]
+ if { "$userpswd" == "" } { set userpswd $passwd }
+ }
+
+ # Figure out prompts
+ set u_prompt [find userprompt $router]
+ if { "$u_prompt" == "" } {
+ set u_prompt "(Username|login| Login):"
+ } else {
+ set u_prompt [join [lindex $u_prompt 0] ""]
+ }
+ set p_prompt [find passprompt $router]
+ if { "$p_prompt" == "" } {
+ set p_prompt "\[Pp]assword:"
+ } else {
+ set p_prompt [join [lindex $p_prompt 0] ""]
+ }
+
+ # Figure out cypher type
+ if {[info exists cypher]} {
+ # command line cypher type
+ set cyphertype $cypher
+ } else {
+ set cyphertype [find cyphertype $router]
+ if { "$cyphertype" == "" } { set cyphertype "3des" }
+ }
+
+ # Figure out connection method
+ set cmethod [find method $router]
+ if { "$cmethod" == "" } { set cmethod {{telnet}} }
+
+ # Login to the router
+ if {[login $router $ruser $userpswd $passwd $prompt $cmethod $cyphertype]} {
+ continue
+ }
+
+ if { $do_command } {
+ if {[run_commands $prompt $command]} {
+ continue
+ }
+ } elseif { $do_script } {
+ source $sfile
+ close
+ } else {
+ label $router
+ log_user 1
+ interact
+ }
+
+ # End of for each router
+ wait
+ sleep 0.3
+}
+exit 0
diff --git a/bin/htrancid.in b/bin/htrancid.in
new file mode 100644
index 0000000..2b2eaaa
--- /dev/null
+++ b/bin/htrancid.in
@@ -0,0 +1,266 @@
+#! @PERLV_PATH@
+##
+## $Id: htrancid.in,v 1.5 2004/01/11 03:49:13 heas Exp $
+##
+## Copyright (C) 1997-2004 by Terrapin Communications, Inc.
+## All rights reserved.
+##
+## This software may be freely copied, modified and redistributed
+## without fee for non-commerical purposes provided that this license
+## remains intact and unmodified with any RANCID distribution.
+##
+## There is no warranty or other guarantee of fitness of this software.
+## It is provided solely "as is". The author(s) disclaim(s) all
+## responsibility and liability with respect to this software's usage
+## or its effect upon hardware, computer systems, other software, or
+## anything else.
+##
+## Except where noted otherwise, rancid was written by and is maintained by
+## Henry Kilmer, John Heasley, Andrew Partan, Pete Whiting, and Austin Schutz.
+##
+#
+# hacked version of Hank's rancid - this one tries to deal with Hitachi's.
+#
+# RANCID - Really Awesome New Cisco confIg Differ
+#
+# usage: htrancid [-d] [-l] [-f filename | $host]
+#
+use Getopt::Std;
+getopts('dfl');
+$log = $opt_l;
+$debug = $opt_d;
+$file = $opt_f;
+$host = $ARGV[0];
+$clean_run = 0;
+$found_end = 0;
+$timeo = 90; # blogin timeout in seconds
+
+my(%filter_pwds); # password filtering mode
+
+# This routine is used to print out the router configuration
+sub ProcessHistory {
+ my($new_hist_tag,$new_command,$command_string,@string)=(@_);
+ if((($new_hist_tag ne $hist_tag) || ($new_command ne $command))
+ && defined %history) {
+ print eval "$command \%history";
+ undef %history;
+ }
+ if (($new_hist_tag) && ($new_command) && ($command_string)) {
+ if ($history{$command_string}) {
+ $history{$command_string} = "$history{$command_string}@string";
+ } else {
+ $history{$command_string} = "@string";
+ }
+ } elsif (($new_hist_tag) && ($new_command)) {
+ $history{++$#history} = "@string";
+ } else {
+ print "@string";
+ }
+ $hist_tag = $new_hist_tag;
+ $command = $new_command;
+ 1;
+}
+
+sub numerically { $a <=> $b; }
+
+# This is a sort routing that will sort numerically on the
+# keys of a hash as if it were a normal array.
+sub keynsort {
+ local(%lines)=@_;
+ local($i) = 0;
+ local(@sorted_lines);
+ foreach $key (sort numerically keys(%lines)) {
+ $sorted_lines[$i] = $lines{$key};
+ $i++;
+ }
+ @sorted_lines;
+}
+
+# This is a sort routing that will sort on the
+# keys of a hash as if it were a normal array.
+sub keysort {
+ local(%lines)=@_;
+ local($i) = 0;
+ local(@sorted_lines);
+ foreach $key (sort keys(%lines)) {
+ $sorted_lines[$i] = $lines{$key};
+ $i++;
+ }
+ @sorted_lines;
+}
+
+# This is a sort routing that will sort on the
+# values of a hash as if it were a normal array.
+sub valsort{
+ local(%lines)=@_;
+ local($i) = 0;
+ local(@sorted_lines);
+ foreach $key (sort values %lines) {
+ $sorted_lines[$i] = $key;
+ $i++;
+ }
+ @sorted_lines;
+}
+
+# This is a numerical sort routing (ascending).
+sub numsort {
+ local(%lines)=@_;
+ local($i) = 0;
+ local(@sorted_lines);
+ foreach $num (sort {$a <=> $b} keys %lines) {
+ $sorted_lines[$i] = $lines{$num};
+ $i++;
+ }
+ @sorted_lines;
+}
+
+# This is a sort routine that will sort on the
+# ip address when the ip address is anywhere in
+# the strings.
+sub ipsort {
+ local(%lines)=@_;
+ local($i) = 0;
+ local(@sorted_lines);
+ foreach $addr (sort sortbyipaddr keys %lines) {
+ $sorted_lines[$i] = $lines{$addr};
+ $i++;
+ }
+ @sorted_lines;
+}
+
+# These two routines will sort based upon IP addresses
+sub ipaddrval {
+ my(@a) = ($_[0] =~ m#^(\d+)\.(\d+)\.(\d+)\.(\d+)$#);
+ $a[3]+256*($a[2]+256*($a[1]+256*$a[0]));
+}
+sub sortbyipaddr {
+ &ipaddrval($a) <=> &ipaddrval($b);
+}
+
+# This routine parses "show config"
+sub ShowConfig {
+ print STDERR " In ShowConfig: $_" if ($debug);
+
+ while (<INPUT>) {
+ tr/\015//d;
+ last if (/^$prompt/);
+ next if (/^(\s*|\s*$cmd\s*)$/);
+ ProcessHistory("","","","$_");
+ }
+ return(0);
+}
+
+# This routine parses single command's that return no required info
+sub ShowVersion {
+ print STDERR " In ShowVersion: $_" if ($debug);
+
+ while (<INPUT>) {
+ tr/\015//d;
+ last if (/^$prompt/);
+ next if (/^(\s*|\s*$cmd\s*)$/);
+ }
+ return(0)
+}
+
+# dummy function
+sub DoNothing {print STDOUT;}
+
+# Main
+%commands=(
+ 'version -a' => "ShowVersion",
+ 'cat /config/router.cnf' => "ShowConfig"
+);
+# keys() doesnt return things in the order entered and the order of the
+# cmds is important (show version first and write term last). pita
+@commands=(
+ "version -a",
+ "cat /config/router.cnf"
+);
+$cisco_cmds=join(";",@commands);
+$cmds_regexp=join("|",@commands);
+
+open(OUTPUT,">$host.new") || die "Can't open $host.new for writing: $!\n";
+select(OUTPUT);
+# make OUTPUT unbuffered if debugging
+if ($debug) { $| = 1; }
+
+if ($file) {
+ print STDERR "opening file $host\n" if ($debug);
+ print STDOUT "opening file $host\n" if ($log);
+ open(INPUT,"<$host") || die "open failed for $host: $!\n";
+} else {
+ print STDERR "executing htlogin -t $timeo -c\"$cisco_cmds\" $host\n" if ($debug);
+ print STDOUT "executing htlogin -t $timeo -c\"$cisco_cmds\" $host\n" if ($log);
+ if (defined($ENV{NOPIPE})) {
+ system "htlogin -t $timeo -c \"$cisco_cmds\" $host </dev/null > $host.raw 2>&1" || die "htlogin failed for $host: $!\n";
+ open(INPUT, "< $host.raw") || die "htlogin failed for $host: $!\n";
+ } else {
+ open(INPUT,"htlogin -t $timeo -c \"$cisco_cmds\" $host </dev/null |") || die "htlogin failed for $host: $!\n";
+ }
+}
+
+# determine password filtering mode
+if ($ENV{"FILTER_PWDS"} =~ /no/i) {
+ $filter_pwds = 0;
+} elsif ($ENV{"FILTER_PWDS"} =~ /all/i) {
+ $filter_pwds = 2;
+} else {
+ $filter_pwds = 1;
+}
+
+ProcessHistory("","","","!RANCID-CONTENT-TYPE: hitachi\n!\n");
+TOP: while(<INPUT>) {
+ tr/\015//d;
+ if (/^.*logout$/) {
+ $clean_run=1;
+ last;
+ }
+ if (/^Error:/) {
+ print STDOUT ("$host htlogin error: $_");
+ print STDERR ("$host htlogin error: $_") if ($debug);
+ $clean_run=0;
+ last;
+ }
+ while (/command:\s*($cmds_regexp)\s*$/) {
+ $cmd = $1;
+ if (!defined($prompt)) {
+ $prompt = ($_ =~ /^([^:]+:)/)[0];
+ }
+ print STDERR ("HIT COMMAND:$_") if ($debug);
+ if (! defined($commands{$cmd})) {
+ print STDERR "$host: found unexpected command - \"$cmd\"\n";
+ $clean_run = 0;
+ last TOP;
+ }
+ $rval = &{$commands{$cmd}};
+ delete($commands{$cmd});
+ if ($rval == -1) {
+ $clean_run = 0;
+ last TOP;
+ }
+ }
+}
+print STDOUT "Done $logincmd: $_\n" if ($log);
+# Flush History
+ProcessHistory("","","","");
+# Cleanup
+close(INPUT);
+close(OUTPUT);
+
+if (defined($ENV{NOPIPE})) {
+ unlink("$host.raw") if (! $debug);
+}
+
+# check for completeness
+if (scalar(%commands) || !$clean_run ) {
+ if (scalar(%commands)) {
+ printf(STDOUT "$host: missed cmd(s): %s\n", join(',', keys(%commands)));
+ printf(STDERR "$host: missed cmd(s): %s\n", join(',', keys(%commands))) if ($debug);
+ }
+ if (!$clean_run ) {
+ print STDOUT "$host: End of run not found\n";
+ print STDERR "$host: End of run not found\n" if ($debug);
+ system("/usr/bin/tail -1 $host.new");
+ }
+ unlink "$host.new" if (! $debug);
+}
diff --git a/bin/jerancid.in b/bin/jerancid.in
new file mode 100644
index 0000000..1b72737
--- /dev/null
+++ b/bin/jerancid.in
@@ -0,0 +1,645 @@
+#! @PERLV_PATH@
+##
+## $Id: jerancid.in,v 1.25 2004/01/11 03:49:13 heas Exp $
+##
+## Copyright (C) 1997-2004 by Terrapin Communications, Inc.
+## All rights reserved.
+##
+## This software may be freely copied, modified and redistributed
+## without fee for non-commerical purposes provided that this license
+## remains intact and unmodified with any RANCID distribution.
+##
+## There is no warranty or other guarantee of fitness of this software.
+## It is provided solely "as is". The author(s) disclaim(s) all
+## responsibility and liability with respect to this software's usage
+## or its effect upon hardware, computer systems, other software, or
+## anything else.
+##
+## Except where noted otherwise, rancid was written by and is maintained by
+## Henry Kilmer, John Heasley, Andrew Partan, Pete Whiting, and Austin Schutz.
+##
+#
+# jerancid - tries to deal with Juniper ERXs.
+#
+# RANCID - Really Awesome New Cisco confIg Differ
+#
+# usage: rancid [-d] [-l] [-f filename | $host]
+#
+use Getopt::Std;
+getopts('dfl');
+$log = $opt_l;
+$debug = $opt_d;
+$file = $opt_f;
+$host = $ARGV[0];
+$clean_run = 0;
+$found_end = 0;
+$timeo = 90; # clogin timeout in seconds
+
+my(%filter_pwds); # password filtering mode
+
+# This routine is used to print out the router configuration
+sub ProcessHistory {
+ my($new_hist_tag,$new_command,$command_string,@string)=(@_);
+ if((($new_hist_tag ne $hist_tag) || ($new_command ne $command))
+ && defined %history) {
+ print eval "$command \%history";
+ undef %history;
+ }
+ if (($new_hist_tag) && ($new_command) && ($command_string)) {
+ if ($history{$command_string}) {
+ $history{$command_string} = "$history{$command_string}@string";
+ } else {
+ $history{$command_string} = "@string";
+ }
+ } elsif (($new_hist_tag) && ($new_command)) {
+ $history{++$#history} = "@string";
+ } else {
+ print "@string";
+ }
+ $hist_tag = $new_hist_tag;
+ $command = $new_command;
+ 1;
+}
+
+sub numerically { $a <=> $b; }
+
+# This is a sort routing that will sort numerically on the
+# keys of a hash as if it were a normal array.
+sub keynsort {
+ local(%lines)=@_;
+ local($i) = 0;
+ local(@sorted_lines);
+ foreach $key (sort numerically keys(%lines)) {
+ $sorted_lines[$i] = $lines{$key};
+ $i++;
+ }
+ @sorted_lines;
+}
+
+# This is a sort routing that will sort on the
+# keys of a hash as if it were a normal array.
+sub keysort {
+ local(%lines)=@_;
+ local($i) = 0;
+ local(@sorted_lines);
+ foreach $key (sort keys(%lines)) {
+ $sorted_lines[$i] = $lines{$key};
+ $i++;
+ }
+ @sorted_lines;
+}
+
+# This is a sort routing that will sort on the
+# values of a hash as if it were a normal array.
+sub valsort{
+ local(%lines)=@_;
+ local($i) = 0;
+ local(@sorted_lines);
+ foreach $key (sort values %lines) {
+ $sorted_lines[$i] = $key;
+ $i++;
+ }
+ @sorted_lines;
+}
+
+# This is a numerical sort routing (ascending).
+sub numsort {
+ local(%lines)=@_;
+ local($i) = 0;
+ local(@sorted_lines);
+ foreach $num (sort {$a <=> $b} keys %lines) {
+ $sorted_lines[$i] = $lines{$num};
+ $i++;
+ }
+ @sorted_lines;
+}
+
+# This is a sort routine that will sort on the
+# ip address when the ip address is anywhere in
+# the strings.
+sub ipsort {
+ local(%lines)=@_;
+ local($i) = 0;
+ local(@sorted_lines);
+ foreach $addr (sort sortbyipaddr keys %lines) {
+ $sorted_lines[$i] = $lines{$addr};
+ $i++;
+ }
+ @sorted_lines;
+}
+
+# These two routines will sort based upon IP addresses
+sub ipaddrval {
+ my(@a) = ($_[0] =~ m#^(\d+)\.(\d+)\.(\d+)\.(\d+)$#);
+ $a[3]+256*($a[2]+256*($a[1]+256*$a[0]));
+}
+sub sortbyipaddr {
+ &ipaddrval($a) <=> &ipaddrval($b);
+}
+
+# This routine parses "show version"
+sub ShowVersion {
+ print STDERR " In ShowVersion: $_" if ($debug);
+ my($slots);
+
+ while (<INPUT>) {
+ tr/\015//d;
+ last if(/^$prompt/);
+ next if(/^(\s*|\s*$cmd\s*)$/);
+ next if (/^Please wait/i);
+ return(-1) if (/command authorization failed/i);
+
+ /^Juniper Edge .* (\S+)$/ &&
+ ProcessHistory("COMMENTS","keysort","A1",
+ "!Chassis type: $1 - a $_") && next;
+ /^System Release: / &&
+ ProcessHistory("COMMENTS","keysort","B1", "!$_") && next;
+ /^\s+(Version: .*)$/ &&
+ ProcessHistory("COMMENTS","keysort","B1", "!System $1\n") &&
+ next;
+
+ if (/^(slot .*)\s+slot uptime/i) {
+ ($slots++);
+ ProcessHistory("COMMENTS","keysort","B2", "!\n! $1\n");
+ next;
+ }
+ /^(--.*) --+$/ && $slots &&
+ ProcessHistory("COMMENTS","keysort","B2", "! $1\n") && next;
+ if (/^(\d+ +\S+ +(\S+).*) \S+$/ && $slots) {
+ my($line) = $1;
+ if ($2 != /--+/) {
+ ProcessHistory("COMMENTS","keysort","B3", "! $line\n");
+ }
+ next;
+ }
+ }
+ ProcessHistory("COMMENTS","keysort","B4","!\n");
+ return(0);
+}
+
+# This routine parses "show redundancy"
+sub ShowRedundancy {
+ print STDERR " In ShowRedundancy: $_" if ($debug);
+
+ while (<INPUT>) {
+ tr/\015//d;
+ last if(/^$prompt/);
+ next if(/^(\s*|\s*$cmd\s*)$/);
+ next if (/^Please wait/i);
+
+ ProcessHistory("","","","! $_");
+ }
+ ProcessHistory("","","","!\n");
+ return(0);
+}
+
+# This routine parses "show environment all"
+sub ShowEnv {
+ print STDERR " In ShowEnv: $_" if ($debug);
+
+ while (<INPUT>) {
+ tr/\015//d;
+ last if (/^$prompt/);
+ next if (/^(\s*|\s*$cmd\s*)$/);
+ next if (/^Please wait/i);
+ return(-1) if (/command authorization failed/i);
+
+ # skip the temperature goop
+ if (/processor\s+processor/) {
+ <INPUT>; <INPUT>; <INPUT>;
+ next;
+ }
+ /^\d+\s+\d+\s+\S+/ && next;
+
+ # strip nvs usage
+ s/, \d+% \S+\)/\)/;
+
+ s/^ //;
+ ProcessHistory("COMMENTS","keysort","D1","! $_");
+ }
+ ProcessHistory("COMMENTS","keysort","D1","!\n");
+ return(0);
+}
+
+# This routine parses "show boot"
+sub ShowBoot {
+ print STDERR " In ShowBoot: $_" if ($debug);
+
+ while (<INPUT>) {
+ tr/\015//d;
+ last if (/^$prompt/);
+ next if (/^(\s*|\s*$cmd\s*)$/);
+ next if (/^Please wait/i);
+ next if (/^\s*$/);
+ return(1) if /^\s*\^\s*$/;
+ return(-1) if (/command authorization failed/i);
+ return(1) if /Ambiguous command/i;
+
+ /System Release:\s+(.*)/ &&
+ ProcessHistory("COMMENTS","keysort","C1","!Boot Release: $1\n")
+ && next;
+ /System Configuration:\s+(.*)/ &&
+ ProcessHistory("COMMENTS","keysort","C1",
+ "!Boot Configuration: $1\n") && next;
+
+ ProcessHistory("COMMENTS","keysort","C1","!$_");
+ }
+ ProcessHistory("COMMENTS","keysort","C1","!\n");
+ return(0);
+}
+
+# This routine parses "dir"
+sub DirSlotN {
+ print STDERR " In DirSlotN: $_" if ($debug);
+
+ my($dev) = (/\s([^\s]+):/);
+
+ while (<INPUT>) {
+ tr/\015//d;
+ last if (/^$prompt/);
+ next if (/^(\s*|\s*$cmd\s*)$/);
+ next if (/^Please wait/i);
+ next if (/^system\.log/);
+
+ ProcessHistory("FLASH","","","!Flash: $_");
+ }
+ ProcessHistory("","","","!\n");
+ return(0);
+}
+
+# This routine parses "show hardware"
+sub ShowHardware {
+ print STDERR " In ShowHardware: $_" if ($debug);
+
+ while (<INPUT>) {
+ tr/\015//d;
+ last if (/^$prompt/);
+ next if (/^(\s*|\s*$cmd\s*)$/);
+ next if (/^Please wait/i);
+ # return(1) if ($type =~ /^(12[40]|7[05])/);
+ return(-1) if (/command authorization failed/i);
+ next if (/^Please wait/i);
+
+ # wow...a clean table
+ ProcessHistory("","","","!$_");
+ }
+ ProcessHistory("","","","!\n");
+ return(0);
+}
+
+# This routine processes a "show configuration"
+sub WriteTerm {
+ print STDERR " In WriteTerm: $_" if ($debug);
+ my($lineauto) = 0;
+
+ while (<INPUT>) {
+ tr/\015//d;
+ last if(/^$prompt/);
+ next if (/^Please wait/i);
+ return(-1) if (/command authorization failed/i);
+ /Non-Volatile memory is in use/ && return(-1); # NvRAM is locked
+ $lineauto = 0 if (/^[^ ]/);
+
+ # skip the crap
+ /^! Configuration script /i && next;
+ /^! Copyright /i && next;
+
+ # Dog gone Cool matches to process the rest of the config
+ /^ntp clock-period / && next; # kill ntp clock-period
+ /^ length / && next; # kill length on serial lines
+ /^ width / && next; # kill width on serial lines
+ $lineauto = 1 if /^ modem auto/;
+ /^ speed / && $lineauto && next; # kill speed on serial lines
+ /^ clockrate / && next; # kill clockrate on serial interfaces
+ if (/^(enable )?(password|passwd) / && $filter_pwds >= 1) {
+ ProcessHistory("ENABLE","","","!$1$2 <removed>\n");
+ next;
+ }
+ if (/^(enable secret) / && $filter_pwds >= 2) {
+ ProcessHistory("ENABLE","","","!$1 <removed>\n");
+ next;
+ }
+
+ # XXX: ERX appears to not have local usernames, but leaving these in
+ # case I am wrong.
+ if (/^username (\S+)(\s.*)? secret /) {
+ if ($filter_pwds >= 2) {
+ ProcessHistory("USER","keysort","$1",
+ "!username $1$2 secret <removed>\n");
+ } else {
+ ProcessHistory("USER","keysort","$1","$_");
+ }
+ next;
+ }
+ if (/^username (\S+)(\s.*)? password ((\d) \S+|\S+)/) {
+ if ($filter_pwds == 2) {
+ ProcessHistory("USER","keysort","$1",
+ "!username $1$2 password <removed>\n");
+ } elsif ($filter_pwds == 1 && $4 ne "5"){
+ ProcessHistory("USER","keysort","$1",
+ "!username $1$2 password <removed>\n");
+ } else {
+ ProcessHistory("USER","keysort","$1","$_");
+ }
+ next;
+ }
+
+ if (/^(\s*)password / && $filter_pwds >= 1) {
+ ProcessHistory("LINE-PASS","","","!$1password <removed>\n");
+ next;
+ }
+ if (/^\s*neighbor (\S*) password / && $filter_pwds >= 1) {
+ ProcessHistory("","","","! neighbor $1 password <removed>\n");
+ next;
+ }
+ if (/^(ppp .* password) 7 .*/ && $filter_pwds >= 1) {
+ ProcessHistory("","","","!$1 <removed>\n"); next;
+ }
+ if (/^( ip ospf authentication-key) / && $filter_pwds >= 1) {
+ ProcessHistory("","","","!$1 <removed>\n"); next;
+ }
+ # isis interface passwords
+ if (/^(\s+isis authentication-key \S+)( \d)? \S+/ &&
+ $filter_pwds >= 1) {
+ ProcessHistory("","","","!$1 <removed>$'\n"); next;
+ }
+ if (/^(\s+isis message-digest-key \d+ hmac-md5)( \d)?( \S+)/ &&
+ $filter_pwds >= 1) {
+ ProcessHistory("","","","!$1 <removed>$'"); next;
+ }
+
+ # this is reversable, despite 'md5' in the cmd
+ if (/^(\s+ip ospf authentication-key \S+)( \d)? \S+/ &&
+ $filter_pwds >= 1) {
+ ProcessHistory("","","","!$1 <removed>$'\n"); next;
+ }
+ if (/^(\s+ip ospf message-digest-key \d+ hmac-md5)( \d)?( \S+)/ &&
+ $filter_pwds >= 1) {
+ ProcessHistory("","","","!$1 <removed>$'"); next;
+ }
+ if (/^( ip ospf message-digest-key \d+ md5) / && $filter_pwds >= 1) {
+ ProcessHistory("","","","!$1 <removed>\n"); next;
+ }
+
+ # filter VRRP passwords
+ if (/^(\s+ip vrrp authentication-key \d+)( \d)? \s+ / &&
+ $filter_pwds >= 1) {
+ ProcessHistory("","","","!$1 <removed>\n"); next;
+ }
+
+ # ftp host encrypted password oscillates
+ if (/^(host \S+ \S+ ftp) /) {
+ if ($filter_pwds >= 1 || /^host \S+ \S+ ftp \d /) {
+ ProcessHistory("","","","!$1 <removed>\n"); next;
+ }
+ }
+
+ # sort ip explicit-paths.
+ if (/^ip explicit-path name (\S+)/) {
+ my($key) = $1;
+ my($expath) = $_;
+ while (<INPUT>) {
+ tr/\015//d;
+ last if (/^$prompt/);
+ last if (/^$prompt/ || ! /^(ip explicit-path name |[ !])/);
+ if (/^ip explicit-path name (\S+)/) {
+ ProcessHistory("EXPATH","keysort","$key","$expath");
+ $key = $1;
+ $expath = $_;
+ } else {
+ $expath .= $_;
+ }
+ }
+ ProcessHistory("EXPATH","keysort","$key","$expath");
+ }
+ # sort route-maps
+ if (/^route-map (\S+)/) {
+ my($key) = $1;
+ my($routemap) = $_;
+ while (<INPUT>) {
+ tr/\015//d;
+ last if (/^$prompt/ || ! /^(route-map |[ !])/);
+ if (/^route-map (\S+)/) {
+ ProcessHistory("ROUTEMAP","keysort","$key","$routemap");
+ $key = $1;
+ $routemap = $_;
+ } else {
+ $routemap .= $_;
+ }
+ }
+ ProcessHistory("ROUTEMAP","keysort","$key","$routemap");
+ }
+ # filter out any RCS/CVS tags to avoid confusing local CVS storage
+ s/\$(Revision|Id):/ $1:/;
+
+ # order arp lists
+ /^arp\s+(\d+\.\d+\.\d+\.\d+)\s+/ &&
+ ProcessHistory("ARP","ipsort","$1","$_") && next;
+
+ /^ip prefix-list\s+(\S+)\s+seq\s+(\d+)\s+(permit|deny)\s+(\d\S+)(\/.*)$/ &&
+ ProcessHistory("PACL $1 $3","ipsort","$4","ip prefix-list $1 $3 $4$5\n")
+ && next;
+
+
+ # order/prune snmp-server host statements
+ # we only prune lines of the form
+ # snmp-server host a.b.c.d <community>
+ if (/^snmp-server host (\d+\.\d+\.\d+\.\d+) /) {
+ if (defined($ENV{'NOCOMMSTR'})) {
+ my($ip) = $1;
+ my($line) = "snmp-server host $ip";
+ my(@tokens) = split(' ', $');
+ my($token);
+ while ($token = shift(@tokens)) {
+ if ($token eq 'version' || $tokens[0] == 1) {
+ $line .= " " . join(' ', ($token, shift(@tokens)));
+ } elsif ($token =~ /^(informs?|traps?|(no)?auth)$/) {
+ $line .= " " . $token;
+ } else {
+ $line = "!$line " .
+ join(' ', ("<removed>", join(' ',@tokens)));
+ last;
+ }
+ }
+ ProcessHistory("SNMPSERVERHOST","ipsort","$ip","$line\n");
+ } else {
+ ProcessHistory("SNMPSERVERHOST","ipsort","$1","$_");
+ }
+ next;
+ }
+ if (/^(snmp-server community) (\S+)/) {
+ if (defined($ENV{'NOCOMMSTR'})) {
+ ProcessHistory("SNMPSERVERCOMM","keysort","$_","!$1 <removed>$'");
+ next;
+ } else {
+ ProcessHistory("SNMPSERVERCOMM","keysort","$_","$_") && next;
+ }
+ }
+
+ # prune tacacs/radius server keys
+ if (/^(tacacs-server|radius-server) key / && $filter_pwds >= 1) {
+ ProcessHistory("","","","!$1 key <removed>\n"); next;
+ }
+ if (/^((tacacs-server|radius-server) host \S+ key)( \d)? \S+/ &&
+ $filter_pwds >= 1) {
+ ProcessHistory("","","","!$1 <removed>$'"); next;
+ }
+ if (/^( key )(\d )?\S+/ && $filter_pwds >= 1) {
+ ProcessHistory("","","","!$1 <removed>$'"); next;
+ }
+
+ # order clns host statements
+ /^clns host \S+ (\S+)/ &&
+ ProcessHistory("CLNS","keysort","$1","$_") && next;
+ # order alias statements
+ /^alias / && ProcessHistory("ALIAS","keysort","$_","$_") && next;
+ # filter isis keys
+ if (/^( (area|domain)-message-digest-key \d+ hmac-md5)( \d)? \S+/ &&
+ $filter_pwds >= 1) {
+ ProcessHistory("","","","!$1 <removed>$'\n"); next;
+ }
+ if (/^( (area|domain)-authentication-key)( \d)? \S+( \d)?/ &&
+ $filter_pwds >= 1) {
+ ProcessHistory("","","","!$1 <removed>$'\n"); next;
+ }
+
+ # delete ntp auth password - this md5 is a reversable too
+ if (/^(ntp authentication-key \d+ md5) / && $filter_pwds >= 1) {
+ ProcessHistory("","","","!$1 <removed>\n"); next;
+ }
+
+ # order ntp peers/servers
+ if (/^ntp (server|peer) (\d+)\.(\d+)\.(\d+)\.(\d+)/) {
+ $sortkey = sprintf("$1 %03d%03d%03d%03d",$2,$3,$4,$5);
+ ProcessHistory("NTP","keysort",$sortkey,"$_");
+ next;
+ }
+
+ # catch anything that wasnt matched above.
+ ProcessHistory("","","","$_");
+ # end of config...is a comment.
+ if (/^! end of /i) {
+ $found_end = 1;
+ return(1);
+ }
+ }
+ return(0);
+}
+
+# dummy function
+sub DoNothing {print STDOUT;}
+
+# Main
+%commands=(
+ 'show version' => "ShowVersion",
+ 'show redundancy' => "ShowRedundancy",
+ 'show boot' => "ShowBoot",
+ 'show environment all' => "ShowEnv",
+ 'dir' => "DirSlotN",
+ 'show hardware' => "ShowHardware",
+ 'show configuration' => "WriteTerm"
+);
+# keys() doesnt return things in the order entered and the order of the
+# cmds is important (show version first and write term last). pita
+@commands=(
+ "show version",
+ "show redundancy",
+ "show boot",
+ "show environment all",
+ "dir",
+ "show hardware",
+ "show configuration"
+);
+$jnxe_cmds=join(";",@commands);
+$cmds_regexp=join("|",@commands);
+
+open(OUTPUT,">$host.new") || die "Can't open $host.new for writing: $!\n";
+select(OUTPUT);
+# make OUTPUT unbuffered if debugging
+if ($debug) { $| = 1; }
+
+if ($file) {
+ print STDERR "opening file $host\n" if ($debug);
+ print STDOUT "opening file $host\n" if ($log);
+ open(INPUT,"<$host") || die "open failed for $host: $!\n";
+} else {
+ print STDERR "executing clogin -t $timeo -c\"$jnxe_cmds\" $host\n" if ($debug);
+ print STDOUT "executing clogin -t $timeo -c\"$jnxe_cmds\" $host\n" if ($log);
+ if (defined($ENV{NOPIPE})) {
+ system "clogin -t $timeo -c \"$jnxe_cmds\" $host </dev/null > $host.raw 2>&1" || die "clogin failed for $host: $!\n";
+ open(INPUT, "< $host.raw") || die "clogin failed for $host: $!\n";
+ } else {
+ open(INPUT,"clogin -t $timeo -c \"$jnxe_cmds\" $host </dev/null |") || die "clogin failed for $host: $!\n";
+ }
+}
+
+# determine password filtering mode
+if ($ENV{"FILTER_PWDS"} =~ /no/i) {
+ $filter_pwds = 0;
+} elsif ($ENV{"FILTER_PWDS"} =~ /all/i) {
+ $filter_pwds = 2;
+} else {
+ $filter_pwds = 1;
+}
+
+ProcessHistory("","","","!RANCID-CONTENT-TYPE: Juniper_ERX\n!\n");
+ProcessHistory("COMMENTS","keysort","B0","!\n");
+ProcessHistory("COMMENTS","keysort","F0","!\n");
+ProcessHistory("COMMENTS","keysort","G0","!\n");
+TOP: while(<INPUT>) {
+ tr/\015//d;
+ if (/\#\s?exit$/) {
+ $clean_run=1;
+ last;
+ }
+ if (/^Error:/) {
+ print STDOUT ("$host clogin error: $_");
+ print STDERR ("$host clogin error: $_") if ($debug);
+ $clean_run=0;
+ last;
+ }
+ while (/#\s*($cmds_regexp)\s*$/) {
+ $cmd = $1;
+ if (!defined($prompt)) {
+ $prompt = ($_ =~ /^([^#]+#)/)[0];
+ $prompt =~ s/([][}{)(\\])/\\$1/g;
+ print STDERR ("PROMPT MATCH: $prompt\n") if ($debug);
+ }
+ print STDERR ("HIT COMMAND:$_") if ($debug);
+ if (! defined($commands{$cmd})) {
+ print STDERR "$host: found unexpected command - \"$cmd\"\n";
+ $clean_run = 0;
+ last TOP;
+ }
+ $rval = &{$commands{$cmd}};
+ delete($commands{$cmd});
+ if ($rval == -1) {
+ $clean_run = 0;
+ last TOP;
+ }
+ }
+}
+print STDOUT "Done $logincmd: $_\n" if ($log);
+# Flush History
+ProcessHistory("","","","");
+# Cleanup
+close(INPUT);
+close(OUTPUT);
+
+if (defined($ENV{NOPIPE})) {
+ unlink("$host.raw") if (! $debug);
+}
+
+# check for completeness
+if (scalar(%commands) || !$clean_run || !$found_end) {
+ if (scalar(%commands)) {
+ printf(STDOUT "$host: missed cmd(s): %s\n", join(',', keys(%commands)));
+ printf(STDERR "$host: missed cmd(s): %s\n", join(',', keys(%commands))) if ($debug);
+ }
+ if (!$clean_run || !$found_end) {
+ print STDOUT "$host: End of run not found\n";
+ print STDERR "$host: End of run not found\n" if ($debug);
+ system("/usr/bin/tail -1 $host.new");
+ }
+ unlink "$host.new" if (! $debug);
+}
diff --git a/bin/jlogin.in b/bin/jlogin.in
index 0f005d7..31be4f6 100755..100644
--- a/bin/jlogin.in
+++ b/bin/jlogin.in
@@ -1,25 +1,30 @@
-#!@EXPECT_PATH@ --
+#! @EXPECT_PATH@ --
##
+## $Id: jlogin.in,v 1.41 2004/01/11 05:39:15 heas Exp $
##
-## Copyright (C) 1997-2001 by Henry Kilmer, Erik Sherk and Pete Whiting.
+## Copyright (C) 1997-2004 by Terrapin Communications, Inc.
## All rights reserved.
##
-## This software may be freely copied, modified and redistributed without
-## fee for non-commerical purposes provided that this copyright notice is
-## preserved intact on all copies and modified copies.
+## This software may be freely copied, modified and redistributed
+## without fee for non-commerical purposes provided that this license
+## remains intact and unmodified with any RANCID distribution.
##
## There is no warranty or other guarantee of fitness of this software.
-## It is provided solely "as is". The author(s) disclaim(s) all
+## It is provided solely "as is". The author(s) disclaim(s) all
## responsibility and liability with respect to this software's usage
## or its effect upon hardware, computer systems, other software, or
## anything else.
##
+## Except where noted otherwise, rancid was written by and is maintained by
+## Henry Kilmer, John Heasley, Andrew Partan, Pete Whiting, and Austin Schutz.
##
#
-# jlogin - juniper ssh login
+# The login expect scripts were based on Erik Sherk's gwtn, by permission.
#
-## Most options are intuitive for logging into a Cisco router.
-## The default username password is the same as the vty password.
+# jlogin - juniper login
+#
+# Most options are intuitive for logging into a Cisco router.
+# The default username password is the same as the vty password.
#
# Usage line
@@ -49,6 +54,8 @@ if {[ info exists env(CISCO_USER) ] } {
set default_user $env(CISCO_USER)
} elseif {[ info exists env(USER) ]} {
set default_user $env(USER)
+} elseif {[ info exists env(LOGNAME) ]} {
+ set default_user $env(LOGNAME)
} else {
# This uses "id" which I think is portable. At least it has existed
# (without options) on all machines/OSes I've been on recently -
@@ -82,7 +89,7 @@ for {set i 0} {$i < $argc} {incr i} {
if {[ regexp .\[E\](.+)=(.+) $arg ignore varname varvalue]} {
set E$varname $varvalue
} else {
- send_user "Error: invalid format for -E in $arg\n"
+ send_user "\nError: invalid format for -E in $arg\n"
exit 1
}
# alternate cloginrc file
@@ -249,6 +256,7 @@ proc source_password_file { password_file } {
# Log into the router.
proc login { router user passwd cmethod cyphertype identfile} {
global spawn_id in_proc do_command do_script passphrase prompt
+ global sshcmd
set in_proc 1
# try each of the connection methods in $cmethod until one is successful
@@ -270,13 +278,13 @@ proc login { router user passwd cmethod cyphertype identfile} {
# We use two calls to spawn since spawn does not seem to parse
# spaces correctly.
if {$identfile != ""} {
- if [ catch {spawn ssh -c $cyphertype -x -l $user -i $identfile $router} reason ] {
- send_user "\nError: failed to ssh: $reason\n"
+ if [ catch {spawn $sshcmd -c $cyphertype -x -l $user -i $identfile $router} reason ] {
+ send_user "\nError: failed to $sshcmd: $reason\n"
exit 1
}
} else {
- if [ catch {spawn ssh -c $cyphertype -x -l $user $router} reason ] {
- send_user "\nError: failed to ssh: $reason\n"
+ if [ catch {spawn $sshcmd -c $cyphertype -x -l $user $router} reason ] {
+ send_user "\nError: failed to $sshcmd: $reason\n"
exit 1
}
}
@@ -438,7 +446,7 @@ foreach router [lrange $argv $i end] {
# command line username
set loginname $username
} else {
- set loginname [find user $router]
+ set loginname [join [find user $router] ""]
if { "$loginname" == "" } { set loginname $default_user }
}
@@ -447,11 +455,11 @@ foreach router [lrange $argv $i end] {
# command line passwd
set passwd $userpasswd
} else {
- set passwd [lindex [find userpassword $router] 0]
+ set passwd [join [lindex [find userpassword $router] 0] ""]
if { "$passwd" == "" } {
- set passwd [lindex [find password $router] 0]
+ set passwd [join [lindex [find password $router] 0] ""]
if { "$passwd" == "" } {
- send_user "Error: no password for $router in $password_file.\n"
+ send_user "\nError: no password for $router in $password_file.\n"
continue
}
}
@@ -460,7 +468,7 @@ foreach router [lrange $argv $i end] {
# figure out identity file to use
set identfile ""
if {[info exists identity]} {
- set identfile [lindex [find identity $router] 0]
+ set identfile [join [lindex [find identity $router] 0] ""]
}
# Figure out ssh cypher type
@@ -476,6 +484,10 @@ foreach router [lrange $argv $i end] {
set cmethod [find method $router]
if { "$cmethod" == "" } { set cmethod {{telnet} {ssh}} }
+ # Figure out the SSH executable name
+ set sshcmd [find sshcmd $router]
+ if { "$sshcmd" == "" } { set sshcmd {ssh} }
+
# Login to the router
if {[login $router $loginname $passwd $cmethod $cyphertype $identfile]} {
continue
diff --git a/bin/jrancid.in b/bin/jrancid.in
index 238e704..2793446 100755..100644
--- a/bin/jrancid.in
+++ b/bin/jrancid.in
@@ -1,23 +1,27 @@
-#!@PERLV_PATH@
+#! @PERLV_PATH@
##
-## Amazingly hacked version of Hank's rancid - this one tries to
-## deal with Junipers.
+## $Id: jrancid.in,v 1.58 2004/01/11 03:49:13 heas Exp $
##
-## Original Rancid: Copyright (C) 1997-2001 by Henry Kilmer.
+## Copyright (C) 1997-2004 by Terrapin Communications, Inc.
## All rights reserved.
##
-## This software may be freely copied, modified and redistributed without
-## fee for non-commerical purposes provided that this copyright notice is
-## preserved intact on all copies and modified copies.
+## This software may be freely copied, modified and redistributed
+## without fee for non-commerical purposes provided that this license
+## remains intact and unmodified with any RANCID distribution.
##
## There is no warranty or other guarantee of fitness of this software.
-## It is provided solely "as is". The author(s) disclaim(s) all
+## It is provided solely "as is". The author(s) disclaim(s) all
## responsibility and liability with respect to this software's usage
## or its effect upon hardware, computer systems, other software, or
## anything else.
##
+## Except where noted otherwise, rancid was written by and is maintained by
+## Henry Kilmer, John Heasley, Andrew Partan, Pete Whiting, and Austin Schutz.
##
#
+# Amazingly hacked version of Hank's rancid - this one tries to
+# deal with Junipers.
+#
# RANCID - Really Awesome New Cisco confIg Differ
#
# usage: jrancid [-d] [-l] [-f filename | $host]
@@ -147,6 +151,8 @@ sub ShowChassisClocks {
while (<INPUT>) {
tr/\015//d;
last if(/^$prompt/);
+ next if(/^system (shutdown message from|going down )/i);
+ next if(/^\{(master|backup)}/);
/error: the chassis subsystem is not running/ && return;
/Couldn\'t initiate connection/ && return;
@@ -171,6 +177,8 @@ sub ShowChassisEnvironment {
while (<INPUT>) {
tr/\015//d;
last if(/^$prompt/);
+ next if(/^system (shutdown message from|going down )/i);
+ next if(/^\{(master|backup)}/);
/error: the chassis subsystem is not running/ && return;
/Couldn\'t initiate connection/ && return;
@@ -199,6 +207,8 @@ sub ShowChassisFirmware {
while (<INPUT>) {
tr/\015//d;
last if(/^$prompt/);
+ next if(/^system (shutdown message from|going down )/i);
+ next if(/^\{(master|backup)}/);
/error: the chassis subsystem is not running/ && return;
/Couldn\'t initiate connection/ && return;
@@ -220,6 +230,8 @@ sub ShowChassisFpcDetail {
while (<INPUT>) {
tr/\015//d;
last if(/^$prompt/);
+ next if(/^system (shutdown message from|going down )/i);
+ next if(/^\{(master|backup)}/);
/error: the chassis subsystem is not running/ && return;
/Couldn\'t initiate connection/ && return;
@@ -244,6 +256,8 @@ sub ShowChassisHardware {
while (<INPUT>) {
tr/\015//d;
last if(/^$prompt/);
+ next if(/^system (shutdown message from|going down )/i);
+ next if(/^\{(master|backup)}/);
/error: the chassis subsystem is not running/ && return;
/Couldn\'t initiate connection/ && return;
@@ -266,6 +280,8 @@ sub ShowChassisRoutingEngine {
while (<INPUT>) {
tr/\015//d;
last if(/^$prompt/);
+ next if(/^system (shutdown message from|going down )/i);
+ next if(/^\{(master|backup)}/);
/error: the chassis subsystem is not running/ && return;
/Couldn\'t initiate connection/ && return;
@@ -284,8 +300,8 @@ sub ShowChassisRoutingEngine {
return;
}
-# This routine parses "show chassis feb" "show chassis scb", "show
-# chassis sfm detail", and "show chassis ssb".
+# This routine parses "show chassis cfeb", "show chassis feb", "show
+# chassis scb", "show chassis sfm detail", and "show chassis ssb".
# Only do this routine once.
sub ShowChassisSCB {
print STDERR " In ShowChassisSCB: $_" if ($debug);
@@ -295,6 +311,8 @@ sub ShowChassisSCB {
while (<INPUT>) {
tr/\015//d;
last if(/^$prompt/);
+ next if(/^system (shutdown message from|going down )/i);
+ next if(/^\{(master|backup)}/);
return if ($ShowChassisSCB);
/error: the chassis subsystem is not running/ && return;
@@ -316,6 +334,25 @@ sub ShowChassisSCB {
}
# This routine parses "show system boot-messages"
+sub ShowChassisAlarms {
+ print STDERR " In ShowChassisAlarms: $_" if ($debug);
+
+ ProcessHistory("","","","# $_");
+ while (<INPUT>) {
+ tr/\015//d;
+ last if(/^$prompt/);
+ next if(/^system (shutdown message from|going down )/i);
+ next if(/^\{(master|backup)}/);
+
+ /Unrecognized command/ && return;
+ /^\s+\^/ && return;
+ /syntax error/ && return;
+ ProcessHistory("","","","# $_");
+ }
+ return;
+}
+
+# This routine parses "show system boot-messages"
sub ShowSystemBootMessages {
print STDERR " In ShowSystemBootMessages: $_" if ($debug);
@@ -324,6 +361,8 @@ sub ShowSystemBootMessages {
while (<INPUT>) {
tr/\015//d;
last if(/^$prompt/);
+ next if(/^system (shutdown message from|going down )/i);
+ next if(/^\{(master|backup)}/);
/Unrecognized command/ && return;
/^\s+\^/ && return;
@@ -347,10 +386,15 @@ sub ShowVersion {
while (<INPUT>) {
tr/\015//d;
last if(/^$prompt/);
+ next if(/^\s*$/);
+ next if(/^system (shutdown message from|going down )/i);
+ next if(/^\{(master|backup)}/);
/^Juniper Networks is:/ && ProcessHistory("","","","# \n# $_") && next;
ProcessHistory("","","","# $_");
}
+ ProcessHistory("","","","#\n");
+
return;
}
@@ -371,11 +415,14 @@ sub ShowConfiguration {
$found_end++;
last;
}
+ next if(/^system (shutdown message from|going down )/i);
+ next if(/^\{(master|backup)}/);
$lines++;
/^database header mismatch: / && return(-1);
/^version .*;\d+$/ && return(-1);
+ s/ # SECRET-DATA$//;
# filter snmp community, when in snmp { stanza }
/^snmp/ && $snmp++;
/^}/ && ($snmp = 0);
@@ -384,24 +431,30 @@ sub ShowConfiguration {
$_ = "$1$2 \"<removed>\"$3\n";
}
}
- if (/(\s*authentication-key ).*$/ && $filter_pwds >= 1) {
- s/(\s*authentication-key ).*$/#$1<removed>;/;
+ if (/(\s*authentication-key )[^ ;]+/ && $filter_pwds >= 1) {
+ ProcessHistory("","","","#$1<removed>$'");
+ next;
}
- if (/(\s*hello-authentication-key ).*$/ && $filter_pwds >= 1) {
- s/(\s*hello-authentication-key ).*$/#$1<removed>;/;
+ if (/(\s*hello-authentication-key )[^ ;]+/ && $filter_pwds >= 1) {
+ ProcessHistory("","","","#$1<removed>$'");
+ next;
}
- if (/^(.*\ssecret \")\$9\$.*(\".*)$/ && $filter_pwds >= 1) {
- s/^(.*\ssecret \")\$9\$.*(\".*)$/#$1<removed>$2/;
+ if (/^(.*\ssecret )[^ ;]+/ && $filter_pwds >= 1) {
+ ProcessHistory("","","","#$1<removed>$'");
+ next;
}
- if (/(\s+encrypted-password ).*$/ && $filter_pwds >= 2) {
- ProcessHistory("","","","#$1<removed>;\n");
+ if (/(\s+encrypted-password )[^ ;]+/ && $filter_pwds >= 2) {
+ ProcessHistory("","","","#$1<removed>$'");
next;
}
if (/(\s+ssh-(rsa|dsa) )\"/ && $filter_pwds >= 2) {
ProcessHistory("","","","#$1<removed>;\n");
next;
}
- s/ # SECRET-DATA$//;
+ if (/^(\s+(pre-shared-|)key (ascii-text|hexadecimal) )[^ ;]+/ && $filter_pwds >= 1) {
+ ProcessHistory("","","","#$1<removed>$'");
+ next;
+ }
ProcessHistory("","","","$_");
}
@@ -433,8 +486,10 @@ sub DoNothing {print STDOUT;}
"show chassis sfm detail" => "ShowChassisSCB",
"show chassis ssb" => "ShowChassisSCB",
"show chassis feb" => "ShowChassisSCB",
+ "show chassis cfeb" => "ShowChassisSCB",
+ "show chassis alarms" => "ShowChassisAlarms",
"show system boot-messages" => "ShowSystemBootMessages",
- "show version" => "ShowVersion",
+ "show version detail" => "ShowVersion",
"show configuration" => "ShowConfiguration"
);
@commands=(
@@ -448,8 +503,10 @@ sub DoNothing {print STDOUT;}
"show chassis sfm detail",
"show chassis ssb",
"show chassis feb",
+ "show chassis cfeb",
+ "show chassis alarms",
"show system boot-messages",
- "show version",
+ "show version detail",
"show configuration"
);
@@ -512,7 +569,8 @@ TOP: while(<INPUT>) {
$cmd = $1;
if (!defined($prompt)) {
$prompt = ($_ =~ /^([^>]+>)/)[0];
- $prompt =~ s/([}{)(\\])/\\$1/g;
+ $prompt =~ s/([][}{)(\\])/\\$1/g;
+ print STDERR ("PROMPT MATCH: $prompt\n") if ($debug);
}
print STDERR ("HIT COMMAND:$_") if ($debug);
if (! defined($commands{$cmd})) {
diff --git a/util/lg/lg.cgi.in b/bin/lg.cgi.in
index 2921f72..ad08c68 100755..100644
--- a/util/lg/lg.cgi.in
+++ b/bin/lg.cgi.in
@@ -1,19 +1,27 @@
-#!@PERLV_PATH@
-## The original original lookingglass s/w was written by Ed Kern. it
-## is a single script and used to be available at http://nitrous.digex.net/
-#
-## Copyright (C) 1997-2001 by Henry Kilmer.
+#! @PERLV_PATH@
+##
+## $Id: lg.cgi.in,v 1.47 2004/01/11 03:49:13 heas Exp $
+##
+## Copyright (C) 1997-2004 by Terrapin Communications, Inc.
## All rights reserved.
##
-## This software may be freely copied, modified and redistributed without
-## fee for non-commerical purposes provided that this copyright notice is
-## preserved intact on all copies and modified copies.
+## This software may be freely copied, modified and redistributed
+## without fee for non-commerical purposes provided that this license
+## remains intact and unmodified with any RANCID distribution.
##
## There is no warranty or other guarantee of fitness of this software.
-## It is provided solely "as is". The author(s) disclaim(s) all
+## It is provided solely "as is". The author(s) disclaim(s) all
## responsibility and liability with respect to this software's usage
## or its effect upon hardware, computer systems, other software, or
## anything else.
+##
+## Except where noted otherwise, rancid was written by and is maintained by
+## Henry Kilmer, John Heasley, Andrew Partan, Pete Whiting, and Austin Schutz.
+##
+#
+# The original original lookingglass s/w was written by Ed Kern. It was
+# a single script that used to be available at http://nitrous.digex.net/.
+# Provided by permission and modified beyond recognition.
#
# Looking glass
# vars: query, router, args
@@ -23,12 +31,13 @@ $me = $0;
$me =~ s/.*\/(\S+)$/$1/;
}
-use CGI qw/:standard/;
+use CGI qw/:standard escapeHTML/;
use POSIX qw(strftime);
use Sys::Syslog;
use LockFile::Simple qw(lock trylock unlock);
my($BASEDIR) = "@prefix@";
+my($SYSCONFDIR) = "@sysconfdir@";
my($pingcmd) = "@LG_PING_CMD@";
my($query, $max_time_diff, $cache_dir, $cloginrc, @results);
@@ -74,17 +83,18 @@ sub dolog
}
return;
}
+
# read LG configuration file
sub readconf
{
my($conffile, $cmds);
local(*CONF);
- if (defined($env{LG_CONF})) {
- $conffile = $env{LG_CONF};
+ if (defined($ENV{LG_CONF})) {
+ $conffile = $ENV{LG_CONF};
} elsif (-e "lg.conf") {
$conffile = "lg.conf";
} else {
- $conffile = "$BASEDIR/util/lg/lg.conf";
+ $conffile = "$SYSCONFDIR/lg.conf";
}
if (! -f $conffile) {
@@ -99,12 +109,14 @@ sub readconf
close(CONF);
eval $cmds;
} else {
- printf(STDERR "ERROR: couldn\'t open the configuration file: $conffile: $!\n");
+ printf(STDERR "ERROR: couldn\'t open the configuration file: " .
+ "$conffile: $!\n");
exit(1);
}
return;
}
+
# read router.db file
sub readrouters
{
@@ -114,7 +126,7 @@ sub readrouters
if (defined($LG_ROUTERDB)) {
$rtrdb = $LG_ROUTERDB;
} else {
- $rtrdb = "$BASEDIR/util/lg/router.db";
+ $rtrdb = "$SYSCONFDIR/router.db";
}
if (! -f $rtrdb) {
@@ -126,7 +138,7 @@ sub readrouters
dolog(LOG_ERR, "ERROR: couldn\'t read $BASEDIR: $!\n");
} else {
while ($dir = readdir(DIR)) {
- next if ($dir =~ /^(\.|\.\.|CVS|bin|logs|util)$/);
+ next if ($dir =~ /^(\.|\.\.|CVS|bin|etc|logs|util)$/);
push(@dirs, $dir) if (-d "$BASEDIR/$dir");
}
closedir(DIR);
@@ -149,7 +161,8 @@ sub readrouters
}
close(RTR);
} else {
- dolog(LOG_ERR, "ERROR: couldn\'t open the router.db file: $BASEDIR/$dir/router.db: $!\n");
+ dolog(LOG_ERR, "ERROR: couldn\'t open the router.db " .
+ "file: $BASEDIR/$dir/router.db: $!\n");
}
}
}
@@ -165,7 +178,8 @@ sub readrouters
}
close(RTR);
} else {
- dolog(LOG_ERR, "ERROR: couldn\'t open the router.db file: $rtrdb: $!\n");
+ dolog(LOG_ERR, "ERROR: couldn\'t open the router.db file: " .
+ "$rtrdb: $!\n");
exit(1);
}
}
@@ -173,7 +187,7 @@ sub readrouters
return;
}
-# the functions remaining are particular to lg.cgi.
+# the remaining functions are particular to lg.cgi.
# return true if $router is a member of @rtrlist
sub arraymember {
@@ -188,6 +202,7 @@ sub arraymember {
return(0);
}
+
# check reachability and lock file before attempting to connect to device
# return non-zero on error.
sub DoRsh
@@ -205,19 +220,18 @@ sub DoRsh
`$pingcmd $router 56 1`;
}
if ($?) {
- push(@results, "$router is unreachable. Try again later.\n");
- print @results;
+ print "$router is unreachable. Try again later.\n";
return(-1);
}
if (! $lckobj->lock("$cache_dir/$router")) {
- push(@results, "$router is busy. Try again later.\n");
- print @results;
+ print "$router is busy. Try again later.\n";
return(-1);
}
$val = &DoCmd($router, $mfg, $cmd, $arg);
$lckobj->unlock("$cache_dir/$router");
- return ($val);
+ return($val);
}
+
# run commands on the router. return non-zero on error.
sub DoCmd
{
@@ -225,13 +239,10 @@ sub DoCmd
local(*CMD);
if ($mfg =~ /foundry/i) {
- $cmd = $foundryCmd{$type};
open(CMD, "sh -c \"flogin -f $cloginrc -c \'$cmd $arg\' $rtr\" 2>&1 |");
} elsif ($mfg =~ /juniper/i) {
- $cmd = $juniperCmd{$type};
open(CMD, "sh -c \"jlogin -f $cloginrc -c \'$cmd $arg\' $rtr\" 2>&1 |");
} else {
- $cmd = $ciscoCmd{$type};
open(CMD, "sh -c \"clogin -noenable -f $cloginrc -c \'$cmd $arg\' $rtr\" 2>&1 |");
}
while (<CMD>) {
@@ -266,6 +277,8 @@ sub DoCmd
return(0);
}
+
+##
# Subroutine: Error
# Usage: &Error("msg"));
# Description: displays an error and exits.
@@ -275,27 +288,32 @@ sub Error {
my($q) = new CGI();
print $q->header;
- print $q->start_html("Looking Glass Error");
-
- print "<BODY>";
+ if ($LG_STYLE) {
+ print $query->start_html(-title => "LookingGlass Results - $router",
+ -style => {'src' => $LG_STYLE});
+ } else {
+ print $query->start_html(-title => "LookingGlass Results - $router");
+ }
# add the company image, LG_IMAGE
print $LG_IMAGE;
print <<EOF ;
-<br>
-<B><FONT SIZE=+2>Looking Glass Error:</FONT></B>
-<p>
-$msg
-<br>
-</body>
+ <br>
+ <B><FONT SIZE=+2>Looking Glass Error:</FONT></B>
+ <p>
+ $msg
+ <br>
+ <hr>
+ $LG_INFO
EOF
print $q->end_html;
exit(0);
}
-# convert a ipv4 address mask to prefix length
+
+# convert an ipv4 address mask to prefix length
sub mask2len {
my($mask) = shift;
my($a, $b, $c, $d) = split('\.', $mask);
@@ -308,6 +326,7 @@ sub mask2len {
return($len);
}
+
# end the page and exit.
sub end_page {
@@ -320,6 +339,7 @@ END
print $query->end_html;
exit(0);
}
+
# start the page and log the transaction...
sub start_page {
my($mfg) = @_;
@@ -330,7 +350,12 @@ sub start_page {
$ENV{REMOTE_HOST}, $ENV{REMOTE_ADDR}, $ENV{REMOTE_USER},
"- - [$timestr] $type $router $arg"));
print $query->header;
- print $query->start_html("Looking Glass Results - $router");
+ if ($LG_STYLE) {
+ print $query->start_html(-title =>"LookingGlass form",
+ -style => {'src' => $LG_STYLE});
+ } else {
+ print $query->start_html(-title =>"LookingGlass from");
+ }
$timestr = strftime("%a %b %e %H:%M:%S %Y %Z", gmtime);
@@ -369,17 +394,16 @@ HEAD
END
return;
-} #end sub start_page
+}
# Main()
# read the configuration file if it exists.
readconf();
-## The script will now cache the results as simple files in the $cache_dir,
-## named after the type of query (queries must, of course, be one word no
-## spaces). Modify $max_time_diff to set the lifetime for each cache.
-## Currently, cache lifetime is the same for all queries.
+# The script will now cache the results as simple files in the $cache_dir,
+# named after the type of query (queries must, of course, be one word with
+# no spaces). Modify $LG_CACHE_TIME to set the lifetime for cache entries.
# for most web servers, cache_dir must be writable by uid nobody
if (defined($LG_CACHE_DIR)) {
$cache_dir = $LG_CACHE_DIR;
@@ -406,7 +430,7 @@ $max_lock_hold = 300;
if (defined($LG_CLOGINRC)) {
$cloginrc = $LG_CLOGINRC;
} else {
- $cloginrc = "$BASEDIR/.cloginrc";
+ $cloginrc = "$ENV(HOME)/.cloginrc";
}
$query = new CGI;
@@ -422,9 +446,16 @@ $arg =~ s/["'`]//g; # these are BS in any arg for any query
# verify router, commands, arguments, etc.
($router, $mfg) = split(':', $router_param);
-if (!defined($type) || !defined($router)) {
- $results[0] = "You must at least choose a Query and a router. Try buying a clue.\n";
- &Error("You must at least choose a Query and a router. Try buying a clue.\n");
+if (!defined($type) || !defined($router) || $router eq "") {
+ &Error("You must at least choose a Query and a router. Try buying " .
+ "a clue.\n");
+}
+
+if ($arg !~ /^[-A-Za-z0-9|_\/ \.^\$]*$/) {
+ &Error("Funny characters in argument; ignoring.\n");
+}
+if (length($arg) >= 50) {
+ &Error("Argument string too long; ignoring. \n");
}
if (! arraymember(\@rtrlist, $router)) {
@@ -436,130 +467,182 @@ if (! arraymember(\@rtrlist, $router)) {
}
# conversion of command "type" passed from lgform.cgi to the vendor's syntax.
-%ciscoCmd = (
- #acl => "show access-list",
- #aspath => "show ip as-path-access-list",
- #communitylist => "show ip community-list",
- damp => "show ip bgp dampened-paths",
+if ($mfg =~ /cisco/i) {
+ %mfgCmd = (
+ # Debug Queries
+ log => "show logging",
+ # Interface Queries
framerelay => "show frame-relay pvc",
interface => "show interface",
intbrief => "show ip interface", # switch in {interface}
- log => "show logging",
+ # Routing Queries
+ damp => "show ip bgp dampened-paths",
+ neighbor => "show ip bgp neighbor",
+ # Multicast Queries
mbgp => "show ip mbgp",
mbgpsum => "show ip mbgp summary",
mneighbor => "show ip bgp neighbor",
- neighbor => "show ip bgp neighbor",
- regex => "show ip bgp regex",
- route => "show ip route",
- routemap => "show route-map",
+ msdp => "show ip msdp summary",
+ msdpsa => "show ip msdp sa-cache",
+ msess => "show ip sdr",
+ mroute => "show ip mroute",
+ pim_interface => "show ip pim interface",
+ pim_neighbor => "show ip pim neighbor",
+ pim_rp => "show ip pim rp mapping",
+ # IPv6 Queries
+ #
+ #acl => "show access-list",
+ #aspath => "show ip as-path-access-list",
+ #communitylist => "show ip community-list",
ping => "ping",
prefix => "show ip bgp",
prefixlist => "show ip prefix-list",
+ regex => "show ip bgp regex",
+ route => "show ip route",
+ routemap => "show route-map",
+ rpf => "show ip rpf",
summary => "show ip bgp summary",
- trace => "traceroute"
- );
-%foundryCmd = (
- #acl => "show access-list",
- #aspath => "show ip as-path-access-list",
- #communitylist => "show ip community-list",
- damp => "show ip bgp dampened-paths",
- #framerelay => "show frame-relay pvc", # no frame relay
- interface => "show interface",
+ trace => "traceroute",
+ v6_bgp => "show bgp ipv6",
+ v6_interface => "show ipv6 interface",
+ v6_summary => "show bgp ipv6 summary"
+ );
+} elsif ($mfg =~ /foundry/i) {
+ %mfgCmd = (
+ # Debug Queries
log => "show log",
- #mbgp => "show ip mbgp",
- #mbgpsum => "show bgp summary",
- #mneighbor => "show ip bgp neighbor",
+ ping => "ping",
+ trace => "traceroute",
+ # Interface Queries
+ #framerelay => "show frame-relay pvc", # no compatible command
+ interface => "show interface",
+ # Routing Queries
+ damp => "show ip bgp dampened-paths",
neighbor => "show ip bgp neighbor",
#regex => "show ip bgp aspath-regex",
route => "show ip route",
- routemap => "show route-map",
- ping => "ping",
- prefix => "show ip bgp",
- prefixlist => "show ip prefix-list",
summary => "show ip bgp summary",
- trace => "traceroute"
- );
-%juniperCmd = (
+ # Multicast Queries
+ #mbgp => "show ip mbgp",
+ #mbgpsum => "show bgp summary",
+ #mneighbor => "show ip bgp neighbor",
+ mroute => "show ip mroute",
+ msdp => "show ip msdp summary",
+ msdpsa => "show ip msdp sa-cache",
+ msess => "show ip sdr",
+ pim_interface => "show ip pim interface",
+ pim_neighbor => "show ip pim neighbor",
+ pim_rp => "show ip pim rp mapping",
+ rpf => "show ip rpf",
+ # IPv6 Queries
+ # v6_bgp => "show bgp ipv6",
+ # v6_interface => "show ipv6 interface",
+ # v6_summary => "show bgp ipv6 summary"
+ #
#acl => "show access-list",
#aspath => "show ip as-path-access-list",
#communitylist => "show ip community-list",
- damp => "show route damping suppressed terse table inet.0",
+ routemap => "show route-map",
+ prefix => "show ip bgp",
+ prefixlist => "show ip prefix-list"
+ );
+} elsif ($mfg =~ /juniper/i) {
+ %mfgCmd = (
+ # Debug Queries
+ log => "show log messages",
+ ping => "ping rapid count 5",
+ trace => "traceroute",
+ # Interface Queries
framerelay => "show frame-relay pvc",
interface => "show interface",
- log => "show log messages",
- mbgp => "show route table inet.2 terse",
- mbgpsum => "show bgp summary",
- mneighbor => "show bgp neighbor",
+ #intbrief => "show ip interface", # switch in {interface}
+ # Routing Queries
+ damp => "show route damping suppressed terse table inet.0",
neighbor => "show bgp neighbor",
regex => "show route table inet.0 aspath-regex",
- route => "show route table inet.0 terse",
- routemap => "show policy",
- ping => "ping rapid count 5",
- prefix => "show route table inet.0",
- prefixlist => "show policy",
summary => "show bgp summary",
- trace => "traceroute"
- );
-%cmdDisp = (
+ # Multicast Queries
+ mbgp => "show route table inet.2 terse",
+ mbgpsum => "show bgp summary",
+ mneighbor => "show bgp neighbor",
+ mroute => "show multicast route extensive",
+ msdp => "show msdp",
+ msdpsa => "show msdp source-active",
+ msess => "show multicast sessions",
+ pim_interface => "show pim interface",
+ pim_neighbor => "show pim neighbors",
+ pim_rp => "show pim rps",
+ pim_join => "show pim join",
+ rpf => "show multicast rpf",
+ # IPv6 Queries
+ v6_bgp => "show route table inet6.0",
+ v6_interface => "show interface",
+ v6_summary => "show bgp summary",
+ #
#acl => "show access-list",
#aspath => "show ip as-path-access-list",
#communitylist => "show ip community-list",
- damp => "show ip bgp dampened-paths",
- framerelay => "show frame-relay pvc",
- interface => "show interface",
- log => "show logging",
- mbgp => "show ip mbgp",
- mbgpsum => "show ip mbgp summary",
- mneighbor => "show ip mbgp neighbor",
- neighbor => "show ip bgp neighbor",
- regex => "show ip bgp regex",
- route => "show ip route",
- routemap => "show route-map",
- ping => "ping",
- prefix => "show ip bgp",
- prefixlist => "show ip prefix-list",
- summary => "show ip bgp summary",
- trace => "traceroute"
+ prefix => "show route table inet.0",
+ prefixlist => "show policy",
+ route => "show route table inet.0 terse",
+ routemap => "show policy"
);
+}
-# not all cmds/queries are implemented for junipers
-if ($mfg =~ /juniper/) {
- if (! defined($juniperCmd{$type})) {
- Error("$cmdDisp{$type} not implemented for junipers. sorry.\n");
- }
- $cmd = $juniperCmd{$type};
-} elsif ($mfg =~ /foundry/) {
- if(! defined($foundryCmd{$type})) {
- Error("$cmdDisp{$type} not implemented for foundrys. sorry.\n");
- }
- $cmd = $foundryCmd{$type};
-} else {
- if(! defined($ciscoCmd{$type})) {
- Error("$cmdDisp{$type} not implemented for cisco. sorry.\n");
+# construct Display command from configuration
+%cmdDisp=();
+foreach $qtype (sort keys(%$queries)) {
+ next if (! scalar(%{$queries->{$qtype}}));
+ foreach $sub_type (sort keys(%{$queries->{$qtype}})) {
+ $cmdDisp{$sub_type} = $queries->{$qtype}->{$sub_type};
}
- $cmd = $ciscoCmd{$type};
}
+# make sure the command is not disabled
+if (! defined($cmdDisp{$type})) {
+ &Error("Unknown command type: $type\n");
+}
+
+# not all cmds/queries are implemented for all platforms
+if (! defined($mfgCmd{$type})) {
+ Error("$cmdDisp{$type} not implemented for $mfg or no suitable " .
+ "equivalent exists. sorry.\n");
+}
+$cmd = $mfgCmd{$type};
+
+# handle each query/command type
if ($type eq "prefix" || $type eq "mbgp" || $type eq "route" ) {
if ($arg[0] !~ /^\d+\.\d+\.\d+\.\d+$/) {
- &Error("The IP address \"$arg[0]\" is not valid and lacking an address would over-burden our router.\n");
+ &Error("The IP address \"$arg[0]\" is not valid and lacking an " .
+ "address would over-burden our router.\n");
} elsif (defined($arg[1]) && $arg[1] !~ /^\d+\.\d+\.\d+\.\d+$/) {
&Error("The IP netmask \"$arg[1]\" is not valid.\n");
}
if ($mfg =~ /juniper/i && defined($arg[1])) {
$arg = $arg[0] . "/" . mask2len($arg[1]);
}
+} elsif ($type eq "v6_route" ){
+ # XXX: is this check of the address arg correct and pedantic?
+ if ($arg[0] !~ /[0-9a-fA-F:]+$/) {
+ &Error("The IPv6 address \"$arg[0]\" is not valid.\n");
+ }
} elsif ($type eq "framerelay") {
if ($mfg =~ /juniper/) {
&Error("Juniper does not have a show frame-relay pvc command. " .
- "Use show interface.\n");
+ "Use show interface.\n");
}
if ($arg[0] > 15 && $arg[0] < 1024) {
$arg = $arg[0];
} else {
undef($arg);
}
-} elsif ($type eq "interface") {
+} elsif ($type eq "interface" || $type eq "v6_interface") {
+
+ # XXX: wtf is arg[1]?
+# if ($arg[1] =~ /[-\/0-9:.]+/) {
+# $arg = $arg[0] . " " . $arg[1];
+# } else {
+
if ($mfg =~ /(cisco|foundry)/) {
if ($arg[0] !~ /^b[^ ]+[0-9]/i && $arg[0] =~ /^b/i) {
$type = "intbrief";
@@ -629,6 +712,7 @@ if ($type eq "prefix" || $type eq "mbgp" || $type eq "route" ) {
}
$arg = $arg[0];
} elsif ($type eq "regex") {
+ # bgp as-path regex
$arg = $arg[0];
if ($#arg >= 1) {
for ($n = 1; $n <= $#arg; $n++) { $arg .= " " . $arg[$n]; }
@@ -646,7 +730,7 @@ if ($type eq "prefix" || $type eq "mbgp" || $type eq "route" ) {
}
if ($mfg =~ /juniper/) {
$arg =~ s/_/ /g;
- # pre-junos 4.4 do not allow anchors
+ # pre-junos 4.4 does not allow anchors
if ($arg =~ /\^\$/) {
$arg =~ "()";
} else {
@@ -732,7 +816,7 @@ start_page();
# cache the following
if ($type eq "summary" || $type eq "mbgpsu" || $type eq "damp"
- || $type eq "log") {
+ || $type eq "log") {
if (!$arg) {
# cache requests with no addr/argument
local(*CACHE);
diff --git a/util/lg/lgform.cgi.in b/bin/lgform.cgi.in
index 97a0c71..461ae68 100755..100644
--- a/util/lg/lgform.cgi.in
+++ b/bin/lgform.cgi.in
@@ -1,16 +1,27 @@
-#!@PERLV_PATH@
-## Copyright (C) 1997-2001 by Henry Kilmer.
+#! @PERLV_PATH@
+##
+## $Id: lgform.cgi.in,v 1.25 2004/01/11 03:49:13 heas Exp $
+##
+## Copyright (C) 1997-2004 by Terrapin Communications, Inc.
## All rights reserved.
##
-## This software may be freely copied, modified and redistributed without
-## fee for non-commerical purposes provided that this copyright notice is
-## preserved intact on all copies and modified copies.
+## This software may be freely copied, modified and redistributed
+## without fee for non-commerical purposes provided that this license
+## remains intact and unmodified with any RANCID distribution.
##
## There is no warranty or other guarantee of fitness of this software.
-## It is provided solely "as is". The author(s) disclaim(s) all
+## It is provided solely "as is". The author(s) disclaim(s) all
## responsibility and liability with respect to this software's usage
## or its effect upon hardware, computer systems, other software, or
## anything else.
+##
+## Except where noted otherwise, rancid was written by and is maintained by
+## Henry Kilmer, John Heasley, Andrew Partan, Pete Whiting, and Austin Schutz.
+##
+#
+# The original original lookingglass s/w was written by Ed Kern. It was
+# a single script that used to be available at http://nitrous.digex.net/.
+# Provided by permission and modified beyond recognition.
#
# lgform.cgi - Looking glass front-end
# produces html form for calling lg.cgi
@@ -19,6 +30,7 @@ use CGI qw/:standard/;
my(@rtrlist, %rtrlabels);
my($BASEDIR) = "@prefix@";
+my($SYSCONFDIR) = "@sysconfdir@";
# note: the following functions are duplicated between lgform.cgi and lg.cgi
# to avoid the need for module inclusion headaches from within a httpd context.
@@ -50,22 +62,23 @@ sub dolog
printf(STDERR $msg);
} else {
printf(LOG $msg);
- close(LOG);
+ close(LOG);
}
}
return;
}
+
# read LG configuration file
sub readconf
{
my($conffile, $cmds);
local(*CONF);
- if (defined($env{LG_CONF})) {
- $conffile = $env{LG_CONF};
+ if (defined($ENV{LG_CONF})) {
+ $conffile = $ENV{LG_CONF};
} elsif (-e "lg.conf") {
$conffile = "lg.conf";
} else {
- $conffile = "$BASEDIR/util/lg/lg.conf";
+ $conffile = "$SYSCONFDIR/lg.conf";
}
if (! -f $conffile) {
@@ -80,12 +93,14 @@ sub readconf
close(CONF);
eval $cmds;
} else {
- printf(STDERR "ERROR: couldn\'t open the configuration file: $conffile: $!\n");
+ printf(STDERR "ERROR: couldn\'t open the configuration file: " .
+ "$conffile: $!\n");
exit(1);
}
return;
}
+
# read router.db file
sub readrouters
{
@@ -95,7 +110,7 @@ sub readrouters
if (defined($LG_ROUTERDB)) {
$rtrdb = $LG_ROUTERDB;
} else {
- $rtrdb = "$BASEDIR/util/lg/router.db";
+ $rtrdb = "$SYSCONFDIR/router.db";
}
if (! -f $rtrdb) {
@@ -107,7 +122,7 @@ sub readrouters
dolog(LOG_ERR, "ERROR: couldn\'t read $BASEDIR: $!\n");
} else {
while ($dir = readdir(DIR)) {
- next if ($dir =~ /^(\.|\.\.|CVS|bin|logs|util)$/);
+ next if ($dir =~ /^(\.|\.\.|CVS|bin|etc|logs|util)$/);
push(@dirs, $dir) if (-d "$BASEDIR/$dir");
}
closedir(DIR);
@@ -130,7 +145,8 @@ sub readrouters
}
close(RTR);
} else {
- dolog(LOG_ERR, "ERROR: couldn\'t open the router.db file: $BASEDIR/$dir/router.db: $!\n");
+ dolog(LOG_ERR, "ERROR: couldn\'t open the router.db " .
+ "file: $BASEDIR/$dir/router.db: $!\n");
}
}
}
@@ -146,7 +162,8 @@ sub readrouters
}
close(RTR);
} else {
- dolog(LOG_ERR, "ERROR: couldn\'t open the router.db file: $rtrdb: $!\n");
+ dolog(LOG_ERR, "ERROR: couldn\'t open the router.db file: " .
+ "$rtrdb: $!\n");
exit(1);
}
}
@@ -161,9 +178,12 @@ readconf();
$query = new CGI;
print $query->header;
-print $query->start_html("LookingGlass form");
-
-print "<BODY>";
+if ($LG_STYLE) {
+ print $query->start_html(-title =>"LookingGlass form",
+ -style => {'src' => $LG_STYLE});
+} else {
+ print $query->start_html(-title =>"LookingGlass form");
+}
# add the company image, LG_IMAGE
print $LG_IMAGE;
@@ -176,46 +196,37 @@ print <<HEAD ;
HEAD
# start table, etc here
+print $query->startform( -action => 'lg.cgi', -method => 'POST');
print <<DOTABLE ;
-<form action=lg.cgi method=GET>
<center>
<table border cellspacing=0 width=575 align=center>
DOTABLE
# available query types here
-print <<QTYPES ;
+print <<TABLEHEAD ;
<tr valign=top>
- <TD><B>Query:</B>
-<dd><input type=radio name="query" value="framerelay">show frame-relay pvc [DLCI]</DD>
-<dd><input type=radio name="query" value="interface">show interface &lt;interface&gt;</DD>
-<dd><input type=radio name="query" value="prefix">show ip bgp &lt;prefix&gt; [netmask]</DD>
-<dd><input type=radio name="query" value="neighbor">show ip bgp neighbor &lt;IP_addr&gt;</DD>
-<dd><input type=radio name="query" value="regex">show ip bgp regex &lt;reg_exp&gt;</DD>
-<dd><input type=radio name="query" value="summary">show ip bgp summary</DD>
-<dd><input type=radio name="query" value="damp">show ip bgp dampened-paths</DD>
-<dd><input type=radio name="query" value="prefixlist">show ip prefix-list &lt;list_name&gt;</DD>
-<dd><input type=radio name="query" value="route">show ip route &lt;prefix&gt; [netmask]</DD>
-<dd><input type=radio name="query" value="routemap">show route-map &lt;map_name&gt;</DD>
-<dd><input type=radio name="query" value="mbgp">show ip mbgp &lt;prefix&gt; [netmask]</dd>
-<dd><input type=radio name="query" value="mbgpsum">show ip mbgp summary</dd>
-<dd><input type=radio name="query" value="log">show logging [ | &lt;match_string&gt;]</DD>
-<dd><input type=radio name="query" value="ping">ping &lt;IP_addr | FQDN&gt;</dd>
-<dd><input type=radio name="query" value="trace">traceroute &lt;IP_addr | FQDN&gt;</DD>
+ <th align=left><B>Query:</B></th>
+ <th align=left><B>Router:</B></th>
+</tr>
+<tr><td>
+TABLEHEAD
+
+foreach $sub_type (sort keys(%$queries)) {
+ next if (! scalar(%{$queries->{$sub_type}}));
+ print $query->radio_group (-name => 'query',
+ -values => $queries->{$sub_type},
+ -default => '-', -linebreak => 'true');
+ print "\n" . $query->hr . "\n";
+}
+
+print <<QTYPES ;
<P><B>Argument(s):</B> <INPUT name="args" size=30></P>
</TD>
- <td ALIGH=left VALIGN=top>
- <b>Router:</B>
-
-<dd>
+ <td aligh=left valign=top>
QTYPES
-# <dd><input type=radio name="query" value="aspath">sh ip as-path-access-list &lt;list_number&gt;</DD>
-# <dd><input type="radio" name="query" value="acl">sh access-list &lt;list_number&gt;</dd>
-# <dd><input type=radio name="query" value="communitylist">sh ip community-list &lt;list_number&gt;<DD>
-# <dd><input type=radio name="query" value="routemap">sh ip route-map &lt;map_name&gt;</DD>
-
# read routers table and create the scrolling list
readrouters();
print $query->scrolling_list(-name => 'router',
@@ -224,20 +235,23 @@ print $query->scrolling_list(-name => 'router',
-labels => \%rtrlabels);
# end
-print <<TAIL ;
+print <<TABLEEND ;
</dd>
</td>
</TABLE>
-<p><input type=submit value=Submit> <INPUT type=reset value=Reset></FORM>
+<p>
+TABLEEND
+
+print $query->submit(-name => 'submit', -value =>'Submit');
+print $query->reset;
+print $query->endform;
+
+print <<TAIL ;
</center>
<br>
<a href=lgnotes.html>Looking Glass notes</a>
-TAIL
-
-print <<TAIL ;
<p>
$LG_INFO
-</body>
TAIL
print $query->end_html;
diff --git a/bin/mrancid.in b/bin/mrancid.in
index 8054917..8d52c27 100755..100644
--- a/bin/mrancid.in
+++ b/bin/mrancid.in
@@ -1,29 +1,33 @@
-#!@PERLV_PATH@
+#! @PERLV_PATH@
##
-## Amazingly hacked version of Hank's rancid - this one tries to
-## deal with MRTd.
+## $Id: mrancid.in,v 1.11 2004/01/11 03:49:13 heas Exp $
##
-## Copyright (C) 1997-2001 by Henry Kilmer.
+## Copyright (C) 1997-2004 by Terrapin Communications, Inc.
## All rights reserved.
##
-## This software may be freely copied, modified and redistributed without
-## fee for non-commerical purposes provided that this copyright notice is
-## preserved intact on all copies and modified copies.
+## This software may be freely copied, modified and redistributed
+## without fee for non-commerical purposes provided that this license
+## remains intact and unmodified with any RANCID distribution.
##
## There is no warranty or other guarantee of fitness of this software.
-## It is provided solely "as is". The author(s) disclaim(s) all
+## It is provided solely "as is". The author(s) disclaim(s) all
## responsibility and liability with respect to this software's usage
## or its effect upon hardware, computer systems, other software, or
## anything else.
##
+## Except where noted otherwise, rancid was written by and is maintained by
+## Henry Kilmer, John Heasley, Andrew Partan, Pete Whiting, and Austin Schutz.
##
#
+# Amazingly hacked version of Hank's rancid - this one tries to
+# deal with MRTd.
+#
# RANCID - Really Awesome New Cisco confIg Differ
#
# usage: rancid [-d] [-l] [-f filename | $host]
#
use Getopt::Std;
-getopts('dflm');
+getopts('dfl');
$log = $opt_l;
$debug = $opt_d;
$file = $opt_f;
@@ -355,8 +359,12 @@ TOP: while(<INPUT>) {
}
while (/#\s*($cmds_regexp)\s*$/) {
$cmd = $1;
- if (!defined($prompt)) {$prompt = ($_ =~ /^([^#]+)/)[0];
- $prompt .= "[#>]"; }
+ if (!defined($prompt)) {
+ $prompt = ($_ =~ /^([^#]+)/)[0];
+ $prompt =~ s/([][}{)(\\])/\\$1/g;
+ $prompt .= "[#>]";
+ print STDERR ("PROMPT MATCH: $prompt\n") if ($debug);
+ }
print STDERR ("HIT COMMAND:$_") if ($debug);
if (! defined($commands{$cmd})) {
print STDERR "$host: found unexpected command - \"$cmd\"\n";
diff --git a/bin/nlogin.in b/bin/nlogin.in
new file mode 100644
index 0000000..685c759
--- /dev/null
+++ b/bin/nlogin.in
@@ -0,0 +1,524 @@
+#! @EXPECT_PATH@ --
+##
+## $Id: nlogin.in,v 1.14 2004/01/11 05:39:15 heas Exp $
+##
+## Copyright (C) 1997-2004 by Terrapin Communications, Inc.
+## All rights reserved.
+##
+## This software may be freely copied, modified and redistributed
+## without fee for non-commerical purposes provided that this license
+## remains intact and unmodified with any RANCID distribution.
+##
+## There is no warranty or other guarantee of fitness of this software.
+## It is provided solely "as is". The author(s) disclaim(s) all
+## responsibility and liability with respect to this software's usage
+## or its effect upon hardware, computer systems, other software, or
+## anything else.
+##
+## Except where noted otherwise, rancid was written by and is maintained by
+## Henry Kilmer, John Heasley, Andrew Partan, Pete Whiting, and Austin Schutz.
+##
+#
+# The login expect scripts were based on Erik Sherk's gwtn, by permission.
+#
+# nlogin - netscreen login
+#
+# Most options are intuitive for logging into a netscreen firewall.
+#
+
+# Usage line
+set usage "Usage: $argv0 \[-c command\] \[-Evar=x\] \[-f cloginrc-file\]
+\[-s script-file\] \[-t timeout\] \[-u user\] \
+\[-p user-password\] \[-y ssh_cypher_type\] firewall \[firewall...\]\n"
+
+# env(CLOGIN) may contain:
+# x == do not set xterm banner or name
+
+# Password file
+set password_file $env(HOME)/.cloginrc
+# Default is to login to the firewall
+set do_command 0
+set do_script 0
+# The default is to automatically enable
+set enable 0
+# The default is that you login non-enabled (tacacs can have you login already
+# enabled)
+set avautoenable 1
+# The default is to look in the password file to find the passwords. This
+# tracks if we receive them on the command line.
+set do_passwd 1
+set do_enapasswd 1
+
+# Find the user in the ENV, or use the unix userid.
+if {[ info exists env(CISCO_USER) ] } {
+ set default_user $env(CISCO_USER)
+} elseif {[ info exists env(USER) ]} {
+ set default_user $env(USER)
+} elseif {[ info exists env(LOGNAME) ]} {
+ set default_user $env(LOGNAME)
+} else {
+ # This uses "id" which I think is portable. At least it has existed
+ # (without options) on all machines/OSes I've been on recently -
+ # unlike whoami or id -nu.
+ if [ catch {exec id} reason ] {
+ send_error "\nError: could not exec id: $reason\n"
+ exit 1
+ }
+ regexp {\(([^)]*)} "$reason" junk default_user
+}
+
+# Sometimes firewall take awhile to answer (the default is 10 sec)
+set timeout 45
+
+# Process the command line
+for {set i 0} {$i < $argc} {incr i} {
+ set arg [lindex $argv $i]
+
+ switch -glob -- $arg {
+ # Username
+ -u* -
+ -U* {
+ if {! [ regexp .\[uU\](.+) $arg ignore user]} {
+ incr i
+ set username [ lindex $argv $i ]
+ }
+ # VTY Password
+ } -p* -
+ -P* {
+ if {! [ regexp .\[pP\](.+) $arg ignore userpasswd]} {
+ incr i
+ set userpasswd [ lindex $argv $i ]
+ }
+ set do_passwd 0
+ # Environment variable to pass to -s scripts
+ } -E*
+ {
+ if {[ regexp .\[E\](.+)=(.+) $arg ignore varname varvalue]} {
+ set E$varname $varvalue
+ } else {
+ send_user "\nError: invalid format for -E in $arg\n"
+ exit 1
+ }
+ # Command to run.
+ } -c* -
+ -C* {
+ if {! [ regexp .\[cC\](.+) $arg ignore command]} {
+ incr i
+ set command [ lindex $argv $i ]
+ }
+ set do_command 1
+ # Expect script to run.
+ } -s* -
+ -S* {
+ if {! [ regexp .\[sS\](.+) $arg ignore sfile]} {
+ incr i
+ set sfile [ lindex $argv $i ]
+ }
+ if { ! [ file readable $sfile ] } {
+ send_user "\nError: Can't read $sfile\n"
+ exit 1
+ }
+ set do_script 1
+ # cypher type
+ } -y* -
+ -Y* {
+ if {! [ regexp .\[eE\](.+) $arg ignore cypher]} {
+ incr i
+ set cypher [ lindex $argv $i ]
+ }
+ # alternate cloginrc file
+ } -f* -
+ -F* {
+ if {! [ regexp .\[fF\](.+) $arg ignore password_file]} {
+ incr i
+ set password_file [ lindex $argv $i ]
+ }
+ } -t* -
+ -T* {
+ incr i
+ set timeout [ lindex $argv $i ]
+ } -x* -
+ -X {
+ if {! [ regexp .\[xX\](.+) $arg ignore cmd_file]} {
+ incr i
+ set cmd_file [ lindex $argv $i ]
+ }
+ if [ catch {set cmd_fd [open $cmd_file r]} reason ] {
+ send_user "\nError: $reason\n"
+ exit 1
+ }
+ set cmd_text [read $cmd_fd]
+ close $cmd_fd
+ set command [join [split $cmd_text \n] \;]
+ set do_command 1
+ # Does tacacs automatically enable us?
+ } -autoenable {
+ # ignore autoenable
+ #set avautoenable 1
+ } -* {
+ send_user "\nError: Unknown argument! $arg\n"
+ send_user $usage
+ exit 1
+ } default {
+ break
+ }
+ }
+}
+# Process firewalls...no firewalls listed is an error.
+if { $i == $argc } {
+ send_user "\nError: $usage"
+}
+
+# Only be quiet if we are running a script (it can log its output
+# on its own)
+if { $do_script } {
+ log_user 0
+} else {
+ log_user 1
+}
+
+#
+# Done configuration/variable setting. Now run with it...
+#
+
+# Sets Xterm title if interactive...if its an xterm and the user cares
+proc label { host } {
+ global env
+ # if CLOGIN has an 'x' in it, don't set the xterm name/banner
+ if [info exists env(CLOGIN)] {
+ if {[string first "x" $env(CLOGIN)] != -1} { return }
+ }
+ # take host from ENV(TERM)
+ if [info exists env(TERM)] {
+ if [regexp \^(xterm|vs) $env(TERM) ignore ] {
+ send_user "\033]1;[lindex [split $host "."] 0]\a"
+ send_user "\033]2;$host\a"
+ }
+ }
+}
+
+# This is a helper function to make the password file easier to
+# maintain. Using this the password file has the form:
+# add password sl* pete cow
+# add password at* steve
+# add password * hanky-pie
+proc add {var args} { global int_$var ; lappend int_$var $args}
+proc include {args} {
+ global env
+ regsub -all "(^{|}$)" $args {} args
+ if { [ regexp "^/" $args ignore ] == 0 } {
+ set args $env(HOME)/$args
+ }
+ source_password_file $args
+}
+
+proc find {var firewall} {
+ upvar int_$var list
+ if { [info exists list] } {
+ foreach line $list {
+ if { [string match [lindex $line 0] $firewall ] } {
+ return [lrange $line 1 end]
+ }
+ }
+ }
+ return {}
+}
+
+# Loads the password file. Note that as this file is tcl, and that
+# it is sourced, the user better know what to put in there, as it
+# could install more than just password info... I will assume however,
+# that a "bad guy" could just as easy put such code in the clogin
+# script, so I will leave .cloginrc as just an extention of that script
+proc source_password_file { password_file } {
+ global env
+ if { ! [file exists $password_file] } {
+ send_user "\nError: password file ($password_file) does not exist\n"
+ exit 1
+ }
+ file stat $password_file fileinfo
+ if { [expr ($fileinfo(mode) & 007)] != 0000 } {
+ send_user "\nError: $password_file must not be world readable/writable\n"
+ exit 1
+ }
+ if [ catch {source $password_file} reason ] {
+ send_user "\nError: $reason\n"
+ exit 1
+ }
+}
+
+# Log into the firewall.
+proc login { firewall user userpswd passwd enapasswd prompt cmethod
+cyphertype } {
+ global spawn_id in_proc do_command do_script sshcmd
+ set in_proc 1
+ set uprompt_seen 0
+
+ # Telnet to the firewall & try to login.
+ set progs [llength $cmethod]
+ foreach prog [lrange $cmethod 0 end] {
+ if [string match "telnet*" $prog] {
+ regexp {telnet(:([^[:space:]]+))*} $prog command suffix port
+ if {"$port" == ""} {
+ set retval [ catch {spawn telnet $firewall} reason ]
+ } else {
+ set retval [ catch {spawn telnet $firewall $port} reason ]
+ }
+ if { $retval } {
+ send_user "\nError: telnet failed: $reason\n"
+ exit 1
+ }
+ } elseif ![string compare $prog "ssh"] {
+ if [ catch {spawn $sshcmd -c $cyphertype -x -l $user $firewall} reason ] {
+ send_user "\nError: $sshcmd failed: $reason\n"
+ exit 1
+ }
+ } elseif ![string compare $prog "rsh"] {
+ if [ catch {spawn rsh -l $user $firewall} reason ] {
+ send_user "\nError: rsh failed: $reason\n"
+ exit 1
+ }
+ } else {
+ puts "\nError: unknown connection method: $prog"
+ return 1
+ }
+ incr progs -1
+
+ sleep 0.3
+
+ # This helps cleanup each expect clause.
+ expect_after {
+ timeout {
+ send_user "\nError: TIMEOUT reached\n"
+ catch {close}; wait
+ if { $in_proc} {
+ return 1
+ } else {
+ continue
+ }
+ } eof {
+ send_user "\nError: EOF received\n"
+ catch {close}; wait
+ if { $in_proc} {
+ return 1
+ } else {
+ continue
+ }
+ }
+ }
+
+ # Here we get a little tricky. There are several possibilities:
+ # the firewall can ask for a username and passwd and then
+ # talk to the TACACS server to authenticate you, or if the
+ # TACACS server is not working, then it will use the enable
+ # passwd. Or, the firewall might not have TACACS turned on,
+ # then it will just send the passwd.
+ # if telnet fails with connection refused, try ssh
+ expect {
+ "Connection refused" {
+ send_user "\nError: Connection Refused\n"; wait; return 1
+ } eof { send_user "\nError: Couldn't login\n"; wait; return 1
+ } "Unknown host\r\n" {
+ expect eof
+ send_user "\nError: Unknown host\n"; wait; return 1
+ } "Host is unreachable" {
+ expect eof
+ send_user "\nError: Host Unreachable!\n"; wait; return 1
+ } "No address associated with name" {
+ expect eof
+ send_user "\nError: Unknown host\n"; wait; return 1
+ }
+ -re "Are you sure you want to continue connecting .*" {
+ send "yes\r"
+ send_user "Host $firewall added to the list of known hosts.\n"
+ exp_continue }
+ -re "Host key not found .* \(yes\/no\)\?" {
+ send "yes\r"
+ send_user "Host $firewall added to the list of known hosts.\n"
+ exp_continue }
+ -re "HOST IDENTIFICATION HAS CHANGED.* \(yes\/no\)\?" {
+ send "no\r"
+ send_user "\nError: The host key for $firewall has changed. Update the SSH known_hosts file accordingly.\n"
+ return 1 }
+ -re "Offending key for .* \(yes\/no\)\?" {
+ send "no\r"
+ send_user "\nError: host key mismatch for $firewall. Update the SSH known_hosts file accordingly.\n"
+ return 1 }
+ denied { send_user "\nError: Check your passwd for $firewall\n"
+ catch {close}; wait; return 1
+ }
+ " ### Login failed" {send_user "\nError: Check your passwd for $firewall\n"; return 1 }
+ -re "(login:)" {
+ sleep 1;
+ send "$user\r"
+ set uprompt_seen 1
+ exp_continue
+ }
+ "@\[^\r\n]+\[Pp]assword:" {
+ # ssh pwd prompt
+ sleep 1
+ send "$userpswd\r"
+ exp_continue
+ }
+ "\[Pp]assword:" {
+ sleep 1;
+ if {$uprompt_seen == 1} {
+ send "$userpswd\r"
+ } else {
+ send "$passwd\r"
+ }
+ exp_continue
+ }
+ "$prompt" { break; }
+ }
+ }
+ set in_proc 0
+ return 0
+}
+
+# Run commands given on the command line.
+proc run_commands { prompt command } {
+ global in_proc
+ set in_proc 1
+
+ send "set console page 0\r"
+ expect $prompt {}
+
+ # Is this a multi-command?
+ if [ string match "*\;*" "$command" ] {
+ set commands [split $command \;]
+ set num_commands [llength $commands]
+
+ for {set i 0} {$i < $num_commands} { incr i} {
+ send "[subst [lindex $commands $i]]\r"
+ expect {
+ -re "$prompt" {}
+ }
+ }
+ } else {
+ send "[subst $command]\r"
+ expect {
+ -re "$prompt" {}
+ }
+ }
+ send "exit\r"
+ expect {
+ "\n" { exp_continue }
+ -re "$prompt" {
+ send "exit\r"
+ exp_continue }
+ -re "Configuration modified, save?" {
+ send "n\r"
+ exp_continue }
+ timeout { return 0 }
+ eof { return 0 }
+ }
+ set in_proc 0
+}
+
+#
+# For each firewall... (this is main loop)
+#
+source_password_file $password_file
+set in_proc 0
+foreach firewall [lrange $argv $i end] {
+ set firewall [string tolower $firewall]
+ send_user "$firewall\n"
+
+ set prompt ">"
+
+ # Figure out passwords
+ if { $do_passwd || $do_enapasswd } {
+ set pswd [find password $firewall]
+ if { [llength $pswd] == 0 } {
+ send_user "\nError: no password for $firewall in $password_file.\n"
+ continue
+ }
+ set passwd [join [lindex $pswd 0]""]
+ set enapasswd [join [lindex $pswd 1] ""]
+ }
+
+ # Figure out username
+ if {[info exists username]} {
+ # command line username
+ set ruser $username
+ } else {
+ set ruser [join [find user $firewall] ""]
+ if { "$ruser" == "" } { set ruser $default_user }
+ }
+
+ # Figure out username's password (if different from the vty password)
+ if {[info exists userpasswd]} {
+ # command line username
+ set userpswd $userpasswd
+ } else {
+ set userpswd [join [find userpassword $firewall] ""]
+ if { "$userpswd" == "" } { set userpswd $passwd }
+ }
+
+ # Figure out enable username
+ if {[info exists enausername]} {
+ # command line enausername
+ set enauser $enausername
+ } else {
+ set enauser [join [find enauser $firewall] ""]
+ if { "$enauser" == "" } { set enauser $ruser }
+ }
+
+ # Figure out cypher type
+ if {[info exists cypher]} {
+ # command line cypher type
+ set cyphertype $cypher
+ } else {
+ set cyphertype [find cyphertype $firewall]
+ if { "$cyphertype" == "" } { set cyphertype "3des" }
+ }
+
+ # Figure out connection method
+ set cmethod [find method $firewall]
+ if { "$cmethod" == "" } { set cmethod {{telnet} {ssh}} }
+
+ # Figure out the SSH executable name
+ set sshcmd [find sshcmd $router]
+ if { "$sshcmd" == "" } { set sshcmd {ssh} }
+
+ # Login to the firewall
+ if {[login $firewall $ruser $userpswd $passwd $enapasswd $prompt $cmethod $cyphertype]} {
+ continue
+ }
+ if { $enable } {
+ if {[do_enable $enauser $enapasswd]} {
+ if { $do_command || $do_script } {
+ close; wait
+ continue
+ }
+ }
+ }
+ # we are logged in, now figure out the full prompt
+ send "\r"
+ expect {
+ -re "\[\r\n]+" { exp_continue; }
+ -re "^.+$prompt" { set junk $expect_out(0,string);
+ regsub -all "\[\]\(\)\[]" $junk {\\&} prompt;
+ }
+ }
+
+ if { $do_command } {
+ if {[run_commands $prompt $command]} {
+ continue
+ }
+ } elseif { $do_script } {
+ send "set console page 0\r"
+ expect $prompt {}
+ source $sfile
+ close
+ } else {
+ label $firewall
+ log_user 1
+ interact
+ }
+
+ # End of for each firewall
+ wait
+ sleep 0.3
+}
+exit 0
diff --git a/bin/nrancid.in b/bin/nrancid.in
new file mode 100644
index 0000000..9b965a2
--- /dev/null
+++ b/bin/nrancid.in
@@ -0,0 +1,302 @@
+#! @PERLV_PATH@
+##
+## $Id: nrancid.in,v 1.13 2004/01/11 03:49:13 heas Exp $
+##
+## Copyright (C) 1997-2004 by Terrapin Communications, Inc.
+## All rights reserved.
+##
+## This software may be freely copied, modified and redistributed
+## without fee for non-commerical purposes provided that this license
+## remains intact and unmodified with any RANCID distribution.
+##
+## There is no warranty or other guarantee of fitness of this software.
+## It is provided solely "as is". The author(s) disclaim(s) all
+## responsibility and liability with respect to this software's usage
+## or its effect upon hardware, computer systems, other software, or
+## anything else.
+##
+## Except where noted otherwise, rancid was written by and is maintained by
+## Henry Kilmer, John Heasley, Andrew Partan, Pete Whiting, and Austin Schutz.
+##
+#
+# Amazingly hacked version of Hank's rancid - this one tries to
+# deal with Netscreen firewalls
+#
+# Original Netscreen hacks implemented by Stephen Gill [gillsr@yahoo.com]
+#
+# RANCID - Really Awesome New Cisco confIg Differ
+#
+# usage: rancid [-d] [-l] [-f filename | $host]
+#
+use Getopt::Std;
+getopts('dfl');
+$log = $opt_l;
+$debug = $opt_d;
+$file = $opt_f;
+$host = $ARGV[0];
+$found_end = 0;
+$timeo = 90; # nlogin timeout in seconds
+
+my(%filter_pwds); # password filtering mode
+
+# This routine is used to print out the firewall configuration
+sub ProcessHistory {
+ my($new_hist_tag,$new_command,$command_string,@string)=(@_);
+ if((($new_hist_tag ne $hist_tag) || ($new_command ne $command))
+ && defined %history) {
+ print eval "$command \%history";
+ undef %history;
+ }
+ if (($new_hist_tag) && ($new_command) && ($command_string)) {
+ if ($history{$command_string}) {
+ $history{$command_string} = "$history{$command_string}@string";
+ } else {
+ $history{$command_string} = "@string";
+ }
+ } elsif (($new_hist_tag) && ($new_command)) {
+ $history{++$#history} = "@string";
+ } else {
+ print "@string";
+ }
+ $hist_tag = $new_hist_tag;
+ $command = $new_command;
+ 1;
+}
+
+sub numerically { $a <=> $b; }
+
+# This is a sort routing that will sort numerically on the
+# keys of a hash as if it were a normal array.
+sub keynsort {
+ local(%lines)=@_;
+ local($i) = 0;
+ local(@sorted_lines);
+ foreach $key (sort numerically keys(%lines)) {
+ $sorted_lines[$i] = $lines{$key};
+ $i++;
+ }
+ @sorted_lines;
+}
+
+# This is a sort routing that will sort on the
+# keys of a hash as if it were a normal array.
+sub keysort {
+ local(%lines)=@_;
+ local($i) = 0;
+ local(@sorted_lines);
+ foreach $key (sort keys(%lines)) {
+ $sorted_lines[$i] = $lines{$key};
+ $i++;
+ }
+ @sorted_lines;
+}
+
+# This is a sort routing that will sort on the
+# values of a hash as if it were a normal array.
+sub valsort{
+ local(%lines)=@_;
+ local($i) = 0;
+ local(@sorted_lines);
+ foreach $key (sort values %lines) {
+ $sorted_lines[$i] = $key;
+ $i++;
+ }
+ @sorted_lines;
+}
+
+# This is a numerical sort routing (ascending).
+sub numsort {
+ local(%lines)=@_;
+ local($i) = 0;
+ local(@sorted_lines);
+ foreach $num (sort {$a <=> $b} keys %lines) {
+ $sorted_lines[$i] = $lines{$num};
+ $i++;
+ }
+ @sorted_lines;
+}
+
+# This is a sort routine that will sort on the
+# ip address when the ip address is anywhere in
+# the strings.
+sub ipsort {
+ local(%lines)=@_;
+ local($i) = 0;
+ local(@sorted_lines);
+ foreach $addr (sort sortbyipaddr keys %lines) {
+ $sorted_lines[$i] = $lines{$addr};
+ $i++;
+ }
+ @sorted_lines;
+}
+
+# These two routines will sort based upon IP addresses
+sub ipaddrval {
+ my(@a) = ($_[0] =~ m#^(\d+)\.(\d+)\.(\d+)\.(\d+)$#);
+ $a[3]+256*($a[2]+256*($a[1]+256*$a[0]));
+}
+sub sortbyipaddr {
+ &ipaddrval($a) <=> &ipaddrval($b);
+}
+
+# This routine parses "get system"
+sub GetSystem {
+ print STDERR " In GetSystem: $_" if ($debug);
+
+ while (<INPUT>) {
+ tr/\015//d;
+ next if /^\s*$/;
+ last if(/$prompt/);
+
+ /^Serial Number: (\d+), Control Number: \d+$/ &&
+ ProcessHistory("SYSTEM","","", "!SN: $1\n") && next;
+ /^Product Name: (\S+)$/ &&
+ ProcessHistory("SYSTEM","","", "!Product: $1\n") && next;
+ /^Hardware Version: (\S+), / &&
+ ProcessHistory("SYSTEM","","", "!HW: $1\n") && next;
+ /^Software Version: (\S+), Type: (\S+)$/ &&
+ ProcessHistory("SYSTEM","","", "!Netscreen Type: $2\n!Software Version: $1\n") && next;
+ /^Image: (\S+), / &&
+ ProcessHistory("SYSTEM","","", "!Image: $1\n") && next;
+ /^Feature: (\S+)$/ &&
+ ProcessHistory("SYSTEM","","", "!Feature: $1\n") && next;
+ /^File Name: (\S+), Checksum: (\S+)$/ &&
+ ProcessHistory("SYSTEM","","", "!File Name: $1, Checksum: $2\n") && next;
+
+ }
+ ProcessHistory("SYSTEM","","","!\n");
+ return(0);
+}
+
+sub GetFile {
+ print STDERR " In GetFile: $_" if ($debug);
+ while (<INPUT>) {
+ last if(/$prompt/);
+ }
+ ProcessHistory("FILE","","","!\n");
+ return(0);
+}
+
+sub GetConf {
+ print STDERR " In GetConf: $_" if ($debug);
+ while (<INPUT>) {
+ tr/\015//d;
+ next if /^\s*$/;
+ last if(/$prompt/);
+
+ if (/^set admin name "(\S+)"$/ && $filter_pwds >= 1) {
+ ProcessHistory("ADMIN","","","!set admin name <removed>\n");
+ next;
+ }
+ if (/^set admin password (\S+)$/ && $filter_pwds >= 1) {
+ ProcessHistory("ADMIN","","","!set admin password <removed>\n");
+ next;
+ }
+ if (/^set admin user (\S+) password (\S+) privilege (\S+)$/ &&
+ $filter_pwds >= 1) {
+ ProcessHistory("ADMIN","","",
+ "!set admin user $1 password <removed> privilege $3\n");
+ next;
+ ProcessHistory("","","","$_");
+ }
+ $found_end=1;
+ return(1);
+}
+
+# dummy function
+sub DoNothing {print STDOUT;}
+
+# Main
+%commands=(
+ 'get system' => "GetSystem",
+ 'get conf' => "GetConf"
+);
+# keys() doesnt return things in the order entered and the order of the
+# cmds is important. pita
+@commands=(
+ "get system",
+ "get conf"
+);
+$cisco_cmds=join(";",@commands);
+$cmds_regexp=join("|",@commands);
+
+open(OUTPUT,">$host.new") || die "Can't open $host.new for writing: $!\n";
+select(OUTPUT);
+# make OUTPUT unbuffered if debugging
+if ($debug) { $| = 1; }
+
+if ($file) {
+ print STDERR "opening file $host\n" if ($debug);
+ print STDOUT "opening file $host\n" if ($log);
+ open(INPUT,"<$host") || die "open failed for $host: $!\n";
+} else {
+ print STDERR "executing nlogin -t $timeo -c\"$cisco_cmds\" $host\n" if ($debug);
+ print STDOUT "executing nlogin -t $timeo -c\"$cisco_cmds\" $host\n" if ($log);
+ if (defined($ENV{NOPIPE})) {
+ system "nlogin -t $timeo -c \"$cisco_cmds\" $host </dev/null > $host.raw 2>&1" || die "nlogin failed for $host: $!\n";
+ open(INPUT, "< $host.raw") || die "nlogin failed for $host: $!\n";
+ } else {
+ open(INPUT,"nlogin -t $timeo -c \"$cisco_cmds\" $host </dev/null |") || die "nlogin failed for $host: $!\n";
+ }
+}
+
+# determine password filtering mode
+if ($ENV{"FILTER_PWDS"} =~ /no/i) {
+ $filter_pwds = 0;
+} elsif ($ENV{"FILTER_PWDS"} =~ /all/i) {
+ $filter_pwds = 2;
+} else {
+ $filter_pwds = 1;
+}
+
+ProcessHistory("","","","!RANCID-CONTENT-TYPE: netscreen\n!\n");
+TOP: while(<INPUT>) {
+ tr/\015//d;
+ if (/^Error:/) {
+ print STDOUT ("$host nlogin error: $_");
+ print STDERR ("$host nlogin error: $_") if ($debug);
+ last;
+ }
+ while (/>\s*($cmds_regexp)\s*$/) {
+ $cmd = $1;
+ if (!defined($prompt)) {
+ $prompt = "\-\>\s*";
+ print STDERR ("PROMPT MATCH: $prompt\n") if ($debug);
+ }
+ print STDERR ("HIT COMMAND:$_") if ($debug);
+ if (!defined($commands{$cmd})) {
+ print STDERR "$host: found unexpected command - \"$cmd\"\n";
+ last TOP;
+ }
+ $rval = &{$commands{$cmd}};
+ delete($commands{$cmd});
+ if ($rval == -1) {
+ last TOP;
+ }
+ }
+}
+print STDOUT "Done $logincmd: $_\n" if ($log);
+# Flush History
+ProcessHistory("","","","");
+# Cleanup
+close(INPUT);
+close(OUTPUT);
+
+if (defined($ENV{NOPIPE})) {
+ unlink("$host.raw") if (! $debug);
+}
+
+# check for completeness
+if (scalar(%commands) || !$found_end) {
+ if (scalar(%commands)) {
+ printf(STDOUT "$host: missed cmd(s): %s\n", join(',', keys(%commands)));
+ printf(STDERR "$host: missed cmd(s): %s\n", join(',', keys(%commands))) if ($debug);
+ }
+ if (!$found_end) {
+ print STDOUT "$found_end: found end\n";
+ print STDOUT "$host: End of run not found\n";
+ print STDERR "$host: End of run not found\n" if ($debug);
+ system("/usr/bin/tail -1 $host.new");
+ }
+ unlink "$host.new" if (! $debug);
+}
diff --git a/bin/nslogin.in b/bin/nslogin.in
new file mode 100644
index 0000000..385f530
--- /dev/null
+++ b/bin/nslogin.in
@@ -0,0 +1,642 @@
+#! @EXPECT_PATH@ --
+##
+## $Id: nslogin.in,v 1.10 2004/01/11 05:39:15 heas Exp $
+##
+## Copyright (C) 1997-2004 by Terrapin Communications, Inc.
+## All rights reserved.
+##
+## This software may be freely copied, modified and redistributed
+## without fee for non-commerical purposes provided that this license
+## remains intact and unmodified with any RANCID distribution.
+##
+## There is no warranty or other guarantee of fitness of this software.
+## It is provided solely "as is". The author(s) disclaim(s) all
+## responsibility and liability with respect to this software's usage
+## or its effect upon hardware, computer systems, other software, or
+## anything else.
+##
+## Except where noted otherwise, rancid was written by and is maintained by
+## Henry Kilmer, John Heasley, Andrew Partan, Pete Whiting, and Austin Schutz.
+##
+#
+# The login expect scripts were based on Erik Sherk's gwtn, by permission.
+#
+# nslogin - Netscaler login
+#
+# Hacks from Anshuman Kanwar.
+#
+# Most options are intuitive for logging into a Cisco router.
+# The default is to enable (thus -noenable). Some folks have
+# setup tacacs to have a user login at priv-lvl = 15 (enabled)
+# so the -autoenable flag was added for this case (don't go through
+# the process of enabling and the prompt will be the "#" prompt.
+# The default username password is the same as the vty password.
+#
+
+# Usage line
+set usage "Usage: $argv0 \[-autoenable\] \[-noenable\] \[-c command\] \
+\[-Evar=x\] \[-e enable-password\] \[-f cloginrc-file\] \[-p user-password\] \
+\[-s script-file\] \[-t timeout\] \[-u username\] \
+\[-v vty-password\] \[-w enable-username\] \[-x command-file\] \
+\[-y ssh_cypher_type\] router \[router...\]\n"
+
+# env(CLOGIN) may contain:
+# x == do not set xterm banner or name
+
+# Password file
+set password_file $env(HOME)/.cloginrc
+# Default is to login to the router
+set do_command 1
+set do_script 0
+# The default is to automatically enable
+set enable 0
+# The default is that you login non-enabled (tacacs can have you login already
+# enabled)
+set avautoenable 0
+# The default is to look in the password file to find the passwords. This
+# tracks if we receive them on the command line.
+set do_passwd 1
+set do_enapasswd 1
+# attempt at platform switching.
+set platform ""
+
+# Find the user in the ENV, or use the unix userid.
+if {[ info exists env(CISCO_USER) ] } {
+ set default_user $env(CISCO_USER)
+} elseif {[ info exists env(USER) ]} {
+ set default_user $env(USER)
+} elseif {[ info exists env(LOGNAME) ]} {
+ set default_user $env(LOGNAME)
+} else {
+ # This uses "id" which I think is portable. At least it has existed
+ # (without options) on all machines/OSes I've been on recently -
+ # unlike whoami or id -nu.
+ if [ catch {exec id} reason ] {
+ send_error "\nError: could not exec id: $reason\n"
+ exit 1
+ }
+ regexp {\(([^)]*)} "$reason" junk default_user
+}
+
+# Sometimes routers take awhile to answer (the default is 10 sec)
+set timeout 45
+
+# Process the command line
+for {set i 0} {$i < $argc} {incr i} {
+ set arg [lindex $argv $i]
+
+ switch -glob -- $arg {
+ # Username
+ -u* -
+ -U* {
+ if {! [ regexp .\[uU\](.+) $arg ignore user]} {
+ incr i
+ set username [ lindex $argv $i ]
+ }
+ # VTY Password
+ } -p* -
+ -P* {
+ if {! [ regexp .\[pP\](.+) $arg ignore userpasswd]} {
+ incr i
+ set userpasswd [ lindex $argv $i ]
+ }
+ set do_passwd 0
+ # VTY Password
+ } -v* -
+ -v* {
+ if {! [ regexp .\[vV\](.+) $arg ignore passwd]} {
+ incr i
+ set passwd [ lindex $argv $i ]
+ }
+ set do_passwd 0
+ # Enable Username
+ } -w* -
+ -W* {
+ if {! [ regexp .\[wW\](.+) $arg ignore enauser]} {
+ incr i
+ set enausername [ lindex $argv $i ]
+ }
+ # Environment variable to pass to -s scripts
+ } -E*
+ {
+ if {[ regexp .\[E\](.+)=(.+) $arg ignore varname varvalue]} {
+ set E$varname $varvalue
+ } else {
+ send_user "\nError: invalid format for -E in $arg\n"
+ exit 1
+ }
+ # Enable Password
+ } -e*
+ {
+ if {! [ regexp .\[e\](.+) $arg ignore enapasswd]} {
+ incr i
+ set enapasswd [ lindex $argv $i ]
+ }
+ set do_enapasswd 0
+ # Command to run.
+ } -c* -
+ -C* {
+ if {! [ regexp .\[cC\](.+) $arg ignore command]} {
+ incr i
+ set command [ lindex $argv $i ]
+ }
+ set do_command 1
+ # Expect script to run.
+ } -s* -
+ -S* {
+ if {! [ regexp .\[sS\](.+) $arg ignore sfile]} {
+ incr i
+ set sfile [ lindex $argv $i ]
+ }
+ if { ! [ file readable $sfile ] } {
+ send_user "\nError: Can't read $sfile\n"
+ exit 1
+ }
+ set do_script 1
+ # 'ssh -c' cypher type
+ } -y* -
+ -Y* {
+ if {! [ regexp .\[eE\](.+) $arg ignore cypher]} {
+ incr i
+ set cypher [ lindex $argv $i ]
+ }
+ # alternate cloginrc file
+ } -f* -
+ -F* {
+ if {! [ regexp .\[fF\](.+) $arg ignore password_file]} {
+ incr i
+ set password_file [ lindex $argv $i ]
+ }
+ # Timeout
+ } -t* -
+ -T* {
+ if {! [ regexp .\[tT\](.+) $arg ignore timeout]} {
+ incr i
+ set timeout [ lindex $argv $i ]
+ }
+ # Command file
+ } -x* -
+ -X {
+ if {! [ regexp .\[xX\](.+) $arg ignore cmd_file]} {
+ incr i
+ set cmd_file [ lindex $argv $i ]
+ }
+ if [ catch {set cmd_fd [open $cmd_file r]} reason ] {
+ send_user "\nError: $reason\n"
+ exit 1
+ }
+ set cmd_text [read $cmd_fd]
+ close $cmd_fd
+ set command [join [split $cmd_text \n] \;]
+ set do_command 1
+ # Do we enable?
+ } -noenable {
+ set enable 0
+ # Does tacacs automatically enable us?
+ } -autoenable {
+ set avautoenable 1
+ set enable 0
+ } -* {
+ send_user "\nError: Unknown argument! $arg\n"
+ send_user $usage
+ exit 1
+ } default {
+ break
+ }
+ }
+}
+# Process routers...no routers listed is an error.
+if { $i == $argc } {
+ send_user "\nError: $usage"
+}
+
+# Only be quiet if we are running a script (it can log its output
+# on its own)
+if { $do_script } {
+ log_user 0
+} else {
+ log_user 1
+}
+
+#
+# Done configuration/variable setting. Now run with it...
+#
+
+# Sets Xterm title if interactive...if its an xterm and the user cares
+proc label { host } {
+ global env
+ # if CLOGIN has an 'x' in it, don't set the xterm name/banner
+ if [info exists env(CLOGIN)] {
+ if {[string first "x" $env(CLOGIN)] != -1} { return }
+ }
+ # take host from ENV(TERM)
+ if [info exists env(TERM)] {
+ if [regexp \^(xterm|vs) $env(TERM) ignore ] {
+ send_user "\033]1;[lindex [split $host "."] 0]\a"
+ send_user "\033]2;$host\a"
+ }
+ }
+}
+
+# This is a helper function to make the password file easier to
+# maintain. Using this the password file has the form:
+# add password sl* pete cow
+# add password at* steve
+# add password * hanky-pie
+proc add {var args} { global int_$var ; lappend int_$var $args}
+proc include {args} {
+ global env
+ regsub -all "(^{|}$)" $args {} args
+ if { [ regexp "^/" $args ignore ] == 0 } {
+ set args $env(HOME)/$args
+ }
+ source_password_file $args
+}
+
+proc find {var router} {
+ upvar int_$var list
+ if { [info exists list] } {
+ foreach line $list {
+ if { [string match [lindex $line 0] $router ] } {
+ return [lrange $line 1 end]
+ }
+ }
+ }
+ return {}
+}
+
+# Loads the password file. Note that as this file is tcl, and that
+# it is sourced, the user better know what to put in there, as it
+# could install more than just password info... I will assume however,
+# that a "bad guy" could just as easy put such code in the clogin
+# script, so I will leave .cloginrc as just an extention of that script
+proc source_password_file { password_file } {
+ global env
+ if { ! [file exists $password_file] } {
+ send_user "\nError: password file ($password_file) does not exist\n"
+ exit 1
+ }
+ file stat $password_file fileinfo
+ if { [expr ($fileinfo(mode) & 007)] != 0000 } {
+ send_user "\nError: $password_file must not be world readable/writable\n"
+ exit 1
+ }
+ if [ catch {source $password_file} reason ] {
+ send_user "\nError: $reason\n"
+ exit 1
+ }
+}
+
+# Log into the router.
+proc login { router user userpswd passwd enapasswd cmethod cyphertype } {
+ global spawn_id in_proc do_command do_script platform
+ global prompt u_prompt p_prompt e_prompt sshcmd
+ set in_proc 1
+ set uprompt_seen 0
+
+ # try each of the connection methods in $cmethod until one is successful
+ set progs [llength $cmethod]
+ foreach prog [lrange $cmethod 0 end] {
+ if ![string compare $prog "ssh"] {
+ if [ catch {spawn $sshcmd -c $cyphertype -x -l $user $router} reason ] {
+ send_user "\nError: $sshcmd failed: $reason\n"
+ exit 1
+ }
+ } else {
+ puts "\nError: unknown connection method: $prog"
+ return 1
+ }
+ incr progs -1
+ sleep 0.3
+
+ # This helps cleanup each expect clause.
+ expect_after {
+ timeout {
+ send_user "\nError: TIMEOUT reached\n"
+ catch {close}; wait
+ if { $in_proc} {
+ return 1
+ } else {
+ continue
+ }
+ } eof {
+ send_user "\nError: EOF received\n"
+ catch {close}; wait
+ if { $in_proc} {
+ return 1
+ } else {
+ continue
+ }
+ }
+ }
+
+ # Here we get a little tricky. There are several possibilities:
+ # the router can ask for a username and passwd and then
+ # talk to the TACACS server to authenticate you, or if the
+ # TACACS server is not working, then it will use the enable
+ # passwd. Or, the router might not have TACACS turned on,
+ # then it will just send the passwd.
+ # if telnet fails with connection refused, try ssh
+ expect {
+ -re "(Connection refused|Secure connection \[^\n\r]+ refused|Connection closed by)" {
+ catch {close}; wait
+ if !$progs {
+ send_user "\nError: Connection Refused ($prog)\n"; return 1
+ }
+ }
+ eof { send_user "\nError: Couldn't login\n"; wait; return 1 }
+ -nocase "unknown host\r" {
+ catch {close};
+ send_user "\nError: Unknown host\n"; wait; return 1
+ }
+ "Host is unreachable" {
+ catch {close};
+ send_user "\nError: Host Unreachable!\n"; wait; return 1
+ }
+ "No address associated with name" {
+ catch {close};
+ send_user "\nError: Unknown host\n"; wait; return 1
+ }
+ -re "(Host key not found |The authenticity of host .* be established).*\(yes\/no\)\?" {
+ send "yes\r"
+ send_user "\nHost $router added to the list of known hosts.\n"
+ exp_continue }
+ -re "HOST IDENTIFICATION HAS CHANGED.* \(yes\/no\)\?" {
+ send "no\r"
+ send_user "\nError: The host key for $router has changed. Update the SSH known_hosts file accordingly.\n"
+ return 1 }
+ -re "Offending key for .* \(yes\/no\)\?" {
+ send "no\r"
+ send_user "\nError: host key mismatch for $router. Update the SSH known_hosts file accordingly.\n"
+ return 1 }
+ -re "(denied|Sorry)" {
+ send_user "\nError: Check your passwd for $router\n"
+ catch {close}; wait; return 1
+ }
+ "Login failed" {
+ send_user "\nError: Check your passwd for $router\n"
+ return 1
+ }
+ -re "% (Bad passwords|Authentication failed)" {
+ send_user "\nError: Check your passwd for $router\n"
+ return 1
+ }
+ -re "@\[^\r\n]+ $p_prompt" {
+ # ssh pwd prompt
+ sleep 1
+ send "$userpswd\r"
+ exp_continue
+ }
+
+ "$prompt" { break; }
+ "Login invalid" {
+ send_user "\nError: Invalid login\n";
+ catch {close}; wait; return 1
+ }
+ }
+ }
+
+ set in_proc 0
+ return 0
+}
+
+
+# Run commands given on the command line.
+
+proc run_commands { prompt command } {
+ global in_proc platform
+ set in_proc 1
+
+ regsub -all "\[)(]" $prompt {\\&} reprompt
+ # this is the only way i see to get rid of more prompts in o/p..grrrrr
+ log_user 0
+ # Is this a multi-command?
+ if [ string match "*\;*" "$command" ] {
+ set commands [split $command \;]
+ set num_commands [llength $commands]
+ # the pager can not be turned off on the PIX, so we have to look
+ # for the "More" prompt. the extreme is equally obnoxious, with a
+ # global switch in the config.
+ for {set i 0} {$i < $num_commands} { incr i} {
+ send "[subst -nocommands [lindex $commands $i]]\r"
+ expect {
+ -re "\b+" { exp_continue }
+ -re "^\[^\n\r *]*$reprompt" { send_user -- "$expect_out(buffer)"
+ }
+ -re "^\[^\n\r]*$reprompt." { send_user -- "$expect_out(buffer)"
+ exp_continue }
+ -re "\[\n\r]+" { send_user -- "$expect_out(buffer)"
+ exp_continue }
+ -re "\[^\r\n]*Press <SPACE> to cont\[^\r\n]*" {
+ send " "
+ # bloody ^[[2K after " "
+ expect {
+ -re "^\[^\r\n]*\r" {}
+ }
+ exp_continue
+ }
+ -re "^ --More--\[^\n\r]*" {
+ send " "
+ exp_continue }
+ -re "^<-+ More -+>\[^\n\r]*" {
+ send_user -- "$expect_out(buffer)"
+ send " "
+ exp_continue }
+ }
+ }
+ } else {
+ # the pager can not be turned off on the PIX, so we have to look
+ # for the "More" prompt. the extreme is equally obnoxious, with a
+ # global switch in the config.
+ send "[subst -nocommands $command]\r"
+ expect {
+ -re "\b+" { exp_continue }
+ -re "^\[^\n\r *]*$reprompt" { send_user -- "$expect_out(buffer)"
+ }
+ -re "^\[^\n\r]*$reprompt." { send_user -- "$expect_out(buffer)"
+ exp_continue }
+ -re "\[\n\r]+" { send_user -- "$expect_out(buffer)"
+ exp_continue }
+ -re "\[^\r\n]*Press <SPACE> to cont\[^\r\n]*" {
+ send " "
+ # bloody ^[[2K after " "
+ expect {
+ -re "^\[^\r\n]*\r" {}
+ }
+ exp_continue
+ }
+ -re "^ --More--\[^\n\r]*" {
+ send " "
+ exp_continue }
+ -re "^<-+ More -+>\[^\n\r]*" {
+ send_user -- "$expect_out(buffer)"
+ send " "
+ exp_continue }
+ }
+ }
+ log_user 1
+
+ if { [ string compare "extreme" "$platform" ] } {
+ send "exit\r"
+ } else {
+ send "quit\r"
+ }
+ expect {
+ "Do you wish to save your configuration changes" {
+ send "n\r"
+ exp_continue
+ }
+ "\n" { exp_continue }
+ timeout { return 0 }
+ eof { return 0 }
+ }
+ set in_proc 0
+}
+
+
+
+#
+# For each router... (this is main loop)
+#
+source_password_file $password_file
+set in_proc 0
+foreach router [lrange $argv $i end] {
+ set router [string tolower $router]
+ send_user "$router\n"
+
+ # Figure out prompt.
+ set prompt "#"
+
+ # look for noenable option in .cloginrc
+ if { [find noenable $router] != "" } {
+ set enable 0
+ }
+
+ # Figure out passwords
+ if { $do_passwd } {
+ set pswd [find password $router]
+ if { [llength $pswd] == 0 } {
+ send_user "\nError: no password for $router in $password_file.\n"
+ continue
+ }
+ if { $enable && $autoenable == 0 && [llength $pswd] < 2 } {
+ send_user "\nError: no enable password for $router in $password_file.\n"
+ continue
+ }
+ set passwd [join [lindex $pswd 0] ""]
+ set enapasswd [join [lindex $pswd 1] ""]
+ }
+
+ # Figure out username
+ if {[info exists username]} {
+ # command line username
+ set ruser $username
+ } else {
+ set ruser [join [find user $router] ""]
+ if { "$ruser" == "" } { set ruser $default_user }
+ }
+
+ # Figure out username's password (if different from the vty password)
+ if {[info exists userpasswd]} {
+ # command line username
+ set userpswd $userpasswd
+ } else {
+ set userpswd [join [find userpassword $router] ""]
+ if { "$userpswd" == "" } { set userpswd $passwd }
+ }
+
+ # Figure out enable username
+ if {[info exists enausername]} {
+ # command line enausername
+ set enauser $enausername
+ } else {
+ set enauser [join [find enauser $router] ""]
+ if { "$enauser" == "" } { set enauser $ruser }
+ }
+
+ # Figure out prompts
+ set u_prompt [find userprompt $router]
+ if { "$u_prompt" == "" } {
+ set u_prompt "(Username|Login|login|user name):"
+ } else {
+ set u_prompt [join [lindex $u_prompt 0] ""]
+ }
+ set p_prompt [find passprompt $router]
+ if { "$p_prompt" == "" } {
+ set p_prompt "(\[Pp]assword|passwd):"
+ } else {
+ set p_prompt [join [lindex $p_prompt 0] ""]
+ }
+ set e_prompt [find enableprompt $router]
+ if { "$e_prompt" == "" } {
+ set e_prompt "\[Pp]assword:"
+ } else {
+ set e_prompt [join [lindex $e_prompt 0] ""]
+ }
+
+ # Figure out cypher type
+ if {[info exists cypher]} {
+ # command line cypher type
+ set cyphertype $cypher
+ } else {
+ set cyphertype [find cyphertype $router]
+ if { "$cyphertype" == "" } { set cyphertype "3des" }
+ }
+
+ # Figure out connection method
+ set cmethod [find method $router]
+ if { "$cmethod" == "" } { set cmethod {{telnet} {ssh}} }
+
+ # Figure out the SSH executable name
+ set sshcmd [find sshcmd $router]
+ if { "$sshcmd" == "" } { set sshcmd {ssh} }
+
+ # Login to the router
+ if {[login $router $ruser $userpswd $passwd $enapasswd $cmethod $cyphertype]} {
+ continue
+ }
+
+ # we are logged in, now figure out the full prompt
+ send "\r"
+ expect {
+ -re "\[\r\n]+" { exp_continue; }
+ -re "^(.+:)1 $prompt" { # stoopid extreme cmd-line numbers and
+ # prompt based on state of config changes
+ set junk $expect_out(1,string)
+ regsub -all "^\\\* " $expect_out(1,string) {} junk
+ set prompt ".? ?$junk\[0-9]+ $prompt";
+ set platform "extreme"
+ }
+ -re "^.+$prompt" { set junk $expect_out(0,string);
+ regsub -all "\[\]\[]" $junk {\\&} prompt; }
+ -re "^.+> \\\(enable\\\)" { set junk $expect_out(0,string);
+ regsub -all "\[\]\[]" $junk {\\&} prompt; }
+ }
+
+ if { $do_command } {
+ if {[run_commands $prompt $command]} {
+ continue
+ }
+ } elseif { $do_script } {
+ # If the prompt is (enable), then we are on a switch and the
+ # command is "set length 0"; otherwise its "term length 0".
+ if [ regexp -- ".*> .*enable" "$prompt" ] {
+ send "set length 0\r"
+ send "set logging session disable\r"
+ } else {
+ send "term length 0\r"
+ }
+ expect -re $prompt {}
+ source $sfile
+ close
+ } else {
+ label $router
+ log_user 1
+ interact
+ }
+
+ # End of for each router
+ wait
+ sleep 0.3
+}
+exit 0
diff --git a/bin/nsrancid.in b/bin/nsrancid.in
new file mode 100644
index 0000000..40a286f
--- /dev/null
+++ b/bin/nsrancid.in
@@ -0,0 +1,313 @@
+#! @PERLV_PATH@
+##
+## $Id: nsrancid.in,v 1.7 2004/01/11 03:49:13 heas Exp $
+##
+## Copyright (C) 1997-2004 by Terrapin Communications, Inc.
+## All rights reserved.
+##
+## This software may be freely copied, modified and redistributed
+## without fee for non-commerical purposes provided that this license
+## remains intact and unmodified with any RANCID distribution.
+##
+## There is no warranty or other guarantee of fitness of this software.
+## It is provided solely "as is". The author(s) disclaim(s) all
+## responsibility and liability with respect to this software's usage
+## or its effect upon hardware, computer systems, other software, or
+## anything else.
+##
+## Except where noted otherwise, rancid was written by and is maintained by
+## Henry Kilmer, John Heasley, Andrew Partan, Pete Whiting, and Austin Schutz.
+##
+#
+# hacked version of Hank's rancid - this one tries to deal with Netscalers.
+# Hacks from Anshuman Kanwar.
+#
+# RANCID - Really Awesome New Cisco confIg Differ
+#
+# usage: rancid [-d] [-l] [-f filename | $host]
+#
+use Getopt::Std;
+getopts('dfl');
+$log = $opt_l;
+$debug = $opt_d;
+$file = $opt_f;
+$host = $ARGV[0];
+$clean_run = 0;
+$found_end = 0;
+$timeo = 90; # nslogin timeout in seconds
+
+
+@temp1 = split (/\./,$host);
+$prompt = "$temp1[0]#";
+$prompt = "netscaler#";
+
+my(%filter_pwds); # password filtering mode
+
+# This routine is used to print out the router configuration
+sub ProcessHistory {
+ my($new_hist_tag,$new_command,$command_string,@string)=(@_);
+ if((($new_hist_tag ne $hist_tag) || ($new_command ne $command))
+ && defined %history) {
+ print eval "$command \%history";
+ undef %history;
+ }
+ if (($new_hist_tag) && ($new_command) && ($command_string)) {
+ if ($history{$command_string}) {
+ $history{$command_string} = "$history{$command_string}@string";
+ } else {
+ $history{$command_string} = "@string";
+ }
+ } elsif (($new_hist_tag) && ($new_command)) {
+ $history{++$#history} = "@string";
+ } else {
+ print "@string";
+ }
+ $hist_tag = $new_hist_tag;
+ $command = $new_command;
+ 1;
+}
+
+sub numerically { $a <=> $b; }
+
+# This is a sort routing that will sort numerically on the
+# keys of a hash as if it were a normal array.
+sub keynsort {
+ local(%lines)=@_;
+ local($i) = 0;
+ local(@sorted_lines);
+ foreach $key (sort numerically keys(%lines)) {
+ $sorted_lines[$i] = $lines{$key};
+ $i++;
+ }
+ @sorted_lines;
+}
+
+# This is a sort routing that will sort on the
+# keys of a hash as if it were a normal array.
+sub keysort {
+ local(%lines)=@_;
+ local($i) = 0;
+ local(@sorted_lines);
+ foreach $key (sort keys(%lines)) {
+ $sorted_lines[$i] = $lines{$key};
+ $i++;
+ }
+ @sorted_lines;
+}
+
+# This is a sort routing that will sort on the
+# values of a hash as if it were a normal array.
+sub valsort{
+ local(%lines)=@_;
+ local($i) = 0;
+ local(@sorted_lines);
+ foreach $key (sort values %lines) {
+ $sorted_lines[$i] = $key;
+ $i++;
+ }
+ @sorted_lines;
+}
+
+# This is a numerical sort routing (ascending).
+sub numsort {
+ local(%lines)=@_;
+ local($i) = 0;
+ local(@sorted_lines);
+ foreach $num (sort {$a <=> $b} keys %lines) {
+ $sorted_lines[$i] = $lines{$num};
+ $i++;
+ }
+ @sorted_lines;
+}
+
+# This is a sort routine that will sort on the
+# ip address when the ip address is anywhere in
+# the strings.
+sub ipsort {
+ local(%lines)=@_;
+ local($i) = 0;
+ local(@sorted_lines);
+ foreach $addr (sort sortbyipaddr keys %lines) {
+ $sorted_lines[$i] = $lines{$addr};
+ $i++;
+ }
+ @sorted_lines;
+}
+
+# These two routines will sort based upon IP addresses
+sub ipaddrval {
+ my(@a) = ($_[0] =~ m#^(\d+)\.(\d+)\.(\d+)\.(\d+)$#);
+ $a[3]+256*($a[2]+256*($a[1]+256*$a[0]));
+}
+sub sortbyipaddr {
+ &ipaddrval($a) <=> &ipaddrval($b);
+}
+
+# This routine parses "show config"
+sub ShowConfig {
+ print STDERR " In ShowConfig: $_" if ($debug);
+
+ while (<INPUT>) {
+ tr/\015//d;
+ last if (/^$prompt/);
+ next if (/^(\s*|\s*$cmd\s*)$/);
+ next if (/^Reading configuration information/);
+ next if (/^Can\'t find object or class named \"\-all\"\s*$/);
+ next if (/lock-address .*$/);
+ next if (/^\# *uptime +\d+\s*$/);
+ if (/community label /) {
+ if (defined($ENV{'NOCOMMSTR'})) {
+ $_ =~ s/community label .*$/community label <removed>/;
+ }
+ }
+ return(1) if /(invalid command name)/;
+ ProcessHistory("","","","$_");
+ }
+
+ if (/exit$/) {
+ $found_end = 1;
+ $clean_run = 1;
+ return(1);
+ }
+ return(0);
+}
+
+# This routine parses "get log setting"
+sub GetLogSet {
+ print STDERR " In GetLogSet: $_" if ($debug);
+
+ while (<INPUT>) {
+ tr/\015//d;
+ last if (/^$prompt/);
+ next if (/^(\s*|\s*$cmd\s*)$/);
+ next if (/^Reading configuration information/);
+ next if (/^Can\'t find object or class named \"\-all\"\s*$/);
+ return(1) if /(invalid command name)/;
+
+ ProcessHistory("","","","$_");
+ }
+ return(0);
+}
+
+# This routine parses single command's that return no required info
+sub RunCommand {
+ print STDERR " In RunCommand: $_" if ($debug);
+
+ while (<INPUT>) {
+ tr/\015//d;
+ last if (/^$prompt/);
+ next if (/^(\s*|\s*$cmd\s*)$/);
+ }
+ return(0)
+}
+
+# dummy function
+sub DoNothing {print STDOUT;}
+
+# Main
+#--------------------------------------------------
+%commands=(
+ 'cat /etc/ns.conf' => "ShowConfig",
+ 'get log setting' => "GetLogSet"
+);
+# keys() doesnt return things in the order entered and the order of the
+# cmds is important (show version first and write term last). pita
+@commands=(
+ "cat /etc/ns.conf",
+ "get log setting"
+);
+$cisco_cmds=join(";",@commands);
+$cmds_regexp=join("|",@commands);
+
+open(OUTPUT,">$host.new") || die "Can't open $host.new for writing: $!\n";
+select(OUTPUT);
+# make OUTPUT unbuffered if debugging
+if ($debug) { $| = 1; }
+
+if ($file) {
+ print STDERR "opening file $host\n" if ($debug);
+ print STDOUT "opening file $host\n" if ($log);
+ open(INPUT,"<$host") || die "open failed for $host: $!\n";
+} else {
+ print STDERR "executing nslogin -t $timeo -c\"$cisco_cmds\" $host\n" if ($debug);
+ print STDOUT "executing nslogin -t $timeo -c\"$cisco_cmds\" $host\n" if ($log);
+ if (defined($ENV{NOPIPE})) {
+ system "nslogin -t $timeo -c \"$cisco_cmds\" $host </dev/null > $host.raw 2>&1" || die "nslogin failed for $host: $!\n";
+ open(INPUT, "< $host.raw") || die "nslogin failed for $host: $!\n";
+ } else {
+ open(INPUT,"nslogin -t $timeo -c \"$cisco_cmds\" $host </dev/null |") || die "nslogin failed for $host: $!\n";
+ }
+}
+
+# determine password filtering mode
+if ($ENV{"FILTER_PWDS"} =~ /no/i) {
+ $filter_pwds = 0;
+} elsif ($ENV{"FILTER_PWDS"} =~ /all/i) {
+ $filter_pwds = 2;
+} else {
+ $filter_pwds = 1;
+}
+
+#print STDOUT "$prompt \n";
+ProcessHistory("","","","!RANCID-CONTENT-TYPE: netscaler\n!\n");
+TOP: while(<INPUT>) {
+ tr/\015//d;
+#print STDOUT " --IN--$_";
+ # if ( (/exit/) || $found_end ) {
+# $clean_run=1;
+#print STDOUT "\n\nhere11\n";
+#last;
+# }
+
+ # if ( (/netscaler#/) || $found_end ) {
+#print STDOUT "\n\nhere1\n";
+# $clean_run=1;
+# last;
+# }
+
+ if (/^Error:/) {
+ print STDOUT ("$host nslogin error: $_");
+ print STDERR ("$host nslogin error: $_") if ($debug);
+ $clean_run=0;
+ last;
+ }
+ while (/#\s*($cmds_regexp)\s*$/) {
+ $cmd = $1;
+ print STDERR ("HIT COMMAND:$_") if ($debug);
+ if (! defined($commands{$cmd})) {
+ print STDERR "$host: found unexpected command - \"$cmd\"\n";
+ $clean_run = 0;
+ last TOP;
+ }
+ $rval = &{$commands{$cmd}};
+ delete($commands{$cmd});
+ if ($rval == -1) {
+ $clean_run = 0;
+ last TOP;
+ }
+ }
+}
+print STDOUT "Done $logincmd: $_\n" if ($log);
+# Flush History
+ProcessHistory("","","","");
+# Cleanup
+close(INPUT);
+close(OUTPUT);
+
+if (defined($ENV{NOPIPE})) {
+ unlink("$host.raw") if (! $debug);
+}
+
+# check for completeness
+if (scalar(%commands) || !$clean_run || !$found_end) {
+ if (scalar(%commands)) {
+ printf(STDOUT "$host: missed cmd(s): %s\n", join(',', keys(%commands)));
+ printf(STDERR "$host: missed cmd(s): %s\n", join(',', keys(%commands))) if ($debug);
+ }
+ if (!$clean_run || !$found_end) {
+ print STDOUT "$host: End of run not found\n";
+ print STDERR "$host: End of run not found\n" if ($debug);
+ system("/usr/bin/tail -1 $host.new");
+ }
+ unlink "$host.new" if (! $debug);
+}
diff --git a/bin/par.in b/bin/par.in
index 02a5383..b50bd05 100755..100644
--- a/bin/par.in
+++ b/bin/par.in
@@ -1,19 +1,22 @@
-#!@PERLV_PATH@
+#! @PERLV_PATH@
##
+## $Id: par.in,v 1.10 2004/01/11 03:49:13 heas Exp $
##
-## Copyright (C) 1997-2001 by Henry Kilmer and Peter Whiting.
+## Copyright (C) 1997-2004 by Terrapin Communications, Inc.
## All rights reserved.
##
-## This software may be freely copied, modified and redistributed without
-## fee for non-commerical purposes provided that this copyright notice is
-## preserved intact on all copies and modified copies.
-##
+## This software may be freely copied, modified and redistributed
+## without fee for non-commerical purposes provided that this license
+## remains intact and unmodified with any RANCID distribution.
+##
## There is no warranty or other guarantee of fitness of this software.
-## It is provided solely "as is". The author(s) disclaim(s) all
+## It is provided solely "as is". The author(s) disclaim(s) all
## responsibility and liability with respect to this software's usage
## or its effect upon hardware, computer systems, other software, or
## anything else.
##
+## Except where noted otherwise, rancid was written by and is maintained by
+## Henry Kilmer, John Heasley, Andrew Partan, Pete Whiting, and Austin Schutz.
##
#
# PAR - parallel processing of command
diff --git a/bin/prancid.in b/bin/prancid.in
new file mode 100755
index 0000000..7ded178
--- /dev/null
+++ b/bin/prancid.in
@@ -0,0 +1,569 @@
+#! @PERLV_PATH@
+##
+## $Id: prancid.in,v 1.29 2004/01/11 03:49:13 heas Exp $
+##
+## Copyright (C) 1997-2004 by Terrapin Communications, Inc.
+## All rights reserved.
+##
+## This software may be freely copied, modified and redistributed
+## without fee for non-commerical purposes provided that this license
+## remains intact and unmodified with any RANCID distribution.
+##
+## There is no warranty or other guarantee of fitness of this software.
+## It is provided solely "as is". The author(s) disclaim(s) all
+## responsibility and liability with respect to this software's usage
+## or its effect upon hardware, computer systems, other software, or
+## anything else.
+##
+## Except where noted otherwise, rancid was written by and is maintained by
+## Henry Kilmer, John Heasley, Andrew Partan, Pete Whiting, and Austin Schutz.
+##
+#
+# This version of rancid tries to deal with Prockets.
+#
+# RANCID - Really Awesome New Cisco confIg Differ
+#
+# usage: rancid [-d] [-l] [-f filename | $host]
+#
+use Getopt::Std;
+getopts('dfl');
+$log = $opt_l;
+$debug = $opt_d;
+$file = $opt_f;
+$host = $ARGV[0];
+$clean_run = 0;
+$found_end = 0;
+$timeo = 90; # clogin timeout in seconds
+
+my($platform); # platform/cpu type
+my(%filter_pwds); # password filtering mode
+
+# This routine is used to print out the router configuration
+sub ProcessHistory {
+ my($new_hist_tag,$new_command,$command_string,@string)=(@_);
+ if((($new_hist_tag ne $hist_tag) || ($new_command ne $command))
+ && defined %history) {
+ print eval "$command \%history";
+ undef %history;
+ }
+ if (($new_hist_tag) && ($new_command) && ($command_string)) {
+ if ($history{$command_string}) {
+ $history{$command_string} = "$history{$command_string}@string";
+ } else {
+ $history{$command_string} = "@string";
+ }
+ } elsif (($new_hist_tag) && ($new_command)) {
+ $history{++$#history} = "@string";
+ } else {
+ print "@string";
+ }
+ $hist_tag = $new_hist_tag;
+ $command = $new_command;
+ 1;
+}
+
+sub numerically { $a <=> $b; }
+
+# This is a sort routing that will sort numerically on the
+# keys of a hash as if it were a normal array.
+sub keynsort {
+ local(%lines)=@_;
+ local($i) = 0;
+ local(@sorted_lines);
+ foreach $key (sort numerically keys(%lines)) {
+ $sorted_lines[$i] = $lines{$key};
+ $i++;
+ }
+ @sorted_lines;
+}
+
+# This is a sort routing that will sort on the
+# keys of a hash as if it were a normal array.
+sub keysort {
+ local(%lines)=@_;
+ local($i) = 0;
+ local(@sorted_lines);
+ foreach $key (sort keys(%lines)) {
+ $sorted_lines[$i] = $lines{$key};
+ $i++;
+ }
+ @sorted_lines;
+}
+
+# This is a sort routing that will sort on the
+# values of a hash as if it were a normal array.
+sub valsort{
+ local(%lines)=@_;
+ local($i) = 0;
+ local(@sorted_lines);
+ foreach $key (sort values %lines) {
+ $sorted_lines[$i] = $key;
+ $i++;
+ }
+ @sorted_lines;
+}
+
+# This is a numerical sort routing (ascending).
+sub numsort {
+ local(%lines)=@_;
+ local($i) = 0;
+ local(@sorted_lines);
+ foreach $num (sort {$a <=> $b} keys %lines) {
+ $sorted_lines[$i] = $lines{$num};
+ $i++;
+ }
+ @sorted_lines;
+}
+
+# This is a sort routine that will sort on the
+# ip address when the ip address is anywhere in
+# the strings.
+sub ipsort {
+ local(%lines)=@_;
+ local($i) = 0;
+ local(@sorted_lines);
+ foreach $addr (sort sortbyipaddr keys %lines) {
+ $sorted_lines[$i] = $lines{$addr};
+ $i++;
+ }
+ @sorted_lines;
+}
+
+# These two routines will sort based upon IP addresses
+sub ipaddrval {
+ my(@a) = ($_[0] =~ m#^(\d+)\.(\d+)\.(\d+)\.(\d+)$#);
+ $a[3]+256*($a[2]+256*($a[1]+256*$a[0]));
+}
+sub sortbyipaddr {
+ &ipaddrval($a) <=> &ipaddrval($b);
+}
+
+# This routine parses "show version"
+sub ShowVersion {
+ print STDERR " In ShowVersion: $_" if ($debug);
+
+ while (<INPUT>) {
+ tr/\015//d;
+ last if(/^$prompt/);
+ next if(/^(\s*|\s*$cmd\s*)$/);
+ return(-1) if (/command authorization failed/i);
+
+ if (/(lynxos|kernel) Version: .* (\S+)/i) {
+ $platform = $2;
+ }
+ /Procket/ && ProcessHistory("COMMENTS","keysort","B0", "! $_") && next;
+ /System Uptime:/ && next;
+ /Protocol Uptime:/ && next;
+ ProcessHistory("COMMENTS","keysort","B0", "!$_") && next;
+
+ }
+ return(0);
+}
+
+# This routine parses "show package"
+sub ShowPackage {
+ print STDERR " In ShowPackage: $_" if ($debug);
+
+ while (<INPUT>) {
+ tr/\015//d;
+ last if(/^$prompt/);
+ next if(/^(\s*|\s*$cmd\s*)$/);
+ return(-1) if (/command authorization failed/i);
+
+ ProcessHistory("COMMENTS","keysort","C0", "! $_") && next;
+
+ }
+ return(0);
+}
+
+# This routine parses "show hardware"
+sub ShowHardware {
+ print STDERR " In ShowHardware: $_" if ($debug);
+
+ while (<INPUT>) {
+ tr/\015//d;
+ last if(/^$prompt/);
+ next if(/^(\s*|\s*$cmd\s*)$/);
+ # skip show hardware on titanium
+ return(0) if ($platform =~ /i386/i);
+ return(-1) if (/command authorization failed/i);
+ return(-1) if (/cli: couldn.t communicate with/);
+
+ ProcessHistory("COMMENTS","keysort","D0", "! $_") && next;
+
+ }
+ return(0);
+}
+
+# This routine parses "show inventory"
+sub ShowInventory {
+ print STDERR " In ShowInventory: $_" if ($debug);
+
+ while (<INPUT>) {
+ tr/\015//d;
+ last if(/^$prompt/);
+ next if(/^(\s*|\s*$cmd\s*)$/);
+ return(0) if (/^\s+\^/);
+ return(-1) if (/command authorization failed/i);
+
+ /Procket/ && ProcessHistory("COMMENTS","keysort","E0", "! $_") && next;
+ /System Uptime:/ && next;
+ /Protocol Uptime:/ && next;
+ ProcessHistory("COMMENTS","keysort","E0", "!$_") && next;
+
+ }
+ return(0);
+}
+
+# This routine processes a "write term"
+sub WriteTerm {
+ print STDERR " In WriteTerm: $_" if ($debug);
+
+ while (<INPUT>) {
+ tr/\015//d;
+ last if(/^$prompt/);
+ return(-1) if (/command authorization failed/i);
+
+ /Non-Volatile memory is in use/ && return(-1); # NvRAM is locked
+ # skip the crap
+ if (/^(##+$|(Building|Current) configuration)/i) {
+ while (<INPUT>) {
+ next if (/^Current configuration\s*:/i);
+ next if (/^([%!].*|\s*)$/);
+ last;
+ }
+ tr/\015//d;
+ }
+ # some versions have other crap mixed in with the bits in the
+ # block above
+ /^! Last Changed:/ && next;
+
+ # Dog gone Cool matches to process the rest of the config
+# /^tftp-server flash / && next; # kill any tftp remains
+# /^ntp clock-period / && next; # kill ntp clock-period
+# /^ length / && next; # kill length on serial lines
+# /^ width / && next; # kill width on serial lines
+# /^ clockrate / && next; # kill clockrate on serial interfaces
+
+ if (/^(enable secret( level \d)?) / && $filter_pwds >= 2) {
+ ProcessHistory("ENABLE","","","!$1 <removed>\n");
+ next;
+ }
+ if (/^username (\S+)(\s.*)? password ((\d) \S+|\S+)/) {
+ if ($filter_pwds == 2) {
+ ProcessHistory("USER","keysort","$1","!username $1$2 password <removed>\n");
+ } elsif ($filter_pwds == 1 && $4 ne "5"){
+ ProcessHistory("USER","keysort","$1","!username $1$2 password <removed>\n");
+ } else {
+ ProcessHistory("USER","keysort","$1","$_");
+ }
+ next;
+ }
+
+ # prune passwords {bgp, ...}
+ if (/^(\s*)password / && $filter_pwds >= 1) {
+ ProcessHistory("","","","!$1password <removed>\n");
+ next;
+ }
+ # prune authentication keys {vrrp vrid N, router isis...}
+ if (/^(\s*authentication \S+ key) / && $filter_pwds >= 1) {
+ ProcessHistory("","","","!$1 <removed>\n");
+ next;
+ }
+ if (/^(\s*authentication-key) \d \S+( .*)/ && $filter_pwds >= 1) {
+ ProcessHistory("","","","!$1 <removed>$2\n");
+ next;
+ }
+
+# if (/^\s*neighbor (\S*) password / && $filter_pwds >= 1) {
+# ProcessHistory("","","","! neighbor $1 password <removed>\n");
+# next;
+# }
+# if (/^(ppp .* password) 7 .*/ && $filter_pwds >= 1) {
+# ProcessHistory("","","","!$1 <removed>\n"); next;
+# }
+# if (/^(ip ftp password) / && $filter_pwds >= 1) {
+# ProcessHistory("","","","!$1 <removed>\n"); next;
+# }
+
+ # prune ospf keys
+ if (/^( ip ospf authentication-key) / && $filter_pwds >= 1) {
+ ProcessHistory("","","","!$1 <removed>\n"); next;
+ }
+ # this is reversable, despite 'md5' in the cmd
+ if (/^( ip ospf message-digest-key \d+ md5) / && $filter_pwds >= 1) {
+ ProcessHistory("","","","!$1 <removed>\n"); next;
+ }
+ # this is reversable, despite 'md5' in the cmd
+ if (/^(\s*message-digest-key \d+ md5) / && $filter_pwds >= 1) {
+ ProcessHistory("","","","!$1 <removed>\n"); next;
+ }
+
+# if (/^((crypto )?isakmp key) \S+ / && $filter_pwds >= 1) {
+# ProcessHistory("","","","!$1 <removed> $'"); next;
+# }
+
+ # sort ip explicit-paths.
+ if (/^ip explicit-path name (\S+)/) {
+ my($key) = $1;
+ my($expath) = $_;
+ while (<INPUT>) {
+ tr/\015//d;
+ last if (/^$prompt/);
+ last if (/^$prompt/ || ! /^(ip explicit-path name |[ !])/);
+ if (/^ip explicit-path name (\S+)/) {
+ ProcessHistory("EXPATH","keysort","$key","$expath");
+ $key = $1;
+ $expath = $_;
+ } else {
+ $expath .= $_;
+ }
+ }
+ ProcessHistory("EXPATH","keysort","$key","$expath");
+ }
+
+ # sort route-maps
+ if (/^route-map (\S+)/) {
+ my($key) = $1;
+ my($routemap) = $_;
+ while (<INPUT>) {
+ tr/\015//d;
+ last if (/^$prompt/ || ! /^(route-map |[ !])/);
+ if (/^route-map (\S+)/) {
+ ProcessHistory("ROUTEMAP","keysort","$key","$routemap");
+ $key = $1;
+ $routemap = $_;
+ } else {
+ $routemap .= $_;
+ }
+ }
+ ProcessHistory("ROUTEMAP","keysort","$key","$routemap");
+ }
+
+ # filter out any RCS/CVS tags to avoid confusing local CVS storage
+ s/\$(Revision|Id):/ $1:/;
+
+# # order access-lists
+# /^access-list\s+(\d\d?)\s+(\S+)\s+(\S+)/ &&
+# ProcessHistory("ACL $1 $2","ipsort","$3","$_") && next;
+# # order extended access-lists
+# /^access-list\s+(\d\d\d)\s+(\S+)\s+ip\s+host\s+(\S+)/ &&
+# ProcessHistory("EACL $1 $2","ipsort","$3","$_") && next;
+# /^access-list\s+(\d\d\d)\s+(\S+)\s+ip\s+(\d\S+)/ &&
+# ProcessHistory("EACL $1 $2","ipsort","$3","$_") && next;
+# /^access-list\s+(\d\d\d)\s+(\S+)\s+ip\s+any/ &&
+# ProcessHistory("EACL $1 $2","ipsort","0.0.0.0","$_") && next;
+# # order arp lists
+# /^arp\s+(\d+\.\d+\.\d+\.\d+)\s+/ &&
+# ProcessHistory("ARP","ipsort","$1","$_") && next;
+# /^ip prefix-list\s+(\S+)\s+seq\s+(\d+)\s+(permit|deny)\s+(\d\S+)(\/.*)$/ &&
+# ProcessHistory("PACL $1 $3","ipsort","$4","ip prefix-list $1 $3 $4$5\n")
+# && next;
+
+ # order logging statements
+ /^logging (\d+\.\d+\.\d+\.\d+)/ &&
+ ProcessHistory("LOGGING","ipsort","$1","$_") && next;
+
+ # order/prune snmp-server host statements
+ # we only prune lines of the form
+ # snmp-server host a.b.c.d <community>
+ if (/^snmp-server host (\d+\.\d+\.\d+\.\d+) /) {
+ if (defined($ENV{'NOCOMMSTR'})) {
+ my($ip) = $1;
+ my($line) = "snmp-server host $ip";
+ my(@tokens) = split(' ', $');
+ my($token);
+ while ($token = shift(@tokens)) {
+ if ($token eq 'version') {
+ $line .= " " . join(' ', ($token, shift(@tokens)));
+ } elsif ($token =~ /^(informs?|traps?|(no)?auth)$/) {
+ $line .= " " . $token;
+ } else {
+ $line = "!$line " . join(' ', ("<removed>", join(' ',@tokens)));
+ last;
+ }
+ }
+ ProcessHistory("SNMPSERVERHOST","ipsort","$ip","$line\n");
+ } else {
+ ProcessHistory("SNMPSERVERHOST","ipsort","$1","$_");
+ }
+ next;
+ }
+ if (/^(snmp-server community) (\S+)/) {
+ if (defined($ENV{'NOCOMMSTR'})) {
+ ProcessHistory("SNMPSERVERCOMM","keysort","$_","!$1 <removed>$'") && next;
+ } else {
+ ProcessHistory("SNMPSERVERCOMM","keysort","$_","$_") && next;
+ }
+ }
+
+ # prune tacacs/radius server keys
+ if (/^(tacacs-server|radius-server) key / && $filter_pwds >= 1) {
+ ProcessHistory("","","","!$1 key <removed>\n"); next;
+ }
+ if (/^(tacacs-server host \S+( .*)? key) (\d )?\S+/
+ && $filter_pwds >= 1) {
+ ProcessHistory("","","","!$1 <removed>\n"); next;
+ }
+
+ # order clns host statements
+# /^clns host \S+ (\S+)/ &&
+# ProcessHistory("CLNS","keysort","$1","$_") && next;
+
+ # prune vrrp password
+ if (/^( ip vrrp authentication .* key) / && $filter_pwds >= 1) {
+ ProcessHistory("","","","!$1 <removed>\n"); next;
+ }
+ # prune isis password
+ if (/^( isis authentication-key) \d \S+/ && $filter_pwds >= 1) {
+ ProcessHistory("","","","!$1 <removed>$'"); next;
+ }
+ # prune msdp password
+ if (/^(ip msdp password \S+) / && $filter_pwds >= 1) {
+ ProcessHistory("","","","!$1 <removed>\n"); next;
+ }
+ # delete ntp auth password - this md5 is a reversable too
+ if (/^(ntp authentication-key \d+ md5) / && $filter_pwds >= 1) {
+ ProcessHistory("","","","!$1 <removed>\n"); next;
+ }
+ # order ntp peers/servers
+ if (/^ntp (server|peer) (\d+)\.(\d+)\.(\d+)\.(\d+)/) {
+ $sortkey = sprintf("$1 %03d%03d%03d%03d",$2,$3,$4,$5);
+ ProcessHistory("NTP","keysort",$sortkey,"$_");
+ next;
+ }
+
+# # order ip host line statements
+# /^ip host line(\d+)/ &&
+# ProcessHistory("IPHOST","numsort","$1","$_") && next;
+# # order ip nat source static statements
+# /^ip nat (\S+) source static (\S+)/ &&
+# ProcessHistory("IP NAT $1","ipsort","$2","$_") && next;
+# # order atm map-list statements
+# /^\s+ip\s+(\d+\.\d+\.\d+\.\d+)\s+atm-vc/ &&
+# ProcessHistory("ATM map-list","ipsort","$1","$_") && next;
+# # order ip rcmd lines
+# /^ip rcmd/ && ProcessHistory("RCMD","keysort","$_","$_") && next;
+
+ # catch anything that wasnt matched above.
+ ProcessHistory("","","","$_");
+ # end of config.
+ if (/^end$/) {
+ $found_end = 1;
+ return(1);
+ }
+ }
+ return(0);
+}
+
+# dummy function
+sub DoNothing {print STDOUT;}
+
+# Main
+%commands=(
+ 'show version all' => "ShowVersion",
+ 'show package' => "ShowPackage",
+ 'show hardware' => "ShowHardware",
+ 'show inventory' => "ShowInventory",
+ 'write term' => "WriteTerm"
+);
+# keys() doesnt return things in the order entered and the order of the
+# cmds is important (show version first and write term last). pita
+@commands=(
+ "show version all",
+ "show package",
+ "show hardware",
+ "show inventory",
+ "write term"
+);
+$cisco_cmds=join(";",@commands);
+$cmds_regexp=join("|",@commands);
+
+open(OUTPUT,">$host.new") || die "Can't open $host.new for writing: $!\n";
+select(OUTPUT);
+# make OUTPUT unbuffered if debugging
+if ($debug) { $| = 1; }
+
+if ($file) {
+ print STDERR "opening file $host\n" if ($debug);
+ print STDOUT "opening file $host\n" if ($log);
+ open(INPUT,"<$host") || die "open failed for $host: $!\n";
+} else {
+ print STDERR "executing clogin -t $timeo -c\"$cisco_cmds\" $host\n" if ($debug);
+ print STDOUT "executing clogin -t $timeo -c\"$cisco_cmds\" $host\n" if ($log);
+ if (defined($ENV{NOPIPE})) {
+ system "clogin -t $timeo -c \"$cisco_cmds\" $host </dev/null > $host.raw 2>&1" || die "clogin failed for $host: $!\n";
+ open(INPUT, "< $host.raw") || die "clogin failed for $host: $!\n";
+ } else {
+ open(INPUT,"clogin -t $timeo -c \"$cisco_cmds\" $host </dev/null |") || die "clogin failed for $host: $!\n";
+ }
+}
+
+# determine password filtering mode
+if ($ENV{"FILTER_PWDS"} =~ /no/i) {
+ $filter_pwds = 0;
+} elsif ($ENV{"FILTER_PWDS"} =~ /all/i) {
+ $filter_pwds = 2;
+} else {
+ $filter_pwds = 1;
+}
+
+ProcessHistory("","","","!RANCID-CONTENT-TYPE: procket\n!\n");
+ProcessHistory("COMMENTS","keysort","B0","!\n"); # show version
+ProcessHistory("COMMENTS","keysort","C0","!\n"); # show package
+ProcessHistory("COMMENTS","keysort","D0","!\n"); # show hardware
+ProcessHistory("COMMENTS","keysort","E0","!\n"); # show inventory
+ProcessHistory("COMMENTS","keysort","Z0","!\n");
+TOP: while(<INPUT>) {
+ tr/\015//d;
+ if (/\#\s?exit$/) {
+ $clean_run=1;
+ last;
+ }
+ if (/^Error:/) {
+ print STDOUT ("$host clogin error: $_");
+ print STDERR ("$host clogin error: $_") if ($debug);
+ $clean_run=0;
+ last;
+ }
+ while (/#\s*($cmds_regexp)\s*$/) {
+ $cmd = $1;
+ if (!defined($prompt)) {$prompt = ($_ =~ /^([^#]+#)/)[0]; }
+ print STDERR ("HIT COMMAND:$_") if ($debug);
+ if (! defined($commands{$cmd})) {
+ print STDERR "$host: found unexpected command - \"$cmd\"\n";
+ $clean_run = 0;
+ last TOP;
+ }
+ $rval = &{$commands{$cmd}};
+ delete($commands{$cmd});
+ if ($rval == -1) {
+ $clean_run = 0;
+ last TOP;
+ }
+ }
+}
+print STDOUT "Done $logincmd: $_\n" if ($log);
+# Flush History
+ProcessHistory("","","","");
+# Cleanup
+close(INPUT);
+close(OUTPUT);
+
+if (defined($ENV{NOPIPE})) {
+ unlink("$host.raw") if (! $debug);
+}
+
+# check for completeness
+if (scalar(%commands) || !$clean_run || !$found_end) {
+ if (scalar(%commands)) {
+ printf(STDOUT "$host: missed cmd(s): %s\n", join(',', keys(%commands)));
+ printf(STDERR "$host: missed cmd(s): %s\n", join(',', keys(%commands))) if ($debug);
+ }
+ if (!$clean_run || !$found_end) {
+ print STDOUT "$host: End of run not found\n";
+ print STDERR "$host: End of run not found\n" if ($debug);
+ system("/usr/bin/tail -1 $host.new");
+ }
+ unlink "$host.new" if (! $debug);
+}
diff --git a/bin/create_cvs.in b/bin/rancid-cvs.in
index 06d414b..22d5fd2 100755..100644
--- a/bin/create_cvs.in
+++ b/bin/rancid-cvs.in
@@ -1,34 +1,39 @@
-#!/bin/sh
+#! /bin/sh
##
+## $Id: rancid-cvs.in,v 1.16 2004/01/11 03:49:13 heas Exp $
##
-## Copyright (C) 1996-2001 by Henry Kilmer.
+## Copyright (C) 1997-2004 by Terrapin Communications, Inc.
## All rights reserved.
##
-## This software may be freely copied, modified and redistributed without
-## fee for non-commerical purposes provided that this copyright notice is
-## preserved intact on all copies and modified copies.
-##
+## This software may be freely copied, modified and redistributed
+## without fee for non-commerical purposes provided that this license
+## remains intact and unmodified with any RANCID distribution.
+##
## There is no warranty or other guarantee of fitness of this software.
-## It is provided solely "as is". The author(s) disclaim(s) all
+## It is provided solely "as is". The author(s) disclaim(s) all
## responsibility and liability with respect to this software's usage
## or its effect upon hardware, computer systems, other software, or
## anything else.
##
+## Except where noted otherwise, rancid was written by and is maintained by
+## Henry Kilmer, John Heasley, Andrew Partan, Pete Whiting, and Austin Schutz.
##
#
-# Create all of the misc files & dirs needed.
+# Create all of the misc files & dirs needed for each group and import them
+# into CVS.
#
-# create_cvs
+# rancid-cvs
#
# Read in the environment
-ENVFILE="`dirname $0`/env"
+ENVFILE="@sysconfdir@/rancid.conf"
. $ENVFILE
# Base dir
if [ ! -d $BASEDIR ]; then
- mkdir -p $BASEDIR
+ mkdir -p $BASEDIR ||
+ (echo "Could not create local state directory: $BASEDIR"; exit 1)
fi
cd $BASEDIR
diff --git a/bin/rancid-fe.in b/bin/rancid-fe.in
index b25dcb1..b80a194 100755..100644
--- a/bin/rancid-fe.in
+++ b/bin/rancid-fe.in
@@ -1,22 +1,25 @@
-#!@PERLV_PATH@
+#! @PERLV_PATH@
##
+## $Id: rancid-fe.in,v 1.36 2004/01/11 03:49:13 heas Exp $
##
-## Copyright (C) 1997-2001 by Henry Kilmer.
+## Copyright (C) 1997-2004 by Terrapin Communications, Inc.
## All rights reserved.
##
-## This software may be freely copied, modified and redistributed without
-## fee for non-commerical purposes provided that this copyright notice is
-## preserved intact on all copies and modified copies.
+## This software may be freely copied, modified and redistributed
+## without fee for non-commerical purposes provided that this license
+## remains intact and unmodified with any RANCID distribution.
##
## There is no warranty or other guarantee of fitness of this software.
-## It is provided solely "as is". The author(s) disclaim(s) all
+## It is provided solely "as is". The author(s) disclaim(s) all
## responsibility and liability with respect to this software's usage
## or its effect upon hardware, computer systems, other software, or
## anything else.
##
+## Except where noted otherwise, rancid was written by and is maintained by
+## Henry Kilmer, John Heasley, Andrew Partan, Pete Whiting, and Austin Schutz.
##
#
-# rancid-FE - front-end to rancid/jrancid for use with par.
+# rancid-FE - front-end to rancid/jrancid/etc. for use with par.
#
# usage: rancid-fe <router>:<vendor>
#
@@ -25,18 +28,28 @@ require 5;
($router, $vendor) = split('\:', $ARGV[0]);
- if ($vendor =~ /^alteon$/i) { exec('arancid', $router); }
-elsif ($vendor =~ /^baynet$/i) { exec('brancid', $router); }
-elsif ($vendor =~ /^cat5$/i) { exec('cat5rancid', $router); }
-elsif ($vendor =~ /^cisco$/i) { exec('rancid', $router); }
-elsif ($vendor =~ /^extreme$/i) { exec('xrancid', $router); }
-elsif ($vendor =~ /^ezt3$/i) { exec('erancid', $router); }
-elsif ($vendor =~ /^force10$/i) { exec('f10rancid', $router); }
-elsif ($vendor =~ /^foundry$/i) { exec('francid', $router); }
-elsif ($vendor =~ /^hp$/i) { exec('hrancid', $router); }
-elsif ($vendor =~ /^juniper$/i) { exec('jrancid', $router); }
-elsif ($vendor =~ /^mrtd$/i) { exec('mrancid', $router); }
-elsif ($vendor =~ /^redback$/i) { exec('rrancid', $router); }
+ if ($vendor =~ /^alteon$/i) { exec('arancid', $router); }
+elsif ($vendor =~ /^baynet$/i) { exec('brancid', $router); }
+elsif ($vendor =~ /^cat5$/i) { exec('cat5rancid', $router); }
+elsif ($vendor =~ /^cisco$/i) { exec('rancid', $router); }
+elsif ($vendor =~ /^css$/i) { exec('cssrancid', $router); }
+elsif ($vendor =~ /^enterasys$/i) { exec('rivrancid', $router); }
+elsif ($vendor =~ /^erx$/i) { exec('jerancid', $router); }
+elsif ($vendor =~ /^extreme$/i) { exec('xrancid', $router); }
+elsif ($vendor =~ /^ezt3$/i) { exec('erancid', $router); }
+elsif ($vendor =~ /^force10$/i) { exec('f10rancid', $router); }
+elsif ($vendor =~ /^foundry$/i) { exec('francid', $router); }
+elsif ($vendor =~ /^hitachi$/i) { exec('htrancid', $router); }
+elsif ($vendor =~ /^hp$/i) { exec('hrancid', $router); }
+elsif ($vendor =~ /^juniper$/i) { exec('jrancid', $router); }
+elsif ($vendor =~ /^mrtd$/i) { exec('mrancid', $router); }
+elsif ($vendor =~ /^netscaler$/i) { exec('nsrancid', $router); }
+elsif ($vendor =~ /^netscreen$/i) { exec('nrancid', $router); }
+elsif ($vendor =~ /^procket$/i) { exec('prancid', $router); }
+elsif ($vendor =~ /^redback$/i) { exec('rrancid', $router); }
+elsif ($vendor =~ /^riverstone$/i) { exec('rivrancid', $router); }
+elsif ($vendor =~ /^tnt$/i) { exec('tntrancid', $router); }
+elsif ($vendor =~ /^zebra$/i) { exec('zrancid', $router); }
else {
printf(STDERR "unknown router manufacturer for $router: $vendor\n");
exit(-1);
diff --git a/bin/do-diffs.in b/bin/rancid-run.in
index 874007c..b59b026 100755..100644
--- a/bin/do-diffs.in
+++ b/bin/rancid-run.in
@@ -1,21 +1,29 @@
-#!/bin/sh
-## Copyright (C) 1997-2001 by Henry Kilmer.
+#! /bin/sh
+##
+## $Id: rancid-run.in,v 1.28 2004/01/11 06:11:23 hank Exp $
+##
+## Copyright (C) 1997-2004 by Terrapin Communications, Inc.
## All rights reserved.
##
-## This software may be freely copied, modified and redistributed without
-## fee for non-commerical purposes provided that this copyright notice is
-## preserved intact on all copies and modified copies.
+## This software may be freely copied, modified and redistributed
+## without fee for non-commerical purposes provided that this license
+## remains intact and unmodified with any RANCID distribution.
##
## There is no warranty or other guarantee of fitness of this software.
-## It is provided solely "as is". The author(s) disclaim(s) all
+## It is provided solely "as is". The author(s) disclaim(s) all
## responsibility and liability with respect to this software's usage
## or its effect upon hardware, computer systems, other software, or
## anything else.
##
-# do diffs for each of the diff groups ($LIST_OF_GROUPS) from <BASEDIR>/bin/env
+## Except where noted otherwise, rancid was written by and is maintained by
+## Henry Kilmer, John Heasley, Andrew Partan, Pete Whiting, and Austin Schutz.
##
+#
+# Run rancid for each of the rancid groups defined by $LIST_OF_GROUPS in
+# @sysconfdir@/rancid.conf or those specified on the command-line.
+#
-ENVFILE="`dirname $0`/env"
+ENVFILE="@sysconfdir@/rancid.conf"
. $ENVFILE
@@ -69,12 +77,12 @@ fi
if [ $# -ge 1 ] ; then
LIST_OF_GROUPS="$*"; export LIST_OF_GROUPS
elif [ "$LIST_OF_GROUPS" = "" ] ; then
- echo "LIST_OF_GROUPS is empty in $ENVFILE"
- exit 1
+ echo "LIST_OF_GROUPS is empty in $ENVFILE"
+ exit 1
fi
-if [ ! -d $BASEDIR/logs ] ; then
- mkdir $BASEDIR/logs
+if [ ! -d $LOGDIR ] ; then
+ mkdir $LOGDIR || (echo "Could not create log directory: $LOGDIR"; exit 1)
fi
for GROUP in $LIST_OF_GROUPS
@@ -99,7 +107,7 @@ do
if [ -s $TMPDIR/.$GROUP.old ]
then
(
- echo "To: @MAILPLUS@admin-$GROUP"
+ echo "To: @ADMINMAILPLUS@$GROUP"
echo "Subject: rancid hung - $GROUP"
echo "Precedence: bulk"
echo ""
@@ -124,5 +132,5 @@ END
echo
echo ending: `date`
- ) >$BASEDIR/logs/$GROUP.`date +%Y%m%d.%H%M%S` 2>&1
+ ) >$LOGDIR/$GROUP.`date +%Y%m%d.%H%M%S` 2>&1
done
diff --git a/bin/rancid.in b/bin/rancid.in
index 4566b58..27a5a48 100755..100644
--- a/bin/rancid.in
+++ b/bin/rancid.in
@@ -1,19 +1,22 @@
-#!@PERLV_PATH@
+#! @PERLV_PATH@
##
+## $Id: rancid.in,v 1.168 2004/01/12 00:52:47 asp Exp $
##
-## Copyright (C) 1997-2001 by Henry Kilmer.
+## Copyright (C) 1997-2004 by Terrapin Communications, Inc.
## All rights reserved.
##
-## This software may be freely copied, modified and redistributed without
-## fee for non-commerical purposes provided that this copyright notice is
-## preserved intact on all copies and modified copies.
+## This software may be freely copied, modified and redistributed
+## without fee for non-commerical purposes provided that this license
+## remains intact and unmodified with any RANCID distribution.
##
## There is no warranty or other guarantee of fitness of this software.
-## It is provided solely "as is". The author(s) disclaim(s) all
+## It is provided solely "as is". The author(s) disclaim(s) all
## responsibility and liability with respect to this software's usage
## or its effect upon hardware, computer systems, other software, or
## anything else.
##
+## Except where noted otherwise, rancid was written by and is maintained by
+## Henry Kilmer, John Heasley, Andrew Partan, Pete Whiting, and Austin Schutz.
##
#
# RANCID - Really Awesome New Cisco confIg Differ
@@ -21,7 +24,7 @@
# usage: rancid [-d] [-l] [-f filename | $host]
#
use Getopt::Std;
-getopts('dflm');
+getopts('dfl');
$log = $opt_l;
$debug = $opt_d;
$file = $opt_f;
@@ -135,31 +138,40 @@ sub sortbyipaddr {
# This routine parses "show version"
sub ShowVersion {
print STDERR " In ShowVersion: $_" if ($debug);
+ my($slaveslot);
while (<INPUT>) {
tr/\015//d;
- study;
last if(/^$prompt/);
next if(/^(\s*|\s*$cmd\s*)$/);
return(-1) if (/command authorization failed/i);
+ # the pager can not be disabled per-session on the PIX
+ s/^<-+ More -+>\s*//;
if (/^Slave in slot (\d+) is running/) {
$slave = " Slave:";
+ $slaveslot = ", slot $1";
next;
}
+ if (/^Application and Content Networking Software/) { $type="CE"; }
+ /^Application and Content Networking Software Release /i &&
+ ProcessHistory("COMMENTS","keysort","F1", "!Image: $_") && next;
/^Cisco Secure PIX /i &&
ProcessHistory("COMMENTS","keysort","F1", "!Image: $_") && next;
- /^IOS .* Software \(([A-Za-z-0-9]*)\), .*Version\s+(.*)$/ &&
+ # PIX fail-over license
+ /^This PIX has an?\s+(.*)$/ &&
+ ProcessHistory("COMMENTS","keysort","C1", "!$_") && next;
+ /^(Cisco )?IOS .* Software,? \(([A-Za-z-0-9]*)\), .*Version\s+(.*)$/ &&
ProcessHistory("COMMENTS","keysort","F1",
- "!Image:$slave Software: $1, $2\n") && next;
+ "!Image:$slave Software: $2, $3\n") && next;
/^([A-Za-z-0-9_]*) Synced to mainline version: (.*)$/ &&
ProcessHistory("COMMENTS","keysort","F2",
"!Image:$slave $1 Synced to mainline version: $2\n") && next;
/^Compiled (.*)$/ &&
ProcessHistory("COMMENTS","keysort","F3",
"!Image:$slave Compiled: $1\n") && next;
- /^ROM: (System )?Bootstrap.*(Version.*)$/ &&
+ /^ROM: (IOS \S+ )?(System )?Bootstrap.*(Version.*)$/ &&
ProcessHistory("COMMENTS","keysort","G1",
- "!ROM Bootstrap: $2\n") && next;
+ "!ROM Bootstrap: $3\n") && next;
if (/^Hardware:\s+(.*), (.* RAM), CPU (.*)$/) {
ProcessHistory("COMMENTS","keysort","A1",
"!Chassis type: $1 - a PIX\n");
@@ -169,6 +181,17 @@ sub ShowVersion {
}
/^Serial Number:\s+(.*)$/ &&
ProcessHistory("COMMENTS","keysort","C1", "!$_") && next;
+ # CatOS 3500xl stuff
+ /^System serial number(:\s+.*)$/ &&
+ ProcessHistory("COMMENTS","keysort","C1", "!Serial Number$1\n") &&
+ next;
+ /^Model / &&
+ ProcessHistory("COMMENTS","keysort","C2", "!$_") && next;
+ /^Motherboard / &&
+ ProcessHistory("COMMENTS","keysort","C3", "!$_") && next;
+ /^Power supply / &&
+ ProcessHistory("COMMENTS","keysort","C4", "!$_") && next;
+
/^Activation Key:\s+(.*)$/ &&
ProcessHistory("COMMENTS","keysort","C2", "!$_") && next;
/^ROM: \d+ Bootstrap .*(Version.*)$/ &&
@@ -193,48 +216,80 @@ sub ShowVersion {
my($cpu) = $2;
my($mem) = $3;
my($device) = "router";
- if ( $1 eq "CSC") {
+
+ # the next line ought to be the more specific cpu info, grab it.
+ # yet, some boards/IOS vers have a processor ID line between these
+ # two. grrr. make sure we dont grab the "software" junk that
+ # follows these lines by looking for "CPU at " or the 2600s
+ # "processor: " unique string. there are undoubtedly many other
+ # incantations. for a slave, we dont get this info and its just a
+ # blank line.
+ $_ = <INPUT>;
+ $_ = <INPUT> if (/processor board id/i);
+ $_ = "" if (! /(cpu at |processor: |$cpu processor,)/i);
+ tr/\015//d;
+ s/implementation/impl/i;
+ if ($_ !~ /^\s*$/) {
+ chomp;
+ s/^/, /;
+ }
+
+ if ( $proc eq "CSC") {
$type = "AGS";
- } elsif ( $1 eq "CSC4") {
+ } elsif ( $proc eq "CSC4") {
$type = "AGS+";
- } elsif ( $1 eq "2511" || $1 eq "2524" || $1 eq "AS2511-RJ") {
+ } elsif ( $proc =~ /^(AS)?25[12][12]/) {
$type = "2500";
- } elsif ( $1 =~ /261[01]/ || $1 =~ /262[01]/ ) {
+ } elsif ( $proc =~ /261[01]/ || $proc =~ /262[01]/ ) {
$type = "2600";
- } elsif ( $1 eq "3620" || $1 eq "3640") {
+ } elsif ( $proc =~ /^36[0246][0-9]/) {
$type = "3600";
- } elsif ( $1 eq "RSP7000") {
+ } elsif ( $proc =~ /^37/) {
+ $type = "3700";
+ } elsif ( $proc eq "RSP7000") {
$type = "7500";
- } elsif ( $1 =~ /RSP\d/) {
+ } elsif ( $proc =~ /RSP\d/) {
$type = "7500";
- } elsif ( $1 eq "RP1") {
+ } elsif ( $proc eq "RP1") {
$type = "7000";
- } elsif ( $1 eq "RP") {
+ } elsif ( $proc eq "RP") {
$type = "7000";
- } elsif ( $1 =~ /720[246]/) {
+ } elsif ( $proc =~ /720[246]/) {
$type = "7200";
- } elsif ( $1 =~ /1200[48]\/GRP/ || $1 =~ /1201[26]\/GRP/) {
+ } elsif ( $proc =~ /1200[48]\/GRP/ || $proc =~ /1201[26]\/GRP/) {
$type = "12000";
- } elsif ( $1 =~ /1201[26]-8R\/GRP/) {
+ } elsif ( $proc =~ /1201[26]-8R\/GRP/) {
$type = "12000";
- } elsif ( $1 =~ /WS-C29/) {
+ } elsif ( $proc =~ /WS-C29/) {
$type = "2900XL";
$device = "switch";
- } elsif ( $1 =~ /WS-C35/) {
+ } elsif ( $proc =~ /WS-C355/) {
+ $type = "3550";
+ $device = "switch";
+ } elsif ( $proc =~ /WS-C35/) {
$type = "3500XL";
$device = "switch";
- } elsif ( $1 =~ /6000/) {
+ } elsif ( $proc =~ /WS-C45/) {
+ $type = "4500";
+ $device = "switch";
+ } elsif ( $proc =~ /6000/) {
$type = "6000";
$device = "switch";
+ } elsif ( $proc =~ /CISCO76/) {
+ $type = "7600";
+ $device = "router";
+ } elsif ( $proc =~ /1900/) {
+ $type = "1900";
+ $device = "switch";
} else {
- $type = $1;
+ $type = $proc;
}
print STDERR "TYPE = $type\n" if ($debug);
ProcessHistory("COMMENTS","keysort","A1",
"!Chassis type:$slave $proc - a $type $device\n");
ProcessHistory("COMMENTS","keysort","B1",
"!Memory:$slave main $mem\n");
- ProcessHistory("COMMENTS","keysort","A3","!CPU:$slave $cpu\n");
+ ProcessHistory("COMMENTS","keysort","A3","!CPU:$slave $cpu$_$slaveslot\n");
next;
}
if (/(\S+) Silicon\s*Switch Processor/) {
@@ -249,7 +304,7 @@ sub ShowVersion {
/^(\d+[kK]) bytes of multibus/ &&
ProcessHistory("COMMENTS","keysort","B2",
"!Memory: multibus $1\n") && next;
- /^(\d+[kK]) bytes of non-volatile/ &&
+ /^(\d+[kK]) bytes of (non-volatile|NVRAM)/ &&
ProcessHistory("COMMENTS","keysort","B3",
"!Memory: nvram $1\n") && next;
/^(\d+[kK]) bytes of flash memory/ &&
@@ -272,9 +327,6 @@ sub ShowVersion {
ProcessHistory("COMMENTS","keysort","I0","!\n");
}
ProcessHistory("COMMENTS","keysort","I1","! $_");
- # The line after the WARNING is what to do about it.
- $_ = <INPUT>; tr/\015//d;
- ProcessHistory("COMMENTS","keysort","I1","! $_");
}
if (/^Configuration register is (.*)$/) {
$config_register=$1;
@@ -284,6 +336,57 @@ sub ShowVersion {
return(0);
}
+# This routine parses "show redundancy"
+sub ShowRedundancy {
+ print STDERR " In ShowRedundancy: $_" if ($debug);
+
+ while (<INPUT>) {
+ tr/\015//d;
+ last if(/^$prompt/);
+ next if(/^(\s*|\s*$cmd\s*)$/);
+ # the pager can not be disabled per-session on the PIX
+ s/^<-+ More -+>\s*//;
+
+ /^IOS .* Software \(([A-Za-z-0-9]*)\), .*Version\s+(.*)$/ &&
+ ProcessHistory("COMMENTS","keysort","F1",
+ "!Image:$slave Software: $1, $2\n") && next;
+ /^Compiled (.*)$/ &&
+ ProcessHistory("COMMENTS","keysort","F3",
+ "!Image:$slave Compiled: $1\n") && next;
+ }
+ return(0);
+}
+
+# This routine parses "show IDprom"
+sub ShowIDprom {
+ my($tmp);
+
+ print STDERR " In ShowIDprom: $_" if ($debug);
+
+ while (<INPUT>) {
+ tr/\015//d;
+ last if(/^$prompt/);
+ next if(/^(\s*|\s*$cmd\s*)$/);
+ # the pager can not be disabled per-session on the PIX
+ s/^<-+ More -+>\s*//;
+
+ /FRU is .(.*)\'/ && ($tmp = $1);
+ /Product Number = .(.*)\'/ &&
+ ProcessHistory("COMMENTS","keysort","D0","!\n") &&
+ ProcessHistory("COMMENTS","keysort","D0",
+ "!Catalyst Chassis type: $1, $tmp\n");
+ /Serial Number = .([0-9A-Za-z]+)/ &&
+ ProcessHistory("COMMENTS","keysort","D1",
+ "!Catalyst Chassis S/N: $1\n");
+ /Manufacturing Assembly Number = .([-0-9]+)/ && ($tmp = $1);
+ /Manufacturing Assembly Revision = .(.*)\'/ && ($tmp .= ", rev " . $1);
+ /Hardware Revision = ([0-9.]+)/ &&
+ ProcessHistory("COMMENTS","keysort","D2",
+ "!Catalyst Chassis assembly: $tmp, ver $1\n");
+ }
+ return(0);
+}
+
# This routine parses "show install active"
sub ShowInstallActive {
print STDERR " In ShowInstallActive: $_" if ($debug);
@@ -295,6 +398,8 @@ sub ShowInstallActive {
return(1) if /^\s*\^\s*$/;
return(1) if /(Invalid input detected|Type help or )/;
return(-1) if (/command authorization failed/i);
+ # the pager can not be disabled per-session on the PIX
+ s/^<-+ More -+>\s*//;
ProcessHistory("COMMENTS","keysort","F5","!Image: $_") && next;
}
return(0);
@@ -311,6 +416,8 @@ sub ShowEnv {
next if (/^(\s*|\s*$cmd\s*)$/);
#return(1) if ($type !~ /^7/);
return(-1) if (/command authorization failed/i);
+ # the pager can not be disabled per-session on the PIX
+ s/^<-+ More -+>\s*//;
if (!defined($E0)) {
$E0=1;
ProcessHistory("COMMENTS","keysort","E0","!\n");
@@ -331,11 +438,42 @@ sub ShowEnv {
ProcessHistory("COMMENTS","keysort","E2","!Power: $1\n") && next;
/^\s*(redundant .*)/i &&
ProcessHistory("COMMENTS","keysort","E2","!Power: $1\n") && next;
+ /^\s*(RPS is .*)/i &&
+ ProcessHistory("COMMENTS","keysort","E2","!Power: $1\n") && next;
}
ProcessHistory("COMMENTS","","","!\n");
return(0);
}
+# This routine parses "show rsp chassis-info" for the rsp
+# This will create arrays for hw info.
+sub ShowRSP {
+ print STDERR " In ShowRSP: $_" if ($debug);
+
+ while (<INPUT>) {
+ tr/\015//d;
+ last if (/^$prompt/);
+ next if (/^(\s*|\s*$cmd\s*)$/);
+ return(-1) if (/command authorization failed/i);
+ # return(1) if ($type !~ /^12[40]/);
+ # the pager can not be disabled per-session on the PIX
+ s/^<-+ More -+>\s*//;
+ /^$/ && next;
+
+ /^\s+Chassis model: (\S+)/ &&
+ ProcessHistory("COMMENTS","keysort","D0","!\n") &&
+ ProcessHistory("COMMENTS","keysort","D1",
+ "!RSP Chassis model: $1\n") &&
+ next;
+ /^\s+Chassis S\/N: (.*)$/ &&
+ ProcessHistory("COMMENTS","keysort","D2",
+ "!RSP Chassis S/N: $1\n") &&
+ next;
+ }
+
+ return(0);
+}
+
# This routine parses "show gsr chassis-info" for the gsr
# This will create arrays for hw info.
sub ShowGSR {
@@ -348,6 +486,8 @@ sub ShowGSR {
next if (/^(\s*|\s*$cmd\s*)$/);
return(-1) if (/command authorization failed/i);
# return(1) if ($type !~ /^12[40]/);
+ # the pager can not be disabled per-session on the PIX
+ s/^<-+ More -+>\s*//;
/^$/ && next;
/^\s+Chassis: type (\S+) Fab Ver: (\S+)/ &&
ProcessHistory("COMMENTS","keysort","D0","!\n") &&
@@ -386,15 +526,17 @@ sub ShowBoot {
return(1) if /Ambiguous command/i;
return(1) if /(Invalid input detected|Type help or )/;
return(1) if /(Open device \S+ failed|Error opening \S+:)/;
+ # the pager can not be disabled per-session on the PIX
+ s/^<-+ More -+>\s*//;
next if /CONFGEN variable/;
if (!defined($H0)) {
$H0=1; ProcessHistory("COMMENTS","keysort","H0","!\n");
}
if ($type !~ /^(12[04]|7)/) {
if ($type !~ /^(29|35)00/) {
- ProcessHistory("COMMENTS","keysort","H2","!BootFlash: $_");
+ ProcessHistory("COMMENTS","keysort","H2","!BootFlash: $_");
} else {
- ProcessHistory("COMMENTS","keysort","H1","!Variable: $_");
+ ProcessHistory("COMMENTS","keysort","H1","!Variable: $_");
}
} elsif (/variable/) {
ProcessHistory("COMMENTS","keysort","H1","!Variable: $_");
@@ -418,6 +560,8 @@ sub ShowFlash {
return(-1) if (/command authorization failed/i);
return(1) if /^\s*\^\s*$/;
return(1) if /(Invalid input detected|Type help or )/;
+ # the pager can not be disabled per-session on the PIX
+ s/^<-+ More -+>\s*//;
ProcessHistory("FLASH","","","!Flash: $_");
}
ProcessHistory("","","","!\n");
@@ -438,13 +582,15 @@ sub DirSlotN {
# return(1) if ($type !~ /^(12[40]|7|36)/);
return(1) if /^\s*\^\s*$/;
return(1) if /(Invalid input detected|Type help or )/;
- return(1) if /No such device/i;
+ return(1) if /(No such device|Error Sending Request)/i;
return(1) if /\%Error: No such file or directory/;
return(1) if /No space information available/;
return(-1) if /\%Error calling/;
return(-1) if /(: device being squeezed|ATA_Status time out)/i; # busy
return(-1) if (/command authorization failed/i);
return(1) if /(Open device \S+ failed|Error opening \S+:)/;
+ # the pager can not be disabled per-session on the PIX
+ s/^<-+ More -+>\s*//;
ProcessHistory("FLASH","","","!Flash: $dev: $_");
}
ProcessHistory("","","","!\n");
@@ -458,11 +604,12 @@ sub ShowContAll {
while (<INPUT>) {
tr/\015//d;
- study;
last if (/^$prompt/);
next if (/^(\s*|\s*$cmd\s*)$/);
# return(1) if ($type =~ /^(12[40]|7[05])/);
return(-1) if (/command authorization failed/i);
+ # the pager can not be disabled per-session on the PIX
+ s/^<-+ More -+>\s*//;
if (/^Interface ([^ \n(]*)/) { $INT = "$1, "; next; }
/^(BRI unit \d)/ &&
ProcessHistory("INT","","","!Interface: $1\n") && next;
@@ -521,6 +668,8 @@ sub ShowContCbus {
next if (/^(\s*|\s*$cmd\s*)$/);
#return(1) if ($type !~ /^7[05]0/);
return(-1) if (/command authorization failed/i);
+ # the pager can not be disabled per-session on the PIX
+ s/^<-+ More -+>\s*//;
if (/^\s*slot(\d+): ([^,]+), hw (\S+), sw (\S+), ccb/) {
$slot = $1;
$board{$slot} = $2;
@@ -562,11 +711,12 @@ sub ShowDiagbus {
while (<INPUT>) {
tr/\015//d;
- study;
last if (/^$prompt/);
next if (/^(\s*|\s*$cmd\s*)$/);
#return(1) if ($type !~ /^7[05]/);
return(-1) if (/command authorization failed/i);
+ # the pager can not be disabled per-session on the PIX
+ s/^<-+ More -+>\s*//;
if (/^\s*Slot (\d+):/i) {
$slot = $1;
next;
@@ -641,7 +791,7 @@ sub ShowDiagbus {
return(0);
}
-# This routine parses "show diag" for the gsr, 7200, 3600, 2600.
+# This routine parses "show diag" for the gsr, 7200, 3700, 3600, 2600.
# This will create arrarys for hw info.
sub ShowDiag {
# Skip if this is not a 12000.
@@ -649,12 +799,14 @@ sub ShowDiag {
while (<INPUT>) {
tr/\015//d;
- study;
last if (/^$prompt/);
next if (/^(\s*|\s*$cmd\s*)$/);
# return(1) if ($type !~ /^(12[40]|720|36|26)/);
return(-1) if (/command authorization failed/i);
/^$/ && next;
+ # the pager can not be disabled per-session on the PIX
+ s/^<-+ More -+>\s*//;
+
s/Port Packet Over SONET/POS/;
if (/^\s*SLOT\s+(\d+)\s+\((.*)\): (.*)/) {
$slot = $1;
@@ -663,11 +815,22 @@ sub ShowDiag {
next;
}
if (/^\s+MAIN:\s* type \d+,\s+(.*)/) {
- ProcessHistory("SLOT","keysort","AM","!Slot $slot/MAIN: part $1\n") && next;
+ ProcessHistory("SLOT","keysort","AM","!Slot $slot/MAIN: part $1\n");
+ next;
+ }
+ if (/^c3700\s+(io-board|mid-plane)/i) {
+ $slot=$1;
+ ProcessHistory("SLOT","","","!\n");
+ ProcessHistory("SLOT","keysort","A","!Slot $slot: part $1\n");
+ next;
}
if (/ Engine:\s+(.*)/) {
ProcessHistory("SLOT","keysort","AE","!Slot $slot/Engine: $1\n");
}
+ if (/FRU:\s+Linecard\/Module:\s+(\S+)/) {
+ ProcessHistory("SLOT","keysort","AF","!Slot $slot/FRU: Linecard/Module: $1\n");
+ next;
+ }
if (/^\s+PCA:\s+(.*)/) {
local($part) = $1;
$_ = <INPUT>;
@@ -707,35 +870,78 @@ sub ShowDiag {
}
next;
}
- # 7200 and 3600 stuff
- if (/^(Slot)\s+(\d+(\/\d+)?):/ || /^\s+(WIC|VIC) Slot (\d):/) {
+ # 7200, 3600, 2600, and 1700 stuff
+ if (/^(Slot)\s+(\d+(\/\d+)?):/
+ || /^\s+(WIC|VIC|WIC\/VIC) Slot (\d):/
+ || /^(Encryption AIM) (\d):/) {
if ($1 eq "WIC") {
$WIC = "/$2";
} elsif ($1 eq "VIC") {
$WIC = "/$2";
+ } elsif ($1 eq "WIC/VIC") {
+ $WIC = "/$2";
+ } elsif ($1 eq "Encryption AIM") {
+ $slot = "$2";
+ undef($WIC);
+ ProcessHistory("SLOT","","","!\n");
+ ProcessHistory("SLOT","keysort","B","!Slot $slot: type $1\n");
+ next;
} else {
$slot = $2;
undef($WIC);
}
$_ = <INPUT>; tr/\015//d;
- # clean up hideous 7200 format to look more like 7500 output
+ # clean up hideous 7200/etc formats to look more like 7500 output
s/Fast-ethernet on C7200 I\/O card/FE-IO/;
s/ with MII or RJ45/-TX/;
s/Fast-ethernet /100Base/; s/[)(]//g;
+ s/intermediate reach/IR/i;
ProcessHistory("SLOT","","","!\n");
/\s+(.*) port adapter,?\s+(\d+)\s+/i &&
- ProcessHistory("SLOT","keysort","B","!Slot $slot: type $1, $2 ports\n");
+ ProcessHistory("SLOT","keysort","B","!Slot $slot: type $1, $2 ports\n") && next;
# I/O controller with no interfaces
/\s+(.*)\s+port adapter\s*$/i &&
- ProcessHistory("SLOT","keysort","B","!Slot $slot: type $1, 0 ports\n");
+ ProcessHistory("SLOT","keysort","B","!Slot $slot: type $1, 0 ports\n") && next;
/\s+(.*)\s+daughter card(.*)$/ &&
- ProcessHistory("SLOT","keysort","B","!Slot $slot$WIC: type $1$2\n");
+ ProcessHistory("SLOT","keysort","B","!Slot $slot$WIC: type $1$2\n") && next;
/\s+(FT1)$/ &&
- ProcessHistory("SLOT","keysort","B","!Slot $slot$WIC: type $1\n");
+ ProcessHistory("SLOT","keysort","B","!Slot $slot$WIC: type $1\n") && next;
+ # handle WICs lacking "daughter card" in the 2nd line of their
+ # show diag o/p
+ if (defined($WIC)) {
+ s/^\s+//;
+ ProcessHistory("SLOT","keysort","B","!Slot $slot$WIC: type $_");
+ }
next;
}
+ # yet another format. seen on 2600s w/ 12.1, but appears to be all
+ # 12.1, including 7200s & 3700s. Sometimes the PCB serial appears
+ # before the hardware revision.
+ if (/(pcb serial number|hardware revision)\s+:\s+(\S+)$/i) {
+ my($hw, $pn, $rev, $sn);
+ if ($1 =~ /^pcb/i) {
+ $sn = $2;
+ } else {
+ $hw = $2;
+ }
+ while (<INPUT>) {
+ tr/\015//d;
+
+ if (/0x..: /) {
+ # no effing idea why break does not work there
+ goto PerlSucks;
+ }
+ if (/hardware revision\s+:\s+(\S+)/i) { $hw = $1; }
+ if (/part number\s+:\s+(\S+)/i) { $pn = $1; }
+ if (/board revision\s+:\s+(\S+)/i) { $rev = $1; }
+ if (/pcb serial number\s+:\s+(\S+)/i) { $sn = $1; }
+ }
+PerlSucks:
+ ProcessHistory("SLOT","keysort","B","!Slot $slot$WIC: hvers $hw rev $rev\n");
+ ProcessHistory("SLOT","keysort","C","!Slot $slot$WIC: part $pn, serial $sn\n");
+ }
/revision\s+(\S+).*revision\s+(\S+)/ &&
ProcessHistory("SLOT","keysort","C","!Slot $slot$WIC: hvers $1 rev $2\n") &&
next;
@@ -760,6 +966,8 @@ sub ShowModule {
last if (/^$prompt/);
next if (/^(\s*|\s*$cmd\s*)$/);
return(-1) if (/command authorization failed/i);
+ # the pager can not be disabled per-session on the PIX
+ s/^<-+ More -+>\s*//;
# match slot/card info line
if (/^ *(\d+)\s+(\d+)\s+(.*)\s+(\S+)\s+(\S+)\s*$/) {
@@ -781,6 +989,24 @@ sub ShowModule {
return(0);
}
+# This routine parses "show spe version".
+sub ShowSpeVersion {
+ print STDERR " In ShowSpeVersion: $_" if ($debug);
+
+ while (<INPUT>) {
+ tr/\015//d;
+ last if (/^$prompt/);
+ next if (/^(\s*|\s*$cmd\s*)$/);
+ return(1) if /^\s*\^\s*$/;
+ return(1) if /(Invalid input detected|Type help or )/;
+ return(-1) if (/command authorization failed/i);
+
+ ProcessHistory("MODEM","","","!Modem: $_") && next;
+ }
+ ProcessHistory("MODEM","","","!\n");
+ return(0);
+}
+
# This routine parses "show c7200" for the 7200
# This will create arrays for hw info.
sub ShowC7200 {
@@ -794,6 +1020,8 @@ sub ShowC7200 {
#return(1) if ($type !~ /^72/);
return(-1) if (/command authorization failed/i);
/^$/ && next;
+ # the pager can not be disabled per-session on the PIX
+ s/^<-+ More -+>\s*//;
if (/^(C7200 )?Midplane EEPROM:/) {
$_ = <INPUT>;
/revision\s+(\S+).*revision\s+(\S+)/;
@@ -838,6 +1066,8 @@ sub ShowVTP {
#return(1) if ($type !~ /^(2900XL|3500XL|6000)$/);
return(-1) if (/command authorization failed/i);
next if (/^Configuration last modified by/);
+ # the pager can not be disabled per-session on the PIX
+ s/^<-+ More -+>\s*//;
if (/^VTP Operating Mode\s+:\s+(Transparent|Server)/) {
$DO_SHOW_VLAN = 1;
}
@@ -858,8 +1088,13 @@ sub ShowVLAN {
last if (/^$prompt/);
next if (/^(\s*|\s*$cmd\s*)$/);
return(1) if /(Invalid input detected|Type help or )/;
+ # newer releases (~12.1(9)) place the vlan config in the normal
+ # configuration (write term).
+ return(1) if ($type =~ /^(3550|4500|7600)$/);
#return(1) if ($type !~ /^(2900XL|3500XL|6000)$/);
return(-1) if (/command authorization failed/i);
+ # the pager can not be disabled per-session on the PIX
+ s/^<-+ More -+>\s*//;
ProcessHistory("COMMENTS","keysort","IO","!VLAN: $_");
}
ProcessHistory("COMMENTS","keysort","IO","!\n");
@@ -869,16 +1104,17 @@ sub ShowVLAN {
# This routine processes a "write term"
sub WriteTerm {
print STDERR " In WriteTerm: $_" if ($debug);
- my($lineauto) = 0;
+ my($lineauto,$comment,$linecnt) = (0,0,0);
while (<INPUT>) {
tr/\015//d;
- study;
last if(/^$prompt/);
return(-1) if (/command authorization failed/i);
# the pager can not be disabled per-session on the PIX
s/^<-+ More -+>\s*//;
/Non-Volatile memory is in use/ && return(-1); # NvRAM is locked
+ return(0) if ($found_end); # Only do this routine once
+ $linecnt++;
$lineauto = 0 if (/^[^ ]/);
# skip the crap
if (/^(##+$|(Building|Current) configuration)/i) {
@@ -898,6 +1134,16 @@ sub WriteTerm {
# block above
/^! (Last configuration|NVRAM config last)/ && next;
+ # skip consecutive comment lines to avoid oscillating extra comment
+ # line on some access servers. grrr.
+ if (/^!/) {
+ next if ($comment);
+ ProcessHistory("","","",$_);
+ $comment++;
+ next;
+ }
+ $comment = 0;
+
# Dog gone Cool matches to process the rest of the config
/^tftp-server flash / && next; # kill any tftp remains
/^ntp clock-period / && next; # kill ntp clock-period
@@ -932,6 +1178,14 @@ sub WriteTerm {
}
next;
}
+ if (/^( set session-key (in|out)bound ah \d+ )/ && $filter_pwds >= 1) {
+ ProcessHistory("","","","!$1<removed>\n");
+ next;
+ }
+ if (/^( set session-key (in|out)bound esp \d+ (authenticator|cypher) )/ && $filter_pwds >= 1) {
+ ProcessHistory("","","","!$1<removed>\n");
+ next;
+ }
if (/^(\s*)password / && $filter_pwds >= 1) {
ProcessHistory("LINE-PASS","","","!$1password <removed>\n");
next;
@@ -955,7 +1209,7 @@ sub WriteTerm {
}
if (/^\s+(domain-password|area-password) (\S+)( .*)?/
&& $filter_pwds >= 1) {
- ProcessHistory("","","","!$1 <removed>$2\n"); next;
+ ProcessHistory("","","","!$1 <removed>$3\n"); next;
}
# this is reversable, despite 'md5' in the cmd
if (/^( ip ospf message-digest-key \d+ md5) / && $filter_pwds >= 1) {
@@ -964,10 +1218,25 @@ sub WriteTerm {
if (/^((crypto )?isakmp key) \S+ / && $filter_pwds >= 1) {
ProcessHistory("","","","!$1 <removed> $'"); next;
}
+ # filter HSRP passwords
+ if (/^(\s+standby \d authentication) / && $filter_pwds >= 1) {
+ ProcessHistory("","","","!$1 <removed>\n"); next;
+ }
+ # this appears in "measurement/sla" images
+ if (/^(\s+key-string \d?)/ && $filter_pwds >= 1) {
+ ProcessHistory("","","","!$1 <removed>\n"); next;
+ }
+ if (/^( l2tp tunnel \S+ password)/ && $filter_pwds >= 1) {
+ ProcessHistory("","","","!$1 <removed>\n"); next;
+ }
# i am told these are plain-text on the PIX
if (/^(vpdn username \S+ password)/ && $filter_pwds >= 1) {
ProcessHistory("","","","!$1 <removed>\n"); next;
}
+ if (/^( cable shared-secret ) / && $filter_pwds >= 1) {
+ ProcessHistory("","","","!$1 <removed>\n");
+ next;
+ }
/fair-queue individual-limit/ && next;
# sort ip explicit-paths.
if (/^ip explicit-path name (\S+)/) {
@@ -1057,10 +1326,14 @@ sub WriteTerm {
ProcessHistory("SNMPSERVERCOMM","keysort","$_","$_") && next;
}
}
- # order/prune tacacs/radius server statements
+ # prune tacacs/radius server keys
if (/^(tacacs-server|radius-server) key / && $filter_pwds >= 1) {
ProcessHistory("","","","!$1 key <removed>\n"); next;
}
+ if (/^((tacacs-server|radius-server) host \S+ key) / &&
+ $filter_pwds >= 1) {
+ ProcessHistory("","","","!$1 <removed>\n"); next;
+ }
# order clns host statements
/^clns host \S+ (\S+)/ &&
ProcessHistory("CLNS","keysort","$1","$_") && next;
@@ -1076,9 +1349,9 @@ sub WriteTerm {
ProcessHistory("NTP","keysort",$sortkey,"$_");
next;
}
- # order ip host line statements
- /^ip host line(\d+)/ &&
- ProcessHistory("IPHOST","numsort","$1","$_") && next;
+ # order ip host statements
+ /^ip host (\S+) / &&
+ ProcessHistory("IPHOST","keysort","$1","$_") && next;
# order ip nat source static statements
/^ip nat (\S+) source static (\S+)/ &&
ProcessHistory("IP NAT $1","ipsort","$2","$_") && next;
@@ -1105,6 +1378,14 @@ sub WriteTerm {
return(1);
}
}
+ # The ContentEngine lacks a definitive "end of config" marker. If we
+ # know that it is a CE and we have seen at least 5 lines of write term
+ # o/p, we can be reasonably sure that we got the config.
+ if ($type =~ /^CE$/ && $linecnt > 5) {
+ $found_end = 1;
+ return(1);
+ }
+
return(0);
}
@@ -1114,8 +1395,11 @@ sub DoNothing {print STDOUT;}
# Main
%commands=(
'show version' => "ShowVersion",
+ 'show redundancy secondary' => "ShowRedundancy",
+ 'show idprom backplane', => "ShowIDprom",
'show install active' => "ShowInstallActive",
'show env all' => "ShowEnv",
+ 'show rsp chassis-info',=> "ShowRSP",
'show gsr chassis' => "ShowGSR",
'show boot' => "ShowBoot",
'show bootvar' => "ShowBoot",
@@ -1131,22 +1415,44 @@ sub DoNothing {print STDOUT;}
'dir /all disk2:' => "DirSlotN",
"dir /all sup-bootflash:"=> "DirSlotN", # cat 6500-ios
"dir /all sup-microcode:"=> "DirSlotN", # cat 6500-ios
+ 'dir /all slavenvram:' => "DirSlotN",
+ 'dir /all slavebootflash:' => "DirSlotN",
+ 'dir /all slaveslot0:' => "DirSlotN",
+ 'dir /all slavedisk0:' => "DirSlotN",
+ 'dir /all slaveslot1:' => "DirSlotN",
+ 'dir /all slavedisk1:' => "DirSlotN",
+ 'dir /all slaveslot2:' => "DirSlotN",
+ 'dir /all slavedisk2:' => "DirSlotN",
+ "dir /all slavesup-bootflash:"=> "DirSlotN", # cat 7609
+ 'dir /all sec-nvram:' => "DirSlotN",
+ 'dir /all sec-bootflash:' => "DirSlotN",
+ 'dir /all sec-slot0:' => "DirSlotN",
+ 'dir /all sec-disk0:' => "DirSlotN",
+ 'dir /all sec-slot1:' => "DirSlotN",
+ 'dir /all sec-disk1:' => "DirSlotN",
+ 'dir /all sec-slot2:' => "DirSlotN",
+ 'dir /all sec-disk2:' => "DirSlotN",
'show controllers' => "ShowContAll",
'show controllers cbus' => "ShowContCbus",
'show diagbus' => "ShowDiagbus",
'show diag' => "ShowDiag",
'show module' => "ShowModule", # cat 6500-ios
+ 'show spe version' => "ShowSpeVersion",
'show c7200' => "ShowC7200",
'show vtp status' => "ShowVTP",
'show vlan' => "ShowVLAN",
+ 'show running-config' => "WriteTerm",
'write term' => "WriteTerm"
);
# keys() doesnt return things in the order entered and the order of the
# cmds is important (show version first and write term last). pita
@commands=(
"show version",
+ "show redundancy secondary",
+ "show idprom backplane",
"show install active",
"show env all",
+ "show rsp chassis-info",
"show gsr chassis",
"show boot",
"show bootvar",
@@ -1162,14 +1468,33 @@ sub DoNothing {print STDOUT;}
"dir /all disk2:",
"dir /all sup-bootflash:",
"dir /all sup-microcode:",
+ "dir /all slavenvram:",
+ "dir /all slavebootflash:",
+ "dir /all slaveslot0:",
+ "dir /all slavedisk0:",
+ "dir /all slaveslot1:",
+ "dir /all slavedisk1:",
+ "dir /all slaveslot2:",
+ "dir /all slavedisk2:",
+ "dir /all slavesup-bootflash:",
+ "dir /all sec-nvram:",
+ "dir /all sec-bootflash:",
+ "dir /all sec-slot0:",
+ "dir /all sec-disk0:",
+ "dir /all sec-slot1:",
+ "dir /all sec-disk1:",
+ "dir /all sec-slot2:",
+ "dir /all sec-disk2:",
"show controllers",
"show controllers cbus",
"show diagbus",
"show diag",
"show module",
+ "show spe version",
"show c7200",
"show vtp status",
"show vlan",
+ "show running-config",
"write term"
);
$cisco_cmds=join(";",@commands);
@@ -1196,7 +1521,7 @@ if ($file) {
}
# determine password filtering mode
-if ($ENV{"FILTER_PWDS"} =~ /no/i) {
+if ($ENV{"FILTER_PWDS"} =~ /no/i) {
$filter_pwds = 0;
} elsif ($ENV{"FILTER_PWDS"} =~ /all/i) {
$filter_pwds = 2;
@@ -1210,7 +1535,7 @@ ProcessHistory("COMMENTS","keysort","F0","!\n");
ProcessHistory("COMMENTS","keysort","G0","!\n");
TOP: while(<INPUT>) {
tr/\015//d;
- if (/\#\s?exit$/) {
+ if (/[>#]\s?exit$/) {
$clean_run=1;
last;
}
@@ -1222,7 +1547,11 @@ TOP: while(<INPUT>) {
}
while (/#\s*($cmds_regexp)\s*$/) {
$cmd = $1;
- if (!defined($prompt)) {$prompt = ($_ =~ /^([^#]+#)/)[0]; }
+ if (!defined($prompt)) {
+ $prompt = ($_ =~ /^([^#]+#)/)[0];
+ $prompt =~ s/([][}{)(\\])/\\$1/g;
+ print STDERR ("PROMPT MATCH: $prompt\n") if ($debug);
+ }
print STDERR ("HIT COMMAND:$_") if ($debug);
if (! defined($commands{$cmd})) {
print STDERR "$host: found unexpected command - \"$cmd\"\n";
diff --git a/bin/rename.in b/bin/rename.in
deleted file mode 100755
index 8c3a111..0000000
--- a/bin/rename.in
+++ /dev/null
@@ -1,113 +0,0 @@
-#!@PERLV_PATH@
-'di';
-'ig00';
-#
-# Revision 3.0.1.2 90/08/09 03:17:57 lwall
-# patch19: added man page for relink and rename
-#
-
-if ($ARGV[0] eq '-i') {
- shift;
- if (open(TTYIN, "</dev/tty") && open(TTYOUT,">/dev/tty")) {
- $inspect++;
- select((select(TTYOUT),$|=1)[0]);
- }
-}
-($op = shift) || die "Usage: rename [-i] perlexpr [filenames]\n";
-if (!@ARGV) {
- @ARGV = <STDIN>;
- chop(@ARGV);
-}
-for (@ARGV) {
- unless (-e) {
- print STDERR "$0: $_: $!\n";
- $status = 1;
- next;
- }
- $was = $_;
- eval $op;
- die $@ if $@;
- if ($was ne $_) {
- if ($inspect && -e) {
- print TTYOUT "remove $_? ";
- next unless <TTYIN> =~ /^y/i;
- }
- unless (rename($was, $_)) {
- print STDERR "$0: can't rename $was to $_: $!\n";
- $status = 1;
- }
- }
-}
-exit $status;
-##############################################################################
-__END__
- # These next few lines are legal in both Perl and nroff.
-
-.00; # finish .ig
-
-'di \" finish diversion--previous line must be blank
-.nr nl 0-1 \" fake up transition to first page again
-.nr % 0 \" start at page 1
-';<<'.ex'; #__END__ ############# From here on it's a standard manual page ############
-.TH RENAME 1 "July 30, 1990"
-.AT 3
-.SH NAME
-rename \- renames multiple files
-.SH SYNOPSIS
-.B rename [-i] perlexpr [files]
-.SH DESCRIPTION
-.I Rename
-renames the filenames supplied according to the rule specified as the
-first argument.
-The argument is a Perl expression which is expected to modify the $_
-string in Perl for at least some of the filenames specified.
-If a given filename is not modified by the expression, it will not be
-renamed.
-If no filenames are given on the command line, filenames will be read
-via standard input.
-.PP
-The
-.B \-i
-flag will prompt to remove the old file first if it exists. This
-flag will be ignored if there is no tty.
-.PP
-For example, to rename all files matching *.bak to strip the extension,
-you might say
-.nf
-
- rename 's/\e.bak$//' *.bak
-
-.fi
-To translate uppercase names to lower, you'd use
-.nf
-
- rename 'y/A-Z/a-z/' *
-
-.fi
-To do the same thing but leave Makefiles unharmed:
-.nf
-
- rename 'y/A-Z/a-z/ unless /^Make/' *
-
-.fi
-To rename all the *.f files to *.BAD, you'd use
-.nf
-
- rename 's/\e.f$/.BAD/' *.f
-
-.SH ENVIRONMENT
-.fi
-No environment variables are used.
-.SH FILES
-.SH AUTHOR
-Larry Wall
-.SH "SEE ALSO"
-mv(1)
-.br
-perl(1)
-.SH DIAGNOSTICS
-If you give an invalid Perl expression you'll get a syntax error.
-.SH BUGS
-.I Rename
-does not check for the existence of target filenames, so use with care.
-.ex
diff --git a/bin/rivlogin.in b/bin/rivlogin.in
new file mode 100644
index 0000000..12554d5
--- /dev/null
+++ b/bin/rivlogin.in
@@ -0,0 +1,1005 @@
+#! @EXPECT_PATH@ --
+##
+## $Id: rivlogin.in,v 1.15 2004/01/11 05:39:15 heas Exp $
+##
+## Copyright (C) 1997-2004 by Terrapin Communications, Inc.
+## All rights reserved.
+##
+## This software may be freely copied, modified and redistributed
+## without fee for non-commerical purposes provided that this license
+## remains intact and unmodified with any RANCID distribution.
+##
+## There is no warranty or other guarantee of fitness of this software.
+## It is provided solely "as is". The author(s) disclaim(s) all
+## responsibility and liability with respect to this software's usage
+## or its effect upon hardware, computer systems, other software, or
+## anything else.
+##
+## Except where noted otherwise, rancid was written by and is maintained by
+## Henry Kilmer, John Heasley, Andrew Partan, Pete Whiting, and Austin Schutz.
+##
+#
+# The login expect scripts were based on Erik Sherk's gwtn, by permission.
+#
+# rivlogin - Riverstone (and Enterasys SSR) login
+#
+# Based upon rscmd (see nmops.org)
+# rscmd - Riverstone Networks Automated login
+# by Mike MacFaden, Kiran Addepalli
+# Riverstone Networks, 2000
+#
+# Returned to the RANCID crowd by andrew fort
+
+# Global vars section
+
+# program diagnostics
+set verbose 0
+set success 1
+set config 0
+
+# in seconds to wait for data back from device
+set timeout 10
+set tempfile "/tmp/rivlogin.[exec date]"
+
+# cli command prompt
+set my_prompt ">"
+set enable_prompt "\#"
+
+set default_user ""
+set output_file ""
+set conf_prompt "*\(config\)# "
+set logging 0
+set config_mode 0
+
+# Password file for routers to access
+set password_file $env(HOME)/.cloginrc
+
+# If no -c or -s specified, just automate router login ala rsh
+set do_command 0
+set do_script 0
+set log_user 0
+
+# The default CLI mode to login to is "enable" mode
+set enable 1
+
+# The default is to look in the password file to find the passwords. This
+# tracks if we receive them on the command line.
+set do_passwd 1
+set do_enapasswd 1
+
+# cmd usage
+set usage "Error: Usage: $argv0 \[-noenable\] \
+\[-f cloginrc-file\] \[-c command\] \[-Evar=x\] \[-s script-file\] \
+\[-x command-file\] \[-t timeout\] \[-o output-file\] \
+router \[router...\]\n"
+
+# Procedures Section
+
+
+#
+# Sets Xterm title if interactive...if its an xterm and the user cares
+#
+
+proc label { host } {
+
+ global env
+
+ # if CLOGIN has an 'x' in it, don't set the xterm name/banner
+ if [info exists env(CLOGIN)] {
+ if {[string first "x" $env(CLOGIN)] != -1} { return }
+ }
+
+ if [info exists env(TERM)] {
+ if [regexp \^(xterm|vs) $env(TERM) ignore ] {
+ send_user "\033]1;[lindex [split $host "."] 0]\a"
+ send_user "\033]2;$host\a"
+ }
+ }
+}
+
+
+# This is a helper function to make the password file easier to
+# maintain.
+# NOTES: Using this the password file has the form:
+# add password sl* pete cow
+# add password at* steve
+# add password * hanky-pie
+
+proc add { var args } {
+
+ global $var
+ lappend $var $args
+}
+
+# Loads the password file. Note that as this file is tcl, and that
+# it is sourced, the user better know what to put in there, as it
+# could install more than just password info... I will assume however,
+# that a "bad guy" could just as easy put such code in the clogin
+# script, so I will leave .cloginrc as just an extention of that script
+
+proc source_password_file { } {
+
+ global env password_file read_password_file
+
+ if { [info exists read_password_file] } {
+ return 1
+ }
+
+ if { [info exists password_file] == 0 } {
+ set password_file $env(HOME)/.cloginrc
+ }
+
+ set read_password_file 1
+ file stat $password_file fileinfo
+
+ if { [expr ($fileinfo(mode) & 007)] != 0000 } {
+ puts "ERROR: $password_file must not be group or world readable and writable\n"
+ return 1
+ }
+
+ source $password_file
+}
+
+# pre: var is x, router is y
+# post: return routerr entry from database else null string
+
+proc find { var router } {
+
+ if {[ source_password_file ] == 0 } {
+ return {}
+ }
+
+ upvar $var list
+ if { [info exists list] } {
+ foreach line $list {
+ if { [string match [lindex $line 0] $router ] } {
+ return [lrange $line 1 end]
+ }
+ }
+ }
+ return {}
+}
+
+
+# pre: login completed ok
+# post: terminate login session by closing tcp connection
+
+proc auto_exit { } {
+
+ global telnet_id
+
+ if { $verbose == 1 } {
+ puts "DEBUG: auto_exit closing connection to pid $telnet_id\n"
+ }
+ close -i telnet_id
+}
+
+# perform login basic to a router
+# pre: args are valid, router is reachable via network
+# post: return 0 on successful login, else 1
+#
+# NOTE: a number of globals are setup: my_prompt, telnet_id are key
+# and paging of cli output is disabled
+
+proc login { router user userpswd passwd enapasswd } {
+
+ global login_array
+ global telnet_id
+ global expect_out
+ global spawn_id
+ global verbose
+ global config verbose my_prompt
+
+ if { $verbose == 1 } {
+ puts "DEBUG: login router = $router"
+ puts "DEBUG: login username = $user"
+ puts "DEBUG: login userpasswd = $userpswd"
+ puts "DEBUG: login passwd = $passwd"
+ puts "DEBUG: login enapasswd = $enapasswd"
+ }
+
+ spawn -noecho telnet $router
+ set telnet_id $spawn_id
+
+ if { $telnet_id == 0 } {
+ puts "ERROR: login: spawn telnet session failed.\n"
+ return 1
+ }
+
+ # wait for initial 'Press RETURN to...' response
+ sleep 0.3
+
+ expect "*"
+ send "\r"
+
+ # If password fails 3 times then expect again
+ set pass_attempt 0
+
+ expect {
+
+ -re ".*> " { }
+
+ "Password:" {
+ incr pass_attempt
+ send "$passwd\r"
+ exp_continue
+ }
+
+ "Username: " {
+
+ set pattempt 0
+
+ send "$user\r"
+ expect {
+
+ "Password: " {
+
+ incr pattempt
+ if {$pattempt == 1} {
+ send "$userpswd\r";
+ } else {
+ send "$enapasswd\r";
+ }
+ exp_continue
+ }
+
+ -re ".*> " { exp_continue;}
+ }
+ }
+
+ "%TELNETD-W-BADPASSWD" {
+ puts "ERROR: bad userid or password to telnet."
+ return 1
+ }
+ "%CONS-W-AUTH_PASSWD" {
+ exp_continue
+ }
+
+ "% Authentication failed." {
+ puts "ERROR: bad userid or password to telnet."
+ return 1
+ }
+
+
+ "Authentication Failed:" {
+ puts "ERROR: bad userid or password to radius/tacacs+"
+ return 1
+ }
+
+ "Connection closed *" {
+ if {$pass_attempt == 3} {
+ puts "ERROR: Maximum attempts for password reached. Check password. Exiting.";
+ puts $expect_out(0,string);
+ return 1
+ }
+ }
+
+ timeout {
+ puts "ERROR: Timeout on login. Exiting.";
+ return 1
+ }
+
+ eof {
+ puts "ERROR: device closed telnet connection during login"
+ return 1
+ }
+ }
+
+ # save my_prompt for later use
+ send "\r"
+ expect -re ".*> "
+ set abc "$expect_out(buffer)"
+ set my_prompt "[lindex $abc 0]"
+ regexp {(.*[^>])} $my_prompt my
+
+ return 0;
+}
+
+
+# pre: login completed ok
+# post: turn off paging of commands
+
+proc disable_cli_paging { } {
+ global my_prompt
+
+ send "cli set terminal rows 0\r"
+
+ expect {
+ "$my_prompt" {return 0 }
+ }
+ return 1
+}
+
+# pre: login returned 0, prompt at top level
+# post: turn off command completion return 0
+# on error, return 1
+
+proc disable_cmd_autocomplete { } {
+ global my_prompt
+
+ send "cli set command completion off\r"
+ expect {
+
+ $my_prompt { }
+
+ timeout {
+ puts "ERROR:disable_cmd_autocomplete(TIMEOUT)";
+ return 0;
+ }
+
+ }
+
+ return 0
+}
+
+# pre: login returned 0, do_enable returned 0, cli is in enable or config mode
+# post: issues logout cli to device, returns 0
+
+proc logout { prompt } {
+ global config_mode enable_prompt
+
+ # in case of not being at root cmd...
+ # verify top level prompt state, move to it if necessary
+
+ if { $config_mode == 1 } {
+
+ send "exit\r"
+
+ expect {
+ "Do you want*" {
+ send "no\r"
+ }
+
+ "$enable_prompt" { }
+
+ timeout { puts "ERROR: logout: timeout from config mode\n" }
+ eof { puts "ERROR: device dropped connection\n" }
+ }
+ set config_mode 0
+ }
+
+ send "logout\r"
+ expect {
+
+ "Are you sure*" {
+ send "yes\r"
+ return 0
+ }
+ }
+}
+
+# pre: current mode allows transition to enable mode
+# post: enable mode entered, my_prompt updated, return 0 else 1
+
+proc do_enable { enauser enapasswd userpswd } {
+ global expect_out verbose
+ global my_prompt enable_prompt
+ set enable_prompt [ string trimright $my_prompt ">" ]
+ set enable_prompt $enable_prompt\#
+
+ if { $verbose == 1 } {
+ puts "DEBUG: do_enable: my_prompt = $my_prompt ena_prompt = $enable_prompt"
+ }
+
+ send "enable\r"
+
+ expect {
+ Username: { send "$enauser\r"; exp_continue }
+ Password: { send "$userpswd\r"; exp_continue }
+
+ "$my_prompt" {
+ puts "ERROR: do_enable failed to gain enable mode."
+ return 1
+ }
+
+ "CONS-W-AUTH_PASSWD" { send "$enapasswd\r"; }
+
+ "$enable_prompt " { }
+ "%SYS-W-NOPASSWD*" { }
+
+ "Authentication Failed: Access Denied" {
+ puts "ERROR: Bad user or password for enable mode."
+ return 1
+ }
+ }
+
+ set my_prompt $enable_prompt
+ return 0
+}
+
+# pre: current mode allows transition to enable mode
+# post: enable mode entered, my_prompt updated, return 0 else 1
+
+proc do_configure { } {
+ global expect_out verbose config_mode
+ global my_prompt
+ set config_prompt [ string trimright $my_prompt "\#" ]
+ set config_prompt $config_prompt\(config\)\#
+
+ if { $verbose == 1 } {
+ puts "DEBUG: do_config: my_prompt = $my_prompt cfg_prompt = $config_prompt"
+ }
+
+ send "configure\r"
+ expect {
+ "$config_prompt " { }
+ "$my_prompt" {
+ }
+
+ eof { return 1}
+ timeout { return 1}
+ }
+
+ set config_mode 1
+ set my_prompt $config_prompt
+ return 0
+}
+
+# track sent/received from device to output_file
+# pre: outut_file is valid filename w/write access
+# post: logfile open, global var logging == 1, return 0 , else 1
+
+proc start_logfile { output_file } {
+ global logging
+
+ if { [ string length $output_file ] != 0 } {
+ set rc [ catch {
+ log_file -noappend $output_file
+ } errMsg ]
+
+ if { $rc != 0 } {
+ puts "ERROR: open file $output_file for write access failed. $errMsg\n"
+ return 1
+ }
+ set logging 1
+ }
+
+ return 0
+}
+
+proc run_commands { prompt cmdstring } {
+ global sendstring
+
+ set commands [split $cmdstring \;]
+ set num_commands [llength $cmdstring]
+
+ for {set i 0} {$i < $num_commands} { incr i} {
+ regsub -- {[ ]*([^\.]*)} [subst -nocommands [lindex $commands $i]] {\1} sendstring
+
+ if {[ run_single_command $prompt $sendstring ] == 1} {
+ puts "ERROR: command '$sendstring' not processed by device. Check previous error messages."
+ return 1
+ }
+ }
+ return 0
+}
+
+
+# Run commands given on the command line
+# pre: prompt is current system cli prompt, cmdstring is command to execute
+# post: return 0 on success else 1
+# NOTE: output from router ends up in output_file if specified
+# expect internal input buffer is reset to "" after each command
+
+proc run_single_command { prompt cmdstring } {
+ global verbose
+ set rc 0
+ set seen_prompt 0
+ set seen_timeout 0
+ set need_ays 0
+ set delay 0
+
+ if {$verbose == 1} {
+ puts "DEBUG: run_commands: prompt=$prompt \"$cmdstring\" "
+ }
+
+ # ays == "are you sure" - must send back yes
+ if { [string compare $cmdstring "save startup" ] == 0 } {
+ set need_ays 1
+ set delay 1
+ if {$verbose == 1} {
+ puts "DEBUG: save startup cmd seen, set need_ays = 1"
+ }
+ }
+
+ # TODO: add case for copy command to startup, also prompts for ok
+
+ # TODO: if we see config command: system set name note it
+ # if we see a save active, then update system prompts as well
+
+ send "$cmdstring\r"
+
+ if { $delay == 1} {
+ sleep 1
+ }
+
+ expect {
+
+ "%CLI-E-IVCMD*" {
+ puts "ERROR: run_commands(command rejected by device)\n"
+ set rc 1
+ }
+
+ "%CLI-E-FACUNKNWN*" {
+ puts "ERROR: run_commands(command rejected by device)\n"
+ set rc 1
+ }
+
+ "%SYS-I-ADDFAILED*" {
+ puts "ERROR: run_commands(command rejected by device)\n"
+ set rc 1
+ }
+ "%TFTP-E-REMOTE,*" {
+ puts "ERROR: run_commands(command rejected by device)\n"
+ set rc 1
+ }
+
+ "%SYS-E-PRIMARY_NO_SUCH_IMAGE*" {
+ puts "ERROR: run_commands(command rejected by device)\n"
+ set rc 1
+ }
+
+ "want to overwrite " {
+ send "yes\r"
+ if {$verbose == 1} {
+ puts "DEBUG: got overwrite question, set need_ays to 0"
+ }
+ set need_ays 0
+ }
+
+
+ "%CONFIG-E-DUPLICATE,*" {
+ }
+
+ "$prompt" {
+ if { $seen_prompt == 0 } {
+ set seen_prompt 1
+ }
+
+ if {$verbose == 1} {
+ puts "DEBUG: saw double prompt, exiting expect loop\n"
+ }
+
+ if { $need_ays == 1 } {
+ exp_continue
+ }
+ }
+
+ -re ".* More: m,<space> --- Quit: q --- One line: <return> ---" {
+ send "q"
+ exp_continue
+ }
+
+
+ timeout {
+ if {$verbose == 1} {
+ puts "DEBUG: timeout occured for the $seen_time time\n"
+ }
+
+ if { $seen_timeout == 0 } {
+ set seen_timeout 1
+ send "\r\r"
+ exp_continue
+ }
+
+ puts "ERROR:run_commands(TIMEOUT)"
+ set rc 1
+ }
+
+ eof {
+ puts "ERROR:run_commands(connection closed by device)\n"
+ set rc 1
+ }
+
+ "\n" { exp_continue }
+ }
+
+ # clear input buffer of any remaining data
+ expect "*"
+ return $rc
+}
+
+
+# pre: RSTONE_USER env var is set
+# post: update global "default_user" to this string
+
+proc init_userid { } {
+ global default_user
+
+ if {[ info exists env(RSTONE_USER) ] } {
+ set default_user $env(RSTONE_USER)
+ } else {
+ # This uses "id" which I think is portable. At least it has existed
+ # (without options) on all machines/OSes I've been on recently -
+ # unlike whoami or id -nu.
+ regexp {\(([^)]*)} [exec id] junk default_user
+ }
+}
+
+proc source_script_file { filename } {
+ global my_prompt
+
+ expect -re "$my_prompt" {}
+
+ source $filename
+
+}
+
+
+# pre: login completed ok, filename contains set of cli commands one per line
+# post: each command is extracted from filename and sent to device
+# return 0 on success, return 1 on error
+# NOTE: for scripts that begin with "configure", change the mode to configure
+# before executing the following commands
+
+proc process_script_file { filename } {
+
+ global my_prompt verbose
+ set rc 0
+ set ifile ""
+
+ set rc [ catch {
+ set ifile [ open $filename r]
+ } errMsg ]
+
+ if { $rc != 0 } {
+ puts "ERROR: process_script_file: open script file $filename for read access failed. $errMsg\n"
+ return 1
+ }
+
+ set line_cnt 0
+
+ while { [eof $ifile] != 1 } {
+
+ set bytes [ gets $ifile cmd ]
+ incr line_cnt
+
+ if { $bytes < 0 } {
+ break
+ } elseif { $bytes == 0 } {
+ continue
+ }
+
+ if { $verbose == 1 } {
+ puts "DEBUG: line:$line_cnt cmd = $cmd\n"
+ }
+
+ # skip comments in script files
+ if { [regexp "^\#" $cmd] != 1 } {
+
+ # puts "$cmd rc = [string compare $cmd "configure" ]\n"
+
+ if { [string compare $cmd "configure" ] == 0 } {
+
+ do_configure
+
+ } else {
+ if {[ run_commands $my_prompt $cmd ] == 1} {
+ puts "ERROR: line $line_cnt in $filename not processed by device. Check previous error msgs."
+ set rc 1
+ break
+ }
+ }
+ }
+ }
+
+ close $ifile
+ return $rc
+}
+
+
+
+# pre: filename is valid file
+# post: remove extended ascii sequences and other cruft
+# and prepend a header: rscmd: ip-addr : date
+# TODO: should watch all file commands more closely
+
+proc strip_log { filename router } {
+
+ global tempfile
+
+ set rc [ catch {
+ set ifile [ open $filename r]
+ } errMsg ]
+
+ if { $rc != 0 } {
+ puts "ERROR: strip_log: open script file $filename for read access failed. $errMsg\n"
+ return 1
+ }
+ set rc [ catch {
+ set ofile [ open $tempfile w]
+ } errMsg ]
+
+ if { $rc != 0 } {
+ puts "ERROR: strip_log: open temp file $tempfile for write access failed. $errMsg\n"
+ return 1
+ }
+
+ set nl 0
+
+ puts $ofile "rscmd: $router : [exec date]"
+
+ while { [eof $ifile] != 1 } {
+
+ set bytes [ gets $ifile cmd ]
+ if { $bytes <= 0 } {
+ break
+ }
+ incr nl
+ if { $nl <= 2 } {
+ continue
+ }
+
+ regsub -all -- "\r" $cmd "" newcmd
+ puts $ofile $newcmd
+ }
+
+ close $ifile
+ close $ofile
+ set rc 0
+ file copy -force $tempfile $filename
+ file delete $tempfile
+ return $rc
+}
+
+#
+# main section
+#
+
+
+if { $verbose == 1 } {
+ puts "\n\nrscmd: Version 1.1 started on [exec date]"
+ puts "[exec uname -a]"
+ puts "Expect Version: [exp_version]\n"
+}
+
+# send input like in a fast and consistent human style
+set send_human {.1 .3 1 .05 2}
+
+# initialize default_user variable
+init_userid
+
+# Parse Command Line
+
+for {set idx 0} {$idx < $argc} {incr idx} {
+
+ set arg [lindex $argv $idx]
+
+ switch -glob -- $arg {
+
+ -c* -
+ -C* {
+ if {! [ regexp .\[cC\](.+) $arg ignore command]} {
+ incr idx
+ set command [ lindex $argv $idx ]
+ }
+ set do_command 1
+ # Environment variable to pass to -s scripts
+ } -E*
+ {
+ if {[ regexp .\[E\](.+)=(.+) $arg ignore varname varvalue]} {
+ set E$varname $varvalue
+ } else {
+ send_user "Error: invalid format for -E in $arg\n"
+ exit 1
+ }
+ # Expect script to run
+ } -s* -
+ -S* {
+ if {! [ regexp .\[sS\](.+) $arg ignore sfile]} {
+ incr idx
+ set sfile [ lindex $argv $idx ]
+ }
+
+ if { ! [ file exists $sfile ] } {
+ puts "ERROR: invalid argument script file \"$sfile\" does not exist.\n"
+ exit 1
+ }
+ if { ! [ file readable $sfile ] } {
+ puts "ERROR: invalid argument script file \"$sfile\" permissions disallow read access.\n"
+ exit 1
+ }
+
+ set do_script 1
+ # Command file
+ } -x* -
+ -X {
+ if {! [ regexp .\[xX\](.+) $arg ignore cmd_file]} {
+ incr idx
+ set cmd_file [ lindex $argv $idx ]
+ }
+ if [ catch {set cmd_fd [open $cmd_file r]} reason ] {
+ send_user "\nError: $reason\n"
+ exit 1
+ }
+ set cmd_text [read $cmd_fd]
+ close $cmd_fd
+ set command [join [split $cmd_text \n] \;]
+ set do_command 1
+ } -f* -
+ -F* {
+ if {! [ regexp .\[fF\](.+) $arg ignore password_file]} {
+ incr idx
+ set password_file [ lindex $argv $idx ]
+ }
+
+ } -o* -
+ -O* {
+ if {! [ regexp .\[fF\](.+) $arg ignore password_file]} {
+ incr idx
+ set output_file [ lindex $argv $idx ]
+ if { $verbose == 1 } {
+ puts "DEBUG: output file: $output_file"
+ }
+ }
+
+ } -t* -
+ -T* {
+ incr idx
+ set timeout [ lindex $argv $idx ]
+
+ } -noenable {
+ set enable 0
+ } -* {
+ puts "ERROR:unkown argument passed: $arg\n"
+ puts $usage
+ exit 1
+
+ } default {
+ break
+ }
+ }
+}
+
+# Verify at least one router is specified
+#
+if { $idx == $argc } {
+ puts "\n$usage"
+ exit 1
+}
+
+# main loop
+
+foreach router [lrange $argv $idx end] {
+set router [string tolower $router]
+
+# Figure out passwords
+if {$verbose == 1} {
+ puts "DEBUG: do_passwd = $do_passwd\n"
+ puts "DEBUG: do_enablepasswd = $do_enapasswd\n"
+}
+
+if { $do_passwd || $do_enapasswd } {
+ set pswd [find password $router]
+ if { [llength $pswd] == 0 } {
+ puts "ERROR: - no password for $router in $password_file.\n"
+ exit 1
+ }
+ if { $do_enapasswd && [llength $pswd] < 2 } {
+ puts "ERROR: no enable password found for $router in $password_file."
+ exit 1
+ }
+
+ set passwd [join [lindex $pswd 0] ""]
+ set enapasswd [join [lindex $pswd 1] ""]
+}
+
+
+# Figure out user to login with if necessary
+
+if {[info exists username]} {
+ # command line username
+ set user $username
+} else {
+ set user [join [find user $router] ""]
+ if { "$user" == "" } { set user $default_user }
+}
+
+# Figure out username's password
+
+if {[info exists userpasswd]} {
+ # command line username
+ set userpswd $userpasswd
+} else {
+ set userpswd [join [find userpassword $router] ""]
+ if { "$userpswd" == "" } { set userpswd $passwd }
+}
+
+# Figure out enable username
+
+if {[info exists enausername]} {
+ # command line enausername
+ set enauser $enausername
+} else {
+ set enauser [join [find enauser $router] ""]
+ if { "$enauser" == "" } { set enauser $user }
+}
+
+# Login to the router, set my_prompt to router's cmd prompt
+
+if {[login $router $user $userpswd $passwd $enapasswd ]} {
+ if { $verbose == 1 } {
+ puts "DEBUG: login to $router failed\n"
+ }
+ exit 1
+}
+
+if {$verbose == 1 } {
+ puts "DEBUG: login completed ok\n"
+}
+
+if { $enable == 1 } {
+
+ if { [do_enable $enauser $enapasswd $userpswd] == 1} {
+ if { $verbose == 1 } {
+ puts "DEBUG: switch to enable mode on $router failed\n"
+ }
+ exit 1
+ }
+}
+
+# run in one of three modes
+
+if { $do_command } {
+
+ disable_cmd_autocomplete
+ disable_cli_paging
+
+ if {[ start_logfile $output_file] != 0 } {
+ exit 1
+ }
+
+ if {[ run_commands $my_prompt $command ]} {
+
+ log_file
+ exit 1
+
+ } else {
+
+ logout $my_prompt
+
+ }
+
+} elseif { $do_script } {
+
+ disable_cmd_autocomplete
+ disable_cli_paging
+
+ if {[ start_logfile $output_file] != 0 } {
+ exit 1
+ }
+
+ #if { [process_script_file $sfile] == 1} {
+# puts "DEBUG: logfile $output_file closed on error\n"
+# logout $my_prompt
+# exit 1
+# }
+
+ source_script_file $sfile
+
+ logout $my_prompt
+
+} else {
+
+ label $router
+ log_user 1
+
+ if {[ start_logfile $output_file] != 0 } {
+ exit 1
+ }
+ interact
+ log_file
+}
+
+if { $verbose == 1 } {
+ puts "DEBUG: exiting normally.\n"
+}
+
+if { $logging == 1} {
+ log_file
+ strip_log $output_file $router
+}
+}
+
+# puts "\n"
+exit 0
diff --git a/bin/rivrancid.in b/bin/rivrancid.in
new file mode 100644
index 0000000..8b9ae03
--- /dev/null
+++ b/bin/rivrancid.in
@@ -0,0 +1,344 @@
+#! @PERLV_PATH@
+##
+## $Id: rivrancid.in,v 1.9 2004/01/11 03:49:13 heas Exp $
+##
+## Copyright (C) 1997-2004 by Terrapin Communications, Inc.
+## All rights reserved.
+##
+## This software may be freely copied, modified and redistributed
+## without fee for non-commerical purposes provided that this license
+## remains intact and unmodified with any RANCID distribution.
+##
+## There is no warranty or other guarantee of fitness of this software.
+## It is provided solely "as is". The author(s) disclaim(s) all
+## responsibility and liability with respect to this software's usage
+## or its effect upon hardware, computer systems, other software, or
+## anything else.
+##
+## Except where noted otherwise, rancid was written by and is maintained by
+## Henry Kilmer, John Heasley, Andrew Partan, Pete Whiting, and Austin Schutz.
+##
+#
+# Amazingly hacked version of Hank's rancid - this one tries to
+# deal with Cabletron, Riverstone and Enterasys routers/switches
+#
+# 10/23/2002 -- Initial changes for Riverstone/Cabletron support
+# Jim Meehan -- jmeehan@vpizza.org
+#
+# RANCID - Really Awesome New Cisco confIg Differ
+#
+# usage: rivrancid [-d] [-l] [-f filename | $host]
+#
+use Getopt::Std;
+getopts('dfl');
+$log = $opt_l;
+$debug = $opt_d;
+$file = $opt_f;
+$host = $ARGV[0];
+$clean_run = 0;
+$found_end = 0;
+$timeo = 90; # flogin timeout in seconds
+
+my(%filter_pwds); # password filtering mode
+
+# This routine is used to print out the router configuration
+sub ProcessHistory {
+ my($new_hist_tag,$new_command,$command_string,@string)=(@_);
+ if((($new_hist_tag ne $hist_tag) || ($new_command ne $command))
+ && defined %history) {
+ print eval "$command \%history";
+ undef %history;
+ }
+ if (($new_hist_tag) && ($new_command) && ($command_string)) {
+ if ($history{$command_string}) {
+ $history{$command_string} = "$history{$command_string}@string";
+ } else {
+ $history{$command_string} = "@string";
+ }
+ } elsif (($new_hist_tag) && ($new_command)) {
+ $history{++$#history} = "@string";
+ } else {
+ print "@string";
+ }
+ $hist_tag = $new_hist_tag;
+ $command = $new_command;
+ 1;
+}
+
+sub numerically { $a <=> $b; }
+
+# This is a sort routing that will sort numerically on the
+# keys of a hash as if it were a normal array.
+sub keynsort {
+ local(%lines)=@_;
+ local($i) = 0;
+ local(@sorted_lines);
+ foreach $key (sort numerically keys(%lines)) {
+ $sorted_lines[$i] = $lines{$key};
+ $i++;
+ }
+ @sorted_lines;
+}
+
+# This is a sort routing that will sort on the
+# keys of a hash as if it were a normal array.
+sub keysort {
+ local(%lines)=@_;
+ local($i) = 0;
+ local(@sorted_lines);
+ foreach $key (sort keys(%lines)) {
+ $sorted_lines[$i] = $lines{$key};
+ $i++;
+ }
+ @sorted_lines;
+}
+
+# This is a sort routing that will sort on the
+# values of a hash as if it were a normal array.
+sub valsort{
+ local(%lines)=@_;
+ local($i) = 0;
+ local(@sorted_lines);
+ foreach $key (sort values %lines) {
+ $sorted_lines[$i] = $key;
+ $i++;
+ }
+ @sorted_lines;
+}
+
+# This is a numerical sort routing (ascending).
+sub numsort {
+ local(%lines)=@_;
+ local($i) = 0;
+ local(@sorted_lines);
+ foreach $num (sort {$a <=> $b} keys %lines) {
+ $sorted_lines[$i] = $lines{$num};
+ $i++;
+ }
+ @sorted_lines;
+}
+
+# This is a sort routine that will sort on the
+# ip address when the ip address is anywhere in
+# the strings.
+sub ipsort {
+ local(%lines)=@_;
+ local($i) = 0;
+ local(@sorted_lines);
+ foreach $addr (sort sortbyipaddr keys %lines) {
+ $sorted_lines[$i] = $lines{$addr};
+ $i++;
+ }
+ @sorted_lines;
+}
+
+# These two routines will sort based upon IP addresses
+sub ipaddrval {
+ my(@a) = ($_[0] =~ m#^(\d+)\.(\d+)\.(\d+)\.(\d+)$#);
+ $a[3]+256*($a[2]+256*($a[1]+256*$a[0]));
+}
+sub sortbyipaddr {
+ &ipaddrval($a) <=> &ipaddrval($b);
+}
+
+# This routine parses "system show version"
+sub ShowVersion {
+ my($slot);
+
+ print STDERR " In ShowVersion: $_" if ($debug);
+
+ while (<INPUT>) {
+ tr/\015//d;
+ next if /^\s*$/;
+ last if(/^$prompt/);
+
+ ProcessHistory("VERSION","","","!SW: $_");
+ }
+ ProcessHistory("VERSION","","","!\n");
+ return(0);
+}
+
+# This routine parses "system show hardware"
+sub ShowHardware {
+ print STDERR " In ShowHardware: $_" if ($debug);
+
+ while (<INPUT>) {
+ tr/\015//d;
+ last if (/^$prompt/);
+ ProcessHistory("HARDWARE","","","!HW: $_");
+ }
+ ProcessHistory("","","","!\n");
+ return(0);
+}
+
+# This routine parses "system show uptime"
+sub ShowUptime {
+ print STDERR " In ShowUptime: $_" if ($debug);
+
+ while (<INPUT>) {
+ tr/\015//d;
+ last if(/^$prompt/);
+ next if /^\s*$/;
+ next if /System up/;
+ ProcessHistory("UPTIME","","","!UPTIME: $_");
+ }
+ ProcessHistory("","","","!\n");
+ return;
+}
+
+# This routine processes a "system show active"
+sub ShowActive {
+ print STDERR " In ShowActive: $_" if ($debug);
+
+ while (<INPUT>) {
+ tr/\015//d;
+
+ # Remove leading whitespace and/or line numbers
+ s/^\s*(\d+\D: )*//;
+
+ # Riverstone/Cabletron doesn't have an "end" line, so
+ # we need to set $clean_run here
+ if (/^$prompt/) {
+ $clean_run = 1;
+ last;
+ }
+
+ next if (/Running system configuration/);
+
+ # filter out any RCS/CVS tags to avoid confusing local CVS storage
+ s/\$(Revision|Id):/ $1:/;
+
+ if (/^(.*hashed-password \S+)/ && $filter_pwds == 2) {
+ ProcessHistory("","","","! $1 <removed>\n");
+ next;
+ }
+
+ if (/^(snmp set community )\S+/ && defined($ENV{'NOCOMMSTR'})) {
+ ProcessHistory("","","","! $1<removed>$'");
+ next;
+ }
+
+ ProcessHistory("","","","$_");
+ }
+ return;
+}
+
+# dummy function
+sub DoNothing {print STDOUT;}
+
+# Main
+%commands=(
+ 'system show uptime' => "ShowUptime",
+ 'system show version' => "ShowVersion",
+ 'system show hardware' => "ShowHardware",
+ 'system show active-config' => "ShowActive"
+);
+
+# keys() doesnt return things in the order entered and the order of the
+# cmds is important. pita
+
+@commands=(
+ "system show uptime",
+ "system show version",
+ "system show hardware",
+ "system show active-config"
+);
+
+$cisco_cmds=join(";",@commands);
+$cmds_regexp=join("|",@commands);
+
+open(OUTPUT,">$host.new") || die "Can't open $host.new for writing: $!\n";
+select(OUTPUT);
+# make OUTPUT unbuffered if debugging
+if ($debug) { $| = 1; }
+
+if ($file) {
+ print STDERR "opening file $host\n" if ($debug);
+ print STDOUT "opening file $host\n" if ($log);
+ open(INPUT,"<$host") || die "open failed for $host: $!\n";
+} else {
+ print STDERR "executing rivlogin -t $timeo -c\"$cisco_cmds\" $host\n" if ($debug);
+ print STDOUT "executing rivlogin -t $timeo -c\"$cisco_cmds\" $host\n" if ($log);
+ if (defined($ENV{NOPIPE})) {
+ system "rivlogin -t $timeo -c \"$cisco_cmds\" $host </dev/null > $host.raw 2>&1" || die "rivlogin failed for $host: $!\n";
+ open(INPUT, "< $host.raw") || die "rivlogin failed for $host: $!\n";
+ } else {
+ open(INPUT,"rivlogin -t $timeo -c \"$cisco_cmds\" $host </dev/null |") || die "rivlogin failed for $host: $!\n";
+ }
+}
+
+# determine password filtering mode
+if ($ENV{"FILTER_PWDS"} =~ /no/i) {
+ $filter_pwds = 0;
+} elsif ($ENV{"FILTER_PWDS"} =~ /all/i) {
+ $filter_pwds = 2;
+} else {
+ $filter_pwds = 1;
+}
+
+ProcessHistory("","","","!RANCID-CONTENT-TYPE: riverstone\n!\n");
+TOP: while(<INPUT>) {
+ tr/\015//d;
+ last if ($clean_run);
+ if (/^Error:/) {
+ print STDOUT ("$host rivlogin error: $_");
+ print STDERR ("$host rivlogin error: $_") if ($debug);
+ $clean_run=0;
+ last;
+ }
+
+ $kradcount++;
+
+ while (/\033(\[\?25l)/) {
+ s/\033\[\?25l//g;
+ #print STDERR "krad $1\n";
+ #print STDERR $_;
+ #print STDERR $kradcount;
+ next;
+ }
+
+
+ while (/#\s*($cmds_regexp)\s*$/) {
+ $cmd = $1;
+ if (!defined($prompt)) {
+ $prompt = ($_ =~ /^([^#]+#)/)[0];
+ $prompt =~ s/([}{)(\\])/\\$1/g;
+ }
+ print STDERR ("HIT COMMAND:$_") if ($debug);
+ if (! defined($commands{$cmd})) {
+ print STDERR "$host: found unexpected command - \"$cmd\"\n";
+ $clean_run = 0;
+ last TOP;
+ }
+ $rval = &{$commands{$cmd}};
+ delete($commands{$cmd});
+ if ($rval == -1) {
+ $clean_run = 0;
+ last TOP;
+ }
+ }
+}
+print STDOUT "Done $logincmd: $_\n" if ($log);
+# Flush History
+ProcessHistory("","","","");
+# Cleanup
+close(INPUT);
+close(OUTPUT);
+
+if (defined($ENV{NOPIPE})) {
+ unlink("$host.raw") if (! $debug);
+}
+
+# check for completeness
+if (scalar(%commands) || !$clean_run) {
+ if (scalar(%commands)) {
+ printf(STDOUT "$host: missed cmd(s): %s\n", join(',', keys(%commands)));
+ printf(STDERR "$host: missed cmd(s): %s\n", join(',', keys(%commands))) if ($debug);
+ }
+ if (!$clean_run) {
+ print STDOUT "$host: End of run not found\n";
+ print STDERR "$host: End of run not found\n" if ($debug);
+ system("/usr/bin/tail -1 $host.new");
+ }
+ unlink "$host.new" if (! $debug);
+}
diff --git a/bin/rrancid.in b/bin/rrancid.in
index f242ec4..7674452 100755..100644
--- a/bin/rrancid.in
+++ b/bin/rrancid.in
@@ -1,28 +1,32 @@
-#!@PERLV_PATH@
+#! @PERLV_PATH@
##
-## hacked version of Hank's rancid - this one tries to deal with redbacks.
+## $Id: rrancid.in,v 1.18 2004/01/11 03:49:13 heas Exp $
##
-## Copyright (C) 1997-2001 by Henry Kilmer.
+## Copyright (C) 1997-2004 by Terrapin Communications, Inc.
## All rights reserved.
##
-## This software may be freely copied, modified and redistributed without
-## fee for non-commerical purposes provided that this copyright notice is
-## preserved intact on all copies and modified copies.
+## This software may be freely copied, modified and redistributed
+## without fee for non-commerical purposes provided that this license
+## remains intact and unmodified with any RANCID distribution.
##
## There is no warranty or other guarantee of fitness of this software.
-## It is provided solely "as is". The author(s) disclaim(s) all
+## It is provided solely "as is". The author(s) disclaim(s) all
## responsibility and liability with respect to this software's usage
## or its effect upon hardware, computer systems, other software, or
## anything else.
##
+## Except where noted otherwise, rancid was written by and is maintained by
+## Henry Kilmer, John Heasley, Andrew Partan, Pete Whiting, and Austin Schutz.
##
#
+# hacked version of Hank's rancid - this one tries to deal with redbacks.
+#
# RANCID - Really Awesome New Cisco confIg Differ
#
# usage: rancid [-d] [-l] [-f filename | $host]
#
use Getopt::Std;
-getopts('dflm');
+getopts('dfl');
$log = $opt_l;
$debug = $opt_d;
$file = $opt_f;
@@ -353,7 +357,8 @@ while(<INPUT>) {
$cmd = $1;
if (!defined($prompt)) {
$prompt = ($_ =~ /^([^#]*#)/)[0];
- $prompt =~ s/([][])/\\$1/g; # quote the damn []'s
+ $prompt =~ s/([][}{)(\\])/\\$1/g; # quote the damn []'s
+ print STDERR ("PROMPT MATCH: $prompt\n") if ($debug);
}
print STDERR ("HIT COMMAND:$_") if ($debug);
if (! defined($commands{$cmd})) {
diff --git a/bin/tntlogin.in b/bin/tntlogin.in
new file mode 100644
index 0000000..021f0d2
--- /dev/null
+++ b/bin/tntlogin.in
@@ -0,0 +1,528 @@
+#! @EXPECT_PATH@ --
+##
+## $Id: tntlogin.in,v 1.11 2004/01/11 05:39:15 heas Exp $
+##
+## Copyright (C) 1997-2004 by Terrapin Communications, Inc.
+## All rights reserved.
+##
+## This software may be freely copied, modified and redistributed
+## without fee for non-commerical purposes provided that this license
+## remains intact and unmodified with any RANCID distribution.
+##
+## There is no warranty or other guarantee of fitness of this software.
+## It is provided solely "as is". The author(s) disclaim(s) all
+## responsibility and liability with respect to this software's usage
+## or its effect upon hardware, computer systems, other software, or
+## anything else.
+##
+## Except where noted otherwise, rancid was written by and is maintained by
+## Henry Kilmer, John Heasley, Andrew Partan, Pete Whiting, and Austin Schutz.
+##
+#
+# The login expect scripts were based on Erik Sherk's gwtn, by permission.
+#
+# Modified by P B Matthews.
+
+# Usage line
+set usage "Usage: $argv0 \[-c command\] \
+\[-Evar=x\] \[-f cloginrc-file\] \
+\[-s script-file\] \[-t timeout\] \[-u username\] \
+\[-v vty-password\] \[-x command-file\] \
+\[-y ssh_cypher_type\] router \[router...\]\n"
+
+# env(CLOGIN) may contain:
+# x == do not set xterm banner or name
+
+# Password file
+set password_file $env(HOME)/.cloginrc
+# Default is to login to the router
+set do_command 0
+set do_script 0
+# The default is to automatically enable
+set enable 0
+# The default is that you login non-enabled (tacacs can have you login already
+# enabled)
+set avautoenable 1
+# The default is to look in the password file to find the passwords. This
+# tracks if we receive them on the command line.
+set do_passwd 1
+
+# Find the user in the ENV, or use the unix userid.
+if {[ info exists env(CISCO_USER) ] } {
+ set default_user $env(CISCO_USER)
+} elseif {[ info exists env(USER) ]} {
+ set default_user $env(USER)
+} elseif {[ info exists env(LOGNAME) ]} {
+ set default_user $env(LOGNAME)
+} else {
+ # This uses "id" which I think is portable. At least it has existed
+ # (without options) on all machines/OSes I've been on recently -
+ # unlike whoami or id -nu.
+ if [ catch {exec id} reason ] {
+ send_error "\nError: could not exec id: $reason\n"
+ exit 1
+ }
+ regexp {\(([^)]*)} "$reason" junk default_user
+}
+
+# Sometimes routers take awhile to answer (the default is 10 sec)
+set timeout 45
+
+# Process the command line
+for {set i 0} {$i < $argc} {incr i} {
+ set arg [lindex $argv $i]
+
+ switch -glob -- $arg {
+ # Username
+ -u* -
+ -U* {
+ if {! [ regexp .\[uU\](.+) $arg ignore user]} {
+ incr i
+ set username [ lindex $argv $i ]
+ }
+ # VTY Password
+ } -v* -
+ -v* {
+ if {! [ regexp .\[vV\](.+) $arg ignore passwd]} {
+ incr i
+ set passwd [ lindex $argv $i ]
+ }
+ set do_passwd 0
+ # Enable Username
+ } -w* -
+ -W* {
+ # ignore -w
+ # Environment variable to pass to -s scripts
+ } -E*
+ {
+ if {[ regexp .\[E\](.+)=(.+) $arg ignore varname varvalue]} {
+ incr i
+ set E$varname $varvalue
+ } else {
+ send_user "\nError: invalid format for -E in $arg\n"
+ exit 1
+ }
+ # Enable Password
+ } -e*
+ {
+ # ignore -e
+ # Command to run.
+ } -c* -
+ -C* {
+ if {! [ regexp .\[cC\](.+) $arg ignore command]} {
+ incr i
+ set command [ lindex $argv $i ]
+ }
+ set do_command 1
+ # Expect script to run.
+ } -s* -
+ -S* {
+ if {! [ regexp .\[sS\](.+) $arg ignore sfile]} {
+ incr i
+ set sfile [ lindex $argv $i ]
+ }
+ if { ! [ file readable $sfile ] } {
+ send_user "\nError: Can't read $sfile\n"
+ exit 1
+ }
+ set do_script 1
+ # 'ssh -c' cypher type
+ } -y* -
+ -Y* {
+ if {! [ regexp .\[eE\](.+) $arg ignore cypher]} {
+ incr i
+ set cypher [ lindex $argv $i ]
+ }
+ # alternate cloginrc file
+ } -f* -
+ -F* {
+ if {! [ regexp .\[fF\](.+) $arg ignore password_file]} {
+ incr i
+ set password_file [ lindex $argv $i ]
+ }
+ # Timeout
+ } -t* -
+ -T* {
+ if {! [ regexp .\[tT\](.+) $arg ignore timeout]} {
+ incr i
+ set timeout [ lindex $argv $i ]
+ }
+ # Command file
+ } -x* -
+ -X {
+ if {! [ regexp .\[xX\](.+) $arg ignore cmd_file]} {
+ incr i
+ set cmd_file [ lindex $argv $i ]
+ }
+ if [ catch {set cmd_fd [open $cmd_file r]} reason ] {
+ send_user "\nError: $reason\n"
+ exit 1
+ }
+ set cmd_text [read $cmd_fd]
+ close $cmd_fd
+ set command [join [split $cmd_text \n] \;]
+ set do_command 1
+ # Do we enable?
+ } -noenable {
+ # ignore -noenable
+ # Does tacacs automatically enable us?
+ } -autoenable {
+ # ignore -autoenable
+ } -* {
+ send_user "\nError: Unknown argument! $arg\n"
+ send_user $usage
+ exit 1
+ } default {
+ break
+ }
+ }
+}
+# Process routers...no routers listed is an error.
+if { $i == $argc } {
+ send_user "\nError: $usage"
+}
+
+# Only be quiet if we are running a script (it can log its output
+# on its own)
+if { $do_script } {
+ log_user 0
+} else {
+ log_user 1
+}
+
+#
+# Done configuration/variable setting. Now run with it...
+#
+
+# Sets Xterm title if interactive...if its an xterm and the user cares
+proc label { host } {
+ global env
+ # if CLOGIN has an 'x' in it, don't set the xterm name/banner
+ if [info exists env(CLOGIN)] {
+ if {[string first "x" $env(CLOGIN)] != -1} { return }
+ }
+ # take host from ENV(TERM)
+ if [info exists env(TERM)] {
+ if [regexp \^(xterm|vs) $env(TERM) ignore ] {
+ send_user "\033]1;[lindex [split $host "."] 0]\a"
+ send_user "\033]2;$host\a"
+ }
+ }
+}
+
+# This is a helper function to make the password file easier to
+# maintain. Using this the password file has the form:
+# add password sl* pete cow
+# add password at* steve
+# add password * hanky-pie
+proc add {var args} { global int_$var ; lappend int_$var $args}
+proc include {args} {
+ global env
+ regsub -all "(^{|}$)" $args {} args
+ if { [ regexp "^/" $args ignore ] == 0 } {
+ set args $env(HOME)/$args
+ }
+ source_password_file $args
+}
+
+proc find {var router} {
+ upvar int_$var list
+ if { [info exists list] } {
+ foreach line $list {
+ if { [string match [lindex $line 0] $router ] } {
+ return [lrange $line 1 end]
+ }
+ }
+ }
+ return {}
+}
+
+# Loads the password file. Note that as this file is tcl, and that
+# it is sourced, the user better know what to put in there, as it
+# could install more than just password info... I will assume however,
+# that a "bad guy" could just as easy put such code in the clogin
+# script, so I will leave .cloginrc as just an extention of that script
+proc source_password_file { password_file } {
+ global env
+ if { ! [file exists $password_file] } {
+ send_user "\nError: password file ($password_file) does not exist\n"
+ exit 1
+ }
+ file stat $password_file fileinfo
+ if { [expr ($fileinfo(mode) & 007)] != 0000 } {
+ send_user "\nError: $password_file must not be world readable/writable\n"
+ exit 1
+ }
+ if [ catch {source $password_file} reason ] {
+ send_user "\nError: $reason\n"
+ exit 1
+ }
+}
+
+# Log into the router.
+proc login { router user userpswd passwd prompt cmethod cyphertype } {
+ global spawn_id in_proc do_command do_script
+ global u_prompt p_prompt sshcmd
+ set in_proc 1
+ set uprompt_seen 0
+
+ # try each of the connection methods in $cmethod until one is successful
+ set progs [llength $cmethod]
+ foreach prog [lrange $cmethod 0 end] {
+ if [string match "telnet*" $prog] {
+ regexp {telnet(:([^[:space:]]+))*} $prog command suffix port
+ if {"$port" == ""} {
+ set retval [ catch {spawn telnet $router} reason ]
+ } else {
+ set retval [ catch {spawn telnet $router $port} reason ]
+ }
+ if { $retval } {
+ send_user "\nError: telnet failed: $reason\n"
+ exit 1
+ }
+ } elseif ![string compare $prog "ssh"] {
+ if [ catch {spawn $sshcmd -c $cyphertype -x -l $user $router} reason ] {
+ send_user "\nError: $sshcmd failed: $reason\n"
+ exit 1
+ }
+ } elseif ![string compare $prog "rsh"] {
+ if [ catch {spawn rsh -l $user $router} reason ] {
+ send_user "\nError: rsh failed: $reason\n"
+ exit 1
+ }
+ } else {
+ puts "\nError: unknown connection method: $prog"
+ return 1
+ }
+ incr progs -1
+ sleep 0.3
+
+ # This helps cleanup each expect clause.
+ expect_after {
+ timeout {
+ send_user "\nError: TIMEOUT reached\n"
+ catch {close}; wait
+ if { $in_proc} {
+ return 1
+ } else {
+ continue
+ }
+ } eof {
+ send_user "\nError: EOF received\n"
+ catch {close}; wait
+ if { $in_proc} {
+ return 1
+ } else {
+ continue
+ }
+ }
+ }
+
+ expect {
+ "Connection refused" {
+ close; wait
+ sleep 0.3
+ expect eof
+ send_user "\nError: Connection Refused\n"; wait; return 1
+ } eof { send_user "\nError: Couldn't login\n"; wait; return 1
+ } "Unknown host\r\n" {
+ expect eof
+ send_user "\nError: Unknown host\n"; wait; return 1
+ } "Host is unreachable" {
+ expect eof
+ send_user "\nError: Host Unreachable!\n"; wait; return 1
+ } "No address associated with name" {
+ expect eof
+ send_user "\nError: Unknown host\n"; wait; return 1
+ }
+ -re "(Host key not found |The authenticity of host .* be established).*\(yes\/no\)\?" {
+ send "yes\r"
+ send_user "\nHost $router added to the list of known hosts.\n"
+ exp_continue }
+ -re "HOST IDENTIFICATION HAS CHANGED.* \(yes\/no\)\?" {
+ send "no\r"
+ send_user "\nError: The host key for $router has changed. Update the SSH known_hosts file accordingly.\n"
+ return 1 }
+ -re "Offending key for .* \(yes\/no\)\?" {
+ send "no\r"
+ send_user "\nError: host key mismatch for $router. Update the SSH known_hosts file accordingly.\n"
+ return 1 }
+
+ -re "$u_prompt" {
+ send "$user\r"
+ set uprompt_seen 1
+ exp_continue
+ }
+ -re "$p_prompt" {
+ sleep 1
+ if {$uprompt_seen == 1} {
+ send "$userpswd\r"
+ } else {
+ send "$passwd\r"
+ }
+ exp_continue
+ }
+ -re "^Confirm seeing above note" {
+ send "y\r"
+ exp_continue
+ }
+ "Password incorrect" { send_user "\nError: Check your password for $router\n";
+ catch {close}; wait; return 1 }
+ -re "$prompt" { break; }
+ denied { send_user "\nError: Check your passwd for $router\n"
+ catch {close}; wait; return 1
+ }
+ "\r\n" { exp_continue; }
+ }
+ }
+ set in_proc 0
+ return 0
+}
+
+# Run commands given on the command line.
+proc run_commands { prompt command } {
+ global in_proc
+ set in_proc 1
+
+ send "lines 0\r"
+ expect -re $prompt {}
+ regsub -all "\[)(]" $prompt {\\&} reprompt
+
+ # Is this a multi-command?
+ if [ string match "*\;*" "$command" ] {
+ set commands [split $command \;]
+ set num_commands [llength $commands]
+ for {set i 0} {$i < $num_commands} { incr i} {
+ send "[subst -nocommands [lindex $commands $i]]\r"
+ expect {
+ -re "^\[^\n\r]*$reprompt" {}
+ -re "^\[^\n\r ]*>>.*$reprompt" { exp_continue }
+ -re "\[\n\r]+" { exp_continue }
+ }
+ }
+ } else {
+ send "[subst -nocommands $command]\r"
+ send "y\r"
+ expect {
+ -re "^\[^\n\r]*$reprompt" {}
+ -re "^\[^\n\r ]*>>.*$reprompt" { exp_continue }
+ -re "\[\n\r]+" { exp_continue }
+ }
+ }
+
+ send "quit\r"
+# expect {
+# -re "^WARNING: the current user has insufficient rights to view password fields. A configuration saved under this circumstance should not be used to restore profiles containing passwords. Save anyway? [y/n]"
+# {
+# send "y\r"
+ exp_continue
+ }
+ "\n" { exp_continue }
+ "\[^\n\r *]*Session terminated" { return 0 }
+ timeout { return 0 }
+ eof { return 0 }
+ }
+ set in_proc 0
+}
+
+#
+# For each router... (this is main loop)
+#
+source_password_file $password_file
+set in_proc 0
+foreach router [lrange $argv $i end] {
+ set router [string tolower $router]
+ send_user "$router\n"
+
+ # Figure out prompt.
+ set prompt "admin>"
+ # TNT only "enables" based on the password used at login time
+ set autoenable 1
+ set enable 0
+
+ # Figure out passwords
+ if { $do_passwd } {
+ set pswd [find password $router]
+ if { [llength $pswd] == 0 } {
+ send_user "\nError - no password for $router in $password_file.\n"
+ continue
+ }
+ set passwd [join [lindex $pswd 0] ""]
+ }
+
+ # Figure out username
+ if {[info exists username]} {
+ # command line username
+ set ruser $username
+ } else {
+ set ruser [join [find user $router] ""]
+ if { "$ruser" == "" } { set ruser $default_user }
+ }
+
+ # Figure out username's password (if different from the vty password)
+ if {[info exists userpasswd]} {
+ # command line username
+ set userpswd $userpasswd
+ } else {
+ set userpswd [join [find userpassword $router] ""]
+ if { "$userpswd" == "" } { set userpswd $passwd }
+ }
+
+ # Figure out prompts
+ set u_prompt [find userprompt $router]
+ if { "$u_prompt" == "" } {
+ set u_prompt "(User|Username|login| Login):"
+ } else {
+ set u_prompt [join [lindex $u_prompt 0] ""]
+ }
+
+ set p_prompt [find passprompt $router]
+ if { "$p_prompt" == "" } {
+ set p_prompt "\[Pp]assword:"
+ } else {
+ set p_prompt [join [lindex $p_prompt 0] ""]
+ }
+
+ # Figure out cypher type
+ if {[info exists cypher]} {
+ # command line cypher type
+ set cyphertype $cypher
+ } else {
+ set cyphertype [find cyphertype $router]
+ if { "$cyphertype" == "" } { set cyphertype "3des" }
+ }
+
+ # Figure out connection method
+ set cmethod [find method $router]
+ if { "$cmethod" == "" } { set cmethod {{telnet} {ssh}} }
+
+ # Figure out the SSH executable name
+ set sshcmd [find sshcmd $router]
+ if { "$sshcmd" == "" } { set sshcmd {ssh} }
+
+ # Login to the router
+ if {[login $router $ruser $userpswd $passwd $prompt $cmethod $cyphertype]} {
+ continue
+ }
+
+ if { $do_command } {
+ if {[run_commands $prompt $command]} {
+ continue
+ }
+ } elseif { $do_script } {
+# send "lines 0\r"
+ expect -re $prompt {}
+ source $sfile
+ send "y\r"
+ close
+ } else {
+ label $router
+ log_user 1
+ interact
+ }
+
+ # End of for each router
+ wait
+ sleep 0.3
+}
+exit 0
diff --git a/bin/tntrancid.in b/bin/tntrancid.in
new file mode 100644
index 0000000..88520fd
--- /dev/null
+++ b/bin/tntrancid.in
@@ -0,0 +1,292 @@
+#! @PERLV_PATH@
+##
+## $Id: tntrancid.in,v 1.8 2004/01/11 03:49:13 heas Exp $
+##
+## Copyright (C) 1997-2004 by Terrapin Communications, Inc.
+## All rights reserved.
+##
+## This software may be freely copied, modified and redistributed
+## without fee for non-commerical purposes provided that this license
+## remains intact and unmodified with any RANCID distribution.
+##
+## There is no warranty or other guarantee of fitness of this software.
+## It is provided solely "as is". The author(s) disclaim(s) all
+## responsibility and liability with respect to this software's usage
+## or its effect upon hardware, computer systems, other software, or
+## anything else.
+##
+## Except where noted otherwise, rancid was written by and is maintained by
+## Henry Kilmer, John Heasley, Andrew Partan, Pete Whiting, and Austin Schutz.
+##
+#
+# Modified by Paul B Matthews & Richard Vander Reyden.
+# I'm suprised it still works....
+#
+# RANCID - Really Awesome New Cisco confIg Differ
+#
+# usage: tntrancid [-d] [-l] [-f filename | $host]
+#
+use Getopt::Std;
+getopts('dfl');
+$log = $opt_l;
+$debug = $opt_d;
+$file = $opt_f;
+$host = $ARGV[0];
+$clean_run = 0;
+$found_end = 0;
+$timeo = 90; # tntlogin timeout in seconds
+$prompt = "admin> ";
+$always_y = "y"; # cause its a pain.
+
+my(%filter_pwds); # password filtering mode
+
+# This routine is used to print out the router configuration
+sub ProcessHistory {
+ my($new_hist_tag,$new_command,$command_string,@string)=(@_);
+ if((($new_hist_tag ne $hist_tag) || ($new_command ne $command))
+ && defined %history) {
+ print eval "$command \%history";
+ print eval "$always_y \%history";
+ undef %history;
+ }
+ if (($new_hist_tag) && ($new_command) && ($command_string)) {
+ if ($history{$command_string}) {
+ $history{$command_string} = "$history{$command_string}@string";
+ } else {
+ $history{$command_string} = "@string";
+ }
+ } elsif (($new_hist_tag) && ($new_command)) {
+ $history{++$#history} = "@string";
+ } else {
+ print "@string";
+ }
+ $hist_tag = $new_hist_tag;
+ $command = $new_command;
+ 1;
+}
+
+sub numerically { $a <=> $b; }
+
+# This is a sort routing that will sort numerically on the
+# keys of a hash as if it were a normal array.
+sub keynsort {
+ local(%lines)=@_;
+ local($i) = 0;
+ local(@sorted_lines);
+ foreach $key (sort numerically keys(%lines)) {
+ $sorted_lines[$i] = $lines{$key};
+ $i++;
+ }
+ @sorted_lines;
+}
+
+# This is a sort routing that will sort on the
+# keys of a hash as if it were a normal array.
+sub keysort {
+ local(%lines)=@_;
+ local($i) = 0;
+ local(@sorted_lines);
+ foreach $key (sort keys(%lines)) {
+ $sorted_lines[$i] = $lines{$key};
+ $i++;
+ }
+ @sorted_lines;
+}
+
+# This is a sort routing that will sort on the
+# values of a hash as if it were a normal array.
+sub valsort{
+ local(%lines)=@_;
+ local($i) = 0;
+ local(@sorted_lines);
+ foreach $key (sort values %lines) {
+ $sorted_lines[$i] = $key;
+ $i++;
+ }
+ @sorted_lines;
+}
+
+# This is a numerical sort routing (ascending).
+sub numsort {
+ local(%lines)=@_;
+ local($i) = 0;
+ local(@sorted_lines);
+ foreach $num (sort {$a <=> $b} keys %lines) {
+ $sorted_lines[$i] = $lines{$num};
+ $i++;
+ }
+ @sorted_lines;
+}
+
+# This is a sort routine that will sort on the
+# ip address when the ip address is anywhere in
+# the strings.
+sub ipsort {
+ local(%lines)=@_;
+ local($i) = 0;
+ local(@sorted_lines);
+ foreach $addr (sort sortbyipaddr keys %lines) {
+ $sorted_lines[$i] = $lines{$addr};
+ $i++;
+ }
+ @sorted_lines;
+}
+
+# These two routines will sort based upon IP addresses
+sub ipaddrval {
+ my(@a) = ($_[0] =~ m#^(\d+)\.(\d+)\.(\d+)\.(\d+)$#);
+ $a[3]+256*($a[2]+256*($a[1]+256*$a[0]));
+}
+sub sortbyipaddr {
+ &ipaddrval($a) <=> &ipaddrval($b);
+}
+
+
+# This routine processes a "save con"
+sub SaveConf {
+ print STDERR " In SaveConf: $_" if ($debug);
+ my($comment) = 1; # strip extra comments, esp to preserve chassis type
+
+ while (<INPUT>) {
+ tr/\015//d;
+ last if(/^$prompt/);
+# next if(/^\s*$/);
+
+### s/^\s*$/;/;
+
+# Leave software revision, but strip out saved date,
+# which causes rancid to think it changes each poll
+
+ if (/^; saved from /) {
+ ProcessHistory("","","","$_");
+ next;
+ }
+ /^; saved / && next;
+
+ # catch anything that wasnt match above.
+ ProcessHistory("","","","$_");
+ # end of config
+# if (/^# End of configuration file/i) {
+ if (/; profiles saved$/) {
+ printf STDERR " End SaveConf: $_" if ($debug);
+ $found_end = 1;
+ print STDOUT "$found_end = found_end within test\n";
+ return(1);
+ }
+ $found_end = 1;
+#### print STDOUT "$found_end = found_end at test\n";
+ }
+ $found_end = 1;
+ return(0);
+}
+$found_end = 1;
+print STDOUT "$found_end = found_end at end test\n";
+
+
+
+
+# dummy function
+sub DoNothing {print STDOUT;}
+
+# Main
+%commands=(
+ 'save con' => "SaveConf"
+);
+# keys() doesnt return things in the order entered and the order of the
+# cmds is important (show version first and write term last). pita
+@commands=(
+ "save con"
+);
+$tnt_cmds=join(";",@commands);
+$cmds_regexp=join("|",@commands);
+$tnt_cmds="save con";
+
+open(OUTPUT,">$host.new") || die "Can't open $host.new for writing: $!\n";
+select(OUTPUT);
+# make OUTPUT unbuffered if debugging
+if ($debug) { $| = 1; }
+
+if ($file) {
+ print STDERR "opening file $host\n" if ($debug);
+ print STDOUT "opening file $host\n" if ($log);
+ open(INPUT,"<$host") || die "open failed for $host: $!\n";
+} else {
+ print STDERR "executing tntlogin -t $timeo -c\"$tnt_cmds\" $host\n" if ($debug);
+ print STDOUT "executing tntlogin -t $timeo -c\"$tnt_cmds\" $host\n" if ($log);
+ if (defined($ENV{NOPIPE})) {
+ system "tntlogin -t $timeo -c \"$tnt_cmds\" $host </dev/null > $host.raw 2>&1" || die "tntlogin failed for $host: $!\n";
+ open(INPUT, "< $host.raw") || die "tntlogin failed for $host: $!\n";
+ } else {
+ open(INPUT,"tntlogin -t $timeo -c \"$tnt_cmds\" $host </dev/null |") || die "tntlogin failed for $host: $!\n";
+ }
+}
+
+# determine password filtering mode
+if ($ENV{"FILTER_PWDS"} =~ /no/i) {
+ $filter_pwds = 0;
+} elsif ($ENV{"FILTER_PWDS"} =~ /all/i) {
+ $filter_pwds = 2;
+} else {
+ $filter_pwds = 1;
+}
+
+ProcessHistory("","","","#RANCID-CONTENT-TYPE: tnt\n#\n");
+ProcessHistory("COMMENTS","keysort","X0",";\n");
+TOP: while(<INPUT>) {
+ tr/\015//d;
+
+ if (/^Error:/) {
+ print STDOUT ("$host tntlogin error: $_");
+ print STDERR ("$host tntlogin error: $_") if ($debug);
+ $clean_run=0;
+ last;
+ }
+ while (/$prompt\s*($cmds_regexp)\s*$/) {
+ $cmd = $1;
+ if (!defined($prompt)) {
+ $prompt = ($_ =~ /^([^#]+#)/)[0];
+ $prompt =~ s/([][}{)(\\])/\\$1/g;
+ $prompt =~ s/:(\d+ ?)#/:\\d+ ?#/;
+ print STDERR ("PROMPT MATCH: $prompt\n") if ($debug);
+ }
+ print STDERR ("HIT COMMAND:$_") if ($debug);
+ if (! defined($commands{$cmd})) {
+ print STDERR "$host: found unexpected command - \"$cmd\"\n";
+ $clean_run = 0;
+ last TOP;
+ }
+ $rval = &{$commands{$cmd}};
+ delete($commands{$cmd});
+ if ($rval == -1) {
+ printf STDERR "rval = -1\n" if ($debug);
+ $clean_run = 0;
+ last TOP;
+ }
+ }
+}
+print STDOUT "Done $logincmd: $_\n" if ($log);
+# Flush History
+ProcessHistory("","","","");
+# Cleanup
+$clean_run = 1;
+print STDOUT "$clean_run - clean\n";
+close(INPUT);
+close(OUTPUT);
+
+if (defined($ENV{NOPIPE})) {
+ unlink("$host.raw") if (! $debug);
+}
+
+# check for completeness
+if (scalar(%commands) || !$clean_run || !$found_end) {
+ if (scalar(%commands)) {
+ printf(STDOUT "$host: missed cmd(s): %s\n", join(',', keys(%commands)));
+ printf(STDERR "$host: missed cmd(s): %s\n", join(',', keys(%commands))) if ($debug);
+ }
+ if (!$clean_run || !$found_end) {
+ print STDOUT "$host: End of run not found\n";
+ print STDERR "$host: End of run not found\n" if ($debug);
+ system("/usr/bin/tail -1 $host.new");
+ }
+ unlink "$host.new" if (! $debug);
+}
diff --git a/bin/xrancid.in b/bin/xrancid.in
index 06ff30b..4aeb1d3 100755..100644
--- a/bin/xrancid.in
+++ b/bin/xrancid.in
@@ -1,19 +1,22 @@
-#!@PERLV_PATH@
+#! @PERLV_PATH@
##
+## $Id: xrancid.in,v 1.32 2004/01/11 03:49:13 heas Exp $
##
-## Copyright (C) 1997-2001 by Henry Kilmer.
+## Copyright (C) 1997-2004 by Terrapin Communications, Inc.
## All rights reserved.
##
-## This software may be freely copied, modified and redistributed without
-## fee for non-commerical purposes provided that this copyright notice is
-## preserved intact on all copies and modified copies.
+## This software may be freely copied, modified and redistributed
+## without fee for non-commerical purposes provided that this license
+## remains intact and unmodified with any RANCID distribution.
##
## There is no warranty or other guarantee of fitness of this software.
-## It is provided solely "as is". The author(s) disclaim(s) all
+## It is provided solely "as is". The author(s) disclaim(s) all
## responsibility and liability with respect to this software's usage
## or its effect upon hardware, computer systems, other software, or
## anything else.
##
+## Except where noted otherwise, rancid was written by and is maintained by
+## Henry Kilmer, John Heasley, Andrew Partan, Pete Whiting, and Austin Schutz.
##
#
# RANCID - Really Awesome New Cisco confIg Differ
@@ -21,7 +24,7 @@
# usage: rancid [-d] [-l] [-f filename | $host]
#
use Getopt::Std;
-getopts('dflm');
+getopts('dfl');
$log = $opt_l;
$debug = $opt_d;
$file = $opt_f;
@@ -272,10 +275,14 @@ sub WriteTerm {
tr/\015//d;
last if(/^$prompt/);
next if(/^\s*$/);
+ return(0) if(/^syntax error at token /i);
# the pager can not be disabled per-session on the PIX
s/^<-+ More -+>\s*//;
+ return(0) if ($found_end);
s/^\s*$/#/;
+ next if (/full detail configuration/i);
+
# filter extra comments and lead comments in config so we can preserve
# the chassis type at the top of muched o/p before the process history
# key changes.
@@ -291,7 +298,7 @@ sub WriteTerm {
# Dog gone Cool matches to process the rest of the config
# some chassis report their chassis type in show diag...oh, but
- # other noooo. grab it here, if available. so, nothing else
+ # others do not. grab it here, if available. so, nothing else
# can change the keysort key until this is grabbed. sigh.
/# (\S+) configuration generated/i &&
ProcessHistory("COMMENTS","keysort","A0","#Chassis type: $1\n") &&
@@ -301,11 +308,11 @@ sub WriteTerm {
/# software version/i && next;
if (/((create|configure) account \S+ \S+) / && $filter_pwds >= 2) {
- ProcessHistory("","","","# $1 <key removed>\n");
+ ProcessHistory("COMMENTS","keysort","H0","# $1 <key removed>\n");
next;
}
if (/configure ssh2 key/ && $filter_pwds >= 1) {
- ProcessHistory("","","","# $_# <key removed>\n");
+ ProcessHistory("COMMENTS","keysort","H0","# $_# <key removed>\n");
while (<INPUT>) {
if (/^(#|enable|conf|disable|unconf)/) {
tr/\015//d;
@@ -317,7 +324,7 @@ sub WriteTerm {
# filter out any RCS/CVS tags to avoid confusing local CVS storage
s/\$(Revision|Id):/ $1:/;
if (/^((config|configure) bgp (neighbor|peer-group) \S+ password encrypted)/i && $filter_pwds >= 1) {
- ProcessHistory("","","","# $1 <removed>\n");
+ ProcessHistory("COMMENTS","keysort","H0","# $1 <removed>\n");
next;
}
@@ -346,17 +353,17 @@ sub WriteTerm {
}
# order/prune tacacs/radius server statements
if (/^(configure radius (primary|secondary) (tacacs-server|radius-server) shared-secret encrypted)/ && $filter_pwds >= 1) {
- ProcessHistory("","","","# $1 <removed>\n");
+ ProcessHistory("COMMENTS","keysort","H0","# $1 <removed>\n");
next;
}
# catch anything that wasnt match above.
- ProcessHistory("","","","$_");
+ ProcessHistory("COMMENTS","keysort","H0","$_");
# end of config
if (/^# End of configuration file/i) {
printf STDERR " End WriteTerm: $_" if ($debug);
$found_end = 1;
- return(1);
+ return(0);
}
}
return(0);
@@ -367,12 +374,13 @@ sub DoNothing {print STDOUT;}
# Main
%commands=(
- 'show version' => "ShowVersion",
- 'show memory' => "ShowMemory",
- 'show diagnostics' => "ShowDiag",
- 'show switch' => "ShowSwitch",
- 'show slot' => "ShowSlot",
- 'show configuration' => "WriteTerm"
+ 'show version' => "ShowVersion",
+ 'show memory' => "ShowMemory",
+ 'show diagnostics' => "ShowDiag",
+ 'show switch' => "ShowSwitch",
+ 'show slot' => "ShowSlot",
+ 'show configuration detail' => "WriteTerm",
+ 'show configuration' => "WriteTerm"
);
# keys() doesnt return things in the order entered and the order of the
# cmds is important (show version first and write term last). pita
@@ -382,6 +390,7 @@ sub DoNothing {print STDOUT;}
"show diagnostics",
"show switch",
"show slot",
+ "show configuration detail",
"show configuration"
);
$cisco_cmds=join(";",@commands);
@@ -397,13 +406,13 @@ if ($file) {
print STDOUT "opening file $host\n" if ($log);
open(INPUT,"<$host") || die "open failed for $host: $!\n";
} else {
- print STDERR "executing clogin -t $timeo -autoenable -c\"$cisco_cmds\" $host\n" if ($debug);
- print STDOUT "executing clogin -t $timeo -autoenable -c\"$cisco_cmds\" $host\n" if ($log);
+ print STDERR "executing clogin -t $timeo -c \"$cisco_cmds\" $host\n" if ($debug);
+ print STDOUT "executing clogin -t $timeo -c \"$cisco_cmds\" $host\n" if ($log);
if (defined($ENV{NOPIPE})) {
- system "clogin -t $timeo -autoenable -c \"$cisco_cmds\" $host </dev/null > $host.raw 2>&1" || die "clogin failed for $host: $!\n";
+ system "clogin -t $timeo -c \"$cisco_cmds\" $host </dev/null > $host.raw 2>&1" || die "clogin failed for $host: $!\n";
open(INPUT, "< $host.raw") || die "clogin failed for $host: $!\n";
} else {
- open(INPUT,"clogin -t $timeo -autoenable -c \"$cisco_cmds\" $host </dev/null |") || die "clogin failed for $host: $!\n";
+ open(INPUT,"clogin -t $timeo -c \"$cisco_cmds\" $host </dev/null |") || die "clogin failed for $host: $!\n";
}
}
@@ -422,13 +431,14 @@ ProcessHistory("COMMENTS","keysort","C0","#\n"); # power supply info
ProcessHistory("COMMENTS","keysort","D0","#\n"); # image name
ProcessHistory("COMMENTS","keysort","E0","#\n"); # h/w info
ProcessHistory("COMMENTS","keysort","F0","#\n"); # slot info
+ProcessHistory("COMMENTS","keysort","H0","#\n"); # config
ProcessHistory("COMMENTS","keysort","X0","#\n");
TOP: while(<INPUT>) {
tr/\015//d;
# note: this match sucks rocks, but currently the extreme bits are
# unreliable about echoing the 'exit\n' command. this match might really
# be a bad idea, but instead rely upon WriteTerm's found_end?
- if (/$prompt\s?(quit|exit|Connection closed)/ && $found_end) {
+ if (/$prompt\s?(quit|exit|Connection( to \S+)? closed)/ && $found_end) {
$clean_run=1;
last;
}
@@ -442,8 +452,10 @@ TOP: while(<INPUT>) {
$cmd = $1;
if (!defined($prompt)) {
$prompt = ($_ =~ /^([^#]+#)/)[0];
+ $prompt =~ s/([][}{)(\\])/\\$1/g;
$prompt =~ s/:(\d+ ?)#/:\\d+ ?#/;
- print STDERR ("PROMPT MATCH:$prompt\n") if ($debug);
+ $prompt =~ s/\*/\\\*/;
+ print STDERR ("PROMPT MATCH: $prompt\n") if ($debug);
}
print STDERR ("HIT COMMAND:$_") if ($debug);
if (! defined($commands{$cmd})) {
diff --git a/bin/zrancid.in b/bin/zrancid.in
new file mode 100755
index 0000000..a969553
--- /dev/null
+++ b/bin/zrancid.in
@@ -0,0 +1,411 @@
+#! @PERLV_PATH@
+##
+## $Id: zrancid.in,v 1.8 2004/01/11 03:49:13 heas Exp $
+##
+## Copyright (C) 1997-2004 by Terrapin Communications, Inc.
+## All rights reserved.
+##
+## This software may be freely copied, modified and redistributed
+## without fee for non-commerical purposes provided that this license
+## remains intact and unmodified with any RANCID distribution.
+##
+## There is no warranty or other guarantee of fitness of this software.
+## It is provided solely "as is". The author(s) disclaim(s) all
+## responsibility and liability with respect to this software's usage
+## or its effect upon hardware, computer systems, other software, or
+## anything else.
+##
+## Except where noted otherwise, rancid was written by and is maintained by
+## Henry Kilmer, John Heasley, Andrew Partan, Pete Whiting, and Austin Schutz.
+##
+#
+# This version of rancid tries to deal with zebra s/w.
+#
+# RANCID - Really Awesome New Cisco confIg Differ
+#
+# usage: rancid [-d] [-l] [-f filename | $host]
+#
+use Getopt::Std;
+getopts('dfl');
+$log = $opt_l;
+$debug = $opt_d;
+$file = $opt_f;
+$host = $ARGV[0];
+$clean_run = 0;
+$found_end = 0;
+$timeo = 90; # clogin timeout in seconds
+
+my(%filter_pwds); # password filtering mode
+
+# This routine is used to print out the router configuration
+sub ProcessHistory {
+ my($new_hist_tag,$new_command,$command_string,@string)=(@_);
+ if((($new_hist_tag ne $hist_tag) || ($new_command ne $command))
+ && defined %history) {
+ print eval "$command \%history";
+ undef %history;
+ }
+ if (($new_hist_tag) && ($new_command) && ($command_string)) {
+ if ($history{$command_string}) {
+ $history{$command_string} = "$history{$command_string}@string";
+ } else {
+ $history{$command_string} = "@string";
+ }
+ } elsif (($new_hist_tag) && ($new_command)) {
+ $history{++$#history} = "@string";
+ } else {
+ print "@string";
+ }
+ $hist_tag = $new_hist_tag;
+ $command = $new_command;
+ 1;
+}
+
+sub numerically { $a <=> $b; }
+
+# This is a sort routing that will sort numerically on the
+# keys of a hash as if it were a normal array.
+sub keynsort {
+ local(%lines)=@_;
+ local($i) = 0;
+ local(@sorted_lines);
+ foreach $key (sort numerically keys(%lines)) {
+ $sorted_lines[$i] = $lines{$key};
+ $i++;
+ }
+ @sorted_lines;
+}
+
+# This is a sort routing that will sort on the
+# keys of a hash as if it were a normal array.
+sub keysort {
+ local(%lines)=@_;
+ local($i) = 0;
+ local(@sorted_lines);
+ foreach $key (sort keys(%lines)) {
+ $sorted_lines[$i] = $lines{$key};
+ $i++;
+ }
+ @sorted_lines;
+}
+
+# This is a sort routing that will sort on the
+# values of a hash as if it were a normal array.
+sub valsort{
+ local(%lines)=@_;
+ local($i) = 0;
+ local(@sorted_lines);
+ foreach $key (sort values %lines) {
+ $sorted_lines[$i] = $key;
+ $i++;
+ }
+ @sorted_lines;
+}
+
+# This is a numerical sort routing (ascending).
+sub numsort {
+ local(%lines)=@_;
+ local($i) = 0;
+ local(@sorted_lines);
+ foreach $num (sort {$a <=> $b} keys %lines) {
+ $sorted_lines[$i] = $lines{$num};
+ $i++;
+ }
+ @sorted_lines;
+}
+
+# This is a sort routine that will sort on the
+# ip address when the ip address is anywhere in
+# the strings.
+sub ipsort {
+ local(%lines)=@_;
+ local($i) = 0;
+ local(@sorted_lines);
+ foreach $addr (sort sortbyipaddr keys %lines) {
+ $sorted_lines[$i] = $lines{$addr};
+ $i++;
+ }
+ @sorted_lines;
+}
+
+# These two routines will sort based upon IP addresses
+sub ipaddrval {
+ my(@a) = ($_[0] =~ m#^(\d+)\.(\d+)\.(\d+)\.(\d+)$#);
+ $a[3]+256*($a[2]+256*($a[1]+256*$a[0]));
+}
+sub sortbyipaddr {
+ &ipaddrval($a) <=> &ipaddrval($b);
+}
+
+# This routine parses "show version"
+sub ShowVersion {
+ print STDERR " In ShowVersion: $_" if ($debug);
+
+ while (<INPUT>) {
+ tr/\015//d;
+ last if(/^$prompt/);
+ next if(/^(\s*|\s*$cmd\s*)$/);
+ return(-1) if (/command authorization failed/i);
+
+ ProcessHistory("COMMENTS","keysort","B0", "!$_") && next;
+
+ }
+ return(0);
+}
+
+# This routine processes a "write term"
+sub WriteTerm {
+ print STDERR " In WriteTerm: $_" if ($debug);
+
+ while (<INPUT>) {
+ tr/\015//d;
+ last if(/^$prompt/);
+ return(-1) if (/command authorization failed/i);
+
+ /Non-Volatile memory is in use/ && return(-1); # NvRAM is locked
+ # skip the crap
+ if (/^(##+$|(Building|Current) configuration)/i) {
+ while (<INPUT>) {
+ next if (/^Current configuration\s*:/i);
+ next if (/^([%!].*|\s*)$/);
+ last;
+ }
+ tr/\015//d;
+ }
+ # some versions have other crap mixed in with the bits in the
+ # block above
+ /^! Last Changed:/ && next;
+
+ # Dog gone Cool matches to process the rest of the config
+# /^tftp-server flash / && next; # kill any tftp remains
+# /^ntp clock-period / && next; # kill ntp clock-period
+# /^ length / && next; # kill length on serial lines
+# /^ width / && next; # kill width on serial lines
+# /^ clockrate / && next; # kill clockrate on serial interfaces
+
+ if (/^(enable password( \d)?) / && $filter_pwds >= 1) {
+ ProcessHistory("ENABLE","","","!$1 <removed>\n");
+ next;
+ }
+ if (/^username (\S+)(\s.*)? password ((\d) \S+|\S+)/) {
+ if ($filter_pwds == 2) {
+ ProcessHistory("USER","keysort","$1","!username $1$2 password <removed>\n");
+ } elsif ($filter_pwds == 1 && $4 ne "5"){
+ ProcessHistory("USER","keysort","$1","!username $1$2 password <removed>\n");
+ } else {
+ ProcessHistory("USER","keysort","$1","$_");
+ }
+ next;
+ }
+
+ # prune passwords {bgp, ...}
+ if (/^\s*neighbor (\S*) password / && $filter_pwds >= 1) {
+ ProcessHistory("","","","! neighbor $1 password <removed>\n");
+ next;
+ }
+ # sort route-maps
+ if (/^route-map (\S+)/) {
+ my($key) = $1;
+ my($routemap) = $_;
+ while (<INPUT>) {
+ tr/\015//d;
+ last if (/^$prompt/ || ! /^(route-map |[ !])/);
+ if (/^route-map (\S+)/) {
+ ProcessHistory("ROUTEMAP","keysort","$key","$routemap");
+ $key = $1;
+ $routemap = $_;
+ } else {
+ $routemap .= $_;
+ }
+ }
+ ProcessHistory("ROUTEMAP","keysort","$key","$routemap");
+ }
+
+ # filter out any RCS/CVS tags to avoid confusing local CVS storage
+ s/\$(Revision|Id):/ $1:/;
+
+ # order access-lists
+ /^access-list\s+(\d\d?)\s+(\S+)\s+(\S+)/ &&
+ ProcessHistory("ACL $1 $2","ipsort","$3","$_") && next;
+
+ # order logging statements
+ /^logging (\d+\.\d+\.\d+\.\d+)/ &&
+ ProcessHistory("LOGGING","ipsort","$1","$_") && next;
+
+ # order/prune snmp-server host statements
+ # we only prune lines of the form
+ # snmp-server host a.b.c.d <community>
+ if (/^snmp-server host (\d+\.\d+\.\d+\.\d+) /) {
+ if (defined($ENV{'NOCOMMSTR'})) {
+ my($ip) = $1;
+ my($line) = "snmp-server host $ip";
+ my(@tokens) = split(' ', $');
+ my($token);
+ while ($token = shift(@tokens)) {
+ if ($token eq 'version') {
+ $line .= " " . join(' ', ($token, shift(@tokens)));
+ } elsif ($token =~ /^(informs?|traps?|(no)?auth)$/) {
+ $line .= " " . $token;
+ } else {
+ $line = "!$line " . join(' ', ("<removed>", join(' ',@tokens)));
+ last;
+ }
+ }
+ ProcessHistory("SNMPSERVERHOST","ipsort","$ip","$line\n");
+ } else {
+ ProcessHistory("SNMPSERVERHOST","ipsort","$1","$_");
+ }
+ next;
+ }
+ if (/^(snmp-server community) (\S+)/) {
+ if (defined($ENV{'NOCOMMSTR'})) {
+ ProcessHistory("SNMPSERVERCOMM","keysort","$_","!$1 <removed>$'") && next;
+ } else {
+ ProcessHistory("SNMPSERVERCOMM","keysort","$_","$_") && next;
+ }
+ }
+
+ # prune tacacs/radius server keys
+ if (/^(tacacs-server|radius-server) key / && $filter_pwds >= 1) {
+ ProcessHistory("","","","!$1 key <removed>\n"); next;
+ }
+ if (/^(tacacs-server host \S+( .*)? key) (\d )?\S+/
+ && $filter_pwds >= 1) {
+ ProcessHistory("","","","!$1 <removed>\n"); next;
+ }
+
+ # order clns host statements
+# /^clns host \S+ (\S+)/ &&
+# ProcessHistory("CLNS","keysort","$1","$_") && next;
+
+ # prune isis password
+ if (/^( isis authentication-key) \d \S+/ && $filter_pwds >= 1) {
+ ProcessHistory("","","","!$1 <removed>$'"); next;
+ }
+ # prune msdp password
+ if (/^(ip msdp password \S+) / && $filter_pwds >= 1) {
+ ProcessHistory("","","","!$1 <removed>\n"); next;
+ }
+
+# # order ip host line statements
+# /^ip host line(\d+)/ &&
+# ProcessHistory("IPHOST","numsort","$1","$_") && next;
+
+ # catch anything that wasnt matched above.
+ ProcessHistory("","","","$_");
+ # end of config.
+ if (/^end$/) {
+ $found_end = 1;
+ return(1);
+ }
+ }
+ return(0);
+}
+
+# dummy function
+sub DoNothing {print STDOUT;}
+
+# Main
+%commands=(
+ 'show version' => "ShowVersion",
+ 'write term' => "WriteTerm"
+);
+# keys() doesnt return things in the order entered and the order of the
+# cmds is important (show version first and write term last). pita
+@commands=(
+ "show version",
+ "write term"
+);
+$cisco_cmds=join(";",@commands);
+$cmds_regexp=join("|",@commands);
+
+open(OUTPUT,">$host.new") || die "Can't open $host.new for writing: $!\n";
+select(OUTPUT);
+# make OUTPUT unbuffered if debugging
+if ($debug) { $| = 1; }
+
+if ($file) {
+ print STDERR "opening file $host\n" if ($debug);
+ print STDOUT "opening file $host\n" if ($log);
+ open(INPUT,"<$host") || die "open failed for $host: $!\n";
+} else {
+ print STDERR "executing clogin -t $timeo -c\"$cisco_cmds\" $host\n" if ($debug);
+ print STDOUT "executing clogin -t $timeo -c\"$cisco_cmds\" $host\n" if ($log);
+ if (defined($ENV{NOPIPE})) {
+ system "clogin -t $timeo -c \"$cisco_cmds\" $host </dev/null > $host.raw 2>&1" || die "clogin failed for $host: $!\n";
+ open(INPUT, "< $host.raw") || die "clogin failed for $host: $!\n";
+ } else {
+ open(INPUT,"clogin -t $timeo -c \"$cisco_cmds\" $host </dev/null |") || die "clogin failed for $host: $!\n";
+ }
+}
+
+# determine password filtering mode
+if ($ENV{"FILTER_PWDS"} =~ /no/i) {
+ $filter_pwds = 0;
+} elsif ($ENV{"FILTER_PWDS"} =~ /all/i) {
+ $filter_pwds = 2;
+} else {
+ $filter_pwds = 1;
+}
+
+ProcessHistory("","","","!RANCID-CONTENT-TYPE: zebra\n!\n");
+ProcessHistory("COMMENTS","keysort","B0","!\n"); # show version
+ProcessHistory("COMMENTS","keysort","C0","!\n"); # show package
+ProcessHistory("COMMENTS","keysort","D0","!\n"); # show hardware
+ProcessHistory("COMMENTS","keysort","Z0","!\n");
+TOP: while(<INPUT>) {
+ tr/\015//d;
+ if (/\#\s?exit$/) {
+ $clean_run=1;
+ last;
+ }
+ if (/^Error:/) {
+ print STDOUT ("$host clogin error: $_");
+ print STDERR ("$host clogin error: $_") if ($debug);
+ $clean_run=0;
+ last;
+ }
+ while (/#\s*($cmds_regexp)\s*$/) {
+ $cmd = $1;
+ if (!defined($prompt)) {
+ $prompt = ($_ =~ /^([^#]+#)/)[0];
+ $prompt =~ s/([][}{)(\\])/\\$1/g;
+ }
+ print STDERR ("HIT COMMAND:$_") if ($debug);
+ if (! defined($commands{$cmd})) {
+ print STDERR "$host: found unexpected command - \"$cmd\"\n";
+ $clean_run = 0;
+ last TOP;
+ }
+ $rval = &{$commands{$cmd}};
+ delete($commands{$cmd});
+ if ($rval == -1) {
+ $clean_run = 0;
+ last TOP;
+ }
+ }
+}
+print STDOUT "Done $logincmd: $_\n" if ($log);
+# Flush History
+ProcessHistory("","","","");
+# Cleanup
+close(INPUT);
+close(OUTPUT);
+
+if (defined($ENV{NOPIPE})) {
+ unlink("$host.raw") if (! $debug);
+}
+
+# check for completeness
+if (scalar(%commands) || !$clean_run || !$found_end) {
+ if (scalar(%commands)) {
+ printf(STDOUT "$host: missed cmd(s): %s\n", join(',', keys(%commands)));
+ printf(STDERR "$host: missed cmd(s): %s\n", join(',', keys(%commands))) if ($debug);
+ }
+ if (!$clean_run || !$found_end) {
+ print STDOUT "$host: End of run not found\n";
+ print STDERR "$host: End of run not found\n" if ($debug);
+ system("/usr/bin/tail -1 $host.new");
+ }
+ unlink "$host.new" if (! $debug);
+}
diff --git a/cloginrc.sample b/cloginrc.sample
index da66459..2d430d0 100644
--- a/cloginrc.sample
+++ b/cloginrc.sample
@@ -34,9 +34,9 @@
#
# add method <router name glob> {ssh} [...]
# Defines, in order, which connection method(s) to use for a device
-# from the set {ssh,telnet,rsh}. eg: add method * {ssh} {telnet} {rsh}
+# from the set {ssh,telnet,rsh}. e.g.: add method * {ssh} {telnet} {rsh}
# will attempt ssh connection first. if ssh fails with connection
-# refused (ie: not due to authentication failure), then try telnet,
+# refused (i.e.: not due to authentication failure), then try telnet,
# then rsh.
# Default: {telnet} {ssh}
#
@@ -101,7 +101,7 @@ add method *.custz.net ssh
# equivalent.
add noenable route-server* 1
-# all our routers, ie: everything else
+# all our routers, i.e.: everything else
add password * {clearance} {clarence}
# set ssh encryption type, dflt: 3des
@@ -112,3 +112,13 @@ add cyphertype * {3des}
# ssh identity for a juniper; used with jlogin
add identity my.juniper $env(HOME)/.ssh/juniper
+
+# riverstone / enterasys / cabletron (rivlogin) example
+# these boxes are 'back-to-front' from cisco (i.e., ask
+# for vty password always, then tac+/radius if configured).
+#
+# vty password and last resort (enable) password for rivlogin
+add password rs3000 {vtypass} {lastresort}
+# if using tac+ or radius login, include these lines
+add user rs3000 {monster}
+add userpassword rs3000 {scary}
diff --git a/configure b/configure
index 3861408..ce3976d 100755
--- a/configure
+++ b/configure
@@ -1,32 +1,326 @@
#! /bin/sh
-
# Guess values for system-dependent variables and create Makefiles.
-# Generated automatically using autoconf version 2.13
-# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
+# Generated by GNU Autoconf 2.59.
#
+# Copyright (C) 2003 Free Software Foundation, Inc.
# This configure script is free software; the Free Software Foundation
# gives unlimited permission to copy, distribute and modify it.
+## --------------------- ##
+## M4sh Initialization. ##
+## --------------------- ##
+
+# Be Bourne compatible
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+ emulate sh
+ NULLCMD=:
+ # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '${1+"$@"}'='"$@"'
+elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
+ set -o posix
+fi
+DUALCASE=1; export DUALCASE # for MKS sh
+
+# Support unset when possible.
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+ as_unset=unset
+else
+ as_unset=false
+fi
+
+
+# Work around bugs in pre-3.0 UWIN ksh.
+$as_unset ENV MAIL MAILPATH
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+for as_var in \
+ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
+ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
+ LC_TELEPHONE LC_TIME
+do
+ if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
+ eval $as_var=C; export $as_var
+ else
+ $as_unset $as_var
+ fi
+done
+
+# Required to use basename.
+if expr a : '\(a\)' >/dev/null 2>&1; then
+ as_expr=expr
+else
+ as_expr=false
+fi
+
+if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then
+ as_basename=basename
+else
+ as_basename=false
+fi
+
+
+# Name of the executable.
+as_me=`$as_basename "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+ X"$0" : 'X\(//\)$' \| \
+ X"$0" : 'X\(/\)$' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X/"$0" |
+ sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; }
+ /^X\/\(\/\/\)$/{ s//\1/; q; }
+ /^X\/\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+
+
+# PATH needs CR, and LINENO needs CR and PATH.
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+ echo "#! /bin/sh" >conf$$.sh
+ echo "exit 0" >>conf$$.sh
+ chmod +x conf$$.sh
+ if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
+ PATH_SEPARATOR=';'
+ else
+ PATH_SEPARATOR=:
+ fi
+ rm -f conf$$.sh
+fi
+
+
+ as_lineno_1=$LINENO
+ as_lineno_2=$LINENO
+ as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
+ test "x$as_lineno_1" != "x$as_lineno_2" &&
+ test "x$as_lineno_3" = "x$as_lineno_2" || {
+ # Find who we are. Look in the path if we contain no path at all
+ # relative or not.
+ case $0 in
+ *[\\/]* ) as_myself=$0 ;;
+ *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+done
+
+ ;;
+ esac
+ # We did not find ourselves, most probably we were run as `sh COMMAND'
+ # in which case we are not to be found in the path.
+ if test "x$as_myself" = x; then
+ as_myself=$0
+ fi
+ if test ! -f "$as_myself"; then
+ { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2
+ { (exit 1); exit 1; }; }
+ fi
+ case $CONFIG_SHELL in
+ '')
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for as_base in sh bash ksh sh5; do
+ case $as_dir in
+ /*)
+ if ("$as_dir/$as_base" -c '
+ as_lineno_1=$LINENO
+ as_lineno_2=$LINENO
+ as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
+ test "x$as_lineno_1" != "x$as_lineno_2" &&
+ test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then
+ $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; }
+ $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; }
+ CONFIG_SHELL=$as_dir/$as_base
+ export CONFIG_SHELL
+ exec "$CONFIG_SHELL" "$0" ${1+"$@"}
+ fi;;
+ esac
+ done
+done
+;;
+ esac
+
+ # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
+ # uniformly replaced by the line number. The first 'sed' inserts a
+ # line-number line before each line; the second 'sed' does the real
+ # work. The second script uses 'N' to pair each line-number line
+ # with the numbered line, and appends trailing '-' during
+ # substitution so that $LINENO is not a special case at line end.
+ # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
+ # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-)
+ sed '=' <$as_myself |
+ sed '
+ N
+ s,$,-,
+ : loop
+ s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3,
+ t loop
+ s,-$,,
+ s,^['$as_cr_digits']*\n,,
+ ' >$as_me.lineno &&
+ chmod +x $as_me.lineno ||
+ { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
+ { (exit 1); exit 1; }; }
+
+ # Don't try to exec as it changes $[0], causing all sort of problems
+ # (the dirname of $[0] is not the place where we might find the
+ # original and so on. Autoconf is especially sensible to this).
+ . ./$as_me.lineno
+ # Exit status is that of the last command.
+ exit
+}
+
+
+case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
+ *c*,-n*) ECHO_N= ECHO_C='
+' ECHO_T=' ' ;;
+ *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;;
+ *) ECHO_N= ECHO_C='\c' ECHO_T= ;;
+esac
-# Defaults:
-ac_help=
+if expr a : '\(a\)' >/dev/null 2>&1; then
+ as_expr=expr
+else
+ as_expr=false
+fi
+
+rm -f conf$$ conf$$.exe conf$$.file
+echo >conf$$.file
+if ln -s conf$$.file conf$$ 2>/dev/null; then
+ # We could just check for DJGPP; but this test a) works b) is more generic
+ # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
+ if test -f conf$$.exe; then
+ # Don't use ln at all; we don't have any links
+ as_ln_s='cp -p'
+ else
+ as_ln_s='ln -s'
+ fi
+elif ln conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s=ln
+else
+ as_ln_s='cp -p'
+fi
+rm -f conf$$ conf$$.exe conf$$.file
+
+if mkdir -p . 2>/dev/null; then
+ as_mkdir_p=:
+else
+ test -d ./-p && rmdir ./-p
+ as_mkdir_p=false
+fi
+
+as_executable_p="test -f"
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+
+
+# IFS
+# We need space, tab and new line, in precisely that order.
+as_nl='
+'
+IFS=" $as_nl"
+
+# CDPATH.
+$as_unset CDPATH
+
+
+# Name of the host.
+# hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
+# so uname gets run too.
+ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
+
+exec 6>&1
+
+#
+# Initializations.
+#
ac_default_prefix=/usr/local
-# Any additions from configure.in:
+ac_config_libobj_dir=.
+cross_compiling=no
+subdirs=
+MFLAGS=
+MAKEFLAGS=
+SHELL=${CONFIG_SHELL-/bin/sh}
+
+# Maximum number of lines to put in a shell here document.
+# This variable seems obsolete. It should probably be removed, and
+# only ac_max_sed_lines should be used.
+: ${ac_max_here_lines=38}
+
+# Identity of this package.
+PACKAGE_NAME=
+PACKAGE_TARNAME=
+PACKAGE_VERSION=
+PACKAGE_STRING=
+PACKAGE_BUGREPORT=
+
+ac_unique_file="CHANGES"
ac_default_prefix=/usr/local/rancid
-ac_help="$ac_help
- --enable-maintainer-mode enable make rules and dependencies not useful
- (and sometimes confusing) to the casual installer"
-ac_help="$ac_help
- --enable-mail-plus enable mail to rancid+ addresses, instead of rancid-"
+# Factoring default headers for most tests.
+ac_includes_default="\
+#include <stdio.h>
+#if HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
+#if HAVE_SYS_STAT_H
+# include <sys/stat.h>
+#endif
+#if STDC_HEADERS
+# include <stdlib.h>
+# include <stddef.h>
+#else
+# if HAVE_STDLIB_H
+# include <stdlib.h>
+# endif
+#endif
+#if HAVE_STRING_H
+# if !STDC_HEADERS && HAVE_MEMORY_H
+# include <memory.h>
+# endif
+# include <string.h>
+#endif
+#if HAVE_STRINGS_H
+# include <strings.h>
+#endif
+#if HAVE_INTTYPES_H
+# include <inttypes.h>
+#else
+# if HAVE_STDINT_H
+# include <stdint.h>
+# endif
+#endif
+#if HAVE_UNISTD_H
+# include <unistd.h>
+#endif"
+
+ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS VERSION PACKAGE INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO AMTAR install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot MAKE CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE CPP EGREP U ANSI2KNR MAILPLUS ADMINMAILPLUS DIRNAME DIFF DIFF_CMD SENDMAIL TAR PERLV_PATH PERLV EXPECT_PATH PING_PATH LG_PING_CMD CVS COMM FIND GREP ID MKDIR RSH SORT SSH TELNET TOUCH ENV_PATH LIBOBJS LTLIBOBJS'
+ac_subst_files=''
# Initialize some variables set by options.
+ac_init_help=
+ac_init_version=false
# The variables have the same names as the options, with
# dashes changed to underlines.
-build=NONE
-cache_file=./config.cache
+cache_file=/dev/null
exec_prefix=NONE
-host=NONE
no_create=
-nonopt=NONE
no_recursion=
prefix=NONE
program_prefix=NONE
@@ -35,10 +329,15 @@ program_transform_name=s,x,x,
silent=
site=
srcdir=
-target=NONE
verbose=
x_includes=NONE
x_libraries=NONE
+
+# Installation directory options.
+# These are left unexpanded so users can "make install exec_prefix=/foo"
+# and all the variables that are supposed to be based on exec_prefix
+# by default will actually change.
+# Use braces instead of parens because sh, perl, etc. also accept them.
bindir='${exec_prefix}/bin'
sbindir='${exec_prefix}/sbin'
libexecdir='${exec_prefix}/libexec'
@@ -52,17 +351,9 @@ oldincludedir='/usr/include'
infodir='${prefix}/info'
mandir='${prefix}/man'
-# Initialize some other variables.
-subdirs=
-MFLAGS= MAKEFLAGS=
-SHELL=${CONFIG_SHELL-/bin/sh}
-# Maximum number of lines to put in a shell here document.
-ac_max_here_lines=12
-
ac_prev=
for ac_option
do
-
# If the previous option needs an argument, assign it.
if test -n "$ac_prev"; then
eval "$ac_prev=\$ac_option"
@@ -70,59 +361,59 @@ do
continue
fi
- case "$ac_option" in
- -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
- *) ac_optarg= ;;
- esac
+ ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'`
# Accept the important Cygnus configure options, so we can diagnose typos.
- case "$ac_option" in
+ case $ac_option in
-bindir | --bindir | --bindi | --bind | --bin | --bi)
ac_prev=bindir ;;
-bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
- bindir="$ac_optarg" ;;
+ bindir=$ac_optarg ;;
-build | --build | --buil | --bui | --bu)
- ac_prev=build ;;
+ ac_prev=build_alias ;;
-build=* | --build=* | --buil=* | --bui=* | --bu=*)
- build="$ac_optarg" ;;
+ build_alias=$ac_optarg ;;
-cache-file | --cache-file | --cache-fil | --cache-fi \
| --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
ac_prev=cache_file ;;
-cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
| --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
- cache_file="$ac_optarg" ;;
+ cache_file=$ac_optarg ;;
+
+ --config-cache | -C)
+ cache_file=config.cache ;;
-datadir | --datadir | --datadi | --datad | --data | --dat | --da)
ac_prev=datadir ;;
-datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
| --da=*)
- datadir="$ac_optarg" ;;
+ datadir=$ac_optarg ;;
-disable-* | --disable-*)
- ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
+ ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
# Reject names that are not valid shell variable names.
- if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
- { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
- fi
- ac_feature=`echo $ac_feature| sed 's/-/_/g'`
- eval "enable_${ac_feature}=no" ;;
+ expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+ { echo "$as_me: error: invalid feature name: $ac_feature" >&2
+ { (exit 1); exit 1; }; }
+ ac_feature=`echo $ac_feature | sed 's/-/_/g'`
+ eval "enable_$ac_feature=no" ;;
-enable-* | --enable-*)
- ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
+ ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
# Reject names that are not valid shell variable names.
- if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
- { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
- fi
- ac_feature=`echo $ac_feature| sed 's/-/_/g'`
- case "$ac_option" in
- *=*) ;;
+ expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+ { echo "$as_me: error: invalid feature name: $ac_feature" >&2
+ { (exit 1); exit 1; }; }
+ ac_feature=`echo $ac_feature | sed 's/-/_/g'`
+ case $ac_option in
+ *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
*) ac_optarg=yes ;;
esac
- eval "enable_${ac_feature}='$ac_optarg'" ;;
+ eval "enable_$ac_feature='$ac_optarg'" ;;
-exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
| --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
@@ -131,95 +422,47 @@ do
-exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
| --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
| --exec=* | --exe=* | --ex=*)
- exec_prefix="$ac_optarg" ;;
+ exec_prefix=$ac_optarg ;;
-gas | --gas | --ga | --g)
# Obsolete; use --with-gas.
with_gas=yes ;;
- -help | --help | --hel | --he)
- # Omit some internal or obsolete options to make the list less imposing.
- # This message is too long to be a string in the A/UX 3.1 sh.
- cat << EOF
-Usage: configure [options] [host]
-Options: [defaults in brackets after descriptions]
-Configuration:
- --cache-file=FILE cache test results in FILE
- --help print this message
- --no-create do not create output files
- --quiet, --silent do not print \`checking...' messages
- --version print the version of autoconf that created configure
-Directory and file names:
- --prefix=PREFIX install architecture-independent files in PREFIX
- [$ac_default_prefix]
- --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
- [same as prefix]
- --bindir=DIR user executables in DIR [EPREFIX/bin]
- --sbindir=DIR system admin executables in DIR [EPREFIX/sbin]
- --libexecdir=DIR program executables in DIR [EPREFIX/libexec]
- --datadir=DIR read-only architecture-independent data in DIR
- [PREFIX/share]
- --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc]
- --sharedstatedir=DIR modifiable architecture-independent data in DIR
- [PREFIX/com]
- --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var]
- --libdir=DIR object code libraries in DIR [EPREFIX/lib]
- --includedir=DIR C header files in DIR [PREFIX/include]
- --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include]
- --infodir=DIR info documentation in DIR [PREFIX/info]
- --mandir=DIR man documentation in DIR [PREFIX/man]
- --srcdir=DIR find the sources in DIR [configure dir or ..]
- --program-prefix=PREFIX prepend PREFIX to installed program names
- --program-suffix=SUFFIX append SUFFIX to installed program names
- --program-transform-name=PROGRAM
- run sed PROGRAM on installed program names
-EOF
- cat << EOF
-Host type:
- --build=BUILD configure for building on BUILD [BUILD=HOST]
- --host=HOST configure for HOST [guessed]
- --target=TARGET configure for TARGET [TARGET=HOST]
-Features and packages:
- --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
- --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
- --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
- --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
- --x-includes=DIR X include files are in DIR
- --x-libraries=DIR X library files are in DIR
-EOF
- if test -n "$ac_help"; then
- echo "--enable and --with options recognized:$ac_help"
- fi
- exit 0 ;;
+ -help | --help | --hel | --he | -h)
+ ac_init_help=long ;;
+ -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
+ ac_init_help=recursive ;;
+ -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
+ ac_init_help=short ;;
-host | --host | --hos | --ho)
- ac_prev=host ;;
+ ac_prev=host_alias ;;
-host=* | --host=* | --hos=* | --ho=*)
- host="$ac_optarg" ;;
+ host_alias=$ac_optarg ;;
-includedir | --includedir | --includedi | --included | --include \
| --includ | --inclu | --incl | --inc)
ac_prev=includedir ;;
-includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
| --includ=* | --inclu=* | --incl=* | --inc=*)
- includedir="$ac_optarg" ;;
+ includedir=$ac_optarg ;;
-infodir | --infodir | --infodi | --infod | --info | --inf)
ac_prev=infodir ;;
-infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
- infodir="$ac_optarg" ;;
+ infodir=$ac_optarg ;;
-libdir | --libdir | --libdi | --libd)
ac_prev=libdir ;;
-libdir=* | --libdir=* | --libdi=* | --libd=*)
- libdir="$ac_optarg" ;;
+ libdir=$ac_optarg ;;
-libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
| --libexe | --libex | --libe)
ac_prev=libexecdir ;;
-libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
| --libexe=* | --libex=* | --libe=*)
- libexecdir="$ac_optarg" ;;
+ libexecdir=$ac_optarg ;;
-localstatedir | --localstatedir | --localstatedi | --localstated \
| --localstate | --localstat | --localsta | --localst \
@@ -228,19 +471,19 @@ EOF
-localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
| --localstate=* | --localstat=* | --localsta=* | --localst=* \
| --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
- localstatedir="$ac_optarg" ;;
+ localstatedir=$ac_optarg ;;
-mandir | --mandir | --mandi | --mand | --man | --ma | --m)
ac_prev=mandir ;;
-mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
- mandir="$ac_optarg" ;;
+ mandir=$ac_optarg ;;
-nfp | --nfp | --nf)
# Obsolete; use --without-fp.
with_fp=no ;;
-no-create | --no-create | --no-creat | --no-crea | --no-cre \
- | --no-cr | --no-c)
+ | --no-cr | --no-c | -n)
no_create=yes ;;
-no-recursion | --no-recursion | --no-recursio | --no-recursi \
@@ -254,26 +497,26 @@ EOF
-oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
| --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
| --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
- oldincludedir="$ac_optarg" ;;
+ oldincludedir=$ac_optarg ;;
-prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
ac_prev=prefix ;;
-prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
- prefix="$ac_optarg" ;;
+ prefix=$ac_optarg ;;
-program-prefix | --program-prefix | --program-prefi | --program-pref \
| --program-pre | --program-pr | --program-p)
ac_prev=program_prefix ;;
-program-prefix=* | --program-prefix=* | --program-prefi=* \
| --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
- program_prefix="$ac_optarg" ;;
+ program_prefix=$ac_optarg ;;
-program-suffix | --program-suffix | --program-suffi | --program-suff \
| --program-suf | --program-su | --program-s)
ac_prev=program_suffix ;;
-program-suffix=* | --program-suffix=* | --program-suffi=* \
| --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
- program_suffix="$ac_optarg" ;;
+ program_suffix=$ac_optarg ;;
-program-transform-name | --program-transform-name \
| --program-transform-nam | --program-transform-na \
@@ -290,7 +533,7 @@ EOF
| --program-transfo=* | --program-transf=* \
| --program-trans=* | --program-tran=* \
| --progr-tra=* | --program-tr=* | --program-t=*)
- program_transform_name="$ac_optarg" ;;
+ program_transform_name=$ac_optarg ;;
-q | -quiet | --quiet | --quie | --qui | --qu | --q \
| -silent | --silent | --silen | --sile | --sil)
@@ -300,7 +543,7 @@ EOF
ac_prev=sbindir ;;
-sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
| --sbi=* | --sb=*)
- sbindir="$ac_optarg" ;;
+ sbindir=$ac_optarg ;;
-sharedstatedir | --sharedstatedir | --sharedstatedi \
| --sharedstated | --sharedstate | --sharedstat | --sharedsta \
@@ -311,58 +554,57 @@ EOF
| --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
| --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
| --sha=* | --sh=*)
- sharedstatedir="$ac_optarg" ;;
+ sharedstatedir=$ac_optarg ;;
-site | --site | --sit)
ac_prev=site ;;
-site=* | --site=* | --sit=*)
- site="$ac_optarg" ;;
+ site=$ac_optarg ;;
-srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
ac_prev=srcdir ;;
-srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
- srcdir="$ac_optarg" ;;
+ srcdir=$ac_optarg ;;
-sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
| --syscon | --sysco | --sysc | --sys | --sy)
ac_prev=sysconfdir ;;
-sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
| --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
- sysconfdir="$ac_optarg" ;;
+ sysconfdir=$ac_optarg ;;
-target | --target | --targe | --targ | --tar | --ta | --t)
- ac_prev=target ;;
+ ac_prev=target_alias ;;
-target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
- target="$ac_optarg" ;;
+ target_alias=$ac_optarg ;;
-v | -verbose | --verbose | --verbos | --verbo | --verb)
verbose=yes ;;
- -version | --version | --versio | --versi | --vers)
- echo "configure generated by autoconf version 2.13"
- exit 0 ;;
+ -version | --version | --versio | --versi | --vers | -V)
+ ac_init_version=: ;;
-with-* | --with-*)
- ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
+ ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
# Reject names that are not valid shell variable names.
- if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
- { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
- fi
+ expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+ { echo "$as_me: error: invalid package name: $ac_package" >&2
+ { (exit 1); exit 1; }; }
ac_package=`echo $ac_package| sed 's/-/_/g'`
- case "$ac_option" in
- *=*) ;;
+ case $ac_option in
+ *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
*) ac_optarg=yes ;;
esac
- eval "with_${ac_package}='$ac_optarg'" ;;
+ eval "with_$ac_package='$ac_optarg'" ;;
-without-* | --without-*)
- ac_package=`echo $ac_option|sed -e 's/-*without-//'`
+ ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'`
# Reject names that are not valid shell variable names.
- if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
- { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
- fi
- ac_package=`echo $ac_package| sed 's/-/_/g'`
- eval "with_${ac_package}=no" ;;
+ expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+ { echo "$as_me: error: invalid package name: $ac_package" >&2
+ { (exit 1); exit 1; }; }
+ ac_package=`echo $ac_package | sed 's/-/_/g'`
+ eval "with_$ac_package=no" ;;
--x)
# Obsolete; use --with-x.
@@ -373,99 +615,110 @@ EOF
ac_prev=x_includes ;;
-x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
| --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
- x_includes="$ac_optarg" ;;
+ x_includes=$ac_optarg ;;
-x-libraries | --x-libraries | --x-librarie | --x-librari \
| --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
ac_prev=x_libraries ;;
-x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
| --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
- x_libraries="$ac_optarg" ;;
+ x_libraries=$ac_optarg ;;
- -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
+ -*) { echo "$as_me: error: unrecognized option: $ac_option
+Try \`$0 --help' for more information." >&2
+ { (exit 1); exit 1; }; }
;;
+ *=*)
+ ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
+ { echo "$as_me: error: invalid variable name: $ac_envvar" >&2
+ { (exit 1); exit 1; }; }
+ ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`
+ eval "$ac_envvar='$ac_optarg'"
+ export $ac_envvar ;;
+
*)
- if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
- echo "configure: warning: $ac_option: invalid host type" 1>&2
- fi
- if test "x$nonopt" != xNONE; then
- { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
- fi
- nonopt="$ac_option"
+ # FIXME: should be removed in autoconf 3.0.
+ echo "$as_me: WARNING: you should use --build, --host, --target" >&2
+ expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
+ echo "$as_me: WARNING: invalid host type: $ac_option" >&2
+ : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
;;
esac
done
if test -n "$ac_prev"; then
- { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
-fi
-
-trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
-
-# File descriptor usage:
-# 0 standard input
-# 1 file creation
-# 2 errors and warnings
-# 3 some systems may open it to /dev/tty
-# 4 used on the Kubota Titan
-# 6 checking for... messages and results
-# 5 compiler messages saved in config.log
-if test "$silent" = yes; then
- exec 6>/dev/null
-else
- exec 6>&1
+ ac_option=--`echo $ac_prev | sed 's/_/-/g'`
+ { echo "$as_me: error: missing argument to $ac_option" >&2
+ { (exit 1); exit 1; }; }
fi
-exec 5>./config.log
-echo "\
-This file contains any messages produced by compilers while
-running configure, to aid debugging if configure makes a mistake.
-" 1>&5
+# Be sure to have absolute paths.
+for ac_var in exec_prefix prefix
+do
+ eval ac_val=$`echo $ac_var`
+ case $ac_val in
+ [\\/$]* | ?:[\\/]* | NONE | '' ) ;;
+ *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
+ { (exit 1); exit 1; }; };;
+ esac
+done
-# Strip out --no-create and --no-recursion so they do not pile up.
-# Also quote any args containing shell metacharacters.
-ac_configure_args=
-for ac_arg
+# Be sure to have absolute paths.
+for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \
+ localstatedir libdir includedir oldincludedir infodir mandir
do
- case "$ac_arg" in
- -no-create | --no-create | --no-creat | --no-crea | --no-cre \
- | --no-cr | --no-c) ;;
- -no-recursion | --no-recursion | --no-recursio | --no-recursi \
- | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
- *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
- ac_configure_args="$ac_configure_args '$ac_arg'" ;;
- *) ac_configure_args="$ac_configure_args $ac_arg" ;;
+ eval ac_val=$`echo $ac_var`
+ case $ac_val in
+ [\\/$]* | ?:[\\/]* ) ;;
+ *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
+ { (exit 1); exit 1; }; };;
esac
done
-# NLS nuisances.
-# Only set these to C if already set. These must not be set unconditionally
-# because not all systems understand e.g. LANG=C (notably SCO).
-# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
-# Non-C LC_CTYPE values break the ctype check.
-if test "${LANG+set}" = set; then LANG=C; export LANG; fi
-if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
-if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
-if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi
+# There might be people who depend on the old broken behavior: `$host'
+# used to hold the argument of --host etc.
+# FIXME: To remove some day.
+build=$build_alias
+host=$host_alias
+target=$target_alias
+
+# FIXME: To remove some day.
+if test "x$host_alias" != x; then
+ if test "x$build_alias" = x; then
+ cross_compiling=maybe
+ echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
+ If a cross compiler is detected then cross compile mode will be used." >&2
+ elif test "x$build_alias" != "x$host_alias"; then
+ cross_compiling=yes
+ fi
+fi
-# confdefs.h avoids OS command line length limits that DEFS can exceed.
-rm -rf conftest* confdefs.h
-# AIX cpp loses on an empty file, so make sure it contains at least a newline.
-echo > confdefs.h
+ac_tool_prefix=
+test -n "$host_alias" && ac_tool_prefix=$host_alias-
+
+test "$silent" = yes && exec 6>/dev/null
-# A filename unique to this package, relative to the directory that
-# configure is in, which we can look for to find out if srcdir is correct.
-ac_unique_file=CHANGES
# Find the source files, if location was not specified.
if test -z "$srcdir"; then
ac_srcdir_defaulted=yes
# Try the directory containing this script, then its parent.
- ac_prog=$0
- ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
- test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
+ ac_confdir=`(dirname "$0") 2>/dev/null ||
+$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$0" : 'X\(//\)[^/]' \| \
+ X"$0" : 'X\(//\)$' \| \
+ X"$0" : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X"$0" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+ /^X\(\/\/\)$/{ s//\1/; q; }
+ /^X\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
srcdir=$ac_confdir
if test ! -r $srcdir/$ac_unique_file; then
srcdir=..
@@ -475,13 +728,468 @@ else
fi
if test ! -r $srcdir/$ac_unique_file; then
if test "$ac_srcdir_defaulted" = yes; then
- { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
+ { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2
+ { (exit 1); exit 1; }; }
else
- { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
+ { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2
+ { (exit 1); exit 1; }; }
fi
fi
-srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
+(cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null ||
+ { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2
+ { (exit 1); exit 1; }; }
+srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'`
+ac_env_build_alias_set=${build_alias+set}
+ac_env_build_alias_value=$build_alias
+ac_cv_env_build_alias_set=${build_alias+set}
+ac_cv_env_build_alias_value=$build_alias
+ac_env_host_alias_set=${host_alias+set}
+ac_env_host_alias_value=$host_alias
+ac_cv_env_host_alias_set=${host_alias+set}
+ac_cv_env_host_alias_value=$host_alias
+ac_env_target_alias_set=${target_alias+set}
+ac_env_target_alias_value=$target_alias
+ac_cv_env_target_alias_set=${target_alias+set}
+ac_cv_env_target_alias_value=$target_alias
+ac_env_CC_set=${CC+set}
+ac_env_CC_value=$CC
+ac_cv_env_CC_set=${CC+set}
+ac_cv_env_CC_value=$CC
+ac_env_CFLAGS_set=${CFLAGS+set}
+ac_env_CFLAGS_value=$CFLAGS
+ac_cv_env_CFLAGS_set=${CFLAGS+set}
+ac_cv_env_CFLAGS_value=$CFLAGS
+ac_env_LDFLAGS_set=${LDFLAGS+set}
+ac_env_LDFLAGS_value=$LDFLAGS
+ac_cv_env_LDFLAGS_set=${LDFLAGS+set}
+ac_cv_env_LDFLAGS_value=$LDFLAGS
+ac_env_CPPFLAGS_set=${CPPFLAGS+set}
+ac_env_CPPFLAGS_value=$CPPFLAGS
+ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set}
+ac_cv_env_CPPFLAGS_value=$CPPFLAGS
+ac_env_CPP_set=${CPP+set}
+ac_env_CPP_value=$CPP
+ac_cv_env_CPP_set=${CPP+set}
+ac_cv_env_CPP_value=$CPP
+
+#
+# Report the --help message.
+#
+if test "$ac_init_help" = "long"; then
+ # Omit some internal or obsolete options to make the list less imposing.
+ # This message is too long to be a string in the A/UX 3.1 sh.
+ cat <<_ACEOF
+\`configure' configures this package to adapt to many kinds of systems.
+
+Usage: $0 [OPTION]... [VAR=VALUE]...
+
+To assign environment variables (e.g., CC, CFLAGS...), specify them as
+VAR=VALUE. See below for descriptions of some of the useful variables.
+
+Defaults for the options are specified in brackets.
+
+Configuration:
+ -h, --help display this help and exit
+ --help=short display options specific to this package
+ --help=recursive display the short help of all the included packages
+ -V, --version display version information and exit
+ -q, --quiet, --silent do not print \`checking...' messages
+ --cache-file=FILE cache test results in FILE [disabled]
+ -C, --config-cache alias for \`--cache-file=config.cache'
+ -n, --no-create do not create output files
+ --srcdir=DIR find the sources in DIR [configure dir or \`..']
+
+_ACEOF
+
+ cat <<_ACEOF
+Installation directories:
+ --prefix=PREFIX install architecture-independent files in PREFIX
+ [$ac_default_prefix]
+ --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
+ [PREFIX]
+
+By default, \`make install' will install all the files in
+\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify
+an installation prefix other than \`$ac_default_prefix' using \`--prefix',
+for instance \`--prefix=\$HOME'.
+
+For better control, use the options below.
+
+Fine tuning of the installation directories:
+ --bindir=DIR user executables [EPREFIX/bin]
+ --sbindir=DIR system admin executables [EPREFIX/sbin]
+ --libexecdir=DIR program executables [EPREFIX/libexec]
+ --datadir=DIR read-only architecture-independent data [PREFIX/share]
+ --sysconfdir=DIR read-only single-machine data [PREFIX/etc]
+ --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
+ --localstatedir=DIR modifiable single-machine data [PREFIX/var]
+ --libdir=DIR object code libraries [EPREFIX/lib]
+ --includedir=DIR C header files [PREFIX/include]
+ --oldincludedir=DIR C header files for non-gcc [/usr/include]
+ --infodir=DIR info documentation [PREFIX/info]
+ --mandir=DIR man documentation [PREFIX/man]
+_ACEOF
+
+ cat <<\_ACEOF
+
+Program names:
+ --program-prefix=PREFIX prepend PREFIX to installed program names
+ --program-suffix=SUFFIX append SUFFIX to installed program names
+ --program-transform-name=PROGRAM run sed PROGRAM on installed program names
+_ACEOF
+fi
+
+if test -n "$ac_init_help"; then
+
+ cat <<\_ACEOF
+
+Optional Features:
+ --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
+ --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
+ --disable-dependency-tracking Speeds up one-time builds
+ --enable-dependency-tracking Do not reject slow dependency extractors
+ --enable-mail-plus enable mail to rancid+ addresses, instead of rancid-
+ --enable-adminmail-plus enable mail to rancid-admin+ addresses, instead of
+ rancid-admin-
+
+Some influential environment variables:
+ CC C compiler command
+ CFLAGS C compiler flags
+ LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a
+ nonstandard directory <lib dir>
+ CPPFLAGS C/C++ preprocessor flags, e.g. -I<include dir> if you have
+ headers in a nonstandard directory <include dir>
+ CPP C preprocessor
+
+Use these variables to override the choices made by `configure' or to help
+it to find libraries and programs with nonstandard names/locations.
+
+_ACEOF
+fi
+
+if test "$ac_init_help" = "recursive"; then
+ # If there are subdirs, report their specific --help.
+ ac_popdir=`pwd`
+ for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
+ test -d $ac_dir || continue
+ ac_builddir=.
+
+if test "$ac_dir" != .; then
+ ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
+ # A "../" for each directory in $ac_dir_suffix.
+ ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
+else
+ ac_dir_suffix= ac_top_builddir=
+fi
+
+case $srcdir in
+ .) # No --srcdir option. We are building in place.
+ ac_srcdir=.
+ if test -z "$ac_top_builddir"; then
+ ac_top_srcdir=.
+ else
+ ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
+ fi ;;
+ [\\/]* | ?:[\\/]* ) # Absolute path.
+ ac_srcdir=$srcdir$ac_dir_suffix;
+ ac_top_srcdir=$srcdir ;;
+ *) # Relative path.
+ ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
+ ac_top_srcdir=$ac_top_builddir$srcdir ;;
+esac
+
+# Do not use `cd foo && pwd` to compute absolute paths, because
+# the directories may not exist.
+case `pwd` in
+.) ac_abs_builddir="$ac_dir";;
+*)
+ case "$ac_dir" in
+ .) ac_abs_builddir=`pwd`;;
+ [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";;
+ *) ac_abs_builddir=`pwd`/"$ac_dir";;
+ esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_top_builddir=${ac_top_builddir}.;;
+*)
+ case ${ac_top_builddir}. in
+ .) ac_abs_top_builddir=$ac_abs_builddir;;
+ [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;
+ *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;
+ esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_srcdir=$ac_srcdir;;
+*)
+ case $ac_srcdir in
+ .) ac_abs_srcdir=$ac_abs_builddir;;
+ [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;;
+ *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;
+ esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_top_srcdir=$ac_top_srcdir;;
+*)
+ case $ac_top_srcdir in
+ .) ac_abs_top_srcdir=$ac_abs_builddir;;
+ [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;
+ *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;
+ esac;;
+esac
+
+ cd $ac_dir
+ # Check for guested configure; otherwise get Cygnus style configure.
+ if test -f $ac_srcdir/configure.gnu; then
+ echo
+ $SHELL $ac_srcdir/configure.gnu --help=recursive
+ elif test -f $ac_srcdir/configure; then
+ echo
+ $SHELL $ac_srcdir/configure --help=recursive
+ elif test -f $ac_srcdir/configure.ac ||
+ test -f $ac_srcdir/configure.in; then
+ echo
+ $ac_configure --help
+ else
+ echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
+ fi
+ cd $ac_popdir
+ done
+fi
+
+test -n "$ac_init_help" && exit 0
+if $ac_init_version; then
+ cat <<\_ACEOF
+
+Copyright (C) 2003 Free Software Foundation, Inc.
+This configure script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it.
+_ACEOF
+ exit 0
+fi
+exec 5>config.log
+cat >&5 <<_ACEOF
+This file contains any messages produced by compilers while
+running configure, to aid debugging if configure makes a mistake.
+
+It was created by $as_me, which was
+generated by GNU Autoconf 2.59. Invocation command line was
+
+ $ $0 $@
+
+_ACEOF
+{
+cat <<_ASUNAME
+## --------- ##
+## Platform. ##
+## --------- ##
+
+hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
+uname -m = `(uname -m) 2>/dev/null || echo unknown`
+uname -r = `(uname -r) 2>/dev/null || echo unknown`
+uname -s = `(uname -s) 2>/dev/null || echo unknown`
+uname -v = `(uname -v) 2>/dev/null || echo unknown`
+
+/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
+/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown`
+
+/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown`
+/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown`
+/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
+hostinfo = `(hostinfo) 2>/dev/null || echo unknown`
+/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown`
+/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown`
+/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown`
+
+_ASUNAME
+
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ echo "PATH: $as_dir"
+done
+
+} >&5
+
+cat >&5 <<_ACEOF
+
+## ----------- ##
+## Core tests. ##
+## ----------- ##
+
+_ACEOF
+
+
+# Keep a trace of the command line.
+# Strip out --no-create and --no-recursion so they do not pile up.
+# Strip out --silent because we don't want to record it for future runs.
+# Also quote any args containing shell meta-characters.
+# Make two passes to allow for proper duplicate-argument suppression.
+ac_configure_args=
+ac_configure_args0=
+ac_configure_args1=
+ac_sep=
+ac_must_keep_next=false
+for ac_pass in 1 2
+do
+ for ac_arg
+ do
+ case $ac_arg in
+ -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil)
+ continue ;;
+ *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
+ ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
+ esac
+ case $ac_pass in
+ 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;;
+ 2)
+ ac_configure_args1="$ac_configure_args1 '$ac_arg'"
+ if test $ac_must_keep_next = true; then
+ ac_must_keep_next=false # Got value, back to normal.
+ else
+ case $ac_arg in
+ *=* | --config-cache | -C | -disable-* | --disable-* \
+ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
+ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
+ | -with-* | --with-* | -without-* | --without-* | --x)
+ case "$ac_configure_args0 " in
+ "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
+ esac
+ ;;
+ -* ) ac_must_keep_next=true ;;
+ esac
+ fi
+ ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'"
+ # Get rid of the leading space.
+ ac_sep=" "
+ ;;
+ esac
+ done
+done
+$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; }
+$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; }
+
+# When interrupted or exit'd, cleanup temporary files, and complete
+# config.log. We remove comments because anyway the quotes in there
+# would cause problems or look ugly.
+# WARNING: Be sure not to use single quotes in there, as some shells,
+# such as our DU 5.0 friend, will then `close' the trap.
+trap 'exit_status=$?
+ # Save into config.log some information that might help in debugging.
+ {
+ echo
+
+ cat <<\_ASBOX
+## ---------------- ##
+## Cache variables. ##
+## ---------------- ##
+_ASBOX
+ echo
+ # The following way of writing the cache mishandles newlines in values,
+{
+ (set) 2>&1 |
+ case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in
+ *ac_space=\ *)
+ sed -n \
+ "s/'"'"'/'"'"'\\\\'"'"''"'"'/g;
+ s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p"
+ ;;
+ *)
+ sed -n \
+ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
+ ;;
+ esac;
+}
+ echo
+
+ cat <<\_ASBOX
+## ----------------- ##
+## Output variables. ##
+## ----------------- ##
+_ASBOX
+ echo
+ for ac_var in $ac_subst_vars
+ do
+ eval ac_val=$`echo $ac_var`
+ echo "$ac_var='"'"'$ac_val'"'"'"
+ done | sort
+ echo
+
+ if test -n "$ac_subst_files"; then
+ cat <<\_ASBOX
+## ------------- ##
+## Output files. ##
+## ------------- ##
+_ASBOX
+ echo
+ for ac_var in $ac_subst_files
+ do
+ eval ac_val=$`echo $ac_var`
+ echo "$ac_var='"'"'$ac_val'"'"'"
+ done | sort
+ echo
+ fi
+
+ if test -s confdefs.h; then
+ cat <<\_ASBOX
+## ----------- ##
+## confdefs.h. ##
+## ----------- ##
+_ASBOX
+ echo
+ sed "/^$/d" confdefs.h | sort
+ echo
+ fi
+ test "$ac_signal" != 0 &&
+ echo "$as_me: caught signal $ac_signal"
+ echo "$as_me: exit $exit_status"
+ } >&5
+ rm -f core *.core &&
+ rm -rf conftest* confdefs* conf$$* $ac_clean_files &&
+ exit $exit_status
+ ' 0
+for ac_signal in 1 2 13 15; do
+ trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal
+done
+ac_signal=0
+
+# confdefs.h avoids OS command line length limits that DEFS can exceed.
+rm -rf conftest* confdefs.h
+# AIX cpp loses on an empty file, so make sure it contains at least a newline.
+echo >confdefs.h
+
+# Predefined preprocessor variables.
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_NAME "$PACKAGE_NAME"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_TARNAME "$PACKAGE_TARNAME"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_VERSION "$PACKAGE_VERSION"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_STRING "$PACKAGE_STRING"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
+_ACEOF
+
+
+# Let the site file select an alternate cache file if it wants to.
# Prefer explicitly selected file to automatically selected ones.
if test -z "$CONFIG_SITE"; then
if test "x$prefix" != xNONE; then
@@ -492,39 +1200,103 @@ if test -z "$CONFIG_SITE"; then
fi
for ac_site_file in $CONFIG_SITE; do
if test -r "$ac_site_file"; then
- echo "loading site script $ac_site_file"
+ { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5
+echo "$as_me: loading site script $ac_site_file" >&6;}
+ sed 's/^/| /' "$ac_site_file" >&5
. "$ac_site_file"
fi
done
if test -r "$cache_file"; then
- echo "loading cache $cache_file"
- . $cache_file
+ # Some versions of bash will fail to source /dev/null (special
+ # files actually), so we avoid doing that.
+ if test -f "$cache_file"; then
+ { echo "$as_me:$LINENO: loading cache $cache_file" >&5
+echo "$as_me: loading cache $cache_file" >&6;}
+ case $cache_file in
+ [\\/]* | ?:[\\/]* ) . $cache_file;;
+ *) . ./$cache_file;;
+ esac
+ fi
else
- echo "creating cache $cache_file"
- > $cache_file
+ { echo "$as_me:$LINENO: creating cache $cache_file" >&5
+echo "$as_me: creating cache $cache_file" >&6;}
+ >$cache_file
+fi
+
+# Check that the precious variables saved in the cache have kept the same
+# value.
+ac_cache_corrupted=false
+for ac_var in `(set) 2>&1 |
+ sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do
+ eval ac_old_set=\$ac_cv_env_${ac_var}_set
+ eval ac_new_set=\$ac_env_${ac_var}_set
+ eval ac_old_val="\$ac_cv_env_${ac_var}_value"
+ eval ac_new_val="\$ac_env_${ac_var}_value"
+ case $ac_old_set,$ac_new_set in
+ set,)
+ { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
+echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
+ ac_cache_corrupted=: ;;
+ ,set)
+ { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5
+echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
+ ac_cache_corrupted=: ;;
+ ,);;
+ *)
+ if test "x$ac_old_val" != "x$ac_new_val"; then
+ { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5
+echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
+ { echo "$as_me:$LINENO: former value: $ac_old_val" >&5
+echo "$as_me: former value: $ac_old_val" >&2;}
+ { echo "$as_me:$LINENO: current value: $ac_new_val" >&5
+echo "$as_me: current value: $ac_new_val" >&2;}
+ ac_cache_corrupted=:
+ fi;;
+ esac
+ # Pass precious variables to config.status.
+ if test "$ac_new_set" = set; then
+ case $ac_new_val in
+ *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
+ ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
+ *) ac_arg=$ac_var=$ac_new_val ;;
+ esac
+ case " $ac_configure_args " in
+ *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy.
+ *) ac_configure_args="$ac_configure_args '$ac_arg'" ;;
+ esac
+ fi
+done
+if $ac_cache_corrupted; then
+ { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5
+echo "$as_me: error: changes in the environment can compromise the build" >&2;}
+ { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
+echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
+ { (exit 1); exit 1; }; }
fi
ac_ext=c
-# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
-ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cc_cross
-
-ac_exeext=
-ac_objext=o
-if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
- # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
- if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
- ac_n= ac_c='
-' ac_t=' '
- else
- ac_n=-n ac_c= ac_t=
- fi
-else
- ac_n= ac_c='\c' ac_t=
-fi
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -533,6 +1305,7 @@ PACKAGE=`sed -n 's/.*package.*"\(.*\)".*/\1/p' $srcdir/include/version.h.in|tr -
+am__api_version="1.8"
ac_aux_dir=
for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
if test -f $ac_dir/install-sh; then
@@ -543,14 +1316,20 @@ for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
ac_aux_dir=$ac_dir
ac_install_sh="$ac_aux_dir/install.sh -c"
break
+ elif test -f $ac_dir/shtool; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/shtool install -c"
+ break
fi
done
if test -z "$ac_aux_dir"; then
- { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; }
+ { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5
+echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;}
+ { (exit 1); exit 1; }; }
fi
-ac_config_guess=$ac_aux_dir/config.guess
-ac_config_sub=$ac_aux_dir/config.sub
-ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
+ac_config_guess="$SHELL $ac_aux_dir/config.guess"
+ac_config_sub="$SHELL $ac_aux_dir/config.sub"
+ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
# Find a good install program. We prefer a C program (faster),
# so one script is as good as another. But avoid the broken or
@@ -559,583 +1338,1162 @@ ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
# SunOS /usr/etc/install
# IRIX /sbin/install
# AIX /bin/install
+# AmigaOS /C/install, which installs bootblocks on floppy discs
# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
# AFS /usr/afsws/bin/install, which mishandles nonexistent args
# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
+# OS/2's system install, which has a completely different semantic
# ./install, which can be erroneously created by make from ./install.sh.
-echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
-echo "configure:568: checking for a BSD compatible install" >&5
+echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
+echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6
if test -z "$INSTALL"; then
-if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":"
- for ac_dir in $PATH; do
- # Account for people who put trailing slashes in PATH elements.
- case "$ac_dir/" in
- /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
- *)
- # OSF1 and SCO ODT 3.0 have their own names for install.
- # Don't use installbsd from OSF since it installs stuff as root
- # by default.
- for ac_prog in ginstall scoinst install; do
- if test -f $ac_dir/$ac_prog; then
+if test "${ac_cv_path_install+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ # Account for people who put trailing slashes in PATH elements.
+case $as_dir/ in
+ ./ | .// | /cC/* | \
+ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
+ ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \
+ /usr/ucb/* ) ;;
+ *)
+ # OSF1 and SCO ODT 3.0 have their own names for install.
+ # Don't use installbsd from OSF since it installs stuff as root
+ # by default.
+ for ac_prog in ginstall scoinst install; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
if test $ac_prog = install &&
- grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
+ grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
# AIX install. It has an incompatible calling convention.
:
+ elif test $ac_prog = install &&
+ grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+ # program-specific install script used by HP pwplus--don't use.
+ :
else
- ac_cv_path_install="$ac_dir/$ac_prog -c"
- break 2
+ ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
+ break 3
fi
fi
done
- ;;
- esac
- done
- IFS="$ac_save_IFS"
+ done
+ ;;
+esac
+done
+
fi
if test "${ac_cv_path_install+set}" = set; then
- INSTALL="$ac_cv_path_install"
+ INSTALL=$ac_cv_path_install
else
# As a last resort, use the slow shell script. We don't cache a
# path for INSTALL within a source directory, because that will
# break other packages using the cache if that directory is
# removed, or if the path is relative.
- INSTALL="$ac_install_sh"
+ INSTALL=$ac_install_sh
fi
fi
-echo "$ac_t""$INSTALL" 1>&6
+echo "$as_me:$LINENO: result: $INSTALL" >&5
+echo "${ECHO_T}$INSTALL" >&6
# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
# It thinks the first close brace ends the variable substitution.
test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
-test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
+test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
-echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6
-echo "configure:621: checking whether build environment is sane" >&5
+echo "$as_me:$LINENO: checking whether build environment is sane" >&5
+echo $ECHO_N "checking whether build environment is sane... $ECHO_C" >&6
# Just in case
sleep 1
-echo timestamp > conftestfile
+echo timestamp > conftest.file
# Do `set' in a subshell so we don't clobber the current shell's
# arguments. Must try -L first in case configure is actually a
# symlink; some systems play weird games with the mod time of symlinks
# (eg FreeBSD returns the mod time of the symlink's containing
# directory).
if (
- set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
+ set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
if test "$*" = "X"; then
# -L didn't work.
- set X `ls -t $srcdir/configure conftestfile`
+ set X `ls -t $srcdir/configure conftest.file`
fi
- if test "$*" != "X $srcdir/configure conftestfile" \
- && test "$*" != "X conftestfile $srcdir/configure"; then
+ rm -f conftest.file
+ if test "$*" != "X $srcdir/configure conftest.file" \
+ && test "$*" != "X conftest.file $srcdir/configure"; then
# If neither matched, then we have a broken ls. This can happen
# if, for instance, CONFIG_SHELL is bash and it inherits a
# broken ls alias from the environment. This has actually
# happened. Such a system could not be considered "sane".
- { echo "configure: error: ls -t appears to fail. Make sure there is not a broken
-alias in your environment" 1>&2; exit 1; }
+ { { echo "$as_me:$LINENO: error: ls -t appears to fail. Make sure there is not a broken
+alias in your environment" >&5
+echo "$as_me: error: ls -t appears to fail. Make sure there is not a broken
+alias in your environment" >&2;}
+ { (exit 1); exit 1; }; }
fi
- test "$2" = conftestfile
+ test "$2" = conftest.file
)
then
# Ok.
:
else
- { echo "configure: error: newly created file is older than distributed files!
-Check your system clock" 1>&2; exit 1; }
-fi
-rm -f conftest*
-echo "$ac_t""yes" 1>&6
-if test "$program_transform_name" = s,x,x,; then
- program_transform_name=
-else
- # Double any \ or $. echo might interpret backslashes.
- cat <<\EOF_SED > conftestsed
-s,\\,\\\\,g; s,\$,$$,g
-EOF_SED
- program_transform_name="`echo $program_transform_name|sed -f conftestsed`"
- rm -f conftestsed
+ { { echo "$as_me:$LINENO: error: newly created file is older than distributed files!
+Check your system clock" >&5
+echo "$as_me: error: newly created file is older than distributed files!
+Check your system clock" >&2;}
+ { (exit 1); exit 1; }; }
fi
+echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
test "$program_prefix" != NONE &&
- program_transform_name="s,^,${program_prefix},; $program_transform_name"
+ program_transform_name="s,^,$program_prefix,;$program_transform_name"
# Use a double $ so make ignores it.
test "$program_suffix" != NONE &&
- program_transform_name="s,\$\$,${program_suffix},; $program_transform_name"
+ program_transform_name="s,\$,$program_suffix,;$program_transform_name"
+# Double any \ or $. echo might interpret backslashes.
+# By default was `s,x,x', remove it if useless.
+cat <<\_ACEOF >conftest.sed
+s/[\\$]/&&/g;s/;s,x,x,$//
+_ACEOF
+program_transform_name=`echo $program_transform_name | sed -f conftest.sed`
+rm conftest.sed
+
+# expand $ac_aux_dir to an absolute path
+am_aux_dir=`cd $ac_aux_dir && pwd`
+
+test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
+# Use eval to expand $SHELL
+if eval "$MISSING --run true"; then
+ am_missing_run="$MISSING --run "
+else
+ am_missing_run=
+ { echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5
+echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;}
+fi
+
+if mkdir -m 0755 -p -- . 2>/dev/null; then
+ mkdir_p='mkdir -m 0755 -p --'
+else
+ # On NextStep and OpenStep, the `mkdir' command does not
+ # recognize any option. It will interpret all options as
+ # directories to create, and then abort because `.' already
+ # exists.
+ for d in ./-m ./0755 ./-p ./--;
+ do
+ test -d $d && rmdir $d
+ done
+ # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists.
+ if test -f "$ac_aux_dir/mkinstalldirs"; then
+ mkdir_p='$(mkinstalldirs) -m 0755'
+ else
+ mkdir_p='$(install_sh) -m 0755 -d'
+ fi
+fi
+
+for ac_prog in gawk mawk nawk awk
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_AWK+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$AWK"; then
+ ac_cv_prog_AWK="$AWK" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_AWK="$ac_prog"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
-# sed with no file args requires a program.
-test "$program_transform_name" = "" && program_transform_name="s,x,x,"
+fi
+fi
+AWK=$ac_cv_prog_AWK
+if test -n "$AWK"; then
+ echo "$as_me:$LINENO: result: $AWK" >&5
+echo "${ECHO_T}$AWK" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+ test -n "$AWK" && break
+done
-echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
-echo "configure:678: checking whether ${MAKE-make} sets \${MAKE}" >&5
-set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5
+echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6
+set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,:./+-,___p_,'`
+if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- cat > conftestmake <<\EOF
+ cat >conftest.make <<\_ACEOF
all:
- @echo 'ac_maketemp="${MAKE}"'
-EOF
+ @echo 'ac_maketemp="$(MAKE)"'
+_ACEOF
# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
-eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=`
+eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=`
if test -n "$ac_maketemp"; then
eval ac_cv_prog_make_${ac_make}_set=yes
else
eval ac_cv_prog_make_${ac_make}_set=no
fi
-rm -f conftestmake
+rm -f conftest.make
fi
if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
- echo "$ac_t""yes" 1>&6
+ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
SET_MAKE=
else
- echo "$ac_t""no" 1>&6
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
SET_MAKE="MAKE=${MAKE-make}"
fi
+rm -rf .tst 2>/dev/null
+mkdir .tst 2>/dev/null
+if test -d .tst; then
+ am__leading_dot=.
+else
+ am__leading_dot=_
+fi
+rmdir .tst 2>/dev/null
-PACKAGE=$PACKAGE
-
-VERSION=$VERSION
+# test to see if srcdir already configured
+if test "`cd $srcdir && pwd`" != "`pwd`" &&
+ test -f $srcdir/config.status; then
+ { { echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5
+echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;}
+ { (exit 1); exit 1; }; }
+fi
-if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
- { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; }
+# test whether we have cygpath
+if test -z "$CYGPATH_W"; then
+ if (cygpath --version) >/dev/null 2>/dev/null; then
+ CYGPATH_W='cygpath -w'
+ else
+ CYGPATH_W=echo
+ fi
fi
-cat >> confdefs.h <<EOF
-#define PACKAGE "$PACKAGE"
-EOF
-cat >> confdefs.h <<EOF
-#define VERSION "$VERSION"
-EOF
+# Define the identity of the package.
+ PACKAGE=$PACKAGE
+ VERSION=$VERSION
-missing_dir=`cd $ac_aux_dir && pwd`
-echo $ac_n "checking for working aclocal""... $ac_c" 1>&6
-echo "configure:724: checking for working aclocal" >&5
-# Run test in a subshell; some versions of sh will print an error if
-# an executable is not found, even if stderr is redirected.
-# Redirect stdin to placate older versions of autoconf. Sigh.
-if (aclocal --version) < /dev/null > /dev/null 2>&1; then
- ACLOCAL=aclocal
- echo "$ac_t""found" 1>&6
-else
- ACLOCAL="$missing_dir/missing aclocal"
- echo "$ac_t""missing" 1>&6
-fi
+# Some tools Automake needs.
-echo $ac_n "checking for working autoconf""... $ac_c" 1>&6
-echo "configure:737: checking for working autoconf" >&5
-# Run test in a subshell; some versions of sh will print an error if
-# an executable is not found, even if stderr is redirected.
-# Redirect stdin to placate older versions of autoconf. Sigh.
-if (autoconf --version) < /dev/null > /dev/null 2>&1; then
- AUTOCONF=autoconf
- echo "$ac_t""found" 1>&6
-else
- AUTOCONF="$missing_dir/missing autoconf"
- echo "$ac_t""missing" 1>&6
-fi
+ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"}
-echo $ac_n "checking for working automake""... $ac_c" 1>&6
-echo "configure:750: checking for working automake" >&5
-# Run test in a subshell; some versions of sh will print an error if
-# an executable is not found, even if stderr is redirected.
-# Redirect stdin to placate older versions of autoconf. Sigh.
-if (automake --version) < /dev/null > /dev/null 2>&1; then
- AUTOMAKE=automake
- echo "$ac_t""found" 1>&6
-else
- AUTOMAKE="$missing_dir/missing automake"
- echo "$ac_t""missing" 1>&6
-fi
-echo $ac_n "checking for working autoheader""... $ac_c" 1>&6
-echo "configure:763: checking for working autoheader" >&5
-# Run test in a subshell; some versions of sh will print an error if
-# an executable is not found, even if stderr is redirected.
-# Redirect stdin to placate older versions of autoconf. Sigh.
-if (autoheader --version) < /dev/null > /dev/null 2>&1; then
- AUTOHEADER=autoheader
- echo "$ac_t""found" 1>&6
-else
- AUTOHEADER="$missing_dir/missing autoheader"
- echo "$ac_t""missing" 1>&6
-fi
+AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"}
-echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6
-echo "configure:776: checking for working makeinfo" >&5
-# Run test in a subshell; some versions of sh will print an error if
-# an executable is not found, even if stderr is redirected.
-# Redirect stdin to placate older versions of autoconf. Sigh.
-if (makeinfo --version) < /dev/null > /dev/null 2>&1; then
- MAKEINFO=makeinfo
- echo "$ac_t""found" 1>&6
-else
- MAKEINFO="$missing_dir/missing makeinfo"
- echo "$ac_t""missing" 1>&6
-fi
+AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"}
+AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"}
+MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
+AMTAR=${AMTAR-"${am_missing_run}tar"}
+install_sh=${install_sh-"$am_aux_dir/install-sh"}
-echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6
-echo "configure:797: checking whether to enable maintainer-specific portions of Makefiles" >&5
- # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given.
-if test "${enable_maintainer_mode+set}" = set; then
- enableval="$enable_maintainer_mode"
- USE_MAINTAINER_MODE=$enableval
+# Installed binaries are usually stripped using `strip' when the user
+# run `make install-strip'. However `strip' might not be the right
+# tool to use in cross-compilation environments, therefore Automake
+# will honor the `STRIP' environment variable to overrule this program.
+if test "$cross_compiling" != no; then
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
+set dummy ${ac_tool_prefix}strip; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_STRIP+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- USE_MAINTAINER_MODE=no
+ if test -n "$STRIP"; then
+ ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_STRIP="${ac_tool_prefix}strip"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+STRIP=$ac_cv_prog_STRIP
+if test -n "$STRIP"; then
+ echo "$as_me:$LINENO: result: $STRIP" >&5
+echo "${ECHO_T}$STRIP" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
fi
+if test -z "$ac_cv_prog_STRIP"; then
+ ac_ct_STRIP=$STRIP
+ # Extract the first word of "strip", so it can be a program name with args.
+set dummy strip; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$ac_ct_STRIP"; then
+ ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_STRIP="strip"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
- echo "$ac_t""$USE_MAINTAINER_MODE" 1>&6
-
+ test -z "$ac_cv_prog_ac_ct_STRIP" && ac_cv_prog_ac_ct_STRIP=":"
+fi
+fi
+ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
+if test -n "$ac_ct_STRIP"; then
+ echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5
+echo "${ECHO_T}$ac_ct_STRIP" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
-if test $USE_MAINTAINER_MODE = yes; then
- MAINTAINER_MODE_TRUE=
- MAINTAINER_MODE_FALSE='#'
+ STRIP=$ac_ct_STRIP
else
- MAINTAINER_MODE_TRUE='#'
- MAINTAINER_MODE_FALSE=
+ STRIP="$ac_cv_prog_STRIP"
fi
- MAINT=$MAINTAINER_MODE_TRUE
-
+
+fi
+INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
+
+# We need awk for the "check" target. The system "awk" is bad on
+# some platforms.
+
+
+
+
-subdirs="util"
# make sure MAKE sets ${MAKE}
# Extract the first word of "gmake", so it can be a program name with args.
set dummy gmake; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:827: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_path_MAKE'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_path_MAKE+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- case "$MAKE" in
- /*)
+ case $MAKE in
+ [\\/]* | ?:[\\/]*)
ac_cv_path_MAKE="$MAKE" # Let the user override the test with a path.
;;
- ?:/*)
- ac_cv_path_MAKE="$MAKE" # Let the user override the test with a dos path.
- ;;
*)
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
- ac_dummy="$PATH"
- for ac_dir in $ac_dummy; do
- test -z "$ac_dir" && ac_dir=.
- if test -f $ac_dir/$ac_word; then
- ac_cv_path_MAKE="$ac_dir/$ac_word"
- break
- fi
- done
- IFS="$ac_save_ifs"
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_path_MAKE="$as_dir/$ac_word$ac_exec_ext"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
test -z "$ac_cv_path_MAKE" && ac_cv_path_MAKE="no"
;;
esac
fi
-MAKE="$ac_cv_path_MAKE"
+MAKE=$ac_cv_path_MAKE
+
if test -n "$MAKE"; then
- echo "$ac_t""$MAKE" 1>&6
+ echo "$as_me:$LINENO: result: $MAKE" >&5
+echo "${ECHO_T}$MAKE" >&6
else
- echo "$ac_t""no" 1>&6
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
fi
if test $MAKE = no; then
unset ac_cv_path_MAKE
# Extract the first word of "make", so it can be a program name with args.
set dummy make; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:865: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_path_MAKE'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_path_MAKE+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- case "$MAKE" in
- /*)
+ case $MAKE in
+ [\\/]* | ?:[\\/]*)
ac_cv_path_MAKE="$MAKE" # Let the user override the test with a path.
;;
- ?:/*)
- ac_cv_path_MAKE="$MAKE" # Let the user override the test with a dos path.
- ;;
*)
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
- ac_dummy="$PATH"
- for ac_dir in $ac_dummy; do
- test -z "$ac_dir" && ac_dir=.
- if test -f $ac_dir/$ac_word; then
- ac_cv_path_MAKE="$ac_dir/$ac_word"
- break
- fi
- done
- IFS="$ac_save_ifs"
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_path_MAKE="$as_dir/$ac_word$ac_exec_ext"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
test -z "$ac_cv_path_MAKE" && ac_cv_path_MAKE="no"
;;
esac
fi
-MAKE="$ac_cv_path_MAKE"
+MAKE=$ac_cv_path_MAKE
+
if test -n "$MAKE"; then
- echo "$ac_t""$MAKE" 1>&6
+ echo "$as_me:$LINENO: result: $MAKE" >&5
+echo "${ECHO_T}$MAKE" >&6
else
- echo "$ac_t""no" 1>&6
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
fi
if test $MAKE = no; then
- { echo "configure: error: can't locate a make." 1>&2; exit 1; }
+ { { echo "$as_me:$LINENO: error: can't locate a make." >&5
+echo "$as_me: error: can't locate a make." >&2;}
+ { (exit 1); exit 1; }; }
exit 1
fi
fi
-echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
-echo "configure:904: checking whether ${MAKE-make} sets \${MAKE}" >&5
-set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5
+echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6
+set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,:./+-,___p_,'`
+if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- cat > conftestmake <<\EOF
+ cat >conftest.make <<\_ACEOF
all:
- @echo 'ac_maketemp="${MAKE}"'
-EOF
+ @echo 'ac_maketemp="$(MAKE)"'
+_ACEOF
# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
-eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=`
+eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=`
if test -n "$ac_maketemp"; then
eval ac_cv_prog_make_${ac_make}_set=yes
else
eval ac_cv_prog_make_${ac_make}_set=no
fi
-rm -f conftestmake
+rm -f conftest.make
fi
if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
- echo "$ac_t""yes" 1>&6
+ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
SET_MAKE=
else
- echo "$ac_t""no" 1>&6
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
SET_MAKE="MAKE=${MAKE-make}"
fi
# compiler specifics
-# Extract the first word of "gcc", so it can be a program name with args.
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}gcc; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_CC="${ac_tool_prefix}gcc"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$ac_cv_prog_CC"; then
+ ac_ct_CC=$CC
+ # Extract the first word of "gcc", so it can be a program name with args.
set dummy gcc; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:935: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$ac_ct_CC"; then
+ ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_CC="gcc"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+ echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+echo "${ECHO_T}$ac_ct_CC" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+ CC=$ac_ct_CC
+else
+ CC="$ac_cv_prog_CC"
+fi
+
+if test -z "$CC"; then
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}cc; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
if test -n "$CC"; then
ac_cv_prog_CC="$CC" # Let the user override the test.
else
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
- ac_dummy="$PATH"
- for ac_dir in $ac_dummy; do
- test -z "$ac_dir" && ac_dir=.
- if test -f $ac_dir/$ac_word; then
- ac_cv_prog_CC="gcc"
- break
- fi
- done
- IFS="$ac_save_ifs"
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_CC="${ac_tool_prefix}cc"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
fi
fi
-CC="$ac_cv_prog_CC"
+CC=$ac_cv_prog_CC
if test -n "$CC"; then
- echo "$ac_t""$CC" 1>&6
+ echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6
else
- echo "$ac_t""no" 1>&6
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
fi
+if test -z "$ac_cv_prog_CC"; then
+ ac_ct_CC=$CC
+ # Extract the first word of "cc", so it can be a program name with args.
+set dummy cc; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$ac_ct_CC"; then
+ ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_CC="cc"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+ echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+echo "${ECHO_T}$ac_ct_CC" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+ CC=$ac_ct_CC
+else
+ CC="$ac_cv_prog_CC"
+fi
+
+fi
if test -z "$CC"; then
# Extract the first word of "cc", so it can be a program name with args.
set dummy cc; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:965: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
if test -n "$CC"; then
ac_cv_prog_CC="$CC" # Let the user override the test.
else
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
ac_prog_rejected=no
- ac_dummy="$PATH"
- for ac_dir in $ac_dummy; do
- test -z "$ac_dir" && ac_dir=.
- if test -f $ac_dir/$ac_word; then
- if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
- ac_prog_rejected=yes
- continue
- fi
- ac_cv_prog_CC="cc"
- break
- fi
- done
- IFS="$ac_save_ifs"
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
+ ac_prog_rejected=yes
+ continue
+ fi
+ ac_cv_prog_CC="cc"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
if test $ac_prog_rejected = yes; then
# We found a bogon in the path, so make sure we never use it.
set dummy $ac_cv_prog_CC
shift
- if test $# -gt 0; then
+ if test $# != 0; then
# We chose a different compiler from the bogus one.
# However, it has the same basename, so the bogon will be chosen
# first if we set CC to just the basename; use the full file name.
shift
- set dummy "$ac_dir/$ac_word" "$@"
- shift
- ac_cv_prog_CC="$@"
+ ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
fi
fi
fi
fi
-CC="$ac_cv_prog_CC"
+CC=$ac_cv_prog_CC
if test -n "$CC"; then
- echo "$ac_t""$CC" 1>&6
+ echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6
else
- echo "$ac_t""no" 1>&6
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
fi
- if test -z "$CC"; then
- case "`uname -s`" in
- *win32* | *WIN32*)
- # Extract the first word of "cl", so it can be a program name with args.
-set dummy cl; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1016: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+fi
+if test -z "$CC"; then
+ if test -n "$ac_tool_prefix"; then
+ for ac_prog in cl
+ do
+ # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
if test -n "$CC"; then
ac_cv_prog_CC="$CC" # Let the user override the test.
else
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
- ac_dummy="$PATH"
- for ac_dir in $ac_dummy; do
- test -z "$ac_dir" && ac_dir=.
- if test -f $ac_dir/$ac_word; then
- ac_cv_prog_CC="cl"
- break
- fi
- done
- IFS="$ac_save_ifs"
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
fi
fi
-CC="$ac_cv_prog_CC"
+CC=$ac_cv_prog_CC
if test -n "$CC"; then
- echo "$ac_t""$CC" 1>&6
+ echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6
else
- echo "$ac_t""no" 1>&6
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
fi
- ;;
- esac
+
+ test -n "$CC" && break
+ done
+fi
+if test -z "$CC"; then
+ ac_ct_CC=$CC
+ for ac_prog in cl
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$ac_ct_CC"; then
+ ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_CC="$ac_prog"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
fi
- test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
+done
+done
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+ echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+echo "${ECHO_T}$ac_ct_CC" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
fi
-echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:1048: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+ test -n "$ac_ct_CC" && break
+done
-ac_ext=c
-# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cc_cross
-
-cat > conftest.$ac_ext << EOF
-
-#line 1059 "configure"
-#include "confdefs.h"
-
-main(){return(0);}
-EOF
-if { (eval echo configure:1064: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- ac_cv_prog_cc_works=yes
- # If we can't run a trivial program, we are probably using a cross compiler.
- if (./conftest; exit) 2>/dev/null; then
- ac_cv_prog_cc_cross=no
+ CC=$ac_ct_CC
+fi
+
+fi
+
+
+test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH
+See \`config.log' for more details." >&5
+echo "$as_me: error: no acceptable C compiler found in \$PATH
+See \`config.log' for more details." >&2;}
+ { (exit 1); exit 1; }; }
+
+# Provide some information about the compiler.
+echo "$as_me:$LINENO:" \
+ "checking for C compiler version" >&5
+ac_compiler=`set X $ac_compile; echo $2`
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5
+ (eval $ac_compiler --version </dev/null >&5) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v </dev/null >&5\"") >&5
+ (eval $ac_compiler -v </dev/null >&5) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V </dev/null >&5\"") >&5
+ (eval $ac_compiler -V </dev/null >&5) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files a.out a.exe b.out"
+# Try to create an executable without -o first, disregard a.out.
+# It will help us diagnose broken compilers, and finding out an intuition
+# of exeext.
+echo "$as_me:$LINENO: checking for C compiler default output file name" >&5
+echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6
+ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
+if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5
+ (eval $ac_link_default) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; then
+ # Find the output, starting from the most likely. This scheme is
+# not robust to junk in `.', hence go to wildcards (a.*) only as a last
+# resort.
+
+# Be careful to initialize this variable, since it used to be cached.
+# Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile.
+ac_cv_exeext=
+# b.out is created by i960 compilers.
+for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out
+do
+ test -f "$ac_file" || continue
+ case $ac_file in
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj )
+ ;;
+ conftest.$ac_ext )
+ # This is the source file.
+ ;;
+ [ab].out )
+ # We found the default executable, but exeext='' is most
+ # certainly right.
+ break;;
+ *.* )
+ ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+ # FIXME: I believe we export ac_cv_exeext for Libtool,
+ # but it would be cool to find out if it's true. Does anybody
+ # maintain Libtool? --akim.
+ export ac_cv_exeext
+ break;;
+ * )
+ break;;
+ esac
+done
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { echo "$as_me:$LINENO: error: C compiler cannot create executables
+See \`config.log' for more details." >&5
+echo "$as_me: error: C compiler cannot create executables
+See \`config.log' for more details." >&2;}
+ { (exit 77); exit 77; }; }
+fi
+
+ac_exeext=$ac_cv_exeext
+echo "$as_me:$LINENO: result: $ac_file" >&5
+echo "${ECHO_T}$ac_file" >&6
+
+# Check the compiler produces executables we can run. If not, either
+# the compiler is broken, or we cross compile.
+echo "$as_me:$LINENO: checking whether the C compiler works" >&5
+echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6
+# FIXME: These cross compiler hacks should be removed for Autoconf 3.0
+# If not cross compiling, check that we can run a simple program.
+if test "$cross_compiling" != yes; then
+ if { ac_try='./$ac_file'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ cross_compiling=no
else
- ac_cv_prog_cc_cross=yes
+ if test "$cross_compiling" = maybe; then
+ cross_compiling=yes
+ else
+ { { echo "$as_me:$LINENO: error: cannot run C compiled programs.
+If you meant to cross compile, use \`--host'.
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot run C compiled programs.
+If you meant to cross compile, use \`--host'.
+See \`config.log' for more details." >&2;}
+ { (exit 1); exit 1; }; }
+ fi
fi
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- ac_cv_prog_cc_works=no
fi
-rm -fr conftest*
-ac_ext=c
-# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cc_cross
-
-echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
-if test $ac_cv_prog_cc_works = no; then
- { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
-fi
-echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:1090: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
-echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
-cross_compiling=$ac_cv_prog_cc_cross
-
-echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
-echo "configure:1095: checking whether we are using GNU C" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.c <<EOF
-#ifdef __GNUC__
- yes;
-#endif
-EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1104: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
- ac_cv_prog_gcc=yes
+echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+
+rm -f a.out a.exe conftest$ac_cv_exeext b.out
+ac_clean_files=$ac_clean_files_save
+# Check the compiler produces executables we can run. If not, either
+# the compiler is broken, or we cross compile.
+echo "$as_me:$LINENO: checking whether we are cross compiling" >&5
+echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6
+echo "$as_me:$LINENO: result: $cross_compiling" >&5
+echo "${ECHO_T}$cross_compiling" >&6
+
+echo "$as_me:$LINENO: checking for suffix of executables" >&5
+echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; then
+ # If both `conftest.exe' and `conftest' are `present' (well, observable)
+# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will
+# work properly (i.e., refer to `conftest.exe'), while it won't with
+# `rm'.
+for ac_file in conftest.exe conftest conftest.*; do
+ test -f "$ac_file" || continue
+ case $ac_file in
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;;
+ *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+ export ac_cv_exeext
+ break;;
+ * ) break;;
+ esac
+done
else
- ac_cv_prog_gcc=no
-fi
-fi
-
-echo "$ac_t""$ac_cv_prog_gcc" 1>&6
+ { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+
+rm -f conftest$ac_cv_exeext
+echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5
+echo "${ECHO_T}$ac_cv_exeext" >&6
+
+rm -f conftest.$ac_ext
+EXEEXT=$ac_cv_exeext
+ac_exeext=$EXEEXT
+echo "$as_me:$LINENO: checking for suffix of object files" >&5
+echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6
+if test "${ac_cv_objext+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
-if test $ac_cv_prog_gcc = yes; then
- GCC=yes
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.o conftest.obj
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; then
+ for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do
+ case $ac_file in
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;;
+ *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
+ break;;
+ esac
+done
else
- GCC=
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot compute suffix of object files: cannot compile
+See \`config.log' for more details." >&2;}
+ { (exit 1); exit 1; }; }
fi
-ac_test_CFLAGS="${CFLAGS+set}"
-ac_save_CFLAGS="$CFLAGS"
-CFLAGS=
-echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:1123: checking whether ${CC-cc} accepts -g" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+rm -f conftest.$ac_cv_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_objext" >&5
+echo "${ECHO_T}$ac_cv_objext" >&6
+OBJEXT=$ac_cv_objext
+ac_objext=$OBJEXT
+echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5
+echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6
+if test "${ac_cv_c_compiler_gnu+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- echo 'void f(){}' > conftest.c
-if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+#ifndef __GNUC__
+ choke me
+#endif
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_compiler_gnu=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_compiler_gnu=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_c_compiler_gnu=$ac_compiler_gnu
+
+fi
+echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5
+echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6
+GCC=`test $ac_compiler_gnu = yes && echo yes`
+ac_test_CFLAGS=${CFLAGS+set}
+ac_save_CFLAGS=$CFLAGS
+CFLAGS="-g"
+echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5
+echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6
+if test "${ac_cv_prog_cc_g+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
ac_cv_prog_cc_g=yes
else
- ac_cv_prog_cc_g=no
-fi
-rm -f conftest*
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+ac_cv_prog_cc_g=no
fi
-
-echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5
+echo "${ECHO_T}$ac_cv_prog_cc_g" >&6
if test "$ac_test_CFLAGS" = set; then
- CFLAGS="$ac_save_CFLAGS"
+ CFLAGS=$ac_save_CFLAGS
elif test $ac_cv_prog_cc_g = yes; then
if test "$GCC" = yes; then
CFLAGS="-g -O2"
@@ -1149,29 +2507,19 @@ else
CFLAGS=
fi
fi
-
-
-
-
-echo $ac_n "checking for ${CC-cc} option to accept ANSI C""... $ac_c" 1>&6
-echo "configure:1158: checking for ${CC-cc} option to accept ANSI C" >&5
-if eval "test \"`echo '$''{'am_cv_prog_cc_stdc'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- am_cv_prog_cc_stdc=no
-ac_save_CC="$CC"
-# Don't try gcc -ansi; that turns off useful extensions and
-# breaks some systems' header files.
-# AIX -qlanglvl=ansi
-# Ultrix and OSF/1 -std1
-# HP-UX -Aa -D_HPUX_SOURCE
-# SVR4 -Xc -D__EXTENSIONS__
-for ac_arg in "" -qlanglvl=ansi -std1 "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
-do
- CC="$ac_save_CC $ac_arg"
- cat > conftest.$ac_ext <<EOF
-#line 1174 "configure"
-#include "confdefs.h"
+echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5
+echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6
+if test "${ac_cv_prog_cc_stdc+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_cv_prog_cc_stdc=no
+ac_save_CC=$CC
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
#include <stdarg.h>
#include <stdio.h>
#include <sys/types.h>
@@ -1194,177 +2542,743 @@ static char *f (char * (*g) (char **, int), char **p, ...)
va_end (v);
return s;
}
+
+/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has
+ function prototypes and stuff, but not '\xHH' hex character constants.
+ These don't provoke an error unfortunately, instead are silently treated
+ as 'x'. The following induces an error, until -std1 is added to get
+ proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an
+ array size at least. It's necessary to write '\x00'==0 to get something
+ that's true only with -std1. */
+int osf4_cc_array ['\x00' == 0 ? 1 : -1];
+
int test (int i, double x);
struct s1 {int (*f) (int a);};
struct s2 {int (*f) (double a);};
int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
int argc;
char **argv;
+int
+main ()
+{
+return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
+ ;
+ return 0;
+}
+_ACEOF
+# Don't try gcc -ansi; that turns off useful extensions and
+# breaks some systems' header files.
+# AIX -qlanglvl=ansi
+# Ultrix and OSF/1 -std1
+# HP-UX 10.20 and later -Ae
+# HP-UX older versions -Aa -D_HPUX_SOURCE
+# SVR4 -Xc -D__EXTENSIONS__
+for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+do
+ CC="$ac_save_CC $ac_arg"
+ rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_prog_cc_stdc=$ac_arg
+break
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext
+done
+rm -f conftest.$ac_ext conftest.$ac_objext
+CC=$ac_save_CC
-int main() {
+fi
-return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
+case "x$ac_cv_prog_cc_stdc" in
+ x|xno)
+ echo "$as_me:$LINENO: result: none needed" >&5
+echo "${ECHO_T}none needed" >&6 ;;
+ *)
+ echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5
+echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6
+ CC="$CC $ac_cv_prog_cc_stdc" ;;
+esac
-; return 0; }
-EOF
-if { (eval echo configure:1211: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
- am_cv_prog_cc_stdc="$ac_arg"; break
+# Some people use a C++ compiler to compile C. Since we use `exit',
+# in C++ we need to declare it. In case someone uses the same compiler
+# for both compiling C and C++ we need to have the C++ compiler decide
+# the declaration of exit, since it's the most demanding environment.
+cat >conftest.$ac_ext <<_ACEOF
+#ifndef __cplusplus
+ choke me
+#endif
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ for ac_declaration in \
+ '' \
+ 'extern "C" void std::exit (int) throw (); using std::exit;' \
+ 'extern "C" void std::exit (int); using std::exit;' \
+ 'extern "C" void exit (int) throw ();' \
+ 'extern "C" void exit (int);' \
+ 'void exit (int);'
+do
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_declaration
+#include <stdlib.h>
+int
+main ()
+{
+exit (42);
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ :
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
-fi
-rm -f conftest*
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+continue
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_declaration
+int
+main ()
+{
+exit (42);
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ break
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
done
-CC="$ac_save_CC"
+rm -f conftest*
+if test -n "$ac_declaration"; then
+ echo '#ifdef __cplusplus' >>confdefs.h
+ echo $ac_declaration >>confdefs.h
+ echo '#endif' >>confdefs.h
+fi
+
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+DEPDIR="${am__leading_dot}deps"
+
+ ac_config_commands="$ac_config_commands depfiles"
+
+
+am_make=${MAKE-make}
+cat > confinc << 'END'
+am__doit:
+ @echo done
+.PHONY: am__doit
+END
+# If we don't find an include directive, just comment out the code.
+echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5
+echo $ECHO_N "checking for style of include used by $am_make... $ECHO_C" >&6
+am__include="#"
+am__quote=
+_am_result=none
+# First try GNU make style include.
+echo "include confinc" > confmf
+# We grep out `Entering directory' and `Leaving directory'
+# messages which can occur if `w' ends up in MAKEFLAGS.
+# In particular we don't look at `^make:' because GNU make might
+# be invoked under some other name (usually "gmake"), in which
+# case it prints its new name instead of `make'.
+if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
+ am__include=include
+ am__quote=
+ _am_result=GNU
+fi
+# Now try BSD make style include.
+if test "$am__include" = "#"; then
+ echo '.include "confinc"' > confmf
+ if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
+ am__include=.include
+ am__quote="\""
+ _am_result=BSD
+ fi
+fi
+
+
+echo "$as_me:$LINENO: result: $_am_result" >&5
+echo "${ECHO_T}$_am_result" >&6
+rm -f confinc confmf
+# Check whether --enable-dependency-tracking or --disable-dependency-tracking was given.
+if test "${enable_dependency_tracking+set}" = set; then
+ enableval="$enable_dependency_tracking"
+
+fi;
+if test "x$enable_dependency_tracking" != xno; then
+ am_depcomp="$ac_aux_dir/depcomp"
+ AMDEPBACKSLASH='\'
fi
-if test -z "$am_cv_prog_cc_stdc"; then
- echo "$ac_t""none needed" 1>&6
+
+if test "x$enable_dependency_tracking" != xno; then
+ AMDEP_TRUE=
+ AMDEP_FALSE='#'
else
- echo "$ac_t""$am_cv_prog_cc_stdc" 1>&6
+ AMDEP_TRUE='#'
+ AMDEP_FALSE=
+fi
+
+
+
+
+depcc="$CC" am_compiler_list=
+
+echo "$as_me:$LINENO: checking dependency style of $depcc" >&5
+echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6
+if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+ # We make a subdir and do the tests there. Otherwise we can end up
+ # making bogus files that we don't know about and never remove. For
+ # instance it was reported that on HP-UX the gcc test will end up
+ # making a dummy file named `D' -- because `-MD' means `put the output
+ # in D'.
+ mkdir conftest.dir
+ # Copy depcomp to subdir because otherwise we won't find it if we're
+ # using a relative directory.
+ cp "$am_depcomp" conftest.dir
+ cd conftest.dir
+ # We will build objects and dependencies in a subdirectory because
+ # it helps to detect inapplicable dependency modes. For instance
+ # both Tru64's cc and ICC support -MD to output dependencies as a
+ # side effect of compilation, but ICC will put the dependencies in
+ # the current directory while Tru64 will put them in the object
+ # directory.
+ mkdir sub
+
+ am_cv_CC_dependencies_compiler_type=none
+ if test "$am_compiler_list" = ""; then
+ am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
+ fi
+ for depmode in $am_compiler_list; do
+ # Setup a source with many dependencies, because some compilers
+ # like to wrap large dependency lists on column 80 (with \), and
+ # we should not choose a depcomp mode which is confused by this.
+ #
+ # We need to recreate these files for each test, as the compiler may
+ # overwrite some of them when testing with obscure command lines.
+ # This happens at least with the AIX C compiler.
+ : > sub/conftest.c
+ for i in 1 2 3 4 5 6; do
+ echo '#include "conftst'$i'.h"' >> sub/conftest.c
+ : > sub/conftst$i.h
+ done
+ echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+
+ case $depmode in
+ nosideeffect)
+ # after this tag, mechanisms are not by side-effect, so they'll
+ # only be used when explicitly requested
+ if test "x$enable_dependency_tracking" = xyes; then
+ continue
+ else
+ break
+ fi
+ ;;
+ none) break ;;
+ esac
+ # We check with `-c' and `-o' for the sake of the "dashmstdout"
+ # mode. It turns out that the SunPro C++ compiler does not properly
+ # handle `-M -o', and we need to detect this.
+ if depmode=$depmode \
+ source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
+ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+ $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
+ >/dev/null 2>conftest.err &&
+ grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+ grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
+ ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+ # icc doesn't choke on unknown options, it will just issue warnings
+ # (even with -Werror). So we grep stderr for any message
+ # that says an option was ignored.
+ if grep 'ignoring option' conftest.err >/dev/null 2>&1; then :; else
+ am_cv_CC_dependencies_compiler_type=$depmode
+ break
+ fi
+ fi
+ done
+
+ cd ..
+ rm -rf conftest.dir
+else
+ am_cv_CC_dependencies_compiler_type=none
+fi
+
+fi
+echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5
+echo "${ECHO_T}$am_cv_CC_dependencies_compiler_type" >&6
+CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
+
+
+
+if
+ test "x$enable_dependency_tracking" != xno \
+ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then
+ am__fastdepCC_TRUE=
+ am__fastdepCC_FALSE='#'
+else
+ am__fastdepCC_TRUE='#'
+ am__fastdepCC_FALSE=
+fi
+
+
+echo "$as_me:$LINENO: checking for function prototypes" >&5
+echo $ECHO_N "checking for function prototypes... $ECHO_C" >&6
+if test "$ac_cv_prog_cc_stdc" != no; then
+ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+
+cat >>confdefs.h <<\_ACEOF
+#define PROTOTYPES 1
+_ACEOF
+
+
+cat >>confdefs.h <<\_ACEOF
+#define __PROTOTYPES 1
+_ACEOF
+
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
fi
-case "x$am_cv_prog_cc_stdc" in
- x|xno) ;;
- *) CC="$CC $am_cv_prog_cc_stdc" ;;
-esac
-echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:1235: checking how to run the C preprocessor" >&5
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5
+echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6
# On Suns, sometimes $CPP names a directory.
if test -n "$CPP" && test -d "$CPP"; then
CPP=
fi
if test -z "$CPP"; then
-if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- # This must be in double quotes, not single quotes, because CPP may get
- # substituted into the Makefile and "${CC-cc}" will confuse make.
- CPP="${CC-cc} -E"
+ if test "${ac_cv_prog_CPP+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ # Double quotes because CPP needs to be expanded
+ for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
+ do
+ ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+ # Use a header file that comes with gcc, so configuring glibc
+ # with a fresh cross-compiler works.
+ # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ # <limits.h> exists even on freestanding compilers.
# On the NeXT, cc -E runs the code through the compiler's parser,
- # not just through cpp.
- cat > conftest.$ac_ext <<EOF
-#line 1250 "configure"
-#include "confdefs.h"
-#include <assert.h>
-Syntax Error
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1256: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
- :
+ # not just through cpp. "Syntax error" is here to catch this case.
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+ Syntax error
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+ else
+ ac_cpp_err=
+ fi
else
- echo "$ac_err" >&5
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- CPP="${CC-cc} -E -traditional-cpp"
- cat > conftest.$ac_ext <<EOF
-#line 1267 "configure"
-#include "confdefs.h"
-#include <assert.h>
-Syntax Error
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1273: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
:
else
- echo "$ac_err" >&5
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- CPP="${CC-cc} -nologo -E"
- cat > conftest.$ac_ext <<EOF
-#line 1284 "configure"
-#include "confdefs.h"
-#include <assert.h>
-Syntax Error
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1290: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
- :
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.$ac_ext
+
+ # OK, works on sane cases. Now check whether non-existent headers
+ # can be detected and how.
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <ac_nonexistent.h>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+ else
+ ac_cpp_err=
+ fi
else
- echo "$ac_err" >&5
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- CPP=/lib/cpp
+ ac_cpp_err=yes
fi
-rm -f conftest*
+if test -z "$ac_cpp_err"; then
+ # Broken: success on invalid input.
+continue
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ # Passes both tests.
+ac_preproc_ok=:
+break
fi
-rm -f conftest*
+rm -f conftest.err conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then
+ break
fi
-rm -f conftest*
- ac_cv_prog_CPP="$CPP"
+
+ done
+ ac_cv_prog_CPP=$CPP
+
fi
- CPP="$ac_cv_prog_CPP"
+ CPP=$ac_cv_prog_CPP
else
- ac_cv_prog_CPP="$CPP"
+ ac_cv_prog_CPP=$CPP
fi
-echo "$ac_t""$CPP" 1>&6
+echo "$as_me:$LINENO: result: $CPP" >&5
+echo "${ECHO_T}$CPP" >&6
+ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+ # Use a header file that comes with gcc, so configuring glibc
+ # with a fresh cross-compiler works.
+ # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ # <limits.h> exists even on freestanding compilers.
+ # On the NeXT, cc -E runs the code through the compiler's parser,
+ # not just through cpp. "Syntax error" is here to catch this case.
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+ Syntax error
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ :
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.$ac_ext
+
+ # OK, works on sane cases. Now check whether non-existent headers
+ # can be detected and how.
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <ac_nonexistent.h>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ # Broken: success on invalid input.
+continue
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+ # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.$ac_ext
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then
+ :
+else
+ { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details." >&5
+echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details." >&2;}
+ { (exit 1); exit 1; }; }
+fi
-echo $ac_n "checking for function prototypes""... $ac_c" 1>&6
-echo "configure:1317: checking for function prototypes" >&5
-if test "$am_cv_prog_cc_stdc" != no; then
- echo "$ac_t""yes" 1>&6
- cat >> confdefs.h <<\EOF
-#define PROTOTYPES 1
-EOF
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
- U= ANSI2KNR=
+
+echo "$as_me:$LINENO: checking for egrep" >&5
+echo $ECHO_N "checking for egrep... $ECHO_C" >&6
+if test "${ac_cv_prog_egrep+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- echo "$ac_t""no" 1>&6
- U=_ ANSI2KNR=./ansi2knr
- # Ensure some checks needed by ansi2knr itself.
- echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:1330: checking for ANSI C header files" >&5
-if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 1335 "configure"
-#include "confdefs.h"
+ if echo a | (grep -E '(a|b)') >/dev/null 2>&1
+ then ac_cv_prog_egrep='grep -E'
+ else ac_cv_prog_egrep='egrep'
+ fi
+fi
+echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5
+echo "${ECHO_T}$ac_cv_prog_egrep" >&6
+ EGREP=$ac_cv_prog_egrep
+
+
+echo "$as_me:$LINENO: checking for ANSI C header files" >&5
+echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
+if test "${ac_cv_header_stdc+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
#include <stdlib.h>
#include <stdarg.h>
#include <string.h>
#include <float.h>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1343: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
- rm -rf conftest*
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
ac_cv_header_stdc=yes
else
- echo "$ac_err" >&5
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- ac_cv_header_stdc=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_header_stdc=no
fi
-rm -f conftest*
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
if test $ac_cv_header_stdc = yes; then
# SunOS 4.x string.h does not declare mem*, contrary to ANSI.
-cat > conftest.$ac_ext <<EOF
-#line 1360 "configure"
-#include "confdefs.h"
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
#include <string.h>
-EOF
+
+_ACEOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- egrep "memchr" >/dev/null 2>&1; then
+ $EGREP "memchr" >/dev/null 2>&1; then
:
else
- rm -rf conftest*
ac_cv_header_stdc=no
fi
rm -f conftest*
@@ -1373,16 +3287,19 @@ fi
if test $ac_cv_header_stdc = yes; then
# ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
-cat > conftest.$ac_ext <<EOF
-#line 1378 "configure"
-#include "confdefs.h"
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
#include <stdlib.h>
-EOF
+
+_ACEOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- egrep "free" >/dev/null 2>&1; then
+ $EGREP "free" >/dev/null 2>&1; then
:
else
- rm -rf conftest*
ac_cv_header_stdc=no
fi
rm -f conftest*
@@ -1391,360 +3308,822 @@ fi
if test $ac_cv_header_stdc = yes; then
# /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
-if test "$cross_compiling" = yes; then
+ if test "$cross_compiling" = yes; then
:
else
- cat > conftest.$ac_ext <<EOF
-#line 1399 "configure"
-#include "confdefs.h"
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
#include <ctype.h>
-#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
-#define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
-#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
-int main () { int i; for (i = 0; i < 256; i++)
-if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
-exit (0); }
+#if ((' ' & 0x0FF) == 0x020)
+# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
+# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
+#else
+# define ISLOWER(c) \
+ (('a' <= (c) && (c) <= 'i') \
+ || ('j' <= (c) && (c) <= 'r') \
+ || ('s' <= (c) && (c) <= 'z'))
+# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
+#endif
-EOF
-if { (eval echo configure:1410: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
-then
+#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
+int
+main ()
+{
+ int i;
+ for (i = 0; i < 256; i++)
+ if (XOR (islower (i), ISLOWER (i))
+ || toupper (i) != TOUPPER (i))
+ exit(2);
+ exit (0);
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
:
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -fr conftest*
- ac_cv_header_stdc=no
+ echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+ac_cv_header_stdc=no
fi
-rm -fr conftest*
+rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi
-
fi
fi
-
-echo "$ac_t""$ac_cv_header_stdc" 1>&6
+echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
+echo "${ECHO_T}$ac_cv_header_stdc" >&6
if test $ac_cv_header_stdc = yes; then
- cat >> confdefs.h <<\EOF
+
+cat >>confdefs.h <<\_ACEOF
#define STDC_HEADERS 1
-EOF
+_ACEOF
fi
- for ac_hdr in string.h
+# On IRIX 5.3, sys/types and inttypes.h are conflicting.
+
+
+
+
+
+
+
+
+
+for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
+ inttypes.h stdint.h unistd.h
do
-ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:1437: checking for $ac_hdr" >&5
-if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ eval "$as_ac_Header=yes"
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+eval "$as_ac_Header=no"
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+
+if test "$ac_cv_prog_cc_stdc" != no; then
+ U= ANSI2KNR=
else
- cat > conftest.$ac_ext <<EOF
-#line 1442 "configure"
-#include "confdefs.h"
-#include <$ac_hdr>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1447: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
- rm -rf conftest*
- eval "ac_cv_header_$ac_safe=yes"
+ U=_ ANSI2KNR=./ansi2knr
+fi
+# Ensure some checks needed by ansi2knr itself.
+
+
+for ac_header in string.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+else
+ # Is the header compilable?
+echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_header_compiler=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_header_compiler=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+
+# Is the header present?
+echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <$ac_header>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+ else
+ ac_cpp_err=
+ fi
else
- echo "$ac_err" >&5
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_header_$ac_safe=no"
+ ac_cpp_err=yes
fi
-rm -f conftest*
+if test -z "$ac_cpp_err"; then
+ ac_header_preproc=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_header_preproc=no
fi
-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_hdr 1
-EOF
-
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+ yes:no: )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+ ac_header_preproc=yes
+ ;;
+ no:yes:* )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+ (
+ cat <<\_ASBOX
+## ------------------------------------------ ##
+## Report this to the AC_PACKAGE_NAME lists. ##
+## ------------------------------------------ ##
+_ASBOX
+ ) |
+ sed "s/^/$as_me: WARNING: /" >&2
+ ;;
+esac
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- echo "$ac_t""no" 1>&6
+ eval "$as_ac_Header=\$ac_header_preproc"
fi
-done
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
-echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:1476: checking how to run the C preprocessor" >&5
+fi
+
+done
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5
+echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6
# On Suns, sometimes $CPP names a directory.
if test -n "$CPP" && test -d "$CPP"; then
CPP=
fi
if test -z "$CPP"; then
-if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- # This must be in double quotes, not single quotes, because CPP may get
- # substituted into the Makefile and "${CC-cc}" will confuse make.
- CPP="${CC-cc} -E"
+ if test "${ac_cv_prog_CPP+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ # Double quotes because CPP needs to be expanded
+ for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
+ do
+ ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+ # Use a header file that comes with gcc, so configuring glibc
+ # with a fresh cross-compiler works.
+ # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ # <limits.h> exists even on freestanding compilers.
# On the NeXT, cc -E runs the code through the compiler's parser,
- # not just through cpp.
- cat > conftest.$ac_ext <<EOF
-#line 1491 "configure"
-#include "confdefs.h"
-#include <assert.h>
-Syntax Error
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1497: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
- :
+ # not just through cpp. "Syntax error" is here to catch this case.
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+ Syntax error
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+ else
+ ac_cpp_err=
+ fi
else
- echo "$ac_err" >&5
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- CPP="${CC-cc} -E -traditional-cpp"
- cat > conftest.$ac_ext <<EOF
-#line 1508 "configure"
-#include "confdefs.h"
-#include <assert.h>
-Syntax Error
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1514: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
:
else
- echo "$ac_err" >&5
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- CPP="${CC-cc} -nologo -E"
- cat > conftest.$ac_ext <<EOF
-#line 1525 "configure"
-#include "confdefs.h"
-#include <assert.h>
-Syntax Error
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1531: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.$ac_ext
+
+ # OK, works on sane cases. Now check whether non-existent headers
+ # can be detected and how.
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <ac_nonexistent.h>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ # Broken: success on invalid input.
+continue
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then
+ break
+fi
+
+ done
+ ac_cv_prog_CPP=$CPP
+
+fi
+ CPP=$ac_cv_prog_CPP
+else
+ ac_cv_prog_CPP=$CPP
+fi
+echo "$as_me:$LINENO: result: $CPP" >&5
+echo "${ECHO_T}$CPP" >&6
+ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+ # Use a header file that comes with gcc, so configuring glibc
+ # with a fresh cross-compiler works.
+ # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ # <limits.h> exists even on freestanding compilers.
+ # On the NeXT, cc -E runs the code through the compiler's parser,
+ # not just through cpp. "Syntax error" is here to catch this case.
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+ Syntax error
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
:
else
- echo "$ac_err" >&5
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- CPP=/lib/cpp
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.$ac_ext
+
+ # OK, works on sane cases. Now check whether non-existent headers
+ # can be detected and how.
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <ac_nonexistent.h>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
fi
-rm -f conftest*
+if test -z "$ac_cpp_err"; then
+ # Broken: success on invalid input.
+continue
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ # Passes both tests.
+ac_preproc_ok=:
+break
fi
-rm -f conftest*
+rm -f conftest.err conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then
+ :
+else
+ { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details." >&5
+echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details." >&2;}
+ { (exit 1); exit 1; }; }
fi
-rm -f conftest*
- ac_cv_prog_CPP="$CPP"
-fi
- CPP="$ac_cv_prog_CPP"
-else
- ac_cv_prog_CPP="$CPP"
-fi
-echo "$ac_t""$CPP" 1>&6
-
-echo $ac_n "checking for working const""... $ac_c" 1>&6
-echo "configure:1556: checking for working const" >&5
-if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 1561 "configure"
-#include "confdefs.h"
-
-int main() {
-
-/* Ultrix mips cc rejects this. */
-typedef int charset[2]; const charset x;
-/* SunOS 4.1.1 cc rejects this. */
-char const *const *ccp;
-char **p;
-/* NEC SVR4.0.2 mips cc rejects this. */
-struct point {int x, y;};
-static struct point const zero = {0,0};
-/* AIX XL C 1.02.0.0 rejects this.
- It does not let you subtract one const X* pointer from another in an arm
- of an if-expression whose if-part is not a constant expression */
-const char *g = "string";
-ccp = &g + (g ? g-g : 0);
-/* HPUX 7.0 cc rejects these. */
-++ccp;
-p = (char**) ccp;
-ccp = (char const *const *) p;
-{ /* SCO 3.2v4 cc rejects this. */
- char *t;
- char const *s = 0 ? (char *) 0 : (char const *) 0;
-
- *t++ = 0;
-}
-{ /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */
- int x[] = {25, 17};
- const int *foo = &x[0];
- ++foo;
-}
-{ /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
- typedef const int *iptr;
- iptr p = 0;
- ++p;
-}
-{ /* AIX XL C 1.02.0.0 rejects this saying
- "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
- struct s { int j; const int *ap[3]; };
- struct s *b; b->j = 5;
-}
-{ /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
- const int foo = 10;
-}
-; return 0; }
-EOF
-if { (eval echo configure:1610: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5
+echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6
+if test "${ac_cv_c_const+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+/* FIXME: Include the comments suggested by Paul. */
+#ifndef __cplusplus
+ /* Ultrix mips cc rejects this. */
+ typedef int charset[2];
+ const charset x;
+ /* SunOS 4.1.1 cc rejects this. */
+ char const *const *ccp;
+ char **p;
+ /* NEC SVR4.0.2 mips cc rejects this. */
+ struct point {int x, y;};
+ static struct point const zero = {0,0};
+ /* AIX XL C 1.02.0.0 rejects this.
+ It does not let you subtract one const X* pointer from another in
+ an arm of an if-expression whose if-part is not a constant
+ expression */
+ const char *g = "string";
+ ccp = &g + (g ? g-g : 0);
+ /* HPUX 7.0 cc rejects these. */
+ ++ccp;
+ p = (char**) ccp;
+ ccp = (char const *const *) p;
+ { /* SCO 3.2v4 cc rejects this. */
+ char *t;
+ char const *s = 0 ? (char *) 0 : (char const *) 0;
+
+ *t++ = 0;
+ }
+ { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */
+ int x[] = {25, 17};
+ const int *foo = &x[0];
+ ++foo;
+ }
+ { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
+ typedef const int *iptr;
+ iptr p = 0;
+ ++p;
+ }
+ { /* AIX XL C 1.02.0.0 rejects this saying
+ "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
+ struct s { int j; const int *ap[3]; };
+ struct s *b; b->j = 5;
+ }
+ { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
+ const int foo = 10;
+ }
+#endif
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
ac_cv_c_const=yes
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- ac_cv_c_const=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_c_const=no
fi
-rm -f conftest*
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
-
-echo "$ac_t""$ac_cv_c_const" 1>&6
+echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5
+echo "${ECHO_T}$ac_cv_c_const" >&6
if test $ac_cv_c_const = no; then
- cat >> confdefs.h <<\EOF
-#define const
-EOF
+
+cat >>confdefs.h <<\_ACEOF
+#define const
+_ACEOF
fi
-echo $ac_n "checking for inline""... $ac_c" 1>&6
-echo "configure:1631: checking for inline" >&5
-if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+echo "$as_me:$LINENO: checking for inline" >&5
+echo $ECHO_N "checking for inline... $ECHO_C" >&6
+if test "${ac_cv_c_inline+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
ac_cv_c_inline=no
for ac_kw in inline __inline__ __inline; do
- cat > conftest.$ac_ext <<EOF
-#line 1638 "configure"
-#include "confdefs.h"
-
-int main() {
-} $ac_kw foo() {
-; return 0; }
-EOF
-if { (eval echo configure:1645: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#ifndef __cplusplus
+typedef int foo_t;
+static $ac_kw foo_t static_foo () {return 0; }
+$ac_kw foo_t foo () {return 0; }
+#endif
+
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
ac_cv_c_inline=$ac_kw; break
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
fi
-rm -f conftest*
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
done
fi
+echo "$as_me:$LINENO: result: $ac_cv_c_inline" >&5
+echo "${ECHO_T}$ac_cv_c_inline" >&6
-echo "$ac_t""$ac_cv_c_inline" 1>&6
-case "$ac_cv_c_inline" in
+
+case $ac_cv_c_inline in
inline | yes) ;;
- no) cat >> confdefs.h <<\EOF
-#define inline
-EOF
- ;;
- *) cat >> confdefs.h <<EOF
-#define inline $ac_cv_c_inline
-EOF
- ;;
+ *)
+ case $ac_cv_c_inline in
+ no) ac_val=;;
+ *) ac_val=$ac_cv_c_inline;;
+ esac
+ cat >>confdefs.h <<_ACEOF
+#ifndef __cplusplus
+#define inline $ac_val
+#endif
+_ACEOF
+ ;;
esac
-
-
-echo $ac_n "checking for preprocessor stringizing operator""... $ac_c" 1>&6
-echo "configure:1673: checking for preprocessor stringizing operator" >&5
-if eval "test \"`echo '$''{'ac_cv_c_stringize'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 1678 "configure"
-#include "confdefs.h"
-
+echo "$as_me:$LINENO: checking for preprocessor stringizing operator" >&5
+echo $ECHO_N "checking for preprocessor stringizing operator... $ECHO_C" >&6
+if test "${ac_cv_c_stringize+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
#define x(y) #y
char *s = x(teststring);
-
-EOF
+_ACEOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- egrep "#teststring" >/dev/null 2>&1; then
- rm -rf conftest*
+ $EGREP "#teststring" >/dev/null 2>&1; then
ac_cv_c_stringize=no
else
- rm -rf conftest*
ac_cv_c_stringize=yes
fi
rm -f conftest*
fi
+echo "$as_me:$LINENO: result: $ac_cv_c_stringize" >&5
+echo "${ECHO_T}$ac_cv_c_stringize" >&6
+if test $ac_cv_c_stringize = yes; then
-if test "${ac_cv_c_stringize}" = yes
-then
- cat >> confdefs.h <<\EOF
+cat >>confdefs.h <<\_ACEOF
#define HAVE_STRINGIZE 1
-EOF
+_ACEOF
fi
-echo "$ac_t""${ac_cv_c_stringize}" 1>&6
# check includes/headers
-echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:1710: checking for ANSI C header files" >&5
-if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 1715 "configure"
-#include "confdefs.h"
+echo "$as_me:$LINENO: checking for ANSI C header files" >&5
+echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
+if test "${ac_cv_header_stdc+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
#include <stdlib.h>
#include <stdarg.h>
#include <string.h>
#include <float.h>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1723: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
- rm -rf conftest*
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
ac_cv_header_stdc=yes
else
- echo "$ac_err" >&5
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- ac_cv_header_stdc=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_header_stdc=no
fi
-rm -f conftest*
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
if test $ac_cv_header_stdc = yes; then
# SunOS 4.x string.h does not declare mem*, contrary to ANSI.
-cat > conftest.$ac_ext <<EOF
-#line 1740 "configure"
-#include "confdefs.h"
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
#include <string.h>
-EOF
+
+_ACEOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- egrep "memchr" >/dev/null 2>&1; then
+ $EGREP "memchr" >/dev/null 2>&1; then
:
else
- rm -rf conftest*
ac_cv_header_stdc=no
fi
rm -f conftest*
@@ -1753,16 +4132,19 @@ fi
if test $ac_cv_header_stdc = yes; then
# ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
-cat > conftest.$ac_ext <<EOF
-#line 1758 "configure"
-#include "confdefs.h"
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
#include <stdlib.h>
-EOF
+
+_ACEOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- egrep "free" >/dev/null 2>&1; then
+ $EGREP "free" >/dev/null 2>&1; then
:
else
- rm -rf conftest*
ac_cv_header_stdc=no
fi
rm -f conftest*
@@ -1771,237 +4153,666 @@ fi
if test $ac_cv_header_stdc = yes; then
# /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
-if test "$cross_compiling" = yes; then
+ if test "$cross_compiling" = yes; then
:
else
- cat > conftest.$ac_ext <<EOF
-#line 1779 "configure"
-#include "confdefs.h"
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
#include <ctype.h>
-#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
-#define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
-#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
-int main () { int i; for (i = 0; i < 256; i++)
-if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
-exit (0); }
+#if ((' ' & 0x0FF) == 0x020)
+# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
+# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
+#else
+# define ISLOWER(c) \
+ (('a' <= (c) && (c) <= 'i') \
+ || ('j' <= (c) && (c) <= 'r') \
+ || ('s' <= (c) && (c) <= 'z'))
+# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
+#endif
-EOF
-if { (eval echo configure:1790: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
-then
+#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
+int
+main ()
+{
+ int i;
+ for (i = 0; i < 256; i++)
+ if (XOR (islower (i), ISLOWER (i))
+ || toupper (i) != TOUPPER (i))
+ exit(2);
+ exit (0);
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
:
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -fr conftest*
- ac_cv_header_stdc=no
+ echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+ac_cv_header_stdc=no
fi
-rm -fr conftest*
+rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi
-
fi
fi
-
-echo "$ac_t""$ac_cv_header_stdc" 1>&6
+echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
+echo "${ECHO_T}$ac_cv_header_stdc" >&6
if test $ac_cv_header_stdc = yes; then
- cat >> confdefs.h <<\EOF
+
+cat >>confdefs.h <<\_ACEOF
#define STDC_HEADERS 1
-EOF
+_ACEOF
fi
-for ac_hdr in limits.h memory.h siginfo.h string.h strings.h unistd.h
+
+
+
+
+
+
+for ac_header in limits.h memory.h siginfo.h string.h strings.h unistd.h
do
-ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:1817: checking for $ac_hdr" >&5
-if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 1822 "configure"
-#include "confdefs.h"
-#include <$ac_hdr>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1827: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
- rm -rf conftest*
- eval "ac_cv_header_$ac_safe=yes"
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+else
+ # Is the header compilable?
+echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_header_compiler=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_header_compiler=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+
+# Is the header present?
+echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <$ac_header>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+ else
+ ac_cpp_err=
+ fi
else
- echo "$ac_err" >&5
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_header_$ac_safe=no"
+ ac_cpp_err=yes
fi
-rm -f conftest*
+if test -z "$ac_cpp_err"; then
+ ac_header_preproc=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_header_preproc=no
fi
-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_hdr 1
-EOF
-
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+ yes:no: )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+ ac_header_preproc=yes
+ ;;
+ no:yes:* )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+ (
+ cat <<\_ASBOX
+## ------------------------------------------ ##
+## Report this to the AC_PACKAGE_NAME lists. ##
+## ------------------------------------------ ##
+_ASBOX
+ ) |
+ sed "s/^/$as_me: WARNING: /" >&2
+ ;;
+esac
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- echo "$ac_t""no" 1>&6
+ eval "$as_ac_Header=\$ac_header_preproc"
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
fi
+
done
-for ac_hdr in errno.h fcntl.h sys/types.h sys/wait.h
+
+
+
+
+for ac_header in errno.h fcntl.h sys/types.h sys/wait.h
do
-ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:1858: checking for $ac_hdr" >&5
-if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 1863 "configure"
-#include "confdefs.h"
-#include <$ac_hdr>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1868: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
- rm -rf conftest*
- eval "ac_cv_header_$ac_safe=yes"
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+else
+ # Is the header compilable?
+echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_header_compiler=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_header_compiler=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+
+# Is the header present?
+echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <$ac_header>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+ else
+ ac_cpp_err=
+ fi
else
- echo "$ac_err" >&5
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_header_$ac_safe=no"
+ ac_cpp_err=yes
fi
-rm -f conftest*
+if test -z "$ac_cpp_err"; then
+ ac_header_preproc=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_header_preproc=no
fi
-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_hdr 1
-EOF
-
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+ yes:no: )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+ ac_header_preproc=yes
+ ;;
+ no:yes:* )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+ (
+ cat <<\_ASBOX
+## ------------------------------------------ ##
+## Report this to the AC_PACKAGE_NAME lists. ##
+## ------------------------------------------ ##
+_ASBOX
+ ) |
+ sed "s/^/$as_me: WARNING: /" >&2
+ ;;
+esac
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- echo "$ac_t""no" 1>&6
+ eval "$as_ac_Header=\$ac_header_preproc"
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
fi
+
done
-for ac_hdr in sysexits.h
+
+for ac_header in sysexits.h
do
-ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:1898: checking for $ac_hdr" >&5
-if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 1903 "configure"
-#include "confdefs.h"
-#include <$ac_hdr>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1908: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
- rm -rf conftest*
- eval "ac_cv_header_$ac_safe=yes"
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+else
+ # Is the header compilable?
+echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_header_compiler=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_header_compiler=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+
+# Is the header present?
+echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <$ac_header>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+ else
+ ac_cpp_err=
+ fi
else
- echo "$ac_err" >&5
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_header_$ac_safe=no"
+ ac_cpp_err=yes
fi
-rm -f conftest*
+if test -z "$ac_cpp_err"; then
+ ac_header_preproc=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_header_preproc=no
fi
-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_hdr 1
-EOF
-
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+ yes:no: )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+ ac_header_preproc=yes
+ ;;
+ no:yes:* )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+ (
+ cat <<\_ASBOX
+## ------------------------------------------ ##
+## Report this to the AC_PACKAGE_NAME lists. ##
+## ------------------------------------------ ##
+_ASBOX
+ ) |
+ sed "s/^/$as_me: WARNING: /" >&2
+ ;;
+esac
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- echo "$ac_t""no" 1>&6
+ eval "$as_ac_Header=\$ac_header_preproc"
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
fi
+
done
# check functions
+
+
+
+
+
+
+
+
+
+
+
+
+
for ac_func in memcpy memmove memset bcopy bzero strerror strchr strrchr \
strstr strtok strrtok index rindex
do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:1940: checking for $ac_func" >&5
-if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 1945 "configure"
-#include "confdefs.h"
+as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
+if eval "test \"\${$as_ac_var+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+ For example, HP-UX 11i <limits.h> declares gettimeofday. */
+#define $ac_func innocuous_$ac_func
+
/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char $ac_func(); below. */
-#include <assert.h>
-/* Override any gcc2 internal prototype to avoid an error. */
-/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
-char $ac_func();
+ which can conflict with char $ac_func (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
-int main() {
+#undef $ac_func
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char $ac_func ();
/* The GNU C library defines this for functions which it implements
to always fail with ENOSYS. Some functions are actually named
something starting with __ and the normal name is an alias. */
#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
choke me
#else
-$ac_func();
+char (*f) () = $ac_func;
+#endif
+#ifdef __cplusplus
+}
#endif
-; return 0; }
-EOF
-if { (eval echo configure:1968: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
-fi
+int
+main ()
+{
+return f != $ac_func;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ eval "$as_ac_var=yes"
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+eval "$as_ac_var=no"
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+if test `eval echo '${'$as_ac_var'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
-EOF
-
-else
- echo "$ac_t""no" 1>&6
fi
done
# type checks
-echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
-echo "configure:1995: checking return type of signal handlers" >&5
-if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 2000 "configure"
-#include "confdefs.h"
+echo "$as_me:$LINENO: checking return type of signal handlers" >&5
+echo $ECHO_N "checking return type of signal handlers... $ECHO_C" >&6
+if test "${ac_cv_type_signal+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
#include <sys/types.h>
#include <signal.h>
#ifdef signal
-#undef signal
+# undef signal
#endif
#ifdef __cplusplus
extern "C" void (*signal (int, void (*)(int)))(int);
@@ -2009,163 +4820,263 @@ extern "C" void (*signal (int, void (*)(int)))(int);
void (*signal ()) ();
#endif
-int main() {
+int
+main ()
+{
int i;
-; return 0; }
-EOF
-if { (eval echo configure:2017: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
ac_cv_type_signal=void
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- ac_cv_type_signal=int
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_type_signal=int
fi
-rm -f conftest*
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
+echo "$as_me:$LINENO: result: $ac_cv_type_signal" >&5
+echo "${ECHO_T}$ac_cv_type_signal" >&6
-echo "$ac_t""$ac_cv_type_signal" 1>&6
-cat >> confdefs.h <<EOF
+cat >>confdefs.h <<_ACEOF
#define RETSIGTYPE $ac_cv_type_signal
-EOF
-
-
-echo $ac_n "checking for size_t""... $ac_c" 1>&6
-echo "configure:2036: checking for size_t" >&5
-if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 2041 "configure"
-#include "confdefs.h"
-#include <sys/types.h>
-#if STDC_HEADERS
-#include <stdlib.h>
-#include <stddef.h>
-#endif
-EOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- egrep "(^|[^a-zA-Z_0-9])size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
- rm -rf conftest*
+_ACEOF
+
+
+echo "$as_me:$LINENO: checking for size_t" >&5
+echo $ECHO_N "checking for size_t... $ECHO_C" >&6
+if test "${ac_cv_type_size_t+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+if ((size_t *) 0)
+ return 0;
+if (sizeof (size_t))
+ return 0;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
ac_cv_type_size_t=yes
else
- rm -rf conftest*
- ac_cv_type_size_t=no
-fi
-rm -f conftest*
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+ac_cv_type_size_t=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
-echo "$ac_t""$ac_cv_type_size_t" 1>&6
-if test $ac_cv_type_size_t = no; then
- cat >> confdefs.h <<\EOF
+echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5
+echo "${ECHO_T}$ac_cv_type_size_t" >&6
+if test $ac_cv_type_size_t = yes; then
+ :
+else
+
+cat >>confdefs.h <<_ACEOF
#define size_t unsigned
-EOF
+_ACEOF
fi
-# Check for a preference for using mail addresses like rancid+admin-group
-# instead of the standard rancid-admin-group
-echo $ac_n "checking whether mail addresses should be in the rancid+ form""... $ac_c" 1>&6
-echo "configure:2072: checking whether mail addresses should be in the rancid+ form" >&5
+# Package-specific options/knobs
+#
+# Check for a preference for using mail addresses like rancid+group
+# instead of the standard rancid-group
+echo "$as_me:$LINENO: checking whether mail addresses should be in the rancid+ form" >&5
+echo $ECHO_N "checking whether mail addresses should be in the rancid+ form... $ECHO_C" >&6
# Check whether --enable-mail-plus or --disable-mail-plus was given.
if test "${enable_mail_plus+set}" = set; then
enableval="$enable_mail_plus"
if test "$enable_mail_plus" = yes; then
- echo "$ac_t""yes" 1>&6
+ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
MAILPLUS="rancid+"
-
+
else
- echo "$ac_t""no" 1>&6
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
MAILPLUS="rancid-"
-
+
fi
else
- echo "$ac_t""no" 1>&6
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
MAILPLUS="rancid-"
-
-fi
+fi;
rd_cv_MAILPLUS=$MAILPLUS
+# Check for a preference for using mail addresses like rancid+admin-group
+# instead of the standard rancid-admin-group
+echo "$as_me:$LINENO: checking whether admin mail addresses should be in the rancid+ form" >&5
+echo $ECHO_N "checking whether admin mail addresses should be in the rancid+ form... $ECHO_C" >&6
+# Check whether --enable-adminmail-plus or --disable-adminmail-plus was given.
+if test "${enable_adminmail_plus+set}" = set; then
+ enableval="$enable_adminmail_plus"
+ if test "$enable_adminmail_plus" = yes; then
+ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+ ADMINMAILPLUS="rancid-admin+"
+
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+ ADMINMAILPLUS="${MAILPLUS}admin-"
+
+fi
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+ ADMINMAILPLUS="${MAILPLUS}admin-"
+
+
+fi;
+rd_cv_ADMINMAILPLUS=$ADMINMAILPLUS
+
# Extract the first word of "dirname", so it can be a program name with args.
set dummy dirname; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2097: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_path_DIRNAME'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_path_DIRNAME+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- case "$DIRNAME" in
- /*)
+ case $DIRNAME in
+ [\\/]* | ?:[\\/]*)
ac_cv_path_DIRNAME="$DIRNAME" # Let the user override the test with a path.
;;
- ?:/*)
- ac_cv_path_DIRNAME="$DIRNAME" # Let the user override the test with a dos path.
- ;;
*)
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
- ac_dummy="$PATH"
- for ac_dir in $ac_dummy; do
- test -z "$ac_dir" && ac_dir=.
- if test -f $ac_dir/$ac_word; then
- ac_cv_path_DIRNAME="$ac_dir/$ac_word"
- break
- fi
- done
- IFS="$ac_save_ifs"
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_path_DIRNAME="$as_dir/$ac_word$ac_exec_ext"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
test -z "$ac_cv_path_DIRNAME" && ac_cv_path_DIRNAME="no"
;;
esac
fi
-DIRNAME="$ac_cv_path_DIRNAME"
+DIRNAME=$ac_cv_path_DIRNAME
+
if test -n "$DIRNAME"; then
- echo "$ac_t""$DIRNAME" 1>&6
+ echo "$as_me:$LINENO: result: $DIRNAME" >&5
+echo "${ECHO_T}$DIRNAME" >&6
else
- echo "$ac_t""no" 1>&6
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
fi
-# locate GNU diff (-u option)
+# locate GNU diff (one supporting the -u option)
# Extract the first word of "diff", so it can be a program name with args.
set dummy diff; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2134: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_path_DIFF'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_path_DIFF+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- case "$DIFF" in
- /*)
+ case $DIFF in
+ [\\/]* | ?:[\\/]*)
ac_cv_path_DIFF="$DIFF" # Let the user override the test with a path.
;;
- ?:/*)
- ac_cv_path_DIFF="$DIFF" # Let the user override the test with a dos path.
- ;;
*)
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
- ac_dummy="/usr/local/bin:/usr/gnu/bin:/usr/bin:/usr/contrib/bin"
- for ac_dir in $ac_dummy; do
- test -z "$ac_dir" && ac_dir=.
- if test -f $ac_dir/$ac_word; then
- ac_cv_path_DIFF="$ac_dir/$ac_word"
- break
- fi
- done
- IFS="$ac_save_ifs"
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+as_dummy="/usr/local/bin:/usr/gnu/bin:/usr/bin:/usr/contrib/bin"
+for as_dir in $as_dummy
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_path_DIFF="$as_dir/$ac_word$ac_exec_ext"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
test -z "$ac_cv_path_DIFF" && ac_cv_path_DIFF="no"
;;
esac
fi
-DIFF="$ac_cv_path_DIFF"
+DIFF=$ac_cv_path_DIFF
+
if test -n "$DIFF"; then
- echo "$ac_t""$DIFF" 1>&6
+ echo "$as_me:$LINENO: result: $DIFF" >&5
+echo "${ECHO_T}$DIFF" >&6
else
- echo "$ac_t""no" 1>&6
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
fi
if test $DIFF = no; then
unset ac_cv_path_DIFF
- { echo "configure: error: can't locate diff." 1>&2; exit 1; }
+ { { echo "$as_me:$LINENO: error: can't locate diff." >&5
+echo "$as_me: error: can't locate diff." >&2;}
+ { (exit 1); exit 1; }; }
else
$DIFF -u /dev/null /dev/null > /dev/null 2>&1
if test $? -ne 0; then
@@ -2173,7 +5084,9 @@ else
if test $? -ne 0; then
$DIFF -c2 /dev/null /dev/null > /dev/null 2>&1
if test $? -ne 0; then
- { echo "configure: error: can't locate a diff which accepts the -u option." 1>&2; exit 1; }
+ { { echo "$as_me:$LINENO: error: can't locate a diff which accepts the -u option." >&5
+echo "$as_me: error: can't locate a diff which accepts the -u option." >&2;}
+ { (exit 1); exit 1; }; }
exit 1
else
DIFF_CMD="diff -c4"
@@ -2190,38 +5103,43 @@ rd_cv_DIFF_CMD=$DIFF_CMD
# Extract the first word of "sendmail", so it can be a program name with args.
set dummy sendmail; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2195: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_path_SENDMAIL'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_path_SENDMAIL+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- case "$SENDMAIL" in
- /*)
+ case $SENDMAIL in
+ [\\/]* | ?:[\\/]*)
ac_cv_path_SENDMAIL="$SENDMAIL" # Let the user override the test with a path.
;;
- ?:/*)
- ac_cv_path_SENDMAIL="$SENDMAIL" # Let the user override the test with a dos path.
- ;;
*)
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
- ac_dummy="/usr/sbin:/usr/bin:/usr/lib"
- for ac_dir in $ac_dummy; do
- test -z "$ac_dir" && ac_dir=.
- if test -f $ac_dir/$ac_word; then
- ac_cv_path_SENDMAIL="$ac_dir/$ac_word"
- break
- fi
- done
- IFS="$ac_save_ifs"
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+as_dummy="/usr/sbin:/usr/bin:/usr/lib"
+for as_dir in $as_dummy
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_path_SENDMAIL="$as_dir/$ac_word$ac_exec_ext"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
test -z "$ac_cv_path_SENDMAIL" && ac_cv_path_SENDMAIL="no"
;;
esac
fi
-SENDMAIL="$ac_cv_path_SENDMAIL"
+SENDMAIL=$ac_cv_path_SENDMAIL
+
if test -n "$SENDMAIL"; then
- echo "$ac_t""$SENDMAIL" 1>&6
+ echo "$as_me:$LINENO: result: $SENDMAIL" >&5
+echo "${ECHO_T}$SENDMAIL" >&6
else
- echo "$ac_t""no" 1>&6
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
fi
@@ -2229,71 +5147,83 @@ fi
# is good enough -- if we can't find GNU tar, we don't really care.
for ac_prog in gnutar gtar tar
do
-# Extract the first word of "$ac_prog", so it can be a program name with args.
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2236: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_TAR'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_TAR+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
if test -n "$TAR"; then
ac_cv_prog_TAR="$TAR" # Let the user override the test.
else
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
- ac_dummy="$PATH"
- for ac_dir in $ac_dummy; do
- test -z "$ac_dir" && ac_dir=.
- if test -f $ac_dir/$ac_word; then
- ac_cv_prog_TAR="$ac_prog"
- break
- fi
- done
- IFS="$ac_save_ifs"
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_TAR="$ac_prog"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
fi
fi
-TAR="$ac_cv_prog_TAR"
+TAR=$ac_cv_prog_TAR
if test -n "$TAR"; then
- echo "$ac_t""$TAR" 1>&6
+ echo "$as_me:$LINENO: result: $TAR" >&5
+echo "${ECHO_T}$TAR" >&6
else
- echo "$ac_t""no" 1>&6
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
fi
-test -n "$TAR" && break
+ test -n "$TAR" && break
done
for ac_prog in automake
do
-# Extract the first word of "$ac_prog", so it can be a program name with args.
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2271: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_AUTOMAKE'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_AUTOMAKE+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
if test -n "$AUTOMAKE"; then
ac_cv_prog_AUTOMAKE="$AUTOMAKE" # Let the user override the test.
else
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
- ac_dummy="$PATH"
- for ac_dir in $ac_dummy; do
- test -z "$ac_dir" && ac_dir=.
- if test -f $ac_dir/$ac_word; then
- ac_cv_prog_AUTOMAKE="$ac_prog"
- break
- fi
- done
- IFS="$ac_save_ifs"
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_AUTOMAKE="$ac_prog"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
fi
fi
-AUTOMAKE="$ac_cv_prog_AUTOMAKE"
+AUTOMAKE=$ac_cv_prog_AUTOMAKE
if test -n "$AUTOMAKE"; then
- echo "$ac_t""$AUTOMAKE" 1>&6
+ echo "$as_me:$LINENO: result: $AUTOMAKE" >&5
+echo "${ECHO_T}$AUTOMAKE" >&6
else
- echo "$ac_t""no" 1>&6
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
fi
-test -n "$AUTOMAKE" && break
+ test -n "$AUTOMAKE" && break
done
@@ -2304,144 +5234,171 @@ done
# SunOS /usr/etc/install
# IRIX /sbin/install
# AIX /bin/install
+# AmigaOS /C/install, which installs bootblocks on floppy discs
# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
# AFS /usr/afsws/bin/install, which mishandles nonexistent args
# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
+# OS/2's system install, which has a completely different semantic
# ./install, which can be erroneously created by make from ./install.sh.
-echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
-echo "configure:2313: checking for a BSD compatible install" >&5
+echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
+echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6
if test -z "$INSTALL"; then
-if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":"
- for ac_dir in $PATH; do
- # Account for people who put trailing slashes in PATH elements.
- case "$ac_dir/" in
- /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
- *)
- # OSF1 and SCO ODT 3.0 have their own names for install.
- # Don't use installbsd from OSF since it installs stuff as root
- # by default.
- for ac_prog in ginstall scoinst install; do
- if test -f $ac_dir/$ac_prog; then
+if test "${ac_cv_path_install+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ # Account for people who put trailing slashes in PATH elements.
+case $as_dir/ in
+ ./ | .// | /cC/* | \
+ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
+ ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \
+ /usr/ucb/* ) ;;
+ *)
+ # OSF1 and SCO ODT 3.0 have their own names for install.
+ # Don't use installbsd from OSF since it installs stuff as root
+ # by default.
+ for ac_prog in ginstall scoinst install; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
if test $ac_prog = install &&
- grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
+ grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
# AIX install. It has an incompatible calling convention.
:
+ elif test $ac_prog = install &&
+ grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+ # program-specific install script used by HP pwplus--don't use.
+ :
else
- ac_cv_path_install="$ac_dir/$ac_prog -c"
- break 2
+ ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
+ break 3
fi
fi
done
- ;;
- esac
- done
- IFS="$ac_save_IFS"
+ done
+ ;;
+esac
+done
+
fi
if test "${ac_cv_path_install+set}" = set; then
- INSTALL="$ac_cv_path_install"
+ INSTALL=$ac_cv_path_install
else
# As a last resort, use the slow shell script. We don't cache a
# path for INSTALL within a source directory, because that will
# break other packages using the cache if that directory is
# removed, or if the path is relative.
- INSTALL="$ac_install_sh"
+ INSTALL=$ac_install_sh
fi
fi
-echo "$ac_t""$INSTALL" 1>&6
+echo "$as_me:$LINENO: result: $INSTALL" >&5
+echo "${ECHO_T}$INSTALL" >&6
# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
# It thinks the first close brace ends the variable substitution.
test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
-test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
+test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
# Extract the first word of "perl5", so it can be a program name with args.
set dummy perl5; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2368: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_path_PERLV_PATH'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_path_PERLV_PATH+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- case "$PERLV_PATH" in
- /*)
+ case $PERLV_PATH in
+ [\\/]* | ?:[\\/]*)
ac_cv_path_PERLV_PATH="$PERLV_PATH" # Let the user override the test with a path.
;;
- ?:/*)
- ac_cv_path_PERLV_PATH="$PERLV_PATH" # Let the user override the test with a dos path.
- ;;
*)
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
- ac_dummy="$PATH"
- for ac_dir in $ac_dummy; do
- test -z "$ac_dir" && ac_dir=.
- if test -f $ac_dir/$ac_word; then
- ac_cv_path_PERLV_PATH="$ac_dir/$ac_word"
- break
- fi
- done
- IFS="$ac_save_ifs"
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_path_PERLV_PATH="$as_dir/$ac_word$ac_exec_ext"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
test -z "$ac_cv_path_PERLV_PATH" && ac_cv_path_PERLV_PATH="no"
;;
esac
fi
-PERLV_PATH="$ac_cv_path_PERLV_PATH"
+PERLV_PATH=$ac_cv_path_PERLV_PATH
+
if test -n "$PERLV_PATH"; then
- echo "$ac_t""$PERLV_PATH" 1>&6
+ echo "$as_me:$LINENO: result: $PERLV_PATH" >&5
+echo "${ECHO_T}$PERLV_PATH" >&6
else
- echo "$ac_t""no" 1>&6
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
fi
if test $PERLV_PATH = no; then
unset ac_cv_path_PERLV_PATH
# Extract the first word of "perl", so it can be a program name with args.
set dummy perl; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2406: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_path_PERLV_PATH'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_path_PERLV_PATH+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- case "$PERLV_PATH" in
- /*)
+ case $PERLV_PATH in
+ [\\/]* | ?:[\\/]*)
ac_cv_path_PERLV_PATH="$PERLV_PATH" # Let the user override the test with a path.
;;
- ?:/*)
- ac_cv_path_PERLV_PATH="$PERLV_PATH" # Let the user override the test with a dos path.
- ;;
*)
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
- ac_dummy="$PATH"
- for ac_dir in $ac_dummy; do
- test -z "$ac_dir" && ac_dir=.
- if test -f $ac_dir/$ac_word; then
- ac_cv_path_PERLV_PATH="$ac_dir/$ac_word"
- break
- fi
- done
- IFS="$ac_save_ifs"
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_path_PERLV_PATH="$as_dir/$ac_word$ac_exec_ext"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
test -z "$ac_cv_path_PERLV_PATH" && ac_cv_path_PERLV_PATH="no"
;;
esac
fi
-PERLV_PATH="$ac_cv_path_PERLV_PATH"
+PERLV_PATH=$ac_cv_path_PERLV_PATH
+
if test -n "$PERLV_PATH"; then
- echo "$ac_t""$PERLV_PATH" 1>&6
+ echo "$as_me:$LINENO: result: $PERLV_PATH" >&5
+echo "${ECHO_T}$PERLV_PATH" >&6
else
- echo "$ac_t""no" 1>&6
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
fi
if test $PERLV_PATH = no; then
- { echo "configure: error: can't locate a suitable perl5." 1>&2; exit 1; }
+ { { echo "$as_me:$LINENO: error: can't locate a suitable perl5." >&5
+echo "$as_me: error: can't locate a suitable perl5." >&2;}
+ { (exit 1); exit 1; }; }
exit 1
else
$PERLV_PATH -e 'require 5;'
if test $? -ne 0 ; then
- { echo "configure: error: can't locate a suitable perl5." 1>&2; exit 1; }
+ { { echo "$as_me:$LINENO: error: can't locate a suitable perl5." >&5
+echo "$as_me: error: can't locate a suitable perl5." >&2;}
+ { (exit 1); exit 1; }; }
exit 1
fi
fi
@@ -2452,84 +5409,96 @@ PERLV=`basename $PERLV_PATH`
# Extract the first word of "expect", so it can be a program name with args.
set dummy expect; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2457: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_path_EXPECT_PATH'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_path_EXPECT_PATH+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- case "$EXPECT_PATH" in
- /*)
+ case $EXPECT_PATH in
+ [\\/]* | ?:[\\/]*)
ac_cv_path_EXPECT_PATH="$EXPECT_PATH" # Let the user override the test with a path.
;;
- ?:/*)
- ac_cv_path_EXPECT_PATH="$EXPECT_PATH" # Let the user override the test with a dos path.
- ;;
*)
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
- ac_dummy="$PATH"
- for ac_dir in $ac_dummy; do
- test -z "$ac_dir" && ac_dir=.
- if test -f $ac_dir/$ac_word; then
- ac_cv_path_EXPECT_PATH="$ac_dir/$ac_word"
- break
- fi
- done
- IFS="$ac_save_ifs"
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_path_EXPECT_PATH="$as_dir/$ac_word$ac_exec_ext"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
test -z "$ac_cv_path_EXPECT_PATH" && ac_cv_path_EXPECT_PATH="no"
;;
esac
fi
-EXPECT_PATH="$ac_cv_path_EXPECT_PATH"
+EXPECT_PATH=$ac_cv_path_EXPECT_PATH
+
if test -n "$EXPECT_PATH"; then
- echo "$ac_t""$EXPECT_PATH" 1>&6
+ echo "$as_me:$LINENO: result: $EXPECT_PATH" >&5
+echo "${ECHO_T}$EXPECT_PATH" >&6
else
- echo "$ac_t""no" 1>&6
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
fi
if test $EXPECT_PATH = no; then
- { echo "configure: error: can't locate expect." 1>&2; exit 1; }
+ { { echo "$as_me:$LINENO: error: can't locate expect." >&5
+echo "$as_me: error: can't locate expect." >&2;}
+ { (exit 1); exit 1; }; }
fi
# locate ping and it's syntax
# Extract the first word of "ping", so it can be a program name with args.
set dummy ping; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2499: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_path_PING_PATH'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_path_PING_PATH+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- case "$PING_PATH" in
- /*)
+ case $PING_PATH in
+ [\\/]* | ?:[\\/]*)
ac_cv_path_PING_PATH="$PING_PATH" # Let the user override the test with a path.
;;
- ?:/*)
- ac_cv_path_PING_PATH="$PING_PATH" # Let the user override the test with a dos path.
- ;;
*)
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
- ac_dummy="$PATH"
- for ac_dir in $ac_dummy; do
- test -z "$ac_dir" && ac_dir=.
- if test -f $ac_dir/$ac_word; then
- ac_cv_path_PING_PATH="$ac_dir/$ac_word"
- break
- fi
- done
- IFS="$ac_save_ifs"
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_path_PING_PATH="$as_dir/$ac_word$ac_exec_ext"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
test -z "$ac_cv_path_PING_PATH" && ac_cv_path_PING_PATH="no"
;;
esac
fi
-PING_PATH="$ac_cv_path_PING_PATH"
+PING_PATH=$ac_cv_path_PING_PATH
+
if test -n "$PING_PATH"; then
- echo "$ac_t""$PING_PATH" 1>&6
+ echo "$as_me:$LINENO: result: $PING_PATH" >&5
+echo "${ECHO_T}$PING_PATH" >&6
else
- echo "$ac_t""no" 1>&6
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
fi
if test $PING_PATH = no; then
- { echo "configure: error: can't locate ping." 1>&2; exit 1; }
+ { { echo "$as_me:$LINENO: error: can't locate ping." >&5
+echo "$as_me: error: can't locate ping." >&2;}
+ { (exit 1); exit 1; }; }
exit 1
fi
# ping seems to take one of two formats for count (N)
@@ -2539,381 +5508,392 @@ $PING_PATH -c 1 -v 127.0.0.1 > /dev/null 2>&1
if test $? -ne 0 ; then
$PING_PATH 127.0.0.1 56 1 > /dev/null 2>&1
if test $? -ne 0 ; then
- { echo "configure: error: can't figure out how to pass count == 1 to $PING_PATH." 1>&2; exit 1; }
+ { { echo "$as_me:$LINENO: error: can't figure out how to pass count == 1 to $PING_PATH." >&5
+echo "$as_me: error: can't figure out how to pass count == 1 to $PING_PATH." >&2;}
+ { (exit 1); exit 1; }; }
exit 1
else
LG_PING_CMD="$PING_PATH"
-
+
fi
else
LG_PING_CMD="$PING_PATH -c 1"
-
+
fi
rd_cv_lg_ping_cmd=$LG_PING_CMD
-# RD_BIN_DATAS are bin/ .in's that need to be installed without execute
-# perms.
-RD_BIN_DATAS=""
-
-rd_cv_rd_bin_datas=$RD_BIN_DATAS
-
-# RD_BIN_PROGS are bin/ .in's that need to be installed with execute perms.
-RD_BIN_PROGS="cat5rancid control_rancid \
-alogin arancid clogin create_cvs blogin brancid do-diffs elogin erancid \
-f10rancid flogin francid jlogin jrancid hlogin hrancid mrancid par rancid-fe \
-rancid rename rrancid xrancid"
-
-rd_cv_rd_bin_progs=$RD_BIN_PROGS
-
-# RD_UTIL_PROGS are util/ .in's that need to be installed with execute perms.
-RD_UTIL_PROGS="rtrfilter downreport getipacctg"
-
-rd_cv_rd_util_progs=$RD_UTIL_PROGS
-
-# RD_UTIL_LG_PROGS are util/lg .in's that need to be installed with execute
-# perms.
-RD_UTIL_LG_PROGS="lg.cgi lgform.cgi"
-
-rd_cv_rd_util_lg_progs=$RD_UTIL_LG_PROGS
-
-
-INST_PROGS=$progs
-
-# locate tools to build $PATH for env. order is significant. want to be
-# sure that we pick up the the proper diff and ucbmail in bin/env.
+# locate tools to build $PATH for rancid.conf. order is significant. want
+# to be sure that we pick up the the proper diff and ucbmail in
+# etc/rancid.conf.
ENV_PATH="`dirname $PERLV_PATH`:`dirname $EXPECT_PATH`:`dirname $SENDMAIL`"
ENV_PATH="$ENV_PATH:`dirname $DIRNAME`:`dirname $DIFF`"
# Extract the first word of "cvs", so it can be a program name with args.
set dummy cvs; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2591: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_path_CVS'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_path_CVS+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- case "$CVS" in
- /*)
+ case $CVS in
+ [\\/]* | ?:[\\/]*)
ac_cv_path_CVS="$CVS" # Let the user override the test with a path.
;;
- ?:/*)
- ac_cv_path_CVS="$CVS" # Let the user override the test with a dos path.
- ;;
*)
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
- ac_dummy="$PATH"
- for ac_dir in $ac_dummy; do
- test -z "$ac_dir" && ac_dir=.
- if test -f $ac_dir/$ac_word; then
- ac_cv_path_CVS="$ac_dir/$ac_word"
- break
- fi
- done
- IFS="$ac_save_ifs"
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_path_CVS="$as_dir/$ac_word$ac_exec_ext"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
test -z "$ac_cv_path_CVS" && ac_cv_path_CVS="no"
;;
esac
fi
-CVS="$ac_cv_path_CVS"
+CVS=$ac_cv_path_CVS
+
if test -n "$CVS"; then
- echo "$ac_t""$CVS" 1>&6
+ echo "$as_me:$LINENO: result: $CVS" >&5
+echo "${ECHO_T}$CVS" >&6
else
- echo "$ac_t""no" 1>&6
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
fi
ENV_PATH="$ENV_PATH:`dirname $ac_cv_path_CVS`"
# Extract the first word of "comm", so it can be a program name with args.
set dummy comm; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2628: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_path_COMM'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_path_COMM+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- case "$COMM" in
- /*)
+ case $COMM in
+ [\\/]* | ?:[\\/]*)
ac_cv_path_COMM="$COMM" # Let the user override the test with a path.
;;
- ?:/*)
- ac_cv_path_COMM="$COMM" # Let the user override the test with a dos path.
- ;;
*)
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
- ac_dummy="$PATH"
- for ac_dir in $ac_dummy; do
- test -z "$ac_dir" && ac_dir=.
- if test -f $ac_dir/$ac_word; then
- ac_cv_path_COMM="$ac_dir/$ac_word"
- break
- fi
- done
- IFS="$ac_save_ifs"
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_path_COMM="$as_dir/$ac_word$ac_exec_ext"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
test -z "$ac_cv_path_COMM" && ac_cv_path_COMM="no"
;;
esac
fi
-COMM="$ac_cv_path_COMM"
+COMM=$ac_cv_path_COMM
+
if test -n "$COMM"; then
- echo "$ac_t""$COMM" 1>&6
+ echo "$as_me:$LINENO: result: $COMM" >&5
+echo "${ECHO_T}$COMM" >&6
else
- echo "$ac_t""no" 1>&6
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
fi
ENV_PATH="$ENV_PATH:`dirname $ac_cv_path_COMM`"
# Extract the first word of "find", so it can be a program name with args.
set dummy find; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2665: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_path_FIND'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_path_FIND+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- case "$FIND" in
- /*)
+ case $FIND in
+ [\\/]* | ?:[\\/]*)
ac_cv_path_FIND="$FIND" # Let the user override the test with a path.
;;
- ?:/*)
- ac_cv_path_FIND="$FIND" # Let the user override the test with a dos path.
- ;;
*)
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
- ac_dummy="$PATH"
- for ac_dir in $ac_dummy; do
- test -z "$ac_dir" && ac_dir=.
- if test -f $ac_dir/$ac_word; then
- ac_cv_path_FIND="$ac_dir/$ac_word"
- break
- fi
- done
- IFS="$ac_save_ifs"
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_path_FIND="$as_dir/$ac_word$ac_exec_ext"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
test -z "$ac_cv_path_FIND" && ac_cv_path_FIND="no"
;;
esac
fi
-FIND="$ac_cv_path_FIND"
+FIND=$ac_cv_path_FIND
+
if test -n "$FIND"; then
- echo "$ac_t""$FIND" 1>&6
+ echo "$as_me:$LINENO: result: $FIND" >&5
+echo "${ECHO_T}$FIND" >&6
else
- echo "$ac_t""no" 1>&6
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
fi
ENV_PATH="$ENV_PATH:`dirname $ac_cv_path_FIND`"
# Extract the first word of "grep", so it can be a program name with args.
set dummy grep; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2702: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_path_GREP'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_path_GREP+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- case "$GREP" in
- /*)
+ case $GREP in
+ [\\/]* | ?:[\\/]*)
ac_cv_path_GREP="$GREP" # Let the user override the test with a path.
;;
- ?:/*)
- ac_cv_path_GREP="$GREP" # Let the user override the test with a dos path.
- ;;
*)
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
- ac_dummy="$PATH"
- for ac_dir in $ac_dummy; do
- test -z "$ac_dir" && ac_dir=.
- if test -f $ac_dir/$ac_word; then
- ac_cv_path_GREP="$ac_dir/$ac_word"
- break
- fi
- done
- IFS="$ac_save_ifs"
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_path_GREP="$as_dir/$ac_word$ac_exec_ext"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
test -z "$ac_cv_path_GREP" && ac_cv_path_GREP="no"
;;
esac
fi
-GREP="$ac_cv_path_GREP"
+GREP=$ac_cv_path_GREP
+
if test -n "$GREP"; then
- echo "$ac_t""$GREP" 1>&6
+ echo "$as_me:$LINENO: result: $GREP" >&5
+echo "${ECHO_T}$GREP" >&6
else
- echo "$ac_t""no" 1>&6
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
fi
ENV_PATH="$ENV_PATH:`dirname $ac_cv_path_GREP`"
# Extract the first word of "id", so it can be a program name with args.
set dummy id; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2739: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_path_ID'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_path_ID+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- case "$ID" in
- /*)
+ case $ID in
+ [\\/]* | ?:[\\/]*)
ac_cv_path_ID="$ID" # Let the user override the test with a path.
;;
- ?:/*)
- ac_cv_path_ID="$ID" # Let the user override the test with a dos path.
- ;;
*)
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
- ac_dummy="$PATH"
- for ac_dir in $ac_dummy; do
- test -z "$ac_dir" && ac_dir=.
- if test -f $ac_dir/$ac_word; then
- ac_cv_path_ID="$ac_dir/$ac_word"
- break
- fi
- done
- IFS="$ac_save_ifs"
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_path_ID="$as_dir/$ac_word$ac_exec_ext"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
test -z "$ac_cv_path_ID" && ac_cv_path_ID="no"
;;
esac
fi
-ID="$ac_cv_path_ID"
+ID=$ac_cv_path_ID
+
if test -n "$ID"; then
- echo "$ac_t""$ID" 1>&6
+ echo "$as_me:$LINENO: result: $ID" >&5
+echo "${ECHO_T}$ID" >&6
else
- echo "$ac_t""no" 1>&6
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
fi
ENV_PATH="$ENV_PATH:`dirname $ac_cv_path_ID`"
# Extract the first word of "mkdir", so it can be a program name with args.
set dummy mkdir; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2776: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_path_MKDIR'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_path_MKDIR+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- case "$MKDIR" in
- /*)
+ case $MKDIR in
+ [\\/]* | ?:[\\/]*)
ac_cv_path_MKDIR="$MKDIR" # Let the user override the test with a path.
;;
- ?:/*)
- ac_cv_path_MKDIR="$MKDIR" # Let the user override the test with a dos path.
- ;;
*)
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
- ac_dummy="$PATH"
- for ac_dir in $ac_dummy; do
- test -z "$ac_dir" && ac_dir=.
- if test -f $ac_dir/$ac_word; then
- ac_cv_path_MKDIR="$ac_dir/$ac_word"
- break
- fi
- done
- IFS="$ac_save_ifs"
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_path_MKDIR="$as_dir/$ac_word$ac_exec_ext"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
test -z "$ac_cv_path_MKDIR" && ac_cv_path_MKDIR="no"
;;
esac
fi
-MKDIR="$ac_cv_path_MKDIR"
+MKDIR=$ac_cv_path_MKDIR
+
if test -n "$MKDIR"; then
- echo "$ac_t""$MKDIR" 1>&6
+ echo "$as_me:$LINENO: result: $MKDIR" >&5
+echo "${ECHO_T}$MKDIR" >&6
else
- echo "$ac_t""no" 1>&6
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
fi
ENV_PATH="$ENV_PATH:`dirname $ac_cv_path_MKDIR`"
# Extract the first word of "rsh", so it can be a program name with args.
set dummy rsh; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2813: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_path_RSH'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_path_RSH+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- case "$RSH" in
- /*)
+ case $RSH in
+ [\\/]* | ?:[\\/]*)
ac_cv_path_RSH="$RSH" # Let the user override the test with a path.
;;
- ?:/*)
- ac_cv_path_RSH="$RSH" # Let the user override the test with a dos path.
- ;;
*)
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
- ac_dummy="$PATH"
- for ac_dir in $ac_dummy; do
- test -z "$ac_dir" && ac_dir=.
- if test -f $ac_dir/$ac_word; then
- ac_cv_path_RSH="$ac_dir/$ac_word"
- break
- fi
- done
- IFS="$ac_save_ifs"
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_path_RSH="$as_dir/$ac_word$ac_exec_ext"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
test -z "$ac_cv_path_RSH" && ac_cv_path_RSH="no"
;;
esac
fi
-RSH="$ac_cv_path_RSH"
+RSH=$ac_cv_path_RSH
+
if test -n "$RSH"; then
- echo "$ac_t""$RSH" 1>&6
+ echo "$as_me:$LINENO: result: $RSH" >&5
+echo "${ECHO_T}$RSH" >&6
else
- echo "$ac_t""no" 1>&6
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
fi
ENV_PATH="$ENV_PATH:`dirname $ac_cv_path_RSH`"
# Extract the first word of "sort", so it can be a program name with args.
set dummy sort; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2850: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_path_SORT'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_path_SORT+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- case "$SORT" in
- /*)
+ case $SORT in
+ [\\/]* | ?:[\\/]*)
ac_cv_path_SORT="$SORT" # Let the user override the test with a path.
;;
- ?:/*)
- ac_cv_path_SORT="$SORT" # Let the user override the test with a dos path.
- ;;
*)
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
- ac_dummy="$PATH"
- for ac_dir in $ac_dummy; do
- test -z "$ac_dir" && ac_dir=.
- if test -f $ac_dir/$ac_word; then
- ac_cv_path_SORT="$ac_dir/$ac_word"
- break
- fi
- done
- IFS="$ac_save_ifs"
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_path_SORT="$as_dir/$ac_word$ac_exec_ext"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
test -z "$ac_cv_path_SORT" && ac_cv_path_SORT="no"
;;
esac
fi
-SORT="$ac_cv_path_SORT"
+SORT=$ac_cv_path_SORT
+
if test -n "$SORT"; then
- echo "$ac_t""$SORT" 1>&6
+ echo "$as_me:$LINENO: result: $SORT" >&5
+echo "${ECHO_T}$SORT" >&6
else
- echo "$ac_t""no" 1>&6
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
fi
ENV_PATH="$ENV_PATH:`dirname $ac_cv_path_SORT`"
# Extract the first word of "ssh", so it can be a program name with args.
set dummy ssh; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2887: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_path_SSH'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_path_SSH+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- case "$SSH" in
- /*)
+ case $SSH in
+ [\\/]* | ?:[\\/]*)
ac_cv_path_SSH="$SSH" # Let the user override the test with a path.
;;
- ?:/*)
- ac_cv_path_SSH="$SSH" # Let the user override the test with a dos path.
- ;;
*)
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
- ac_dummy="$PATH"
- for ac_dir in $ac_dummy; do
- test -z "$ac_dir" && ac_dir=.
- if test -f $ac_dir/$ac_word; then
- ac_cv_path_SSH="$ac_dir/$ac_word"
- break
- fi
- done
- IFS="$ac_save_ifs"
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_path_SSH="$as_dir/$ac_word$ac_exec_ext"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
test -z "$ac_cv_path_SSH" && ac_cv_path_SSH="no"
;;
esac
fi
-SSH="$ac_cv_path_SSH"
+SSH=$ac_cv_path_SSH
+
if test -n "$SSH"; then
- echo "$ac_t""$SSH" 1>&6
+ echo "$as_me:$LINENO: result: $SSH" >&5
+echo "${ECHO_T}$SSH" >&6
else
- echo "$ac_t""no" 1>&6
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
fi
if test $DIFF = no; then
@@ -2922,75 +5902,83 @@ fi
unset ac_cv_path_SSH
# Extract the first word of "telnet", so it can be a program name with args.
set dummy telnet; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2927: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_path_TELNET'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_path_TELNET+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- case "$TELNET" in
- /*)
+ case $TELNET in
+ [\\/]* | ?:[\\/]*)
ac_cv_path_TELNET="$TELNET" # Let the user override the test with a path.
;;
- ?:/*)
- ac_cv_path_TELNET="$TELNET" # Let the user override the test with a dos path.
- ;;
*)
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
- ac_dummy="$PATH"
- for ac_dir in $ac_dummy; do
- test -z "$ac_dir" && ac_dir=.
- if test -f $ac_dir/$ac_word; then
- ac_cv_path_TELNET="$ac_dir/$ac_word"
- break
- fi
- done
- IFS="$ac_save_ifs"
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_path_TELNET="$as_dir/$ac_word$ac_exec_ext"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
test -z "$ac_cv_path_TELNET" && ac_cv_path_TELNET="no"
;;
esac
fi
-TELNET="$ac_cv_path_TELNET"
+TELNET=$ac_cv_path_TELNET
+
if test -n "$TELNET"; then
- echo "$ac_t""$TELNET" 1>&6
+ echo "$as_me:$LINENO: result: $TELNET" >&5
+echo "${ECHO_T}$TELNET" >&6
else
- echo "$ac_t""no" 1>&6
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
fi
ENV_PATH="$ENV_PATH:`dirname $ac_cv_path_TELNET`"
# Extract the first word of "touch", so it can be a program name with args.
set dummy touch; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2964: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_path_TOUCH'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_path_TOUCH+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- case "$TOUCH" in
- /*)
+ case $TOUCH in
+ [\\/]* | ?:[\\/]*)
ac_cv_path_TOUCH="$TOUCH" # Let the user override the test with a path.
;;
- ?:/*)
- ac_cv_path_TOUCH="$TOUCH" # Let the user override the test with a dos path.
- ;;
*)
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
- ac_dummy="$PATH"
- for ac_dir in $ac_dummy; do
- test -z "$ac_dir" && ac_dir=.
- if test -f $ac_dir/$ac_word; then
- ac_cv_path_TOUCH="$ac_dir/$ac_word"
- break
- fi
- done
- IFS="$ac_save_ifs"
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_path_TOUCH="$as_dir/$ac_word$ac_exec_ext"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
test -z "$ac_cv_path_TOUCH" && ac_cv_path_TOUCH="no"
;;
esac
fi
-TOUCH="$ac_cv_path_TOUCH"
+TOUCH=$ac_cv_path_TOUCH
+
if test -n "$TOUCH"; then
- echo "$ac_t""$TOUCH" 1>&6
+ echo "$as_me:$LINENO: result: $TOUCH" >&5
+echo "${ECHO_T}$TOUCH" >&6
else
- echo "$ac_t""no" 1>&6
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
fi
ENV_PATH="$ENV_PATH:`dirname $ac_cv_path_TOUCH`"
@@ -3001,525 +5989,1576 @@ ENV_PATH=`echo $ENV_PATH | $PERLV_PATH -e 'foreach $x(split(":",<>)){next unless
ac_cv_env_path=$ENV_PATH
-trap '' 1 2 15
-cat > confcache <<\EOF
+
+ ac_config_files="$ac_config_files Makefile"
+
+ ac_config_files="$ac_config_files bin/Makefile"
+
+ ac_config_files="$ac_config_files etc/Makefile"
+
+ ac_config_files="$ac_config_files include/Makefile"
+
+ ac_config_files="$ac_config_files man/Makefile"
+
+ ac_config_files="$ac_config_files share/Makefile"
+
+ ac_config_files="$ac_config_files include/version.h"
+ # this is not a header in the sense of
+ # AC_CONFIG_HEADERS will cause
+ # autoheader to overwrite it, while all
+ # want is simple variable replacement
+ ac_config_headers="$ac_config_headers include/config.h"
+
+ ac_config_files="$ac_config_files bin/control_rancid bin/par bin/rancid-fe"
+
+ ac_config_files="$ac_config_files bin/alogin bin/arancid"
+
+ ac_config_files="$ac_config_files bin/blogin bin/brancid"
+
+ ac_config_files="$ac_config_files bin/cat5rancid bin/clogin bin/rancid"
+
+ ac_config_files="$ac_config_files bin/cssrancid"
+
+ ac_config_files="$ac_config_files bin/elogin bin/erancid"
+
+ ac_config_files="$ac_config_files bin/f10rancid"
+
+ ac_config_files="$ac_config_files bin/flogin bin/francid"
+
+ ac_config_files="$ac_config_files bin/fnrancid"
+
+ ac_config_files="$ac_config_files bin/jlogin bin/jrancid bin/jerancid"
+
+ ac_config_files="$ac_config_files bin/hlogin bin/hrancid"
+
+ ac_config_files="$ac_config_files bin/htlogin bin/htrancid"
+
+ ac_config_files="$ac_config_files bin/mrancid"
+
+ ac_config_files="$ac_config_files bin/nlogin bin/nrancid"
+
+ ac_config_files="$ac_config_files bin/nslogin bin/nsrancid"
+
+ ac_config_files="$ac_config_files bin/prancid"
+
+ ac_config_files="$ac_config_files bin/rivlogin bin/rivrancid"
+
+ ac_config_files="$ac_config_files bin/rrancid"
+
+ ac_config_files="$ac_config_files bin/tntlogin bin/tntrancid"
+
+ ac_config_files="$ac_config_files bin/xrancid bin/zrancid"
+
+ ac_config_files="$ac_config_files share/rtrfilter"
+
+
+cat >confcache <<\_ACEOF
# This file is a shell script that caches the results of configure
# tests run on this system so they can be shared between configure
-# scripts and configure runs. It is not useful on other systems.
-# If it contains results you don't want to keep, you may remove or edit it.
+# scripts and configure runs, see configure's option --config-cache.
+# It is not useful on other systems. If it contains results you don't
+# want to keep, you may remove or edit it.
#
-# By default, configure uses ./config.cache as the cache file,
-# creating it if it does not exist already. You can give configure
-# the --cache-file=FILE option to use a different cache file; that is
-# what configure does when it calls configure scripts in
-# subdirectories, so they share the cache.
-# Giving --cache-file=/dev/null disables caching, for debugging configure.
-# config.status only pays attention to the cache file if you give it the
-# --recheck option to rerun configure.
+# config.status only pays attention to the cache file if you give it
+# the --recheck option to rerun configure.
#
-EOF
+# `ac_cv_env_foo' variables (set or unset) will be overridden when
+# loading this file, other *unset* `ac_cv_foo' will be assigned the
+# following values.
+
+_ACEOF
+
# The following way of writing the cache mishandles newlines in values,
# but we know of no workaround that is simple, portable, and efficient.
# So, don't put newlines in cache variables' values.
# Ultrix sh set writes to stderr and can't be redirected directly,
# and sets the high bit in the cache file unless we assign to the vars.
-(set) 2>&1 |
- case `(ac_space=' '; set | grep ac_space) 2>&1` in
- *ac_space=\ *)
- # `set' does not quote correctly, so add quotes (double-quote substitution
- # turns \\\\ into \\, and sed turns \\ into \).
- sed -n \
- -e "s/'/'\\\\''/g" \
- -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
- ;;
- *)
- # `set' quotes correctly as required by POSIX, so do not add quotes.
- sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
- ;;
- esac >> confcache
-if cmp -s $cache_file confcache; then
- :
-else
+{
+ (set) 2>&1 |
+ case `(ac_space=' '; set | grep ac_space) 2>&1` in
+ *ac_space=\ *)
+ # `set' does not quote correctly, so add quotes (double-quote
+ # substitution turns \\\\ into \\, and sed turns \\ into \).
+ sed -n \
+ "s/'/'\\\\''/g;
+ s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
+ ;;
+ *)
+ # `set' quotes correctly as required by POSIX, so do not add quotes.
+ sed -n \
+ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
+ ;;
+ esac;
+} |
+ sed '
+ t clear
+ : clear
+ s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
+ t end
+ /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
+ : end' >>confcache
+if diff $cache_file confcache >/dev/null 2>&1; then :; else
if test -w $cache_file; then
- echo "updating cache $cache_file"
- cat confcache > $cache_file
+ test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
+ cat confcache >$cache_file
else
echo "not updating unwritable cache $cache_file"
fi
fi
rm -f confcache
-trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
-
test "x$prefix" = xNONE && prefix=$ac_default_prefix
# Let make expand exec_prefix.
test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
-# Any assignment to VPATH causes Sun make to only execute
-# the first set of double-colon rules, so remove it if not needed.
-# If there is a colon in the path, we need to keep it.
+# VPATH may cause trouble with some makes, so we remove $(srcdir),
+# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
+# trailing colons and then remove the whole line if VPATH becomes empty
+# (actually we leave an empty line to preserve line numbers).
if test "x$srcdir" = x.; then
- ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d'
+ ac_vpsub='/^[ ]*VPATH[ ]*=/{
+s/:*\$(srcdir):*/:/;
+s/:*\${srcdir}:*/:/;
+s/:*@srcdir@:*/:/;
+s/^\([^=]*=[ ]*\):*/\1/;
+s/:*$//;
+s/^[^=]*=[ ]*$//;
+}'
fi
-trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
-
DEFS=-DHAVE_CONFIG_H
-# Without the "./", some shells look in PATH for config.status.
-: ${CONFIG_STATUS=./config.status}
+ac_libobjs=
+ac_ltlibobjs=
+for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
+ # 1. Remove the extension, and $U if already installed.
+ ac_i=`echo "$ac_i" |
+ sed 's/\$U\././;s/\.o$//;s/\.obj$//'`
+ # 2. Add them.
+ ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext"
+ ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo'
+done
+LIBOBJS=$ac_libobjs
-echo creating $CONFIG_STATUS
-rm -f $CONFIG_STATUS
-cat > $CONFIG_STATUS <<EOF
-#! /bin/sh
-# Generated automatically by configure.
+LTLIBOBJS=$ac_ltlibobjs
+
+
+if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then
+ { { echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"AMDEP\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
+ { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"am__fastdepCC\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+
+: ${CONFIG_STATUS=./config.status}
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files $CONFIG_STATUS"
+{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5
+echo "$as_me: creating $CONFIG_STATUS" >&6;}
+cat >$CONFIG_STATUS <<_ACEOF
+#! $SHELL
+# Generated by $as_me.
# Run this file to recreate the current configuration.
-# This directory was configured as follows,
-# on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
-#
-# $0 $ac_configure_args
-#
# Compiler output produced by configure, useful for debugging
-# configure, is in ./config.log if it exists.
+# configure, is in config.log if it exists.
-ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
-for ac_option
+debug=false
+ac_cs_recheck=false
+ac_cs_silent=false
+SHELL=\${CONFIG_SHELL-$SHELL}
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+## --------------------- ##
+## M4sh Initialization. ##
+## --------------------- ##
+
+# Be Bourne compatible
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+ emulate sh
+ NULLCMD=:
+ # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '${1+"$@"}'='"$@"'
+elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
+ set -o posix
+fi
+DUALCASE=1; export DUALCASE # for MKS sh
+
+# Support unset when possible.
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+ as_unset=unset
+else
+ as_unset=false
+fi
+
+
+# Work around bugs in pre-3.0 UWIN ksh.
+$as_unset ENV MAIL MAILPATH
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+for as_var in \
+ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
+ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
+ LC_TELEPHONE LC_TIME
do
- case "\$ac_option" in
- -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
- echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
- exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
- -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
- echo "$CONFIG_STATUS generated by autoconf version 2.13"
- exit 0 ;;
- -help | --help | --hel | --he | --h)
- echo "\$ac_cs_usage"; exit 0 ;;
- *) echo "\$ac_cs_usage"; exit 1 ;;
- esac
+ if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
+ eval $as_var=C; export $as_var
+ else
+ $as_unset $as_var
+ fi
done
-ac_given_srcdir=$srcdir
-ac_given_INSTALL="$INSTALL"
-
-trap 'rm -fr `echo " Makefile include/Makefile bin/Makefile util/Makefile \
- bin/alogin bin/arancid bin/blogin bin/brancid bin/cat5rancid \
- bin/clogin bin/control_rancid bin/create_cvs bin/do-diffs bin/elogin \
- bin/env bin/erancid bin/f10rancid bin/flogin bin/francid bin/jlogin \
- bin/jrancid bin/hlogin \
- bin/hrancid bin/mrancid bin/par bin/rancid-fe bin/rancid bin/rename \
- bin/rrancid bin/xrancid \
- man/Makefile man/env.5 man/lg.conf.5 man/lg_intro.1 \
- include/version.h \
- util/rtrfilter util/downreport include/config.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
-EOF
-cat >> $CONFIG_STATUS <<EOF
-
-# Protect against being on the right side of a sed subst in config.status.
-sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
- s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
-$ac_vpsub
-$extrasub
-s%@SHELL@%$SHELL%g
-s%@CFLAGS@%$CFLAGS%g
-s%@CPPFLAGS@%$CPPFLAGS%g
-s%@CXXFLAGS@%$CXXFLAGS%g
-s%@FFLAGS@%$FFLAGS%g
-s%@DEFS@%$DEFS%g
-s%@LDFLAGS@%$LDFLAGS%g
-s%@LIBS@%$LIBS%g
-s%@exec_prefix@%$exec_prefix%g
-s%@prefix@%$prefix%g
-s%@program_transform_name@%$program_transform_name%g
-s%@bindir@%$bindir%g
-s%@sbindir@%$sbindir%g
-s%@libexecdir@%$libexecdir%g
-s%@datadir@%$datadir%g
-s%@sysconfdir@%$sysconfdir%g
-s%@sharedstatedir@%$sharedstatedir%g
-s%@localstatedir@%$localstatedir%g
-s%@libdir@%$libdir%g
-s%@includedir@%$includedir%g
-s%@oldincludedir@%$oldincludedir%g
-s%@infodir@%$infodir%g
-s%@mandir@%$mandir%g
-s%@VERSION@%$VERSION%g
-s%@PACKAGE@%$PACKAGE%g
-s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
-s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
-s%@INSTALL_DATA@%$INSTALL_DATA%g
-s%@ACLOCAL@%$ACLOCAL%g
-s%@AUTOCONF@%$AUTOCONF%g
-s%@AUTOMAKE@%$AUTOMAKE%g
-s%@AUTOHEADER@%$AUTOHEADER%g
-s%@MAKEINFO@%$MAKEINFO%g
-s%@SET_MAKE@%$SET_MAKE%g
-s%@MAINTAINER_MODE_TRUE@%$MAINTAINER_MODE_TRUE%g
-s%@MAINTAINER_MODE_FALSE@%$MAINTAINER_MODE_FALSE%g
-s%@MAINT@%$MAINT%g
-s%@subdirs@%$subdirs%g
-s%@MAKE@%$MAKE%g
-s%@CC@%$CC%g
-s%@CPP@%$CPP%g
-s%@U@%$U%g
-s%@ANSI2KNR@%$ANSI2KNR%g
-s%@MAILPLUS@%$MAILPLUS%g
-s%@DIRNAME@%$DIRNAME%g
-s%@DIFF@%$DIFF%g
-s%@DIFF_CMD@%$DIFF_CMD%g
-s%@SENDMAIL@%$SENDMAIL%g
-s%@TAR@%$TAR%g
-s%@PERLV_PATH@%$PERLV_PATH%g
-s%@PERLV@%$PERLV%g
-s%@EXPECT_PATH@%$EXPECT_PATH%g
-s%@PING_PATH@%$PING_PATH%g
-s%@LG_PING_CMD@%$LG_PING_CMD%g
-s%@RD_BIN_DATAS@%$RD_BIN_DATAS%g
-s%@RD_BIN_PROGS@%$RD_BIN_PROGS%g
-s%@RD_UTIL_PROGS@%$RD_UTIL_PROGS%g
-s%@RD_UTIL_LG_PROGS@%$RD_UTIL_LG_PROGS%g
-s%@INST_PROGS@%$INST_PROGS%g
-s%@CVS@%$CVS%g
-s%@COMM@%$COMM%g
-s%@FIND@%$FIND%g
-s%@GREP@%$GREP%g
-s%@ID@%$ID%g
-s%@MKDIR@%$MKDIR%g
-s%@RSH@%$RSH%g
-s%@SORT@%$SORT%g
-s%@SSH@%$SSH%g
-s%@TELNET@%$TELNET%g
-s%@TOUCH@%$TOUCH%g
-s%@ENV_PATH@%$ENV_PATH%g
+# Required to use basename.
+if expr a : '\(a\)' >/dev/null 2>&1; then
+ as_expr=expr
+else
+ as_expr=false
+fi
-CEOF
-EOF
-
-cat >> $CONFIG_STATUS <<\EOF
-
-# Split the substitutions into bite-sized pieces for seds with
-# small command number limits, like on Digital OSF/1 and HP-UX.
-ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
-ac_file=1 # Number of current file.
-ac_beg=1 # First line for current file.
-ac_end=$ac_max_sed_cmds # Line after last line for current file.
-ac_more_lines=:
-ac_sed_cmds=""
-while $ac_more_lines; do
- if test $ac_beg -gt 1; then
- sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
+if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then
+ as_basename=basename
+else
+ as_basename=false
+fi
+
+
+# Name of the executable.
+as_me=`$as_basename "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+ X"$0" : 'X\(//\)$' \| \
+ X"$0" : 'X\(/\)$' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X/"$0" |
+ sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; }
+ /^X\/\(\/\/\)$/{ s//\1/; q; }
+ /^X\/\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+
+
+# PATH needs CR, and LINENO needs CR and PATH.
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+ echo "#! /bin/sh" >conf$$.sh
+ echo "exit 0" >>conf$$.sh
+ chmod +x conf$$.sh
+ if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
+ PATH_SEPARATOR=';'
else
- sed "${ac_end}q" conftest.subs > conftest.s$ac_file
+ PATH_SEPARATOR=:
fi
- if test ! -s conftest.s$ac_file; then
- ac_more_lines=false
- rm -f conftest.s$ac_file
+ rm -f conf$$.sh
+fi
+
+
+ as_lineno_1=$LINENO
+ as_lineno_2=$LINENO
+ as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
+ test "x$as_lineno_1" != "x$as_lineno_2" &&
+ test "x$as_lineno_3" = "x$as_lineno_2" || {
+ # Find who we are. Look in the path if we contain no path at all
+ # relative or not.
+ case $0 in
+ *[\\/]* ) as_myself=$0 ;;
+ *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+done
+
+ ;;
+ esac
+ # We did not find ourselves, most probably we were run as `sh COMMAND'
+ # in which case we are not to be found in the path.
+ if test "x$as_myself" = x; then
+ as_myself=$0
+ fi
+ if test ! -f "$as_myself"; then
+ { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5
+echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;}
+ { (exit 1); exit 1; }; }
+ fi
+ case $CONFIG_SHELL in
+ '')
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for as_base in sh bash ksh sh5; do
+ case $as_dir in
+ /*)
+ if ("$as_dir/$as_base" -c '
+ as_lineno_1=$LINENO
+ as_lineno_2=$LINENO
+ as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
+ test "x$as_lineno_1" != "x$as_lineno_2" &&
+ test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then
+ $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; }
+ $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; }
+ CONFIG_SHELL=$as_dir/$as_base
+ export CONFIG_SHELL
+ exec "$CONFIG_SHELL" "$0" ${1+"$@"}
+ fi;;
+ esac
+ done
+done
+;;
+ esac
+
+ # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
+ # uniformly replaced by the line number. The first 'sed' inserts a
+ # line-number line before each line; the second 'sed' does the real
+ # work. The second script uses 'N' to pair each line-number line
+ # with the numbered line, and appends trailing '-' during
+ # substitution so that $LINENO is not a special case at line end.
+ # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
+ # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-)
+ sed '=' <$as_myself |
+ sed '
+ N
+ s,$,-,
+ : loop
+ s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3,
+ t loop
+ s,-$,,
+ s,^['$as_cr_digits']*\n,,
+ ' >$as_me.lineno &&
+ chmod +x $as_me.lineno ||
+ { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5
+echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;}
+ { (exit 1); exit 1; }; }
+
+ # Don't try to exec as it changes $[0], causing all sort of problems
+ # (the dirname of $[0] is not the place where we might find the
+ # original and so on. Autoconf is especially sensible to this).
+ . ./$as_me.lineno
+ # Exit status is that of the last command.
+ exit
+}
+
+
+case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
+ *c*,-n*) ECHO_N= ECHO_C='
+' ECHO_T=' ' ;;
+ *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;;
+ *) ECHO_N= ECHO_C='\c' ECHO_T= ;;
+esac
+
+if expr a : '\(a\)' >/dev/null 2>&1; then
+ as_expr=expr
+else
+ as_expr=false
+fi
+
+rm -f conf$$ conf$$.exe conf$$.file
+echo >conf$$.file
+if ln -s conf$$.file conf$$ 2>/dev/null; then
+ # We could just check for DJGPP; but this test a) works b) is more generic
+ # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
+ if test -f conf$$.exe; then
+ # Don't use ln at all; we don't have any links
+ as_ln_s='cp -p'
else
- if test -z "$ac_sed_cmds"; then
- ac_sed_cmds="sed -f conftest.s$ac_file"
+ as_ln_s='ln -s'
+ fi
+elif ln conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s=ln
+else
+ as_ln_s='cp -p'
+fi
+rm -f conf$$ conf$$.exe conf$$.file
+
+if mkdir -p . 2>/dev/null; then
+ as_mkdir_p=:
+else
+ test -d ./-p && rmdir ./-p
+ as_mkdir_p=false
+fi
+
+as_executable_p="test -f"
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+
+
+# IFS
+# We need space, tab and new line, in precisely that order.
+as_nl='
+'
+IFS=" $as_nl"
+
+# CDPATH.
+$as_unset CDPATH
+
+exec 6>&1
+
+# Open the log real soon, to keep \$[0] and so on meaningful, and to
+# report actual input values of CONFIG_FILES etc. instead of their
+# values after options handling. Logging --version etc. is OK.
+exec 5>>config.log
+{
+ echo
+ sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
+## Running $as_me. ##
+_ASBOX
+} >&5
+cat >&5 <<_CSEOF
+
+This file was extended by $as_me, which was
+generated by GNU Autoconf 2.59. Invocation command line was
+
+ CONFIG_FILES = $CONFIG_FILES
+ CONFIG_HEADERS = $CONFIG_HEADERS
+ CONFIG_LINKS = $CONFIG_LINKS
+ CONFIG_COMMANDS = $CONFIG_COMMANDS
+ $ $0 $@
+
+_CSEOF
+echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5
+echo >&5
+_ACEOF
+
+# Files that config.status was made for.
+if test -n "$ac_config_files"; then
+ echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS
+fi
+
+if test -n "$ac_config_headers"; then
+ echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS
+fi
+
+if test -n "$ac_config_links"; then
+ echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS
+fi
+
+if test -n "$ac_config_commands"; then
+ echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS
+fi
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+
+ac_cs_usage="\
+\`$as_me' instantiates files from templates according to the
+current configuration.
+
+Usage: $0 [OPTIONS] [FILE]...
+
+ -h, --help print this help, then exit
+ -V, --version print version number, then exit
+ -q, --quiet do not print progress messages
+ -d, --debug don't remove temporary files
+ --recheck update $as_me by reconfiguring in the same conditions
+ --file=FILE[:TEMPLATE]
+ instantiate the configuration file FILE
+ --header=FILE[:TEMPLATE]
+ instantiate the configuration header FILE
+
+Configuration files:
+$config_files
+
+Configuration headers:
+$config_headers
+
+Configuration commands:
+$config_commands
+
+Report bugs to <bug-autoconf@gnu.org>."
+_ACEOF
+
+cat >>$CONFIG_STATUS <<_ACEOF
+ac_cs_version="\\
+config.status
+configured by $0, generated by GNU Autoconf 2.59,
+ with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
+
+Copyright (C) 2003 Free Software Foundation, Inc.
+This config.status script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it."
+srcdir=$srcdir
+INSTALL="$INSTALL"
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+# If no file are specified by the user, then we need to provide default
+# value. By we need to know if files were specified by the user.
+ac_need_defaults=:
+while test $# != 0
+do
+ case $1 in
+ --*=*)
+ ac_option=`expr "x$1" : 'x\([^=]*\)='`
+ ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
+ ac_shift=:
+ ;;
+ -*)
+ ac_option=$1
+ ac_optarg=$2
+ ac_shift=shift
+ ;;
+ *) # This is not an option, so the user has probably given explicit
+ # arguments.
+ ac_option=$1
+ ac_need_defaults=false;;
+ esac
+
+ case $ac_option in
+ # Handling of the options.
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
+ -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
+ ac_cs_recheck=: ;;
+ --version | --vers* | -V )
+ echo "$ac_cs_version"; exit 0 ;;
+ --he | --h)
+ # Conflict between --help and --header
+ { { echo "$as_me:$LINENO: error: ambiguous option: $1
+Try \`$0 --help' for more information." >&5
+echo "$as_me: error: ambiguous option: $1
+Try \`$0 --help' for more information." >&2;}
+ { (exit 1); exit 1; }; };;
+ --help | --hel | -h )
+ echo "$ac_cs_usage"; exit 0 ;;
+ --debug | --d* | -d )
+ debug=: ;;
+ --file | --fil | --fi | --f )
+ $ac_shift
+ CONFIG_FILES="$CONFIG_FILES $ac_optarg"
+ ac_need_defaults=false;;
+ --header | --heade | --head | --hea )
+ $ac_shift
+ CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg"
+ ac_need_defaults=false;;
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil | --si | --s)
+ ac_cs_silent=: ;;
+
+ # This is an error.
+ -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1
+Try \`$0 --help' for more information." >&5
+echo "$as_me: error: unrecognized option: $1
+Try \`$0 --help' for more information." >&2;}
+ { (exit 1); exit 1; }; } ;;
+
+ *) ac_config_targets="$ac_config_targets $1" ;;
+
+ esac
+ shift
+done
+
+ac_configure_extra_args=
+
+if $ac_cs_silent; then
+ exec 6>/dev/null
+ ac_configure_extra_args="$ac_configure_extra_args --silent"
+fi
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF
+if \$ac_cs_recheck; then
+ echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6
+ exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
+fi
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<_ACEOF
+#
+# INIT-COMMANDS section.
+#
+
+AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"
+
+_ACEOF
+
+
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+for ac_config_target in $ac_config_targets
+do
+ case "$ac_config_target" in
+ # Handling of arguments.
+ "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
+ "bin/Makefile" ) CONFIG_FILES="$CONFIG_FILES bin/Makefile" ;;
+ "etc/Makefile" ) CONFIG_FILES="$CONFIG_FILES etc/Makefile" ;;
+ "include/Makefile" ) CONFIG_FILES="$CONFIG_FILES include/Makefile" ;;
+ "man/Makefile" ) CONFIG_FILES="$CONFIG_FILES man/Makefile" ;;
+ "share/Makefile" ) CONFIG_FILES="$CONFIG_FILES share/Makefile" ;;
+ "include/version.h" ) CONFIG_FILES="$CONFIG_FILES include/version.h" ;;
+ "bin/control_rancid" ) CONFIG_FILES="$CONFIG_FILES bin/control_rancid" ;;
+ "bin/par" ) CONFIG_FILES="$CONFIG_FILES bin/par" ;;
+ "bin/rancid-fe" ) CONFIG_FILES="$CONFIG_FILES bin/rancid-fe" ;;
+ "bin/alogin" ) CONFIG_FILES="$CONFIG_FILES bin/alogin" ;;
+ "bin/arancid" ) CONFIG_FILES="$CONFIG_FILES bin/arancid" ;;
+ "bin/blogin" ) CONFIG_FILES="$CONFIG_FILES bin/blogin" ;;
+ "bin/brancid" ) CONFIG_FILES="$CONFIG_FILES bin/brancid" ;;
+ "bin/cat5rancid" ) CONFIG_FILES="$CONFIG_FILES bin/cat5rancid" ;;
+ "bin/clogin" ) CONFIG_FILES="$CONFIG_FILES bin/clogin" ;;
+ "bin/rancid" ) CONFIG_FILES="$CONFIG_FILES bin/rancid" ;;
+ "bin/cssrancid" ) CONFIG_FILES="$CONFIG_FILES bin/cssrancid" ;;
+ "bin/elogin" ) CONFIG_FILES="$CONFIG_FILES bin/elogin" ;;
+ "bin/erancid" ) CONFIG_FILES="$CONFIG_FILES bin/erancid" ;;
+ "bin/f10rancid" ) CONFIG_FILES="$CONFIG_FILES bin/f10rancid" ;;
+ "bin/flogin" ) CONFIG_FILES="$CONFIG_FILES bin/flogin" ;;
+ "bin/francid" ) CONFIG_FILES="$CONFIG_FILES bin/francid" ;;
+ "bin/fnrancid" ) CONFIG_FILES="$CONFIG_FILES bin/fnrancid" ;;
+ "bin/jlogin" ) CONFIG_FILES="$CONFIG_FILES bin/jlogin" ;;
+ "bin/jrancid" ) CONFIG_FILES="$CONFIG_FILES bin/jrancid" ;;
+ "bin/jerancid" ) CONFIG_FILES="$CONFIG_FILES bin/jerancid" ;;
+ "bin/hlogin" ) CONFIG_FILES="$CONFIG_FILES bin/hlogin" ;;
+ "bin/hrancid" ) CONFIG_FILES="$CONFIG_FILES bin/hrancid" ;;
+ "bin/htlogin" ) CONFIG_FILES="$CONFIG_FILES bin/htlogin" ;;
+ "bin/htrancid" ) CONFIG_FILES="$CONFIG_FILES bin/htrancid" ;;
+ "bin/mrancid" ) CONFIG_FILES="$CONFIG_FILES bin/mrancid" ;;
+ "bin/nlogin" ) CONFIG_FILES="$CONFIG_FILES bin/nlogin" ;;
+ "bin/nrancid" ) CONFIG_FILES="$CONFIG_FILES bin/nrancid" ;;
+ "bin/nslogin" ) CONFIG_FILES="$CONFIG_FILES bin/nslogin" ;;
+ "bin/nsrancid" ) CONFIG_FILES="$CONFIG_FILES bin/nsrancid" ;;
+ "bin/prancid" ) CONFIG_FILES="$CONFIG_FILES bin/prancid" ;;
+ "bin/rivlogin" ) CONFIG_FILES="$CONFIG_FILES bin/rivlogin" ;;
+ "bin/rivrancid" ) CONFIG_FILES="$CONFIG_FILES bin/rivrancid" ;;
+ "bin/rrancid" ) CONFIG_FILES="$CONFIG_FILES bin/rrancid" ;;
+ "bin/tntlogin" ) CONFIG_FILES="$CONFIG_FILES bin/tntlogin" ;;
+ "bin/tntrancid" ) CONFIG_FILES="$CONFIG_FILES bin/tntrancid" ;;
+ "bin/xrancid" ) CONFIG_FILES="$CONFIG_FILES bin/xrancid" ;;
+ "bin/zrancid" ) CONFIG_FILES="$CONFIG_FILES bin/zrancid" ;;
+ "share/rtrfilter" ) CONFIG_FILES="$CONFIG_FILES share/rtrfilter" ;;
+ "depfiles" ) CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
+ "include/config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS include/config.h" ;;
+ *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5
+echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
+ { (exit 1); exit 1; }; };;
+ esac
+done
+
+# If the user did not use the arguments to specify the items to instantiate,
+# then the envvar interface is used. Set only those that are not.
+# We use the long form for the default assignment because of an extremely
+# bizarre bug on SunOS 4.1.3.
+if $ac_need_defaults; then
+ test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
+ test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
+ test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
+fi
+
+# Have a temporary directory for convenience. Make it in the build tree
+# simply because there is no reason to put it here, and in addition,
+# creating and moving files from /tmp can sometimes cause problems.
+# Create a temporary directory, and hook for its removal unless debugging.
+$debug ||
+{
+ trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
+ trap '{ (exit 1); exit 1; }' 1 2 13 15
+}
+
+# Create a (secure) tmp directory for tmp files.
+
+{
+ tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` &&
+ test -n "$tmp" && test -d "$tmp"
+} ||
+{
+ tmp=./confstat$$-$RANDOM
+ (umask 077 && mkdir $tmp)
+} ||
+{
+ echo "$me: cannot create a temporary directory in ." >&2
+ { (exit 1); exit 1; }
+}
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<_ACEOF
+
+#
+# CONFIG_FILES section.
+#
+
+# No need to generate the scripts if there are no CONFIG_FILES.
+# This happens for instance when ./config.status config.h
+if test -n "\$CONFIG_FILES"; then
+ # Protect against being on the right side of a sed subst in config.status.
+ sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
+ s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
+s,@SHELL@,$SHELL,;t t
+s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
+s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
+s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
+s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
+s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
+s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
+s,@exec_prefix@,$exec_prefix,;t t
+s,@prefix@,$prefix,;t t
+s,@program_transform_name@,$program_transform_name,;t t
+s,@bindir@,$bindir,;t t
+s,@sbindir@,$sbindir,;t t
+s,@libexecdir@,$libexecdir,;t t
+s,@datadir@,$datadir,;t t
+s,@sysconfdir@,$sysconfdir,;t t
+s,@sharedstatedir@,$sharedstatedir,;t t
+s,@localstatedir@,$localstatedir,;t t
+s,@libdir@,$libdir,;t t
+s,@includedir@,$includedir,;t t
+s,@oldincludedir@,$oldincludedir,;t t
+s,@infodir@,$infodir,;t t
+s,@mandir@,$mandir,;t t
+s,@build_alias@,$build_alias,;t t
+s,@host_alias@,$host_alias,;t t
+s,@target_alias@,$target_alias,;t t
+s,@DEFS@,$DEFS,;t t
+s,@ECHO_C@,$ECHO_C,;t t
+s,@ECHO_N@,$ECHO_N,;t t
+s,@ECHO_T@,$ECHO_T,;t t
+s,@LIBS@,$LIBS,;t t
+s,@VERSION@,$VERSION,;t t
+s,@PACKAGE@,$PACKAGE,;t t
+s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
+s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
+s,@INSTALL_DATA@,$INSTALL_DATA,;t t
+s,@CYGPATH_W@,$CYGPATH_W,;t t
+s,@ACLOCAL@,$ACLOCAL,;t t
+s,@AUTOCONF@,$AUTOCONF,;t t
+s,@AUTOMAKE@,$AUTOMAKE,;t t
+s,@AUTOHEADER@,$AUTOHEADER,;t t
+s,@MAKEINFO@,$MAKEINFO,;t t
+s,@AMTAR@,$AMTAR,;t t
+s,@install_sh@,$install_sh,;t t
+s,@STRIP@,$STRIP,;t t
+s,@ac_ct_STRIP@,$ac_ct_STRIP,;t t
+s,@INSTALL_STRIP_PROGRAM@,$INSTALL_STRIP_PROGRAM,;t t
+s,@mkdir_p@,$mkdir_p,;t t
+s,@AWK@,$AWK,;t t
+s,@SET_MAKE@,$SET_MAKE,;t t
+s,@am__leading_dot@,$am__leading_dot,;t t
+s,@MAKE@,$MAKE,;t t
+s,@CC@,$CC,;t t
+s,@CFLAGS@,$CFLAGS,;t t
+s,@LDFLAGS@,$LDFLAGS,;t t
+s,@CPPFLAGS@,$CPPFLAGS,;t t
+s,@ac_ct_CC@,$ac_ct_CC,;t t
+s,@EXEEXT@,$EXEEXT,;t t
+s,@OBJEXT@,$OBJEXT,;t t
+s,@DEPDIR@,$DEPDIR,;t t
+s,@am__include@,$am__include,;t t
+s,@am__quote@,$am__quote,;t t
+s,@AMDEP_TRUE@,$AMDEP_TRUE,;t t
+s,@AMDEP_FALSE@,$AMDEP_FALSE,;t t
+s,@AMDEPBACKSLASH@,$AMDEPBACKSLASH,;t t
+s,@CCDEPMODE@,$CCDEPMODE,;t t
+s,@am__fastdepCC_TRUE@,$am__fastdepCC_TRUE,;t t
+s,@am__fastdepCC_FALSE@,$am__fastdepCC_FALSE,;t t
+s,@CPP@,$CPP,;t t
+s,@EGREP@,$EGREP,;t t
+s,@U@,$U,;t t
+s,@ANSI2KNR@,$ANSI2KNR,;t t
+s,@MAILPLUS@,$MAILPLUS,;t t
+s,@ADMINMAILPLUS@,$ADMINMAILPLUS,;t t
+s,@DIRNAME@,$DIRNAME,;t t
+s,@DIFF@,$DIFF,;t t
+s,@DIFF_CMD@,$DIFF_CMD,;t t
+s,@SENDMAIL@,$SENDMAIL,;t t
+s,@TAR@,$TAR,;t t
+s,@PERLV_PATH@,$PERLV_PATH,;t t
+s,@PERLV@,$PERLV,;t t
+s,@EXPECT_PATH@,$EXPECT_PATH,;t t
+s,@PING_PATH@,$PING_PATH,;t t
+s,@LG_PING_CMD@,$LG_PING_CMD,;t t
+s,@CVS@,$CVS,;t t
+s,@COMM@,$COMM,;t t
+s,@FIND@,$FIND,;t t
+s,@GREP@,$GREP,;t t
+s,@ID@,$ID,;t t
+s,@MKDIR@,$MKDIR,;t t
+s,@RSH@,$RSH,;t t
+s,@SORT@,$SORT,;t t
+s,@SSH@,$SSH,;t t
+s,@TELNET@,$TELNET,;t t
+s,@TOUCH@,$TOUCH,;t t
+s,@ENV_PATH@,$ENV_PATH,;t t
+s,@LIBOBJS@,$LIBOBJS,;t t
+s,@LTLIBOBJS@,$LTLIBOBJS,;t t
+CEOF
+
+_ACEOF
+
+ cat >>$CONFIG_STATUS <<\_ACEOF
+ # Split the substitutions into bite-sized pieces for seds with
+ # small command number limits, like on Digital OSF/1 and HP-UX.
+ ac_max_sed_lines=48
+ ac_sed_frag=1 # Number of current file.
+ ac_beg=1 # First line for current file.
+ ac_end=$ac_max_sed_lines # Line after last line for current file.
+ ac_more_lines=:
+ ac_sed_cmds=
+ while $ac_more_lines; do
+ if test $ac_beg -gt 1; then
+ sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
else
- ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
+ sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
fi
- ac_file=`expr $ac_file + 1`
- ac_beg=$ac_end
- ac_end=`expr $ac_end + $ac_max_sed_cmds`
- fi
-done
-if test -z "$ac_sed_cmds"; then
- ac_sed_cmds=cat
-fi
-EOF
-
-cat >> $CONFIG_STATUS <<EOF
-
-CONFIG_FILES=\${CONFIG_FILES-"Makefile include/Makefile bin/Makefile util/Makefile \
- bin/alogin bin/arancid bin/blogin bin/brancid bin/cat5rancid \
- bin/clogin bin/control_rancid bin/create_cvs bin/do-diffs bin/elogin \
- bin/env bin/erancid bin/f10rancid bin/flogin bin/francid bin/jlogin \
- bin/jrancid bin/hlogin \
- bin/hrancid bin/mrancid bin/par bin/rancid-fe bin/rancid bin/rename \
- bin/rrancid bin/xrancid \
- man/Makefile man/env.5 man/lg.conf.5 man/lg_intro.1 \
- include/version.h \
- util/rtrfilter util/downreport "}
-EOF
-cat >> $CONFIG_STATUS <<\EOF
-for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
+ if test ! -s $tmp/subs.frag; then
+ ac_more_lines=false
+ else
+ # The purpose of the label and of the branching condition is to
+ # speed up the sed processing (if there are no `@' at all, there
+ # is no need to browse any of the substitutions).
+ # These are the two extra sed commands mentioned above.
+ (echo ':t
+ /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
+ if test -z "$ac_sed_cmds"; then
+ ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
+ else
+ ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
+ fi
+ ac_sed_frag=`expr $ac_sed_frag + 1`
+ ac_beg=$ac_end
+ ac_end=`expr $ac_end + $ac_max_sed_lines`
+ fi
+ done
+ if test -z "$ac_sed_cmds"; then
+ ac_sed_cmds=cat
+ fi
+fi # test -n "$CONFIG_FILES"
+
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
+for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
# Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
- case "$ac_file" in
- *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
- ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
- *) ac_file_in="${ac_file}.in" ;;
+ case $ac_file in
+ - | *:- | *:-:* ) # input from stdin
+ cat >$tmp/stdin
+ ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
+ ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
+ *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
+ ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
+ * ) ac_file_in=$ac_file.in ;;
esac
- # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
-
- # Remove last slash and all that follows it. Not all systems have dirname.
- ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
- if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
- # The file is in a subdirectory.
- test ! -d "$ac_dir" && mkdir "$ac_dir"
- ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
- # A "../" for each directory in $ac_dir_suffix.
- ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
+ # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
+ ac_dir=`(dirname "$ac_file") 2>/dev/null ||
+$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$ac_file" : 'X\(//\)[^/]' \| \
+ X"$ac_file" : 'X\(//\)$' \| \
+ X"$ac_file" : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X"$ac_file" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+ /^X\(\/\/\)$/{ s//\1/; q; }
+ /^X\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+ { if $as_mkdir_p; then
+ mkdir -p "$ac_dir"
else
- ac_dir_suffix= ac_dots=
- fi
-
- case "$ac_given_srcdir" in
- .) srcdir=.
- if test -z "$ac_dots"; then top_srcdir=.
- else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
- /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
+ as_dir="$ac_dir"
+ as_dirs=
+ while test ! -d "$as_dir"; do
+ as_dirs="$as_dir $as_dirs"
+ as_dir=`(dirname "$as_dir") 2>/dev/null ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$as_dir" : 'X\(//\)[^/]' \| \
+ X"$as_dir" : 'X\(//\)$' \| \
+ X"$as_dir" : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X"$as_dir" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+ /^X\(\/\/\)$/{ s//\1/; q; }
+ /^X\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+ done
+ test ! -n "$as_dirs" || mkdir $as_dirs
+ fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5
+echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}
+ { (exit 1); exit 1; }; }; }
+
+ ac_builddir=.
+
+if test "$ac_dir" != .; then
+ ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
+ # A "../" for each directory in $ac_dir_suffix.
+ ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
+else
+ ac_dir_suffix= ac_top_builddir=
+fi
+
+case $srcdir in
+ .) # No --srcdir option. We are building in place.
+ ac_srcdir=.
+ if test -z "$ac_top_builddir"; then
+ ac_top_srcdir=.
+ else
+ ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
+ fi ;;
+ [\\/]* | ?:[\\/]* ) # Absolute path.
+ ac_srcdir=$srcdir$ac_dir_suffix;
+ ac_top_srcdir=$srcdir ;;
*) # Relative path.
- srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
- top_srcdir="$ac_dots$ac_given_srcdir" ;;
- esac
+ ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
+ ac_top_srcdir=$ac_top_builddir$srcdir ;;
+esac
+
+# Do not use `cd foo && pwd` to compute absolute paths, because
+# the directories may not exist.
+case `pwd` in
+.) ac_abs_builddir="$ac_dir";;
+*)
+ case "$ac_dir" in
+ .) ac_abs_builddir=`pwd`;;
+ [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";;
+ *) ac_abs_builddir=`pwd`/"$ac_dir";;
+ esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_top_builddir=${ac_top_builddir}.;;
+*)
+ case ${ac_top_builddir}. in
+ .) ac_abs_top_builddir=$ac_abs_builddir;;
+ [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;
+ *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;
+ esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_srcdir=$ac_srcdir;;
+*)
+ case $ac_srcdir in
+ .) ac_abs_srcdir=$ac_abs_builddir;;
+ [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;;
+ *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;
+ esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_top_srcdir=$ac_top_srcdir;;
+*)
+ case $ac_top_srcdir in
+ .) ac_abs_top_srcdir=$ac_abs_builddir;;
+ [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;
+ *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;
+ esac;;
+esac
- case "$ac_given_INSTALL" in
- [/$]*) INSTALL="$ac_given_INSTALL" ;;
- *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
+
+ case $INSTALL in
+ [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
+ *) ac_INSTALL=$ac_top_builddir$INSTALL ;;
esac
- echo creating "$ac_file"
- rm -f "$ac_file"
- configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
- case "$ac_file" in
- *Makefile*) ac_comsub="1i\\
-# $configure_input" ;;
- *) ac_comsub= ;;
+ if test x"$ac_file" != x-; then
+ { echo "$as_me:$LINENO: creating $ac_file" >&5
+echo "$as_me: creating $ac_file" >&6;}
+ rm -f "$ac_file"
+ fi
+ # Let's still pretend it is `configure' which instantiates (i.e., don't
+ # use $as_me), people would be surprised to read:
+ # /* config.h. Generated by config.status. */
+ if test x"$ac_file" = x-; then
+ configure_input=
+ else
+ configure_input="$ac_file. "
+ fi
+ configure_input=$configure_input"Generated from `echo $ac_file_in |
+ sed 's,.*/,,'` by configure."
+
+ # First look for the input files in the build tree, otherwise in the
+ # src tree.
+ ac_file_inputs=`IFS=:
+ for f in $ac_file_in; do
+ case $f in
+ -) echo $tmp/stdin ;;
+ [\\/$]*)
+ # Absolute (can't be DOS-style, as IFS=:)
+ test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
+echo "$as_me: error: cannot find input file: $f" >&2;}
+ { (exit 1); exit 1; }; }
+ echo "$f";;
+ *) # Relative
+ if test -f "$f"; then
+ # Build tree
+ echo "$f"
+ elif test -f "$srcdir/$f"; then
+ # Source tree
+ echo "$srcdir/$f"
+ else
+ # /dev/null tree
+ { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
+echo "$as_me: error: cannot find input file: $f" >&2;}
+ { (exit 1); exit 1; }; }
+ fi;;
+ esac
+ done` || { (exit 1); exit 1; }
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF
+ sed "$ac_vpsub
+$extrasub
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
+:t
+/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
+s,@configure_input@,$configure_input,;t t
+s,@srcdir@,$ac_srcdir,;t t
+s,@abs_srcdir@,$ac_abs_srcdir,;t t
+s,@top_srcdir@,$ac_top_srcdir,;t t
+s,@abs_top_srcdir@,$ac_abs_top_srcdir,;t t
+s,@builddir@,$ac_builddir,;t t
+s,@abs_builddir@,$ac_abs_builddir,;t t
+s,@top_builddir@,$ac_top_builddir,;t t
+s,@abs_top_builddir@,$ac_abs_top_builddir,;t t
+s,@INSTALL@,$ac_INSTALL,;t t
+" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
+ rm -f $tmp/stdin
+ if test x"$ac_file" != x-; then
+ mv $tmp/out $ac_file
+ else
+ cat $tmp/out
+ rm -f $tmp/out
+ fi
+
+ # Run the commands associated with the file.
+ case $ac_file in
+ bin/control_rancid ) chmod a+x $ac_file ;;
+ bin/par ) chmod a+x $ac_file ;;
+ bin/rancid-fe ) chmod a+x $ac_file ;;
+ bin/alogin ) chmod a+x $ac_file ;;
+ bin/arancid ) chmod a+x $ac_file ;;
+ bin/blogin ) chmod a+x $ac_file ;;
+ bin/brancid ) chmod a+x $ac_file ;;
+ bin/cat5rancid ) chmod a+x $ac_file ;;
+ bin/clogin ) chmod a+x $ac_file ;;
+ bin/rancid ) chmod a+x $ac_file ;;
+ bin/cssrancid ) chmod a+x $ac_file ;;
+ bin/elogin ) chmod a+x $ac_file ;;
+ bin/erancid ) chmod a+x $ac_file ;;
+ bin/f10rancid ) chmod a+x $ac_file ;;
+ bin/flogin ) chmod a+x $ac_file ;;
+ bin/francid ) chmod a+x $ac_file ;;
+ bin/fnrancid ) chmod a+x $ac_file ;;
+ bin/jlogin ) chmod a+x $ac_file ;;
+ bin/jrancid ) chmod a+x $ac_file ;;
+ bin/jerancid ) chmod a+x $ac_file ;;
+ bin/hlogin ) chmod a+x $ac_file ;;
+ bin/hrancid ) chmod a+x $ac_file ;;
+ bin/htlogin ) chmod a+x $ac_file ;;
+ bin/htrancid ) chmod a+x $ac_file ;;
+ bin/mrancid ) chmod a+x $ac_file ;;
+ bin/nlogin ) chmod a+x $ac_file ;;
+ bin/nrancid ) chmod a+x $ac_file ;;
+ bin/nslogin ) chmod a+x $ac_file ;;
+ bin/nsrancid ) chmod a+x $ac_file ;;
+ bin/prancid ) chmod a+x $ac_file ;;
+ bin/rivlogin ) chmod a+x $ac_file ;;
+ bin/rivrancid ) chmod a+x $ac_file ;;
+ bin/rrancid ) chmod a+x $ac_file ;;
+ bin/tntlogin ) chmod a+x $ac_file ;;
+ bin/tntrancid ) chmod a+x $ac_file ;;
+ bin/xrancid ) chmod a+x $ac_file ;;
+ bin/zrancid ) chmod a+x $ac_file ;;
+ share/rtrfilter ) chmod a+x $ac_file ;;
esac
+done
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
- ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
- sed -e "$ac_comsub
-s%@configure_input@%$configure_input%g
-s%@srcdir@%$srcdir%g
-s%@top_srcdir@%$top_srcdir%g
-s%@INSTALL@%$INSTALL%g
-" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
-fi; done
-rm -f conftest.s*
+#
+# CONFIG_HEADER section.
+#
# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
# NAME is the cpp macro being defined and VALUE is the value it is being given.
#
# ac_d sets the value in "#define NAME VALUE" lines.
-ac_dA='s%^\([ ]*\)#\([ ]*define[ ][ ]*\)'
-ac_dB='\([ ][ ]*\)[^ ]*%\1#\2'
-ac_dC='\3'
-ac_dD='%g'
-# ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
-ac_uA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)'
-ac_uB='\([ ]\)%\1#\2define\3'
+ac_dA='s,^\([ ]*\)#\([ ]*define[ ][ ]*\)'
+ac_dB='[ ].*$,\1#\2'
+ac_dC=' '
+ac_dD=',;t'
+# ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
+ac_uA='s,^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)'
+ac_uB='$,\1#\2define\3'
ac_uC=' '
-ac_uD='\4%g'
-# ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
-ac_eA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)'
-ac_eB='$%\1#\2define\3'
-ac_eC=' '
-ac_eD='%g'
-
-if test "${CONFIG_HEADERS+set}" != set; then
-EOF
-cat >> $CONFIG_STATUS <<EOF
- CONFIG_HEADERS="include/config.h"
-EOF
-cat >> $CONFIG_STATUS <<\EOF
-fi
-for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
+ac_uD=',;t'
+
+for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
# Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
- case "$ac_file" in
- *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
- ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
- *) ac_file_in="${ac_file}.in" ;;
+ case $ac_file in
+ - | *:- | *:-:* ) # input from stdin
+ cat >$tmp/stdin
+ ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
+ ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
+ *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
+ ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
+ * ) ac_file_in=$ac_file.in ;;
esac
- echo creating $ac_file
-
- rm -f conftest.frag conftest.in conftest.out
- ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
- cat $ac_file_inputs > conftest.in
-
-EOF
-
-# Transform confdefs.h into a sed script conftest.vals that substitutes
-# the proper values into config.h.in to produce config.h. And first:
-# Protect against being on the right side of a sed subst in config.status.
-# Protect against being in an unquoted here document in config.status.
-rm -f conftest.vals
-cat > conftest.hdr <<\EOF
-s/[\\&%]/\\&/g
-s%[\\$`]%\\&%g
-s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
-s%ac_d%ac_u%gp
-s%ac_u%ac_e%gp
-EOF
-sed -n -f conftest.hdr confdefs.h > conftest.vals
-rm -f conftest.hdr
+ test x"$ac_file" != x- && { echo "$as_me:$LINENO: creating $ac_file" >&5
+echo "$as_me: creating $ac_file" >&6;}
+
+ # First look for the input files in the build tree, otherwise in the
+ # src tree.
+ ac_file_inputs=`IFS=:
+ for f in $ac_file_in; do
+ case $f in
+ -) echo $tmp/stdin ;;
+ [\\/$]*)
+ # Absolute (can't be DOS-style, as IFS=:)
+ test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
+echo "$as_me: error: cannot find input file: $f" >&2;}
+ { (exit 1); exit 1; }; }
+ # Do quote $f, to prevent DOS paths from being IFS'd.
+ echo "$f";;
+ *) # Relative
+ if test -f "$f"; then
+ # Build tree
+ echo "$f"
+ elif test -f "$srcdir/$f"; then
+ # Source tree
+ echo "$srcdir/$f"
+ else
+ # /dev/null tree
+ { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
+echo "$as_me: error: cannot find input file: $f" >&2;}
+ { (exit 1); exit 1; }; }
+ fi;;
+ esac
+ done` || { (exit 1); exit 1; }
+ # Remove the trailing spaces.
+ sed 's/[ ]*$//' $ac_file_inputs >$tmp/in
+
+_ACEOF
+
+# Transform confdefs.h into two sed scripts, `conftest.defines' and
+# `conftest.undefs', that substitutes the proper values into
+# config.h.in to produce config.h. The first handles `#define'
+# templates, and the second `#undef' templates.
+# And first: Protect against being on the right side of a sed subst in
+# config.status. Protect against being in an unquoted here document
+# in config.status.
+rm -f conftest.defines conftest.undefs
+# Using a here document instead of a string reduces the quoting nightmare.
+# Putting comments in sed scripts is not portable.
+#
+# `end' is used to avoid that the second main sed command (meant for
+# 0-ary CPP macros) applies to n-ary macro definitions.
+# See the Autoconf documentation for `clear'.
+cat >confdef2sed.sed <<\_ACEOF
+s/[\\&,]/\\&/g
+s,[\\$`],\\&,g
+t clear
+: clear
+s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*\)\(([^)]*)\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1\2${ac_dC}\3${ac_dD},gp
+t end
+s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp
+: end
+_ACEOF
+# If some macros were called several times there might be several times
+# the same #defines, which is useless. Nevertheless, we may not want to
+# sort them, since we want the *last* AC-DEFINE to be honored.
+uniq confdefs.h | sed -n -f confdef2sed.sed >conftest.defines
+sed 's/ac_d/ac_u/g' conftest.defines >conftest.undefs
+rm -f confdef2sed.sed
# This sed command replaces #undef with comments. This is necessary, for
# example, in the case of _POSIX_SOURCE, which is predefined and required
# on some systems where configure will not decide to define it.
-cat >> conftest.vals <<\EOF
-s%^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
-EOF
-
-# Break up conftest.vals because some shells have a limit on
-# the size of here documents, and old seds have small limits too.
+cat >>conftest.undefs <<\_ACEOF
+s,^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */,
+_ACEOF
+
+# Break up conftest.defines because some shells have a limit on the size
+# of here documents, and old seds have small limits too (100 cmds).
+echo ' # Handle all the #define templates only if necessary.' >>$CONFIG_STATUS
+echo ' if grep "^[ ]*#[ ]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS
+echo ' # If there are no defines, we may have an empty if/fi' >>$CONFIG_STATUS
+echo ' :' >>$CONFIG_STATUS
+rm -f conftest.tail
+while grep . conftest.defines >/dev/null
+do
+ # Write a limited-size here document to $tmp/defines.sed.
+ echo ' cat >$tmp/defines.sed <<CEOF' >>$CONFIG_STATUS
+ # Speed up: don't consider the non `#define' lines.
+ echo '/^[ ]*#[ ]*define/!b' >>$CONFIG_STATUS
+ # Work around the forget-to-reset-the-flag bug.
+ echo 't clr' >>$CONFIG_STATUS
+ echo ': clr' >>$CONFIG_STATUS
+ sed ${ac_max_here_lines}q conftest.defines >>$CONFIG_STATUS
+ echo 'CEOF
+ sed -f $tmp/defines.sed $tmp/in >$tmp/out
+ rm -f $tmp/in
+ mv $tmp/out $tmp/in
+' >>$CONFIG_STATUS
+ sed 1,${ac_max_here_lines}d conftest.defines >conftest.tail
+ rm -f conftest.defines
+ mv conftest.tail conftest.defines
+done
+rm -f conftest.defines
+echo ' fi # grep' >>$CONFIG_STATUS
+echo >>$CONFIG_STATUS
+# Break up conftest.undefs because some shells have a limit on the size
+# of here documents, and old seds have small limits too (100 cmds).
+echo ' # Handle all the #undef templates' >>$CONFIG_STATUS
rm -f conftest.tail
-while :
-do
- ac_lines=`grep -c . conftest.vals`
- # grep -c gives empty output for an empty file on some AIX systems.
- if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
- # Write a limited-size here document to conftest.frag.
- echo ' cat > conftest.frag <<CEOF' >> $CONFIG_STATUS
- sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
+while grep . conftest.undefs >/dev/null
+do
+ # Write a limited-size here document to $tmp/undefs.sed.
+ echo ' cat >$tmp/undefs.sed <<CEOF' >>$CONFIG_STATUS
+ # Speed up: don't consider the non `#undef'
+ echo '/^[ ]*#[ ]*undef/!b' >>$CONFIG_STATUS
+ # Work around the forget-to-reset-the-flag bug.
+ echo 't clr' >>$CONFIG_STATUS
+ echo ': clr' >>$CONFIG_STATUS
+ sed ${ac_max_here_lines}q conftest.undefs >>$CONFIG_STATUS
echo 'CEOF
- sed -f conftest.frag conftest.in > conftest.out
- rm -f conftest.in
- mv conftest.out conftest.in
-' >> $CONFIG_STATUS
- sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
- rm -f conftest.vals
- mv conftest.tail conftest.vals
-done
-rm -f conftest.vals
-
-cat >> $CONFIG_STATUS <<\EOF
- rm -f conftest.frag conftest.h
- echo "/* $ac_file. Generated automatically by configure. */" > conftest.h
- cat conftest.in >> conftest.h
- rm -f conftest.in
- if cmp -s $ac_file conftest.h 2>/dev/null; then
- echo "$ac_file is unchanged"
- rm -f conftest.h
+ sed -f $tmp/undefs.sed $tmp/in >$tmp/out
+ rm -f $tmp/in
+ mv $tmp/out $tmp/in
+' >>$CONFIG_STATUS
+ sed 1,${ac_max_here_lines}d conftest.undefs >conftest.tail
+ rm -f conftest.undefs
+ mv conftest.tail conftest.undefs
+done
+rm -f conftest.undefs
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+ # Let's still pretend it is `configure' which instantiates (i.e., don't
+ # use $as_me), people would be surprised to read:
+ # /* config.h. Generated by config.status. */
+ if test x"$ac_file" = x-; then
+ echo "/* Generated by configure. */" >$tmp/config.h
else
- # Remove last slash and all that follows it. Not all systems have dirname.
- ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
- if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
- # The file is in a subdirectory.
- test ! -d "$ac_dir" && mkdir "$ac_dir"
- fi
- rm -f $ac_file
- mv conftest.h $ac_file
+ echo "/* $ac_file. Generated by configure. */" >$tmp/config.h
fi
-fi; done
-
-EOF
-cat >> $CONFIG_STATUS <<EOF
-
-
-EOF
-cat >> $CONFIG_STATUS <<\EOF
-test -z "$CONFIG_HEADERS" || echo timestamp > include/stamp-h
-\
- chmod a+x bin/*login bin/*rancid bin/par
-
-exit 0
-EOF
-chmod +x $CONFIG_STATUS
-rm -fr confdefs* $ac_clean_files
-test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
-
-if test "$no_recursion" != yes; then
-
- # Remove --cache-file and --srcdir arguments so they do not pile up.
- ac_sub_configure_args=
- ac_prev=
- for ac_arg in $ac_configure_args; do
- if test -n "$ac_prev"; then
- ac_prev=
- continue
- fi
- case "$ac_arg" in
- -cache-file | --cache-file | --cache-fil | --cache-fi \
- | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
- ac_prev=cache_file ;;
- -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
- | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
- ;;
- -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
- ac_prev=srcdir ;;
- -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
- ;;
- *) ac_sub_configure_args="$ac_sub_configure_args $ac_arg" ;;
- esac
- done
-
- for ac_config_dir in util; do
-
- # Do not complain, so a configure script can configure whichever
- # parts of a large source tree are present.
- if test ! -d $srcdir/$ac_config_dir; then
- continue
+ cat $tmp/in >>$tmp/config.h
+ rm -f $tmp/in
+ if test x"$ac_file" != x-; then
+ if diff $ac_file $tmp/config.h >/dev/null 2>&1; then
+ { echo "$as_me:$LINENO: $ac_file is unchanged" >&5
+echo "$as_me: $ac_file is unchanged" >&6;}
+ else
+ ac_dir=`(dirname "$ac_file") 2>/dev/null ||
+$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$ac_file" : 'X\(//\)[^/]' \| \
+ X"$ac_file" : 'X\(//\)$' \| \
+ X"$ac_file" : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X"$ac_file" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+ /^X\(\/\/\)$/{ s//\1/; q; }
+ /^X\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+ { if $as_mkdir_p; then
+ mkdir -p "$ac_dir"
+ else
+ as_dir="$ac_dir"
+ as_dirs=
+ while test ! -d "$as_dir"; do
+ as_dirs="$as_dir $as_dirs"
+ as_dir=`(dirname "$as_dir") 2>/dev/null ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$as_dir" : 'X\(//\)[^/]' \| \
+ X"$as_dir" : 'X\(//\)$' \| \
+ X"$as_dir" : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X"$as_dir" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+ /^X\(\/\/\)$/{ s//\1/; q; }
+ /^X\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+ done
+ test ! -n "$as_dirs" || mkdir $as_dirs
+ fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5
+echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}
+ { (exit 1); exit 1; }; }; }
+
+ rm -f $ac_file
+ mv $tmp/config.h $ac_file
fi
+ else
+ cat $tmp/config.h
+ rm -f $tmp/config.h
+ fi
+# Compute $ac_file's index in $config_headers.
+_am_stamp_count=1
+for _am_header in $config_headers :; do
+ case $_am_header in
+ $ac_file | $ac_file:* )
+ break ;;
+ * )
+ _am_stamp_count=`expr $_am_stamp_count + 1` ;;
+ esac
+done
+echo "timestamp for $ac_file" >`(dirname $ac_file) 2>/dev/null ||
+$as_expr X$ac_file : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X$ac_file : 'X\(//\)[^/]' \| \
+ X$ac_file : 'X\(//\)$' \| \
+ X$ac_file : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X$ac_file |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+ /^X\(\/\/\)$/{ s//\1/; q; }
+ /^X\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`/stamp-h$_am_stamp_count
+done
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
- echo configuring in $ac_config_dir
-
- case "$srcdir" in
- .) ;;
- *)
- if test -d ./$ac_config_dir || mkdir ./$ac_config_dir; then :;
- else
- { echo "configure: error: can not create `pwd`/$ac_config_dir" 1>&2; exit 1; }
- fi
- ;;
- esac
-
- ac_popdir=`pwd`
- cd $ac_config_dir
-
- # A "../" for each directory in /$ac_config_dir.
- ac_dots=`echo $ac_config_dir|sed -e 's%^\./%%' -e 's%[^/]$%&/%' -e 's%[^/]*/%../%g'`
-
- case "$srcdir" in
- .) # No --srcdir option. We are building in place.
- ac_sub_srcdir=$srcdir ;;
- /*) # Absolute path.
- ac_sub_srcdir=$srcdir/$ac_config_dir ;;
- *) # Relative path.
- ac_sub_srcdir=$ac_dots$srcdir/$ac_config_dir ;;
- esac
-
- # Check for guested configure; otherwise get Cygnus style configure.
- if test -f $ac_sub_srcdir/configure; then
- ac_sub_configure=$ac_sub_srcdir/configure
- elif test -f $ac_sub_srcdir/configure.in; then
- ac_sub_configure=$ac_configure
+#
+# CONFIG_COMMANDS section.
+#
+for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
+ ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
+ ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
+ ac_dir=`(dirname "$ac_dest") 2>/dev/null ||
+$as_expr X"$ac_dest" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$ac_dest" : 'X\(//\)[^/]' \| \
+ X"$ac_dest" : 'X\(//\)$' \| \
+ X"$ac_dest" : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X"$ac_dest" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+ /^X\(\/\/\)$/{ s//\1/; q; }
+ /^X\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+ { if $as_mkdir_p; then
+ mkdir -p "$ac_dir"
+ else
+ as_dir="$ac_dir"
+ as_dirs=
+ while test ! -d "$as_dir"; do
+ as_dirs="$as_dir $as_dirs"
+ as_dir=`(dirname "$as_dir") 2>/dev/null ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$as_dir" : 'X\(//\)[^/]' \| \
+ X"$as_dir" : 'X\(//\)$' \| \
+ X"$as_dir" : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X"$as_dir" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+ /^X\(\/\/\)$/{ s//\1/; q; }
+ /^X\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+ done
+ test ! -n "$as_dirs" || mkdir $as_dirs
+ fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5
+echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}
+ { (exit 1); exit 1; }; }; }
+
+ ac_builddir=.
+
+if test "$ac_dir" != .; then
+ ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
+ # A "../" for each directory in $ac_dir_suffix.
+ ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
+else
+ ac_dir_suffix= ac_top_builddir=
+fi
+
+case $srcdir in
+ .) # No --srcdir option. We are building in place.
+ ac_srcdir=.
+ if test -z "$ac_top_builddir"; then
+ ac_top_srcdir=.
else
- echo "configure: warning: no configuration information is in $ac_config_dir" 1>&2
- ac_sub_configure=
- fi
+ ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
+ fi ;;
+ [\\/]* | ?:[\\/]* ) # Absolute path.
+ ac_srcdir=$srcdir$ac_dir_suffix;
+ ac_top_srcdir=$srcdir ;;
+ *) # Relative path.
+ ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
+ ac_top_srcdir=$ac_top_builddir$srcdir ;;
+esac
- # The recursion is here.
- if test -n "$ac_sub_configure"; then
+# Do not use `cd foo && pwd` to compute absolute paths, because
+# the directories may not exist.
+case `pwd` in
+.) ac_abs_builddir="$ac_dir";;
+*)
+ case "$ac_dir" in
+ .) ac_abs_builddir=`pwd`;;
+ [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";;
+ *) ac_abs_builddir=`pwd`/"$ac_dir";;
+ esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_top_builddir=${ac_top_builddir}.;;
+*)
+ case ${ac_top_builddir}. in
+ .) ac_abs_top_builddir=$ac_abs_builddir;;
+ [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;
+ *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;
+ esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_srcdir=$ac_srcdir;;
+*)
+ case $ac_srcdir in
+ .) ac_abs_srcdir=$ac_abs_builddir;;
+ [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;;
+ *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;
+ esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_top_srcdir=$ac_top_srcdir;;
+*)
+ case $ac_top_srcdir in
+ .) ac_abs_top_srcdir=$ac_abs_builddir;;
+ [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;
+ *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;
+ esac;;
+esac
- # Make the cache file name correct relative to the subdirectory.
- case "$cache_file" in
- /*) ac_sub_cache_file=$cache_file ;;
- *) # Relative path.
- ac_sub_cache_file="$ac_dots$cache_file" ;;
- esac
- case "$ac_given_INSTALL" in
- [/$]*) INSTALL="$ac_given_INSTALL" ;;
- *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
- esac
-
- echo "running ${CONFIG_SHELL-/bin/sh} $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_sub_srcdir"
- # The eval makes quoting arguments work.
- if eval ${CONFIG_SHELL-/bin/sh} $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_sub_srcdir
- then :
- else
- { echo "configure: error: $ac_sub_configure failed for $ac_config_dir" 1>&2; exit 1; }
- fi
- fi
- cd $ac_popdir
+ { echo "$as_me:$LINENO: executing $ac_dest commands" >&5
+echo "$as_me: executing $ac_dest commands" >&6;}
+ case $ac_dest in
+ depfiles ) test x"$AMDEP_TRUE" != x"" || for mf in $CONFIG_FILES; do
+ # Strip MF so we end up with the name of the file.
+ mf=`echo "$mf" | sed -e 's/:.*$//'`
+ # Check whether this is an Automake generated Makefile or not.
+ # We used to match only the files named `Makefile.in', but
+ # some people rename them; so instead we look at the file content.
+ # Grep'ing the first line is not enough: some people post-process
+ # each Makefile.in and add a new line on top of each file to say so.
+ # So let's grep whole file.
+ if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then
+ dirpart=`(dirname "$mf") 2>/dev/null ||
+$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$mf" : 'X\(//\)[^/]' \| \
+ X"$mf" : 'X\(//\)$' \| \
+ X"$mf" : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X"$mf" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+ /^X\(\/\/\)$/{ s//\1/; q; }
+ /^X\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+ else
+ continue
+ fi
+ grep '^DEP_FILES *= *[^ #]' < "$mf" > /dev/null || continue
+ # Extract the definition of DEP_FILES from the Makefile without
+ # running `make'.
+ DEPDIR=`sed -n -e '/^DEPDIR = / s///p' < "$mf"`
+ test -z "$DEPDIR" && continue
+ # When using ansi2knr, U may be empty or an underscore; expand it
+ U=`sed -n -e '/^U = / s///p' < "$mf"`
+ test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR"
+ # We invoke sed twice because it is the simplest approach to
+ # changing $(DEPDIR) to its actual value in the expansion.
+ for file in `sed -n -e '
+ /^DEP_FILES = .*\\\\$/ {
+ s/^DEP_FILES = //
+ :loop
+ s/\\\\$//
+ p
+ n
+ /\\\\$/ b loop
+ p
+ }
+ /^DEP_FILES = / s/^DEP_FILES = //p' < "$mf" | \
+ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
+ # Make sure the directory exists.
+ test -f "$dirpart/$file" && continue
+ fdir=`(dirname "$file") 2>/dev/null ||
+$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$file" : 'X\(//\)[^/]' \| \
+ X"$file" : 'X\(//\)$' \| \
+ X"$file" : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X"$file" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+ /^X\(\/\/\)$/{ s//\1/; q; }
+ /^X\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+ { if $as_mkdir_p; then
+ mkdir -p $dirpart/$fdir
+ else
+ as_dir=$dirpart/$fdir
+ as_dirs=
+ while test ! -d "$as_dir"; do
+ as_dirs="$as_dir $as_dirs"
+ as_dir=`(dirname "$as_dir") 2>/dev/null ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$as_dir" : 'X\(//\)[^/]' \| \
+ X"$as_dir" : 'X\(//\)$' \| \
+ X"$as_dir" : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X"$as_dir" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+ /^X\(\/\/\)$/{ s//\1/; q; }
+ /^X\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+ done
+ test ! -n "$as_dirs" || mkdir $as_dirs
+ fi || { { echo "$as_me:$LINENO: error: cannot create directory $dirpart/$fdir" >&5
+echo "$as_me: error: cannot create directory $dirpart/$fdir" >&2;}
+ { (exit 1); exit 1; }; }; }
+
+ # echo "creating $dirpart/$file"
+ echo '# dummy' > "$dirpart/$file"
done
-fi
+done
+ ;;
+ esac
+done
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+{ (exit 0); exit 0; }
+_ACEOF
+chmod +x $CONFIG_STATUS
+ac_clean_files=$ac_clean_files_save
+
+
+# configure is writing to config.log, and then calls config.status.
+# config.status does its own redirection, appending to config.log.
+# Unfortunately, on DOS this fails, as config.log is still kept open
+# by configure, so config.status won't be able to write to it; its
+# output is simply discarded. So we exec the FD to /dev/null,
+# effectively closing config.log, so it can be properly (re)opened and
+# appended to by config.status. When coming back to configure, we
+# need to make the FD available again.
+if test "$no_create" != yes; then
+ ac_cs_success=:
+ ac_config_status_args=
+ test "$silent" = yes &&
+ ac_config_status_args="$ac_config_status_args --quiet"
+ exec 5>/dev/null
+ $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
+ exec 5>>config.log
+ # Use ||, not &&, to avoid exiting from the if with $? = 1, which
+ # would make configure fail if this is the last instruction.
+ $ac_cs_success || { (exit 1); exit 1; }
+fi
-# fix permissions on scripts.
-for file in $progs; do chmod a+x $file; done
diff --git a/configure.in b/configure.in
index b18d474..597b49e 100644
--- a/configure.in
+++ b/configure.in
@@ -10,17 +10,14 @@ PACKAGE=`sed -n 's/.*package.*"\(.*\)".*/\1/p' $srcdir/include/version.h.in|tr -
AC_SUBST(VERSION)
AC_SUBST(PACKAGE)
-AM_INIT_AUTOMAKE($PACKAGE, $VERSION)
-
-AM_CONFIG_HEADER(include/config.h)
+AM_INIT_AUTOMAKE($PACKAGE, $VERSION, rancid@shrubbery.net)
dnl default install location
AC_PREFIX_DEFAULT(/usr/local/rancid)
-AM_MAINTAINER_MODE()
+dnl AM_MAINTAINER_MODE()
-dnl AC_CONFIG_SUBDIRS(bin util)
-AC_CONFIG_SUBDIRS(util)
+dnl AC_CONFIG_SUBDIRS(util)
# make sure MAKE sets ${MAKE}
AC_PATH_PROG(MAKE,gmake,no)
@@ -60,11 +57,13 @@ dnl AC_FUNC_VPRINTF
AC_TYPE_SIGNAL
AC_TYPE_SIZE_T
-# Check for a preference for using mail addresses like rancid+admin-group
-# instead of the standard rancid-admin-group
+# Package-specific options/knobs
+#
+# Check for a preference for using mail addresses like rancid+group
+# instead of the standard rancid-group
AC_MSG_CHECKING([whether mail addresses should be in the rancid+ form])
AC_ARG_ENABLE(mail-plus,
-[ --enable-mail-plus enable mail to rancid+ addresses, instead of rancid-],
+ AS_HELP_STRING([--enable-mail-plus], [enable mail to rancid+ addresses, instead of rancid-]),
[if test "$enable_mail_plus" = yes; then
AC_MSG_RESULT(yes)
MAILPLUS="rancid+"
@@ -80,8 +79,28 @@ fi],
])
rd_cv_MAILPLUS=$MAILPLUS
+# Check for a preference for using mail addresses like rancid+admin-group
+# instead of the standard rancid-admin-group
+AC_MSG_CHECKING([whether admin mail addresses should be in the rancid+ form])
+AC_ARG_ENABLE(adminmail-plus,
+ AS_HELP_STRING([--enable-adminmail-plus], [enable mail to rancid-admin+ addresses, instead of rancid-admin-]),
+[if test "$enable_adminmail_plus" = yes; then
+ AC_MSG_RESULT(yes)
+ ADMINMAILPLUS="rancid-admin+"
+ AC_SUBST(ADMINMAILPLUS)
+else
+ AC_MSG_RESULT(no)
+ ADMINMAILPLUS="${MAILPLUS}admin-"
+ AC_SUBST(ADMINMAILPLUS)
+fi],
+[AC_MSG_RESULT(no)
+ ADMINMAILPLUS="${MAILPLUS}admin-"
+ AC_SUBST(ADMINMAILPLUS)
+])
+rd_cv_ADMINMAILPLUS=$ADMINMAILPLUS
+
AC_PATH_PROG(DIRNAME,dirname,no)
-# locate GNU diff (-u option)
+# locate GNU diff (one supporting the -u option)
AC_PATH_PROG(DIFF,diff,no, /usr/local/bin:/usr/gnu/bin:/usr/bin:/usr/contrib/bin)
if test $DIFF = no; then
unset ac_cv_path_DIFF
@@ -168,36 +187,9 @@ else
fi
rd_cv_lg_ping_cmd=$LG_PING_CMD
-# RD_BIN_DATAS are bin/ .in's that need to be installed without execute
-# perms.
-RD_BIN_DATAS=""
-AC_SUBST(RD_BIN_DATAS)
-rd_cv_rd_bin_datas=$RD_BIN_DATAS
-
-# RD_BIN_PROGS are bin/ .in's that need to be installed with execute perms.
-RD_BIN_PROGS="cat5rancid control_rancid \
-alogin arancid clogin create_cvs blogin brancid do-diffs elogin erancid \
-f10rancid flogin francid jlogin jrancid hlogin hrancid mrancid par rancid-fe \
-rancid rename rrancid xrancid"
-AC_SUBST(RD_BIN_PROGS)
-rd_cv_rd_bin_progs=$RD_BIN_PROGS
-
-# RD_UTIL_PROGS are util/ .in's that need to be installed with execute perms.
-RD_UTIL_PROGS="rtrfilter downreport getipacctg"
-AC_SUBST(RD_UTIL_PROGS)
-rd_cv_rd_util_progs=$RD_UTIL_PROGS
-
-# RD_UTIL_LG_PROGS are util/lg .in's that need to be installed with execute
-# perms.
-RD_UTIL_LG_PROGS="lg.cgi lgform.cgi"
-AC_SUBST(RD_UTIL_LG_PROGS)
-rd_cv_rd_util_lg_progs=$RD_UTIL_LG_PROGS
-
-AC_SUBST(INST_PROGS)
-INST_PROGS=$progs
-
-# locate tools to build $PATH for env. order is significant. want to be
-# sure that we pick up the the proper diff and ucbmail in bin/env.
+# locate tools to build $PATH for rancid.conf. order is significant. want
+# to be sure that we pick up the the proper diff and ucbmail in
+# etc/rancid.conf.
ENV_PATH="`dirname $PERLV_PATH`:`dirname $EXPECT_PATH`:`dirname $SENDMAIL`"
ENV_PATH="$ENV_PATH:`dirname $DIRNAME`:`dirname $DIFF`"
@@ -233,18 +225,38 @@ ENV_PATH=`echo $ENV_PATH | $PERLV_PATH -e 'foreach $x(split(":",<>)){next unless
ac_cv_env_path=$ENV_PATH
AC_SUBST(ENV_PATH)
-AC_OUTPUT([ Makefile include/Makefile bin/Makefile util/Makefile \
- bin/alogin bin/arancid bin/blogin bin/brancid bin/cat5rancid \
- bin/clogin bin/control_rancid bin/create_cvs bin/do-diffs bin/elogin \
- bin/env bin/erancid bin/f10rancid bin/flogin bin/francid bin/jlogin \
- bin/jrancid bin/hlogin \
- bin/hrancid bin/mrancid bin/par bin/rancid-fe bin/rancid bin/rename \
- bin/rrancid bin/xrancid \
- man/Makefile man/env.5 man/lg.conf.5 man/lg_intro.1 \
- include/version.h \
- util/rtrfilter util/downreport ], \
- [ chmod a+x bin/*login bin/*rancid bin/par ]
- )
-
-# fix permissions on scripts.
-for file in $progs; do chmod a+x $file; done
+
+AC_CONFIG_FILES(Makefile)
+AC_CONFIG_FILES(bin/Makefile)
+AC_CONFIG_FILES(etc/Makefile)
+AC_CONFIG_FILES(include/Makefile)
+AC_CONFIG_FILES(man/Makefile)
+AC_CONFIG_FILES(share/Makefile)
+AC_CONFIG_FILES(include/version.h) # this is not a header in the sense of
+ # AC_CONFIG_HEADERS will cause
+ # autoheader to overwrite it, while all
+ # want is simple variable replacement
+AC_CONFIG_HEADERS(include/config.h)
+AC_CONFIG_FILES(bin/control_rancid bin/par bin/rancid-fe, [chmod a+x $ac_file])
+AC_CONFIG_FILES(bin/alogin bin/arancid, [chmod a+x $ac_file])
+AC_CONFIG_FILES(bin/blogin bin/brancid, [chmod a+x $ac_file])
+AC_CONFIG_FILES(bin/cat5rancid bin/clogin bin/rancid, [chmod a+x $ac_file])
+AC_CONFIG_FILES(bin/cssrancid, [chmod a+x $ac_file])
+AC_CONFIG_FILES(bin/elogin bin/erancid, [chmod a+x $ac_file])
+AC_CONFIG_FILES(bin/f10rancid, [chmod a+x $ac_file])
+AC_CONFIG_FILES(bin/flogin bin/francid, [chmod a+x $ac_file])
+AC_CONFIG_FILES(bin/fnrancid, [chmod a+x $ac_file])
+AC_CONFIG_FILES(bin/jlogin bin/jrancid bin/jerancid, [chmod a+x $ac_file])
+AC_CONFIG_FILES(bin/hlogin bin/hrancid, [chmod a+x $ac_file])
+AC_CONFIG_FILES(bin/htlogin bin/htrancid, [chmod a+x $ac_file])
+AC_CONFIG_FILES(bin/mrancid, [chmod a+x $ac_file])
+AC_CONFIG_FILES(bin/nlogin bin/nrancid, [chmod a+x $ac_file])
+AC_CONFIG_FILES(bin/nslogin bin/nsrancid, [chmod a+x $ac_file])
+AC_CONFIG_FILES(bin/prancid, [chmod a+x $ac_file])
+AC_CONFIG_FILES(bin/rivlogin bin/rivrancid, [chmod a+x $ac_file])
+AC_CONFIG_FILES(bin/rrancid, [chmod a+x $ac_file])
+AC_CONFIG_FILES(bin/tntlogin bin/tntrancid, [chmod a+x $ac_file])
+AC_CONFIG_FILES(bin/xrancid bin/zrancid, [chmod a+x $ac_file])
+AC_CONFIG_FILES(share/rtrfilter, [chmod a+x $ac_file])
+
+AC_OUTPUT()
diff --git a/depcomp b/depcomp
new file mode 100755
index 0000000..9e5522d
--- /dev/null
+++ b/depcomp
@@ -0,0 +1,520 @@
+#! /bin/sh
+# depcomp - compile a program generating dependencies as side-effects
+
+scriptversion=2003-11-08.23
+
+# Copyright (C) 1999, 2000, 2003 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+# 02111-1307, USA.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# Originally written by Alexandre Oliva <oliva@dcc.unicamp.br>.
+
+case $1 in
+ '')
+ echo "$0: No command. Try \`$0 --help' for more information." 1>&2
+ exit 1;
+ ;;
+ -h | --h*)
+ cat <<\EOF
+Usage: depcomp [--help] [--version] PROGRAM [ARGS]
+
+Run PROGRAMS ARGS to compile a file, generating dependencies
+as side-effects.
+
+Environment variables:
+ depmode Dependency tracking mode.
+ source Source file read by `PROGRAMS ARGS'.
+ object Object file output by `PROGRAMS ARGS'.
+ depfile Dependency file to output.
+ tmpdepfile Temporary file to use when outputing dependencies.
+ libtool Whether libtool is used (yes/no).
+
+Report bugs to <bug-automake@gnu.org>.
+EOF
+ exit 0
+ ;;
+ -v | --v*)
+ echo "depcomp $scriptversion"
+ exit 0
+ ;;
+esac
+
+if test -z "$depmode" || test -z "$source" || test -z "$object"; then
+ echo "depcomp: Variables source, object and depmode must be set" 1>&2
+ exit 1
+fi
+# `libtool' can also be set to `yes' or `no'.
+
+if test -z "$depfile"; then
+ base=`echo "$object" | sed -e 's,^.*/,,' -e 's,\.\([^.]*\)$,.P\1,'`
+ dir=`echo "$object" | sed 's,/.*$,/,'`
+ if test "$dir" = "$object"; then
+ dir=
+ fi
+ # FIXME: should be _deps on DOS.
+ depfile="$dir.deps/$base"
+fi
+
+tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
+
+rm -f "$tmpdepfile"
+
+# Some modes work just like other modes, but use different flags. We
+# parameterize here, but still list the modes in the big case below,
+# to make depend.m4 easier to write. Note that we *cannot* use a case
+# here, because this file can only contain one case statement.
+if test "$depmode" = hp; then
+ # HP compiler uses -M and no extra arg.
+ gccflag=-M
+ depmode=gcc
+fi
+
+if test "$depmode" = dashXmstdout; then
+ # This is just like dashmstdout with a different argument.
+ dashmflag=-xM
+ depmode=dashmstdout
+fi
+
+case "$depmode" in
+gcc3)
+## gcc 3 implements dependency tracking that does exactly what
+## we want. Yay! Note: for some reason libtool 1.4 doesn't like
+## it if -MD -MP comes after the -MF stuff. Hmm.
+ "$@" -MT "$object" -MD -MP -MF "$tmpdepfile"
+ stat=$?
+ if test $stat -eq 0; then :
+ else
+ rm -f "$tmpdepfile"
+ exit $stat
+ fi
+ mv "$tmpdepfile" "$depfile"
+ ;;
+
+gcc)
+## There are various ways to get dependency output from gcc. Here's
+## why we pick this rather obscure method:
+## - Don't want to use -MD because we'd like the dependencies to end
+## up in a subdir. Having to rename by hand is ugly.
+## (We might end up doing this anyway to support other compilers.)
+## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
+## -MM, not -M (despite what the docs say).
+## - Using -M directly means running the compiler twice (even worse
+## than renaming).
+ if test -z "$gccflag"; then
+ gccflag=-MD,
+ fi
+ "$@" -Wp,"$gccflag$tmpdepfile"
+ stat=$?
+ if test $stat -eq 0; then :
+ else
+ rm -f "$tmpdepfile"
+ exit $stat
+ fi
+ rm -f "$depfile"
+ echo "$object : \\" > "$depfile"
+ alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
+## The second -e expression handles DOS-style file names with drive letters.
+ sed -e 's/^[^:]*: / /' \
+ -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
+## This next piece of magic avoids the `deleted header file' problem.
+## The problem is that when a header file which appears in a .P file
+## is deleted, the dependency causes make to die (because there is
+## typically no way to rebuild the header). We avoid this by adding
+## dummy dependencies for each header file. Too bad gcc doesn't do
+## this for us directly.
+ tr ' ' '
+' < "$tmpdepfile" |
+## Some versions of gcc put a space before the `:'. On the theory
+## that the space means something, we add a space to the output as
+## well.
+## Some versions of the HPUX 10.20 sed can't process this invocation
+## correctly. Breaking it into two sed invocations is a workaround.
+ sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
+ rm -f "$tmpdepfile"
+ ;;
+
+hp)
+ # This case exists only to let depend.m4 do its work. It works by
+ # looking at the text of this script. This case will never be run,
+ # since it is checked for above.
+ exit 1
+ ;;
+
+sgi)
+ if test "$libtool" = yes; then
+ "$@" "-Wp,-MDupdate,$tmpdepfile"
+ else
+ "$@" -MDupdate "$tmpdepfile"
+ fi
+ stat=$?
+ if test $stat -eq 0; then :
+ else
+ rm -f "$tmpdepfile"
+ exit $stat
+ fi
+ rm -f "$depfile"
+
+ if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files
+ echo "$object : \\" > "$depfile"
+
+ # Clip off the initial element (the dependent). Don't try to be
+ # clever and replace this with sed code, as IRIX sed won't handle
+ # lines with more than a fixed number of characters (4096 in
+ # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines;
+ # the IRIX cc adds comments like `#:fec' to the end of the
+ # dependency line.
+ tr ' ' '
+' < "$tmpdepfile" \
+ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \
+ tr '
+' ' ' >> $depfile
+ echo >> $depfile
+
+ # The second pass generates a dummy entry for each header file.
+ tr ' ' '
+' < "$tmpdepfile" \
+ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
+ >> $depfile
+ else
+ # The sourcefile does not contain any dependencies, so just
+ # store a dummy comment line, to avoid errors with the Makefile
+ # "include basename.Plo" scheme.
+ echo "#dummy" > "$depfile"
+ fi
+ rm -f "$tmpdepfile"
+ ;;
+
+aix)
+ # The C for AIX Compiler uses -M and outputs the dependencies
+ # in a .u file. In older versions, this file always lives in the
+ # current directory. Also, the AIX compiler puts `$object:' at the
+ # start of each line; $object doesn't have directory information.
+ # Version 6 uses the directory in both cases.
+ stripped=`echo "$object" | sed 's/\(.*\)\..*$/\1/'`
+ tmpdepfile="$stripped.u"
+ if test "$libtool" = yes; then
+ "$@" -Wc,-M
+ else
+ "$@" -M
+ fi
+ stat=$?
+
+ if test -f "$tmpdepfile"; then :
+ else
+ stripped=`echo "$stripped" | sed 's,^.*/,,'`
+ tmpdepfile="$stripped.u"
+ fi
+
+ if test $stat -eq 0; then :
+ else
+ rm -f "$tmpdepfile"
+ exit $stat
+ fi
+
+ if test -f "$tmpdepfile"; then
+ outname="$stripped.o"
+ # Each line is of the form `foo.o: dependent.h'.
+ # Do two passes, one to just change these to
+ # `$object: dependent.h' and one to simply `dependent.h:'.
+ sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile"
+ sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile"
+ else
+ # The sourcefile does not contain any dependencies, so just
+ # store a dummy comment line, to avoid errors with the Makefile
+ # "include basename.Plo" scheme.
+ echo "#dummy" > "$depfile"
+ fi
+ rm -f "$tmpdepfile"
+ ;;
+
+icc)
+ # Intel's C compiler understands `-MD -MF file'. However on
+ # icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c
+ # ICC 7.0 will fill foo.d with something like
+ # foo.o: sub/foo.c
+ # foo.o: sub/foo.h
+ # which is wrong. We want:
+ # sub/foo.o: sub/foo.c
+ # sub/foo.o: sub/foo.h
+ # sub/foo.c:
+ # sub/foo.h:
+ # ICC 7.1 will output
+ # foo.o: sub/foo.c sub/foo.h
+ # and will wrap long lines using \ :
+ # foo.o: sub/foo.c ... \
+ # sub/foo.h ... \
+ # ...
+
+ "$@" -MD -MF "$tmpdepfile"
+ stat=$?
+ if test $stat -eq 0; then :
+ else
+ rm -f "$tmpdepfile"
+ exit $stat
+ fi
+ rm -f "$depfile"
+ # Each line is of the form `foo.o: dependent.h',
+ # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'.
+ # Do two passes, one to just change these to
+ # `$object: dependent.h' and one to simply `dependent.h:'.
+ sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile"
+ # Some versions of the HPUX 10.20 sed can't process this invocation
+ # correctly. Breaking it into two sed invocations is a workaround.
+ sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" |
+ sed -e 's/$/ :/' >> "$depfile"
+ rm -f "$tmpdepfile"
+ ;;
+
+tru64)
+ # The Tru64 compiler uses -MD to generate dependencies as a side
+ # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'.
+ # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
+ # dependencies in `foo.d' instead, so we check for that too.
+ # Subdirectories are respected.
+ dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
+ test "x$dir" = "x$object" && dir=
+ base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
+
+ if test "$libtool" = yes; then
+ tmpdepfile1="$dir.libs/$base.lo.d"
+ tmpdepfile2="$dir.libs/$base.d"
+ "$@" -Wc,-MD
+ else
+ tmpdepfile1="$dir$base.o.d"
+ tmpdepfile2="$dir$base.d"
+ "$@" -MD
+ fi
+
+ stat=$?
+ if test $stat -eq 0; then :
+ else
+ rm -f "$tmpdepfile1" "$tmpdepfile2"
+ exit $stat
+ fi
+
+ if test -f "$tmpdepfile1"; then
+ tmpdepfile="$tmpdepfile1"
+ else
+ tmpdepfile="$tmpdepfile2"
+ fi
+ if test -f "$tmpdepfile"; then
+ sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
+ # That's a tab and a space in the [].
+ sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
+ else
+ echo "#dummy" > "$depfile"
+ fi
+ rm -f "$tmpdepfile"
+ ;;
+
+#nosideeffect)
+ # This comment above is used by automake to tell side-effect
+ # dependency tracking mechanisms from slower ones.
+
+dashmstdout)
+ # Important note: in order to support this mode, a compiler *must*
+ # always write the preprocessed file to stdout, regardless of -o.
+ "$@" || exit $?
+
+ # Remove the call to Libtool.
+ if test "$libtool" = yes; then
+ while test $1 != '--mode=compile'; do
+ shift
+ done
+ shift
+ fi
+
+ # Remove `-o $object'.
+ IFS=" "
+ for arg
+ do
+ case $arg in
+ -o)
+ shift
+ ;;
+ $object)
+ shift
+ ;;
+ *)
+ set fnord "$@" "$arg"
+ shift # fnord
+ shift # $arg
+ ;;
+ esac
+ done
+
+ test -z "$dashmflag" && dashmflag=-M
+ # Require at least two characters before searching for `:'
+ # in the target name. This is to cope with DOS-style filenames:
+ # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise.
+ "$@" $dashmflag |
+ sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile"
+ rm -f "$depfile"
+ cat < "$tmpdepfile" > "$depfile"
+ tr ' ' '
+' < "$tmpdepfile" | \
+## Some versions of the HPUX 10.20 sed can't process this invocation
+## correctly. Breaking it into two sed invocations is a workaround.
+ sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
+ rm -f "$tmpdepfile"
+ ;;
+
+dashXmstdout)
+ # This case only exists to satisfy depend.m4. It is never actually
+ # run, as this mode is specially recognized in the preamble.
+ exit 1
+ ;;
+
+makedepend)
+ "$@" || exit $?
+ # Remove any Libtool call
+ if test "$libtool" = yes; then
+ while test $1 != '--mode=compile'; do
+ shift
+ done
+ shift
+ fi
+ # X makedepend
+ shift
+ cleared=no
+ for arg in "$@"; do
+ case $cleared in
+ no)
+ set ""; shift
+ cleared=yes ;;
+ esac
+ case "$arg" in
+ -D*|-I*)
+ set fnord "$@" "$arg"; shift ;;
+ # Strip any option that makedepend may not understand. Remove
+ # the object too, otherwise makedepend will parse it as a source file.
+ -*|$object)
+ ;;
+ *)
+ set fnord "$@" "$arg"; shift ;;
+ esac
+ done
+ obj_suffix="`echo $object | sed 's/^.*\././'`"
+ touch "$tmpdepfile"
+ ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
+ rm -f "$depfile"
+ cat < "$tmpdepfile" > "$depfile"
+ sed '1,2d' "$tmpdepfile" | tr ' ' '
+' | \
+## Some versions of the HPUX 10.20 sed can't process this invocation
+## correctly. Breaking it into two sed invocations is a workaround.
+ sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
+ rm -f "$tmpdepfile" "$tmpdepfile".bak
+ ;;
+
+cpp)
+ # Important note: in order to support this mode, a compiler *must*
+ # always write the preprocessed file to stdout.
+ "$@" || exit $?
+
+ # Remove the call to Libtool.
+ if test "$libtool" = yes; then
+ while test $1 != '--mode=compile'; do
+ shift
+ done
+ shift
+ fi
+
+ # Remove `-o $object'.
+ IFS=" "
+ for arg
+ do
+ case $arg in
+ -o)
+ shift
+ ;;
+ $object)
+ shift
+ ;;
+ *)
+ set fnord "$@" "$arg"
+ shift # fnord
+ shift # $arg
+ ;;
+ esac
+ done
+
+ "$@" -E |
+ sed -n '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' |
+ sed '$ s: \\$::' > "$tmpdepfile"
+ rm -f "$depfile"
+ echo "$object : \\" > "$depfile"
+ cat < "$tmpdepfile" >> "$depfile"
+ sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile"
+ rm -f "$tmpdepfile"
+ ;;
+
+msvisualcpp)
+ # Important note: in order to support this mode, a compiler *must*
+ # always write the preprocessed file to stdout, regardless of -o,
+ # because we must use -o when running libtool.
+ "$@" || exit $?
+ IFS=" "
+ for arg
+ do
+ case "$arg" in
+ "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
+ set fnord "$@"
+ shift
+ shift
+ ;;
+ *)
+ set fnord "$@" "$arg"
+ shift
+ shift
+ ;;
+ esac
+ done
+ "$@" -E |
+ sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile"
+ rm -f "$depfile"
+ echo "$object : \\" > "$depfile"
+ . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile"
+ echo " " >> "$depfile"
+ . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile"
+ rm -f "$tmpdepfile"
+ ;;
+
+none)
+ exec "$@"
+ ;;
+
+*)
+ echo "Unknown depmode $depmode" 1>&2
+ exit 1
+ ;;
+esac
+
+exit 0
+
+# Local Variables:
+# mode: shell-script
+# sh-indentation: 2
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-end: "$"
+# End:
diff --git a/etc/Makefile.am b/etc/Makefile.am
new file mode 100644
index 0000000..e44e781
--- /dev/null
+++ b/etc/Makefile.am
@@ -0,0 +1,77 @@
+## Process this file with automake to produce Makefile.in
+## A Makefile.in is supplied, in case you do not have automake.
+
+## $Id: Makefile.am,v 1.10 2004/01/11 03:43:50 heas Exp $
+##
+## Copyright (C) 1997-2004 by Terrapin Communications, Inc.
+## All rights reserved.
+##
+## This software may be freely copied, modified and redistributed
+## without fee for non-commerical purposes provided that this license
+## remains intact and unmodified with any RANCID distribution.
+##
+## There is no warranty or other guarantee of fitness of this software.
+## It is provided solely "as is". The author(s) disclaim(s) all
+## responsibility and liability with respect to this software's usage
+## or its effect upon hardware, computer systems, other software, or
+## anything else.
+##
+## Except where noted otherwise, rancid was written by and is maintained by
+## Henry Kilmer, John Heasley, Andrew Partan, Pete Whiting, and Austin Schutz.
+##
+
+#AUTOMAKE_OPTIONS=foreign no-dependencies
+AUTOMAKE_OPTIONS=foreign
+
+pkgdata_DATA= lg.conf.sample rancid.conf.sample
+EXTRA_DIST= $(pkgdata_DATA:%=%.in)
+
+CLEANFILES= $(pkgdata_DATA)
+
+install-data-local: all
+ @if test -f $(sysconfdir)/rancid.conf ; then \
+ echo ""; \
+ echo "WARNING: *** $(sysconfdir)/rancid.conf exists. See "; \
+ echo " *** $(pkgdatadir)/rancid.conf.sample for new"; \
+ echo " *** examples."; \
+ echo ""; \
+ else \
+ $(INSTALL_DATA) rancid.conf.sample $(sysconfdir)/rancid.conf; \
+ fi; \
+ if test -f $(sysconfdir)/lg.conf ; then \
+ echo ""; \
+ echo "WARNING: *** $(sysconfdir)/lg.conf exists. See "; \
+ echo " *** $(pkgdatadir)/lg.conf.sample for new"; \
+ echo " *** examples."; \
+ echo ""; \
+ else \
+ $(INSTALL_DATA) lg.conf.sample $(sysconfdir)/lg.conf; \
+ fi;
+
+#clean:
+# rm -f Makefile rancid.conf $(BIN_DATAS) $(BIN_PROGS)
+
+# auto_edit does the autoconf variable substitution. This allows the
+# substitution to have the full expansion of the variables, e.g.: $sysconfdir
+# will be /prefix/etc instead of ${prefix}/etc.
+#
+# This is a bit of a PITA, but is the method recommended by the autoconf
+# documentation.
+auto_edit = sed \
+ -e 's,@bindir\@,$(bindir),g' \
+ -e 's,@prefix\@,$(prefix),g' \
+ -e 's,@localstatedir\@,$(localstatedir),g' \
+ -e 's,@sysconfdir\@,$(sysconfdir),g' \
+ -e 's,@EXPECT_PATH\@,$(EXPECT_PATH),g' \
+ -e 's,@PERLV_PATH\@,$(PERLV_PATH),g' \
+ -e 's,@ENV_PATH\@,$(ENV_PATH),g'
+
+lg.conf.sample: Makefile $(srcdir)/lg.conf.sample.in
+ rm -f lg.conf.sample lg.conf.sample.tmp; \
+ $(auto_edit) $(srcdir)/lg.conf.sample.in >lg.conf.sample.tmp; \
+ mv lg.conf.sample.tmp lg.conf.sample
+
+rancid.conf.sample: Makefile $(srcdir)/rancid.conf.sample.in
+ rm -f rancid.conf.sample rancid.conf.sample.tmp; \
+ $(auto_edit) $(srcdir)/rancid.conf.sample.in >rancid.conf.sample.tmp; \
+ mv rancid.conf.sample.tmp rancid.conf.sample
diff --git a/etc/Makefile.in b/etc/Makefile.in
new file mode 100644
index 0000000..7a52e35
--- /dev/null
+++ b/etc/Makefile.in
@@ -0,0 +1,375 @@
+# Makefile.in generated by automake 1.8 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
+# Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+subdir = etc
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
+ $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
+CONFIG_HEADER = $(top_builddir)/include/config.h
+CONFIG_CLEAN_FILES =
+SOURCES =
+DIST_SOURCES =
+am__installdirs = $(DESTDIR)$(pkgdatadir)
+pkgdataDATA_INSTALL = $(INSTALL_DATA)
+DATA = $(pkgdata_DATA)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+ADMINMAILPLUS = @ADMINMAILPLUS@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+COMM = @COMM@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CVS = @CVS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DIFF = @DIFF@
+DIFF_CMD = @DIFF_CMD@
+DIRNAME = @DIRNAME@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+ENV_PATH = @ENV_PATH@
+EXEEXT = @EXEEXT@
+EXPECT_PATH = @EXPECT_PATH@
+FIND = @FIND@
+GREP = @GREP@
+ID = @ID@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LG_PING_CMD = @LG_PING_CMD@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LTLIBOBJS = @LTLIBOBJS@
+MAILPLUS = @MAILPLUS@
+MAKE = @MAKE@
+MAKEINFO = @MAKEINFO@
+MKDIR = @MKDIR@
+OBJEXT = @OBJEXT@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PERLV = @PERLV@
+PERLV_PATH = @PERLV_PATH@
+PING_PATH = @PING_PATH@
+RSH = @RSH@
+SENDMAIL = @SENDMAIL@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SORT = @SORT@
+SSH = @SSH@
+STRIP = @STRIP@
+TAR = @TAR@
+TELNET = @TELNET@
+TOUCH = @TOUCH@
+U = @U@
+VERSION = @VERSION@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_STRIP = @ac_ct_STRIP@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+bindir = @bindir@
+build_alias = @build_alias@
+datadir = @datadir@
+exec_prefix = @exec_prefix@
+host_alias = @host_alias@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+
+#AUTOMAKE_OPTIONS=foreign no-dependencies
+AUTOMAKE_OPTIONS = foreign
+pkgdata_DATA = lg.conf.sample rancid.conf.sample
+EXTRA_DIST = $(pkgdata_DATA:%=%.in)
+CLEANFILES = $(pkgdata_DATA)
+
+#clean:
+# rm -f Makefile rancid.conf $(BIN_DATAS) $(BIN_PROGS)
+
+# auto_edit does the autoconf variable substitution. This allows the
+# substitution to have the full expansion of the variables, e.g.: $sysconfdir
+# will be /prefix/etc instead of ${prefix}/etc.
+#
+# This is a bit of a PITA, but is the method recommended by the autoconf
+# documentation.
+auto_edit = sed \
+ -e 's,@bindir\@,$(bindir),g' \
+ -e 's,@prefix\@,$(prefix),g' \
+ -e 's,@localstatedir\@,$(localstatedir),g' \
+ -e 's,@sysconfdir\@,$(sysconfdir),g' \
+ -e 's,@EXPECT_PATH\@,$(EXPECT_PATH),g' \
+ -e 's,@PERLV_PATH\@,$(PERLV_PATH),g' \
+ -e 's,@ENV_PATH\@,$(ENV_PATH),g'
+
+all: all-am
+
+.SUFFIXES:
+$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+ && exit 0; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign etc/Makefile'; \
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --foreign etc/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+uninstall-info-am:
+install-pkgdataDATA: $(pkgdata_DATA)
+ @$(NORMAL_INSTALL)
+ $(mkdir_p) $(DESTDIR)$(pkgdatadir)
+ @list='$(pkgdata_DATA)'; for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ f="`echo $$p | sed -e 's|^.*/||'`"; \
+ echo " $(pkgdataDATA_INSTALL) $$d$$p $(DESTDIR)$(pkgdatadir)/$$f"; \
+ $(pkgdataDATA_INSTALL) $$d$$p $(DESTDIR)$(pkgdatadir)/$$f; \
+ done
+
+uninstall-pkgdataDATA:
+ @$(NORMAL_UNINSTALL)
+ @list='$(pkgdata_DATA)'; for p in $$list; do \
+ f="`echo $$p | sed -e 's|^.*/||'`"; \
+ echo " rm -f $(DESTDIR)$(pkgdatadir)/$$f"; \
+ rm -f $(DESTDIR)$(pkgdatadir)/$$f; \
+ done
+tags: TAGS
+TAGS:
+
+ctags: CTAGS
+CTAGS:
+
+
+distdir: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+ list='$(DISTFILES)'; for file in $$list; do \
+ case $$file in \
+ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+ esac; \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+ dir="/$$dir"; \
+ $(mkdir_p) "$(distdir)$$dir"; \
+ else \
+ dir=''; \
+ fi; \
+ if test -d $$d/$$file; then \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+ fi; \
+ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+ else \
+ test -f $(distdir)/$$file \
+ || cp -p $$d/$$file $(distdir)/$$file \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: check-am
+all-am: Makefile $(DATA)
+installdirs:
+ $(mkdir_p) $(DESTDIR)$(pkgdatadir)
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+ -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
+
+distclean-generic:
+ -rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic mostlyclean-am
+
+distclean: distclean-am
+ -rm -f Makefile
+distclean-am: clean-am distclean-generic
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am: install-data-local install-pkgdataDATA
+
+install-exec-am:
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-info-am uninstall-pkgdataDATA
+
+.PHONY: all all-am check check-am clean clean-generic distclean \
+ distclean-generic distdir dvi dvi-am html html-am info info-am \
+ install install-am install-data install-data-am \
+ install-data-local install-exec install-exec-am install-info \
+ install-info-am install-man install-pkgdataDATA install-strip \
+ installcheck installcheck-am installdirs maintainer-clean \
+ maintainer-clean-generic mostlyclean mostlyclean-generic pdf \
+ pdf-am ps ps-am uninstall uninstall-am uninstall-info-am \
+ uninstall-pkgdataDATA
+
+
+install-data-local: all
+ @if test -f $(sysconfdir)/rancid.conf ; then \
+ echo ""; \
+ echo "WARNING: *** $(sysconfdir)/rancid.conf exists. See "; \
+ echo " *** $(pkgdatadir)/rancid.conf.sample for new"; \
+ echo " *** examples."; \
+ echo ""; \
+ else \
+ $(INSTALL_DATA) rancid.conf.sample $(sysconfdir)/rancid.conf; \
+ fi; \
+ if test -f $(sysconfdir)/lg.conf ; then \
+ echo ""; \
+ echo "WARNING: *** $(sysconfdir)/lg.conf exists. See "; \
+ echo " *** $(pkgdatadir)/lg.conf.sample for new"; \
+ echo " *** examples."; \
+ echo ""; \
+ else \
+ $(INSTALL_DATA) lg.conf.sample $(sysconfdir)/lg.conf; \
+ fi;
+
+lg.conf.sample: Makefile $(srcdir)/lg.conf.sample.in
+ rm -f lg.conf.sample lg.conf.sample.tmp; \
+ $(auto_edit) $(srcdir)/lg.conf.sample.in >lg.conf.sample.tmp; \
+ mv lg.conf.sample.tmp lg.conf.sample
+
+rancid.conf.sample: Makefile $(srcdir)/rancid.conf.sample.in
+ rm -f rancid.conf.sample rancid.conf.sample.tmp; \
+ $(auto_edit) $(srcdir)/rancid.conf.sample.in >rancid.conf.sample.tmp; \
+ mv rancid.conf.sample.tmp rancid.conf.sample
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/etc/lg.conf.sample.in b/etc/lg.conf.sample.in
new file mode 100644
index 0000000..54e538a
--- /dev/null
+++ b/etc/lg.conf.sample.in
@@ -0,0 +1,188 @@
+# configuration file for the looking glass
+#
+# note: these are perl statements! Mind the syntax. "perl -c lg.conf"
+# should succeed.
+#
+# adjust the path to find [cfj]login, telnet, ssh, rsh, etc.
+#
+$ENV{PATH}="@prefix@/bin:@ENV_PATH@";
+#
+#
+# LG_CACHE_DIR is the location of the cache directory. the LG uses this
+# to hold lock files, the default log file (lg.log), and o/p from
+# commands that can be very verbose. it defaults to "tmp",
+# i.e.: relative to the directory where lg.cgi runs in your
+# server's (httpd) DocumentRoot (e.g.:
+# /usr/local/www/data/lg/tmp).
+#
+#$LG_CACHE_DIR="./tmp";
+#
+#
+# LG_CACHE_TIME is the number of seconds the LG should cache o/p from certain
+# commands; those that tend to produce a lot of o/p, such as
+# 'show ip bgp dampened-paths'. it defaults to 600 seconds
+# (10 minutes).
+#
+#$LG_CACHE_TIME=600;
+#
+#
+# LG_CLOGINRC is the .cloginrc that the LG should use. it defaults to
+# <prefix>/.cloginrc. note that the .cloginrc must be readable
+# by the user or group (UID / GID) that will be running the CGI
+# and the clogin (and friends) will not allow a world readable
+# .cloginrc. this is normally the user the server (httpd) runs
+# under.
+#
+#$LG_CLOGINRC="$ENV(HOME)/.cloginrc";
+#
+#
+# LG_IMAGE is the filename of an image you wish to appear at the top
+# of the LG pages. it can also be other html goo, like
+# the first example. this is just handed to print, so \n and
+# the like will work and mind the character escapes (backslashes).
+#
+#$LG_IMAGE="<img src=/icons/rancid.gif hspace=0>\n <font size=+2>FOO</font>";
+#$LG_IMAGE="<img src=rancid.gif hspace=0>\n";
+#
+#
+# LG_INFO is info in html format to output at the bottom of main form.
+# it might be local contact information, disclaimer, etc. this
+# is just handed to print, so \n and the like will work and mind
+# the character escapes (backslashes).
+#
+#$LG_INFO="For support, contact <a href=\"mailto:webmaster\@localhost\">webmaster</a>";
+#
+#
+# LG_LOG is either a FQPN (fully qualified path name) or the syslog
+# facility to use for logging. if not defined, the LG
+# will log to LG_CACHE_DIR/lg.log. possible syslog facility
+# values are from the facility codes in /usr/include/syslog.h
+# minus the 'LOG_' and lower case.
+#
+#$LG_LOG="$LG_CACHE_DIR/lg.log";
+#$LG_LOG="/tmp/lg.log";
+#$LG_LOG="local0";
+#
+#
+# LG_ROUTERDB is the router.db in rancid's router.db format, listing
+# the routers and their platform that should be available to
+# the looking glass. if defined, the LG will use this variable
+# to find the router.db. if not defined, it will look for it
+# at <prefix>/<sysconfdir>/router.db. if it does not exist, it
+# will build the list from <prefix>/*/router.db (i.e.: the
+# router.db's from all your groups). note that if you choose
+# this last option; the group directories and router.db files'
+# modes may have to be changed, depending upon the UID/GID of
+# the user your server (httpd) runs under, since rancid's default
+# mask is 007 (see etc/rancid.conf). routers not marked 'up' are
+# skipped.
+#
+#$LG_ROUTERDB="@sysconfdir@/router.db";
+#
+#
+# LG_STYLE define a style sheet to be used for formatting HTML.
+#
+#$LG_STYLE="http://www.your.site/style/style.css";
+#
+#
+# Options:
+#
+# LG_AS_REG *** not implemented.
+#
+#@LG_AS_REG=();
+#
+#
+# LG_BGP_RT allows a few bgp commands which can produce long output (heavy
+# router load), such as sh ip bgp neighbor <ip> advertised-routes
+# would for a transit customer or sh ip b neigh <ip>
+# received-routes would for a transit provider.
+#
+#$LG_BGP_RT=1;
+#
+#
+# LG_SINGLE serializes and limits queries per-router to one at a time via
+# per-router lock files.
+#
+#$LG_SINGLE=0;
+#
+# LG_STRIP strips login o/p from the looking glass results. Expect
+# occassionally screws up disabling echo when passwords are
+# entered (NOTE: SECURITY CONCERN). However, this o/p can be
+# very useful for debugging clogin/flogin/jlogin problems.
+#
+$LG_STRIP=1;
+#
+#
+# Commands/Queries:
+# Un-comment/Comment the commands that are desired/not desired.
+# The Commands are separated into a few categories. The value
+# of each variable is the string which will appear in the
+# (lgform.cgi) menu. Mind the ,'s within hash assignments.
+#
+# The double-commented (##) queries are not implemented or have
+# not been tested.
+#
+$queries = {};
+#
+# Interface queries
+$queries->{"interface"} = {
+ framerelay => "show frame-relay PVC [DLCI]",
+ interface => "show interface [interface]"
+};
+#
+# Routing queries
+$queries->{"routing"} = {
+ damp => "show ip bgp dampened-paths",
+ neighbor => "show ip bgp neighbor <IP_addr>",
+ prefix => "show ip bgp <prefix> [netmask]",
+ prefixlist => "show ip prefix-list <list_name>",
+ regex => "show ip bgp regex <regex>",
+ route => "show ip route <prefix> [netmask]",
+ routemap => "show route-map <policy_name/number>",
+ summary => "show ip bgp summary"
+};
+#
+# Debug queries
+$queries->{"debug"} = {
+ log => "Show Logs [ | <match_string>]",
+ ping => "ping <IP_addr | FQDN>",
+ trace => "traceroute <IP_addr | FQDN>"
+};
+#
+# Multicast queries
+$queries->{"multicast"} = {
+ mbgp => "Show ip mbgp <prefix> [netmask]",
+ mbgpsum => "Show ip mbgp summary",
+ # show ip pim interface/show pim interface
+ ## pim_interface => "Show PIM Interfaces",
+ # ???/show pim join (extensive)
+ ## pim_join => "Show PIM Join [group_address]",
+ # show ip mroute/show multicast route [active]
+ ## mroute => "Show Multicast Forwarding Table [active]",
+ # show ip msdp summary/show msdp
+ ## msdp => "Show MSDP Peering Status",
+ # show ip msdp sa cache/show msdp source-active
+ ## msdpsa => "Show MSDP Source Active Table",
+ # show ip sdr|show multicast sessions
+ ## msess => "Show Multicast SDR sessions [detail]",
+ # show ip pim neighbor/show pim neighbors
+ ## pim_neighbor => "Show PIM Neighbors [detail]",
+ # show ip pim rp mapping/show pim rps
+ ## pim_rp => "Show PIM Rendez-vous Points [detail]",
+ # show ip rpf [address] /show multicast rpf [address]
+ ## rpf => "Test Multicast RPF <address>"
+};
+#
+# IPv6 commands
+$queries->{"ipv6"} = {
+ # show bgp ipv6 / ???
+ ## v6_bgp => "Show IPv6 BGP table";
+ # show ipv6 interface / show interface
+ ## v6_interface => "Show IPv6 interface parameters [interface]";
+ # show bgp ipv6 summary / show bgp summary
+ ## v6_summary => "Show IPv6 BGP Summary";
+ # show ipv6 route / show route table inet6.0
+ ## v6_route => "Show IPv6 Routes <prefix>";
+};
+#
+# %EOF%
diff --git a/etc/rancid.conf.sample.in b/etc/rancid.conf.sample.in
new file mode 100644
index 0000000..c550c74
--- /dev/null
+++ b/etc/rancid.conf.sample.in
@@ -0,0 +1,59 @@
+#
+# This file sets up the environment used for rancid. see rancid.conf(5)
+#
+# This will be site specific
+#
+TERM=network;export TERM
+#
+# Under BASEDIR (i.e.: --localstatedir), there will be a "logs" directory for
+# the logs from rancid and a directory for each group of routers defined in
+# LIST_OF_GROUPS (below). In addition to these, there will be a "CVS"
+# directory which is the cvs repository.
+#
+# Use a full path (no sym-links) for BASEDIR. Some versions of CVS seem to
+# dislike sym-links.
+#
+TMPDIR=/tmp; export TMPDIR
+# Be careful changing this, it affects CVSROOT below.
+BASEDIR=@localstatedir@; export BASEDIR
+PATH=@bindir@:@ENV_PATH@; export PATH
+# Location of the CVS repository. Be careful changing this.
+CVSROOT=$BASEDIR/CVS; export CVSROOT
+# Location of log files produced by rancid-run(1).
+LOGDIR=$BASEDIR/logs; export LOGDIR
+#
+# if NOPIPE is set, temp files will be used instead of a cmd pipe during
+# collection from the router(s).
+#NOPIPE=YES; export NOPIPE
+#
+# FILTER_PWDS determines which passwords are filtered from configs by the
+# value set (NO | YES | ALL). see rancid.conf(5).
+#FILTER_PWDS=YES; export FILTER_PWDS
+#
+# if NOCOMMSTR is set, snmp community strings will be stripped from the configs
+#NOCOMMSTR=YES; export NOCOMMSTR
+#
+# How many hours should pass before complaining about routers that
+# can not be reached. The value should be greater than the number
+# of hours between your rancid-run cron job.
+OLDTIME=4; export OLDTIME
+#
+# How many hours should pass before complaining that a group's collection
+# (the age of it's lock file) is hung.
+#LOCKTIME=4; export LOCKTIME
+#
+# The number of devices to collect simultaneously.
+#PAR_COUNT=5; export PAR_COUNT
+#
+# list of rancid groups
+#LIST_OF_GROUPS="sl joebobisp"
+# more groups...
+#LIST_OF_GROUPS="$LIST_OF_GROUPS noc billybobisp"
+#
+# For each group, define a list of people to receive the diffs.
+# in sendmail's /etc/aliases.
+# rancid-group: joe,moe@foo
+# rancid-group-admin: hostmaster
+# be sure to read ../README regarding aliases.
+#
+umask 027
diff --git a/include/Makefile.am b/include/Makefile.am
index 23fb6fe..19772b2 100644
--- a/include/Makefile.am
+++ b/include/Makefile.am
@@ -1,12 +1,34 @@
## Process this file with automake to produce Makefile.in
## A Makefile.in is supplied, in case you do not have automake.
+## $Id: Makefile.am,v 1.5 2004/01/11 03:45:18 heas Exp $
+##
+## Copyright (C) 1997-2004 by Terrapin Communications, Inc.
+## All rights reserved.
+##
+## This software may be freely copied, modified and redistributed
+## without fee for non-commerical purposes provided that this license
+## remains intact and unmodified with any RANCID distribution.
+##
+## There is no warranty or other guarantee of fitness of this software.
+## It is provided solely "as is". The author(s) disclaim(s) all
+## responsibility and liability with respect to this software's usage
+## or its effect upon hardware, computer systems, other software, or
+## anything else.
+##
+## Except where noted otherwise, rancid was written by and is maintained by
+## Henry Kilmer, John Heasley, Andrew Partan, Pete Whiting, and Austin Schutz.
+##
+
#AUTOMAKE_OPTIONS=foreign no-dependencies
AUTOMAKE_OPTIONS=foreign
+@SET_MAKE@
+
noinst_HEADERS= config.h version.h
-@SET_MAKE@
+# no idea why automake doesnt clean these targets
+CLEANFILES= stamp-h stamp-h1
all:
diff --git a/include/Makefile.in b/include/Makefile.in
index deda786..1424aef 100644
--- a/include/Makefile.in
+++ b/include/Makefile.in
@@ -1,6 +1,8 @@
-# Makefile.in generated automatically by automake 1.4-p5 from Makefile.am
+# Makefile.in generated by automake 1.8 from Makefile.am.
+# @configure_input@
-# Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc.
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
+# Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@@ -10,255 +12,364 @@
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
-#AUTOMAKE_OPTIONS=foreign no-dependencies
-
-
-SHELL = @SHELL@
+@SET_MAKE@
srcdir = @srcdir@
top_srcdir = @top_srcdir@
VPATH = @srcdir@
-prefix = @prefix@
-exec_prefix = @exec_prefix@
-
-bindir = @bindir@
-sbindir = @sbindir@
-libexecdir = @libexecdir@
-datadir = @datadir@
-sysconfdir = @sysconfdir@
-sharedstatedir = @sharedstatedir@
-localstatedir = @localstatedir@
-libdir = @libdir@
-infodir = @infodir@
-mandir = @mandir@
-includedir = @includedir@
-oldincludedir = /usr/include
-
-DESTDIR =
-
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
-
top_builddir = ..
-
-ACLOCAL = @ACLOCAL@
-AUTOCONF = @AUTOCONF@
-AUTOMAKE = @AUTOMAKE@
-AUTOHEADER = @AUTOHEADER@
-
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
INSTALL = @INSTALL@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS)
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-transform = @program_transform_name@
-
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
+subdir = include
+DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \
+ $(srcdir)/Makefile.in $(srcdir)/config.h.in \
+ $(srcdir)/version.h.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
+ $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
+CONFIG_HEADER = config.h
+CONFIG_CLEAN_FILES = version.h
+SOURCES =
+DIST_SOURCES =
+HEADERS = $(noinst_HEADERS)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+ADMINMAILPLUS = @ADMINMAILPLUS@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
COMM = @COMM@
CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
CVS = @CVS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
DIFF = @DIFF@
DIFF_CMD = @DIFF_CMD@
DIRNAME = @DIRNAME@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
ENV_PATH = @ENV_PATH@
+EXEEXT = @EXEEXT@
EXPECT_PATH = @EXPECT_PATH@
FIND = @FIND@
GREP = @GREP@
ID = @ID@
-INST_PROGS = @INST_PROGS@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
LG_PING_CMD = @LG_PING_CMD@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LTLIBOBJS = @LTLIBOBJS@
MAILPLUS = @MAILPLUS@
-MAINT = @MAINT@
MAKE = @MAKE@
MAKEINFO = @MAKEINFO@
MKDIR = @MKDIR@
+OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
PERLV = @PERLV@
PERLV_PATH = @PERLV_PATH@
PING_PATH = @PING_PATH@
-RD_BIN_DATAS = @RD_BIN_DATAS@
-RD_BIN_PROGS = @RD_BIN_PROGS@
-RD_UTIL_LG_PROGS = @RD_UTIL_LG_PROGS@
-RD_UTIL_PROGS = @RD_UTIL_PROGS@
RSH = @RSH@
SENDMAIL = @SENDMAIL@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
SORT = @SORT@
SSH = @SSH@
+STRIP = @STRIP@
TAR = @TAR@
TELNET = @TELNET@
TOUCH = @TOUCH@
U = @U@
VERSION = @VERSION@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_STRIP = @ac_ct_STRIP@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+bindir = @bindir@
+build_alias = @build_alias@
+datadir = @datadir@
+exec_prefix = @exec_prefix@
+host_alias = @host_alias@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+#AUTOMAKE_OPTIONS=foreign no-dependencies
AUTOMAKE_OPTIONS = foreign
-
noinst_HEADERS = config.h version.h
-mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
-CONFIG_HEADER = config.h
-CONFIG_CLEAN_FILES = version.h
-HEADERS = $(noinst_HEADERS)
-
-DIST_COMMON = ./stamp-h.in Makefile.am Makefile.in config.h.in \
-version.h.in
+# no idea why automake doesnt clean these targets
+CLEANFILES = stamp-h stamp-h1
+all: config.h
+ $(MAKE) $(AM_MAKEFLAGS) all-am
-DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
-
-GZIP_ENV = --best
-all: all-redirect
.SUFFIXES:
-$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
- cd $(top_srcdir) && $(AUTOMAKE) --foreign --include-deps include/Makefile
-
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
- cd $(top_builddir) \
- && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
-
-
-config.h: stamp-h
+$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+ && exit 0; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign include/Makefile'; \
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --foreign include/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+config.h: stamp-h1
@if test ! -f $@; then \
- rm -f stamp-h; \
- $(MAKE) stamp-h; \
+ rm -f stamp-h1; \
+ $(MAKE) stamp-h1; \
else :; fi
-stamp-h: $(srcdir)/config.h.in $(top_builddir)/config.status
- cd $(top_builddir) \
- && CONFIG_FILES= CONFIG_HEADERS=include/config.h \
- $(SHELL) ./config.status
- @echo timestamp > stamp-h 2> /dev/null
-$(srcdir)/config.h.in: @MAINTAINER_MODE_TRUE@$(srcdir)/stamp-h.in
- @if test ! -f $@; then \
- rm -f $(srcdir)/stamp-h.in; \
- $(MAKE) $(srcdir)/stamp-h.in; \
- else :; fi
-$(srcdir)/stamp-h.in: $(top_srcdir)/configure.in $(ACLOCAL_M4)
- cd $(top_srcdir) && $(AUTOHEADER)
- @echo timestamp > $(srcdir)/stamp-h.in 2> /dev/null
-
-mostlyclean-hdr:
-clean-hdr:
+stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status
+ @rm -f stamp-h1
+ cd $(top_builddir) && $(SHELL) ./config.status include/config.h
+$(srcdir)/config.h.in: $(am__configure_deps) $(top_srcdir)/acconfig.h
+ cd $(top_srcdir) && $(AUTOHEADER)
+ rm -f stamp-h1
+ touch $@
distclean-hdr:
- -rm -f config.h
-
-maintainer-clean-hdr:
-version.h: $(top_builddir)/config.status version.h.in
- cd $(top_builddir) && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
-
+ -rm -f config.h stamp-h1
+version.h: $(top_builddir)/config.status $(srcdir)/version.h.in
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
+uninstall-info-am:
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ mkid -fID $$unique
tags: TAGS
-TAGS: $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) $(LISP)
+TAGS: $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
- list='$(SOURCES) $(HEADERS)'; \
- unique=`for i in $$list; do echo $$i; done | \
- awk ' { files[$$0] = 1; } \
+ list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
- test -z "$(ETAGS_ARGS)config.h.in$$unique$(LISP)$$tags" \
- || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags config.h.in $$unique $(LISP) -o $$here/TAGS)
-
-mostlyclean-tags:
+ test -z "$(ETAGS_ARGS)$$tags$$unique" \
+ || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$tags $$unique
+ctags: CTAGS
+CTAGS: $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ test -z "$(CTAGS_ARGS)$$tags$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$tags $$unique
-clean-tags:
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && cd $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) $$here
distclean-tags:
- -rm -f TAGS ID
-
-maintainer-clean-tags:
-
-distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
-
-subdir = include
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
distdir: $(DISTFILES)
- @for file in $(DISTFILES); do \
- d=$(srcdir); \
+ @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+ list='$(DISTFILES)'; for file in $$list; do \
+ case $$file in \
+ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+ esac; \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+ dir="/$$dir"; \
+ $(mkdir_p) "$(distdir)$$dir"; \
+ else \
+ dir=''; \
+ fi; \
if test -d $$d/$$file; then \
- cp -pr $$d/$$file $(distdir)/$$file; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+ fi; \
+ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
else \
test -f $(distdir)/$$file \
- || ln $$d/$$file $(distdir)/$$file 2> /dev/null \
- || cp -p $$d/$$file $(distdir)/$$file || :; \
+ || cp -p $$d/$$file $(distdir)/$$file \
+ || exit 1; \
fi; \
done
-info-am:
-info: info-am
-dvi-am:
-dvi: dvi-am
check-am: all-am
check: check-am
-installcheck-am:
-installcheck: installcheck-am
-all-recursive-am: config.h
- $(MAKE) $(AM_MAKEFLAGS) all-recursive
-
-install-exec-am:
+all-am: Makefile $(HEADERS) config.h
+installdirs:
+install: install-am
install-exec: install-exec-am
-
-install-data-am:
install-data: install-data-am
+uninstall: uninstall-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-install: install-am
-uninstall-am:
-uninstall: uninstall-am
-all-am: Makefile $(HEADERS) config.h
-all-redirect: all-am
-install-strip:
- $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install
-installdirs:
-
+installcheck: installcheck-am
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
mostlyclean-generic:
clean-generic:
+ -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
distclean-generic:
- -rm -f Makefile $(CONFIG_CLEAN_FILES)
- -rm -f config.cache config.log stamp-h stamp-h[0-9]*
+ -rm -f $(CONFIG_CLEAN_FILES)
maintainer-clean-generic:
-mostlyclean-am: mostlyclean-hdr mostlyclean-tags mostlyclean-generic
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
-mostlyclean: mostlyclean-am
+clean-am: clean-generic mostlyclean-am
-clean-am: clean-hdr clean-tags clean-generic mostlyclean-am
+distclean: distclean-am
+ -rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-hdr distclean-tags
-clean: clean-am
+dvi: dvi-am
-distclean-am: distclean-hdr distclean-tags distclean-generic clean-am
+dvi-am:
-distclean: distclean-am
+html: html-am
-maintainer-clean-am: maintainer-clean-hdr maintainer-clean-tags \
- maintainer-clean-generic distclean-am
- @echo "This command is intended for maintainers to use;"
- @echo "it deletes files that may require special tools to rebuild."
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-exec-am:
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
maintainer-clean: maintainer-clean-am
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic
+
+pdf: pdf-am
+
+pdf-am:
-.PHONY: mostlyclean-hdr distclean-hdr clean-hdr maintainer-clean-hdr \
-tags mostlyclean-tags distclean-tags clean-tags maintainer-clean-tags \
-distdir info-am info dvi-am dvi check check-am installcheck-am \
-installcheck all-recursive-am install-exec-am install-exec \
-install-data-am install-data install-am install uninstall-am uninstall \
-all-redirect all-am all installdirs mostlyclean-generic \
-distclean-generic clean-generic maintainer-clean-generic clean \
-mostlyclean distclean maintainer-clean
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-info-am
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+ ctags distclean distclean-generic distclean-hdr distclean-tags \
+ distdir dvi dvi-am html html-am info info-am install \
+ install-am install-data install-data-am install-exec \
+ install-exec-am install-info install-info-am install-man \
+ install-strip installcheck installcheck-am installdirs \
+ maintainer-clean maintainer-clean-generic mostlyclean \
+ mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \
+ uninstall-am uninstall-info-am
@SET_MAKE@
all:
-
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
diff --git a/include/config.h b/include/config.h
index 0e9e4d3..5648d5d 100644
--- a/include/config.h
+++ b/include/config.h
@@ -1,108 +1,135 @@
-/* include/config.h. Generated automatically by configure. */
-/* include/config.h.in. Generated automatically from configure.in by autoheader. */
+/* include/config.h. Generated by configure. */
+/* include/config.h.in. Generated from configure.in by autoheader. */
#ifndef CONFIG_H
#define CONFIG_H 1
-/* Define to empty if the keyword does not work. */
-/* #undef const */
-
-/* Define if you have the ANSI # stringizing operator in cpp. */
-#define HAVE_STRINGIZE 1
-/* Define as __inline if that's what the C compiler calls it. */
-/* #undef inline */
+/* Define to 1 if you have the `bcopy' function. */
+#define HAVE_BCOPY 1
-/* Define as the return type of signal handlers (int or void). */
-#define RETSIGTYPE void
+/* Define to 1 if you have the `bzero' function. */
+#define HAVE_BZERO 1
-/* Define to `unsigned' if <sys/types.h> doesn't define. */
-/* #undef size_t */
+/* Define to 1 if you have the <errno.h> header file. */
+#define HAVE_ERRNO_H 1
-/* Define if you have the ANSI C header files. */
-#define STDC_HEADERS 1
+/* Define to 1 if you have the <fcntl.h> header file. */
+#define HAVE_FCNTL_H 1
-/* Define if you have the bcopy function. */
-#define HAVE_BCOPY 1
+/* Define to 1 if you have the `index' function. */
+#define HAVE_INDEX 1
-/* Define if you have the bzero function. */
-#define HAVE_BZERO 1
+/* Define to 1 if you have the <inttypes.h> header file. */
+#define HAVE_INTTYPES_H 1
-/* Define if you have the index function. */
-#define HAVE_INDEX 1
+/* Define to 1 if you have the <limits.h> header file. */
+#define HAVE_LIMITS_H 1
-/* Define if you have the memcpy function. */
+/* Define to 1 if you have the `memcpy' function. */
#define HAVE_MEMCPY 1
-/* Define if you have the memmove function. */
+/* Define to 1 if you have the `memmove' function. */
#define HAVE_MEMMOVE 1
-/* Define if you have the memset function. */
+/* Define to 1 if you have the <memory.h> header file. */
+#define HAVE_MEMORY_H 1
+
+/* Define to 1 if you have the `memset' function. */
#define HAVE_MEMSET 1
-/* Define if you have the rindex function. */
+/* Define to 1 if you have the `rindex' function. */
#define HAVE_RINDEX 1
-/* Define if you have the strchr function. */
+/* Define to 1 if you have the <siginfo.h> header file. */
+/* #undef HAVE_SIGINFO_H */
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#define HAVE_STDINT_H 1
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#define HAVE_STDLIB_H 1
+
+/* Define to 1 if you have the `strchr' function. */
#define HAVE_STRCHR 1
-/* Define if you have the strerror function. */
+/* Define to 1 if you have the `strerror' function. */
#define HAVE_STRERROR 1
-/* Define if you have the strrchr function. */
+/* Define to 1 if cpp supports the ANSI # stringizing operator. */
+#define HAVE_STRINGIZE 1
+
+/* Define to 1 if you have the <strings.h> header file. */
+#define HAVE_STRINGS_H 1
+
+/* Define to 1 if you have the <string.h> header file. */
+#define HAVE_STRING_H 1
+
+/* Define to 1 if you have the `strrchr' function. */
#define HAVE_STRRCHR 1
-/* Define if you have the strrtok function. */
+/* Define to 1 if you have the `strrtok' function. */
/* #undef HAVE_STRRTOK */
-/* Define if you have the strstr function. */
+/* Define to 1 if you have the `strstr' function. */
#define HAVE_STRSTR 1
-/* Define if you have the strtok function. */
+/* Define to 1 if you have the `strtok' function. */
#define HAVE_STRTOK 1
-/* Define if you have the <errno.h> header file. */
-#define HAVE_ERRNO_H 1
+/* Define to 1 if you have the <sysexits.h> header file. */
+#define HAVE_SYSEXITS_H 1
-/* Define if you have the <fcntl.h> header file. */
-#define HAVE_FCNTL_H 1
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#define HAVE_SYS_STAT_H 1
-/* Define if you have the <limits.h> header file. */
-#define HAVE_LIMITS_H 1
+/* Define to 1 if you have the <sys/types.h> header file. */
+#define HAVE_SYS_TYPES_H 1
-/* Define if you have the <memory.h> header file. */
-#define HAVE_MEMORY_H 1
+/* Define to 1 if you have the <sys/wait.h> header file. */
+#define HAVE_SYS_WAIT_H 1
-/* Define if you have the <siginfo.h> header file. */
-/* #undef HAVE_SIGINFO_H */
+/* Define to 1 if you have the <unistd.h> header file. */
+#define HAVE_UNISTD_H 1
-/* Define if you have the <string.h> header file. */
-#define HAVE_STRING_H 1
+/* Define to the address where bug reports for this package should be sent. */
+#define PACKAGE_BUGREPORT ""
-/* Define if you have the <strings.h> header file. */
-#define HAVE_STRINGS_H 1
+/* Define to the full name of this package. */
+#define PACKAGE_NAME ""
-/* Define if you have the <sys/types.h> header file. */
-#define HAVE_SYS_TYPES_H 1
+/* Define to the full name and version of this package. */
+#define PACKAGE_STRING ""
-/* Define if you have the <sys/wait.h> header file. */
-#define HAVE_SYS_WAIT_H 1
+/* Define to the one symbol short name of this package. */
+#define PACKAGE_TARNAME ""
-/* Define if you have the <sysexits.h> header file. */
-#define HAVE_SYSEXITS_H 1
+/* Define to the version of this package. */
+#define PACKAGE_VERSION ""
-/* Define if you have the <unistd.h> header file. */
-#define HAVE_UNISTD_H 1
+/* Define to 1 if the C compiler supports function prototypes. */
+#define PROTOTYPES 1
-/* Name of package */
-#define PACKAGE "rancid"
+/* Define as the return type of signal handlers (`int' or `void'). */
+#define RETSIGTYPE void
-/* Version number of package */
-#define VERSION "2.2.2"
+/* Define to 1 if you have the ANSI C header files. */
+#define STDC_HEADERS 1
-/* Define if compiler has function prototypes */
-#define PROTOTYPES 1
+/* Define like PROTOTYPES; this can be used by system headers. */
+#define __PROTOTYPES 1
+
+/* Define to empty if `const' does not conform to ANSI C. */
+/* #undef const */
+
+/* Define to `__inline__' or `__inline' if that's what the C compiler
+ calls it, or to nothing if 'inline' is not supported under any name. */
+#ifndef __cplusplus
+/* #undef inline */
+#endif
+/* Define to `unsigned' if <sys/types.h> does not define. */
+/* #undef size_t */
#ifndef __P
# if STDC_HEADERS
@@ -118,12 +145,12 @@
# include <stdlib.h>
#endif
-#if HAVE_UNISTD_H
-# include <unistd.h>
+#if HAVE_UNISTD_H
+# include <unistd.h>
# include <sys/types.h>
-#elif HAVE_SYS_TYPES_H
+#elif HAVE_SYS_TYPES_H
# include <sys/types.h>
-#endif
+#endif
#if HAVE_ERRNO_H
# include <errno.h>
@@ -131,25 +158,25 @@
extern int errno;
#if HAVE_STRING_H
-# include <string.h>
+# include <string.h>
#endif
-#if HAVE_STRINGS_H
+#if HAVE_STRINGS_H
# include <strings.h>
-#endif
+#endif
#if ! HAVE_STRERROR
# define strerror(n) sys_errlist[n];
#endif
-#if HAVE_SYS_WAIT_H
+#if HAVE_SYS_WAIT_H
# include <sys/wait.h>
-#endif
+#endif
#ifndef WEXITSTATUS
# define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
#endif
#ifndef WIFEXITED
# define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
-#endif
+#endif
#if HAVE_MEMSET
# define bzero(p,s) memset(p, 0, s)
diff --git a/include/config.h.in b/include/config.h.in
index 8d5931b..6a867fd 100644
--- a/include/config.h.in
+++ b/include/config.h.in
@@ -1,107 +1,134 @@
-/* include/config.h.in. Generated automatically from configure.in by autoheader. */
+/* include/config.h.in. Generated from configure.in by autoheader. */
#ifndef CONFIG_H
#define CONFIG_H 1
-/* Define to empty if the keyword does not work. */
-#undef const
-
-/* Define if you have the ANSI # stringizing operator in cpp. */
-#undef HAVE_STRINGIZE
-/* Define as __inline if that's what the C compiler calls it. */
-#undef inline
+/* Define to 1 if you have the `bcopy' function. */
+#undef HAVE_BCOPY
-/* Define as the return type of signal handlers (int or void). */
-#undef RETSIGTYPE
+/* Define to 1 if you have the `bzero' function. */
+#undef HAVE_BZERO
-/* Define to `unsigned' if <sys/types.h> doesn't define. */
-#undef size_t
+/* Define to 1 if you have the <errno.h> header file. */
+#undef HAVE_ERRNO_H
-/* Define if you have the ANSI C header files. */
-#undef STDC_HEADERS
+/* Define to 1 if you have the <fcntl.h> header file. */
+#undef HAVE_FCNTL_H
-/* Define if you have the bcopy function. */
-#undef HAVE_BCOPY
+/* Define to 1 if you have the `index' function. */
+#undef HAVE_INDEX
-/* Define if you have the bzero function. */
-#undef HAVE_BZERO
+/* Define to 1 if you have the <inttypes.h> header file. */
+#undef HAVE_INTTYPES_H
-/* Define if you have the index function. */
-#undef HAVE_INDEX
+/* Define to 1 if you have the <limits.h> header file. */
+#undef HAVE_LIMITS_H
-/* Define if you have the memcpy function. */
+/* Define to 1 if you have the `memcpy' function. */
#undef HAVE_MEMCPY
-/* Define if you have the memmove function. */
+/* Define to 1 if you have the `memmove' function. */
#undef HAVE_MEMMOVE
-/* Define if you have the memset function. */
+/* Define to 1 if you have the <memory.h> header file. */
+#undef HAVE_MEMORY_H
+
+/* Define to 1 if you have the `memset' function. */
#undef HAVE_MEMSET
-/* Define if you have the rindex function. */
+/* Define to 1 if you have the `rindex' function. */
#undef HAVE_RINDEX
-/* Define if you have the strchr function. */
+/* Define to 1 if you have the <siginfo.h> header file. */
+#undef HAVE_SIGINFO_H
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#undef HAVE_STDINT_H
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#undef HAVE_STDLIB_H
+
+/* Define to 1 if you have the `strchr' function. */
#undef HAVE_STRCHR
-/* Define if you have the strerror function. */
+/* Define to 1 if you have the `strerror' function. */
#undef HAVE_STRERROR
-/* Define if you have the strrchr function. */
+/* Define to 1 if cpp supports the ANSI # stringizing operator. */
+#undef HAVE_STRINGIZE
+
+/* Define to 1 if you have the <strings.h> header file. */
+#undef HAVE_STRINGS_H
+
+/* Define to 1 if you have the <string.h> header file. */
+#undef HAVE_STRING_H
+
+/* Define to 1 if you have the `strrchr' function. */
#undef HAVE_STRRCHR
-/* Define if you have the strrtok function. */
+/* Define to 1 if you have the `strrtok' function. */
#undef HAVE_STRRTOK
-/* Define if you have the strstr function. */
+/* Define to 1 if you have the `strstr' function. */
#undef HAVE_STRSTR
-/* Define if you have the strtok function. */
+/* Define to 1 if you have the `strtok' function. */
#undef HAVE_STRTOK
-/* Define if you have the <errno.h> header file. */
-#undef HAVE_ERRNO_H
+/* Define to 1 if you have the <sysexits.h> header file. */
+#undef HAVE_SYSEXITS_H
-/* Define if you have the <fcntl.h> header file. */
-#undef HAVE_FCNTL_H
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#undef HAVE_SYS_STAT_H
-/* Define if you have the <limits.h> header file. */
-#undef HAVE_LIMITS_H
+/* Define to 1 if you have the <sys/types.h> header file. */
+#undef HAVE_SYS_TYPES_H
-/* Define if you have the <memory.h> header file. */
-#undef HAVE_MEMORY_H
+/* Define to 1 if you have the <sys/wait.h> header file. */
+#undef HAVE_SYS_WAIT_H
-/* Define if you have the <siginfo.h> header file. */
-#undef HAVE_SIGINFO_H
+/* Define to 1 if you have the <unistd.h> header file. */
+#undef HAVE_UNISTD_H
-/* Define if you have the <string.h> header file. */
-#undef HAVE_STRING_H
+/* Define to the address where bug reports for this package should be sent. */
+#undef PACKAGE_BUGREPORT
-/* Define if you have the <strings.h> header file. */
-#undef HAVE_STRINGS_H
+/* Define to the full name of this package. */
+#undef PACKAGE_NAME
-/* Define if you have the <sys/types.h> header file. */
-#undef HAVE_SYS_TYPES_H
+/* Define to the full name and version of this package. */
+#undef PACKAGE_STRING
-/* Define if you have the <sys/wait.h> header file. */
-#undef HAVE_SYS_WAIT_H
+/* Define to the one symbol short name of this package. */
+#undef PACKAGE_TARNAME
-/* Define if you have the <sysexits.h> header file. */
-#undef HAVE_SYSEXITS_H
+/* Define to the version of this package. */
+#undef PACKAGE_VERSION
-/* Define if you have the <unistd.h> header file. */
-#undef HAVE_UNISTD_H
+/* Define to 1 if the C compiler supports function prototypes. */
+#undef PROTOTYPES
-/* Name of package */
-#undef PACKAGE
+/* Define as the return type of signal handlers (`int' or `void'). */
+#undef RETSIGTYPE
-/* Version number of package */
-#undef VERSION
+/* Define to 1 if you have the ANSI C header files. */
+#undef STDC_HEADERS
-/* Define if compiler has function prototypes */
-#undef PROTOTYPES
+/* Define like PROTOTYPES; this can be used by system headers. */
+#undef __PROTOTYPES
+/* Define to empty if `const' does not conform to ANSI C. */
+#undef const
+
+/* Define to `__inline__' or `__inline' if that's what the C compiler
+ calls it, or to nothing if 'inline' is not supported under any name. */
+#ifndef __cplusplus
+#undef inline
+#endif
+
+/* Define to `unsigned' if <sys/types.h> does not define. */
+#undef size_t
#ifndef __P
# if STDC_HEADERS
diff --git a/include/stamp-h.in b/include/stamp-h.in
deleted file mode 100644
index 9788f70..0000000
--- a/include/stamp-h.in
+++ /dev/null
@@ -1 +0,0 @@
-timestamp
diff --git a/include/version.h b/include/version.h
index c1348ad..3cffb0b 100644
--- a/include/version.h
+++ b/include/version.h
@@ -4,6 +4,6 @@
/* pkg version */
char package[] = "rancid";
-char version[] = "2.2.2";
+char version[] = "2.3.rc1";
#endif
diff --git a/include/version.h.in b/include/version.h.in
index c1348ad..3cffb0b 100644
--- a/include/version.h.in
+++ b/include/version.h.in
@@ -4,6 +4,6 @@
/* pkg version */
char package[] = "rancid";
-char version[] = "2.2.2";
+char version[] = "2.3.rc1";
#endif
diff --git a/install-sh b/install-sh
index 89fc9b0..f5061e7 100755
--- a/install-sh
+++ b/install-sh
@@ -1,23 +1,52 @@
-#! /bin/sh
-#
+#!/bin/sh
# install - install a program, script, or datafile
-# This comes from X11R5.
+
+scriptversion=2003-09-24.23
+
+# This originates from X11R5 (mit/util/scripts/install.sh), which was
+# later released in X11R6 (xc/config/util/install.sh) with the
+# following copyright and license.
+#
+# Copyright (C) 1994 X Consortium
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to
+# deal in the Software without restriction, including without limitation the
+# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+# sell copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
+# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+#
+# Except as contained in this notice, the name of the X Consortium shall not
+# be used in advertising or otherwise to promote the sale, use or other deal-
+# ings in this Software without prior written authorization from the X Consor-
+# tium.
+#
+#
+# FSF changes to this file are in the public domain.
#
# Calling this script install-sh is preferred over install.sh, to prevent
# `make' implicit rules from creating a file called install from it
# when there is no Makefile.
#
# This script is compatible with the BSD install script, but was written
-# from scratch.
-#
-
+# from scratch. It can only install one file at a time, a restriction
+# shared with many OS's install programs.
# set DOITPROG to echo to test this script
# Don't use :- since 4.3BSD and earlier shells don't like it.
doit="${DOITPROG-}"
-
# put in absolute paths if you don't have them in your path; or use env. vars.
mvprog="${MVPROG-mv}"
@@ -29,210 +58,238 @@ stripprog="${STRIPPROG-strip}"
rmprog="${RMPROG-rm}"
mkdirprog="${MKDIRPROG-mkdir}"
-tranformbasename=""
-transform_arg=""
+transformbasename=
+transform_arg=
instcmd="$mvprog"
chmodcmd="$chmodprog 0755"
-chowncmd=""
-chgrpcmd=""
-stripcmd=""
+chowncmd=
+chgrpcmd=
+stripcmd=
rmcmd="$rmprog -f"
mvcmd="$mvprog"
-src=""
-dst=""
-dir_arg=""
-
-while [ x"$1" != x ]; do
- case $1 in
- -c) instcmd="$cpprog"
- shift
- continue;;
-
- -d) dir_arg=true
- shift
- continue;;
-
- -m) chmodcmd="$chmodprog $2"
- shift
- shift
- continue;;
-
- -o) chowncmd="$chownprog $2"
- shift
- shift
- continue;;
-
- -g) chgrpcmd="$chgrpprog $2"
- shift
- shift
- continue;;
-
- -s) stripcmd="$stripprog"
- shift
- continue;;
-
- -t=*) transformarg=`echo $1 | sed 's/-t=//'`
- shift
- continue;;
-
- -b=*) transformbasename=`echo $1 | sed 's/-b=//'`
- shift
- continue;;
-
- *) if [ x"$src" = x ]
- then
- src=$1
- else
- # this colon is to work around a 386BSD /bin/sh bug
- :
- dst=$1
- fi
- shift
- continue;;
- esac
+src=
+dst=
+dir_arg=
+
+usage="Usage: $0 [OPTION]... SRCFILE DSTFILE
+ or: $0 -d DIR1 DIR2...
+
+In the first form, install SRCFILE to DSTFILE, removing SRCFILE by default.
+In the second, create the directory path DIR.
+
+Options:
+-b=TRANSFORMBASENAME
+-c copy source (using $cpprog) instead of moving (using $mvprog).
+-d create directories instead of installing files.
+-g GROUP $chgrp installed files to GROUP.
+-m MODE $chmod installed files to MODE.
+-o USER $chown installed files to USER.
+-s strip installed files (using $stripprog).
+-t=TRANSFORM
+--help display this help and exit.
+--version display version info and exit.
+
+Environment variables override the default commands:
+ CHGRPPROG CHMODPROG CHOWNPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG
+"
+
+while test -n "$1"; do
+ case $1 in
+ -b=*) transformbasename=`echo $1 | sed 's/-b=//'`
+ shift
+ continue;;
+
+ -c) instcmd=$cpprog
+ shift
+ continue;;
+
+ -d) dir_arg=true
+ shift
+ continue;;
+
+ -g) chgrpcmd="$chgrpprog $2"
+ shift
+ shift
+ continue;;
+
+ --help) echo "$usage"; exit 0;;
+
+ -m) chmodcmd="$chmodprog $2"
+ shift
+ shift
+ continue;;
+
+ -o) chowncmd="$chownprog $2"
+ shift
+ shift
+ continue;;
+
+ -s) stripcmd=$stripprog
+ shift
+ continue;;
+
+ -t=*) transformarg=`echo $1 | sed 's/-t=//'`
+ shift
+ continue;;
+
+ --version) echo "$0 $scriptversion"; exit 0;;
+
+ *) if test -z "$src"; then
+ src=$1
+ else
+ # this colon is to work around a 386BSD /bin/sh bug
+ :
+ dst=$1
+ fi
+ shift
+ continue;;
+ esac
done
-if [ x"$src" = x ]
-then
- echo "install: no input file specified"
- exit 1
-else
- true
+if test -z "$src"; then
+ echo "$0: no input file specified." >&2
+ exit 1
fi
-if [ x"$dir_arg" != x ]; then
- dst=$src
- src=""
-
- if [ -d $dst ]; then
- instcmd=:
- else
- instcmd=mkdir
- fi
+# Protect names starting with `-'.
+case $src in
+ -*) src=./$src ;;
+esac
+
+if test -n "$dir_arg"; then
+ dst=$src
+ src=
+
+ if test -d "$dst"; then
+ instcmd=:
+ chmodcmd=
+ else
+ instcmd=$mkdirprog
+ fi
else
-
-# Waiting for this to be detected by the "$instcmd $src $dsttmp" command
-# might cause directories to be created, which would be especially bad
-# if $src (and thus $dsttmp) contains '*'.
-
- if [ -f $src -o -d $src ]
- then
- true
- else
- echo "install: $src does not exist"
- exit 1
- fi
-
- if [ x"$dst" = x ]
- then
- echo "install: no destination specified"
- exit 1
- else
- true
- fi
-
-# If destination is a directory, append the input filename; if your system
-# does not like double slashes in filenames, you may need to add some logic
-
- if [ -d $dst ]
- then
- dst="$dst"/`basename $src`
- else
- true
- fi
+ # Waiting for this to be detected by the "$instcmd $src $dsttmp" command
+ # might cause directories to be created, which would be especially bad
+ # if $src (and thus $dsttmp) contains '*'.
+ if test ! -f "$src" && test ! -d "$src"; then
+ echo "$0: $src does not exist." >&2
+ exit 1
+ fi
+
+ if test -z "$dst"; then
+ echo "$0: no destination specified." >&2
+ exit 1
+ fi
+
+ # Protect names starting with `-'.
+ case $dst in
+ -*) dst=./$dst ;;
+ esac
+
+ # If destination is a directory, append the input filename; won't work
+ # if double slashes aren't ignored.
+ if test -d "$dst"; then
+ dst=$dst/`basename "$src"`
+ fi
fi
-## this sed command emulates the dirname command
-dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
+# This sed command emulates the dirname command.
+dstdir=`echo "$dst" | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
# Make sure that the destination directory exists.
-# this part is taken from Noah Friedman's mkinstalldirs script
# Skip lots of stat calls in the usual case.
-if [ ! -d "$dstdir" ]; then
-defaultIFS='
-'
-IFS="${IFS-${defaultIFS}}"
-
-oIFS="${IFS}"
-# Some sh's can't handle IFS=/ for some reason.
-IFS='%'
-set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'`
-IFS="${oIFS}"
-
-pathcomp=''
-
-while [ $# -ne 0 ] ; do
- pathcomp="${pathcomp}${1}"
- shift
-
- if [ ! -d "${pathcomp}" ] ;
- then
- $mkdirprog "${pathcomp}"
- else
- true
- fi
-
- pathcomp="${pathcomp}/"
-done
+if test ! -d "$dstdir"; then
+ defaultIFS='
+ '
+ IFS="${IFS-$defaultIFS}"
+
+ oIFS=$IFS
+ # Some sh's can't handle IFS=/ for some reason.
+ IFS='%'
+ set - `echo "$dstdir" | sed -e 's@/@%@g' -e 's@^%@/@'`
+ IFS=$oIFS
+
+ pathcomp=
+
+ while test $# -ne 0 ; do
+ pathcomp=$pathcomp$1
+ shift
+ test -d "$pathcomp" || $mkdirprog "$pathcomp"
+ pathcomp=$pathcomp/
+ done
fi
-if [ x"$dir_arg" != x ]
-then
- $doit $instcmd $dst &&
+if test -n "$dir_arg"; then
+ $doit $instcmd "$dst" \
+ && { test -z "$chowncmd" || $doit $chowncmd "$dst"; } \
+ && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } \
+ && { test -z "$stripcmd" || $doit $stripcmd "$dst"; } \
+ && { test -z "$chmodcmd" || $doit $chmodcmd "$dst"; }
- if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi &&
- if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi &&
- if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi &&
- if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi
else
-
-# If we're going to rename the final executable, determine the name now.
-
- if [ x"$transformarg" = x ]
- then
- dstfile=`basename $dst`
- else
- dstfile=`basename $dst $transformbasename |
- sed $transformarg`$transformbasename
- fi
-
-# don't allow the sed command to completely eliminate the filename
-
- if [ x"$dstfile" = x ]
- then
- dstfile=`basename $dst`
- else
- true
- fi
-
-# Make a temp file name in the proper directory.
-
- dsttmp=$dstdir/#inst.$$#
-
-# Move or copy the file name to the temp name
-
- $doit $instcmd $src $dsttmp &&
-
- trap "rm -f ${dsttmp}" 0 &&
-
-# and set any options; do chmod last to preserve setuid bits
-
-# If any of these fail, we abort the whole thing. If we want to
-# ignore errors from any of these, just make sure not to ignore
-# errors from the above "$doit $instcmd $src $dsttmp" command.
-
- if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi &&
- if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi &&
- if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi &&
- if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi &&
-
-# Now rename the file to the real destination.
-
- $doit $rmcmd -f $dstdir/$dstfile &&
- $doit $mvcmd $dsttmp $dstdir/$dstfile
-
+ # If we're going to rename the final executable, determine the name now.
+ if test -z "$transformarg"; then
+ dstfile=`basename "$dst"`
+ else
+ dstfile=`basename "$dst" $transformbasename \
+ | sed $transformarg`$transformbasename
+ fi
+
+ # don't allow the sed command to completely eliminate the filename.
+ test -z "$dstfile" && dstfile=`basename "$dst"`
+
+ # Make a couple of temp file names in the proper directory.
+ dsttmp=$dstdir/_inst.$$_
+ rmtmp=$dstdir/_rm.$$_
+
+ # Trap to clean up those temp files at exit.
+ trap 'status=$?; rm -f "$dsttmp" "$rmtmp" && exit $status' 0
+ trap '(exit $?); exit' 1 2 13 15
+
+ # Move or copy the file name to the temp name
+ $doit $instcmd "$src" "$dsttmp" &&
+
+ # and set any options; do chmod last to preserve setuid bits.
+ #
+ # If any of these fail, we abort the whole thing. If we want to
+ # ignore errors from any of these, just make sure not to ignore
+ # errors from the above "$doit $instcmd $src $dsttmp" command.
+ #
+ { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } \
+ && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } \
+ && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } \
+ && { test -z "$chmodcmd" || $doit $chmodcmd "$dsttmp"; } &&
+
+ # Now remove or move aside any old file at destination location. We
+ # try this two ways since rm can't unlink itself on some systems and
+ # the destination file might be busy for other reasons. In this case,
+ # the final cleanup might fail but the new file should still install
+ # successfully.
+ {
+ if test -f "$dstdir/$dstfile"; then
+ $doit $rmcmd -f "$dstdir/$dstfile" 2>/dev/null \
+ || $doit $mvcmd -f "$dstdir/$dstfile" "$rmtmp" 2>/dev/null \
+ || {
+ echo "$0: cannot unlink or rename $dstdir/$dstfile" >&2
+ (exit 1); exit
+ }
+ else
+ :
+ fi
+ } &&
+
+ # Now rename the file to the real destination.
+ $doit $mvcmd "$dsttmp" "$dstdir/$dstfile"
fi &&
-
-exit 0
+# The final little trick to "correctly" pass the exit status to the exit trap.
+{
+ (exit 0); exit
+}
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-end: "$"
+# End:
diff --git a/man/Makefile.am b/man/Makefile.am
index d499951..4be3c26 100644
--- a/man/Makefile.am
+++ b/man/Makefile.am
@@ -1,24 +1,73 @@
## Process this file with automake to produce Makefile.in
## A Makefile.in is supplied, in case you do not have automake.
+## $Id: Makefile.am,v 1.44 2004/01/11 06:12:35 hank Exp $
+##
+## Copyright (C) 1997-2004 by Terrapin Communications, Inc.
+## All rights reserved.
+##
+## This software may be freely copied, modified and redistributed
+## without fee for non-commerical purposes provided that this license
+## remains intact and unmodified with any RANCID distribution.
+##
+## There is no warranty or other guarantee of fitness of this software.
+## It is provided solely "as is". The author(s) disclaim(s) all
+## responsibility and liability with respect to this software's usage
+## or its effect upon hardware, computer systems, other software, or
+## anything else.
+##
+## Except where noted otherwise, rancid was written by and is maintained by
+## Henry Kilmer, John Heasley, Andrew Partan, Pete Whiting, and Austin Schutz.
+##
+
AUTOMAKE_OPTIONS=foreign no-dependencies
@SET_MAKE@
-man_gen_MANS = env.5 lg.conf.5 lg_intro.1
-man_nogen_MANS = do-diffs.1 alogin.1 blogin.1 clogin.1 control_rancid.1 \
- create_cvs.1 rancid.1 \
+man_gen_MANS = lg.conf.5 rancid.conf.5 lg_intro.1
+man_nogen_MANS = alogin.1 blogin.1 clogin.1 control_rancid.1 \
+ cssrancid.1 rancid.1 \
rancid_intro.1 cloginrc.5 router.db.5 \
- elogin.1 f10rancid.1 flogin.1 hlogin.1 hrancid.1 jlogin.1 \
- jrancid.1 f10rancid.1 francid.1 cat5rancid.1 erancid.1 \
- mrancid.1 par.1 xrancid.1
+ elogin.1 f10rancid.1 flogin.1 fnrancid.1 \
+ hlogin.1 hrancid.1 htlogin.1 htrancid.1 jlogin.1 \
+ jrancid.1 jerancid.1 f10rancid.1 francid.1 cat5rancid.1 \
+ erancid.1 mrancid.1 nlogin.1 nrancid.1 nslogin.1 nsrancid.1 \
+ par.1 prancid.1 \
+ rancid-cvs.1 rancid-run.1 rivlogin.1 rivrancid.1 \
+ tntlogin.1 tntrancid.1 xrancid.1 zrancid.1
+
+man_MANS = $(man_nogen_MANS) $(man_gen_MANS)
+
+EXTRA_DIST = $(man_nogen_MANS) $(man_gen_MANS:%=%.in)
-man_MANS = $(man_gen_MANS) $(man_nogen_MANS)
+CLEANFILES = $(man_gen_MANS)
-EXTRA_DIST = $(man_nogen_MANS)
+# auto_edit does the autoconf variable substitution. This allows the
+# substitution to have the full expansion of the variables, e.g.: $sysconfdir
+# will be /prefix/etc instead of ${prefix}/etc.
+#
+# This is a bit of a PITA, but is the method recommended by the autoconf
+# documentation.
+auto_edit = sed \
+ -e 's,@prefix\@,$(prefix),g' \
+ -e 's,@bindir\@,$(bindir),g' \
+ -e 's,@localstatedir\@,$(localstatedir),g' \
+ -e 's,@sysconfdir\@,$(sysconfdir),g' \
+ -e 's,@pkgdatadir\@,$(sysconfdir),g' \
+ -e 's,@ADMINMAILPLUS\@,$(ADMINMAILPLUS),g' \
+ -e 's,@MAILPLUS\@,$(MAILPLUS),g'
-#CLEANFILES = Makefile env.5 lg.conf.5 lg_intro.1
+lg.conf.5: Makefile $(srcdir)/lg.conf.5.in
+ rm -f lg.conf.5 lg.conf.5.tmp; \
+ $(auto_edit) $(srcdir)/lg.conf.5.in >lg.conf.5.tmp; \
+ mv lg.conf.5.tmp lg.conf.5
-all:
+lg_intro.1: Makefile $(srcdir)/lg_intro.1.in
+ rm -f lg_intro.1 lg_intro.1.tmp; \
+ $(auto_edit) $(srcdir)/lg_intro.1.in >lg_intro.1.tmp; \
+ mv lg_intro.1.tmp lg_intro.1
-distclean: clean
+rancid.conf.5: Makefile $(srcdir)/rancid.conf.5.in
+ rm -f rancid.conf.5 rancid.conf.5.tmp; \
+ $(auto_edit) $(srcdir)/rancid.conf.5.in >rancid.conf.5.tmp; \
+ mv rancid.conf.5.tmp rancid.conf.5
diff --git a/man/Makefile.in b/man/Makefile.in
index 0c9bc06..135c237 100644
--- a/man/Makefile.in
+++ b/man/Makefile.in
@@ -1,6 +1,8 @@
-# Makefile.in generated automatically by automake 1.4-p5 from Makefile.am
+# Makefile.in generated by automake 1.8 from Makefile.am.
+# @configure_input@
-# Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc.
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
+# Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@@ -10,135 +12,213 @@
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
-
-SHELL = @SHELL@
-
+@SET_MAKE@
srcdir = @srcdir@
top_srcdir = @top_srcdir@
VPATH = @srcdir@
-prefix = @prefix@
-exec_prefix = @exec_prefix@
-
-bindir = @bindir@
-sbindir = @sbindir@
-libexecdir = @libexecdir@
-datadir = @datadir@
-sysconfdir = @sysconfdir@
-sharedstatedir = @sharedstatedir@
-localstatedir = @localstatedir@
-libdir = @libdir@
-infodir = @infodir@
-mandir = @mandir@
-includedir = @includedir@
-oldincludedir = /usr/include
-
-DESTDIR =
-
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
-
top_builddir = ..
-
-ACLOCAL = @ACLOCAL@
-AUTOCONF = @AUTOCONF@
-AUTOMAKE = @AUTOMAKE@
-AUTOHEADER = @AUTOHEADER@
-
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
INSTALL = @INSTALL@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS)
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-transform = @program_transform_name@
-
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
+subdir = man
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
+ $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
+CONFIG_HEADER = $(top_builddir)/include/config.h
+CONFIG_CLEAN_FILES =
+depcomp =
+am__depfiles_maybe =
+SOURCES =
+DIST_SOURCES =
+man1dir = $(mandir)/man1
+am__installdirs = $(DESTDIR)$(man1dir) $(DESTDIR)$(man5dir)
+man5dir = $(mandir)/man5
+NROFF = nroff
+MANS = $(man_MANS)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+ADMINMAILPLUS = @ADMINMAILPLUS@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
COMM = @COMM@
CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
CVS = @CVS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
DIFF = @DIFF@
DIFF_CMD = @DIFF_CMD@
DIRNAME = @DIRNAME@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
ENV_PATH = @ENV_PATH@
+EXEEXT = @EXEEXT@
EXPECT_PATH = @EXPECT_PATH@
FIND = @FIND@
GREP = @GREP@
ID = @ID@
-INST_PROGS = @INST_PROGS@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
LG_PING_CMD = @LG_PING_CMD@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LTLIBOBJS = @LTLIBOBJS@
MAILPLUS = @MAILPLUS@
-MAINT = @MAINT@
MAKE = @MAKE@
MAKEINFO = @MAKEINFO@
MKDIR = @MKDIR@
+OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
PERLV = @PERLV@
PERLV_PATH = @PERLV_PATH@
PING_PATH = @PING_PATH@
-RD_BIN_DATAS = @RD_BIN_DATAS@
-RD_BIN_PROGS = @RD_BIN_PROGS@
-RD_UTIL_LG_PROGS = @RD_UTIL_LG_PROGS@
-RD_UTIL_PROGS = @RD_UTIL_PROGS@
RSH = @RSH@
SENDMAIL = @SENDMAIL@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
SORT = @SORT@
SSH = @SSH@
+STRIP = @STRIP@
TAR = @TAR@
TELNET = @TELNET@
TOUCH = @TOUCH@
U = @U@
VERSION = @VERSION@
-
+ac_ct_CC = @ac_ct_CC@
+ac_ct_STRIP = @ac_ct_STRIP@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+bindir = @bindir@
+build_alias = @build_alias@
+datadir = @datadir@
+exec_prefix = @exec_prefix@
+host_alias = @host_alias@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
AUTOMAKE_OPTIONS = foreign no-dependencies
+man_gen_MANS = lg.conf.5 rancid.conf.5 lg_intro.1
+man_nogen_MANS = alogin.1 blogin.1 clogin.1 control_rancid.1 \
+ cssrancid.1 rancid.1 \
+ rancid_intro.1 cloginrc.5 router.db.5 \
+ elogin.1 f10rancid.1 flogin.1 fnrancid.1 \
+ hlogin.1 hrancid.1 htlogin.1 htrancid.1 jlogin.1 \
+ jrancid.1 jerancid.1 f10rancid.1 francid.1 cat5rancid.1 \
+ erancid.1 mrancid.1 nlogin.1 nrancid.1 nslogin.1 nsrancid.1 \
+ par.1 prancid.1 \
+ rancid-cvs.1 rancid-run.1 rivlogin.1 rivrancid.1 \
+ tntlogin.1 tntrancid.1 xrancid.1 zrancid.1
+
+man_MANS = $(man_nogen_MANS) $(man_gen_MANS)
+EXTRA_DIST = $(man_nogen_MANS) $(man_gen_MANS:%=%.in)
+CLEANFILES = $(man_gen_MANS)
+
+# auto_edit does the autoconf variable substitution. This allows the
+# substitution to have the full expansion of the variables, e.g.: $sysconfdir
+# will be /prefix/etc instead of ${prefix}/etc.
+#
+# This is a bit of a PITA, but is the method recommended by the autoconf
+# documentation.
+auto_edit = sed \
+ -e 's,@prefix\@,$(prefix),g' \
+ -e 's,@bindir\@,$(bindir),g' \
+ -e 's,@localstatedir\@,$(localstatedir),g' \
+ -e 's,@sysconfdir\@,$(sysconfdir),g' \
+ -e 's,@pkgdatadir\@,$(sysconfdir),g' \
+ -e 's,@ADMINMAILPLUS\@,$(ADMINMAILPLUS),g' \
+ -e 's,@MAILPLUS\@,$(MAILPLUS),g'
+
+all: all-am
-man_gen_MANS = env.5 lg.conf.5 lg_intro.1
-man_nogen_MANS = do-diffs.1 alogin.1 blogin.1 clogin.1 control_rancid.1 create_cvs.1 rancid.1 rancid_intro.1 cloginrc.5 router.db.5 elogin.1 f10rancid.1 flogin.1 hlogin.1 hrancid.1 jlogin.1 jrancid.1 f10rancid.1 francid.1 cat5rancid.1 erancid.1 mrancid.1 par.1 xrancid.1
-
-
-man_MANS = $(man_gen_MANS) $(man_nogen_MANS)
-
-EXTRA_DIST = $(man_nogen_MANS)
-mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
-CONFIG_HEADER = ../include/config.h
-CONFIG_CLEAN_FILES = env.5 lg.conf.5 lg_intro.1
-man1dir = $(mandir)/man1
-man5dir = $(mandir)/man5
-MANS = $(man_MANS)
-
-NROFF = nroff
-DIST_COMMON = Makefile.am Makefile.in env.5.in lg.conf.5.in \
-lg_intro.1.in
-
-
-DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
-
-GZIP_ENV = --best
-all: all-redirect
.SUFFIXES:
-$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
- cd $(top_srcdir) && $(AUTOMAKE) --foreign man/Makefile
-
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
- cd $(top_builddir) \
- && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
-
-env.5: $(top_builddir)/config.status env.5.in
- cd $(top_builddir) && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
-lg.conf.5: $(top_builddir)/config.status lg.conf.5.in
- cd $(top_builddir) && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
-lg_intro.1: $(top_builddir)/config.status lg_intro.1.in
- cd $(top_builddir) && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
-
-install-man1:
- $(mkinstalldirs) $(DESTDIR)$(man1dir)
- @list='$(man1_MANS)'; \
- l2='$(man_MANS)'; for i in $$l2; do \
+$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+ && exit 0; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign man/Makefile'; \
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --foreign man/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+uninstall-info-am:
+install-man1: $(man1_MANS) $(man_MANS)
+ @$(NORMAL_INSTALL)
+ $(mkdir_p) $(DESTDIR)$(man1dir)
+ @list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \
+ l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \
+ for i in $$l2; do \
case "$$i" in \
*.1*) list="$$list $$i" ;; \
esac; \
@@ -147,31 +227,43 @@ install-man1:
if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \
else file=$$i; fi; \
ext=`echo $$i | sed -e 's/^.*\\.//'`; \
+ case "$$ext" in \
+ 1*) ;; \
+ *) ext='1' ;; \
+ esac; \
inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
+ inst=`echo $$inst | sed -e 's/^.*\///'`; \
inst=`echo $$inst | sed '$(transform)'`.$$ext; \
echo " $(INSTALL_DATA) $$file $(DESTDIR)$(man1dir)/$$inst"; \
$(INSTALL_DATA) $$file $(DESTDIR)$(man1dir)/$$inst; \
done
-
uninstall-man1:
- @list='$(man1_MANS)'; \
- l2='$(man_MANS)'; for i in $$l2; do \
+ @$(NORMAL_UNINSTALL)
+ @list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \
+ l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \
+ for i in $$l2; do \
case "$$i" in \
*.1*) list="$$list $$i" ;; \
esac; \
done; \
for i in $$list; do \
ext=`echo $$i | sed -e 's/^.*\\.//'`; \
+ case "$$ext" in \
+ 1*) ;; \
+ *) ext='1' ;; \
+ esac; \
inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
+ inst=`echo $$inst | sed -e 's/^.*\///'`; \
inst=`echo $$inst | sed '$(transform)'`.$$ext; \
echo " rm -f $(DESTDIR)$(man1dir)/$$inst"; \
rm -f $(DESTDIR)$(man1dir)/$$inst; \
done
-
-install-man5:
- $(mkinstalldirs) $(DESTDIR)$(man5dir)
- @list='$(man5_MANS)'; \
- l2='$(man_MANS)'; for i in $$l2; do \
+install-man5: $(man5_MANS) $(man_MANS)
+ @$(NORMAL_INSTALL)
+ $(mkdir_p) $(DESTDIR)$(man5dir)
+ @list='$(man5_MANS) $(dist_man5_MANS) $(nodist_man5_MANS)'; \
+ l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \
+ for i in $$l2; do \
case "$$i" in \
*.5*) list="$$list $$i" ;; \
esac; \
@@ -180,122 +272,176 @@ install-man5:
if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \
else file=$$i; fi; \
ext=`echo $$i | sed -e 's/^.*\\.//'`; \
+ case "$$ext" in \
+ 5*) ;; \
+ *) ext='5' ;; \
+ esac; \
inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
+ inst=`echo $$inst | sed -e 's/^.*\///'`; \
inst=`echo $$inst | sed '$(transform)'`.$$ext; \
echo " $(INSTALL_DATA) $$file $(DESTDIR)$(man5dir)/$$inst"; \
$(INSTALL_DATA) $$file $(DESTDIR)$(man5dir)/$$inst; \
done
-
uninstall-man5:
- @list='$(man5_MANS)'; \
- l2='$(man_MANS)'; for i in $$l2; do \
+ @$(NORMAL_UNINSTALL)
+ @list='$(man5_MANS) $(dist_man5_MANS) $(nodist_man5_MANS)'; \
+ l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \
+ for i in $$l2; do \
case "$$i" in \
*.5*) list="$$list $$i" ;; \
esac; \
done; \
for i in $$list; do \
ext=`echo $$i | sed -e 's/^.*\\.//'`; \
+ case "$$ext" in \
+ 5*) ;; \
+ *) ext='5' ;; \
+ esac; \
inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
+ inst=`echo $$inst | sed -e 's/^.*\///'`; \
inst=`echo $$inst | sed '$(transform)'`.$$ext; \
echo " rm -f $(DESTDIR)$(man5dir)/$$inst"; \
rm -f $(DESTDIR)$(man5dir)/$$inst; \
done
-install-man: $(MANS)
- @$(NORMAL_INSTALL)
- $(MAKE) $(AM_MAKEFLAGS) install-man1 install-man5
-uninstall-man:
- @$(NORMAL_UNINSTALL)
- $(MAKE) $(AM_MAKEFLAGS) uninstall-man1 uninstall-man5
tags: TAGS
TAGS:
+ctags: CTAGS
+CTAGS:
-distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
-
-subdir = man
distdir: $(DISTFILES)
- @for file in $(DISTFILES); do \
- d=$(srcdir); \
+ @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+ list='$(DISTFILES)'; for file in $$list; do \
+ case $$file in \
+ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+ esac; \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+ dir="/$$dir"; \
+ $(mkdir_p) "$(distdir)$$dir"; \
+ else \
+ dir=''; \
+ fi; \
if test -d $$d/$$file; then \
- cp -pr $$d/$$file $(distdir)/$$file; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+ fi; \
+ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
else \
test -f $(distdir)/$$file \
- || ln $$d/$$file $(distdir)/$$file 2> /dev/null \
- || cp -p $$d/$$file $(distdir)/$$file || :; \
+ || cp -p $$d/$$file $(distdir)/$$file \
+ || exit 1; \
fi; \
done
-info-am:
-info: info-am
-dvi-am:
-dvi: dvi-am
check-am: all-am
check: check-am
-installcheck-am:
-installcheck: installcheck-am
-install-exec-am:
+all-am: Makefile $(MANS)
+installdirs:
+ $(mkdir_p) $(DESTDIR)$(man1dir) $(DESTDIR)$(man5dir)
+install: install-am
install-exec: install-exec-am
-
-install-data-am: install-man
install-data: install-data-am
+uninstall: uninstall-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-install: install-am
-uninstall-am: uninstall-man
-uninstall: uninstall-am
-all-am: Makefile $(MANS)
-all-redirect: all-am
-install-strip:
- $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install
-installdirs:
- $(mkinstalldirs) $(DESTDIR)$(mandir)/man1 $(DESTDIR)$(mandir)/man5
-
+installcheck: installcheck-am
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
mostlyclean-generic:
clean-generic:
+ -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
distclean-generic:
- -rm -f Makefile $(CONFIG_CLEAN_FILES)
- -rm -f config.cache config.log stamp-h stamp-h[0-9]*
+ -rm -f $(CONFIG_CLEAN_FILES)
maintainer-clean-generic:
-mostlyclean-am: mostlyclean-generic
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
-mostlyclean: mostlyclean-am
+clean-am: clean-generic mostlyclean-am
-clean-am: clean-generic mostlyclean-am
+distclean: distclean-am
+ -rm -f Makefile
+distclean-am: clean-am distclean-generic
-clean: clean-am
+dvi: dvi-am
-distclean-am: distclean-generic clean-am
+dvi-am:
-distclean: distclean-am
+html: html-am
-maintainer-clean-am: maintainer-clean-generic distclean-am
- @echo "This command is intended for maintainers to use;"
- @echo "it deletes files that may require special tools to rebuild."
+info: info-am
+
+info-am:
+
+install-data-am: install-man
+
+install-exec-am:
+
+install-info: install-info-am
+
+install-man: install-man1 install-man5
+
+installcheck-am:
maintainer-clean: maintainer-clean-am
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
-.PHONY: install-man1 uninstall-man1 install-man5 uninstall-man5 \
-install-man uninstall-man tags distdir info-am info dvi-am dvi check \
-check-am installcheck-am installcheck install-exec-am install-exec \
-install-data-am install-data install-am install uninstall-am uninstall \
-all-redirect all-am all installdirs mostlyclean-generic \
-distclean-generic clean-generic maintainer-clean-generic clean \
-mostlyclean distclean maintainer-clean
+mostlyclean: mostlyclean-am
+mostlyclean-am: mostlyclean-generic
-@SET_MAKE@
+pdf: pdf-am
-#CLEANFILES = Makefile env.5 lg.conf.5 lg_intro.1
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-info-am uninstall-man
+
+uninstall-man: uninstall-man1 uninstall-man5
+
+.PHONY: all all-am check check-am clean clean-generic distclean \
+ distclean-generic distdir dvi dvi-am html html-am info info-am \
+ install install-am install-data install-data-am install-exec \
+ install-exec-am install-info install-info-am install-man \
+ install-man1 install-man5 install-strip installcheck \
+ installcheck-am installdirs maintainer-clean \
+ maintainer-clean-generic mostlyclean mostlyclean-generic pdf \
+ pdf-am ps ps-am uninstall uninstall-am uninstall-info-am \
+ uninstall-man uninstall-man1 uninstall-man5
+
+
+@SET_MAKE@
-all:
+lg.conf.5: Makefile $(srcdir)/lg.conf.5.in
+ rm -f lg.conf.5 lg.conf.5.tmp; \
+ $(auto_edit) $(srcdir)/lg.conf.5.in >lg.conf.5.tmp; \
+ mv lg.conf.5.tmp lg.conf.5
-distclean: clean
+lg_intro.1: Makefile $(srcdir)/lg_intro.1.in
+ rm -f lg_intro.1 lg_intro.1.tmp; \
+ $(auto_edit) $(srcdir)/lg_intro.1.in >lg_intro.1.tmp; \
+ mv lg_intro.1.tmp lg_intro.1
+rancid.conf.5: Makefile $(srcdir)/rancid.conf.5.in
+ rm -f rancid.conf.5 rancid.conf.5.tmp; \
+ $(auto_edit) $(srcdir)/rancid.conf.5.in >rancid.conf.5.tmp; \
+ mv rancid.conf.5.tmp rancid.conf.5
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
diff --git a/man/clogin.1 b/man/clogin.1
index a888d99..48e53ea 100644
--- a/man/clogin.1
+++ b/man/clogin.1
@@ -1,6 +1,6 @@
.\"
.hys 50
-.TH "clogin" "1" "13 Jan 2001"
+.TH "clogin" "1" "6 Jan 2004"
.SH NAME
clogin \- Cisco/Foundry login script
.SH SYNOPSIS
@@ -50,22 +50,33 @@ router
is an
.BR expect (1)
script to automate the process of logging into a Cisco router,
-catalyst switch, Extreme switch, or Redback router. There are
-complementary scripts for
+catalyst switch, Extreme switch, Juniper ERX/E-series, Procket Networks,
+or Redback router.
+There are complementary scripts for
Alteon,
Bay Networks (nortel),
ADC-kentrox EZ-T3 mux,
Foundry,
HP Procurve Switches,
-and Juniper,
+Hitachi Routers,
+Juniper Networks,
+Netscreen firewalls,
+Netscaler,
+Riverstone,
+and Lucent TNT,
named
.B alogin,
.B blogin,
.B elogin,
.B flogin,
.B hlogin,
-and
+.B htlogin,
.B jlogin,
+.B nlogin,
+.B nslogin,
+.B rivlogin,
+and
+.B tntlogin,
respectively.
.PP
.B clogin
@@ -89,7 +100,7 @@ should be quoted to avoid shell expansion.
.B \-E
Specifies a variable to pass through to scripts (\-s). For example, the
command-line option \-Efoo=bar will produce a global variable by the name
-Efoo with the initial value "foo".
+Efoo with the initial value "bar".
.\"
.TP
.B \-e
@@ -118,8 +129,13 @@ The filename of an
script which will be sourced after the login is successful and is expected
to return control to
.B clogin,
-with the connection to the router intact, when it is done. Example script(s)
-can be found in util/*.exp.
+with the connection to the router intact, when it is done. Note that
+.B clogin
+disables
+.IR log_user
+of
+.BR expect (1).
+Example script(s) can be found in util/*.exp.
.\"
.TP
.B \-t
@@ -209,16 +225,33 @@ configuration file.
.SH "SEE ALSO"
.BR cloginrc (5),
.BR expect (1)
+.\"
.SH CAVEATS
The HP Procurve switches that are Foundry OEMs use flogin, not hlogin.
+.PP
+The Extreme is supported by
+.B clogin,
+but it has no concept of an "enabled" privilege level. You must
+set autoenable for these devices in your
+.IR .cloginrc .
+.\"
.SH BUGS
+Do not use greater than (>) or pound sign (#) in device banners. These
+are the normal terminating characters of device prompts and the login
+scripts need to locate the initial prompt. Afterward, the full prompt
+is collected and makes a more precise match so that the scripts know
+when the device is ready for the next command.
+.PP
All these login scripts for separate devices should be rolled into one.
+This goal is exceedingly difficult.
.PP
-The HP Procurve switch CLI relies heavily upon curses based cursor/screen
+The HP Procurve switch CLI relies heavily upon curses for cursor/screen
manipulation and assumes a vt100 terminal type. They do not provide a way
to set a different terminal type or adjust this behavior. The resulting
escape codes make automating interaction with these devices very difficult
-or impossible. Therefore, bin/hpfilter is used by hlogin to filter these.
-While this works for rancid's collection, there are side effects for
-interactive logins via hlogin; most of which are formatting annoyances that
-may be remedied by hitting CTRL-R to reprint the current line.
+or impossible. Thus bin/hpuifilter, which must be found in the PATH, is used
+by hlogin to filter these. While this works for rancid's collection,
+there are side effects for interactive logins via hlogin; most of which are
+formatting annoyances that may be remedied by typing CTRL-R to reprint the
+current line.
+.PP
diff --git a/man/cloginrc.5 b/man/cloginrc.5
index e91bfea..36709c2 100644
--- a/man/cloginrc.5
+++ b/man/cloginrc.5
@@ -1,6 +1,8 @@
.\"
+.\" $Id: cloginrc.5,v 1.31 2004/01/11 01:53:10 heas Exp $
+.\"
.hys 50
-.TH "cloginrc" "5" "22 Jan 2001"
+.TH "cloginrc" "5" "11 Jan 2004"
.SH NAME
\.cloginrc \- clogin configuration file
.SH DESCRIPTION
@@ -12,8 +14,13 @@ contains configuration information for
.BR elogin (1),
.BR flogin (1),
.BR hlogin (1),
-and
+.BR htlogin (1),
.BR jlogin (1),
+.BR nlogin (1),
+.BR nslogin (1),
+.BR rivlogin (1),
+and
+.BR tntlogin (1),
such as usernames, passwords, ssh encryption type, etc., and is read at
run-time.
.PP
@@ -33,11 +40,23 @@ include {<file>}
.fi
.in -1i
.PP
+Note: the braces ({}) surrounding the values is significant when the values
+include TCL meta-characters. Best common practice is to always enclose the
+values in braces. If a value includes a (left or right) brace, it must
+be backslash-escaped, as in:
+.PP
+.in +1i
+.nf
+add user <hostname glob> {foo\\}bar}
+.fi
+.in -1i
+.PP
As
.B .cloginrc
-is searched for a directive for a hostname, it is always the first instance
-of a directive, whose hostname glob expression matches the hostname, that
-is used. For example; looking up the password for hostname foo in a
+is searched for a directive matching a hostname, it is always the first
+matching instance of a directive, one whose hostname glob expression matches
+the hostname, which is used. For example; looking up the "password"
+directive for hostname foo in a
.B .cloginrc
file containing
.sp
@@ -61,12 +80,6 @@ of the same unix group. See
and
.BR chmod (1)
for more information on ownership and file modes.
-.PP
-A sample
-.B .cloginrc
-file can be found in the top-level directory of the rancid distribution by the
-name
-.IR "cloginrc.sample" .
.SH DIRECTIVES
The accepted directives are (alphabetically):
.PP
@@ -148,6 +161,8 @@ to first attempt an ssh connection to the device and if that were
to fail with connection refused, a telnet connection to port 3000
would be tried, and then a rsh connection.
.sp
+Note that not all platforms support all of these connection methods.
+.sp
Default: {telnet} {ssh}
.\"
.TP
@@ -196,7 +211,7 @@ Specifies a username
.IR clogin
should use if or when prompted for one.
.sp
-Default: $USER, ie: your Unix username.
+Default: $USER (or $LOGNAME), i.e.: your Unix username.
.\"
.TP
.B add userpassword <router name glob> {<user password>}
@@ -231,17 +246,31 @@ file that is shared among a group of folks.
If <file> is not a full pathname, $HOME/ will be prepended.
.sp
Example: include {.cloginrc.group}
+.\"
+.TP
+.B add sshcmd {<ssh>}
+<ssh> is the name of the ssh executable. OpenSSH uses a command-line
+option to specify the protocol version, but other implementations use
+a separate binary such as "ssh1".
+.B sshcmd
+allows this to be adjusted as necessary for the local environment.
+.sp
+Default: ssh
.El
.SH FILES
.br
.nf
.\" set tabstop to longest possible filename, plus a wee bit
.ta \w'xHOME/xcloginrc 'u
-\fI$HOME/.cloginrc\fR Configuration file described here.
+\fI$HOME/.cloginrc\fR Configuration file described here.
+.\"
+\fIshare/rancid/cloginrc.sample\fR A sample \fB.cloginrc\fR.
+.\"
.SH ERRORS
.B .cloginrc
is interpreted directly by Tcl, so its syntax follows that of Tcl. Errors
may produce quite unexpected results.
.SH "SEE ALSO"
.BR clogin (1),
-.BR glob (3)
+.BR glob (3),
+.BR tclsh (1)
diff --git a/man/control_rancid.1 b/man/control_rancid.1
index e6ca10e..f502fb0 100644
--- a/man/control_rancid.1
+++ b/man/control_rancid.1
@@ -1,10 +1,10 @@
.\"
.hys 50
-.TH "control_rancid" "1" "22 Jan 2001"
+.TH "control_rancid" "1" "7 Jan 2004"
.SH NAME
control_rancid \- run rancid for devices of a group
.SH SYNOPSIS
-.B create_cvs
+.B control_rancid
[\c
.BI \-m\ \c
mail_rcpt]\ \c
@@ -44,10 +44,10 @@ with <group name>/<device name> rather than just the group name alone.
.PP
.B control_rancid
is normally (and best) run via
-.BR do-diffs (1)
+.BR rancid-run (1)
which provides a locking mechanism on a group basis.
.\"
-.SH SEE ALSO
-.BR do-diffs (1),
-.BR env (5),
+.SH "SEE ALSO"
+.BR rancid-run (1),
+.BR rancid.conf (5),
.BR router.db (5)
diff --git a/man/cssrancid.1 b/man/cssrancid.1
new file mode 100644
index 0000000..b4633ee
--- /dev/null
+++ b/man/cssrancid.1
@@ -0,0 +1 @@
+.so man1/rancid.1
diff --git a/man/fnrancid.1 b/man/fnrancid.1
new file mode 100644
index 0000000..b4633ee
--- /dev/null
+++ b/man/fnrancid.1
@@ -0,0 +1 @@
+.so man1/rancid.1
diff --git a/man/htlogin.1 b/man/htlogin.1
new file mode 100644
index 0000000..4c83247
--- /dev/null
+++ b/man/htlogin.1
@@ -0,0 +1 @@
+.so man1/clogin.1
diff --git a/man/htrancid.1 b/man/htrancid.1
new file mode 100644
index 0000000..b4633ee
--- /dev/null
+++ b/man/htrancid.1
@@ -0,0 +1 @@
+.so man1/rancid.1
diff --git a/man/jerancid.1 b/man/jerancid.1
new file mode 100644
index 0000000..b4633ee
--- /dev/null
+++ b/man/jerancid.1
@@ -0,0 +1 @@
+.so man1/rancid.1
diff --git a/man/lg.conf.5.in b/man/lg.conf.5.in
index b5d5423..a2058d1 100644
--- a/man/lg.conf.5.in
+++ b/man/lg.conf.5.in
@@ -1,6 +1,6 @@
.\"
.hys 50
-.TH "lg.conf" "5" "22 Jan 2001"
+.TH "lg.conf" "5" "7 Jan 2004"
.SH NAME
lg.conf \- looking glass configuration file
.SH DESCRIPTION
@@ -36,7 +36,7 @@ Default: ./tmp
.sp
Note that the default is relative to the directory where
.IR lg.cgi
-runs in the server's document root (eg: /usr/local/www/data/lg/tmp).
+runs in the server's document root (e.g.: /usr/local/www/data/lg/tmp).
.\"
.TP
.B LG_CACHE_TIME
@@ -53,7 +53,7 @@ Defines the location of the
that the looking glass should use. The path may be relative to the directory
where the CGI scripts run in the server's document root.
.sp
-Default: @prefix@/.cloginrc
+Default: $HOME/.cloginrc
.sp
Note that the .cloginrc must be readable by the user or group that will be
running the CGI and that
@@ -80,7 +80,7 @@ Example: $LG_INFO="For Support contact <a href=mailto:webmaster\@localhost>webma
.\"
.TP
.B LG_LOG
-Defines the fully qualified path name (ie: begins with '/') for the log file
+Defines the fully qualified path name (i.e.: begins with '/') for the log file
or the
.BR syslog (3)
facility to use for logging. For syslog, the argument is the lowercase name
@@ -100,14 +100,14 @@ format. It lists the devices that should be available to the looking glass
users. Only those devices of supported types and with state 'up' are made
available. If not defined and the default file does not exist, the looking
glass will compile a list from the router.db files of all the groups present
-in rancid, that is, the list will be a concatenation of $BASEDIR/*/router.db.
-.sp
-Default: @prefix@/util/lg/router.db
+in rancid, that is, the list will be a concatenation of the available
+.IR router.db (5)
+files.
.sp
Note that if the concatenation method is used, it may be necessary to alter
the mode of the router.db files in the rancid group directories, since rancid's
default umask is 027 (see
-.BR env (5)).
+.BR rancid.conf (5)).
.\"
.TP
.B LG_STRIP
@@ -117,17 +117,24 @@ this is a SECURITY CONCERN! However, this output can be very useful for
debugging clogin problems.
.\"
.TP
+.B LG_STYLE
+Defines the URL of a style sheet to be used for HTML formatting.
+.\"
+.TP
.B PATH
Is a colon separated list of directory pathnames in the file system
where rancid's login scripts,
.IR clogin (1)
-etc. )
+etc.)
and programs needed within these, such as
.IR telnet (1),
are located.
Its value is set by configure. Should it be necessary to modify PATH,
note that it must include $BASEDIR/bin (see above).
.\"
+.TP
+Queries ...................................
+.\"
.El
.\"
.SH ENVIRONMENT
@@ -148,19 +155,23 @@ is interpreted directly by
so its syntax follows that of perl. Syntax errors may produce quite unexpected
results.
.SH FILES
-.Bl -tag -width .BASEDIR/bin/ENV -compact
+.Bl -tag -width @sysconfdir@/rancid.conf -compact
.TP
-.B $BASEDIR/util/lg/lg.conf
-Configuration file described here, where $BASEDIR is set at the time that
-the rancid package was configured. In this installation, $BASEDIR is
-.IR @prefix@ .
+.B @sysconfdir@/lg.conf
+Configuration file described here.
.sp
.B lg.conf
is located by the value of the environment variable LG_CONF, in the CWD
-(current working directory), or rancid install directory ($BASEDIR/util/lg),
-in that order.
+(current working directory), or the sysconfdir defined when rancid was
+installed, in that order.
.El
-.SH SEE ALSO
+.SH "SEE ALSO"
.BR cloginrc (5),
.BR lg_intro (1),
.BR router.db (5)
+.\"
+.SH HISTORY
+In RANCID releases prior to 2.3,
+.B lg.conf
+was located in the util/lg sub-directory of the install path. This was
+changed to be more consistent with common file location practices.
diff --git a/man/lg_intro.1.in b/man/lg_intro.1.in
index b6ced11..a9a72c4 100644
--- a/man/lg_intro.1.in
+++ b/man/lg_intro.1.in
@@ -47,7 +47,7 @@ Besides
.BR lg.conf (5),
additional instructions for setting up the looking glass can be found
in the README file under
-.IR @prefix@/util/lg .
+.IR @pkgdatadir@/README.lg .
.PP
Note that the looking glass scripts require a few perl modules not
included with rancid. Rancid's configure process does not check for
diff --git a/man/nlogin.1 b/man/nlogin.1
new file mode 100644
index 0000000..4c83247
--- /dev/null
+++ b/man/nlogin.1
@@ -0,0 +1 @@
+.so man1/clogin.1
diff --git a/man/nrancid.1 b/man/nrancid.1
new file mode 100644
index 0000000..b4633ee
--- /dev/null
+++ b/man/nrancid.1
@@ -0,0 +1 @@
+.so man1/rancid.1
diff --git a/man/nslogin.1 b/man/nslogin.1
new file mode 100644
index 0000000..4c83247
--- /dev/null
+++ b/man/nslogin.1
@@ -0,0 +1 @@
+.so man1/clogin.1
diff --git a/man/nsrancid.1 b/man/nsrancid.1
new file mode 100644
index 0000000..b4633ee
--- /dev/null
+++ b/man/nsrancid.1
@@ -0,0 +1 @@
+.so man1/rancid.1
diff --git a/man/par.1 b/man/par.1
index 535246a..7f4ebd4 100644
--- a/man/par.1
+++ b/man/par.1
@@ -1,6 +1,6 @@
.\"
.hys 50
-.TH "par" "1" "17 Nov 2001"
+.TH "par" "1" "9 Jan 2004"
.SH NAME
par \- parallel command processing
.SH SYNOPSIS
@@ -22,14 +22,14 @@ file
takes a list of files to run a command on. The first line of each file begins
with a colon (:) or a pound-sign (#). If a colon, the remainder of the
line is a command to run for each of the subsequent lines. If a pound-sign,
-then each subsequent line is a command, unless the
+then each subsequent line is a (self-contained) command, unless the
.B \-c
option was specified, in which case it operates as if the argument to
.B \-c
had followed a colon on the first line.
.PP
In each of the cases where the lines of the file following the first are
-not commands (ie: colon or -c), instances of open-close braces ({}) in the
+not commands (i.e.: colon or -c), instances of open-close braces ({}) in the
command will be replaced by these values.
.PP
For example, a inputfile whose contents is:
@@ -61,7 +61,7 @@ The command-line options are as follows:
.TP
.B \-c
Command to be run on each of the arguments following the command-line
-options, when the first line of the input file(s) begin with a pound-sign
+options, where the first line of the input file(s) begins with a pound-sign
(#).
.\"
.TP
@@ -70,7 +70,7 @@ Print debugging information on standard error (stderr).
.\"
.TP
.B \-i
-Run commands interactively though (multiple)
+Run commands interactively through (multiple)
.BR xterm (1)
processes.
.\"
diff --git a/man/prancid.1 b/man/prancid.1
new file mode 100644
index 0000000..b4633ee
--- /dev/null
+++ b/man/prancid.1
@@ -0,0 +1 @@
+.so man1/rancid.1
diff --git a/man/create_cvs.1 b/man/rancid-cvs.1
index 1e57459..2cb34bd 100644
--- a/man/create_cvs.1
+++ b/man/rancid-cvs.1
@@ -1,13 +1,13 @@
.\"
.hys 50
-.TH "create_cvs" "1" "13 Jan 2001"
+.TH "rancid-cvs" "1" "7 Jan 2004"
.SH NAME
-create_cvs \- initialize CVS and rancid group files and directories
+rancid-cvs \- initialize CVS and rancid group files and directories
.SH SYNOPSIS
-.B create_cvs
+.B rancid-cvs
[group [group ...]]
.SH DESCRIPTION
-.B create_cvs
+.B rancid-cvs
is a
.IR sh (1)
script to create the directories,
@@ -17,21 +17,21 @@ and
directories necessary for a rancid group.
.\"
.PP
-.B create_cvs
+.B rancid-cvs
reads
-.BR env (5)
+.BR rancid.conf (5)
to configure itself. Then proceeds with the initialization first of the
.BR cvs (1)
repository, if necessary, and then for each of the rancid groups listed on
the command-line or those in the variable
.I LIST_OF_GROUPS
from
-.BR env (5),
+.BR rancid.conf (5),
if the argument is omitted.
.\"
.PP
Running
-.B create_cvs
+.B rancid-cvs
for groups which already exist will not cause problems. If the group's
directory already exists, the
.BR cvs (1)
@@ -43,12 +43,12 @@ already exists, it will be left as-is.
The best method for adding groups is add the group name to
.I LIST_OF_GROUPS
in
-.BR env (5),
+.BR rancid.conf (5),
then run
-.B create_cvs. Do not create the directories manually, allow create_cvs
+.B rancid-cvs. Do not create the directories manually, allow rancid-cvs
to do it.
.\"
-.SH SEE ALSO
+.SH "SEE ALSO"
.BR cvs (1),
-.BR env (5),
+.BR rancid.conf (5),
.BR router.db (5)
diff --git a/man/do-diffs.1 b/man/rancid-run.1
index 97b9664..3e99b26 100644
--- a/man/do-diffs.1
+++ b/man/rancid-run.1
@@ -1,10 +1,10 @@
.\"
.hys 50
-.TH "do-diffs" "1" "13 Jan 2001"
+.TH "rancid-run" "1" "7 Jan 2004"
.SH NAME
-do-diffs \- run rancid for each of the groups
+rancid-run \- run rancid for each of the groups
.SH SYNOPSIS
-.B do-diffs
+.B rancid-run
[\c
.BI \-m\ \c
mail_rcpt]\ \c
@@ -13,16 +13,16 @@ mail_rcpt]\ \c
device_name]\ \c
[group [group ...]]
.SH DESCRIPTION
-.B do-diffs
+.B rancid-run
is a
.IR sh (1)
script to run
.IR rancid (1)
for a set of rancid group(s).
.PP
-.B do-diffs
+.B rancid-run
reads
-.BR env (5)
+.BR rancid.conf (5)
to configure itself, then uses
.IR control_rancid (1)
to run
@@ -31,12 +31,12 @@ for each rancid group. The set of rancid groups can either be provided
as command-line arguments or via the
.I LIST_OF_GROUPS
variable in
-.BR env (5),
+.BR rancid.conf (5),
if the group argument is omitted.
.PP
A lock file is maintained per-group to prevent simultaneous runs for a given
group by
-.IR do-diffs (1).
+.IR rancid-run (1).
The lock file will be named
.IR .<group>.run.lock
and will be located in
@@ -44,18 +44,18 @@ and will be located in
(see below).
.PP
A log file is produced under
-.IR $BASEDIR/logs
+.IR $LOGDIR/logs
for each rancid group processed. The file name will be <group>.YYYYMMDD.HHMMSS
(year month day . hour minute second).
.PP
-.B do-diffs
+.B rancid-run
is normally used to run rancid from
.BR cron (8).
For example:
.PP
.in +1i
.nf
-0 * * * * /usr/local/rancid/bin/do-diffs
+0 * * * * /usr/local/rancid/bin/rancid-run
.fi
.in -1i
.\"
@@ -82,9 +82,9 @@ option alters the subject line of the diff mail. It will begin
with <group name>/<device name> rather than just the group name alone.
.\"
.SH ENVIRONMENT
-.B do-diffs
+.B rancid-run
utilizes the following environment variables from
-.BR env (5).
+.BR rancid.conf (5).
.\"
.TP
.B BASEDIR
@@ -114,11 +114,11 @@ device with 'clogin hostname', and so on.
.BR
.SH FILES
.TP
-.B $BASEDIR/bin/env
-.B do-diffs
+.B $BASEDIR/etc/rancid.conf
+.B rancid-run
configuration file.
.El
-.SH SEE ALSO
+.SH "SEE ALSO"
.BR control_rancid (1),
-.BR router.db (5),
-.BR env (5)
+.BR rancid.conf (5),
+.BR router.db (5)
diff --git a/man/rancid.1 b/man/rancid.1
index fe8d618..15fca7d 100644
--- a/man/rancid.1
+++ b/man/rancid.1
@@ -1,6 +1,6 @@
.\"
.hys 50
-.TH "rancid" "1" "13 Jan 2001"
+.TH "rancid" "1" "6 Jan 2004"
.SH NAME
rancid \- Cisco configuration filter
.SH SYNOPSIS
@@ -26,28 +26,48 @@ For example, hostname.new.
There are complementary scripts for
Alteon WebOS switches,
Bay Networks (nortel),
-Cisco catalyst switch,
+Cisco catalyst switches,
+Cisco content services switches,
ADC-kentrox EZ-T3 mux,
Force10,
Foundry,
HP Procurve Switches,
-Juniper,
+Hitachi Routers,
+Juniper Networks E-series,
+Juniper Networks,
MRTd,
+Procket Networks,
+Riverstone,
Redback,
-and Extreme,
+Lucent TNT,
+Netscreen firewalls,
+Netscaler,
+Extreme,
+and Zebra routing software
named
.B arancid,
.B brancid,
.B cat5rancid,
+.B cssrancid,
.B erancid,
.B f10rancid,
+.B fnrancid,
.B francid,
.B hrancid,
+.B htrancid,
+.B jerancid,
.B jrancid,
.B mrancid,
+.B nrancid,
+.B nsrancid,
+.B prancid,
+.B rivrancid,
.B rrancid,
-and
+.B tntrancid,
+.B nrancid,
.B xrancid,
+and
+.B zrancid,
respectively.
.PP
The command-line options are as follows:
@@ -70,4 +90,20 @@ output it would normally collect from the device (
.SH "SEE ALSO"
.BR control_rancid (1),
.BR clogin (1),
-.BR env (5)
+.BR rancid.conf (5)
+.\"
+.SH "CAVEATS"
+For Catalyst switches running CatOS, type
+.B cat5,
+the prompt must end with '>'.
+.BR clogin (1)
+looks for '>' to determine when a login is successful. For example:
+.sp
+.in +1i
+.nf
+cat5k>
+cat5k> enable
+Password:
+cat5k> (enable)
+.fi
+.in -1i
diff --git a/man/env.5.in b/man/rancid.conf.5.in
index 99366c4..75adc87 100644
--- a/man/env.5.in
+++ b/man/rancid.conf.5.in
@@ -1,46 +1,51 @@
.\"
+.\" $Id: rancid.conf.5.in,v 1.9 2004/01/11 06:12:35 hank Exp $
+.\"
.hys 50
-.TH "env" "5" "22 Jan 2001"
+.TH "rancid.conf" "5" "7 Jan 2004"
.SH NAME
-env \- rancid environment configuration file
+rancid.conf \- rancid environment configuration file
.SH DESCRIPTION
-.B env
+.B rancid.conf
contains environment configuration information for
-.BR do-diffs (1)
+.BR rancid-run (1)
and
.BR rancid (1)
including shell PATH, list of rancid groups, etc. and is read by
-.BR do-diffs (1)
+.BR rancid-run (1)
at run-time.
.PP
The syntax of
-.B env
+.B rancid.conf
is that of
.IR sh (1).
-.B env
+.B rancid.conf
is used to set environment variables used by other rancid scripts to
effect their run-time behavior or to enable them to find their resources.
.PP
.SH VARIABLES
-The following variables are used (alphabetically):
+The following variables are used (listed alphabetically):
.PP
.Bl -tag -width flag
.\"
.TP
.B BASEDIR
-BASEDIR is the top-level directory where rancid is installed. Its value
-is set by configure and should be modified if rancid is moved to a new
-location in the file system without re-installing from the distribution.
+BASEDIR is the directory where
+.B rancid-run's
+log directory and where the CVS repository and rancid collection group
+directories will be placed. Its value is configure's localstatedir and
+should be modified if rancid is moved to a new location in the file
+system without re-installing from the distribution.
.sp
-Default: @prefix@
+Default: @localstatedir@
.\"
.TP
.B CVSROOT
.IR cvs (1)
and
-.IR create_cvs (1)
+.IR rancid-cvs (1)
use this environment variable to locate the CVS repository. It should
-not be necessary to alter CVSROOT.
+not be necessary to alter it.
.sp
Default: $BASEDIR/CVS
.\"
@@ -62,14 +67,14 @@ does not affect the handling of SNMP community strings. see
below.
.sp
Note: passwords whose value cycles and would produce erroneous diffs
-are always filtered (eg: Alteon passwords).
+are always filtered (e.g.: Alteon passwords).
.\"
.TP
.B LIST_OF_GROUPS
Defines a list of group names of routers separated by white-space. These
names become the directory names in $BASEDIR which contain the data
for that set of devices.
-.BR do-diffs (1)
+.BR rancid-run (1)
also uses this variable to determine which device groups it should collect.
Choose these names to be descriptive of the set of devices and do not use
spaces, unprintable characters, etc.
@@ -78,7 +83,7 @@ Example: LIST_OF_GROUPS="UofO USFS"
.sp
Two groups are defined; UofO (University of Oregon) and USFS (US Forest
Service). Each will have a directory created (see
-.IR create_cvs (1))
+.IR rancid-cvs (1))
$BASEDIR/UofO and $BASEDIR/USFS respectively, which will contain their data.
.sp
Each group must also have aliases for the administrative and diff recipients
@@ -89,14 +94,27 @@ For example:
.in +1i
.nf
@MAILPLUS@uofo: frank
-@MAILPLUS@admin-uofo: joe,bob
+@ADMINMAILPLUS@uofo: joe,bob
@MAILPLUS@usfs: frank
-@MAILPLUS@admin-usfs: joe,bob
+@ADMINMAILPLUS@usfs: joe,bob
.fi
.sp
.in -1i
.\"
.TP
+.B LOCKTIME
+Defines the number of hours a group's lock file may age before rancid
+starts to complain about a hung collection. The default is 4 hours.
+.\"
+.TP
+.B LOGDIR
+Directory where
+.B rancid-run
+places log files.
+.sp
+Default: $BASEDIR/logs
+.\"
+.TP
.B NOCOMMSTR
If set,
.IR rancid (1)
@@ -120,7 +138,9 @@ Specified as a number of hours, OLDTIME defines how many hours should pass
since a successful collection of a device's configuration and when
.IR control_rancid (1)
should start complaining about failures. The value should be greater than
-the number of hours between do-diffs cron runs.
+the number of hours between
+.B rancid-run
+cron runs.
.sp
Default: 4
.\"
@@ -148,12 +168,18 @@ and
scripts should look for the programs that it needs, such as
.IR telnet (1).
Its value is set by configure. Should it be necessary to modify PATH,
-note that it must include $BASEDIR/bin (see above).
+note that it must include @bindir@.
.\"
.TP
.B TERM
Some Unix utilities require TERM, the terminal type, to be set to a sane
-value. The default should suffice.
+value. Some clients, such as
+.IR telnet (1)
+and
+.IR ssh (1) ,
+communicate this to the server (i.e.: the remote device), thus this can
+affect the behavior of login sessions on a device. The default should
+suffice.
.sp
Default: network
.\"
@@ -171,19 +197,28 @@ present in the environment of child processes, each must be exported. See
.IR sh (1)
for more information on the built-in command export.
.SH ERRORS
-.B env
+.B rancid.conf
is interpreted directly by
.IR sh (1),
so its syntax follows that of the bourne shell. Errors
may produce quite unexpected results.
.SH FILES
-.Bl -tag -width .BASEDIR/bin/ENV -compact
+.Bl -tag -width @sysconfdir@/rancid.conf -compact
.TP
-.B $BASEDIR/bin/env
+.B @sysconfdir@/rancid.conf
Configuration file described here.
.El
-.SH SEE ALSO
+.\"
+.SH "SEE ALSO"
.BR control_rancid (1),
-.BR create_cvs (1),
-.BR do-diffs (1),
-.BR rancid (1)
+.BR rancid (1),
+.BR rancid-cvs (1),
+.BR rancid-run (1)
+.\"
+.SH HISTORY
+In RANCID releases prior to 2.3,
+.B rancid.conf
+was named
+.B env
+and located in the bin directory. This was changed to be more consistent
+with common file location practices.
diff --git a/man/rancid_intro.1 b/man/rancid_intro.1
index d180019..cf4c571 100644
--- a/man/rancid_intro.1
+++ b/man/rancid_intro.1
@@ -1,14 +1,18 @@
.\"
+.\" $Id: rancid_intro.1,v 1.27 2004/01/11 00:43:19 heas Exp $
+.\"
.hys 50
-.TH "rancid_intro" "1" "22 Jan 2001"
+.TH "rancid_intro" "1" "7 Jan 2004"
.SH NAME
rancid_intro \- introduction to the Really Awesome New Cisco confIg Differ
.SH INTRODUCTION
.B rancid
is really more than just a Cisco configuration differ. It handles several
different device's configurations; currently including Alteon, Bay Networks
-(Nortel), Cisco, Extreme, Force10, Foundry, HP Procurve switches,
-Juniper, Redback, MRTd daemon, and the ADC-Kentrox EZ-T3 mux.
+(Nortel), Cisco, Extreme, Force10, Foundry, HP Procurve switches, Juniper
+Routers and edge (ERX) routers, Redback, MRTd daemon, Lucent TNT, Netscalar
+load balancers, Netscreen firewalls, Zebra routing software, and the
+ADC-Kentrox EZ-T3 mux.
.PP
.B rancid
uses an expect script to login to each of a list of devices and run a set of
@@ -18,15 +22,17 @@ unwanted or security related data such as chassis temperature and easily
reverse-able passwords.
.PP
Named after the device's name in the group's configuration file (\c
-.B router.db\c
-), the resulting files are saved in the directory <group>/configs. Except for
+.IR router.db ),
+the resulting files are saved in the directory <group>/configs. Except for
the data filtered from the configuration file for security reasons, such as
reversable passwords, these files are suitable for loading directly to restore
a lost configuration. See
-.BR env (5)
-for more information on <group>'s.
+.BR rancid.conf (5)
+for more information on <group>s.
.PP
-After filtering, a uni-diff (see diff(1)) of the result is produced
+After filtering, a uni-diff (see
+.BR diff (1))
+of the result is produced
for each of the devices in a group against that of the previous run of
.B rancid
and is e-mailed to that group's mail list, "rancid-<group>". This e-mail
@@ -75,14 +81,12 @@ the router, it could just as easily be that the card crashed so the RP
can not communicate with it to collect information.
.SH "GETTING STARTED"
Installation instructions are included in the distribution's top-level
-directory in the README file. Once the installation is complete, start
-by reading the man pages listed below or follow the basic instructions
-included in the README file.
+directory in the README file (which will be installed in share/rancid).
+Once the installation is complete, start by reading the man pages listed
+below or follow the basic instructions included in the README file.
.PP
See http://www.shrubbery.net/rancid for information on new versions,
mail lists, etc.
-.B rancid
-can be retrieved from ftp://ftp.shrubbery.net/pub/rancid.
.SH "ADDING NEW GROUPS"
Follow this procdure for adding new groups:
.TP
@@ -90,26 +94,26 @@ o
Update the
.IR LIST_OF_GROUPS
variable in
-.IR bin/env
+.IR etc/rancid.conf
(see
-.BR env (5)).
+.BR rancid.conf (5)).
.TP
o
Run
-.BR create_cvs (1).
+.BR rancid-cvs (1).
.TP
o
Update the system's mail aliases file
-.IR /etc/aliases (
-see
-.BR env (5)).
+.IR /etc/aliases
+(see
+.BR rancid.conf (5)).
.\"
.SH "SEE ALSO"
-.BR cloginrc (5),
.BR clogin (1),
+.BR cloginrc (5),
.BR control_rancid (1),
-.BR env (5),
-.BR do-diffs (1),
.BR lg_intro (1),
-.BR router.db (5) ,
-.BR rancid (1)
+.BR rancid (1),
+.BR rancid-run (1),
+.BR rancid.conf (5),
+.BR router.db (5)
diff --git a/man/rivlogin.1 b/man/rivlogin.1
new file mode 100644
index 0000000..4c83247
--- /dev/null
+++ b/man/rivlogin.1
@@ -0,0 +1 @@
+.so man1/clogin.1
diff --git a/man/rivrancid.1 b/man/rivrancid.1
new file mode 100644
index 0000000..b4633ee
--- /dev/null
+++ b/man/rivrancid.1
@@ -0,0 +1 @@
+.so man1/rancid.1
diff --git a/man/router.db.5 b/man/router.db.5
index a568243..8261556 100644
--- a/man/router.db.5
+++ b/man/router.db.5
@@ -1,6 +1,6 @@
.\"
.hys 50
-.TH "router.db" "5" "22 Jan 2001"
+.TH "router.db" "5" "7 Jan 2004"
.SH NAME
router.db \- rancid group configuration file
.SH DESCRIPTION
@@ -55,13 +55,25 @@ An Alteon WebOS switches.
A Bay Networks router.
.TP
.B cat5
-A cisco catalyst series 5000 and 4000 switches (ie: running the catalyst OS,
+A Cisco catalyst series 5000 and 4000 switches (i.e.: running the catalyst OS,
not IOS).
.TP
.B cisco
-A cisco router, PIX, or switch such as the 3500XL or 6000 running IOS (or
+A Cisco router, PIX, or switch such as the 3500XL or 6000 running IOS (or
IOS-like) OS.
.TP
+.B css
+A Cisco content services switch.
+.TP
+.ID 15n
+.B enterasys
+An enterasys NAS. This is currently an alias for the
+.B riverstone
+device type.
+.TP
+.B erx
+A Juniper E-series edge router.
+.TP
.B extreme
An Extreme switch.
.TP
@@ -76,6 +88,9 @@ A Foundry router, switch, or router-switch. This includes HP
Procurve switches that are OEMs of Foundry products, such as the
HP9304M.
.TP
+.B hitachi
+A Hitachi routers.
+.TP
.B hp
A HP Procurve switch such as the 2524 or 4108 procurve switches. Also see the
.B foundry
@@ -88,8 +103,28 @@ A Juniper router.
A host running the (merit) MRTd daemon.
.TP
.ID 15n
+.B netscalar
+A Netscalar load balancer.
+.TP
+.ID 15n
+.B netscreen
+A Netscreen firewall.
+.TP
+.ID 15n
.B redback
A Redback router, NAS, etc.
+.TP
+.ID 15n
+.B riverstone
+A Riverstone NAS or Cabletron (starting with version ~9.0.3) router.
+.TP
+.ID 15n
+.B tnt
+A lucent TNT.
+.TP
+.ID 15n
+.B zebra
+Zebra routing software.
.RE
.\"
.TP
@@ -119,7 +154,7 @@ Freeform string to describe the current state of the router.
A ``#'' at the begining of a line is a comment; the entire line is
ignored.
.PP
-If you delete a device from the
+If a device is deleted from the
.B router.db
file, then
.B rancid
@@ -139,9 +174,9 @@ Attic directory (using
Configuration file described here, where <group> is a device group name
defined in the variable
.I LIST_OF_GROUPS
-within \fI$BASEDIR/bin/env\fR.
+within \fI$BASEDIR/etc/rancid.conf\fR.
.El
-.SH SEE ALSO
+.SH "SEE ALSO"
.BR control_rancid (1),
-.BR env (5),
-.BR rancid (1)
+.BR rancid (1),
+.BR rancid.conf (5)
diff --git a/man/tntlogin.1 b/man/tntlogin.1
new file mode 100644
index 0000000..4c83247
--- /dev/null
+++ b/man/tntlogin.1
@@ -0,0 +1 @@
+.so man1/clogin.1
diff --git a/man/tntrancid.1 b/man/tntrancid.1
new file mode 100644
index 0000000..b4633ee
--- /dev/null
+++ b/man/tntrancid.1
@@ -0,0 +1 @@
+.so man1/rancid.1
diff --git a/man/zrancid.1 b/man/zrancid.1
new file mode 100644
index 0000000..b4633ee
--- /dev/null
+++ b/man/zrancid.1
@@ -0,0 +1 @@
+.so man1/rancid.1
diff --git a/missing b/missing
index 7789652..e7ef83a 100755
--- a/missing
+++ b/missing
@@ -1,7 +1,11 @@
#! /bin/sh
# Common stub for a few missing GNU programs while installing.
-# Copyright (C) 1996, 1997 Free Software Foundation, Inc.
-# Franc,ois Pinard <pinard@iro.umontreal.ca>, 1996.
+
+scriptversion=2003-09-02.23
+
+# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003
+# Free Software Foundation, Inc.
+# Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -18,11 +22,48 @@
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
# 02111-1307, USA.
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
if test $# -eq 0; then
echo 1>&2 "Try \`$0 --help' for more information"
exit 1
fi
+run=:
+
+# In the cases where this matters, `missing' is being run in the
+# srcdir already.
+if test -f configure.ac; then
+ configure_ac=configure.ac
+else
+ configure_ac=configure.in
+fi
+
+msg="missing on your system"
+
+case "$1" in
+--run)
+ # Try to run requested program, and just exit if it succeeds.
+ run=
+ shift
+ "$@" && exit 0
+ # Exit code 63 means version mismatch. This often happens
+ # when the user try to use an ancient version of a tool on
+ # a file that requires a minimum version. In this case we
+ # we should proceed has if the program had been absent, or
+ # if --run hadn't been passed.
+ if test $? = 63; then
+ run=:
+ msg="probably too old"
+ fi
+ ;;
+esac
+
+# If it does not exist, or fails to run (possibly an outdated version),
+# try to emulate it.
case "$1" in
-h|--h|--he|--hel|--help)
@@ -35,6 +76,7 @@ error status if there is no known handling for PROGRAM.
Options:
-h, --help display this help and exit
-v, --version output version information and exit
+ --run try to run the given command, and emulate it if it fails
Supported PROGRAM values:
aclocal touch file \`aclocal.m4'
@@ -43,13 +85,17 @@ Supported PROGRAM values:
automake touch all \`Makefile.in' files
bison create \`y.tab.[ch]', if possible, from existing .[ch]
flex create \`lex.yy.c', if possible, from existing .c
+ help2man touch the output file
lex create \`lex.yy.c', if possible, from existing .c
makeinfo touch the output file
- yacc create \`y.tab.[ch]', if possible, from existing .[ch]"
+ tar try tar, gnutar, gtar, then tar without non-portable flags
+ yacc create \`y.tab.[ch]', if possible, from existing .[ch]
+
+Send bug reports to <bug-automake@gnu.org>."
;;
-v|--v|--ve|--ver|--vers|--versi|--versio|--version)
- echo "missing - GNU libit 0.0"
+ echo "missing $scriptversion (GNU Automake)"
;;
-*)
@@ -58,31 +104,46 @@ Supported PROGRAM values:
exit 1
;;
- aclocal)
+ aclocal*)
+ if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
+ # We have it, but it failed.
+ exit 1
+ fi
+
echo 1>&2 "\
-WARNING: \`$1' is missing on your system. You should only need it if
- you modified \`acinclude.m4' or \`configure.in'. You might want
+WARNING: \`$1' is $msg. You should only need it if
+ you modified \`acinclude.m4' or \`${configure_ac}'. You might want
to install the \`Automake' and \`Perl' packages. Grab them from
any GNU archive site."
touch aclocal.m4
;;
autoconf)
+ if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
+ # We have it, but it failed.
+ exit 1
+ fi
+
echo 1>&2 "\
-WARNING: \`$1' is missing on your system. You should only need it if
- you modified \`configure.in'. You might want to install the
+WARNING: \`$1' is $msg. You should only need it if
+ you modified \`${configure_ac}'. You might want to install the
\`Autoconf' and \`GNU m4' packages. Grab them from any GNU
archive site."
touch configure
;;
autoheader)
+ if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
+ # We have it, but it failed.
+ exit 1
+ fi
+
echo 1>&2 "\
-WARNING: \`$1' is missing on your system. You should only need it if
- you modified \`acconfig.h' or \`configure.in'. You might want
+WARNING: \`$1' is $msg. You should only need it if
+ you modified \`acconfig.h' or \`${configure_ac}'. You might want
to install the \`Autoconf' and \`GNU m4' packages. Grab them
from any GNU archive site."
- files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' configure.in`
+ files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}`
test -z "$files" && files="config.h"
touch_files=
for f in $files; do
@@ -95,10 +156,15 @@ WARNING: \`$1' is missing on your system. You should only need it if
touch $touch_files
;;
- automake)
+ automake*)
+ if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
+ # We have it, but it failed.
+ exit 1
+ fi
+
echo 1>&2 "\
-WARNING: \`$1' is missing on your system. You should only need it if
- you modified \`Makefile.am', \`acinclude.m4' or \`configure.in'.
+WARNING: \`$1' is $msg. You should only need it if
+ you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'.
You might want to install the \`Automake' and \`Perl' packages.
Grab them from any GNU archive site."
find . -type f -name Makefile.am -print |
@@ -106,9 +172,37 @@ WARNING: \`$1' is missing on your system. You should only need it if
while read f; do touch "$f"; done
;;
+ autom4te)
+ if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
+ # We have it, but it failed.
+ exit 1
+ fi
+
+ echo 1>&2 "\
+WARNING: \`$1' is needed, but is $msg.
+ You might have modified some files without having the
+ proper tools for further handling them.
+ You can get \`$1' as part of \`Autoconf' from any GNU
+ archive site."
+
+ file=`echo "$*" | sed -n 's/.*--output[ =]*\([^ ]*\).*/\1/p'`
+ test -z "$file" && file=`echo "$*" | sed -n 's/.*-o[ ]*\([^ ]*\).*/\1/p'`
+ if test -f "$file"; then
+ touch $file
+ else
+ test -z "$file" || exec >$file
+ echo "#! /bin/sh"
+ echo "# Created by GNU Automake missing as a replacement of"
+ echo "# $ $@"
+ echo "exit 0"
+ chmod +x $file
+ exit 1
+ fi
+ ;;
+
bison|yacc)
echo 1>&2 "\
-WARNING: \`$1' is missing on your system. You should only need it if
+WARNING: \`$1' $msg. You should only need it if
you modified a \`.y' file. You may need the \`Bison' package
in order for those modifications to take effect. You can get
\`Bison' from any GNU archive site."
@@ -138,7 +232,7 @@ WARNING: \`$1' is missing on your system. You should only need it if
lex|flex)
echo 1>&2 "\
-WARNING: \`$1' is missing on your system. You should only need it if
+WARNING: \`$1' is $msg. You should only need it if
you modified a \`.l' file. You may need the \`Flex' package
in order for those modifications to take effect. You can get
\`Flex' from any GNU archive site."
@@ -159,9 +253,39 @@ WARNING: \`$1' is missing on your system. You should only need it if
fi
;;
+ help2man)
+ if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
+ # We have it, but it failed.
+ exit 1
+ fi
+
+ echo 1>&2 "\
+WARNING: \`$1' is $msg. You should only need it if
+ you modified a dependency of a manual page. You may need the
+ \`Help2man' package in order for those modifications to take
+ effect. You can get \`Help2man' from any GNU archive site."
+
+ file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
+ if test -z "$file"; then
+ file=`echo "$*" | sed -n 's/.*--output=\([^ ]*\).*/\1/p'`
+ fi
+ if [ -f "$file" ]; then
+ touch $file
+ else
+ test -z "$file" || exec >$file
+ echo ".ab help2man is required to generate this page"
+ exit 1
+ fi
+ ;;
+
makeinfo)
+ if test -z "$run" && (makeinfo --version) > /dev/null 2>&1; then
+ # We have makeinfo, but it failed.
+ exit 1
+ fi
+
echo 1>&2 "\
-WARNING: \`$1' is missing on your system. You should only need it if
+WARNING: \`$1' is $msg. You should only need it if
you modified a \`.texi' or \`.texinfo' file, or any other file
indirectly affecting the aspect of the manual. The spurious
call might also be the consequence of using a buggy \`make' (AIX,
@@ -175,12 +299,51 @@ WARNING: \`$1' is missing on your system. You should only need it if
touch $file
;;
+ tar)
+ shift
+ if test -n "$run"; then
+ echo 1>&2 "ERROR: \`tar' requires --run"
+ exit 1
+ fi
+
+ # We have already tried tar in the generic part.
+ # Look for gnutar/gtar before invocation to avoid ugly error
+ # messages.
+ if (gnutar --version > /dev/null 2>&1); then
+ gnutar "$@" && exit 0
+ fi
+ if (gtar --version > /dev/null 2>&1); then
+ gtar "$@" && exit 0
+ fi
+ firstarg="$1"
+ if shift; then
+ case "$firstarg" in
+ *o*)
+ firstarg=`echo "$firstarg" | sed s/o//`
+ tar "$firstarg" "$@" && exit 0
+ ;;
+ esac
+ case "$firstarg" in
+ *h*)
+ firstarg=`echo "$firstarg" | sed s/h//`
+ tar "$firstarg" "$@" && exit 0
+ ;;
+ esac
+ fi
+
+ echo 1>&2 "\
+WARNING: I can't seem to be able to run \`tar' with the given arguments.
+ You may want to install GNU tar or Free paxutils, or check the
+ command line arguments."
+ exit 1
+ ;;
+
*)
echo 1>&2 "\
-WARNING: \`$1' is needed, and you do not seem to have it handy on your
- system. You might have modified some files without having the
+WARNING: \`$1' is needed, and is $msg.
+ You might have modified some files without having the
proper tools for further handling them. Check the \`README' file,
- it often tells you about the needed prerequirements for installing
+ it often tells you about the needed prerequisites for installing
this package. You may also peek at any GNU archive site, in case
some other package would contain this missing \`$1' program."
exit 1
@@ -188,3 +351,10 @@ WARNING: \`$1' is needed, and you do not seem to have it handy on your
esac
exit 0
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-end: "$"
+# End:
diff --git a/mkinstalldirs b/mkinstalldirs
index 78724ba..6504b74 100755
--- a/mkinstalldirs
+++ b/mkinstalldirs
@@ -1,40 +1,143 @@
#! /bin/sh
# mkinstalldirs --- make directory hierarchy
-# Author: Noah Friedman <friedman@prep.ai.mit.edu>
-# Created: 1993-05-16
-# Public domain
-# $Id: mkinstalldirs,v 1.1 2000/10/03 03:52:43 heas Exp $
+scriptversion=2003-11-08.23
+
+# Original author: Noah Friedman <friedman@prep.ai.mit.edu>
+# Created: 1993-05-16
+# Public domain.
+#
+# This file is maintained in Automake, please report
+# bugs to <bug-automake@gnu.org> or send patches to
+# <automake-patches@gnu.org>.
errstatus=0
+dirmode=""
+
+usage="\
+Usage: mkinstalldirs [-h] [--help] [--version] [-m MODE] DIR ...
+
+Create each directory DIR (with mode MODE, if specified), including all
+leading file name components.
+
+Report bugs to <bug-automake@gnu.org>."
+
+# process command line arguments
+while test $# -gt 0 ; do
+ case $1 in
+ -h | --help | --h*) # -h for help
+ echo "$usage"
+ exit 0
+ ;;
+ -m) # -m PERM arg
+ shift
+ test $# -eq 0 && { echo "$usage" 1>&2; exit 1; }
+ dirmode=$1
+ shift
+ ;;
+ --version)
+ echo "$0 $scriptversion"
+ exit 0
+ ;;
+ --) # stop option processing
+ shift
+ break
+ ;;
+ -*) # unknown option
+ echo "$usage" 1>&2
+ exit 1
+ ;;
+ *) # first non-opt arg
+ break
+ ;;
+ esac
+done
for file
do
- set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
- shift
+ if test -d "$file"; then
+ shift
+ else
+ break
+ fi
+done
+
+case $# in
+ 0) exit 0 ;;
+esac
+
+case $dirmode in
+ '')
+ if mkdir -p -- . 2>/dev/null; then
+ echo "mkdir -p -- $*"
+ exec mkdir -p -- "$@"
+ else
+ # On NextStep and OpenStep, the `mkdir' command does not
+ # recognize any option. It will interpret all options as
+ # directories to create, and then abort because `.' already
+ # exists.
+ test -d ./-p && rmdir ./-p
+ test -d ./-- && rmdir ./--
+ fi
+ ;;
+ *)
+ if mkdir -m "$dirmode" -p -- . 2>/dev/null; then
+ echo "mkdir -m $dirmode -p -- $*"
+ exec mkdir -m "$dirmode" -p -- "$@"
+ else
+ # Clean up after NextStep and OpenStep mkdir.
+ for d in ./-m ./-p ./-- "./$dirmode";
+ do
+ test -d $d && rmdir $d
+ done
+ fi
+ ;;
+esac
+
+for file
+do
+ set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
+ shift
+
+ pathcomp=
+ for d
+ do
+ pathcomp="$pathcomp$d"
+ case $pathcomp in
+ -*) pathcomp=./$pathcomp ;;
+ esac
- pathcomp=
- for d
- do
- pathcomp="$pathcomp$d"
- case "$pathcomp" in
- -* ) pathcomp=./$pathcomp ;;
- esac
+ if test ! -d "$pathcomp"; then
+ echo "mkdir $pathcomp"
- if test ! -d "$pathcomp"; then
- echo "mkdir $pathcomp"
+ mkdir "$pathcomp" || lasterr=$?
- mkdir "$pathcomp" || lasterr=$?
+ if test ! -d "$pathcomp"; then
+ errstatus=$lasterr
+ else
+ if test ! -z "$dirmode"; then
+ echo "chmod $dirmode $pathcomp"
+ lasterr=""
+ chmod "$dirmode" "$pathcomp" || lasterr=$?
- if test ! -d "$pathcomp"; then
- errstatus=$lasterr
- fi
- fi
+ if test ! -z "$lasterr"; then
+ errstatus=$lasterr
+ fi
+ fi
+ fi
+ fi
- pathcomp="$pathcomp/"
- done
+ pathcomp="$pathcomp/"
+ done
done
exit $errstatus
-# mkinstalldirs ends here
+# Local Variables:
+# mode: shell-script
+# sh-indentation: 2
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-end: "$"
+# End:
diff --git a/share/Makefile.am b/share/Makefile.am
new file mode 100644
index 0000000..858ad27
--- /dev/null
+++ b/share/Makefile.am
@@ -0,0 +1,53 @@
+## Process this file with automake to produce Makefile.in
+## A Makefile.in is supplied, in case you do not have automake.
+
+## $Id: Makefile.am,v 1.7 2004/01/11 03:43:50 heas Exp $
+##
+## Copyright (C) 1997-2004 by Terrapin Communications, Inc.
+## All rights reserved.
+##
+## This software may be freely copied, modified and redistributed
+## without fee for non-commerical purposes provided that this license
+## remains intact and unmodified with any RANCID distribution.
+##
+## There is no warranty or other guarantee of fitness of this software.
+## It is provided solely "as is". The author(s) disclaim(s) all
+## responsibility and liability with respect to this software's usage
+## or its effect upon hardware, computer systems, other software, or
+## anything else.
+##
+## Except where noted otherwise, rancid was written by and is maintained by
+## Henry Kilmer, John Heasley, Andrew Partan, Pete Whiting, and Austin Schutz.
+##
+
+#AUTOMAKE_OPTIONS=foreign no-dependencies
+AUTOMAKE_OPTIONS=foreign
+
+pkgdata_SCRIPTS= rtrfilter downreport
+dist_pkgdata_SCRIPTS=getipacctg
+dist_pkgdata_DATA=README.misc cisco-load.exp cisco-reload.exp \
+ index.html lgnotes.html
+
+EXTRA_DIST = rtrfilter.in downreport.in
+
+CLEANFILES= downreport
+
+all:
+
+# auto_edit does the autoconf variable substitution. This allows the
+# substitution to have the full expansion of the variables, e.g.: $sysconfdir
+# will be /prefix/etc instead of ${prefix}/etc.
+#
+# This is a bit of a PITA, but is the method recommended by the autoconf
+# documentation.
+auto_edit = sed \
+ -e 's,@prefix\@,$(prefix),g' \
+ -e 's,@localstatedir\@,$(localstatedir),g' \
+ -e 's,@sysconfdir\@,$(sysconfdir),g' \
+ -e 's,@pkgdatadir\@,$(pkgdatadir),g'
+
+downreport: Makefile $(srcdir)/downreport.in
+ rm -f downreport downreport.tmp; \
+ $(auto_edit) $(srcdir)/downreport.in >downreport.tmp; \
+ chmod +x downreport.tmp; \
+ mv downreport.tmp downreport
diff --git a/share/Makefile.in b/share/Makefile.in
new file mode 100644
index 0000000..04c1dd1
--- /dev/null
+++ b/share/Makefile.in
@@ -0,0 +1,401 @@
+# Makefile.in generated by automake 1.8 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
+# Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+subdir = share
+DIST_COMMON = $(dist_pkgdata_DATA) $(dist_pkgdata_SCRIPTS) \
+ $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+ $(srcdir)/rtrfilter.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
+ $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
+CONFIG_HEADER = $(top_builddir)/include/config.h
+CONFIG_CLEAN_FILES = rtrfilter
+am__installdirs = $(DESTDIR)$(pkgdatadir) $(DESTDIR)$(pkgdatadir) $(DESTDIR)$(pkgdatadir)
+dist_pkgdataSCRIPT_INSTALL = $(INSTALL_SCRIPT)
+pkgdataSCRIPT_INSTALL = $(INSTALL_SCRIPT)
+SCRIPTS = $(dist_pkgdata_SCRIPTS) $(pkgdata_SCRIPTS)
+SOURCES =
+DIST_SOURCES =
+dist_pkgdataDATA_INSTALL = $(INSTALL_DATA)
+DATA = $(dist_pkgdata_DATA)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+ADMINMAILPLUS = @ADMINMAILPLUS@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+COMM = @COMM@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CVS = @CVS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DIFF = @DIFF@
+DIFF_CMD = @DIFF_CMD@
+DIRNAME = @DIRNAME@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+ENV_PATH = @ENV_PATH@
+EXEEXT = @EXEEXT@
+EXPECT_PATH = @EXPECT_PATH@
+FIND = @FIND@
+GREP = @GREP@
+ID = @ID@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LG_PING_CMD = @LG_PING_CMD@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LTLIBOBJS = @LTLIBOBJS@
+MAILPLUS = @MAILPLUS@
+MAKE = @MAKE@
+MAKEINFO = @MAKEINFO@
+MKDIR = @MKDIR@
+OBJEXT = @OBJEXT@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PERLV = @PERLV@
+PERLV_PATH = @PERLV_PATH@
+PING_PATH = @PING_PATH@
+RSH = @RSH@
+SENDMAIL = @SENDMAIL@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SORT = @SORT@
+SSH = @SSH@
+STRIP = @STRIP@
+TAR = @TAR@
+TELNET = @TELNET@
+TOUCH = @TOUCH@
+U = @U@
+VERSION = @VERSION@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_STRIP = @ac_ct_STRIP@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+bindir = @bindir@
+build_alias = @build_alias@
+datadir = @datadir@
+exec_prefix = @exec_prefix@
+host_alias = @host_alias@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+
+#AUTOMAKE_OPTIONS=foreign no-dependencies
+AUTOMAKE_OPTIONS = foreign
+pkgdata_SCRIPTS = rtrfilter downreport
+dist_pkgdata_SCRIPTS = getipacctg
+dist_pkgdata_DATA = README.misc cisco-load.exp cisco-reload.exp \
+ index.html lgnotes.html
+
+EXTRA_DIST = rtrfilter.in downreport.in
+CLEANFILES = downreport
+
+# auto_edit does the autoconf variable substitution. This allows the
+# substitution to have the full expansion of the variables, e.g.: $sysconfdir
+# will be /prefix/etc instead of ${prefix}/etc.
+#
+# This is a bit of a PITA, but is the method recommended by the autoconf
+# documentation.
+auto_edit = sed \
+ -e 's,@prefix\@,$(prefix),g' \
+ -e 's,@localstatedir\@,$(localstatedir),g' \
+ -e 's,@sysconfdir\@,$(sysconfdir),g' \
+ -e 's,@pkgdatadir\@,$(pkgdatadir),g'
+
+all: all-am
+
+.SUFFIXES:
+$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+ && exit 0; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign share/Makefile'; \
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --foreign share/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+rtrfilter: $(top_builddir)/config.status $(srcdir)/rtrfilter.in
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
+install-dist_pkgdataSCRIPTS: $(dist_pkgdata_SCRIPTS)
+ @$(NORMAL_INSTALL)
+ $(mkdir_p) $(DESTDIR)$(pkgdatadir)
+ @list='$(dist_pkgdata_SCRIPTS)'; for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ if test -f $$d$$p; then \
+ f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \
+ echo " $(dist_pkgdataSCRIPT_INSTALL) $$d$$p $(DESTDIR)$(pkgdatadir)/$$f"; \
+ $(dist_pkgdataSCRIPT_INSTALL) $$d$$p $(DESTDIR)$(pkgdatadir)/$$f; \
+ else :; fi; \
+ done
+
+uninstall-dist_pkgdataSCRIPTS:
+ @$(NORMAL_UNINSTALL)
+ @list='$(dist_pkgdata_SCRIPTS)'; for p in $$list; do \
+ f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \
+ echo " rm -f $(DESTDIR)$(pkgdatadir)/$$f"; \
+ rm -f $(DESTDIR)$(pkgdatadir)/$$f; \
+ done
+install-pkgdataSCRIPTS: $(pkgdata_SCRIPTS)
+ @$(NORMAL_INSTALL)
+ $(mkdir_p) $(DESTDIR)$(pkgdatadir)
+ @list='$(pkgdata_SCRIPTS)'; for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ if test -f $$d$$p; then \
+ f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \
+ echo " $(pkgdataSCRIPT_INSTALL) $$d$$p $(DESTDIR)$(pkgdatadir)/$$f"; \
+ $(pkgdataSCRIPT_INSTALL) $$d$$p $(DESTDIR)$(pkgdatadir)/$$f; \
+ else :; fi; \
+ done
+
+uninstall-pkgdataSCRIPTS:
+ @$(NORMAL_UNINSTALL)
+ @list='$(pkgdata_SCRIPTS)'; for p in $$list; do \
+ f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \
+ echo " rm -f $(DESTDIR)$(pkgdatadir)/$$f"; \
+ rm -f $(DESTDIR)$(pkgdatadir)/$$f; \
+ done
+uninstall-info-am:
+install-dist_pkgdataDATA: $(dist_pkgdata_DATA)
+ @$(NORMAL_INSTALL)
+ $(mkdir_p) $(DESTDIR)$(pkgdatadir)
+ @list='$(dist_pkgdata_DATA)'; for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ f="`echo $$p | sed -e 's|^.*/||'`"; \
+ echo " $(dist_pkgdataDATA_INSTALL) $$d$$p $(DESTDIR)$(pkgdatadir)/$$f"; \
+ $(dist_pkgdataDATA_INSTALL) $$d$$p $(DESTDIR)$(pkgdatadir)/$$f; \
+ done
+
+uninstall-dist_pkgdataDATA:
+ @$(NORMAL_UNINSTALL)
+ @list='$(dist_pkgdata_DATA)'; for p in $$list; do \
+ f="`echo $$p | sed -e 's|^.*/||'`"; \
+ echo " rm -f $(DESTDIR)$(pkgdatadir)/$$f"; \
+ rm -f $(DESTDIR)$(pkgdatadir)/$$f; \
+ done
+tags: TAGS
+TAGS:
+
+ctags: CTAGS
+CTAGS:
+
+
+distdir: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+ list='$(DISTFILES)'; for file in $$list; do \
+ case $$file in \
+ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+ esac; \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+ dir="/$$dir"; \
+ $(mkdir_p) "$(distdir)$$dir"; \
+ else \
+ dir=''; \
+ fi; \
+ if test -d $$d/$$file; then \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+ fi; \
+ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+ else \
+ test -f $(distdir)/$$file \
+ || cp -p $$d/$$file $(distdir)/$$file \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: check-am
+all-am: Makefile $(SCRIPTS) $(DATA)
+installdirs:
+ $(mkdir_p) $(DESTDIR)$(pkgdatadir) $(DESTDIR)$(pkgdatadir) $(DESTDIR)$(pkgdatadir)
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+ -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
+
+distclean-generic:
+ -rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic mostlyclean-am
+
+distclean: distclean-am
+ -rm -f Makefile
+distclean-am: clean-am distclean-generic
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am: install-dist_pkgdataDATA install-dist_pkgdataSCRIPTS \
+ install-pkgdataSCRIPTS
+
+install-exec-am:
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-dist_pkgdataDATA uninstall-dist_pkgdataSCRIPTS \
+ uninstall-info-am uninstall-pkgdataSCRIPTS
+
+.PHONY: all all-am check check-am clean clean-generic distclean \
+ distclean-generic distdir dvi dvi-am html html-am info info-am \
+ install install-am install-data install-data-am \
+ install-dist_pkgdataDATA install-dist_pkgdataSCRIPTS \
+ install-exec install-exec-am install-info install-info-am \
+ install-man install-pkgdataSCRIPTS install-strip installcheck \
+ installcheck-am installdirs maintainer-clean \
+ maintainer-clean-generic mostlyclean mostlyclean-generic pdf \
+ pdf-am ps ps-am uninstall uninstall-am \
+ uninstall-dist_pkgdataDATA uninstall-dist_pkgdataSCRIPTS \
+ uninstall-info-am uninstall-pkgdataSCRIPTS
+
+
+all:
+
+downreport: Makefile $(srcdir)/downreport.in
+ rm -f downreport downreport.tmp; \
+ $(auto_edit) $(srcdir)/downreport.in >downreport.tmp; \
+ chmod +x downreport.tmp; \
+ mv downreport.tmp downreport
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/share/README.misc b/share/README.misc
new file mode 100644
index 0000000..4c6b2c6
--- /dev/null
+++ b/share/README.misc
@@ -0,0 +1,24 @@
+share/rancid includes some utilities that either don't seem to belong
+in <BINDIR> (i.e.: not part of the core pkg), contributed sources, or
+sources included for convenience/example.
+
+README.misc This file.
+downreport Daily report of routers not listed as up in router.db
+getipacctg Get and sort show ip accounting output from cisco router
+rtrfilter Procmail mail filter for diffs
+
+---------------
+rtrfilter can be used to filter rancid diffs to avoid sending unwanted
+diffs to certain recipient(s) or diffs which those recipient(s) should
+not see without the need to create separate or duplicate group(s).
+
+/etc/aliases e.g.:
+
+rancid-foo: engineering,
+ customer-ops-foo
+#
+# only send diffs for the SJC routers (aka. *.sjc.shrubbery.net)
+customer-ops-foo: "| /usr/local/rancid/share/rancid/rtrfilter -i '\.sjc\.' -s 'sjc router diffs' customer-ops"
+#
+customer-ops: jimbob,
+ sally
diff --git a/util/cisco-load.exp b/share/cisco-load.exp
index 58277e2..0c28549 100644
--- a/util/cisco-load.exp
+++ b/share/cisco-load.exp
@@ -1,16 +1,23 @@
##
-## Copyright (C) 1997-2001 by Henry Kilmer.
+## $Id: cisco-load.exp,v 1.10 2004/01/11 03:43:50 heas Exp $
+##
+##
+## Copyright (C) 1997-2004 by Terrapin Communications, Inc.
## All rights reserved.
##
-## This software may be freely copied, modified and redistributed without
-## fee for non-commerical purposes provided that this copyright notice is
-## preserved intact on all copies and modified copies.
+## This software may be freely copied, modified and redistributed
+## without fee for non-commerical purposes provided that this license
+## remains intact and unmodified with any RANCID distribution.
##
## There is no warranty or other guarantee of fitness of this software.
-## It is provided solely "as is". The author(s) disclaim(s) all
+## It is provided solely "as is". The author(s) disclaim(s) all
## responsibility and liability with respect to this software's usage
## or its effect upon hardware, computer systems, other software, or
## anything else.
+##
+## Except where noted otherwise, rancid was written by and is maintained by
+## Henry Kilmer, John Heasley, Andrew Partan, Pete Whiting, and Austin Schutz.
+##
#
# this expect snipit is sourced by clogin (-s option) to load a configuration
# file (named <routername>-confg into nvram from an rcp/tftp host. this is an
@@ -210,7 +217,7 @@ proc doload { confghost routername config retry } {
send_user "loading $router config from $confghost\n";
-# look for router hostname in prompt (ie: deal with fqdn)
+# look for router hostname in prompt (i.e.: deal with fqdn)
send "\r"
expect {
timeout {
diff --git a/util/cisco-reload.exp b/share/cisco-reload.exp
index 095a3b2..25880c1 100644
--- a/util/cisco-reload.exp
+++ b/share/cisco-reload.exp
@@ -1,16 +1,22 @@
##
-## Copyright (C) 1997-2001 by Henry Kilmer.
+## $Id: cisco-reload.exp,v 1.9 2004/01/11 03:43:50 heas Exp $
+##
+## Copyright (C) 1997-2004 by Terrapin Communications, Inc.
## All rights reserved.
##
-## This software may be freely copied, modified and redistributed without
-## fee for non-commerical purposes provided that this copyright notice is
-## preserved intact on all copies and modified copies.
+## This software may be freely copied, modified and redistributed
+## without fee for non-commerical purposes provided that this license
+## remains intact and unmodified with any RANCID distribution.
##
## There is no warranty or other guarantee of fitness of this software.
-## It is provided solely "as is". The author(s) disclaim(s) all
+## It is provided solely "as is". The author(s) disclaim(s) all
## responsibility and liability with respect to this software's usage
## or its effect upon hardware, computer systems, other software, or
## anything else.
+##
+## Except where noted otherwise, rancid was written by and is maintained by
+## Henry Kilmer, John Heasley, Andrew Partan, Pete Whiting, and Austin Schutz.
+##
#
# this expect snipit is sourced by clogin (-s option) to issue a reload
# command on a cisco router. it DOES NOT save the config if it has been
@@ -20,7 +26,7 @@
# it expects the following variables via the -E option:
# reload_arg ='command argument' such as 'at 05:00' or 'cancel
#
-# eg usage:
+# e.g. usage:
# % clogin -s cisco-reload.exp -Ereload_arg='at 01:00' router
# router
# Reload scheduled for 01:00:00 UTC Sat Jun 23 2001 (in 7 hours and 16 minutes)
diff --git a/share/downreport.in b/share/downreport.in
new file mode 100644
index 0000000..a05a524
--- /dev/null
+++ b/share/downreport.in
@@ -0,0 +1,81 @@
+#! /bin/sh
+##
+## $Id: downreport.in,v 1.9 2004/01/11 03:43:50 heas Exp $
+##
+## Copyright (C) 1997-2004 by Terrapin Communications, Inc.
+## All rights reserved.
+##
+## This software may be freely copied, modified and redistributed
+## without fee for non-commerical purposes provided that this license
+## remains intact and unmodified with any RANCID distribution.
+##
+## There is no warranty or other guarantee of fitness of this software.
+## It is provided solely "as is". The author(s) disclaim(s) all
+## responsibility and liability with respect to this software's usage
+## or its effect upon hardware, computer systems, other software, or
+## anything else.
+##
+## Except where noted otherwise, rancid was written by and is maintained by
+## Henry Kilmer, John Heasley, Andrew Partan, Pete Whiting, and Austin Schutz.
+##
+#
+# Reports the list of routers not listed as 'up'.
+
+# Put this in your crontab to run once a day:
+# 0 0 * * * @pkgdatadir@/downreport
+
+# It can optionally
+# take a space list of groups on the command line
+# It will use the list of groups defined in rancid.conf otherwise.
+
+
+ENVFILE="@sysconfdir@/rancid.conf"
+
+. $ENVFILE
+
+if [ $# -ge 1 ] ; then
+ LIST_OF_GROUPS="$*"
+elif [ "$LIST_OF_GROUPS" = "" ] ; then
+ echo "LIST_OF_GROUPS is empty in $ENVFILE"
+ exit 1
+fi
+
+
+for GROUP in $LIST_OF_GROUPS; do
+ (
+ echo "To: @MAILPLUS@admin-$GROUP"
+ echo "Subject: Down router report - $GROUP"
+ echo "Precedence: bulk"
+ echo ""
+ DIR=$BASEDIR/$GROUP
+ if [ -s $DIR/routers.down ]; then
+ (
+
+ cat << EOM
+
+ The following $GROUP routers are listed as other than up.
+
+ Routers listed as "up" in rancid's router.db are polled several
+times daily. This is a list of routers that are not "up" and therefore
+not polled.
+
+EOM
+
+ cat $DIR/routers.down;
+
+ )
+
+ else
+ (
+
+ cat << EOM
+
+ No routers are down/ticketed for router group $GROUP (yay).
+
+EOM
+
+ )
+ fi
+ ) | sendmail -t
+
+done
diff --git a/util/getipacctg.in b/share/getipacctg
index d77c919..9a5eb20 100755..100644
--- a/util/getipacctg.in
+++ b/share/getipacctg
@@ -1,7 +1,26 @@
#! /bin/sh
+##
+## $Id: getipacctg,v 1.7 2004/01/11 03:43:50 heas Exp $
+##
+## Copyright (C) 1997-2004 by Terrapin Communications, Inc.
+## All rights reserved.
+##
+## This software may be freely copied, modified and redistributed
+## without fee for non-commerical purposes provided that this license
+## remains intact and unmodified with any RANCID distribution.
+##
+## There is no warranty or other guarantee of fitness of this software.
+## It is provided solely "as is". The author(s) disclaim(s) all
+## responsibility and liability with respect to this software's usage
+## or its effect upon hardware, computer systems, other software, or
+## anything else.
+##
+## Except where noted otherwise, rancid was written by and is maintained by
+## Henry Kilmer, John Heasley, Andrew Partan, Pete Whiting, and Austin Schutz.
+##
#
# getipacctg uses clogin to login to a cisco router, collect the o/p of
-# show ip accounting, and sort by the greatest number of bytes. if a
+# show ip accounting, and sort by the greatest number of bytes. If a
# second argument is supplied, it is a number indicating the top N producers.
# a third (3 to N) argument(s) specify a prefix(es) to match/select src/dst
# IPs, while others will be filtered.
@@ -13,23 +32,23 @@
# will display the top 25 for src or dst ip's within prefix
# 192.168.0.0/24
#
-# contributed by steve neighorn.
+# Contributed to rancid by Steve Neighorn of SCN Reasearch.
TMP="/tmp/ipacct.$$.prefixes"
TMP2="/tmp/ipacct.$$.sorted"
TMP3="/tmp/ipacct.$$.pl"
if [ $# -eq 0 ] ; then
- echo "usage: getipacctg router_name [<number of lines off the top>] [<src/dest prefix filter> [...]]" >&2
- exit 1;
+ echo "usage: getipacctg router_name [<number of lines off the top>] [<src/dest prefix filter> [...]]" >&2
+ exit 1;
fi
trap 'rm -fr /tmp/ipacct.$$ $TMP $TMP2 $TMP3;' 1 2 15
clogin -c 'show ip accounting' $1 > /tmp/ipacct.$$
if [ $? -ne 0 ] ; then
- echo "clogin failed." >&2
- exit 1
+ echo "clogin failed." >&2
+ exit 1
fi
# rest of the command-line options
exec 6>$TMP
@@ -92,7 +111,7 @@ cat > $TMP3 <<PERL
}
}
PERL
- perl $TMP3 $TMP $TMP2 | $HEAD
+ perl $TMP3 $TMP $TMP2 | $HEAD
else
$HEAD $TMP2
fi
@@ -100,4 +119,3 @@ fi
rm -fr /tmp/ipacct.$$ $TMP $TMP2 $TMP3
trap ';' 1 2 15
exit 0
-
diff --git a/util/lg/index.html b/share/index.html
index 0087a90..0b7ef06 100644
--- a/util/lg/index.html
+++ b/share/index.html
@@ -4,6 +4,9 @@
this can also be done with a redirect (which is supposedly more universally
supported. something like <redirect URL=lgform.cgi>. not sure...i'm not
a web person. but this works for netscape.
+
+ apache can do this with a line in the directory's .htaccess file:
+ DirectoryIndex index.php
-->
<meta http-equiv=Refresh content="0; URL=lgform.cgi">
diff --git a/util/lg/lgnotes.html b/share/lgnotes.html
index 9f28ec3..9f28ec3 100644
--- a/util/lg/lgnotes.html
+++ b/share/lgnotes.html
diff --git a/util/rtrfilter.in b/share/rtrfilter.in
index 28bd21a..9807e1f 100755..100644
--- a/util/rtrfilter.in
+++ b/share/rtrfilter.in
@@ -1,17 +1,23 @@
-#!@PERLV_PATH@
+#! @PERLV_PATH@
##
-## Copyright (C) 1997-2001 by Henry Kilmer.
+## $Id: rtrfilter.in,v 1.13 2004/01/11 03:43:50 heas Exp $
+##
+## Copyright (C) 1997-2004 by Terrapin Communications, Inc.
## All rights reserved.
##
-## This software may be freely copied, modified and redistributed without
-## fee for non-commerical purposes provided that this copyright notice is
-## preserved intact on all copies and modified copies.
+## This software may be freely copied, modified and redistributed
+## without fee for non-commerical purposes provided that this license
+## remains intact and unmodified with any RANCID distribution.
##
## There is no warranty or other guarantee of fitness of this software.
-## It is provided solely "as is". The author(s) disclaim(s) all
+## It is provided solely "as is". The author(s) disclaim(s) all
## responsibility and liability with respect to this software's usage
## or its effect upon hardware, computer systems, other software, or
## anything else.
+##
+## Except where noted otherwise, rancid was written by and is maintained by
+## Henry Kilmer, John Heasley, Andrew Partan, Pete Whiting, and Austin Schutz.
+##
#
# rtrtfilter - "| rtrfilter -x <perl regex> -i <perl regex> -f <regex file> \
# -u <From address> -s <subject> <rcpts>"
@@ -19,14 +25,14 @@
# rancid and emails a filtered copy to <rcpts> with the subject of the
# original msg or the contents of -s <subject>. the perl regex(es) specified
# via -x or -i (exclusive and inclusive, respectively) are applied to the
-# router names (ie: files) from the "Index:" of the diff o/p. alternatively,
+# router names (i.e.: files) from the "Index:" of the diff o/p. alternatively,
# the regex's may be specified in -f <regex file> in the form:
# # comment
# x <regex>
# # comment
# i <regex>
# do not include /'s in the regex's.
-# eg:
+# e.g.:
# #i inc1
# i a0[12]\.
# i a0[34]\.
diff --git a/util/Makefile.in b/util/Makefile.in
deleted file mode 100644
index ed8db01..0000000
--- a/util/Makefile.in
+++ /dev/null
@@ -1,37 +0,0 @@
-PREFIX = @prefix@
-
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-
-UTIL_PROGS = @RD_UTIL_PROGS@
-
-all:
-
-install: all
- for file in $(UTIL_PROGS) ; do \
- $(INSTALL) $$file $(PREFIX)/util; \
- done; \
- for file in *README* *.exp; do \
- $(INSTALL_DATA) $$file $(PREFIX)/util; \
- done; \
- cd lg; $(MAKE) -e install
-
-clean:
- @if [ -f lg/Makefile ] ; then \
- cd lg; $(MAKE) -e clean; \
- fi
-
-distclean: clean
- @if [ -f lg/Makefile ] ; then \
- cd lg; $(MAKE) -e distclean; \
- fi
- rm -f Makefile $(UTIL_PROGS) config.log config.status
-
-distdir:
- for file in Makefile.in configure.in *README* *.exp; do \
- $(INSTALL_DATA) $$file $(distdir); \
- done; \
- for file in configure $(UTIL_PROGS:=.in) ; do \
- $(INSTALL) $$file $(distdir); \
- done; \
- cd lg; $(MAKE) -e distdir
diff --git a/util/README b/util/README
deleted file mode 100644
index 56d5673..0000000
--- a/util/README
+++ /dev/null
@@ -1,9 +0,0 @@
-rancid/util includes some utilities that either don't seem to belong
-in rancid/bin (ie: not part of the core pkg), contributed sources, or
-sources included for convenience/example.
-
-README This file.
-downreport Daily report of routers not listed as up in router.db
-getipacctg get and sort show ip accounting o/p from cisco router
-lg looking glass pkg
-rtrfilter mail filter for diffs
diff --git a/util/configure b/util/configure
deleted file mode 100755
index fb8e766..0000000
--- a/util/configure
+++ /dev/null
@@ -1,990 +0,0 @@
-#! /bin/sh
-
-# Guess values for system-dependent variables and create Makefiles.
-# Generated automatically using autoconf version 2.13
-# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
-#
-# This configure script is free software; the Free Software Foundation
-# gives unlimited permission to copy, distribute and modify it.
-
-# Defaults:
-ac_help=
-ac_default_prefix=/usr/local
-# Any additions from configure.in:
-ac_default_prefix=/usr/local/rancid
-
-# Initialize some variables set by options.
-# The variables have the same names as the options, with
-# dashes changed to underlines.
-build=NONE
-cache_file=./config.cache
-exec_prefix=NONE
-host=NONE
-no_create=
-nonopt=NONE
-no_recursion=
-prefix=NONE
-program_prefix=NONE
-program_suffix=NONE
-program_transform_name=s,x,x,
-silent=
-site=
-srcdir=
-target=NONE
-verbose=
-x_includes=NONE
-x_libraries=NONE
-bindir='${exec_prefix}/bin'
-sbindir='${exec_prefix}/sbin'
-libexecdir='${exec_prefix}/libexec'
-datadir='${prefix}/share'
-sysconfdir='${prefix}/etc'
-sharedstatedir='${prefix}/com'
-localstatedir='${prefix}/var'
-libdir='${exec_prefix}/lib'
-includedir='${prefix}/include'
-oldincludedir='/usr/include'
-infodir='${prefix}/info'
-mandir='${prefix}/man'
-
-# Initialize some other variables.
-subdirs=
-MFLAGS= MAKEFLAGS=
-SHELL=${CONFIG_SHELL-/bin/sh}
-# Maximum number of lines to put in a shell here document.
-ac_max_here_lines=12
-
-ac_prev=
-for ac_option
-do
-
- # If the previous option needs an argument, assign it.
- if test -n "$ac_prev"; then
- eval "$ac_prev=\$ac_option"
- ac_prev=
- continue
- fi
-
- case "$ac_option" in
- -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
- *) ac_optarg= ;;
- esac
-
- # Accept the important Cygnus configure options, so we can diagnose typos.
-
- case "$ac_option" in
-
- -bindir | --bindir | --bindi | --bind | --bin | --bi)
- ac_prev=bindir ;;
- -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
- bindir="$ac_optarg" ;;
-
- -build | --build | --buil | --bui | --bu)
- ac_prev=build ;;
- -build=* | --build=* | --buil=* | --bui=* | --bu=*)
- build="$ac_optarg" ;;
-
- -cache-file | --cache-file | --cache-fil | --cache-fi \
- | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
- ac_prev=cache_file ;;
- -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
- | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
- cache_file="$ac_optarg" ;;
-
- -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
- ac_prev=datadir ;;
- -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
- | --da=*)
- datadir="$ac_optarg" ;;
-
- -disable-* | --disable-*)
- ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
- # Reject names that are not valid shell variable names.
- if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
- { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
- fi
- ac_feature=`echo $ac_feature| sed 's/-/_/g'`
- eval "enable_${ac_feature}=no" ;;
-
- -enable-* | --enable-*)
- ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
- # Reject names that are not valid shell variable names.
- if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
- { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
- fi
- ac_feature=`echo $ac_feature| sed 's/-/_/g'`
- case "$ac_option" in
- *=*) ;;
- *) ac_optarg=yes ;;
- esac
- eval "enable_${ac_feature}='$ac_optarg'" ;;
-
- -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
- | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
- | --exec | --exe | --ex)
- ac_prev=exec_prefix ;;
- -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
- | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
- | --exec=* | --exe=* | --ex=*)
- exec_prefix="$ac_optarg" ;;
-
- -gas | --gas | --ga | --g)
- # Obsolete; use --with-gas.
- with_gas=yes ;;
-
- -help | --help | --hel | --he)
- # Omit some internal or obsolete options to make the list less imposing.
- # This message is too long to be a string in the A/UX 3.1 sh.
- cat << EOF
-Usage: configure [options] [host]
-Options: [defaults in brackets after descriptions]
-Configuration:
- --cache-file=FILE cache test results in FILE
- --help print this message
- --no-create do not create output files
- --quiet, --silent do not print \`checking...' messages
- --version print the version of autoconf that created configure
-Directory and file names:
- --prefix=PREFIX install architecture-independent files in PREFIX
- [$ac_default_prefix]
- --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
- [same as prefix]
- --bindir=DIR user executables in DIR [EPREFIX/bin]
- --sbindir=DIR system admin executables in DIR [EPREFIX/sbin]
- --libexecdir=DIR program executables in DIR [EPREFIX/libexec]
- --datadir=DIR read-only architecture-independent data in DIR
- [PREFIX/share]
- --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc]
- --sharedstatedir=DIR modifiable architecture-independent data in DIR
- [PREFIX/com]
- --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var]
- --libdir=DIR object code libraries in DIR [EPREFIX/lib]
- --includedir=DIR C header files in DIR [PREFIX/include]
- --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include]
- --infodir=DIR info documentation in DIR [PREFIX/info]
- --mandir=DIR man documentation in DIR [PREFIX/man]
- --srcdir=DIR find the sources in DIR [configure dir or ..]
- --program-prefix=PREFIX prepend PREFIX to installed program names
- --program-suffix=SUFFIX append SUFFIX to installed program names
- --program-transform-name=PROGRAM
- run sed PROGRAM on installed program names
-EOF
- cat << EOF
-Host type:
- --build=BUILD configure for building on BUILD [BUILD=HOST]
- --host=HOST configure for HOST [guessed]
- --target=TARGET configure for TARGET [TARGET=HOST]
-Features and packages:
- --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
- --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
- --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
- --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
- --x-includes=DIR X include files are in DIR
- --x-libraries=DIR X library files are in DIR
-EOF
- if test -n "$ac_help"; then
- echo "--enable and --with options recognized:$ac_help"
- fi
- exit 0 ;;
-
- -host | --host | --hos | --ho)
- ac_prev=host ;;
- -host=* | --host=* | --hos=* | --ho=*)
- host="$ac_optarg" ;;
-
- -includedir | --includedir | --includedi | --included | --include \
- | --includ | --inclu | --incl | --inc)
- ac_prev=includedir ;;
- -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
- | --includ=* | --inclu=* | --incl=* | --inc=*)
- includedir="$ac_optarg" ;;
-
- -infodir | --infodir | --infodi | --infod | --info | --inf)
- ac_prev=infodir ;;
- -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
- infodir="$ac_optarg" ;;
-
- -libdir | --libdir | --libdi | --libd)
- ac_prev=libdir ;;
- -libdir=* | --libdir=* | --libdi=* | --libd=*)
- libdir="$ac_optarg" ;;
-
- -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
- | --libexe | --libex | --libe)
- ac_prev=libexecdir ;;
- -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
- | --libexe=* | --libex=* | --libe=*)
- libexecdir="$ac_optarg" ;;
-
- -localstatedir | --localstatedir | --localstatedi | --localstated \
- | --localstate | --localstat | --localsta | --localst \
- | --locals | --local | --loca | --loc | --lo)
- ac_prev=localstatedir ;;
- -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
- | --localstate=* | --localstat=* | --localsta=* | --localst=* \
- | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
- localstatedir="$ac_optarg" ;;
-
- -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
- ac_prev=mandir ;;
- -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
- mandir="$ac_optarg" ;;
-
- -nfp | --nfp | --nf)
- # Obsolete; use --without-fp.
- with_fp=no ;;
-
- -no-create | --no-create | --no-creat | --no-crea | --no-cre \
- | --no-cr | --no-c)
- no_create=yes ;;
-
- -no-recursion | --no-recursion | --no-recursio | --no-recursi \
- | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
- no_recursion=yes ;;
-
- -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
- | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
- | --oldin | --oldi | --old | --ol | --o)
- ac_prev=oldincludedir ;;
- -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
- | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
- | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
- oldincludedir="$ac_optarg" ;;
-
- -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
- ac_prev=prefix ;;
- -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
- prefix="$ac_optarg" ;;
-
- -program-prefix | --program-prefix | --program-prefi | --program-pref \
- | --program-pre | --program-pr | --program-p)
- ac_prev=program_prefix ;;
- -program-prefix=* | --program-prefix=* | --program-prefi=* \
- | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
- program_prefix="$ac_optarg" ;;
-
- -program-suffix | --program-suffix | --program-suffi | --program-suff \
- | --program-suf | --program-su | --program-s)
- ac_prev=program_suffix ;;
- -program-suffix=* | --program-suffix=* | --program-suffi=* \
- | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
- program_suffix="$ac_optarg" ;;
-
- -program-transform-name | --program-transform-name \
- | --program-transform-nam | --program-transform-na \
- | --program-transform-n | --program-transform- \
- | --program-transform | --program-transfor \
- | --program-transfo | --program-transf \
- | --program-trans | --program-tran \
- | --progr-tra | --program-tr | --program-t)
- ac_prev=program_transform_name ;;
- -program-transform-name=* | --program-transform-name=* \
- | --program-transform-nam=* | --program-transform-na=* \
- | --program-transform-n=* | --program-transform-=* \
- | --program-transform=* | --program-transfor=* \
- | --program-transfo=* | --program-transf=* \
- | --program-trans=* | --program-tran=* \
- | --progr-tra=* | --program-tr=* | --program-t=*)
- program_transform_name="$ac_optarg" ;;
-
- -q | -quiet | --quiet | --quie | --qui | --qu | --q \
- | -silent | --silent | --silen | --sile | --sil)
- silent=yes ;;
-
- -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
- ac_prev=sbindir ;;
- -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
- | --sbi=* | --sb=*)
- sbindir="$ac_optarg" ;;
-
- -sharedstatedir | --sharedstatedir | --sharedstatedi \
- | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
- | --sharedst | --shareds | --shared | --share | --shar \
- | --sha | --sh)
- ac_prev=sharedstatedir ;;
- -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
- | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
- | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
- | --sha=* | --sh=*)
- sharedstatedir="$ac_optarg" ;;
-
- -site | --site | --sit)
- ac_prev=site ;;
- -site=* | --site=* | --sit=*)
- site="$ac_optarg" ;;
-
- -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
- ac_prev=srcdir ;;
- -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
- srcdir="$ac_optarg" ;;
-
- -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
- | --syscon | --sysco | --sysc | --sys | --sy)
- ac_prev=sysconfdir ;;
- -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
- | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
- sysconfdir="$ac_optarg" ;;
-
- -target | --target | --targe | --targ | --tar | --ta | --t)
- ac_prev=target ;;
- -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
- target="$ac_optarg" ;;
-
- -v | -verbose | --verbose | --verbos | --verbo | --verb)
- verbose=yes ;;
-
- -version | --version | --versio | --versi | --vers)
- echo "configure generated by autoconf version 2.13"
- exit 0 ;;
-
- -with-* | --with-*)
- ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
- # Reject names that are not valid shell variable names.
- if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
- { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
- fi
- ac_package=`echo $ac_package| sed 's/-/_/g'`
- case "$ac_option" in
- *=*) ;;
- *) ac_optarg=yes ;;
- esac
- eval "with_${ac_package}='$ac_optarg'" ;;
-
- -without-* | --without-*)
- ac_package=`echo $ac_option|sed -e 's/-*without-//'`
- # Reject names that are not valid shell variable names.
- if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
- { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
- fi
- ac_package=`echo $ac_package| sed 's/-/_/g'`
- eval "with_${ac_package}=no" ;;
-
- --x)
- # Obsolete; use --with-x.
- with_x=yes ;;
-
- -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
- | --x-incl | --x-inc | --x-in | --x-i)
- ac_prev=x_includes ;;
- -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
- | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
- x_includes="$ac_optarg" ;;
-
- -x-libraries | --x-libraries | --x-librarie | --x-librari \
- | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
- ac_prev=x_libraries ;;
- -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
- | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
- x_libraries="$ac_optarg" ;;
-
- -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
- ;;
-
- *)
- if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
- echo "configure: warning: $ac_option: invalid host type" 1>&2
- fi
- if test "x$nonopt" != xNONE; then
- { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
- fi
- nonopt="$ac_option"
- ;;
-
- esac
-done
-
-if test -n "$ac_prev"; then
- { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
-fi
-
-trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
-
-# File descriptor usage:
-# 0 standard input
-# 1 file creation
-# 2 errors and warnings
-# 3 some systems may open it to /dev/tty
-# 4 used on the Kubota Titan
-# 6 checking for... messages and results
-# 5 compiler messages saved in config.log
-if test "$silent" = yes; then
- exec 6>/dev/null
-else
- exec 6>&1
-fi
-exec 5>./config.log
-
-echo "\
-This file contains any messages produced by compilers while
-running configure, to aid debugging if configure makes a mistake.
-" 1>&5
-
-# Strip out --no-create and --no-recursion so they do not pile up.
-# Also quote any args containing shell metacharacters.
-ac_configure_args=
-for ac_arg
-do
- case "$ac_arg" in
- -no-create | --no-create | --no-creat | --no-crea | --no-cre \
- | --no-cr | --no-c) ;;
- -no-recursion | --no-recursion | --no-recursio | --no-recursi \
- | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
- *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
- ac_configure_args="$ac_configure_args '$ac_arg'" ;;
- *) ac_configure_args="$ac_configure_args $ac_arg" ;;
- esac
-done
-
-# NLS nuisances.
-# Only set these to C if already set. These must not be set unconditionally
-# because not all systems understand e.g. LANG=C (notably SCO).
-# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
-# Non-C LC_CTYPE values break the ctype check.
-if test "${LANG+set}" = set; then LANG=C; export LANG; fi
-if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
-if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
-if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi
-
-# confdefs.h avoids OS command line length limits that DEFS can exceed.
-rm -rf conftest* confdefs.h
-# AIX cpp loses on an empty file, so make sure it contains at least a newline.
-echo > confdefs.h
-
-# A filename unique to this package, relative to the directory that
-# configure is in, which we can look for to find out if srcdir is correct.
-ac_unique_file=
-
-# Find the source files, if location was not specified.
-if test -z "$srcdir"; then
- ac_srcdir_defaulted=yes
- # Try the directory containing this script, then its parent.
- ac_prog=$0
- ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
- test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
- srcdir=$ac_confdir
- if test ! -r $srcdir/$ac_unique_file; then
- srcdir=..
- fi
-else
- ac_srcdir_defaulted=no
-fi
-if test ! -r $srcdir/$ac_unique_file; then
- if test "$ac_srcdir_defaulted" = yes; then
- { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
- else
- { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
- fi
-fi
-srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
-
-# Prefer explicitly selected file to automatically selected ones.
-if test -z "$CONFIG_SITE"; then
- if test "x$prefix" != xNONE; then
- CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
- else
- CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
- fi
-fi
-for ac_site_file in $CONFIG_SITE; do
- if test -r "$ac_site_file"; then
- echo "loading site script $ac_site_file"
- . "$ac_site_file"
- fi
-done
-
-if test -r "$cache_file"; then
- echo "loading cache $cache_file"
- . $cache_file
-else
- echo "creating cache $cache_file"
- > $cache_file
-fi
-
-ac_ext=c
-# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cc_cross
-
-ac_exeext=
-ac_objext=o
-if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
- # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
- if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
- ac_n= ac_c='
-' ac_t=' '
- else
- ac_n=-n ac_c= ac_t=
- fi
-else
- ac_n= ac_c='\c' ac_t=
-fi
-
-
-
-ac_aux_dir=
-for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
- if test -f $ac_dir/install-sh; then
- ac_aux_dir=$ac_dir
- ac_install_sh="$ac_aux_dir/install-sh -c"
- break
- elif test -f $ac_dir/install.sh; then
- ac_aux_dir=$ac_dir
- ac_install_sh="$ac_aux_dir/install.sh -c"
- break
- fi
-done
-if test -z "$ac_aux_dir"; then
- { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; }
-fi
-ac_config_guess=$ac_aux_dir/config.guess
-ac_config_sub=$ac_aux_dir/config.sub
-ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
-
-subdirs="lg"
-
-
-
-
-# Find a good install program. We prefer a C program (faster),
-# so one script is as good as another. But avoid the broken or
-# incompatible versions:
-# SysV /etc/install, /usr/sbin/install
-# SunOS /usr/etc/install
-# IRIX /sbin/install
-# AIX /bin/install
-# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
-# AFS /usr/afsws/bin/install, which mishandles nonexistent args
-# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
-# ./install, which can be erroneously created by make from ./install.sh.
-echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
-echo "configure:563: checking for a BSD compatible install" >&5
-if test -z "$INSTALL"; then
-if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":"
- for ac_dir in $PATH; do
- # Account for people who put trailing slashes in PATH elements.
- case "$ac_dir/" in
- /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
- *)
- # OSF1 and SCO ODT 3.0 have their own names for install.
- # Don't use installbsd from OSF since it installs stuff as root
- # by default.
- for ac_prog in ginstall scoinst install; do
- if test -f $ac_dir/$ac_prog; then
- if test $ac_prog = install &&
- grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
- # AIX install. It has an incompatible calling convention.
- :
- else
- ac_cv_path_install="$ac_dir/$ac_prog -c"
- break 2
- fi
- fi
- done
- ;;
- esac
- done
- IFS="$ac_save_IFS"
-
-fi
- if test "${ac_cv_path_install+set}" = set; then
- INSTALL="$ac_cv_path_install"
- else
- # As a last resort, use the slow shell script. We don't cache a
- # path for INSTALL within a source directory, because that will
- # break other packages using the cache if that directory is
- # removed, or if the path is relative.
- INSTALL="$ac_install_sh"
- fi
-fi
-echo "$ac_t""$INSTALL" 1>&6
-
-# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
-# It thinks the first close brace ends the variable substitution.
-test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
-
-test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
-
-test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
-
-
-RD_UTIL_PROGS=$rd_cv_rd_util_progs
-
-
-PERLV_PATH=$ac_cv_path_PERLV_PATH
-
-EXPECT_PATH=$ac_cv_path_EXPECT_PATH
-
-
-MAILPLUS=$rd_cv_MAILPLUS
-
-
-trap '' 1 2 15
-cat > confcache <<\EOF
-# This file is a shell script that caches the results of configure
-# tests run on this system so they can be shared between configure
-# scripts and configure runs. It is not useful on other systems.
-# If it contains results you don't want to keep, you may remove or edit it.
-#
-# By default, configure uses ./config.cache as the cache file,
-# creating it if it does not exist already. You can give configure
-# the --cache-file=FILE option to use a different cache file; that is
-# what configure does when it calls configure scripts in
-# subdirectories, so they share the cache.
-# Giving --cache-file=/dev/null disables caching, for debugging configure.
-# config.status only pays attention to the cache file if you give it the
-# --recheck option to rerun configure.
-#
-EOF
-# The following way of writing the cache mishandles newlines in values,
-# but we know of no workaround that is simple, portable, and efficient.
-# So, don't put newlines in cache variables' values.
-# Ultrix sh set writes to stderr and can't be redirected directly,
-# and sets the high bit in the cache file unless we assign to the vars.
-(set) 2>&1 |
- case `(ac_space=' '; set | grep ac_space) 2>&1` in
- *ac_space=\ *)
- # `set' does not quote correctly, so add quotes (double-quote substitution
- # turns \\\\ into \\, and sed turns \\ into \).
- sed -n \
- -e "s/'/'\\\\''/g" \
- -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
- ;;
- *)
- # `set' quotes correctly as required by POSIX, so do not add quotes.
- sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
- ;;
- esac >> confcache
-if cmp -s $cache_file confcache; then
- :
-else
- if test -w $cache_file; then
- echo "updating cache $cache_file"
- cat confcache > $cache_file
- else
- echo "not updating unwritable cache $cache_file"
- fi
-fi
-rm -f confcache
-
-trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
-
-test "x$prefix" = xNONE && prefix=$ac_default_prefix
-# Let make expand exec_prefix.
-test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
-
-# Any assignment to VPATH causes Sun make to only execute
-# the first set of double-colon rules, so remove it if not needed.
-# If there is a colon in the path, we need to keep it.
-if test "x$srcdir" = x.; then
- ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d'
-fi
-
-trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
-
-# Transform confdefs.h into DEFS.
-# Protect against shell expansion while executing Makefile rules.
-# Protect against Makefile macro expansion.
-cat > conftest.defs <<\EOF
-s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%-D\1=\2%g
-s%[ `~#$^&*(){}\\|;'"<>?]%\\&%g
-s%\[%\\&%g
-s%\]%\\&%g
-s%\$%$$%g
-EOF
-DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' '`
-rm -f conftest.defs
-
-
-# Without the "./", some shells look in PATH for config.status.
-: ${CONFIG_STATUS=./config.status}
-
-echo creating $CONFIG_STATUS
-rm -f $CONFIG_STATUS
-cat > $CONFIG_STATUS <<EOF
-#! /bin/sh
-# Generated automatically by configure.
-# Run this file to recreate the current configuration.
-# This directory was configured as follows,
-# on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
-#
-# $0 $ac_configure_args
-#
-# Compiler output produced by configure, useful for debugging
-# configure, is in ./config.log if it exists.
-
-ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
-for ac_option
-do
- case "\$ac_option" in
- -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
- echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
- exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
- -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
- echo "$CONFIG_STATUS generated by autoconf version 2.13"
- exit 0 ;;
- -help | --help | --hel | --he | --h)
- echo "\$ac_cs_usage"; exit 0 ;;
- *) echo "\$ac_cs_usage"; exit 1 ;;
- esac
-done
-
-ac_given_srcdir=$srcdir
-ac_given_INSTALL="$INSTALL"
-
-trap 'rm -fr `echo "Makefile $RD_UTIL_PROGS" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
-EOF
-cat >> $CONFIG_STATUS <<EOF
-
-# Protect against being on the right side of a sed subst in config.status.
-sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
- s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
-$ac_vpsub
-$extrasub
-s%@SHELL@%$SHELL%g
-s%@CFLAGS@%$CFLAGS%g
-s%@CPPFLAGS@%$CPPFLAGS%g
-s%@CXXFLAGS@%$CXXFLAGS%g
-s%@FFLAGS@%$FFLAGS%g
-s%@DEFS@%$DEFS%g
-s%@LDFLAGS@%$LDFLAGS%g
-s%@LIBS@%$LIBS%g
-s%@exec_prefix@%$exec_prefix%g
-s%@prefix@%$prefix%g
-s%@program_transform_name@%$program_transform_name%g
-s%@bindir@%$bindir%g
-s%@sbindir@%$sbindir%g
-s%@libexecdir@%$libexecdir%g
-s%@datadir@%$datadir%g
-s%@sysconfdir@%$sysconfdir%g
-s%@sharedstatedir@%$sharedstatedir%g
-s%@localstatedir@%$localstatedir%g
-s%@libdir@%$libdir%g
-s%@includedir@%$includedir%g
-s%@oldincludedir@%$oldincludedir%g
-s%@infodir@%$infodir%g
-s%@mandir@%$mandir%g
-s%@subdirs@%$subdirs%g
-s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
-s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
-s%@INSTALL_DATA@%$INSTALL_DATA%g
-s%@RD_UTIL_PROGS@%$RD_UTIL_PROGS%g
-s%@PERLV_PATH@%$PERLV_PATH%g
-s%@EXPECT_PATH@%$EXPECT_PATH%g
-s%@MAILPLUS@%$MAILPLUS%g
-
-CEOF
-EOF
-
-cat >> $CONFIG_STATUS <<\EOF
-
-# Split the substitutions into bite-sized pieces for seds with
-# small command number limits, like on Digital OSF/1 and HP-UX.
-ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
-ac_file=1 # Number of current file.
-ac_beg=1 # First line for current file.
-ac_end=$ac_max_sed_cmds # Line after last line for current file.
-ac_more_lines=:
-ac_sed_cmds=""
-while $ac_more_lines; do
- if test $ac_beg -gt 1; then
- sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
- else
- sed "${ac_end}q" conftest.subs > conftest.s$ac_file
- fi
- if test ! -s conftest.s$ac_file; then
- ac_more_lines=false
- rm -f conftest.s$ac_file
- else
- if test -z "$ac_sed_cmds"; then
- ac_sed_cmds="sed -f conftest.s$ac_file"
- else
- ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
- fi
- ac_file=`expr $ac_file + 1`
- ac_beg=$ac_end
- ac_end=`expr $ac_end + $ac_max_sed_cmds`
- fi
-done
-if test -z "$ac_sed_cmds"; then
- ac_sed_cmds=cat
-fi
-EOF
-
-cat >> $CONFIG_STATUS <<EOF
-
-CONFIG_FILES=\${CONFIG_FILES-"Makefile $RD_UTIL_PROGS"}
-EOF
-cat >> $CONFIG_STATUS <<\EOF
-for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
- # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
- case "$ac_file" in
- *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
- ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
- *) ac_file_in="${ac_file}.in" ;;
- esac
-
- # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
-
- # Remove last slash and all that follows it. Not all systems have dirname.
- ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
- if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
- # The file is in a subdirectory.
- test ! -d "$ac_dir" && mkdir "$ac_dir"
- ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
- # A "../" for each directory in $ac_dir_suffix.
- ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
- else
- ac_dir_suffix= ac_dots=
- fi
-
- case "$ac_given_srcdir" in
- .) srcdir=.
- if test -z "$ac_dots"; then top_srcdir=.
- else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
- /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
- *) # Relative path.
- srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
- top_srcdir="$ac_dots$ac_given_srcdir" ;;
- esac
-
- case "$ac_given_INSTALL" in
- [/$]*) INSTALL="$ac_given_INSTALL" ;;
- *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
- esac
-
- echo creating "$ac_file"
- rm -f "$ac_file"
- configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
- case "$ac_file" in
- *Makefile*) ac_comsub="1i\\
-# $configure_input" ;;
- *) ac_comsub= ;;
- esac
-
- ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
- sed -e "$ac_comsub
-s%@configure_input@%$configure_input%g
-s%@srcdir@%$srcdir%g
-s%@top_srcdir@%$top_srcdir%g
-s%@INSTALL@%$INSTALL%g
-" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
-fi; done
-rm -f conftest.s*
-
-EOF
-cat >> $CONFIG_STATUS <<EOF
-
-EOF
-cat >> $CONFIG_STATUS <<\EOF
-
-exit 0
-EOF
-chmod +x $CONFIG_STATUS
-rm -fr confdefs* $ac_clean_files
-test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
-
-if test "$no_recursion" != yes; then
-
- # Remove --cache-file and --srcdir arguments so they do not pile up.
- ac_sub_configure_args=
- ac_prev=
- for ac_arg in $ac_configure_args; do
- if test -n "$ac_prev"; then
- ac_prev=
- continue
- fi
- case "$ac_arg" in
- -cache-file | --cache-file | --cache-fil | --cache-fi \
- | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
- ac_prev=cache_file ;;
- -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
- | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
- ;;
- -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
- ac_prev=srcdir ;;
- -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
- ;;
- *) ac_sub_configure_args="$ac_sub_configure_args $ac_arg" ;;
- esac
- done
-
- for ac_config_dir in lg; do
-
- # Do not complain, so a configure script can configure whichever
- # parts of a large source tree are present.
- if test ! -d $srcdir/$ac_config_dir; then
- continue
- fi
-
- echo configuring in $ac_config_dir
-
- case "$srcdir" in
- .) ;;
- *)
- if test -d ./$ac_config_dir || mkdir ./$ac_config_dir; then :;
- else
- { echo "configure: error: can not create `pwd`/$ac_config_dir" 1>&2; exit 1; }
- fi
- ;;
- esac
-
- ac_popdir=`pwd`
- cd $ac_config_dir
-
- # A "../" for each directory in /$ac_config_dir.
- ac_dots=`echo $ac_config_dir|sed -e 's%^\./%%' -e 's%[^/]$%&/%' -e 's%[^/]*/%../%g'`
-
- case "$srcdir" in
- .) # No --srcdir option. We are building in place.
- ac_sub_srcdir=$srcdir ;;
- /*) # Absolute path.
- ac_sub_srcdir=$srcdir/$ac_config_dir ;;
- *) # Relative path.
- ac_sub_srcdir=$ac_dots$srcdir/$ac_config_dir ;;
- esac
-
- # Check for guested configure; otherwise get Cygnus style configure.
- if test -f $ac_sub_srcdir/configure; then
- ac_sub_configure=$ac_sub_srcdir/configure
- elif test -f $ac_sub_srcdir/configure.in; then
- ac_sub_configure=$ac_configure
- else
- echo "configure: warning: no configuration information is in $ac_config_dir" 1>&2
- ac_sub_configure=
- fi
-
- # The recursion is here.
- if test -n "$ac_sub_configure"; then
-
- # Make the cache file name correct relative to the subdirectory.
- case "$cache_file" in
- /*) ac_sub_cache_file=$cache_file ;;
- *) # Relative path.
- ac_sub_cache_file="$ac_dots$cache_file" ;;
- esac
- case "$ac_given_INSTALL" in
- [/$]*) INSTALL="$ac_given_INSTALL" ;;
- *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
- esac
-
- echo "running ${CONFIG_SHELL-/bin/sh} $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_sub_srcdir"
- # The eval makes quoting arguments work.
- if eval ${CONFIG_SHELL-/bin/sh} $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_sub_srcdir
- then :
- else
- { echo "configure: error: $ac_sub_configure failed for $ac_config_dir" 1>&2; exit 1; }
- fi
- fi
-
- cd $ac_popdir
- done
-fi
-
-
-# fix permissions on scripts.
-for file in $RD_UTIL_PROGS; do chmod a+x $file; done
diff --git a/util/configure.in b/util/configure.in
deleted file mode 100644
index c23c556..0000000
--- a/util/configure.in
+++ /dev/null
@@ -1,26 +0,0 @@
-dnl Process this file with autoconf to produce a configure script.
-AC_INIT()
-
-AC_CONFIG_SUBDIRS(lg)
-
-dnl default install location
-AC_PREFIX_DEFAULT(/usr/local/rancid)
-
-dnl install program(s)
-AC_PROG_INSTALL
-
-RD_UTIL_PROGS=$rd_cv_rd_util_progs
-AC_SUBST(RD_UTIL_PROGS)
-
-PERLV_PATH=$ac_cv_path_PERLV_PATH
-AC_SUBST(PERLV_PATH)
-EXPECT_PATH=$ac_cv_path_EXPECT_PATH
-AC_SUBST(EXPECT_PATH)
-
-MAILPLUS=$rd_cv_MAILPLUS
-AC_SUBST(MAILPLUS)
-
-AC_OUTPUT(Makefile $RD_UTIL_PROGS)
-
-# fix permissions on scripts.
-for file in $RD_UTIL_PROGS; do chmod a+x $file; done
diff --git a/util/downreport.in b/util/downreport.in
deleted file mode 100755
index edb3ae0..0000000
--- a/util/downreport.in
+++ /dev/null
@@ -1,62 +0,0 @@
-#!/bin/sh
-
-# Reports the list of routers not listed as 'up'.
-
-# Put this in your crontab to run once a day:
-# 0 0 * * * @prefix@/util/downreport
-
-# It can optionally
-# take a space list of groups on the command line
-# It will use the list of groups defined in env otherwise.
-
-
-ENVFILE="`dirname $0`../bin/env"
-
-. $ENVFILE
-
-if [ $# -ge 1 ] ; then
- LIST_OF_GROUPS="$*"
-elif [ "$LIST_OF_GROUPS" = "" ] ; then
- echo "LIST_OF_GROUPS is empty in $ENVFILE"
- exit 1
-fi
-
-
-for GROUP in $LIST_OF_GROUPS; do
- (
- echo "To: @MAILPLUS@admin-$GROUP"
- echo "Subject: Down router report - $GROUP"
- echo "Precedence: bulk"
- echo ""
- DIR=$BASEDIR/$GROUP
- if [ -s $DIR/routers.down ]; then
- (
-
- cat << EOM
-
- The following $GROUP routers are listed as other than up.
-
- Routers listed as "up" in rancid's router.db are polled several
-times daily. This list is of routers that are not listed as up and therefore
-not polled.
-
-EOM
-
- cat $DIR/routers.down;
-
- )
-
- else
- (
-
- cat << EOM
-
- No routers are down/ticketed for router group $GROUP (yay).
-
-EOM
-
- )
- fi
- ) | sendmail -t
-
-done
diff --git a/util/lg/Makefile.in b/util/lg/Makefile.in
deleted file mode 100644
index 54b42a6..0000000
--- a/util/lg/Makefile.in
+++ /dev/null
@@ -1,43 +0,0 @@
-PREFIX = @prefix@
-
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-
-UTIL_LG_PROGS = @RD_UTIL_LG_PROGS@
-
-DISTDIR=../$(distdir)/lg
-
-all:
-
-install: all
- for file in $(UTIL_LG_PROGS) ; do \
- $(INSTALL) $$file $(PREFIX)/util/lg; \
- done; \
- if test -f $(PREFIX)/util/lg/lg.conf ; then \
- echo "WARNING: *** $(PREFIX)/util/lg/lg.conf exists: installing as lg.conf.new."; \
- echo " *** review lg.conf.new for new/deprecated switches"; \
- $(INSTALL_DATA) lg.conf $(PREFIX)/util/lg/lg.conf.new; \
- else \
- $(INSTALL_DATA) lg.conf $(PREFIX)/util/lg; \
- fi; \
- for file in *README* *.html; do \
- $(INSTALL_DATA) $$file $(PREFIX)/util/lg; \
- done
-
-clean:
-
-distclean: clean
- rm -f Makefile $(UTIL_LG_PROGS) lg.conf
- rm -f config.log config.status
-
-distdir:
- test -d $(DISTDIR) \
- || mkdir $(DISTDIR) \
- || exit 1; \
- chmod 777 $(DISTDIR); \
- for file in Makefile.in configure.in *README* *.html lg.conf.in ; do \
- $(INSTALL_DATA) $$file $(DISTDIR); \
- done; \
- for file in configure $(UTIL_LG_PROGS:=.in) ; do \
- $(INSTALL) $$file $(DISTDIR); \
- done
diff --git a/util/lg/README b/util/lg/README
deleted file mode 100644
index faa4120..0000000
--- a/util/lg/README
+++ /dev/null
@@ -1,76 +0,0 @@
-This is a looking glass based on Ed Kern's which used to be available on
-http://nitrous.digex.net/. This version supports cisco, juniper, and
-foundry, using rancid's [cfj]login to login (so rcmd is not necessary,
-it can use telnet, ssh, or rsh), and has some additional commands
-implemented. There are a few cisco commands where either no juniper or
-foundry equivalent exists or we have not had time to implement yet.
-
-packing list:
-README This file.
-index.html often the default document the server will load, contains
- an html redirect to load lgform.cgi
-lg.conf looking glass configuration file
-lg.cgi work horse of the looking glass
-lgform.cgi front-end form for the looking glass engine
-lgnotes.html user info for the looking glass
-
-the looking glass requires the CGI and LockFile-Simple perl modules.
-these can be retrieved from CPAN, http://www.cpan.org/. CGI's home is
-ftp://ftp-genome.wi.mit.edu/pub/software/WWW/. it also requires
-the POSIX module (for strftime) and Sys::Syslog, which i believe come
-with perl5 and/or are converted with h2ph(1).
-
-basic installation instructions:
-
-The configure and make install process will make variable substitutions
-and install bits in /usr/local/rancid/util/lg (or <prefix>/util/lg).
-
-1) make the scripts/html available to your server (httpd) by
- creating a directory in your server's document root directory
- (apache's httpd.conf "DocumentRoot" variable).
- eg: assuming the default in freebsd's apache pkg
- mkdir /usr/local/www/data/lg
-
- then either:
- - copy the files {lgnotes.html, lg.cgi, lgform.cgi} to
- /usr/local/www/data/lg
- OR
- - create symlinks from /usr/local/www/data/lg to each of {lgnotes.html,
- lg.cgi, lgform.cgi} in /usr/local/rancid/util/lg
-
- note on links: if you use symlinks, you have to configure apache to
- allow following symlinks. eg:
- % cat /usr/local/www/data/lg/.htaccess
- Options FollowSymLinks ExecCGI
-
- note on index.html: index.html is typically the default file loaded
- when a url ends with a '/'. index.html can be used to redirect this
- to lgform.cgi using a netscape meta refresh. Though this is supported
- by many browsers, it is supposedly netscape specific and non-standard.
- In apache, the same thing can be acheived by altering the default
- directory index like this:
-
- % cat /usr/local/www/data/lg/.htaccess
- DirectoryIndex lgform.cgi
-
-2) the LG needs to be able to find and read lg.conf. by default this
- is installed as <PREFIX>/util/lg/lg.conf and the LG will first look in
- its CWD (current working directory) and then <PREFIX>/util/lg/lg.conf if
- it does not exist in the CWD. However the LG_CONF environment variable can
- be used to move it elsewhere.
-
- to get LG_CONF into the enviroment, you can use SetEnvIf in apache's
- httpd.conf. for example:
- SetEnvIf Request_URI "\/lg/.*.cgi" LG_CONF=/usr/local/util/lg/lg.conf
-
-3) edit <PREFIX>/util/lg/lg.conf.
-
-4) set-up cron jobs to rotate the log file and clean out old cache files.
- see LG_CACHE_DIR & LG_LOG in lg.conf. something like (YMMV):
-
- # rotate lookingglass log
- #0 0 * * * cd /usr/local/www/data/lg/tmp; /usr/local/etc/savelog -m 666 -c14 lg.log
- 0 0 * * * cd /usr/local/www/data/lg/tmp; /bin/mv lg.log lg.log.0
- # clean out the lookingglass cache
- 0 0 * * * cd /usr/local/www/data/lg/tmp; /usr/local/bin/find . -type f -maxdepth 1 \( \! -name lg.log\* \) -mtime +1 -exec rm -f {} \;
-
diff --git a/util/lg/configure b/util/lg/configure
deleted file mode 100755
index e41f619..0000000
--- a/util/lg/configure
+++ /dev/null
@@ -1,991 +0,0 @@
-#! /bin/sh
-
-# Guess values for system-dependent variables and create Makefiles.
-# Generated automatically using autoconf version 2.13
-# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
-#
-# This configure script is free software; the Free Software Foundation
-# gives unlimited permission to copy, distribute and modify it.
-
-# Defaults:
-ac_help=
-ac_default_prefix=/usr/local
-# Any additions from configure.in:
-ac_default_prefix=/usr/local/rancid
-
-# Initialize some variables set by options.
-# The variables have the same names as the options, with
-# dashes changed to underlines.
-build=NONE
-cache_file=./config.cache
-exec_prefix=NONE
-host=NONE
-no_create=
-nonopt=NONE
-no_recursion=
-prefix=NONE
-program_prefix=NONE
-program_suffix=NONE
-program_transform_name=s,x,x,
-silent=
-site=
-srcdir=
-target=NONE
-verbose=
-x_includes=NONE
-x_libraries=NONE
-bindir='${exec_prefix}/bin'
-sbindir='${exec_prefix}/sbin'
-libexecdir='${exec_prefix}/libexec'
-datadir='${prefix}/share'
-sysconfdir='${prefix}/etc'
-sharedstatedir='${prefix}/com'
-localstatedir='${prefix}/var'
-libdir='${exec_prefix}/lib'
-includedir='${prefix}/include'
-oldincludedir='/usr/include'
-infodir='${prefix}/info'
-mandir='${prefix}/man'
-
-# Initialize some other variables.
-subdirs=
-MFLAGS= MAKEFLAGS=
-SHELL=${CONFIG_SHELL-/bin/sh}
-# Maximum number of lines to put in a shell here document.
-ac_max_here_lines=12
-
-ac_prev=
-for ac_option
-do
-
- # If the previous option needs an argument, assign it.
- if test -n "$ac_prev"; then
- eval "$ac_prev=\$ac_option"
- ac_prev=
- continue
- fi
-
- case "$ac_option" in
- -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
- *) ac_optarg= ;;
- esac
-
- # Accept the important Cygnus configure options, so we can diagnose typos.
-
- case "$ac_option" in
-
- -bindir | --bindir | --bindi | --bind | --bin | --bi)
- ac_prev=bindir ;;
- -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
- bindir="$ac_optarg" ;;
-
- -build | --build | --buil | --bui | --bu)
- ac_prev=build ;;
- -build=* | --build=* | --buil=* | --bui=* | --bu=*)
- build="$ac_optarg" ;;
-
- -cache-file | --cache-file | --cache-fil | --cache-fi \
- | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
- ac_prev=cache_file ;;
- -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
- | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
- cache_file="$ac_optarg" ;;
-
- -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
- ac_prev=datadir ;;
- -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
- | --da=*)
- datadir="$ac_optarg" ;;
-
- -disable-* | --disable-*)
- ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
- # Reject names that are not valid shell variable names.
- if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
- { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
- fi
- ac_feature=`echo $ac_feature| sed 's/-/_/g'`
- eval "enable_${ac_feature}=no" ;;
-
- -enable-* | --enable-*)
- ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
- # Reject names that are not valid shell variable names.
- if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
- { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
- fi
- ac_feature=`echo $ac_feature| sed 's/-/_/g'`
- case "$ac_option" in
- *=*) ;;
- *) ac_optarg=yes ;;
- esac
- eval "enable_${ac_feature}='$ac_optarg'" ;;
-
- -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
- | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
- | --exec | --exe | --ex)
- ac_prev=exec_prefix ;;
- -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
- | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
- | --exec=* | --exe=* | --ex=*)
- exec_prefix="$ac_optarg" ;;
-
- -gas | --gas | --ga | --g)
- # Obsolete; use --with-gas.
- with_gas=yes ;;
-
- -help | --help | --hel | --he)
- # Omit some internal or obsolete options to make the list less imposing.
- # This message is too long to be a string in the A/UX 3.1 sh.
- cat << EOF
-Usage: configure [options] [host]
-Options: [defaults in brackets after descriptions]
-Configuration:
- --cache-file=FILE cache test results in FILE
- --help print this message
- --no-create do not create output files
- --quiet, --silent do not print \`checking...' messages
- --version print the version of autoconf that created configure
-Directory and file names:
- --prefix=PREFIX install architecture-independent files in PREFIX
- [$ac_default_prefix]
- --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
- [same as prefix]
- --bindir=DIR user executables in DIR [EPREFIX/bin]
- --sbindir=DIR system admin executables in DIR [EPREFIX/sbin]
- --libexecdir=DIR program executables in DIR [EPREFIX/libexec]
- --datadir=DIR read-only architecture-independent data in DIR
- [PREFIX/share]
- --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc]
- --sharedstatedir=DIR modifiable architecture-independent data in DIR
- [PREFIX/com]
- --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var]
- --libdir=DIR object code libraries in DIR [EPREFIX/lib]
- --includedir=DIR C header files in DIR [PREFIX/include]
- --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include]
- --infodir=DIR info documentation in DIR [PREFIX/info]
- --mandir=DIR man documentation in DIR [PREFIX/man]
- --srcdir=DIR find the sources in DIR [configure dir or ..]
- --program-prefix=PREFIX prepend PREFIX to installed program names
- --program-suffix=SUFFIX append SUFFIX to installed program names
- --program-transform-name=PROGRAM
- run sed PROGRAM on installed program names
-EOF
- cat << EOF
-Host type:
- --build=BUILD configure for building on BUILD [BUILD=HOST]
- --host=HOST configure for HOST [guessed]
- --target=TARGET configure for TARGET [TARGET=HOST]
-Features and packages:
- --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
- --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
- --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
- --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
- --x-includes=DIR X include files are in DIR
- --x-libraries=DIR X library files are in DIR
-EOF
- if test -n "$ac_help"; then
- echo "--enable and --with options recognized:$ac_help"
- fi
- exit 0 ;;
-
- -host | --host | --hos | --ho)
- ac_prev=host ;;
- -host=* | --host=* | --hos=* | --ho=*)
- host="$ac_optarg" ;;
-
- -includedir | --includedir | --includedi | --included | --include \
- | --includ | --inclu | --incl | --inc)
- ac_prev=includedir ;;
- -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
- | --includ=* | --inclu=* | --incl=* | --inc=*)
- includedir="$ac_optarg" ;;
-
- -infodir | --infodir | --infodi | --infod | --info | --inf)
- ac_prev=infodir ;;
- -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
- infodir="$ac_optarg" ;;
-
- -libdir | --libdir | --libdi | --libd)
- ac_prev=libdir ;;
- -libdir=* | --libdir=* | --libdi=* | --libd=*)
- libdir="$ac_optarg" ;;
-
- -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
- | --libexe | --libex | --libe)
- ac_prev=libexecdir ;;
- -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
- | --libexe=* | --libex=* | --libe=*)
- libexecdir="$ac_optarg" ;;
-
- -localstatedir | --localstatedir | --localstatedi | --localstated \
- | --localstate | --localstat | --localsta | --localst \
- | --locals | --local | --loca | --loc | --lo)
- ac_prev=localstatedir ;;
- -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
- | --localstate=* | --localstat=* | --localsta=* | --localst=* \
- | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
- localstatedir="$ac_optarg" ;;
-
- -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
- ac_prev=mandir ;;
- -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
- mandir="$ac_optarg" ;;
-
- -nfp | --nfp | --nf)
- # Obsolete; use --without-fp.
- with_fp=no ;;
-
- -no-create | --no-create | --no-creat | --no-crea | --no-cre \
- | --no-cr | --no-c)
- no_create=yes ;;
-
- -no-recursion | --no-recursion | --no-recursio | --no-recursi \
- | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
- no_recursion=yes ;;
-
- -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
- | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
- | --oldin | --oldi | --old | --ol | --o)
- ac_prev=oldincludedir ;;
- -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
- | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
- | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
- oldincludedir="$ac_optarg" ;;
-
- -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
- ac_prev=prefix ;;
- -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
- prefix="$ac_optarg" ;;
-
- -program-prefix | --program-prefix | --program-prefi | --program-pref \
- | --program-pre | --program-pr | --program-p)
- ac_prev=program_prefix ;;
- -program-prefix=* | --program-prefix=* | --program-prefi=* \
- | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
- program_prefix="$ac_optarg" ;;
-
- -program-suffix | --program-suffix | --program-suffi | --program-suff \
- | --program-suf | --program-su | --program-s)
- ac_prev=program_suffix ;;
- -program-suffix=* | --program-suffix=* | --program-suffi=* \
- | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
- program_suffix="$ac_optarg" ;;
-
- -program-transform-name | --program-transform-name \
- | --program-transform-nam | --program-transform-na \
- | --program-transform-n | --program-transform- \
- | --program-transform | --program-transfor \
- | --program-transfo | --program-transf \
- | --program-trans | --program-tran \
- | --progr-tra | --program-tr | --program-t)
- ac_prev=program_transform_name ;;
- -program-transform-name=* | --program-transform-name=* \
- | --program-transform-nam=* | --program-transform-na=* \
- | --program-transform-n=* | --program-transform-=* \
- | --program-transform=* | --program-transfor=* \
- | --program-transfo=* | --program-transf=* \
- | --program-trans=* | --program-tran=* \
- | --progr-tra=* | --program-tr=* | --program-t=*)
- program_transform_name="$ac_optarg" ;;
-
- -q | -quiet | --quiet | --quie | --qui | --qu | --q \
- | -silent | --silent | --silen | --sile | --sil)
- silent=yes ;;
-
- -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
- ac_prev=sbindir ;;
- -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
- | --sbi=* | --sb=*)
- sbindir="$ac_optarg" ;;
-
- -sharedstatedir | --sharedstatedir | --sharedstatedi \
- | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
- | --sharedst | --shareds | --shared | --share | --shar \
- | --sha | --sh)
- ac_prev=sharedstatedir ;;
- -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
- | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
- | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
- | --sha=* | --sh=*)
- sharedstatedir="$ac_optarg" ;;
-
- -site | --site | --sit)
- ac_prev=site ;;
- -site=* | --site=* | --sit=*)
- site="$ac_optarg" ;;
-
- -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
- ac_prev=srcdir ;;
- -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
- srcdir="$ac_optarg" ;;
-
- -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
- | --syscon | --sysco | --sysc | --sys | --sy)
- ac_prev=sysconfdir ;;
- -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
- | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
- sysconfdir="$ac_optarg" ;;
-
- -target | --target | --targe | --targ | --tar | --ta | --t)
- ac_prev=target ;;
- -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
- target="$ac_optarg" ;;
-
- -v | -verbose | --verbose | --verbos | --verbo | --verb)
- verbose=yes ;;
-
- -version | --version | --versio | --versi | --vers)
- echo "configure generated by autoconf version 2.13"
- exit 0 ;;
-
- -with-* | --with-*)
- ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
- # Reject names that are not valid shell variable names.
- if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
- { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
- fi
- ac_package=`echo $ac_package| sed 's/-/_/g'`
- case "$ac_option" in
- *=*) ;;
- *) ac_optarg=yes ;;
- esac
- eval "with_${ac_package}='$ac_optarg'" ;;
-
- -without-* | --without-*)
- ac_package=`echo $ac_option|sed -e 's/-*without-//'`
- # Reject names that are not valid shell variable names.
- if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
- { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
- fi
- ac_package=`echo $ac_package| sed 's/-/_/g'`
- eval "with_${ac_package}=no" ;;
-
- --x)
- # Obsolete; use --with-x.
- with_x=yes ;;
-
- -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
- | --x-incl | --x-inc | --x-in | --x-i)
- ac_prev=x_includes ;;
- -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
- | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
- x_includes="$ac_optarg" ;;
-
- -x-libraries | --x-libraries | --x-librarie | --x-librari \
- | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
- ac_prev=x_libraries ;;
- -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
- | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
- x_libraries="$ac_optarg" ;;
-
- -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
- ;;
-
- *)
- if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
- echo "configure: warning: $ac_option: invalid host type" 1>&2
- fi
- if test "x$nonopt" != xNONE; then
- { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
- fi
- nonopt="$ac_option"
- ;;
-
- esac
-done
-
-if test -n "$ac_prev"; then
- { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
-fi
-
-trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
-
-# File descriptor usage:
-# 0 standard input
-# 1 file creation
-# 2 errors and warnings
-# 3 some systems may open it to /dev/tty
-# 4 used on the Kubota Titan
-# 6 checking for... messages and results
-# 5 compiler messages saved in config.log
-if test "$silent" = yes; then
- exec 6>/dev/null
-else
- exec 6>&1
-fi
-exec 5>./config.log
-
-echo "\
-This file contains any messages produced by compilers while
-running configure, to aid debugging if configure makes a mistake.
-" 1>&5
-
-# Strip out --no-create and --no-recursion so they do not pile up.
-# Also quote any args containing shell metacharacters.
-ac_configure_args=
-for ac_arg
-do
- case "$ac_arg" in
- -no-create | --no-create | --no-creat | --no-crea | --no-cre \
- | --no-cr | --no-c) ;;
- -no-recursion | --no-recursion | --no-recursio | --no-recursi \
- | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
- *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
- ac_configure_args="$ac_configure_args '$ac_arg'" ;;
- *) ac_configure_args="$ac_configure_args $ac_arg" ;;
- esac
-done
-
-# NLS nuisances.
-# Only set these to C if already set. These must not be set unconditionally
-# because not all systems understand e.g. LANG=C (notably SCO).
-# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
-# Non-C LC_CTYPE values break the ctype check.
-if test "${LANG+set}" = set; then LANG=C; export LANG; fi
-if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
-if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
-if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi
-
-# confdefs.h avoids OS command line length limits that DEFS can exceed.
-rm -rf conftest* confdefs.h
-# AIX cpp loses on an empty file, so make sure it contains at least a newline.
-echo > confdefs.h
-
-# A filename unique to this package, relative to the directory that
-# configure is in, which we can look for to find out if srcdir is correct.
-ac_unique_file=
-
-# Find the source files, if location was not specified.
-if test -z "$srcdir"; then
- ac_srcdir_defaulted=yes
- # Try the directory containing this script, then its parent.
- ac_prog=$0
- ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
- test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
- srcdir=$ac_confdir
- if test ! -r $srcdir/$ac_unique_file; then
- srcdir=..
- fi
-else
- ac_srcdir_defaulted=no
-fi
-if test ! -r $srcdir/$ac_unique_file; then
- if test "$ac_srcdir_defaulted" = yes; then
- { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
- else
- { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
- fi
-fi
-srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
-
-# Prefer explicitly selected file to automatically selected ones.
-if test -z "$CONFIG_SITE"; then
- if test "x$prefix" != xNONE; then
- CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
- else
- CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
- fi
-fi
-for ac_site_file in $CONFIG_SITE; do
- if test -r "$ac_site_file"; then
- echo "loading site script $ac_site_file"
- . "$ac_site_file"
- fi
-done
-
-if test -r "$cache_file"; then
- echo "loading cache $cache_file"
- . $cache_file
-else
- echo "creating cache $cache_file"
- > $cache_file
-fi
-
-ac_ext=c
-# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cc_cross
-
-ac_exeext=
-ac_objext=o
-if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
- # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
- if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
- ac_n= ac_c='
-' ac_t=' '
- else
- ac_n=-n ac_c= ac_t=
- fi
-else
- ac_n= ac_c='\c' ac_t=
-fi
-
-
-
-ac_aux_dir=
-for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
- if test -f $ac_dir/install-sh; then
- ac_aux_dir=$ac_dir
- ac_install_sh="$ac_aux_dir/install-sh -c"
- break
- elif test -f $ac_dir/install.sh; then
- ac_aux_dir=$ac_dir
- ac_install_sh="$ac_aux_dir/install.sh -c"
- break
- fi
-done
-if test -z "$ac_aux_dir"; then
- { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; }
-fi
-ac_config_guess=$ac_aux_dir/config.guess
-ac_config_sub=$ac_aux_dir/config.sub
-ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
-
-subdirs="lg"
-
-
-
-
-# Find a good install program. We prefer a C program (faster),
-# so one script is as good as another. But avoid the broken or
-# incompatible versions:
-# SysV /etc/install, /usr/sbin/install
-# SunOS /usr/etc/install
-# IRIX /sbin/install
-# AIX /bin/install
-# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
-# AFS /usr/afsws/bin/install, which mishandles nonexistent args
-# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
-# ./install, which can be erroneously created by make from ./install.sh.
-echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
-echo "configure:563: checking for a BSD compatible install" >&5
-if test -z "$INSTALL"; then
-if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":"
- for ac_dir in $PATH; do
- # Account for people who put trailing slashes in PATH elements.
- case "$ac_dir/" in
- /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
- *)
- # OSF1 and SCO ODT 3.0 have their own names for install.
- # Don't use installbsd from OSF since it installs stuff as root
- # by default.
- for ac_prog in ginstall scoinst install; do
- if test -f $ac_dir/$ac_prog; then
- if test $ac_prog = install &&
- grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
- # AIX install. It has an incompatible calling convention.
- :
- else
- ac_cv_path_install="$ac_dir/$ac_prog -c"
- break 2
- fi
- fi
- done
- ;;
- esac
- done
- IFS="$ac_save_IFS"
-
-fi
- if test "${ac_cv_path_install+set}" = set; then
- INSTALL="$ac_cv_path_install"
- else
- # As a last resort, use the slow shell script. We don't cache a
- # path for INSTALL within a source directory, because that will
- # break other packages using the cache if that directory is
- # removed, or if the path is relative.
- INSTALL="$ac_install_sh"
- fi
-fi
-echo "$ac_t""$INSTALL" 1>&6
-
-# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
-# It thinks the first close brace ends the variable substitution.
-test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
-
-test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
-
-test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
-
-
-RD_UTIL_LG_PROGS=$rd_cv_rd_util_lg_progs
-
-
-PERLV_PATH=$ac_cv_path_PERLV_PATH
-
-
-LG_PING_CMD=$rd_cv_lg_ping_cmd
-
-
-ENV_PATH=$ac_cv_env_path
-
-
-trap '' 1 2 15
-cat > confcache <<\EOF
-# This file is a shell script that caches the results of configure
-# tests run on this system so they can be shared between configure
-# scripts and configure runs. It is not useful on other systems.
-# If it contains results you don't want to keep, you may remove or edit it.
-#
-# By default, configure uses ./config.cache as the cache file,
-# creating it if it does not exist already. You can give configure
-# the --cache-file=FILE option to use a different cache file; that is
-# what configure does when it calls configure scripts in
-# subdirectories, so they share the cache.
-# Giving --cache-file=/dev/null disables caching, for debugging configure.
-# config.status only pays attention to the cache file if you give it the
-# --recheck option to rerun configure.
-#
-EOF
-# The following way of writing the cache mishandles newlines in values,
-# but we know of no workaround that is simple, portable, and efficient.
-# So, don't put newlines in cache variables' values.
-# Ultrix sh set writes to stderr and can't be redirected directly,
-# and sets the high bit in the cache file unless we assign to the vars.
-(set) 2>&1 |
- case `(ac_space=' '; set | grep ac_space) 2>&1` in
- *ac_space=\ *)
- # `set' does not quote correctly, so add quotes (double-quote substitution
- # turns \\\\ into \\, and sed turns \\ into \).
- sed -n \
- -e "s/'/'\\\\''/g" \
- -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
- ;;
- *)
- # `set' quotes correctly as required by POSIX, so do not add quotes.
- sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
- ;;
- esac >> confcache
-if cmp -s $cache_file confcache; then
- :
-else
- if test -w $cache_file; then
- echo "updating cache $cache_file"
- cat confcache > $cache_file
- else
- echo "not updating unwritable cache $cache_file"
- fi
-fi
-rm -f confcache
-
-trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
-
-test "x$prefix" = xNONE && prefix=$ac_default_prefix
-# Let make expand exec_prefix.
-test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
-
-# Any assignment to VPATH causes Sun make to only execute
-# the first set of double-colon rules, so remove it if not needed.
-# If there is a colon in the path, we need to keep it.
-if test "x$srcdir" = x.; then
- ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d'
-fi
-
-trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
-
-# Transform confdefs.h into DEFS.
-# Protect against shell expansion while executing Makefile rules.
-# Protect against Makefile macro expansion.
-cat > conftest.defs <<\EOF
-s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%-D\1=\2%g
-s%[ `~#$^&*(){}\\|;'"<>?]%\\&%g
-s%\[%\\&%g
-s%\]%\\&%g
-s%\$%$$%g
-EOF
-DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' '`
-rm -f conftest.defs
-
-
-# Without the "./", some shells look in PATH for config.status.
-: ${CONFIG_STATUS=./config.status}
-
-echo creating $CONFIG_STATUS
-rm -f $CONFIG_STATUS
-cat > $CONFIG_STATUS <<EOF
-#! /bin/sh
-# Generated automatically by configure.
-# Run this file to recreate the current configuration.
-# This directory was configured as follows,
-# on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
-#
-# $0 $ac_configure_args
-#
-# Compiler output produced by configure, useful for debugging
-# configure, is in ./config.log if it exists.
-
-ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
-for ac_option
-do
- case "\$ac_option" in
- -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
- echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
- exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
- -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
- echo "$CONFIG_STATUS generated by autoconf version 2.13"
- exit 0 ;;
- -help | --help | --hel | --he | --h)
- echo "\$ac_cs_usage"; exit 0 ;;
- *) echo "\$ac_cs_usage"; exit 1 ;;
- esac
-done
-
-ac_given_srcdir=$srcdir
-ac_given_INSTALL="$INSTALL"
-
-trap 'rm -fr `echo "Makefile lg.conf $RD_UTIL_LG_PROGS" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
-EOF
-cat >> $CONFIG_STATUS <<EOF
-
-# Protect against being on the right side of a sed subst in config.status.
-sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
- s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
-$ac_vpsub
-$extrasub
-s%@SHELL@%$SHELL%g
-s%@CFLAGS@%$CFLAGS%g
-s%@CPPFLAGS@%$CPPFLAGS%g
-s%@CXXFLAGS@%$CXXFLAGS%g
-s%@FFLAGS@%$FFLAGS%g
-s%@DEFS@%$DEFS%g
-s%@LDFLAGS@%$LDFLAGS%g
-s%@LIBS@%$LIBS%g
-s%@exec_prefix@%$exec_prefix%g
-s%@prefix@%$prefix%g
-s%@program_transform_name@%$program_transform_name%g
-s%@bindir@%$bindir%g
-s%@sbindir@%$sbindir%g
-s%@libexecdir@%$libexecdir%g
-s%@datadir@%$datadir%g
-s%@sysconfdir@%$sysconfdir%g
-s%@sharedstatedir@%$sharedstatedir%g
-s%@localstatedir@%$localstatedir%g
-s%@libdir@%$libdir%g
-s%@includedir@%$includedir%g
-s%@oldincludedir@%$oldincludedir%g
-s%@infodir@%$infodir%g
-s%@mandir@%$mandir%g
-s%@subdirs@%$subdirs%g
-s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
-s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
-s%@INSTALL_DATA@%$INSTALL_DATA%g
-s%@RD_UTIL_LG_PROGS@%$RD_UTIL_LG_PROGS%g
-s%@PERLV_PATH@%$PERLV_PATH%g
-s%@LG_PING_CMD@%$LG_PING_CMD%g
-s%@ENV_PATH@%$ENV_PATH%g
-
-CEOF
-EOF
-
-cat >> $CONFIG_STATUS <<\EOF
-
-# Split the substitutions into bite-sized pieces for seds with
-# small command number limits, like on Digital OSF/1 and HP-UX.
-ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
-ac_file=1 # Number of current file.
-ac_beg=1 # First line for current file.
-ac_end=$ac_max_sed_cmds # Line after last line for current file.
-ac_more_lines=:
-ac_sed_cmds=""
-while $ac_more_lines; do
- if test $ac_beg -gt 1; then
- sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
- else
- sed "${ac_end}q" conftest.subs > conftest.s$ac_file
- fi
- if test ! -s conftest.s$ac_file; then
- ac_more_lines=false
- rm -f conftest.s$ac_file
- else
- if test -z "$ac_sed_cmds"; then
- ac_sed_cmds="sed -f conftest.s$ac_file"
- else
- ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
- fi
- ac_file=`expr $ac_file + 1`
- ac_beg=$ac_end
- ac_end=`expr $ac_end + $ac_max_sed_cmds`
- fi
-done
-if test -z "$ac_sed_cmds"; then
- ac_sed_cmds=cat
-fi
-EOF
-
-cat >> $CONFIG_STATUS <<EOF
-
-CONFIG_FILES=\${CONFIG_FILES-"Makefile lg.conf $RD_UTIL_LG_PROGS"}
-EOF
-cat >> $CONFIG_STATUS <<\EOF
-for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
- # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
- case "$ac_file" in
- *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
- ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
- *) ac_file_in="${ac_file}.in" ;;
- esac
-
- # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
-
- # Remove last slash and all that follows it. Not all systems have dirname.
- ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
- if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
- # The file is in a subdirectory.
- test ! -d "$ac_dir" && mkdir "$ac_dir"
- ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
- # A "../" for each directory in $ac_dir_suffix.
- ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
- else
- ac_dir_suffix= ac_dots=
- fi
-
- case "$ac_given_srcdir" in
- .) srcdir=.
- if test -z "$ac_dots"; then top_srcdir=.
- else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
- /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
- *) # Relative path.
- srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
- top_srcdir="$ac_dots$ac_given_srcdir" ;;
- esac
-
- case "$ac_given_INSTALL" in
- [/$]*) INSTALL="$ac_given_INSTALL" ;;
- *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
- esac
-
- echo creating "$ac_file"
- rm -f "$ac_file"
- configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
- case "$ac_file" in
- *Makefile*) ac_comsub="1i\\
-# $configure_input" ;;
- *) ac_comsub= ;;
- esac
-
- ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
- sed -e "$ac_comsub
-s%@configure_input@%$configure_input%g
-s%@srcdir@%$srcdir%g
-s%@top_srcdir@%$top_srcdir%g
-s%@INSTALL@%$INSTALL%g
-" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
-fi; done
-rm -f conftest.s*
-
-EOF
-cat >> $CONFIG_STATUS <<EOF
-
-EOF
-cat >> $CONFIG_STATUS <<\EOF
-
-exit 0
-EOF
-chmod +x $CONFIG_STATUS
-rm -fr confdefs* $ac_clean_files
-test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
-
-if test "$no_recursion" != yes; then
-
- # Remove --cache-file and --srcdir arguments so they do not pile up.
- ac_sub_configure_args=
- ac_prev=
- for ac_arg in $ac_configure_args; do
- if test -n "$ac_prev"; then
- ac_prev=
- continue
- fi
- case "$ac_arg" in
- -cache-file | --cache-file | --cache-fil | --cache-fi \
- | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
- ac_prev=cache_file ;;
- -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
- | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
- ;;
- -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
- ac_prev=srcdir ;;
- -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
- ;;
- *) ac_sub_configure_args="$ac_sub_configure_args $ac_arg" ;;
- esac
- done
-
- for ac_config_dir in lg; do
-
- # Do not complain, so a configure script can configure whichever
- # parts of a large source tree are present.
- if test ! -d $srcdir/$ac_config_dir; then
- continue
- fi
-
- echo configuring in $ac_config_dir
-
- case "$srcdir" in
- .) ;;
- *)
- if test -d ./$ac_config_dir || mkdir ./$ac_config_dir; then :;
- else
- { echo "configure: error: can not create `pwd`/$ac_config_dir" 1>&2; exit 1; }
- fi
- ;;
- esac
-
- ac_popdir=`pwd`
- cd $ac_config_dir
-
- # A "../" for each directory in /$ac_config_dir.
- ac_dots=`echo $ac_config_dir|sed -e 's%^\./%%' -e 's%[^/]$%&/%' -e 's%[^/]*/%../%g'`
-
- case "$srcdir" in
- .) # No --srcdir option. We are building in place.
- ac_sub_srcdir=$srcdir ;;
- /*) # Absolute path.
- ac_sub_srcdir=$srcdir/$ac_config_dir ;;
- *) # Relative path.
- ac_sub_srcdir=$ac_dots$srcdir/$ac_config_dir ;;
- esac
-
- # Check for guested configure; otherwise get Cygnus style configure.
- if test -f $ac_sub_srcdir/configure; then
- ac_sub_configure=$ac_sub_srcdir/configure
- elif test -f $ac_sub_srcdir/configure.in; then
- ac_sub_configure=$ac_configure
- else
- echo "configure: warning: no configuration information is in $ac_config_dir" 1>&2
- ac_sub_configure=
- fi
-
- # The recursion is here.
- if test -n "$ac_sub_configure"; then
-
- # Make the cache file name correct relative to the subdirectory.
- case "$cache_file" in
- /*) ac_sub_cache_file=$cache_file ;;
- *) # Relative path.
- ac_sub_cache_file="$ac_dots$cache_file" ;;
- esac
- case "$ac_given_INSTALL" in
- [/$]*) INSTALL="$ac_given_INSTALL" ;;
- *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
- esac
-
- echo "running ${CONFIG_SHELL-/bin/sh} $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_sub_srcdir"
- # The eval makes quoting arguments work.
- if eval ${CONFIG_SHELL-/bin/sh} $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_sub_srcdir
- then :
- else
- { echo "configure: error: $ac_sub_configure failed for $ac_config_dir" 1>&2; exit 1; }
- fi
- fi
-
- cd $ac_popdir
- done
-fi
-
-
-# fix permissions on scripts.
-for file in $RD_UTIL_LG_PROGS; do chmod a+x $file; done
diff --git a/util/lg/configure.in b/util/lg/configure.in
deleted file mode 100644
index 445b74d..0000000
--- a/util/lg/configure.in
+++ /dev/null
@@ -1,27 +0,0 @@
-dnl Process this file with autoconf to produce a configure script.
-AC_INIT()
-
-AC_CONFIG_SUBDIRS(lg)
-
-dnl default install location
-AC_PREFIX_DEFAULT(/usr/local/rancid)
-
-dnl install program(s)
-AC_PROG_INSTALL
-
-RD_UTIL_LG_PROGS=$rd_cv_rd_util_lg_progs
-AC_SUBST(RD_UTIL_LG_PROGS)
-
-PERLV_PATH=$ac_cv_path_PERLV_PATH
-AC_SUBST(PERLV_PATH)
-
-LG_PING_CMD=$rd_cv_lg_ping_cmd
-AC_SUBST(LG_PING_CMD)
-
-ENV_PATH=$ac_cv_env_path
-AC_SUBST(ENV_PATH)
-
-AC_OUTPUT(Makefile lg.conf $RD_UTIL_LG_PROGS)
-
-# fix permissions on scripts.
-for file in $RD_UTIL_LG_PROGS; do chmod a+x $file; done
diff --git a/util/lg/lg.conf.in b/util/lg/lg.conf.in
deleted file mode 100644
index d13d9fd..0000000
--- a/util/lg/lg.conf.in
+++ /dev/null
@@ -1,105 +0,0 @@
-# configuration file for the looking glass
-#
-# note: these are perl statements! mind the syntax
-#
-# adjust the path to find [cfj]login, telnet, ssh, rsh, etc.
-#
-$ENV{PATH}="@prefix@/bin:@ENV_PATH@";
-#
-#
-# LG_CACHE_DIR is the location of the cache directory. the LG uses this
-# to hold lock files, the default log file (lg.log), and o/p from
-# commands that can be very verbose. it defaults to "tmp",
-# ie: relative to the directory where lg.cgi runs in your
-# server's (httpd) DocumentRoot (eg: /usr/local/www/data/lg/tmp).
-#
-#$LG_CACHE_DIR="./tmp";
-#
-#
-# LG_CLOGINRC is the .cloginrc that the LG should use. it defaults to
-# <prefix>/.cloginrc. note that the .cloginrc must be readable
-# by the user or group (UID / GID) that will be running the CGI
-# and the clogin (and friends) will not allow a world readable
-# .cloginrc. this is normally the user the server (httpd) runs
-# under.
-#
-#$LG_CLOGINRC="@prefix@/.cloginrc";
-#
-#
-# LG_IMAGE is the filename of an image you wish to appear at the top
-# of the LG pages. it can also be other html goo, like
-# the first example. this is just handed to print, so \n and
-# the like will work.
-#
-#$LG_IMAGE="<img src=/icons/rancid.gif hspace=0>\n <font size=+2>FOO</font>";
-#$LG_IMAGE="<img src=rancid.gif hspace=0>\n";
-#
-#
-# LG_INFO is info in html format to output at the bottom of main form.
-# it might be local contact information, disclaimer, etc. this
-# is just handed to print, so \n and the like will work.
-#
-#$LG_INFO="For support, contact <a href=\"mailto:webmaster\@localhost\">webmaster</a>";
-#
-#
-# LG_LOG is either a FQPN (fully qualified path name) or the syslog
-# facility to use for logging. if not defined, the LG
-# will log to LG_CACHE_DIR/lg.log. possible syslog facility
-# values are from the facility codes in /usr/include/syslog.h
-# minus the 'LOG_' and lower case.
-#
-#$LG_LOG="$LG_CACHE_DIR/lg.log";
-#$LG_LOG="/tmp/lg.log";
-#$LG_LOG="local0";
-#
-#
-# LG_ROUTERDB is the router.db in rancid's router.db format, listing
-# the routers and their platform that should be available to
-# the looking glass. if defined, the LG will use this variable
-# to find the router.db. if not defined, it will look for it
-# at <prefix>/util/lg/router.db. if it does not exist, it will
-# build the list from <prefix>/*/router.db (ie: the router.db's
-# from all your groups). note that if you choose this last
-# option; the group directories and router.db files' modes may
-# have to be changed, depending upon the UID/GID of the user
-# your server (httpd) runs under, since rancid's default mask
-# is 007 (see bin/env). routers not marked 'up' are skipped.
-#
-#$LG_ROUTERDB="@prefix@/util/lg/router.db";
-#
-#
-# Options:
-#
-# LG_AS_REG *** not implemented.
-#
-#@LG_AS_REG=();
-#
-#
-# LG_BGP_RT allows a few bgp commands which can produce long output (heavy
-# router load), such as sh ip bgp neighbor <ip> advertised-routes
-# for a transit customer, sh ip b neigh <ip> received-routes for
-# a transit provider.
-#
-#$LG_BGP_RT=1
-#
-#
-# LG_CACHE_TIME is the number of seconds the LG should cache o/p from certain
-# commands; those that tend to produce a lot of o/p, such as
-# 'show ip bgp dampened-paths'. it defaults to 600 seconds
-# (10 minutes).
-#
-#$LG_CACHE_TIME=600;
-#
-#
-# LG_SINGLE serializes and limits queries per-router to one at a time via
-# per-router lock files.
-#
-#$LG_SINGLE=0;
-#
-# $LG_STRIP strips login o/p from the looking glass results. Expect
-# occassionally screws up disabling echo when passwords are
-# entered (NOTE SECURITY CONCERN). However, this o/p can be
-# very useful for debugging clogin problems.
-#
-$LG_STRIP=1;
-#
diff --git a/util/rtrfilter.README b/util/rtrfilter.README
deleted file mode 100644
index 19b64c3..0000000
--- a/util/rtrfilter.README
+++ /dev/null
@@ -1,14 +0,0 @@
-rtrfilter can be used to filter rancid diffs to avoid sending unwanted
-diffs to certain recipient(s) or diffs which those recipient(s) should
-not see without the need to create separate or duplicate group(s).
-
-/etc/aliases eg:
-
-rancid-foo: engineering,
- customer-ops-foo
-#
-# only send diffs for the SJC routers (aka. *.sjc.shrubbery.net)
-customer-ops-foo: "| /home/rancid/util/rtrfilter -i '\.sjc\.' -s 'sjc router diffs' customer-ops"
-#
-customer-ops: jimbob,
- sally