[hamradio-commits] [aprsdigi] 02/08: Imported Upstream version 2.4.4

Iain Learmonth irl-guest at moszumanska.debian.org
Sat Jul 4 16:36:19 UTC 2015


This is an automated email from the git hooks/post-receive script.

irl-guest pushed a commit to branch master
in repository aprsdigi.

commit 5f7d189dc3b619e6d218eea91f9efbec5c71d5ed
Author: Iain R. Learmonth <irl at fsfe.org>
Date:   Sat Jul 4 17:28:31 2015 +0100

    Imported Upstream version 2.4.4
---
 AUTHORS               |    1 +
 COPYING               |  341 ++++
 ChangeLog             |   86 +
 INSTALL               |   38 +
 Makefile.am           |   32 +
 Makefile.in           |  557 ++++++
 NEWS                  |   48 +
 README                |   40 +
 TODO                  |   37 +
 aclocal.m4            |  758 ++++++++
 aprsdigi.8            |  566 ++++++
 aprsdigi.c            | 2688 ++++++++++++++++++++++++++
 aprsdigi.html         |  770 ++++++++
 aprsdigi.lsm          |   23 +
 aprsdigi.spec         |   55 +
 aprsmon.8             |  181 ++
 aprsmon.c             |  361 ++++
 aprsmon.html          |  184 ++
 aprsshm.c             |  301 +++
 aprsshm.h             |    6 +
 configure             | 5045 +++++++++++++++++++++++++++++++++++++++++++++++++
 configure.in          |   70 +
 depcomp               |  423 +++++
 fiforead.8            |   17 +
 fiforead.c            |   60 +
 fiforead.html         |   54 +
 fifowrite.8           |   19 +
 fifowrite.c           |   55 +
 fifowrite.html        |   57 +
 install-sh            |  250 +++
 libax25ext.c          |  397 ++++
 libax25ext.h          |   36 +
 mic_e.c               |  254 +++
 mic_e.h               |   22 +
 mic_e_test.c          |   53 +
 missing               |  336 ++++
 mkinstalldirs         |   99 +
 parse_cooked_ax25.fig |  164 ++
 parse_cooked_ax25.pdf |  Bin 0 -> 4005 bytes
 testmcast.c           |  184 ++
 testparse.c           |  129 ++
 41 files changed, 14797 insertions(+)

diff --git a/AUTHORS b/AUTHORS
new file mode 100644
index 0000000..242cf21
--- /dev/null
+++ b/AUTHORS
@@ -0,0 +1 @@
+Alan Crosswell, n2ygk at weca.org
diff --git a/COPYING b/COPYING
new file mode 100644
index 0000000..86cf81a
--- /dev/null
+++ b/COPYING
@@ -0,0 +1,341 @@
+
+		    GNU GENERAL PUBLIC LICENSE
+		       Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+                          675 Mass Ave, Cambridge, MA 02139, USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+			    Preamble
+
+  The licenses for most software are designed to take away your
+freedom to share and change it.  By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users.  This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it.  (Some other Free Software Foundation software is covered by
+the GNU Library General Public License instead.)  You can apply it to
+your programs, too.
+
+  When we speak of free software, we are referring to freedom, not
+price.  Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+  To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+  For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have.  You must make sure that they, too, receive or can get the
+source code.  And you must show them these terms so they know their
+rights.
+
+  We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+  Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software.  If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+  Finally, any free program is threatened constantly by software
+patents.  We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary.  To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.
+

+		    GNU GENERAL PUBLIC LICENSE
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+  0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License.  The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language.  (Hereinafter, translation is included without limitation in
+the term "modification".)  Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope.  The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+  1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+  2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+    a) You must cause the modified files to carry prominent notices
+    stating that you changed the files and the date of any change.
+
+    b) You must cause any work that you distribute or publish, that in
+    whole or in part contains or is derived from the Program or any
+    part thereof, to be licensed as a whole at no charge to all third
+    parties under the terms of this License.
+
+    c) If the modified program normally reads commands interactively
+    when run, you must cause it, when started running for such
+    interactive use in the most ordinary way, to print or display an
+    announcement including an appropriate copyright notice and a
+    notice that there is no warranty (or else, saying that you provide
+    a warranty) and that users may redistribute the program under
+    these conditions, and telling the user how to view a copy of this
+    License.  (Exception: if the Program itself is interactive but
+    does not normally print such an announcement, your work based on
+    the Program is not required to print an announcement.)
+

+These requirements apply to the modified work as a whole.  If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works.  But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+  3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+    a) Accompany it with the complete corresponding machine-readable
+    source code, which must be distributed under the terms of Sections
+    1 and 2 above on a medium customarily used for software interchange; or,
+
+    b) Accompany it with a written offer, valid for at least three
+    years, to give any third party, for a charge no more than your
+    cost of physically performing source distribution, a complete
+    machine-readable copy of the corresponding source code, to be
+    distributed under the terms of Sections 1 and 2 above on a medium
+    customarily used for software interchange; or,
+
+    c) Accompany it with the information you received as to the offer
+    to distribute corresponding source code.  (This alternative is
+    allowed only for noncommercial distribution and only if you
+    received the program in object code or executable form with such
+    an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it.  For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable.  However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+

+  4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License.  Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+  5. You are not required to accept this License, since you have not
+signed it.  However, nothing else grants you permission to modify or
+distribute the Program or its derivative works.  These actions are
+prohibited by law if you do not accept this License.  Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+  6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions.  You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+  7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License.  If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all.  For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices.  Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+

+  8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded.  In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+  9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time.  Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number.  If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation.  If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+  10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission.  For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this.  Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+			    NO WARRANTY
+
+  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+		     END OF TERMS AND CONDITIONS
+

+	Appendix: How to Apply These Terms to Your New Programs
+
+  If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+  To do so, attach the following notices to the program.  It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+    <one line to give the program's name and a brief idea of what it does.>
+    Copyright (C) 19yy  <name of author>
+
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program; if not, write to the Free Software
+    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+    Gnomovision version 69, Copyright (C) 19yy name of author
+    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+    This is free software, and you are welcome to redistribute it
+    under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License.  Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary.  Here is a sample; alter the names:
+
+  Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+  `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+  <signature of Ty Coon>, 1 April 1989
+  Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs.  If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library.  If this is what you want to do, use the GNU Library General
+Public License instead of this License.
+
diff --git a/ChangeLog b/ChangeLog
new file mode 100644
index 0000000..5febf1d
--- /dev/null
+++ b/ChangeLog
@@ -0,0 +1,86 @@
+* Changes in aprsdigi-2.4.4, April 2003:
+
+
+* Changes in aprsdigi-2.4.3, April 2003:
+  - Add support for IP/UDP interface, including IPv4 and IPv6 unicast and
+    IPv4 any-source multicast (until I learn how to do SSM and v6 multicast).
+  - Add Unix fifo interface and two test programs, fiforead and fifowrite.
+    Mostly useful for debugging.
+  - "-p port:call...." for ax25 ports is deprecated.  Use "-p ax25:port:..."
+  - Add interfaces options to toggle TX-enable, RX-enable and don't retransmit
+    on received interface (e.g. for pt-to-pt and IP interface).
+  - Add budlist (permit/deny access lists).
+  - parse_cooked_ax25() and gen_cooked_ax25() added to libax25ext.  Supports
+    parsing TNC2 and AEA formats.  Generates TNC2 format.
+  - Corrected destination SSID routing to always work, not just for mic-E
+    packets (per APRS Spec 1.02 Ch. 3 p. 12)
+  - Added 3rd-party tunneling/de-tunneling (-3) per APRS Spec 1.02 Ch 17.
+    I don't understand it, but it's there now.  I use transparent 
+    tunneling (-0)!
+  - Really fix the fencepost error that I claimed I fixed in 2.4.2!
+	
+* Changes in aprsdigi-2.4.2, June 2002:
+  - Fix fencepost error in expansion of TRACEn-n that was causing a seg fault.
+
+* Changes in aprsdigi-2.4.1, December 2001:
+  - Fix loop killing (-L) to actually drop looping packets and not other
+    random packets!
+
+* Changes in aprsdigi-2.4.0, November 2001:
+  - Apply patches from Hamish Moffatt <hamish at rising.com.au> to update to
+    the latest libax25.  
+  - Change keep default to 28 seconds to match the documented typical
+    value per p.11 of the APRS Protocol Spec 1.0. 
+  - Don't digipeat packets that my station originated and then got repeated
+    back to me (e.g. beacon -d "APRS via WIDE WIDE" should not be digi'd).
+    (Thanks for noticing this one Arte.)
+  - Make other cosmetic changes to eliminate need to patch libax25.
+  - Rename a couple of functions.
+  - Built and tested under a 2.4 kernel.  Renumber the version to reflect
+    the kernel version it runs with.
+
+* Changes in aprsdigi-2.0, March 1999:
+  General aprsmon and aprsdigi changes:
+  - Fix incorrect order of Mic-E longitude calculation which resulted in, 
+    among other errors, a zero longitude displaying as 19060.00W.
+  - Corrections and changes to Mic-E -> "MIM" translations as requested
+    by Bob Bruninga, including support for Kenwood TH-D7.
+  - Fix T#MIC telemetry
+  - Strip TheNet X1J4 BTEXT prefix, making an X1J4 node's beacon look
+    like a regular APRS beacon.
+  - Rename the package from aprsmon to aprsdigi-2.0 since the dominant
+    useful code in the package is now the digi.  arpsmon should probably
+    be replaced by WA4DSY's aprsd.
+  - Changes for Linux kernel 2.2 (AF_PACKET instead of AF_INET).
+  - Changes for GNU libc 2 (glibc, a/k/a libc6).
+  - Use autoconf and automake.
+
+  aprsdigi-specific changes:
+  - Bring aprsdigi WIDE flooding implementation into alignment with current
+    WIDEn-n definition.
+  - Add real control of how to interconnect (gate) multiple interfaces:
+    - Tie each of my callsigns/aliases to an interface:
+      replace -rxa switches with -p port1:alias,alias... -p port2:alias...
+    - routing between interfaces now based on next-hop callsign.
+    - one-to-many relationship supported by giving the same alias to multiple
+      interfaces.  Each interface with the matching next-hop alias will
+      transmit, with per-interface customizations (e.g. MYCALL substitution
+      is based on the callsign of the interface).
+  - Make tag/idinterval, reformatting of Mic-E and X1J4, etc. selectable
+    per-interface (rather than global) options.
+  - Implement TRACE: Note that TRACEn-n vs. plain TRACE do
+    different things: TRACEn-n *inserts* calls into the digipath while
+    decrementing ssid. e.g.:
+	RELAY*,TRACE3-3
+	RELAY,N2YGK-7*,TRACE3-2
+	RELAY,N2YGK-7,WB2ZII*,TRACE3-1
+	RELAY,N2YGK-7,WB2ZII,N2MH-15*,TRACE3
+	RELAY,N2YGK-7,WB2ZII,N2MH-15,WA2YSM-14*
+    "Plain Old" TRACE just does a one-for-one mycall substitution.
+  - Kill looping packets (-L option):
+	RELAY*,WIDE,WIDE,WIDE
+	RELAY,N2YGK-7*,WIDE,WIDE
+	RELAY,N2YGK-7,WIDE*,WIDE
+			     ^---- normally n2ygk-7 would respond to this,
+	but, by finding one of mycall earlier in the path, I know to ignore it.
+
diff --git a/INSTALL b/INSTALL
new file mode 100644
index 0000000..c34cd0d
--- /dev/null
+++ b/INSTALL
@@ -0,0 +1,38 @@
+N2YGK's aprsdigi 2.4.3 installation instructions
+----------------------------------------------
+
+Alan Crosswell, n2ygk at weca.org
+
+PREREQUISITES:
+-------------
+
+1. You must have a Linux 2.4.x kernel with AX.25 and "Packet socket" configured
+   (CONFIG_AX25 and CONFIG_PACKET) along with the applicable low-level
+   AX.25 drivers (CONFIG_MKISS, CONFIG_BAYCOM*, CONFIG_SOUNDMODEM*, etc.)
+   This release of my software has been tested with Linux 2.4 and GNU libc
+   2 (glibc) on a Red Hat 8.0 distribution.  See the AX25-HOWTO for 
+   instructions:  http://www.linuxdoc.org/HOWTO/AX25-HOWTO.html
+
+2. You need libax25.a and the corresponding include files.  These are
+   part of the libax25-0.0.7 (or later) package.  You also will need
+   ax25-tools and you might as well get ax25-apps too.  The AX25-HOWTO
+   tells how to get and install these as well.
+
+INSTALLING FROM SOURCES:
+-----------------------
+
+First make sure you have libax25 installed.
+
+Then untar and build aprsdigi:
+
+  gunzip -c aprsdigi-2.4.3.tar.gz | tar xfz -
+  cd aprsdigi-2.4.3
+  ./configure
+  make
+  make install
+
+CONFIGURING
+-----------
+
+See the man page, aprsdigi.8.
+
diff --git a/Makefile.am b/Makefile.am
new file mode 100644
index 0000000..9cdaacf
--- /dev/null
+++ b/Makefile.am
@@ -0,0 +1,32 @@
+# automake Makefile.am for Laprs (linux APRS(tm)) package
+# APRS is a registered trademark of Bob Bruninga, WB4APR
+SUFFIXES = .fig .html .8 .pdf
+noinst_LIBRARIES = libaprs.a
+sbin_PROGRAMS = aprsmon aprsdigi
+noinst_PROGRAMS = mic_e_test testparse testmcast fiforead fifowrite
+aprsmon_SOURCES = aprsmon.c aprsshm.c aprsshm.h
+LDADD = libaprs.a
+aprsdigi_SOURCES = aprsdigi.c
+mic_e_test_SOURCES = mic_e_test.c
+testparse_SOURCES = testparse.c
+testmcast_SOURCES = testmcast.c
+fiforead_SOURCES = fiforead.c
+fifowrite_SOURCES = fifowrite.c
+libaprs_a_SOURCES = mic_e.c mic_e.h libax25ext.c libax25ext.h
+man_MANS = aprsdigi.8 aprsmon.8 fiforead.8 fifowrite.8
+HTMLS = aprsdigi.html aprsmon.html fiforead.html fifowrite.html
+noinst_SCRIPTS = $(HTMLS) aprsdigi.spec missing depcomp mkinstalldirs
+DOCS = aprsdigi.lsm parse_cooked_ax25.pdf parse_cooked_ax25.fig
+EXTRA_DIST= $(MANS) $(SCRIPTS) $(DOCS)
+
+.8.html: 
+	$(MAN2HTML)  $< >$@
+
+.fig.pdf:
+	fig2dev -L pdf $< $@
+
+backup:
+	tar cfz aprsmon.bak $(DISTFILES) RCS
+	mcopy aprsmon.bak a:
+
+
diff --git a/Makefile.in b/Makefile.in
new file mode 100644
index 0000000..83d0ea3
--- /dev/null
+++ b/Makefile.in
@@ -0,0 +1,557 @@
+# Makefile.in generated by automake 1.6.3 from Makefile.am.
+# @configure_input@
+
+# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002
+# 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.
+
+ at SET_MAKE@
+SHELL = @SHELL@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+prefix = @prefix@
+exec_prefix = @exec_prefix@
+
+bindir = @bindir@
+sbindir = @sbindir@
+libexecdir = @libexecdir@
+datadir = @datadir@
+sysconfdir = @sysconfdir@
+sharedstatedir = @sharedstatedir@
+localstatedir = @localstatedir@
+libdir = @libdir@
+infodir = @infodir@
+mandir = @mandir@
+includedir = @includedir@
+oldincludedir = /usr/include
+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@
+INSTALL_DATA = @INSTALL_DATA@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = @program_transform_name@
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+
+EXEEXT = @EXEEXT@
+OBJEXT = @OBJEXT@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+AMTAR = @AMTAR@
+AWK = @AWK@
+CC = @CC@
+DEPDIR = @DEPDIR@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+MAN2HTML = @MAN2HTML@
+PACKAGE = @PACKAGE@
+RANLIB = @RANLIB@
+STRIP = @STRIP@
+VERSION = @VERSION@
+am__include = @am__include@
+am__quote = @am__quote@
+install_sh = @install_sh@
+
+# automake Makefile.am for Laprs (linux APRS(tm)) package
+# APRS is a registered trademark of Bob Bruninga, WB4APR
+SUFFIXES = .fig .html .8 .pdf
+noinst_LIBRARIES = libaprs.a
+sbin_PROGRAMS = aprsmon aprsdigi
+noinst_PROGRAMS = mic_e_test testparse testmcast fiforead fifowrite
+aprsmon_SOURCES = aprsmon.c aprsshm.c aprsshm.h
+LDADD = libaprs.a
+aprsdigi_SOURCES = aprsdigi.c
+mic_e_test_SOURCES = mic_e_test.c
+testparse_SOURCES = testparse.c
+testmcast_SOURCES = testmcast.c
+fiforead_SOURCES = fiforead.c
+fifowrite_SOURCES = fifowrite.c
+libaprs_a_SOURCES = mic_e.c mic_e.h libax25ext.c libax25ext.h
+man_MANS = aprsdigi.8 aprsmon.8 fiforead.8 fifowrite.8
+HTMLS = aprsdigi.html aprsmon.html fiforead.html fifowrite.html
+noinst_SCRIPTS = $(HTMLS) aprsdigi.spec missing depcomp mkinstalldirs
+DOCS = aprsdigi.lsm parse_cooked_ax25.pdf parse_cooked_ax25.fig
+EXTRA_DIST = $(MANS) $(SCRIPTS) $(DOCS)
+subdir = .
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
+CONFIG_CLEAN_FILES =
+LIBRARIES = $(noinst_LIBRARIES)
+
+libaprs_a_AR = $(AR) cru
+libaprs_a_LIBADD =
+am_libaprs_a_OBJECTS = mic_e.$(OBJEXT) libax25ext.$(OBJEXT)
+libaprs_a_OBJECTS = $(am_libaprs_a_OBJECTS)
+noinst_PROGRAMS = mic_e_test$(EXEEXT) testparse$(EXEEXT) \
+	testmcast$(EXEEXT) fiforead$(EXEEXT) fifowrite$(EXEEXT)
+sbin_PROGRAMS = aprsmon$(EXEEXT) aprsdigi$(EXEEXT)
+PROGRAMS = $(noinst_PROGRAMS) $(sbin_PROGRAMS)
+
+am_aprsdigi_OBJECTS = aprsdigi.$(OBJEXT)
+aprsdigi_OBJECTS = $(am_aprsdigi_OBJECTS)
+aprsdigi_LDADD = $(LDADD)
+aprsdigi_DEPENDENCIES = libaprs.a
+aprsdigi_LDFLAGS =
+am_aprsmon_OBJECTS = aprsmon.$(OBJEXT) aprsshm.$(OBJEXT)
+aprsmon_OBJECTS = $(am_aprsmon_OBJECTS)
+aprsmon_LDADD = $(LDADD)
+aprsmon_DEPENDENCIES = libaprs.a
+aprsmon_LDFLAGS =
+am_fiforead_OBJECTS = fiforead.$(OBJEXT)
+fiforead_OBJECTS = $(am_fiforead_OBJECTS)
+fiforead_LDADD = $(LDADD)
+fiforead_DEPENDENCIES = libaprs.a
+fiforead_LDFLAGS =
+am_fifowrite_OBJECTS = fifowrite.$(OBJEXT)
+fifowrite_OBJECTS = $(am_fifowrite_OBJECTS)
+fifowrite_LDADD = $(LDADD)
+fifowrite_DEPENDENCIES = libaprs.a
+fifowrite_LDFLAGS =
+am_mic_e_test_OBJECTS = mic_e_test.$(OBJEXT)
+mic_e_test_OBJECTS = $(am_mic_e_test_OBJECTS)
+mic_e_test_LDADD = $(LDADD)
+mic_e_test_DEPENDENCIES = libaprs.a
+mic_e_test_LDFLAGS =
+am_testmcast_OBJECTS = testmcast.$(OBJEXT)
+testmcast_OBJECTS = $(am_testmcast_OBJECTS)
+testmcast_LDADD = $(LDADD)
+testmcast_DEPENDENCIES = libaprs.a
+testmcast_LDFLAGS =
+am_testparse_OBJECTS = testparse.$(OBJEXT)
+testparse_OBJECTS = $(am_testparse_OBJECTS)
+testparse_LDADD = $(LDADD)
+testparse_DEPENDENCIES = libaprs.a
+testparse_LDFLAGS =
+SCRIPTS = $(noinst_SCRIPTS)
+
+
+DEFS = @DEFS@
+DEFAULT_INCLUDES =  -I. -I$(srcdir)
+CPPFLAGS = @CPPFLAGS@
+LDFLAGS = @LDFLAGS@
+LIBS = @LIBS@
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+ at AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/aprsdigi.Po ./$(DEPDIR)/aprsmon.Po \
+ at AMDEP_TRUE@	./$(DEPDIR)/aprsshm.Po ./$(DEPDIR)/fiforead.Po \
+ at AMDEP_TRUE@	./$(DEPDIR)/fifowrite.Po ./$(DEPDIR)/libax25ext.Po \
+ at AMDEP_TRUE@	./$(DEPDIR)/mic_e.Po ./$(DEPDIR)/mic_e_test.Po \
+ at AMDEP_TRUE@	./$(DEPDIR)/testmcast.Po ./$(DEPDIR)/testparse.Po
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+CFLAGS = @CFLAGS@
+DIST_SOURCES = $(libaprs_a_SOURCES) $(aprsdigi_SOURCES) \
+	$(aprsmon_SOURCES) $(fiforead_SOURCES) $(fifowrite_SOURCES) \
+	$(mic_e_test_SOURCES) $(testmcast_SOURCES) $(testparse_SOURCES)
+
+NROFF = nroff
+MANS = $(man_MANS)
+DIST_COMMON = README AUTHORS COPYING ChangeLog INSTALL Makefile.am \
+	Makefile.in NEWS TODO aclocal.m4 configure configure.in depcomp \
+	install-sh missing mkinstalldirs
+SOURCES = $(libaprs_a_SOURCES) $(aprsdigi_SOURCES) $(aprsmon_SOURCES) $(fiforead_SOURCES) $(fifowrite_SOURCES) $(mic_e_test_SOURCES) $(testmcast_SOURCES) $(testparse_SOURCES)
+
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .fig .html .8 .pdf .c .o .obj
+
+am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
+ configure.lineno
+$(srcdir)/Makefile.in:  Makefile.am  $(top_srcdir)/configure.in $(ACLOCAL_M4)
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --gnu  Makefile
+Makefile:  $(srcdir)/Makefile.in  $(top_builddir)/config.status
+	cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)
+
+$(top_builddir)/config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	$(SHELL) ./config.status --recheck
+$(srcdir)/configure:  $(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES)
+	cd $(srcdir) && $(AUTOCONF)
+
+$(ACLOCAL_M4):  configure.in 
+	cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
+
+AR = ar
+
+clean-noinstLIBRARIES:
+	-test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES)
+libaprs.a: $(libaprs_a_OBJECTS) $(libaprs_a_DEPENDENCIES) 
+	-rm -f libaprs.a
+	$(libaprs_a_AR) libaprs.a $(libaprs_a_OBJECTS) $(libaprs_a_LIBADD)
+	$(RANLIB) libaprs.a
+
+clean-noinstPROGRAMS:
+	-test -z "$(noinst_PROGRAMS)" || rm -f $(noinst_PROGRAMS)
+sbinPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
+install-sbinPROGRAMS: $(sbin_PROGRAMS)
+	@$(NORMAL_INSTALL)
+	$(mkinstalldirs) $(DESTDIR)$(sbindir)
+	@list='$(sbin_PROGRAMS)'; for p in $$list; do \
+	  p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+	  if test -f $$p \
+	  ; then \
+	    f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
+	   echo " $(INSTALL_PROGRAM_ENV) $(sbinPROGRAMS_INSTALL) $$p $(DESTDIR)$(sbindir)/$$f"; \
+	   $(INSTALL_PROGRAM_ENV) $(sbinPROGRAMS_INSTALL) $$p $(DESTDIR)$(sbindir)/$$f; \
+	  else :; fi; \
+	done
+
+uninstall-sbinPROGRAMS:
+	@$(NORMAL_UNINSTALL)
+	@list='$(sbin_PROGRAMS)'; for p in $$list; do \
+	  f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
+	  echo " rm -f $(DESTDIR)$(sbindir)/$$f"; \
+	  rm -f $(DESTDIR)$(sbindir)/$$f; \
+	done
+
+clean-sbinPROGRAMS:
+	-test -z "$(sbin_PROGRAMS)" || rm -f $(sbin_PROGRAMS)
+aprsdigi$(EXEEXT): $(aprsdigi_OBJECTS) $(aprsdigi_DEPENDENCIES) 
+	@rm -f aprsdigi$(EXEEXT)
+	$(LINK) $(aprsdigi_LDFLAGS) $(aprsdigi_OBJECTS) $(aprsdigi_LDADD) $(LIBS)
+aprsmon$(EXEEXT): $(aprsmon_OBJECTS) $(aprsmon_DEPENDENCIES) 
+	@rm -f aprsmon$(EXEEXT)
+	$(LINK) $(aprsmon_LDFLAGS) $(aprsmon_OBJECTS) $(aprsmon_LDADD) $(LIBS)
+fiforead$(EXEEXT): $(fiforead_OBJECTS) $(fiforead_DEPENDENCIES) 
+	@rm -f fiforead$(EXEEXT)
+	$(LINK) $(fiforead_LDFLAGS) $(fiforead_OBJECTS) $(fiforead_LDADD) $(LIBS)
+fifowrite$(EXEEXT): $(fifowrite_OBJECTS) $(fifowrite_DEPENDENCIES) 
+	@rm -f fifowrite$(EXEEXT)
+	$(LINK) $(fifowrite_LDFLAGS) $(fifowrite_OBJECTS) $(fifowrite_LDADD) $(LIBS)
+mic_e_test$(EXEEXT): $(mic_e_test_OBJECTS) $(mic_e_test_DEPENDENCIES) 
+	@rm -f mic_e_test$(EXEEXT)
+	$(LINK) $(mic_e_test_LDFLAGS) $(mic_e_test_OBJECTS) $(mic_e_test_LDADD) $(LIBS)
+testmcast$(EXEEXT): $(testmcast_OBJECTS) $(testmcast_DEPENDENCIES) 
+	@rm -f testmcast$(EXEEXT)
+	$(LINK) $(testmcast_LDFLAGS) $(testmcast_OBJECTS) $(testmcast_LDADD) $(LIBS)
+testparse$(EXEEXT): $(testparse_OBJECTS) $(testparse_DEPENDENCIES) 
+	@rm -f testparse$(EXEEXT)
+	$(LINK) $(testparse_LDFLAGS) $(testparse_OBJECTS) $(testparse_LDADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT) core *.core
+
+distclean-compile:
+	-rm -f *.tab.c
+
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/aprsdigi.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/aprsmon.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/aprsshm.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/fiforead.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/fifowrite.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libax25ext.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mic_e.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mic_e_test.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/testmcast.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/testparse.Po at am__quote@
+
+distclean-depend:
+	-rm -rf ./$(DEPDIR)
+
+.c.o:
+ at AMDEP_TRUE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@	depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@
+ at AMDEP_TRUE@	$(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+	$(COMPILE) -c `test -f '$<' || echo '$(srcdir)/'`$<
+
+.c.obj:
+ at AMDEP_TRUE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@	depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@
+ at AMDEP_TRUE@	$(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+	$(COMPILE) -c `cygpath -w $<`
+CCDEPMODE = @CCDEPMODE@
+uninstall-info-am:
+
+man8dir = $(mandir)/man8
+install-man8: $(man8_MANS) $(man_MANS)
+	@$(NORMAL_INSTALL)
+	$(mkinstalldirs) $(DESTDIR)$(man8dir)
+	@list='$(man8_MANS) $(dist_man8_MANS) $(nodist_man8_MANS)'; \
+	l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \
+	for i in $$l2; do \
+	  case "$$i" in \
+	    *.8*) list="$$list $$i" ;; \
+	  esac; \
+	done; \
+	for i in $$list; do \
+	  if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \
+	  else file=$$i; fi; \
+	  ext=`echo $$i | sed -e 's/^.*\\.//'`; \
+	  case "$$ext" in \
+	    8*) ;; \
+	    *) ext='8' ;; \
+	  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)$(man8dir)/$$inst"; \
+	  $(INSTALL_DATA) $$file $(DESTDIR)$(man8dir)/$$inst; \
+	done
+uninstall-man8:
+	@$(NORMAL_UNINSTALL)
+	@list='$(man8_MANS) $(dist_man8_MANS) $(nodist_man8_MANS)'; \
+	l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \
+	for i in $$l2; do \
+	  case "$$i" in \
+	    *.8*) list="$$list $$i" ;; \
+	  esac; \
+	done; \
+	for i in $$list; do \
+	  ext=`echo $$i | sed -e 's/^.*\\.//'`; \
+	  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)$(man8dir)/$$inst"; \
+	  rm -f $(DESTDIR)$(man8dir)/$$inst; \
+	done
+
+ETAGS = etags
+ETAGSFLAGS =
+
+tags: TAGS
+
+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:  $(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 "$(ETAGS_ARGS)$$tags$$unique" \
+	  || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+
+top_distdir = .
+distdir = $(PACKAGE)-$(VERSION)
+
+am__remove_distdir = \
+  { test ! -d $(distdir) \
+    || { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \
+         && rm -fr $(distdir); }; }
+
+GZIP_ENV = --best
+distcleancheck_listfiles = find . -type f -print
+
+distdir: $(DISTFILES)
+	$(am__remove_distdir)
+	mkdir $(distdir)
+	@list='$(DISTFILES)'; for file in $$list; do \
+	  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"; \
+	    $(mkinstalldirs) "$(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
+	-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 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
+	$(am__remove_distdir)
+	GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(AMTAR) xf -
+	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` \
+	  && 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 \
+	  && (test `find $$dc_install_base -type f -print | wc -l` -le 1 \
+	      || { echo "ERROR: files left after uninstall:" ; \
+	           find $$dc_install_base -type f -print ; \
+	           exit 1; } >&2 ) \
+	  && $(MAKE) $(AM_MAKEFLAGS) dist-gzip \
+	  && rm -f $(distdir).tar.gz \
+	  && $(MAKE) $(AM_MAKEFLAGS) distcleancheck
+	$(am__remove_distdir)
+	@echo "$(distdir).tar.gz is ready for distribution" | \
+	  sed 'h;s/./=/g;p;x;p;x'
+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 after distclean:" ; \
+	       $(distcleancheck_listfiles) ; \
+	       exit 1; } >&2
+check-am: all-am
+check: check-am
+all-am: Makefile $(LIBRARIES) $(PROGRAMS) $(SCRIPTS) $(MANS)
+
+installdirs:
+	$(mkinstalldirs) $(DESTDIR)$(sbindir) $(DESTDIR)$(man8dir)
+
+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_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)
+
+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 clean-noinstLIBRARIES clean-noinstPROGRAMS \
+	clean-sbinPROGRAMS mostlyclean-am
+
+distclean: distclean-am
+	-rm -f $(am__CONFIG_DISTCLEAN_FILES)
+distclean-am: clean-am distclean-compile distclean-depend \
+	distclean-generic distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+info: info-am
+
+info-am:
+
+install-data-am: install-man
+
+install-exec-am: install-sbinPROGRAMS
+
+install-info: install-info-am
+
+install-man: install-man8
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -f $(am__CONFIG_DISTCLEAN_FILES)
+	-rm -rf autom4te.cache
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic
+
+uninstall-am: uninstall-info-am uninstall-man uninstall-sbinPROGRAMS
+
+uninstall-man: uninstall-man8
+
+.PHONY: GTAGS all all-am check check-am clean clean-generic \
+	clean-noinstLIBRARIES clean-noinstPROGRAMS clean-sbinPROGRAMS \
+	dist dist-all dist-gzip distcheck distclean distclean-compile \
+	distclean-depend distclean-generic distclean-tags \
+	distcleancheck distdir dvi dvi-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-man8 install-sbinPROGRAMS install-strip installcheck \
+	installcheck-am installdirs maintainer-clean \
+	maintainer-clean-generic mostlyclean mostlyclean-compile \
+	mostlyclean-generic tags uninstall uninstall-am \
+	uninstall-info-am uninstall-man uninstall-man8 \
+	uninstall-sbinPROGRAMS
+
+
+.8.html: 
+	$(MAN2HTML)  $< >$@
+
+.fig.pdf:
+	fig2dev -L pdf $< $@
+
+backup:
+	tar cfz aprsmon.bak $(DISTFILES) RCS
+	mcopy aprsmon.bak a:
+# 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/NEWS b/NEWS
new file mode 100644
index 0000000..2b42eb3
--- /dev/null
+++ b/NEWS
@@ -0,0 +1,48 @@
+Announcing N2YGK's Linux aprsdigi-2.4.4.		March, 2004
+
+Release 2.4.4 of N2YGK's advanced APRS digipeater is now available for
+free under the terms of the GNU Public License (GPL) at
+ftp://ftp.tapr.org/aprssig/linux/aprsdigi-2.4.4.tgz and
+http://aprsdigi.sourceforge.net.
+
+This release has the following new features:
+
+- Aprsdigi is now a sourceforge.net project.  Please visit aprsdigi.sf.net
+  and sign up to be a developer or join the users or developers mailing lists.
+- Short (-s) command line options replaced with long ones (--long).  Short
+  options are now deprecated and may disappear in a future release.
+- Ability to specify a list of ports that get sent a verbatim duplicate copy
+  of all packets received on a given port.  Useful for "reflecting" what's
+  heard on an RF port to a local LAN for instance.  This is different from
+  APRS-IS (e.g. aprsd) since the data is sent with UDP (multicast or unicast).
+  Use with caution (or not at all) on RF ports.
+
+Added in 2.4.3:
+- UDP/IP (v4 and v6) unicast and multicast (ASM) support.  Useful for 
+  connecting aprsdigi's over the Internet, WLANs, etc.
+  (Note: this is *not* TCP support as used by APRS-IS, aprsd, etc.)
+  Both transparent and "3rd party" tunneling are supported.
+- Budlist to permit/deny digipeating of traffic for individuals or groups of
+  AX.25 and IP sources.  IP budlists are helpful when using IP multicast!
+- Interfaces may be set to transmit- or receive-only.
+- Interfaces may be set to disable retransmission of received packets on
+  the same interface (one-armed routing).  
+- Unix FIFO supported as an interface type.  Mostly useful for debugging.
+- Bug fixed that caused aprsdigi to crash upon TRACEn-n callsign insertion
+  when the digipeater list was full.
+
+Along with these features:
+- Digipeater callsign substitution (e.g. RELAY replaced w/N0CLU-12).
+- WIDE, WIDEn-n, TRACE, and TRACEn-n.
+- As many radio interfaces as you can plug into your Linux machine
+  with flexible gatewaying between them.
+- Special handling for Mic-Encoder, Kenwood TH-D7, and TheNet X1J4, including
+  SSID-based digipeating.
+- Suppression of duplicate and looping packets.
+- Works with Linux 2.4 kernel AX.25 network stack.  This means any AX.25
+  interface supported by the kernel will work, not just a TNC2 clone.
+  Examples include all the BAYCOM interfaces (BAYPAC, PICPAR, PICSER, etc.),
+  soundcards, 8530 SCC cards, any serial port KISS TNC, etc.
+
+Aprsdigi is Copyright (c) 1996,1997,1999,2001,2002,2003,2004 Alan Crosswell,
+  n2ygk at weca.org
diff --git a/README b/README
new file mode 100644
index 0000000..327a386
--- /dev/null
+++ b/README
@@ -0,0 +1,40 @@
+Linux aprsdigi and aprsmon.
+Copyright (c) 1996,1997,1998,1999,2001  E. Alan Crosswell
+Released under the GNU Public License.  See the file COPYING for details.
+
+Alan Crosswell, N2YGK
+n2ygk at weca.org
+revised November 28, 2001
+
+Where to find the latest releases:
+
+The official places where I put new versions are:
+
+   http://www.cloud9.net/~alan/ham/aprs/
+   ftp://ftp.tapr.org/aprssig/linux/
+
+Others may mirror this stuff elsewhere, but I only promise that the
+latest will be at the above two sites.
+
+If you are not a member of Tucson Amateur Packet Radio (TAPR), consider
+joining!  See www.tapr.org
+
+See the aprsdigi.8 and aprsmon.1 man pages.  Aprsdigi is an intelligent
+digipeater (see the APRS Protocol Reference, ISBN 0-9644707-6-4, at
+http://www.tapr.org).
+
+Aprsmon enables a rudimentary TNC monitor as expected by Steve Dimse's
+javAPRS applet.  If you want to build the aprsmon without saving up
+stale packets in a shared memory segment, give the --disable-shm
+option to configure.  However, you should probably use aprsd instead,
+since it is a more complete implementation.  See the AX25-HOWTO
+or http://sourceforge.net/projects/aprsd/.
+
+See the file INSTALL for installation instructions.
+
+
+
+
+
+
+
diff --git a/TODO b/TODO
new file mode 100644
index 0000000..8c16a2b
--- /dev/null
+++ b/TODO
@@ -0,0 +1,37 @@
+aprsdigi:
+  - set up sf.net:
+    - CVS import (done)
+    - aprsdigi-users && aprsdigi-devel mailing lists
+    - release files/tarball
+    - aprsdigi.sf.net web page
+  - document how to use aprsd UDP port support or whether it makes sense
+    to do so vs. just running aprsd in parallel.
+  - make aprs-is compatible (see aprsd/doc/q.html) or just use aprsd?
+  - suppress loops/dupes per-interface???  Currently globally.
+  - make log file list rx/tx port and timestamp?
+  - add "tcp:" interface types (both initiator/client and responder/server).
+    netcat ./nc -v -u -p 14439 -l | ./nc -v -l -p 14439 localhost 
+  - add file: and/or tty: intf type to support non-KISS-capable TNCs 
+    and broken KISS implentations like TH-D7A (this is getting gross).
+  - support more than 8 digipeaters in cooked mode?
+  - digipeat other than UI frames (digi_ned && requested for opentrac pid 99)
+  - Combine unproto() and parsecalls().
+  - Figure out why I can't just use standard full_sockaddr instead of
+    struct ax_calls.
+  - add maxhops for TRACEn-n. (I don't remember what this means!)
+  - assure 100% alignment with APRS Protocol Spec 1.0
+  - add a real config file instead of hokey command line switches.
+  - add IPv6 multicast, IPv4 SSM?
+  - Implement HOME: (or did this idea die out?)
+  - Implement compressed and/or decompressed GPS strings and posits.
+  - Look at my notes from DCC proceedings APRS papers.
+
+mic_e.c:
+  - looked at Dale's changes but they *broke* parsing of D7, mic_e pkts???
+  - Add PIC-E support: /P>mon
+  - Is this necessary anymore given aprsd?
+
+General:
+  - Make a new distro rpm and tarball.
+
+
diff --git a/aclocal.m4 b/aclocal.m4
new file mode 100644
index 0000000..0cd6eab
--- /dev/null
+++ b/aclocal.m4
@@ -0,0 +1,758 @@
+# aclocal.m4 generated automatically by aclocal 1.6.3 -*- Autoconf -*-
+
+# Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002
+# 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.
+
+# 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.
+
+# 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 1996, 1997, 1998, 1999, 2000, 2001, 2002
+# 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 8
+
+# 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...
+
+
+AC_PREREQ([2.52])
+
+# Autoconf 2.50 wants to disallow AM_ names.  We explicitly allow
+# the ones we care about.
+m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
+
+# 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([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
+
+# 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
+# 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
+
+_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
+])
+])
+
+# Copyright 2002  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
+
+# 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.6"])
+
+# 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.6.3])])
+
+# Helper functions for option handling.                    -*- Autoconf -*-
+
+# Copyright 2001, 2002  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])])
+
+#
+# Check to make sure that the build environment is sane.
+#
+
+# Copyright 1996, 1997, 2000, 2001 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 > 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 conftest.file 2> /dev/null`
+   if test "$[*]" = "X"; then
+      # -L didn't work.
+      set X `ls -t $srcdir/configure conftest.file`
+   fi
+   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".
+      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
+alias in your environment])
+   fi
+
+   test "$[2]" = conftest.file
+   )
+then
+   # Ok.
+   :
+else
+   AC_MSG_ERROR([newly created file is older than distributed files!
+Check your system clock])
+fi
+AC_MSG_RESULT(yes)])
+
+#  -*- Autoconf -*-
+
+
+# Copyright 1997, 1999, 2000, 2001 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_AUX_DIR_EXPAND
+
+# Copyright 2001 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.
+
+# Rely on autoconf to set up CDPATH properly.
+AC_PREREQ([2.50])
+
+AC_DEFUN([AM_AUX_DIR_EXPAND], [
+# expand $ac_aux_dir to an absolute path
+am_aux_dir=`cd $ac_aux_dir && pwd`
+])
+
+# AM_PROG_INSTALL_SH
+# ------------------
+# Define $install_sh.
+
+# Copyright 2001 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)])
+
+# AM_PROG_INSTALL_STRIP
+
+# Copyright 2001 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.
+
+# 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
+INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
+AC_SUBST([INSTALL_STRIP_PROGRAM])])
+
+# serial 4						-*- Autoconf -*-
+
+# Copyright 1999, 2000, 2001 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
+
+  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
+    # 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.
+    echo '#include "conftest.h"' > conftest.c
+    echo 'int i;' > conftest.h
+    echo "${am__include} ${am__quote}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=conftest.c object=conftest.o \
+       depfile=conftest.Po tmpdepfile=conftest.TPo \
+       $SHELL ./depcomp $depcc -c conftest.c -o conftest.o >/dev/null 2>&1 &&
+       grep conftest.h conftest.Po > /dev/null 2>&1 &&
+       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+      am_cv_$1_dependencies_compiler_type=$depmode
+      break
+    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_SET_DEPDIR
+# -------------
+# Choose a directory name for dependency files.
+# This macro is AC_REQUIREd in _AM_DEPENDENCIES
+AC_DEFUN([AM_SET_DEPDIR],
+[rm -f .deps 2>/dev/null
+mkdir .deps 2>/dev/null
+if test -d .deps; then
+  DEPDIR=.deps
+else
+  # MS-DOS does not allow filenames that begin with a dot.
+  DEPDIR=_deps
+fi
+rmdir .deps 2>/dev/null
+AC_SUBST([DEPDIR])
+])
+
+
+# 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 1999, 2000, 2001, 2002 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"])
+])
+
+# Copyright 2001 Free Software Foundation, Inc.             -*- Autoconf -*-
+
+# 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'
+doit:
+	@echo done
+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 | fgrep -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
+])
+
+# AM_CONDITIONAL                                              -*- Autoconf -*-
+
+# Copyright 1997, 2000, 2001 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 5
+
+AC_PREREQ(2.52)
+
+# AM_CONDITIONAL(NAME, SHELL-CONDITION)
+# -------------------------------------
+# Define a conditional.
+AC_DEFUN([AM_CONDITIONAL],
+[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])])
+
diff --git a/aprsdigi.8 b/aprsdigi.8
new file mode 100644
index 0000000..261bc0a
--- /dev/null
+++ b/aprsdigi.8
@@ -0,0 +1,566 @@
+.TH APRSDIGI 8 "25 February 2004"
+.SH NAME
+aprsdigi \- APRS(\*(Tm) digipeater
+.SH SYNOPSIS
+.nf
+.BI "aprsdigi " options
+.fi
+.SH DESCRIPTION
+.PP
+.I Aprsdigi
+is a specialized Amateur Packet Radio (AX.25) UI-frame digipeater
+for the Automatic Position Reporting Systems, APRS(tm).
+It uses the Linux kernel AX.25 network stack as well as the SOCK_PACKET
+facility
+to listen for packets on one or more radio interfaces (ports) and repeat
+those packets -- with several possible modifications -- on the same or
+other interfaces. 
+.I Aprsdigi
+can also use the Internet to tunnel connections among other APRS digipeaters
+and nodes using IPv4 or IPv6 UDP unicast or multicast.
+.PP
+.I Aprsdigi
+implements conventional packet radio AX.25
+digipeating, in which a packet is digipeated if the next hop (non-repeated)
+digipeater ("via") callsign matches the AX.25 port's callsign and
+sub-station ID (SSID) or an
+.I alias
+callsign and SSID.
+.PP
+There are a number of extensions to conventional digipeating that have
+been proposed for use in the APRS community.  Some of these features
+have been adopted by Terminal Node Controller (TNC) manufacturers,
+notably Paccomm and Kantronics.
+.I Aprsdigi
+implements most if not all of the commercialy adopted and proposed
+features.  See the APRS 1.0 Protocol Specification at www.tapr.org
+for protocol documentation.  
+.I Aprsdigi
+attempts to minimally comply with the protocol specification as well
+as support experimental APRS features.  Specific features implemented 
+include:
+.PP
+.IP \(bu 2
+Single-interface conventional UI-frame digipeating.
+.IP \(bu 2
+Cross-interface digipeating (also known as bridging, routing or gatewaying)
+and one-to-many fanout.
+.IP \(bu 2
+Substitution of a digipeated alias with the interface's callsign
+(typically used to substitute
+.BI RELAY,
+.BI WIDE
+or
+.BI TRACE
+aliases).
+.IP \(bu 2
+.BI "WIDEn-n"
+flooding algorithim.
+.IP \(bu 2
+.BI "TRACEn-n"
+route recording.
+.IP \(bu 2
+.I Mic-Encoder(tm)
+support, including SSID-based digipeating, decompression of packets into
+the conventional APRS MIM format.  (The Mic-Encoder compression is also
+used by other products such as the Kenwood TH-D7A and D700, and TAPR
+PIC-Encoder).
+.IP \(bu 2
+TheNet X1J4 node beacon text translation (removal of the  
+\(lqTheNet X1J4 (alias)\(rq prefix from the btext).
+.PP
+.SH "GENERAL OPTIONS"
+.TP 10
+.BI "\-v \--verbose"
+Produce verbose debugging output.
+.TP 10
+.BI "\-T \--testing"
+Test mode: listen to my packets too.  This mode is useful for off-air
+experimentation and configuration testing.  Do not use it on-air.
+.TP 10
+.BI "\-D \--kill_dupes"
+Suppress Duplicate packets.  Remembers
+duplicate packets for the number of seconds given by the -k option and
+will not repeat them more than once.  This reduces conjestion caused
+when several digipeaters that share a common flooding alias (e.g. WIDE)
+have overlapping footprints, causing geometric duplication
+of packets addressed via \(lqWIDE,WIDE\(rq for example.
+.TP 10
+.BI "\-L \--kill_loops"
+Suppress Looping packets.  Similar in function to duplicate packet
+suppression, but looks back through the list of already digipeated callsigns
+in the packet's digipeat list and kills any packets that list a callsign
+belonging to this 
+.I aprsdigi.
+Note that only real callsigns are compared.  Generic flooding aliases are not.
+Therefore, loop detection is only useful when callsign substitution is used.
+.TP 10
+.BI "\-V \--version"
+Print program version and exit.
+.TP 10
+.BI "\-n|s|e|w \--north|south|east|west"
+Set North|South|East|West SSID directional path.
+.TP 10
+.BI "\-d \--digipath"
+Set SSID omnidirectional next-hops when operating in a non flooding
+network (e.g. when WIDEn-n is not an option).
+.TP 10
+.BI "\-f \--flood"
+Set flooding alias.  Use \(lq-f WIDE\(rq to enable WIDEn-n flooding.
+Use -f multiple times to define several flooding aliases.
+.TP 10
+.BI "\-F \--trace"
+Set flooding trace callsign.  Use \(lq-F TRACE\(rq to enable TRACE and
+TRACEn-n flooding. Use -F multiple times to define several trace aliases.
+.TP 10
+.BI "\-k \--keep secs"
+Remember old packets for this long for duplicate packet detection.
+Default is 28 seconds.
+.TP 10
+.BI "\-l \--logfile file"
+Log digipeated packets to this file.
+.SH "PER-INTERFACE OPTIONS"
+Put these options
+.I before
+each
+.BI "\-p \--interface"
+to set new values as needed.  The values you set are remembered for
+subsequent 
+.BI "\-p's"
+so options you want to set for all interfaces need only be specified
+once, before the first
+.BI "\-p."
+But you have to remember to unset an option if you don't want it to
+apply to subsequent interfaces.
+.TP 10
+.BI "\-C (-c) \--[no]subst_mycall"
+Do (not) perform callsign substitution.  When enabled, aliases are
+replaced with the interface's callsign when repeated.
+.TP 10
+.BI "\-M (-m) \--[no]mice_xlate"
+Do (not) perform Mic-E to MIM translation.  When enabled, compressed Mic-E
+reports are expanded into one MIM-style position report packet and optionally
+a second telemetry packet if telemetry was supplied in the Mic-E packet.
+.TP 10
+.BI "\-X (-x) \--[no]x1j4_xlate"
+Do (not) perform X1J4 translation.  When enabled, the leading 
+\(lqTheNet X1J4 (alias)\(rq text is removed when digipeated.  This allows
+non-compliant APRS implementations to detect an APRS position report in
+an X1J4 beacon.
+.TP 10
+.BI "\-i \--idinterval secs"
+Seconds between ID transmissions.  Set to 0 to disable IDs on this interface.
+Default is 570 (9 minutes 30 seconds).  IDs are only sent if the interface
+transmitted anything since the last ID.  ID packets are addressed to the 
+\(lqID\(rq callsign, have no digipeat path, and list the callsign and aliases
+for the interface the ID is being transmitted on.
+.TP 10
+.BI "\-t \--tag text"
+Text to append to received packets.  Use 
+.I "\-t -"
+to reset to empty.  Use this, for example, when gatewaying Mic-E packets
+from a voice repeater to the APRS net frequency to indicate where the report
+originated.
+.TP 10
+.B "\-3 \--3rdparty"
+Enable 3rd party tunneling.  Packets tunneled 
+.I to
+a 3rd party interface are sent with the unused digipeaters removed from
+the digipeater list.  Packets tunneled
+.I from
+a 3rd party interface have the Source Path Header prepended to the
+packet payload prefixed by the "}" character.
+.TP 10
+.B "\-0 \--no3rdparty"
+Enable transparent tunneling. No special tricks are done when sending to
+or receiving from a tunneled interface.  If the interface does not natively
+support AX.25 addresses (from-call, to-call, and digipeater list), then
+the address header is prepended to the payload in "cooked" format. Likewise,
+a cooked prepended header is stripped from a cooked interface and put back
+in the AX.25 address when going from a non-AX.25 to AX.25 interface.
+.TP 10
+.BI "\-o r \--norx"
+Disable receiving on the following interface(s).
+.TP 10
+.BI "\-o R \--rx"
+Enable receiving on the following interface(s).
+.TP 10
+.BI "\-o t \--notx"
+Disable transmitting on the following interface(s).
+.TP 10
+.BI "\-o T \--tx"
+Enable transmitting on the following interface(s).
+.TP 10
+.BI "\-o s \--notxsame"
+Disable retransmitting a received packet on the same interface.
+.TP 10
+.BI "\-o S \--txsame"
+Enable retransmitting a received packet on the same interface.
+.TP 10
+.BI "\-o d \--duplicate intf"
+Duplicate received packets without modification to the given interface (port).
+.TP 10
+.BI "-p \--interface ax25:port:alias1,alias2,..."
+AX25 interface name (port) and optional list of aliases.
+The primary callsign is obtained from the interface's configuration.
+(See ifconfig(8)).
+.TP 10
+.BI "-p \--interface udp:host/port/ttl:alias1,alias2,..."
+IP host name or address and list of aliases.  IP addresses may be IPv4
+unicast or multicast or IPv6 unicast.
+The primary callsign is obtained from the first alias.
+.TP 10
+.BI "-p \--interface unix:filename:alias1,alias2,..."
+Unix file and list of aliases.  Useful for debugging by setting up
+a simulated APRS network on one machine.  You may want to make your
+FIFOs explicitly transmit- or receive-only to avoid confusion.
+The primary callsign is obtained from the first alias.
+.TP 10
+.BI "\-B|b \--[no]bud"
+.I addr
+Is similar to a TNC-2's BUDLIST.  Use 
+.BI "\-B \--bud"
+to accept or 
+.BI "\-b \--nobud"
+to ignore packets from a sender or group of senders.  Budlists are
+attached to each interface and can be reset with
+.BI "\--bud \-"
+.br
+You can set up a global budlist once, or per-interface budlists.
+The format of
+.I addr
+varies based on the interface type:
+.HP
+.BI "\--bud ax25:callsign-ssid"
+matches only a given digipeater callsign and SSID.  For example,
+\-B ax25:n0clu-14.
+.HP
+.BI "\--bud ax25:callsign" 
+matches all SSIDs for the given callsign.  For example
+\-B ax25:n0clu.
+.HP
+.BI "\--bud ip:hostname" 
+matches one Internet host name (IPv6 or IPv4).  For example
+\-B ip:n0clu.ampr.net
+.HP
+.BI "\--bud ip:address/maskbits" 
+matches all IP addresses that have the given prefix.  For example
+\--bud ip:44.0.0.0/8 matches the entire class-A network.
+\--bud ip:192.168.0.0/16 matches the entire class-B network.
+\--bud ip:fe80::201:3ff:fe9a:38c6 matches a single IPv6 host.
+\--bud ip:2002:905::/32 matches the 32-bit IPv6 prefix.
+.PP
+.SH "RUNTIME CONTROLS"
+.PP
+.I aprsdigi
+responds to the following signals:
+.TP 10
+.B "SIGUSR1"
+Print cumulative statistics.  For each port, the following counters are 
+displayed:
+packets received and how many of those where ignored, duplicates, loops,
+mic-E formatted;  packets transmitted and how many of those where
+conventional digipeats, flooding digipeats (WIDEn-n), SSID-based digipeats,
+and IDs.  If a log file was specified with the 
+.B "\-l \--logfile"
+option, then the statistics are written to that file.  Otherwise they are
+written to stderr.
+
+.TP 10
+.B "SIGUSR2"
+Prints the statistics and then resets all counters to zero.
+.PP
+All other normal termination signals cause final statistics to print before
+.I aprsdigi
+exits.
+
+.SH "SSID-BASED ROUTING"
+.PP
+SSID-based routing uses a non-zero sub-station ID in the destination
+callsign, an empty digipeater path to indicate that
+the APRS digipeater should repeat the packet after filling in
+an appropriate digipeater path.  For example, a packet sent to
+\(lqT1QS4W-3\(rq
+would be repeated with a modifed destination of \(lqAPRS VIA WIDE3-3\(rq
+(in a network that supports WIDEn-n flooding).
+A packet sent to \(lqAPRS-11\(rq would be repeated to the West unproto
+path, as defined with the
+.B \--west
+option.  A table of SSID values and their paths follows:
+.sp
+.nf
+SSID unproto path
+---- ------------
+0    none 
+1    WIDE1-1
+2    WIDE2-2
+3    WIDE3-3
+4    WIDE4-4
+5    WIDE5-5
+6    WIDE6-6
+7    WIDE7-7
+8    NORTH UNPROTO path
+9    SOUTH UNPROTO path
+10   EAST  UNPROTO path
+11   WEST  UNPROTO path
+12   NORTH UNPROTO path + WIDE
+13   SOUTH UNPROTO path + WIDE
+14   EAST  UNPROTO path + WIDE
+15   WEST  UNPROTO path + WIDE
+.fi
+.sp
+SSID digipeating was first introduced with the Mic-Encoder but works
+with any destination callsign with a non-zero SSID.
+The theory behind destination SSID digipeating is described in more detail
+in the APRSdos README, MIC-E.TXT.  Basically, the idea is to minimize
+packet lengths and to have the manager of the WIDE APRS digipeater
+determine the most appropriate directional digipeat paths, removing
+the burden from the mobile user.
+.PP
+.I Aprsdigi
+also fits into a non WIDEn-n network by using the same algorithm for
+selection of subset of digipeaters from a list supplied with the
+.B \--digipath
+option as the MIC-E.  That is, SSIDs of 1, 2 or 3 select that number
+of digipeaters from the first three digipeaters in the 
+.B \--digipath
+list.  SSIDs of 4, 5, 6, or 7, start at the fourth digipeater in
+the list.
+.PP
+.SH "FLOODING ALIASES"
+APRS flooding (WIDEn-n) digipeating works by repeating any received packet
+whose next hop digipeater has a flooding alias (specified with the 
+.B \--flood
+option), and the SSID is 1 or greater.  The SSID is decremented by one,
+and the packet is repeated.  Furthermore, to prevent broadcast storms,
+recently transmitted packets are remembered for a period of time specified
+by the
+.B \--keep
+option and are not repeated if they are heard within that time period.
+.PP
+Unlike conventional digipeating, in which the digipeater callsign/alias is
+flagged as \(lqrepeated\(rq, the flooding mode does not do this.
+Once the SSID decrements to zero, then a flooding alias is treated just like
+any other alias, and does get marked as repeated upon transmission.
+.PP
+.SH "TRACE and TRACEn-n ALIASES"
+\(lqFlooding\(rq Trace aliases (TRACEn-n; 
+.B \--trace
+option) are treated like flooding aliases with the addition that,
+besides decrementing the SSID, the current interface's callsign is
+inserted in front of the trace alias, providing a record-route function.
+\(lqPlain\(rq trace aliases (TRACE; also
+.B \--trace
+option) are simply substituted in the conventional (
+.B \--subst_mycall
+) manner.
+.PP
+.SH "MULTI PORT OPERATION"
+In single port operation, there is only one interface specified with
+.BI "\--interface."
+All packets are received and some are retransmitted on the same interface,
+depending on whether they match the criteria for retransmission
+after translation of the digpeater path from one of the APRS-specific
+formats:
+.IP \(bu 2
+Mic-E TO-call SSID-based route.
+.IP \(bu 2
+WIDEn-n/TRACEn-n flooding.
+.PP
+or a conventional next-hop (non-repeated) digipeater matching the
+callsign or one of the aliases for the interface.
+.PP
+The decision to transmit is made by matching the next hop
+callsign/alias with the table of callsigns and aliases you supply to
+.BI "\--interface."
+.PP
+In multi-port operation, this same technique simply extends to several
+interfaces.  Besides each interface's unique callsign, you can give
+the same alias to several interfaces.  This results in a one-to-many
+fanout which might be useful for dual frequency operation such as a
+general use APRS net frequency and an event-specific frequency.
+.PP
+By using different flags for Mic-E expansions, etc. you can tailor
+these fanouts differently on each of these interfaces, perhaps keeping
+Mic-E packets compressed on one frequency while decompressing them on
+another.
+.SH DUPLICATING PACKETS
+The 
+.B "\--dupe intf"
+option will duplicate a packet received on one interface to the interface
+name given.  If you want to duplicate to several other interface, repeat
+.B "\--dupe intf" 
+for each interface.
+The packet is duplicated verbatim
+as received.  No callsign substitution, flooding or other processing
+or checking such as whether the packet still has any
+non-repeated digipeaters in the list is checked.  This feature is meant
+to provide a means to simply repeat received packets verbatim, on an RF
+interface, for example, out an interface that might be an Ethernet,
+that has APRS client applications running on it (or 
+.I aprsd
+listening on a UDP interface).  Digipeating without
+the normal processing can be dangerous since the digipeater list is never
+used up.  Because of this, packets received on a given interface will
+never be blindly duplicated back to the same interface, regardless of
+the option setting.
+.PP
+.SH TRACE vs. TRACEN-N
+.PP
+Note that TRACEn-n vs. plain TRACE do
+different things: TRACEn-n *inserts* calls into the digipath while
+decrementing ssid, e.g.:
+.nf
+	RELAY*,TRACE3-3
+	RELAY,N2YGK-7*,TRACE3-2
+	RELAY,N2YGK-7,WB2ZII*,TRACE3-1
+	RELAY,N2YGK-7,WB2ZII,N2MH-15*,TRACE3
+	RELAY,N2YGK-7,WB2ZII,N2MH-15,WA2YSM-14*
+.fi
+.PP
+.SH KILLING LOOPING PACKETS
+.PP
+Kill looping packets (\--kill_loops option):
+.nf
+	RELAY*,WIDE,WIDE,WIDE
+	RELAY,N2YGK-7*,WIDE,WIDE
+	RELAY,N2YGK-7,WIDE*,WIDE
+.fi
+Normally n2ygk-7 would respond to this,
+but, by finding one of mycall earlier in the path, I know to ignore it.
+.PP
+.SH EXAMPLES
+.PP
+Following is a sample invocation of 
+.I aprsdigi
+running on two ports.  This is a contrived example that tries to show
+all the features.  Comments to the right describe each feature.
+.nf
+aprsdigi \\
+   --verbose \\                                 # verbose
+   --north "N2YGK-2 WB2ZII WA2YSM-14" \\        # North digi path
+   --south "N2YGK-3 WB2ZII WA2JNF-4" \\         # South ...
+   --east "N2YGK-3 WB2ZII KD1LY" \\             # East ...
+   --west "N2YGK-2 WB2ZII N2MH-15" \\           # West ...
+   --flood "WIDE" \\                            # WIDEn-n flooding
+   --trace "TRACE" \\                           # TRACEn-n tracing
+   --kill_dupes \\                              # kill dupes
+   --kill_loops \\                              # kill loops
+   --mice_xlate \\                              # do Mic-E translation
+   --subst_mycall \\                            # do callsign substituton
+   --tag " via 147.06 (WB2ZII/R)" \\            # add this tag to rec'd pkts
+   --nobud "ax25:NOCALL" \\                     # ignore pkts from NOCALL
+   --dupe udp:233.0.14.100 \\			# dupe everything heard 
+   --int ax25:sm0:RELAY,WIDE,TRACE \\           # ax25 soundmodem intf
+   --nomice_xlate \\                            # turn off Mic-E translation
+   --x1j4_xlate \\                              # do X1J4 translation
+   --nosubst_mycall \\                          # turn off callsign subst.
+   --tag - \\                                   # clear the tag
+   --int ax25:ax0:RELAY,WIDE,FOO,TRACE \\       # ax25 ax0 intf.
+   --bud - \\                                   # clear the budlist
+   --bud ip:128.59.39.150/32 \\                 # allow only from this IP host
+   --int udp:233.0.14.99/12345/16:N2YGK-4,RELAY,WIDE,TRACE \\ # multicast 
+   --int udp:233.0.14.100/12345/16:N2YGK-5	# to this mcast group
+
+opening UDP socket on 233.0.14.99/12345/16
+UDP address info: family 2 type 2 proto 17 next 0x0
+Linux APRS(tm) digipeater
+Copyright (c) 1996,1997,1999,2001,2002,2003 Alan Crosswell, n2ygk at weca.org
+Version: aprsdigi aprsdigi-2.4.3
+This is free software covered under the GNU Public License.
+There is no warranty.  See the file COPYING for details.
+
+# configuration:
+ budlist 1 deny NOCALL/48
+ budlist 2 permit 128.59.39.150/32
+interface ax25:sm0
+ callsign N2YGK-2
+ alias RELAY
+ alias WIDE
+ alias TRACE
+ option SUBST_MYCALL on
+ option MICE_XLATE on
+ option X1J4_XLATE off
+ option I_TX on
+ option I_RX on
+ option I_TXSAME on
+ option idinterval 570 #(09:30)
+ option tag  via 147.06 (WB2ZII/R)
+ budlist 1
+interface ax25:ax0
+ callsign N2YGK-3
+ alias RELAY
+ alias WIDE
+ alias FOO
+ option SUBST_MYCALL off
+ option MICE_XLATE off
+ option X1J4_XLATE on
+ option I_TX on
+ option I_RX on
+ option I_TXSAME on
+ option idinterval 570 #(09:30)
+ option tag #(none)
+ budlist 2
+interface udp:233.0.14.99
+ callsign N2YGK-4
+ alias RELAY
+ alias WIDE
+ alias FOO
+ option SUBST_MYCALL off
+ option MICE_XLATE off
+ option X1J4_XLATE on
+ option I_TX on
+ option I_RX on
+ option I_TXSAME off
+ option idinterval 570 #(09:30)
+ option tag #(none)
+ budlist 2
+# end of configuration
+
+My callsigns and aliases (routing table):
+Callsign  Interfaces...
+N2YGK-2   sm0 
+RELAY     sm0       ax0       233.0.14.99
+WIDEn-n   sm0       ax0       233.0.14.99
+TRACEn-n  sm0 
+N2YGK-3   ax0 
+FOO       ax0       233.0.14.99
+N2YGK-4   233.0.14.99
+SSID-based directional routing:
+
+N:        N2YGK-2   WB2ZII    WA2YSM-14 
+S:        N2YGK-3   WB2ZII    WA2JNF-4  
+E:        N2YGK-3   WB2ZII    KD1LY     
+W:        N2YGK-2   WB2ZII    N2MH-15   
+keep dupes for: 28 seconds
+log file: (none)
+kill dupes: ON loops: ON  testing: OFF
+
+.fi
+.SH BUGS
+.I Aprsdigi
+should not be confused with a Wes Johnson's DOS program of the same name.
+This code has most recently been tested with the Linux 2.4.20 kernel
+under Red Hat Fedora Core 1.
+The command line syntax is ugly and will eventually be replaced by a 
+configuration file. 
+Short options are deprecated and will dissappear in a future release.
+Please use long options.
+.PP
+.SH FILES
+.BR /etc/ax25/axports
+.SH "SEE ALSO"
+.BR call (1),
+.BR listen (1),
+.BR beacon (1),
+.BR ax25 (4),
+.BR kissattach (8),
+.BR ifconfig (8),
+.BR aprsmon (1),
+.BR http://www.tapr.org
+.SH AUTHORS
+.nf
+Alan Crosswell, n2ygk at weca.org
+.br
+APRS and the Mic-Encoder are Trademarks of APRS Engineering LLC.
+.fi
diff --git a/aprsdigi.c b/aprsdigi.c
new file mode 100644
index 0000000..5fdd7dc
--- /dev/null
+++ b/aprsdigi.c
@@ -0,0 +1,2688 @@
+/* aprsdigi: APRS-style UI frame digipeater and node.
+ *
+ *  APRS has some peculiar digipeating ideas, so let's test them here:
+ *
+ *  1. Several digipeater aliases such as RELAY, WIDE, GATE.
+ *  2. WIDEn-n flooding algorithm.
+ *  3. SSID-based shorthand for digi path.
+ *  
+ *  See Bob Bruninga's (WB4APR) README/MIC-E.TXT for a description of
+ *  methods 2 and 3.  #1 is conventional TNC digipeating with MYAlias, etc.
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License, version 2 as
+ *  published by the Free Software Foundation.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ * (See the file "COPYING" that is included with this source distribution.)
+ * 
+ * portions derived from ax25-utils/listen.c
+ *
+ * Copyright (c) 1996,1997,1999,2001,2002,2003 Alan Crosswell
+ * Alan Crosswell, N2YGK
+ * 144 Washburn Road
+ * Briarcliff Manor, NY 10510, USA
+ * n2ygk at weca.org
+ *
+ * TODO:
+ *  see ./TODO
+ */
+#include <sys/types.h>
+#include <sys/time.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <sys/socket.h>
+#include <sys/un.h>
+#include <net/if.h>
+#include <netinet/if_ether.h>
+#include <netinet/in.h>
+#include <sys/ioctl.h>
+#include <unistd.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <ctype.h>
+#include <time.h>
+#include <signal.h>
+#include <errno.h>
+#include <netax25/kernel_ax25.h>
+#include <netax25/kernel_rose.h>
+#include <netax25/ax25.h>
+#include <netax25/axlib.h>
+#include <netax25/axconfig.h>
+#ifndef AX25_MTU
+#define AX25_MTU 256
+#endif
+#include <netdb.h>
+
+#include "mic_e.h"
+#include "libax25ext.h"
+
+#ifndef PACKAGE
+#define PACKAGE "aprsdigi"
+#endif
+#ifndef VERSION
+#define VERSION "$Revision: 1.1.1.1 $";
+#endif
+
+/* some defines that really belong in a header file! */
+#define	ALEN		6	/* index to where the SSID and flags go */
+#define	AXLEN		7	/* length of a callsign */
+/* SSID mask and various flags that are stuffed into the SSID byte */
+#define	SSID		0x1E
+#define	HDLCAEB		0x01
+#define	REPEATED	0x80
+
+#define	UI		0x03	/* unnumbered information (unproto) */
+#define	PID_NO_L3	0xF0	/* no level-3 (text) */
+#define	C		0x80
+#define	SSSID_SPARE	0x40	/* must be set if not used */
+#define	ESSID_SPARE	0x20
+
+
+struct statistics {		/* counters */
+  int rx;			/* packets received */
+  int rx_ign;			/*  rx packets ignored */
+  int rx_dup;			/*  dupe packets killed */
+  int rx_loop;			/*  looping packets killed */
+  int rx_mic;			/*  mic_e packets received */
+  int rx_ssid;			/*  dest SSID packets received */
+  int tx;			/* packets transmitted, sum of: */
+  int digi;			/*  regular digipeats */
+  int flood;			/*  flood-N digipeats */
+  int ssid;			/*  dest SSID digipeats */
+  int ids;			/*  id packets */
+};
+
+/* the per-interface information */
+#define MAXALIASES 5
+#define MAXINTF 10
+
+struct budlist_entry {		/* budlist entry */
+  struct budlist_entry *be_next;
+  int be_permit;			/* permit/deny */
+  struct sockaddr_storage be_addr, be_mask;
+  int be_maskbits;
+};
+
+struct budlist {		/* a given budlist */
+  struct budlist *bl_next;
+  int bl_list_no;			/* list number */
+  struct budlist_entry *bl_ent_head, *bl_ent_last;
+};
+
+static struct budlist *Bl_head = NULL, *Bl_last = NULL;
+
+struct dupelist_entry {		/* dupelist entry */
+  struct dupelist_entry *de_next;
+  char *de_dev;			/* interface device name to dupe to */
+};
+
+struct dupelist {		/* a given dupelist */
+  struct dupelist *dl_next;
+  int dl_list_no;		/* list number */
+  struct interface_list *dl_il;	/* list of interfaces to dupe to */
+  struct dupelist_entry *dl_ent_head, *dl_ent_last;
+};
+
+static struct dupelist *Dl_head = NULL, *Dl_last=NULL;
+
+static struct interface {
+  char *port;			/* axports port name */
+  char *dev;			/* kernel device name */
+  char *devname;		/* user-friendly device name */
+  char *tag;			/* optional tag text */
+  int taglen;
+  int idinterval;		/* seconds between IDs; 0 for none. */
+  int i_flags;			/* status flags */
+  enum {
+    P_UDP=1,			/* interface is UDP socket */
+    P_AX25=2,			/* interface is AX25 socket */
+    P_UNIX=3,			/* interface is a unix file */
+  } i_proto;
+  ax25_address aliases[MAXALIASES]; /* intf call & aliases */
+  int n_aliases;
+  int rsock,tsock;		/* socket fds */
+#ifdef IPV6
+  struct sockaddr_storage rsa,tsa,rsafrom;	/* and their sockaddrs */
+#else
+  struct sockaddr rsa,tsa,rsafrom;	/* and their sockaddrs */
+#endif /*IPV6*/
+  int rsa_size,tsa_size;	/* sendto() bug w/sizeof(sockaddr_storage)? */
+  time_t next_id;		/* next time we ID */
+  u_char idbuf[AX25_MTU];	/* An ID packet for this intf */
+  int idlen;
+  struct statistics stats;	/* statistics */
+  struct budlist *bud;		/* budlist */
+  struct dupelist *dupe;	/* list of interfaces to dupe to */
+} Intf[MAXINTF];
+#define MYCALL(n) Intf[n].aliases[0]
+#define I_MYCALL(i) i->aliases[0]
+static int N_intf = 0;
+
+struct interface_list {		/* a list of interfaces (duh) */
+  struct interface_list *next;
+  struct interface *i;
+};
+
+struct stuff {			/* maybe I should learn C++... */
+  u_char *cp;			/* pointer into the packet */
+  int len;			/* length of it */
+  struct ax_calls in;		/* the received packet's calls, flags, etc. */
+  struct ax_calls out;		/* the transmitted packet's calls, etc. */
+  struct interface *i;		/* the interface received on */
+}; 
+
+/* some global stuff */
+
+/* General options: */
+static int Verbose = 0;
+static int Testing = 0;
+static int Digi_SSID = 0;
+static int Kill_dupes = 0;	/* kill dupes even in conventional mode */
+static int Kill_loops = 0;	/* kill loops */
+static int Doing_dupes = 0;	/* dupelist was set on some interface */
+static char *Logfile = NULL;
+static ax25_address Aprscall;	/* replace mic-e encoded to-call with this */
+static ax25_address Trace_dummy; /* dummy call for tracen-n substitution */
+static ax25_address Widecall;	/* dummy call for WIDEn-n substitution */
+static ax25_address Udpipcall;	/* dummy call for UDPIP 3rd party */
+static int Have_digipath = 0;
+#define DIGISIZE 7		/* one more than usual! */
+static ax25_address Digipath[DIGISIZE]; /* for SSID-[1:7] w/o flooding */
+static struct full_sockaddr_ax25 Path[4]; /* for SSID-[8:15] N S E W */
+static char Dirs[5] = "NSEW";
+
+/* per-interface default options: */
+static char *Tag = NULL;	/* tag onto end of rx'd posit */
+static int Taglen = 0;
+static int Idinterval = (9*60)+30; /* default to 9:30 */
+static int Keep = 28;		/* seconds to remember for dupe test */
+static int I_flags = 0;		/* interface default flags */
+#define I_NEED_ID    0x01	/* need to ID */
+#define SUBST_MYCALL 0x02	/* replace digi alias w/mycall */
+#define MICE_XLATE   0x04	/* translate mic-e to tracker format */
+#define X1J4_XLATE   0x08	/* translate x1j4 to plain format */
+#define I_COOKED     0x20	/* interface is cooked */
+#define I_RX         0x40	/* interface is enabled to receive */
+#define I_TX         0x80	/* interface is enabled to transmit */
+#define I_TXSAME   0x0100	/* enable re-TX on received interface */
+#define I_3RDP     0x0200	/* enable 3rd party tunneling */
+
+/*
+ * A table of recognized flooding alias prefixes.  In current practice, 
+ * the only recognized flood aliases are WIDEn and TRACEn(where n is 0-7)
+ * where the latter has truly odd behavior.  The flavors of WIDE and TRACE
+ * are:
+ *  1. WIDE:  A conventional alias, eligible for MYCALL substitution.
+ *     Roughly equivalent to WIDE0-0.
+ *  2. WIDEn-n: Flooding algorithm.  Decrement SSID and repeat the packet
+ *     without setting the DIGIPEATED flag until it reaches zero at which
+ *     point do set the DIGIPEATED flag and move on to the next callsign
+ *     in the digipeat list.  Does not get MYCALL substituted (even WIDEn-0)
+ *     so the user can see that the packet came in via n (anonymous) WIDE
+ *     digis.
+ *  3. TRACE: Like WIDE but MYCALL substitution is not required.
+ *  4. TRACEn-n: Do the SSID substitution like WIDE, but also insert MYCALL
+ *     into the digi list:
+ *	RELAY*,TRACE3-3
+ *	RELAY,N2YGK-7*,TRACE3-2
+ *	RELAY,N2YGK-7,WB2ZII*,TRACE3-1
+ *	RELAY,N2YGK-7,WB2ZII,N2MH-15*,TRACE3
+ *	RELAY,N2YGK-7,WB2ZII,N2MH-15,WA2YSM-14*
+ *     (What happens when the digi list gets too long for the AX.25 protocol
+ *     appears not to have been considered in this design.  I guess we'll
+ *     just insert as many as we can.)
+ */
+
+/*
+ * These flags are shared by the calltab and floods tables and by 
+ * the floodtype of a specific received call.  That is, while there is
+ * only one WIDE calltab entry, a received callsign can be WIDE-n or
+ * WIDEn-n.
+ */
+#define C_IS_NOFLOOD 0		/* not a flood */
+#define C_IS_FLOOD 1		/* this callsign is a flood (WIDE) */
+#define C_IS_FLOODN 2		/* this is an N-N type flood (WIDEn-n) */
+#define C_IS_TRACE 4		/* this is a trace-type flood (TRACE*) */
+
+struct flood {
+  ax25_address call;		/* the flooding callsign prefix */
+  int len;			/* length */
+  int flags;
+} Floods[MAXALIASES];
+static int N_floods = 0;
+#define FLOODCALL Floods[0].call
+#define FLOODLEN Floods[0].len
+
+/* forward declarations */
+static int unproto(struct full_sockaddr_ax25 *, char *);
+static int parsecalls(ax25_address*, int, char *);
+static void print_it(FILE *,struct ax_calls *,unsigned char *,int len);
+static void add_text(u_char **,int *,u_char *,int,char *,int);
+static int dupe_packet(struct ax_calls *,u_char *,int);
+static int loop_packet(struct ax_calls *,u_char *,int);
+static int xmit(struct stuff *s, struct interface_list *list);
+static void set_id(void);
+static void rx_packet(struct interface *i, u_char *buffer, int len);
+static void fix_recvfrom(struct stuff *s);
+static int floodcmp(ax25_address *a, int len, ax25_address *b);
+static int floodtype(ax25_address *c, int i);
+static void sked_id(struct interface *iface);
+static void budlist_add(char *, int);
+static int budlist_permit(struct stuff *);
+static void budlist_print_all(FILE *f);
+static void budlist_print(FILE *f,struct budlist *);
+static void dupelist_add(char *);
+static void dupelist_print_all(FILE *f);
+static void dupelist_print(FILE *f,struct dupelist *);
+static void dupelist_init(void);
+static void printaddr(struct sockaddr_storage *s, char *buf, int buflen);
+static void setmask(int, u_char *);
+static int cmpmask(int, u_char *, u_char *, u_char *);
+static void die(char *);
+static void usage(void);
+static void usage_udp(void);
+static void usage_unix(void);
+static void usage_ax25(void);
+static void usage_budlist(void);
+static void check_config();
+static void config_print(FILE *f);
+static void print_dupes(void);
+static struct interface_list *intf_of(ax25_address *callsign);
+static void to_3rdparty(struct ax_calls *calls);
+static void drop_unused_digis(struct ax_calls *calls);
+static void from_3rdparty(struct stuff *s,
+	      int npkts,	/* dimension of the next two vectors */
+	      u_char *pkt[],	/* output buffers for source path header */
+	      int pktl[]);	/* output length of sph (AX25_MTU max) */
+/* signal handlers */
+static void cleanup(int),identify(int),identify_final(int),
+  print_stats(int),reset_stats(int);
+
+static void do_opts(int argc, char **argv);
+static void do_ports(void);
+static void do_port_ax25(struct interface *);
+static void do_port_udp(struct interface *);
+static void do_port_unix(struct interface *);
+static void set_sig(void);
+static int rx_loop(void);
+
+int
+main(int argc, char **argv)
+{
+  int r;
+
+  bzero(Intf,sizeof(Intf));
+  do_opts(argc,argv);
+  do_ports();
+  set_id();
+  set_sig();
+  check_config();
+  r = rx_loop();
+  exit(r);
+}
+
+/* Listen for received packets and farm out the work */
+static int
+rx_loop()
+{
+  unsigned char buffer[AX25_MTU];
+  int n,selfds = 0;
+  struct interface *i;
+  fd_set select_mask;
+
+  /* set up the initial select mask */
+  FD_ZERO(&select_mask);
+  for (n  = 0, i = Intf; n < N_intf; n++, i++) {
+    if (i->rsock >= 0 && (i->i_flags & I_RX)) {
+      FD_SET(i->rsock, &select_mask);
+      selfds = (i->rsock>selfds)?i->rsock:selfds;
+    }
+  }
+  ++selfds;
+  for (;;) {
+    int len;
+    fd_set rmask = select_mask;
+
+    if (select(selfds,&rmask,NULL,NULL,NULL) < 0) {
+      if (errno == EINTR)
+	continue;
+      perror("select");
+      return 1;
+    }
+
+    /* find which sockets have data */
+    for (n = 0, i = Intf; n < N_intf; n++, i++) {
+      if (i->rsock >= 0 && FD_ISSET(i->rsock,&rmask)) {
+	int size = sizeof(i->rsafrom);
+	if ((len = recvfrom(i->rsock,buffer,sizeof(buffer),0,(struct sockaddr *)&i->rsafrom,&size)) < 0) {
+	  if (errno == EINTR)
+	    continue;
+	  perror(i->port);
+	  return 1;
+	}
+	rx_packet(i,buffer,len); /* process the received packet */
+      }
+    }
+  } /* end of for(;;) */
+  return 0;			/* NOTREACHED */
+}
+
+/* Parse a received packet, convert and digipeat if necessary. */
+
+static void rx_dupeit(struct stuff *s);
+static int rx_nodigi(struct stuff *s,int r);
+static int rx_dupe(struct stuff *s);
+static int rx_to_me(struct stuff *s);
+static int rx_bud_deny(struct stuff *s);
+static int rx_from_me(struct stuff *s);
+static int rx_ssid(struct stuff *s);
+static int rx_flood(struct stuff *s);
+static int rx_digi(struct stuff *s);
+
+static void
+rx_packet(struct interface *i,	/* which interface received on */
+	  u_char *buffer,	/* what was received */
+	  int len)		/* length received */
+{
+  int r;
+  struct stuff s;
+
+  bzero(&s,sizeof(s));
+  s.i = i;
+  ++s.i->stats.rx;
+  s.cp = buffer;
+  s.len = len;
+
+
+  /* parse the cooked or raw kiss frame */
+  if (i->i_flags&I_COOKED)
+    r = parse_cooked_ax25(&s.cp,&s.len,&s.in);
+  else
+    r = parse_raw_ax25(&s.cp,&s.len,&s.in);
+  
+  fix_recvfrom(&s);		/* workaround bug in AF_AX25 */
+
+  if (Verbose) {
+    char buf[20];
+    time_t tick = time(0);
+    strftime(buf,sizeof(buf),"%T",gmtime(&tick));
+    fprintf(stderr,"%s %s: RX: ",buf,s.i->port);
+    print_it(stderr,&s.in,s.cp,s.len);
+  }
+
+  /* go through a bunch of choices until we eat the packet or die:-) */
+
+  if (Doing_dupes)
+    rx_dupeit(&s);		/* blindly dupe it */
+  if (rx_bud_deny(&s))		/* budlisted */
+    return;
+  else if (rx_from_me(&s))      /* don't digi my own repeated beacons! */
+    return;
+  else if (rx_ssid(&s))		/* dest SSID handling */
+    return;
+  else if (rx_nodigi(&s,r))	/* Nothing to digi? */
+    return;
+  else if (rx_dupe(&s))		/* Is it a killed dupe or loop? */
+    return;
+  else if (rx_to_me(&s))	/* Addressed to me? */
+    return;
+  else if (rx_flood(&s))	/* flood special handling */
+    return;
+  else if (rx_digi(&s))		/* conventional digi */
+    return;
+
+  /* How'd we get here? */
+  if (Testing) {
+    fprintf(stderr,"%s: Not repeatable\n",s.i->port);
+  }
+}	  
+
+/* XXX bug(?) in AF_AX25 for raw sockets puts the interface name in
+   sax25_call instead of the sender's callsign:
+   (gdb) p (struct sockaddr_ax25)i->rsafrom
+   $3 = {sax25_family = 3, sax25_call = {ax25_call = "ax0\0\0\0"}, 
+   sax25_ndigis = 0}
+*/
+static void
+fix_recvfrom(struct stuff *s)
+{
+  struct sockaddr_ax25 *sax25 = (struct sockaddr_ax25 *)&s->i->rsafrom;
+
+  if (sax25->sax25_family == AF_AX25) {
+    bcopy(&s->in.ax_from_call,
+	  sax25->sax25_call.ax25_call,sizeof(sax25->sax25_call.ax25_call));
+  }
+}
+
+static void
+rx_dupeit(struct stuff *s)
+{
+  int n;
+
+  if (s->i->dupe && s->i->dupe->dl_il) {
+    if (Verbose) {
+      fprintf(stderr,"%s: duping to dupelist %d\n",s->i->devname,
+	      s->i->dupe->dl_list_no);
+    }
+    s->out = s->in;
+    if (xmit(s,s->i->dupe->dl_il) < 0) 
+      perror("xmit");
+    }
+}
+
+static int
+rx_nodigi(struct stuff *s,int r)
+{
+  int result = 0;
+  /* bail if invalid or not doing SSID & no unrepeated digis */
+  if (r == PK_INVALID || r == PK_VALID || (r != PK_VALDIGI && !Digi_SSID)) {
+    ++s->i->stats.rx_ign;
+    result = 1;
+  }
+  if (Verbose) {
+    if (result)
+      fprintf(stderr,"packet is %s. (r=%d)\n",
+	      (r == PK_INVALID)?"invalid":"not repeatable",r);
+    else
+      fprintf(stderr,"packet is repeatable. (r=%d)\n",r);
+  }
+  return result;
+}
+
+static int
+rx_dupe(struct stuff *s)
+{
+  int result = 0;
+  static char *lupedupe[] = {"dupe or loop","dupe","loop"};
+
+  /* If packet was last transmitted by me, then don't digipeat it! */
+  if (Kill_dupes && dupe_packet(&s->in,s->cp,s->len)) {
+    ++s->i->stats.rx_dup;
+    result = 1;
+  } else if (Kill_loops && loop_packet(&s->in,s->cp,s->len)) {
+    ++s->i->stats.rx_loop;
+    result = 2;
+  }
+  if (Verbose) {
+    fprintf(stderr,"packet is%sa %s\n",result?" ":" not ",lupedupe[result]);
+  }
+  return result;
+}  
+
+
+/*
+ * find interfaces belonging to a callsign or alias.  Returns a pointer to
+ * a list of interfaces or NULL if not found.
+ */
+static struct callsign_list {
+  ax25_address *callsign;
+  int flags;
+  int floodlen;			/* length of flood call */
+  struct interface_list *l;	/* list of interfaces having this callsign */
+  struct interface_list *illast;
+  struct callsign_list *next;
+} *calltab = NULL, *ctlast = NULL;
+
+static void calltab_init(void);
+
+static struct callsign_list *
+calltab_entry(ax25_address *callsign,int *flags)
+{
+  struct callsign_list *c;
+  int flagdummy;
+
+  if (flags == NULL)
+    flags = &flagdummy;		/* dummy the flags if not needed */
+  *flags = 0;
+  for (c = calltab; c; c = c->next) {
+    if ((c->flags&C_IS_FLOOD 
+	 && (*flags = floodcmp(c->callsign,c->floodlen,callsign)))
+	|| (ax25_cmp(c->callsign,callsign) == 0)) {
+      *flags |= c->flags;	/* add stuff floodcmp doesn't know about */
+      return c;
+    }
+  }
+  return NULL;
+}
+
+static void 
+calltab_init(void)
+{
+  struct interface *i;
+  int n,m;
+  
+  /* iterate over all interfaces' callsigns */
+  for (i = Intf, n = 0; n < N_intf; n++,i++) {
+    for (m = 0; m < i->n_aliases; m++) {
+      struct interface_list *new_il = 
+	(struct interface_list *)calloc(1,sizeof(struct interface_list));
+      struct callsign_list *c = (calltab)?calltab_entry(&i->aliases[m],0):NULL;
+
+      if (!c) {			/* first time seeing this call */
+	int f;
+	c = (struct callsign_list *)calloc(1,sizeof(struct callsign_list));
+	c->callsign = &i->aliases[m];
+	/* see if this is a flood call */
+	for (f = 0; f < N_floods; f++) {
+	  if (floodcmp(&Floods[f].call,Floods[f].len,c->callsign)) {
+	    c->flags =  Floods[f].flags;
+	    c->floodlen = Floods[f].len;
+	    break;
+	  }
+	}
+	/* add the new callsign_list to calltab */
+	if (ctlast) {
+	  ctlast->next = c;
+	  ctlast = c;
+	} else {
+	  calltab = ctlast = c;	/* very first entry */
+	}
+      }
+      new_il->i = i;		/* initialize the interface list */
+      if (c->illast) {		/* and link it in to the callsign's list */
+	c->illast->next = new_il;
+	c->illast = new_il;
+      } else {
+	c->l = c->illast = new_il;
+      }
+    }
+  }
+}
+
+static struct interface_list *
+intf_of(ax25_address *callsign)
+{
+  struct callsign_list *c;
+
+  if (c = calltab_entry(callsign,0))
+    return c->l;
+  return NULL;
+}
+
+static int
+rx_to_me(struct stuff *s)
+{
+  int result = 0;
+  struct interface_list *l = intf_of(&s->in.ax_to_call);
+
+  if (l) {
+    result = 1;
+    ++s->i->stats.rx_ign;
+  }
+  if (Verbose) {
+    fprintf(stderr,"packet is%saddressed to me.\n",result?" ":" not ");
+  }
+  return result;
+}  
+
+static int
+rx_bud_deny(struct stuff *s)
+{
+  int permit = 0;
+
+  permit = budlist_permit(s);
+  if (Verbose) {
+    fprintf(stderr,"packet is %s by budlist.\n",permit?"permitted":"denied");
+  }
+  return !permit;		/* true if denied */
+}  
+
+
+static int
+rx_from_me(struct stuff *s)
+{
+  int n,result = 0;
+  struct interface *iface;
+
+  for (n = 0, iface = Intf; n < N_intf; n++, iface++) {
+    if (ax25_cmp(&MYCALL(n),&s->in.ax_from_call) == 0) {
+      result=1;
+      ++s->i->stats.rx_ign;
+    }
+  }
+
+  if (Verbose) {
+    fprintf(stderr,"packet is%sfrom me.\n",result?" ":" not ");
+  }
+  return result;
+}  
+
+/* 
+ * SSID path selection only applies if:
+ *  1. SSID digipeating is enabled.
+ *  2. To-call's SSID must be non zero: this is the route.
+ *  3. Digipeater path must be empty.
+ * Count up mic_e packets while we are here.
+ */
+static int
+rx_ssid(struct stuff *s)
+{
+  int ssid, mic_e, result = 0;
+
+  mic_e = (*(s->cp) == 0x60 || *(s->cp) == 0x27
+	   || *(s->cp) == 0x1c || *(s->cp) == 0x1d);
+  if (mic_e)
+    ++s->i->stats.rx_mic;
+  if (Verbose) {
+    fprintf(stderr,"%s mic_e...\n",mic_e?"is":"is not");
+  }  
+  if (Digi_SSID && s->in.ax_n_digis == 0 
+      && (ssid = (s->in.ax_to_call.ax25_call[ALEN]&SSID)>>1)
+      && s->len > 0) {
+    if (Verbose) {
+      fprintf(stderr,"Got an SSID route for path %d.\n",ssid);
+    }
+    ++s->i->stats.rx_ssid;
+    s->out.ax_from_call = s->in.ax_from_call;
+    s->out.ax_to_call = s->in.ax_to_call;
+    s->out.ax_to_call.ax25_call[ALEN]&=~SSID; /* zero the SSID */
+    s->out.ax_type = s->in.ax_type;
+    s->out.ax_pid = s->in.ax_pid;
+    if (ssid <= 7) {	/* omnidirectional */
+      if (N_floods || ssid == 0) { /* in a flooding network? */
+	s->out.ax_n_digis = 1;
+	s->out.ax_digi_call[0] = FLOODCALL;
+	s->out.ax_digi_call[0].ax25_call[FLOODLEN] = (ssid+'0') << 1;
+	s->out.ax_digi_call[0].ax25_call[ALEN] |= SSID&(ssid<<1);
+	if (Verbose) {
+	  fprintf(stderr,"Flooding: setting path to %s\n",
+		  ax25_ntoa_pretty(&s->out.ax_digi_call[0]));
+	}
+      } else {		/* not in a flooding network */
+	int startat,i;
+	if (ssid < 4) {		/* RTFM for why this is */
+	  startat = 0;		/* starting point in digipath */
+	  s->out.ax_n_digis = ssid; /* number of digis from there. */
+	} else {
+	  startat = 3;
+	  s->out.ax_n_digis = ssid-3;
+	}
+	if (Verbose) {
+	  fprintf(stderr,"Non-flooding: converting SSID WIDE-%d path to DIGI[%d:%d]\n",
+		  ssid,startat,startat+s->out.ax_n_digis-1);
+	}
+	/* fill in the digipeater list */
+	for (i = 0; i < s->out.ax_n_digis; i++,startat++) {
+	  s->out.ax_digi_call[i] = Digipath[startat];
+	}
+      } /* flooding/non-flooding network */
+    } else {			/* SSID > 7 is directional */
+      int j;
+      if (Verbose) {
+	fprintf(stderr,"setting path to %c UNPROTO%s\n",
+		Dirs[ssid&3],(ssid&4)?" + WIDE":"");
+      }
+      s->out.ax_n_digis = Path[ssid&3].fsa_ax25.sax25_ndigis;
+      for (j = 0; j <= s->out.ax_n_digis; j++)
+	s->out.ax_digi_call[j] = Path[ssid&3].fsa_digipeater[j];
+      if (ssid&4) {	/* directional + wide call */
+	s->out.ax_digi_call[s->out.ax_n_digis++] = Widecall;
+      }
+    }
+    ++s->i->stats.ssid;
+    if (xmit(s,NULL) < 0)
+      perror("xmit");
+    result = 1;
+  }
+  if (Verbose) {
+    fprintf(stderr,"did%srequire destination SSID handling.\n",
+	    result?" ":" not ");
+  }
+  return result;
+}  
+
+/* see if special WIDEn-n & TRACEn-n handling applies. */
+static int
+rx_flood(struct stuff *s)
+{
+  int i,wide,thisflags,result=0;
+  struct callsign_list *c;
+
+  /* FLOODn-n algorithm: next digi with non-zero ssid callsign */
+  c = calltab_entry(&s->in.ax_digi_call[s->in.ax_next_digi],&thisflags);
+  if (c && thisflags&C_IS_FLOOD
+      && (wide = (s->in.ax_digi_call[s->in.ax_next_digi].ax25_call[ALEN]&SSID)>>1)) {
+
+    if (Verbose) {
+      fprintf(stderr,"Got a flooding %s route.\n",
+	      ax25_ntoa_pretty(&s->in.ax_digi_call[s->in.ax_next_digi]));
+    }
+
+    /* flooding algorithm always kills dupes.  If kill_dupes
+       option was not selected, then do the dupe checking here */
+    if (!Kill_dupes && dupe_packet(&s->in,s->cp,s->len)) {
+      if (Verbose) {
+	fprintf(stderr,"flood packet is a dupe\n");
+      }
+      return 1;
+    }
+    /* decrement the flood counter (SSID) */
+    s->out = s->in;		/* copy the input header */
+    s->out.ax_digi_call[s->out.ax_next_digi].ax25_call[ALEN] &= ~SSID;
+    s->out.ax_digi_call[s->out.ax_next_digi].ax25_call[ALEN] |= ((--wide) << 1)&SSID;
+    /* TRACEn-n: insert dummy mycall in front: xmit will put the real one in */
+    if ((thisflags&(C_IS_FLOODN|C_IS_TRACE)) == (C_IS_FLOODN|C_IS_TRACE)) {
+      int n;
+      if (s->out.ax_n_digis >= AX25_MAX_DIGIS) {
+	fprintf(stderr,"%s: TRACEn-n list overflow. Last digi dropped.\n",
+		s->i->port);
+	s->out.ax_n_digis--;
+      }
+      /* shift remaining digis right one slot to make room */
+      for (n = s->out.ax_n_digis; n >= s->out.ax_next_digi; n--) {
+	s->out.ax_digi_call[n] = s->out.ax_digi_call[n-1];
+      }
+      /* then stuff in a dummy "TRACE" and mark it repeated */
+      s->out.ax_digi_call[s->out.ax_next_digi] = Trace_dummy;
+      s->out.ax_digi_call[s->out.ax_next_digi].ax25_call[ALEN] |= REPEATED;
+      s->out.ax_n_digis++;
+    }
+    if (Verbose) {
+      fprintf(stderr,"Rewriting it as %s:\n",
+	      ax25_ntoa_pretty(&s->out.ax_digi_call[s->out.ax_next_digi]));
+    }
+    ++s->i->stats.flood;
+    if (xmit(s,NULL) < 0) 
+      perror("xmit");
+    return 1;
+  }
+  if (Verbose) {
+    fprintf(stderr,"Did %s require special flooding handling.\n",
+	    result?" ":" not ");
+  }
+  return result;
+}
+
+/* see if conventional digipeat handling applies. */
+static int
+rx_digi(struct stuff *s)
+{
+  int j, result = 0;
+  struct interface_list *l;
+
+  /* conventional: see if the next digipeater matches one of my calls */
+  if (l = intf_of(&s->in.ax_digi_call[s->in.ax_next_digi])) {
+    /* a packet for me to digipeat */
+    if (Verbose) {
+      fprintf(stderr,"Got a conventional digipeat.\n");
+    }
+      s->out = s->in;	/* copy input list to output unmodifed */
+      s->out.ax_digi_call[s->out.ax_next_digi].ax25_call[ALEN] |= REPEATED;
+      ++s->i->stats.digi;
+      if (xmit(s,NULL) < 0) 
+	perror("xmit");
+      result  = 1;
+  }
+  if (Verbose) {
+    fprintf(stderr,"Did%srequire conventional digipeat handling.\n",
+	    result?" ":" not ");
+  }
+  return result;
+}
+
+static void
+add_text(op,oleft,text,len,tag,taglen)
+unsigned char **op;
+int *oleft;
+u_char *text;
+int len;
+char *tag;
+int taglen;
+{
+  if ((*oleft -= len) > 0) {
+    bcopy(text,*op,len);	/* copy the text */
+    *op += len;
+  }
+  if (taglen && tag && (*oleft -= taglen) > 0) {
+    bcopy(tag,*op,taglen); /* and tack on the tag */
+    *op += taglen;
+  }
+}
+
+/* watch out for overflow when adding mycall and/or wide */
+static int
+unproto(calls,str)		/* parse a via path into a calls struct */
+struct full_sockaddr_ax25 *calls;
+char *str;
+{
+  char buf[200];
+
+  bzero(calls, sizeof(*calls));
+  sprintf(buf,"dummy via %s",str);
+  return ax25_aton(buf,calls);
+}
+
+static int
+parsecalls(calls,ncalls,str)	/* parse a via path into a calls struct */
+ax25_address *calls;
+int ncalls;			/* max number */
+char *str;
+{
+  char *cp;
+  int i;
+
+  bzero(calls,ncalls*sizeof(*calls));
+  cp = strtok(str," \t\n,");
+  for (i = 0; cp && i < ncalls; i++) {
+    if (ax25_aton_entry(cp,calls[i].ax25_call) < 0)
+      return -1;
+    cp = strtok(NULL," \t\n,");
+  }
+  return i;
+}
+
+static void
+print_it(FILE *f,
+	 struct ax_calls *calls,
+	 u_char *data,
+	 int len)
+{
+  int j;
+  char asc_from[12],asc_to[12];
+
+  if (f == NULL)
+    return;
+  strncpy(asc_to,ax25_ntoa_pretty(&calls->ax_to_call),sizeof(asc_to));
+  strncpy(asc_from,ax25_ntoa_pretty(&calls->ax_from_call),sizeof(asc_from));
+  fprintf(f,"%s>%s",asc_from,asc_to);
+  for (j = 0; j < calls->ax_n_digis; j++) {
+    fprintf(f,",%s%s",ax25_ntoa_pretty(&calls->ax_digi_call[j]),
+	    (calls->ax_digi_call[j].ax25_call[ALEN]&REPEATED
+		&& (j == calls->ax_next_digi-1))?"*":"");
+  }
+  fprintf(f,":%.*s\n",len,data);
+}
+
+/* 
+ * packet reformatter
+ *  depending on options flags on transmit interface, perform reformatting
+ *  of the payload.  Current methods include mic_E expansion, X1J4
+ *  stripping of the the "TheNet X1J4 (alias)" prefix. Future methods 
+ *  to include GPS/APRS position compression, expansion, etc.
+ */
+static int
+reformat(struct stuff *s,	/* "class data":-) */
+	 struct interface *i,	/* this iteration's transmit interface */
+	 u_char ***ovec,	/* returns ptr to array of u_char ptrs */
+	 int **olen)		/* returns ptr to array of lengths */
+{
+  int r;
+  time_t now;
+  static u_char mic1[AX25_MTU], mic2[AX25_MTU];	/* MTU is *not* max payload! */
+  static u_char pref1[AX25_MTU], pref2[AX25_MTU];
+  static u_char *vecp[2];
+  static int vecl[2];
+
+  time(&now);
+
+  *ovec = vecp;			/* returned ptrs */
+  *olen = vecl;
+  vecp[0] = mic1; vecl[0] = 0;
+  vecp[1] = mic2; vecl[1] = 0;
+  /* does xmit intf want mic-E translation? */
+  if (i->i_flags&MICE_XLATE && 
+      fmt_mic_e(ax25_ntoa_pretty(&s->out.ax_to_call),s->cp,s->len,
+		mic1,&vecl[0],mic2,&vecl[1],now)) {
+    s->out.ax_to_call = Aprscall; /* replace compressed lat w/"APRS" */
+  } else if (i->i_flags&X1J4_XLATE &&   /* want x1j4 translation? */
+	     fmt_x1j4(ax25_ntoa_pretty(&s->out.ax_to_call),s->cp,s->len,
+		      mic1,&vecl[0],mic2,&vecl[1],now)) {
+  } else {			/* no reformat; just pass thru */
+    vecp[0] = s->cp;
+    vecl[0] = s->len;
+  }
+  return (vecl[0]>0)+(vecl[1]>0);
+}
+
+/* 
+ * xmit looks at the next digipeater call to see which interfaces the
+ * packet has to go out.  By giving several interfaces the same callsign
+ * or alias, multi-way fanout and/or gatewaying can be performed.
+ *
+ * An overriding interface list passed in is used by rx_dupeit().
+ */
+static int
+xmit(struct stuff *s, struct interface_list *dupelist)
+{
+  struct callsign_list *c;
+  struct interface_list *l;
+  int r = 0, sent;
+  int thisflags = 0;
+
+  /* transmit the packet on the interface(s) of the next callsign */
+  if (!dupelist) {
+    if ((c = calltab_entry(&s->out.ax_digi_call[s->out.ax_next_digi],&thisflags)) == NULL) {
+      fprintf(stderr,"xmit: Assertion failed: call %s not found\n",
+	      ax25_ntoa_pretty(&s->out.ax_digi_call[s->out.ax_next_digi]));
+      return -1;
+    }
+  }
+  for(l = (dupelist)?dupelist:c->l; l; l = l->next) { /* loop over each tx interface */
+    u_char obuf[AX25_MTU];
+    u_char *op = obuf;
+    int oleft = sizeof(obuf);
+    int olen;
+    int npkt,n;
+    u_char **vecp;		/* output vector */
+    int *vecl;			/* and lengths */
+
+    if (!(l->i->i_flags & I_TX)) {
+      if (Verbose)
+	fprintf(stderr,"%s: interface will not xmit.\n",l->i->devname);
+      continue;
+    }
+    if (!(l->i->i_flags & I_TXSAME) && l->i == s->i) {
+      if (Verbose)
+	fprintf(stderr,"%s: will not retransmit on same interface.\n",l->i->devname);
+      continue;
+    }
+
+    /* do any required per-intf expansion/translation/compression of payload */
+    npkt = reformat(s,l->i,&vecp,&vecl);
+
+    if (s->i != l->i && l->i->i_flags&I_3RDP) {
+      if (Verbose)
+	fprintf(stderr,"3rd party de-tunnel: source port: %s  dest port: %s\n",
+		s->i->port, l->i->port);
+      from_3rdparty(s,npkt,vecp,vecl);
+    }
+          
+    for (n = 0; n < npkt; n++) {
+      struct ax_calls calls = s->out;
+      /* 
+       * Adjust the next_digi pointer only if REPEATED was set.
+       * Only substitute MYCALL if marked REPEATED and the callsign
+       * flags permit it.  Flags and their rules:
+       * FLOOD  FLOODN  TRACE  Rule
+       * -----  ------  -----  -----------------------------------
+       *     0       X      X  only if SUBST_MYCALL substitute MYCALL
+       *     1       0      X  always substitute MYCALL (WIDE/TRACE->MYCALL)
+       *     1       1      0  never substitute MYCALL (WIDEn-n)
+       *     1       1      1  always substitute MYCALL (???->MYCALL)
+       * rx_flood will have inserted tracecall in front of TRACEn-n.
+       * but MYCALL subst happens here since it is iface-specific.
+       */
+      if (!dupelist) {		/* if dupeing, ignore this crap */
+	if (calls.ax_digi_call[calls.ax_next_digi].ax25_call[ALEN]&REPEATED) {
+	  if ((!(thisflags&C_IS_FLOOD) && l->i->i_flags&SUBST_MYCALL)
+	      || ((thisflags&C_IS_FLOOD) && !(thisflags&C_IS_FLOODN))
+	      || ((thisflags&(C_IS_FLOOD|C_IS_FLOODN|C_IS_TRACE))
+		  == (C_IS_FLOOD|C_IS_FLOODN|C_IS_TRACE))) {
+	    calls.ax_digi_call[calls.ax_next_digi] = I_MYCALL(l->i);
+	    calls.ax_digi_call[calls.ax_next_digi].ax25_call[ALEN] |= REPEATED;
+	  }
+	  ++calls.ax_next_digi;
+	}
+      }
+      /* XXX - deal with detunneled 3rdparty (empty digi list) -- or is
+	 some default digi list supposed to be used? */
+      if (s->i != l->i && s->i->i_flags&I_3RDP) {
+	if (Verbose)
+	  fprintf(stderr,"3rd party tunnel: source port: %s  dest port: %s\n",
+		  s->i->port, l->i->port);
+	to_3rdparty(&calls);
+      }
+
+      if (l->i->i_flags&I_COOKED)
+	gen_cooked_ax25(&op,&oleft,&calls); /* generate cooked header */
+      else
+	gen_raw_ax25(&op,&oleft,&calls); /* generate the raw kiss header */
+      add_text(&op,&oleft,vecp[n],vecl[n],l->i->tag,l->i->taglen); /* fill in the info field */	
+
+      olen = sizeof(obuf) - oleft;
+      if (Logfile) {		/* XXX this gets duplicated crap for multiple intfs */
+	FILE *of;
+	if (Logfile[0] == '-' && Logfile[1] == '\0')
+	  of = stdout;
+	else
+	  of = fopen(Logfile,"a");
+	print_it(of,&calls,op-(vecl[n]+l->i->taglen),vecl[n]+l->i->taglen);
+	if (of != stdout)
+	  fclose(of);
+      }
+      if (Verbose) {
+	fprintf(stderr,"%s: TX: ",l->i->port);
+	print_it(stderr,&calls,op-(vecl[n]+l->i->taglen),vecl[n]+l->i->taglen);
+      }
+      ++l->i->stats.tx;
+      sked_id(l->i);
+      if ((sent = sendto(l->i->tsock,obuf,olen,0,(struct sockaddr *)&l->i->tsa,
+			 l->i->tsa_size)) < 0)
+	perror(l->i->port);
+      else
+	r += sent;
+    } /* end for n */
+  } /* end for l  */
+  return r;
+}
+
+
+/* 
+ * packet dupe checking 
+ *
+ * Compare the to, from, and info.  Ignore the digipeater path.
+ * If the packet matches one already received within the 'keep'
+ * interval then it is a dupe.  Keep the list sorted in reverse
+ * chronological order and throw out any stale packets.
+ */
+struct pkt {
+  struct pkt *next,*prev;
+  time_t t;			/* when recevied */
+  ax25_address to;		/* destination */
+  ax25_address fr;		/* source */
+  int l;			/* length of text */
+  u_char d[AX25_MTU];		/* the text */
+};
+
+static struct pkt *top;		/* stacked in reverse chronological order */
+
+static int
+dupe_packet(struct ax_calls *calls,u_char *cp,int len)
+{
+  struct pkt *p, *matched = NULL, *old = NULL;
+  time_t now = time(0);
+  time_t stale = now - Keep;
+
+  if (Verbose) {
+    print_dupes();
+  }
+  for (p = top; p; p = p->next) {
+    if (p->t >= stale) {	/* packet is still fresh */
+      if (p->l == len && bcmp(p->d,cp,len) == 0
+	  && bcmp(&calls->ax_to_call,&p->to,sizeof(p->to)) == 0
+	  && bcmp(&calls->ax_from_call,&p->fr,sizeof(p->fr)) == 0) {
+	matched = p;
+	break;
+      } else
+	continue;
+    } else {			/* all following packets are stale */
+      old = p;
+      break;
+    }
+  }
+  if (old) {			/* trim list of stale pkts */
+    if (top == old)
+      top = NULL;		/* entire list is stale */
+    else {
+      old->prev->next = NULL;
+    }
+    while (old) {
+      p = old->next;
+      free(old);
+      old = p;
+    }
+  }
+  if (matched) {		/* move matched packet to head of list? */
+#ifdef DUPE_REFRESH_STAMP
+    /* 
+     * Should dupe-checking update the time stamp each time a dupe is
+     * heard again or let it age out so that it can get digi'd
+     * periodically?  For example, if a station beacons once every 15
+     * seconds, then only the first packet received ever will be
+     * digi'd if the "memory" is 28 sec.  Good example of where this
+     * could be a problem is a MIC-E beaconing an emergency.  By not
+     * refreshing the timestamp, the desired behavior of reducing channel
+     * clutter is still achieved.
+     */
+    matched->t = now;		/* updated timestamp */
+    if (matched == top)		/* already on top */
+      return 1;
+    /* unlink matched packet from list */
+    if (matched->prev)
+      matched->prev->next = matched->next;
+    if (matched->next)
+      matched->next->prev = matched->prev;
+    matched->prev = matched->next = NULL;
+    /* push matched packet on top of list */
+    matched->next = top;
+    if (top)
+      top->prev = matched;
+    top = matched;
+#endif
+    return 1;
+  } else {			/* not matched: push new packet on top */
+    if ((p = (struct pkt *)calloc(1,sizeof(struct pkt))) == NULL) {
+      fprintf(stderr,"failed to calloc!\n");
+      return 0;			
+    }
+    p->t = now;
+    p->l = (len>AX25_MTU)?AX25_MTU:len;
+    bcopy(cp,p->d,p->l);
+    p->to = calls->ax_to_call;
+    p->fr = calls->ax_from_call;
+    /* push new packet on top of list */
+    p->next = top;
+    if (top)
+      top->prev = p;
+    top = p;
+    return 0;
+  }
+}
+
+static void
+print_dupes(void) {
+  struct pkt *p;
+
+  for (p = top; p ; p = p->next) {
+    fprintf(stderr,"dupe @ 0x%0x:  prev->0x%0x  next->0x%0x  time %d  len %d\n",
+	    p,p->prev,p->next,p->t,p->l);
+  }
+}
+
+/*
+ * is packet looping?
+ * e.g. FOO,mycall,WIDE*,mycall,somecall....
+ * Only look for one of my already repeated real callsigns (e.g. MYCALL(n)).
+ *
+ * Search through the list of already-repeated digipeaters and compare
+ * each to one of my interface callsigns (since these are the ones that
+ * replace generic callsigns).
+ */
+
+static int
+loop_packet(struct ax_calls *calls,u_char *cp,int len)
+{
+  int n, flags;
+  int j;
+  struct interface *iface;
+  struct callsign_list *cl;
+
+  for (n = 0; n < calls->ax_next_digi; n++) {
+    if (calls->ax_digi_call[n].ax25_call[ALEN]&REPEATED) {
+      for (j = 0, iface = Intf; j < N_intf; j++, iface++) {
+	if (ax25_cmp(&MYCALL(j),&calls->ax_digi_call[n]) == 0) {
+	  if (Verbose)
+	    fprintf(stderr,"loop_packet: found my call %s at digi_call[%d]\n",
+		    ax25_ntoa_pretty(&calls->ax_digi_call[n]),n);
+	  return 1;
+	}
+      }
+    } else
+      return 0;			/* last repeated call */
+  }
+  return 0;
+}
+
+static void
+cleanup(sig)
+int sig;			/* dont't really care what it was */
+{
+  if (alarm(0) > 0)		/* an alarm was pending, so... */
+    sked_id(NULL);		/*  ID one last time */
+  identify_final(sig);
+  print_stats(sig);		/* dump final stats */
+  exit(0);			/* and exit */
+}
+
+static void
+print_stats(sig)
+int sig;
+{
+  FILE *of = stderr;
+  struct interface *i;
+  int n;
+
+  if (Logfile) {
+    if (Logfile[0] == '-' && Logfile[1] == '\0')
+      of = stdout;
+    else
+      of = fopen(Logfile,"a");
+  }
+  if (of == NULL)
+    return;
+  for (i = Intf, n = 0; n < N_intf; n++,i++) {
+    fprintf(of,"# %s: rx %d (ign %d dup %d loop %d mic %d ssid %d) tx %d (digi %d flood %d ssid %d ids %d)\n",
+	    i->port,
+	    i->stats.rx,i->stats.rx_ign,i->stats.rx_dup,i->stats.rx_loop,
+	    i->stats.rx_mic,i->stats.rx_ssid,
+	    i->stats.tx,i->stats.digi,i->stats.flood,i->stats.ssid,
+	    i->stats.ids);
+  }
+  if (of != stdout)
+    fclose(of);
+  if (sig >= 0)
+    signal(sig,print_stats);
+}
+
+static void
+reset_stats(sig)
+int sig;
+{
+  struct interface *i;
+  int n;
+  print_stats(-1);
+
+  for (i = Intf, n = 0; n < N_intf; n++,i++) {
+    bzero(&i->stats,sizeof(i->stats));
+  }
+  signal(sig,reset_stats);
+}
+
+
+/* setup a bare minimum legal ID (don't QRM the world with a digi path!) */
+static void
+set_id()
+{
+  struct ax_calls id;
+  char idinfo[AX25_MTU];
+  int i,n;
+  struct interface *iface;
+
+  for (n = 0, iface = Intf; n < N_intf; n++, iface++) {
+    u_char *op = iface->idbuf;
+    int oleft = sizeof(iface->idbuf);
+
+    bzero(&id,sizeof(id));
+    ax25_aton_entry("ID",id.ax_to_call.ax25_call);
+    id.ax_to_call.ax25_call[ALEN] |= C; /* it's a command */
+    id.ax_from_call = MYCALL(n);
+    id.ax_type = UI;
+    id.ax_pid = PID_NO_L3;
+    id.ax_n_digis = 0;
+
+    if (iface->i_flags&I_COOKED)
+      gen_cooked_ax25(&op,&oleft,&id);	/* generate the kiss header */
+    else
+      gen_raw_ax25(&op,&oleft,&id);	/* generate the kiss header */
+    *idinfo = '\0';
+    for (i = 0; i < iface->n_aliases; i++) {
+      strcat(idinfo,ax25_ntoa_pretty(&iface->aliases[i]));
+      strcat(idinfo,"/R ");
+    }
+    for (i = 0; i < N_floods; i++) {
+      strcat(idinfo,ax25_ntoa_pretty(&Floods[i].call));
+      strcat(idinfo,"n-n/R ");
+    }
+    add_text(&op,&oleft,idinfo,strlen(idinfo),0,0);
+    iface->idlen = sizeof(iface->idbuf) - oleft;
+  }
+}
+
+static void
+xmit_id(struct interface *i)
+{
+  if (Verbose) {
+    fprintf(stderr,"%s: TX: ID\n",i->port);
+  }
+  if (sendto(i->tsock,i->idbuf,i->idlen,
+	     0,(struct sockaddr *)&i->tsa,i->tsa_size) < 0) /* ship it off */
+    perror(i->devname);
+  i->i_flags &= ~I_NEED_ID;
+  i->next_id = 0;
+  ++i->stats.ids;
+}
+
+/*
+ * sched alarm for next id.  Called with intf ptr if that interface
+ * needs to schedule an ID, NULL during alarm sig handler.
+ */
+static struct interface *ID_next = NULL;
+static void
+sked_id(struct interface *iface)
+{
+  struct interface *i;
+  int n;
+  time_t now = time(0);
+  time_t min = now+24*60*60;
+  time_t when;
+
+  if (iface && !(iface->i_flags&I_NEED_ID) && iface->idinterval) { 
+    iface->next_id = now+iface->idinterval;
+    iface->i_flags |= I_NEED_ID;
+  }
+  /* find minimum time among all interfaces 'til next needed ID. */
+  for (i = Intf, n = 0, ID_next = NULL; n < N_intf; n++,i++) {
+    if (i->i_flags&I_NEED_ID && i->idinterval && i->next_id > 0) {
+      if ((when = i->next_id - now) <= 0) /* catch any already due */
+	xmit_id(i);
+      else if (i->next_id < min) {
+	ID_next = i;		/* new minimum */
+	min = ID_next->next_id;
+      }    
+    }
+  }
+  if (ID_next && ID_next->next_id && ID_next->next_id > 0) {
+    alarm(when); /* next alarm in this many secs */
+    if (Verbose) {
+      fprintf(stderr,"next ID for %s in %d seconds\n",ID_next->port, when);
+    }
+  }
+}
+
+static void
+identify(int sig)		/* wake up and ID! */
+{
+  if (ID_next && ID_next->i_flags&I_NEED_ID) {
+    xmit_id(ID_next);
+    ID_next = NULL;
+    sked_id(NULL);		/* schedule next ID */
+    signal(sig,identify);
+  }
+}
+
+static void
+identify_final(int sig)		/* wake up and ID! */
+{
+  struct interface *i;
+  int n;
+
+  for (i = Intf, n = 0; n < N_intf; n++,i++) {
+    if (i->i_flags&I_NEED_ID && i->idinterval && i->next_id > 0) {
+      xmit_id(i);
+    }
+  }
+}
+
+#include <getopt.h>
+enum {NONE=no_argument,REQD=required_argument,OPT=optional_argument};
+static struct option opts[] = {
+  {"verbose",OPT,0,'v'},
+  {"testing",NONE,0,'T'},
+  {"interface",REQD,0,'p'},
+  {"port",REQD,0,'p'},
+  {"trace",REQD,0,'F'},
+  {"flood",REQD,0,'f'},
+  {"east",REQD,0,'e'},
+  {"west",REQD,0,'w'},
+  {"north",REQD,0,'n'},
+  {"south",REQD,0,'s'},
+  {"digipath",REQD,0,'d'},
+  {"tag",REQD,0,'t'},
+  {"keep",REQD,0,'k'},
+  {"logfile",REQD,0,'l'},
+  {"idinterval",REQD,0,'i'},
+  {"subst_mycall",NONE,0,'C'},
+  {"nosubst_mycall",NONE,0,'c'},
+  {"mice_xlate",NONE,0,'M'},
+  {"nomice_xlate",NONE,0,'m'},
+  {"x1j4_xlate",NONE,0,'X'},
+  {"nox1j4_xlate",NONE,0,'x'},
+  {"3rdparty",NONE,0,'3'},
+  {"no3rdparty",NONE,0,'0'},
+  {"kill_dupes",NONE,0,'D'},
+  {"kill_loops",NONE,0,'L'},
+  {"bud",REQD,0,'B'},
+  {"nobud",REQD,0,'b'},
+  {"version",NONE,0,'V'},
+  {"help",NONE,0,'?'},
+  {"opts",REQD,0,'o'},  /* ran out of letters */
+#define O(x) ((int)(256+(int)x))
+  {"rx",NONE,0,O('R')},
+  {"norx",NONE,0,O('r')},
+  {"tx",NONE,0,O('T')},
+  {"notx",NONE,0,O('t')},
+  {"txsame",NONE,0,O('S')},
+  {"notxsame",NONE,0,O('s')},
+  {"dupe",REQD,0,O('d')},
+  {"duplicate",REQD,0,O('d')},
+  {0,0,0,0}
+};
+static char *optstring = "CcMmXxF:f:n:s:e:w:t:k:l:i:d:p:DLVvT30o:B:b:";
+
+static void
+do_opts(int argc, char **argv)
+{
+  int s;
+  int opt_index = 0;
+
+  /* set interface defaults */
+  I_flags = I_TX|I_RX|I_TXSAME;
+  while ((s = getopt_long(argc, argv, optstring, opts, &opt_index)) != -1) {
+    int p = -1;			/* used for NSEW hack, below */
+    int fflags = 0;		/* use for fF hack */
+    switch (s) {
+    case 'v':
+      ++Verbose;
+      break;
+    case 'T':
+      ++Testing;
+      break;
+    case 'p':			/* -p port[:alias,alias,alias...] */
+      if (N_intf >= MAXINTF) {
+	fprintf(stderr,"too many interfaces!\n");
+	exit(1);
+      }
+      {
+	struct interface *i = &Intf[N_intf++];
+	int a_i = 1;		/* default 0'th alias is MYCALL */
+	char *op = strchr(optarg,':');
+	/* fill in defaults */
+	i->i_flags = I_flags;
+	i->tag = Tag;
+	i->taglen = Taglen;
+	i->idinterval = Idinterval;
+	i->bud = Bl_last;
+	i->dupe = Dl_last;
+	if (strncasecmp(optarg,"udp:",4) == 0) { /* IP/UDP port */
+	  i->i_flags |= I_COOKED;
+	  i->i_proto = P_UDP;
+	  i->i_flags &= ~I_TXSAME; /* prevent stupid loops? */
+	  a_i = 0;		/* get MYCALL here */
+	  /* udp:foo.bar.net/aprs/ttl:call,alias... */
+	  /* or udp:224.1.2.3/1234/ttl:call,alias... */
+	  /* or udp:fe80::204:e2ff:fe3c:ca2a/1234/ttl:call,alias... */
+	  if (!op || !*op) {	/* missing operand */
+	    usage_udp();
+	  }
+	  i->port = ++op;	/* parse host/service/ttl later on */
+	  op = strrchr(op,':'); /* skip backwards to the callsigns */
+	} else if (strncasecmp(optarg,"ax25:",5) == 0) { /* new-style axlib */
+	  i->i_proto = P_AX25;
+	  if (!op || !*op) {	/* missing operand */
+	    usage_ax25();
+	  }
+	  i->port = ++op;
+	  op = strchr(op,':');
+	  if (op)
+	    *op = '\0';
+	} else if (strncasecmp(optarg,"unix:",5) == 0) { /* Unix fifo */
+	  i->i_flags |= I_COOKED;
+	  i->i_proto = P_UNIX;
+	  a_i = 0;		/* get MYCALL here */
+	  if (!op || !*op) {	/* missing operand */
+	    usage_unix();
+	  }
+	  i->port = ++op;
+	  op = strrchr(op,':'); /* skip backwards to the callsigns */
+	} else {		/* ax25lib port name (same as ax25:) */
+	  fprintf(stderr,"Warning: deprecated usage. Use \"-p ax25:%s\"\n",optarg);
+	  i->i_proto = P_AX25;
+	  i->port = optarg;
+	}
+	if (op) {		/* additional aliases... */
+	  *op++ = '\0';
+	  if ((i->n_aliases=parsecalls(&i->aliases[a_i],MAXALIASES-1,op)) < 1) {
+	    fprintf(stderr,"Don't understand port %s aliases %s\n",optarg,op);
+	    exit(1);
+	  }
+	  if (i->i_proto == P_UDP || i->i_proto == P_UNIX)
+	    i->n_aliases--;	/* alias 0 is MYCALL */
+	}
+      }
+#ifdef notdef
+      /* -p is an implicit -B - XXX why? */
+      budlist_add("-",0);
+#endif
+      break;
+    case 'F':			/* flooding trace alias */
+      fflags = C_IS_TRACE;
+    case 'f':			/* flooding wide alias */
+      fflags |= C_IS_FLOOD;
+      if (N_floods >= MAXALIASES) {
+	fprintf(stderr,"too many flooding aliases!\n");
+	exit(1);
+      }
+      if (ax25_aton_entry(optarg,Floods[N_floods].call.ax25_call) < 0) {
+	fprintf(stderr,"Don't understand callsign %s\n",optarg);
+	exit(1);
+      }
+      if ((Floods[N_floods].call.ax25_call[ALEN]&SSID) != 0) {
+	fprintf(stderr,"-f %s: flooding callsign must have a zero SSID\n",
+		optarg);
+	exit(1);
+      }
+      Floods[N_floods].flags = fflags;
+      Floods[N_floods++].len = strlen(optarg);
+      break;
+    case 'w':			/* directional unproto path */
+      ++p;
+    case 'e':
+      ++p;
+    case 's':
+      ++p;
+    case 'n':
+      ++p;
+      ++Digi_SSID;
+      if (unproto(&Path[p],optarg) < 0) {
+	fprintf(stderr,"Don't understand %c path %s\n",toupper(s),optarg);
+	exit(1);
+      }
+      break;
+    case 'd':			/* DIGI-style(non-SSID) unproto path */
+      ++Have_digipath;
+      if (parsecalls(Digipath,DIGISIZE,optarg)!=DIGISIZE) {
+	fprintf(stderr,"Don't understand %c path %s\n",toupper(s),optarg);
+	exit(1);
+      }
+      break;
+    case 't':			/* tag to tack on to end of all packets */
+      Tag = optarg;
+      Taglen = strlen(optarg);
+      if (*Tag == '-' && Taglen == 1) {
+	Tag = NULL;
+	Taglen = 0;
+      }
+      break;
+    case 'k':
+      if ((Keep = atoi(optarg)) <= 0)
+	Keep = 28;		/* default keep is 28 */
+      break;
+    case 'l':
+      Logfile = optarg;		/* log digipeated packets */
+      break;
+    case 'i':
+      Idinterval = atoi(optarg);
+      break;
+    case 'C':
+      I_flags |= SUBST_MYCALL;
+      break;
+    case 'c':
+      I_flags &= ~SUBST_MYCALL;
+      break;
+    case 'M':
+      I_flags |= MICE_XLATE;
+      break;
+    case 'm':
+      I_flags &= ~MICE_XLATE;
+      break;
+    case 'X':
+      I_flags |= X1J4_XLATE;
+      break;
+    case 'x':
+      I_flags &= ~X1J4_XLATE;
+      break;
+    case '3':
+      I_flags |= I_3RDP;	/* enable 3rd party tunneling */
+      break;
+    case '0':
+      I_flags &= ~I_3RDP;	/* disable 3rd party tunneling (transparent) */
+      break;
+    case 'o':			/* o for options cuz I'm out of letters! */
+      switch (*optarg) {
+      case 'R':			/* RX enable */
+	I_flags |= I_RX;
+	break;
+      case 'r':			/* RX disable */
+	I_flags &= ~I_RX;
+	break;
+      case 'T':
+	I_flags |= I_TX;	/* TX enable */
+	break;
+      case 't':
+	I_flags &= ~I_TX;	/* TX disable */
+	break;
+      case 'S':
+	I_flags |= I_TXSAME;	/* re-TX on RX interface */
+	break;
+      case 's':
+	I_flags &= ~I_TXSAME;	/* no re-TX on RX interface */
+	break;
+      default:
+	usage();
+      }
+      break;
+    case O('d'):		/* dupe to interface w/no modification */
+      dupelist_add(optarg);
+      break;
+    case O('R'):
+      I_flags |= I_RX;
+      break;
+    case O('r'):
+      I_flags &= ~I_RX;
+      break;
+    case O('T'):
+      I_flags |= I_TX;		/* TX enable */
+      break;
+    case O('t'):
+      I_flags &= ~I_TX;	/* TX disable */
+      break;
+    case O('S'):
+      I_flags |= I_TXSAME;	/* re-TX on RX interface */
+      break;
+    case O('s'):
+      I_flags &= ~I_TXSAME;	/* no re-TX on RX interface */
+      break;
+    case 'D':
+      Kill_dupes++;
+      break;
+    case 'L':
+      Kill_loops++;
+      break;
+    case 'B':
+      budlist_add(optarg,1);
+      break;
+    case 'b':
+      budlist_add(optarg,0);
+      break;
+    case 'V':
+      printf("aprsdigi: %s-%s\n",PACKAGE,VERSION);
+      exit(0);
+    case '?':
+      usage();
+    }
+  }
+  /* sanity-check args */
+  if (N_intf <= 0) {
+    fprintf(stderr,"aprsdigi: must specify at least one port with -p\n");
+    exit(1);
+  }
+}
+
+static void
+die(char *s)
+{
+  perror(s);
+  exit(1);
+}
+
+static void
+usage()
+{
+  fprintf(stderr,"Usage: aprsdigi [-CcDLMXv] [-n|s|e|w path] [-fF call] [-t tag] [-k secs] [-l logfile] [-i interval] [-o r|R|t|T|s|S] [-p port:alias1,alias2...] [-B budlist] [-b budlist] ...\n");
+  fprintf(stderr," general options:\n");
+  fprintf(stderr," -v | --verbose     -- produce verbose debugging output\n");
+  fprintf(stderr," -T | --testing     -- test mode: listen to my packets too\n");
+  fprintf(stderr," -D | --kill_dupes  -- suppress Duplicate packets\n");
+  fprintf(stderr," -L | --kill_loops  -- suppress Looping packets\n");
+  fprintf(stderr," -V | --version     -- print program version and exit\n");
+  fprintf(stderr," -n|s|e|w -- set North|South|East|West SSID directional path\n");
+  fprintf(stderr," --north | --south | --east | --west\n");
+  fprintf(stderr," -f | --flood       -- set Flooding callsign (usually WIDE)\n");
+  fprintf(stderr," -F | --trace       -- set Flooding TRACE callsign (usually TRACE)\n");
+  fprintf(stderr," -k | --keep        -- seconds of old dupes to remember\n");
+  fprintf(stderr," -l | --logfile     -- log digipeated packets here\n");
+  fprintf(stderr," per-interface options (put *before* each -p as needed):\n");
+  fprintf(stderr," -C (-c) | --[no]subst_mycall  -- do (not) perform Mycall substitution\n");
+  fprintf(stderr," -M (-m) | --[no]mice_xlate    -- do (not) perform Mic-E translation\n");
+  fprintf(stderr," -X (-x) | --[no]x1j4_xlate    -- do (not) perform X1J4 translation\n");
+  fprintf(stderr," -3 | --3rdparty     -- perform 3rd party tunneling\n");
+  fprintf(stderr," -0 | --no3rdparty   -- perform transparent tunneling (default)\n");
+  fprintf(stderr," -o r (R) | --[no]rx           -- do (not) mark interface receive-only\n");
+  fprintf(stderr," -o t (T) | --[no]tx           -- do (not) mark interface transmit-only\n");
+  fprintf(stderr," -o s (S) | --[no]txsame       -- do (not) supress retransmission on RX intf.\n");
+  fprintf(stderr," -i | --idinterval   -- seconds between ID transmissions\n");
+  fprintf(stderr,"             (Use \"-i 0\" to disable IDs)\n");
+  fprintf(stderr," -t | --tag          -- tag text to add to received packets\n");
+  fprintf(stderr,"             (Use \"-t -\" to reset to empty)\n");
+  fprintf(stderr," -B | --bud call|addr -- accept traffic only from matching source.\n");
+  fprintf(stderr," -b | --nobud call|addr -- deny traffic from matching source.\n");
+  fprintf(stderr," --dupe interface     -- copy traffic from this interface.\n");
+  fprintf(stderr,"\n");
+  fprintf(stderr," -p | --port | --interface ax25:port:a1,a2,... -- port name and optional list of aliases\n");
+  fprintf(stderr,"             port is from /etc/ax25/axports\n");
+  fprintf(stderr,"             (primary callsign is obtained from the port)\n");
+  fprintf(stderr," -p | --port | --interface udp:address/port/ttl:call,a1,a2... -- IP host,service,ttl,call and optional list of aliases\n");
+  fprintf(stderr," -p | --port | --interface unix:path:call,a1,a2... -- FIFO filename, call and optional list of aliases\n");
+  exit(1);
+}
+
+static void
+usage_udp()
+{
+  fprintf(stderr,"aprsdigi: Use --int udp:host/service/ttl:callsign,a1,a2,...\n");
+  fprintf(stderr," example: --int udp:224.1.2.3/1234/127:N2YGK-2,RELAY,WIDE\n");
+  fprintf(stderr,"          --int udp:192.168.1.2/1234/16:N2YGK-2,RELAY,WIDE\n");
+  fprintf(stderr,"          --int udp:n0clu.ampr.net/1234/16:N2YGK-2,RELAY,WIDE\n");
+  fprintf(stderr,"          --int udp:2002:123:45::ab:cd/1234/16:N2YGK-2,RELAY,WIDE\n");
+  exit(1);
+}
+
+static void
+usage_ax25()
+{
+  fprintf(stderr,"aprsdigi: Use --int ax25:port:a1,a2,...\n");
+  fprintf(stderr," example: --int ax25:1:N2YGK-7,RELAY,WIDE\n");
+  exit(1);
+}
+
+static void
+usage_unix()
+{
+  fprintf(stderr,"aprsdigi: Use --int unix:path:a1,a2,...\n");
+  fprintf(stderr," example: --int unix:/tmp/fifo:N2YGK-7,RELAY,WIDE\n");
+  exit(1);
+}
+
+static void
+usage_budlist()
+{
+  fprintf(stderr,"aprsdigi: Use --[no]bud ax25:callsign[-SSID]|ip:host|udp:addr[/mask].\n");
+  fprintf(stderr,"          \"--bud -\" resets the list to empty\n");
+  fprintf(stderr,"          Use callsign-SSID to match specific station.\n");
+  fprintf(stderr,"          Use callsign to match all SSIDs.\n");
+  fprintf(stderr,"          Use host to match a given IP host.\n");
+  fprintf(stderr,"          Use addr/mask to match a given IP range.\n");
+  fprintf(stderr,"examples: --bud ax25:n0clu-14  -- matches only n0clu-14.\n");
+  fprintf(stderr,"          --bud ax25:n0clu     -- matches all n0clu's\n");
+  fprintf(stderr,"          --bud ip:n0clu.ampr.net  -- matches one host.\n");
+  fprintf(stderr,"          --bud ip:192.168.5.3     -- matches one host.\n");
+  fprintf(stderr,"          --bud ip:192.168.5.3/32  -- matches one host.\n");
+  fprintf(stderr,"          --bud ip:192.168.5.0/25  -- matches subnet\n");
+  fprintf(stderr,"          --bud ip:fe80::201:3ff:fe9a:38c6  -- matches one host.\n");
+  fprintf(stderr,"          --bud ip:fe80::201:3ff:fe9a:38c6/128  -- matches one host.\n");
+  fprintf(stderr,"          --bud ip:2002:905::/32  -- matches prefix.\n");
+  exit(1);
+}
+
+static void
+usage_dupelist()
+{
+  fprintf(stderr,"aprsdigi: Use --dupe ax25:interface|udp:addr|unix:file.\n");
+  fprintf(stderr,"          \"--dupe -\" resets the list to empty\n");
+  exit(1);
+}
+
+/*
+ * do_ports: Initialize interfaces.
+ */
+static void
+do_ports()
+{
+  struct interface *i;
+
+  ax25_aton_entry("APRS",Aprscall.ax25_call);
+  ax25_aton_entry("WIDE",Widecall.ax25_call);
+  ax25_aton_entry("UDPIP",Udpipcall.ax25_call);
+  ax25_aton_entry("trace",Trace_dummy.ax25_call);
+  if (ax25_config_load_ports() == 0)
+    fprintf(stderr, "aprsdigi: no AX.25 port data configured\n");
+  
+  for (i = Intf; i < &Intf[N_intf]; i++) {
+    ++i->n_aliases;		/* count the zeroth element too! */
+    switch (i->i_proto) {
+    case P_AX25:
+      do_port_ax25(i);
+      break;
+    case P_UNIX:
+      do_port_unix(i);
+      break;
+    case P_UDP:
+      do_port_udp(i);
+      break;
+    default:
+      fprintf(stderr,"Unknown proto %d\n",i->i_proto);
+      exit(1);
+      break;
+    }
+  }
+  calltab_init();
+  dupelist_init();
+}
+
+static void
+do_port_ax25(struct interface *i)
+{
+  struct ifreq ifr;
+  int proto = (Testing)?ETH_P_ALL:ETH_P_AX25;
+
+  if ((i->dev = ax25_config_get_dev(i->port)) == NULL) {
+    fprintf(stderr, "aprsdigi: invalid ax25 port name - %s\n", i->port);
+    exit(1);
+  }
+  i->devname = strdup(i->port);
+  i->rsa_size = i->tsa_size = sizeof(struct sockaddr_ax25);
+
+  if (!(i->i_flags & I_TX)) {
+    i->tsock = -1;
+  } else {			/* open transmit socket */
+    if ((i->tsock = socket(AF_PACKET, SOCK_PACKET, htons(proto))) == -1) {
+      die(i->port);
+    }
+    strcpy(((struct sockaddr*)&i->tsa)->sa_data, i->dev);
+    ((struct sockaddr *)&i->tsa)->sa_family = AF_AX25;
+  }
+
+  if (!(i->i_flags & I_RX)) {
+    i->rsock = -1;
+  } else {			/* open receive socket */
+    if ((i->rsock = socket(AF_PACKET, SOCK_PACKET, htons(proto))) == -1) {
+      die(i->port);
+    }
+    strcpy(((struct sockaddr *)&i->rsa)->sa_data, i->dev);
+    ((struct sockaddr *)&i->rsa)->sa_family = AF_AX25;
+    if (bind(i->rsock, (struct sockaddr *)&i->rsa, i->rsa_size) < 0) {
+      die(i->devname);
+    }
+  }
+
+  /* set mycall (zeroth alias) to the port's */
+  strcpy(ifr.ifr_name, i->dev); /* get this port's callsign */
+  if (ioctl(i->rsock, SIOCGIFHWADDR, &ifr) < 0) {
+    die(i->devname);
+  }
+  if (ifr.ifr_hwaddr.sa_family != AF_AX25) {
+    fprintf(stderr,"%s: not AX25\n",i->port);
+    exit(1);
+  }
+  bcopy(ifr.ifr_hwaddr.sa_data,I_MYCALL(i).ax25_call,sizeof(I_MYCALL(i).ax25_call));
+  I_MYCALL(i).ax25_call[ALEN] |= ESSID_SPARE|SSSID_SPARE;
+} 
+
+static void
+do_port_udp(struct interface *i)
+{
+  struct hostent *hp;
+  struct servent *sp;
+  char *name, *service, *ttl;
+  const int one=1;
+  int ttlval;
+  struct addrinfo *ai, hints = {0, PF_UNSPEC, SOCK_DGRAM, 0};
+
+  /* hostname/service(port)/ttl */
+  i->dev = i->port;
+  name = i->port;
+  service = strchr(name,'/');
+  if (!service || *service != '/')
+    usage_udp();
+  //  *service++ = '\0';
+  ttl = strchr(&service[1],'/');
+  if (!ttl || *ttl != '/')
+    usage_udp();
+  *ttl++ = '\0';
+  i->devname = strdup(name);
+  *service++ = '\0';
+  if ((ttlval = atoi(ttl)) <= 0)
+      usage_udp();
+
+  if (Verbose)
+    fprintf(stderr,"opening UDP socket on %s/%s/%d\n", name, service, ttlval);
+  if (getaddrinfo(name,service,&hints,&ai) < 0)
+    die(name);
+  if (Verbose)
+    fprintf(stderr,"UDP address info: family %d type %d proto %d next 0x%0x\n",
+	    ai->ai_family,ai->ai_socktype,ai->ai_protocol,ai->ai_next);
+  if (ai->ai_socktype != SOCK_DGRAM) {
+    die("getaddrinfo returned non SOCK_DGRAM!\n");
+  }
+  if (!(i->i_flags & I_TX)) {
+    i->tsock = -1;
+  } else {
+    if ((i->tsock = socket(ai->ai_family, SOCK_DGRAM, 0)) == -1)
+      die(name);
+    if (setsockopt(i->tsock, SOL_SOCKET, SO_REUSEADDR, &one, sizeof(one)) < 0)
+      die(i->port);
+    if (ai->ai_family == AF_INET) { /* IPv4 */
+      i->tsa_size = sizeof(struct sockaddr);
+      if (IN_MULTICAST(ntohl(((struct sockaddr_in*)ai->ai_addr)->sin_addr.s_addr))) {
+	if (setsockopt(i->tsock, SOL_IP, IP_MULTICAST_TTL, &ttlval, sizeof(ttlval)) < 0)
+	  die(i->port);
+      } else {
+	if (setsockopt(i->tsock, SOL_IP, IP_TTL, &ttlval, sizeof(ttlval)) < 0)
+	  die(i->port);
+      }
+#ifdef IPV6
+    } else if (ai->ai_family == AF_INET6) { /* IPv6 */
+      i->tsa_size = sizeof(struct sockaddr_storage);
+      /* XXX ??? */
+#endif /* IPV6 */
+    } else {
+      fprintf(stderr,"%s: unsupported protocol family\n",i->port);
+      exit(1);
+    }
+    bzero(&i->tsa,sizeof(i->tsa));
+    bcopy((struct sockaddr*)ai->ai_addr,&i->tsa,sizeof(i->tsa)); /* fill sockaddr w/sockaddr_in */
+    if (connect(i->tsock, (struct sockaddr *)&i->tsa, i->tsa_size) < 0) {
+      die(i->devname);
+    }
+  }
+
+  /* now the receive socket */
+  if (!(i->i_flags & I_RX)) {
+    i->rsock = -1;
+  } else {
+    if ((i->rsock = socket(ai->ai_family, SOCK_DGRAM, 0)) == -1) {
+      die(i->port);
+    }
+    if (setsockopt(i->rsock, SOL_SOCKET, SO_REUSEADDR, &one, sizeof(one)) < 0)
+      die(i->port);
+    
+    if (ai->ai_family == AF_INET && !IN_MULTICAST(ntohl(((struct sockaddr_in*)ai->ai_addr)->sin_addr.s_addr))) {
+      ((struct sockaddr_in *)ai->ai_addr)->sin_addr.s_addr = INADDR_ANY; /* not mcast so wildcard listen */
+      i->rsa_size = sizeof(struct sockaddr);
+#ifdef IPV6
+    } else if (ai->ai_family == AF_INET6) { /* IPv6 */
+      /* XXX ??? */
+#endif /* IPV6 */
+    }
+    i->rsa_size = sizeof(struct sockaddr_storage);
+    bzero(&i->rsa,sizeof(i->rsa));
+    bcopy((struct sockaddr*)ai->ai_addr,&i->rsa,sizeof(i->rsa));
+    if (bind(i->rsock, (struct sockaddr *)&i->rsa, i->rsa_size) < 0) {
+      die(i->devname);
+    }
+    /* if the UDP socket is a multicast group, then do IGMP join for rsock */
+    
+    if (ai->ai_family == AF_INET && IN_MULTICAST(ntohl(((struct sockaddr_in*)ai->ai_addr)->sin_addr.s_addr))) {
+      struct ip_mreq mreq;
+      mreq.imr_multiaddr = ((struct sockaddr_in*)ai->ai_addr)->sin_addr;
+      mreq.imr_interface.s_addr = INADDR_ANY;
+      if (setsockopt(i->rsock, IPPROTO_IP, IP_ADD_MEMBERSHIP, &mreq, sizeof(mreq)) < 0)
+	die(i->port);
+#ifdef IPV6
+    } else if (ai->ai_family == AF_INET6) { /* IPv6 */
+      /* XXX ??? */
+#endif /* IPV6 */
+    }
+  }
+}
+
+static void
+do_port_unix(struct interface *i)
+{
+  const int one=1;
+  struct sockaddr_un *sun;
+  char name[sizeof(sun->sun_path)];
+  
+  i->dev = i->port;
+  i->devname = strdup(i->dev);
+  strncpy(name,i->dev,sizeof(name));
+  i->rsa_size = i->tsa_size = sizeof(struct sockaddr_un);
+  /* the receive socket */
+  if (!(i->i_flags & I_RX)) {
+    i->rsock = -1;
+  } else {
+    if (Verbose)
+      fprintf(stderr,"opening RX FIFO socket on %s\n", name);
+    if ((i->rsock = socket(AF_UNIX, SOCK_DGRAM, 0)) == -1) {
+      die(name);
+    }
+    bzero(&i->rsa,sizeof(i->rsa));
+    sun = (struct sockaddr_un *)&i->rsa;
+    sun->sun_family = AF_UNIX;
+    strncpy(sun->sun_path,name,sizeof(sun->sun_path));    
+    /* create the fifo if it doesn't already exist */
+    if (bind(i->rsock, (struct sockaddr *)&i->rsa, i->rsa_size) < 0
+	&& errno != EADDRINUSE) {
+      die(name);
+    }
+  }
+
+  /* the transmit socket */
+  if (!(i->i_flags & I_TX)) {
+    i->tsock = -1;
+  } else {
+    if (Verbose)
+      fprintf(stderr,"opening TX FIFO socket on %s\n", name);
+    if ((i->tsock = socket(AF_UNIX, SOCK_DGRAM, 0)) == -1) {
+      die(name);
+    }
+    bzero(&i->tsa,sizeof(i->tsa));
+    sun = (struct sockaddr_un *)&i->tsa;
+    sun->sun_family = AF_UNIX;
+    strncpy(sun->sun_path,name,sizeof(sun->sun_path));    
+    if (setsockopt(i->tsock, SOL_SOCKET, SO_REUSEADDR, &one, sizeof(one)) < 0)
+      die(i->port);
+  }
+}
+
+static void
+set_sig()
+{
+  signal(SIGHUP,cleanup);
+  signal(SIGINT,cleanup);
+  signal(SIGQUIT,cleanup);
+  signal(SIGTERM,cleanup);
+  signal(SIGPWR,cleanup);
+  signal(SIGPIPE,cleanup);
+  signal(SIGUSR1,print_stats);
+  signal(SIGUSR2,reset_stats);
+  signal(SIGALRM,identify);
+}
+
+/*
+ * compare two ax.25 "flooding" addresses.
+ * returns: floodtype
+ * args: f is the known flood call prefix, len is its len.
+ *       c is what we are testing against it to see if it is
+ *       flood, floodN, or none.
+ */
+static int
+floodcmp(ax25_address *f, int len, ax25_address *c)
+{
+  int i;
+
+  for (i = 0; i < len; i++) 
+    if ((f->ax25_call[i] & 0xFE) != (c->ax25_call[i] & 0xFE))
+      return C_IS_NOFLOOD;
+  return floodtype(c,i);
+}
+
+/*
+ * floodtype: Is it a flood, or floodN, or not a flood at all?
+ * The call should have blanks in the remainder
+ * (e.g. WIDE-3), or a single digit followed by blanks
+ * (WIDE3-3).  If it has other junk then is is not a flood (WIDENED).
+ */
+static int
+floodtype(ax25_address *c, int i)
+{
+  int dig = (c->ax25_call[i]&0xFE)>>1;
+  if (dig == ' ')
+    return C_IS_FLOOD;
+  else if (dig >= '0' && dig <= '9' 
+	   && ((i>=5) || (c->ax25_call[i+1] & 0xFE)>>1 == ' '))
+    return C_IS_FLOOD|C_IS_FLOODN;
+  else
+    return C_IS_NOFLOOD;
+}
+
+#define DEVTYPE(i) ((i)->i_proto == P_UDP)?"udp":\
+	    ((i)->i_proto == P_AX25)?"ax25":\
+	    ((i)->i_proto == P_UNIX)?"unix":"???"
+
+
+static void
+check_config()
+{
+  int n, j;
+  struct callsign_list *cl;
+  
+  printf("Linux APRS(tm) digipeater\nCopyright (c) 1996,1997,1999,2001,2002,2003,2004 Alan Crosswell, n2ygk at weca.org\n");
+  printf("Version: aprsdigi %s-%s\n",PACKAGE,VERSION);
+  printf("This is free software covered under the GNU Public License.\n");
+  printf("There is no warranty.  See the file COPYING for details.\n\n");
+
+  config_print(stdout);
+  printf("My callsigns and aliases (routing table):\n");
+  printf("Callsign  Interfaces...\n");
+  for (cl = calltab; cl; cl = cl->next) {
+    struct interface_list *l;
+    char t[10];
+
+    strcpy(t,ax25_ntoa_pretty(cl->callsign));
+    if (cl->flags&C_IS_FLOOD)
+      strcat(t,"n-n");		/* indicate a WIDEn-n */
+    printf("%-9.9s",t);
+    for (l = cl->l; l; l = l->next) {
+      printf(" %s:%s",DEVTYPE(l->i),l->i->devname);
+    }
+    printf("\n");
+  }
+  if (N_floods == 0)
+    printf("No flooding callsigns\n");
+  if (Have_digipath) {
+    printf("SSID-based omnidirectional routing:\n");
+    if (N_floods) {		/* doing WIDEn-n so this won't get used */
+      fprintf(stderr,"ERROR: -d is inconsistent with WIDEn-n flooding\n");
+      exit(1);
+    }
+    if (intf_of(&Digipath[0]) == NULL) {
+      fprintf(stderr,"ERROR: %s: first callsign in omni route is not one of my callsigns.\n",
+	      ax25_ntoa_pretty(&Path[n].fsa_digipeater[0]));
+      exit(1);
+    }
+    for (j = 0; j < DIGISIZE; j++) {
+      printf("%-9.9s ",ax25_ntoa_pretty(&Digipath[j]));
+    }
+    printf("\n");
+  }
+  if (Digi_SSID) {
+    printf("SSID-based directional routing:\n");
+    for (n = 0; n < 4; n++) {
+      if (intf_of(&Path[n].fsa_digipeater[0]) == NULL) {
+	fprintf(stderr,"ERROR: %s: first callsign in %c route is not one of my callsigns.\n",
+		ax25_ntoa_pretty(&Path[n].fsa_digipeater[0]),Dirs[n]);
+	exit(1);
+      }
+      printf("\n%c:        ",Dirs[n]);
+      for (j = 0; j < Path[n].fsa_ax25.sax25_ndigis; j++)
+	printf("%-9.9s ",ax25_ntoa_pretty(&Path[n].fsa_digipeater[j]));
+    }
+    printf("\n");
+  } else {
+    printf("SSID-based routing: (none)\n");
+  }
+  /* flags */
+  printf("keep dupes for: %d seconds\n",Keep);
+  printf("log file: %s\n",(Logfile)?Logfile:"(none)");
+#define onoff(x) (x)?"ON":"OFF"
+  printf("kill dupes: %s loops: %s  testing: %s\n",
+	 onoff(Kill_dupes), onoff(Kill_loops), 
+	 onoff(Testing));
+#undef onoff
+  fflush(stdout);
+}
+
+static void
+config_print(FILE *f)
+{
+  struct interface *i;
+  int n, j;
+
+  fprintf(f,"# configuration:\n");
+  budlist_print_all(f);
+  dupelist_print_all(f);
+  for (i = Intf, n = 0; n < N_intf; i++,n++) {
+    fprintf(f,"interface %s:%s\n", DEVTYPE(i),i->devname);
+    fprintf(f," callsign %s\n",ax25_ntoa_pretty(&i->aliases[0]));
+    for (j = 1; j < i->n_aliases; j++) {
+      fprintf(f," alias %s\n",ax25_ntoa_pretty(&i->aliases[j]));
+    }
+#define onoff(opt) fprintf(f," option %s %s\n",(#opt),((i->i_flags&(opt))?("on"):("off")))
+    onoff(SUBST_MYCALL);
+    onoff(MICE_XLATE);
+    onoff(X1J4_XLATE);
+    onoff(I_TX);
+    onoff(I_RX);
+    onoff(I_TXSAME);
+    onoff(I_3RDP);
+#undef onoff
+    fprintf(f," option idinterval %d #(%02d:%02d)\n",i->idinterval, i->idinterval/60,i->idinterval%60);
+    fprintf(f," option tag %s\n",(i->taglen)?i->tag:"#(none)");
+    if (i->bud)
+      fprintf(f," budlist %d\n",i->bud->bl_list_no);
+    if (i->dupe && i->dupe->dl_ent_head)
+      fprintf(f," dupelist %d\n",i->dupe->dl_list_no);
+  }
+  fprintf(f,"# end of configuration\n\n");
+}
+
+/* 
+ * budlist's can be "global" or per-interface.  Basically, the
+ * budlist is built up with -B|-b's prior to the interface's -p
+ * and then these get glued to the per-interface budlist. To
+ * reset the budlist between ports, use "-B -".
+ */
+
+static void
+budlist_add(char *item,int permit)
+{
+  struct sockaddr_in *sin, *sinmask;
+  struct sockaddr_in6 *sin6, *sin6mask;
+  struct sockaddr_ax25 *sinax25, *sinax25mask;
+  struct budlist_entry *e;
+
+  if (!item || !*item)
+    usage_budlist();
+  if (!Bl_head) {		/* this is first invocation */
+    Bl_head = Bl_last = (struct budlist *)calloc(1,sizeof(struct budlist));
+    if (!Bl_head) 
+      die("malloc");
+    Bl_head->bl_list_no = 1;
+  }
+  if (item[0] == '-' && item[1] == '\0') { /* start a new list */
+    if (Bl_last->bl_ent_last)	{ /* if the list has entries... */
+      /* ... start a new list */
+      Bl_last->bl_next = (struct budlist *)calloc(1,sizeof(struct budlist));
+      if (!Bl_last->bl_next)
+	die("malloc");
+      Bl_last->bl_next->bl_list_no = Bl_last->bl_list_no+1;
+      Bl_last = Bl_last->bl_next;
+    }
+    return;
+  }
+
+  if (!Bl_last->bl_ent_head) {	/* list has no elements yet */
+    Bl_last->bl_ent_head = Bl_last->bl_ent_last = 
+      (struct budlist_entry *)calloc(1,sizeof(struct budlist_entry));
+    if (!Bl_last->bl_ent_head)
+      die("malloc");
+  } else if (!Bl_last->bl_ent_last->be_next) { /* alloc a new entry */
+    Bl_last->bl_ent_last->be_next = 
+      (struct budlist_entry *)calloc(1,sizeof(struct budlist_entry));
+    if (!Bl_last->bl_ent_last->be_next)
+      die("malloc");
+    Bl_last->bl_ent_last = Bl_last->bl_ent_last->be_next;
+  }
+  /* done with all that allocation foolishness */
+  e = Bl_last->bl_ent_last;
+  e->be_permit = permit;
+  if (!strcasecmp(item,"any")) {
+    bzero(&e->be_addr,sizeof(e->be_addr));
+    setmask(8*sizeof(e->be_mask), (u_char *)&e->be_mask);
+    e->be_maskbits = -1;
+  } else if (strncasecmp(item,"ax25:",5) == 0) {
+    char *name;
+    struct sockaddr_ax25 *call = (struct sockaddr_ax25 *)&e->be_addr;
+    struct sockaddr_ax25 *callmask = (struct sockaddr_ax25 *)&e->be_mask;
+
+    name = &item[5];
+    bzero(&e->be_addr,sizeof(e->be_addr));
+    if (ax25_aton_entry(name,call->sax25_call.ax25_call) < 0)
+      die(item);
+    call->sax25_family = AF_AX25;
+    call->sax25_ndigis = 0;
+
+    /* set maskbits as follows:
+     * if callsign then mask the 6 bytes containing the call.
+     * if callsign-SSID then mask all 7.
+     */
+    bzero(&e->be_mask,sizeof(e->be_mask));
+    e->be_maskbits = (strchr(name,'-'))? 7*8 : 6*8;
+    setmask(8*sizeof(call->sax25_family), (u_char *)&callmask->sax25_family);
+    setmask(e->be_maskbits, (u_char *)callmask->sax25_call.ax25_call);
+  } else if (strncasecmp(item,"ip:",3) == 0) {
+    struct addrinfo *ai, hints = {0, PF_UNSPEC, SOCK_DGRAM, 0};
+    char *name, *mask;
+
+    e->be_maskbits = 0;
+    name = &item[3];
+    if (mask = strrchr(name,'/')) {
+      *mask++ = '\0';
+      e->be_maskbits = atoi(mask);
+    }
+    if (getaddrinfo(name,NULL,&hints,&ai) < 0)
+      die(item);
+    
+    bzero(&e->be_mask,sizeof(e->be_mask));
+    bcopy(ai->ai_addr,&e->be_addr,ai->ai_addrlen);
+    switch (ai->ai_family) {
+    case AF_INET:		/* IPv4 */
+      sin = (struct sockaddr_in *)&e->be_addr;
+      sinmask = (struct sockaddr_in *)&e->be_mask;
+      if (e->be_maskbits == 0)
+	e->be_maskbits = 32;
+      /* sockaddr_in bitmask: sin_family all ones; sin_port all zeros; 
+	 sin_addr specified number of ones */
+      setmask(8*sizeof(sin->sin_family), (u_char *)&sinmask->sin_family);
+      setmask(e->be_maskbits, (u_char *)&sinmask->sin_addr);
+      break;
+    case AF_INET6:		/* IPv6 */
+      sin6 = (struct sockaddr_in6 *)&e->be_addr;
+      sin6mask = (struct sockaddr_in6 *)&e->be_mask;
+      if (e->be_maskbits == 0)
+	e->be_maskbits = 128;
+      /* sockaddr_in6 bitmask: sin6_family ones; sin6_port zeros; 
+	 sin6_flowinfo zeros; sin6_addr specified; sin6_scope_id zeros */
+      setmask(8*sizeof(sin6->sin6_family), (u_char *)&sin6mask->sin6_family),
+      setmask(e->be_maskbits,(u_char *)&sin6mask->sin6_addr);
+      break;
+    default:
+      fprintf(stderr,"%s: Unsupported protocol family (%d)\n",name,ai->ai_family);
+      exit(1);
+    }
+    freeaddrinfo(ai);
+  } else
+    usage_budlist();
+}
+
+static void
+budlist_print_all(FILE *f)
+{
+  struct budlist *l;
+
+  for (l = Bl_head; l; l=l->bl_next)
+    budlist_print(f,l);
+}
+  
+
+static void
+budlist_print(FILE *f, struct budlist *bud)
+{
+  char host[1000];
+  struct sockaddr_in *sin;
+  struct sockaddr_in6 *sin6;
+  struct sockaddr_ax25 *sinax25;
+  struct budlist_entry *b;
+
+  if (!bud || !bud->bl_ent_head) 
+    return;
+  for (b = bud->bl_ent_head; b; b = b->be_next) {
+    printaddr(&b->be_addr,host,sizeof(host));
+    fprintf(f," budlist %d %s %s",bud->bl_list_no,
+	   (b->be_permit)?"permit":"deny",host);
+    if (b->be_maskbits>=0)
+      fprintf(f,"/%d\n",b->be_maskbits);
+    else
+      fprintf(f,"\n");
+  }
+}
+
+static void
+printaddr(struct sockaddr_storage *s, char *buf, int buflen)
+{
+  struct sockaddr_in *sin = (struct sockaddr_in *)s;
+  struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *)s;
+  struct sockaddr_ax25 *sinax25 = (struct sockaddr_ax25 *)s;
+
+  switch (sin->sin_family) {
+  case AF_INET:
+    inet_ntop(sin->sin_family,&sin->sin_addr, buf, buflen);
+    break;
+  case AF_INET6:
+    inet_ntop(sin6->sin6_family,&sin6->sin6_addr, buf, buflen);
+    break;
+  case AF_AX25:
+    strncpy(buf,ax25_ntoa_pretty(&sinax25->sax25_call),buflen);
+    break;
+  case 0:
+    strncpy(buf,"any",buflen);      
+    break;
+  default:
+    strncpy(buf,"???",buflen);
+    break;
+  }
+}
+
+/*
+ * Is this packet permitted by budlist?
+ *  1. Check (possibly IP) source address
+ *  2. Check AX25 source callsign
+ *  3. Check intermediate repeated digis
+ *  First match wins.
+ */
+
+int
+budlist_permit(struct stuff *s)
+{
+  struct budlist_entry *be;
+  struct interface *i = s->i;
+  char testhost[200],host[200];
+  int j;
+
+  if (!s->i->bud || !s->i->bud->bl_ent_head) /* no budlist */
+    return 1;			/* permitted */
+  for (be = s->i->bud->bl_ent_head; be; be = be->be_next) {
+    struct sockaddr_ax25 *be25  = (struct sockaddr_ax25 *)&be->be_addr;
+    struct sockaddr_ax25 *bemask  = (struct sockaddr_ax25 *)&be->be_mask;
+    /* 1: check source address */
+    if (Verbose) {
+      printaddr(&be->be_addr,testhost,sizeof(testhost));
+      printaddr(&i->rsafrom,host,sizeof(host));
+      fprintf(stderr,"budlist_permit: budlist %d %s %s/%d vs. net source %s\n",
+	      s->i->bud->bl_list_no, (be->be_permit)?"permit":"deny",
+	      testhost, be->be_maskbits, host);
+    }
+    if (cmpmask(8*sizeof(be->be_addr), (u_char *)&be->be_addr, 
+		(u_char *)&be->be_mask, (u_char *)&i->rsafrom) == 0)
+      return be->be_permit;
+
+    /* 2: check ax25 from call. */
+    if (be25->sax25_family != AF_AX25)
+      continue;			/* no need to compare non-ax25 buds */
+    if (Verbose) {
+      fprintf(stderr,"budlist_permit: budlist %d %s %s/%d vs. ax25 source %s\n",
+	      s->i->bud->bl_list_no, (be->be_permit)?"permit":"deny",
+	      testhost, be->be_maskbits, ax25_ntoa_pretty(&s->in.ax_from_call));
+    }
+    if (cmpmask(be->be_maskbits,
+		(u_char *)&be25->sax25_call.ax25_call,
+		(u_char *)&bemask->sax25_call.ax25_call, 
+		(u_char *)&s->in.ax_from_call) == 0)
+      return be->be_permit;
+    /* 3. check ax25 digis. */ 
+    for (j = 0; j < s->in.ax_next_digi-1; j++) {
+      if (Verbose) {
+	fprintf(stderr,"budlist_permit: budlist %d %s %s/%d vs. ax25 digi[%d] %s\n",
+		s->i->bud->bl_list_no, (be->be_permit)?"permit":"deny",
+		testhost, be->be_maskbits, j,
+		ax25_ntoa_pretty(&s->in.ax_digi_call[j]));
+      }
+    if (cmpmask(be->be_maskbits,
+		(u_char *)&be25->sax25_call.ax25_call,
+		(u_char *)&bemask->sax25_call.ax25_call, 
+		(u_char *)&s->in.ax_digi_call[j]) == 0)
+      return be->be_permit;
+    }
+  }
+  return 1;			/* permit */
+}
+
+static void
+setmask(int bits, u_char *mask)
+{
+  int B,b,rem;
+
+  for (B = 0; B < bits/8; B++) {
+    mask[B] |= 0xff;
+  }
+  for (b = 0, rem = 0; b < bits%8; b++) {
+    rem = rem >> 1;
+    rem |= 0x80;
+  }
+  mask[B] = rem;
+}
+
+static int
+cmpmask(int bits, u_char *val1, u_char *mask, u_char *val2) 
+{
+  int B,bytes;
+
+  bytes = bits/8;
+  if (bits%8)
+    ++bytes;
+  
+  for (B = 0; B < bytes; B++) {
+    if ((val1[B] & mask[B]) != (val2[B] & mask[B]))
+      return val1[B] - val2[B];
+  }
+  
+  return 0;
+}
+
+/* gee, this looks like a copy of budlist.  I should make a class. */
+
+static void
+dupelist_add(char *item)
+{
+  struct dupelist_entry *e;
+
+  if (!item || !*item)
+    usage_dupelist();
+  ++Doing_dupes;
+  if (!Dl_head) {		/* this is first invocation */
+    Dl_head = Dl_last = (struct dupelist *)calloc(1,sizeof(struct dupelist));
+    if (!Dl_head) 
+      die("malloc");
+    Dl_head->dl_list_no = 1;
+  }
+  if (item[0] == '-' && item[1] == '\0') { /* start a new list */
+    if (Dl_last->dl_ent_last)	{ /* if the list has entries... */
+      /* ... start a new list */
+      Dl_last->dl_next = (struct dupelist *)calloc(1,sizeof(struct dupelist));
+      if (!Dl_last->dl_next)
+	die("malloc");
+      Dl_last->dl_next->dl_list_no = Dl_last->dl_list_no+1;
+      Dl_last = Dl_last->dl_next;
+    }
+    return;
+  }
+
+  if (!Dl_last->dl_ent_head) {	/* list has no elements yet */
+    Dl_last->dl_ent_head = Dl_last->dl_ent_last = 
+      (struct dupelist_entry *)calloc(1,sizeof(struct dupelist_entry));
+    if (!Dl_last->dl_ent_head)
+      die("malloc");
+  } else if (!Dl_last->dl_ent_last->de_next) { /* alloc a new entry */
+    Dl_last->dl_ent_last->de_next = 
+      (struct dupelist_entry *)calloc(1,sizeof(struct dupelist_entry));
+    if (!Dl_last->dl_ent_last->de_next)
+      die("malloc");
+    Dl_last->dl_ent_last = Dl_last->dl_ent_last->de_next;
+  }
+  /* done with all that allocation foolishness */
+  e = Dl_last->dl_ent_last;
+  e->de_dev = item;
+}
+
+static void
+dupelist_print_all(FILE *f)
+{
+  struct dupelist *l;
+
+  for (l = Dl_head; l; l=l->dl_next)
+    dupelist_print(f,l);
+}
+  
+
+static void
+dupelist_print(FILE *f, struct dupelist *dupe)
+{
+  char host[1000];
+  struct dupelist_entry *l;
+
+  if (!dupe || !dupe->dl_ent_head) 
+    return;
+  for (l = dupe->dl_ent_head; l; l = l->de_next) {
+    fprintf(f," dupelist %d %s\n",dupe->dl_list_no,l->de_dev);
+  }
+}
+
+static void add_intflist(struct interface_list **il, struct interface *i);
+
+/*
+ * dupelist_init:  Take dupelist from i->dupe, search for interfaces
+ * with matching names and add them to i->dupe->dl_il.  Do not add own
+ * interface.
+ */
+static void
+dupelist_init() 
+{
+  struct dupelist_entry *de;
+  struct dupelist *dl;
+  struct interface *i,*j;
+  int n;
+
+  for (i = Intf; i < &Intf[N_intf]; i++) {
+    if (i->dupe) {    /* walk all entries in this list */
+      for (de = i->dupe->dl_ent_head; de; de = de->de_next) { 
+	char devname[100];
+	/* search for an interface name that matches */
+	for (j = Intf, n = 0; n < N_intf; j++,n++) {
+	  sprintf(devname,"%s:%s",DEVTYPE(j),j->devname);
+	  if (Verbose)
+	    fprintf(stderr,"dupelist_init: comparing %s to %s...\n",
+		    de->de_dev,devname);
+	  if ((strcasecmp(devname,de->de_dev) == 0) && j != i) {
+	    if (Verbose)
+	      fprintf(stderr," ... matched.  Adding to interface list\n");
+	    add_intflist(&i->dupe->dl_il,j); /* add j to dupe interface list */
+	    break;
+	  }
+	}
+	if (n >= N_intf) {		/* search fell through */
+	  fprintf(stderr,"warning: dupelist %d interface %s not found.\n",
+		  i->dupe->dl_list_no,de->de_dev);
+	}
+      }
+    }
+  }
+}
+
+/*
+ * add_intflist: Add an interface to an interface list.
+ */
+static void
+add_intflist(struct interface_list **il, struct interface *i)
+{
+  struct interface_list *n = calloc(1,sizeof(struct interface_list));
+
+  if (n == NULL)
+    die("malloc");
+  n->i = i;
+  if (*il == NULL)
+    *il = n;
+  else {
+    for (; (*il)->next; (*il) = (*il)->next) ;
+    (*il)->next = n;
+  }
+}
+
+/* 
+ * 3rd party tunneling per APRS spec 1.01 Ch. 17
+ *
+ * What I implement is what I will call "transparent" tunneling. 
+ * For APRS 1.0 compatibility, need to implement "3rd party" tunneling:
+ *  0. 3rd party only applies when input and output intfs are different.
+ *  1. Make 3rdparty an option so I can do transparent tunneling too.
+ *  2. For transmit to a 3rdparty intf: just drop unusused digipeaters.
+ *  3. For transmit to any intf when pkt is received from a 3rdparty intf:
+ *     a. drop unused digipeaters (in case the sender didn't)
+ *     b. append Third-Party Network ID (Use UDPIP) followed by the xmit
+ *        intf callsign (MYCALL(i)) to digi list, marked as repeated.
+ *     c. Spit out "}" and then gen_cooked_ax25() (the Source Path
+ *        Header) into the payload, followed by the original payload.
+ *     d. Rewrite the raw ax25 header with a from_call of MYCALL, and no
+ *        digipeat path(!).
+ *     e. xmit on the ax25 interface(s).
+ * Editorial note: Tunneling was implemented this way because the APRS
+ * authors were using hardware TNC-2's in CONVerse mode and were unable to
+ * modify the real AX.25 headers the way I can.
+ */
+
+/* removed non-repeated digipeaters */
+
+static void 
+drop_unused_digis(struct ax_calls *calls) 
+{
+  if (!calls->ax_n_digis || calls->ax_next_digi >= calls->ax_n_digis)
+    return;			/* all digis are used up */
+  if ((calls->ax_n_digis = calls->ax_next_digi) > 0) { /* truncate the list */
+    calls->ax_digi_call[calls->ax_next_digi-1].ax25_call[ALEN] |= HDLCAEB;
+  } else {			/* no digis left */
+    calls->ax_from_call.ax25_call[ALEN] |= HDLCAEB;
+  }
+  if (Verbose)
+    fprintf(stderr,"3rd party: Unused digis have been dropped.\n");
+}
+
+/*
+ * from_3rdparty: generates the source path header and insert it into
+ * the list of packet payloads in pkt[].
+ * clobbers the s->out digipeater list as well.
+ */
+static void 
+from_3rdparty(struct stuff *s,
+	      int npkts,	/* dimension of the next two vectors */
+	      u_char *pkt[],	/* output buffers for source path header */
+	      int pktl[])	/* output length of sph (AX25_MTU max) */
+{
+  u_char pref[AX25_MTU], *pp;
+  int j, plen, rem;
+
+  /* a. drop unused digipeaters (in case the sender didn't) */
+  drop_unused_digis(&s->out);
+  /* b. append Third-Party Network ID (Use UDPIP) ... */
+  /* XXX fencepost check */
+  if (s->out.ax_n_digis >= AX25_MAX_DIGIS-1) {
+    if (Verbose)
+      fprintf(stderr,"%s: 3rd party digi list overflow. First 2 digis dropped.\n",
+	      s->i->port);
+    for (j = 2; j < s->out.ax_n_digis; j++)
+      s->out.ax_digi_call[j - 2] = s->out.ax_digi_call[j];
+    s->out.ax_n_digis -= 2;
+    s->out.ax_next_digi -= 2;
+  } 
+  s->out.ax_digi_call[s->out.ax_n_digis] = Udpipcall;
+  s->out.ax_digi_call[s->out.ax_n_digis].ax25_call[ALEN] |= REPEATED;
+  /* ... followed by the xmit intf callsign (MYCALL(i)) ... */
+  s->out.ax_digi_call[s->out.ax_n_digis+1] = I_MYCALL(s->i);
+  s->out.ax_digi_call[s->out.ax_n_digis+1].ax25_call[ALEN] |= REPEATED|HDLCAEB;
+  s->out.ax_n_digis += 2;
+  s->out.ax_next_digi += 2;
+  /* c. Spit out "}" and then gen_cooked_ax25() (the Source Path
+     Header) into the payload, followed by the original payload. */
+  plen = 0;
+  pref[plen++] = '}';
+  rem = AX25_MTU - plen;
+  pp = &pref[1];
+  gen_cooked_ax25(&pp,&rem,&s->out); /* generate the source path header */
+  plen = AX25_MTU - rem + 1;	/* XXX??? */
+  /* for each payload, insert the prefix in front of it! */
+  for (j = 0; j < npkts; j++) {	/* may have to repeat for multiple pkts */
+    u_char *oldp = pkt[j];
+    if (pktl[j]) {
+      if (pktl[j] + plen > AX25_MTU) {
+	pktl[j] -= AX25_MTU-pktl[j]-plen;
+	if (Verbose)
+	  fprintf(stderr,"%s: Oversized 3rd party detunneled packet truncated.\n",
+		  s->i->port);
+      }
+      bcopy(pkt[j],&pref[plen-1],pktl[j]); /* tag vecp onto end of pref. */
+      bcopy(pref,pkt[j],pktl[j]+=plen-1); /* not sure why this is -1 */
+      pref[plen] = '\0';
+    }
+  }
+  /* d. Rewrite the raw ax25 header with a from_call of MYCALL, and no
+   *    digipeat path(!).  */
+  s->out.ax_n_digis = s->out.ax_next_digi = 0;
+  s->out.ax_from_call.ax25_call[ALEN] |= HDLCAEB;
+  s->out.ax_from_call = I_MYCALL(s->i);
+}
+
+static void
+to_3rdparty(struct ax_calls *calls)
+{
+  drop_unused_digis(calls);		/* just drop unused digipeaters */
+}
+
diff --git a/aprsdigi.html b/aprsdigi.html
new file mode 100644
index 0000000..67db856
--- /dev/null
+++ b/aprsdigi.html
@@ -0,0 +1,770 @@
+Content-type: text/html
+
+<HTML><HEAD><TITLE>Manpage of APRSDIGI</TITLE>
+</HEAD><BODY>
+<H1>APRSDIGI</H1>
+Section: Maintenance Commands (8)<BR>Updated: 25 February 2004<BR><A HREF="#index">Index</A>
+<A HREF="http://localhost/cgi-bin/man/man2html">Return to Main Contents</A><HR>
+
+<A NAME="lbAB"> </A>
+<H2>NAME</H2>
+
+aprsdigi - APRS() digipeater
+<A NAME="lbAC"> </A>
+<H2>SYNOPSIS</H2>
+
+<PRE>
+<B>aprsdigi </B><I>options</I>
+</PRE>
+
+<A NAME="lbAD"> </A>
+<H2>DESCRIPTION</H2>
+
+<P>
+
+<I>Aprsdigi</I>
+
+is a specialized Amateur Packet Radio (AX.25) UI-frame digipeater
+for the Automatic Position Reporting Systems, APRS(tm).
+It uses the Linux kernel AX.25 network stack as well as the SOCK_PACKET
+facility
+to listen for packets on one or more radio interfaces (ports) and repeat
+those packets -- with several possible modifications -- on the same or
+other interfaces. 
+<I>Aprsdigi</I>
+
+can also use the Internet to tunnel connections among other APRS digipeaters
+and nodes using IPv4 or IPv6 UDP unicast or multicast.
+<P>
+
+<I>Aprsdigi</I>
+
+implements conventional packet radio AX.25
+digipeating, in which a packet is digipeated if the next hop (non-repeated)
+digipeater ("via") callsign matches the AX.25 port's callsign and
+sub-station ID (SSID) or an
+<I>alias</I>
+
+callsign and SSID.
+<P>
+
+There are a number of extensions to conventional digipeating that have
+been proposed for use in the APRS community.  Some of these features
+have been adopted by Terminal Node Controller (TNC) manufacturers,
+notably Paccomm and Kantronics.
+<I>Aprsdigi</I>
+
+implements most if not all of the commercialy adopted and proposed
+features.  See the APRS 1.0 Protocol Specification at <A HREF="http://www.tapr.org">www.tapr.org</A>
+for protocol documentation.  
+<I>Aprsdigi</I>
+
+attempts to minimally comply with the protocol specification as well
+as support experimental APRS features.  Specific features implemented 
+include:
+<P>
+
+<DL COMPACT>
+<DT>*<DD>
+Single-interface conventional UI-frame digipeating.
+<DT>*<DD>
+Cross-interface digipeating (also known as bridging, routing or gatewaying)
+and one-to-many fanout.
+<DT>*<DD>
+Substitution of a digipeated alias with the interface's callsign
+(typically used to substitute
+<B>RELAY,</B>
+
+<B>WIDE</B>
+
+or
+<B>TRACE</B>
+
+aliases).
+<DT>*<DD>
+<B>WIDEn-n</B>
+
+flooding algorithim.
+<DT>*<DD>
+<B>TRACEn-n</B>
+
+route recording.
+<DT>*<DD>
+<I>Mic-Encoder(tm)</I>
+
+support, including SSID-based digipeating, decompression of packets into
+the conventional APRS MIM format.  (The Mic-Encoder compression is also
+used by other products such as the Kenwood TH-D7A and D700, and TAPR
+PIC-Encoder).
+<DT>*<DD>
+TheNet X1J4 node beacon text translation (removal of the  
+lqTheNet X1J4 (alias)rq prefix from the btext).
+</DL>
+<P>
+
+<A NAME="lbAE"> </A>
+<H2>GENERAL OPTIONS</H2>
+
+<DL COMPACT>
+<DT><B>-v --verbose</B>
+
+<DD>
+Produce verbose debugging output.
+<DT><B>-T --testing</B>
+
+<DD>
+Test mode: listen to my packets too.  This mode is useful for off-air
+experimentation and configuration testing.  Do not use it on-air.
+<DT><B>-D --kill_dupes</B>
+
+<DD>
+Suppress Duplicate packets.  Remembers
+duplicate packets for the number of seconds given by the -k option and
+will not repeat them more than once.  This reduces conjestion caused
+when several digipeaters that share a common flooding alias (e.g. WIDE)
+have overlapping footprints, causing geometric duplication
+of packets addressed via lqWIDE,WIDErq for example.
+<DT><B>-L --kill_loops</B>
+
+<DD>
+Suppress Looping packets.  Similar in function to duplicate packet
+suppression, but looks back through the list of already digipeated callsigns
+in the packet's digipeat list and kills any packets that list a callsign
+belonging to this 
+<I>aprsdigi.</I>
+
+Note that only real callsigns are compared.  Generic flooding aliases are not.
+Therefore, loop detection is only useful when callsign substitution is used.
+<DT><B>-V --version</B>
+
+<DD>
+Print program version and exit.
+<DT><B>-n|s|e|w --north|south|east|west</B>
+
+<DD>
+Set North|South|East|West SSID directional path.
+<DT><B>-d --digipath</B>
+
+<DD>
+Set SSID omnidirectional next-hops when operating in a non flooding
+network (e.g. when WIDEn-n is not an option).
+<DT><B>-f --flood</B>
+
+<DD>
+Set flooding alias.  Use lq-f WIDErq to enable WIDEn-n flooding.
+Use -f multiple times to define several flooding aliases.
+<DT><B>-F --trace</B>
+
+<DD>
+Set flooding trace callsign.  Use lq-F TRACErq to enable TRACE and
+TRACEn-n flooding. Use -F multiple times to define several trace aliases.
+<DT><B>-k --keep secs</B>
+
+<DD>
+Remember old packets for this long for duplicate packet detection.
+Default is 28 seconds.
+<DT><B>-l --logfile file</B>
+
+<DD>
+Log digipeated packets to this file.
+</DL>
+<A NAME="lbAF"> </A>
+<H2>PER-INTERFACE OPTIONS</H2>
+
+Put these options
+<I>before</I>
+
+each
+<B>-p --interface</B>
+
+to set new values as needed.  The values you set are remembered for
+subsequent 
+<B>-p's</B>
+
+so options you want to set for all interfaces need only be specified
+once, before the first
+<B>-p.</B>
+
+But you have to remember to unset an option if you don't want it to
+apply to subsequent interfaces.
+<DL COMPACT>
+<DT><B>-C (-c) --[no]subst_mycall</B>
+
+<DD>
+Do (not) perform callsign substitution.  When enabled, aliases are
+replaced with the interface's callsign when repeated.
+<DT><B>-M (-m) --[no]mice_xlate</B>
+
+<DD>
+Do (not) perform Mic-E to MIM translation.  When enabled, compressed Mic-E
+reports are expanded into one MIM-style position report packet and optionally
+a second telemetry packet if telemetry was supplied in the Mic-E packet.
+<DT><B>-X (-x) --[no]x1j4_xlate</B>
+
+<DD>
+Do (not) perform X1J4 translation.  When enabled, the leading 
+lqTheNet X1J4 (alias)rq text is removed when digipeated.  This allows
+non-compliant APRS implementations to detect an APRS position report in
+an X1J4 beacon.
+<DT><B>-i --idinterval secs</B>
+
+<DD>
+Seconds between ID transmissions.  Set to 0 to disable IDs on this interface.
+Default is 570 (9 minutes 30 seconds).  IDs are only sent if the interface
+transmitted anything since the last ID.  ID packets are addressed to the 
+lqIDrq callsign, have no digipeat path, and list the callsign and aliases
+for the interface the ID is being transmitted on.
+<DT><B>-t --tag text</B>
+
+<DD>
+Text to append to received packets.  Use 
+<I>-t -</I>
+
+to reset to empty.  Use this, for example, when gatewaying Mic-E packets
+from a voice repeater to the APRS net frequency to indicate where the report
+originated.
+<DT><B>-3 --3rdparty</B>
+
+<DD>
+Enable 3rd party tunneling.  Packets tunneled 
+<I>to</I>
+
+a 3rd party interface are sent with the unused digipeaters removed from
+the digipeater list.  Packets tunneled
+<I>from</I>
+
+a 3rd party interface have the Source Path Header prepended to the
+packet payload prefixed by the "}" character.
+<DT><B>-0 --no3rdparty</B>
+
+<DD>
+Enable transparent tunneling. No special tricks are done when sending to
+or receiving from a tunneled interface.  If the interface does not natively
+support AX.25 addresses (from-call, to-call, and digipeater list), then
+the address header is prepended to the payload in "cooked" format. Likewise,
+a cooked prepended header is stripped from a cooked interface and put back
+in the AX.25 address when going from a non-AX.25 to AX.25 interface.
+<DT><B>-o r --norx</B>
+
+<DD>
+Disable receiving on the following interface(s).
+<DT><B>-o R --rx</B>
+
+<DD>
+Enable receiving on the following interface(s).
+<DT><B>-o t --notx</B>
+
+<DD>
+Disable transmitting on the following interface(s).
+<DT><B>-o T --tx</B>
+
+<DD>
+Enable transmitting on the following interface(s).
+<DT><B>-o s --notxsame</B>
+
+<DD>
+Disable retransmitting a received packet on the same interface.
+<DT><B>-o S --txsame</B>
+
+<DD>
+Enable retransmitting a received packet on the same interface.
+<DT><B>-o d --duplicate intf</B>
+
+<DD>
+Duplicate received packets without modification to the given interface (port).
+<DT><B>-p --interface ax25:port:alias1,alias2,...</B>
+
+<DD>
+AX25 interface name (port) and optional list of aliases.
+The primary callsign is obtained from the interface's configuration.
+(See <A HREF="http://localhost/cgi-bin/man/man2html?8+ifconfig">ifconfig</A>(8)).
+<DT><B>-p --interface udp:host/port/ttl:alias1,alias2,...</B>
+
+<DD>
+IP host name or address and list of aliases.  IP addresses may be IPv4
+unicast or multicast or IPv6 unicast.
+The primary callsign is obtained from the first alias.
+<DT><B>-p --interface unix:filename:alias1,alias2,...</B>
+
+<DD>
+Unix file and list of aliases.  Useful for debugging by setting up
+a simulated APRS network on one machine.  You may want to make your
+FIFOs explicitly transmit- or receive-only to avoid confusion.
+The primary callsign is obtained from the first alias.
+<DT><B>-B|b --[no]bud</B>
+
+<DD>
+<I>addr</I>
+
+Is similar to a TNC-2's BUDLIST.  Use 
+<B>-B --bud</B>
+
+to accept or 
+<B>-b --nobud</B>
+
+to ignore packets from a sender or group of senders.  Budlists are
+attached to each interface and can be reset with
+<B>--bud -</B>
+
+<BR>
+
+You can set up a global budlist once, or per-interface budlists.
+The format of
+<I>addr</I>
+
+varies based on the interface type:
+<DT>
+<B>--bud ax25:callsign-ssid</B>
+
+<DD>matches only a given digipeater callsign and SSID.  For example,
+-B ax25:n0clu-14.
+<DT>
+<B>--bud ax25:callsign</B>
+
+<DD>matches all SSIDs for the given callsign.  For example
+-B ax25:n0clu.
+<DT>
+<B>--bud ip:hostname</B>
+
+<DD>matches one Internet host name (IPv6 or IPv4).  For example
+-B ip:n0clu.ampr.net
+<DT>
+<B>--bud ip:address/maskbits</B>
+
+<DD>matches all IP addresses that have the given prefix.  For example
+--bud ip:44.0.0.0/8 matches the entire class-A network.
+--bud ip:192.168.0.0/16 matches the entire class-B network.
+--bud ip:fe80::201:3ff:fe9a:38c6 matches a single IPv6 host.
+--bud ip:2002:905::/32 matches the 32-bit IPv6 prefix.
+</DL>
+<P>
+
+<A NAME="lbAG"> </A>
+<H2>RUNTIME CONTROLS</H2>
+
+<P>
+
+<I>aprsdigi</I>
+
+responds to the following signals:
+<DL COMPACT>
+<DT><B>SIGUSR1</B>
+
+<DD>
+Print cumulative statistics.  For each port, the following counters are 
+displayed:
+packets received and how many of those where ignored, duplicates, loops,
+mic-E formatted;  packets transmitted and how many of those where
+conventional digipeats, flooding digipeats (WIDEn-n), SSID-based digipeats,
+and IDs.  If a log file was specified with the 
+<B>-l --logfile</B>
+
+option, then the statistics are written to that file.  Otherwise they are
+written to stderr.
+<P>
+<DT><B>SIGUSR2</B>
+
+<DD>
+Prints the statistics and then resets all counters to zero.
+</DL>
+<P>
+
+All other normal termination signals cause final statistics to print before
+<I>aprsdigi</I>
+
+exits.
+<P>
+<A NAME="lbAH"> </A>
+<H2>SSID-BASED ROUTING</H2>
+
+<P>
+
+SSID-based routing uses a non-zero sub-station ID in the destination
+callsign, an empty digipeater path to indicate that
+the APRS digipeater should repeat the packet after filling in
+an appropriate digipeater path.  For example, a packet sent to
+lqT1QS4W-3rq
+would be repeated with a modifed destination of lqAPRS VIA WIDE3-3rq
+(in a network that supports WIDEn-n flooding).
+A packet sent to lqAPRS-11rq would be repeated to the West unproto
+path, as defined with the
+<B>--west</B>
+
+option.  A table of SSID values and their paths follows:
+<P>
+<PRE>
+SSID unproto path
+---- ------------
+0    none 
+1    WIDE1-1
+2    WIDE2-2
+3    WIDE3-3
+4    WIDE4-4
+5    WIDE5-5
+6    WIDE6-6
+7    WIDE7-7
+8    NORTH UNPROTO path
+9    SOUTH UNPROTO path
+10   EAST  UNPROTO path
+11   WEST  UNPROTO path
+12   NORTH UNPROTO path + WIDE
+13   SOUTH UNPROTO path + WIDE
+14   EAST  UNPROTO path + WIDE
+15   WEST  UNPROTO path + WIDE
+</PRE>
+
+<P>
+SSID digipeating was first introduced with the Mic-Encoder but works
+with any destination callsign with a non-zero SSID.
+The theory behind destination SSID digipeating is described in more detail
+in the APRSdos README, MIC-E.TXT.  Basically, the idea is to minimize
+packet lengths and to have the manager of the WIDE APRS digipeater
+determine the most appropriate directional digipeat paths, removing
+the burden from the mobile user.
+<P>
+
+<I>Aprsdigi</I>
+
+also fits into a non WIDEn-n network by using the same algorithm for
+selection of subset of digipeaters from a list supplied with the
+<B>--digipath</B>
+
+option as the MIC-E.  That is, SSIDs of 1, 2 or 3 select that number
+of digipeaters from the first three digipeaters in the 
+<B>--digipath</B>
+
+list.  SSIDs of 4, 5, 6, or 7, start at the fourth digipeater in
+the list.
+<P>
+
+<A NAME="lbAI"> </A>
+<H2>FLOODING ALIASES</H2>
+
+APRS flooding (WIDEn-n) digipeating works by repeating any received packet
+whose next hop digipeater has a flooding alias (specified with the 
+<B>--flood</B>
+
+option), and the SSID is 1 or greater.  The SSID is decremented by one,
+and the packet is repeated.  Furthermore, to prevent broadcast storms,
+recently transmitted packets are remembered for a period of time specified
+by the
+<B>--keep</B>
+
+option and are not repeated if they are heard within that time period.
+<P>
+
+Unlike conventional digipeating, in which the digipeater callsign/alias is
+flagged as lqrepeatedrq, the flooding mode does not do this.
+Once the SSID decrements to zero, then a flooding alias is treated just like
+any other alias, and does get marked as repeated upon transmission.
+<P>
+
+<A NAME="lbAJ"> </A>
+<H2>TRACE and TRACEn-n ALIASES</H2>
+
+lqFloodingrq Trace aliases (TRACEn-n; 
+<B>--trace</B>
+
+option) are treated like flooding aliases with the addition that,
+besides decrementing the SSID, the current interface's callsign is
+inserted in front of the trace alias, providing a record-route function.
+lqPlainrq trace aliases (TRACE; also
+<B>--trace</B>
+
+option) are simply substituted in the conventional (
+<B>--subst_mycall</B>
+
+) manner.
+<P>
+
+<A NAME="lbAK"> </A>
+<H2>MULTI PORT OPERATION</H2>
+
+In single port operation, there is only one interface specified with
+<B>--interface.</B>
+
+All packets are received and some are retransmitted on the same interface,
+depending on whether they match the criteria for retransmission
+after translation of the digpeater path from one of the APRS-specific
+formats:
+<DL COMPACT>
+<DT>*<DD>
+Mic-E TO-call SSID-based route.
+<DT>*<DD>
+WIDEn-n/TRACEn-n flooding.
+</DL>
+<P>
+
+or a conventional next-hop (non-repeated) digipeater matching the
+callsign or one of the aliases for the interface.
+<P>
+
+The decision to transmit is made by matching the next hop
+callsign/alias with the table of callsigns and aliases you supply to
+<B>--interface.</B>
+
+<P>
+
+In multi-port operation, this same technique simply extends to several
+interfaces.  Besides each interface's unique callsign, you can give
+the same alias to several interfaces.  This results in a one-to-many
+fanout which might be useful for dual frequency operation such as a
+general use APRS net frequency and an event-specific frequency.
+<P>
+
+By using different flags for Mic-E expansions, etc. you can tailor
+these fanouts differently on each of these interfaces, perhaps keeping
+Mic-E packets compressed on one frequency while decompressing them on
+another.
+<A NAME="lbAL"> </A>
+<H2>DUPLICATING PACKETS</H2>
+
+The 
+<B>--dupe intf</B>
+
+option will duplicate a packet received on one interface to the interface
+name given.  If you want to duplicate to several other interface, repeat
+<B>--dupe intf </B>
+
+for each interface.
+The packet is duplicated verbatim
+as received.  No callsign substitution, flooding or other processing
+or checking such as whether the packet still has any
+non-repeated digipeaters in the list is checked.  This feature is meant
+to provide a means to simply repeat received packets verbatim, on an RF
+interface, for example, out an interface that might be an Ethernet,
+that has APRS client applications running on it (or 
+<I>aprsd</I>
+
+listening on a UDP interface).  Digipeating without
+the normal processing can be dangerous since the digipeater list is never
+used up.  Because of this, packets received on a given interface will
+never be blindly duplicated back to the same interface, regardless of
+the option setting.
+<P>
+
+<A NAME="lbAM"> </A>
+<H2>TRACE vs. TRACEN-N</H2>
+
+<P>
+
+Note that TRACEn-n vs. plain TRACE do
+different things: TRACEn-n *inserts* calls into the digipath while
+decrementing ssid, e.g.:
+<PRE>
+        RELAY*,TRACE3-3
+        RELAY,N2YGK-7*,TRACE3-2
+        RELAY,N2YGK-7,WB2ZII*,TRACE3-1
+        RELAY,N2YGK-7,WB2ZII,N2MH-15*,TRACE3
+        RELAY,N2YGK-7,WB2ZII,N2MH-15,WA2YSM-14*
+</PRE>
+
+<P>
+
+<A NAME="lbAN"> </A>
+<H2>KILLING LOOPING PACKETS</H2>
+
+<P>
+
+Kill looping packets (--kill_loops option):
+<PRE>
+        RELAY*,WIDE,WIDE,WIDE
+        RELAY,N2YGK-7*,WIDE,WIDE
+        RELAY,N2YGK-7,WIDE*,WIDE
+</PRE>
+
+Normally n2ygk-7 would respond to this,
+but, by finding one of mycall earlier in the path, I know to ignore it.
+<P>
+
+<A NAME="lbAO"> </A>
+<H2>EXAMPLES</H2>
+
+<P>
+
+Following is a sample invocation of 
+<I>aprsdigi</I>
+
+running on two ports.  This is a contrived example that tries to show
+all the features.  Comments to the right describe each feature.
+<PRE>
+aprsdigi \
+   --verbose \                                 # verbose
+   --north "N2YGK-2 WB2ZII WA2YSM-14" \        # North digi path
+   --south "N2YGK-3 WB2ZII WA2JNF-4" \         # South ...
+   --east "N2YGK-3 WB2ZII KD1LY" \             # East ...
+   --west "N2YGK-2 WB2ZII N2MH-15" \           # West ...
+   --flood "WIDE" \                            # WIDEn-n flooding
+   --trace "TRACE" \                           # TRACEn-n tracing
+   --kill_dupes \                              # kill dupes
+   --kill_loops \                              # kill loops
+   --mice_xlate \                              # do Mic-E translation
+   --subst_mycall \                            # do callsign substituton
+   --tag " via 147.06 (WB2ZII/R)" \            # add this tag to rec'd pkts
+   --nobud "ax25:NOCALL" \                     # ignore pkts from NOCALL
+   --dupe udp:233.0.14.100 \                    # dupe everything heard 
+   --int ax25:sm0:RELAY,WIDE,TRACE \           # ax25 soundmodem intf
+   --nomice_xlate \                            # turn off Mic-E translation
+   --x1j4_xlate \                              # do X1J4 translation
+   --nosubst_mycall \                          # turn off callsign subst.
+   --tag - \                                   # clear the tag
+   --int ax25:ax0:RELAY,WIDE,FOO,TRACE \       # ax25 ax0 intf.
+   --bud - \                                   # clear the budlist
+   --bud ip:128.59.39.150/32 \                 # allow only from this IP host
+   --int udp:233.0.14.99/12345/16:N2YGK-4,RELAY,WIDE,TRACE \ # multicast 
+   --int udp:233.0.14.100/12345/16:N2YGK-5      # to this mcast group
+
+opening UDP socket on 233.0.14.99/12345/16
+UDP address info: family 2 type 2 proto 17 next 0x0
+Linux APRS(tm) digipeater
+Copyright (c) 1996,1997,1999,2001,2002,2003 Alan Crosswell, <A HREF="mailto:n2ygk at weca.org">n2ygk at weca.org</A>
+Version: aprsdigi aprsdigi-2.4.3
+This is free software covered under the GNU Public License.
+There is no warranty.  See the file COPYING for details.
+
+# configuration:
+ budlist 1 deny NOCALL/48
+ budlist 2 permit 128.59.39.150/32
+interface ax25:sm0
+ callsign N2YGK-2
+ alias RELAY
+ alias WIDE
+ alias TRACE
+ option SUBST_MYCALL on
+ option MICE_XLATE on
+ option X1J4_XLATE off
+ option I_TX on
+ option I_RX on
+ option I_TXSAME on
+ option idinterval 570 #(09:30)
+ option tag  via 147.06 (WB2ZII/R)
+ budlist 1
+interface ax25:ax0
+ callsign N2YGK-3
+ alias RELAY
+ alias WIDE
+ alias FOO
+ option SUBST_MYCALL off
+ option MICE_XLATE off
+ option X1J4_XLATE on
+ option I_TX on
+ option I_RX on
+ option I_TXSAME on
+ option idinterval 570 #(09:30)
+ option tag #(none)
+ budlist 2
+interface udp:233.0.14.99
+ callsign N2YGK-4
+ alias RELAY
+ alias WIDE
+ alias FOO
+ option SUBST_MYCALL off
+ option MICE_XLATE off
+ option X1J4_XLATE on
+ option I_TX on
+ option I_RX on
+ option I_TXSAME off
+ option idinterval 570 #(09:30)
+ option tag #(none)
+ budlist 2
+# end of configuration
+
+My callsigns and aliases (routing table):
+Callsign  Interfaces...
+N2YGK-2   sm0 
+RELAY     sm0       ax0       233.0.14.99
+WIDEn-n   sm0       ax0       233.0.14.99
+TRACEn-n  sm0 
+N2YGK-3   ax0 
+FOO       ax0       233.0.14.99
+N2YGK-4   233.0.14.99
+SSID-based directional routing:
+
+N:        N2YGK-2   WB2ZII    WA2YSM-14 
+S:        N2YGK-3   WB2ZII    WA2JNF-4  
+E:        N2YGK-3   WB2ZII    KD1LY     
+W:        N2YGK-2   WB2ZII    N2MH-15   
+keep dupes for: 28 seconds
+log file: (none)
+kill dupes: ON loops: ON  testing: OFF
+
+</PRE>
+
+<A NAME="lbAP"> </A>
+<H2>BUGS</H2>
+
+<I>Aprsdigi</I>
+
+should not be confused with a Wes Johnson's DOS program of the same name.
+This code has most recently been tested with the Linux 2.4.20 kernel
+under Red Hat Fedora Core 1.
+The command line syntax is ugly and will eventually be replaced by a 
+configuration file. 
+Short options are deprecated and will dissappear in a future release.
+Please use long options.
+<P>
+
+<A NAME="lbAQ"> </A>
+<H2>FILES</H2>
+
+<B>/etc/ax25/axports</B>
+
+<A NAME="lbAR"> </A>
+<H2>SEE ALSO</H2>
+
+<B><A HREF="http://localhost/cgi-bin/man/man2html?1+call">call</A></B>(1),
+
+<B><A HREF="http://localhost/cgi-bin/man/man2html?1+listen">listen</A></B>(1),
+
+<B><A HREF="http://localhost/cgi-bin/man/man2html?1+beacon">beacon</A></B>(1),
+
+<B><A HREF="http://localhost/cgi-bin/man/man2html?4+ax25">ax25</A></B>(4),
+
+<B><A HREF="http://localhost/cgi-bin/man/man2html?8+kissattach">kissattach</A></B>(8),
+
+<B><A HREF="http://localhost/cgi-bin/man/man2html?8+ifconfig">ifconfig</A></B>(8),
+
+<B><A HREF="http://localhost/cgi-bin/man/man2html?1+aprsmon">aprsmon</A></B>(1),
+
+<B><A HREF="http://www.tapr.org">http://www.tapr.org</A></B>
+
+<A NAME="lbAS"> </A>
+<H2>AUTHORS</H2>
+
+<PRE>
+Alan Crosswell, <A HREF="mailto:n2ygk at weca.org">n2ygk at weca.org</A>
+<BR>
+APRS and the Mic-Encoder are Trademarks of APRS Engineering LLC.
+</PRE>
+
+<P>
+
+<HR>
+<A NAME="index"> </A><H2>Index</H2>
+<DL>
+<DT><A HREF="#lbAB">NAME</A><DD>
+<DT><A HREF="#lbAC">SYNOPSIS</A><DD>
+<DT><A HREF="#lbAD">DESCRIPTION</A><DD>
+<DT><A HREF="#lbAE">GENERAL OPTIONS</A><DD>
+<DT><A HREF="#lbAF">PER-INTERFACE OPTIONS</A><DD>
+<DT><A HREF="#lbAG">RUNTIME CONTROLS</A><DD>
+<DT><A HREF="#lbAH">SSID-BASED ROUTING</A><DD>
+<DT><A HREF="#lbAI">FLOODING ALIASES</A><DD>
+<DT><A HREF="#lbAJ">TRACE and TRACEn-n ALIASES</A><DD>
+<DT><A HREF="#lbAK">MULTI PORT OPERATION</A><DD>
+<DT><A HREF="#lbAL">DUPLICATING PACKETS</A><DD>
+<DT><A HREF="#lbAM">TRACE vs. TRACEN-N</A><DD>
+<DT><A HREF="#lbAN">KILLING LOOPING PACKETS</A><DD>
+<DT><A HREF="#lbAO">EXAMPLES</A><DD>
+<DT><A HREF="#lbAP">BUGS</A><DD>
+<DT><A HREF="#lbAQ">FILES</A><DD>
+<DT><A HREF="#lbAR">SEE ALSO</A><DD>
+<DT><A HREF="#lbAS">AUTHORS</A><DD>
+</DL>
+<HR>
+This document was created by
+<A HREF="http://localhost/cgi-bin/man/man2html">man2html</A>,
+using the manual pages.<BR>
+Time: 15:37:03 GMT, February 25, 2004
+</BODY>
+</HTML>
diff --git a/aprsdigi.lsm b/aprsdigi.lsm
new file mode 100644
index 0000000..c4cc14c
--- /dev/null
+++ b/aprsdigi.lsm
@@ -0,0 +1,23 @@
+Begin3
+Title:		aprsdigi
+Version:	2.4.1
+Entered-date:	28 Dec 01
+Description:	Aprsdigi is a specialized Amateur Packet Radio (AX.25) 
+		UI-frame digipeater for the Automatic Position Reporting 
+		System, APRS(tm).  
+
+		Aprsmon collects and displays standard AX.25 UI text
+		frames in a format similar to that output by a standard 
+		TNC in "Monitor ON" mode and is intended to be used with
+		programs like javAPRS which wish to see a TNC data
+		stream over a TCP connection.
+Keywords:	AX.25 APRS Amateur Radio
+Author:		n2ygk at weca.org (Alan Crosswell)
+Maintained-by:	n2ygk at weca.org (Alan Crosswell)
+Primary-site:	http://www.cloud9.net/~alan/ham/aprsdigi-2.4.1.tar.gz
+Alternate-site:	ftp://ftp.tapr.org/aprssig/linux/aprsdigi-2.4.1.tar.gz
+Original-site:
+Copying-policy:	GPL.
+
+End
+
diff --git a/aprsdigi.spec b/aprsdigi.spec
new file mode 100644
index 0000000..71d1173
--- /dev/null
+++ b/aprsdigi.spec
@@ -0,0 +1,55 @@
+Summary: AX.25 Automatic Position Reporting System aprsdigi and aprsmon
+Name: aprsdigi
+Version: 2.4.1
+Release: 1
+Copyright: GPL
+Group: Utilities/System
+Packager: Alan Crosswell <n2ygk at weca.org>
+Buildroot: /var/tmp/aprsdigi
+Source: ftp://ftp.tapr.org/aprssig/linux/aprsdigi-%{PACKAGE_VERSION}.tar.gz
+Url: http://www.cloud9.net/~alan/ham/aprsdigi.html
+Requires: libax25 >= 0.0.7
+
+%changelog
+* Fri Dec 28 2001 Alan Crosswell <alan at columbia.edu>
+- Try to make a new RPM, but first need to find RPMs for libax25.
+
+* Mon Apr 05 1999 Alan Crosswell <alan at columbia.edu>
+- Initial rpm
+
+%description
+Aprsdigi is a specialized Amateur Packet Radio (AX.25) UI-frame digipeater
+for the Automatic Position Reporting System, APRS(tm).  
+
+Aprsmon collects and displays standard AX.25 UI text frames in a format similar
+to that output by a standard TNC in "Monitor ON" mode and is intended
+to be used with programs like javAPRS which wish to see a TNC data
+stream over a TCP connection.
+
+%prep
+%setup -q -n aprsdigi-2.4.1
+
+%build
+./configure
+make
+
+%install
+rm -rf $RPM_BUILD_ROOT
+make DESTDIR=$RPM_BUILD_ROOT install 
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%files
+%doc README
+%doc INSTALL
+%doc COPYING
+%doc NEWS
+%doc ChangeLog
+%doc TODO
+%doc AUTHORS
+%doc aprsdigi.lsm
+/usr/sbin/aprsdigi
+/usr/sbin/aprsmon
+/usr/man/man8/aprsdigi.8
+/usr/man/man8/aprsmon.8
diff --git a/aprsmon.8 b/aprsmon.8
new file mode 100644
index 0000000..c0d9314
--- /dev/null
+++ b/aprsmon.8
@@ -0,0 +1,181 @@
+.TH APRSMON 8 "9 February 1999" Linux "Linux Programmer's Manual"
+.SH NAME
+aprsmon \- monitor APRS AX.25 traffic for javAPRS
+.SH SYNOPSIS
+.B aprsmon [-a] [-m] [-r] [-k minutes] [-p port] [-t title] [-i infofile]
+.SH DESCRIPTION
+.LP
+.B Aprsmon
+uses SOCK_PACKET facilities to provide a network monitor of all AX.25
+UI text traffic heard by the system.  It is based on
+listen(1).
+.LP
+.B Aprsmon
+collects (-m) 
+or displays standard AX.25 UI text frames in a format similar
+to that output by a standard TNC in "Monitor ON" mode and is intended
+to be used with programs like javAPRS which wish to see a TNC data
+stream over a TCP connection.  When the 
+.B aprsmon
+master has been running for a while and a new
+.B aprsmon
+slave starts up, first all saved up reports are sent, then a title
+line indicating the beginning of live data is sent, and new reports
+are sent as received.
+.LP
+Compressed position and telemetry reports as generated by the APRS Mic
+Encoder are translated into the conventional uncompressed APRS 
+Micro-Interface-Module (MIM) telemtry format so
+that these stations are visible in javAPRS.  Reports containing a
+TheNet X1J4 beacon header are also edited to strip off the header
+making these nodes visible in javAPRS as well.
+.LP
+.SH OPTIONS
+.TP 10
+.BI \-a
+Allow for the monitoring of outgoing frames as well as incoming ones.
+.TP 10
+.BI \-r
+Choose "raw" mode which allows non-printable data through.
+.TP 10
+.BI "\-p port"
+Monitor only those frames received on a particular port, by default all
+AX.25 interfaces are monitored.
+.TP 10
+.BI "-m"
+"Master" mode.  Retain monitored data for the number of minutes specified 
+with the
+.B -k
+option in a shared memory segment.
+.TP 10
+.BI "-k minutes"
+Retain monitored packets going back the given number of minutes.  
+Default is 30.
+.TP 10
+.BI "-t title"
+Sets the 
+.I javAPRS
+title string.  Default is "Live data from Linux."
+.TP 10
+.BI "-i infofile"
+.I Infofile
+is the path to the file that the aprsmon master writes the shared memory
+segment and semaphore id's into.  Default is "/var/ax25/aprsmon.info."
+.SH "javAPRS CONFIGURATION"
+Set up one 
+.I aprsmon
+master running on your system to collect historical data going back
+a while.  You will probably want to set up an /etc/rc.d/init.d script for
+this.
+.sp
+.nf
+aprsmon -a -m&
+.fi
+.sp
+Add an entry into /etc/services with the port number you
+want javAPRS to connect on.  For example:
+.sp
+.nf
+aprs		14439/tcp	# APRS monitor on 144.39
+.fi
+.sp
+Add an entry into /etc/inetd.conf for this service:
+.sp
+.nf
+aprs stream tcp nowait root /usr/sbin/aprsmon aprsmon -a
+.fi
+.sp
+To test, simply "telnet localhost aprs".  To use with javAPRS,
+set, for example,
+.sp
+.nf
+<PARAM name = "dataFile1" value = "netc:14439:localhost">
+.fi
+in your HTML file as described in the 
+.B javAPRS
+documentation, and then use 
+.B appletviewer
+to run javAPRS:
+.nf
+appletviewer mydemo.html
+.fi
+.sp
+.SH "Mic-E to MIM Translation"
+The Mic-E reduces the duration of packet noise on a voice frequency
+by encoding its data in a compressed form, some of which is binary.
+Some APRS-decoding software, notably javAPRS, is unable to deal
+with this data.  To solve this problem
+.B aprsmon
+expands the Mic-E packet into one or two MIM packets as follows:
+.sp
+.nf
+@\fBddhhmm\fPz\fBDDMM.hhN/DDDMM.hhW$cse/spd/E\fP>mon/M\fBm\fP/\fBstatus\fP
+T#MIC,\fBaaabbbcccdddeeefffComments
+.fi
+.sp
+.TP 10
+.BI ddhhmm
+is the UTC day and time the packet was received by the host running 
+.B aprsmon.
+.TP 10
+.BI DDMM.hhN
+is the latitude.
+.TP 10
+.BI /
+is the symbol table selection (/ or \\).
+.TP 10
+.BI DDDMM.hhW
+is the longitude.
+.TP 10
+.BI $
+is the symbol.
+.TP 10
+.BI "cse,spd"
+are course and speed.
+.TP 10
+.BI E
+is the type of Mic-Encoder:
+.IP
+.nf
+E - TAPR Mic-Encoder
+T - Kenwood TH-D7
+.fi
+.RP
+.TP 10
+.BI m
+is the status message number, and
+.TP 10
+.BI status
+is the status message number expanded as follows:
+.IP
+.nf
+0 -  Off duty..
+1 -  Enroute...
+2 -  In Service
+3 -  Returning.
+4 -  Committed.
+5 -  Special...
+6 -  PRIORITY..
+7 -  EMERGENCY.
+.fi
+.RP
+.TP 10
+.BI aaa,bbb,ccc,ddd,eee,fff
+are the values of the telemetry channels.
+.SH FILES
+.BR /etc/ax25/axports
+.BR /var/ax25/aprsmon.info
+.SH "SEE ALSO"
+.BR call (1),
+.BR listen (1),
+.BR beacon (1),
+.BR ax25 (4),
+.BR axattach (8),
+.BR http://www.bridge.net/~sdimse/javAPRS.html,
+.BR http://www.tapr.org,
+.BR http://www.aprs.net,
+.BR MIC-E.TXT, TELEMTRY.TXT, PROTOCOL.TXT
+.SH AUTHOR
+.nf
+Alan Crosswell, n2ygk at weca.org
+.fi
diff --git a/aprsmon.c b/aprsmon.c
new file mode 100644
index 0000000..8f5b055
--- /dev/null
+++ b/aprsmon.c
@@ -0,0 +1,361 @@
+/* aprsmon: An incredible simulation of a non-KISS TNC with MONitor ON
+ *  (for UI frames only) on a Linux AX.25 interface.  Why?  So it can
+ *  be run under inetd and connected to by programs like javAPRS that
+ *  want to see a TNC datastream.
+ *  (e.g. FROM>TO,DIGI,DIGI...DIGI:text)
+ *
+ * Runs in two modes:
+ *  1. Just spits out received data to stdout.
+ *  2. Buffers up some number of minutes worth of received packets into
+ *     a segment.  #1 mode dumps contents of this segment before going "live."
+ *
+ * A socket opened in SOCK_PACKET mode returns frames that are exactly
+ * what a KISS TNC sends: a zero, indicating data, followed by the
+ * contents of the AX.25 packet.  This program has to decode all that
+ * AX.25 junk all over again just to print it out in generic TNC MONitor
+ * format.
+ *
+ * This program is derived from AX.25 utils 2.0.12 listen(8) written by
+ * (according to the lsm):
+ * 
+ *      jsn at cs.nott.ac.uk (Jonathan Naylor)
+ *  	tpmannin at cc.hut.fi (Tomi Manninen)
+ *      A.Cox at swansea.ac.uk (Alan Cox)
+ * 
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License, version 2 as
+ *  published by the Free Software Foundation.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ * (See the file "COPYING" that is included with this source distribution.)
+ * 
+ * portions Copyright (c) 1996,1997,1998,1999 Alan Crosswell
+ * Alan Crosswell, N2YGK
+ * 144 Washburn Road
+ * Briarcliff Manor, NY 10510, USA
+ * n2ygk at weca.org
+ */
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <sys/socket.h>
+#include <net/if.h>
+#include <netinet/if_ether.h>
+#include <netinet/in.h>
+#include <sys/ioctl.h>
+#include <sys/time.h>
+#include <sys/utsname.h>
+#include <unistd.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <ctype.h>
+#include <time.h>
+#include <signal.h>
+
+#include <netax25/kernel_ax25.h>
+#include <netax25/kernel_rose.h>
+#include <netax25/ax25.h>
+#include <netax25/axlib.h>
+#include <netax25/axconfig.h>
+
+#ifndef HAVE_LIBAX25_EXTENSIONS
+#include "libax25ext.h"
+#endif
+#ifdef USE_SHM
+#include "aprsshm.h"
+#endif
+#include "mic_e.h"
+
+#define	ALEN		6
+#define	AXLEN		7
+/* SSID mask and various flags that are stuffed into the SSID byte */
+#define	SSID		0x1E
+#define	HDLCAEB		0x01
+#define	REPEATED	0x80
+
+#define	UI		0x03	/* unnumbered information (unproto) */
+#define	PID_NO_L3	0xF0	/* no level-3 (text) */
+
+void dump(FILE *f,unsigned char *, int,time_t);
+void fmt(const unsigned char *, int, unsigned char **, unsigned char **,time_t);
+char *pax25(char *, const unsigned char *);
+void cleanup(int);
+
+int master = 0;			/* data collector */
+int keepfor = 30;		/* minutes to keep collected data.  */
+int raw = 0;			/* print raw data */
+char *infofile = "/var/ax25/aprsmon.info";
+#ifndef PACKAGE
+#define PACKAGE "aprsmon"
+#endif
+
+#ifndef VERSION
+#define VERSION "$Revision: 1.1.1.1 $"
+#endif
+
+char *title = "Live data from Linux";
+
+int main(int argc, char **argv)
+{
+  unsigned char buffer[1500];
+  int size;
+  int s;
+  char *port = NULL, *dev = NULL;
+  struct sockaddr sa;
+  struct ifreq ifr;
+  int proto = ETH_P_AX25;
+  time_t now;
+
+#ifdef USE_SHM
+#define OPTS "p:amk:i:t:rv"
+#else
+#define OPTS "p:at:rv"
+#endif
+  while ((s = getopt(argc, argv, OPTS)) != -1) {
+    switch (s) {
+#ifdef USE_SHM
+    case 'm':
+      master++;
+      break;
+    case 'i':
+      infofile = optarg;	/* file name for passing seg/sem info */
+      break;
+    case 'k':			/* keep for optarg minutes */
+      keepfor = atoi(optarg);
+      break;
+#endif
+    case 'p':			/* entry in axports */
+      port = optarg;
+      break;
+    case 'a': /* allows 'hearing' my transmitted packets */
+      proto = ETH_P_ALL;
+      break;
+    case 'r':			/* raw data printing */
+      raw++;
+      break;
+    case 't':
+      title = optarg;
+      break;
+    case 'v':
+      printf("aprsmon: %s-%s\n",PACKAGE,VERSION);
+      exit(0);
+    case '?':
+#ifdef USE_SHM
+      fprintf(stderr, "Usage: aprsmon [-ar] [-p port] [-m [-k minutes]] [-i infofile] [-t title]\n");
+#else
+      fprintf(stderr, "Usage: aprsmon [-ar] [-p port] [-t title]\n");
+#endif
+      return 1;
+    }
+  }
+
+  if (ax25_config_load_ports() == 0)
+    fprintf(stderr, "aprsmon: no AX.25 port data configured\n");
+  
+  if (port != NULL) {
+    if ((dev = ax25_config_get_dev(port)) == NULL) {
+      fprintf(stderr, "aprsmon: invalid port name - %s\n", port);
+      return 1;
+    }
+  }
+  
+  if ((s = socket(AF_PACKET, SOCK_PACKET, htons(proto))) == -1) {
+    perror("socket");
+    return 1;
+  }
+  signal(SIGHUP,cleanup);
+  signal(SIGINT,cleanup);
+  signal(SIGQUIT,cleanup);
+  signal(SIGPWR,cleanup);
+  signal(SIGPIPE,cleanup);
+  
+#ifdef USE_SHM
+  if (master) {
+    if (shm_master(keepfor,infofile))
+      return 1;
+  } else 
+#endif
+    {
+    struct utsname me;
+
+    uname(&me);
+    printf("aprsmon>JAVA:javaMSG  :Linux APRS server (%s-%s by Alan Crosswell, N2YGK) on %s running %s %s\r\n",
+	   PACKAGE, VERSION, me.nodename, me.sysname, me.release);
+#ifdef USE_SHM
+    (void) shm_slave(stdout,infofile);
+#endif
+    printf("# Live data follows:\r\n");
+    printf("aprsmon>JAVA:javaTITLE:%s\r\n",title);
+    fflush(stdout);
+  }
+  for (;;) {
+    int asize;
+
+    asize = sizeof(sa);
+    if ((size = recvfrom(s, buffer, sizeof(buffer), 0, &sa, &asize)) == -1) {
+      perror("recv");
+      return 1;
+    }
+    if (dev != NULL && strcmp(dev, sa.sa_data) != 0)
+      continue; 
+    
+    time(&now);
+    if (proto == ETH_P_ALL) {	/* promiscuous mode? */
+      strcpy(ifr.ifr_name, sa.sa_data);
+      if (ioctl(s, SIOCGIFHWADDR, &ifr) < 0
+	  || ifr.ifr_hwaddr.sa_family != AF_AX25)
+	continue;		/* not AX25 so ignore this packet */
+    }
+#ifdef USE_SHM
+    if (master)
+      collect(buffer,size);
+    else
+#endif
+      dump(stdout,buffer,size,now);
+  }
+}
+
+void
+dump(FILE *f,
+     unsigned char *buf,
+     int len,
+     time_t now)
+{
+  unsigned char *cp1,*cp2;
+
+  fmt(buf,len,&cp1,&cp2,now);
+  if (*cp1) {
+    fprintf(f,"%s\r\n",cp1);
+  }
+  if (*cp2) {
+    fprintf(f,"%s\r\n",cp2);
+  }
+  fflush(f);
+}
+
+void
+fmt(const unsigned char *buf,
+    int len,unsigned char **cp1, 
+    unsigned char **cp2,
+    time_t now)
+{
+  static unsigned char buf1[1000],buf2[100];
+  char mic1[200],mic2[200];
+  int l1,l2;
+  char from[10],to[10],digis[100];
+  int i,hadlast,l;
+  char tmp[15];
+
+  *buf1 = *buf2 = '\0';
+  *cp1 = buf1;
+  *cp2 = buf2;
+  if ((buf[0] & 0xf) != 0)	/* not a kiss data frame */
+    return;
+  ++buf;
+  --len;
+  if (len < (AXLEN+ALEN+1))	/* too short */
+    return;
+
+  pax25(to,buf);		/* to call */
+  pax25(from,&buf[AXLEN]);	/* from call */
+
+  buf+=AXLEN;			/* skip over the from call now... */
+  len-=AXLEN;
+  *digis = '\0';
+  if (!(buf[ALEN] & HDLCAEB)) {	/* is there a digipeater path? */
+    for (l=0, buf+=AXLEN, len-=AXLEN, i = 0;
+	 i < 6 && len >= 0;
+	 i++, len-=AXLEN, buf+=AXLEN) {
+      int nextrept = buf[AXLEN+ALEN]&REPEATED;
+      if (buf[ALEN]&HDLCAEB)
+	nextrept = 0;
+      pax25(tmp,buf);
+      
+      if (*tmp) {
+	sprintf(&digis[l],",%s%s",tmp,(buf[ALEN]&REPEATED&&!nextrept)?"*":"");
+	++hadlast;
+	l += strlen(&digis[l]);
+      }
+      if (buf[ALEN] & HDLCAEB)
+	break;
+    }
+  }
+  buf += AXLEN;
+  len -= AXLEN;
+  if (len <= 0)
+    return;			/* no data after callsigns */
+  if (*buf++ == UI && *buf++ == PID_NO_L3) {
+    len -= 2;
+  } else {
+    return;			/* must have UI text to be useful */
+  }
+  /* now check to see if it's a mic-e frame & rewrite it */
+  if (fmt_mic_e(to,buf,len,mic1,&l1,mic2,&l2,now)) {
+    /* it was a MIC-E */
+    mic1[l1] = mic2[l2] = '\0';
+    if (l1)
+      sprintf(buf1,"%s>%s%s:%s",from,"APRS",digis,mic1);
+    if (l2)
+      sprintf(buf2,"%s>%s%s:%s",from,"APRS",digis,mic2);
+  } else if (fmt_x1j4(to,buf,len,mic1,&l1,mic2,&l2,now)) {
+    /* it was an X1J4 digi */
+    mic1[l1] = mic2[l2] = '\0';
+    if (l1)
+      sprintf(buf1,"%s>%s%s:%s",from,to,digis,mic1);
+  } else {
+    /* not mic-e/x1j4, so just print the packet without editing */
+    sprintf(buf1,"%s>%s%s:",from,to,digis);
+    l = strlen(buf1);
+    for (i = 0; i < len; i++,l++) {
+      buf1[l] = (raw||isprint(buf[i]))?buf[i]:' '; /* keep it clean */
+    }
+    buf1[l] = '\0';
+  }
+  return;
+}
+
+char *pax25(char *buf, const unsigned char *data)
+{
+  int i, ssid;
+  char *s;
+  char c;
+  
+  s = buf;
+  
+  for (i = 0; i < ALEN; i++) {
+    c = (data[i] >> 1) & 0x7F;
+    
+    if (!isalnum(c) && c != ' ') {
+      strcpy(buf, "[invalid]");
+      return buf;
+    }
+    
+    if (c != ' ') *s++ = c;
+  }	
+  
+  if ((ssid = (data[ALEN] & SSID)>>1) != 0)
+    sprintf(s, "-%d", ssid);
+  else
+    *s = '\0';
+  
+  return(buf);
+}
+
+void
+cleanup(sig)
+int sig;
+{
+#ifdef USE_SHM
+  shm_cleanup(sig);		/* clean up shared memory, etc. */
+#endif
+  exit(0);
+}
diff --git a/aprsmon.html b/aprsmon.html
new file mode 100644
index 0000000..91975d8
--- /dev/null
+++ b/aprsmon.html
@@ -0,0 +1,184 @@
+<HTML>
+<BODY>
+<PRE>
+<HTML>
+<BODY>
+<PRE>
+       aprsmon - monitor APRS AX.25 traffic for javAPRS
+
+
+</PRE>
+<H2>SYNOPSIS</H2><PRE>
+       <STRONG>aprsmon</STRONG>  <STRONG>[-a]</STRONG>  <STRONG>[-m]</STRONG> <STRONG>[-r]</STRONG> <STRONG>[-k</STRONG> <STRONG>minutes]</STRONG> <STRONG>[-p</STRONG> <STRONG>port]</STRONG> <STRONG>[-t</STRONG> <STRONG>title]</STRONG>
+       <STRONG>[-i</STRONG> <STRONG>infofile]</STRONG>
+
+
+</PRE>
+<H2>DESCRIPTION</H2><PRE>
+       <STRONG>Aprsmon</STRONG> uses SOCK_PACKET facilities to provide  a  network
+       monitor  of all AX.25 UI text traffic heard by the system.
+       It is based on listen(1).
+
+       <STRONG>Aprsmon</STRONG> collects (-m) or displays standard AX.25  UI  text
+       frames  in  a  format similar to that output by a standard
+       TNC in "Monitor ON" mode and is intended to be  used  with
+       programs  like javAPRS which wish to see a TNC data stream
+       over a TCP connection.  When the <STRONG>aprsmon</STRONG> master  has  been
+       running  for  a  while  and a new <STRONG>aprsmon</STRONG> slave starts up,
+       first all saved up reports are sent,  then  a  title  line
+       indicating  the  beginning  of  live data is sent, and new
+       reports are sent as received.
+
+       Compressed position and telemetry reports as generated  by
+       the  APRS Mic Encoder are translated into the conventional
+       uncompressed APRS  Micro-Interface-Module  (MIM)  telemtry
+       format  so  that  these  stations  are visible in javAPRS.
+       Reports containing a TheNet X1J4 beacon  header  are  also
+       edited  to strip off the header making these nodes visible
+       in javAPRS as well.
+
+
+
+</PRE>
+<H2>OPTIONS</H2><PRE>
+       <STRONG>-a</STRONG>        Allow for the monitoring of outgoing  frames  as
+                 well as incoming ones.
+
+       <STRONG>-r</STRONG>        Choose  "raw"  mode  which  allows non-printable
+                 data through.
+
+       <STRONG>-p</STRONG> <STRONG>port</STRONG>   Monitor only those frames received on a particu-
+                 lar  port,  by  default all AX.25 interfaces are
+                 monitored.
+
+       <STRONG>-m</STRONG>        "Master" mode.  Retain monitored  data  for  the
+                 number  of  minutes specified with the <STRONG>-k</STRONG> option
+                 in a shared memory segment.
+
+       <STRONG>-k</STRONG> <STRONG>minutes</STRONG>
+                 Retain monitored packets going  back  the  given
+                 number of minutes.  Default is 30.
+
+       <STRONG>-t</STRONG> <STRONG>title</STRONG>  Sets the <EM>javAPRS</EM> title string.  Default is "Live
+                 data from Linux."
+
+                 <EM>Infofile</EM> is  the  path  to  the  file  that  the
+                 aprsmon  master writes the shared memory segment
+                 and   semaphore   id's   into.     Default    is
+                 "/var/ax25/aprsmon.info."
+
+
+</PRE>
+<H2>javAPRS CONFIGURATION</H2><PRE>
+       Set  up  one <EM>aprsmon</EM> master running on your system to col-
+       lect historical data going back a while.  You will  proba-
+       bly want to set up an /etc/rc.d/init.d script for this.
+
+       aprsmon -a -m&
+
+       Add  an  entry into /etc/services with the port number you
+       want javAPRS to connect on.  For example:
+
+       aprs      14439/tcp # APRS monitor on 144.39
+
+       Add an entry into /etc/inetd.conf for this service:
+
+       aprs stream tcp nowait root /usr/sbin/aprsmon aprsmon -a
+
+       To test, simply "telnet  localhost  aprs".   To  use  with
+       javAPRS, set, for example,
+
+       <PARAM name = "dataFile1" value = "netc:14439:localhost">
+       in  your  HTML file as described in the <STRONG>javAPRS</STRONG> documenta-
+       tion, and then use <STRONG>appletviewer</STRONG> to run javAPRS:
+       appletviewer mydemo.html
+
+
+
+</PRE>
+<H2>Mic-E to MIM Translation</H2><PRE>
+       The Mic-E reduces the duration of packet noise on a  voice
+       frequency  by encoding its data in a compressed form, some
+       of which is binary.  Some APRS-decoding software,  notably
+       javAPRS,  is unable to deal with this data.  To solve this
+       problem <STRONG>aprsmon</STRONG> expands the Mic-E packet into one  or  two
+       MIM packets as follows:
+
+       @<STRONG>ddhhmm</STRONG>z<STRONG>DDMM.hhN/DDDMM.hhW$cse/spd/E</STRONG>>mon/M<STRONG>m</STRONG>/<STRONG>status</STRONG>
+       T#MIC,<STRONG>aaabbbcccdddeeefffComments</STRONG>
+
+
+       <STRONG>ddhhmm</STRONG>    is  the UTC day and time the packet was received
+                 by the host running <STRONG>aprsmon.</STRONG>
+
+       <STRONG>DDMM.hhN</STRONG>  is the latitude.
+
+       <STRONG>/</STRONG>         is the symbol table selection (/ or \).
+
+       <STRONG>DDDMM.hhW</STRONG> is the longitude.
+
+       <STRONG>$</STRONG>         is the symbol.
+
+       <STRONG>E</STRONG>         is the type of Mic-Encoder:
+
+                 E - TAPR Mic-Encoder
+                 T - Kenwood TH-D7
+
+       <STRONG>m</STRONG>         is the status message number, and
+
+       <STRONG>status</STRONG>    is the status message number  expanded  as  fol-
+                 lows:
+
+                 0 -  Off duty..
+                 1 -  Enroute...
+                 2 -  In Service
+                 3 -  Returning.
+                 4 -  Committed.
+                 5 -  Special...
+                 6 -  PRIORITY..
+                 7 -  EMERGENCY.
+
+       <STRONG>aaa,bbb,ccc,ddd,eee,fff</STRONG>
+                 are the values of the telemetry channels.
+
+
+</PRE>
+<H2>FILES</H2><PRE>
+       <STRONG>/etc/ax25/axports</STRONG> <STRONG>/var/ax25/aprsmon.info</STRONG>
+
+
+</PRE>
+<H2>SEE ALSO</H2><PRE>
+       <STRONG>call</STRONG>(1),   <STRONG>listen</STRONG>(1),   <STRONG>beacon</STRONG>(1),  <STRONG>ax25</STRONG>(4),  <STRONG>axattach</STRONG>(8),
+       <STRONG>http://www.bridge.net/~sdimse/javAPRS.html,</STRONG>
+       <STRONG>http://www.tapr.org,</STRONG>       <STRONG>http://www.aprs.net,</STRONG>       <STRONG>MIC-</STRONG>
+       <STRONG>E.TXT,</STRONG>TELEMTRY.TXT,<STRONG>PROTOCOL.TXT</STRONG>
+
+
+</PRE>
+<H2>AUTHOR</H2><PRE>
+       Alan Crosswell, n2ygk at weca.org
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+</PRE>
+</BODY>
+</HTML>
+</PRE>
+</BODY>
+</HTML>
diff --git a/aprsshm.c b/aprsshm.c
new file mode 100644
index 0000000..6543c45
--- /dev/null
+++ b/aprsshm.c
@@ -0,0 +1,301 @@
+#if defined(USE_SHM) && defined(HAVE_SHMCTL)
+/*
+ * routines to collect up packets for 'keepfor' minutes, manage shared
+ *  memory circular buffer, etc. 
+ * See aprsmon.c for the main program.
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License, version 2 as
+ *  published by the Free Software Foundation.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ * (See the file "COPYING" that is included with this source distribution.)
+ * 
+ * Copyright (c) 1996,1997,1999 Alan Crosswell
+ * Alan Crosswell, N2YGK
+ * 144 Washburn Road
+ * Briarcliff Manor, NY 10510, USA
+ * n2ygk at weca.org
+ */
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <sys/socket.h>
+#include <net/if.h>
+#include <netinet/if_ether.h>
+#include <netinet/in.h>
+#include <sys/ioctl.h>
+#include <sys/time.h>
+#include <sys/ipc.h>
+#include <sys/shm.h>
+#include <sys/sem.h>
+#include <unistd.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <ctype.h>
+#include <time.h>
+
+#include <netax25/ax25.h>
+
+#include <netax25/axconfig.h>
+#include "aprsshm.h"
+
+#define MAXPPM 10
+#define MAXPKT 256
+
+struct pkt {			/* we make a circular buffer of these */
+  int len;			/* packet length */
+  time_t recvd;			/* when received */
+  unsigned char data[MAXPKT];	/* the packet. */
+};
+
+struct pktseg {			/* mapping of the shared segment */
+  struct pkt *head, *tail;	/* relative addr */
+  int keepfor;			/* might as well make this info available */
+  int filled;			/* and fact that we did some early tosses */
+  int segsize;			/* need this in the client */
+  struct pkt pkt0;		/* first packet in seg */
+};
+  
+static int seg = -1, segsize = 0, sem = -1, master = 0;
+static struct pktseg *pktseg = NULL;
+static char *infofile = NULL;
+
+/* convert relative ptr to absolute & vice-versa */
+#define RELABS(x) ((struct pkt *)(((unsigned int)(x))+(unsigned int)pktseg))
+#define ABSREL(x) ((struct pkt *)(((unsigned int)(x))-(unsigned int)pktseg))
+#define PKTSIZE (sizeof(struct pkt))
+
+int
+shm_master(k,ifile)		/* "collector" shared memory master */
+int k;				/* keep for n minutes */
+char *ifile;
+{
+  struct sembuf sops[1];
+  FILE *info;
+
+  master = 1;
+  infofile = ifile;
+  segsize = sizeof(struct pktseg)+(k*MAXPPM*PKTSIZE);
+  if ((seg = shmget(IPC_PRIVATE,segsize,IPC_CREAT|0644)) < 0) {
+    perror("shmget");
+    return -1;
+  }
+  if ((pktseg = (struct pktseg *)shmat(seg,0,0)) < 0) {
+    perror("shmat");
+    return -1;
+  }
+  if ((sem = semget(IPC_PRIVATE,1,IPC_CREAT|0644)) < 0) {
+    perror("semget");
+    return -1;
+  }
+  if (semctl(sem,0,SETVAL,1) < 0) { /* initialize the semaphore to locked */
+    perror("semctl");
+    return -1;
+  }
+  if ((info = fopen(infofile,"w")) != NULL) {
+    fprintf(info,"%d %d\n",seg,sem);
+    fclose(info);
+  } else {
+    perror(infofile);
+    return -1;
+  }
+
+  bzero(pktseg,segsize);	/* initialize the shared segment */
+  pktseg->segsize = segsize;
+  pktseg->keepfor = k;
+  pktseg->head = ABSREL(&pktseg->pkt0);
+  pktseg->tail = (struct pkt *)-1;
+
+  sops[0].sem_num = 0;  
+  sops[0].sem_op = -1;		/* release the lock */
+  sops[0].sem_flg = 0;
+  if (semop(sem,sops,1) < 0) {
+    perror("semop");
+    return -1;
+  }
+  return 0;
+}
+
+void
+shm_cleanup(sig)		/* release segment and semaphore */
+int sig;
+{
+  if (pktseg) {
+    shmdt((char *)pktseg);
+  }
+  if (master) {
+    if (infofile)
+      unlink(infofile);
+    if (seg >= 0)
+      shmctl(seg,IPC_RMID,0);
+    if (sem >= 0)
+      semctl(sem,0,IPC_RMID,0);
+  }
+}
+
+int
+shm_slave(f,ifile)		/* "client" shared memory slave */
+FILE *f;
+char *ifile;
+{
+  struct sembuf sops[1];
+  FILE *info;
+
+  infofile = ifile;
+  if ((info = fopen(infofile,"r"))) {
+    if (fscanf(info,"%d%d",&seg,&sem) != 2) {
+      fclose(info);
+      fprintf(stderr,"#%s: didn't scan\n",infofile);
+      return -1;
+    }
+    fclose(info);
+  } else {			/* no collector running.  That's OK. */
+    printf("# No saved data available.\r\n");
+    return -1;
+  }
+    
+  if ((pktseg = (struct pktseg *)shmat(seg,0,SHM_RDONLY)) < 0) {
+    perror("shmat");
+    return -1;
+  }
+  segsize = pktseg->segsize;
+
+  sops[0].sem_num = 0;  
+  sops[0].sem_op = 0;		/* wait for a read lock?? */
+  sops[0].sem_flg = 0;
+  if (semop(sem,sops,1) < 0) {
+    perror("semop");
+    return -1;
+  }
+  dump_saved(f);		/* print out the saved stuff */
+  shmdt((char *)pktseg);
+  return 0;
+}
+
+/* accumulate packets and age out stale ones */
+void
+collect(buf,len)
+unsigned char *buf;
+int len;
+{
+  time_t now = time(NULL);
+  struct pkt *p;
+  struct sembuf sops[1];
+
+  if (len>MAXPKT) {
+    fprintf(stderr,"buffer overrun (pkt len %d)\n",len);
+    len = MAXPKT;
+  }
+  /* obtain the write lock */
+  sops[0].sem_num = 0;  
+  sops[0].sem_op = 1;		
+  sops[0].sem_flg = 0;
+  if (semop(sem,sops,1) < 0) {
+    perror("semop");
+    return;
+  }
+  /* next free packet goes right after tail packet */
+  p = free_stale(now,1);	/* toss stale packets/make room */
+  p->recvd = now;
+  p->len = len;
+  bcopy(buf,p->data,len);
+  bzero(&p->data[len],MAXPKT-len); /* clean out any garbage */
+  pktseg->tail = ABSREL(p);	/* new tail */
+
+  /* release the write lock */
+  sops[0].sem_num = 0;  
+  sops[0].sem_op = -1;		
+  sops[0].sem_flg = 0;
+  if (semop(sem,sops,1) < 0) {
+    perror("semop");
+  }
+}
+
+/* get rid of stale (older than keepfor minutes) packets and more
+   packets if the buffer is full and makespace is true.  Returns
+   abs pointer to where there's room for next packet. */
+
+struct pkt *
+free_stale(now,makespace)	/* lose stale packets */
+time_t now;
+int makespace;
+{
+  struct pkt *head = RELABS(pktseg->head);
+  struct pkt *tail = RELABS(pktseg->tail);
+  struct pkt *segend = (struct pkt *)((char *)pktseg+segsize);
+  struct pkt *nextp;
+  int tossed = 0;
+  
+  if (pktseg->tail == (struct pkt *)-1) { /* nothing in buffer yet! */
+    return head;
+  }
+
+  /* throw out any stale packets, moving head forward through list. */
+  while((head->recvd < (now - pktseg->keepfor*60)) && head != tail) {
+    ++tossed;
+    if (++head >= segend) {	/* wrap around */
+      head = &pktseg->pkt0;
+    }
+  }
+  pktseg->head = ABSREL(head);
+
+  /* find where the next packet will be stuffed */
+  nextp = &tail[1];
+  if (nextp >= segend) {	/* have to circle around */
+    nextp = &pktseg->pkt0;
+  }
+
+  /* must flush oldest non-stale (head) packet */
+  if (makespace && !tossed && head == nextp) {
+    if (++head >= segend) 	/* wrap around */
+      head = &pktseg->pkt0;
+    pktseg->head = ABSREL(head);
+    pktseg->filled++;
+  }
+  if (pktseg->filled && tossed)	/* full buffer remedied by stale-out */
+    pktseg->filled = 0;
+  return nextp;
+}
+
+void
+dump_saved(f)			/* write saved pkts to file */
+FILE *f;
+{
+  extern void dump(FILE *,unsigned char *, int,time_t);
+  struct pkt *head = RELABS(pktseg->head);
+  struct pkt *tail = RELABS(pktseg->tail);
+  struct pkt *segend = (struct pkt *)((char *)pktseg+segsize);
+  struct pkt *p;
+  struct tm *t;
+
+  if (pktseg->tail == (struct pkt *)-1)
+    return;			/* no logged packets yet. */
+  t = gmtime(&head->recvd);
+  fprintf(f,"# Activity seen since %04d%02d%02d %02d%02dZ:\r\n",
+	  t->tm_year+1900,
+	  t->tm_mon+1,
+	  t->tm_mday,
+	  t->tm_hour,
+	  t->tm_min);
+  for (p = head; p != tail;) { /* then print the rest */
+    dump(f,p->data,p->len,p->recvd);
+    if (++p >= segend) { /* have to circle around */
+      p = &pktseg->pkt0;
+    }
+  }
+  if (p == tail) {
+    dump(f,p->data,p->len,p->recvd);    
+  }
+  fprintf(f,"# end of recorded activity.\r\n");
+}
+#endif
diff --git a/aprsshm.h b/aprsshm.h
new file mode 100644
index 0000000..0381f1f
--- /dev/null
+++ b/aprsshm.h
@@ -0,0 +1,6 @@
+extern int shm_master(int,char *);
+extern int shm_slave(FILE *,char *);
+extern void collect(unsigned char *, int);
+extern struct pkt *free_stale(time_t,int);
+extern void dump_saved(FILE *);
+extern void shm_cleanup(int);
diff --git a/configure b/configure
new file mode 100755
index 0000000..f6bb1c4
--- /dev/null
+++ b/configure
@@ -0,0 +1,5045 @@
+#! /bin/sh
+# Guess values for system-dependent variables and create Makefiles.
+# Generated by GNU Autoconf 2.53.
+#
+# Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002
+# Free Software Foundation, Inc.
+# This configure script is free software; the Free Software Foundation
+# gives unlimited permission to copy, distribute and modify it.
+
+if expr a : '\(a\)' >/dev/null 2>&1; then
+  as_expr=expr
+else
+  as_expr=false
+fi
+
+
+## --------------------- ##
+## M4sh Initialization.  ##
+## --------------------- ##
+
+# Be Bourne compatible
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+  emulate sh
+  NULLCMD=:
+elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
+  set -o posix
+fi
+
+# NLS nuisances.
+# Support unset when possible.
+if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
+  as_unset=unset
+else
+  as_unset=false
+fi
+
+(set +x; test -n "`(LANG=C; export LANG) 2>&1`") &&
+    { $as_unset LANG || test "${LANG+set}" != set; } ||
+      { LANG=C; export LANG; }
+(set +x; test -n "`(LC_ALL=C; export LC_ALL) 2>&1`") &&
+    { $as_unset LC_ALL || test "${LC_ALL+set}" != set; } ||
+      { LC_ALL=C; export LC_ALL; }
+(set +x; test -n "`(LC_TIME=C; export LC_TIME) 2>&1`") &&
+    { $as_unset LC_TIME || test "${LC_TIME+set}" != set; } ||
+      { LC_TIME=C; export LC_TIME; }
+(set +x; test -n "`(LC_CTYPE=C; export LC_CTYPE) 2>&1`") &&
+    { $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set; } ||
+      { LC_CTYPE=C; export LC_CTYPE; }
+(set +x; test -n "`(LANGUAGE=C; export LANGUAGE) 2>&1`") &&
+    { $as_unset LANGUAGE || test "${LANGUAGE+set}" != set; } ||
+      { LANGUAGE=C; export LANGUAGE; }
+(set +x; test -n "`(LC_COLLATE=C; export LC_COLLATE) 2>&1`") &&
+    { $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set; } ||
+      { LC_COLLATE=C; export LC_COLLATE; }
+(set +x; test -n "`(LC_NUMERIC=C; export LC_NUMERIC) 2>&1`") &&
+    { $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set; } ||
+      { LC_NUMERIC=C; export LC_NUMERIC; }
+(set +x; test -n "`(LC_MESSAGES=C; export LC_MESSAGES) 2>&1`") &&
+    { $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set; } ||
+      { LC_MESSAGES=C; export LC_MESSAGES; }
+
+
+# Name of the executable.
+as_me=`(basename "$0") 2>/dev/null ||
+$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" >conftest.sh
+  echo  "exit 0"   >>conftest.sh
+  chmod +x conftest.sh
+  if (PATH=".;."; conftest.sh) >/dev/null 2>&1; then
+    PATH_SEPARATOR=';'
+  else
+    PATH_SEPARATOR=:
+  fi
+  rm -f conftest.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
+	     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
+
+if expr a : '\(a\)' >/dev/null 2>&1; then
+  as_expr=expr
+else
+  as_expr=false
+fi
+
+rm -f conf$$ conf$$.exe conf$$.file
+echo >conf$$.file
+if ln -s conf$$.file conf$$ 2>/dev/null; then
+  # We could just check for DJGPP; but this test a) works b) is more generic
+  # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
+  if test -f conf$$.exe; then
+    # Don't use ln at all; we don't have any links
+    as_ln_s='cp -p'
+  else
+    as_ln_s='ln -s'
+  fi
+elif ln conf$$.file conf$$ 2>/dev/null; then
+  as_ln_s=ln
+else
+  as_ln_s='cp -p'
+fi
+rm -f conf$$ conf$$.exe conf$$.file
+
+as_executable_p="test -f"
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="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 || test "${CDPATH+set}" != set || { CDPATH=$PATH_SEPARATOR; export CDPATH; }
+
+
+# Name of the host.
+# hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
+# so uname gets run too.
+ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
+
+exec 6>&1
+
+#
+# Initializations.
+#
+ac_default_prefix=/usr/local
+cross_compiling=no
+subdirs=
+MFLAGS=
+MAKEFLAGS=
+SHELL=${CONFIG_SHELL-/bin/sh}
+
+# Maximum number of lines to put in a shell here document.
+# This variable seems obsolete.  It should probably be removed, and
+# only ac_max_sed_lines should be used.
+: ${ac_max_here_lines=38}
+
+# Identity of this package.
+PACKAGE_NAME=
+PACKAGE_TARNAME=
+PACKAGE_VERSION=
+PACKAGE_STRING=
+PACKAGE_BUGREPORT=
+
+ac_unique_file="aprsshm.h"
+ac_default_prefix=/usr
+# 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"
+
+
+# Initialize some variables set by options.
+ac_init_help=
+ac_init_version=false
+# The variables have the same names as the options, with
+# dashes changed to underlines.
+cache_file=/dev/null
+exec_prefix=NONE
+no_create=
+no_recursion=
+prefix=NONE
+program_prefix=NONE
+program_suffix=NONE
+program_transform_name=s,x,x,
+silent=
+site=
+srcdir=
+verbose=
+x_includes=NONE
+x_libraries=NONE
+
+# Installation directory options.
+# These are left unexpanded so users can "make install exec_prefix=/foo"
+# and all the variables that are supposed to be based on exec_prefix
+# by default will actually change.
+# Use braces instead of parens because sh, perl, etc. also accept them.
+bindir='${exec_prefix}/bin'
+sbindir='${exec_prefix}/sbin'
+libexecdir='${exec_prefix}/libexec'
+datadir='${prefix}/share'
+sysconfdir='${prefix}/etc'
+sharedstatedir='${prefix}/com'
+localstatedir='${prefix}/var'
+libdir='${exec_prefix}/lib'
+includedir='${prefix}/include'
+oldincludedir='/usr/include'
+infodir='${prefix}/info'
+mandir='${prefix}/man'
+
+ac_prev=
+for ac_option
+do
+  # If the previous option needs an argument, assign it.
+  if test -n "$ac_prev"; then
+    eval "$ac_prev=\$ac_option"
+    ac_prev=
+    continue
+  fi
+
+  ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'`
+
+  # Accept the important Cygnus configure options, so we can diagnose typos.
+
+  case $ac_option in
+
+  -bindir | --bindir | --bindi | --bind | --bin | --bi)
+    ac_prev=bindir ;;
+  -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
+    bindir=$ac_optarg ;;
+
+  -build | --build | --buil | --bui | --bu)
+    ac_prev=build_alias ;;
+  -build=* | --build=* | --buil=* | --bui=* | --bu=*)
+    build_alias=$ac_optarg ;;
+
+  -cache-file | --cache-file | --cache-fil | --cache-fi \
+  | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
+    ac_prev=cache_file ;;
+  -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
+  | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
+    cache_file=$ac_optarg ;;
+
+  --config-cache | -C)
+    cache_file=config.cache ;;
+
+  -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
+    ac_prev=datadir ;;
+  -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
+  | --da=*)
+    datadir=$ac_optarg ;;
+
+  -disable-* | --disable-*)
+    ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+      { echo "$as_me: error: invalid feature name: $ac_feature" >&2
+   { (exit 1); exit 1; }; }
+    ac_feature=`echo $ac_feature | sed 's/-/_/g'`
+    eval "enable_$ac_feature=no" ;;
+
+  -enable-* | --enable-*)
+    ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+      { echo "$as_me: error: invalid feature name: $ac_feature" >&2
+   { (exit 1); exit 1; }; }
+    ac_feature=`echo $ac_feature | sed 's/-/_/g'`
+    case $ac_option in
+      *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
+      *) ac_optarg=yes ;;
+    esac
+    eval "enable_$ac_feature='$ac_optarg'" ;;
+
+  -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
+  | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
+  | --exec | --exe | --ex)
+    ac_prev=exec_prefix ;;
+  -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
+  | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
+  | --exec=* | --exe=* | --ex=*)
+    exec_prefix=$ac_optarg ;;
+
+  -gas | --gas | --ga | --g)
+    # Obsolete; use --with-gas.
+    with_gas=yes ;;
+
+  -help | --help | --hel | --he | -h)
+    ac_init_help=long ;;
+  -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
+    ac_init_help=recursive ;;
+  -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
+    ac_init_help=short ;;
+
+  -host | --host | --hos | --ho)
+    ac_prev=host_alias ;;
+  -host=* | --host=* | --hos=* | --ho=*)
+    host_alias=$ac_optarg ;;
+
+  -includedir | --includedir | --includedi | --included | --include \
+  | --includ | --inclu | --incl | --inc)
+    ac_prev=includedir ;;
+  -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
+  | --includ=* | --inclu=* | --incl=* | --inc=*)
+    includedir=$ac_optarg ;;
+
+  -infodir | --infodir | --infodi | --infod | --info | --inf)
+    ac_prev=infodir ;;
+  -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
+    infodir=$ac_optarg ;;
+
+  -libdir | --libdir | --libdi | --libd)
+    ac_prev=libdir ;;
+  -libdir=* | --libdir=* | --libdi=* | --libd=*)
+    libdir=$ac_optarg ;;
+
+  -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
+  | --libexe | --libex | --libe)
+    ac_prev=libexecdir ;;
+  -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
+  | --libexe=* | --libex=* | --libe=*)
+    libexecdir=$ac_optarg ;;
+
+  -localstatedir | --localstatedir | --localstatedi | --localstated \
+  | --localstate | --localstat | --localsta | --localst \
+  | --locals | --local | --loca | --loc | --lo)
+    ac_prev=localstatedir ;;
+  -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
+  | --localstate=* | --localstat=* | --localsta=* | --localst=* \
+  | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
+    localstatedir=$ac_optarg ;;
+
+  -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
+    ac_prev=mandir ;;
+  -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
+    mandir=$ac_optarg ;;
+
+  -nfp | --nfp | --nf)
+    # Obsolete; use --without-fp.
+    with_fp=no ;;
+
+  -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+  | --no-cr | --no-c | -n)
+    no_create=yes ;;
+
+  -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+  | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
+    no_recursion=yes ;;
+
+  -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
+  | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
+  | --oldin | --oldi | --old | --ol | --o)
+    ac_prev=oldincludedir ;;
+  -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
+  | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
+  | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
+    oldincludedir=$ac_optarg ;;
+
+  -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
+    ac_prev=prefix ;;
+  -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
+    prefix=$ac_optarg ;;
+
+  -program-prefix | --program-prefix | --program-prefi | --program-pref \
+  | --program-pre | --program-pr | --program-p)
+    ac_prev=program_prefix ;;
+  -program-prefix=* | --program-prefix=* | --program-prefi=* \
+  | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
+    program_prefix=$ac_optarg ;;
+
+  -program-suffix | --program-suffix | --program-suffi | --program-suff \
+  | --program-suf | --program-su | --program-s)
+    ac_prev=program_suffix ;;
+  -program-suffix=* | --program-suffix=* | --program-suffi=* \
+  | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
+    program_suffix=$ac_optarg ;;
+
+  -program-transform-name | --program-transform-name \
+  | --program-transform-nam | --program-transform-na \
+  | --program-transform-n | --program-transform- \
+  | --program-transform | --program-transfor \
+  | --program-transfo | --program-transf \
+  | --program-trans | --program-tran \
+  | --progr-tra | --program-tr | --program-t)
+    ac_prev=program_transform_name ;;
+  -program-transform-name=* | --program-transform-name=* \
+  | --program-transform-nam=* | --program-transform-na=* \
+  | --program-transform-n=* | --program-transform-=* \
+  | --program-transform=* | --program-transfor=* \
+  | --program-transfo=* | --program-transf=* \
+  | --program-trans=* | --program-tran=* \
+  | --progr-tra=* | --program-tr=* | --program-t=*)
+    program_transform_name=$ac_optarg ;;
+
+  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+  | -silent | --silent | --silen | --sile | --sil)
+    silent=yes ;;
+
+  -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
+    ac_prev=sbindir ;;
+  -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
+  | --sbi=* | --sb=*)
+    sbindir=$ac_optarg ;;
+
+  -sharedstatedir | --sharedstatedir | --sharedstatedi \
+  | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
+  | --sharedst | --shareds | --shared | --share | --shar \
+  | --sha | --sh)
+    ac_prev=sharedstatedir ;;
+  -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
+  | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
+  | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
+  | --sha=* | --sh=*)
+    sharedstatedir=$ac_optarg ;;
+
+  -site | --site | --sit)
+    ac_prev=site ;;
+  -site=* | --site=* | --sit=*)
+    site=$ac_optarg ;;
+
+  -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
+    ac_prev=srcdir ;;
+  -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
+    srcdir=$ac_optarg ;;
+
+  -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
+  | --syscon | --sysco | --sysc | --sys | --sy)
+    ac_prev=sysconfdir ;;
+  -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
+  | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
+    sysconfdir=$ac_optarg ;;
+
+  -target | --target | --targe | --targ | --tar | --ta | --t)
+    ac_prev=target_alias ;;
+  -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
+    target_alias=$ac_optarg ;;
+
+  -v | -verbose | --verbose | --verbos | --verbo | --verb)
+    verbose=yes ;;
+
+  -version | --version | --versio | --versi | --vers | -V)
+    ac_init_version=: ;;
+
+  -with-* | --with-*)
+    ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+      { echo "$as_me: error: invalid package name: $ac_package" >&2
+   { (exit 1); exit 1; }; }
+    ac_package=`echo $ac_package| sed 's/-/_/g'`
+    case $ac_option in
+      *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
+      *) ac_optarg=yes ;;
+    esac
+    eval "with_$ac_package='$ac_optarg'" ;;
+
+  -without-* | --without-*)
+    ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+      { echo "$as_me: error: invalid package name: $ac_package" >&2
+   { (exit 1); exit 1; }; }
+    ac_package=`echo $ac_package | sed 's/-/_/g'`
+    eval "with_$ac_package=no" ;;
+
+  --x)
+    # Obsolete; use --with-x.
+    with_x=yes ;;
+
+  -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
+  | --x-incl | --x-inc | --x-in | --x-i)
+    ac_prev=x_includes ;;
+  -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
+  | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
+    x_includes=$ac_optarg ;;
+
+  -x-libraries | --x-libraries | --x-librarie | --x-librari \
+  | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
+    ac_prev=x_libraries ;;
+  -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
+  | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
+    x_libraries=$ac_optarg ;;
+
+  -*) { echo "$as_me: error: unrecognized option: $ac_option
+Try \`$0 --help' for more information." >&2
+   { (exit 1); exit 1; }; }
+    ;;
+
+  *=*)
+    ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
+      { echo "$as_me: error: invalid variable name: $ac_envvar" >&2
+   { (exit 1); exit 1; }; }
+    ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`
+    eval "$ac_envvar='$ac_optarg'"
+    export $ac_envvar ;;
+
+  *)
+    # FIXME: should be removed in autoconf 3.0.
+    echo "$as_me: WARNING: you should use --build, --host, --target" >&2
+    expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
+      echo "$as_me: WARNING: invalid host type: $ac_option" >&2
+    : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
+    ;;
+
+  esac
+done
+
+if test -n "$ac_prev"; then
+  ac_option=--`echo $ac_prev | sed 's/_/-/g'`
+  { echo "$as_me: error: missing argument to $ac_option" >&2
+   { (exit 1); exit 1; }; }
+fi
+
+# Be sure to have absolute paths.
+for ac_var in exec_prefix prefix
+do
+  eval ac_val=$`echo $ac_var`
+  case $ac_val in
+    [\\/$]* | ?:[\\/]* | NONE | '' ) ;;
+    *)  { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
+   { (exit 1); exit 1; }; };;
+  esac
+done
+
+# Be sure to have absolute paths.
+for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \
+              localstatedir libdir includedir oldincludedir infodir mandir
+do
+  eval ac_val=$`echo $ac_var`
+  case $ac_val in
+    [\\/$]* | ?:[\\/]* ) ;;
+    *)  { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
+   { (exit 1); exit 1; }; };;
+  esac
+done
+
+# There might be people who depend on the old broken behavior: `$host'
+# used to hold the argument of --host etc.
+# 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
+
+ac_tool_prefix=
+test -n "$host_alias" && ac_tool_prefix=$host_alias-
+
+test "$silent" = yes && exec 6>/dev/null
+
+
+# Find the source files, if location was not specified.
+if test -z "$srcdir"; then
+  ac_srcdir_defaulted=yes
+  # Try the directory containing this script, then its parent.
+  ac_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=..
+  fi
+else
+  ac_srcdir_defaulted=no
+fi
+if test ! -r $srcdir/$ac_unique_file; then
+  if test "$ac_srcdir_defaulted" = yes; then
+    { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2
+   { (exit 1); exit 1; }; }
+  else
+    { 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%'`
+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
+  --disable-shm           Do not use shared memory
+
+Optional Packages:
+  --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
+  --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
+  --with-ax25inc=path     Location of ax25 include files if other than <ax25/>
+
+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
+# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be
+# absolute.
+ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd`
+ac_abs_top_builddir=`cd "$ac_dir" && cd $ac_top_builddir && pwd`
+ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd`
+ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd`
+
+    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 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002
+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.53.  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.
+# Also quote any args containing shell meta-characters.
+ac_configure_args=
+ac_sep=
+for ac_arg
+do
+  case $ac_arg in
+  -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+  | --no-cr | --no-c | -n ) continue ;;
+  -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+  | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
+    continue ;;
+  *" "*|*"	"*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
+    ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
+  esac
+  case " $ac_configure_args " in
+    *" '$ac_arg' "*) ;; # Avoid dups.  Use of quotes ensures accuracy.
+    *) ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'"
+       ac_sep=" " ;;
+  esac
+  # Get rid of the leading space.
+done
+
+# When interrupted or exit'd, cleanup temporary files, and complete
+# config.log.  We remove comments because anyway the quotes in there
+# would cause problems or look ugly.
+# 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
+    if test -s confdefs.h; then
+      cat <<\_ASBOX
+## ----------- ##
+## confdefs.h. ##
+## ----------- ##
+_ASBOX
+      echo
+      sed "/^$/d" confdefs.h
+      echo
+    fi
+    test "$ac_signal" != 0 &&
+      echo "$as_me: caught signal $ac_signal"
+    echo "$as_me: exit $exit_status"
+  } >&5
+  rm -f core 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
+    CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
+  else
+    CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
+  fi
+fi
+for ac_site_file in $CONFIG_SITE; do
+  if test -r "$ac_site_file"; then
+    { echo "$as_me:$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
+  # 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 "$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
+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
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+am__api_version="1.6"
+ac_aux_dir=
+for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
+  if test -f $ac_dir/install-sh; then
+    ac_aux_dir=$ac_dir
+    ac_install_sh="$ac_aux_dir/install-sh -c"
+    break
+  elif test -f $ac_dir/install.sh; then
+    ac_aux_dir=$ac_dir
+    ac_install_sh="$ac_aux_dir/install.sh -c"
+    break
+  elif test -f $ac_dir/shtool; then
+    ac_aux_dir=$ac_dir
+    ac_install_sh="$ac_aux_dir/shtool install -c"
+    break
+  fi
+done
+if test -z "$ac_aux_dir"; then
+  { { echo "$as_me:$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="$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
+# incompatible versions:
+# SysV /etc/install, /usr/sbin/install
+# SunOS /usr/etc/install
+# IRIX /sbin/install
+# AIX /bin/install
+# AmigaOS /C/install, which installs bootblocks on floppy discs
+# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
+# AFS /usr/afsws/bin/install, which mishandles nonexistent args
+# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
+# ./install, which can be erroneously created by make from ./install.sh.
+echo "$as_me:$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 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/* | \
+  /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 "$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="$as_dir/$ac_prog$ac_exec_ext -c"
+            break 3
+          fi
+        fi
+      done
+    done
+    ;;
+esac
+done
+
+
+fi
+  if test "${ac_cv_path_install+set}" = set; then
+    INSTALL=$ac_cv_path_install
+  else
+    # As a last resort, use the slow shell script.  We don't cache a
+    # path for INSTALL within a source directory, because that will
+    # break other packages using the cache if that directory is
+    # removed, or if the path is relative.
+    INSTALL=$ac_install_sh
+  fi
+fi
+echo "$as_me:$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}'
+
+test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
+
+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 > 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 conftest.file 2> /dev/null`
+   if test "$*" = "X"; then
+      # -L didn't work.
+      set X `ls -t $srcdir/configure conftest.file`
+   fi
+   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 "$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" = conftest.file
+   )
+then
+   # Ok.
+   :
+else
+   { { 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"
+# Use a double $ so make ignores it.
+test "$program_suffix" != NONE &&
+  program_transform_name="s,\$,$program_suffix,;$program_transform_name"
+# Double any \ or $.  echo might interpret backslashes.
+# By default was `s,x,x', remove it if useless.
+cat <<\_ACEOF >conftest.sed
+s/[\\$]/&&/g;s/;s,x,x,$//
+_ACEOF
+program_transform_name=`echo $program_transform_name | sed -f conftest.sed`
+rm conftest.sed
+
+
+# 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
+
+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
+
+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 "$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 >conftest.make <<\_ACEOF
+all:
+	@echo 'ac_maketemp="${MAKE}"'
+_ACEOF
+# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
+eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=`
+if test -n "$ac_maketemp"; then
+  eval ac_cv_prog_make_${ac_make}_set=yes
+else
+  eval ac_cv_prog_make_${ac_make}_set=no
+fi
+rm -f conftest.make
+fi
+if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
+  echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+  SET_MAKE=
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+  SET_MAKE="MAKE=${MAKE-make}"
+fi
+
+ # 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
+
+# Define the identity of the package.
+ PACKAGE=aprsdigi
+ VERSION=2.4.4
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE "$PACKAGE"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define VERSION "$VERSION"
+_ACEOF
+
+# Some tools Automake needs.
+
+ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"}
+
+
+AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"}
+
+
+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"}
+
+# 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
+  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
+
+  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
+
+  STRIP=$ac_ct_STRIP
+else
+  STRIP="$ac_cv_prog_STRIP"
+fi
+
+fi
+INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
+
+# We need awk for the "check" target.  The system "awk" is bad on
+# some platforms.
+
+
+
+
+
+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 "$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
+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
+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 "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 "$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
+  ac_prog_rejected=no
+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 $# != 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 "$as_dir/$ac_word" ${1+"$@"}
+    shift
+    ac_cv_prog_CC="$@"
+  fi
+fi
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  echo "$as_me:$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 "$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
+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
+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
+
+    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
+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
+
+  test -n "$ac_ct_CC" && break
+done
+
+  CC=$ac_ct_CC
+fi
+
+fi
+
+
+test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH" >&5
+echo "$as_me: error: no acceptable C compiler found in \$PATH" >&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
+#line $LINENO "configure"
+#include "confdefs.h"
+
+#ifdef F77_DUMMY_MAIN
+#  ifdef __cplusplus
+     extern "C"
+#  endif
+   int F77_DUMMY_MAIN() { return 1; }
+#endif
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files a.out a.exe"
+# Try to create an executable without -o first, disregard a.out.
+# It will help us diagnose broken compilers, and finding out an intuition
+# of exeext.
+echo "$as_me:$LINENO: checking for C compiler default output" >&5
+echo $ECHO_N "checking for C compiler default output... $ECHO_C" >&6
+ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
+if { (eval echo "$as_me:$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=
+for ac_file in `ls a_out.exe a.exe conftest.exe 2>/dev/null;
+                ls a.out conftest 2>/dev/null;
+                ls a.* conftest.* 2>/dev/null`; do
+  case $ac_file in
+    *.$ac_ext | *.o | *.obj | *.xcoff | *.tds | *.d | *.pdb | *.xSYM ) ;;
+    a.out ) # We found the default executable, but exeext='' is most
+            # certainly right.
+            break;;
+    *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+          # FIXME: I believe we export ac_cv_exeext for Libtool --akim.
+          export ac_cv_exeext
+          break;;
+    * ) break;;
+  esac
+done
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+{ { echo "$as_me:$LINENO: error: C compiler cannot create executables" >&5
+echo "$as_me: error: C compiler cannot create executables" >&2;}
+   { (exit 77); exit 77; }; }
+fi
+
+ac_exeext=$ac_cv_exeext
+echo "$as_me:$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
+    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'." >&5
+echo "$as_me: error: cannot run C compiled programs.
+If you meant to cross compile, use \`--host'." >&2;}
+   { (exit 1); exit 1; }; }
+    fi
+  fi
+fi
+echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+
+rm -f a.out a.exe conftest$ac_cv_exeext
+ac_clean_files=$ac_clean_files_save
+# Check the compiler produces executables we can run.  If not, either
+# the compiler is broken, or we cross compile.
+echo "$as_me:$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 `(ls conftest.exe; ls conftest; ls conftest.*) 2>/dev/null`; do
+  case $ac_file in
+    *.$ac_ext | *.o | *.obj | *.xcoff | *.tds | *.d | *.pdb ) ;;
+    *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+          export ac_cv_exeext
+          break;;
+    * ) break;;
+  esac
+done
+else
+  { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link" >&5
+echo "$as_me: error: cannot compute suffix of executables: cannot compile and link" >&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
+#line $LINENO "configure"
+#include "confdefs.h"
+
+#ifdef F77_DUMMY_MAIN
+#  ifdef __cplusplus
+     extern "C"
+#  endif
+   int F77_DUMMY_MAIN() { return 1; }
+#endif
+int
+main ()
+{
+
+  ;
+  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 ) ;;
+    *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
+       break;;
+  esac
+done
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile" >&5
+echo "$as_me: error: cannot compute suffix of object files: cannot compile" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+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
+  cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+#include "confdefs.h"
+
+#ifdef F77_DUMMY_MAIN
+#  ifdef __cplusplus
+     extern "C"
+#  endif
+   int F77_DUMMY_MAIN() { return 1; }
+#endif
+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>&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
+cat conftest.$ac_ext >&5
+ac_compiler_gnu=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+ac_cv_c_compiler_gnu=$ac_compiler_gnu
+
+fi
+echo "$as_me:$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
+#line $LINENO "configure"
+#include "confdefs.h"
+
+#ifdef F77_DUMMY_MAIN
+#  ifdef __cplusplus
+     extern "C"
+#  endif
+   int F77_DUMMY_MAIN() { return 1; }
+#endif
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+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); } &&
+         { 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
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_prog_cc_g=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$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
+elif test $ac_cv_prog_cc_g = yes; then
+  if test "$GCC" = yes; then
+    CFLAGS="-g -O2"
+  else
+    CFLAGS="-g"
+  fi
+else
+  if test "$GCC" = yes; then
+    CFLAGS="-O2"
+  else
+    CFLAGS=
+  fi
+fi
+# Some people use a C++ compiler to compile C.  Since we use `exit',
+# in C++ we need to declare it.  In case someone uses the same compiler
+# for both compiling C and C++ we need to have the C++ compiler decide
+# the declaration of exit, since it's the most demanding environment.
+cat >conftest.$ac_ext <<_ACEOF
+#ifndef __cplusplus
+  choke me
+#endif
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 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 \
+   ''\
+   '#include <stdlib.h>' \
+   'extern "C" void std::exit (int) throw (); using std::exit;' \
+   'extern "C" void std::exit (int); using std::exit;' \
+   'extern "C" void exit (int) throw ();' \
+   'extern "C" void exit (int);' \
+   'void exit (int);'
+do
+  cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+#include "confdefs.h"
+#include <stdlib.h>
+$ac_declaration
+#ifdef F77_DUMMY_MAIN
+#  ifdef __cplusplus
+     extern "C"
+#  endif
+   int F77_DUMMY_MAIN() { return 1; }
+#endif
+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>&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 "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+continue
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+  cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+#include "confdefs.h"
+$ac_declaration
+#ifdef F77_DUMMY_MAIN
+#  ifdef __cplusplus
+     extern "C"
+#  endif
+   int F77_DUMMY_MAIN() { return 1; }
+#endif
+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>&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
+cat conftest.$ac_ext >&5
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+done
+rm -f conftest*
+if test -n "$ac_declaration"; then
+  echo '#ifdef __cplusplus' >>confdefs.h
+  echo $ac_declaration      >>confdefs.h
+  echo '#endif'             >>confdefs.h
+fi
+
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+rm -f .deps 2>/dev/null
+mkdir .deps 2>/dev/null
+if test -d .deps; then
+  DEPDIR=.deps
+else
+  # MS-DOS does not allow filenames that begin with a dot.
+  DEPDIR=_deps
+fi
+rmdir .deps 2>/dev/null
+
+
+ac_config_commands="$ac_config_commands depfiles"
+
+
+am_make=${MAKE-make}
+cat > confinc << 'END'
+doit:
+	@echo done
+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 | fgrep -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 "x$enable_dependency_tracking" != xno; then
+  AMDEP_TRUE=
+  AMDEP_FALSE='#'
+else
+  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
+
+  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
+    # 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.
+    echo '#include "conftest.h"' > conftest.c
+    echo 'int i;' > conftest.h
+    echo "${am__include} ${am__quote}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=conftest.c object=conftest.o \
+       depfile=conftest.Po tmpdepfile=conftest.TPo \
+       $SHELL ./depcomp $depcc -c conftest.c -o conftest.o >/dev/null 2>&1 &&
+       grep conftest.h conftest.Po > /dev/null 2>&1 &&
+       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+      am_cv_CC_dependencies_compiler_type=$depmode
+      break
+    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 -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ranlib; 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_RANLIB+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$RANLIB"; then
+  ac_cv_prog_RANLIB="$RANLIB" # 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_RANLIB="${ac_tool_prefix}ranlib"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+fi
+fi
+RANLIB=$ac_cv_prog_RANLIB
+if test -n "$RANLIB"; then
+  echo "$as_me:$LINENO: result: $RANLIB" >&5
+echo "${ECHO_T}$RANLIB" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$ac_cv_prog_RANLIB"; then
+  ac_ct_RANLIB=$RANLIB
+  # Extract the first word of "ranlib", so it can be a program name with args.
+set dummy ranlib; 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_RANLIB+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$ac_ct_RANLIB"; then
+  ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # 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_RANLIB="ranlib"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+  test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB=":"
+fi
+fi
+ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
+if test -n "$ac_ct_RANLIB"; then
+  echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5
+echo "${ECHO_T}$ac_ct_RANLIB" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+  RANLIB=$ac_ct_RANLIB
+else
+  RANLIB="$ac_cv_prog_RANLIB"
+fi
+
+# Find a good install program.  We prefer a C program (faster),
+# so one script is as good as another.  But avoid the broken or
+# incompatible versions:
+# SysV /etc/install, /usr/sbin/install
+# SunOS /usr/etc/install
+# IRIX /sbin/install
+# AIX /bin/install
+# AmigaOS /C/install, which installs bootblocks on floppy discs
+# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
+# AFS /usr/afsws/bin/install, which mishandles nonexistent args
+# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
+# ./install, which can be erroneously created by make from ./install.sh.
+echo "$as_me:$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 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/* | \
+  /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 "$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="$as_dir/$ac_prog$ac_exec_ext -c"
+            break 3
+          fi
+        fi
+      done
+    done
+    ;;
+esac
+done
+
+
+fi
+  if test "${ac_cv_path_install+set}" = set; then
+    INSTALL=$ac_cv_path_install
+  else
+    # As a last resort, use the slow shell script.  We don't cache a
+    # path for INSTALL within a source directory, because that will
+    # break other packages using the cache if that directory is
+    # removed, or if the path is relative.
+    INSTALL=$ac_install_sh
+  fi
+fi
+echo "$as_me:$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}'
+
+test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
+
+# Extract the first word of "man2html", so it can be a program name with args.
+set dummy man2html; 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_path_MAN2HTML+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  case $MAN2HTML in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_MAN2HTML="$MAN2HTML" # Let the user override the test with a path.
+  ;;
+  *)
+  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_MAN2HTML="$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_MAN2HTML" && ac_cv_path_MAN2HTML=".:$PATH"
+  ;;
+esac
+fi
+MAN2HTML=$ac_cv_path_MAN2HTML
+
+if test -n "$MAN2HTML"; then
+  echo "$as_me:$LINENO: result: $MAN2HTML" >&5
+echo "${ECHO_T}$MAN2HTML" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+
+{ echo "$as_me:$LINENO: checking for N2YGK's -lax25 extensions:..." >&5
+echo "$as_me: checking for N2YGK's -lax25 extensions:..." >&6;}
+
+echo "$as_me:$LINENO: checking for parse_raw_ax25 in -lax25" >&5
+echo $ECHO_N "checking for parse_raw_ax25 in -lax25... $ECHO_C" >&6
+if test "${ac_cv_lib_ax25_parse_raw_ax25+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lax25  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+#include "confdefs.h"
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char parse_raw_ax25 ();
+#ifdef F77_DUMMY_MAIN
+#  ifdef __cplusplus
+     extern "C"
+#  endif
+   int F77_DUMMY_MAIN() { return 1; }
+#endif
+int
+main ()
+{
+parse_raw_ax25 ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext 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='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
+  ac_cv_lib_ax25_parse_raw_ax25=yes
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_lib_ax25_parse_raw_ax25=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_ax25_parse_raw_ax25" >&5
+echo "${ECHO_T}$ac_cv_lib_ax25_parse_raw_ax25" >&6
+if test $ac_cv_lib_ax25_parse_raw_ax25 = yes; then
+  cat >>confdefs.h <<\_ACEOF
+#define HAVE_LIBAX25_EXTENSIONS 1
+_ACEOF
+
+fi
+
+
+echo "$as_me:$LINENO: checking for ax25_config_load_ports in -lax25" >&5
+echo $ECHO_N "checking for ax25_config_load_ports in -lax25... $ECHO_C" >&6
+if test "${ac_cv_lib_ax25_ax25_config_load_ports+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lax25  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+#include "confdefs.h"
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char ax25_config_load_ports ();
+#ifdef F77_DUMMY_MAIN
+#  ifdef __cplusplus
+     extern "C"
+#  endif
+   int F77_DUMMY_MAIN() { return 1; }
+#endif
+int
+main ()
+{
+ax25_config_load_ports ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext 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='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
+  ac_cv_lib_ax25_ax25_config_load_ports=yes
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_lib_ax25_ax25_config_load_ports=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_ax25_ax25_config_load_ports" >&5
+echo "${ECHO_T}$ac_cv_lib_ax25_ax25_config_load_ports" >&6
+if test $ac_cv_lib_ax25_ax25_config_load_ports = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBAX25 1
+_ACEOF
+
+  LIBS="-lax25 $LIBS"
+
+fi
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+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 test "${ac_cv_prog_CPP+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+      # Double quotes because CPP needs to be expanded
+    for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
+    do
+      ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+  # Use a header file that comes with gcc, so configuring glibc
+  # with a fresh cross-compiler works.
+  # On the NeXT, cc -E runs the code through the compiler's parser,
+  # not just through cpp. "Syntax error" is here to catch this case.
+  cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+#include "confdefs.h"
+#include <assert.h>
+                     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=$?
+  egrep -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
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  :
+else
+  echo "$as_me: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.$ac_ext
+
+  # OK, works on sane cases.  Now check whether non-existent headers
+  # can be detected and how.
+  cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+#include "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=$?
+  egrep -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
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  # Broken: success on invalid input.
+continue
+else
+  echo "$as_me: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then
+  break
+fi
+
+    done
+    ac_cv_prog_CPP=$CPP
+
+fi
+  CPP=$ac_cv_prog_CPP
+else
+  ac_cv_prog_CPP=$CPP
+fi
+echo "$as_me:$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.
+  # On the NeXT, cc -E runs the code through the compiler's parser,
+  # not just through cpp. "Syntax error" is here to catch this case.
+  cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+#include "confdefs.h"
+#include <assert.h>
+                     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=$?
+  egrep -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
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  :
+else
+  echo "$as_me: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.$ac_ext
+
+  # OK, works on sane cases.  Now check whether non-existent headers
+  # can be detected and how.
+  cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+#include "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=$?
+  egrep -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
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  # Broken: success on invalid input.
+continue
+else
+  echo "$as_me: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then
+  :
+else
+  { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check" >&5
+echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+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
+#line $LINENO "configure"
+#include "confdefs.h"
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <float.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=$?
+  egrep -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
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  ac_cv_header_stdc=yes
+else
+  echo "$as_me: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  ac_cv_header_stdc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+
+if test $ac_cv_header_stdc = yes; then
+  # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
+  cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+#include "confdefs.h"
+#include <string.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  egrep "memchr" >/dev/null 2>&1; then
+  :
+else
+  ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+  # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
+  cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+#include "confdefs.h"
+#include <stdlib.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  egrep "free" >/dev/null 2>&1; then
+  :
+else
+  ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+  # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
+  if test "$cross_compiling" = yes; then
+  :
+else
+  cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+#include "confdefs.h"
+#include <ctype.h>
+#if ((' ' & 0x0FF) == 0x020)
+# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
+# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
+#else
+# define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
+                     || ('j' <= (c) && (c) <= 'r') \
+                     || ('s' <= (c) && (c) <= 'z'))
+# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
+#endif
+
+#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
+int
+main ()
+{
+  int i;
+  for (i = 0; i < 256; i++)
+    if (XOR (islower (i), ISLOWER (i))
+        || toupper (i) != TOUPPER (i))
+      exit(2);
+  exit (0);
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:$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 "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+( exit $ac_status )
+ac_cv_header_stdc=no
+fi
+rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+fi
+fi
+echo "$as_me:$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 <<\_ACEOF
+#define STDC_HEADERS 1
+_ACEOF
+
+fi
+
+echo "$as_me:$LINENO: checking for sys/wait.h that is POSIX.1 compatible" >&5
+echo $ECHO_N "checking for sys/wait.h that is POSIX.1 compatible... $ECHO_C" >&6
+if test "${ac_cv_header_sys_wait_h+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+#include "confdefs.h"
+#include <sys/types.h>
+#include <sys/wait.h>
+#ifndef WEXITSTATUS
+# define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
+#endif
+#ifndef WIFEXITED
+# define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
+#endif
+
+#ifdef F77_DUMMY_MAIN
+#  ifdef __cplusplus
+     extern "C"
+#  endif
+   int F77_DUMMY_MAIN() { return 1; }
+#endif
+int
+main ()
+{
+  int s;
+  wait (&s);
+  s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+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); } &&
+         { 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_sys_wait_h=yes
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_header_sys_wait_h=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_header_sys_wait_h" >&5
+echo "${ECHO_T}$ac_cv_header_sys_wait_h" >&6
+if test $ac_cv_header_sys_wait_h = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_SYS_WAIT_H 1
+_ACEOF
+
+fi
+
+# 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
+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
+#line $LINENO "configure"
+#include "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>&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
+cat conftest.$ac_ext >&5
+eval "$as_ac_Header=no"
+fi
+rm -f 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
+
+
+
+
+
+
+
+
+for ac_header in fcntl.h limits.h sys/ioctl.h sys/time.h unistd.h ax25/axconfig.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
+#line $LINENO "configure"
+#include "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>&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
+cat conftest.$ac_ext >&5
+ac_header_compiler=no
+fi
+rm -f 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
+#line $LINENO "configure"
+#include "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=$?
+  egrep -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
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  ac_header_preproc=yes
+else
+  echo "$as_me: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  ac_header_preproc=no
+fi
+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 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 preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;};;
+  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: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&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
+  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
+
+
+if test "$ac_cv_header_ax25_axconfig_h" = yes ; then
+	CPPFLAGS="$CPPFLAGS -I/usr/include/ax25"
+fi
+
+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
+#line $LINENO "configure"
+#include "confdefs.h"
+#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;
+#ifdef F77_DUMMY_MAIN
+#  ifdef __cplusplus
+     extern "C"
+#  endif
+   int F77_DUMMY_MAIN() { return 1; }
+#endif
+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>&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
+cat conftest.$ac_ext >&5
+fi
+rm -f conftest.$ac_objext
+done
+rm -f conftest.$ac_ext conftest.$ac_objext
+CC=$ac_save_CC
+
+fi
+
+case "x$ac_cv_prog_cc_stdc" in
+  x|xno)
+    echo "$as_me:$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
+
+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
+#line $LINENO "configure"
+#include "confdefs.h"
+
+#ifdef F77_DUMMY_MAIN
+#  ifdef __cplusplus
+     extern "C"
+#  endif
+   int F77_DUMMY_MAIN() { return 1; }
+#endif
+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>&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 "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_c_const=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$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 <<\_ACEOF
+#define const
+_ACEOF
+
+fi
+
+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
+#line $LINENO "configure"
+#include "confdefs.h"
+$ac_includes_default
+#ifdef F77_DUMMY_MAIN
+#  ifdef __cplusplus
+     extern "C"
+#  endif
+   int F77_DUMMY_MAIN() { return 1; }
+#endif
+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>&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
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_type_size_t=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+fi
+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
+_ACEOF
+
+fi
+
+echo "$as_me:$LINENO: checking whether struct tm is in sys/time.h or time.h" >&5
+echo $ECHO_N "checking whether struct tm is in sys/time.h or time.h... $ECHO_C" >&6
+if test "${ac_cv_struct_tm+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+#include "confdefs.h"
+#include <sys/types.h>
+#include <time.h>
+
+#ifdef F77_DUMMY_MAIN
+#  ifdef __cplusplus
+     extern "C"
+#  endif
+   int F77_DUMMY_MAIN() { return 1; }
+#endif
+int
+main ()
+{
+struct tm *tp; tp->tm_sec;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+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); } &&
+         { 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_struct_tm=time.h
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_struct_tm=sys/time.h
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_struct_tm" >&5
+echo "${ECHO_T}$ac_cv_struct_tm" >&6
+if test $ac_cv_struct_tm = sys/time.h; then
+
+cat >>confdefs.h <<\_ACEOF
+#define TM_IN_SYS_TIME 1
+_ACEOF
+
+fi
+
+{ echo "$as_me:$LINENO: checking for IPv6..." >&5
+echo "$as_me: checking for IPv6..." >&6;}
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+#include "confdefs.h"
+#include <sys/types.h>
+    	 #include <sys/socket.h>
+	 #include <netinet/in.h>
+	 #include <netinet/tcp.h>
+
+#ifdef F77_DUMMY_MAIN
+#  ifdef __cplusplus
+     extern "C"
+#  endif
+   int F77_DUMMY_MAIN() { return 1; }
+#endif
+int
+main ()
+{
+struct sockaddr_storage sa_union, *sa_unionp;
+  	 struct sockaddr_in6 *sa;
+  	 sa_unionp = &sa_union;
+  	 sa = (struct sockaddr_in6 *)sa_unionp;
+  	 sa->sin6_port = ntohs(5001);
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+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); } &&
+         { 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_accept_ipv6=yes
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_accept_ipv6=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+if test "$ac_accept_ipv6" = yes ; then
+ 	cat >>confdefs.h <<\_ACEOF
+#define IPV6 1
+_ACEOF
+
+fi
+
+if test $ac_cv_c_compiler_gnu = yes; then
+    echo "$as_me:$LINENO: checking whether $CC needs -traditional" >&5
+echo $ECHO_N "checking whether $CC needs -traditional... $ECHO_C" >&6
+if test "${ac_cv_prog_gcc_traditional+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+    ac_pattern="Autoconf.*'x'"
+  cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+#include "confdefs.h"
+#include <sgtty.h>
+Autoconf TIOCGETP
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  egrep "$ac_pattern" >/dev/null 2>&1; then
+  ac_cv_prog_gcc_traditional=yes
+else
+  ac_cv_prog_gcc_traditional=no
+fi
+rm -f conftest*
+
+
+  if test $ac_cv_prog_gcc_traditional = no; then
+    cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+#include "confdefs.h"
+#include <termio.h>
+Autoconf TCGETA
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  egrep "$ac_pattern" >/dev/null 2>&1; then
+  ac_cv_prog_gcc_traditional=yes
+fi
+rm -f conftest*
+
+  fi
+fi
+echo "$as_me:$LINENO: result: $ac_cv_prog_gcc_traditional" >&5
+echo "${ECHO_T}$ac_cv_prog_gcc_traditional" >&6
+  if test $ac_cv_prog_gcc_traditional = yes; then
+    CC="$CC -traditional"
+  fi
+fi
+
+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
+#line $LINENO "configure"
+#include "confdefs.h"
+#include <sys/types.h>
+#include <signal.h>
+#ifdef signal
+# undef signal
+#endif
+#ifdef __cplusplus
+extern "C" void (*signal (int, void (*)(int)))(int);
+#else
+void (*signal ()) ();
+#endif
+
+#ifdef F77_DUMMY_MAIN
+#  ifdef __cplusplus
+     extern "C"
+#  endif
+   int F77_DUMMY_MAIN() { return 1; }
+#endif
+int
+main ()
+{
+int i;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+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); } &&
+         { 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 "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_type_signal=int
+fi
+rm -f 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
+
+cat >>confdefs.h <<_ACEOF
+#define RETSIGTYPE $ac_cv_type_signal
+_ACEOF
+
+
+echo "$as_me:$LINENO: checking for wait3 that fills in rusage" >&5
+echo $ECHO_N "checking for wait3 that fills in rusage... $ECHO_C" >&6
+if test "${ac_cv_func_wait3_rusage+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test "$cross_compiling" = yes; then
+  ac_cv_func_wait3_rusage=no
+else
+  cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+#include "confdefs.h"
+#include <sys/types.h>
+#include <sys/time.h>
+#include <sys/resource.h>
+#include <stdio.h>
+/* HP-UX has wait3 but does not fill in rusage at all.  */
+int
+main ()
+{
+  struct rusage r;
+  int i;
+  /* Use a field that we can force nonzero --
+     voluntary context switches.
+     For systems like NeXT and OSF/1 that don't set it,
+     also use the system CPU time.  And page faults (I/O) for Linux.  */
+  r.ru_nvcsw = 0;
+  r.ru_stime.tv_sec = 0;
+  r.ru_stime.tv_usec = 0;
+  r.ru_majflt = r.ru_minflt = 0;
+  switch (fork ())
+    {
+    case 0: /* Child.  */
+      sleep(1); /* Give up the CPU.  */
+      _exit(0);
+      break;
+    case -1: /* What can we do?  */
+      _exit(0);
+      break;
+    default: /* Parent.  */
+      wait3(&i, 0, &r);
+      /* Avoid "text file busy" from rm on fast HP-UX machines.  */
+      sleep(2);
+      exit (r.ru_nvcsw == 0 && r.ru_majflt == 0 && r.ru_minflt == 0
+	    && r.ru_stime.tv_sec == 0 && r.ru_stime.tv_usec == 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
+  ac_cv_func_wait3_rusage=yes
+else
+  echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+( exit $ac_status )
+ac_cv_func_wait3_rusage=no
+fi
+rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+fi
+echo "$as_me:$LINENO: result: $ac_cv_func_wait3_rusage" >&5
+echo "${ECHO_T}$ac_cv_func_wait3_rusage" >&6
+if test $ac_cv_func_wait3_rusage = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_WAIT3 1
+_ACEOF
+
+fi
+
+
+
+
+
+
+
+for ac_func in select socket strdup strtol uname shmctl
+do
+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
+#line $LINENO "configure"
+#include "confdefs.h"
+/* 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.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char $ac_func ();
+char (*f) ();
+
+#ifdef F77_DUMMY_MAIN
+#  ifdef __cplusplus
+     extern "C"
+#  endif
+   int F77_DUMMY_MAIN() { return 1; }
+#endif
+int
+main ()
+{
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+choke me
+#else
+f = $ac_func;
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 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
+cat conftest.$ac_ext >&5
+eval "$as_ac_var=no"
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$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
+
+fi
+done
+
+
+# Check whether --enable-shm or --disable-shm was given.
+if test "${enable_shm+set}" = set; then
+  enableval="$enable_shm"
+
+fi;
+if test "$enable_shm" != no; then
+  cat >>confdefs.h <<\_ACEOF
+#define USE_SHM 1
+_ACEOF
+
+fi
+
+# Check whether --with-ax25inc or --without-ax25inc was given.
+if test "${with_ax25inc+set}" = set; then
+  withval="$with_ax25inc"
+  CPPFLAGS="$CPPFLAGS -I$with_ax25inc"
+fi;
+
+ac_config_files="$ac_config_files Makefile"
+cat >confcache <<\_ACEOF
+# This file is a shell script that caches the results of configure
+# tests run on this system so they can be shared between configure
+# scripts and configure runs, see configure's option --config-cache.
+# It is not useful on other systems.  If it contains results you don't
+# want to keep, you may remove or edit it.
+#
+# config.status only pays attention to the cache file if you give it
+# the --recheck option to rerun configure.
+#
+# `ac_cv_env_foo' variables (set or unset) will be overriden when
+# loading this file, other *unset* `ac_cv_foo' will be assigned the
+# following values.
+
+_ACEOF
+
+# The following way of writing the cache mishandles newlines in values,
+# but we know of no workaround that is simple, portable, and efficient.
+# So, don't put newlines in cache variables' values.
+# Ultrix sh set writes to stderr and can't be redirected directly,
+# and sets the high bit in the cache file unless we assign to the vars.
+{
+  (set) 2>&1 |
+    case `(ac_space=' '; set | grep ac_space) 2>&1` in
+    *ac_space=\ *)
+      # `set' does not quote correctly, so add quotes (double-quote
+      # substitution turns \\\\ into \\, and sed turns \\ into \).
+      sed -n \
+        "s/'/'\\\\''/g;
+    	  s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
+      ;;
+    *)
+      # `set' quotes correctly as required by POSIX, so do not add quotes.
+      sed -n \
+        "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
+      ;;
+    esac;
+} |
+  sed '
+     t clear
+     : clear
+     s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
+     t end
+     /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
+     : end' >>confcache
+if cmp -s $cache_file confcache; then :; else
+  if test -w $cache_file; then
+    test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
+    cat confcache >$cache_file
+  else
+    echo "not updating unwritable cache $cache_file"
+  fi
+fi
+rm -f confcache
+
+test "x$prefix" = xNONE && prefix=$ac_default_prefix
+# Let make expand exec_prefix.
+test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
+
+# VPATH may cause trouble with some makes, so we remove $(srcdir),
+# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
+# trailing colons and then remove the whole line if VPATH becomes empty
+# (actually we leave an empty line to preserve line numbers).
+if test "x$srcdir" = x.; then
+  ac_vpsub='/^[ 	]*VPATH[ 	]*=/{
+s/:*\$(srcdir):*/:/;
+s/:*\${srcdir}:*/:/;
+s/:*@srcdir@:*/:/;
+s/^\([^=]*=[ 	]*\):*/\1/;
+s/:*$//;
+s/^[^=]*=[ 	]*$//;
+}'
+fi
+
+# Transform confdefs.h into DEFS.
+# Protect against shell expansion while executing Makefile rules.
+# Protect against Makefile macro expansion.
+#
+# If the first sed substitution is executed (which looks for macros that
+# take arguments), then we branch to the quote section.  Otherwise,
+# look for a macro that doesn't take arguments.
+cat >confdef2opt.sed <<\_ACEOF
+t clear
+: clear
+s,^[ 	]*#[ 	]*define[ 	][ 	]*\([^ 	(][^ 	(]*([^)]*)\)[ 	]*\(.*\),-D\1=\2,g
+t quote
+s,^[ 	]*#[ 	]*define[ 	][ 	]*\([^ 	][^ 	]*\)[ 	]*\(.*\),-D\1=\2,g
+t quote
+d
+: quote
+s,[ 	`~#$^&*(){}\\|;'"<>?],\\&,g
+s,\[,\\&,g
+s,\],\\&,g
+s,\$,$$,g
+p
+_ACEOF
+# We use echo to avoid assuming a particular line-breaking character.
+# The extra dot is to prevent the shell from consuming trailing
+# line-breaks from the sub-command output.  A line-break within
+# single-quotes doesn't work because, if this script is created in a
+# platform that uses two characters for line-breaks (e.g., DOS), tr
+# would break.
+ac_LF_and_DOT=`echo; echo .`
+DEFS=`sed -n -f confdef2opt.sed confdefs.h | tr "$ac_LF_and_DOT" ' .'`
+rm -f confdef2opt.sed
+
+
+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
+
+: ${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.
+# Compiler output produced by configure, useful for debugging
+# configure, is in config.log if it exists.
+
+debug=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=:
+elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
+  set -o posix
+fi
+
+# NLS nuisances.
+# Support unset when possible.
+if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
+  as_unset=unset
+else
+  as_unset=false
+fi
+
+(set +x; test -n "`(LANG=C; export LANG) 2>&1`") &&
+    { $as_unset LANG || test "${LANG+set}" != set; } ||
+      { LANG=C; export LANG; }
+(set +x; test -n "`(LC_ALL=C; export LC_ALL) 2>&1`") &&
+    { $as_unset LC_ALL || test "${LC_ALL+set}" != set; } ||
+      { LC_ALL=C; export LC_ALL; }
+(set +x; test -n "`(LC_TIME=C; export LC_TIME) 2>&1`") &&
+    { $as_unset LC_TIME || test "${LC_TIME+set}" != set; } ||
+      { LC_TIME=C; export LC_TIME; }
+(set +x; test -n "`(LC_CTYPE=C; export LC_CTYPE) 2>&1`") &&
+    { $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set; } ||
+      { LC_CTYPE=C; export LC_CTYPE; }
+(set +x; test -n "`(LANGUAGE=C; export LANGUAGE) 2>&1`") &&
+    { $as_unset LANGUAGE || test "${LANGUAGE+set}" != set; } ||
+      { LANGUAGE=C; export LANGUAGE; }
+(set +x; test -n "`(LC_COLLATE=C; export LC_COLLATE) 2>&1`") &&
+    { $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set; } ||
+      { LC_COLLATE=C; export LC_COLLATE; }
+(set +x; test -n "`(LC_NUMERIC=C; export LC_NUMERIC) 2>&1`") &&
+    { $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set; } ||
+      { LC_NUMERIC=C; export LC_NUMERIC; }
+(set +x; test -n "`(LC_MESSAGES=C; export LC_MESSAGES) 2>&1`") &&
+    { $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set; } ||
+      { LC_MESSAGES=C; export LC_MESSAGES; }
+
+
+# Name of the executable.
+as_me=`(basename "$0") 2>/dev/null ||
+$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" >conftest.sh
+  echo  "exit 0"   >>conftest.sh
+  chmod +x conftest.sh
+  if (PATH=".;."; conftest.sh) >/dev/null 2>&1; then
+    PATH_SEPARATOR=';'
+  else
+    PATH_SEPARATOR=:
+  fi
+  rm -f conftest.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
+	     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
+    as_ln_s='ln -s'
+  fi
+elif ln conf$$.file conf$$ 2>/dev/null; then
+  as_ln_s=ln
+else
+  as_ln_s='cp -p'
+fi
+rm -f conf$$ conf$$.exe conf$$.file
+
+as_executable_p="test -f"
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="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 || test "${CDPATH+set}" != set || { CDPATH=$PATH_SEPARATOR; export 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.53.  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
+  -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
+
+Configuration files:
+$config_files
+
+Configuration commands:
+$config_commands
+
+Report bugs to <bug-autoconf at gnu.org>."
+_ACEOF
+
+cat >>$CONFIG_STATUS <<_ACEOF
+ac_cs_version="\\
+config.status
+configured by $0, generated by GNU Autoconf 2.53,
+  with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
+
+Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
+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[^=]*=\(.*\)'`
+    shift
+    set dummy "$ac_option" "$ac_optarg" ${1+"$@"}
+    shift
+    ;;
+  -*);;
+  *) # This is not an option, so the user has probably given explicit
+     # arguments.
+     ac_need_defaults=false;;
+  esac
+
+  case $1 in
+  # Handling of the options.
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF
+  -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
+    echo "running $SHELL $0 " $ac_configure_args " --no-create --no-recursion"
+    exec $SHELL $0 $ac_configure_args --no-create --no-recursion ;;
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
+  --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 )
+    shift
+    CONFIG_FILES="$CONFIG_FILES $1"
+    ac_need_defaults=false;;
+  --header | --heade | --head | --hea )
+    shift
+    CONFIG_HEADERS="$CONFIG_HEADERS $1"
+    ac_need_defaults=false;;
+
+  # This is an error.
+  -*) { { echo "$as_me:$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
+
+_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" ;;
+  "depfiles" ) CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
+  *) { { 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_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
+fi
+
+# Create a temporary directory, and hook for its removal unless debugging.
+$debug ||
+{
+  trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
+  trap '{ (exit 1); exit 1; }' 1 2 13 15
+}
+
+# Create a (secure) tmp directory for tmp files.
+: ${TMPDIR=/tmp}
+{
+  tmp=`(umask 077 && mktemp -d -q "$TMPDIR/csXXXXXX") 2>/dev/null` &&
+  test -n "$tmp" && test -d "$tmp"
+}  ||
+{
+  tmp=$TMPDIR/cs$$-$RANDOM
+  (umask 077 && mkdir $tmp)
+} ||
+{
+   echo "$me: cannot create a temporary directory in $TMPDIR" >&2
+   { (exit 1); exit 1; }
+}
+
+_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, at SHELL@,$SHELL,;t t
+s, at PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
+s, at PACKAGE_NAME@,$PACKAGE_NAME,;t t
+s, at PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
+s, at PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
+s, at PACKAGE_STRING@,$PACKAGE_STRING,;t t
+s, at PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
+s, at exec_prefix@,$exec_prefix,;t t
+s, at prefix@,$prefix,;t t
+s, at program_transform_name@,$program_transform_name,;t t
+s, at bindir@,$bindir,;t t
+s, at sbindir@,$sbindir,;t t
+s, at libexecdir@,$libexecdir,;t t
+s, at datadir@,$datadir,;t t
+s, at sysconfdir@,$sysconfdir,;t t
+s, at sharedstatedir@,$sharedstatedir,;t t
+s, at localstatedir@,$localstatedir,;t t
+s, at libdir@,$libdir,;t t
+s, at includedir@,$includedir,;t t
+s, at oldincludedir@,$oldincludedir,;t t
+s, at infodir@,$infodir,;t t
+s, at mandir@,$mandir,;t t
+s, at build_alias@,$build_alias,;t t
+s, at host_alias@,$host_alias,;t t
+s, at target_alias@,$target_alias,;t t
+s, at DEFS@,$DEFS,;t t
+s, at ECHO_C@,$ECHO_C,;t t
+s, at ECHO_N@,$ECHO_N,;t t
+s, at ECHO_T@,$ECHO_T,;t t
+s, at LIBS@,$LIBS,;t t
+s, at INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
+s, at INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
+s, at INSTALL_DATA@,$INSTALL_DATA,;t t
+s, at PACKAGE@,$PACKAGE,;t t
+s, at VERSION@,$VERSION,;t t
+s, at ACLOCAL@,$ACLOCAL,;t t
+s, at AUTOCONF@,$AUTOCONF,;t t
+s, at AUTOMAKE@,$AUTOMAKE,;t t
+s, at AUTOHEADER@,$AUTOHEADER,;t t
+s, at MAKEINFO@,$MAKEINFO,;t t
+s, at AMTAR@,$AMTAR,;t t
+s, at install_sh@,$install_sh,;t t
+s, at STRIP@,$STRIP,;t t
+s, at ac_ct_STRIP@,$ac_ct_STRIP,;t t
+s, at INSTALL_STRIP_PROGRAM@,$INSTALL_STRIP_PROGRAM,;t t
+s, at AWK@,$AWK,;t t
+s, at SET_MAKE@,$SET_MAKE,;t t
+s, at CC@,$CC,;t t
+s, at CFLAGS@,$CFLAGS,;t t
+s, at LDFLAGS@,$LDFLAGS,;t t
+s, at CPPFLAGS@,$CPPFLAGS,;t t
+s, at ac_ct_CC@,$ac_ct_CC,;t t
+s, at EXEEXT@,$EXEEXT,;t t
+s, at OBJEXT@,$OBJEXT,;t t
+s, at DEPDIR@,$DEPDIR,;t t
+s, at am__include@,$am__include,;t t
+s, at am__quote@,$am__quote,;t t
+s, at AMDEP_TRUE@,$AMDEP_TRUE,;t t
+s, at AMDEP_FALSE@,$AMDEP_FALSE,;t t
+s, at AMDEPBACKSLASH@,$AMDEPBACKSLASH,;t t
+s, at CCDEPMODE@,$CCDEPMODE,;t t
+s, at RANLIB@,$RANLIB,;t t
+s, at ac_ct_RANLIB@,$ac_ct_RANLIB,;t t
+s, at MAN2HTML@,$MAN2HTML,;t t
+s, at CPP@,$CPP,;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
+      sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
+    fi
+    if test ! -s $tmp/subs.frag; then
+      ac_more_lines=false
+    else
+      # The purpose of the label and of the branching condition is to
+      # speed up the sed processing (if there are no `@' at all, there
+      # is no need to browse any of the substitutions).
+      # These are the two extra sed commands mentioned above.
+      (echo ':t
+  /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
+      if test -z "$ac_sed_cmds"; then
+  	ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
+      else
+  	ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
+      fi
+      ac_sed_frag=`expr $ac_sed_frag + 1`
+      ac_beg=$ac_end
+      ac_end=`expr $ac_end + $ac_max_sed_lines`
+    fi
+  done
+  if test -z "$ac_sed_cmds"; then
+    ac_sed_cmds=cat
+  fi
+fi # test -n "$CONFIG_FILES"
+
+_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
+  - | *:- | *:-:* ) # input from stdin
+        cat >$tmp/stdin
+        ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
+        ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
+  *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
+        ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
+  * )   ac_file_in=$ac_file.in ;;
+  esac
+
+  # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
+  ac_dir=`(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'`
+  { case "$ac_dir" in
+  [\\/]* | ?:[\\/]* ) as_incr_dir=;;
+  *)                      as_incr_dir=.;;
+esac
+as_dummy="$ac_dir"
+for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
+  case $as_mkdir_dir in
+    # Skip DOS drivespec
+    ?:) as_incr_dir=$as_mkdir_dir ;;
+    *)
+      as_incr_dir=$as_incr_dir/$as_mkdir_dir
+      test -d "$as_incr_dir" ||
+        mkdir "$as_incr_dir" ||
+	{ { echo "$as_me:$LINENO: error: cannot create \"$ac_dir\"" >&5
+echo "$as_me: error: cannot create \"$ac_dir\"" >&2;}
+   { (exit 1); exit 1; }; }
+    ;;
+  esac
+done; }
+
+  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
+# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be
+# absolute.
+ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd`
+ac_abs_top_builddir=`cd "$ac_dir" && cd $ac_top_builddir && pwd`
+ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd`
+ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd`
+
+
+  case $INSTALL in
+  [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
+  *) ac_INSTALL=$ac_top_builddir$INSTALL ;;
+  esac
+
+  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, at configure_input@,$configure_input,;t t
+s, at srcdir@,$ac_srcdir,;t t
+s, at abs_srcdir@,$ac_abs_srcdir,;t t
+s, at top_srcdir@,$ac_top_srcdir,;t t
+s, at abs_top_srcdir@,$ac_abs_top_srcdir,;t t
+s, at builddir@,$ac_builddir,;t t
+s, at abs_builddir@,$ac_abs_builddir,;t t
+s, at top_builddir@,$ac_top_builddir,;t t
+s, at abs_top_builddir@,$ac_abs_top_builddir,;t t
+s, at INSTALL@,$ac_INSTALL,;t t
+" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
+  rm -f $tmp/stdin
+  if test x"$ac_file" != x-; then
+    mv $tmp/out $ac_file
+  else
+    cat $tmp/out
+    rm -f $tmp/out
+  fi
+
+done
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
+
+#
+# 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'`
+  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
+# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be
+# absolute.
+ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd`
+ac_abs_top_builddir=`cd "$ac_dir" && cd $ac_top_builddir && pwd`
+ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd`
+ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd`
+
+
+  { 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'`
+    { case $dirpart/$fdir in
+  [\\/]* | ?:[\\/]* ) as_incr_dir=;;
+  *)                      as_incr_dir=.;;
+esac
+as_dummy=$dirpart/$fdir
+for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
+  case $as_mkdir_dir in
+    # Skip DOS drivespec
+    ?:) as_incr_dir=$as_mkdir_dir ;;
+    *)
+      as_incr_dir=$as_incr_dir/$as_mkdir_dir
+      test -d "$as_incr_dir" ||
+        mkdir "$as_incr_dir" ||
+	{ { echo "$as_me:$LINENO: error: cannot create $dirpart/$fdir" >&5
+echo "$as_me: error: cannot create $dirpart/$fdir" >&2;}
+   { (exit 1); exit 1; }; }
+    ;;
+  esac
+done; }
+
+    # echo "creating $dirpart/$file"
+    echo '# dummy' > "$dirpart/$file"
+  done
+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=:
+  exec 5>/dev/null
+  $SHELL $CONFIG_STATUS || ac_cs_success=false
+  exec 5>>config.log
+  # Use ||, not &&, to avoid exiting from the if with $? = 1, which
+  # would make configure fail if this is the last instruction.
+  $ac_cs_success || { (exit 1); exit 1; }
+fi
+
diff --git a/configure.in b/configure.in
new file mode 100644
index 0000000..d32ae57
--- /dev/null
+++ b/configure.in
@@ -0,0 +1,70 @@
+dnl Process this file with autoconf to produce a configure script.
+AC_INIT(aprsshm.h)
+AM_INIT_AUTOMAKE(aprsdigi, 2.4.4)
+AC_PREFIX_DEFAULT(/usr)
+
+dnl Checks for programs.
+AC_PROG_CC
+AC_PROG_RANLIB
+AC_PROG_INSTALL
+AC_PATH_PROG(MAN2HTML,man2html,.:$PATH)
+
+dnl Checks for libraries.
+AC_CHECKING(for N2YGK's -lax25 extensions:)
+AC_CHECK_LIB(ax25, parse_raw_ax25, AC_DEFINE(HAVE_LIBAX25_EXTENSIONS))
+AC_CHECK_LIB(ax25, ax25_config_load_ports)
+
+dnl Checks for header files.
+AC_HEADER_STDC
+AC_HEADER_SYS_WAIT
+AC_CHECK_HEADERS(fcntl.h limits.h sys/ioctl.h sys/time.h unistd.h ax25/axconfig.h)
+
+if test "$ac_cv_header_ax25_axconfig_h" = yes ; then
+	CPPFLAGS="$CPPFLAGS -I/usr/include/ax25"
+fi
+
+dnl Checks for typedefs, structures, and compiler characteristics.
+AC_C_CONST
+AC_TYPE_SIZE_T
+AC_STRUCT_TM
+dnl following ip6 test lifted from iperf:
+dnl ===================================================================
+dnl Check for IPV6 support
+dnl We have avoided checking for ss_family in sockaddr_storage because
+dnl linux 2.4.x versions support IPv6 but do not have this structure
+dnl Just check for the presence of sockaddr_storage, sockaddr_in6 
+dnl and sin6_port
+dnl ===================================================================
+AC_CHECKING(for IPv6)
+AC_TRY_COMPILE(
+	[#include <sys/types.h>
+    	 #include <sys/socket.h>
+	 #include <netinet/in.h>
+	 #include <netinet/tcp.h>
+	],
+      	[struct sockaddr_storage sa_union, *sa_unionp;
+  	 struct sockaddr_in6 *sa;
+  	 sa_unionp = &sa_union;
+  	 sa = (struct sockaddr_in6 *)sa_unionp;
+  	 sa->sin6_port = ntohs(5001);
+        ],
+    	ac_accept_ipv6=yes,
+    	ac_accept_ipv6=no)
+if test "$ac_accept_ipv6" = yes ; then
+ 	AC_DEFINE(IPV6)
+fi	
+
+dnl Checks for library functions.
+AC_PROG_GCC_TRADITIONAL
+AC_TYPE_SIGNAL
+AC_FUNC_WAIT3
+AC_CHECK_FUNCS(select socket strdup strtol uname shmctl)
+
+dnl Compile-time options.
+AC_ARG_ENABLE(shm,[  --disable-shm           Do not use shared memory])
+if test "$enable_shm" != no; then
+  AC_DEFINE(USE_SHM)
+fi
+AC_ARG_WITH(ax25inc,[  --with-ax25inc=path     Location of ax25 include files if other than <ax25/>],CPPFLAGS="$CPPFLAGS -I$with_ax25inc")
+
+AC_OUTPUT(Makefile)
diff --git a/depcomp b/depcomp
new file mode 100755
index 0000000..807b991
--- /dev/null
+++ b/depcomp
@@ -0,0 +1,423 @@
+#! /bin/sh
+
+# depcomp - compile a program generating dependencies as side-effects
+# Copyright 1999, 2000 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 at dcc.unicamp.br>.
+
+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.  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.
+  stripped=`echo "$object" | sed -e 's,^.*/,,' -e 's/\(.*\)\..*$/\1/'`
+  tmpdepfile="$stripped.u"
+  outname="$stripped.o"
+  if test "$libtool" = yes; then
+    "$@" -Wc,-M
+  else
+    "$@" -M
+  fi
+
+  stat=$?
+  if test $stat -eq 0; then :
+  else
+    rm -f "$tmpdepfile"
+    exit $stat
+  fi
+
+  if test -f "$tmpdepfile"; then
+    # 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"
+  ;;
+
+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 space and a tab 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 proprocessed 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'.  We will use -o /dev/null later,
+  # however we can't do the remplacement now because
+  # `-o $object' might simply not be used
+  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
+  "$@" -o /dev/null $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 $?
+  # 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 ;;
+    -*)
+      ;;
+    *)
+      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 proprocessed 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 proprocessed 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
diff --git a/fiforead.8 b/fiforead.8
new file mode 100644
index 0000000..dcbb673
--- /dev/null
+++ b/fiforead.8
@@ -0,0 +1,17 @@
+.TH FIFOREAD 8 "4 April 2003"
+.SH NAME
+fiforead \- test program for aprsdigi.
+.SH SYNOPSIS
+.nf
+.BI "fiforead " filename
+.fi
+.SH DESCRIPTION
+.PP
+.I Fiforead
+is useful for testing aprsdigi.  Unix datagrams received from 
+.BI "aprsdigi \-p:unix:" filename,callsign,alias...
+are written to stdout.
+.SH AUTHOR
+.nf
+Alan Crosswell, n2ygk at weca.org
+.fi
diff --git a/fiforead.c b/fiforead.c
new file mode 100644
index 0000000..87e1549
--- /dev/null
+++ b/fiforead.c
@@ -0,0 +1,60 @@
+/* fiforead: read from the aprsdigi fifo */
+#include <sys/types.h>
+#include <sys/time.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <sys/socket.h>
+#include <sys/un.h>
+#include <sys/ioctl.h>
+#include <unistd.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <ctype.h>
+#include <time.h>
+#include <signal.h>
+#include <errno.h>
+
+int Verbose = 1;
+
+
+static void die(char *s);
+
+main(int argc, char **argv)
+{
+  struct sockaddr_un mysun,remsun;
+  int size;
+  int sock;
+  u_char buf[1024];
+  int n;
+ 
+  if (argc != 2) {
+    fprintf(stderr,"Usage: %s file\n", argv[0]);
+    exit(1);
+  }
+  bzero(&mysun,sizeof(mysun));
+  mysun.sun_family = AF_UNIX;
+  strncpy(mysun.sun_path,argv[1],sizeof(mysun.sun_path));
+  if (Verbose)
+    fprintf(stderr,"opening unix socket on %s\n", mysun.sun_path);
+  if ((sock = socket(AF_UNIX, SOCK_DGRAM, 0)) < 0) {
+    die("socket");
+  }
+  if (bind(sock, (struct sockaddr *)&mysun, sizeof(mysun)) < 0 
+      && errno != EADDRINUSE) {
+    die(mysun.sun_path);
+  }
+  size = sizeof(remsun);
+  while ((n = recvfrom(sock,buf,sizeof(buf),0,(struct sockaddr *)&remsun,&size)) >= 0) {
+    printf("read %d: %*.*s\n",n,n,n,buf);
+    size = sizeof(remsun);
+  }
+}
+
+static void
+die(char *s)
+{
+  perror(s);
+  exit(1);
+}
+
diff --git a/fiforead.html b/fiforead.html
new file mode 100644
index 0000000..df33c08
--- /dev/null
+++ b/fiforead.html
@@ -0,0 +1,54 @@
+Content-type: text/html
+
+<HTML><HEAD><TITLE>Manpage of FIFOREAD</TITLE>
+</HEAD><BODY>
+<H1>FIFOREAD</H1>
+Section: Maintenance Commands (8)<BR>Updated: 4 April 2003<BR><A HREF="#index">Index</A>
+<A HREF="http://localhost/cgi-bin/man/man2html">Return to Main Contents</A><HR>
+
+<A NAME="lbAB"> </A>
+<H2>NAME</H2>
+
+fiforead - test program for aprsdigi.
+<A NAME="lbAC"> </A>
+<H2>SYNOPSIS</H2>
+
+<PRE>
+<B>fiforead </B><I>filename</I>
+</PRE>
+
+<A NAME="lbAD"> </A>
+<H2>DESCRIPTION</H2>
+
+<P>
+
+<I>Fiforead</I>
+
+is useful for testing aprsdigi.  Unix datagrams received from 
+<B>aprsdigi -p:unix:</B><I>filename,callsign,alias...</I>
+
+are written to stdout.
+<A NAME="lbAE"> </A>
+<H2>AUTHOR</H2>
+
+<PRE>
+Alan Crosswell, <A HREF="mailto:n2ygk at weca.org">n2ygk at weca.org</A>
+</PRE>
+
+<P>
+
+<HR>
+<A NAME="index"> </A><H2>Index</H2>
+<DL>
+<DT><A HREF="#lbAB">NAME</A><DD>
+<DT><A HREF="#lbAC">SYNOPSIS</A><DD>
+<DT><A HREF="#lbAD">DESCRIPTION</A><DD>
+<DT><A HREF="#lbAE">AUTHOR</A><DD>
+</DL>
+<HR>
+This document was created by
+<A HREF="http://localhost/cgi-bin/man/man2html">man2html</A>,
+using the manual pages.<BR>
+Time: 22:03:18 GMT, April 05, 2003
+</BODY>
+</HTML>
diff --git a/fifowrite.8 b/fifowrite.8
new file mode 100644
index 0000000..a767842
--- /dev/null
+++ b/fifowrite.8
@@ -0,0 +1,19 @@
+.TH FIFOWRITE 8 "4 April 2003"
+.SH NAME
+fifowrite \- test program for aprsdigi.
+.SH SYNOPSIS
+.nf
+.BI "fifowrite " filename
+.fi
+.SH DESCRIPTION
+.PP
+.I Fifowrite
+is useful for testing aprsdigi.  Lines of text read from stdin are
+written as a Unix datagram to the fifo at
+.I filename
+which is expected to have been opened for reading by
+.BI "aprsdigi \-p unix:" filename,callsign,alias...
+.SH AUTHOR
+.nf
+Alan Crosswell, n2ygk at weca.org
+.fi
diff --git a/fifowrite.c b/fifowrite.c
new file mode 100644
index 0000000..b72c0c6
--- /dev/null
+++ b/fifowrite.c
@@ -0,0 +1,55 @@
+/* fifowrite: write to the aprsdigi fifo */
+#include <sys/types.h>
+#include <sys/time.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <sys/socket.h>
+#include <sys/un.h>
+#include <sys/ioctl.h>
+#include <unistd.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <ctype.h>
+#include <time.h>
+#include <signal.h>
+#include <errno.h>
+
+int Verbose = 1;
+
+
+static void die(char *s);
+
+main(int argc, char **argv)
+{
+  struct sockaddr_un mysun;
+  int sock;
+  u_char buf[1024];
+  int n;
+ 
+  if (argc != 2) {
+    fprintf(stderr,"Usage: %s file\n", argv[0]);
+    exit(1);
+  }
+  bzero(&mysun,sizeof(mysun));
+  mysun.sun_family = AF_UNIX;
+  strncpy(mysun.sun_path,argv[1],sizeof(mysun.sun_path));
+  if ((sock = socket(AF_UNIX, SOCK_DGRAM, 0)) < 0) {
+    die("socket");
+  }
+
+  while (fgets(buf,sizeof(buf),stdin)) {
+    int sent;
+    if ((sent = sendto(sock,buf,strlen(buf),0,(struct sockaddr *)&mysun,
+		       sizeof(mysun))) < 0)
+      die("sendto");
+  }
+}
+
+static void
+die(char *s)
+{
+  perror(s);
+  exit(1);
+}
+
diff --git a/fifowrite.html b/fifowrite.html
new file mode 100644
index 0000000..80dfdfc
--- /dev/null
+++ b/fifowrite.html
@@ -0,0 +1,57 @@
+Content-type: text/html
+
+<HTML><HEAD><TITLE>Manpage of FIFOWRITE</TITLE>
+</HEAD><BODY>
+<H1>FIFOWRITE</H1>
+Section: Maintenance Commands (8)<BR>Updated: 4 April 2003<BR><A HREF="#index">Index</A>
+<A HREF="http://localhost/cgi-bin/man/man2html">Return to Main Contents</A><HR>
+
+<A NAME="lbAB"> </A>
+<H2>NAME</H2>
+
+fifowrite - test program for aprsdigi.
+<A NAME="lbAC"> </A>
+<H2>SYNOPSIS</H2>
+
+<PRE>
+<B>fifowrite </B><I>filename</I>
+</PRE>
+
+<A NAME="lbAD"> </A>
+<H2>DESCRIPTION</H2>
+
+<P>
+
+<I>Fifowrite</I>
+
+is useful for testing aprsdigi.  Lines of text read from stdin are
+written as a Unix datagram to the fifo at
+<I>filename</I>
+
+which is expected to have been opened for reading by
+<B>aprsdigi -p unix:</B><I>filename,callsign,alias...</I>
+
+<A NAME="lbAE"> </A>
+<H2>AUTHOR</H2>
+
+<PRE>
+Alan Crosswell, <A HREF="mailto:n2ygk at weca.org">n2ygk at weca.org</A>
+</PRE>
+
+<P>
+
+<HR>
+<A NAME="index"> </A><H2>Index</H2>
+<DL>
+<DT><A HREF="#lbAB">NAME</A><DD>
+<DT><A HREF="#lbAC">SYNOPSIS</A><DD>
+<DT><A HREF="#lbAD">DESCRIPTION</A><DD>
+<DT><A HREF="#lbAE">AUTHOR</A><DD>
+</DL>
+<HR>
+This document was created by
+<A HREF="http://localhost/cgi-bin/man/man2html">man2html</A>,
+using the manual pages.<BR>
+Time: 22:03:18 GMT, April 05, 2003
+</BODY>
+</HTML>
diff --git a/install-sh b/install-sh
new file mode 100755
index 0000000..ebc6691
--- /dev/null
+++ b/install-sh
@@ -0,0 +1,250 @@
+#! /bin/sh
+#
+# install - install a program, script, or datafile
+# This comes from X11R5 (mit/util/scripts/install.sh).
+#
+# Copyright 1991 by the Massachusetts Institute of Technology
+#
+# Permission to use, copy, modify, distribute, and sell this software and its
+# documentation for any purpose is hereby granted without fee, provided that
+# the above copyright notice appear in all copies and that both that
+# copyright notice and this permission notice appear in supporting
+# documentation, and that the name of M.I.T. not be used in advertising or
+# publicity pertaining to distribution of the software without specific,
+# written prior permission.  M.I.T. makes no representations about the
+# suitability of this software for any purpose.  It is provided "as is"
+# without express or implied warranty.
+#
+# Calling this script install-sh is preferred over install.sh, to prevent
+# `make' implicit rules from creating a file called install from it
+# when there is no Makefile.
+#
+# This script is compatible with the BSD install script, but was written
+# from scratch.  It can only install one file at a time, a restriction
+# shared with many OS's install programs.
+
+
+# set DOITPROG to echo to test this script
+
+# Don't use :- since 4.3BSD and earlier shells don't like it.
+doit="${DOITPROG-}"
+
+
+# put in absolute paths if you don't have them in your path; or use env. vars.
+
+mvprog="${MVPROG-mv}"
+cpprog="${CPPROG-cp}"
+chmodprog="${CHMODPROG-chmod}"
+chownprog="${CHOWNPROG-chown}"
+chgrpprog="${CHGRPPROG-chgrp}"
+stripprog="${STRIPPROG-strip}"
+rmprog="${RMPROG-rm}"
+mkdirprog="${MKDIRPROG-mkdir}"
+
+transformbasename=""
+transform_arg=""
+instcmd="$mvprog"
+chmodcmd="$chmodprog 0755"
+chowncmd=""
+chgrpcmd=""
+stripcmd=""
+rmcmd="$rmprog -f"
+mvcmd="$mvprog"
+src=""
+dst=""
+dir_arg=""
+
+while [ x"$1" != x ]; do
+    case $1 in
+	-c) instcmd="$cpprog"
+	    shift
+	    continue;;
+
+	-d) dir_arg=true
+	    shift
+	    continue;;
+
+	-m) chmodcmd="$chmodprog $2"
+	    shift
+	    shift
+	    continue;;
+
+	-o) chowncmd="$chownprog $2"
+	    shift
+	    shift
+	    continue;;
+
+	-g) chgrpcmd="$chgrpprog $2"
+	    shift
+	    shift
+	    continue;;
+
+	-s) stripcmd="$stripprog"
+	    shift
+	    continue;;
+
+	-t=*) transformarg=`echo $1 | sed 's/-t=//'`
+	    shift
+	    continue;;
+
+	-b=*) transformbasename=`echo $1 | sed 's/-b=//'`
+	    shift
+	    continue;;
+
+	*)  if [ x"$src" = x ]
+	    then
+		src=$1
+	    else
+		# this colon is to work around a 386BSD /bin/sh bug
+		:
+		dst=$1
+	    fi
+	    shift
+	    continue;;
+    esac
+done
+
+if [ x"$src" = x ]
+then
+	echo "install:	no input file specified"
+	exit 1
+else
+	true
+fi
+
+if [ x"$dir_arg" != x ]; then
+	dst=$src
+	src=""
+	
+	if [ -d $dst ]; then
+		instcmd=:
+	else
+		instcmd=mkdir
+	fi
+else
+
+# Waiting for this to be detected by the "$instcmd $src $dsttmp" command
+# might cause directories to be created, which would be especially bad 
+# if $src (and thus $dsttmp) contains '*'.
+
+	if [ -f $src -o -d $src ]
+	then
+		true
+	else
+		echo "install:  $src does not exist"
+		exit 1
+	fi
+	
+	if [ x"$dst" = x ]
+	then
+		echo "install:	no destination specified"
+		exit 1
+	else
+		true
+	fi
+
+# If destination is a directory, append the input filename; if your system
+# does not like double slashes in filenames, you may need to add some logic
+
+	if [ -d $dst ]
+	then
+		dst="$dst"/`basename $src`
+	else
+		true
+	fi
+fi
+
+## this sed command emulates the dirname command
+dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
+
+# Make sure that the destination directory exists.
+#  this part is taken from Noah Friedman's mkinstalldirs script
+
+# Skip lots of stat calls in the usual case.
+if [ ! -d "$dstdir" ]; then
+defaultIFS='	
+'
+IFS="${IFS-${defaultIFS}}"
+
+oIFS="${IFS}"
+# Some sh's can't handle IFS=/ for some reason.
+IFS='%'
+set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'`
+IFS="${oIFS}"
+
+pathcomp=''
+
+while [ $# -ne 0 ] ; do
+	pathcomp="${pathcomp}${1}"
+	shift
+
+	if [ ! -d "${pathcomp}" ] ;
+        then
+		$mkdirprog "${pathcomp}"
+	else
+		true
+	fi
+
+	pathcomp="${pathcomp}/"
+done
+fi
+
+if [ x"$dir_arg" != x ]
+then
+	$doit $instcmd $dst &&
+
+	if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi &&
+	if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi &&
+	if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi &&
+	if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi
+else
+
+# If we're going to rename the final executable, determine the name now.
+
+	if [ x"$transformarg" = x ] 
+	then
+		dstfile=`basename $dst`
+	else
+		dstfile=`basename $dst $transformbasename | 
+			sed $transformarg`$transformbasename
+	fi
+
+# don't allow the sed command to completely eliminate the filename
+
+	if [ x"$dstfile" = x ] 
+	then
+		dstfile=`basename $dst`
+	else
+		true
+	fi
+
+# Make a temp file name in the proper directory.
+
+	dsttmp=$dstdir/#inst.$$#
+
+# Move or copy the file name to the temp name
+
+	$doit $instcmd $src $dsttmp &&
+
+	trap "rm -f ${dsttmp}" 0 &&
+
+# and set any options; do chmod last to preserve setuid bits
+
+# If any of these fail, we abort the whole thing.  If we want to
+# ignore errors from any of these, just make sure not to ignore
+# errors from the above "$doit $instcmd $src $dsttmp" command.
+
+	if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi &&
+	if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi &&
+	if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi &&
+	if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi &&
+
+# Now rename the file to the real destination.
+
+	$doit $rmcmd -f $dstdir/$dstfile &&
+	$doit $mvcmd $dsttmp $dstdir/$dstfile 
+
+fi &&
+
+
+exit 0
diff --git a/libax25ext.c b/libax25ext.c
new file mode 100644
index 0000000..e9af48c
--- /dev/null
+++ b/libax25ext.c
@@ -0,0 +1,397 @@
+/*
+ * libax25ext.c: Some added functions for libax25.  Conditionally
+ *  compiled only if the installed libax25 has not integrated them.
+ *  which they haven't :-(
+ *  Copyright (c) 1999,2001,2002 E. Alan Crosswell, N2YGK
+ */
+
+#ifndef HAVE_LIBAX25_EXTENSIONS
+
+#include <netax25/ax25.h>
+#include <netrose/rose.h>
+#include <netax25/axlib.h>
+#include "libax25ext.h"
+#include <string.h>
+
+#define	ALEN		6
+#define	AXLEN		7
+#define	HDLCAEB		0x01
+#define	REPEATED	0x80
+#define	UI		0x03	/* unnumbered information (unproto) */
+#define	PID_NO_L3	0xF0	/* no level-3 */
+
+/*
+ * parse a received kiss data frame into ax_calls and update data pointer
+ *  and length next byte of frame.  Returns -1 on invalid or non-UI frame, 0
+ *  on valid frame, 1 on valid frame that still has a non-repeated digi.
+ */
+
+pk_val
+parse_raw_ax25(unsigned char **frame, int *len, struct ax_calls *calls)
+{
+  if ((**frame & 0xf) != 0 || *len < 1+(2*AXLEN))
+    return PK_INVALID;		/* not a valid kiss data frame */
+  ++*frame;
+  --*len;
+  bzero(calls,sizeof(*calls));
+  calls->ax_next_digi = 0;
+  bcopy(*frame,calls->ax_to_call.ax25_call,AXLEN);
+  *frame += AXLEN;
+  *len -= AXLEN;
+  bcopy(*frame,calls->ax_from_call.ax25_call,AXLEN);
+  *frame += AXLEN;
+  *len -= AXLEN;
+  if (*len <= 0)
+    return PK_VALID;
+  if (!(calls->ax_from_call.ax25_call[ALEN] & HDLCAEB))	{ /* digis listed */
+    for (calls->ax_n_digis = 0; 
+	 calls->ax_n_digis < AX25_MAX_DIGIS && *len > 0; 
+	 calls->ax_n_digis++, *len-=AXLEN,*frame+=AXLEN) {
+      bcopy(*frame,calls->ax_digi_call[calls->ax_n_digis].ax25_call,AXLEN);
+      if ((*frame)[ALEN]&REPEATED)
+	calls->ax_next_digi = calls->ax_n_digis+1;
+      if ((*frame)[ALEN]&HDLCAEB) { /* last digi */
+	*frame += AXLEN;
+	*len -= AXLEN;
+	calls->ax_n_digis++;
+	break;
+      }
+    }
+  }
+  if (--*len >= 0)
+    calls->ax_type = *(*frame)++;
+  if (--*len >= 0)
+    calls->ax_pid = *(*frame)++;
+  if (!(calls->ax_type == UI && calls->ax_pid == PID_NO_L3))
+    return PK_INVALID;		/* not a UI text frame */
+  if (calls->ax_n_digis == 0
+      || calls->ax_next_digi >= calls->ax_n_digis) /* all digis used up */
+    return PK_VALID;
+  else
+    return PK_VALDIGI;
+}
+
+/* 
+ * like parse_raw_ax25 but the frame header is in TNC-2 or AEA format
+ * per APRS spec 1.01 p. 84 
+ * TNC-2: source>dest,digi1,digi2*,...,digi8:
+ * AEA: source*>digi1>digi2*>...,digi8>dest:
+ *
+ * See parse_cooked_ax25.(fig,pdf) for a state diagram for the parser (uggh).
+ */
+
+pk_val
+parse_cooked_ax25(unsigned char **frame, int *len, struct ax_calls *calls)
+{
+  unsigned char *tok;
+  int state,next_state = 0;
+
+  while (next_state <= 99) {
+    int switchtok, i;
+    state = next_state;
+    switch(state) {
+    case 0:
+      /* 0: Initial state */
+      bzero(calls,sizeof(*calls));
+      calls->ax_n_digis = 0;	/* this is "n = 0" in the diagram */
+      
+      if ((tok = strpbrk(*frame,"*>")) == NULL) /* source callsign */
+	return PK_INVALID;
+      switchtok = *tok;
+      *tok++ = '\0';
+      ax25_aton_entry(*frame,calls->ax_from_call.ax25_call);
+      *len -= tok - *frame;
+      *frame = tok;
+      switch (switchtok) {
+      case '*':
+	calls->ax_from_call.ax25_call[ALEN] |= REPEATED;
+	next_state = 1;
+	break;
+      case '>':
+	next_state= 2;
+	break;
+      }
+      break;
+    case 1:
+      if (*tok++ == '>') {	/* 1->3: AEA */
+	next_state = 3;
+	*len -= tok - *frame;
+	*frame = tok;
+      } else
+	return PK_INVALID;
+      break;
+    case 11:			/* 11->3: AEA */
+      if (*tok++ != '>')
+	return PK_INVALID;
+      *frame = tok;		/* ? */
+      (*len)--;
+      next_state = 3;
+      break;
+    case 3:			/* 3->5: AEA */
+      if ((tok = strpbrk(*frame,">*:")) == NULL) /* callsign */
+	return PK_INVALID;
+      switchtok = *tok;
+      *tok++ = '\0';
+      switch (switchtok) {
+      case '>':			/* 5->3: digi */
+      case '*':
+	if (calls->ax_n_digis >= AX25_MAX_DIGIS)
+	  return PK_INVALID;
+	ax25_aton_entry(*frame,calls->ax_digi_call[calls->ax_n_digis].ax25_call);
+	*len -= tok - *frame;
+	*frame = tok;
+	calls->ax_n_digis++;
+	if (switchtok == '>') {
+	  next_state = 3;
+	} else {
+	  /* set REPEATED flag for all digis up to and including this */
+	  for (i = 0; i < calls->ax_n_digis; i++)
+	    calls->ax_digi_call[i].ax25_call[ALEN] |= REPEATED; 
+	  calls->ax_next_digi = calls->ax_n_digis;
+	  next_state = 7;
+	}
+	break;
+      case ':':
+	ax25_aton_entry(*frame,calls->ax_to_call.ax25_call);
+	*len -= tok - *frame;
+	*frame = tok;
+	next_state = 99;	
+	break;
+      default:
+	return PK_INVALID;
+      }
+      break;
+    case 5:			/* not really a state */
+      return PK_INVALID;
+      break;
+    case 7:
+      if (*tok++ != '>')
+	return PK_INVALID;
+      (*len)--;
+      *frame = tok;
+      next_state = 3;
+      break;
+    case 2:			/* 2->4: TNC2, unless it's an AEA:-) */
+      if ((tok = strpbrk(*frame,">*:,")) == NULL) /* callsign */
+	return PK_INVALID;
+      switchtok = *tok;
+      switch (switchtok) {
+      case '>':			/* 4->3: AEA */
+	*tok++ = '\0';
+	if (calls->ax_n_digis >= AX25_MAX_DIGIS)
+	  return PK_INVALID;
+	ax25_aton_entry(*frame,calls->ax_digi_call[calls->ax_n_digis].ax25_call);
+	*len -= tok - *frame;
+	*frame = tok;
+	calls->ax_n_digis++;
+	next_state = 3;
+	break;
+      case '*':			/* 4->3: AEA, heard direct */
+	*tok++ = '\0';
+	if (calls->ax_n_digis >= AX25_MAX_DIGIS)
+	  return PK_INVALID;
+	ax25_aton_entry(*frame,calls->ax_digi_call[calls->ax_n_digis].ax25_call);
+	*len -= tok - *frame;
+	*frame = tok;
+	calls->ax_n_digis++;
+	/* set repeated AEB flags for all digis up to and including this */
+	for (i = 0; i < calls->ax_n_digis; i++)
+	  calls->ax_digi_call[i].ax25_call[ALEN] |= REPEATED; /* +HDLCAEB? */
+	calls->ax_next_digi = calls->ax_n_digis;
+	next_state = 11;
+	break;
+      case ':':
+	*tok++ = '\0';
+	ax25_aton_entry(*frame,calls->ax_to_call.ax25_call);
+	*len -= tok - *frame;
+	*frame = tok;
+	next_state = 99;	
+	break;
+      case ',':
+	*tok++ = '\0';
+	ax25_aton_entry(*frame,calls->ax_to_call.ax25_call);
+	*len -= tok - *frame;
+	*frame = tok;
+	next_state = 6;
+	break;
+      }
+      break;
+    case 4:			/* not really a state */
+      return PK_INVALID;
+      break;
+    case 6:			/* 6->8 */
+      if ((tok = strpbrk(*frame,":*,")) == NULL) /* callsign */
+	return PK_INVALID;
+      switchtok = *tok;
+      *tok++ = '\0';
+      if (calls->ax_n_digis >= AX25_MAX_DIGIS)
+	return PK_INVALID;
+      ax25_aton_entry(*frame,calls->ax_digi_call[calls->ax_n_digis].ax25_call);
+      *len -= tok - *frame;
+      *frame = tok;
+      calls->ax_n_digis++;
+      switch (switchtok) {
+      case ':':			/* 8->T */
+	next_state = 99;
+	break;
+      case '*':			/* 8->10 */
+	/* set repeated AEB flags for all digis up to and including this */
+	for (i = 0; i < calls->ax_n_digis; i++)
+	  calls->ax_digi_call[i].ax25_call[ALEN] |= REPEATED; /* +HDLCAEB? */
+	calls->ax_next_digi = calls->ax_n_digis;
+	next_state = 10;
+	break;
+      case ',':			/* 8->6 */
+	next_state = 6;
+	break;
+      }
+      break;
+    case 8:
+      return PK_INVALID;	/* not really a state */
+      break;
+    case 10:
+      switch(*tok) {
+      case ',':
+	next_state = 6;
+	break;
+      case ':':
+	next_state = 99;
+	break;
+      default:
+	return PK_INVALID;
+      }
+      *tok++ = '\0';
+      (*len)--;
+      *frame = tok;
+      break;
+  case 99:			/* terminal */
+    calls->ax_type = UI;
+    calls->ax_pid == PID_NO_L3;
+    if (calls->ax_n_digis == 0)
+      calls->ax_from_call.ax25_call[ALEN] |= HDLCAEB;
+    else
+      calls->ax_digi_call[calls->ax_n_digis-1].ax25_call[ALEN] |= HDLCAEB; 
+
+    if (calls->ax_n_digis == 0
+	|| calls->ax_next_digi >= calls->ax_n_digis) /* all digis used up */
+      return PK_VALID;
+    else
+      return PK_VALDIGI;
+    break;
+  default:
+    return PK_INVALID;
+    }
+
+  }
+  /* NOTREACHED */
+}
+
+
+/* reverse of parse_raw_ax25: generates a kiss frame */
+int
+gen_raw_ax25(unsigned char **frame, int *len, struct ax_calls *calls)
+{
+  int minsize = 1+AXLEN+AXLEN+(calls->ax_n_digis*AXLEN)+2;
+  int i;
+  
+  if (*len < minsize)
+    return -1;
+  *len -= minsize;
+  if (calls->ax_n_digis == 0)
+    calls->ax_from_call.ax25_call[ALEN] |= HDLCAEB;
+  else
+    calls->ax_from_call.ax25_call[ALEN] &= ~HDLCAEB;
+
+  *(*frame)++ = '\0';		/* KISS type 0 */
+  bcopy(calls->ax_to_call.ax25_call,*frame,AXLEN);
+  *frame += AXLEN;
+  bcopy(calls->ax_from_call.ax25_call,*frame,AXLEN);
+  *frame += AXLEN;
+  for (i = 0; i < calls->ax_n_digis; i++,*frame += AXLEN) {
+    calls->ax_digi_call[i].ax25_call[ALEN] &= ~HDLCAEB;
+    bcopy(calls->ax_digi_call[i].ax25_call,*frame,AXLEN);
+  }    
+  if (i > 0)
+    *(*frame-AXLEN+ALEN) |= HDLCAEB;
+  *(*frame)++ = calls->ax_type;
+  *(*frame)++ = calls->ax_pid;
+  return 0;
+}
+
+/* Like gen_raw_ax25 but in "cooked" TNC-2 format per APRS spec 1.01 p. 83 */
+/* source_call>dest_call,digi1,digi2*,...,digi8: */
+int
+gen_cooked_ax25(unsigned char **frame, int *len, struct ax_calls *calls)
+{
+  int minsize = AXLEN+3+1+AXLEN+3+1+(calls->ax_n_digis*(AXLEN+3+1))+2;
+  int i,l;
+  
+  if (*len < minsize)
+    return -1;
+
+  strncpy(*frame,ax25_ntoa_pretty(&calls->ax_from_call),AXLEN+3);
+  l = strlen(*frame);
+  *frame += l;
+  *(*frame)++ = '>'; 
+  *len -= (l+1);
+  strncpy(*frame,ax25_ntoa_pretty(&calls->ax_to_call),AXLEN+3);
+  l = strlen(*frame);
+  *frame += l; 
+  *len -= l;
+  for (i = 0; i < calls->ax_n_digis; i++) {
+    *(*frame)++ = ',';
+    (*len)--;
+    strncpy(*frame,ax25_ntoa_pretty(&calls->ax_digi_call[i]),AXLEN+3);
+    l = strlen(*frame);
+    *frame += l;    
+    *len -= l;
+    /* only the last repeated digi gets * */
+    if (calls->ax_n_digis && calls->ax_next_digi-1 == i) {
+      *(*frame)++ = '*';
+      (*len)--;
+    }
+  }
+  *(*frame)++ = ':';
+  (*len)--;
+  return 0;
+}
+
+/*
+ *  ax25 -> ascii conversion, pretty version
+ *
+ *  lifted from libax25/axutils.c and fixed so that SSID 0 comes out
+ *  as MYCALL instead of MYCALL-0, just like most people expect!
+ *  The libax25 developers didn't accept my patch submission so I have
+ *  to drag this code around forever.  Oh well.
+ */
+char *ax25_ntoa_pretty(const ax25_address *a)
+{
+  static char buf[11];
+  char c, *s;
+  int n;
+  
+  for (n = 0, s = buf; n < 6; n++) {
+    c = (a->ax25_call[n] >> 1) & 0x7F;
+    
+    if (c != ' ') *s++ = c;
+  }
+  
+  if ((n = ((a->ax25_call[6] >> 1) & 0x0F))) { /* not SSID=0 */
+    *s++ = '-';
+    
+    if (n > 9) {
+      *s++ = '1';
+      n -= 10;
+    }
+    
+    *s++ = n + '0';
+  }
+  
+  *s++ = '\0';
+  
+  return buf;
+}
+
+#endif
+
+
diff --git a/libax25ext.h b/libax25ext.h
new file mode 100644
index 0000000..6393c78
--- /dev/null
+++ b/libax25ext.h
@@ -0,0 +1,36 @@
+/*
+ * libax25ext.h: Some added functions for libax25.  Conditionally
+ *  compiled only if the installed libax25 has not integrated them.
+ *  Copyright (c) 1999 E. Alan Crosswell, N2YGK
+ */
+
+#ifndef HAVE_LIBAX25_EXTENSIONS
+  
+struct ax_calls {
+  ax25_address ax_to_call;
+  ax25_address ax_from_call;
+  int ax_n_digis;		/* number of digis to follow */
+  ax25_address ax_digi_call[AX25_MAX_DIGIS];
+  int ax_next_digi;		/* index of next digi (1st non-repeated) */
+  unsigned char ax_type;	/* frame type */
+  unsigned char ax_pid;		/* protocol ID */
+};
+
+/*
+ * parse a received kiss data frame into ax_calls and update data pointer
+ *  and length next byte of frame.  Returns -1 on invalid frame, 0
+ *  on valid frame, 1 on valid frame that still has a non-repeated digi.
+ */
+typedef enum {PK_INVALID=-1,PK_VALID=0,PK_VALDIGI=1} pk_val;
+extern pk_val parse_raw_ax25(unsigned char **, int *, struct ax_calls *);
+/* parse a received cooked TNC-2 or AEA format data frame */
+extern pk_val parse_cooked_ax25(unsigned char **, int *, struct ax_calls *);
+/* generate a raw kiss data frame header (converse of parse_raw_ax25) */
+extern int gen_raw_ax25(unsigned char **, int *, struct ax_calls *);
+/* generate a cooked TNC-2 format data frame header (converse of parse_cooked_ax25) */
+extern int gen_cooked_ax25(unsigned char **, int *, struct ax_calls *);
+
+/* pretty version of stand libax25's ax25_ntoa */
+extern char *ax25_ntoa_pretty(const ax25_address *a);
+
+#endif
diff --git a/mic_e.c b/mic_e.c
new file mode 100644
index 0000000..04af100
--- /dev/null
+++ b/mic_e.c
@@ -0,0 +1,254 @@
+/*
+ * mic_e: function to reformat APRS Mic Encoder compressed position report
+ *  into a conventional (non-binary) tracker report.
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License, version 2 as
+ *  published by the Free Software Foundation.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ * (See the file "COPYING" that is included with this source distribution.)
+ * 
+ * Copyright (c) 1997,1999 Alan Crosswell
+ * Alan Crosswell, N2YGK
+ * 144 Washburn Road
+ * Briarcliff Manor, NY 10510, USA
+ * n2ygk at weca.org
+ */
+#include <stdio.h>
+#include <time.h>
+#include <string.h>
+#include <ctype.h>
+#include <sys/types.h>
+#include "mic_e.h"
+
+static char *msgname[] = {
+  "Off duty..",
+  "Enroute...",
+  "In Service",
+  "Returning.",
+  "Committed.",
+  "Special...",
+  "PRIORITY..",
+  "EMERGENCY."
+};
+
+static unsigned int hex2i(u_char,u_char);
+
+int
+fmt_mic_e(const u_char *t,	/* tocall */
+	  const u_char *i,	/* info */
+	  const int l,		/* length of info */
+	  u_char *buf1,		/* output buffer */
+	  int *l1,		/* length of output buffer */
+	  u_char *buf2,		/* 2nd output buffer */
+	  int *l2,		/* length of 2nd output buffer */
+	  time_t tick)		/* received timestamp of the packet */
+{
+  u_int msg,sp,dc,se,spd,cse;
+  char north, west;
+  int lon1,lonDD,lonMM,lonHH;
+  char *bp;
+  struct tm *gmt;
+  enum {none=0, BETA, REV1} rev = none; /* mic_e revision level */
+  int gps_valid = 0;
+  char symtbl = '/', symbol = '$', etype = 'E';
+  int buf2_n = 0;
+
+  *l1 = *l2 = 0;
+  
+  switch (i[0]) {		/* possible valid MIC-E flags */
+  case 0x60:
+    gps_valid = 1;
+    rev = REV1;
+    break;
+  case 0x27:
+    gps_valid = 0;
+    rev = REV1;
+    break;
+  case 0x1c:
+    gps_valid = 1;
+    rev = BETA;
+    break;
+  case 0x1d:
+    gps_valid = 0;
+    rev = BETA;
+    break;
+  default:
+    gps_valid = 0;
+    rev = none;
+    break;
+  }
+  if (l >= 7 && (rev != none)) {
+    msg = ((t[0]&0x40)?0:4) + ((t[1]&0x40)?0:2) + ((t[2]&0x40)?0:1);
+    north = t[3]&0x40?'N':'S';
+    west = t[5]&0x40?'W':'E';
+    lon1 = t[4]&0x40;
+    lonDD = i[1] - 28;
+    lonMM = i[2] - 28;
+    lonHH = i[3] - 28;
+#ifdef DEBUG
+    fprintf(stderr,"raw lon 0x%02x(%d) 0x%02x(%d) 0x%02x(%d) 0x%02x(%d)\n",
+	    i[1],i[1],i[2],i[2],i[3],i[3],i[4],i[4]);
+    fprintf(stderr,"before: lonDD=%d, lonMM=%d, lonHH=%d lon1=0x%0x\n",lonDD,lonMM,lonHH,lon1);
+#endif
+    if (rev >= REV1) {
+      if (lon1)			/* do this first? */
+	lonDD += 100;
+      if (180 <= lonDD && lonDD <= 189)
+	lonDD -= 80;
+      if (190 <= lonDD && lonDD <= 199)
+	lonDD -= 190;
+      if (lonMM >= 60)
+	lonMM -= 60;
+    }
+#ifdef DEBUG
+    fprintf(stderr,"after: lonDD=%d, lonMM=%d, lonHH=%d lon1=0x%0x\n",lonDD,lonMM,lonHH,lon1);
+#endif
+    sp = i[4] - 28;
+    dc = i[5] - 28;
+    se = i[6] - 28;
+    buf2_n = 6;			/* keep track of where we are */
+#ifdef DEBUG
+    fprintf(stderr,"sp=%02x dc==%02x se=%02x\n",sp,dc,se);
+#endif
+    spd = sp*10+dc/10;
+    cse = (dc%10)*100+se;
+    if (rev >= REV1) {
+      if (spd >= 800)
+	spd -= 800;
+      if (cse >= 400)
+	cse -= 400;
+    }
+    gmt = gmtime(&tick);
+#ifdef DEBUG
+    fprintf(stderr,"symbol=0x%02x, symtbl=0x%02x\n",i[7],i[8]);
+#endif
+    symtbl = (l >= 8 && rev >= REV1)? i[8] : '/';
+    /* rev1 bug workaround:  sends null symbol/table bytes */
+    if (symtbl != '/' && symtbl != '\\' 
+	&& !('0' <= symtbl && symtbl <= '9')
+	&& !('A' <= symtbl && symtbl <= 'J')
+	&& symtbl != '*' && symtbl != '!')
+      symtbl = '/';
+    symbol = i[7];
+    if (!isprint(symbol))
+      symbol = '$';
+
+    buf2_n = (rev == BETA)?8:9;
+    if (l >= 10) {
+      buf2_n = (rev == BETA)?8:9;
+      switch (i[buf2_n]) {
+      case '>':		/* Kenwood TH-D7: no telemetry */
+	etype = 'T';
+	buf2_n++;
+	break;
+      case 0x60:		/* two-channel telemetry */
+	sprintf(buf2,"T#MIC%03d,%03d",
+		hex2i(i[buf2_n+1],i[buf2_n+2]),
+		hex2i(i[buf2_n+3],i[buf2_n+4]));
+	buf2_n+=5;
+	*l2 = strlen(buf2);
+	break;
+      case 0x27:		/* five-channel telemetry */
+	sprintf(buf2,"T#MIC%03d,%03d,%03d,%03d,%03d",
+		hex2i(i[buf2_n+1],i[buf2_n+2]),
+		hex2i(i[buf2_n+3],i[buf2_n+4]),
+		hex2i(i[buf2_n+5],i[buf2_n+6]),
+		hex2i(i[buf2_n+7],i[buf2_n+8]),
+		hex2i(i[buf2_n+9],i[buf2_n+10]));
+	buf2_n+=11;
+	*l2 = strlen(buf2);
+	break;
+      case 0x1d:		/* five-channel telemetry */
+	sprintf(buf2,"T#MIC%03d,%03d,%03d,%03d,%03d",
+		i[buf2_n+1],i[buf2_n+2],i[buf2_n+3],i[buf2_n+4],i[buf2_n+5]);
+	buf2_n+=6;
+	*l2 = strlen(buf2);
+	break;
+      default:
+	break;			/* no telemetry */
+      }
+    }
+    sprintf(buf1,"@%02d%02d%02dz%d%d%d%d.%d%d%c%c%03d%02d.%02d%c%c%03d/%03d/%c>mon/M%d/%s",
+	    gmt->tm_mday,gmt->tm_hour,gmt->tm_min,
+	    t[0]&0x0f,t[1]&0x0f,t[2]&0x0f,t[3]&0x0f,t[4]&0x0f,t[5]&0x0f,
+	    north,symtbl,
+	    lonDD,lonMM,lonHH,
+	    west,
+	    symbol,
+	    cse,spd,
+	    etype,
+	    msg,msgname[msg]);
+    bp = &buf1[(*l1 = strlen(buf1))];
+    if (buf2_n < l) {		/* additional comments/btext */
+      *bp++ = ' ';		/* add a space */
+      (*l1)++;
+      memcpy(bp,&i[buf2_n],l-buf2_n);
+      *l1 += l-buf2_n;
+    }
+  }
+  return ((*l1>0)+(*l2>0));
+}
+
+/*
+ * here's another APRS device that get's mistreated by some APRS
+ * implementations:  A TNC2 running TheNet X1J4.
+ *
+ *          1         2
+ * 1234567890123456789012
+ * TheNet X-1J4  (RELAY)
+ */
+static u_char x1j4prefix[] = "TheNet X-1J4";
+#define MINX1J4LEN 14		/* min length w/TheNet X1J4 prefix */
+#define MAXX1J4LEN 22		/* max length w/(alias) */
+int
+fmt_x1j4(const u_char *t,	/* tocall */
+	 const u_char *i,	/* info */
+	 const int l,		/* length of info */
+	 u_char *buf1,		/* output buffer */
+	 int *l1,		/* length of output buffer */
+	 u_char *buf2,		/* 2nd output buffer */
+	 int *l2,		/* length of 2nd output buffer */
+	 time_t tick)		/* received timestamp of the packet */
+{
+  const u_char *cp;
+  *l1 = *l2 = 0;
+  if (l < MINX1J4LEN || memcmp(i,x1j4prefix,sizeof(x1j4prefix)-1) != 0)
+    return 0;
+  /* it's a TheNet beacon: either has ()'s w/alias name or no ()'s
+     and the btext starts after some white space! */
+  cp = memchr(&i[MINX1J4LEN],')',MAXX1J4LEN-MINX1J4LEN);
+  if (cp == NULL)		/* no parens (no alias call) */
+    cp = &i[MINX1J4LEN];
+  else
+    cp++;			/* skip over the ) */
+  while (cp <= &i[l-1] && *cp == ' ') cp++; /* skip blanks */
+  memcpy(buf1,cp,*l1=&i[l-1]-cp);
+  return 1;
+}
+
+static unsigned int hex2i(u_char a,u_char b)
+{
+  unsigned int r = 0;
+
+  if (a >= '0' && a <= '9') {
+   r = (a-'0') << 4;
+  } else if (a >= 'A' && a <= 'F') {
+   r = (a-'A'+10) << 4;
+  }
+  if (b >= '0' && b <= '9') {
+   r += (b-'0');
+  } else if (b >= 'A' && b <= 'F') {
+   r += (b-'A'+10);
+  }
+  return r;
+}
diff --git a/mic_e.h b/mic_e.h
new file mode 100644
index 0000000..44a75d2
--- /dev/null
+++ b/mic_e.h
@@ -0,0 +1,22 @@
+/*
+ * mic_e.h: APRS Mic Encoder special case functions
+ */
+
+extern int fmt_mic_e(const u_char *t,	/* tocall */
+	  const u_char *i,	/* info */
+	  const int l,		/* length of info */
+	  u_char *buf1,		/* output buffer */
+	  int *l1,		/* length of output buffer */
+	  u_char *buf2,		/* 2nd output buffer */
+	  int *l2,		/* length of 2nd output buffer */
+	  time_t tick);		/* received timestamp of the packet */
+
+extern int fmt_x1j4(const u_char *t,	/* tocall */
+	  const u_char *i,	/* info */
+	  const int l,		/* length of info */
+	  u_char *buf1,		/* output buffer */
+	  int *l1,		/* length of output buffer */
+	  u_char *buf2,		/* 2nd output buffer */
+	  int *l2,		/* length of 2nd output buffer */
+	  time_t tick);		/* received timestamp of the packet */
+
diff --git a/mic_e_test.c b/mic_e_test.c
new file mode 100644
index 0000000..a4a0a27
--- /dev/null
+++ b/mic_e_test.c
@@ -0,0 +1,53 @@
+#include <stdio.h>
+#include <time.h>
+#include <string.h>
+#include <ctype.h>
+#include <sys/types.h>
+#include <getopt.h>
+#include "mic_e.h"
+
+void
+main(argc,argv)			/* test this formatter */
+int argc;
+char **argv;
+{
+  char b[100];
+  char ob1[512],ob2[512];
+  int ol1,ol2;
+
+  bzero(b,sizeof(b));
+  while (fgets(b,sizeof(b),stdin)) {
+    int tl = strlen(b);
+    u_char *to = strchr(b,'>');
+    u_char *i = strchr(b,':');
+    time_t tick;
+
+    if (tl < sizeof(b) && b[tl-1] == '\n')
+      b[tl-1] = '\0';
+    if (!to || !i) {
+      putchar('?');
+      puts(b);
+      continue;
+    }
+    ++to;
+    ++i;
+    time(&tick);
+    
+    if (fmt_mic_e(to,i,strlen(i),ob1,&ol1,ob2,&ol2,tick)
+	|| fmt_x1j4(to,i,strlen(i),ob1,&ol1,ob2,&ol2,tick)) {
+      if (ol2) {
+	fwrite(ob2,ol2,1,stdout);	/* telemetry */
+	putchar('\n');
+      }
+      if (ol1) {
+	fwrite(ob1,ol1,1,stdout);	/* posit */
+	putchar('\n');
+      }
+    } else {
+      putchar('#');
+      puts(b);
+    }
+    bzero(b,sizeof(b));
+  }
+}
+
diff --git a/missing b/missing
new file mode 100755
index 0000000..6a37006
--- /dev/null
+++ b/missing
@@ -0,0 +1,336 @@
+#! /bin/sh
+# Common stub for a few missing GNU programs while installing.
+# Copyright (C) 1996, 1997, 1999, 2000, 2002 Free Software Foundation, Inc.
+# Originally by Fran,cois Pinard <pinard at 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
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+# 02111-1307, USA.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+if test $# -eq 0; then
+  echo 1>&2 "Try \`$0 --help' for more information"
+  exit 1
+fi
+
+run=:
+
+# In the cases where this matters, `missing' is being run in the
+# srcdir already.
+if test -f configure.ac; then
+  configure_ac=configure.ac
+else
+  configure_ac=configure.in
+fi
+
+case "$1" in
+--run)
+  # Try to run requested program, and just exit if it succeeds.
+  run=
+  shift
+  "$@" && exit 0
+  ;;
+esac
+
+# If it does not exist, or fails to run (possibly an outdated version),
+# try to emulate it.
+case "$1" in
+
+  -h|--h|--he|--hel|--help)
+    echo "\
+$0 [OPTION]... PROGRAM [ARGUMENT]...
+
+Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an
+error status if there is no known handling for PROGRAM.
+
+Options:
+  -h, --help      display this help and exit
+  -v, --version   output version information and exit
+  --run           try to run the given command, and emulate it if it fails
+
+Supported PROGRAM values:
+  aclocal      touch file \`aclocal.m4'
+  autoconf     touch file \`configure'
+  autoheader   touch file \`config.h.in'
+  automake     touch all \`Makefile.in' files
+  bison        create \`y.tab.[ch]', if possible, from existing .[ch]
+  flex         create \`lex.yy.c', if possible, from existing .c
+  help2man     touch the output file
+  lex          create \`lex.yy.c', if possible, from existing .c
+  makeinfo     touch the output file
+  tar          try tar, gnutar, gtar, then tar without non-portable flags
+  yacc         create \`y.tab.[ch]', if possible, from existing .[ch]"
+    ;;
+
+  -v|--v|--ve|--ver|--vers|--versi|--versio|--version)
+    echo "missing 0.4 - GNU automake"
+    ;;
+
+  -*)
+    echo 1>&2 "$0: Unknown \`$1' option"
+    echo 1>&2 "Try \`$0 --help' for more information"
+    exit 1
+    ;;
+
+  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_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_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_ac}'.  You might want
+         to install the \`Autoconf' and \`GNU m4' packages.  Grab them
+         from any GNU archive site."
+    files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}`
+    test -z "$files" && files="config.h"
+    touch_files=
+    for f in $files; do
+      case "$f" in
+      *:*) touch_files="$touch_files "`echo "$f" |
+				       sed -e 's/^[^:]*://' -e 's/:.*//'`;;
+      *) touch_files="$touch_files $f.in";;
+      esac
+    done
+    touch $touch_files
+    ;;
+
+  automake*)
+    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_ac}'.
+         You might want to install the \`Automake' and \`Perl' packages.
+         Grab them from any GNU archive site."
+    find . -type f -name Makefile.am -print |
+	   sed 's/\.am$/.in/' |
+	   while read f; do touch "$f"; done
+    ;;
+
+  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, and you do not seem to have it handy on your
+         system.  You might have modified some files without having the
+         proper tools for further handling them.
+         You can get \`$1Help2man' 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
+         you modified a \`.y' file.  You may need the \`Bison' package
+         in order for those modifications to take effect.  You can get
+         \`Bison' from any GNU archive site."
+    rm -f y.tab.c y.tab.h
+    if [ $# -ne 1 ]; then
+        eval LASTARG="\${$#}"
+	case "$LASTARG" in
+	*.y)
+	    SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
+	    if [ -f "$SRCFILE" ]; then
+	         cp "$SRCFILE" y.tab.c
+	    fi
+	    SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
+	    if [ -f "$SRCFILE" ]; then
+	         cp "$SRCFILE" y.tab.h
+	    fi
+	  ;;
+	esac
+    fi
+    if [ ! -f y.tab.h ]; then
+	echo >y.tab.h
+    fi
+    if [ ! -f y.tab.c ]; then
+	echo 'main() { return 0; }' >y.tab.c
+    fi
+    ;;
+
+  lex|flex)
+    echo 1>&2 "\
+WARNING: \`$1' is missing on your system.  You should only need it if
+         you modified a \`.l' file.  You may need the \`Flex' package
+         in order for those modifications to take effect.  You can get
+         \`Flex' from any GNU archive site."
+    rm -f lex.yy.c
+    if [ $# -ne 1 ]; then
+        eval LASTARG="\${$#}"
+	case "$LASTARG" in
+	*.l)
+	    SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
+	    if [ -f "$SRCFILE" ]; then
+	         cp "$SRCFILE" lex.yy.c
+	    fi
+	  ;;
+	esac
+    fi
+    if [ ! -f lex.yy.c ]; then
+	echo 'main() { return 0; }' >lex.yy.c
+    fi
+    ;;
+
+  help2man)
+    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 a dependency of a manual page.  You may need the
+	 \`Help2man' package in order for those modifications to take
+	 effect.  You can get \`Help2man' from any GNU archive site."
+
+    file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
+    if test -z "$file"; then
+	file=`echo "$*" | sed -n 's/.*--output=\([^ ]*\).*/\1/p'`
+    fi
+    if [ -f "$file" ]; then
+	touch $file
+    else
+	test -z "$file" || exec >$file
+	echo ".ab help2man is required to generate this page"
+	exit 1
+    fi
+    ;;
+
+  makeinfo)
+    if test -z "$run" && (makeinfo --version) > /dev/null 2>&1; then
+       # We have makeinfo, but it failed.
+       exit 1
+    fi
+
+    echo 1>&2 "\
+WARNING: \`$1' is missing on your system.  You should only need it if
+         you modified a \`.texi' or \`.texinfo' file, or any other file
+         indirectly affecting the aspect of the manual.  The spurious
+         call might also be the consequence of using a buggy \`make' (AIX,
+         DU, IRIX).  You might want to install the \`Texinfo' package or
+         the \`GNU make' package.  Grab either from any GNU archive site."
+    file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
+    if test -z "$file"; then
+      file=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
+      file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $file`
+    fi
+    touch $file
+    ;;
+
+  tar)
+    shift
+    if test -n "$run"; then
+      echo 1>&2 "ERROR: \`tar' requires --run"
+      exit 1
+    fi
+
+    # We have already tried tar in the generic part.
+    # Look for gnutar/gtar before invocation to avoid ugly error
+    # messages.
+    if (gnutar --version > /dev/null 2>&1); then
+       gnutar "$@" && 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
+         proper tools for further handling them.  Check the \`README' file,
+         it often tells you about the needed prerequirements for installing
+         this package.  You may also peek at any GNU archive site, in case
+         some other package would contain this missing \`$1' program."
+    exit 1
+    ;;
+esac
+
+exit 0
diff --git a/mkinstalldirs b/mkinstalldirs
new file mode 100755
index 0000000..8ab885e
--- /dev/null
+++ b/mkinstalldirs
@@ -0,0 +1,99 @@
+#! /bin/sh
+# mkinstalldirs --- make directory hierarchy
+# Author: Noah Friedman <friedman at prep.ai.mit.edu>
+# Created: 1993-05-16
+# Public domain
+
+errstatus=0
+dirmode=""
+
+usage="\
+Usage: mkinstalldirs [-h] [--help] [-m mode] dir ..."
+
+# process command line arguments
+while test $# -gt 0 ; do
+   case "${1}" in
+     -h | --help | --h* )			# -h for help
+	echo "${usage}" 1>&2; exit 0 ;;
+     -m )					# -m PERM arg
+	shift
+	test $# -eq 0 && { echo "${usage}" 1>&2; exit 1; }
+	dirmode="${1}"
+	shift ;;
+     -- ) shift; break ;;			# stop option processing
+     -* ) echo "${usage}" 1>&2; exit 1 ;;	# unknown option
+     * )  break ;;				# first non-opt arg
+   esac
+done
+
+for file
+do
+  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 -- "$@"
+  fi ;;
+*)
+  if mkdir -m "$dirmode" -p -- . 2>/dev/null; then
+    echo "mkdir -m $dirmode -p -- $*"
+    exec mkdir -m "$dirmode" -p -- "$@"
+  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
+
+     if test ! -d "$pathcomp"; then
+	echo "mkdir $pathcomp"
+
+	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 ! -z "$lasterr"; then
+	       errstatus=$lasterr
+	     fi
+	  fi
+	fi
+     fi
+
+     pathcomp="$pathcomp/"
+   done
+done
+
+exit $errstatus
+
+# Local Variables:
+# mode: shell-script
+# sh-indentation: 3
+# End:
+# mkinstalldirs ends here
diff --git a/parse_cooked_ax25.fig b/parse_cooked_ax25.fig
new file mode 100644
index 0000000..a042b60
--- /dev/null
+++ b/parse_cooked_ax25.fig
@@ -0,0 +1,164 @@
+#FIG 3.2
+Landscape
+Center
+Inches
+Letter  
+100.00
+Single
+-2
+1200 2
+5 1 0 1 0 7 50 0 -1 0.000 0 0 1 0 3821.677 3827.374 4275 3825 3750 4275 3375 3750
+	0 0 1.00 60.00 120.00
+5 1 0 1 0 7 50 0 -1 0.000 0 0 1 0 3814.195 4314.407 4500 4650 3225 4800 3300 3750
+	0 0 1.00 60.00 120.00
+5 1 0 1 0 7 50 0 -1 0.000 0 1 1 0 2850.000 1370.833 3300 1575 3000 900 2400 1575
+	0 0 1.00 60.00 120.00
+5 1 0 1 0 7 50 0 -1 0.000 0 0 1 0 3358.928 1923.214 3675 2850 2550 2475 2400 1725
+	0 0 1.00 60.00 120.00
+5 1 0 1 0 7 50 0 -1 0.000 0 0 1 0 2662.500 2437.500 2325 3150 1875 2400 2325 1725
+	0 0 1.00 60.00 120.00
+5 1 0 1 0 7 50 0 -1 0.000 0 0 1 0 2323.987 2376.689 2325 3225 1575 2775 1500 2175
+	0 0 1.00 60.00 120.00
+5 1 0 1 0 7 50 0 -1 0.000 0 0 1 0 2212.500 2362.500 1575 2025 1875 1725 2325 1650
+	0 0 1.00 60.00 120.00
+6 2250 1500 2550 1800
+6 2250 1500 2550 1800
+1 3 0 1 0 7 50 0 -1 0.000 1 0.0000 2400 1650 106 106 2400 1650 2475 1725
+-6
+4 1 0 50 0 0 12 0.0000 4 135 90 2400 1725 3\001
+-6
+6 3150 1500 3450 1800
+6 3150 1500 3450 1800
+1 3 0 1 0 7 50 0 -1 0.000 1 0.0000 3300 1650 106 106 3300 1650 3375 1725
+-6
+4 1 0 50 0 0 12 0.0000 4 135 90 3300 1725 5\001
+-6
+6 2250 3075 2550 3375
+6 2250 3075 2550 3375
+1 3 0 1 0 7 50 0 -1 0.000 1 0.0000 2400 3225 106 106 2400 3225 2475 3300
+-6
+4 1 0 50 0 0 12 0.0000 4 135 90 2400 3300 4\001
+-6
+6 3225 3525 3525 3825
+6 3225 3525 3525 3825
+1 3 0 1 0 7 50 0 -1 0.000 1 0.0000 3375 3675 106 106 3375 3675 3450 3750
+-6
+4 1 0 50 0 0 12 0.0000 4 135 90 3375 3750 6\001
+-6
+6 4125 3525 4425 3825
+6 4125 3525 4425 3825
+1 3 0 1 0 7 50 0 -1 0.000 1 0.0000 4275 3675 106 106 4275 3675 4350 3750
+-6
+4 1 0 50 0 0 12 0.0000 4 135 90 4275 3750 8\001
+-6
+6 4425 4425 4725 4725
+6 4425 4425 4725 4725
+1 3 0 1 0 7 50 0 -1 0.000 1 0.0000 4575 4575 106 106 4575 4575 4650 4650
+-6
+4 1 0 50 0 0 12 0.0000 4 135 180 4575 4650 10\001
+-6
+6 3600 2700 3900 3000
+6 3600 2700 3900 3000
+1 3 0 1 0 7 50 0 -1 0.000 1 0.0000 3750 2850 106 106 3750 2850 3825 2925
+-6
+4 1 0 50 0 0 12 0.0000 4 135 90 3750 2925 7\001
+-6
+6 900 3075 1200 3375
+1 3 0 1 0 7 50 0 -1 0.000 1 0.0000 1050 3225 106 106 1050 3225 1125 3300
+4 1 0 50 0 0 12 0.0000 4 135 90 1050 3300 2\001
+-6
+6 1350 1950 1650 2250
+6 1350 1950 1650 2250
+1 3 0 1 0 7 50 0 -1 0.000 1 0.0000 1500 2100 106 106 1500 2100 1575 2175
+-6
+4 1 0 50 0 0 12 0.0000 4 135 180 1500 2175 11\001
+-6
+1 3 0 1 0 7 50 0 -1 0.000 1 0.0000 750 2325 106 106 750 2325 825 2400
+1 3 0 1 0 7 50 0 -1 0.000 1 0.0000 1125 1650 106 106 1125 1650 1200 1725
+2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 2
+	0 0 1.00 60.00 120.00
+	 1125 3225 2273 3225
+2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 2
+	0 0 1.00 60.00 120.00
+	 1200 1650 2325 1650
+2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 2
+	0 0 1.00 60.00 120.00
+	 2498 1650 3173 1650
+2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 2
+	0 0 1.00 60.00 120.00
+	 2475 3150 5250 3600
+2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 2
+	0 0 1.00 60.00 120.00
+	 2475 3300 3248 3675
+2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 2
+	0 0 1.00 60.00 120.00
+	 3473 3675 4148 3675
+2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 2
+	0 0 1.00 60.00 120.00
+	 4373 3675 5250 3675
+2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 2
+	0 0 1.00 60.00 120.00
+	 4364 3746 4589 4496
+2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 2
+	0 0 1.00 60.00 120.00
+	 4650 4500 5250 3750
+2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 2
+	0 0 1.00 60.00 120.00
+	 3375 1725 5250 3525
+2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 2
+	0 0 1.00 60.00 120.00
+	 3300 1725 3750 2775
+2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 2
+	0 0 1.00 60.00 120.00
+	 825 2400 1050 3150
+2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 2
+	0 0 1.00 60.00 120.00
+	 825 2250 1125 1725
+2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 2
+	0 0 1.00 60.00 120.00
+	 225 1800 750 2250
+4 0 4 50 0 0 18 0.0000 4 75 60 2775 3375 ,\001
+4 0 4 50 0 0 18 0.0000 4 75 60 3750 4125 ,\001
+4 0 4 50 0 0 18 0.0000 4 135 60 4575 3600 :\001
+4 0 4 50 0 0 16 0.0000 4 90 120 4500 4200 *\001
+4 0 4 50 0 0 18 0.0000 4 135 60 4875 4125 :\001
+4 0 4 50 0 0 18 0.0000 4 75 60 3750 4950 ,\001
+4 1 0 50 0 0 12 0.0000 4 135 120 4350 4200 R\001
+4 0 4 50 0 0 18 0.0000 4 135 60 3225 3225 :\001
+4 0 4 50 0 0 12 0.0000 4 180 585 3525 3600 callsign\001
+4 0 0 50 0 0 12 0.0001 4 180 690 3450 3900 digi[n++]\001
+4 0 4 50 0 0 12 0.0000 4 180 585 2550 1575 callsign\001
+4 0 4 50 0 0 18 0.0000 4 135 165 2850 825 >\001
+4 0 0 50 0 0 12 0.0001 4 180 690 2475 1200 digi[n++]\001
+4 0 4 50 0 0 18 0.0000 4 135 60 4275 2475 :\001
+4 0 0 50 0 0 12 5.4978 4 135 555 3975 2550 dst call\001
+4 0 4 50 0 0 16 0.0000 4 90 120 3450 2175 *\001
+4 0 0 50 0 0 12 5.1487 4 135 120 3225 2175 R\001
+4 0 0 50 0 0 12 0.0000 4 135 105 5400 3675 T\001
+4 0 0 50 0 0 12 5.8469 4 135 555 2475 3525 dst call\001
+4 0 0 50 0 0 12 6.1087 4 135 555 3000 3450 dst call\001
+4 0 0 50 0 0 12 1.2218 4 180 690 2025 2550 digi[n++]\001
+4 0 0 50 0 0 12 5.3233 4 180 690 2325 2400 digi[n++]\001
+4 0 4 50 0 0 18 0.0000 4 135 165 2925 2700 >\001
+4 1 0 50 0 0 12 0.0000 4 180 1500 5025 750 parse_cooked_ax25\001
+4 1 0 50 0 0 12 0.0000 4 180 1035 5025 975 state diagram\001
+4 1 4 50 0 0 12 0.0000 4 135 855 5025 1200 red = token\001
+4 1 0 50 0 0 12 0.0000 4 135 1065 5025 1425 black = action\001
+4 1 0 50 0 0 12 0.0000 4 180 600 5250 4425 (TNC2)\001
+4 1 0 50 0 0 12 0.0000 4 180 540 5250 3000 (AEA)\001
+4 1 0 50 0 0 12 0.0000 4 135 90 750 2400 0\001
+4 0 4 50 0 0 16 0.0000 4 90 120 825 2100 *\001
+4 0 0 50 0 0 12 1.0472 4 135 435 975 2325 direct\001
+4 1 0 50 0 0 12 0.0000 4 135 90 1125 1725 1\001
+4 0 4 50 0 0 18 0.0000 4 135 165 975 2700 >\001
+4 0 4 50 0 0 12 5.5851 4 180 585 300 1800 callsign\001
+4 0 0 50 0 0 12 5.5851 4 135 555 150 1950 src call\001
+4 0 0 50 0 0 12 0.0000 4 135 285 225 1650 n=0\001
+4 0 0 50 0 0 12 0.0000 4 135 60 225 1425 I\001
+4 0 4 50 0 0 18 0.0000 4 135 165 1500 1575 >\001
+4 0 4 50 0 0 16 0.0000 4 90 120 1350 2775 *\001
+4 0 4 50 0 0 12 0.0000 4 180 585 1200 3150 callsign\001
+4 0 4 50 0 0 18 0.0000 4 135 165 1875 1950 >\001
+4 0 4 50 0 0 18 0.0000 4 135 165 1500 1875 >\001
+4 1 0 50 0 0 12 1.5708 4 135 120 1650 2400 R\001
+4 0 0 50 0 0 12 2.2690 4 180 690 2100 3075 digi[n++]\001
diff --git a/parse_cooked_ax25.pdf b/parse_cooked_ax25.pdf
new file mode 100644
index 0000000..0e656c5
Binary files /dev/null and b/parse_cooked_ax25.pdf differ
diff --git a/testmcast.c b/testmcast.c
new file mode 100644
index 0000000..b83b39a
--- /dev/null
+++ b/testmcast.c
@@ -0,0 +1,184 @@
+/* test multicast */
+#include <sys/types.h>
+#include <sys/time.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <sys/socket.h>
+#include <net/if.h>
+#include <netinet/if_ether.h>
+#include <netinet/in.h>
+#include <sys/ioctl.h>
+#include <unistd.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <ctype.h>
+#include <time.h>
+#include <signal.h>
+#include <errno.h>
+#include <netax25/kernel_ax25.h>
+#include <netax25/kernel_rose.h>
+#include <netax25/ax25.h>
+#include <netax25/axlib.h>
+#include <netax25/axconfig.h>
+#ifndef AX25_MTU
+#define AX25_MTU 256
+#endif
+#include <netdb.h>
+#include "libax25ext.h"
+
+static void
+die(char *p, char *s)
+{
+  fprintf(stderr,"%s: ",p);
+  perror(s);
+  exit(1);
+}
+
+main(int argc,char **argv)
+{
+  struct sockaddr_in sin;
+  struct sockaddr tsa, rsa;
+  struct hostent *hp;
+  struct servent *sp;
+  char *name = argv[1], *service = argv[2], *ttl = argv[3];
+  const int one=1;
+  int ttlval;
+  int tsock, rsock;
+  unsigned char buffer[AX25_MTU];
+  int selfds = 0;
+  fd_set select_mask;
+
+  if (argc < 4 || (ttlval = atoi(ttl)) <= 0) {
+    fprintf(stderr,"Usage: %s destination port ttl\n",argv[0]);
+    exit(1);
+  }
+
+  fprintf(stderr,"opening UDP socket on %s/%s/%d\n", name, service, ttlval);
+
+  bzero(&sin, sizeof(struct sockaddr_in));
+  if (isdigit(*name)) {
+    sin.sin_addr.s_addr = inet_addr(name);
+  }
+  else if (hp = gethostbyname(name)) {
+    bcopy(hp->h_addr, (char *)&sin.sin_addr, hp->h_length);
+  }
+  else {
+    fprintf(stderr,"Unrecognized host name: %s\n",name);
+    exit(1);
+  }
+
+  if (isdigit(*service)) {
+    sin.sin_port = htons(atoi(service));
+  }
+  else if (sp = getservbyname(service,"udp")) {
+    sin.sin_port = sp->s_port;
+  }
+  else {
+    fprintf(stderr,"Unrecognized service: %s\n",service);
+    exit(1);
+  }
+  sin.sin_family = AF_INET;
+
+  if (argc == 4) {
+    if ((tsock = socket(AF_INET, SOCK_DGRAM, 0)) == -1) {
+      perror(name);
+      exit(1);
+    }
+    if (setsockopt(tsock, SOL_SOCKET, SO_REUSEADDR, &one, sizeof(one)) < 0)
+      die("setsockopt SO_REUSEADDR",name);
+    if (IN_MULTICAST(ntohl(sin.sin_addr.s_addr))) {
+      if (setsockopt(tsock, SOL_IP, IP_MULTICAST_TTL, &ttlval, sizeof(ttlval)) < 0)
+	die("setsockopt MULTICAST_TTL",name);
+    } else {
+      if (setsockopt(tsock, SOL_IP, IP_TTL, &ttlval, sizeof(ttlval)) < 0)
+	die("setsockopt IP_TTL",name);
+    }
+    
+    bzero(&tsa,sizeof(tsa));
+    bcopy(&sin,&tsa,sizeof(sin)); /* fill sockaddr w/sockaddr_in */
+    
+  }
+  if (argc == 4) {
+    if (connect(tsock, &tsa, sizeof(struct sockaddr)) < 0) {
+      die("connect(tsock)",name);
+    }
+  }
+
+  /* now the rsock */
+
+  if ((rsock = socket(AF_INET, SOCK_DGRAM, 0)) == -1) {
+    die("rsock = socket",name);
+  }
+
+  if (setsockopt(rsock, SOL_SOCKET, SO_REUSEADDR, &one, sizeof(one)) < 0)
+    die("rsock SO_REUSEADDR",name);
+
+  /* if the UDP socket is a multicast group, then do IGMP join for rsock */
+
+  if (!IN_MULTICAST(ntohl(sin.sin_addr.s_addr)))
+    sin.sin_addr.s_addr = INADDR_ANY;
+
+  bzero(&rsa,sizeof(rsa));
+  bcopy(&sin,&rsa,sizeof(sin));
+  
+  if (bind(rsock, &rsa, sizeof(struct sockaddr)) < 0) {
+    die("bind(rsock)",name);
+  }
+
+  if (IN_MULTICAST(ntohl(sin.sin_addr.s_addr))) {
+    struct ip_mreq mreq;
+    mreq.imr_multiaddr = sin.sin_addr;
+    mreq.imr_interface.s_addr = INADDR_ANY;
+    setsockopt(rsock, IPPROTO_IP, IP_ADD_MEMBERSHIP, &mreq, sizeof(mreq));
+  }
+
+  /* sockets set up, enter loop, receiving from stdin & rsock,
+     transmitting what's read from stdin on tsock */
+
+  /* set up the initial select mask */
+  FD_ZERO(&select_mask);
+  FD_SET(rsock, &select_mask);
+  FD_SET(0, &select_mask);
+  selfds = rsock+1;
+  for (;;) {
+    int len;
+    fd_set rmask = select_mask;
+    int size = sizeof(struct sockaddr);
+    
+    fprintf(stderr,"before select rsock=%d rmask=0x%0x\n",rsock,rmask);
+    if (select(selfds,&rmask,NULL,NULL,NULL) < 0) {
+      if (errno == EINTR)
+	continue;
+      perror("select");
+      return 1;
+    }
+    fprintf(stderr,"after select rmask=0x%0x\n",rmask);    
+    /* find which sockets have data */
+    if (FD_ISSET(rsock,&rmask)) {
+      fprintf(stderr,"rsock was set\n");
+      if ((len = recvfrom(rsock,buffer,sizeof(buffer),0,&rsa,&size)) < 0) {
+	if (errno == EINTR)
+	  continue;
+	perror(name);
+	exit(1);
+      }
+      fprintf(stderr,"rsock rec'd %d: %s\n",len,buffer);
+    }
+    if (FD_ISSET(0,&rmask)) {
+      int r;
+      fprintf(stderr,"stdin was set\n");
+      if ((len = read(0,buffer,sizeof(buffer))) < 0) {
+	perror("stdin");
+	exit(1);
+      }
+      fprintf(stderr,"stdin read %d: %s\n",len,buffer);
+      /* now xmit it */
+      if ((r = sendto(tsock,buffer,len,0,&tsa,sizeof(tsa))) < 0)
+	die("sendto","xmit");
+      fprintf(stderr,"transmitted %d\n",r);
+    }
+    
+  } /* end of for(;;) */
+  return 0;			/* NOTREACHED */
+}
diff --git a/testparse.c b/testparse.c
new file mode 100644
index 0000000..3daeb38
--- /dev/null
+++ b/testparse.c
@@ -0,0 +1,129 @@
+/* test parse_cooked_ax25 */
+#include <sys/types.h>
+#include <sys/time.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <sys/socket.h>
+#include <net/if.h>
+#include <netinet/if_ether.h>
+#include <netinet/in.h>
+#include <sys/ioctl.h>
+#include <unistd.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <ctype.h>
+#include <time.h>
+#include <signal.h>
+#include <errno.h>
+#include <netax25/kernel_ax25.h>
+#include <netax25/kernel_rose.h>
+#include <netax25/ax25.h>
+#include <netax25/axlib.h>
+#include <netax25/axconfig.h>
+#include <netdb.h>
+#include "libax25ext.h"
+static void print_it(FILE *f,
+	 struct ax_calls *calls,
+	 u_char *data,
+	      int len);
+static void drop_unused_digis(struct ax_calls *);
+
+main()
+{
+  unsigned char buf[2048],*bp;
+  int buflen, *lp = &buflen;
+
+  while (fgets(buf,sizeof(buf),stdin)) {
+    unsigned char obuf[2048], *op;
+    int r,olen = sizeof(obuf), *olp = &olen;
+    struct ax_calls calls;
+
+    bp = buf;
+    buflen = strlen(buf);
+    if (buf[buflen-1] == '\n')
+      buf[--buflen] = '\0';
+    op = obuf;
+    olen = sizeof(obuf);
+    bzero(obuf,sizeof(obuf));
+    fprintf(stderr,"================================\ninput: %s\n",buf);
+    switch(r=parse_cooked_ax25(&bp,lp,&calls)) {
+    case PK_VALID:
+    case PK_VALDIGI:
+      fprintf(stderr,"valid%s packet.  n_digis: %d next_digi: %d  type: %d  pid: %d\n",
+	      (r==PK_VALDIGI)?" repeatable":"",
+	      calls.ax_n_digis, calls.ax_next_digi, calls.ax_type, calls.ax_pid);
+      fprintf(stderr,"data @0x%0x (len %d): %s\n",bp,buflen,bp);
+      fprintf(stderr,"---- print_it ----\n");
+      print_it(stderr,&calls,bp,buflen);
+      fprintf(stderr,"---- gen_cooked thing: ----\n");
+      fprintf(stderr,"gen_cooked rc: %d\n",gen_cooked_ax25(&op,olp,&calls));
+      fprintf(stderr,"cooked at 0x%0x (len %d): %s\n",obuf,olen,obuf);/* ?? */
+      fprintf(stderr,"data @0x%0x (len %d): %s\n", bp, buflen, bp);
+      strncpy(&obuf[sizeof(obuf)-olen],bp,buflen);
+      printf("%s\n",obuf);
+      fprintf(stderr,"after dropping unused digis:\n");
+      drop_unused_digis(&calls);
+      fprintf(stderr,"  n_digis: %d next_digi: %d  type: %d  pid: %d\n",
+	      calls.ax_n_digis, calls.ax_next_digi, calls.ax_type, calls.ax_pid);
+      print_it(stderr,&calls,bp,buflen);
+      break;
+    case PK_INVALID:
+      fprintf(stderr,"failed to parse\n");
+      break;
+    default:
+      fprintf(stderr,"bogus return value\n");
+      break;
+    }
+  }
+}
+
+/* some defines that really belong in a header file! */
+#define	ALEN		6	/* index to where the SSID and flags go */
+#define	AXLEN		7	/* length of a callsign */
+/* SSID mask and various flags that are stuffed into the SSID byte */
+#define	SSID		0x1E
+#define	HDLCAEB		0x01
+#define	REPEATED	0x80
+
+#define	UI		0x03	/* unnumbered information (unproto) */
+#define	PID_NO_L3	0xF0	/* no level-3 (text) */
+#define	C		0x80
+#define	SSSID_SPARE	0x40	/* must be set if not used */
+#define	ESSID_SPARE	0x20
+
+static void
+print_it(FILE *f,
+	 struct ax_calls *calls,
+	 u_char *data,
+	 int len)
+{
+  int j;
+  char asc_from[12],asc_to[12];
+
+  if (f == NULL)
+    return;
+  fprintf(stderr,"print_it: n_digis %d next_digi %d\n",
+	  calls->ax_n_digis,calls->ax_next_digi);
+  strncpy(asc_to,ax25_ntoa_pretty(&calls->ax_to_call),sizeof(asc_to));
+  strncpy(asc_from,ax25_ntoa_pretty(&calls->ax_from_call),sizeof(asc_from));
+  fprintf(f,"%s>%s",asc_from,asc_to);
+  for (j = 0; j < calls->ax_n_digis; j++) {
+    fprintf(stderr,"\nprint_it: digi[%d]: %s %s\n",j,
+	    (calls->ax_digi_call[j].ax25_call[ALEN]&REPEATED)?"REPEATED":"",
+	    (calls->ax_digi_call[j].ax25_call[ALEN]&HDLCAEB)?"HDLCAEB":"");
+    fprintf(f,",%s%s",ax25_ntoa_pretty(&calls->ax_digi_call[j]),
+	    (calls->ax_digi_call[j].ax25_call[ALEN]&REPEATED
+		&& (j == calls->ax_next_digi-1))?"*":"");
+  }
+  fprintf(f,":%.*s\n",len,data);
+}
+
+static void 
+drop_unused_digis(struct ax_calls *calls) 
+{
+  if (!calls->ax_n_digis || calls->ax_next_digi >= calls->ax_n_digis)
+    return;			/* all digis are used up */
+  calls->ax_n_digis = calls->ax_next_digi; /* truncate the list */
+  calls->ax_digi_call[calls->ax_next_digi-1].ax25_call[ALEN] |= HDLCAEB;
+}

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-hamradio/aprsdigi.git



More information about the pkg-hamradio-commits mailing list