Initial revision
authorPhil Blundell <philb@gnu.org>
Thu, 8 Jan 1998 09:54:43 +0000 (09:54 +0000)
committerPhil Blundell <philb@gnu.org>
Thu, 8 Jan 1998 09:54:43 +0000 (09:54 +0000)
148 files changed:
COPYING [new file with mode: 0644]
ChangeLog [new file with mode: 0644]
INSTALLING [new file with mode: 0644]
Makefile [new file with mode: 0644]
README [new file with mode: 0644]
README.ipv6 [new file with mode: 0644]
TODO [new file with mode: 0644]
arp.c [new file with mode: 0644]
config.in [new file with mode: 0644]
configure.sh [new file with mode: 0755]
hostname.c [new file with mode: 0644]
ifconfig.c [new file with mode: 0644]
include/ipx.h [new file with mode: 0644]
lib/Makefile [new file with mode: 0644]
lib/activate.c [new file with mode: 0644]
lib/af.c [new file with mode: 0644]
lib/arcnet.c [new file with mode: 0644]
lib/ax25.c [new file with mode: 0644]
lib/ax25_gr.c [new file with mode: 0644]
lib/ddp.c [new file with mode: 0644]
lib/ddp_gr.c [new file with mode: 0644]
lib/ether.c [new file with mode: 0644]
lib/frame.c [new file with mode: 0644]
lib/getargs.c [new file with mode: 0644]
lib/getroute.c [new file with mode: 0644]
lib/hw.c [new file with mode: 0644]
lib/inet.c [new file with mode: 0644]
lib/inet6.c [new file with mode: 0644]
lib/inet6_gr.c [new file with mode: 0644]
lib/inet6_sr.c [new file with mode: 0644]
lib/inet_gr.c [new file with mode: 0644]
lib/inet_sr.c [new file with mode: 0644]
lib/ipx.c [new file with mode: 0644]
lib/ipx_gr.c [new file with mode: 0644]
lib/ipx_sr.c [new file with mode: 0644]
lib/loopback.c [new file with mode: 0644]
lib/masq_info.c [new file with mode: 0644]
lib/net-features.h [new file with mode: 0644]
lib/net-locale.h [new file with mode: 0644]
lib/net-string.c [new file with mode: 0644]
lib/net-support.h [new file with mode: 0644]
lib/netrom.c [new file with mode: 0644]
lib/netrom_gr.c [new file with mode: 0644]
lib/netrom_sr.c [new file with mode: 0644]
lib/pathnames.h [new file with mode: 0644]
lib/ppp.c [new file with mode: 0644]
lib/ppp_ac.c [new file with mode: 0644]
lib/setroute.c [new file with mode: 0644]
lib/sit.c [new file with mode: 0644]
lib/slip.c [new file with mode: 0644]
lib/slip_ac.c [new file with mode: 0644]
lib/tr.c [new file with mode: 0644]
lib/tunnel.c [new file with mode: 0644]
lib/unix.c [new file with mode: 0644]
man/Makefile [new file with mode: 0644]
man/en_US.88591/arp.8 [new file with mode: 0644]
man/en_US.88591/dnsdomainname.1 [new file with mode: 0644]
man/en_US.88591/domainname.1 [new file with mode: 0644]
man/en_US.88591/ethers.5 [new file with mode: 0644]
man/en_US.88591/hostname.1 [new file with mode: 0644]
man/en_US.88591/ifconfig.8 [new file with mode: 0644]
man/en_US.88591/netstat.8 [new file with mode: 0644]
man/en_US.88591/nisdomainname.1 [new file with mode: 0644]
man/en_US.88591/rarp.8 [new file with mode: 0644]
man/en_US.88591/route.8 [new file with mode: 0644]
man/en_US.88591/ypdomainname.1 [new file with mode: 0644]
man/fr_FR.88591/arp.8 [new file with mode: 0644]
man/fr_FR.88591/dnsdomainname.1 [new file with mode: 0644]
man/fr_FR.88591/domainname.1 [new file with mode: 0644]
man/fr_FR.88591/hostname.1 [new file with mode: 0644]
man/fr_FR.88591/ifconfig.8 [new file with mode: 0644]
man/fr_FR.88591/ipfw.8 [new file with mode: 0644]
man/fr_FR.88591/netstat.8 [new file with mode: 0644]
man/fr_FR.88591/nisdomainname.1 [new file with mode: 0644]
man/fr_FR.88591/rarp.8 [new file with mode: 0644]
man/fr_FR.88591/route.8 [new file with mode: 0644]
man/fr_FR.88591/ypdomainname.1 [new file with mode: 0644]
netstat.c [new file with mode: 0644]
nls/Makefile [new file with mode: 0644]
nls/de_DE.88591/README [new file with mode: 0644]
nls/de_DE.88591/arcnet.m [new file with mode: 0644]
nls/de_DE.88591/arp.m [new file with mode: 0644]
nls/de_DE.88591/ax25.m [new file with mode: 0644]
nls/de_DE.88591/ddp.m [new file with mode: 0644]
nls/de_DE.88591/ether.m [new file with mode: 0644]
nls/de_DE.88591/hostname.m [new file with mode: 0644]
nls/de_DE.88591/ifconfig.m [new file with mode: 0644]
nls/de_DE.88591/inet.m [new file with mode: 0644]
nls/de_DE.88591/ipfw.m [new file with mode: 0644]
nls/de_DE.88591/ipx.m [new file with mode: 0644]
nls/de_DE.88591/lib.m [new file with mode: 0644]
nls/de_DE.88591/loopback.m [new file with mode: 0644]
nls/de_DE.88591/netrom.m [new file with mode: 0644]
nls/de_DE.88591/netstat.m [new file with mode: 0644]
nls/de_DE.88591/plipconfig.m [new file with mode: 0644]
nls/de_DE.88591/ppp.m [new file with mode: 0644]
nls/de_DE.88591/rarp.m [new file with mode: 0644]
nls/de_DE.88591/route.m [new file with mode: 0644]
nls/de_DE.88591/slattach.m [new file with mode: 0644]
nls/de_DE.88591/slip.m [new file with mode: 0644]
nls/de_DE.88591/tunnel.m [new file with mode: 0644]
nls/de_DE.88591/unix.m [new file with mode: 0644]
nls/en_US.88591/arcnet.m [new file with mode: 0644]
nls/en_US.88591/arp.m [new file with mode: 0644]
nls/en_US.88591/ax25.m [new file with mode: 0644]
nls/en_US.88591/ddp.m [new file with mode: 0644]
nls/en_US.88591/ether.m [new file with mode: 0644]
nls/en_US.88591/hostname.m [new file with mode: 0644]
nls/en_US.88591/ifconfig.m [new file with mode: 0644]
nls/en_US.88591/inet.m [new file with mode: 0644]
nls/en_US.88591/ipfw.m [new file with mode: 0644]
nls/en_US.88591/ipx.m [new file with mode: 0644]
nls/en_US.88591/lib.m [new file with mode: 0644]
nls/en_US.88591/loopback.m [new file with mode: 0644]
nls/en_US.88591/netrom.m [new file with mode: 0644]
nls/en_US.88591/netstat.m [new file with mode: 0644]
nls/en_US.88591/plipconfig.m [new file with mode: 0644]
nls/en_US.88591/ppp.m [new file with mode: 0644]
nls/en_US.88591/rarp.m [new file with mode: 0644]
nls/en_US.88591/route.m [new file with mode: 0644]
nls/en_US.88591/slattach.m [new file with mode: 0644]
nls/en_US.88591/slip.m [new file with mode: 0644]
nls/en_US.88591/tunnel.m [new file with mode: 0644]
nls/en_US.88591/unix.m [new file with mode: 0644]
nls/fr_FR.88591/arcnet.m [new file with mode: 0644]
nls/fr_FR.88591/arp.m [new file with mode: 0644]
nls/fr_FR.88591/ax25.m [new file with mode: 0644]
nls/fr_FR.88591/ddp.m [new file with mode: 0644]
nls/fr_FR.88591/ether.m [new file with mode: 0644]
nls/fr_FR.88591/hostname.m [new file with mode: 0644]
nls/fr_FR.88591/ifconfig.m [new file with mode: 0644]
nls/fr_FR.88591/inet.m [new file with mode: 0644]
nls/fr_FR.88591/ipfw.m [new file with mode: 0644]
nls/fr_FR.88591/ipx.m [new file with mode: 0644]
nls/fr_FR.88591/lib.m [new file with mode: 0644]
nls/fr_FR.88591/loopback.m [new file with mode: 0644]
nls/fr_FR.88591/netrom.m [new file with mode: 0644]
nls/fr_FR.88591/netstat.m [new file with mode: 0644]
nls/fr_FR.88591/plipconfig.m [new file with mode: 0644]
nls/fr_FR.88591/ppp.m [new file with mode: 0644]
nls/fr_FR.88591/rarp.m [new file with mode: 0644]
nls/fr_FR.88591/route.m [new file with mode: 0644]
nls/fr_FR.88591/slattach.m [new file with mode: 0644]
nls/fr_FR.88591/slip.m [new file with mode: 0644]
nls/fr_FR.88591/unix.m [new file with mode: 0644]
rarp.c [new file with mode: 0644]
route.c [new file with mode: 0644]
statistics.c [new file with mode: 0644]

diff --git a/COPYING b/COPYING
new file mode 100644 (file)
index 0000000..a43ea21
--- /dev/null
+++ b/COPYING
@@ -0,0 +1,339 @@
+                   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.
+\f
+                   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.)
+\f
+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.
+\f
+  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.
+\f
+  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
+\f
+       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 (file)
index 0000000..4578363
--- /dev/null
+++ b/ChangeLog
@@ -0,0 +1,26 @@
+Tue Sep 23 20:58:27 1997  Philip Blundell  <Philip.Blundell@pobox.com>
+
+       * ifconfig.c (if_getstats): use _PATH_PROCNET_DEV rather than
+       hardcoding.
+       * lib/pathnames.h (_PATH_PROCNET_DEV): define.
+
+       * ifconfig.c (set_flag): tidy up.
+       (clr_flag): likewise.
+
+Sun Sep 21 18:26:24 1997  Philip Blundell  <Philip.Blundell@pobox.com>
+
+       * Makefile (RELEASE): set to 1.432
+       * version.h (RELEASE): likewise.
+
+       * TODO: updated.
+       * README: likewise.
+
+       * ifconfig.c (set_flag): print error message if no such interface.
+       (clr_flag): likewise.
+
+       * lib/net-features.h: remove ipfw stuff, add INET6
+       
+       * netstat.c: include <net/route.h> for net-features.  Patch by
+       Roderich Schupp <rsch@ExperTeam.de> 
+       * route.c: likewise.
+       
\ No newline at end of file
diff --git a/INSTALLING b/INSTALLING
new file mode 100644 (file)
index 0000000..ed544b0
--- /dev/null
@@ -0,0 +1,60 @@
+net-tools
+
+                               INSTALLING
+
+Please read the file `README' before you start with the installation of the
+net-tools.
+
+
+
+HACKERS WAY
+-----------
+cd /usr/src ; tar xvzf net-tools*.tar.gz
+less Makefile ; make config ; make ; make -n install ; make install
+
+
+
+CONFIGURE
+---------
+First of all change into the net-tools directory.
+
+Before you start with the Installation please have a look into the toplevel
+Makefile. There are some configuration options with explanations.
+
+To configure the compilation use "make config".
+
+If you have a recent Kernel you can and SHOULD answer ALL the Configuration
+Options with YES. You only have to decide about the NLS:
+
+If you don't know whether NLS is supported on your system or not, see
+/usr/include/locale.h. If it exists, there is every chance that NLS is
+supported. You also need the "gencat" program if you want to compile with
+National Language Support.
+
+On some BETA Releases NLS is disabled, cause the catalougs are out of sync
+with the development source-tree.
+
+
+
+COMPILE
+-------  
+To compile simply use "make".
+
+There should be no warnings or errors.
+
+
+
+INSTALLATION
+------------
+If you want to install the binaries use "make install".
+
+This will generate backups of your old binaries. If you dont want the
+backups, please use "make update" instead. To change the default permissions
+and ownerships of the installed binaries and manpages edit the Makefile. You
+can test the Installation with "make -n install". This will tell make: Don't
+run any commands, just print them.
+
+
+
+Bernd 'eckes' Eckenfels
+<net-tools@lina.inka.de>
diff --git a/Makefile b/Makefile
new file mode 100644 (file)
index 0000000..495210e
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,251 @@
+#
+# Makefile     Main Makefile for the net-tools Package
+#
+# NET-TOOLS    A collection of programs that form the base set of the
+#              NET-3 Networking Distribution for the LINUX operating
+#              system.
+#
+# Version:     Makefile 1.33 (1996-05-18)
+#
+# Author:      Bernd Eckenfels <net-tools@lina.inka.de>
+#              Copyright 1995-1996 Bernd Eckebnfels, Germany
+#
+# URLs:                ftp://ftp.inka.de/pub/comp/Linux/networking/NetTools/ 
+#              ftp://ftp.linux.org.uk/pub/linux/Networking/PROGRAMS/NetTools/
+#              http://www.inka.de/sites/lina/linux/NetTools/index_en.html
+#
+# Based on:    Fred N. van Kempen, <waltje@uwalt.nl.mugnet.org>
+#              Copyright 1988-1993 MicroWalt Corporation
+#
+# Modifications:
+#              Extensively modified from 01/21/94 onwards by
+#              Alan Cox <A.Cox@swansea.ac.uk>
+#              Copyright 1993-1994 Swansea University Computer Society
+#              
+#
+#      {1.20}  Bernd Eckenfels:        Even more modifications for the new 
+#                                      package layout
+#      {1.21}  Bernd Eckenfels:        Check if config.in is newer than 
+#                                      config.status
+#      {1.22}  Bernd Eckenfels:        Include ypdomainname and nisdomainame
+#
+#      1.3.50-BETA6 private Release
+#                              
+#960125        {1.23}  Bernd Eckenfels:        Peter Tobias' rewrite for 
+#                                      makefile-based installation
+#      1.3.50-BETA6a private Release
+#
+#960201 {1.24} Bernd Eckenfels:        net-features.h added
+#
+#960201 1.3.50-BETA6b private Release
+#
+#960203 1.3.50-BETA6c private Release
+#
+#960204 1.3.50-BETA6d private Release
+#
+#960204 {1.25} Bernd Eckenfels:        DISTRIBUTION added
+#
+#960205 1.3.50-BETA6e private Release
+#
+#960206        {1.26}  Bernd Eckenfels:        afrt.o removed (cleaner solution)
+#
+#960215 1.3.50-BETA6f Release
+#
+#960216 {1.30} Bernd Eckenfels:        net-lib support
+#960322 {1.31} Bernd Eckenfels:        moveable netlib, TOPDIR
+#960424 {1.32} Bernd Eckenfels:        included the URLs in the Comment
+#
+#960514 1.31-alpha release
+#
+#960518 {1.33} Bernd Eckenfels:        -I/usr/src/linux/include comment added
+#
+#      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.
+#
+
+# set the base of the Installation 
+# BASEDIR = /mnt
+
+#
+# DON'T CHANGE ANY of the NLS-Support definitions, it's disabled
+#
+# set default language (DEF_LANG) to en_US.88591 if you don't use NLS
+DEF_LANG = en_US.88591
+
+# install national language support for the following languages
+# ADD_LANG = fr_FR.88591 de_DE.88591
+
+# path to the net-lib support library. Default: lib
+NET-LIB-PATH = lib
+NET-LIB-NAME = support
+
+PROGS  = ifconfig hostname arp netstat route rarp 
+
+# Compiler and Linker Options
+# You may need to uncomment and edit these if you are using libc5.
+COPTS = -O2 -Wall -g # -I/usr/inet6/include
+LOPTS = 
+RESLIB = # -L/usr/inet6/lib -linet6
+
+# -------- end of user definitions --------
+
+MAINTAINER = Philip.Blundell@pobox.com
+RELEASE           = 1.433
+
+.EXPORT_ALL_VARIABLES:
+
+ifeq ("$(NET-LIB-PATH)","lib2")
+TOPDIR   = ..
+else
+TOPDIR  := $(shell if [ "$$PWD" != "" ]; then echo $$PWD; else pwd; fi)
+endif
+
+NET-LIB = $(NET-LIB-PATH)/lib$(NET-LIB-NAME).a
+
+CFLAGS = $(COPTS) -I. -I./include/ -I$(NET-LIB-PATH)
+LDFLAGS        = $(LOPTS) -L$(NET-LIB-PATH)
+
+SUBDIRS        = man/ $(NET-LIB-PATH)/
+
+CC     = gcc
+LD     = gcc
+
+NLIB   = -l$(NET-LIB-NAME)
+
+USE_NLS := $(shell grep -s 'define NLS 1' config.h)
+
+MDEFINES = COPTS='$(COPTS)' LOPTS='$(LOPTS)' TOPDIR='$(TOPDIR)'
+
+%.o:           %.c config.h version.h net-locale.h net-features.h $<
+               $(CC) $(CFLAGS) -c $<
+
+all:           config.h version.h subdirs $(PROGS)
+
+config:        cleanconfig config.h
+
+install:       all savebin installbin installdata
+
+update:        all installbin installdata
+
+clean:
+               rm -f *.o DEADJOE config.new *~ *.orig lib/*.o
+               @for i in $(SUBDIRS); do (cd $$i && make clean) ; done
+
+cleanconfig:
+               rm -f config.h
+
+clobber:       clean
+               rm -f $(PROGS) config.h version.h config.status
+               @for i in $(SUBDIRS); do (cd $$i && make clobber) ; done
+
+
+dist:          clobber
+               @echo Creating net-tools-$(RELEASE) in ..
+               @tar -cvz -f ../net-tools-$(RELEASE).tar.gz -C .. net-tools
+
+
+config.h:      config.in Makefile 
+               @echo "Configuring the Linux net-tools (NET-3 Base Utilities)..." ; echo
+               @if [ config.status -nt config.in ]; \
+                       then ./configure.sh <config.status; \
+                  else ./configure.sh <config.in; \
+                fi
+
+
+version.h:     Makefile
+               @echo "#define RELEASE \"net-tools $(RELEASE)\"" >version.h
+
+
+$(NET-LIB):    config.h version.h net-locale.h libdir
+
+net-locale.h:          nlsdir
+
+libdir:
+               @$(MAKE) -C $(NET-LIB-PATH) $(MDEFINES)
+
+nlsdir:
+               @$(MAKE) -C nls
+
+subdirs:
+               @for i in $(SUBDIRS); do $(MAKE) -C $$i $(MDEFINES) ; done
+
+ifconfig:      $(NET-LIB) ifconfig.o
+               $(CC) $(LDFLAGS) -o ifconfig ifconfig.o $(NLIB) $(RESLIB)
+
+hostname:      hostname.o
+               $(CC) $(LDFLAGS) -o hostname hostname.o
+
+route:         $(NET-LIB) route.o
+               $(CC) $(LDFLAGS) -o route route.o $(NLIB) $(RESLIB)
+
+arp:           $(NET-LIB) arp.o
+               $(CC) $(LDFLAGS) -o arp arp.o $(NLIB) $(RESLIB)
+
+rarp:          $(NET-LIB) rarp.o
+               $(CC) $(LDFLAGS) -o rarp rarp.o $(NLIB)
+
+netstat:       $(NET-LIB) netstat.o statistics.o
+               $(CC) $(LDFLAGS) -o netstat netstat.o statistics.o $(NLIB) $(RESLIB)
+
+installbin:
+       install -o root -g root -m 0755 arp      ${BASEDIR}/sbin
+       install -o root -g root -m 0755 ifconfig ${BASEDIR}/sbin
+       install -o root -g root -m 0755 netstat  ${BASEDIR}/bin
+       install -o root -g root -m 0755 rarp     ${BASEDIR}/sbin
+       install -o root -g root -m 0755 route    ${BASEDIR}/sbin
+       install -o root -g root -m 0755 hostname ${BASEDIR}/bin
+       ln -fs hostname $(BASEDIR)/bin/dnsdomainname
+       ln -fs hostname $(BASEDIR)/bin/ypdomainname
+       ln -fs hostname $(BASEDIR)/bin/nisdomainname
+       ln -fs hostname $(BASEDIR)/bin/domainname
+
+
+savebin:
+       @for i in ${BASEDIR}/sbin/arp ${BASEDIR}/sbin/ifconfig \
+                 ${BASEDIR}/bin/netstat \
+                ${BASEDIR}/sbin/rarp ${BASEDIR}/sbin/route \
+                ${BASEDIR}/bin/hostname ${BASEDIR}/bin/ypdomainname \
+                 ${BASEDIR}/bin/dnsdomainname ${BASEDIR}/bin/nisdomainname \
+                ${BASEDIR}/bin/domainname ; do \
+                [ -f $$i ] && cp -f $$i $$i.old ; done ; echo Saved.
+
+installdata:
+       install -o root -g root -m 0644 man/${DEF_LANG}/arp.8           ${BASEDIR}/usr/man/man8
+       install -o root -g root -m 0644 man/${DEF_LANG}/ifconfig.8      ${BASEDIR}/usr/man/man8
+       install -o root -g root -m 0644 man/${DEF_LANG}/netstat.8       ${BASEDIR}/usr/man/man8
+       install -o root -g root -m 0644 man/${DEF_LANG}/rarp.8          ${BASEDIR}/usr/man/man8
+       install -o root -g root -m 0644 man/${DEF_LANG}/route.8         ${BASEDIR}/usr/man/man8
+       install -o root -g root -m 0644 man/${DEF_LANG}/hostname.1      ${BASEDIR}/usr/man/man1
+       install -o root -g root -m 0644 man/${DEF_LANG}/dnsdomainname.1 ${BASEDIR}/usr/man/man1
+       install -o root -g root -m 0644 man/${DEF_LANG}/ypdomainname.1  ${BASEDIR}/usr/man/man1
+       install -o root -g root -m 0644 man/${DEF_LANG}/nisdomainname.1 ${BASEDIR}/usr/man/man1
+       install -o root -g root -m 0644 man/${DEF_LANG}/domainname.1    ${BASEDIR}/usr/man/man1
+       install -o root -g root -m 0644 man/${DEF_LANG}/ethers.5        ${BASEDIR}/usr/man/man5
+#ifneq ($(USE_NLS), "")
+#      if [ "${DEF_LANG}" != "en_US.88591" ]; then \
+#              install -o root -g root -m 0755 -d ${BASEDIR}/usr/lib/locale/${DEF_LANG} ;\
+#              install -o root -g root -m 0644 nls/${DEF_LANG}/nettools.cat ${BASEDIR}/usr/lib/locale/${DEF_LANG} ;\
+#      fi
+#      for i in $(ADD_LANG); do \
+#      install -o root -g root -m 0755 -d ${BASEDIR}/usr/lib/locale/$$i ;\
+#      install -o root -g root -m 0644 nls/$$i/nettools.cat ${BASEDIR}/usr/lib/locale/$$i ;\
+#      if [ -d man/$$i ]; then \
+#      install -o root -g root -m 0755 -d ${BASEDIR}/usr/man/$$i/man8 ;\
+#      install -o root -g root -m 0644 man/$$i/arp.8           ${BASEDIR}/usr/man/$$i/man8 ;\
+#      install -o root -g root -m 0644 man/$$i/ifconfig.8      ${BASEDIR}/usr/man/$$i/man8 ;\
+#      install -o root -g root -m 0644 man/$$i/netstat.8       ${BASEDIR}/usr/man/$$i/man8 ;\
+#      install -o root -g root -m 0644 man/$$i/rarp.8          ${BASEDIR}/usr/man/$$i/man8 ;\
+#      install -o root -g root -m 0644 man/$$i/route.8         ${BASEDIR}/usr/man/$$i/man8 ;\
+#      install -o root -g root -m 0644 man/$$i/hostname.1      ${BASEDIR}/usr/man/$$i/man1 ;\
+#      install -o root -g root -m 0644 man/$$i/dnsdomainname.1 ${BASEDIR}/usr/man/$$i/man1 ;\
+#      install -o root -g root -m 0644 man/$$i/ypdomainname.1  ${BASEDIR}/usr/man/$$i/man1 ;\
+#      install -o root -g root -m 0644 man/$$i/nisdomainname.1 ${BASEDIR}/usr/man/$$i/man1 ;\
+#      install -o root -g root -m 0644 man/$$i/domainname.1    ${BASEDIR}/usr/man/$$i/man1 ;\
+#      fi ;\
+#      done
+#endif
+
+# End of Makefile.
diff --git a/README b/README
new file mode 100644 (file)
index 0000000..9093328
--- /dev/null
+++ b/README
@@ -0,0 +1,53 @@
+                                README
+
+                Information about the net-tools package                                
+NET-TOOLS      A collection of programs that form the base set of the
+               NET-3 networking distribution for the Linux operating
+               system.
+
+This package includes the important tools for controlling the network
+subsystem of the Linux kernel.  This includes arp, hostname, ifconfig,
+netstat, rarp and route.
+
+Please include the output of "program --version" when reporting bugs.
+
+
+Contents:
+  
+   README              This file.
+
+   README.ipv6         Notes for people hacking IPv6.
+
+   INSTALLING          Installation instructions.
+
+   COPYING             Your free copy of the GNU Public License.
+
+   TODO                        Some things that need to be done.
+
+
+                          Notes
+                          -----
+
+This is net-tools 1.432.  You need kernel 2.0 or later to use these programs.
+These programs should compile cleanly with either glibc or libc5.
+
+There is no NLS support in this distribution.  The files are out of date.
+Unless a volunteer is found soon to maintain the translations, NLS will be
+dropped altogether.
+
+ipfw has been removed from the distribution.  Use ipfwadm instead; get
+it at <ftp://ftp.xos.nl/pub/linux/ipfwadm/>.
+
+route/netstat -r do not yet support different AF cleanly.  IPX/DDP/AX25
+people, please feel free to add the code.
+
+ifconfig now supports changing media types for interfaces.  This requires
+a recent 2.1.x kernel, and many devices do not support it yet.
+
+The documentation is slimmed down.  I think most of it was out of
+date.
+
+
+Phil Blundell
+philb@gnu.ai.mit.edu
+21st September 1997
diff --git a/README.ipv6 b/README.ipv6
new file mode 100644 (file)
index 0000000..b67cd49
--- /dev/null
@@ -0,0 +1,18 @@
+Notes for IPv6.
+
+If you are using libc5, you may need to edit the Makefile so that
+libinet6 is linked in and your IPv6 include files are found in the
+right place.  The definitions in question are at about line 91. 
+
+If you use glibc, you should get the latest 2.1 snapshot.  In this
+case you do not need to edit the Makefile or apply any patches.
+Version 2.0 of glibc has no support for IPv6.
+
+Not all the IPv6 functionality is implemented in the kernel.  As of
+2.1.51, the code to delete IPv6 routes is still missing, and these
+operations will fail silently.  The code to delete IPv6 interface
+addresses has been written, but not yet (again, as of 2.1.51) merged
+with the mainstream kernel distribution.
+
+You may find that you are missing files such as <netinet/ip6.h>.  This is
+not a bug in net-tools; you should find some newer include files.
diff --git a/TODO b/TODO
new file mode 100644 (file)
index 0000000..8e529c0
--- /dev/null
+++ b/TODO
@@ -0,0 +1,33 @@
+TODO for net-tools
+
+[ ] netstat manpage and code cleanup, ddp support
+[ ] lib/netrom_rt.c rprint should not rewind _PATH_PROCNET_NR_NEIGH
+[ ] ARPHRD_METRICOM [1.3.82]
+[ ] include proxy arp description into man page.
+[ ] netstat -i: XOVR!=compressed
+[ ] nettools.8 man-page
+[ ] lib/ddp.c: /etc/atalk.names support
+[ ] lib/ether.c: /etc/ether support
+[ ] share source between netstat/ifconfig (lib/if_info.c)
+[ ] ARPHDR_LOOPBACK in new kernels, ok? dont think so :-/
+[ ] ARPHRD_LOCALTLK and aarp?
+[ ] ARCNET support? linux/drivers/net/arcnet.c
+[ ] ifconfig support for isdn4linux, linefill...
+[ ] Wilfred's Suggestion for config files for route and ifconfig (expand arp
+    file format)
+[ ] make netstat display more interesting states from interface
+       (CSLIP? BSDCOMP?)
+[ ] netstat netconfiguration info screen (forwarding, supplied protocols...)
+[ ] net-features.h in all tools
+[ ] check netstat -o
+[ ] supply some informations about new features to HOWTOs
+[ ] Need to include Jos Vos ipfwadm <ftp.xos.nl>
+[ ] Config file only works with bash not ash.
+[ ] Token ring is almost totally untested.
+[ ] additional tools for IPX, AX.25 etc be bundled [ipxripd004, ipx_* tools 
+       from caldera, axattach] into existing bins
+[ ] "SIOCAX25OPTRT" [Joerg (DL1BKE)]. 1.3.75
+[ ] dummy NOARP?! (2. default route for preveting hostunreachables on linedrop)
+[ ] ppp_dev_stat called for each dev in ifconfig, why? (1.3.17)
+[ ] linux/include/net/br.h?
+[ ] update fr/de translations (or drop NLS entirely)
diff --git a/arp.c b/arp.c
new file mode 100644 (file)
index 0000000..c2377e1
--- /dev/null
+++ b/arp.c
@@ -0,0 +1,640 @@
+/*
+ * arp         This file contains an implementation of the command
+ *             that maintains the kernel's ARP cache.  It is derived
+ *             from Berkeley UNIX arp(8), but cleaner and with sup-
+ *             port for devices other than Ethernet.
+ *
+ * NET-TOOLS   A collection of programs that form the base set of the
+ *             NET-3 Networking Distribution for the LINUX operating
+ *             system.
+ *
+ * Version:    arp 1.69 (1996-05-17)
+ *
+ * Maintainer: Bernd 'eckes' Eckenfels, <net-tools@lina.inka.de>
+ *
+ * Author:     Fred N. van Kempen, <waltje@uwalt.nl.mugnet.org>
+ *
+ * Changes:
+ *              Alan Cox        :      modified for NET3
+ *              Andrew Tridgell :      proxy arp netmasks
+ *              Bernd Eckenfels :      -n option
+ *              Bernd Eckenfels :      Use only /proc for display
+ *      {1.60} Bernd Eckenfels :       new arpcode (-i) for 1.3.42 but works 
+ *                                     with 1.2.x, too
+ *      {1.61} Bernd Eckenfels :       more verbose messages
+ *      {1.62} Bernd Eckenfels :       check -t for hw adresses and try to
+ *                                     explain EINVAL (jeff)
+ *960125 {1.63}        Bernd Eckenfels :       -a print hardwarename instead of tiltle
+ *960201 {1.64} Bernd Eckenfels :      net-features.h support
+ *960203 {1.65} Bernd Eckenfels :      "#define" in "#if", 
+ *                                     -H|-A additional to -t|-p
+ *960214 {1.66} Bernd Eckenfels :      Fix optarg required for -H and -A
+ *960412 {1.67} Bernd Eckenfels :      device=""; is default
+ *960514 {1.68}        Bernd Eckenfels :       -N and -D
+ *960517 {1.69}        Bernd Eckenfels :       usage() fixed
+ *
+ *             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.
+ */
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <sys/ioctl.h>
+#include <net/if.h>
+#include <net/if_arp.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <errno.h>
+#include <ctype.h>
+#include <fcntl.h>
+#include <string.h>
+#include <getopt.h>
+#include <unistd.h>
+#include "net-support.h"
+#include "pathnames.h"
+#include "version.h"
+#include "config.h"
+#include "net-locale.h"
+
+#define DFLT_AF        "inet"
+#define DFLT_HW        "ether"
+
+#define FEATURE_ARP
+#include "lib/net-features.h"
+
+
+char *Release = RELEASE,
+     *Version = "arp 1.69 (1996-05-17)";
+
+int opt_n = 0;                         /* do not resolve addresses     */
+int opt_N = 0;                         /* use symbolic names           */
+int opt_v = 0;                         /* debugging output flag        */
+int opt_D = 0;                         /* HW-address is devicename     */
+struct aftype *ap;                     /* current address family       */
+struct hwtype *hw;                     /* current hardware type        */
+int sockfd=0;                          /* active socket descriptor     */
+int hw_set = 0;                                /* flag if hw-type was set (-H) */
+char device[16]="";                    /* current device               */
+static void usage(void);
+
+/* Delete an entry from the ARP cache. */
+static int
+arp_del(char **args)
+{
+  char host[128];
+  struct arpreq req;
+  struct sockaddr sa;
+#if HAVE_NEW_SIOCSARP
+  struct arpreq_old old_req;
+#endif
+
+  memset((char *) &req, 0, sizeof(req));
+
+  /* Resolve the host name. */
+  if (*args == NULL) {
+       fprintf(stderr, NLS_CATGETS(catfd, arpSet, arp_hostname, "arp: need host name\n"));
+       return(-1);
+  }
+  strcpy(host, *args);
+  if (ap->input(0, host, &sa) < 0) {
+       ap->herror(host);
+       return(-1);
+  }
+
+  /* If a host has more than one address, use the correct one! */
+  memcpy((char *) &req.arp_pa, (char *) &sa, sizeof(struct sockaddr));
+
+  req.arp_flags=0;
+  
+  if (args[1]) {
+       if (strcmp(args[1],"pub")==0)
+               req.arp_flags|=ATF_PUBL;
+       else
+               usage();
+  }
+
+#if HAVE_NEW_SIOCSARP
+  strcpy(req.arp_dev,device);
+  memcpy((char *)&old_req,(char *)&req,sizeof(old_req));
+
+  /* Call the kernel. */
+  if (opt_v)  fprintf(stderr,"arp: SIOCDARP()\n");
+  if (ioctl(sockfd, SIOCDARP, &req) < 0) {
+       if (errno == EINVAL) {
+               if (opt_v)  fprintf(stderr,"arp: OLD_SIOCDARP()\n");
+               if (ioctl(sockfd, OLD_SIOCDARP, &old_req) < 0) {
+                       if (errno != ENXIO) {
+                               perror("OLD_SIOCSARP");
+                               return(-1);
+                       }
+               } else {
+                       return(0);
+               }
+       }
+       if (errno == ENXIO) {
+               printf(NLS_CATGETS(catfd, arpSet, arp_no_arp, 
+                       "No ARP entry for %s\n"), host);
+               return(-1);
+       }
+       perror("SIOCDARP");
+       return(-1);
+  }
+#else
+  /* Call the kernel. */
+  if (opt_v)  fprintf(stderr,"arp: old_SIOCDARP()\n");
+  if (ioctl(sockfd, SIOCDARP, &req) < 0) {
+       perror("SIOCDARP");
+       return(-1);
+  }
+#endif
+
+  return(0);
+}
+
+/* Get the hardware address to a specified interface name */
+static int
+arp_getdevhw(char *ifname, struct sockaddr *sa, struct hwtype *hw)
+{
+  struct ifreq ifr;
+  struct hwtype *xhw;
+
+  strcpy(ifr.ifr_name, ifname);
+  if (ioctl(sockfd, SIOCGIFHWADDR, &ifr) < 0) {
+      fprintf(stderr,"arp: cant get HW-Address for `%s': %s.\n", ifname, strerror(errno));
+      return(-1);
+  }
+  if (hw && (ifr.ifr_hwaddr.sa_family!=hw->type)) {
+      fprintf(stderr,"arp: protocol type missmatch.\n");
+      return(-1);
+  }
+  memcpy((char *)sa, (char *)&(ifr.ifr_hwaddr), sizeof(struct sockaddr));
+
+  if (opt_v) {
+      if (!(xhw = get_hwntype(ifr.ifr_hwaddr.sa_family)) || (xhw->sprint==0)) {
+        xhw = get_hwntype(-1);
+      }
+      fprintf(stderr, "arp: device `%s' has HW address %s `%s'.\n",ifname, xhw->name, xhw->sprint(&ifr.ifr_hwaddr));
+  }
+  return(0);
+}
+
+/* Set an entry in the ARP cache. */
+static int
+arp_set(char **args)
+{
+  char host[128];
+  struct arpreq req;
+#if HAVE_NEW_SIOCSARP
+  struct arpreq_old old_req;
+#endif
+  struct sockaddr sa;
+  int flags;
+
+  memset((char *) &req, 0, sizeof(req));
+
+  /* Resolve the host name. */
+  if (*args == NULL) {
+       fprintf(stderr, NLS_CATGETS(catfd, arpSet, arp_hostname, "arp: need host name\n"));
+       return(-1);
+  }
+  strcpy(host, *args++);
+  if (ap->input(0, host, &sa) < 0) {
+       ap->herror(host);
+       return(-1);
+  }
+
+  /* If a host has more than one address, use the correct one! */
+  memcpy((char *) &req.arp_pa, (char *) &sa, sizeof(struct sockaddr));
+
+  /* Fetch the hardware address. */
+  if (*args == NULL) {
+       fprintf(stderr, NLS_CATGETS(catfd, arpSet, arp_need_hw, "arp: need hardware address\n"));
+       return(-1);
+  }
+
+  if (opt_D) {
+    if (arp_getdevhw(*args++, &req.arp_ha, hw_set?hw:NULL) < 0)
+      return(-1);
+  } else {
+    if (hw->input(*args++, &req.arp_ha) < 0) {
+       fprintf(stderr, NLS_CATGETS(catfd, arpSet, arp_invalidhw, "arp: invalid hardware address\n"));
+       return(-1);
+    }
+  }
+  
+  /* Check out any modifiers. */
+  flags = ATF_PERM;
+  while (*args != NULL) {
+       if (! strcmp(*args, "temp")) flags &= ~ATF_PERM;
+       if (! strcmp(*args, "pub")) flags |= ATF_PUBL;
+/*     if (! strcmp(*args, "rarp")) flags |= ATF_RARP;*/
+       if (! strcmp(*args, "trail")) flags |= ATF_USETRAILERS;
+       if (! strcmp(*args, "netmask")) 
+         {
+           if (*++args == NULL) usage();
+           if (strcmp(*args,"255.255.255.255") != 0)
+             {
+               strcpy(host, *args);
+               if (ap->input(0, host, &sa) < 0) {
+                       ap->herror(host);
+                       return(-1);
+               }
+               memcpy((char *) &req.arp_netmask, (char *) &sa,
+                      sizeof(struct sockaddr));
+               flags |= ATF_NETMASK;
+             }
+         }
+       args++;
+  }
+
+  if ((flags & ATF_NETMASK) && !(flags & ATF_PUBL))
+    usage();
+
+  /* Fill in the remainder of the request. */
+  req.arp_flags = flags;
+
+#if HAVE_NEW_SIOCSARP
+  strcpy(req.arp_dev,device);
+  memcpy((char *)&old_req,(char *)&req,sizeof(old_req));
+
+  /* Call the kernel. */
+  if (opt_v)  fprintf(stderr,"arp: SIOCSARP()\n");
+  if (ioctl(sockfd, SIOCSARP, &req) < 0) {
+       if (errno != EINVAL) {
+               perror("SIOCSARP");
+               return(-1);
+       }
+       if (opt_v)  fprintf(stderr,"arp: OLD_SIOCSARP()\n");
+       if (ioctl(sockfd, OLD_SIOCSARP, &old_req) < 0) {
+               if (errno != EINVAL) {
+                       perror("OLD_SIOCSARP");
+                       return(-1);
+               }
+               perror("SIOCSARP and OLD_SIOCSARP");
+               if (flags & ATF_PUBL)
+                       fprintf(stderr, NLS_CATGETS(catfd, arpSet, arp_einv_pub, 
+                                       "Probably destination is reached via ARP Interface. See arp(8)\n"));
+               else
+                       fprintf(stderr, NLS_CATGETS(catfd, arpSet, arp_einv_nopub, 
+                                       "Probably destination is on different Interface. See arp(8)\n"));
+               return(-1);
+       }
+  }
+#else
+  /* Call the kernel. */
+  if (opt_v)  fprintf(stderr,"arp: old_SIOCSARP()\n");
+  if (ioctl(sockfd, SIOCSARP, &req) < 0) {
+       perror("SIOCSARP");
+       return(-1);
+  }
+#endif
+
+  return(0);
+}
+
+
+/* Process an EtherFile */
+static int
+arp_file(char *name)
+{
+  char buff[1024];
+  char *sp, *args[32];
+  int linenr, argc;
+  FILE *fp;
+
+  if ((fp = fopen(name, "r")) == NULL) {
+       fprintf(stderr, NLS_CATGETS(catfd, arpSet, arp_cant_open, "arp: cannot open etherfile %s !\n"), name);
+       return(-1);
+  }
+
+  /* Read the lines in the file. */
+  linenr = 0;
+  while (fgets(buff, sizeof(buff), fp) != (char *)NULL) {
+       linenr++;
+       if (opt_v == 1) fprintf(stderr, ">> %s", buff);
+       if ((sp = strchr(buff, '\n')) != (char *)NULL) *sp = '\0';
+       if (buff[0] == '#' || buff[0] == '\0') continue;
+
+       argc = getargs(buff, args);
+       if (argc < 2) {
+               fprintf(stderr, NLS_CATGETS(catfd, arpSet, arp_formaterr, 
+                                           "arp: format error on line %u of etherfile %s !\n"),
+                       linenr, name);
+               continue;
+       }
+
+       if (arp_set(args) != 0) {
+               fprintf(stderr, NLS_CATGETS(catfd, arpSet, arp_cant_set,
+                                           "arp: cannot set entry on line %u of etherfile %s !\n"),
+                       linenr, name);
+       }
+  }
+
+  (void) fclose(fp);
+  return(0);
+}
+
+
+/* Print the contents of an ARP request block. */
+static void
+arp_disp_2(char *ip,int type,int arp_flags,char *hwa,char *mask,char *dev)
+{
+  static int title = 0;
+  struct hwtype *xhw;
+  struct aftype *xap;
+  char *sp;
+  struct sockaddr sap; 
+  char flags[6];
+  
+  xhw = get_hwntype(type);
+  if (xhw == NULL) 
+    xhw = get_hwtype("ether");
+/*
+ * xap = get_afntype(req->arp_pa.sa_family);
+ * if (xap == NULL) 
+ */
+  xap = get_aftype("inet");
+    
+  if (title++ == 0) {
+    printf(NLS_CATGETS(catfd, arpSet, arp_address,
+                      "Address\t\t\tHWtype\tHWaddress\t    Flags Mask\t\t  Iface\n"));
+  }
+  /* Setup the flags. */
+  flags[0] = '\0';
+  if (arp_flags & ATF_COM) strcat(flags, "C");
+  if (arp_flags & ATF_PERM) strcat(flags, "M");
+  if (arp_flags & ATF_PUBL) strcat(flags, "P");
+/*  if (arp_flags & ATF_RARP) strcat(flags, "R");*/
+  if (arp_flags & ATF_USETRAILERS) strcat(flags, "T");
+
+  /* This IS ugly but it works -be */
+  if (xap->input(0, ip,&sap) < 0)
+       sp=ip;
+  else
+       sp = xap->sprint(&sap, opt_n);
+  
+  printf("%-23.23s\t%-8.8s", sp, xhw->name);
+  printf("%-20.20s%-6.6s%-15.15s %s\n", hwa, flags,mask,dev);
+}
+
+
+/* Display the contents of the ARP cache in the kernel. */
+static int
+arp_show(char *name)
+{
+  char host[100];
+  struct sockaddr sa;
+  char ip[100];
+  char hwa[100];
+  char mask[100];
+  char line[200];
+  char dev[100];
+  int type,flags;
+  FILE *fp;
+  int num,entries=0,showed=0;
+
+  host[0]='\0';
+  
+  if (name != NULL) {
+       /* Resolve the host name. */
+       strcpy(host, name);
+       if (ap->input(0, host, &sa) < 0) {
+               ap->herror(host);
+               return(-1);
+       }
+       strcpy(host,ap->sprint(&sa, 1));
+  }
+  
+  /* Open the PROCps kernel table. */
+  if ((fp = fopen(_PATH_PROCNET_ARP, "r")) == NULL) {
+       perror(_PATH_PROCNET_ARP);
+       return(-1);
+  }
+
+  /* Bypass header -- read until newline */
+  if (fgets(line, sizeof(line), fp) != (char *)NULL) {
+       strcpy(mask,"-");
+       strcpy(dev,"-");
+       /* Read the ARP cache entries. */
+       for(;fgets(line,sizeof(line),fp);)
+       {
+               num=sscanf(line,"%s 0x%x 0x%x %s %s %s\n",
+                                              ip,&type,&flags,hwa,mask,dev);
+               if(num<4)
+                       break;
+               
+               entries++;      
+               /* if the user specified hw-type differs, skip it */
+               if (hw_set && (type != hw->type))
+                       continue;
+                       
+               /* if the user specified address differs, skip it */
+               if (host[0] && strcmp(ip,host))
+                       continue;
+               
+               /* if the user specified device differs, skip it */
+               if (device[0] && strcmp(dev,device))
+                       continue;
+               showed++;       
+               arp_disp_2(ip,type,flags,hwa,mask,dev);
+       }
+  }
+  if (opt_v)
+       printf(NLS_CATGETS(catfd, arpSet, arp_sum,
+               "Entries: %d\tSkiped: %d\tFound: %d\n"),entries,entries-showed,showed);
+  
+  if (!showed && (hw_set || host[0] || device[0]))
+       printf(NLS_CATGETS(catfd, arpSet, arp_none,
+               "arp: in %d entries no match found.\n"),entries);
+  (void) fclose(fp);
+  return(0);
+}
+
+static void
+version(void)
+{
+  fprintf(stderr, "%s\n%s\n%s\n",Release,Version,Features);
+  NLS_CATCLOSE(catfd)
+  exit(-1);
+}
+
+static void
+usage(void)
+{
+  fprintf(stderr, NLS_CATGETS(catfd, arpSet, arp_usage1,
+       "Usage: arp [-vn] [-H type] [-i if] -a [hostname]\n"));
+  fprintf(stderr, NLS_CATGETS(catfd, arpSet, arp_usage2,
+       "       arp [-v] [-i if] -d hostname [pub]\n"));
+  fprintf(stderr, NLS_CATGETS(catfd, arpSet, arp_usage3,
+       "       arp [-v] [-H type] [-i if] -s  hostname hw_addr [temp]\n"));
+  fprintf(stderr, NLS_CATGETS(catfd, arpSet, arp_usage4,
+       "       arp [-v] [-H type] [-i if] -s  hostname hw_addr [netmask nm] pub\n"));
+  fprintf(stderr, NLS_CATGETS(catfd, arpSet, arp_usage5,
+       "       arp [-v] [-H type] [-i if] -Ds hostname if [netmask nm] pub\n"));
+  fprintf(stderr, NLS_CATGETS(catfd, arpSet, arp_usage6,
+       "       arp [-vnD] [-H type] [-i if] -f filename\n"));
+  NLS_CATCLOSE(catfd)
+  exit(-1);
+}
+
+int
+main(int argc, char **argv)
+{
+  int i, lop, what;
+  struct option longopts[]=
+  {
+       {"verbose",     0,      0,      'v'},
+       {"version",     0,      0,      'V'},
+       {"display",     0,      0,      'a'},
+       {"delete",      0,      0,      'd'},
+       {"file",        0,      0,      'f'},
+       {"numeric",     0,      0,      'n'},
+       {"set",         0,      0,      's'},
+       {"protocol",    1,      0,      'A'},
+       {"hw-type",     1,      0,      'H'},
+       {"device",      0,      0,      'i'},
+       {"help",        0,      0,      'h'},
+       {"use-device",  0,      0,      'D'},
+       {"symbolic",    0,      0,      'N'},
+       {NULL,          0,      0,      0}
+  };   
+             
+#if NLS
+  setlocale (LC_MESSAGES, "");
+  catfd = catopen ("nettools", MCLoadBySet);
+#endif
+
+  /* Initialize variables... */
+  if ((hw = get_hwtype(DFLT_HW)) == NULL) {
+       fprintf(stderr, NLS_CATGETS(catfd, arpSet, arp_hw_not_supp,
+                                   "%s: hardware type not supported!\n"), DFLT_HW);
+       NLS_CATCLOSE(catfd)
+       return(-1);
+  }
+  if ((ap = get_aftype(DFLT_AF)) == NULL) {
+       fprintf(stderr, NLS_CATGETS(catfd, arpSet, arp_fam_not_supp,
+                                   "%s: address family not supported!\n"), DFLT_AF);
+       NLS_CATCLOSE(catfd)
+       return(-1);
+  }
+  what = -1;
+
+  /* Fetch the command-line arguments. */
+  /* opterr = 0; */
+  while ((i = getopt_long(argc, argv, "A:H:adfp:nsi:t:vh?DNV",longopts, &lop)) != EOF) switch(i) {
+       case 'a':
+               what = 1;
+               break;
+
+       case 'd':
+               what = 3;
+               break;
+
+       case 'f':
+               what = 2;
+               break;
+
+       case 'n':
+               opt_n = FLAG_NUM;
+               break;
+       case 'D':
+               opt_D = 1;
+               break;
+       case 'N':
+               opt_N = FLAG_SYM;
+               fprintf(stderr,"arp: -N not yet supported.\n");
+               break;
+       case 'A':
+       case 'p':
+               ap = get_aftype(optarg);
+               if (ap == NULL) {
+                       fprintf(stderr, NLS_CATGETS(catfd, arpSet, arp_unkn_addr,
+                                                   "arp: %s: unknown address family.\n"),
+                               optarg);
+                       NLS_CATCLOSE(catfd)
+                       exit(-1);
+               }
+               break;
+
+       case 's':
+               what = 4;
+               break;
+
+       case 'H':
+       case 't':
+               hw = get_hwtype(optarg);
+               if (hw == NULL) {
+                       fprintf(stderr, NLS_CATGETS(catfd, arpSet, arp_unkn_hw,
+                                                   "arp: %s: unknown hardware type.\n"),
+                               optarg);
+                       NLS_CATCLOSE(catfd)
+                       exit(-1);
+               }
+               hw_set = 1;
+               break;
+       case 'i':
+               strncpy(device,optarg,sizeof(device)-1);
+               device[sizeof(device)-1]='\0';
+               break;
+
+       case 'v':
+               opt_v = 1;
+               break;
+
+       case 'V':
+               version();
+
+       case '?':
+       case 'h':
+       default:
+               usage();
+  }
+
+  if (ap->af != AF_INET) {
+       fprintf(stderr, NLS_CATGETS(catfd, arpSet, arp_wrong_af,
+                                   "arp: %s: kernel only supports 'inet'.\n"),
+                       ap->name);
+       NLS_CATCLOSE(catfd)
+       exit(-1);
+  }
+  if (hw->alen <= 0) {
+       fprintf(stderr, NLS_CATGETS(catfd, arpSet, arp_wrong_hw,
+                                   "arp: %s: hardware type without ARP support.\n"),
+                       hw->name);
+       NLS_CATCLOSE(catfd)
+       exit(-1);
+  }
+  if ((sockfd = socket(AF_INET,SOCK_DGRAM,0)) <0)
+  {
+       perror("socket");
+       NLS_CATCLOSE(catfd)
+       exit(-1);
+  }
+
+  /* Now see what we have to do here... */
+  switch(what) {
+       case 1:         /* show an ARP entry in the cache */
+               what = arp_show(argv[optind]);
+               break;
+
+       case 2:         /* process an EtherFile */
+               what = arp_file(argv[optind]);
+               break;
+
+       case 3:         /* delete an ARP entry from the cache */
+               what = arp_del(&argv[optind]);
+               break;
+
+       case 4:         /* set an ARP entry in the cache */
+               what = arp_set(&argv[optind]);
+               break;
+
+       default:
+               usage();
+  }
+
+  NLS_CATCLOSE(catfd)
+  exit(what);
+}
diff --git a/config.in b/config.in
new file mode 100644 (file)
index 0000000..64eb51c
--- /dev/null
+++ b/config.in
@@ -0,0 +1,83 @@
+#
+# config.in    Configure.sh source for the net-tools.
+#              This file contains the definition of what the support
+#              library contains.  Most of all, it defines which types
+#              of address families and hardware we know of.
+#
+# NET-TOOLS    A collection of programs that form the base set of the
+#              NET-3 Networking Distribution for the LINUX operating
+#              system.
+#
+# Version:     config.in 1.04  (96-04-24)
+#
+# Author:      Fred N. van Kempen, <waltje@uwalt.nl.mugnet.org>
+#              Copyright 1988-1993 MicroWalt Corporation
+#
+#              Bernd 'eckes' Eckenfels <net-tools@lina.inka.de>
+#
+# Modified:
+#      {1.01}  Bernd Eckenfels:        generates more verbose config.h file
+#960125        {1.02}  Bernd Eckenfels:        reordered
+#960215 {1.03} Bernd Eckenfels:        NET/ROM (Jonathan)
+#960424 {1.04} Bernd Eckenfels:        NLS disabled, FR added
+#
+#              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.
+#
+= /*
+=  * config.h  Automatically generated configuration includefile
+=  *
+=  * NET-TOOLS A collection of programs that form the base set of the
+=  *           NET-3 Networking Distribution for the LINUX operating
+=  *           system.
+=  *
+=  *           DO  NOT  EDIT  DIRECTLY
+=  *
+=  * Version:  Generated from "config.in 1.04 (96-04-24)"
+=  */
+#*
+#*
+#*                     NLS
+#*
+#*           (National Language Support)
+#*
+#* In this BETA Release the NLS is disabled, cause the catalougs
+#* are completely outdated.
+#*
+#
+#
+#= #define NLS 0
+#
+#
+# * (answer 'n' if you haye no system with national language support)
+# *
+# bool 'Does your system support NLS?' NLS n
+#: Does your system support NLS? (NLS) [n] NO
+*
+*
+*             Protocol Families.
+* 
+bool 'UNIX protocol family' HAVE_AFUNIX y
+bool 'INET (TCP/IP) protocol family' HAVE_AFINET y
+bool 'INET6 (IPv6) protocol family' HAVE_AFINET6 n
+bool 'Novell IPX/SPX protocol family' HAVE_AFIPX y
+bool 'Appletalk DDP protocol family' HAVE_AFATALK y
+bool 'AX25 (Packet Radio) protocol family' HAVE_AFAX25 y
+bool 'NET/ROM (Packet Radio) protocol family' HAVE_AFNETROM y
+*
+*
+*            Device Hardware types.
+*
+bool 'Ethernet (generic) support' HAVE_HWETHER y
+bool 'ARCnet support' HAVE_HWARC y
+bool 'SLIP (serial line) support' HAVE_HWSLIP y
+bool 'PPP (serial line) support' HAVE_HWPPP y
+bool 'IPIP Tunnel support' HAVE_HWTUNNEL y
+bool 'Token ring (generic) support' HAVE_HWTR y
+bool 'AX25 (Packet Radio) support' HAVE_HWAX25 y
+bool 'NET/ROM (Packet Radio) support' HAVE_HWNETROM y
+bool 'DLCI/FRAD (Frame Relay) support' HAVE_HWFR y
+bool 'SIT (IPv6-in-IPv4) support' HAVE_HWSIT n
diff --git a/configure.sh b/configure.sh
new file mode 100755 (executable)
index 0000000..cba50e0
--- /dev/null
@@ -0,0 +1,161 @@
+#!/bin/bash
+#
+# Configure.sh Generates interactively a config.h from config.in
+#
+# net-tools    A collection of programs that form the base set of the
+#              NET-3 Networking Distribution for the LINUX operating
+#              system.
+#
+# Usage:       Install.sh [--nobackup] [--test]
+#
+# Version:     Install.sh 1.65 (1996-01-12)
+#
+# Authors:     Fred N. van Kempen, <waltje@uwalt.nl.mugnet.org>
+#              Johannes Grosen, <grosen@argv.cs.ndsu.nodak.edu>
+#              Copyright 1988-1993 MicroWalt Corporation
+#
+# Modified:
+#        {1.65} Bernd eckes Eckenfels <net-tools@lina.inka.de>
+#              some layout cleanups, slattach/plipconfig removed.
+#              --test for testinstallations added.
+#
+#              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.
+#
+#
+# Make sure we're really running bash.
+#
+# I would really have preferred to write this script in a language with
+# better string handling, but alas, bash is the only scripting language
+# that I can be reasonable sure everybody has on their Linux machine.
+#
+
+CONFIG=config.h
+
+
+[ -z "$BASH" ] && { echo "Configure requires bash" 1>&2; exit 1; }
+
+# Disable filename globbing once and for all.
+# Enable function cacheing.
+set -f -h
+
+#
+# readln reads a line into $ans.
+#
+#      readln prompt default
+#
+function readln()
+{
+  echo -n "$1"
+  IFS='@' read ans </dev/tty || exit 1
+  [ -z "$ans" ] && ans=$2
+}
+
+# bool processes a boolean argument
+#
+#      bool tail
+#
+function bool()
+{
+  # Slimier hack to get bash to rescan a line.
+  eval "set -- $1"
+  ans=""
+  while [ "$ans" != "y" -a "$ans" != "n" ]
+  do
+       readln "$1 ($2) [$3] " "$3"
+  done
+  if [ "$ans" = "y" ]; then
+       echo "#define $2 1" >>${CONFIG}
+    else
+       echo "#define $2 0" >>${CONFIG}
+  fi
+  raw_input_line="bool '$1' $2 $ans"
+  eval "$2=$ans"
+}
+
+# int processes an integer argument
+#
+#      int tail
+#
+function int()
+{
+  # Slimier hack to get bash to rescan a line.
+  eval "set -- $1"
+  ans="x"
+  while [ $[$ans+0] != "$ans" ];
+  do
+       readln "$1 ($2) [$3] " "$3"
+  done
+  echo "#define $2 ($ans)" >>${CONFIG}
+  raw_input_line="int '$1' $2 $ans"
+  eval "$2=$ans"
+}
+
+  #
+  # Make sure we start out with a clean slate.
+  #
+  > config.new
+  > ${CONFIG}
+
+  stack=''
+  branch='t'
+
+  while IFS='@' read raw_input_line
+  do
+       # Slimy hack to get bash to rescan a line.
+       read cmd rest <<-END_OF_COMMAND
+               $raw_input_line
+       END_OF_COMMAND
+
+       if [ "$cmd" = "*" ]; then
+               if [ "$branch" = "t" ]; then
+                       echo "$raw_input_line"
+                       # echo "# $rest" >>$CONFIG
+                       if [ "$prevcmd" != "*" ]; then
+                               echo >>${CONFIG}
+                               echo "/* $rest" >>${CONFIG}
+                       else
+                               echo " * $rest" >>${CONFIG}
+                       fi
+                       prevcmd="*"
+               fi
+       else
+               [ "$prevcmd" = "*" ] && echo " */" >>${CONFIG}
+               prevcmd=""
+               case "$cmd" in
+               =)      [ "$branch" = "t" ] && echo "$rest" >>${CONFIG};;
+               :)      [ "$branch" = "t" ] && echo "$raw_input_line" ;;
+               int)    [ "$branch" = "t" ] && int "$rest" ;;
+               bool)   [ "$branch" = "t" ] && bool "$rest" ;;
+               exec)   [ "$branch" = "t" ] && ( sh -c "$rest" ) ;;
+               if)     stack="$branch $stack"
+                       if [ "$branch" = "t" ] && eval "$rest"; then
+                               branch=t
+                       else
+                               branch=f
+                       fi ;;
+               else)   if [ "$branch" = "t" ]; then
+                               branch=f
+                       else
+                               read branch rest <<-END_OF_STACK
+                                       $stack
+                               END_OF_STACK
+                       fi ;;
+               fi)     [ -z "$stack" ] && echo "Error!  Extra fi." 1>&2
+                       read branch stack <<-END_OF_STACK
+                               $stack
+                       END_OF_STACK
+                       ;;
+               esac
+       fi
+       echo "$raw_input_line" >>config.new
+  done
+  [ "$prevcmd" = "*" ] && echo " */" >>${CONFIG}
+
+  [ -z "$stack" ] || echo "Error!  Untermiated if." 1>&2
+
+  mv config.new config.status
+  exit 0
diff --git a/hostname.c b/hostname.c
new file mode 100644 (file)
index 0000000..1a344a3
--- /dev/null
@@ -0,0 +1,360 @@
+/*
+ * hostname    This file contains an implementation of the command
+ *             that maintains the hostname and the domainname. It
+ *             is also used to show the FQDN and the IP-Addresses.
+ *
+ * Usage:      hostname [-d|-f|-s|-a|-i|-y]
+ *             hostname [-h|-V]
+ *             hostname {name|-F file}
+ *             dnsdmoainname   
+ *             nisdomainname {name|-F file}
+ *
+ * Version:    hostname 1.96 (1996-02-18)
+ *
+ * Author:     Peter Tobias <tobias@et-inf.fho-emden.de>
+ *
+ * Changes:
+ *      {1.90} Peter Tobias :          Added -a and -i options.
+ *     {1.91}  Bernd Eckenfels :       -v,-V rewritten, long_opts 
+ *                                     (major rewrite), usage.
+ *960120 {1.95}        Bernd Eckenfels :       -y/nisdomainname - support for get/
+ *                                     setdomainname added 
+ *960218 {1.96} Bernd Eckenfels :      netinet/in.h added
+ *
+ *             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.
+ */
+#include <stdio.h>
+#include <unistd.h>
+#include <getopt.h>
+#include <string.h>
+#include <netdb.h>
+#include <errno.h>
+#include <sys/param.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+#include "config.h"
+#include "version.h"
+#include "net-locale.h"
+
+char *Release = RELEASE,
+     *Version = "hostname 1.96 (1996-02-18)";
+     
+static char *program_name;
+static int  opt_v;
+
+static void sethname(char *);
+static void setdname(char *);
+static void showhname(char *, int);
+static void usage(void);
+static void version(void);
+static void setfilename(char *,int);
+
+#define SETHOST                1
+#define SETDOMAIN      2
+
+static void sethname(char *hname)
+{
+       if (opt_v)
+               fprintf(stderr,NLS_CATGETS(catfd, hostnameSet, hostname_verb_set, "Setting hostname to `%s'\n"),
+                       hname);
+       if(sethostname(hname, strlen(hname))) {
+               switch(errno) {
+                       case EPERM:
+                               fprintf(stderr,NLS_CATGETS(catfd, hostnameSet, hostname_root,
+                                                          "%s: you must be root to change the host name\n"), program_name);
+                               break;
+                       case EINVAL:
+                               fprintf(stderr,NLS_CATGETS(catfd, hostnameSet, hostname_toolong,
+                                                          "%s: name too long\n"), program_name);
+                               break;
+                       default:
+               }
+               NLS_CATCLOSE(catfd)
+               exit(1);
+       };
+}
+
+static void setdname(char *dname)
+{
+       if (opt_v)
+               fprintf(stderr,NLS_CATGETS(catfd, hostnameSet, hostname_verb_dset, "Setting domainname to `%s'\n"),
+                       dname);
+       if(setdomainname(dname, strlen(dname))) {
+               switch(errno) {
+                       case EPERM:
+                               fprintf(stderr,NLS_CATGETS(catfd, hostnameSet, hostname_dname_root,
+                                                          "%s: you must be root to change the domain name\n"), program_name);
+                               break;
+                       case EINVAL:
+                               fprintf(stderr,NLS_CATGETS(catfd, hostnameSet, hostname_dname_toolong,
+                                                          "%s: name too long\n"), program_name);
+                               break;
+                       default:
+               }
+               NLS_CATCLOSE(catfd)
+               exit(1);
+       };
+}
+
+static void showhname(char *hname, int c)
+{
+       struct hostent *hp;
+       register char *p,**alias;
+       struct in_addr **ip;
+       
+       if (opt_v)
+               fprintf(stderr,NLS_CATGETS(catfd, hostnameSet, hostname_verb_res, "Resolving `%s' ...\n"),hname);
+       if (!(hp = gethostbyname(hname))) {
+               herror(program_name);
+               NLS_CATCLOSE(catfd)
+               exit(1);
+       }
+
+       if (opt_v) { 
+               fprintf(stderr,NLS_CATGETS(catfd, hostnameSet, hostname_verb_fnd, "Result: h_name=`%s'\n"),
+                       hp->h_name);
+                       
+               alias=hp->h_aliases;
+               while(alias[0])
+                       fprintf(stderr,NLS_CATGETS(catfd, hostnameSet, hostname_verb_ali, "Result: h_aliases=`%s'\n"),
+                               *alias++);
+                               
+               ip=(struct in_addr **)hp->h_addr_list;
+               while(ip[0])
+                       fprintf(stderr,NLS_CATGETS(catfd, hostnameSet, hostname_verb_ipn, "Result: h_addr_list=`%s'\n"),
+                               inet_ntoa(**ip++));
+       }
+
+       if (!(p = strchr(hp->h_name, '.')) && (c == 'd')) return;
+
+       switch(c) {
+               case 'a':
+                       while (hp->h_aliases[0])
+                               printf("%s ", *hp->h_aliases++);
+                       printf("\n");
+                       break;
+               case 'i':
+                       while (hp->h_addr_list[0])
+                               printf("%s ", inet_ntoa(*(struct in_addr *) * hp->h_addr_list++));
+                       printf("\n");
+                       break;
+               case 'd':
+                       printf("%s\n", ++p);
+                       break;
+               case 'f':
+                       printf("%s\n", hp->h_name);
+                       break;
+               case 's':
+                       if (p != NULL) *p = '\0';
+                       printf("%s\n", hp->h_name);
+                       break;
+               default:
+       }
+}
+
+static void setfilename(char * name,int what)
+{              
+  register FILE *fd;
+  register char *p;
+  char fline[MAXHOSTNAMELEN];
+
+  if ((fd = fopen(name, "r")) != NULL) {
+       while (fgets(fline, sizeof(fline), fd) != NULL) {
+               if ((p = index(fline, '\n')) != NULL)
+                       *p = '\0';
+                       if (opt_v) fprintf(stderr, ">> %s\n", fline);
+                       if (fline[0] == '#')
+                               continue;
+                       if (what == SETHOST) {
+                               sethname(fline);
+                       } else {
+                               setdname(fline);
+                       }
+       }
+       (void) fclose(fd);
+  } else {
+       fprintf(stderr,NLS_CATGETS(catfd, hostnameSet, hostname_cant_open, "%s: can't open `%s'\n"),
+                       program_name, optarg);
+       NLS_CATCLOSE(catfd)
+       exit(1);
+  }
+}
+
+static void version(void)
+{
+       fprintf(stderr,"%s\n%s\n",Release,Version);
+       NLS_CATCLOSE(catfd)
+       exit(-1);
+}
+
+static void usage(void)
+{
+       fprintf(stderr,NLS_CATGETS(catfd, hostnameSet, hostname_usage1, 
+               "Usage: hostname [-v] {hostname|-F file}      set hostname (from file)\n"));
+       fprintf(stderr,NLS_CATGETS(catfd, hostnameSet, hostname_usage2, 
+               "       domainname [-v] {nisdomain|-F file}   set NIS domainname (from file)\n"));
+       fprintf(stderr,NLS_CATGETS(catfd, hostnameSet, hostname_usage3, 
+               "       hostname [-v] [-d|-f|-s|-a|-i|-y]     display formated name\n"));
+       fprintf(stderr,NLS_CATGETS(catfd, hostnameSet, hostname_usage4, 
+               "       hostname [-v]                         display hostname\n\n"));
+       fprintf(stderr,NLS_CATGETS(catfd, hostnameSet, hostname_usage5, 
+               "       hostname -V|--version|-h|--help       print info and exit\n\n"));
+       fprintf(stderr,NLS_CATGETS(catfd, hostnameSet, hostname_usage6, 
+               "    dnsdomainname=hostname -d, {yp,nis,}domainname=hostname -y\n\n"));
+       fprintf(stderr,NLS_CATGETS(catfd, hostnameSet, hostname_usage7, 
+               "    -s, --short           short host name\n"));
+       fprintf(stderr,NLS_CATGETS(catfd, hostnameSet, hostname_usage8, 
+               "    -a, --alias           alias names\n"));
+       fprintf(stderr,NLS_CATGETS(catfd, hostnameSet, hostname_usage9, 
+               "    -i, --ip-address      addresses for the hostname\n"));
+       fprintf(stderr,NLS_CATGETS(catfd, hostnameSet, hostname_usage10, 
+               "    -f, --fqdn, --long    long host name (FQDN)\n"));
+       fprintf(stderr,NLS_CATGETS(catfd, hostnameSet, hostname_usage11, 
+               "    -d, --domain          DNS domain name\n"));
+       fprintf(stderr,NLS_CATGETS(catfd, hostnameSet, hostname_usage12, 
+               "    -y, --yp, --nis       NIS/YP domainname\n"));
+       fprintf(stderr,NLS_CATGETS(catfd, hostnameSet, hostname_usage13, 
+               "    -F, --file            read hostname or nis domainname from given File\n\n"));
+       fprintf(stderr,NLS_CATGETS(catfd, hostnameSet, hostname_usage14, 
+               "   This comand can get or set the hostname or the NIS domainname. You can\n"));
+       fprintf(stderr,NLS_CATGETS(catfd, hostnameSet, hostname_usage15, 
+               "   also get the DNS domain or the FQDN (fully qualified domain name).\n"));
+       fprintf(stderr,NLS_CATGETS(catfd, hostnameSet, hostname_usage16, 
+               "   Unless you are using bind or NIS for host lookups you can change the\n"));
+       fprintf(stderr,NLS_CATGETS(catfd, hostnameSet, hostname_usage17, 
+               "   FQDN (Fully Qualified Domain Name) and the DNS domain name (which is\n"));
+       fprintf(stderr,NLS_CATGETS(catfd, hostnameSet, hostname_usage18, 
+               "   part of the FQDN) in the /etc/hosts file.\n"));
+       NLS_CATCLOSE(catfd)
+       exit(-1);
+}
+
+
+int main(int argc, char **argv)
+{
+       int c;
+       char type='\0';
+       int option_index = 0;
+       int what = 0;
+       char myname[MAXHOSTNAMELEN+1];
+       char *file=NULL;
+
+       static const struct option long_options[] =
+       {
+               {"domain", no_argument, 0, 'd'},
+               {"file", required_argument, 0, 'F'},
+               {"fqdn", no_argument, 0, 'f'},
+               {"help", no_argument, 0, 'h'},
+               {"long", no_argument, 0, 'f'},
+               {"short", no_argument, 0, 's'},
+               {"version", no_argument, 0, 'V'},
+               {"verbose", no_argument, 0, 'v'},
+               {"alias", no_argument, 0, 'a'},
+               {"ip-address", no_argument, 0, 'i'},
+               {"nis", no_argument, 0, 'y'},
+               {"yp", no_argument, 0, 'y'},
+               {0, 0, 0, 0}
+       };
+
+#if NLS
+       setlocale (LC_MESSAGES, "");
+       catfd = catopen ("nettools", MCLoadBySet);
+#endif
+
+       program_name = (rindex(argv[0], '/')) ? rindex(argv[0], '/') + 1 : argv[0];
+
+       if (!strcmp(program_name,"ypdomainname") || 
+           !strcmp(program_name,"domainname")   || 
+           !strcmp(program_name,"nisdomainname"))
+               what = 3;
+       if (!strcmp(program_name,"dnsdomainname"))
+               what = 2;
+       
+       while((c = getopt_long(argc, argv, "adfF:h?isVvy", long_options, &option_index)) != EOF)
+       switch(c)
+       {
+               case 'd':
+                       what = 2;
+                       break;
+               case 'a':
+               case 'f':
+               case 'i':
+               case 's':
+                       what = 1;
+                       type=c;
+                       break;
+               case 'y':
+                       what = 3;
+                       break;
+               case 'F':
+                       file=optarg;                                            
+                       break;
+               case 'v':
+                       opt_v++;
+                       break;
+               case 'V':
+                       version();
+               case '?':
+               case 'h':
+               default:
+                       usage();
+
+       };
+
+
+       switch(what) {
+               case 2:
+                       if (file || (optind < argc)) {
+                               fprintf(stderr,NLS_CATGETS(catfd, hostnameSet, hostname_nodns1,
+                                          "%s: You can't change the DNS domain name with this command\n"), program_name);
+                               fprintf(stderr,NLS_CATGETS(catfd, hostnameSet, hostname_nodns2,
+                                          "\nUnless you are using bind or NIS for host lookups you can change the DNS\n"));
+                               fprintf(stderr,NLS_CATGETS(catfd, hostnameSet, hostname_nodns3,
+                                          "domain name (which is part of the FQDN) in the /etc/hosts file.\n"));
+                               NLS_CATCLOSE(catfd)
+                               exit(1);
+                       }
+                       type='d';                       
+                       /* NOBREAK */
+               case 0:
+                       if (file) {
+                               setfilename(file,SETHOST);
+                               break;
+                       }
+                       if (optind < argc) {
+                               sethname(argv[optind]);
+                               break;
+                       }
+               case 1:
+                       gethostname(myname, sizeof(myname));
+                       if (opt_v)
+                               fprintf(stderr,NLS_CATGETS(catfd, hostnameSet, hostname_verb_get, 
+                                       "gethostname()=`%s'\n"),myname);
+                       if (!type)
+                               printf("%s\n",myname);
+                       else
+                               showhname(myname,type);
+                       break;
+               case 3:
+                       if (file) {
+                               setfilename(file,SETDOMAIN);
+                               break;
+                       }
+                       if (optind < argc) {
+                               setdname(argv[optind]);
+                               break;
+                       }
+                       getdomainname(myname,sizeof(myname));
+                       if (opt_v)
+                               fprintf(stderr,NLS_CATGETS(catfd, hostnameSet, hostname_verb_dget, 
+                                       "getdomainname()=`%s'\n"),myname);
+                       printf("%s\n",myname);
+                       break;
+       }
+       NLS_CATCLOSE(catfd)
+       exit(0);
+}
diff --git a/ifconfig.c b/ifconfig.c
new file mode 100644 (file)
index 0000000..8ce44e1
--- /dev/null
@@ -0,0 +1,1261 @@
+/*
+ * ifconfig    This file contains an implementation of the command
+ *             that either displays or sets the characteristics of
+ *             one or more of the system's networking interfaces.
+ *
+ * Version:    ifconfig 1.30 (1998-01-02)
+ *
+ * Author:     Fred N. van Kempen, <waltje@uwalt.nl.mugnet.org>
+ *              and others.  Copyright 1993 MicroWalt Corporation
+ *
+ *             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.
+ */
+
+#include "config.h"
+
+#include <features.h>
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <sys/ioctl.h>
+#include <netinet/in.h>
+#include <net/if.h>
+#include <net/if_arp.h>
+#include <stdio.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <ctype.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include <netdb.h>
+
+/* Ugh.  But libc5 doesn't provide POSIX types.  */
+#include <asm/types.h>
+
+#if HAVE_AFINET6
+
+/*
+ *     This is in linux/include/net/ipv6.h.
+ */
+
+struct in6_ifreq {
+  struct in6_addr ifr6_addr;
+  __u32 ifr6_prefixlen;
+  unsigned int ifr6_ifindex;
+};
+#define IPV6_ADDR_ANY          0x0000U
+
+#define IPV6_ADDR_UNICAST              0x0001U 
+#define IPV6_ADDR_MULTICAST            0x0002U 
+#define IPV6_ADDR_ANYCAST      0x0004U
+
+#define IPV6_ADDR_LOOPBACK     0x0010U
+#define IPV6_ADDR_LINKLOCAL    0x0020U
+#define IPV6_ADDR_SITELOCAL    0x0040U
+
+#define IPV6_ADDR_COMPATv4     0x0080U
+
+#define IPV6_ADDR_SCOPE_MASK   0x00f0U
+
+#define IPV6_ADDR_MAPPED       0x1000U
+#define IPV6_ADDR_RESERVED     0x2000U /* reserved address space */
+
+#endif  /* HAVE_AFINET6 */
+
+#ifndef IFF_PORTSEL
+#define IFF_PORTSEL    0x2000
+#define IFF_AUTOMEDIA  0x4000
+#endif
+
+/* This is from <linux/netdevice.h>. */
+
+struct user_net_device_stats
+{
+  unsigned long        rx_packets;     /* total packets received       */
+  unsigned long        tx_packets;     /* total packets transmitted    */
+  unsigned long        rx_bytes;       /* total bytes received         */
+  unsigned long        tx_bytes;       /* total bytes transmitted      */
+  unsigned long        rx_errors;      /* bad packets received         */
+  unsigned long        tx_errors;      /* packet transmit problems     */
+  unsigned long        rx_dropped;     /* no space in linux buffers    */
+  unsigned long        tx_dropped;     /* no space available in linux  */
+  unsigned long        multicast;      /* multicast packets received   */
+  unsigned long        collisions;
+
+  /* detailed rx_errors: */
+  unsigned long        rx_length_errors;
+  unsigned long        rx_over_errors; /* receiver ring buff overflow  */
+  unsigned long        rx_crc_errors;  /* recved pkt with crc error    */
+  unsigned long        rx_frame_errors; /* recv'd frame alignment error */
+  unsigned long        rx_fifo_errors; /* recv'r fifo overrun          */
+  unsigned long        rx_missed_errors; /* receiver missed packet     */
+  /* detailed tx_errors */
+  unsigned long        tx_aborted_errors;
+  unsigned long        tx_carrier_errors;
+  unsigned long        tx_fifo_errors;
+  unsigned long        tx_heartbeat_errors;
+  unsigned long        tx_window_errors;
+};
+
+struct interface {
+  char                 name[IFNAMSIZ];         /* interface name        */
+  short                        type;                   /* if type               */
+  short                        flags;                  /* various flags         */
+  int                  metric;                 /* routing metric        */
+  int                  mtu;                    /* MTU value             */
+  struct ifmap         map;                    /* hardware setup        */
+  struct sockaddr      addr;                   /* IP address            */
+  struct sockaddr      dstaddr;                /* P-P IP address        */
+  struct sockaddr      broadaddr;              /* IP broadcast address  */
+  struct sockaddr      netmask;                /* IP network mask       */
+  struct sockaddr      ipxaddr_bb;             /* IPX network address   */
+  struct sockaddr      ipxaddr_sn;             /* IPX network address   */
+  struct sockaddr      ipxaddr_e3;             /* IPX network address   */
+  struct sockaddr      ipxaddr_e2;             /* IPX network address   */
+  struct sockaddr      ddpaddr;                /* Appletalk DDP address */
+  int                  has_ip;
+  int                  has_ipx_bb;
+  int                  has_ipx_sn;
+  int                  has_ipx_e3;
+  int                  has_ipx_e2;
+  int                  has_ax25;
+  int                  has_ddp;
+  char                 hwaddr[32];             /* HW address            */
+  struct user_net_device_stats stats;          /* statistics            */
+};
+
+static const char *if_port_text[][4] = {
+  /* Keep in step with <linux/netdevice.h> */
+  { "unknown", NULL , NULL, NULL },
+  { "10base2", "bnc", "coax", NULL },
+  { "10baseT", "utp", "tpe", NULL },
+  { "AUI", "thick", "db15", NULL },
+  { "100baseT", NULL, NULL, NULL },
+  { "100baseTX", NULL, NULL, NULL },
+  { "100baseFX", NULL, NULL, NULL },
+  { NULL, NULL, NULL, NULL },
+};
+
+/* Not all kernels have these new ioctls. */
+#ifndef SIOGIFNAME
+#define SIOGIFNAME     0x8934          /* if_index -> name mapping     */
+#endif
+#ifndef SIOCGIFCOUNT
+#define SIOCGIFCOUNT   0x8935          /* get number of interfaces     */
+#endif
+#ifndef SIOCDIFADDR
+#define SIOCDIFADDR    0x8936          /* delete PA address            */
+#endif
+
+#if HAVE_AFIPX
+#include "ipx.h"
+#endif
+#include "net-support.h"
+#include "pathnames.h"
+#include "version.h"
+#include "net-locale.h"
+
+char *Release = RELEASE,
+     *Version = "ifconfig 1.30 (1998-01-02)";
+
+int opt_a = 0;                         /* show all interfaces          */
+int opt_i = 0;                         /* show the statistics          */
+int opt_v = 0;                         /* debugging output flag        */
+
+int skfd = -1;                         /* generic raw socket desc.     */
+#if HAVE_AFIPX
+int ipx_sock = -1;                     /* IPX socket                   */
+#endif
+#if HAVE_AFAX25
+int ax25_sock = -1;                    /* AX.25 socket                 */
+#endif
+#if HAVE_AFINET
+int inet_sock = -1;                    /* INET socket                  */
+#endif
+#if HAVE_AFINET6
+int inet6_sock = -1;                   /* INET6 socket                 */
+#endif
+#if HAVE_AFATALK
+int ddp_sock = -1;                     /* Appletalk DDP socket         */
+#endif
+int addr_family = 0;                   /* currently selected AF        */
+
+
+static void
+ife_print(struct interface *ptr)
+{
+  struct aftype *ap;
+  struct hwtype *hw;
+  int hf;
+  char *dispname=NLS_CATSAVE (catfd, ifconfigSet, ifconfig_over, "overruns");
+  static struct aftype *ipxtype=NULL, *ddptype=NULL;
+#if HAVE_AFINET6
+  FILE *f;
+  char addr6[40], devname[10];
+  struct sockaddr_in6 sap;
+  int plen, scope, dad_status, if_idx;
+  extern struct aftype inet6_aftype;
+  char addr6p[8][5];
+  
+  if (!strncmp(ptr->name, "sit", 3)) 
+    ptr->addr.sa_family = AF_INET6;      /* fix this up properly one day */
+#endif
+
+  ap = get_afntype(ptr->addr.sa_family);
+  if (ap == NULL) ap = get_afntype(0);
+
+  hf=ptr->type;
+
+  if(strncmp(ptr->name,"lo",2)==0)
+       hf=255;
+       
+  if(hf==ARPHRD_CSLIP || hf==ARPHRD_CSLIP6)
+  {
+#if NLS
+    /* NLS must free dispname */
+    free (dispname);
+#endif
+    /* Overrun got reused: BAD - fix later */
+    dispname=NLS_CATSAVE (catfd, ifconfigSet, ifconfig_compress, "compressed");
+  }
+  
+  hw = get_hwntype(hf);
+  if (hw == NULL) hw = get_hwntype(-1);
+
+  printf(NLS_CATGETS(catfd, ifconfigSet, ifconfig_link, 
+                    "%-8.8s  Link encap:%s  "), ptr->name, hw->title);
+  /* Don't print the hardware address for ATM if it's null. */
+  if (hw->sprint != NULL && (strncmp(ptr->name, "atm", 3) || 
+   (ptr->hwaddr[0] || ptr->hwaddr[1] || ptr->hwaddr[2] || ptr->hwaddr[3] || 
+   ptr->hwaddr[4] || ptr->hwaddr[5]))) 
+    printf(NLS_CATGETS(catfd, ifconfigSet, ifconfig_hw, "HWaddr %s  ")
+          , hw->print(ptr->hwaddr));
+  if (ptr->flags & IFF_PORTSEL) 
+    printf("Media:%s%s", if_port_text[ptr->map.port][0], 
+          (ptr->flags & IFF_AUTOMEDIA)?"(auto)":"");
+  printf("\n");
+#if HAVE_AFINET6  
+  if (ap->af != AF_INET6) {
+#endif
+    printf(NLS_CATGETS(catfd, ifconfigSet, ifconfig_adr,
+                      "          %s addr:%s"), ap->name,
+          ap->sprint(&ptr->addr, 1));
+    if (ptr->flags & IFF_POINTOPOINT) {
+      printf(NLS_CATGETS(catfd, ifconfigSet, ifconfig_pap, "  P-t-P:%s  "),
+            ap->sprint(&ptr->dstaddr, 1));
+    } else {
+      printf(NLS_CATGETS(catfd, ifconfigSet, ifconfig_bcast, "  Bcast:%s  "),
+            ap->sprint(&ptr->broadaddr, 1));
+    }
+    printf(NLS_CATGETS(catfd, ifconfigSet, ifconfig_mask, "Mask:%s\n"),
+          ap->sprint(&ptr->netmask, 1));
+#if HAVE_AFINET6
+  }
+  if ((f = fopen(_PATH_PROCNET_IFINET6, "r")) != NULL) {
+    while(fscanf(f, "%4s%4s%4s%4s%4s%4s%4s%4s %02x %02x %02x %02x %s\n",
+                addr6p[0], addr6p[1], addr6p[2], addr6p[3],
+                addr6p[4], addr6p[5], addr6p[6], addr6p[7],
+                &if_idx, &plen, &scope, &dad_status, devname) != EOF) {
+      if (!strcmp(devname, ptr->name)) {
+       sprintf(addr6, "%s:%s:%s:%s:%s:%s:%s:%s",
+               addr6p[0], addr6p[1], addr6p[2], addr6p[3],
+               addr6p[4], addr6p[5], addr6p[6], addr6p[7]);
+       inet6_aftype.input(1, addr6, (struct sockaddr *)&sap);
+       printf(NLS_CATGETS(catfd, ifconfigSet, ifconfig_adr6,
+                          "          inet6 addr: %s/%d"),
+              inet6_aftype.sprint((struct sockaddr *)&sap, 1), plen);
+       printf(NLS_CATGETS(catfd, ifconfigSet, ifconfig_scope,
+                                  " Scope:"));
+       switch (scope) {
+       case 0: printf("Global"); break;
+       case IPV6_ADDR_LINKLOCAL: printf("Link"); break;
+       case IPV6_ADDR_SITELOCAL: printf("Site"); break;
+       case IPV6_ADDR_COMPATv4: printf("Compat"); break;
+       case IPV6_ADDR_LOOPBACK: printf("Host"); break;
+       default: printf("Unknown");
+       }
+       printf("\n");
+      }
+    }
+    fclose(f);
+  }
+#endif
+  
+  if (ipxtype==NULL)
+    ipxtype=get_afntype(AF_IPX);
+
+  if (ipxtype!=NULL) {
+    if(ptr->has_ipx_bb)
+      printf(NLS_CATGETS(catfd, ifconfigSet, ifconfig_etherII,
+                        "          IPX/Ethernet II addr:%s\n"),
+            ipxtype->sprint(&ptr->ipxaddr_bb,1));
+    if(ptr->has_ipx_sn)
+      printf(NLS_CATGETS(catfd, ifconfigSet, ifconfig_SNAP,
+                        "          IPX/Ethernet SNAP addr:%s\n"),
+            ipxtype->sprint(&ptr->ipxaddr_sn,1));
+    if(ptr->has_ipx_e2)
+      printf(NLS_CATGETS(catfd, ifconfigSet, ifconfig_8022,
+                        "          IPX/Ethernet 802.2 addr:%s\n"),
+            ipxtype->sprint(&ptr->ipxaddr_e2,1));
+    if(ptr->has_ipx_e3)
+      printf(NLS_CATGETS(catfd, ifconfigSet, ifconfig_8023,
+                        "          IPX/Ethernet 802.3 addr:%s\n"),
+            ipxtype->sprint(&ptr->ipxaddr_e3,1));
+  }
+  if (ddptype==NULL)
+    ddptype=get_afntype(AF_APPLETALK);
+  if (ddptype!=NULL) {
+    if (ptr->has_ddp)
+      printf(NLS_CATGETS(catfd, ifconfigSet, ifconfig_talk,
+                        "          EtherTalk Phase 2 addr:%s\n"),
+            ddptype->sprint(&ptr->ddpaddr,1));
+  }
+  printf("          ");
+  if (ptr->flags == 0) printf(NLS_CATGETS(catfd, ifconfigSet, ifconfig_noflags,
+                                         "[NO FLAGS] "));
+  if (ptr->flags & IFF_UP) printf("UP ");
+  if (ptr->flags & IFF_BROADCAST) printf("BROADCAST ");
+  if (ptr->flags & IFF_DEBUG) printf("DEBUG ");
+  if (ptr->flags & IFF_LOOPBACK) printf("LOOPBACK ");
+  if (ptr->flags & IFF_POINTOPOINT) printf("POINTOPOINT ");
+  if (ptr->flags & IFF_NOTRAILERS) printf("NOTRAILERS ");
+  if (ptr->flags & IFF_RUNNING) printf("RUNNING ");
+  if (ptr->flags & IFF_NOARP) printf("NOARP ");
+  if (ptr->flags & IFF_PROMISC) printf("PROMISC ");
+  if (ptr->flags & IFF_ALLMULTI) printf("ALLMULTI ");
+  if (ptr->flags & IFF_SLAVE) printf("SLAVE ");
+  if (ptr->flags & IFF_MASTER) printf("MASTER ");
+  if (ptr->flags & IFF_MULTICAST) printf("MULTICAST ");
+  printf(NLS_CATGETS(catfd, ifconfigSet, ifconfig_mtu, " MTU:%d  Metric:%d\n"),
+        ptr->mtu, ptr->metric?ptr->metric:1);
+
+
+  /* If needed, display the interface statistics. */
+  printf("          ");
+
+  printf(NLS_CATGETS(catfd, ifconfigSet, ifconfig_rx,
+       "RX packets:%lu errors:%lu dropped:%lu %s:%lu frame:%lu\n"),
+       ptr->stats.rx_packets, ptr->stats.rx_errors,
+       ptr->stats.rx_dropped, dispname, ptr->stats.rx_fifo_errors,
+        ptr->stats.rx_frame_errors);
+        
+  printf("          ");
+
+  printf(NLS_CATGETS(catfd, ifconfigSet, ifconfig_tx,
+       "TX packets:%lu errors:%lu dropped:%lu %s:%lu carrier:%lu coll:%lu\n"),
+       ptr->stats.tx_packets, ptr->stats.tx_errors,
+       ptr->stats.tx_dropped, dispname, ptr->stats.tx_fifo_errors,
+       ptr->stats.tx_carrier_errors, ptr->stats.collisions);
+
+  if (hf<255 && (ptr->map.irq || ptr->map.mem_start || ptr->map.dma || 
+               ptr->map.base_addr)) {
+    printf("          ");
+    if (ptr->map.irq)
+      printf(NLS_CATGETS(catfd, ifconfigSet, ifconfig_interrupt,
+                        "Interrupt:%d "), ptr->map.irq);
+    if (ptr->map.base_addr>=0x100)      /* Only print devices using it for 
+                                         I/O maps */
+      printf(NLS_CATGETS(catfd, ifconfigSet, ifconfig_base,
+                        "Base address:0x%x "), ptr->map.base_addr);
+    if (ptr->map.mem_start) {
+      printf(NLS_CATGETS(catfd, ifconfigSet, ifconfig_mem, "Memory:%lx-%lx "),
+            ptr->map.mem_start,ptr->map.mem_end);
+    }
+    if (ptr->map.dma)
+      printf(NLS_CATGETS(catfd, ifconfigSet, ifconfig_dma, "DMA chan:%x "),
+            ptr->map.dma);
+    printf("\n");
+  }
+  
+  printf("\n");
+
+#if NLS
+  /* NLS must free dispname */
+  free (dispname);
+#endif
+}
+
+
+static void if_getstats(char *ifname, struct interface *ife)
+{
+  FILE *f = fopen(_PATH_PROCNET_DEV, "r");
+  char buf[256];
+  int have_byte_counters = 0;
+  char *bp;
+  if (f==NULL)
+    return;
+  fgets(buf, 255, f);  /* throw away first line of header */
+  fgets(buf, 255, f);
+  if (strstr(buf, "bytes")) have_byte_counters=1;
+  while(fgets(buf,255,f)) {
+    bp=buf;
+    while(*bp&&isspace(*bp))
+      bp++;
+    if(strncmp(bp,ifname,strlen(ifname))==0 && bp[strlen(ifname)]==':') {
+      bp=strchr(bp,':');
+      bp++;
+      if (have_byte_counters) {
+       sscanf(bp,"%ld %ld %ld %ld %ld %ld %ld %ld %ld %ld %ld %ld %ld",
+              &ife->stats.rx_bytes,
+              &ife->stats.rx_packets,
+              &ife->stats.rx_errors,
+              &ife->stats.rx_dropped,
+              &ife->stats.rx_fifo_errors,
+              &ife->stats.rx_frame_errors,
+              
+              &ife->stats.tx_bytes,
+              &ife->stats.tx_packets,
+              &ife->stats.tx_errors,
+              &ife->stats.tx_dropped,
+              &ife->stats.tx_fifo_errors,
+              &ife->stats.collisions,
+              
+              &ife->stats.tx_carrier_errors
+              );
+      } else {
+       sscanf(bp,"%ld %ld %ld %ld %ld %ld %ld %ld %ld %ld %ld",
+              &ife->stats.rx_packets,
+              &ife->stats.rx_errors,
+              &ife->stats.rx_dropped,
+              &ife->stats.rx_fifo_errors,
+              &ife->stats.rx_frame_errors,
+              
+              &ife->stats.tx_packets,
+              &ife->stats.tx_errors,
+              &ife->stats.tx_dropped,
+              &ife->stats.tx_fifo_errors,
+              &ife->stats.collisions,
+              
+              &ife->stats.tx_carrier_errors
+              );
+       ife->stats.rx_bytes = 0;
+       ife->stats.tx_bytes = 0;
+      }
+      break;
+    }
+  }
+  fclose(f);
+}
+
+/* Support for fetching an IPX address */
+
+#if HAVE_AFIPX
+static int ipx_getaddr(int sock, int ft, struct ifreq *ifr)
+{
+       ((struct sockaddr_ipx *)&ifr->ifr_addr)->sipx_type=ft;
+       return ioctl(sock, SIOCGIFADDR, ifr);
+}
+#endif
+
+/* Fetch the interface configuration from the kernel. */
+static int
+if_fetch(char *ifname, struct interface *ife)
+{
+  struct ifreq ifr;
+
+  memset((char *) ife, 0, sizeof(struct interface));
+  strcpy(ife->name, ifname);
+
+  strcpy(ifr.ifr_name, ifname);
+  if (ioctl(skfd, SIOCGIFFLAGS, &ifr) < 0) return(-1);
+  ife->flags = ifr.ifr_flags;
+
+  strcpy(ifr.ifr_name, ifname);
+  if (ioctl(skfd, SIOCGIFHWADDR, &ifr) < 0) 
+    memset(ife->hwaddr, 0, 32);
+  else 
+    memcpy(ife->hwaddr,ifr.ifr_hwaddr.sa_data,8);
+
+  ife->type=ifr.ifr_hwaddr.sa_family;
+
+  strcpy(ifr.ifr_name, ifname);
+  if (ioctl(skfd, SIOCGIFMETRIC, &ifr) < 0)
+    ife->metric = 0;
+  else 
+    ife->metric = ifr.ifr_metric;
+
+  strcpy(ifr.ifr_name, ifname);
+  if (ioctl(skfd, SIOCGIFMTU, &ifr) < 0)
+    ife->mtu = 0;
+  else 
+    ife->mtu = ifr.ifr_mtu;
+
+  strcpy(ifr.ifr_name, ifname);
+  if (ioctl(skfd, SIOCGIFMAP, &ifr) < 0)
+    memset(&ife->map, 0, sizeof(struct ifmap));
+  else 
+    memcpy(&ife->map,&ifr.ifr_map,sizeof(struct ifmap));
+
+  strcpy(ifr.ifr_name, ifname);
+  if (ioctl(skfd, SIOCGIFMAP, &ifr) < 0)
+    memset(&ife->map, 0, sizeof(struct ifmap));
+  else 
+    ife->map = ifr.ifr_map;
+  
+#if HAVE_AFINET
+  strcpy(ifr.ifr_name, ifname);
+  if (inet_sock < 0 || ioctl(inet_sock, SIOCGIFDSTADDR, &ifr) < 0)
+    memset(&ife->dstaddr, 0, sizeof(struct sockaddr));
+  else 
+    ife->dstaddr = ifr.ifr_dstaddr;
+
+  strcpy(ifr.ifr_name, ifname);
+  if (inet_sock < 0 || ioctl(inet_sock, SIOCGIFBRDADDR, &ifr) < 0)
+    memset(&ife->broadaddr, 0, sizeof(struct sockaddr));
+  else 
+    ife->broadaddr = ifr.ifr_broadaddr;
+
+  strcpy(ifr.ifr_name, ifname);
+  if (inet_sock < 0 || ioctl(inet_sock, SIOCGIFNETMASK, &ifr) < 0)
+    memset(&ife->netmask, 0, sizeof(struct sockaddr));
+  else 
+    ife->netmask = ifr.ifr_netmask;
+
+  strcpy(ifr.ifr_name, ifname);
+  if (inet_sock < 0 || ioctl(inet_sock, SIOCGIFADDR, &ifr) < 0) 
+    memset(&ife->addr, 0, sizeof(struct sockaddr));
+  else 
+    ife->addr = ifr.ifr_addr;
+#endif
+  
+#if HAVE_AFATALK
+  /* DDP address maybe ? */
+  strcpy(ifr.ifr_name, ifname);
+  if (ddp_sock >= 0 && ioctl(ddp_sock, SIOCGIFADDR, &ifr) == 0) {
+    ife->ddpaddr=ifr.ifr_addr;
+    ife->has_ddp=1;
+  }
+#endif
+
+#if HAVE_AFIPX  
+  /* Look for IPX addresses with all framing types */
+  strcpy(ifr.ifr_name, ifname);
+  if (ipx_sock >= 0) {
+    if (!ipx_getaddr(ipx_sock, IPX_FRAME_ETHERII, &ifr)) {
+      ife->has_ipx_bb=1;
+      ife->ipxaddr_bb=ifr.ifr_addr;
+    }
+    strcpy(ifr.ifr_name, ifname);
+    if (!ipx_getaddr(ipx_sock, IPX_FRAME_SNAP, &ifr)) {
+      ife->has_ipx_sn=1;
+      ife->ipxaddr_sn=ifr.ifr_addr;
+    }
+    strcpy(ifr.ifr_name, ifname);
+    if(!ipx_getaddr(ipx_sock, IPX_FRAME_8023, &ifr)) {
+      ife->has_ipx_e3=1;
+      ife->ipxaddr_e3=ifr.ifr_addr;
+    }
+    strcpy(ifr.ifr_name, ifname);
+    if(!ipx_getaddr(ipx_sock, IPX_FRAME_8022, &ifr)) {
+      ife->has_ipx_e2=1;
+      ife->ipxaddr_e2=ifr.ifr_addr;
+    }
+  }
+#endif
+
+  if_getstats(ifname,ife);
+  return(0);
+}
+
+
+static void
+if_print(char *ifname)
+{
+  struct interface ife;
+
+  if (ifname == (char *)NULL) {
+    int i;
+    struct ifconf ifc;
+    struct ifreq *ifr;
+    if (ioctl(skfd, SIOCGIFCOUNT, &i) < 0) {
+      int n = 2, s;
+      ifc.ifc_buf = NULL;
+      do {
+       n *= 2;
+       ifc.ifc_buf = realloc(ifc.ifc_buf, (ifc.ifc_len = s = 
+                                           n*sizeof(struct ifreq)));
+       if (ifc.ifc_buf == NULL) {
+         fprintf(stderr, "Out of memory\n");
+         exit(1);
+       }
+       
+       if (ioctl(skfd, SIOCGIFCONF, &ifc) < 0) {
+         perror("SIOCGIFCONF");
+         return;
+       }
+      } while (ifc.ifc_len == s);
+    } else {
+      ifc.ifc_buf = malloc(ifc.ifc_len = i*sizeof(struct ifreq));
+      if (ifc.ifc_buf == NULL) {
+       fprintf(stderr, "Out of memory.\n");
+       exit(1);
+      }
+      if (ioctl(skfd, SIOCGIFCONF, &ifc) < 0) {
+       perror("SIOCGIFCONF");
+       return;
+      }
+    }
+    ifr = ifc.ifc_req;
+    for (i = ifc.ifc_len / sizeof(struct ifreq); --i >= 0; ifr++) {
+      if (if_fetch(ifr->ifr_name, &ife) < 0) {
+       fprintf(stderr, NLS_CATGETS(catfd, ifconfigSet, 
+                     ifconfig_unkn, "%s: unknown interface.\n"),
+               ifr->ifr_name);
+       continue;
+      }
+      
+      if (((ife.flags & IFF_UP) == 0) && !opt_a) continue;
+      ife_print(&ife);
+    }
+    free(ifc.ifc_buf);
+  } else {
+    if (if_fetch(ifname, &ife) < 0)
+      fprintf(stderr, NLS_CATGETS(catfd, ifconfigSet, 
+                     ifconfig_unkn, "%s: unknown interface.\n"), ifname);
+    else 
+      ife_print(&ife);
+  }
+}
+
+
+/* Set a certain interface flag. */
+static int
+set_flag(char *ifname, short flag)
+{
+  struct ifreq ifr;
+
+  strcpy(ifr.ifr_name, ifname);
+  if (ioctl(skfd, SIOCGIFFLAGS, &ifr) < 0) {
+    fprintf(stderr, "%s: unknown interface.\n", ifname);
+    return(-1);
+  }
+  strcpy(ifr.ifr_name, ifname);
+  ifr.ifr_flags |= flag;
+  if (ioctl(skfd, SIOCSIFFLAGS, &ifr) < 0) {
+    perror("SIOCSIFFLAGS");
+    return -1;
+  }
+  return(0);
+}
+
+
+/* Clear a certain interface flag. */
+static int
+clr_flag(char *ifname, short flag)
+{
+  struct ifreq ifr;
+
+  strcpy(ifr.ifr_name, ifname);
+  if (ioctl(skfd, SIOCGIFFLAGS, &ifr) < 0) {
+    fprintf(stderr, "%s: unknown interface.\n", ifname);
+    return -1;
+  }
+  strcpy(ifr.ifr_name, ifname);
+  ifr.ifr_flags &= ~flag;
+  if (ioctl(skfd, SIOCSIFFLAGS, &ifr) < 0) {
+    perror("SIOCSIFFLAGS");
+    return -1;
+  }
+  return(0);
+}
+
+
+static void
+usage(void)
+{
+  fprintf(stderr, NLS_CATGETS(catfd, ifconfigSet, ifconfig_usage1,
+                             "Usage: ifconfig [-a] [-i] [-v] interface\n"));
+  fprintf(stderr, "                [[family] address]\n");
+#if HAVE_AFINET6
+  fprintf(stderr, "                [add inet6address/prefixlen]\n");
+  fprintf(stderr, "                [del inet6address/prefixlen]\n");
+  fprintf(stderr, "                [tunnel aa.bb.cc.dd]\n");
+#endif
+#if HAVE_AFINET
+  fprintf(stderr, "                [[-]broadcast [aa.bb.cc.dd]]\n");
+  fprintf(stderr, "                [[-]pointopoint [aa.bb.cc.dd]]\n");
+  fprintf(stderr, "                [netmask aa.bb.cc.dd]\n");
+  fprintf(stderr, "                [dstaddr aa.bb.cc.dd]\n");
+#endif
+  fprintf(stderr, "                [hw class address]\n");
+  fprintf(stderr, "                [metric NN] [mtu NN]\n");
+  fprintf(stderr, "                [[-]trailers] [[-]arp]\n");
+  fprintf(stderr, "                [[-]allmulti] [[-]promisc]\n");
+  fprintf(stderr, "                [multicast]\n");
+  fprintf(stderr, "                [mem_start NN] [io_addr NN] [irq NN]\n");
+  fprintf(stderr, "                [media type]\n");
+  fprintf(stderr, "                [up] [down] ...\n");
+  NLS_CATCLOSE(catfd)
+  exit(1);
+}
+
+static void
+version(void)
+{
+  fprintf(stderr,"%s\n%s\n",Release,Version);
+  NLS_CATCLOSE(catfd)
+  exit(1);
+}
+
+static int sockets_open()
+{
+#if HAVE_AFINET
+  inet_sock = socket(AF_INET, SOCK_DGRAM, 0);
+#endif
+
+#if HAVE_AFINET6
+  inet6_sock = socket(AF_INET6, SOCK_DGRAM, 0);
+#endif
+
+#if HAVE_AFIPX 
+  ipx_sock = socket(AF_IPX, SOCK_DGRAM, 0);
+#endif
+
+#if HAVE_AFAX25 
+  ax25_sock = socket(AF_AX25, SOCK_DGRAM, 0);
+#endif
+
+#if HAVE_AFATALK
+  ddp_sock = socket(AF_APPLETALK, SOCK_DGRAM, 0);
+#endif
+  
+  /*
+   *   Now pick any (existing) useful socket family for generic queries
+   */
+
+#if HAVE_AFINET
+  if (inet_sock != -1) return inet_sock;
+#endif
+
+#if HAVE_AFINET6
+  if (inet6_sock != -1) return inet6_sock;
+#endif
+
+#if HAVE_AFIPX 
+  if (ipx_sock != -1) return ipx_sock;
+#endif
+
+#if HAVE_AFAX25 
+  if (ax25_sock != -1) return ax25_sock;
+#endif
+
+#if HAVE_AFATALK
+  if (ddp_sock != -1) return ddp_sock;
+#endif
+
+  /* We have no address families.  */
+  fprintf(stderr, "No usable address families found.\n");
+  return -1;
+}
+       
+int
+main(int argc, char **argv)
+{
+  struct sockaddr sa;
+  char host[128];
+  struct aftype *ap;
+  struct hwtype *hw;
+  struct ifreq ifr;
+  int goterr = 0;
+  char **spp;
+#if HAVE_AFINET6
+  extern struct aftype inet6_aftype;
+  struct sockaddr_in6 sa6;
+  struct in6_ifreq ifr6;
+  unsigned long prefix_len;
+  char *cp;
+#endif
+  
+#if NLS
+  setlocale (LC_MESSAGES, "");
+  catfd = catopen ("nettools", MCLoadBySet);
+#endif
+
+  /* Create a channel to the NET kernel. */
+  if ((skfd = sockets_open()) < 0) {
+    perror("socket");
+    NLS_CATCLOSE(catfd)
+    exit(1);
+  }
+
+  /* Find any options. */
+  argc--; argv++;
+  while (argc && *argv[0] == '-') {
+    if (!strcmp(*argv, "-a")) opt_a = 1;
+    
+    if (!strcmp(*argv, "-v")) opt_v = 1;
+    
+    if (!strcmp(*argv, "-V") || !strcmp(*argv, "-version") || 
+       !strcmp(*argv, "--version")) version();
+    
+    if (!strcmp(*argv, "-?") || !strcmp(*argv, "-h") || 
+       !strcmp(*argv, "-help") || !strcmp(*argv, "--help")) usage();
+    
+    argv++;
+    argc--;
+  }
+
+  /* Do we have to show the current setup? */
+  if (argc == 0) {
+    if_print((char *)NULL);
+    (void) close(skfd);
+    NLS_CATCLOSE(catfd)
+    exit(0);
+  }
+
+  /* No. Fetch the interface name. */
+  spp = argv;
+  strncpy(ifr.ifr_name, *spp++, IFNAMSIZ);
+  if (*spp == (char *)NULL) {
+    if_print(ifr.ifr_name);
+    (void) close(skfd);
+    NLS_CATCLOSE(catfd)
+    exit(0);
+  }
+
+  /* The next argument is either an address family name, or an option. */
+  if ((ap = get_aftype(*spp)) == NULL) 
+    ap = get_aftype("inet");
+  else 
+    spp++;
+  addr_family = ap->af;
+
+  /* Process the remaining arguments. */
+  while (*spp != (char *)NULL) {
+    if (!strcmp(*spp, "arp")) {
+      goterr |= clr_flag(ifr.ifr_name, IFF_NOARP);
+      spp++;
+      continue;
+    }
+    
+    if (!strcmp(*spp, "-arp")) {
+      goterr |= set_flag(ifr.ifr_name, IFF_NOARP);
+      spp++;
+      continue;
+    }
+
+    if (!strcmp(*spp, "media") || !strcmp(*spp, "port")) {
+      if (*++spp == NULL) usage();
+      if (!strcasecmp(*spp, "auto")) {
+       goterr |= set_flag(ifr.ifr_name, IFF_AUTOMEDIA);
+      } else {
+       int i, j, newport;
+       char *endp;
+       newport = strtol(*spp, &endp, 10);
+       if (*endp != 0) {
+         newport = -1;
+         for (i = 0; if_port_text[i][0] && newport == -1; i++) {
+           for (j = 0; if_port_text[i][j]; j++) {
+             if (!strcasecmp(*spp, if_port_text[i][j])) {
+               newport = i;
+               break;
+             }
+           }
+         }
+       }
+       spp++;
+       if (newport == -1) {
+         fprintf(stderr, "Unknown media type.\n");
+         goterr = 1;
+       } else {
+         if (ioctl(skfd, SIOCGIFMAP, &ifr) < 0) {
+           goterr = 1;
+           continue;
+         }
+         ifr.ifr_map.port = newport;
+         if (ioctl(skfd, SIOCSIFMAP, &ifr) < 0) {
+           perror("SIOCSIFMAP");
+           goterr = 1;
+         }
+       }
+      }
+      continue;
+    }
+    
+    if (!strcmp(*spp, "trailers")) {
+      goterr |= clr_flag(ifr.ifr_name, IFF_NOTRAILERS);
+      spp++;
+      continue;
+    }
+    
+    if (!strcmp(*spp, "-trailers")) {
+      goterr |= set_flag(ifr.ifr_name, IFF_NOTRAILERS);
+      spp++;
+      continue;
+    }
+    
+    if (!strcmp(*spp, "promisc")) {
+      goterr |= set_flag(ifr.ifr_name, IFF_PROMISC);
+      spp++;
+      continue;
+    }
+    
+    if (!strcmp(*spp, "-promisc")) {
+      goterr |= clr_flag(ifr.ifr_name, IFF_PROMISC);
+      spp++;
+      continue;
+    }
+    
+    if (!strcmp(*spp, "multicast")) {
+      goterr |= set_flag(ifr.ifr_name, IFF_MULTICAST);
+      spp++;
+      continue;
+    }
+    
+    if (!strcmp(*spp, "-multicast")) {
+      goterr |= clr_flag(ifr.ifr_name, IFF_MULTICAST);
+      spp++;
+      continue;
+    }
+
+    if (!strcmp(*spp, "allmulti")) {
+      goterr |= set_flag(ifr.ifr_name, IFF_ALLMULTI);
+      spp++;
+      continue;
+    }
+
+    if (!strcmp(*spp, "-allmulti")) {
+      goterr |= clr_flag(ifr.ifr_name, IFF_ALLMULTI);
+      spp++;
+      continue;
+    }
+
+    if (!strcmp(*spp, "up")) {
+      goterr |= set_flag(ifr.ifr_name, (IFF_UP | IFF_RUNNING));
+      spp++;
+      continue;
+    }
+    
+    if (!strcmp(*spp, "down")) {
+      goterr |= clr_flag(ifr.ifr_name, IFF_UP);
+      spp++;
+      continue;
+    }
+
+    if (!strcmp(*spp, "metric")) {
+      if (*++spp == NULL) usage();
+      ifr.ifr_metric = atoi(*spp);
+      if (ioctl(skfd, SIOCSIFMETRIC, &ifr) < 0) {
+       fprintf(stderr, "SIOCSIFMETRIC: %s\n", strerror(errno));
+       goterr = 1;
+      }
+      spp++;
+      continue;
+    }
+    
+    if (!strcmp(*spp, "mtu")) {
+      if (*++spp == NULL) usage();
+      ifr.ifr_mtu = atoi(*spp);
+      if (ioctl(skfd, SIOCSIFMTU, &ifr) < 0) {
+       fprintf(stderr, "SIOCSIFMTU: %s\n", strerror(errno));
+       goterr = 1;
+      }
+      spp++;
+      continue;
+    }
+    
+    if (!strcmp(*spp, "-broadcast")) {
+      goterr |= clr_flag(ifr.ifr_name, IFF_BROADCAST);
+      spp++;
+      continue;
+    }
+    
+    if (!strcmp(*spp, "broadcast")) {
+      if (*++spp != NULL ) {
+       strcpy(host, *spp);
+       if (ap->input(0, host, &sa) < 0) {
+         ap->herror(host);
+         goterr = 1;
+         spp++;
+         continue;
+       }
+       memcpy((char *) &ifr.ifr_broadaddr, (char *) &sa,
+              sizeof(struct sockaddr));
+       if (ioctl(skfd, SIOCSIFBRDADDR, &ifr) < 0) {
+         fprintf(stderr, "SIOCSIFBRDADDR: %s\n",
+                 strerror(errno));
+         goterr = 1;
+       }
+       spp++;
+      }
+      goterr |= set_flag(ifr.ifr_name, IFF_BROADCAST);
+      continue;
+    }
+    
+    if (!strcmp(*spp, "dstaddr")) {
+      if (*++spp == NULL) usage();
+      strcpy(host, *spp);
+      if (ap->input(0, host, &sa) < 0) {
+       ap->herror(host);
+       goterr = 1;
+       spp++;
+       continue;
+      }
+      memcpy((char *) &ifr.ifr_dstaddr, (char *) &sa,
+            sizeof(struct sockaddr));
+      if (ioctl(skfd, SIOCSIFDSTADDR, &ifr) < 0) {
+       fprintf(stderr, "SIOCSIFDSTADDR: %s\n",
+               strerror(errno));
+       goterr = 1;
+      }
+      spp++;
+      continue;
+    }
+    
+    if (!strcmp(*spp, "netmask")) {
+      if (*++spp == NULL) usage();
+      strcpy(host, *spp);
+      if (ap->input(0, host, &sa) < 0) {
+       ap->herror(host);
+       goterr = 1;
+       spp++;
+       continue;
+      }
+      memcpy((char *) &ifr.ifr_netmask, (char *) &sa,
+            sizeof(struct sockaddr));
+      if (ioctl(skfd, SIOCSIFNETMASK, &ifr) < 0) {
+       fprintf(stderr, "SIOCSIFNETMASK: %s\n",
+               strerror(errno));
+       goterr = 1;
+      }
+      spp++;
+      continue;
+    }
+    
+    if (!strcmp(*spp, "mem_start")) {
+      if (*++spp == NULL) usage();
+      if (ioctl(skfd, SIOCGIFMAP, &ifr) < 0) {
+       goterr = 1;
+       continue;
+      }
+      ifr.ifr_map.mem_start = strtoul(*spp, NULL, 0);
+      if (ioctl(skfd, SIOCSIFMAP, &ifr) < 0) {
+       fprintf(stderr, "SIOCSIFMAP: %s\n", strerror(errno));
+       goterr = 1;
+      }
+      spp++;
+      continue;
+    }
+    
+    if (!strcmp(*spp, "io_addr")) {
+      if (*++spp == NULL) usage();
+      if (ioctl(skfd, SIOCGIFMAP, &ifr) < 0) {
+       goterr = 1;
+       continue;
+      }
+      ifr.ifr_map.base_addr = strtol(*spp, NULL, 0);
+      if (ioctl(skfd, SIOCSIFMAP, &ifr) < 0) {
+       fprintf(stderr, "SIOCSIFMAP: %s\n", strerror(errno));
+       goterr = 1;
+      }
+      spp++;
+      continue;
+    }
+    
+    if (!strcmp(*spp, "irq")) {
+      if (*++spp == NULL) usage();
+      if (ioctl(skfd, SIOCGIFMAP, &ifr) < 0) {
+       goterr = 1;
+       continue;
+      }
+      ifr.ifr_map.irq = atoi(*spp);
+      if (ioctl(skfd, SIOCSIFMAP, &ifr) < 0) {
+       fprintf(stderr, "SIOCSIFMAP: %s\n", strerror(errno));
+       goterr = 1;
+      }
+      spp++;
+      continue;
+    }
+    
+    if (!strcmp(*spp, "-pointopoint")) {
+      goterr |= clr_flag(ifr.ifr_name, IFF_POINTOPOINT);
+      spp++;
+      continue;
+    }
+    
+    if (!strcmp(*spp, "pointopoint")) {
+      if (*(spp+1) != NULL) {
+       spp++;
+       strcpy(host, *spp);
+       if (ap->input(0, host, &sa)) {
+         ap->herror(host);
+         goterr = 1;
+         spp++;
+         continue;
+       }
+       memcpy((char *) &ifr.ifr_dstaddr, (char *) &sa,
+              sizeof(struct sockaddr));
+       if (ioctl(skfd, SIOCSIFDSTADDR, &ifr) < 0) {
+         fprintf(stderr, "SIOCSIFDSTADDR: %s\n",
+                 strerror(errno));
+         goterr = 1;
+       }
+      }
+      goterr |= set_flag(ifr.ifr_name, IFF_POINTOPOINT);
+      spp++;
+      continue;
+    };
+    
+    if (!strcmp(*spp, "hw")) {
+      if (*++spp == NULL) usage();
+      if ((hw = get_hwtype(*spp)) == NULL) usage();
+      if (*++spp == NULL) usage();
+      strcpy(host, *spp);
+      if (hw->input(host, &sa) < 0) {
+       fprintf(stderr, "%s: invalid %s address.\n", host, hw->name);
+       goterr = 1;
+       spp++;
+       continue;
+      }
+      memcpy((char *) &ifr.ifr_hwaddr, (char *) &sa,
+            sizeof(struct sockaddr));
+      if (ioctl(skfd, SIOCSIFHWADDR, &ifr) < 0) {
+       fprintf(stderr, "SIOCSIFHWADDR: %s\n",
+               strerror(errno));
+       goterr = 1;
+      }
+      spp++;
+      continue;
+    }
+    
+#if HAVE_AFINET6
+    if (!strcmp(*spp, "add")) {
+      if (*++spp == NULL) usage();
+      if ((cp = strchr(*spp, '/'))) {
+       prefix_len = atol(cp+1);
+       if ((prefix_len < 0) || (prefix_len > 128)) usage();
+       *cp = 0;
+      } else {
+       prefix_len = 0;
+      }
+      strcpy(host, *spp);
+      if (inet6_aftype.input(1, host, (struct sockaddr *)&sa6) < 0) {
+       inet6_aftype.herror(host);
+       goterr = 1;
+       spp++;
+       continue;
+      }
+      memcpy((char *) &ifr6.ifr6_addr, (char *) &sa6.sin6_addr,
+            sizeof(struct in6_addr));
+      
+      if (ioctl(inet6_sock, SIOGIFINDEX, &ifr) < 0) {
+       perror("SIOGIFINDEX");
+       goterr = 1;
+       spp++;
+       continue;
+      }
+
+      ifr6.ifr6_ifindex = ifr.ifr_ifindex;
+      ifr6.ifr6_prefixlen = prefix_len;
+      if (ioctl(inet6_sock, SIOCSIFADDR, &ifr6) < 0) {
+       fprintf(stderr, "SIOCSIFADDR: %s\n",
+               strerror(errno));
+       goterr = 1;
+      }
+      spp++;
+      continue;
+    }
+
+    if (!strcmp(*spp, "del")) {
+      if (*++spp == NULL) usage();
+      if ((cp = strchr(*spp, '/'))) {
+       prefix_len = atol(cp+1);
+       if ((prefix_len < 0) || (prefix_len > 128)) usage();
+       *cp = 0;
+      } else {
+       prefix_len = 0;
+      }
+      strcpy(host, *spp);
+      if (inet6_aftype.input(1, host, (struct sockaddr *)&sa6) < 0) {
+       inet6_aftype.herror(host);
+       goterr = 1;
+       spp++;
+       continue;
+      }
+      memcpy((char *) &ifr6.ifr6_addr, (char *) &sa6.sin6_addr,
+            sizeof(struct in6_addr));
+      
+      if (ioctl(inet6_sock, SIOGIFINDEX, &ifr) < 0) {
+       perror("SIOGIFINDEX");
+       goterr = 1;
+       spp++;
+       continue;
+      }
+
+      ifr6.ifr6_ifindex = ifr.ifr_ifindex;
+      ifr6.ifr6_prefixlen = prefix_len;
+      if (ioctl(inet6_sock, SIOCDIFADDR, &ifr6) < 0) {
+       fprintf(stderr, "SIOCDIFADDR: %s\n",
+               strerror(errno));
+       goterr = 1;
+      }
+      spp++;
+      continue;
+    }
+    
+    if (!strcmp(*spp, "tunnel")) {
+      if (*++spp == NULL) usage();
+      if ((cp = strchr(*spp, '/'))) {
+       prefix_len = atol(cp+1);
+       if ((prefix_len < 0) || (prefix_len > 128)) usage();
+       *cp = 0;
+      } else {
+       prefix_len = 0;
+      }
+      strcpy(host, *spp);
+      if (inet6_aftype.input(1, host, (struct sockaddr *)&sa6) < 0) {
+       inet6_aftype.herror(host);
+       goterr = 1;
+       spp++;
+       continue;
+      }
+      memcpy((char *) &ifr6.ifr6_addr, (char *) &sa6.sin6_addr,
+            sizeof(struct in6_addr));
+      
+      if (ioctl(inet6_sock, SIOGIFINDEX, &ifr) < 0) {
+       perror("SIOGIFINDEX");
+       goterr = 1;
+       spp++;
+       continue;
+      }
+      
+      ifr6.ifr6_ifindex = ifr.ifr_ifindex;
+      ifr6.ifr6_prefixlen = prefix_len;
+      
+      if (ioctl(inet6_sock, SIOCSIFDSTADDR, &ifr6) < 0) {
+       fprintf(stderr, "SIOCSIFDSTADDR: %s\n",
+               strerror(errno));
+       goterr = 1;
+      }
+      spp++;
+      continue;
+    }
+#endif
+    
+    /* If the next argument is a valid hostname, assume OK. */
+    strcpy(host, *spp);
+    if (ap->input(0, host, &sa) < 0) {
+      ap->herror(host);
+      usage();
+    }
+
+    memcpy((char *) &ifr.ifr_addr, (char *) &sa, sizeof(struct sockaddr));
+    if (ioctl(skfd, SIOCSIFADDR, &ifr) < 0) {
+      fprintf(stderr, "SIOCSIFADDR: %s\n", strerror(errno));
+      goterr = 1;
+    }
+    goterr |= set_flag(ifr.ifr_name, (IFF_UP | IFF_RUNNING));
+    spp++;
+  }
+
+  /* Close the socket. */
+  (void) close(skfd);
+
+  NLS_CATCLOSE(catfd)
+  return(goterr);
+}
diff --git a/include/ipx.h b/include/ipx.h
new file mode 100644 (file)
index 0000000..0b63141
--- /dev/null
@@ -0,0 +1,30 @@
+/* Sanitised ipx.h for net-tools. */
+
+#ifndef _IPX_H_ 
+#define _IPX_H_
+
+#define IPX_NODE_LEN   6
+#define IPX_MTU                576
+
+struct sockaddr_ipx
+  {
+#if LINUX_VERSION_CODE > 131328  /* 2.1.0 or later */
+    sa_family_t            sipx_family;
+#else
+    short sipx_family;
+#endif
+    unsigned short  sipx_port;
+    unsigned long   sipx_network;
+    unsigned char   sipx_node[IPX_NODE_LEN];
+    unsigned char   sipx_type;
+    unsigned char   sipx_zero; /* 16 byte fill */
+  };
+
+#define IPX_FRAME_NONE         0
+#define IPX_FRAME_SNAP         1
+#define IPX_FRAME_8022         2
+#define IPX_FRAME_ETHERII      3
+#define IPX_FRAME_8023         4
+#define IPX_FRAME_TR_8022      5
+
+#endif
diff --git a/lib/Makefile b/lib/Makefile
new file mode 100644 (file)
index 0000000..1901b4f
--- /dev/null
@@ -0,0 +1,66 @@
+#
+# lib/Makefile Makefile for the net-lib function collection
+#
+# NET-LIB      A collection of functions used from the base set of the
+#              NET-2 Networking Distribution for the LINUX operating
+#              system.  (net-tools, net-drivers)
+#
+# Version:     lib/Makefile 1.27 (1996-04-13)
+#
+# Author:      Fred N. van Kempen, <waltje@uwalt.nl.mugnet.org>
+#              Copyright 1993 MicroWalt Corporation
+#
+# Modification:
+#960125        {1.21}  Bernd Eckenfels:        reformated, layout
+#960203 {1.22} Bernd Eckenfels:        afrt.o will include all the 
+#                                      routing support into the binaries.
+#960206 {1.23} Bernd Eckenfels:        better solution wit route_init
+#960215 {1.24} Bernd Eckenfels:        ax25_rt.o added
+#960221 {1.25} Bernd Eckenfels:        getroute/setroute.o
+#960322 {1.26} Bernd Eckenfels:        ACTOBJS support
+#960413 {1.27} Bernd Eckenfels:        Mike McLagan FRAD Support (frame.c)
+#960809 {1.xx} Frank Strauss:          inet6.c inet6_gr.c
+#
+#              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.
+#
+
+
+HWOBJS  = hw.o loopback.o slip.o ether.o ax25.o ppp.o arcnet.o tr.o tunnel.o frame.o sit.o
+AFOBJS  = unix.o inet.o inet6.o ax25.o ipx.o ddp.o ipx.o netrom.o af.o
+AFGROBJS = inet_gr.o inet6_gr.o ipx_gr.o ddp_gr.o netrom_gr.o ax25_gr.o getroute.o
+AFSROBJS = inet_sr.o inet6_sr.o netrom_sr.o ipx_sr.o setroute.o
+ACTOBJS  = slip_ac.o ppp_ac.o activate.o
+VARIA   = getargs.o masq_info.o
+NLSMISC  = net-string.o
+
+OBJS   = $(NLSMISC) $(VARIA) $(AFOBJS) $(HWOBJS) \
+               $(AFGROBJS) $(AFSROBJS) $(ACTOBJS)
+
+
+# This can be overwritten by the TOPLEVEL Makefile
+TOPDIR=..
+COPTS = -O2 -Wall -fomit-frame-pointer #-DDEBUG
+LOPTS = -s
+
+CFLAGS  = $(COPTS) -I. -I$(TOPDIR) -I$(TOPDIR)/include
+LDFLAGS = $(LOPTS)
+
+all:   libsupport.a
+
+libsupport.a:  Makefile $(TOPDIR)/config.h $(OBJS)
+                       @echo Building libsupport.a
+                       @rm -f libsupport.a
+                       @ar rcs libsupport.a $(OBJS)
+                       @ranlib libsupport.a
+
+clean:
+               rm -f *.o *~ *.orig
+
+clobber:       clean
+               rm -f *.a
+
+# End of lib/Makefile.
diff --git a/lib/activate.c b/lib/activate.c
new file mode 100644 (file)
index 0000000..1dfb789
--- /dev/null
@@ -0,0 +1,77 @@
+/*
+ * lib/activate.c      This file contains a small interface function to
+ *                     use the HW specific activate routines for line
+ *                     disciplines
+ *
+ * NET-LIB     A collection of functions used from the base set of the
+ *             NET-3 Networking Distribution for the LINUX operating
+ *             system. (net-tools, net-drivers)
+ *
+ * Version:    lib/activate.c 0.01 (1996-03-22)
+ *
+ * Author:     Bernd 'eckes' Eckenfels <net-tools@lina.inka.de>
+ *             Copyright 1996 Bernd Eckenfels, Germany
+ *
+ * Modifications:
+ *
+ *960322 {0.01} Bernd Eckenfels:       creation
+ *
+ *             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.
+ */
+#include <stdio.h>
+#include <string.h>
+#include "net-support.h"
+#include "pathnames.h"
+#include "version.h"
+#include "config.h"
+#include "net-locale.h"
+
+extern struct hwtype   slip_hwtype;
+extern struct hwtype   cslip_hwtype;
+extern struct hwtype   slip6_hwtype;
+extern struct hwtype   cslip6_hwtype;
+extern struct hwtype   adaptive_hwtype;
+extern  struct hwtype  ppp_hwtype;
+
+extern int SLIP_activate(int fd);
+extern int CSLIP_activate(int fd);
+extern int SLIP6_activate(int fd);
+extern int CSLIP6_activate(int fd);
+extern int ADAPTIVE_activate(int fd);
+extern int PPP_activate(int fd);
+
+void
+activate_init(void)
+{
+#if HAVE_HWSLIP
+       slip_hwtype.activate     = SLIP_activate;
+       cslip_hwtype.activate    = CSLIP_activate;
+       slip6_hwtype.activate    = SLIP6_activate;
+       cslip6_hwtype.activate   = CSLIP6_activate;
+       adaptive_hwtype.activate = ADAPTIVE_activate;
+#endif
+#if HAVE_HWPPP
+        ppp_hwtype.activate = PPP_activate;
+#endif
+}
+
+int activate_ld(const char *hwname, int fd)
+{
+  struct hwtype *hw;
+  
+  hw = get_hwtype(hwname);
+  
+  if (!hw) {
+       fprintf(stderr,NLS_CATGETS(catfd, libSet, lib_act_no_support, "Hardware type `%s' not supported.\n"),hwname);
+       return(E_NOSUPP);
+  }
+  if (!hw->activate) {
+       fprintf(stderr,NLS_CATGETS(catfd, libSet, lib_type_no_act, "Cannot change line discipline to `%s'.\n"),hw->name);
+       return(E_OPTERR);
+  }
+  return(hw->activate(fd));
+}
diff --git a/lib/af.c b/lib/af.c
new file mode 100644 (file)
index 0000000..6e2e668
--- /dev/null
+++ b/lib/af.c
@@ -0,0 +1,244 @@
+/*
+ * lib/af.c    This file contains the top-level part of the protocol
+ *             support functions module for the NET-2 base distribution.
+ *
+ * Version:    lib/af.c 1.13 (1996-02-21)
+ *
+ * Author:     Fred N. van Kempen, <waltje@uwalt.nl.mugnet.org>
+ *             Copyright 1993 MicroWalt Corporation
+ *
+ *             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.
+ */
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <errno.h>
+#include <ctype.h>
+#include <string.h>
+#include <unistd.h>
+#include "config.h"
+#include "net-support.h"
+#include "pathnames.h"
+#define  EXTERN
+#include "net-locale.h"
+
+
+int flag_unx = 0;
+int flag_ipx = 0;
+int flag_ax25 = 0;
+int flag_ddp = 0;
+int flag_netrom = 0;
+int flag_inet = 0;
+int flag_inet6 = 0;
+
+
+struct aftrans_t {
+       char *alias;
+       char *name;
+       int  *flag;
+} aftrans[]={
+       {"ax25",        "ax25",         &flag_ax25},
+       {"ip",          "inet",         &flag_inet},
+       {"ip6",         "inet6",        &flag_inet6},
+       {"ipx",         "ipx",          &flag_ipx},
+       {"appletalk",   "ddp",          &flag_ddp},
+       {"netrom",      "netrom",       &flag_netrom},
+       {"inet",        "inet",         &flag_inet},
+       {"inet6",       "inet6",        &flag_inet6},
+       {"ddp",         "ddp",          &flag_ddp},
+       {"unix",        "unix",         &flag_unx},
+       {"tcpip",       "inet",         &flag_inet},
+       {0,             0,              0}
+};
+
+char           afname[256]="";
+
+extern struct aftype   unspec_aftype;
+extern struct aftype   unix_aftype;
+extern struct aftype   inet_aftype;
+extern struct aftype   inet6_aftype;
+extern struct aftype   ax25_aftype;
+extern struct aftype   netrom_aftype;
+extern struct aftype   ipx_aftype;
+extern struct aftype   ddp_aftype;
+
+static short sVafinit = 0;
+
+static struct aftype *aftypes[] = {
+#if HAVE_AFUNIX
+  &unix_aftype,
+#endif
+#if HAVE_AFINET
+  &inet_aftype,
+#endif
+#if HAVE_AFINET6
+  &inet6_aftype,
+#endif
+#if HAVE_AFAX25
+  &ax25_aftype,
+#endif
+#if HAVE_AFNETROM
+  &netrom_aftype,
+#endif
+#if HAVE_AFIPX
+  &ipx_aftype,
+#endif
+#if HAVE_AFATALK
+  &ddp_aftype,
+#endif    
+  &unspec_aftype,
+  NULL
+};
+
+void afinit ()
+{
+  unspec_aftype.title = NLS_CATSAVE (catfd, unixSet, unix_unspec, "UNSPEC");
+#if HAVE_AFINET
+  unix_aftype.title = NLS_CATSAVE (catfd, unixSet, unix_unix, "UNIX Domain");
+#endif
+#if HAVE_AFINET
+  inet_aftype.title = NLS_CATSAVE (catfd, inetSet, inet_darpa, "DARPA Internet");
+#endif
+#if HAVE_AFINET6
+  inet6_aftype.title = NLS_CATSAVE (catfd, inetSet, inet_darpa, "IPv6");
+#endif
+#if HAVE_AFAX25
+  ax25_aftype.title = NLS_CATSAVE (catfd, ax25Set, ax25_ax25, "AMPR AX.25");
+#endif
+#if HAVE_AFNETROM
+  netrom_aftype.title = NLS_CATSAVE (catfd, netromSet, netrom_netrom, "AMPR NET/ROM");
+#endif
+#if HAVE_AFIPX
+  ipx_aftype.title = NLS_CATSAVE (catfd, ipxSet, ipx_ipx, "IPX");
+#endif
+#if HAVE_AFATALK
+  ddp_aftype.title = NLS_CATSAVE (catfd, ddpSet, ddp_ddp, "Appletalk DDP");
+#endif
+  sVafinit = 1;
+}
+
+/* set the default AF list from the program name or a constant value   */
+void
+aftrans_def(char *tool, char *argv0, char *dflt)
+{
+  char *tmp;
+  char *buf;
+  
+  strcpy(afname, dflt);
+
+  if (!(tmp = strrchr(argv0, '/')))
+       tmp = argv0;                    /* no slash?! */
+  else
+       tmp++;
+  
+  if (!(buf = strdup(tmp)))
+       return;
+
+  if (strlen(tool) >= strlen(tmp)) {
+       free(buf);
+       return;
+  }
+  tmp = buf+(strlen(tmp)-strlen(tool));
+  
+  if (strcmp(tmp, tool)!=0) {
+       free(buf);
+       return;
+  }
+  
+  *tmp = '\0';
+  if ((tmp = strchr(buf,'_')))
+       *tmp = '\0';
+  
+  afname[0]='\0';
+  if (aftrans_opt(buf))
+       strcpy(afname, buf);
+
+  free(buf);
+}
+
+
+/* Check our protocol family table for this family. */
+struct aftype *
+get_aftype(const char *name)
+{
+  struct aftype **afp;
+
+  if (!sVafinit)
+    afinit ();
+  
+  afp = aftypes;
+  while (*afp != NULL) {
+       if (!strcmp((*afp)->name, name)) return(*afp);
+       afp++;
+  }
+  if (index(name,','))
+       fprintf(stderr,NLS_CATGETS(catfd, libSet, lib_toomuch, "Please don't supply more than one address family.\n"));
+  return(NULL);
+}
+
+
+/* Check our protocol family table for this family. */
+struct aftype *
+get_afntype(int af)
+{
+  struct aftype **afp;
+
+  if (!sVafinit)
+    afinit ();
+  
+  afp = aftypes;
+  while (*afp != NULL) {
+       if ((*afp)->af == af) return(*afp);
+       afp++;
+  }
+  return(NULL);
+}
+
+
+int aftrans_opt(const char *arg)
+{
+       struct aftrans_t *paft;
+       char *tmp1, *tmp2;
+       char buf[256];
+               
+       strncpy(buf,arg,sizeof(buf));
+       buf[sizeof(buf)-1]='\0';
+       
+       tmp1=buf;
+       
+       while(tmp1) {
+       
+               tmp2=index(tmp1,',');
+
+               if (tmp2)
+                       *(tmp2++)='\0';
+                       
+               paft=aftrans;
+               for(paft=aftrans;paft->alias;paft++) {
+                       if (strcmp(tmp1,paft->alias))
+                               continue;
+                       if (strlen(paft->name)+strlen(afname)+1 >= sizeof(afname)) {
+                               fprintf(stderr,NLS_CATGETS(catfd, libSet, lib_toomuch_af, "Too much address family arguments.\n"));                             
+                               return(0);
+                       }
+                       if (paft->flag)
+                               (*paft->flag)++;
+                       if (afname[0])
+                               strcat(afname,",");
+                       strcat(afname,paft->name);
+                       break;
+               }
+               if (!paft->alias) {
+                       fprintf(stderr,NLS_CATGETS(catfd, libSet, lib_unknown_af, "Unknown address family `%s'.\n"),tmp1);                      
+                       return(1);
+               }
+               tmp1=tmp2;
+       }
+
+       return(0);
+}
diff --git a/lib/arcnet.c b/lib/arcnet.c
new file mode 100644 (file)
index 0000000..d784535
--- /dev/null
@@ -0,0 +1,141 @@
+/*
+ * lib/arcnet.c        This file contains an implementation of the "ARCnet"
+ *             support functions for the NET-2 base distribution.
+ *
+ * Version:    @(#)arcnet.c    1.10    10/07/93
+ *
+ * Author:     Fred N. van Kempen, <waltje@uwalt.nl.mugnet.org>
+ *             Copyright 1993 MicroWalt Corporation
+ *
+ *             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.
+ */
+#include "config.h"
+
+#if HAVE_HWARC
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <net/if_arp.h>
+#include <linux/if_ether.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <errno.h>
+#include <ctype.h>
+#include <string.h>
+#include <unistd.h>
+#include "net-support.h"
+#include "pathnames.h"
+#define  EXTERN
+#include "net-locale.h"
+
+
+extern struct hwtype arcnet_hwtype;
+
+
+/* Display an ARCnet address in readable format. */
+static char *
+pr_arcnet(unsigned char *ptr)
+{
+  static char buff[64];
+
+  sprintf(buff, "%02X",(ptr[0] & 0377));
+  return(buff);
+}
+
+
+/* Display an ARCnet socket address. */
+static char *
+pr_sarcnet(struct sockaddr *sap)
+{
+  static char buf[64];
+
+  if (sap->sa_family == 0xFFFF || sap->sa_family == 0)
+    return(NLS_CATBUFF (catfd, arcnetSet, arcnet_none, "[NONE SET]", buf, 64));
+  return(pr_arcnet(sap->sa_data));
+}
+
+
+/* Input an ARCnet address and convert to binary. */
+static int
+in_arcnet(char *bufp, struct sockaddr *sap)
+{
+  unsigned char *ptr;
+  char c, *orig;
+  int i, val;
+
+  sap->sa_family = arcnet_hwtype.type;
+  ptr = sap->sa_data;
+
+  i = 0;
+  orig = bufp;
+  while((*bufp != '\0') && (i < 1)) {
+       val = 0;
+       c = *bufp++;
+       if (isdigit(c)) val = c - '0';
+         else if (c >= 'a' && c <= 'f') val = c - 'a' + 10;
+         else if (c >= 'A' && c <= 'F') val = c - 'A' + 10;
+         else {
+#ifdef DEBUG
+               fprintf(stderr, NLS_CATGETS(catfd, arcnetSet, arcnet_debug1,
+                                           "in_arcnet(%s): invalid arcnet address!\n"), orig);
+#endif
+               errno = EINVAL;
+               return(-1);
+       }
+       val <<= 4;
+       c = *bufp++;
+       if (isdigit(c)) val |= c - '0';
+         else if (c >= 'a' && c <= 'f') val |= c - 'a' + 10;
+         else if (c >= 'A' && c <= 'F') val |= c - 'A' + 10;
+         else {
+#ifdef DEBUG
+               fprintf(stderr, NLS_CATGETS(catfd, arcnetSet, arcnet_debug2,
+                                           "in_arcnet(%s): invalid arcnet address!\n"), orig);
+#endif
+               errno = EINVAL;
+               return(-1);
+       }
+       *ptr++ = (unsigned char) (val & 0377);
+       i++;
+
+       /* We might get a semicolon here - not required. */
+       if (*bufp == ':') {
+               if (i == ETH_ALEN) {
+#ifdef DEBUG
+                       fprintf(stderr, NLS_CATGETS(catfd, arcnetSet, arcnet_debug3,
+                                                   "in_arcnet(%s): trailing : ignored!\n"),
+                                                                       orig)
+#endif
+                                               ; /* nothing */
+               }
+               bufp++;
+       }
+  }
+
+  /* That's it.  Any trailing junk? */
+  if ((i == ETH_ALEN) && (*bufp != '\0')) {
+#ifdef DEBUG
+       fprintf(stderr, NLS_CATGETS(catfd, arcnetSet, arcnet_debug4, "in_arcnet(%s): trailing junk!\n"), orig);
+       errno = EINVAL;
+       return(-1);
+#endif
+  }
+
+#ifdef DEBUG
+  fprintf(stderr, "in_arcnet(%s): %s\n", orig, pr_arcnet(sap->sa_data));
+#endif
+
+  return(0);
+}
+
+
+struct hwtype arcnet_hwtype = {
+  "arcnet",    NULL, /*"2.5Mbps ARCnet",*/             ARPHRD_ARCNET,  1,
+  pr_arcnet,   pr_sarcnet,     in_arcnet,      NULL
+};
+
+
+#endif /* HAVE_HWARC */
diff --git a/lib/ax25.c b/lib/ax25.c
new file mode 100644 (file)
index 0000000..83ffac9
--- /dev/null
@@ -0,0 +1,202 @@
+/*
+ * lib/ax25.c  This file contains an implementation of the "AX.25"
+ *             support functions for the NET-2 base distribution.
+ *
+ * Version:    @(#)ax25.c      1.20    12/16/93
+ *
+ * NOTE:       I will redo this module as soon as I got the libax25.a
+ *             library sorted out.  This library contains some useful
+ *             and often used address conversion functions, database
+ *             lookup stuff, and more of the like.
+ *
+ * Author:     Fred N. van Kempen, <waltje@uwalt.nl.mugnet.org>
+ *             Copyright 1993 MicroWalt Corporation
+ *
+ *             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.
+ */
+#include "config.h"
+
+#if HAVE_AFAX25 || HAVE_HWAX25
+#include <sys/types.h>
+#include <sys/ioctl.h>
+#include <sys/socket.h>
+#include <linux/ax25.h>
+#include <net/if_arp.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <ctype.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <string.h>
+#include <termios.h>
+#include <unistd.h>
+#include "net-support.h"
+#include "pathnames.h"
+#define  EXTERN
+#include "net-locale.h"
+
+static char AX25_errmsg[128];
+
+
+extern struct aftype ax25_aftype;
+
+
+static char *
+AX25_print(unsigned char *ptr)
+{
+  static char buff[8];
+  int i;
+
+  for (i = 0; i < 6; i++) {
+       buff[i] = ((ptr[i] & 0377) >> 1);
+       if (buff[i] == ' ') buff[i] = '\0';
+  }
+  buff[6] = '\0';
+  i = ((ptr[6] & 0x1E) >> 1);
+  if (i != 0) sprintf(&buff[strlen(buff)], "-%d", i);
+  return(buff);
+}
+
+
+/* Display an AX.25 socket address. */
+static char *
+AX25_sprint(struct sockaddr *sap, int numeric)
+{
+  static char buf[64];
+
+  if (sap->sa_family == 0xFFFF || sap->sa_family == 0)
+    return(NLS_CATBUFF (catfd, ax25Set, ax25_none, "[NONE SET]", buf, 64));
+  return(AX25_print(((struct sockaddr_ax25 *)sap)->sax25_call.ax25_call));
+}
+
+
+static int
+AX25_input(int type, char *bufp, struct sockaddr *sap)
+{
+  unsigned char *ptr;
+  char *orig, c;
+  int i;
+
+  sap->sa_family = ax25_aftype.af;
+  ptr = ((struct sockaddr_ax25 *)sap)->sax25_call.ax25_call;
+
+  /* First, scan and convert the basic callsign. */
+  orig = bufp;
+  i = 0;
+  while((*bufp != '\0') && (*bufp != '-') && (i < 6)) {
+       c = *bufp++;
+       if (islower(c)) c = toupper(c);
+       if (! (isupper(c) || isdigit(c))) {
+               strcpy(AX25_errmsg, NLS_CATGETS (catfd, ax25Set, ax25_debug1, "Invalid callsign"));
+#ifdef DEBUG
+               fprintf(stderr, "ax25_input(%s): %s !\n", AX25_errmsg, orig);
+#endif
+               errno = EINVAL;
+               return(-1);
+       }
+       *ptr++ = (unsigned char) ((c << 1) & 0xFE);
+       i++;
+  }
+
+  /* Callsign too long? */
+  if ((i == 6) && (*bufp != '-') && (*bufp != '\0')) {
+       strcpy(AX25_errmsg, NLS_CATGETS (catfd, ax25Set, ax25_debug2, "Callsign too long"));
+#ifdef DEBUG
+       fprintf(stderr, "ax25_input(%s): %s !\n", AX25_errmsg, orig);
+#endif
+       errno = E2BIG;
+       return(-1);
+  }
+
+  /* Nope, fill out the address bytes with blanks. */
+  while (i++ < sizeof(ax25_address)-1) {
+       *ptr++ = (unsigned char) ((' ' << 1) & 0xFE);
+  }
+
+  /* See if we need to add an SSID field. */
+  if (*bufp == '-') {
+       i = atoi(++bufp);
+       *ptr = (unsigned char) ((i << 1) & 0xFE);
+  } else {
+       *ptr = (unsigned char) '\0';
+  }
+
+  /* All done. */
+#ifdef DEBUG
+  fprintf(stderr, "ax25_input(%s): ", orig);
+  for (i = 0; i < sizeof(ax25_address); i++)
+       fprintf(stderr, "%02X ", sap->sa_data[i] & 0377);
+  fprintf(stderr, "\n");
+#endif
+
+  return(0);
+}
+
+
+/* Display an error message. */
+static void
+AX25_herror(char *text)
+{
+  if (text == NULL) fprintf(stderr, "%s\n", AX25_errmsg);
+    else fprintf(stderr, "%s: %s\n", text, AX25_errmsg);
+}
+
+
+static char *
+AX25_hprint(struct sockaddr *sap)
+{
+  static char buf[64];
+
+  if (sap->sa_family == 0xFFFF || sap->sa_family == 0)
+    return(NLS_CATBUFF (catfd, ax25Set, ax25_none, "[NONE SET]", buf, 64));
+  return(AX25_print(((struct sockaddr_ax25 *)sap)->sax25_call.ax25_call));
+}
+
+
+static int
+AX25_hinput(char *bufp, struct sockaddr *sap)
+{
+  if (AX25_input(0, bufp, sap) < 0) return(-1);
+  sap->sa_family = ARPHRD_AX25;
+  return(0);
+}
+
+#if 0
+/* Set the line discipline of a terminal line. */
+static int
+KISS_set_disc(int fd, int disc)
+{
+  if (ioctl(fd, TIOCSETD, &disc) < 0) {
+       fprintf(stderr, "KISS_set_disc(%d): %s\n", disc, strerror(errno));
+       return(-errno);
+  }
+  return(0);
+}
+
+
+/* Start the KISS encapsulation on the file descriptor. */
+static int
+KISS_init(int fd)
+{
+  if (KISS_set_disc(fd, N_SLIP) < 0) return(-1);
+  if (ioctl(fd, SIOCSIFENCAP, 4) <0) return(-1);
+  return(0);
+}
+#endif
+
+struct hwtype ax25_hwtype = {
+  "ax25",      NULL, /*"AMPR AX.25",*/         ARPHRD_AX25,    7,
+  AX25_print,  AX25_hprint,            AX25_hinput,    NULL
+};
+
+struct aftype ax25_aftype = {
+  "ax25",      NULL, /*"AMPR AX.25",*/         AF_AX25,        7,
+  AX25_print,  AX25_sprint,            AX25_input,     AX25_herror,    
+  NULL
+};
+
+#endif /* HAVE_xxAX25 */
diff --git a/lib/ax25_gr.c b/lib/ax25_gr.c
new file mode 100644 (file)
index 0000000..016ebce
--- /dev/null
@@ -0,0 +1,66 @@
+/*
+ * lib/ax25_gr.c       This file contains an implementation of the "AX.25"
+ *                     route print support functions.
+ *
+ * Version:    lib/ax25_gr.c 1.01 (1996-02-15)
+ *
+ * Author:     Bernd Eckenfels, <ecki@lina.inka.de>
+ *             Copyright 1999 Bernd Eckenfels, Germany
+ *             base on Code from Jonathan Naylor <jsn@Cs.Nott.AC.UK>
+ *
+ *             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.
+ */
+#include "config.h"
+
+#if HAVE_AFAX25
+#if 0
+#include <sys/types.h>
+#include <sys/ioctl.h>
+#include <sys/socket.h>
+#include <linux/ax25.h>
+#include <linux/if_arp.h>      /* ARPHRD_AX25 */
+#include <ctype.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <string.h>
+#include <termios.h>
+#endif
+#include <stdlib.h>
+#include <stdio.h>
+#include <unistd.h>
+#include "net-support.h"
+#include "pathnames.h"
+#define  EXTERN
+#include "net-locale.h"
+
+int AX25_rprint(int options)
+{
+       FILE *f=fopen(_PATH_PROCNET_AX25_ROUTE, "r");
+       char buffer[256];
+       int  use;
+
+       if(f==NULL)
+       {
+               printf(NLS_CATGETS(catfd, netstatSet, netstat_noax25, "AX.25 not configured in this system.\n")); /* xxx */
+               return 1;
+       }
+       printf(NLS_CATGETS(catfd, netstatSet, netstat_ax25, "Kernel AX.25 routing table\n")); /* xxx */
+       printf(NLS_CATGETS(catfd, netstatSet, netstat_header_ax25, "Destination  Iface    Use\n")); /* xxx */
+       fgets(buffer,256,f);
+       while(fgets(buffer,256,f))
+       {
+               buffer[9]=0;
+               buffer[14]=0;
+               use=atoi(buffer+15);
+               printf("%-9s    %-5s  %5d\n",
+                       buffer,buffer+10,use);
+       }
+       fclose(f);
+       return 0;
+}
+
+#endif /* HAVE_AFAX25 */
diff --git a/lib/ddp.c b/lib/ddp.c
new file mode 100644 (file)
index 0000000..2745813
--- /dev/null
+++ b/lib/ddp.c
@@ -0,0 +1,62 @@
+/*
+ *             DDP protocol output functions.
+ *             [Not yet input]
+ *
+ *                     Alan Cox  <Alan.Cox@linux.org>
+ *
+ *             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.
+ */
+#include "config.h"
+
+#if HAVE_AFATALK
+#include <asm/types.h>
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <linux/atalk.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <errno.h>
+#include <ctype.h>
+#include <string.h>
+#include <unistd.h>
+#include <netinet/in.h>
+#include "net-support.h"
+#include "pathnames.h"
+#define  EXTERN
+#include "net-locale.h"
+
+
+/* Display a ddp domain address. */
+static char *
+ddp_print(unsigned char *ptr)
+{
+  static char buff[64];
+  struct sockaddr_at *sat=(struct sockaddr_at *)(ptr-2);
+  sprintf(buff,"%d/%d",(int) ntohs(sat->sat_addr.s_net), (int)sat->sat_addr.s_node);
+  return(buff);
+}
+
+
+/* Display a ddp domain address. */
+static char *
+ddp_sprint(struct sockaddr *sap, int numeric)
+{
+  static char buf[64];
+
+  if (sap->sa_family != AF_APPLETALK)
+    return(NLS_CATBUFF (catfd, ddpSet, ddp_none, "[NONE SET]", buf, 64));
+  return(ddp_print(sap->sa_data));
+}
+
+
+struct aftype ddp_aftype = {
+  "ddp",       NULL, /*"Appletalk DDP",*/      AF_APPLETALK,   0,
+  ddp_print,   ddp_sprint,             NULL,           NULL,
+  NULL/*DDP_rprint*/
+};
+
+#endif
diff --git a/lib/ddp_gr.c b/lib/ddp_gr.c
new file mode 100644 (file)
index 0000000..c708e10
--- /dev/null
@@ -0,0 +1,26 @@
+#include "config.h"
+
+#if HAVE_AFATALK
+#include <asm/types.h>
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <linux/atalk.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <errno.h>
+#include <ctype.h>
+#include <string.h>
+#include <unistd.h>
+#include <netinet/in.h>
+#include "net-support.h"
+#include "pathnames.h"
+#define  EXTERN
+#include "net-locale.h"
+
+int DDP_rprint(int options)
+{
+       fprintf(stderr,NLS_CATGETS(catfd, ddpSet, ddp_notyet,
+               "Routing table for `ddp' not yet supported.\n"));
+       return(1);
+}
+#endif
diff --git a/lib/ether.c b/lib/ether.c
new file mode 100644 (file)
index 0000000..2ad0eb7
--- /dev/null
@@ -0,0 +1,144 @@
+/*
+ * lib/ether.c This file contains an implementation of the "Ethernet"
+ *             support functions for the NET-2 base distribution.
+ *
+ * Version:    @(#)ether.c     1.10    10/07/93
+ *
+ * Author:     Fred N. van Kempen, <waltje@uwalt.nl.mugnet.org>
+ *             Copyright 1993 MicroWalt Corporation
+ *
+ *             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.
+ */
+#include "config.h"
+
+#if HAVE_HWETHER
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <net/if_arp.h>
+#include <linux/if_ether.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <errno.h>
+#include <ctype.h>
+#include <string.h>
+#include <unistd.h>
+#include "net-support.h"
+#include "pathnames.h"
+#define  EXTERN
+#include "net-locale.h"
+
+
+extern struct hwtype ether_hwtype;
+
+
+/* Display an Ethernet address in readable format. */
+static char *
+pr_ether(unsigned char *ptr)
+{
+  static char buff[64];
+
+  sprintf(buff, "%02X:%02X:%02X:%02X:%02X:%02X",
+       (ptr[0] & 0377), (ptr[1] & 0377), (ptr[2] & 0377),
+       (ptr[3] & 0377), (ptr[4] & 0377), (ptr[5] & 0377)
+  );
+  return(buff);
+}
+
+
+/* Display an Ethernet socket address. */
+static char *
+pr_sether(struct sockaddr *sap)
+{
+  static char buf[64];
+
+  if (sap->sa_family == 0xFFFF || sap->sa_family == 0)
+    return(NLS_CATBUFF (catfd, etherSet, ether_none, "[NONE SET]", buf, 64));
+  return(pr_ether(sap->sa_data));
+}
+
+
+/* Input an Ethernet address and convert to binary. */
+static int
+in_ether(char *bufp, struct sockaddr *sap)
+{
+  unsigned char *ptr;
+  char c, *orig;
+  int i, val;
+
+  sap->sa_family = ether_hwtype.type;
+  ptr = sap->sa_data;
+
+  i = 0;
+  orig = bufp;
+  while((*bufp != '\0') && (i < ETH_ALEN)) {
+       val = 0;
+       c = *bufp++;
+       if (isdigit(c)) val = c - '0';
+         else if (c >= 'a' && c <= 'f') val = c - 'a' + 10;
+         else if (c >= 'A' && c <= 'F') val = c - 'A' + 10;
+         else {
+#ifdef DEBUG
+               fprintf(stderr, NLS_CATGETS(catfd, etherSet, ether_debug1,
+                                           "in_ether(%s): invalid ether address!\n"), orig);
+#endif
+               errno = EINVAL;
+               return(-1);
+       }
+       val <<= 4;
+       c = *bufp++;
+       if (isdigit(c)) val |= c - '0';
+         else if (c >= 'a' && c <= 'f') val |= c - 'a' + 10;
+         else if (c >= 'A' && c <= 'F') val |= c - 'A' + 10;
+         else {
+#ifdef DEBUG
+               fprintf(stderr, NLS_CATGETS(catfd, etherSet, ether_debug2,
+                                           "in_ether(%s): invalid ether address!\n"), orig);
+#endif
+               errno = EINVAL;
+               return(-1);
+       }
+       *ptr++ = (unsigned char) (val & 0377);
+       i++;
+
+       /* We might get a semicolon here - not required. */
+       if (*bufp == ':') {
+               if (i == ETH_ALEN) {
+#ifdef DEBUG
+                       fprintf(stderr, NLS_CATGETS(catfd, etherSet, ether_debug3,
+                                                   "in_ether(%s): trailing : ignored!\n"),
+                                                                       orig)
+#endif
+                                               ; /* nothing */
+               }
+               bufp++;
+       }
+  }
+
+  /* That's it.  Any trailing junk? */
+  if ((i == ETH_ALEN) && (*bufp != '\0')) {
+#ifdef DEBUG
+       fprintf(stderr, NLS_CATGETS(catfd, etherSet, ether_debug4, "in_ether(%s): trailing junk!\n"), orig);
+       errno = EINVAL;
+       return(-1);
+#endif
+  }
+
+#ifdef DEBUG
+  fprintf(stderr, "in_ether(%s): %s\n", orig, pr_ether(sap->sa_data));
+#endif
+
+  return(0);
+}
+
+
+struct hwtype ether_hwtype = {
+  "ether",     NULL, /*"10Mbps Ethernet",*/            ARPHRD_ETHER,   ETH_ALEN,
+  pr_ether,    pr_sether,      in_ether,       NULL
+};
+
+
+#endif /* HAVE_HWETHER */
diff --git a/lib/frame.c b/lib/frame.c
new file mode 100644 (file)
index 0000000..2920662
--- /dev/null
@@ -0,0 +1,59 @@
+/*
+ * lib/frame.c This file contains the Frame Relay support.
+ *
+ * Version:    lib/frame.c 0.01 (1996-03-23)
+ *
+ * Maintainer: Bernd 'eckes' Eckenfels, <net-tools@lina.inka.de>
+ *
+ * Author:     Mike McLagan <mike.mclagan@linux.org>
+ *
+ * Changes:
+ *
+ *962303 {0.01}        Mike McLagan :          creation
+ *960413 {0.02} Bernd Eckenfels :      included in net-lib
+ *
+ *             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.
+ */
+#include "config.h"
+
+#if HAVE_HWFR
+
+#include <sys/types.h>
+#include <sys/ioctl.h>
+#include <sys/socket.h>
+#include <net/if_arp.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <ctype.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <string.h>
+#include <termios.h>
+#include <unistd.h>
+#include "net-support.h"
+#include "pathnames.h"
+#define  EXTERN
+#include "net-locale.h"
+
+char *pr_dlci(unsigned char *ptr)
+{
+   static char buf[12];
+
+   sprintf(buf, "%i", *(short *)ptr);
+   return(buf);
+}
+
+struct hwtype dlci_hwtype = {
+  "dlci",      NULL, /*"Frame Relay DLCI",*/           ARPHRD_DLCI,    3,
+  pr_dlci,     NULL,           NULL,           NULL
+};
+
+struct hwtype frad_hwtype = {
+  "frad",      NULL, /*"Frame Relay Access Device",*/          ARPHRD_FRAD,    0,
+  NULL,                NULL,           NULL,           NULL
+};
+#endif /* HAVE_HWFR */
diff --git a/lib/getargs.c b/lib/getargs.c
new file mode 100644 (file)
index 0000000..8741b2c
--- /dev/null
@@ -0,0 +1,87 @@
+/*
+ * lib/getargs.c       General argument parser.
+ *
+ * Version:    @(#)getargs.c   4.0.1   04/05/94
+ *
+ * Author:      Fred N. van Kempen, <waltje@uwalt.nl.mugnet.org>
+ *             Copyright 1993,1994 MicroWalt Corporation
+ *
+ *             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.
+ */
+#include "config.h"
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <net/if.h>
+#include <errno.h>
+#include <signal.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include "net-support.h"
+#include "pathnames.h"
+
+
+/* Split the input string into multiple fields. */
+int
+getargs(char *string, char *arguments[])
+{
+  char temp[1024];
+  char *sp, *ptr;
+  int i, argc;
+  char want;
+
+  /*
+   * Copy the string into a buffer.  We may have to modify
+   * the original string because of all the quoting...
+   */
+  sp = string; i = 0;
+  strcpy(temp, string);    
+  ptr = temp;
+  /*
+   * Look for delimiters ("); if present whatever
+   * they enclose will be considered one argument.
+   */
+  while (*ptr != '\0' && i < 32) {
+       /* Ignore leading whitespace on input string. */
+       while (*ptr == ' ' || *ptr == '\t') ptr++;
+
+       /* Set string pointer. */
+       arguments[i++] = sp;
+
+       /* Check for any delimiters. */
+       if (*ptr == '"' || *ptr == '\'') {
+               /*
+                * Copy the string up to any whitespace OR the next
+                * delimiter. If the delimiter was escaped, skip it
+                * as it if was not there.
+                */
+               want = *ptr++;
+               while(*ptr != '\0') {
+                       if (*ptr == want && *(ptr - 1) != '\\') {
+                               ptr++;
+                               break;
+                       }
+                       *sp++ = *ptr++;
+               }
+       } else {
+               /* Just copy the string up to any whitespace. */
+               while(*ptr != '\0' && *ptr != ' ' && *ptr != '\t')
+                                                       *sp++ = *ptr++;
+       }
+       *sp++ = '\0';
+
+       /* Skip trailing whitespace. */
+       if (*ptr != '\0') {
+               while(*ptr == ' ' || *ptr == '\t') ptr++;
+       }
+  }  
+  argc = i;
+  while (i < 32)  arguments[i++] = (char *)NULL;
+  return(argc);
+}
diff --git a/lib/getroute.c b/lib/getroute.c
new file mode 100644 (file)
index 0000000..ba64a4c
--- /dev/null
@@ -0,0 +1,116 @@
+/*
+ * lib/getroute.c      This file contains a small interface function to
+ *                     use the AF specific print routine for the routing
+ *                     table.
+ *
+ * NET-LIB     A collection of functions used from the base set of the
+ *             NET-3 Networking Distribution for the LINUX operating
+ *             system. (net-tools, net-drivers)
+ *
+ * Version:    lib/getroute.c 1.03 (1996-04-13)
+ *
+ * Author:     Bernd 'eckes' Eckenfels <net-tools@lina.inka.de>
+ *             Copyright 1999 Bernd Eckenfels, Germany
+ *
+ * Modifications:
+ *
+ *951020 {0.10} Bernd Eckenfels:       creation
+ *960202 {0.90}        Bernd Eckenfels:        rewrite to use getaftype.
+ *960204 {0.91} Bernd Eckenfels:       takes constant list of AFs
+ *960206 {1.01} Bernd Eckenfels:       route_init will enable routing
+ *                                     support in the AF handlers
+ *960221 {1.02} Bernd Eckenfels:       renamed from route_info to getroute.c
+ *960413 {1.03} Bernd Eckenfels:       new RTACTION support
+ *
+ *             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.
+ */
+#include <stdio.h>
+#include <string.h>
+#include "net-support.h"
+#include "pathnames.h"
+#include "version.h"
+#include "config.h"
+#include "net-locale.h"
+
+extern struct aftype   unspec_aftype;
+extern struct aftype   unix_aftype;
+extern struct aftype   inet_aftype;
+extern struct aftype   inet6_aftype;
+extern struct aftype   ax25_aftype;
+extern struct aftype   netrom_aftype;
+extern struct aftype   ipx_aftype;
+extern struct aftype   ddp_aftype;
+
+void
+getroute_init(void)
+{
+#if HAVE_AFINET
+       inet_aftype.rprint = INET_rprint;
+#endif
+#if HAVE_AFINET6
+       inet6_aftype.rprint = INET6_rprint;
+#endif
+#if HAVE_AFNETROM
+       netrom_aftype.rprint = NETROM_rprint;
+#endif
+#if HAVE_AFAX25
+       ax25_aftype.rprint = AX25_rprint;
+#endif
+#if HAVE_AFIPX
+       ipx_aftype.rprint = IPX_rprint;
+#endif
+#if HAVE_AFATALK
+       ddp_aftype.rprint = DDP_rprint;
+#endif
+}
+
+int
+route_info(const char *afname, int options)
+{
+  struct aftype *ap;
+  char *tmp1,*tmp2;
+  int found=E_NOTFOUND,rc;
+  char buf[256];
+  
+  strncpy(buf,afname,sizeof(buf));
+  buf[sizeof(buf)-1]='\0';
+   
+  tmp1=buf;
+  
+  while(tmp1) {
+       
+       ap=NULL;
+       
+       if ((tmp2=index(tmp1,',')))
+               *tmp2++='\0';
+  
+       if (!tmp1[0]) {
+               tmp1=tmp2;
+               continue;
+       }
+       
+       ap = get_aftype(tmp1);
+  
+       if (!ap) {
+               fprintf(stderr,NLS_CATGETS(catfd, netstatSet, netstat_route_no_support, "Address family `%s' not supported.\n"),tmp1);
+               return(E_OPTERR);
+       }
+       tmp1=tmp2;
+  
+       if (!ap->rprint) {
+               fprintf(stderr,NLS_CATGETS(catfd, netstatSet, netstat_type_no_route, "No routing for address family `%s'.\n"),ap->name);
+               return(E_OPTERR);
+       }
+       
+       found = 0;
+       
+       if ((rc = ap->rprint(options)))
+               return(rc);
+       
+  }
+  return(found);
+}
diff --git a/lib/hw.c b/lib/hw.c
new file mode 100644 (file)
index 0000000..34ab207
--- /dev/null
+++ b/lib/hw.c
@@ -0,0 +1,178 @@
+/*
+ * lib/hw.c    This file contains the top-level part of the hardware
+ *             support functions module for the NET-2 base distribution.
+ *
+ * Version:    lib/hw.c 1.13 (1996-04-13)
+ *
+ * Maintainer: Bernd 'eckes' Eckenfels, <net-tools@lina.inka.de>
+ *
+ * Author:     Fred N. van Kempen, <waltje@uwalt.nl.mugnet.org>
+ *             Copyright 1993 MicroWalt Corporation
+ *
+ * Changes:
+ *960413 {1.13}        Mike Mclagan    :       DLCI/FRAD support
+ *
+ *             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.
+ */
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <errno.h>
+#include <ctype.h>
+#include <string.h>
+#include <unistd.h>
+#include "config.h"
+#include "net-support.h"
+#include "pathnames.h"
+#define  EXTERN
+#include "net-locale.h"
+
+
+extern struct hwtype   unspec_hwtype;
+extern struct hwtype   loop_hwtype;
+
+extern struct hwtype   slip_hwtype;
+extern struct hwtype   cslip_hwtype;
+extern struct hwtype   slip6_hwtype;
+extern struct hwtype   cslip6_hwtype;
+extern struct hwtype   adaptive_hwtype;
+
+extern struct hwtype   ether_hwtype;
+extern struct hwtype   tr_hwtype;
+
+extern struct hwtype   ax25_hwtype;
+extern  struct hwtype   netrom_hwtype;
+extern  struct hwtype   tunnel_hwtype;
+
+extern struct hwtype   ppp_hwtype;
+
+extern struct hwtype   arcnet_hwtype;
+
+extern struct hwtype   dlci_hwtype;
+extern struct hwtype   frad_hwtype;
+
+extern struct hwtype   sit_hwtype;
+
+static struct hwtype *hwtypes[] = {
+
+  &loop_hwtype,
+
+#if HAVE_HWSLIP
+  &slip_hwtype,
+  &cslip_hwtype,
+  &slip6_hwtype,
+  &cslip6_hwtype,
+  &adaptive_hwtype,
+#endif
+#if HAVE_HWETHER
+  &ether_hwtype,
+#endif
+#if HAVE_HWTR
+  &tr_hwtype,
+#endif
+#if HAVE_HWAX25
+  &ax25_hwtype,
+#endif
+#if HAVE_HWNETROM
+  &netrom_hwtype,
+#endif
+#if HAVE_HWTUNNEL
+  &tunnel_hwtype,
+#endif
+#if HAVE_HWPPP
+  &ppp_hwtype,
+#endif  
+#if HAVE_HWARC
+  &arcnet_hwtype,
+#endif  
+#if HAVE_HWFR
+  &dlci_hwtype,
+  &frad_hwtype,
+#endif
+#if HAVE_HWSIT
+  &sit_hwtype,
+#endif
+  &unspec_hwtype,
+  NULL
+};
+
+static short sVhwinit = 0;
+
+void hwinit ()
+{
+  loop_hwtype.title = NLS_CATSAVE (catfd, loopbackSet, loopback_loop, "Local Loopback");
+#if HAVE_HWSLIP
+  slip_hwtype.title = NLS_CATSAVE (catfd, slipSet, slip_slip, "Serial Line IP");
+  cslip_hwtype.title = NLS_CATSAVE (catfd, slipSet, slip_cslip, "VJ Serial Line IP");
+  slip6_hwtype.title = NLS_CATSAVE (catfd, slipSet, slip_slip6, "6-bit Serial Line IP");
+  cslip6_hwtype.title = NLS_CATSAVE (catfd, slipSet, slip_cslip6, "VJ 6-bit Serial Line IP");
+  adaptive_hwtype.title = NLS_CATSAVE (catfd, slipSet, slip_adaptive, "Adaptive Serial Line IP");
+#endif
+  unspec_hwtype.title = NLS_CATSAVE (catfd, loopbackSet, loopback_unspec, "UNSPEC");
+#if HAVE_HWETHER
+  ether_hwtype.title = NLS_CATSAVE (catfd, etherSet, ether_ether, "Ethernet");
+#endif
+#if HAVE_HWAX25
+  ax25_hwtype.title = NLS_CATSAVE (catfd, ax25Set, ax25_hw, "AMPR AX.25");
+#endif
+#if HAVE_HWNETROM
+  netrom_hwtype.title = NLS_CATSAVE (catfd, netromSet, netrom_hw, "AMPR NET/ROM");
+#endif
+#if HAVE_HWTUNNEL
+  tunnel_hwtype.title = NLS_CATSAVE (catfd, tunnelSet, tunnel_hw, "IPIP Tunnel");
+#endif
+#if HAVE_HWPPP
+  ppp_hwtype.title = NLS_CATSAVE (catfd, pppSet, ppp_ppp, "Point-to-Point Protocol");
+#endif  
+#if HAVE_HWARC
+  arcnet_hwtype.title = NLS_CATSAVE (catfd, arcnetSet, arcnet_arcnet, "1.5Mbps ARCnet");
+#endif
+#if HAVE_HWFR
+   dlci_hwtype.title = NLS_CATSAVE(catfd, dlciSet, dlci_hw, "Frame Relay DLCI");
+   frad_hwtype.title = NLS_CATSAVE(catfd, fradSet, frad_hw, "Frame Relay Access Device");
+#endif
+#if HAVE_HWSIT
+   sit_hwtype.title = NLS_CATSAVE(catfd, sitSet, sit_hw, "IPv6-in-IPv4");
+#endif
+    sVhwinit = 1;
+}
+
+/* Check our hardware type table for this type. */
+struct hwtype *
+get_hwtype(const char *name)
+{
+  struct hwtype **hwp;
+
+  if (!sVhwinit)
+    hwinit();
+  
+  hwp = hwtypes;
+  while (*hwp != NULL) {
+       if (!strcmp((*hwp)->name, name)) return(*hwp);
+       hwp++;
+  }
+  return(NULL);
+}
+
+
+/* Check our hardware type table for this type. */
+struct hwtype *
+get_hwntype(int type)
+{
+  struct hwtype **hwp;
+
+  if (!sVhwinit)
+    hwinit();
+
+  hwp = hwtypes;
+  while (*hwp != NULL) {
+       if ((*hwp)->type == type) return(*hwp);
+       hwp++;
+  }
+  return(NULL);
+}
diff --git a/lib/inet.c b/lib/inet.c
new file mode 100644 (file)
index 0000000..f1e07c0
--- /dev/null
@@ -0,0 +1,359 @@
+/*
+ * lib/inet.c  This file contains an implementation of the "INET"
+ *             support functions for the net-tools.
+ *             (NET-3 base distribution).
+ *
+ * Version:    lib/inet.c 1.26 1996-03-29
+ *
+ * Author:     Fred N. van Kempen, <waltje@uwalt.nl.mugnet.org>
+ *             Copyright 1993 MicroWalt Corporation
+ *
+ * Modified:
+ *960113 {1.21}        Bernd Eckenfels :       rresolve cache bug.
+ *960128 {1.22}        Bernd Eckenfels :       endian bug in print
+ *960203 {1.23} Bernd Eckenfels :       net-features support
+ *960217 {1.24} Bernd Eckenfels :      get_sname
+ *960219 {1.25} Bernd Eckenfels :      extern int h_errno
+ *960329 {1.26} Bernd Eckenfels :      resolve 255.255.255.255 
+ *
+ *             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.
+ */
+#include "config.h"
+
+#if HAVE_AFINET
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+#include <arpa/nameser.h>
+#include <ctype.h>
+#include <errno.h>
+#include <netdb.h>
+#include <resolv.h>
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#include <unistd.h>
+#include "version.h"
+#include "net-support.h"
+#include "pathnames.h"
+#define  EXTERN
+#include "net-locale.h"
+
+extern int h_errno;  /* some netdb.h versions don't export this */
+
+struct addr {
+  struct sockaddr_in   addr;
+  char                 *name;
+  struct addr          *next;
+};
+
+struct service {
+  int number;
+  char *name;
+  struct service *next;
+};
+
+static struct service *tcp_name = NULL,
+                     *udp_name = NULL,
+                     *raw_name = NULL;
+
+
+static struct addr *INET_nn = NULL;    /* addr-to-name cache           */
+
+
+static int
+INET_resolve(char *name, struct sockaddr_in *sin)
+{
+  struct hostent *hp;
+  struct netent *np;
+
+  /* Grmpf. -FvK */
+  sin->sin_family = AF_INET;
+  sin->sin_port = 0;
+
+  /* Default is special, meaning 0.0.0.0. */
+  if (!strcmp(name, "default")) {
+       sin->sin_addr.s_addr = INADDR_ANY;
+       return(1);
+  }
+
+  /* Look to see if it's a dotted quad. */
+  if (inet_aton(name, &sin->sin_addr)) {
+    return 0;
+  }
+
+  /* Try the NETWORKS database to see if this is a known network. */
+  if ((np = getnetbyname(name)) != (struct netent *)NULL) {
+    sin->sin_addr.s_addr = htonl(np->n_net);
+    strcpy(name, np->n_name);
+    return 1;
+  }
+
+#ifdef DEBUG
+  res_init();
+  _res.options |= RES_DEBUG;
+#endif
+
+  if ((hp = gethostbyname(name)) == (struct hostent *)NULL) {
+    errno = h_errno;
+    return -1;
+  }
+  memcpy((char *) &sin->sin_addr, (char *) hp->h_addr_list[0], hp->h_length);
+  strcpy(name, hp->h_name);
+  return 0;
+}
+
+
+static int
+INET_rresolve(char *name, struct sockaddr_in *sin, int numeric)
+{
+  struct hostent *ent;
+  struct netent *np;
+  struct addr *pn;
+  unsigned long ad, host_ad;
+
+  /* Grmpf. -FvK */
+  if (sin->sin_family != AF_INET) {
+#ifdef DEBUG
+       fprintf(stderr, NLS_CATGETS(catfd, inetSet, inet_debug1, "rresolve: unsupport address family %d !\n"), sin->sin_family);
+#endif
+       errno = EAFNOSUPPORT;
+       return(-1);
+  }
+
+  ad = (unsigned long) sin->sin_addr.s_addr;
+  if (ad == INADDR_ANY) {
+       if ((numeric & 0x7FFF) == 0) {
+               if (numeric & 0x8000) strcpy(name, "default");
+                 else strcpy(name, "*");
+               return(0);
+       }
+  }
+  if (numeric & 0x7FFF) {
+       strcpy(name,inet_ntoa (sin->sin_addr));
+       return(0);
+  }
+
+#if 0
+  INET_nn = NULL;
+#endif
+  pn = INET_nn;
+  while (pn != NULL) {
+       if (pn->addr.sin_addr.s_addr == ad) {
+               strcpy(name, pn->name);
+               return(0);
+       }
+       pn = pn->next;
+  }
+
+  host_ad = ntohl(ad);
+  np = NULL;
+  ent = NULL;
+  if ((host_ad & 0xFF) != 0)  {
+       ent = gethostbyaddr((char *) &ad, 4, AF_INET);
+       if (ent != NULL)
+               strcpy(name, ent->h_name);
+  } else {
+       np = getnetbyaddr(host_ad, AF_INET);
+       if (np != NULL) {
+               strcpy(name, np->n_name);
+       }
+  }
+  if ((ent == NULL) && (np == NULL)) {
+       strcpy(name,inet_ntoa (sin->sin_addr));
+  }
+  pn = (struct addr *)malloc(sizeof(struct addr));
+  pn->addr = *sin;
+  pn->next = INET_nn;
+  pn->name = (char *) malloc(strlen(name) + 1);
+  strcpy(pn->name, name);
+  INET_nn = pn;
+
+  return(0);
+}
+
+
+static void
+INET_reserror(char *text)
+{
+  herror(text);
+}
+
+
+/* Display an Internet socket address. */
+static char *
+INET_print(unsigned char *ptr)
+{
+  return(inet_ntoa((*(struct in_addr *) ptr)));
+}
+
+
+/* Display an Internet socket address. */
+static char *
+INET_sprint(struct sockaddr *sap, int numeric)
+{
+  static char buff[128];
+
+  if (sap->sa_family == 0xFFFF || sap->sa_family == 0)
+    return(NLS_CATBUFF (catfd, inetSet, inet_none, "[NONE SET]", buff, 128));
+  if (INET_rresolve(buff, (struct sockaddr_in *) sap, numeric) != 0)
+                                                       return(NULL);
+  return(buff);
+}
+
+
+static int
+INET_getsock(char *bufp, struct sockaddr *sap)
+{
+  char *sp = bufp,*bp;
+  unsigned int i;
+  unsigned val;
+  struct sockaddr_in *sin;
+  
+  sin             = (struct sockaddr_in *) sap;
+  sin->sin_family = AF_INET;
+  sin->sin_port   = 0;
+
+  val = 0;
+  bp=(char *)&val;
+  for (i = 0; i < sizeof(sin->sin_addr.s_addr); i++) {
+       *sp = toupper(*sp);
+       
+       if ((*sp >= 'A') && (*sp <= 'F')) 
+               bp[i] |= (int) (*sp - 'A') + 10;
+       else if ((*sp >= '0') && (*sp <= '9'))
+               bp[i] |= (int) (*sp - '0');
+       else
+               return(-1);
+
+       bp[i] <<= 4;
+       sp++;
+       *sp = toupper(*sp);
+       
+       if ((*sp >= 'A') && (*sp <= 'F')) 
+               bp[i] |= (int) (*sp - 'A') + 10;
+       else if ((*sp >= '0') && (*sp <= '9'))
+               bp[i] |= (int) (*sp - '0');
+       else
+               return(-1);
+       
+       sp++;
+    }
+    sin->sin_addr.s_addr = htonl (val);
+
+    return(sp-bufp);
+}
+
+static int
+INET_input(int type, char *bufp, struct sockaddr *sap)
+{
+  switch(type) {
+       case 1:
+               return(INET_getsock(bufp,sap));
+       default:
+               return(INET_resolve(bufp, (struct sockaddr_in *) sap));
+  }
+}
+
+
+struct aftype inet_aftype = {
+  "inet",      NULL, /*"DARPA Internet",*/     AF_INET,        sizeof(unsigned long),
+  INET_print,  INET_sprint,            INET_input,     INET_reserror,  
+  NULL/*INET_rprint*/, NULL/*INET_rinput*/
+};
+
+#endif /* HAVE_AFINET || HAVE_AFINET6 */
+
+#if HAVE_AFINET || HAVE_AFINET6
+
+static void
+add2list(struct service **namebase, struct service *item) 
+{
+  if (*namebase == NULL) {
+       *namebase = item;
+       item->next = NULL;
+  } else {
+       item->next = *namebase;
+       *namebase = item;
+  } 
+}
+
+
+static struct service *
+searchlist(struct service *servicebase, int number)
+{
+  struct service *item;
+
+  for(item = servicebase; item != NULL; item = item->next) {
+       if (item->number == number) return(item);
+  }
+  return(NULL);
+}
+
+
+static int
+read_services(void)
+{
+  struct servent *se;
+  struct service *item;
+
+  setservent(1);
+  while((se=getservent())) {
+       /* Allocate a service entry. */
+       item = (struct service *) malloc(sizeof(struct service));
+       if (item == NULL) perror("netstat"); 
+       item->name = strdup(se->s_name);
+       item->number = se->s_port;
+
+       /* Fill it in. */
+       if (! strcmp(se->s_proto, "tcp")) {
+               add2list(&tcp_name,item);
+       } else if (! strcmp(se->s_proto, "udp")) {
+               add2list(&udp_name,item);
+       } else if (! strcmp(se->s_proto, "raw")) {
+               add2list(&raw_name,item);
+       }
+  }
+  endservent();
+  return(0);
+}
+
+
+char *
+get_sname(int socknumber, char *proto, int numeric)
+{
+  static char buffer[64], init=0;
+  struct service *item;
+
+  if (socknumber == 0) return("*");
+  if (numeric) {
+       sprintf(buffer, "%d", ntohs(socknumber));
+       return(buffer);
+  }
+  if (!init) {
+       (void)read_services();
+       init=1;
+  }
+  buffer[0]='\0';
+  if (! strcmp(proto, "tcp")) {
+       if ((item = searchlist(tcp_name, socknumber)) != NULL)
+               sprintf(buffer, "%s", item->name);
+  } else if (! strcmp(proto, "udp")) {
+       if ((item = searchlist(udp_name, socknumber)) != NULL)
+               sprintf(buffer, "%s", item->name);
+  } else if (! strcmp(proto, "raw")) {
+       if ((item = searchlist(raw_name, socknumber)) != NULL)
+               sprintf(buffer, "%s", item->name);
+
+  }
+  if (!buffer[0])
+       sprintf(buffer, "%d", ntohs(socknumber));
+  return(buffer);
+}
+
+#endif /* HAVE_AFINET || HAVE_AFINET6 */
diff --git a/lib/inet6.c b/lib/inet6.c
new file mode 100644 (file)
index 0000000..e9ddd5d
--- /dev/null
@@ -0,0 +1,162 @@
+/*
+ * lib/inet6.c This file contains an implementation of the "INET6"
+ *             support functions for the net-tools.
+ *             (most of it copied from lib/inet.c 1.26).
+ *
+ * Version:    lib/inet6.c 0.01 1996-08-08
+ *
+ * Author:     Fred N. van Kempen, <waltje@uwalt.nl.mugnet.org>
+ *             Copyright 1993 MicroWalt Corporation
+ *
+ * Modified:
+ *960808 {0.01}        Frank Strauss :         adapted for IPv6 support
+ *
+ *             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.
+ */
+#include "config.h"
+
+#if HAVE_AFINET6
+#include <asm/types.h>
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+#include <arpa/nameser.h>
+#include <ctype.h>
+#include <errno.h>
+#include <netdb.h>
+#include <resolv.h>
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#include <unistd.h>
+#include "version.h"
+#include "net-support.h"
+#include "pathnames.h"
+#define  EXTERN
+#include "net-locale.h"
+
+extern int h_errno;  /* some netdb.h versions don't export this */
+
+static int
+INET6_resolve(char *name, struct sockaddr_in6 *sin6)
+{
+  struct addrinfo req, *ai; 
+  int s; 
+
+  req.ai_family = AF_INET6;
+  if ((s = getaddrinfo(name, NULL, &req, &ai))) {
+    fprintf(stderr, "getaddrinfo: %s: %s\n", name, gai_strerror(s));
+    return -1;
+  }
+
+  memcpy(sin6, ai->ai_addr, sizeof(struct sockaddr_in6));
+
+  freeaddrinfo(ai);
+
+  return(0);
+}
+
+
+static int
+INET6_rresolve(char *name, struct sockaddr_in6 *sin6, int numeric)
+{
+  int s;
+
+  /* Grmpf. -FvK */
+  if (sin6->sin6_family != AF_INET6) {
+#ifdef DEBUG
+       fprintf(stderr, NLS_CATGETS(catfd, inetSet, inet_debug1, "rresolve: unsupport address family %d !\n"),
+                                                       sin6->sin6_family);
+#endif
+       errno = EAFNOSUPPORT;
+       return(-1);
+  }
+
+  if (numeric & 0x7FFF) {
+        inet_ntop(AF_INET6, &sin6->sin6_addr, name, 80);
+       return(0);
+  }
+
+  if ((s = getnameinfo((struct sockaddr *)sin6, sizeof(struct sockaddr_in6),
+                     name, 255 /* !! */, NULL, 0, 0))) {
+    fprintf(stderr, "getnameinfo: %s\n", gai_strerror(s));
+    return -1;
+  }
+
+  return(0);
+}
+
+
+static void
+INET6_reserror(char *text)
+{
+  herror(text);
+}
+
+
+/* Display an Internet socket address. */
+static char *
+INET6_print(unsigned char *ptr)
+{
+  static char name[80];
+
+  inet_ntop(AF_INET6, (struct in6_addr *)ptr, name, 80);
+  return name;
+}
+
+
+/* Display an Internet socket address. */
+/* dirty! struct sockaddr usually doesn't suffer for inet6 addresses, fst. */
+static char *
+INET6_sprint(struct sockaddr *sap, int numeric)
+{
+  static char buff[128];
+
+  if (sap->sa_family == 0xFFFF || sap->sa_family == 0)
+    return(NLS_CATBUFF (catfd, inetSet, inet_none, "[NONE SET]", buff, 128));
+  if (INET6_rresolve(buff, (struct sockaddr_in6 *) sap, numeric) != 0)
+                                                       return(NULL);
+  return(buff);
+}
+
+
+static int
+INET6_getsock(char *bufp, struct sockaddr *sap)
+{
+  struct sockaddr_in6 *sin6;
+  
+  sin6              = (struct sockaddr_in6 *) sap;
+  sin6->sin6_family = AF_INET6;
+  sin6->sin6_port   = 0;
+
+  if (inet_pton(AF_INET6, bufp, sin6->sin6_addr.s6_addr) <= 0)
+    return(-1);
+
+  return 16; /* ?;) */
+}
+
+static int
+INET6_input(int type, char *bufp, struct sockaddr *sap)
+{
+  switch(type) {
+       case 1:
+               return(INET6_getsock(bufp, sap));
+       default:
+               return(INET6_resolve(bufp, (struct sockaddr_in6 *) sap));
+  }
+}
+
+
+struct aftype inet6_aftype = {
+  "inet6",     NULL, /*"IPv6",*/       AF_INET6,       sizeof(struct in6_addr),
+  INET6_print, INET6_sprint,           INET6_input,    INET6_reserror, 
+  INET6_rprint,        INET6_rinput
+};
+
+
+#endif /* HAVE_AFINET6 */
diff --git a/lib/inet6_gr.c b/lib/inet6_gr.c
new file mode 100644 (file)
index 0000000..e0c0378
--- /dev/null
@@ -0,0 +1,263 @@
+#include "config.h"
+
+#if HAVE_AFINET6
+#include <asm/types.h>
+#include <asm/param.h>
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+#include <arpa/nameser.h>
+#include <net/route.h>
+#include <ctype.h>
+#include <errno.h>
+#include <netdb.h>
+#include <resolv.h>
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#include <unistd.h>
+#include <netinet/ip6.h>
+#ifndef __GLIBC__
+#include <netinet6/ipv6_route.h>  /* glibc doesn't have this */
+#endif
+#include "version.h"
+#include "net-support.h"
+#include "pathnames.h"
+#define  EXTERN
+#include "net-locale.h"
+
+#include "net-features.h"
+
+/* this is from linux/include/net/ndisc.h */
+/*
+ *     Neighbor Cache Entry States (7.3.2.)
+ */
+
+/*
+ *     The lsb is set for states that have a timer associated
+ */
+
+#define NUD_NONE       0x00
+#define NUD_INCOMPLETE 0x11
+#define NUD_REACHABLE  0x20
+#define NUD_STALE      0x30
+#define NUD_DELAY      0x41
+#define NUD_PROBE      0x51
+#define NUD_FAILED     0x60    /* neighbour discovery failed   */
+
+#define NUD_IN_TIMER   0x01
+
+#define NDISC_QUEUE_LEN        3
+
+#define NCF_NOARP              0x0100  /* no ARP needed on this device */
+#define NCF_SUBNET             0x0200  /* NC entry for subnet          */
+#define NCF_INVALID            0x0400
+#define NCF_DELAY_EXPIRED      0x0800  /* time to move to PROBE        */
+#define NCF_ROUTER             0x1000  /* neighbour is a router        */
+#define NCF_HHVALID            0x2000  /* Hardware header is valid     */
+
+
+extern     struct aftype   inet6_aftype;
+
+
+int rprint_fib6(int ext, int numeric)
+{
+  char buff[4096], iface[16], flags[16];
+  char addr6[128], naddr6[128];
+  struct sockaddr_in6 saddr6, snaddr6;
+  int num, iflags, metric, refcnt, use, prefix_len, slen;
+  FILE *fp=fopen(_PATH_PROCNET_ROUTE6, "r");
+  char addr6p[8][5], saddr6p[8][5], naddr6p[8][5];
+
+  if (!fp) {
+       ESYSNOT("getroute","INET6 FIB");
+       return 1;
+  }
+
+  printf(NLS_CATGETS(catfd, inet6Set, inet6_table, "Kernel IPv6 routing table\n"));
+
+  printf(NLS_CATGETS(catfd, inet6Set, inet6_header2,
+                    "Destination                                 "
+                    "Next Hop                                "
+                    "Flags Metric Ref    Use Iface\n"));
+
+  while (fgets(buff, 1023, fp))
+  {
+       num = sscanf(buff, "%4s%4s%4s%4s%4s%4s%4s%4s %02x %4s%4s%4s%4s%4s%4s%4s%4s %02x %4s%4s%4s%4s%4s%4s%4s%4s %08x %08x %08x %08x %s\n",
+                    addr6p[0], addr6p[1], addr6p[2], addr6p[3],
+                    addr6p[4], addr6p[5], addr6p[6], addr6p[7],
+                    &prefix_len,
+                    saddr6p[0], saddr6p[1], saddr6p[2], saddr6p[3],
+                    saddr6p[4], saddr6p[5], saddr6p[6], saddr6p[7],
+                    &slen,
+                    naddr6p[0], naddr6p[1], naddr6p[2], naddr6p[3],
+                    naddr6p[4], naddr6p[5], naddr6p[6], naddr6p[7],
+                    &metric, &use, &refcnt, &iflags, iface);
+#if 0
+       if (num < 23) continue;
+#endif
+       /* Fetch and resolve the target address. */
+       sprintf(addr6, "%s:%s:%s:%s:%s:%s:%s:%s",
+               addr6p[0], addr6p[1], addr6p[2], addr6p[3],
+               addr6p[4], addr6p[5], addr6p[6], addr6p[7]);
+       inet6_aftype.input(1, addr6, (struct sockaddr *)&saddr6);
+       sprintf(addr6, "%s/%d",
+               inet6_aftype.sprint((struct sockaddr *)&saddr6, 1),
+               prefix_len);
+       
+       /* Fetch and resolve the nexthop address. */
+       sprintf(naddr6, "%s:%s:%s:%s:%s:%s:%s:%s",
+               naddr6p[0], naddr6p[1], naddr6p[2], naddr6p[3],
+               naddr6p[4], naddr6p[5], naddr6p[6], naddr6p[7]);
+       inet6_aftype.input(1, naddr6, (struct sockaddr *)&snaddr6);
+       sprintf(naddr6, "%s",
+               inet6_aftype.sprint((struct sockaddr *)&snaddr6, 1));
+       
+       /* Decode the flags. */
+       flags[0] = '\0';
+       if (iflags & RTF_UP) strcat(flags, "U");
+       if (iflags & RTF_GATEWAY) strcat(flags, "G");
+       if (iflags & RTF_HOST) strcat(flags, "H");
+       if (iflags & RTF_DEFAULT) strcat(flags, "D");
+       if (iflags & RTF_ADDRCONF) strcat(flags, "A");
+       if (iflags & RTF_CACHE) strcat(flags, "C");
+       
+       /* Print the info. */
+       printf("%-43s %-39s %-5s %-6d %-2d %7d %-8s\n",
+              addr6, naddr6, flags, metric, refcnt, use, iface);
+  }
+
+  (void) fclose(fp);
+  return(0);
+}
+
+int rprint_cache6(int ext, int numeric)
+{
+  char buff[4096], iface[16], flags[16];
+  char addr6[128], haddr[20], statestr[20];
+  struct sockaddr_in6 saddr6;
+  int type, num, refcnt, prefix_len, location,state,gc;
+  long tstamp, expire, ndflags,reachable,stale,delete;
+  FILE *fp=fopen(_PATH_PROCNET_NDISC, "r");
+  char addr6p[8][5], haddrp[6][3];
+
+  if (!fp) {
+       ESYSNOT("nd_print","ND Table");
+       return 1;
+  }
+
+  printf(NLS_CATGETS(catfd, inet6ndSet, inet6_ndtable, "Kernel IPv6 Neighbour Cache\n"));
+
+  if (ext == 2)
+    printf(NLS_CATGETS(catfd, inet6ndSet, inet6_ndheader2,
+                    "Neighbour                                   "
+                    "HW Address        "
+                    "Iface    Flags Ref State\n"));
+  else 
+    printf(NLS_CATGETS(catfd, inet6ndSet, inet6_ndheader2,
+                    "Neighbour                                   "
+                    "HW Address        "
+                    "Iface    Flags Ref State            Stale(sec) Delete(sec)\n"));
+
+
+  while (fgets(buff, 1023, fp))
+  {
+       num = sscanf(buff, "%4s%4s%4s%4s%4s%4s%4s%4s %02x %02x %02x %02x %08lx %08lx %08lx %04x %04x %04lx %8s %2s%2s%2s%2s%2s%2s\n",
+                    addr6p[0], addr6p[1], addr6p[2], addr6p[3],
+                    addr6p[4], addr6p[5], addr6p[6], addr6p[7],
+                    &location, &prefix_len, &type, &state, &expire, &tstamp, &reachable, &gc, &refcnt,
+                    &ndflags, iface,
+                    haddrp[0], haddrp[1], haddrp[2], haddrp[3], haddrp[4], haddrp[5]);
+
+       /* Fetch and resolve the nexthop address. */
+       sprintf(addr6, "%s:%s:%s:%s:%s:%s:%s:%s",
+               addr6p[0], addr6p[1], addr6p[2], addr6p[3],
+               addr6p[4], addr6p[5], addr6p[6], addr6p[7]);
+       inet6_aftype.input(1, addr6, (struct sockaddr *)&saddr6);
+       sprintf(addr6, "%s/%d",
+               inet6_aftype.sprint((struct sockaddr *)&saddr6, numeric),
+               prefix_len);
+       
+       /* Fetch the  hardware address. */
+       sprintf(haddr, "%s:%s:%s:%s:%s:%s", haddrp[0],haddrp[1],haddrp[2], haddrp[3],haddrp[4],haddrp[5]);
+       
+       /* Decode the flags. */
+       flags[0] = '\0';
+       if (ndflags & NCF_NOARP) strcat(flags, "N");
+       if (ndflags & NCF_SUBNET) strcat(flags, "S");
+       if (ndflags & NCF_INVALID) strcat(flags, "I");
+       if (ndflags & NCF_DELAY_EXPIRED) strcat(flags, "D");
+       if (ndflags & NCF_ROUTER) strcat(flags, "R");
+       if (ndflags & NCF_HHVALID) strcat(flags, "H");
+
+       /* Decode the state */
+       switch (state) {
+       case NUD_NONE:
+               strcpy(statestr,"NONE");
+               break;
+       case NUD_INCOMPLETE:
+               strcpy(statestr,"INCOMPLETE");
+               break;
+       case NUD_REACHABLE:
+               strcpy(statestr,"REACHABLE");
+               break;
+       case NUD_STALE:
+               strcpy(statestr,"STALE");
+               break;
+       case NUD_DELAY:
+               strcpy(statestr,"DELAY");
+               break;
+       case NUD_PROBE:
+               strcpy(statestr,"PROBE");
+               break;
+       case NUD_FAILED:
+               strcpy(statestr,"FAILED");
+               break;
+       case NUD_IN_TIMER:
+               strcpy(statestr,"IN TIMER");
+               break;
+       default:
+               sprintf(statestr,"UNKNOWN %02x",state);
+               break;
+       }
+       
+       /* Print the info. */
+       printf("%-43s %-17s %-8s %-5s %-3d %-16s",
+              addr6, haddr, iface, flags, refcnt, statestr);
+
+       stale=0;
+       if (state==NUD_REACHABLE)
+           stale = reachable > tstamp?reachable - tstamp:0;
+       delete = gc > tstamp?gc - tstamp:0;
+       if (ext!=2){
+         printf(" %-9ld ",stale/HZ);
+          if (refcnt)
+             printf(" * ");
+          else
+             printf(" %-7ld ",delete/HZ);
+       }
+       printf("\n");
+  }
+
+  (void) fclose(fp);
+  return(0);
+}
+
+int INET6_rprint(int options)
+{
+  int ext = options & FLAG_EXT;
+  int numeric = options & (FLAG_NUM|FLAG_SYM);
+  int rc = E_INTERN;
+  
+  if (options & FLAG_FIB)
+       if ((rc = rprint_fib6(ext,numeric)))
+               return(rc);
+
+  if (options & FLAG_CACHE)  
+       if ((rc = rprint_cache6(ext,numeric)))
+               return(rc);
+  return(rc);
+}
+
+#endif /* HAVE_AFINET6 */
diff --git a/lib/inet6_sr.c b/lib/inet6_sr.c
new file mode 100644 (file)
index 0000000..388d49d
--- /dev/null
@@ -0,0 +1,187 @@
+#include "config.h"
+
+#if HAVE_AFINET6
+#include <asm/types.h>
+#include <sys/param.h>
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+#include <arpa/nameser.h>
+#include <net/route.h>
+#include <net/if.h>
+#include <sys/ioctl.h>
+#include <ctype.h>
+#include <errno.h>
+#include <netdb.h>
+#include <resolv.h>
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#include <unistd.h>
+#ifndef __GLIBC__ 
+#include <netinet6/ipv6_route.h>     /* glibc does not have this */
+#endif
+#include "version.h"
+#include "net-support.h"
+#include "pathnames.h"
+#define  EXTERN
+#include "net-locale.h"
+
+#include "net-features.h"
+
+extern     struct aftype   inet6_aftype;
+
+static int skfd = -1;
+
+
+static int usage(void)
+{
+  fprintf(stderr,"Usage: inet6_route [-vF] del Target\n");
+  fprintf(stderr,"       inet6_route [-vF] add Target [gw Gw] [metric M] [[dev] If]\n");
+  fprintf(stderr,"       inet6_route [-FC] flush      NOT supported\n");
+  return(E_USAGE);
+}
+
+
+static int INET6_setroute(int action, int options, char **args)
+{
+  struct in6_rtmsg rt;
+  struct ifreq ifr;
+  struct sockaddr_in6 sa6;
+  char target[128], gateway[128] = "NONE";
+  int metric, prefix_len;
+  char *devname = NULL;
+  char *cp;
+  
+  if (*args == NULL)
+       return(usage());
+
+  strcpy(target, *args++);
+  if ((cp = strchr(target, '/'))) {
+    prefix_len = atol(cp+1);
+    if ((prefix_len < 0) || (prefix_len > 128)) usage();
+    *cp = 0;
+  } else {
+    prefix_len = 128;
+  }
+
+  /* Clean out the RTREQ structure. */
+  memset((char *) &rt, 0, sizeof(struct in6_rtmsg));
+
+  if (inet6_aftype.input(1, target, (struct sockaddr *)&sa6) < 0) {
+       inet6_aftype.herror(target);
+       return (1);
+  }
+  memcpy(&rt.rtmsg_dst, sa6.sin6_addr.s6_addr, sizeof(struct in6_addr));
+  
+  /* Fill in the other fields. */
+  rt.rtmsg_flags = RTF_UP;
+  if (prefix_len == 128)
+       rt.rtmsg_flags |= RTF_HOST;
+  rt.rtmsg_metric = 1;
+  rt.rtmsg_dst_len = prefix_len;
+  
+  while (*args) {
+       if (!strcmp(*args, "metric")) {
+
+               args++;
+               if (!*args || !isdigit(**args))
+                       return(usage());
+               metric = atoi(*args);
+               rt.rtmsg_metric = metric;
+               args++;
+               continue;
+       }
+       if (!strcmp(*args,"gw") || !strcmp(*args,"gateway")) {
+               args++;
+               if (!*args)
+                       return(usage());
+               if (rt.rtmsg_flags & RTF_GATEWAY)
+                       return(usage());
+               strcpy(gateway, *args);
+               if (inet6_aftype.input(1, gateway,
+                                      (struct sockaddr *)&sa6) < 0) {
+                       inet6_aftype.herror(gateway);
+                       return (E_LOOKUP);
+               }
+               memcpy(&rt.rtmsg_gateway, sa6.sin6_addr.s6_addr,
+                      sizeof(struct in6_addr));
+               rt.rtmsg_flags |= RTF_GATEWAY;
+               args++;
+               continue;
+       }
+       if (!strcmp(*args,"mod")) {
+               args++;
+               rt.rtmsg_flags |= RTF_MODIFIED;
+               continue;
+       }
+       if (!strcmp(*args,"dyn")) {
+               args++;
+               rt.rtmsg_flags |= RTF_DYNAMIC;
+               continue;
+       }
+       if (!strcmp(*args,"device") || !strcmp(*args,"dev")) {
+               args++;
+               if (!*args)
+                       return(usage());
+       } else
+               if (args[1])
+                       return(usage());
+
+       devname = *args;
+       args++;
+  }
+
+  /* Create a socket to the INET6 kernel. */
+  if ((skfd = socket(AF_INET6, SOCK_DGRAM, 0)) < 0) {
+         perror("socket");
+         return(E_SOCK);
+  }
+  
+  if (devname) {
+         memset(&ifr, 0, sizeof(ifr));
+         strcpy(ifr.ifr_name, devname);
+         
+         if (ioctl(skfd, SIOGIFINDEX, &ifr) < 0) {
+                 perror("SIOGIFINDEX");
+                 return(E_SOCK);
+         }
+  
+         rt.rtmsg_ifindex = ifr.ifr_ifindex;
+  }
+  else
+         rt.rtmsg_ifindex = 0;
+  
+  /* Tell the kernel to accept this route. */
+  if (action==RTACTION_DEL) {
+       if (ioctl(skfd, SIOCDELRT, &rt) < 0) {
+               perror("SIOCDELRT");
+               close(skfd);
+               return(E_SOCK);
+       }
+  } else {
+       if (ioctl(skfd, SIOCADDRT, &rt) < 0) {
+               perror("SIOCADDRT");
+               close(skfd);
+               return(E_SOCK);
+       }
+  }
+
+  /* Close the socket. */
+  (void) close(skfd);
+  return(0);
+}
+
+int INET6_rinput(int action, int options, char **args)
+{
+  if (action == RTACTION_FLUSH) {
+       fprintf(stderr,"Flushing `inet6' routing table not supported\n");
+       return(usage());
+  }    
+  if ((*args == NULL) || (action == RTACTION_HELP))
+       return(usage());
+  
+  return(INET6_setroute(action, options, args));
+}
+#endif /* HAVE_AFINET6 */
diff --git a/lib/inet_gr.c b/lib/inet_gr.c
new file mode 100644 (file)
index 0000000..93303a5
--- /dev/null
@@ -0,0 +1,259 @@
+#include "config.h"
+
+#if HAVE_AFINET
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+#include <arpa/nameser.h>
+#include <net/route.h>
+#include <ctype.h>
+#include <errno.h>
+#include <netdb.h>
+#include <resolv.h>
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#include <unistd.h>
+#include "version.h"
+#include "net-support.h"
+#include "pathnames.h"
+#define  EXTERN
+#include "net-locale.h"
+
+#include "net-features.h"
+
+extern     struct aftype   inet_aftype;
+
+
+int rprint_fib(int ext, int numeric)
+{
+  char buff[4096], iface[16], flags[16];
+  char gate_addr[128], net_addr[128];
+  char mask_addr[128];
+  struct sockaddr snet, sgate, smask;
+  int num, iflags, metric, refcnt, use, mss, window, irtt;
+  FILE *fp=fopen(_PATH_PROCNET_ROUTE, "r");
+
+  if (!fp) {
+       ESYSNOT("getroute","INET FIB");
+       return 1;
+  }
+
+  printf(NLS_CATGETS(catfd, inetSet, inet_table, "Kernel IP routing table\n"));
+
+  if (ext == 1)
+       printf(NLS_CATGETS(catfd, inetSet, inet_header1,
+               "Destination     Gateway         Genmask         "
+               "Flags Metric Ref    Use Iface\n"));
+  if (ext == 2)
+       printf(NLS_CATGETS(catfd, inetSet, inet_header2,
+               "Destination     Gateway         Genmask         "
+               "Flags   MSS Window  irtt Iface\n"));
+  if (ext >= 3)
+       printf(NLS_CATGETS(catfd, inetSet, inet_header3,
+               "Destination     Gateway         Genmask         "
+               "Flags Metric Ref    Use Iface    "
+               "MSS   Window irtt\n"));
+
+  irtt=0;
+  window=0;
+  mss=0;
+  while (fgets(buff, 1023, fp))
+  {
+       num = sscanf(buff, "%s %s %s %X %d %d %d %s %d %d %d\n",
+               iface, net_addr, gate_addr,
+               &iflags, &refcnt, &use, &metric, mask_addr,
+               &mss,&window,&irtt);
+       if (num < 10) continue;
+
+       /* Fetch and resolve the target address. */
+       (void)inet_aftype.input(1, net_addr, &snet);
+       strcpy(net_addr, inet_aftype.sprint(&snet, (numeric | 0x8000)));
+       net_addr[15] = '\0';
+    
+       /* Fetch and resolve the gateway address. */
+       (void)inet_aftype.input(1, gate_addr, &sgate);
+       strcpy(gate_addr, inet_aftype.sprint(&sgate, numeric));
+       gate_addr[15] = '\0';
+
+       /* Fetch and resolve the genmask. */
+       (void)inet_aftype.input(1, mask_addr, &smask);
+       strcpy(mask_addr, inet_aftype.sprint(&smask, 1));
+       mask_addr[15] = '\0';
+
+       /* Decode the flags. */
+       flags[0] = '\0';
+       if (iflags & RTF_UP) strcat(flags, "U");
+       if (iflags & RTF_GATEWAY) strcat(flags, "G");
+#if HAVE_RTF_REJECT
+       if (iflags & RTF_REJECT) strcpy(flags,"!");
+#endif
+       if (iflags & RTF_HOST) strcat(flags, "H");
+       if (iflags & RTF_REINSTATE) strcat(flags, "R");
+       if (iflags & RTF_DYNAMIC) strcat(flags, "D");
+       if (iflags & RTF_MODIFIED) strcat(flags, "M");
+       /* Print the info. */
+       if (ext == 1) {
+#if HAVE_RTF_REJECT
+               if (iflags & RTF_REJECT)
+                       printf("%-15s -               %-15s %-5s %-6d -  %7d -\n",
+                               net_addr,  mask_addr, flags, metric, use);
+               else
+#endif
+                       printf("%-15s %-15s %-15s %-5s %-6d %-2d %7d %s\n",
+                       net_addr, gate_addr, mask_addr, flags,
+                       metric, refcnt, use, iface);
+       }
+       if (ext == 2) {
+#if HAVE_RTF_REJECT
+               if (iflags & RTF_REJECT)
+                       printf("%-15s -               %-15s %-5s     - -          - -\n",
+                               net_addr, mask_addr, flags);
+               else
+#endif
+                       printf("%-15s %-15s %-15s %-5s %5d %-5d %6d %s\n",
+                               net_addr, gate_addr, mask_addr, flags,
+                               mss, window, irtt, iface);
+       }
+       if (ext >= 3) {
+#if HAVE_RTF_REJECT
+               if (iflags & RTF_REJECT)
+                       printf("%-15s -               %-15s %-5s %-6d -  %7d -        -     -      -\n",
+                               net_addr, mask_addr, flags, metric, use);
+               else
+#endif
+                       printf("%-15s %-15s %-15s %-5s %-6d %-3d %6d %-6.6s   %-5d %-6d %d\n",
+                       net_addr, gate_addr, mask_addr, flags,
+                       metric, refcnt, use, iface, mss, window, irtt);
+       }
+  }
+
+  (void) fclose(fp);
+  return(0);
+}
+
+int rprint_cache(int ext, int numeric)
+{
+  char buff[4096], iface[16], flags[16];
+  char gate_addr[128], net_addr[128];
+  char mask_addr[128];
+  struct sockaddr snet, sgate, smask;
+  int num, iflags, metric, refcnt, use, mss, window, irtt, hh, arp;
+
+  FILE *fp=fopen(_PATH_PROCNET_RTCACHE, "r");
+
+  if (!fp) {
+       ESYSNOT("getroute","INET CACHE");
+       return 1;
+  }
+
+  if (ext == 1)
+       printf(NLS_CATGETS(catfd, inetSet, inet_header1,
+               "Destination     Gateway         Source          "
+               "Flags Metric Ref    Use Iface\n"));
+  if (ext == 2)
+       printf(NLS_CATGETS(catfd, inetSet, inet_header2,
+               "Destination     Gateway         Source          "
+               "Flags   MSS Window  irtt Iface\n"));
+  if (ext >= 3)
+       printf(NLS_CATGETS(catfd, inetSet, inet_header3,
+               "Destination     Gateway         Source          "
+               "Flags Metric Ref    Use Iface    "
+               "MSS   Window irtt   HH  Arp\n"));
+
+  irtt=0;
+  window=0;
+  mss=0;
+  hh=0;
+  arp=0;
+  while (fgets(buff, 1023, fp))
+  {
+       num = sscanf(buff, "%s %s %s %X %d %d %d %s %d %d %d %d %d\n",
+               iface, net_addr, gate_addr,
+               &iflags, &refcnt, &use, &metric, mask_addr,
+               &mss,&window,&irtt,&hh,&arp);
+       if (num < 12) continue;
+
+       /* Fetch and resolve the target address. */
+       (void)inet_aftype.input(1, net_addr, &snet);
+       strcpy(net_addr, inet_aftype.sprint(&snet, (numeric | 0x8000)));
+       net_addr[15] = '\0';
+
+       /* Fetch and resolve the gateway address. */
+       (void)inet_aftype.input(1, gate_addr, &sgate);
+       strcpy(gate_addr, inet_aftype.sprint(&sgate, numeric));
+       gate_addr[15] = '\0';
+
+       /* Fetch and resolve the genmask. */
+       (void)inet_aftype.input(1, mask_addr, &smask);
+       strcpy(mask_addr, inet_aftype.sprint(&smask, 1));
+       mask_addr[15] = '\0';
+
+       /* Decode the flags. */
+       flags[0] = '\0';
+       if (iflags & RTF_UP) strcat(flags, "U");
+       if (iflags & RTF_GATEWAY) strcat(flags, "G");
+#if HAVE_RTF_REJECT
+       if (iflags & RTF_REJECT) strcpy(flags,"!");
+#endif
+       if (iflags & RTF_HOST) strcat(flags, "H");
+       if (iflags & RTF_REINSTATE) strcat(flags, "R");
+       if (iflags & RTF_DYNAMIC) strcat(flags, "D");
+       if (iflags & RTF_MODIFIED) strcat(flags, "M");
+       /* Print the info. */
+       if (ext == 1) {
+#if HAVE_RTF_REJECT
+               if (iflags & RTF_REJECT)
+                       printf("%-15s -               %-15s %-5s %-6d -  %7d -\n",
+                               net_addr,  mask_addr, flags, metric, use);
+               else
+#endif
+                       printf("%-15s %-15s %-15s %-5s %-6d %-2d %7d %s\n",
+                       net_addr, gate_addr, mask_addr, flags,
+                       metric, refcnt, use, iface);
+       }
+       if (ext == 2) {
+#if HAVE_RTF_REJECT
+               if (iflags & RTF_REJECT)
+                       printf("%-15s -               %-15s %-5s     - -          - -\n",
+                               net_addr, mask_addr, flags);
+               else
+#endif
+                       printf("%-15s %-15s %-15s %-5s %5d %-5d %6d %s\n",
+                               net_addr, gate_addr, mask_addr, flags,
+                               mss, window, irtt, iface);
+       }
+       if (ext >= 3) {
+#if HAVE_RTF_REJECT
+               if (iflags & RTF_REJECT)
+                       printf("%-15s -               %-15s %-5s %-6d -  %7d -        -     -      -\n",
+                               net_addr, mask_addr, flags, metric, use);
+               else
+#endif
+                       printf("%-15s %-15s %-15s %-5s %-6d %-3d %6d %-6.6s   %-5d %-6d %-6d %-3d %d\n",
+                       net_addr, gate_addr, mask_addr, flags,
+                       metric, refcnt, use, iface, mss, window, irtt,  hh, arp);
+       }
+  }
+
+  (void) fclose(fp);
+  return(0);
+}
+
+int INET_rprint(int options)
+{
+  int ext = options & FLAG_EXT;
+  int numeric = options & (FLAG_NUM|FLAG_SYM);
+  int rc = E_INTERN;
+  
+  if (options & FLAG_FIB)
+       if ((rc = rprint_fib(ext,numeric)))
+               return(rc);
+  if (options & FLAG_CACHE)
+       rc = rprint_cache(ext,numeric);
+  
+  return(rc);
+}
+
+#endif /* HAVE_AFINET */
diff --git a/lib/inet_sr.c b/lib/inet_sr.c
new file mode 100644 (file)
index 0000000..d969d03
--- /dev/null
@@ -0,0 +1,309 @@
+#include "config.h"
+
+#if HAVE_AFINET
+#include <asm/types.h>
+#include <sys/param.h>
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+#include <arpa/nameser.h>
+#include <net/route.h>
+#include <sys/ioctl.h>
+#include <ctype.h>
+#include <errno.h>
+#include <netdb.h>
+#include <resolv.h>
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#include <unistd.h>
+#include "version.h"
+#include "net-support.h"
+#include "pathnames.h"
+#define  EXTERN
+#include "net-locale.h"
+
+#include "net-features.h"
+
+#if HAVE_NEW_ADDRT
+#define mask_in_addr(x) (((struct sockaddr_in *)&((x).rt_genmask))->sin_addr.s_addr)
+#define full_mask(x) (x)
+#else
+#define mask_in_addr(x) ((x).rt_genmask)
+#define full_mask(x) (((struct sockaddr_in *)&(x))->sin_addr.s_addr)
+#endif
+
+extern     struct aftype   inet_aftype;
+
+static int skfd = -1;
+
+
+static int usage(void)
+{
+  fprintf(stderr,"Usage: inet_route [-vF] del {-host|-net} Target [gw Gw] [metric M] [[dev] If]\n");
+  fprintf(stderr,"       inet_route [-vF] add {-host|-net} Target [gw Gw] [metric M]\n");
+  fprintf(stderr,"                              [netmask N] [mss Mss] [window W] [irtt I]\n");
+  fprintf(stderr,"                              [mod] [dyn] [reinstate] [[dev] If]\n");
+  fprintf(stderr,"       inet_route [-vF] add {-host|-net} Target [metric M] reject\n");
+  fprintf(stderr,"       inet_route [-FC] flush      NOT aupported\n");
+  return(E_USAGE);
+}
+
+
+static int INET_setroute(int action, int options, char **args)
+{
+  struct rtentry rt;
+  char target[128], gateway[128] = "NONE", netmask[128] = "default";
+  int xflag, isnet;
+
+  xflag = 0;
+
+  if (!strcmp(*args, "#net")) {
+       xflag = 1;
+       args++;
+  } else if (!strcmp(*args, "#host")) {
+       xflag = 2;
+       args++;
+  }
+  if (*args == NULL)
+       return(usage());
+
+  strcpy(target, *args++);
+
+  /* Clean out the RTREQ structure. */
+  memset((char *) &rt, 0, sizeof(struct rtentry));
+
+  if ((isnet = inet_aftype.input(0, target, &rt.rt_dst)) < 0) {
+       inet_aftype.herror(target);
+       return (1);
+  }
+  switch (xflag) {
+       case 1:
+               isnet = 1;
+               break;
+
+       case 2:
+               isnet = 0;
+               break;
+
+       default:
+               break;
+  }
+
+  /* Fill in the other fields. */
+  rt.rt_flags = (RTF_UP | RTF_HOST);
+  if (isnet)
+       rt.rt_flags &= ~RTF_HOST;
+
+  while (*args) {
+       if (!strcmp(*args, "metric")) {
+               int metric;
+
+               args++;
+               if (!*args || !isdigit(**args))
+                       return(usage());
+               metric = atoi(*args);
+#if HAVE_NEW_ADDRT
+               rt.rt_metric = metric + 1;
+#else
+               ENOSUPP("inet_setroute","NEW_ADDRT (metric)");
+#endif
+               args++;
+               continue;
+       }
+       if (!strcmp(*args, "netmask")) {
+               struct sockaddr mask;
+
+               args++;
+               if (!*args || mask_in_addr(rt))
+                       return(usage());
+               strcpy(netmask, *args);
+               if ((isnet = inet_aftype.input(0, netmask, &mask)) < 0) {
+                       inet_aftype.herror(netmask);
+                       return (E_LOOKUP);
+               }
+               rt.rt_genmask = full_mask(mask);
+               args++;
+               continue;
+       }
+       if (!strcmp(*args,"gw") || !strcmp(*args,"gateway")) {
+               args++;
+               if (!*args)
+                       return(usage());
+               if (rt.rt_flags & RTF_GATEWAY)
+                       return(usage());
+               strcpy(gateway, *args);
+               if ((isnet = inet_aftype.input(0, gateway, &rt.rt_gateway)) < 0) {
+                       inet_aftype.herror(gateway);
+                       return (E_LOOKUP);
+               }
+               if (isnet) {
+                       fprintf(stderr, NLS_CATGETS(catfd, routeSet, route_cant_use,
+                                                   "route: %s: cannot use a NETWORK as gateway!\n"),
+                               gateway);
+                       return (E_OPTERR);
+               }
+               rt.rt_flags |= RTF_GATEWAY;
+               args++;
+               continue;
+       }
+       if (!strcmp(*args,"mss")) {
+               args++;
+               rt.rt_flags |= RTF_MSS;
+               if(!*args)
+                       return(usage());
+               rt.rt_mss = atoi(*args);
+               args++;
+               if(rt.rt_mss<64||rt.rt_mss>32768)
+               {
+                       fprintf(stderr, NLS_CATGETS(catfd, routeSet, route_MSS, "route: Invalid MSS.\n"));
+                       return(E_OPTERR);
+               }
+               continue;
+       }
+       if (!strcmp(*args,"window")) {
+               args++;
+               if(!*args)
+                       return(usage());
+               rt.rt_flags |= RTF_WINDOW;
+               rt.rt_window = atoi(*args);
+               args++;
+               if(rt.rt_window<128)
+               {
+                       fprintf(stderr, NLS_CATGETS(catfd, routeSet, route_window, "route: Invalid window.\n"));
+                       return(E_OPTERR);
+               }
+               continue;
+       }
+       if (!strcmp(*args,"irtt")) {
+               args++;
+               if(!*args)
+                       return(usage());
+               args++;
+#if HAVE_RTF_IRTT
+               rt.rt_flags |= RTF_IRTT;
+               rt.rt_irtt = atoi(*(args-1));
+               rt.rt_irtt*=(HZ/100); /* FIXME */
+#if 0 /* FIXME: do we need to check anything of this? */
+               if(rt.rt_irtt<1||rt.rt_irtt> (120*HZ))
+               {
+                       fprintf(stderr, NLS_CATGETS(catfd, routeSet, route_irtt, "route: Invalid initial rtt.\n"));
+                       return(E_OPTERR);
+               }
+#endif
+#else
+               ENOSUPP("inet_setroute","RTF_IRTT");
+#endif
+               continue;
+       }
+       if (!strcmp(*args,"reject")) {
+               args++;
+#if HAVE_RTF_REJECT
+               rt.rt_flags |= RTF_REJECT;
+#else
+               ENOSUPP("inet_setroute","RTF_REJECT");
+#endif
+               continue;
+       }
+       if (!strcmp(*args,"mod")) {
+               args++;
+               rt.rt_flags |= RTF_MODIFIED;
+               continue;
+       }
+       if (!strcmp(*args,"dyn")) {
+               args++;
+               rt.rt_flags |= RTF_DYNAMIC;
+               continue;
+       }
+       if (!strcmp(*args,"reinstate")) {
+               args++;
+               rt.rt_flags |= RTF_REINSTATE;
+               continue;
+       }
+       if (!strcmp(*args,"device") || !strcmp(*args,"dev")) {
+               args++;
+               if (!*args)
+                       return(usage());
+       } else
+               if (args[1])
+                       return(usage());
+       if (rt.rt_dev)
+               return(usage());
+       rt.rt_dev = *args;
+       args++;
+  }
+
+#if HAVE_RTF_REJECT
+  if ((rt.rt_flags & RTF_REJECT) && !rt.rt_dev)
+       rt.rt_dev="lo";
+#endif
+       
+  /* sanity checks.. */
+  if (mask_in_addr(rt)) {
+       __u32 mask = ~ntohl(mask_in_addr(rt));
+       if (rt.rt_flags & RTF_HOST) {
+               fprintf(stderr, NLS_CATGETS(catfd, routeSet, route_netmask1,
+                                           "route: netmask doesn't make sense with host route\n"));
+               return(E_OPTERR);
+       }
+       if (mask & (mask+1)) {
+               fprintf(stderr, NLS_CATGETS(catfd, routeSet, route_netmask2,
+                                           "route: bogus netmask %s\n"), netmask);
+               return(E_OPTERR);
+       }
+       mask = ((struct sockaddr_in *) &rt.rt_dst)->sin_addr.s_addr;
+       if (mask & ~mask_in_addr(rt)) {
+               fprintf(stderr, NLS_CATGETS(catfd, routeSet, route_netmask3,
+                                           "route: netmask doesn't match route address\n"));
+               return(E_OPTERR);
+       }
+  }
+
+  /* Fill out netmask if still unset */
+  if ((action==RTACTION_ADD) && rt.rt_flags & RTF_HOST)
+       mask_in_addr(rt) = 0xffffffff;
+
+  /* Create a socket to the INET kernel. */
+  if ((skfd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) {
+       perror("socket");
+       return(E_SOCK);
+  }
+  
+  /* Tell the kernel to accept this route. */
+  if (action==RTACTION_DEL) {
+       if (ioctl(skfd, SIOCDELRT, &rt) < 0) {
+               perror("SIOCDELRT");
+               close(skfd);
+               return(E_SOCK);
+       }
+  } else {
+       if (ioctl(skfd, SIOCADDRT, &rt) < 0) {
+               perror("SIOCADDRT");
+               close(skfd);
+               return(E_SOCK);
+       }
+  }
+
+  /* Close the socket. */
+  (void) close(skfd);
+  return(0);
+}
+
+int INET_rinput(int action, int options, char **args)
+{
+  if (action == RTACTION_FLUSH) {
+       fprintf(stderr,"Flushing `inet' routing table not supported\n");
+       return(usage());
+  }    
+  if (options & FLAG_CACHE) {
+       fprintf(stderr,"Modifying `inet' routing cache not supported\n");
+       return(usage());
+  }    
+  if ((*args == NULL) || (action == RTACTION_HELP))
+       return(usage());
+  
+  return(INET_setroute(action, options, args));
+}
+#endif /* HAVE_AFINET */
diff --git a/lib/ipx.c b/lib/ipx.c
new file mode 100644 (file)
index 0000000..bd4df65
--- /dev/null
+++ b/lib/ipx.c
@@ -0,0 +1,174 @@
+/*
+ *             IPX protocol output functions.
+ *             [Not yet input]
+ *
+ *                     Alan Cox  <Alan.Cox@linux.org>
+ *
+ *             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.
+ */
+#include "config.h"
+
+#if HAVE_AFIPX
+#include <asm/types.h>
+#include <sys/types.h>
+#include <sys/socket.h>
+#include "ipx.h"
+#include <stdlib.h>
+#include <stdio.h>
+#include <errno.h>
+#include <ctype.h>
+#include <string.h>
+#include <unistd.h>
+#include <netinet/in.h>
+#include "version.h"
+#include "net-support.h"
+#include "pathnames.h"
+#define  EXTERN
+#include "net-locale.h"
+
+#if (IPX_NODE_LEN != 6)
+#error "IPX_NODE_LEN != 6"
+#endif
+
+/* Display a ipx domain address. */
+static char *
+IPX_print(unsigned char *ptr)
+{
+  static char buff[64];
+  struct sockaddr_ipx *sipx=(struct sockaddr_ipx *)(ptr-2);
+  int t;
+
+  
+  for(t=IPX_NODE_LEN;t;t--)
+    if (sipx->sipx_node[t-1])
+      break;
+
+  if (t && ntohl(sipx->sipx_network))   
+    sprintf(buff,"%08lX:%02X%02X%02X%02X%02X%02X",
+       (long int)ntohl(sipx->sipx_network),
+       (int)sipx->sipx_node[0],(int)sipx->sipx_node[1],
+       (int)sipx->sipx_node[2],(int)sipx->sipx_node[3],
+       (int)sipx->sipx_node[4],(int)sipx->sipx_node[5]);
+  else if (!t && ntohl(sipx->sipx_network))
+    sprintf(buff,"%08lX", (long int)ntohl(sipx->sipx_network));
+  else if (t && !ntohl(sipx->sipx_network))
+    sprintf(buff,"%02X%02X%02X%02X%02X%02X",
+       (int)sipx->sipx_node[0],(int)sipx->sipx_node[1],
+       (int)sipx->sipx_node[2],(int)sipx->sipx_node[3],
+       (int)sipx->sipx_node[4],(int)sipx->sipx_node[5]);
+  else
+       buff[0] = '\0';
+  return(buff);
+}
+
+
+/* Display a ipx domain address. */
+static char *
+IPX_sprint(struct sockaddr *sap, int numeric)
+{
+  static char buf[64];
+
+  if (sap->sa_family != AF_IPX)
+    return(NLS_CATBUFF (catfd, ipxSet, ipx_none, "[NONE SET]", buf, 64));
+  return(IPX_print(sap->sa_data));
+}
+
+
+static int
+IPX_getsock(char *bufp, struct sockaddr *sap)
+{
+  char *sp = bufp,*bp;
+  unsigned int i;
+  unsigned char val;
+  struct sockaddr_ipx *sipx=(struct sockaddr_ipx *) sap;
+  
+  sipx->sipx_port   = 0;
+
+  val = 0;
+  bp=(char *)sipx->sipx_node;
+  for (i = 0; i < sizeof(sipx->sipx_node); i++) {
+       *sp = toupper(*sp);
+       
+       if ((*sp >= 'A') && (*sp <= 'F')) 
+               bp[i] |= (int) (*sp - 'A') + 10;
+       else if ((*sp >= '0') && (*sp <= '9'))
+               bp[i] |= (int) (*sp - '0');
+       else
+               return(-1);
+
+       bp[i] <<= 4;
+       sp++;
+       *sp = toupper(*sp);
+       
+       if ((*sp >= 'A') && (*sp <= 'F')) 
+               bp[i] |= (int) (*sp - 'A') + 10;
+       else if ((*sp >= '0') && (*sp <= '9'))
+               bp[i] |= (int) (*sp - '0');
+       else
+               return(-1);
+       
+       sp++;
+    }
+    if ((memcmp(sipx->sipx_node, "\0\0\0\0\0\0\0\0", IPX_NODE_LEN) == 0) ||
+        (memcmp(sipx->sipx_node, "\377\377\377\377\377\377", IPX_NODE_LEN) == 0))
+       return(-1);
+                             
+    return(0);
+}
+
+/* XXX define type which makes verbose format checks AF_input*/
+
+static int
+IPX_input(int type, char *bufp, struct sockaddr *sap)
+{
+  struct sockaddr_ipx  *sai=(struct sockaddr_ipx *)sap;
+  unsigned long netnum;
+  char *ep;
+  int nbo;
+  
+  sai->sipx_family = AF_IPX;
+  sai->sipx_network = htonl(0);
+  sai->sipx_node[0] = sai->sipx_node[1] = sai->sipx_node[2] = 
+  sai->sipx_node[3] = sai->sipx_node[4] = sai->sipx_node[5] = '\0';
+  sai->sipx_port = 0;
+   
+  if (type & 4)
+       nbo = 1;
+  else
+       nbo = 0;
+  
+  type &= 3;
+  if (type <= 1) {
+       netnum = strtoul(bufp,&ep,16);
+       if ((netnum == 0xffffffffL) || (netnum == 0L))
+               return(-1);
+       if (nbo)
+               sai->sipx_network = netnum;
+       else
+               sai->sipx_network = htonl(netnum);
+  }
+  if (type == 1) {
+       if (*ep != '\0')
+               return(-2);
+       return(0);
+  }
+  if (type == 0) {
+       if (*ep != ':')
+               return(-3);
+       bufp=ep+1;
+  }
+  return(IPX_getsock(bufp,sap));
+}
+
+
+struct aftype ipx_aftype = {
+  "ipx",       NULL, /*"IPX",*/                AF_IPX, 0,
+  IPX_print,   IPX_sprint,             IPX_input,              NULL,
+  NULL/*IPX_rprint*/
+};
+
+#endif
diff --git a/lib/ipx_gr.c b/lib/ipx_gr.c
new file mode 100644 (file)
index 0000000..91110df
--- /dev/null
@@ -0,0 +1,78 @@
+/* support for ap->rresolv missing */
+
+#include "config.h"
+
+#if HAVE_AFIPX
+#include <asm/types.h>
+#include <sys/types.h>
+#include <sys/socket.h>
+#include "ipx.h"
+#include <stdlib.h>
+#include <stdio.h>
+#include <errno.h>
+#include <ctype.h>
+#include <string.h>
+#include <unistd.h>
+#include <netinet/in.h>
+#include "version.h"
+#include "net-support.h"
+#include "pathnames.h"
+#define  EXTERN
+#include "net-locale.h"
+
+/* UGLY */
+
+int IPX_rprint(int options)
+{
+  /* int ext = options & FLAG_EXT; */
+  int numeric = options & FLAG_NUM;
+  char buff[1024];
+  char net[128], router_net[128];
+  char router_node[128];
+  int num;
+  FILE *fp;
+  struct aftype *ap;
+  struct sockaddr sa;
+  
+  printf(NLS_CATGETS(catfd, ipxSet, ipx_table, "Kernel IPX routing table\n")); /* xxx */
+
+  if ((ap = get_afntype(AF_IPX)) == NULL) {
+       EINTERN("lib/ipx_rt.c","AF_IPX missing");
+       return(-1);
+  }
+
+  printf(NLS_CATGETS(catfd, ipxSet, ipx_header1,
+               "Destination               Router Net                Router Node\n"));
+
+  if ((fp = fopen(_PATH_PROCNET_IPX_ROUTE, "r")) == NULL) {
+       perror(_PATH_PROCNET_IPX_ROUTE);
+       return(-1);
+  }
+
+  fgets(buff, 1023, fp);
+  
+  while (fgets(buff, 1023, fp))
+  {
+       num = sscanf(buff, "%s %s %s",net,router_net,router_node);
+       if (num < 3) continue;
+       
+       /* Fetch and resolve the Destination */
+       (void)ap->input(5,net,&sa);
+       strcpy(net, ap->sprint(&sa, numeric));
+
+       /* Fetch and resolve the Router Net */
+       (void)ap->input(5,router_net,&sa);
+       strcpy(router_net, ap->sprint(&sa, numeric));
+
+       /* Fetch and resolve the Router Node */
+       (void)ap->input(2,router_node,&sa);
+       strcpy(router_node, ap->sprint(&sa, numeric));
+
+       printf("%-25s %-25s %-25s\n",net, router_net, router_node);
+  }
+
+  (void) fclose(fp);
+  return(0);
+}
+
+#endif /* HAVE_AFIPX */
diff --git a/lib/ipx_sr.c b/lib/ipx_sr.c
new file mode 100644 (file)
index 0000000..dc458e4
--- /dev/null
@@ -0,0 +1,46 @@
+#include "config.h"
+
+#if HAVE_AFIPX
+#include <sys/param.h>
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+#include <arpa/nameser.h>
+#include <sys/ioctl.h>
+#include <ctype.h>
+#include <errno.h>
+#include <netdb.h>
+#include <resolv.h>
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#include <unistd.h>
+#include "version.h"
+#include "net-support.h"
+#include "pathnames.h"
+#define  EXTERN
+#include "net-locale.h"
+
+#include "net-features.h"
+
+extern     struct aftype   ipx_aftype;
+
+/* static int skfd = -1; */
+
+/*
+static int usage(void)
+{
+  fprintf(stderr,"IPX usage\n");
+
+  return(E_USAGE);
+}
+*/
+
+int IPX_rinput(int action, int ext, char **args)
+{
+  
+  fprintf(stderr,"IPX: this needs to be written\n");
+  return(0);
+}
+#endif /* HAVE_AFIPX */
diff --git a/lib/loopback.c b/lib/loopback.c
new file mode 100644 (file)
index 0000000..ae2b04b
--- /dev/null
@@ -0,0 +1,69 @@
+/*
+ * lib/loopback.c      This file contains the general hardware types.
+ *
+ * Version:    @(#)loopback.c  1.10    10/07/93
+ *
+ * Author:     Fred N. van Kempen, <waltje@uwalt.nl.mugnet.org>
+ *             Copyright 1993 MicroWalt Corporation
+ *
+ *             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.
+ */
+#include "config.h"
+
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <net/if_arp.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <errno.h>
+#include <ctype.h>
+#include <string.h>
+#include <unistd.h>
+#include "net-support.h"
+#include "pathnames.h"
+#define  EXTERN
+#include "net-locale.h"
+
+
+/* Display an UNSPEC address. */
+static char *
+pr_unspec(unsigned char *ptr)
+{
+  static char buff[64];
+  char *pos;
+  unsigned int i;
+
+  pos = buff;
+  for(i = 0; i < sizeof(struct sockaddr); i++) {
+       pos += sprintf(pos, "%02X-", (*ptr++ & 0377));
+  }
+  buff[strlen(buff) - 1] = '\0';
+  return(buff);
+}
+
+
+/* Display an UNSPEC socket address. */
+static char *
+pr_sunspec(struct sockaddr *sap)
+{
+  static char buf[64];
+
+  if (sap->sa_family == 0xFFFF || sap->sa_family == 0)
+    return(NLS_CATBUFF (catfd, loopbackSet, loopback_none, "[NONE SET]", buf, 64));
+  return(pr_unspec(sap->sa_data));
+}
+
+
+struct hwtype unspec_hwtype = {
+  "unspec",    NULL, /*"UNSPEC",*/             -1,             0,
+  pr_unspec,   pr_sunspec,             NULL,           NULL
+};
+
+struct hwtype loop_hwtype = {
+  "loop",      NULL, /*"Local Loopback",*/     255/*ARPHRD_LOOPBACK*/, 0,
+  NULL,                NULL,                   NULL,           NULL
+};
diff --git a/lib/masq_info.c b/lib/masq_info.c
new file mode 100644 (file)
index 0000000..477cbba
--- /dev/null
@@ -0,0 +1,223 @@
+/*
+ * lib/masq_info.c     This file contains a the functio masq_info
+ *                     to print a table of current masquerade connections.
+ *
+ * NET-LIB     A collection of functions used from the base set of the
+ *             NET-3 Networking Distribution for the LINUX operating
+ *             system. (net-tools, net-drivers)
+ *
+ * Version:    lib/masq_info.c 0.02 (1996-02-18)
+ *
+ * Author:     Bernd 'eckes' Eckenfels <net-tools@lina.inka.de>
+ *             Copyright 1999 Bernd Eckenfels, Germany
+ *
+ * Modifications:
+ *
+ *960217 {0.01} Bernd Eckenfels:       creatin from the code of
+ *                                     Jos Vos' ipfwadm 2.0beta1
+ *950218 {0.02} Bernd Eckenfels:       <linux/if.h> added
+ *
+ *             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.
+ */
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+#include <errno.h>
+#include <stdio.h>
+#include <malloc.h>
+#include <string.h>
+#include <unistd.h>
+#if 0
+#include <linux/ip.h>
+#include <linux/icmp.h>
+#include <linux/tcp.h>
+#include <linux/udp.h>
+#include <linux/if.h>
+#include <linux/ip_fw.h>
+#endif
+#include "net-support.h"
+#include "pathnames.h"
+#include "version.h"
+#include "config.h"
+#include "net-locale.h"
+
+#include "net-features.h"
+#if HAVE_FW_MASQUERADE
+
+
+struct masq {
+       unsigned long   expires;        /* Expiration timer */
+       char *          proto;          /* Which protocol are we talking? */
+       struct sockaddr_in src, dst;    /* Source and destination IP addresses */
+       unsigned short  sport, dport;   /* Source and destination ports */
+       unsigned short  mport;          /* Masqueraded port */
+       unsigned long   initseq;        /* Add delta from this seq. on */
+       short           delta;          /* Delta in sequence numbers */
+       short           pdelta;         /* Delta in sequence numbers before last */
+};
+
+static struct aftype   *ap;            /* current address family       */
+static int has_pdelta;
+
+static void
+print_masq(struct masq *ms, int numeric, int ext)
+{
+       unsigned long minutes, seconds, sec100s;
+
+       printf("%-4s", ms->proto);
+
+       sec100s = ms->expires % 100L;
+       seconds = (ms->expires / 100L) % 60;
+       minutes = ms->expires / 6000L;
+
+       printf("%3ld:%02ld.%02ld ", minutes, seconds, sec100s);
+
+       if (ext>1) {
+               if (has_pdelta)
+                       printf("%10lu %5hd %5hd ", ms->initseq,
+                               ms->delta, ms->pdelta);
+               else
+                       printf("%10lu %5hd     - ", ms->initseq,
+                               ms->delta);
+       }
+       printf("%-20s ", ap->sprint((struct sockaddr *)&(ms->src),numeric));
+       printf("%-20s ", ap->sprint((struct sockaddr *)&(ms->dst),numeric));
+
+       printf("%s -> ", get_sname(ms->sport, ms->proto, numeric));
+       printf("%s", get_sname(ms->dport, ms->proto, numeric));
+       printf(" (%s)\n", get_sname(ms->mport, ms->proto, numeric));
+}
+
+
+static int
+read_masqinfo(FILE *f, struct masq *mslist, int nmslist)
+{
+       int n, nread = 0;
+       struct masq *ms;
+       char buf[256];
+
+       for (nread = 0; nread < nmslist; nread++) {
+               ms = &mslist[nread];
+               if (has_pdelta) {
+                       if ((n = fscanf(f, " %s %lX:%hX %lX:%hX %hX %lX %hd %hd %lu", 
+                               buf,
+                               (unsigned long *) &ms->src.sin_addr.s_addr, &ms->sport,
+                               (unsigned long *) &ms->dst.sin_addr.s_addr, &ms->dport,
+                               &ms->mport, &ms->initseq, &ms->delta,
+                               &ms->pdelta, &ms->expires)) == -1)
+                               return nread;
+               } else {
+                       if ((n = fscanf(f, " %s %lX:%hX %lX:%hX %hX %lX %hd %lu", 
+                               buf,
+                               (unsigned long *) &ms->src.sin_addr.s_addr, &ms->sport,
+                               (unsigned long *) &ms->dst.sin_addr.s_addr, &ms->dport,
+                               &ms->mport, &ms->initseq, &ms->delta,
+                               &ms->expires)) == -1)
+                               return nread;
+               }       
+               if ((has_pdelta && (n !=10)) || (!has_pdelta && (n != 9))) {
+                       EINTERN("masq_info.c", "ip_masquerade format error");
+                       return(-1);
+               }
+               
+               ms->src.sin_family = AF_INET;
+               ms->dst.sin_family = AF_INET;
+         
+               if (strcmp("TCP", buf) == 0)
+                       ms->proto = "tcp";
+               else if (strcmp("UDP", buf) == 0)
+                       ms->proto = "udp";
+               else {
+                       EINTERN("masq_info.c", "ip_masquerade unknown type");
+                       return(-1);
+               }
+
+               /* we always keep these addresses in network byte order */
+               ms->src.sin_addr.s_addr = htonl(ms->src.sin_addr.s_addr);
+               ms->dst.sin_addr.s_addr = htonl(ms->dst.sin_addr.s_addr);
+               ms->sport = htons(ms->sport);
+               ms->dport = htons(ms->dport);
+               ms->mport = htons(ms->mport);
+       }
+       return nread;
+}
+
+
+int ip_masq_info(int numeric, int ext)
+{
+       FILE *f;
+       int i;
+       char buf[256];
+       struct masq *mslist;
+       int ntotal = 0, nread;
+
+       if(!(f=fopen(_PATH_PROCNET_IP_MASQ, "r")))
+       {
+               if (errno != ENOENT) {
+                       perror(_PATH_PROCNET_IP_MASQ);
+                       return(-1);
+               }
+               ESYSNOT("netstat","ip_masquerade");
+               return(1);
+       }
+       
+       if ((ap = get_aftype("inet")) == NULL) {
+               ENOSUPP("masq_info","AF INET");
+               fclose(f);
+               return(-1);
+       }
+       
+       fgets(buf, sizeof(buf), f);
+        has_pdelta = strstr(buf,"PDelta")?1:0;
+        
+       mslist = (struct masq *) malloc(16 * sizeof(struct masq));
+       if (!mslist) {
+               EINTERN("masq_info","malloc() failed");
+               fclose(f);
+               return(-1);
+       }
+       while ((nread = read_masqinfo(f, &(mslist[ntotal]), 16)) == 16) {
+               ntotal += nread;
+               mslist = (struct masq *) realloc(mslist,
+                       (ntotal + 16) * sizeof(struct masq));
+               if (!mslist) {
+                       EINTERN("masq_info","realloc() failed");
+                       fclose(f);
+                       return(-1);
+               }
+                       
+       }
+       fclose(f);
+       
+       if (nread < 0) {
+               if (mslist)
+                       free(mslist);
+               return(-1);
+       }
+       
+       ntotal += nread;
+
+       if (ntotal > 0) {
+               printf(NLS_CATGETS(catfd, libSet, lib_masq, "IP masquerading entries\n"));
+               switch(ext) {
+                       case 1:
+                               printf(NLS_CATGETS(catfd, libSet, lib_masq_tit1, "prot   expire source               destination          ports\n"));
+                               break;
+                       default:
+                               printf(NLS_CATGETS(catfd, libSet, lib_masq_tit2, "prot   expire    initseq delta prevd source               destination          ports\n"));
+                               break;
+               }
+               for (i = 0; i < ntotal; i++)
+                       print_masq(&(mslist[i]), numeric, ext);
+               if (mslist)
+                       free(mslist);
+
+       }
+       return 0;
+}
+#endif
diff --git a/lib/net-features.h b/lib/net-features.h
new file mode 100644 (file)
index 0000000..707633d
--- /dev/null
@@ -0,0 +1,264 @@
+/*
+ * lib/net-features.h  This file contains the definitions of all kernel
+ *                     dependend features.
+ *
+ * Version:    features.h 0.03 (1996-03-22)
+ *
+ * Author:     Bernd Eckenfels <net-tools@lina.inka.de>
+ *             Copyright 1996 Bernd Eckenfels, Germany
+ *
+ * Modifications:
+ *960201 {0.01}        Bernd Eckenfels:        creation
+ *960202 {0.02}        Bernd Eckenfels:        HW and AF added
+ *960322 {0.03}        Bernd Eckenfels:        moved into the NET-LIB
+ *
+ *             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 needs to be included AFTER the KErnel Header Files
+ *     one of the FEATURE_ should be defined to get the Feature Variable
+ *     definition included
+ */
+#ifndef _NET_FEATURES_H
+#define _NET_FEATURES_H
+
+/* detect the present features */
+
+#ifdef OLD_SIOCSARP /* arp */
+#  define HAVE_NEW_SIOCSARP 1
+#endif
+
+#if defined (SIOCADDRTOLD) || defined (RTF_IRTT) /* route */
+#  define HAVE_NEW_ADDRT 1
+#endif
+
+#ifdef RTF_IRTT /* route */
+#  define HAVE_RTF_IRTT 1
+#endif
+
+#ifdef RTF_REJECT /* route */
+#  define HAVE_RTF_REJECT 1
+#endif
+
+#ifdef RTMSG_NEWROUTE /* netstat */
+#  define HAVE_RT_NETLINK 1
+#endif
+
+/* compos the feature information string */
+
+#if defined (FEATURE_ARP) || defined (FEATURE_ROUTE) || defined (FEATURE_NETSTAT)
+static char *Features=
+
+/* ---------------------------------------------------- */
+#ifdef FEATURE_ARP
+
+#  if HAVE_NEW_SIOCSARP
+       "+"
+#  else 
+       "-"
+#  endif
+       "NEW_SIOCSARP "
+       
+#endif /* FEATURE_ARP */
+/* ---------------------------------------------------- */
+
+
+/* ---------------------------------------------------- */
+#ifdef FEATURE_ROUTE
+
+#  if HAVE_NEW_ADDRT
+       "+"
+#  else
+       "-"
+#  endif
+       "NEW_ADDRT "
+       
+#  if HAVE_RTF_IRTT
+       "+"
+#  else
+       "-"
+#  endif
+       "RTF_IRTT "
+
+#  if HAVE_RTF_REJECT
+       "+"
+#  else
+       "-"
+#  endif
+       "RTF_REJECT "
+
+#endif /* FEATURE_ROUTE */
+/* ---------------------------------------------------- */
+
+
+/* ---------------------------------------------------- */
+#ifdef FEATURE_NETSTAT
+
+#  if HAVE_NEW_ADDRT
+       "+"
+#  else
+       "-"
+#  endif
+       "NEW_ADDRT "
+       
+#  if HAVE_RTF_IRTT
+       "+"
+#  else
+       "-"
+#  endif
+       "RTF_IRTT "
+
+#  if HAVE_RTF_REJECT
+       "+"
+#  else
+       "-"
+#  endif
+       "RTF_REJECT "
+
+#  if HAVE_RT_NETLINK
+       "+"
+#  else
+       "-"
+#  endif
+       "RT_NETLINK "
+
+#  if HAVE_FW_MASQUERADE
+       "+"
+#  else 
+       "-"
+#  endif
+       "FW_MASQUERADE "
+
+#endif /* FEATURE_NETSTAT */
+/* ---------------------------------------------------- */
+
+
+#if NLS
+       "+NLS"
+#else
+       "-NLS"
+#endif /* NLS */
+
+
+"\nAF:"
+#ifdef DFLT_AF
+       "("DFLT_AF")"
+#endif
+
+#if HAVE_AFUNIX
+       " +"
+#else
+       " -"
+#endif
+       "UNIX "
+#if HAVE_AFINET
+       "+"
+#else
+       "-"
+#endif
+       "INET "
+#if HAVE_AFINET6
+       "+"
+#else
+       "-"
+#endif
+       "INET6 "
+#if HAVE_AFIPX
+       "+"
+#else
+       "-"
+#endif
+       "IPX "
+#if HAVE_AFAX25
+       "+"
+#else
+       "-"
+#endif
+       "AX25 "
+#if HAVE_AFNETROM 
+       "+" 
+#else
+       "-"
+#endif
+       "NETROM "
+#if HAVE_AFATALK
+       "+"
+#else
+       "-"
+#endif
+       "ATALK "
+
+"\nHW:"
+
+#ifdef DFLT_HW
+       "("DFLT_HW")"
+#endif
+
+#if HAVE_HWETHER
+       " +"
+#else
+       " -"
+#endif
+       "ETHER "
+#if HAVE_HWARC
+       "+"
+#else
+       "-"
+#endif
+       "ARC "
+#if HAVE_HWSLIP
+       "+"
+#else
+       "-"
+#endif
+       "SLIP "
+#if HAVE_HWPPP
+       "+"
+#else
+       "-"
+#endif
+       "PPP "
+#if HAVE_HWTUNNEL
+       "+"
+#else
+       "-"
+#endif
+       "TUNNEL "
+#if HAVE_HWTR
+       "+"
+#else
+       "-"
+#endif
+       "TR "
+#if HAVE_HWAX25
+       "+"
+#else
+       "-"
+#endif
+       "AX25 "
+       
+#if HAVE_HWNETROM
+       "+"
+#else
+       "-"
+#endif
+       "NETROM "
+
+#if HAVE_HWFR
+       "+"
+#else
+       "-"
+#endif
+       "FR ";
+
+
+#endif /* FEATURE_* */
+
+#endif /* _NET_FEATURES_H */
+/* End of features.h */
diff --git a/lib/net-locale.h b/lib/net-locale.h
new file mode 100644 (file)
index 0000000..e87911e
--- /dev/null
@@ -0,0 +1,52 @@
+/*
+ * lib/net-locale.h    Headerfile for the NLS functions
+ *
+ * NET-LIB     
+ *
+ * Version:    lib/net-locale.h 0.51 (1996-03-22)
+ *
+ * Author:     Bernd Eckenfels <net-tools@lina.inka.de>
+ *             Copyright 1995-1996 Bernd Eckebnfels, Germany
+ *
+ * Modifications:
+ *960125 {0.50}        Bernd Eckenfels:        included Header, reformated
+ *960322 {0.51}        Bernd Eckenfels:        moved into lib/
+ *
+ */
+#ifndef NET_LOCALE_H
+#define NET_LOCALE_H
+
+#if NLS
+#  include <locale.h>
+#  include <nl_types.h>
+
+#  ifndef EXTERN
+#    define EXTERN
+#  else
+#    undef EXTERN
+#    define EXTERN extern
+#  endif
+
+   EXTERN nl_catd catfd;
+
+   char *strsave (char *);
+   char *str_in_buff (char *, int, char *);
+
+#  define NLS_CATINIT catinit ();
+#  define NLS_CATCLOSE(catfd) catclose (catfd);
+#  define NLS_CATGETS(catfd, arg1, arg2, fmt) \
+       catgets ((catfd), (arg1), (arg2), (fmt))
+#  define NLS_CATSAVE(catfd, arg1, arg2, fmt) \
+       strsave (catgets ((catfd), (arg1), (arg2), (fmt)))
+#  define NLS_CATBUFF(catfd, arg1, arg2, fmt, buf, len) \
+       str_in_buff (buf, len, catgets ((catfd), (arg1), (arg2), (fmt)))
+#  include "nettools-nls.h"
+#else
+#  define NLS_CATINIT
+#  define NLS_CATCLOSE(catfd)
+#  define NLS_CATGETS(catfd, arg1, arg2, fmt) fmt
+#  define NLS_CATSAVE(catfd, arg1, arg2, fmt) fmt
+#  define NLS_CATBUFF(catfd, arg1, arg2, fmt, buf, len) strcpy (buf, fmt)
+#endif
+
+#endif /* NET_LOCALE_H */
diff --git a/lib/net-string.c b/lib/net-string.c
new file mode 100644 (file)
index 0000000..ed455b2
--- /dev/null
@@ -0,0 +1,83 @@
+/*-
+ * This file is part of a file of tcsh-6.05 used for the purpose of
+ * string handling. It is given ``as it is'' with its copyright.
+ *
+ * -----------------------------------------------------------------------
+ * Copyright (c) 1980, 1991 The Regents of the University of California.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ *    must display the following acknowledgement:
+ *     This product includes software developed by the University of
+ *     California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <strings.h>
+#ifndef FREEBSD
+#include <malloc.h>
+#endif
+
+#ifdef xmalloc
+#undef xmalloc
+#endif
+#define xmalloc    malloc
+
+char   *
+strsave(s)
+    register const char *s;
+{
+    char   *n;
+    register char *p;
+
+    if (s == NULL)
+       s = (const char *) "";
+    for (p = (char *) s; *p++ != '\0';)
+       continue;
+    n = p = (char *) xmalloc((size_t)
+                            ((((const char *) p) - s) * sizeof(char)));
+    while ((*p++ = *s++) != '\0')
+       continue;
+    return (n);
+}
+
+
+char *str_in_buff (char *buff, int len, char *string)
+{
+  if (string)
+    if (strlen (string) >= len) /* does not include \0 */
+      {
+       strncpy (buff, string, len-1);
+       buff[len] = '\0';
+      }
+    else
+      strcpy (buff, string);
+  else
+    strcpy (buff, "");
+
+  return (buff);
+}
diff --git a/lib/net-support.h b/lib/net-support.h
new file mode 100644 (file)
index 0000000..3147da5
--- /dev/null
@@ -0,0 +1,150 @@
+/*
+ * lib/support.h       This file contains the definitions of what is in the
+ *                     support library.  Most of all, it defines structures
+ *                     for accessing support modules, and the function proto-
+ *                     types.
+ *
+ * NET-LIB     A collection of functions used from the base set of the
+ *             NET-3 Networking Distribution for the LINUX operating
+ *             system. (net-tools, net-drivers)
+ *
+ * Version:    lib/net-support.h 1.34 (1996-04-13)
+ *
+ * Maintainer: Bernd 'eckes' Eckenfels, <net-tools@lina.inka.de>
+ *
+ * Author:     Fred N. van Kempen, <waltje@uwalt.nl.mugnet.org>
+ *             Copyright 1993 MicroWalt Corporation
+ *
+ * Modifications:
+ *960125 {1.20}        Bernd Eckenfels:        reformated, layout
+ *960202 {1.30} Bernd Eckenfels:       rprint in aftype
+ *960206 {1.31} Bernd Eckenfels:       route_init
+ *960219 {1.32} Bernd Eckenfels:       type for ap->input()
+ *960322 {1.33} Bernd Eckenfels:       activate_ld and const in get_hwtype
+ *960413 {1.34} Bernd Eckenfels:       new RTACTION suport
+ *
+ *             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.
+ */
+#include <sys/socket.h>
+
+/* This structure defines protocol families and their handlers. */
+struct aftype {
+  char         *name;
+  char         *title;
+  int          af;
+  int          alen;
+  char         *(*print)       (unsigned char *);
+  char         *(*sprint)      (struct sockaddr *, int numeric);
+  int          (*input)        (int type, char *bufp, struct sockaddr *);
+  void         (*herror)       (char *text);
+  int          (*rprint)       (int options);
+  int          (*rinput)       (int typ, int ext, char **argv);
+};
+
+
+/* This structure defines hardware protocols and their handlers. */
+struct hwtype {
+  char         *name;
+  char         *title;
+  int          type;
+  int          alen;
+  char         *(*print)       (unsigned char *);
+  char         *(*sprint)      (struct sockaddr *);
+  int          (*input)        (char *, struct sockaddr *);
+  int          (*activate)     (int fd);
+};
+
+
+extern struct hwtype   *get_hwtype(const char *name);
+extern struct hwtype   *get_hwntype(int type);
+extern struct aftype   *get_aftype(const char *name);
+extern struct aftype   *get_afntype(int type);
+
+extern int             getargs(char *string, char *arguments[]);
+
+extern void            getroute_init(void);
+extern void            setroute_init(void);
+extern void            activate_init(void);
+extern int             route_info(const char *afname, int flags);
+extern int             route_edit(int action, const char *afname, int flags, char **argv);
+extern int             activate_ld(const char *hwname, int fd);
+
+#define RTACTION_ADD   1
+#define RTACTION_DEL   2
+#define RTACTION_HELP  3
+#define RTACTION_FLUSH 4
+#define RTACTION_SHOW  5
+
+#define FLAG_EXT      3 /* AND-Mask */
+#define FLAG_NUM      4
+#define FLAG_SYM      8
+#define FLAG_CACHE   16
+#define FLAG_FIB     32
+#define FLAG_VERBOSE 64
+         
+extern int             ip_masq_info(int numeric, int ext);
+
+extern int     INET_rprint(int options);
+extern int     INET6_rprint(int options);
+extern int     DDP_rprint(int options);
+extern int     IPX_rprint(int options);
+extern int     NETROM_rprint(int options);
+extern int     AX25_rprint(int options);
+
+extern int     INET_rinput(int action, int flags, char **argv);
+extern int     INET6_rinput(int action, int flags, char **argv);
+extern int     DDP_rinput(int action, int flags, char **argv);
+extern int     IPX_rinput(int action, int flags, char **argv);
+extern int     NETROM_rinput(int action, int flags, char **argv);
+extern int     AX25_rinput(int action, int flags, char **argv);
+
+int    aftrans_opt     (const char *arg);
+void   aftrans_def     (char *tool, char *argv0, char *dflt);
+
+char * get_sname(int socknumber, char *proto, int numeric);
+
+extern int flag_unx;
+extern int flag_ipx;
+extern int flag_ax25;
+extern int flag_ddp;
+extern int flag_netrom;
+extern int flag_inet;
+extern int flag_inet6;
+
+extern char afname[];
+
+#define AFTRANS_OPTS \
+       {"ax25",        0,      0,      1}, \
+       {"ip",          0,      0,      1}, \
+       {"ipx",         0,      0,      1}, \
+       {"appletalk",   0,      0,      1}, \
+       {"netrom",      0,      0,      1}, \
+       {"inet",        0,      0,      1}, \
+       {"ddp",         0,      0,      1}, \
+       {"unix",        0,      0,      1}, \
+       {"tcpip",       0,      0,      1}
+#define AFTRANS_CNT 9
+
+#define EINTERN(file, text) fprintf(stderr, \
+       "%s: Internal Error `%s'.\n",file,text);
+
+#define ENOSUPP(A,B)   fprintf(stderr, NLS_CATGETS(catfd, libSet, lib_nofeature, \
+                               "%s: feature `%s' not supported.\nPlease recompile `net-tools' with newer kernel source or full configuration.\n"),A,B)
+
+#define ESYSNOT(A,B)   fprintf(stderr, NLS_CATGETS(catfd, libSet, lib_sysnot, \
+                               "%s: no support for `%s' on this system.\n"),A,B)
+
+#define E_NOTFOUND     8
+#define E_SOCK         7
+#define E_LOOKUP       6
+#define E_VERSION      5
+#define E_USAGE                4
+#define E_OPTERR       3
+#define E_INTERN       2
+#define E_NOSUPP       1
+
+/* End of lib/support.h */
diff --git a/lib/netrom.c b/lib/netrom.c
new file mode 100644 (file)
index 0000000..aaac576
--- /dev/null
@@ -0,0 +1,199 @@
+/*
+ * lib/netrom.c        This file contains an implementation of the "NET/ROM"
+ *             support functions for the NET-2 base distribution.
+ *
+ * Version:    @(#)netrom.c    1.20    12/16/93
+ *
+ * NOTE:       I will redo this module as soon as I got the libax25.a
+ *             library sorted out.  This library contains some useful
+ *             and often used address conversion functions, database
+ *             lookup stuff, and more of the like.
+ *
+ * Author:     Fred N. van Kempen, <waltje@uwalt.nl.mugnet.org>
+ *             Copyright 1993 MicroWalt Corporation
+ *
+ *             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.
+ */
+#include "config.h"
+
+#if HAVE_AFNETROM || HAVE_HWNETROM
+#include <sys/types.h>
+#include <sys/ioctl.h>
+#include <sys/socket.h>
+#include <net/if_arp.h>
+#include <linux/ax25.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <ctype.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <string.h>
+#include <termios.h>
+#include <unistd.h>
+#include "net-support.h"
+#include "pathnames.h"
+#define EXTERN
+#include "net-locale.h"
+
+static char netrom_errmsg[128];
+
+
+extern struct aftype netrom_aftype;
+
+
+static char *
+NETROM_print(unsigned char *ptr)
+{
+  static char buff[8];
+  int i;
+
+  for (i = 0; i < 6; i++) {
+       buff[i] = ((ptr[i] & 0377) >> 1);
+       if (buff[i] == ' ') buff[i] = '\0';
+  }
+  buff[6] = '\0';
+  i = ((ptr[6] & 0x1E) >> 1);
+  if (i != 0) sprintf(&buff[strlen(buff)], "-%d", i);
+  return(buff);
+}
+
+
+/* Display an AX.25 socket address. */
+static char *
+NETROM_sprint(struct sockaddr *sap, int numeric)
+{
+  char buf[64];
+  if (sap->sa_family == 0xFFFF || sap->sa_family == 0) 
+    return(NLS_CATBUFF (catfd, netromSet, netrom_none, "[NONE SET]", buf, 64));
+  return(NETROM_print(((struct sockaddr_ax25 *)sap)->sax25_call.ax25_call));
+}
+
+
+static int
+NETROM_input(int type, char *bufp, struct sockaddr *sap)
+{
+  unsigned char *ptr;
+  char *orig, c;
+  unsigned int i;
+
+  sap->sa_family = netrom_aftype.af;
+  ptr = ((struct sockaddr_ax25 *)sap)->sax25_call.ax25_call;
+
+  /* First, scan and convert the basic callsign. */
+  orig = bufp;
+  i = 0;
+  while((*bufp != '\0') && (*bufp != '-') && (i < 6)) {
+       c = *bufp++;
+       if (islower(c)) c = toupper(c);
+       if (! (isupper(c) || isdigit(c))) {
+               strcpy(netrom_errmsg, NLS_CATGETS (catfd, netromSet, netrom_debug1, "Invalid callsign"));
+#ifdef DEBUG
+               fprintf(stderr, "netrom_input(%s): %s !\n", netrom_errmsg, orig);
+#endif
+               errno = EINVAL;
+               return(-1);
+       }
+       *ptr++ = (unsigned char) ((c << 1) & 0xFE);
+       i++;
+  }
+
+  /* Callsign too long? */
+  if ((i == 6) && (*bufp != '-') && (*bufp != '\0')) {
+       strcpy(netrom_errmsg, NLS_CATGETS (catfd, netromSet, netrom_debug2, "Callsign too long"));
+#ifdef DEBUG
+       fprintf(stderr, "netrom_input(%s): %s !\n", netrom_errmsg, orig);
+#endif
+       errno = E2BIG;
+       return(-1);
+  }
+
+  /* Nope, fill out the address bytes with blanks. */
+  while (i++ < sizeof(ax25_address)-1) {
+       *ptr++ = (unsigned char) ((' ' << 1) & 0xFE);
+  }
+
+  /* See if we need to add an SSID field. */
+  if (*bufp == '-') {
+       i = atoi(++bufp);
+       *ptr = (unsigned char) ((i << 1) & 0xFE);
+  } else {
+       *ptr = (unsigned char) '\0';
+  }
+
+  /* All done. */
+#ifdef DEBUG
+  fprintf(stderr, "netrom_input(%s): ", orig);
+  for (i = 0; i < sizeof(ax25_address); i++)
+       fprintf(stderr, "%02X ", sap->sa_data[i] & 0377);
+  fprintf(stderr, "\n");
+#endif
+
+  return(0);
+}
+
+
+/* Display an error message. */
+static void
+NETROM_herror(char *text)
+{
+  if (text == NULL) fprintf(stderr, "%s\n", netrom_errmsg);
+    else fprintf(stderr, "%s: %s\n", text, netrom_errmsg);
+}
+
+
+static char *
+NETROM_hprint(struct sockaddr *sap)
+{
+  if (sap->sa_family == 0xFFFF || sap->sa_family == 0) return("[NONE SET]");
+  return(NETROM_print(((struct sockaddr_ax25 *)sap)->sax25_call.ax25_call));
+}
+
+
+static int
+NETROM_hinput(char *bufp, struct sockaddr *sap)
+{
+  if (NETROM_input(0, bufp, sap) < 0) return(-1);
+  sap->sa_family = ARPHRD_NETROM;
+  return(0);
+}
+
+#if 0
+/* Set the line discipline of a terminal line. */
+static int
+KISS_set_disc(int fd, int disc)
+{
+  if (ioctl(fd, TIOCSETD, &disc) < 0) {
+       fprintf(stderr, "KISS_set_disc(%d): %s\n", disc, strerror(errno));
+       return(-errno);
+  }
+  return(0);
+}
+
+
+/* Start the KISS encapsulation on the file descriptor. */
+static int
+KISS_init(int fd)
+{
+  if (KISS_set_disc(fd, N_SLIP) < 0) return(-1);
+  if (ioctl(fd, SIOCSIFENCAP, 4) <0) return(-1);
+  return(0);
+}
+#endif
+
+struct hwtype netrom_hwtype = {
+  "netrom",    "AMPR NET/ROM",         ARPHRD_NETROM,  7,
+  NETROM_print,        NETROM_hprint,          NETROM_hinput,  NULL
+};
+
+struct aftype netrom_aftype = {
+  "netrom",    "AMPR NET/ROM",         AF_NETROM,      7,
+  NETROM_print,        NETROM_sprint,          NETROM_input,   NETROM_herror,  
+  NULL/*NETROM_rprint*/
+};
+
+
+#endif /* HAVE_AFNETROM */
diff --git a/lib/netrom_gr.c b/lib/netrom_gr.c
new file mode 100644 (file)
index 0000000..f9cb3f5
--- /dev/null
@@ -0,0 +1,75 @@
+/*
+ * lib/netrom_gr.c     This file contains an implementation of the NET/ROM
+ *                     route support functions.
+ *
+ * Version:    lib/netrom_gr.c 0.01 (1996-02-15)
+ *
+ * Author:     Bernd Eckenfels, <ecki@lina.inka.de>
+ *             Copyright 1999 Bernd Eckenfels, Germany
+ *             base on Code from Jonathan Naylor <jsn@Cs.Nott.AC.UK>
+ *
+ *             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.
+ */
+#include "config.h"
+
+#if HAVE_AFNETROM
+#include <stdlib.h>
+#include <stdio.h>
+#include <unistd.h>
+#include "net-support.h"
+#include "pathnames.h"
+#define  EXTERN
+#include "net-locale.h"
+
+/* UGLY */
+
+int NETROM_rprint(int options)
+{
+       FILE *f1=fopen(_PATH_PROCNET_NR_NODES, "r");
+       FILE *f2=fopen(_PATH_PROCNET_NR_NEIGH, "r");
+       char buffer[256];
+       int qual,n,w;
+       /*int ext = options & FLAG_EXT;
+       int numeric = options & FLAG_NUM;*/
+
+       if(f1==NULL||f2==NULL)
+       {
+               printf(NLS_CATGETS(catfd, netstatSet, netstat_nonetrom, "NET/ROM not configured in this system.\n")); /* xxx */
+               return 1;
+       }
+       printf(NLS_CATGETS(catfd, netstatSet, netstat_netrom, "Kernel NET/ROM routing table\n")); /* xxx */
+       printf(NLS_CATGETS(catfd, netstatSet, netstat_header_netrom, "Destination  Mnemonic  Quality  Neighbour  Iface\n")); /* xxx */
+       fgets(buffer,256,f1);
+       while(fgets(buffer,256,f1))
+       {
+               buffer[9]=0;
+               buffer[17]=0;
+               w=atoi(buffer+19)-1;
+               printf("%-9s    %-7s   ",
+                       buffer,buffer+10);
+               qual=atoi(buffer+24+15*w);
+               n=atoi(buffer+32+15*w);
+               rewind(f2);
+               fgets(buffer,256,f2);
+               while(fgets(buffer,256,f2))
+               {
+                       if(atoi(buffer)==n)
+                       {
+                               buffer[15]=0;
+                               buffer[20]=0;
+                               printf("%3d      %-9s  %s\n",
+                                       qual,buffer+6,buffer+16);
+                               break;
+                       }
+               }
+       }
+       fclose(f1);
+       fclose(f2);
+       return 0;
+}
+
+#endif /* HAVE_AFNETROM */
diff --git a/lib/netrom_sr.c b/lib/netrom_sr.c
new file mode 100644 (file)
index 0000000..3bdf0f9
--- /dev/null
@@ -0,0 +1,46 @@
+#include "config.h"
+
+#if HAVE_AFNETROM
+#include <sys/param.h>
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+#include <arpa/nameser.h>
+#include <net/route.h>
+#include <sys/ioctl.h>
+#include <ctype.h>
+#include <errno.h>
+#include <netdb.h>
+#include <resolv.h>
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#include <unistd.h>
+#include "version.h"
+#include "net-support.h"
+#include "pathnames.h"
+#define  EXTERN
+#include "net-locale.h"
+
+#include "net-features.h"
+
+extern     struct aftype   netrom_aftype;
+
+/* static int skfd = -1; */
+
+static int usage(void)
+{
+  fprintf(stderr,"netrom usage\n");
+
+  return(E_USAGE);
+}
+
+
+int NETROM_rinput(int action, int ext, char **args)
+{
+  
+  fprintf(stderr,"NET/ROM: this needs to be written\n");
+  return(0);
+}
+#endif /* HAVE_AFNETROM */
diff --git a/lib/pathnames.h b/lib/pathnames.h
new file mode 100644 (file)
index 0000000..2c56026
--- /dev/null
@@ -0,0 +1,45 @@
+/*
+ * lib/pathnames.h     This file contains the definitions of the path 
+ *                     names used by the NET-LIB.
+ *
+ * NET-LIB     
+ *
+ * Version:    lib/pathnames.h 1.37 (1997-08-23)
+ *
+ * Author:     Fred N. van Kempen, <waltje@uwalt.nl.mugnet.org>
+ */
+
+/* pathnames of the procfs files used by NET. */
+# define _PATH_PROCNET_TCP             "/proc/net/tcp"
+# define _PATH_PROCNET_TCP6            "/proc/net/tcp6"
+# define _PATH_PROCNET_UDP             "/proc/net/udp"
+# define _PATH_PROCNET_UDP6            "/proc/net/udp6"
+# define _PATH_PROCNET_RAW             "/proc/net/raw"
+# define _PATH_PROCNET_RAW6            "/proc/net/raw6"
+# define _PATH_PROCNET_UNIX            "/proc/net/unix"
+# define _PATH_PROCNET_ROUTE           "/proc/net/route"
+# define _PATH_PROCNET_ROUTE6          "/proc/net/ipv6_route"
+# define _PATH_PROCNET_RTCACHE         "/proc/net/rt_cache"
+# define _PATH_PROCNET_AX25_ROUTE      "/proc/net/ax25_route"
+# define _PATH_PROCNET_NR              "/proc/net/nr"
+# define _PATH_PROCNET_NR_NEIGH                "/proc/net/nr_neigh"
+# define _PATH_PROCNET_NR_NODES                "/proc/net/nr_nodes"
+# define _PATH_PROCNET_ARP             "/proc/net/arp"
+# define _PATH_PROCNET_AX25            "/proc/net/ax25"
+# define _PATH_PROCNET_IPX             "/proc/net/ipx"
+# define _PATH_PROCNET_IPX_ROUTE       "/proc/net/ipx_route"
+# define _PATH_PROCNET_ATALK           "/proc/net/appletalk"
+# define _PATH_PROCNET_IP_BLK          "/proc/net/ip_block"
+# define _PATH_PROCNET_IP_FWD          "/proc/net/ip_forward"
+# define _PATH_PROCNET_IP_ACC          "/proc/net/ip_acct"
+# define _PATH_PROCNET_IP_MASQ         "/proc/net/ip_masquerade"
+# define _PATH_PROCNET_NDISC           "/proc/net/ndisc"
+# define _PATH_PROCNET_IFINET6         "/proc/net/if_inet6"
+# define _PATH_PROCNET_DEV             "/proc/net/dev"
+# define _PATH_PROCNET_RARP            "/proc/net/rarp"
+# define _PATH_ETHERS                  "/etc/ethers"
+
+/* pathname for the netlink device */
+# define _PATH_DEV_ROUTE       "/dev/route"
+
+/* End of pathnames.h */
diff --git a/lib/ppp.c b/lib/ppp.c
new file mode 100644 (file)
index 0000000..89783ea
--- /dev/null
+++ b/lib/ppp.c
@@ -0,0 +1,57 @@
+/*
+ * lib/ppp.c   This file contains the SLIP support for the NET-2 base
+ *             distribution.
+ *
+ * Version:    @(#)slip.c      1.10    10/07/93
+ *
+ * Author:     Fred N. van Kempen, <waltje@uwalt.nl.mugnet.org>
+ *             Copyright 1993 MicroWalt Corporation
+ *
+ *             Modified by Alan Cox, May 94 to cover NET-3
+ *
+ *             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.
+ */
+#include "config.h"
+
+#if HAVE_HWPPP
+
+#include <sys/types.h>
+#include <sys/ioctl.h>
+#include <sys/socket.h>
+#include <net/if_arp.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <ctype.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <string.h>
+#include <termios.h>
+#include <unistd.h>
+#include "net-support.h"
+#include "pathnames.h"
+#define  EXTERN
+#include "net-locale.h"
+
+
+/* Start the PPP encapsulation on the file descriptor. */
+static int
+do_ppp(int fd)
+{
+       fprintf(stderr,NLS_CATGETS(catfd, pppSet, ppp_cant_start, "You cannot start PPP with this program.\n"));
+        return -1;
+}
+
+
+
+
+struct hwtype ppp_hwtype = {
+  "ppp",       NULL, /*"Point-Point Protocol",*/               ARPHRD_PPP,     0,
+  NULL,                NULL,           NULL,           do_ppp
+};
+
+
+#endif /* HAVE_PPP */
diff --git a/lib/ppp_ac.c b/lib/ppp_ac.c
new file mode 100644 (file)
index 0000000..e2bb2d3
--- /dev/null
@@ -0,0 +1,44 @@
+/*
+ * lib/ppp_ac.c        This file contains the activation for the
+ *             PPP line disciplines, called from activate_ld().
+ *
+ * Version:    ppp_ac.c 0.01 (1996-03-22)
+ *
+ * Author:     Bernd 'eckes' Eckenfels
+ *
+ *             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.
+ */
+#include "config.h"
+
+#if HAVE_HWPPP
+
+#include <sys/types.h>
+#include <sys/ioctl.h>
+#include <sys/socket.h>
+#include <net/if_arp.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <ctype.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <string.h>
+#include <termios.h>
+#include <unistd.h>
+#include "net-support.h"
+#include "pathnames.h"
+#define  EXTERN
+#include "net-locale.h"
+
+
+/* Start the VJ-SLIP encapsulation on the file descriptor. */
+int PPP_activate(int fd)
+{
+  fprintf(stderr,"Sorry, use pppd!\n"); /* FIXME */
+  return(-1);
+}
+
+#endif /* HAVE_HWPPP */
diff --git a/lib/setroute.c b/lib/setroute.c
new file mode 100644 (file)
index 0000000..f55633f
--- /dev/null
@@ -0,0 +1,88 @@
+/*
+ * lib/setroute.c      This file contains a small interface function to
+ *                     use the AF specific input routine for the routing
+ *                     table.
+ *
+ * NET-LIB     A collection of functions used from the base set of the
+ *             NET-3 Networking Distribution for the LINUX operating
+ *             system. (net-tools, net-drivers)
+ *
+ * Version:    lib/setroute.c 0.02 (1996-04-13)
+ *
+ * Author:     Bernd 'eckes' Eckenfels <net-tools@lina.inka.de>
+ *             Copyright 1999 Bernd Eckenfels, Germany
+ *
+ * Modifications:
+ *
+ *960221 {0.01} Bernd Eckenfels:       generated from getroute.c
+ *960413 {0.02} Bernd Eckenfels:       new RTACTION support
+ *960809        Frank Strauss:          INET6
+ *
+ *             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.
+ */
+#include <stdio.h>
+#include <string.h>
+#include "net-support.h"
+#include "pathnames.h"
+#include "version.h"
+#include "config.h"
+#include "net-locale.h"
+
+extern struct aftype   unspec_aftype;
+extern struct aftype   unix_aftype;
+extern struct aftype   inet_aftype;
+extern struct aftype   inet6_aftype;
+extern struct aftype   ax25_aftype;
+extern struct aftype   netrom_aftype;
+extern struct aftype   ipx_aftype;
+extern struct aftype   ddp_aftype;
+
+void
+setroute_init(void)
+{
+#if HAVE_AFINET
+       inet_aftype.rinput = INET_rinput;
+#endif
+#if HAVE_AFINET6
+       inet6_aftype.rinput = INET6_rinput;
+#endif
+#if HAVE_AFNETROM
+       netrom_aftype.rinput = NETROM_rinput;
+#endif
+#if HAVE_AFIPX
+       ipx_aftype.rinput = IPX_rinput;
+#endif
+#if 0
+#if HAVE_AFAX25
+       ax25_aftype.rinput = AX25_rinput;
+#endif
+#if HAVE_AFATALK
+       ddp_aftype.rinput = DDP_rinput;
+#endif
+#endif
+}
+
+
+int
+route_edit(int action, const char *afname, int options, char **argv)
+{
+  struct aftype *ap;
+  
+  ap = get_aftype(afname);
+
+  if (!ap) {
+       fprintf(stderr,NLS_CATGETS(catfd, netstatSet, netstat_route_no_support, "Address family `%s' not supported.\n"),afname);
+       return(E_OPTERR);
+  }
+
+  if (!ap->rinput) {
+       fprintf(stderr,NLS_CATGETS(catfd, netstatSet, netstat_type_no_route, "No routing for address family `%s'.\n"),ap->name);
+       return(E_OPTERR);
+  }
+
+  return(ap->rinput(action, options, argv));
+}
diff --git a/lib/sit.c b/lib/sit.c
new file mode 100644 (file)
index 0000000..9194421
--- /dev/null
+++ b/lib/sit.c
@@ -0,0 +1,44 @@
+/*
+ * lib/sit.c   This file contains the SIT HW-type support.
+ *
+ * Version:    sit.c   0.01 (1996-08-08)
+ *
+ * Author:     Fred N. van Kempen, <waltje@uwalt.nl.mugnet.org>
+ *             Copyright 1993 MicroWalt Corporation
+ *
+ *             Based on slip.c, modified by Frank Strauss, Aug 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 of the License, or  (at
+ *             your option) any later version.
+ */
+#include "config.h"
+
+#if HAVE_HWSIT
+
+#include <sys/types.h>
+#include <sys/ioctl.h>
+#include <sys/socket.h>
+#include <net/if_arp.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <ctype.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <string.h>
+#include <termios.h>
+#include <unistd.h>
+#include "net-support.h"
+#include "pathnames.h"
+#define  EXTERN
+#include "net-locale.h"
+
+
+struct hwtype sit_hwtype = {
+  "sit",       NULL, /*"IPv6-in-IPv4",*/               ARPHRD_SIT,     0,
+  NULL,                NULL,           NULL,           NULL
+};
+
+#endif /* HAVE_HWSIT */
diff --git a/lib/slip.c b/lib/slip.c
new file mode 100644 (file)
index 0000000..8688475
--- /dev/null
@@ -0,0 +1,59 @@
+/*
+ * lib/slip.c  This file contains the SLIP HW-type support.
+ *
+ * Version:    slip.c  1.20 (1996-03-22)
+ *
+ * Author:     Fred N. van Kempen, <waltje@uwalt.nl.mugnet.org>
+ *             Copyright 1993 MicroWalt Corporation
+ *
+ *             Modified by Alan Cox, May 94 to cover NET-3
+ *
+ *             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.
+ */
+#include "config.h"
+
+#if HAVE_HWSLIP
+
+#include <sys/types.h>
+#include <sys/ioctl.h>
+#include <sys/socket.h>
+#include <net/if_arp.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <ctype.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <string.h>
+#include <termios.h>
+#include <unistd.h>
+#include "net-support.h"
+#include "pathnames.h"
+#define  EXTERN
+#include "net-locale.h"
+
+
+struct hwtype slip_hwtype = {
+  "slip",      NULL, /*"Serial Line IP",*/             ARPHRD_SLIP,    0,
+  NULL,                NULL,           NULL,           NULL
+};
+struct hwtype cslip_hwtype = {
+  "cslip",     NULL, /*"VJ Serial Line IP",*/          ARPHRD_CSLIP,   0,
+  NULL,                NULL,           NULL,           NULL
+};
+struct hwtype slip6_hwtype = {
+  "slip6",     NULL, /*"6-bit Serial Line IP",*/               ARPHRD_SLIP6,   0,
+  NULL,                NULL,           NULL,           NULL
+};
+struct hwtype cslip6_hwtype = {
+  "cslip6",    NULL, /*"VJ 6-bit Serial Line IP",*/    ARPHRD_CSLIP6,  0,
+  NULL,                NULL,           NULL,           NULL
+};
+struct hwtype adaptive_hwtype = {
+  "adaptive",  NULL, /*"Adaptive Serial Line IP",*/    ARPHRD_ADAPT,0,
+  NULL,                NULL,           NULL,           NULL
+};
+#endif /* HAVE_HWSLIP */
diff --git a/lib/slip_ac.c b/lib/slip_ac.c
new file mode 100644 (file)
index 0000000..586d282
--- /dev/null
@@ -0,0 +1,108 @@
+/*
+ * lib/slip_ac.c       This file contains the activation for the
+ *                     SLIP line disciplines, called from activate_ld().
+ *
+ * Version:    slip.c 0.11 (1996-03-22)
+ *
+ * Author:     Bernd 'eckes' Eckenfels
+ *             Fred N. van Kempen, <waltje@uwalt.nl.mugnet.org>
+ *             Copyright 1993 MicroWalt Corporation
+ *
+ *             Modified by Alan Cox, May 94 to cover NET-3
+ *
+ *             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.
+ */
+#include "config.h"
+
+#if HAVE_HWSLIP
+
+#include <sys/types.h>
+#include <sys/ioctl.h>
+#include <sys/socket.h>
+#include <net/if_arp.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <ctype.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <string.h>
+#include <termios.h>
+#include <unistd.h>
+#include "net-support.h"
+#include "pathnames.h"
+#define  EXTERN
+#include "net-locale.h"
+
+
+/* Set the line discipline of a terminal line. */
+static int
+SLIP_set_disc(int fd, int disc)
+{
+  if (ioctl(fd, TIOCSETD, &disc) < 0) {
+       fprintf(stderr, "SLIP_set_disc(%d): %s\n", disc, strerror(errno));
+       return(-errno);
+  }
+  return(0);
+}
+
+
+/* Set the encapsulation type of a terminal line. */
+static int
+SLIP_set_encap(int fd, int encap)
+{
+  if (ioctl(fd, SIOCSIFENCAP, &encap) < 0) {
+       fprintf(stderr, "SLIP_set_encap(%d): %s\n", encap, strerror(errno));
+       return(-errno);
+  }
+  return(0);
+}
+
+
+/* Start the SLIP encapsulation on the file descriptor. */
+int SLIP_activate(int fd)
+{
+  if (SLIP_set_disc(fd, N_SLIP) < 0) return(-1);
+  if (SLIP_set_encap(fd, 0) < 0) return(-1);
+  return(0);
+}
+
+
+/* Start the VJ-SLIP encapsulation on the file descriptor. */
+int CSLIP_activate(int fd)
+{
+  if (SLIP_set_disc(fd, N_SLIP) < 0) return(-1);
+  if (SLIP_set_encap(fd, 1) < 0) return(-1);
+  return(0);
+}
+
+
+/* Start the SLIP-6 encapsulation on the file descriptor. */
+int SLIP6_activate(int fd)
+{
+  if (SLIP_set_disc(fd, N_SLIP) < 0) return(-1);
+  if (SLIP_set_encap(fd, 2) < 0) return(-1);
+  return(0);
+}
+
+
+/* Start the VJ-SLIP-6 encapsulation on the file descriptor. */
+int CSLIP6_activate(int fd)
+{
+  if (SLIP_set_disc(fd, N_SLIP) < 0) return(-1);
+  if (SLIP_set_encap(fd, 3) < 0) return(-1);
+  return(0);
+}
+
+
+/* Start adaptive encapsulation on the file descriptor. */
+int ADAPTIVE_activate(int fd)
+{
+  if (SLIP_set_disc(fd, N_SLIP) < 0) return(-1);
+  if (SLIP_set_encap(fd, 8) < 0) return(-1);
+  return(0);
+}
+#endif /* HAVE_HWSLIP */
diff --git a/lib/tr.c b/lib/tr.c
new file mode 100644 (file)
index 0000000..2da8d8a
--- /dev/null
+++ b/lib/tr.c
@@ -0,0 +1,137 @@
+/*
+ * lib/tr.c    This file contains an implementation of the "Ethernet"
+ *             support functions for the NET-2 base distribution.
+ *
+ * Version:    @(#)tr.c        1.10    10/07/93
+ *
+ * Author:     Fred N. van Kempen, <waltje@uwalt.nl.mugnet.org>
+ *             Copyright 1993 MicroWalt Corporation
+ *
+ *             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.
+ */
+#include "config.h"
+
+#if HAVE_HWTR
+#include <asm/types.h>
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <net/if_arp.h>
+#include <linux/if_tr.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <errno.h>
+#include <ctype.h>
+#include <string.h>
+#include <unistd.h>
+#include "net-support.h"
+#include "pathnames.h"
+
+
+extern struct hwtype tr_hwtype;
+
+
+/* Display an Ethernet address in readable format. */
+static char *
+pr_tr(unsigned char *ptr)
+{
+  static char buff[64];
+
+  sprintf(buff, "%02X:%02X:%02X:%02X:%02X:%02X",
+       (ptr[0] & 0377), (ptr[1] & 0377), (ptr[2] & 0377),
+       (ptr[3] & 0377), (ptr[4] & 0377), (ptr[5] & 0377)
+  );
+  return(buff);
+}
+
+
+/* Display an Ethernet socket address. */
+static char *
+pr_str(struct sockaddr *sap)
+{
+  if (sap->sa_family == 0xFFFF || sap->sa_family == 0) return("[NONE SET]");
+  return(pr_tr(sap->sa_data));
+}
+
+
+/* Input an Ethernet address and convert to binary. */
+static int
+in_tr(char *bufp, struct sockaddr *sap)
+{
+  unsigned char *ptr;
+  char c, *orig;
+  int i, val;
+
+  sap->sa_family = tr_hwtype.type;
+  ptr = sap->sa_data;
+
+  i = 0;
+  orig = bufp;
+  while((*bufp != '\0') && (i < TR_ALEN)) {
+       val = 0;
+       c = *bufp++;
+       if (isdigit(c)) val = c - '0';
+         else if (c >= 'a' && c <= 'f') val = c - 'a' + 10;
+         else if (c >= 'A' && c <= 'F') val = c - 'A' + 10;
+         else {
+#ifdef DEBUG
+               fprintf(stderr, "in_tr(%s): invalid token ring address!\n", orig);
+#endif
+               errno = EINVAL;
+               return(-1);
+       }
+       val <<= 4;
+       c = *bufp++;
+       if (isdigit(c)) val |= c - '0';
+         else if (c >= 'a' && c <= 'f') val |= c - 'a' + 10;
+         else if (c >= 'A' && c <= 'F') val |= c - 'A' + 10;
+         else {
+#ifdef DEBUG
+               fprintf(stderr, "in_tr(%s): invalid token ring address!\n", orig);
+#endif
+               errno = EINVAL;
+               return(-1);
+       }
+       *ptr++ = (unsigned char) (val & 0377);
+       i++;
+
+       /* We might get a semicolon here - not required. */
+       if (*bufp == ':') {
+               if (i == TR_ALEN) {
+#ifdef DEBUG
+                       fprintf(stderr, "in_tr(%s): trailing : ignored!\n",
+                                                                       orig)
+#endif
+                                               ; /* nothing */
+               }
+               bufp++;
+       }
+  }
+
+  /* That's it.  Any trailing junk? */
+  if ((i == TR_ALEN) && (*bufp != '\0')) {
+#ifdef DEBUG
+       fprintf(stderr, "in_tr(%s): trailing junk!\n", orig);
+       errno = EINVAL;
+       return(-1);
+#endif
+  }
+
+#ifdef DEBUG
+  fprintf(stderr, "in_tr(%s): %s\n", orig, pr_tr(sap->sa_data));
+#endif
+
+  return(0);
+}
+
+
+struct hwtype tr_hwtype = {
+  "tr",        "16/4 Mbps TR",         ARPHRD_IEEE802, TR_ALEN,
+  pr_tr,       pr_str, in_tr,  NULL
+};
+
+
+#endif /* HAVE_HWTR */
diff --git a/lib/tunnel.c b/lib/tunnel.c
new file mode 100644 (file)
index 0000000..4867e4a
--- /dev/null
@@ -0,0 +1,54 @@
+/*
+ *     Tunnel.c, Alan Cox 1995.
+ *
+ */
+#include "config.h"
+
+#if HAVE_HWTUNNEL
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <net/if_arp.h>
+#include <linux/if_ether.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <errno.h>
+#include <ctype.h>
+#include <string.h>
+#include <unistd.h>
+#include "net-support.h"
+#include "pathnames.h"
+#define  EXTERN
+#include "net-locale.h"
+
+
+extern struct hwtype ether_hwtype;
+
+
+static char *
+pr_tunnel(unsigned char *ptr)
+{
+  return("");
+}
+
+
+static char *pr_stunnel(struct sockaddr *sap)
+{
+  return("");
+}
+
+
+static int
+in_tunnel(char *bufp, struct sockaddr *sap)
+{
+  return(-1);
+}
+
+
+struct hwtype tunnel_hwtype = {
+  "tunnel",    NULL, /*"IPIP Tunnel",*/        ARPHRD_TUNNEL,  0,
+  pr_tunnel,   pr_stunnel,     in_tunnel,      NULL
+};
+
+
+#endif /* HAVE_HWTUNNEL */
diff --git a/lib/unix.c b/lib/unix.c
new file mode 100644 (file)
index 0000000..9125114
--- /dev/null
@@ -0,0 +1,97 @@
+/*
+ * lib/unix.c  This file contains the general hardware types.
+ *
+ * Version:    @(#)unix.c      1.10    10/07/93
+ *
+ * Author:     Fred N. van Kempen, <waltje@uwalt.nl.mugnet.org>
+ *             Copyright 1993 MicroWalt Corporation
+ *
+ *             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.
+ */
+#include "config.h"
+
+#include <sys/types.h>
+#include <sys/socket.h>
+#if HAVE_AFUNIX
+#   include <sys/un.h>
+#endif
+#include <stdlib.h>
+#include <stdio.h>
+#include <errno.h>
+#include <ctype.h>
+#include <string.h>
+#include <unistd.h>
+#include "net-support.h"
+#include "pathnames.h"
+#define  EXTERN
+#include "net-locale.h"
+
+
+/* Display an UNSPEC address. */
+static char *
+UNSPEC_print(unsigned char *ptr)
+{
+  static char buff[64];
+  char *pos;
+  unsigned int i;
+
+  pos = buff;
+  for(i = 0; i < sizeof(struct sockaddr); i++) {
+       pos += sprintf(pos, "%02X-", (*ptr++ & 0377));
+  }
+  buff[strlen(buff) - 1] = '\0';
+  return(buff);
+}
+
+
+/* Display an UNSPEC socket address. */
+static char *
+UNSPEC_sprint(struct sockaddr *sap, int numeric)
+{
+  static char buf[64];
+
+  if (sap->sa_family == 0xFFFF || sap->sa_family == 0)
+    return(NLS_CATBUFF (catfd, unixSet, unix_none, "[NONE SET]", buf, 64));
+  return(UNSPEC_print(sap->sa_data));
+}
+
+
+#if HAVE_AFUNIX
+
+/* Display a UNIX domain address. */
+static char *
+UNIX_print(unsigned char *ptr)
+{
+  return(ptr);
+}
+
+
+/* Display a UNIX domain address. */
+static char *
+UNIX_sprint(struct sockaddr *sap, int numeric)
+{
+  static char buf[64];
+
+  if (sap->sa_family == 0xFFFF || sap->sa_family == 0)
+    return(NLS_CATBUFF (catfd, unixSet, unix_none, "[NONE SET]", buf, 64));
+  return(UNIX_print(sap->sa_data));
+}
+
+
+struct aftype unix_aftype = {
+  "unix",      NULL, /*"UNIX Domain",*/                AF_UNIX,        0,
+  UNIX_print,  UNIX_sprint,            NULL,           NULL,
+  NULL
+};
+#endif /* HAVE_AFUNIX */
+
+
+struct aftype unspec_aftype = {
+  "unspec",    NULL, /*"UNSPEC",*/             AF_UNSPEC,      0,
+  UNSPEC_print,        UNSPEC_sprint,          NULL,           NULL,   
+  NULL
+};
diff --git a/man/Makefile b/man/Makefile
new file mode 100644 (file)
index 0000000..f29d675
--- /dev/null
@@ -0,0 +1,31 @@
+#
+# man/Makefile man/ Makefile for the net-tools Package
+#
+# NET-TOOLS    A collection of programs that form the base set of the
+#              NET-3 Networking Distribution for the LINUX operating
+#              system.
+#
+# Version:     Makefile 0.01 (1996-03-22)
+#
+# Author:      Bernd Eckenfels <net-tools@lina.inka.de>
+#              Copyright 1995-1996 Bernd Eckebnfels, Germany
+#
+#960322        {0.01}  Bernd Eckenfels:        creation to make main Makefile cleaner
+#
+#      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.
+#
+
+
+all:
+
+clean:
+               rm -f DEADJOE *~ *.orig
+               rm -f */DEADJOE */*~ */*.orig
+
+clobber:       clean
+
+# End of man/Makefile.
diff --git a/man/en_US.88591/arp.8 b/man/en_US.88591/arp.8
new file mode 100644 (file)
index 0000000..b6dc42b
--- /dev/null
@@ -0,0 +1,168 @@
+.TH ARP 8 "15 May 1996" "net-tools" "Linux Programmer's Manual"
+.SH NAME
+arp \- manipulate the system ARP cache
+.SH SYNOPSIS
+.B arp 
+.RB [ \-vn ] 
+.RB [ "\-H type" ] 
+.RB [ "-i if" ] 
+.B -a 
+.RB [ hostname ]
+.PP
+.B arp 
+.RB [ \-v ]
+.RB [ "\-i if" ] 
+.B "\-d hostname"
+.RB [ pub ]
+.PP
+.B arp 
+.RB [ \-v ] 
+.RB [ "\-H type" ] 
+.RB [ "\-i if" ] 
+.B -s hostname hw_addr
+.RB [ temp ] 
+.PP
+.B arp 
+.RB [ \-v ] 
+.RB [ "\-H type" ] 
+.RB [ "\-i if" ] 
+.B -s hostname hw_addr
+.RB [ "netmask nm" ] 
+.B pub
+.PP
+.B arp 
+.RB [ \-v ] 
+.RB [ "\-H type" ] 
+.RB [ "\-i if" ] 
+.B -Ds hostname ifa
+.RB [ "netmask nm" ] 
+.B pub
+.PP
+.B arp 
+.RB [ \-vnD ]
+.RB [ "\-H type" ] 
+.RB [ "-i if" ]
+.B -f filename
+
+.SH DESCRIPTION
+.B Arp
+manipulates the kernel's ARP cache in various ways.  The primary options
+are clearing an address mapping entry and manually setting up one.  For
+debugging purposes, the
+.B arp
+program also allows a complete dump of the ARP cache.
+.SH OPTIONS
+.TP
+.B "\-v, \-\-verbose"
+Tell the user what is going on by being verbose.
+.TP
+.B "\-n, \-\-umeric"
+shows numerical addresses instead of trying to determine symbolic host, port
+or user names.
+.TP
+.B "\-H type, \-\-hw-type type"
+When setting or reading the ARP cache, this optional parameter tells
+.B arp
+which class of entries it should check for.  The default value of
+this parameter is
+.B ether
+(i.e. hardware code 0x01 for IEEE 802.3 10Mbps Ethernet).
+Other values might include network technologies such as
+.RB "ARCnet (" arcnet ")"
+,
+.RB "PROnet (" pronet ")"
+,
+.RB "AX.25 (" ax25 ")"
+and
+.RB "NET/ROM (" netrom ")."
+.TP
+.B "\-a [hostname], \-\-display [hostname]"
+Shows the entries of the specified hosts.  If the
+.B hostname
+parameter is not used,
+.B all
+entries will be displayed.
+.TP
+.B "\-d hostname, \-\-delete hostname"
+Remove any entry for the specified host.  This can be used if the
+indicated host is brought down, for example.
+.TP
+.B "\-D, \-\-use-device"
+Use the interface
+.BR ifa "'s"
+hardware address.
+.TP
+.B "\-i If, \-\-device If"
+Select an Interface. When dumping the ARP cache only entries matching the
+Interface will be printed. Setting a permanent or temp ARP entry will be
+used on the specified device. If no device is given, the kernels guess the
+device from the routing table. For
+.B pub
+entries the specified interface is the interface on which ARP requests will
+be answered. 
+.br
+.B NOTE:
+This has to be different from the interface to witch the IP
+Packages will be routed.
+.TP
+.B "\-s hostname hw_addr, \-\-set hostname"
+Manually create an ARP address mapping entry for host
+.B hostname
+with hardware address set to
+.B hw_addr
+.  The format of the hardware address is dependent on the hardware
+class, but for most classes one can assume that the usual presentation
+can be used.  For the Ethernet class, this is 6 bytes in hexadecimal,
+separated by colons. When adding proxy arp entries (that is those with
+the 
+.BR pub lish 
+flag set a 
+.B netmask 
+may be specified to proxy arp for
+entire subnets. Proxy arp for routing entire networks is not a good 
+protocol, but its sometimes useful so supported. If the 
+.B temp
+flag is not supplied entries will be permanent stored into the ARP cache.
+.TP
+.B "\-f filename, \-\-file filename"
+Similar to the
+.B \-s
+option, only this time the address info is taken from file
+.B filename
+.  This can be used if ARP entries for a lot of hosts have to be
+set up.  The name of the data file is very often
+.IR /etc/ethers , 
+but this is not official.
+.sp 1
+The format of the file is simple; it
+only contains ASCII text lines with a hostname, and a hardware
+address separated by whitespace. Additionally the 
+.BR "pub" , " temp" " and" " netmask"
+flags can be used.
+.LP
+In all places where a
+.B hostname
+is expected, one can also enter an
+.B "IP address"
+in dotted-decimal notation.
+.LP 
+Each complete entry in the ARP cache will be marked with the
+.B C
+flag. Permanent entries are marked with
+.B M
+and published entries have the
+.B P
+flag.
+.SH FILES
+.I /proc/net/arp,
+.br
+.I /etc/networks
+.br
+.I /etc/hosts
+.br
+.I /etc/ethers
+.SH SEE ALSO
+rarp(8), route(8), ifconfig(8), netstat(8)
+.SH AUTHORS
+Fred N. van Kempen, <waltje@uwalt.nl.mugnet.org> with a lot of improvements
+from net-tools Maintainer Bernd Eckenfels <net-tools@lina.inka.de>.
diff --git a/man/en_US.88591/dnsdomainname.1 b/man/en_US.88591/dnsdomainname.1
new file mode 100644 (file)
index 0000000..1f45128
--- /dev/null
@@ -0,0 +1 @@
+.so man1/hostname.1
diff --git a/man/en_US.88591/domainname.1 b/man/en_US.88591/domainname.1
new file mode 100644 (file)
index 0000000..1f45128
--- /dev/null
@@ -0,0 +1 @@
+.so man1/hostname.1
diff --git a/man/en_US.88591/ethers.5 b/man/en_US.88591/ethers.5
new file mode 100644 (file)
index 0000000..f3ba116
--- /dev/null
@@ -0,0 +1,31 @@
+.TH ETHERS 5 "April 26th, 1996" "" "File formats"
+.SH NAME \"{{{roff}}}\"{{{
+ethers \- Ethernet address to IP number database
+.\"}}}
+.SH DESCRIPTION \"{{{
+\fB/etc/ethers\fP contains 48 bit Ethernet addresses and their corresponding
+IP numbers, one line for each IP number:
+.sp
+.RS
+\fIEthernet-address\fP  \fIIP-number\fP
+.RE
+.sp
+The two items are separated by any number of SPACE and/or TAB char
+acters.   A \fB#\fP at the beginning of a line starts a comment
+which extends to the end of the line.  The \fIEthernet-address\fP is
+written as
+.IR x : x : x : x : x : x ,
+where \fIx\fP is a hexadecimal number between \fB0\fP and \fBff\fP
+which represents one byte of the address, which is in network byte
+order (big-endian).  The \fIIP-number\fP may be a hostname which
+can be resolved by DNS or a dot separated number.
+.\"}}}
+.SH EXAMPLES \"{{{
+08:00:20:00:61:CA  pal
+.\"}}}
+.SH FILES \"{{{
+/etc/ethers
+.\"}}}
+.SH "SEE ALSO" \"{{{
+rarp(8)
+.\"}}}
diff --git a/man/en_US.88591/hostname.1 b/man/en_US.88591/hostname.1
new file mode 100644 (file)
index 0000000..aee2da0
--- /dev/null
@@ -0,0 +1,188 @@
+.TH HOSTNAME 1 "28 Jan 1996" "net-tools" "Linux Programmer's Manual"
+
+.SH NAME
+hostname \- show or set the system's host name
+.br
+domainname \- show or set the system's NIS/YP domain name
+.br
+dnsdomainname \- show the system's DNS domain name
+.br
+nisdomainname \- show or set system's NIS/YP domain name
+.br
+ypdomainname \- show or set the system's NIS/YP domain name
+
+.SH SYNOPSIS
+.B hostname
+.RB [ \-v ]
+.RB [ \-a ]
+.RB [ \-\-alias ]
+.RB [ \-d ]
+.RB [ \-\-domain ]
+.RB [ \-f ]
+.RB [ \-\-fqdn ]
+.RB [ \-i ]
+.RB [ \-\-ip-address ]
+.RB [ \-\-long ]
+.RB [ \-s ]
+.RB [ \-\-short ]
+.RB [ \-y ]
+.RB [ \-\-yp ]
+.RB [ \-\-nis ]
+
+.PP
+.B hostname 
+.RB [ \-v ]
+.RB [ \-F\ filename ]
+.RB [ \-\-file\ filename ]
+.RB [ hostname ]
+
+.PP
+.B domainname
+.RB [ \-v ]
+.RB [ \-F\ filename ]
+.RB [ \-\-file\ filename ]
+.RB [ name ]
+
+.PP
+.B hostname
+.RB [ \-v ]
+.RB [ \-h ]
+.RB [ \-\-help ]
+.RB [ \-V ]
+.RB [ \-\-version ]
+
+.PP
+.B dnsdomainname
+.RB [ \-v ]
+.br
+.B nisdomainname
+.RB [ \-v ]
+.br
+.B ypdomainname
+.RB [ \-v ]
+
+.SH DESCRIPTION
+.B Hostname
+is the program that is used to either set or display
+the current host or domain name of the system.  This name is used
+by many of the networking programs to identify the machine. The domain 
+name is also used by NIS/YP.
+
+.SS "GET NAME"
+When called without any arguments, the program displays the current
+names:
+
+.LP
+.B hostname
+will print the name of the system as returned by the
+.BR gethostname (2)
+function.
+
+.LP
+.B "domainname, nisdomainname, ypdomainname"
+will print the name of the system as returned by the
+.BR getdomainname (2)
+function. This is also known as the YP/NIS domain name of the system.
+
+.LP
+.B dnsdomainname
+will print the domain part of the FQDN (Fully Qualified Domain Name). The
+complete FQDN of the system is returned with
+.BR "hostname \-\-fqdn" .
+
+.SS "SET NAME"
+When called with one argument or with the 
+.B \-\-file
+option, the commands set the host name or the NIS/YP domain name. 
+
+.LP
+Note, that only the super-user can change the names. 
+
+.LP
+It is not possible to set the FQDN or the DNS domain name with the 
+.B dnsdomainname 
+command (see 
+.B "THE FQDN"
+below).
+
+.LP
+The host name is usually set once at system startup in
+.I /etc/rc.d/rc.inet1
+or
+.I /etc/init.d/boot
+(normally by reading the contents of a file which contains
+the host name, e.g. 
+.IR /etc/hostname ).
+
+.SS THE FQDN
+You can't change the FQDN (as returned by 
+.BR "hostname \-\-fqdn" ) 
+or the DNS domain name (as returned by
+.BR "dnsdomainname" ) 
+with this command. The FQDN of the system is the name that the
+.BR resolver (3)
+returns for the host name. 
+
+.LP
+Technically: The FQDN is the name
+.BR gethostbyname (2)
+returns for the host name returned by
+.BR gethostname (2).
+The DNS domain name is the part after the first dot.
+.LP
+Therefore it depends on the configuration (usually in 
+.IR /etc/host.conf )
+how you can change it. Usually (if the hosts file is parsed before DNS or 
+NIS) you can change it in 
+.IR /etc/hosts .
+
+
+.SH OPTIONS
+.TP
+.I "\-a, \-\-alias"
+Display the alias name of the host (if used).
+.TP
+.I "\-d, \-\-domain"
+Display the name of the DNS domain. Don't use the command
+.B domainname
+to get the DNS domain name because it will show the NIS domain name and
+not the DNS domain name. Use
+.B dnsdomainname 
+instead.
+.TP
+.I "\-F, \-\-file filename"
+Read the host name from the specified file. Comments (lines starting with
+a `#') are ignored.
+.TP
+.I "\-f, \-\-fqdn, \-\-long"
+Display the FQDN (Fully Qualified Domain Name). A FQDN consists of a
+short host name and the DNS domain name. Unless you are using bind or NIS
+for host lookups you can change the FQDN and the DNS domain name (which is
+part of the FQDN) in the \fI/etc/hosts\fR file.
+.TP
+.I "\-h, \-\-help"
+Print a usage message and exit.
+.TP
+.I "\-i, \-\-ip-address"
+Display the IP address(es) of the host.
+.TP
+.I "\-s, \-\-short"
+Display the short host name. This is the host name cut at the first dot.
+.TP
+.I "\-V, \-\-version"
+Print version information on standard output and exit successfully.
+.TP
+.I "\-v, \-\-verbose"
+Be verbose and tell what's going on.
+.TP
+.I "\-y, \-\-yp, \-\-nis"
+Display the NIS domain name. If a parameter is given (or 
+.B \-\-file name
+) then root can also set a new NIS domain.
+.SH FILES
+.B /etc/hosts
+.SH AUTHOR
+Peter Tobias, <tobias@et-inf.fho-emden.de>
+.br
+Bernd Eckenfels, <net-tools@lina.inka.de> (NIS and manpage).
+.br
diff --git a/man/en_US.88591/ifconfig.8 b/man/en_US.88591/ifconfig.8
new file mode 100644 (file)
index 0000000..77533f6
--- /dev/null
@@ -0,0 +1,182 @@
+.TH IFCONFIG 8 "4 August 1997" "net-tools" "Linux Programmer's Manual"
+.SH NAME
+ifconfig \- configure a network interface
+.SH SYNOPSIS
+.B "ifconfig [interface]"
+.br
+.B "ifconfig interface [aftype] options | address ..."
+.SH DESCRIPTION
+.B Ifconfig
+is used to configure the kernel-resident network interfaces.  It is
+used at boot time to set up interfaces as necessary.  After that, it
+is usually only needed when debugging or when system tuning is needed.
+.LP
+If no arguments are given,
+.B ifconfig
+displays the status of the currently active interfaces.  If
+a single
+.B interface
+argument is given, it displays the status of the given interface
+only; if a single
+.B -a
+argument is given, it displays the status of all interfaces, even
+those that are down.  Otherwise, it configures an interface.
+
+.SH Address Families
+If the first argument after the interface name is recognized as
+the name of a supported address family, that address family is
+used for decoding and displaying all protocol addresses.  Currently
+supported address families include
+.B inet
+(TCP/IP, default), 
+.B inet6
+(IPv6),
+.B ax25
+(AMPR Packet Radio),
+.B ddp
+(Appletalk Phase 2),
+.B ipx
+(Novell IPX) and
+.B netrom
+(AMPR Packet radio).
+.SH OPTIONS
+.TP
+.B interface
+The name of the interface.  This is usually a driver name followed by
+a unit number, for example
+.B eth0
+for the first Ethernet interface.
+.TP
+.B up
+This flag causes the interface to be activated.  It is implicitly
+specified if an address is assigned to the interface.
+.TP
+.B down
+This flag causes the driver for this interface to be shut down.
+.TP
+.B "[\-]arp"
+Enable or disable the use of the ARP protocol on this interface.
+.TP
+.B "[\-]promisc"
+Enable or disable the
+.B promiscuous
+mode of the interface.  If selected, all packets on the network will
+be received by the interface.
+.TP
+.B "[\-]allmulti"
+Enable or disable 
+.B all-multicast
+mode.  If selected, all multicast packets on the network will be
+received by the interface.
+.TP
+.B "metric N"
+This parameter sets the interface metric.
+.TP
+.B "mtu N"
+This parameter sets the Maximum Transfer Unit (MTU) of an interface.
+.TP
+.B "dstaddr addr"
+Set the remote IP address for a point-to-point link (such as
+PPP).  This keyword is now obsolete; use the
+.B pointopoint
+keyword instead.
+.TP
+.B "netmask addr"
+Set the IP network mask for this interface.  This value defaults to the
+usual class A, B or C network mask (as derived from the interface IP
+address), but it can be set to any value.
+.TP
+.B "add addr/prefixlen"
+Add an IPv6 address to an interface. 
+.TP
+.B "del addr/prefixlen"
+Remove an IPv6 address from an interface.
+.TP
+.B "tunnel aa.bb.cc.dd"
+Create a new SIT (IPv6-in-IPv4) device, tunnelling to the given destination.
+.TP
+.B "irq addr"
+Set the interrupt line used by this device.  Not all devices can
+dynamically change their IRQ setting.
+.TP
+.B "io_addr addr"
+Set the start address in I/O space for this device. 
+.TP
+.B "mem_start addr"
+Set the start address for shared memory used by this device.  Only a
+few devices need this.
+.TP
+.B "media type"
+Set the physical port or medium type to be used by the device.  Not
+all devices can change this setting, and those that can vary in what
+values they support.  Typical values for
+.B type
+are 
+.B 10base2
+(thin Ethernet),
+.B 10baseT
+(twisted-pair 10Mbps Ethernet),
+.B AUI 
+(external transceiver) and so on.  The special medium type of
+.B auto
+can be used to tell the driver to auto-sense the media.  Again, not
+all drivers can do this.
+.TP
+.B "[-]broadcast [addr]"
+If the address argument is given, set the protocol broadcast
+address for this interface.  Otherwise, set (or clear) the
+.B IFF_BROADCAST
+flag for the interface.
+.TP
+.B "[-]pointopoint [addr]"
+This keyword enables the
+.B point-to-point
+mode of an interface, meaning that it is a direct link between two
+machines with nobody else listening on it.
+.br
+If the address argument is also given, set the protocol address of
+the other side of the link, just like the obsolete
+.B dstaddr
+keyword does.  Otherwise, set or clear the
+.B IFF_POINTOPOINT
+flag for the interface. 
+.TP
+.B hw class address
+Set the hardware address of this interface, if the device driver
+supports this operation.  The keyword must be followed by the
+name of the hardware class and the printable ASCII equivalent of
+the hardware address.  Hardware classes currently supported include
+.B ether
+(Ethernet),
+.B ax25
+(AMPR AX.25),
+.B ARCnet
+and
+.B netrom
+(AMPR NET/ROM).
+.TP
+.B multicast
+Set the multicast flag on the interface. This should not normally be needed
+as the drivers set the flag correctly themselves.
+.TP
+.B address
+The IP address to be assigned to this interface.
+.SH FILES
+.I /proc/net/socket 
+.br
+.I /proc/net/dev
+.br
+.I /proc/net/if_inet6
+.br
+.I /etc/init.d/network
+.SH BUGS
+While appletalk DDP and IPX addresses will be displayed they cannot be
+altered by this command.
+.SH SEE ALSO
+route(8), netstat(8), arp(8), rarp(8)
+.SH AUTHORS
+Fred N. van Kempen, <waltje@uwalt.nl.mugnet.org>
+.br
+Alan Cox, <Alan.Cox@linux.org>
+.br
+Phil Blundell, <Philip.Blundell@pobox.com>
diff --git a/man/en_US.88591/netstat.8 b/man/en_US.88591/netstat.8
new file mode 100644 (file)
index 0000000..a43ff59
--- /dev/null
@@ -0,0 +1,455 @@
+.\"
+.\" netstat.8 
+.\"
+.\" Original: (mdw@tc.cornell.edu & dc6iq@insu1.etec.uni-karlsruhe.de)
+.\"
+.\" Modified: Bernd.Eckenfels@inka.de
+.\"
+.\"
+.TH NETSTAT 8 "20 Feb 1999" "net-tools" "Linux Programmer's Manual"
+
+.SH NAME
+netstat \- Display network connections, routing tables, interface statistics, masquerade connections and netlink messages
+
+.SH SYNOPSIS
+
+.B netstat 
+.RB [ \-venaoc ]
+.RB [ \-\-tcp | \-t ]
+.RB [ \-\-udp | \-u ]
+.RB [ \-\-raw | \-w ]
+.RB [ \-\-unix | \-u ] 
+.RB [ \-\-inet | \-\-ip ]
+.RB [ \-\-ax25 ]
+.RB [ \-\-ipx ] 
+.RB [ \-\-netrom ]
+
+.PP
+
+.B netstat 
+.RB [ \-veenc ]
+.RB [ \-\-inet ] 
+.RB [ \-\-ipx ]
+.RB [ \-\-netrom ] 
+.RB [ \-\-ddp ]
+.RB [ \-\-ax25 ]
+.RB { \-\-route | \-r }
+
+.PP
+
+.B netstat
+.RB [ \-veenac ]
+.RB { \-\-interfaces | \-i }
+.RI [ iface ]
+
+.PP
+
+.B netstat
+.RB [ \-enc ]
+.RB { \-\-masquerade | \-M }
+
+.PP
+
+.B netstat 
+.RB [ \-cn ]
+.RB { \-\-netlink | \-N }
+
+.PP
+
+.B netstat 
+.RB { \-V | \-\-version }
+.RB { \-h | \-\-help }
+
+.PP
+.SH DESCRIPTION
+.B Netstat
+displays information of the Linux networking subsystem.
+
+.SS "(no option)"
+You can view the
+status of network connections by listing the open sockets. This is the
+default operation: If you don't specify any address families, then the
+active sockets of all configured address families will be printed. With
+.B -e
+you get some additional informations (userid). With the
+.B -v
+switch you can make netstat complain about known address families which are
+not supported by the kernel. The
+.B -o
+option displays some additional information on networking timers. 
+.B -a
+print all sockets, including the listening server sockets. The address
+family
+.B inet
+will display raw, udp and tcp sockets.
+
+.SS "\-r, \-\-route"
+With the
+.BR \-r ", " \-\-route
+option, you get the kernel routing tables in the same format as
+.B "route -e" 
+use.
+.B "netstat -er" 
+will use the output format of
+.BR route .
+Please see
+.BR route (8)
+for details.
+
+.SS "\-i, \-\-interface \fIiface\fI"
+If you use the
+.BR -i ", " --interfaces
+option, a table of all (or the specified 
+.IR iface ) 
+networking interfaces will be printed. The output uses the
+.B "ifconfig -e"
+format, and is described in
+.BR ifconfig (8).
+.B "netstat -ei" 
+will print a table or a single interface entry just like
+.B ifconfig
+does. With the
+.B -a
+switch, you can include interfaces which are not configured (i.e. don't have
+the 
+.BR U = UP
+flag set).
+
+.SS "\-M, \-\-masquerade"
+
+A list of all masqueraded sessions can be viewed, too. With the
+.B -e 
+switch you can include some more informations about sequenze numbering and
+deltas, caused by data rewrites on FTP sessions (PORT
+command). Masquerade support is used to hide hosts with unofficial network
+addresses from the outside world, as described in
+.BR ipfw (4), ipfwadm "(8) and " ipfw (8).
+
+.SS "\-N, \-\-netlink"
+
+Recent kernels have a kernel/user communication support called netlink. You
+can get messages about creation or deletion of interfaces or routes from
+.I /dev/route
+(36,0).
+
+.PP
+.SH OPTIONS
+.SS "\-v, \-\-verbose"
+Tell the user what is going on by being verbose. Especially print some
+usefull informations about unconfigured address families.
+
+.SS "\-n, \-\-numeric"
+shows numerical addresses instead of trying to determine symbolic host, port
+or user names.
+
+.SS "\-A, \-\-af \fIfamily\fI"
+use a different method to set the address families.
+.I family 
+is a comma (',') seperated list of address family keywords like
+.BR inet , 
+.BR unix , 
+.BR ipx , 
+.BR ax25 , 
+.B netrom 
+and
+.BR ddp .
+This is has the same effect as using the long options
+.BR \-\-inet ,
+.BR \-\-unix ,
+.BR \-\-ipx ,
+.BR \-\-ax25 ,
+.B \-\-netrom
+and
+.BR \-\-ddp.
+
+.SS "\-c, \-\-continous"
+This will cause
+.B netstat
+to print the selected table every second continously on the screen until you
+interrupt it.
+
+.PP
+.SH OUTPUT
+
+.PP
+.SS Active Internet connections \fR(TCP, UDP, RAW)\fR
+
+.SS "Proto" 
+The protocol (tcp, udp, raw) used by the socket. 
+
+.SS "Recv-Q"
+The count of bytes not copied by the user program connected to this socket.
+
+.SS "Send-Q"
+The count of bytes not acknoledged by the remote host.
+
+.SS "Local Address" 
+The local address (local hostname) and port number of the socket. Unless
+the
+.B -n
+switch is given, the socket address is resolved to its canonical
+hostname, and the port number is translated into the corresponding service
+name. 
+
+.SS "Foreign Address"
+The remote address (remote hostname) and port number of he socket. As
+with the local address:port, the
+.B -n
+switch turns off hostname and service name resolution.
+
+.SS "State"
+The state of the socket. Since there are no states in RAW and usually no
+states used in UDP, this row may be left blank. Normally this can be one
+of several values:
+.TP
+.I
+ESTABLISHED
+The socket has an established connection.
+.TP
+.I
+SYN_SENT
+The socket is actively attempting to establish a connection.
+.TP
+.I
+SYN_RECV
+The connection is being initialized.
+.TP
+.I
+FIN_WAIT1
+The socket is closed, and the connection is shutting down.
+.TP
+.I
+FIN_WAIT2
+Connection is closed, and the socket is waiting for a shutdown from the
+remote end.
+.TP
+.I
+TIME_WAIT
+The socket is waiting after close for remote shutdown retransmission.
+.TP
+.I
+CLOSED
+The socket is not being used.
+.TP
+.I
+CLOSE_WAIT
+The remote end has shut down, waiting for the socket to close.
+.TP
+.I
+LAST_ACK
+The remote end shut down, and the socket is closed. Waiting for
+acknowledgement.
+.TP
+.I
+LISTEN
+The socket is listening for incoming connections. Those sockets are only
+displayed if the
+.BR -a , --listening
+switch is set.
+.TP
+.I
+CLOSING
+Both sockets are shut down but we still don't have all our data
+sent.
+.TP
+.I
+UNKNOWN
+The state of the socket is unknown.
+
+.SS "User"
+The name or the UID of the owner of the socket.
+
+.SS "Timer"
+(this needs to be written)
+
+
+.PP
+.SS Active UNIX domain Sockets
+
+
+.SS "Proto" 
+The protocol (usually unix) used by the socket.
+
+.SS "RefCnt"
+The reference count (i.e. attached processes via this socket).
+
+.SS "Flags"
+The flags displayed is SO_ACCEPTON (displayed as 
+.BR ACC ),
+SO_WAITDATA 
+.RB ( W )
+or SO_NOSPACE 
+.RB ( N ). 
+SO_ACCECPTON 
+is used on unconnected sockets if their corresponding
+processes are waiting for a connect request. The other flags are not
+of normal interest.
+
+.SS "Type"
+There are several types of socket access:
+.TP
+.I
+SOCK_DGRAM
+The socket is used in Datagram (connectionless) mode.
+.TP
+.I
+SOCK_STREAM
+This is a stream (connection) socket.
+.TP
+.I
+SOCK_RAW
+The socket is used as a raw socket.
+.TP
+.I
+SOCK_RDM
+This one serves reliably-delivered messages.
+.TP
+.I
+SOCK_SEQPACKET
+This is a sequential packet socket.
+.TP
+.I
+SOCK_PACKET
+RAW interface access socket.
+.TP
+.I
+UNKNOWN
+Who ever knows, what the future will bring us - just fill in here :-)
+
+.PP
+.SS "State"
+This field will contain one of the following Keywords:
+.TP
+.I
+FREE
+The socket is not allocated
+.TP
+.I
+LISTENING
+The socket is listening for a connection request. Those sockets are only
+displayed if the
+.BR -a , --listening
+switch is set.
+.TP
+.I
+CONNECTING
+The socket is about to establish a connection.
+.TP
+.I
+CONNECTED
+The socket is connected.
+.TP
+.I
+DISCONNECTING
+The socket is disconnecting.
+.TP
+.I
+(empty)
+The socket is not connected to another one.
+.TP
+.I
+UNKNOWN
+This state should never happen.
+
+.SS "Path"
+This displays the path name as which the corresponding processes attached
+to the socket.
+
+.PP
+.SS Active IPX sockets
+
+(this needs to be done by somebody who knows it)
+
+.PP
+.SS Active NET/ROM sockets
+
+(this needs to be done by somebody who knows it)
+
+.PP
+.SS Active AX.25 sockets
+
+(this needs to be done by somebody who knows it)
+
+.PP
+.SH FILES
+.ta
+.I /etc/services
+-- The services translation file
+
+.I /proc/net/dev
+-- devices information
+
+.I /proc/net/raw
+-- RAW socket information
+
+
+.I /proc/net/tcp
+-- TCP socket information
+
+.I /proc/net/udp
+-- UDP socket information
+
+.I /proc/net/unix
+-- Unix domain socket information
+
+.I /proc/net/ipx
+-- IPX socket information
+
+.I /proc/net/ax25
+-- AX25 socket information
+
+.I /proc/net/appeltalk
+-- DDP (appeltalk) socket information
+
+.I /proc/net/nr
+-- NET/ROM socket information
+
+.I /proc/net/route
+-- Kernel IP routing information
+
+.I /proc/net/ax25_route
+-- Kernel AX25 routing information
+
+.I /proc/net/ipx_route
+-- Kernel IPX routing information
+
+.I /proc/net/nr_nodes
+-- Kernel NET/ROM nodelist
+
+.I /proc/net/nr_neigh
+-- Kernel NET/ROM neighbours
+
+.I /proc/net/ip_masquerade
+-- Kernel masqueraded connections
+
+.fi
+
+.PP
+.SH SEE ALSO
+.BR route (8), 
+.BR ifconfig (8), 
+.BR ipfw (4), 
+.BR ipfw (8), 
+.BR ipfwadm (8)
+
+.PP
+.SH BUGS
+Occasionally strange information may appear if a socket changes
+as it is viewed. This is unlikely to occur.
+.br
+The
+.B netstat -i
+options is described as it should work after some code cleanup of the BETA
+release of the net-tools package.
+
+.PP
+.SH AUTHORS
+The netstat user interface was written by Fred Baumgarten
+<dc6iq@insu1.etec.uni-karlsruhe.de> the man page basically
+by Matt Welsh <mdw@tc.cornell.edu>. It was updated by
+Alan Cox <Alan.Cox@linux.org> but could do with a bit more
+work. 
+.br
+The man page and the command included in the net-tools
+package is totally rewritten from Bernd Eckenfels 
+<ecki@linux.de>.
diff --git a/man/en_US.88591/nisdomainname.1 b/man/en_US.88591/nisdomainname.1
new file mode 100644 (file)
index 0000000..1f45128
--- /dev/null
@@ -0,0 +1 @@
+.so man1/hostname.1
diff --git a/man/en_US.88591/rarp.8 b/man/en_US.88591/rarp.8
new file mode 100644 (file)
index 0000000..b3e9586
--- /dev/null
@@ -0,0 +1,77 @@
+.TH RARP 8 "4 August 1997" "net-tools" "Linux Programmer's Manual"
+.SH NAME
+rarp \- manipulate the system RARP table
+.SH SYNOPSIS
+.B "rarp [-V] [--version] [-h] [--help]"
+.br
+.B "rarp -a"
+.br
+.B "rarp [-v] -d hostname ..."
+.br
+.B "rarp [-v] [-t type] -s hostname hw_addr"
+.SH DESCRIPTION
+.B Rarp
+manipulates the kernel's RARP table in various ways.  The primary options
+are clearing an address mapping entry and manually setting up one.  For
+debugging purposes, the
+.B arp
+program also allows a complete dump of the RARP table.
+.SH OPTIONS
+.TP
+.B \-V
+Display the version of RARP in use.
+.TP
+.B \-v
+Tell the user what is going on by being verbose.
+.TP
+.B "\-t type"
+When setting or reading the RARP table, this optional parameter tells
+.B rarp
+which class of entries it should check for.  The default value of
+this parameter is
+.B ether
+(i.e. hardware code
+.B 0x01
+for
+.B "IEEE 802.3 10Mbps Ethernet."
+Other values might include network technologies such as
+.B AX.25 (ax25)
+and
+.B NET/ROM (netrom).
+.TP
+.B "\-a"
+.TP
+.B "\-\-list"
+Lists the entries in the RARP table.
+.TP
+.B "\-d hostname"
+.TP
+.B "\-\-delete hostname"
+Remove all RARP entries for the specified host.
+.TP
+.B "\-s hostname hw_addr"
+.TP
+.B "\-\-set hostname hw_addr"
+Create a RARP address mapping entry for host
+.B hostname
+with hardware address set to
+.B hw_addr
+.  The format of the hardware address is dependent on the hardware
+class, but for most classes one can assume that the usual presentation
+can be used.  For the Ethernet class, this is 6 bytes in hexadecimal,
+separated by colons.
+.SH WARNING
+Some systems (notably older Suns) assume that the host replying to
+a RARP query can also provide other remote boot services. Therefore 
+never gratuitously add rarp entries unless you wish to meet the wrath
+of the network administrator.
+.SH FILES
+.I /proc/net/rarp,
+.SH SEE ALSO
+arp(8), route(8), ifconfig(8), netstat(8)
+.SH AUTHORS
+Ross D. Martin, <martin@trcsun3.eas.asu.edu>
+.br
+Fred N. van Kempen, <waltje@uwalt.nl.mugnet.org>
+.br
+Phil Blundell, <Philip.Blundell@pobox.com>
diff --git a/man/en_US.88591/route.8 b/man/en_US.88591/route.8
new file mode 100644 (file)
index 0000000..16cab17
--- /dev/null
@@ -0,0 +1,324 @@
+.TH ROUTE 8 "8 August 1997" "net-tools" "Linux Programmer's Manual"
+.SH NAME
+route \- show / manipulate the IP routing table
+.SH SYNOPSIS
+.B route
+.RB [ \-CFvnee ]
+.TP
+.B route 
+.RB [ \-v ]
+.RB [ \-A
+family] 
+.B add 
+.RB [ \-net | \-host ] 
+target 
+.RB [ netmask 
+Nm] 
+.RB [ gw 
+Gw] 
+.RB [ metric 
+N] 
+.RB [ mss 
+M] 
+.RB [ window 
+W] 
+.RB [ irtt 
+I]
+.RB [ reject ]
+.RB [ mod ]
+.RB [ dyn ] 
+.RB [ reinstate ] 
+.RB [[ dev ] 
+If]
+.TP
+.B route 
+.RB [ \-v ] 
+.RB [ \-A
+family]
+.B del 
+.RB [ \-net | \-host ] 
+target 
+.RB [ gw 
+Gw] 
+.RB [ netmask 
+Nm] 
+.RB [ metric 
+N] 
+.RB [[ dev ]
+If]
+.TP
+.B route 
+.RB [ \-V ] 
+.RB [ \-\-version ]
+.RB [ \-h ]
+.RB [ \--help ]
+.SH DESCRIPTION
+.B Route
+manipulates the kernel's IP routing table.  Its primary use is to set
+up static routes to specific hosts or networks via an interface after
+it has been configured with the
+.BR ifconfig (8)
+program.
+
+
+.SH OPTIONS
+.TP
+.B \-v
+select verbose operation.
+
+.TP
+.B \-A family
+Use the specified address family (eg `inet', `inet6').
+
+.TP
+.B \-n
+show numerical addresses instead of trying to determine symbolic host
+names. This is useful if you are trying to determine why the route to your
+nameserver has vanished.
+
+.TP
+.B \-e
+use
+.BR netstat (8)-format
+for displaying the routing table.
+.B \-ee 
+will generate a very long line with all parameters from the routing table.
+
+.TP
+.B \-net
+the
+.B target
+is a network.
+
+.TP
+.B -host
+the
+.B target 
+is a host.
+
+.TP 
+.B -F
+displays the kernel FIB routing table. The layout can be changed with
+.B \-e
+and
+.B \-ee
+.
+
+.TP 
+.B -C
+displays the kernel's route cache. 
+
+.TP
+.B del
+deletes a route.
+
+.TP 
+.B add 
+adds a route.
+
+.TP
+.B target
+The destination network or host. You can provide IP addresses in dotted
+decimal or host/network names.
+
+.TP
+.B netmask Nm
+modifier specifies the netmask of the route to be added.
+
+.TP
+.B gw Gw
+Any IP packets for the target network/host will be routed through the 
+specified gateway. 
+.B NOTE:
+The specified gateway must be reachable first. This usually means that
+you have to set up a static route to the gateway beforehand. If you specify
+the adress of one of your local interfaces, it will be used to decide about
+the interface to which the packets should be routed to. This is a BSDism
+compatibility hack.
+
+.TP
+.B metric M
+Set the metric field in the routing table (used by routing daemons) to M.
+
+.TP 
+.B mss M
+Set the TCP Maximum Segment Size (MSS) for connections over this route
+to M bytes. This is normally used only for fine optimisation of
+routing setups. The default is 536.
+
+.TP 
+.B window W 
+Set the TCP window size for connections over this route to W
+bytes. This is typically only used on AX.25 networks and with drivers
+unable to handle back to back frames.
+
+.TP
+.B irtt I
+Set the initial round trip time (irtt) for TCP connections over this
+route to I milliseconds (1-12000). This is typically only used on
+AX.25 networks. If omitted the RFC 1122 default of 300ms is used.
+
+.TP
+.B reject
+Install a blocking route, which will force a route lookup to fail.
+This is for example used to mask out networks before using the default
+route.  This is NOT for firewalling.
+
+.TP
+.B mod, dyn, reinstate
+Install a dynamic or modified route. Both flags are generally only
+set by a routing daemon. This is only for diagnostic purpose.
+
+.TP
+.B dev If
+Forces the route to be associated with the specified device, as the
+kernel will otherwise try to determine the device on its own (by
+checking already existing routes and device specifications, and where
+the route is added to). In most normal networks you won't need this.
+
+If 
+.B dev If
+is the last option on the command line, the word 
+.B dev
+may be omitted, as it's the default. Otherwise the order of the route
+modifiers (metric - netmask - gw - dev) doesn't matter.
+
+.SH EXAMPLES
+.TP
+.B route add -net 127.0.0.0
+adds the normal loopback entry, using netmask 255.0.0.0 (class A net,
+determined from the destination address) and associated with the 
+"lo" device (assuming this device was prviously set up correctly with
+.BR ifconfig (8)). 
+
+.TP 
+.B route add -net 192.56.76.0 netmask 255.255.255.0 dev eth0
+adds a route to the network 192.56.76.x via 
+"eth0". The Class C netmask modifier is not really necessary here because
+192.* is a Class C IP address. The word "dev" can be omitted here. 
+
+.TP
+.B route add default gw mango-gw
+adds a default route (which will be used if no other route matches).
+All packets using this route will be gatewayed through "mango-gw". The
+device which will actually be used for that route depends on how we
+can reach "mango-gw" - the static route to "mango-gw" will have to be
+set up before. 
+
+.TP
+.B route add ipx4 sl0
+Adds the route to the "ipx4" host via the SLIP interface (assuming that
+"ipx4" is the SLIP host).
+
+.TP
+.B route add -net 192.57.66.0 netmask 255.255.255.0 gw ipx4
+This command adds the net "192.57.66.x" to be gatewayed through the former
+route to the SLIP interface.
+
+.TP
+.B route add 224.0.0.0 netmask 240.0.0.0 dev eth0
+This is an obscure one documented so people know how to do it. This sets
+all of the class D (multicast) IP routes to go via "eth0". This is the
+correct normal configuration line with a multicasting kernel. 
+
+.TP
+.B route add 10.0.0.0 netmask 255.0.0.0 reject
+This installs a rejecting route for the private network "10.x.x.x."
+
+.LP
+.SH OUTPUT
+The output of the kernel routing table is organized in the following columns
+.TP
+.B Destination     
+The destination network or destination host.
+.TP
+.B Gateway
+The gateway address or '*' if none set.
+.TP
+.B Genmask         
+The netmask for the destination net; '255.255.255.255' for a host destination
+and '0.0.0.0' for the 
+.B default
+route.
+.TP
+.B Flags 
+Possible flags are
+.br
+.B U
+(route is
+.BR up )
+.br
+.B H
+(target is a
+.BR host )
+.br
+.B G
+(use
+.BR gateway )
+.br
+.B R
+.RB ( reinstate
+route for dynamic routing)
+.br
+.B D
+.RB ( dynamically
+installed by daemon or redirect)
+.br
+.B M
+.RB ( modified
+from routing daemon or rederict)
+.br
+.B !
+.RB ( reject
+route)
+.TP
+.B Metric 
+The 'distance' to the target (usually counted in hops). It is not used by
+recent kernels, but may be needed by routing daemons.
+.TP
+.B Ref    
+Number of references to this route. (Not used in the Linux kernel.)
+.TP
+.B Use
+Count of lookups for the route.  Depending on the use of -F and -C this will
+be either route cache misses (-F) or hits (-C).
+.TP
+.B Iface
+Interface to which packets for this route will be sent.
+.TP
+.B MSS 
+Default maximum segement size for TCP connections over this route.
+.TP
+.B Window  
+Default window size for TCP connections over this route.
+.TP
+.B irtt
+Initial RTT (Round Trip Time). The kernel uses this to guess about the best
+TCP protocol parameters without waiting on (possible slow) answers.
+.TP
+.B HH (cached only)
+The number of ARP entries and cached routes that refer to the hardware
+header cache for the cached route. This will be \-1 if a hardware
+address is not needed for the interface of the cached route (e.g. lo).
+.TP
+.B Arp (cached only)
+Whether or not the hardware address for the cached route is up to date.
+.LP
+.SH FILES
+.I /proc/net/ipv6_route
+.br
+.I /proc/net/route
+.br
+.I /proc/net/rt_cache
+.LP
+.SH SEE ALSO
+.I ifconfig(8), netstat(8), arp(8), rarp(8)
+.LP
+.SH HISTORY
+.B Route
+for Linux was originally written by Fred N.  van Kempen,
+<waltje@uwalt.nl.mugnet.org> and then modified by Johannes Stille and
+Linus Torvalds for pl15. Alan Cox added the mss and window options for
+Linux 1.1.22. irtt support and merged with netstat from Bernd Eckenfels.
+.SH AUTHOR
+Currently maintained by Phil Blundell <Philip.Blundell@pobox.com>.
diff --git a/man/en_US.88591/ypdomainname.1 b/man/en_US.88591/ypdomainname.1
new file mode 100644 (file)
index 0000000..1f45128
--- /dev/null
@@ -0,0 +1 @@
+.so man1/hostname.1
diff --git a/man/fr_FR.88591/arp.8 b/man/fr_FR.88591/arp.8
new file mode 100644 (file)
index 0000000..045846c
--- /dev/null
@@ -0,0 +1,101 @@
+.TH ARP 8 "05 Feb 1995" "net-tools" "Linux Programmer's Manual"
+.SH NOM
+arp \- manipule la table ARP du système
+.SH SYNOPSIS
+.B "arp [-vn] [-H type] -a [nom_d_hôte]"
+.br
+.B "arp [-v] -d nom_d_hôte ..."
+.br
+.B "arp [-v] [-H type] -s nom_d_hôte hw_addr [temp] [netmask aa.bb.cc.dd] [pub]"
+.br
+.B "arp [-v] -f nom_de_fichier"
+.SH DESCRIPTION
+.B Arp
+manipule la table ARP du noyau de différentes façons.  Les options principales
+permettent d'effacer une correspondance d'adresses   et d'en définir
+une manuellement.
+Pour les besoins de débogage, le programme
+.B arp
+permet aussi d'effectuer un dump complet de la table ARP.
+.SH OPTIONS
+.TP
+.B \-v
+Dit Ã  l'utilisateur ce qui se passe en Ã©tant verbeux.
+.TP
+.B \-n
+shows numerical addresses instead of trying to determine symbolic host names.
+.TP
+.B "\-H type"
+En positionnant ou lisant les entrées ARP, ce paramètre optionnel dit
+à 
+.B arp
+quel type d'entrées il doit contrôler.  La valeur par défaut de
+ce paramètre est
+.B ether
+(i.e. code de matériel
+.B 0x01
+pour
+.B "IEEE 802.3 10Mbps Ethernet".
+D'autres valeurs doivent correspondre Ã  des technologies réseaux telles que
+.B ARCnet (arcnet)
+,
+.B PROnet (pronet)
+et
+.B AX.25 (ax25).
+.TP
+.B "\-a [nom_d_hôte]"
+Montre les entrées concernant l'hôte spécifié.  Si le paramètre
+.B nom_d_hôte
+n'est pas utilisé,
+.B toutes
+les entrées seront affichées.
+.TP
+.B "\-d nom_d_hôte"
+Enlève une entrée pour l'hôte spécifié.  Ceci peut Ãªtre
+utilisé si l'hôte concerné ne fonctionne plus, par exemple.
+.TP
+.B "\-s hostname adr_mat"
+Crée manuellement une correspondance d'adresses ARP pour l'hôte
+.B nom_d_hôte
+avec l'adresse matérielle positionnée Ã 
+.B adr_mat.
+Le format de l'adresse matérielle est dépendant du matériel,
+mais pour la plupart on peut considérer que la présentation classique
+peut Ãªtre utilisée.  Pour la classe Ethernet, c'est 6 octets en hexadécimal,
+séparés par des double-points. Pour ajouter des entrées proxy-arp
+(Ce sont celles avec le drapeau [pub]lish positionné)
+un masque réseau peut Ãªtre spécifié au proxy-arp pour le
+sous-réseau entier. Proxy arp pour le routage de réseaux entiers
+n'est pas un bon protocole, mais c'est parfois intéressant de le supporter.
+.TP
+.B "\-f nom_de_fichier"
+Similaire Ã  l'option 
+.B \-s
+, mais cette fois les informations d'adresses sont prises dans le fichier
+.B nom_de_fichier.
+Ceci peut Ãªtre utilisé si les entrées ARP Ã  configurer sont
+nombreuses.  Le nom du fichier de données est très souvent nommé
+.B /etc/ethers
+, mais ce n'est pas officiel.
+.sp 1
+Le format du fichier est simple; Il contient
+seulement des lignes de texte ASCII avec un nom d'hôte, et une adresse
+matérielle, le tout séparés par des espaces.
+.LP
+A tous les endroits où un
+.B nom d'hôte
+est attendu, on peut aussi entrer une
+.B "addresse IP"
+en notation décimale séparée par des points.
+.SH FICHIERS
+.I /proc/net/arp,
+.br
+.I /etc/ethers
+.SH AUTEUR
+Fred N. van Kempen, <waltje@uwalt.nl.mugnet.org>
+.br
+Maintainer of the net-tools Bernd Eckenfels <net-tools@lina.inka.de>
+.SH BUGS
+Support for non-ether hardware addresses is not yet tested/implemented.
+.SH TRADUCTION
+Jean Michel VANSTEENE (vansteen@frcl.bull.fr)
diff --git a/man/fr_FR.88591/dnsdomainname.1 b/man/fr_FR.88591/dnsdomainname.1
new file mode 100644 (file)
index 0000000..1f45128
--- /dev/null
@@ -0,0 +1 @@
+.so man1/hostname.1
diff --git a/man/fr_FR.88591/domainname.1 b/man/fr_FR.88591/domainname.1
new file mode 100644 (file)
index 0000000..1f45128
--- /dev/null
@@ -0,0 +1 @@
+.so man1/hostname.1
diff --git a/man/fr_FR.88591/hostname.1 b/man/fr_FR.88591/hostname.1
new file mode 100644 (file)
index 0000000..da31f87
--- /dev/null
@@ -0,0 +1,85 @@
+.TH HOSTNAME 1 "28 July 1994" "net-tools" "Linux Programmer's Manual"
+.SH NOM
+hostname \- affiche ou définit le nom d'hôte du système
+.br
+dnsdomainname \- affiche le nom de domaine du système
+.SH SYNOPSIS
+.B hostname
+.RB [ \-d ]
+.RB [ \-\-domain ]
+.RB [ \-F\ nom_de_fichier ]
+.RB [ \-\-file\ nom_de_fichier ]
+.RB [ \-f ]
+.RB [ \-\-fqdn ]
+.RB [ \-h ]
+.RB [ \-\-help ]
+.RB [ \-\-long ]
+.RB [ \-s ]
+.RB [ \-\-short ]
+.RB [ \-v ]
+.RB [ \-\-version ]
+.RB [ nom ]
+.br
+.B dnsdomainname
+.SH DESCRIPTION
+.B Hostname
+est le programme utilisé soit pour définir le nom d'hôte, soit
+pour visualiser le nom d'hôte ou de domaine du système. Ce nom est
+utilisé par différents programmes réseaux pour identifier la machine.
+.LP
+Appelé sans argument, le programme affiche le nom courant, tel que
+définit Ã  l'aide de la commande
+.B hostname.
+Vous pouvez changer le format de sortie pour afficher soit la forme
+courte, soit la forme longue du nom d'hôte (FQDN). Appelé avec un
+argument, le programme définit la valeur du nom d'hôte Ã  la
+valeur fournie. C'est généralement fait une seule fois, au
+démarrage du système, par le script de configuration
+.I /etc/rc.d/rc.inet1.
+.LP
+Notez que seul le super-utilisateur peut changer le nom d'hôte.
+.LP
+Si c'est le programme
+.B dnsdomainname
+qui est appelé, il affichera le nom de domaine DNS. Vous ne pouvez pas
+changer le nom de domaine DNS avec
+.B dnsdomainname
+(voir après).
+.SH OPTIONS
+.TP
+.I "\-a, \-\-alias"
+Display the alias name of the host (if used).
+.TP
+.I "\-d, \-\-domain"
+Affiche le nom de domaine DNS. N'utilisez pas la commande
+.B domainname
+pour récupérer le nom de domaine DNS parce qu'elle affichera en fait
+le nom de domaine NIS et non pas le non DNS.
+.TP
+.I "\-F, \-\-file nom_de_fichier"
+Lit le nom d'hôte dans le fichier spécifié. Les commentaires
+(lignes commençant avec un `#') sont ignorés.
+.TP
+.I "\-f, \-\-fqdn, \-\-long"
+Affiche le nom complet FQDN (Fully Qualified Domain Name). Un FQDN consite
+en un nom d'hôte court et un nom de domaine DNS. Sauf si vous
+utilisez "bind" ou NIS pour la recherche des hôtes vous pouvez changer
+le FQDN et le nom de domaine DNS (qui fait partie du FQDN) dans le fichier \fI/etc/hosts\fR.
+.TP
+.I "\-h, \-\-help"
+Affiche un message d'utilisation sur la sortie standard et termine.
+.TP
+.I "\-i, \-\-ip-address"
+Display the IP address(es) of the host.
+.TP
+.I "\-s, \-\-short"
+Affiche le nom d'hôte en format court.
+.TP
+.I "\-v, \-\-version"
+Affiche les informations sur la version sur la sortie standard et termine.
+.SH FICHIERS
+.B /etc/hosts
+.SH AUTHOR
+Peter Tobias, <tobias@et-inf.fho-emden.de>
+.SH TRADUCTION
+Jean Michel VANSTEENE (vansteen@frcl.bull.fr)
diff --git a/man/fr_FR.88591/ifconfig.8 b/man/fr_FR.88591/ifconfig.8
new file mode 100644 (file)
index 0000000..9551667
--- /dev/null
@@ -0,0 +1,152 @@
+.TH IFCONFIG 8 "17 February 1995" "net-tools" "Linux Programmer's Manual"
+.SH NOM
+ifconfig \- configure une interface réseau
+.SH SYNOPSIS
+.B "ifconfig [interface]"
+.br
+.B "ifconfig interface [aftype] options | adresse ..."
+.SH DESCRIPTION
+.B Ifconfig
+est utilisé pour configurer (et maintenir ensuite) les interfaces
+réseau résidentes dans le noyau.  Il est utilisé lors du boot pour
+configurer la plupart d'entre-elles et ainsi rendre le système
+opérationnel.  Après, ce n'est quasiment plus utilisé que pour
+le débogage ou pour des réglages si nécessaire.
+.LP
+Si aucun argument n'est donné,
+.B ifconfig
+affiche simplement l'état des interfaces actuellement définies. Si
+seul le paramètre
+.B interface
+est donné, il affiche seulement l'état de l'interface correspondante.
+Autrement, il considère qu'il faut positionner de nouvelles valeurs.
+.SH Familles d'adresses
+Si le premier argument après le nom de l'interface est reconnu comme
+étant un nom de famille d'adresses supporté, cette famille d'adresses
+est utilisée pour décoder et afficher toutes les adresses
+protocolaires.  Les familles d'adresses actuellement supportées comprennent
+.B inet
+(TCP/IP, default) 
+.B ax25
+(AMPR Packet Radio.) 
+.B ddp
+(Appletalk Phase 2) and
+.B ipx
+(Novell IPX).
+.SH OPTIONS
+.TP
+.B interface
+Le nom de l'interface réseau.  C'est généralement un nom comme
+.B eth0
+,
+.B sl3
+ou quelque chose comme cela: un nom de pilote de périphérique suivi
+par un numéro d'unité.
+.TP
+.B up
+Cette option active l'interface.  Elle est implicitement spécifiée
+si une nouvelle adresse est affectée Ã  l'interface (voir plus loin).
+.TP
+.B down
+Cette option arrête le fonctionnement du pilote pour cette interface, et
+est utilisée lorsque les choses commencent Ã  aller mal.
+.TP
+.B "[\-]arp"
+Valide ou invalide l'utilisation du protocole ARP sur cette interface. Si
+le signe moins (\-) est présent, l'option est invalidée.
+.TP
+.B "[\-]trailers"
+Valide ou invalide l'utilisation d'infos complémémentaires (pistage) sur les
+trames Ethernet.  Ceci n'est pas utilisé dans l'implémentation actuelle.
+.TP
+.B "[\-]allmulti"
+Valide ou invalide le fonctionnement de l'interface en mode
+.B promiscuité
+.  Ceci signifie que toutes les trames entrantes sont envoyées Ã  la
+couche réseau du noyau, permettant la surveillance du réseau.
+.TP
+.B "metric N"
+Ce paramètre définit la métrique de l'interface. Il n'est pour
+l'instant pas implémenté, mais le sera prochainement.
+.TP
+.B "mtu N"
+Ce     paramètre  définit le  MTU     (Maximum  Transfer Unit)  d'une
+interface. Pour  Ethernet, c'est un nombre  compris entre 1000 et 2000 (par
+défaut 1500).  Pour SLIP,  utilisez une  valeur  comprise entre  200  et
+4096. Notez que l'implémentation actuelle  ne gère pas les  fragments
+au niveau  IP, donc il est mieux  de mettre le  MTU Ã   la valeur la plus
+grande.
+.TP
+.B "dstaddr adr"
+Définit l'adresse IP de "l'autre bout" dans le cas d'un lien
+point-à-point, comme PPP. Ce mot clé est rendu obsolète par le mot
+clé pointopoint.
+.TP
+.B "netmask adr"
+Définit le masque de réseau IP pour cette interface. La valeur par
+défaut de cette valeur correspond au masque réseau usuel pour les
+classes A, B ou C (déduite de l'adresse IP), mais toute autre valeur peut
+être définie selon les besoins en sous-réseaux.
+.TP
+.B "irq adr"
+Définit la ligne d'interruption utilisée par ce
+périphérique. Certains périphériques ne supportent pas le
+changement dynamique de l'IRQ.
+.TP
+.B "[-]broadcast [adr]"
+Si l'adresse est Ã©galement donnée, définit l'adresse broadcast
+protocolaire pour cette interface. Autrement, if définit seulement
+l'option
+.B IFF_BROADCAST
+de l'interface. Si le mot clé est précédé d'un signe moins
+.B (-)
+, l'option est retirée.
+.TP
+.B "[-]pointopoint [adr]"
+Ce mot clé valide le mode
+.B point-à-point
+d'une interface, signifiant qu'il existe un lien direct entre 2 machines,
+sans personne d'autre n'écoutant (en tout cas, je souhaite que ce
+soit le cas, :-) )
+.br
+Si l'argument d'adresse est Ã©galement donné, il définit l'adresse
+de l'autre machine, de la même manière que le paramètre
+obsolète
+.B dstaddr.
+Autrement il définit seulement l'option
+.B IFF_POINTOPOINT
+de l'interface.  Si le mot clé est précédé d'un signe moins
+.B (-)
+l'option est retirée.
+.TP
+.B hw
+Définit l'adresse matérielle de l'interface, si le pilote du
+périphérique supporte cette opération. Le mot clé doit Ãªtre
+suivi du nom de la classe matérielle et de l'adresse matérielle en
+caractères imprimables ASCII. Les classes matérielles actuellement
+supportées comprennent 
+.B ether
+(Ethernet),
+.B ax25
+(AMPR AX.25), et
+.B ARCnet.
+.TP
+.B multicast
+Définit l'option multicast sur l'interface. Elle n'est
+généralement pas nécessaire puisque les pilotes positionnent
+l'option correcte eux même.
+.TP
+.B adresse
+Le nom d'hôte ou l'adresse IP (le nom d'hôte correspond Ã  une
+adresse IP) de cette interface.  Ce paramètre est nécessaire,
+bien que la syntaxe ne la demande pas.
+.SH FICHIERS
+.I /proc/net/socket /proc/net/dev
+.SH BUGS
+Même si les adresses appletalk DDP et IPX peuvent Ãªtre affichées,
+elles ne peuvent Ãªtre modifiées avec cette commande.
+.SH AUTHORS
+Fred N. van Kempen, <waltje@uwalt.nl.mugnet.org>
+Alan Cox, <Alan.Cox@linux.org>
+.SH TRADUCTION
+Jean-Michel VANSTEENE (J.M.Vansteene@frcl.bull.fr)
diff --git a/man/fr_FR.88591/ipfw.8 b/man/fr_FR.88591/ipfw.8
new file mode 100644 (file)
index 0000000..6f847cc
--- /dev/null
@@ -0,0 +1,118 @@
+.TH IPFW 8 "09 April 1995" "net-tools" "Linux Programmer's Manual"
+.Dd November 16, 1994
+.Dt IPFW 8
+.Os
+.Sh NOM
+ipfw - utilitaire de contrôle pour firewall et comptabilité. 
+
+.Sh SYNOPSIS
+
+ ipfw [-vn] <action-entrée>    <motif d'entrée de chaine>
+ ipfw [-vn] <action-contrôle>  <motif du paquet>
+ ipfw [-vn] <action-chaine>    <type de chaine[s]>
+
+.Sh DESCRIPTION
+ Dans la première forme, l'utilitaire ipfw permet l'ajout et le retrait
+d'entrées de chaines de blocage/renvoi/comptabilité.
+ Dans la seconde forme, l'utilitaire ipfw contrôle chaque fois qu'un
+paquet IP du type donné est accepté ou rejeté par un firewall  de
+blocage ou de renvoi.
+ Dans la troisième forme, l'utilitaire ipfw permet des actions globales
+comme la remise Ã  zéro de compteurs, le vidage ou le listage des
+entrées de chaines et la valeur des compteurs associés.
+
+Les options suivantes sont disponibles :
+
+-n   ne résout rien.  Lors de définition des entrées, n'essaie pas
+de résoudre  une adresse donnée (noms d'hôte/adresses).
+Pour les listes, affiche les adresses dans le format numérique.
+
+Les <actions-entrées> sont :
+       
+  a[dd]b[locking] - ajoute une entrée au firewall de blocage.
+  d[el]b[locking] - enlève une entrée au firewall de blocage.
+  a[dd]f[orwarding] - ajoute une entrée au firewall de renvoi.
+  d[el]f[orwarding] - enlève une entrée au firewall de renvoi.
+  a[dd]a[ccounting] - ajoute une entrée Ã  la chaine de comptage.
+  d[el]a[ccounting] - supprime une entrée de la chaine de comptage.
+
+Les <actions-contrôle> sont :
+  c[heck]b[locking] - contrôle un paquet contre le firewall de blocage.
+  c[heck]f[orwarding] - contrôle un paquet contre le firewall de renvoi.
+
+Les <actions-chaines> sont :
+  f[lush] - supprime toutes les entrées des chaines firewall/comptablilité.
+  l[ist] - affiche toutes les entrées des chaines blocage/renvoi/comptabilité.
+  zero[accounting] - Efface les compteurs de chaines (actuellement
+seulement pour la comptabilisation).
+
+ Le <motif d'entrée de chaines> est construit comme ceci : 
+ Pour les chaines de renvoi/blocage :
+  deny <motif proto/adr>
+  accept <motif proto/adr>
+    
+ Le <motif proto/adr> est ainsi :
+  all|icmp from  <src addr/mask> to <dst addr/mask>
+  tcp|udp  from  <src addr/mask> [ports] to <dst addr/mask> [ports]
+    
+  <src addr/mask>:
+    <INET IP addr | nom_domaine> [/mask bits | :mask motif]
+  [ports]:
+    [ port,port....|port:port] où le nom de service peut Ãªtre 
+    utilisé au lieu de la valeur numérique.
+
+Lorsqu'une entrée est ajoutée Ã  une chaine et  que l'option -v est
+utilisée, l'entrée est ajoutée avec l'option PRN positionnée.
+
+Le <motif de paquet> se construit exactement comme <motif entrée de chaine>.
+
+ A la commande l[ist] peuvent Ãªtre passés :
+f[orwarding]|b[locking]|a[ccounting] pour lister les chaines
+spécifiques, ou rien pour les lister toutes. L'option -v provoque un
+changement du format de sortie pour que soient imprimés les compteurs de
+paquets/octets. Le format de sortie standard correspond parfaitement Ã 
+<motif entrée de chaine>.
+
+ A la commande f[lush] peuvent Ãªtre passés :
+f[irewall]|a[ccounting] pour supprimer toutes les entrées des chaines de
+renvoi/blocage ou de la chaine de comptabilisation. Toutes les entrées
+de chaines sont supprimées si aucun argument n'est donné.
+ Aucun argument n'est nécessaire Ã  la commande zero[accounting], et
+tous les compteurs sont réinitialisés.
+
+.Sh EXEMPLES
+
+ La commande suivante ajoute une entrée qui refuse tous les paquets TCP  de
+hacker.evil.org vers le port telnet de wolf.tambov.su et Ã©tant
+renvoyées par l'hôte :
+  ipfw addf deny tcp from hacker.evil.org to wolf.tambov.su telnet
+ Cellle-ci inhibe toutes les connexions de tout le réseau  "hackers"
+vers  mon hôte :
+  ipfw addb deny all from 123.45.67.8/24 to my.host.org
+
+.Sh BUGS
+ ATTENTION!!ATTENTION!!ATTENTION!!ATTENTION!!ATTENTION!!
+ Ce programme peut mettre votre ordinateur dans un Ã©tat quasiment
+inutilisable.
+La première fois essayez de l'utiliser Ã  partir d'une console et NE
+faites rien que vous ne comprenez pas.
+ Souvenez vous que "ipfw flush" peut résoudre tous les problèmes.
+Gardez Ã©galement Ã  l'esprit que "ipfw policy deny" combiné avec
+quelques entrées de chaines incorrectes (comme la seule entrée faite
+pour refuser certains paquets externes) peut isoler votre ordinateur du
+reste du monde.
+  En plus d'une mauvaise utilisation, le seul bug connu est que les
+entrées ajoutées avec l'option -v doivent Ãªtre supprimée avec
+la même option, mais il n'y a pas moyen de voir cela dans la commande
+'list'.
+
+.Sh HISTORY
+ Initiallement cet utilitaire a Ã©té Ã©crit pour BSDI par :
+  Daniel Boulet    <danny@BouletFermat.ab.ca> 
+ La version FreeBSD  a Ã©té entièrement Ã©crite par : 
+  Ugen J.S.Antsilevich <ugen@NetVision.net.il> 
+ Le synopsis est partiellement compatible avec l'ancien.
+ Porté pour Linux par :
+  Alan Cox  <Alan.Cox@linux.org>
diff --git a/man/fr_FR.88591/netstat.8 b/man/fr_FR.88591/netstat.8
new file mode 100644 (file)
index 0000000..fa7caa2
--- /dev/null
@@ -0,0 +1,402 @@
+.\"
+.\" netstat.8 (mdw@tc.cornell.edu & dc6iq@insu1.etec.uni-karlsruhe.de)
+.\"
+.\" I believe mdw should look up this manual page again for bad
+.\" grammar, bad spelling etc... -FB
+.\"
+.\" This man page is for Version 1.1.79 of netstat - compatible to
+.\" NET3.019
+.\"
+.TH NETSTAT 8 "9 Jan 1995" "net-tools" "Linux Programmer's Manual"
+.SH NOM
+netstat \- Affiche les connexions réseau actives
+.SH SYNOPSIS
+netstat [[-a | [-t | -u | -w]] [-n | -o] | -x] [-c]
+
+netstat -i [-a] [-c]
+
+netstat -r [-c] [-n]
+
+netstat -v
+.SH DESCRIPTION
+.B Netstat
+affiche l'état des connexions réseau concernant les prises TCP, UDP,
+RAW, ou UNIX liées au système. Par défaut,
+.B netstat
+affiche l'état des prises actives qui ne sont pas dans l'état
+"LISTEN" (i.e. connexions aux processus actifs). Pour obtenir des
+informations concernant les tables de routage du noyau,
+.B netstat
+peut Ãªtre invoqué avec l'option
+.B -r
+.
+.sp
+L'affichage de Netstat comprend les informations suivantes pour
+chaque prise :
+.SS "Proto" 
+Le protocole (soit TCP, soit UDP) utilisé par la prise. 
+
+.SS "Recv-Q"
+Le nombre d'octets pas encore lu par le programme utilisateur connecté
+à cette prise.
+
+.SS "Send-Q"
+Le nombre d'octets pas encore acquittés par l'hôte distant.
+
+.SS "Local Address" 
+L'adresse locale (nom d'hôte local) et numéro de port de la
+prise. Sauf si l'option
+.B -n
+est donnée, l'adresse de la prise est traduite en nom d'hôte,
+et le numéro de port est traduit en nom de service correspondant.
+
+.SS "Adresse distante"
+L'adresse distante (nom d'hôte distant) et le numéro de port de
+la prise. Comme pour l'adresse locale et le numéro de port, l'option
+.B -n
+invalide la traduction du nom d'hôte et de service.
+
+.SS "(Etat)"
+L'état de la prise. Puisqu'il n'y a pas d'état dans le mode RAW
+et généralement pas d'état utilisé en UDP, cette colonne
+peut se trouver vierge. Normalement, on trouvera une des valeur suivante:
+.TP
+.I
+ESTABLISHED
+La prise a une connexion Ã©tablie.
+.TP
+.I
+SYN_SENT
+La prise attend activement d'établir une connexion.
+.TP
+.I
+SYN_RECV
+La connexion est en cours d'initialisation.
+.TP
+.I
+FIN_WAIT1
+La prise est fermée, et la connexion est en cours de terminaison.
+.TP
+.I
+FIN_WAIT2
+La connexion est fermée, et la prise attend une terminaison du distant.
+.TP
+.I
+TIME_WAIT
+La prise attend une retransmission de terminaison de la part du distant
+après fermeture de connexion.
+.TP
+.I
+CLOSED
+La prise n'est pas utilisée.
+.TP
+.I
+CLOSE_WAIT
+Le distant a arrêté, attendant la fermeture de la prise.
+.TP
+.I
+LAST_ACK
+Le distant arrête, et la prise est fermée. Attente d'acquittement.
+.TP
+.I
+LISTEN
+La prise est Ã  l'écoute de connexions entrantes.
+.TP
+.I
+CLOSING
+Les deux prises sont arrêtées mais toutes les données locales n'ont
+pas encore Ã©té envoyées.
+.TP
+.I
+UNKNOWN
+L'état de la prise est inconnue.
+.PP
+.sp
+Si
+.B netstat
+est invoqué avec l'option
+.B -o
+, des informations supplémentaires seront affichées après l'état.
+Ces informations sont fournies comme suit : "nb octets rx-retransmission"
+"nb octets tx-retransmission" "état timer" "(temps/recul)". L'état du
+Timer peut maintenant Ãªtre soit `on', soit `off'.  Le temps (en secondes)
+affiché correspond Ã  la durée avant expiration. Toutes ces
+options sont sujettes Ã  suppresion dans les version ultérieures du
+paquetage `NET'.
+.sp
+Invoqué avec l'option
+.B -x
+,
+.B netstat affiche une liste de toutes les prises de communication actives
+de la famille UNIX.
+.sp
+L'affichage de netstat inclut les informations suivantes pour chaque prise :
+.SS "Proto" 
+Le protocole (habituellement UNIX) utilisé par la prise.
+\"
+\" To mdw, FvK: I don't believe there are other protocols than "0", right ?
+\" >>>FVK>>> Correct.
+\"
+.SS "CptRef"
+Le nombre de références (i.e. processus attachés via cette prise).
+
+.SS "Options"
+La seule option affichée est SO_ACCEPTON (affichée ACC) autrement
+laissé vierge. SO_ACCECPTON est utilisé pour les prises
+non-connectées si les processus correspondant sont en attente de
+demande de connexion. Les autres options sont d'un intérêt limité
+et ne sont pas affichées.
+
+.SS "Type"
+Il y a différents types d'accès aux prises :
+.TP
+.I
+SOCK_DGRAM
+La prises est utilisée en mode Datagram (sans connexion).
+.TP
+.I
+SOCK_STREAM
+C'est une prise `stream' (connexion).
+.TP
+.I
+SOCK_RAW
+La prises utilisée est une prise en mode `raw'.
+.TP
+.I
+SOCK_RDM
+Celle-ci est utilisée pour les messages délivrée de manière fiable.
+.TP
+.I
+SOCK_SEQPACKET
+C'est une prises en mode paquets séquentiels.
+.TP
+.I
+SOCK_PACKET
+Prise d'accès Ã  l'interface RAW.
+.TP
+.I
+UNKNOWN
+Qui sait ce que l'avenir nous réserve - Juste Ã  remplir ici :-)
+.PP
+.SS "Etat"
+Ce champ contient un des mots clés suivants :
+.TP
+.I
+FREE
+La prises n'est pas allouée
+.TP
+.I
+LISTENING
+La prises est Ã  l'écoute de demandes de connexions.
+.TP
+.I
+UNCONNECTED
+La prise n'est pas connctée Ã  une autre.
+.TP
+.I
+CONNECTING
+La prise est en cours d'établissement de connexion.
+.TP
+.I
+CONNECTED
+La prise est connectée.
+.TP
+.I
+DISCONNECTING
+La prise est en cours de déconnexion.
+.TP
+.I
+UNKNOWN
+Cet Ã©tat ne devrait jamais arriver.
+.SS "Chemin"
+Ceci affiche le chemin du processus attaché Ã  la prises.
+.PP
+.sp
+La table de routage réseau (invoqué avec
+.B netstat -r
+) montre les informations suivantes :
+.SS Destination réseau/adresse
+Affiche l'adresse destination d'un hôte ou d'un réseau saisi
+manuellement.  Sauf si l'option
+.B -n
+est donnée, les hôtes ou réseaux sont traduits en noms. une entrée
+nommée "default" décrit la route par défaut pour le noyau.
+.SS Passerelle
+S'il n'y a pas d'étoile ('*') - toute donnée sera routée
+vers la passerelle concernée.
+.SS Opts
+Lest options de routage possibles sont :
+.TP
+.I
+U
+Cette route est utilisable
+.TP
+.I
+G
+La destination est une passerelle
+.TP
+.I
+H
+La destination est un hôte
+.TP
+.I
+R
+La route sera rétablie après time-out
+.TP
+.I
+D
+Route créée dynamiquement (par redirection)
+.TP
+.I
+M
+Route modifiée dynamiquement (par redirection)
+.SS CptRef
+Nombre de références pour cette route
+.SS Use
+Nombre de fois que cette route a Ã©té utilisée
+.SS Iface
+Nom de l'interface, Ã  laquelle la route appartient
+.PP
+.sp
+La table de statistiques des périphériques (invoquée avec
+.B netstat -i
+) affiche des informations sur les interfaces :
+.SS Iface
+Le nom de cette interface.
+.SS MTU
+Taille maximum pour transmission sur cette interface. Ce devrait Ãªtre
+la taille des données transférées sur cette interface sans
+l'en-tête spécifique.
+.SS RX-OK
+paquets reçus sans erreur par cette interface.
+.SS RX-ERR
+paquets erronés.
+.SS RX-DRP
+paquets reçus, abandonnés (du Ã  un manque mémoire ?).
+.SS RX-OVR
+paquets impossible Ã  recevoir si rapidement.
+.SS TX-OK
+paquets transmis sans erreur via cette interface.
+.SS TX-ERR
+paquets transmis erronés.
+.SS TX-DRP
+paquets transmis abandonnés.
+.SS TX-OVR
+paquets impossibles Ã  transmettre.
+.SS Flags
+On pourra trouver aussi les options suivantes :
+.TP
+.I
+A
+Cette interface recevra toutes les adresses Multicast.
+.TP
+.I
+B
+Broadcasts acceptés.
+.TP
+.I
+D
+Le débogage est validé.
+.TP
+.I
+L
+L'interface est une boucle.
+.TP
+.I
+M
+Tous les paquets sont reçus (mode promiscuité).
+.TP
+.I
+N
+Pas de d'encapsulation des trames (Trailers).
+.TP
+.I
+O
+Pas de Protocole de Résolution d'Adresse (ARP) sur cette interface.
+.TP
+.I
+P
+L'interface est une connexion point-à-point.
+.TP
+.I
+R
+L'interface fonctionne.
+.TP
+.I
+U
+L'interface est montée (UP).
+.PP
+.SS Options
+.PP
+.TP
+\fB-a\fP
+Affiche des informations sur toutes les prises internet, i.e. TCP, UDP, RAW
+et UNIX y compris les prises qui sont seulement Ã  l'écoute.
+.TP
+.B -i
+Affiche des statistiques sur les périphériques réseau.
+.TP
+.B -c
+Génère un listage continu de l'état du réseau: l'affichage
+est répété toutes les secondes jusqu'à interruption du programme.
+.TP
+.B -n
+invite netstat Ã  ne pas traduire les adresses locales et distantes
+en noms d'hôtes, ni les numéros de ports en noms de services.
+.TP
+.B -o
+Affiche les Ã©tats des timers, temps avant expiration et Ã©tat de recul.
+.TP
+.B -r
+Affiche les tables de routage du noyau.
+.TP
+.B -t
+Affiche des informations sur les prises TCP uniquement, y comprises celles
+en Ã©coute.
+.TP
+.B -u
+Affiche des informations sur les prises UDP uniquement.
+.TP
+.B -v
+Affiche les informations sur la version.
+.TP
+.B -w
+Affiche des informations sur les prises RAW.
+.TP
+.B -x
+Affiche des informations sur les prises du domaine UNIX.
+.PP
+.SH FICHIERS
+.ta
+.I /etc/services
+-- Le fichier de correspondance des services
+
+.I /proc/net/socket
+-- informations périphériques
+
+.I /proc/net/raw
+-- informations prises RAW
+
+.I /proc/net/route
+-- information routage noyau
+
+.I /proc/net/tcp
+-- informations prises TCP
+
+.I /proc/net/udp
+-- informations prises UDP
+
+.I /proc/net/unix
+-- informations prises domaine UNIX
+.fi
+.SH BUGS
+Des informations Ã©tranges peuvent apparaitre occasionnellement
+si une prises change d'état au moment ou elle est visualisée.
+Ceci est peut probable.
+.SH AUTEURS
+L'interface utilisateur de netstat a Ã©té développée par
+Fred Baumgarten <dc6iq@insu1.etec.uni-karlsruhe.de>. Les pages du
+manuel essentiellement Ã©crites par Matt Welsh
+<mdw@tc.cornell.edu>. Mis Ã  jour par Alan Cox <Alan.Cox@linux.org>.
+.SH TRADUCTION
+Jean Michel VANSTEENE (J.M.Vansteenefrcl.bull.fr)
diff --git a/man/fr_FR.88591/nisdomainname.1 b/man/fr_FR.88591/nisdomainname.1
new file mode 100644 (file)
index 0000000..1f45128
--- /dev/null
@@ -0,0 +1 @@
+.so man1/hostname.1
diff --git a/man/fr_FR.88591/rarp.8 b/man/fr_FR.88591/rarp.8
new file mode 100644 (file)
index 0000000..c7ab1c0
--- /dev/null
@@ -0,0 +1,70 @@
+.TH RARP 8 "09 Jan 1995" "net-tools" "Linux Programmer's Manual"
+.SH NOM
+rarp \- manipule la table système RARP
+.SH SYNOPSIS
+.B "rarp [-v] [-t type] -a [nom_d_hôte]"
+.br
+.B "rarp [-v] -d nom_d_hôte ..."
+.br
+.B "rarp [-v] [-t type] -s nom_d_hôte adr_mat"
+.SH DESCRIPTION
+.B Rarp
+manipule la table RARP du noyau de différentes façons.  Les options de base
+permettent d'effacer une entrée de correspondance d'adresses et d'en
+redéfinir une manuellement.  Pour des besoins de débogage, le programme
+.B arp
+permet aussi de vider complètement la table RARP.
+.SH OPTIONS
+.TP
+.B \-v
+Dit Ã  l'utilisateur ce qui se passe, en Ã©tant verbeux.
+.TP
+.B "\-t type"
+En définissant ou lisant la table RARP, ce paramètre optionnel dit Ã 
+.B rarp
+quel type d'entrées il doit contrôler.  La valeur par défaut de
+ce paramètre est
+.B ether
+(i.e. code matériel
+.B 0x01
+pour
+.B "IEEE 802.3 10Mbps Ethernet".
+D'autres valeurs doivent correspondre Ã  des technologies réseaux telles que
+.B AX.25 (ax25).
+.TP
+.B "\-a [hostname]"
+Montre les entrées concernant l'hôte spécifié.  Si le paramètre
+.B hostname
+n'est pas utilisé,
+.B toutes
+les entrées seront affichées.
+.TP
+.B "\-d nom_d_hôte"
+Enlève une entrée pour l'hôte spécifié.  Ceci peut Ãªtre
+utilisé si l'hôte concerné ne fonctionne plus, par exemple.
+.TP
+.B "\-s nom_d_hôte adr_mat"
+Crée manuellement une correspondance d'adresses RARP pour l'hôte
+.B nom_d_hôte
+avec l'adresse matérielle positionnée Ã 
+.B adr_mat.
+Le format de l'adresse matérielle est dépendant du matériel,
+mais pour la plupart on peut considérer que la présentation classique
+peut Ãªtre utilisée.  Pour la classe Ethernet, c'est 6 octets en hexadécimal,
+séparés par des double-points.
+
+.SH ATTENTION
+Certains systèmes (notamment des vieux Sun's) supposent que l'hôte
+répondant Ã  une requête RARP peut aussi fournir d'autres services
+de démarrage Ã  distance. Par conséquent n'ajoutez jamais
+d'entrées RARP gratuitement Ã  moins que vous souhaitiez affronter la
+colère de votre administrateur réseau.
+.SH FICHIERS
+.I /proc/net/rarp,
+.SH AUTEURS
+Ross D. Martin, <martin@trcsun3.eas.asu.edu>
+.br
+Fred N. van Kempen, <waltje@uwalt.nl.mugnet.org>
+
+.SH TRADUCTION
+Jean-Michel VANSTEENE (J.M.Vansteene@frcl.bull.fr)
diff --git a/man/fr_FR.88591/route.8 b/man/fr_FR.88591/route.8
new file mode 100644 (file)
index 0000000..f1d2d6b
--- /dev/null
@@ -0,0 +1,164 @@
+.TH ROUTE 8 "14 Jun 1994" "net-tools" "Linux Programmer's Manual"
+.SH NAME
+route \- affiche / manipule la table de routage IP
+.SH SYNOPSIS
+.B "route [ -vn ]"
+.TP
+.B "route [ -v ] add [ -net | -host ] XXXX [gw GGGG] [metric MMMM] [netmask NNNN] [mss NNNN] [window NNNN] [dev DDDD]"
+.LP
+.B "route [ -v ] del XXXX"
+.SH DESCRIPTION
+.B Route
+manipule la table de routage IP du noyau.  Son utilisation première
+consiste Ã  configurer des routes statiques vers des hôtes ou des réseaux
+via une interface, après sa configuration par le programme
+.B ifconfig(8).
+Cette version de
+.B route
+est prévue seulement pour fonctionner avec les noyaux Ã  partir de la
+version 0.99pl14n.
+.SH OPTIONS
+.TP
+.B (aucun)
+Affiche la table de routage du noyau, en listant successivement l'adresse
+destination, la passerelle, le masque réseau pour la route ("Masque"), les
+options (U = Up, H = Host (Hôte), G = Gateway (Passerelle), D = dynamic,
+M = Modified), la métrique (pas encore supportée), Ref, Use et Iface
+(i.e. Ã  quel périphérique la route correspond). 
+.TP
+.B -n
+comme précédemment, mais affiche les adresses numériques, au lieu
+d'essayer de déterminer les noms d'hôtes. C'est utile si vous essayer de
+savoir pourquoi la route vers votre serveur de nom a disparu.
+.TP
+.B -v
+est une option pour le mode
+.BR verbeux 
+(pas vraiment utilisée). 
+.TP
+.B del XXXX
+efface la route associée Ã  l'adresse destination XXXX. 
+.TP 
+.B add [ -net | -host ] XXXX [gw GGGG] [metric MMMM] [netmask NNNN] [window WWWW] [dev DDDD]
+ajoute une route vers l'adresse IP XXXX. La route est une route réseau si
+(a) le modificateur 
+.B -net
+est utilisé ou (b) XXXX est trouvé dans
+.B /etc/networks
+par la function 
+.B getnetbyname() 
+et si le modificateur 
+.B -host
+n'est pas utilisé. 
+
+L'argument 
+.B gw GGGG
+signifie que tout paquet IP envoyé Ã  cette adresse  sera routé par
+la passerelle spécifiée.
+.B NOTE:
+La passerelle concernée doit pouvoir Ãªtre atteinte. Ceci signifie
+qu'une route statique vers cette passerelle doit préalablement exister.
+
+Le modificateur 
+.B metric MMMM
+n'est pas encore implémenté (et avec l'option 
+.B -v
+émet un message d'avertissement).
+
+Le modificateur 
+.B netmask NNNN
+spécifie le masque réseau de la route Ã  ajouter. Ceci n'a de sens que
+pour une route réseau, et lorsque l'adresse XXXX elle-même permet un tel
+masque. Si aucun masque n'est donné,
+.B route
+en crée un par défaut, donc, pour la plupart des configurations, vous n'avez
+pas besoin d'en donner. 
+
+Le modificateur 
+.B mss NNNN
+spécifie le MSS (Maximum Segment Size, Taille maximum de segment) de TCP,
+pour la route Ã  ajouter. Ce n'est normalement utilisé que pour des
+optimisations fines des configurations de routage.
+
+Le modificateur 
+.B window NNNN
+spécifie la fenêtre TCP pour la route Ã  ajouter. C'est typiquement
+utilisé sur les réseaux AX.25 et avec les pilotes incapables de manipuler
+les adossements de trames.
+
+Le modificateur 
+.B dev DDDD
+permet de forcer l'association entre la route et le périphérique
+spécifié, sans quoi le noyau essaierait de le déterminer seul, par
+un contrôle des routes existantes et des associations déjà effectuées.
+Dans la plupart des réseaux, ceci n'est pas nécessaire.
+
+Si 
+.B dev DDDD
+est la dernière option de la ligne de commande, le mot clé 
+.B dev
+peut Ãªtre omis, puisque c'est sa position par défaut.
+Autrement, l'ordre dans lequel sont donnés les modificateurs
+(metric - netmask - gw - dev) n'a pas d'importance.
+
+.SH EXEMPLES
+.TP
+.B route add -net 127.0.0.0
+ajoute l'entrée pour la boucle locale, en utilisant le masque 255.0.0.0
+(Réseau de classe A,
+déterminé Ã  partir de l'adresse destination) et associée avec le
+périphérique 
+.B lo
+(considérant que ce périphérique a Ã©té préalablement configuré
+correctement avec
+.B ifconfig(8)
+). 
+.TP 
+.B route add -net 192.56.76.0 netmask 255.255.255.0 dev eth0
+ajoute une route vers le réseau 192.56.76.x via 
+.B eth0.
+Le modificateur de masque réseau pour la classe C n'est pas vraiment
+nécessaire, puisque 192.* est une adresse IP de classe C. Le mot
+.B dev
+peut Ãªtre omis. 
+.TP
+.B route add default gw mango-gw
+ajoute une route par défaut (qui sera utilisée si aucune autre route ne
+correspond).
+Tous les paquets empruntant cette route passeront Ã  travers la passerelle
+"mango-gw". Le périphérique qui sera utilisé pour cette route
+dépend de la façon d'atteindre "mango-gw" - La route statique vers "mango-gw"
+devra Ãªtre configurée avant.
+.TP
+.B route add ipx4 sl0
+.TP 
+.B route add -net 192.57.66.0 netmask 255.255.255.0 gw ipx4
+Cette séquence de commandes ajoute une route vers l'hôte "ipx4" via
+l'interface SLIP (considérant que "ipx4" est un hôte SLIP), puis ajoute
+une route vers le réseau 192.57.66.0 dont la passerelle sera cet hôte.
+.TP
+.B route add 224.0.0.0 netmask 240.0.0.0 dev eth0
+Cette commande Ã©trange permet de configurer toutes les routes IP de classe D
+(multicast) via eth0. C'est la configuration normale et correcte pour un noyau
+multicast. 
+.LP
+.SH FICHIERS
+.I /proc/net/route
+.br
+.I /etc/networks
+.br
+.I /etc/hosts
+.SH VOIR AUSSI
+.I ifconfig(8)
+.SH HISTORIQUE
+.B Route
+pour Linux a Ã©té originellement Ã©crit par Fred N.  van Kempen,
+<waltje@uwalt.nl.mugnet.org> puis modifié par Johannes Stille et
+Linus Torvalds pour pl15. Alan Cox a ajouté les options concernant la gestion
+des fenêtres et MSS pour Linux 1.1.22.
+.SH BUGS
+Alan devra ajouter l'option 'irtt' (initial round trip time, c.a.d le
+temps d'aller et retour initial) pour des liens (AX.25/NetROM). Malheureusement
+la modification doit d'abord Ãªtre faite dans le noyau.
+.SH TRADUCTION
+Jean-Michel VANSTEENE (J.M.Vansteene@frcl.bull.fr)
diff --git a/man/fr_FR.88591/ypdomainname.1 b/man/fr_FR.88591/ypdomainname.1
new file mode 100644 (file)
index 0000000..1f45128
--- /dev/null
@@ -0,0 +1 @@
+.so man1/hostname.1
diff --git a/netstat.c b/netstat.c
new file mode 100644 (file)
index 0000000..caa2ec1
--- /dev/null
+++ b/netstat.c
@@ -0,0 +1,1654 @@
+/*
+ * netstat     This file contains an implementation of the command
+ *             that helps in debugging the networking modules.
+ *
+ * NET-TOOLS   A collection of programs that form the base set of the
+ *             NET-3 Networking Distribution for the LINUX operating
+ *             system.
+ *
+ * Version:    netstat 1.24 (1997-09-21)
+ *
+ * Authors:    Fred Baumgarten, <dc6iq@insu1.etec.uni-karlsruhe.de>
+ *             Fred N. van Kempen, <waltje@uwalt.nl.mugnet.org>
+ *             Phil Packer, <pep@wicked.demon.co.uk>
+ *             Johannes Stille, <johannes@titan.os.open.de>
+ *             Bernd Eckenfels, <net-tools@lina.inka.de>
+ *             Phil Blundell <philb@gnu.ai.mit.edu>
+ *
+ * Tuned for NET3 by:
+ *             Alan Cox, <A.Cox@swansea.ac.uk>
+ *
+ *             Copyright (c) 1993  Fred Baumgarten
+ *
+ * Modified:
+ *
+ *960116 {1.01} Bernd Eckenfels:       verbose, cleanups
+ *960204 {1.10} Bernd Eckenfels:       aftrans, usage, new route_info, 
+ *                                     DLFT_AF
+ *960204 {1.11} Bernd Eckenfels:       netlink support
+ *960204 {1.12} Bernd Eckenfels:       route_init()
+ *960215 {1.13} Bernd Eckenfels:       netlink_print honors HAVE_
+ *960217 {1.14} Bernd Eckenfels:       masq_info from Jos Vos and 
+ *                                     ax25_info from Jonathan Naylor.
+ *960218 {1.15} Bernd Eckenfels:       ipx_info rewritten, -e for tcp/ipx
+ *960220 {1.16} Bernd Eckenfels:       minor output reformats, -a for -x
+ *960221 {1.17} Bernd Eckenfels:       route_init->getroute_init
+ *960426 {1.18} Bernd Eckenfels:       new RTACTION, SYM/NUM, FIB/CACHE
+ *960517 {1.19} Bernd Eckenfels:       usage() spelling fix and --unix inode, 
+ *                                     ':' is part of sock_addr for --inet
+ *960822 {x.xx} Frank Strauss:          INET6 support
+ *
+ *970406 {1.33} Philip Copeland                Added snmp reporting support module -s
+ *                                     code provided by Andi Kleen
+ *                                     (relly needs to be kernel hooked but 
+ *                                     this will do in the meantime)
+ *                                     minor header file misplacement tidy up.
+ *
+ *             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.
+ *
+ */
+#include <errno.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <strings.h>
+#include <unistd.h>
+#include <ctype.h>
+#include <fcntl.h>
+#include <netdb.h>
+#include <paths.h>
+#include <pwd.h>
+#include <getopt.h>
+#include <sys/param.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <sys/ioctl.h>
+#include <net/if.h>
+#include <net/route.h>
+#include "net-support.h"
+#include "pathnames.h"
+#include "version.h"
+#include "config.h"
+#include "net-locale.h"
+
+/* prototypes for statistics.c */
+void parsesnmp(void);
+void inittab(void);
+
+typedef enum {
+  SS_FREE = 0,                          /* not allocated                */
+  SS_UNCONNECTED,                       /* unconnected to any socket    */
+  SS_CONNECTING,                        /* in process of connecting     */
+  SS_CONNECTED,                         /* connected to socket          */
+  SS_DISCONNECTING                      /* in process of disconnecting  */
+} socket_state;
+
+#define SO_ACCEPTCON    (1<<16)         /* performed a listen           */
+#define SO_WAITDATA     (1<<17)         /* wait data to read            */
+#define SO_NOSPACE      (1<<18)         /* no space to write            */
+
+#define DFLT_AF "inet"
+
+#define FEATURE_NETSTAT
+#include "lib/net-features.h"
+
+char *Release   = RELEASE,
+     *Version   = "netstat 1.24 (1997-09-21)",
+     *Signature = "Fred Baumgarten <dc6iq@insu1.etec.uni-karlsruhe.de> and Alan Cox.";
+
+
+#define E_READ  -1
+#define E_IOCTL -3
+
+
+/* This is from <linux/netdevice.h>. */
+
+struct net_device_stats
+{
+  unsigned long        rx_packets;             /* total packets received */
+  unsigned long        tx_packets;             /* total packets transmitted */
+  unsigned long        rx_bytes;               /* total bytes received */
+  unsigned long        tx_bytes;               /* total bytes transmitted */
+  unsigned long        rx_errors;              /* bad packets received */
+  unsigned long        tx_errors;              /* packet transmit problems */
+  unsigned long        rx_dropped;             /* no space in linux buffers */
+  unsigned long        tx_dropped;             /* no space available in linux */
+  unsigned long        multicast;              /* multicast packets received */
+  unsigned long        collisions;
+  
+  /* detailed rx_errors */
+  unsigned long        rx_length_errors;
+  unsigned long        rx_over_errors;         /* receiver ring buff overflow */
+  unsigned long        rx_crc_errors;          /* packet with crc error */
+  unsigned long        rx_frame_errors;        /* frame alignment error */
+  unsigned long        rx_fifo_errors;         /* fifo overran */
+  unsigned long        rx_missed_errors;       /* receiver missed packet */
+
+  /* detailed tx_errors */
+  unsigned long        tx_aborted_errors;
+  unsigned long        tx_carrier_errors;      /* lost carrier */
+  unsigned long        tx_fifo_errors;         /* fifo underran */
+  unsigned long        tx_heartbeat_errors;    /* heartbeat failure */
+  unsigned long        tx_window_errors;
+};
+
+
+struct interface {
+  char name[IFNAMSIZ];                 /* interface name       */
+  short flags;                         /* various flags        */
+  int metric;                          /* routing metric       */
+  int mtu;                             /* MTU value            */
+  struct sockaddr addr;                        /* IP address           */
+  struct sockaddr dstaddr;             /* P-P IP address       */
+  struct sockaddr broadaddr;           /* IP broadcast address */
+  struct sockaddr netmask;             /* IP network mask      */
+  struct sockaddr hwaddr;              /* HW address           */
+  struct net_device_stats stats;       /* statistics           */
+};
+
+int flag_nlp = 0;
+int flag_int = 0;
+int flag_rou = 0;
+int flag_mas = 0;
+
+int flag_all = 0;
+int flag_cnt = 0;
+int flag_deb = 0;
+int flag_not = 0;
+int flag_cf  = 0;
+int flag_opt = 0;
+int flag_raw = 0;
+int flag_tcp = 0;
+int flag_udp = 0;
+int flag_rom = 0;
+int flag_exp = 1;
+int flag_arg = 0;
+int flag_ver = 0;
+
+int skfd;
+FILE *procinfo;
+
+#define INFO_GUTS1(file,name,proc)                     \
+  char buffer[8192];                                   \
+  int lnr = 0;                                         \
+                                                       \
+  procinfo = fopen((file), "r");                       \
+  if (procinfo == NULL) {                              \
+    if (errno != ENOENT) {                             \
+      perror((file));                                  \
+      return(-1);                                      \
+    }                                                  \
+    if (flag_arg || flag_ver)                          \
+      ESYSNOT("netstat", (name));                      \
+    if (flag_arg)                                      \
+      return(1);                                       \
+    else                                               \
+      return(0);                                       \
+  }                                                    \
+                                                       \
+  do {                                                 \
+    if (fgets(buffer, sizeof(buffer), procinfo))       \
+      (proc)(lnr++, buffer);                           \
+  } while (!feof(procinfo));                           \
+  fclose(procinfo);
+
+#if HAVE_AFINET6
+#define INFO_GUTS2(file,proc)                          \
+  lnr = 0;                                             \
+  procinfo = fopen((file), "r");                       \
+  if (procinfo != NULL) {                              \
+    fgets(buffer, sizeof(buffer), procinfo);           \
+    do {                                               \
+      if (fgets(buffer, sizeof(buffer), procinfo))     \
+       (proc)(lnr++, buffer);                          \
+    } while (!feof(procinfo));                         \
+    fclose(procinfo);                                  \
+  }
+#else
+#define INFO_GUTS2(file,proc)
+#endif
+
+#define INFO_GUTS3                                     \
+ return(0);                                            
+
+#define INFO_GUTS6(file,file6,name,proc)               \
+ INFO_GUTS1(file,name,proc)                            \
+ INFO_GUTS2(file6,proc)                                        \
+ INFO_GUTS3
+
+#define INFO_GUTS(file,name,proc)                      \
+ INFO_GUTS1(file,name,proc)                            \
+ INFO_GUTS3
+
+#if HAVE_RT_NETLINK && 0
+static int
+netlink_print(void)
+{
+  int flag;
+#define NL_DEV   1
+#define NL_ADDR  2
+#define NL_MISC  4
+  int fd,ret;
+  struct in_rtmsg buf;
+  struct aftype *ap;
+  struct sockaddr *s;
+  
+  if ((fd = open(_PATH_DEV_ROUTE, O_RDONLY))<0) {
+    if (errno == ENODEV)       
+      ESYSNOT("netstat", _PATH_DEV_ROUTE);
+    else
+      perror(_PATH_DEV_ROUTE);
+    return(-1);
+  }
+
+  if (flag_ver) {
+    printf(NLS_CATGETS(catfd, netstatSet, netstat_nlp_title, "Netlink Kernel Messages"));
+    if (flag_cnt)
+      printf(NLS_CATGETS(catfd, netstatSet, netstat_nlp_cnt, " (continous)"));
+    printf("\n");      
+  }    
+       
+  do {
+    if ((ret=read(fd,(char *)&buf,sizeof(buf))) < 0) {
+      perror("read "_PATH_DEV_ROUTE);
+      return(-1);
+    }
+    if (ret != sizeof(buf)) {
+      EINTERN("netstat.c", "netlink message size mismatch");
+      return(-1);
+    }
+    
+       flag=0;
+       /* No NLS, keep this parseable */
+       switch(buf.rtmsg_type) {
+       case RTMSG_NEWROUTE:
+         printf("NEWROUTE\t");
+         flag=NL_DEV|NL_ADDR|NL_MISC;
+         break;
+       case RTMSG_DELROUTE:
+         printf("DELROUTE\t");
+         flag=NL_DEV|NL_ADDR|NL_MISC;
+         break;
+       case RTMSG_NEWDEVICE:
+         printf("NEWDEVICE\t");
+         flag=NL_DEV|NL_MISC;
+         break;
+       case RTMSG_DELDEVICE:
+         printf("DELDEVICE\t");
+         flag=NL_DEV|NL_MISC;
+         break;
+       default:
+         printf("UNKNOWN%lx\t",buf.rtmsg_type);
+         flag=NL_DEV|NL_ADDR|NL_MISC;
+         break;
+       }
+       
+       if (flag&NL_ADDR) {
+         s=&buf.rtmsg_dst;
+         ap = get_afntype(s->sa_family);
+         if (ap == NULL) ap = get_afntype(0);
+         
+         printf("%s/%s ",ap->sprint(s, flag_not), ap->name);
+         
+         s=&buf.rtmsg_gateway;
+         ap = get_afntype(s->sa_family);
+         if (ap == NULL) ap = get_afntype(0);
+         
+         printf("%s/%s ",ap->sprint(s, flag_not), ap->name);
+         
+         s=&buf.rtmsg_genmask;
+         ap = get_afntype(s->sa_family);
+         if (ap == NULL) ap = get_afntype(0);
+         
+         printf("%s/%s ",ap->sprint(s, 1), ap->name);
+       }
+       if (flag&NL_MISC) {
+         printf("0x%x %d ",buf.rtmsg_flags,buf.rtmsg_metric);
+       }
+       if (flag&NL_DEV) {
+         printf("%s",buf.rtmsg_device);
+       }
+       printf("\n");
+  } while(flag_cnt);
+  close(fd);
+  return(0);
+}
+#endif
+
+
+#if HAVE_AFNETROM
+static const char *netrom_state[]=
+{
+  "LISTENING",
+  "CONN SENT",
+  "DISC SENT",
+  "ESTABLISHED"
+};
+
+static int netrom_info(void)
+{
+  FILE *f;
+  char buffer[256],dev[16];
+  int st,vs,vr,sendq,recvq;
+
+  f = fopen(_PATH_PROCNET_NR, "r");
+  if (f == NULL) {
+    if (errno != ENOENT) {
+      perror(_PATH_PROCNET_NR);
+      return(-1);
+    }
+    if (flag_arg || flag_ver)
+      ESYSNOT("netstat","AF NETROM");
+    if (flag_arg)
+      return(1);
+    else
+      return(0);
+  }
+  
+  printf(NLS_CATGETS(catfd, netstatSet, netstat_netrom, "Activate NET/ROM sockets\n"));
+  printf(NLS_CATGETS(catfd, netstatSet, netstat_header_netrom, "User       Dest       Source     Device  State        Vr/Vs  Send-Q  Recv-Q\n"));
+  fgets(buffer,256,f);
+  while (fgets(buffer,256,f)) {
+    buffer[9]=0;
+    buffer[19]=0;
+    buffer[29]=0;
+    sscanf(buffer+30,"%s %*d/%*d %*d/%*d %d %d %d %*d %*d/%*d %*d/%*d %*d/%*d %*d %*d %d %d",
+          dev,&st,&vs,&vr,&sendq,&recvq);
+    printf("%-9s  %-9s  %-9s  %-6s  %-11s  %02d/%02d  %-6d  %-6d\n",
+          buffer,buffer+10,buffer+20,
+          dev,
+          netrom_state[st],
+          vr,vs,sendq,recvq);
+  }
+  fclose(f);
+  return 0;            
+}
+#endif
+
+
+#if HAVE_AFINET
+
+enum {
+  TCP_ESTABLISHED = 1,
+  TCP_SYN_SENT,
+  TCP_SYN_RECV,
+  TCP_FIN_WAIT1,
+  TCP_FIN_WAIT2,
+  TCP_TIME_WAIT,
+  TCP_CLOSE,
+  TCP_CLOSE_WAIT,
+  TCP_LAST_ACK,
+  TCP_LISTEN,
+  TCP_CLOSING   /* now a valid state */
+};
+
+static const char *tcp_state[] = {
+  "",
+  "ESTABLISHED",
+  "SYN_SENT",
+  "SYN_RECV",
+  "FIN_WAIT1",
+  "FIN_WAIT2",
+  "TIME_WAIT",
+  "CLOSE",
+  "CLOSE_WAIT",
+  "LAST_ACK",
+  "LISTEN",
+  "CLOSING"
+};
+
+static void tcp_do_one(int lnr, const char *line)
+{
+  unsigned long rxq, txq, time_len, retr;
+  int num, local_port, rem_port, d, state, uid, timer_run;
+  char rem_addr[128], local_addr[128], timers[64], buffer[1024];
+  struct aftype *ap;
+  struct passwd *pw;
+#if HAVE_AFINET6
+  struct sockaddr_in6 localaddr, remaddr;
+  char addr6p[16][3], addr6[128];
+  extern struct aftype inet6_aftype;
+#else
+  struct sockaddr_in localaddr, remaddr;
+#endif
+
+  if (lnr == 0) 
+    return;
+  
+  num = sscanf(line,
+         "%d: %[0-9A-Fa-f]:%X %[0-9A-Fa-f]:%X %X %lX:%lX %X:%lX %lX %d\n",
+         &d, local_addr, &local_port, rem_addr, &rem_port, &state,
+         &txq, &rxq, &timer_run, &time_len, &retr, &uid);
+  
+  if (strlen(local_addr) > 8) {
+#if HAVE_AFINET6
+    /* Demangle what the kernel gives us */
+    sscanf(local_addr, 
+          "%2s%2s%2s%2s%2s%2s%2s%2s%2s%2s%2s%2s%2s%2s%2s%2s",
+          addr6p[0], addr6p[1], addr6p[2], addr6p[3],
+          addr6p[4], addr6p[5], addr6p[6], addr6p[7],
+          addr6p[8], addr6p[9], addr6p[10], addr6p[11],
+          addr6p[12], addr6p[13], addr6p[14], addr6p[15]);
+    sprintf(addr6, "%s%s:%s%s:%s%s:%s%s:%s%s:%s%s:%s%s:%s%s",
+           addr6p[3], addr6p[2], addr6p[1], addr6p[0],
+           addr6p[7], addr6p[6], addr6p[5], addr6p[4],
+           addr6p[11], addr6p[10], addr6p[9], addr6p[8],
+           addr6p[15], addr6p[14], addr6p[13], addr6p[12]);
+         inet6_aftype.input(1, addr6, (struct sockaddr *)&localaddr);
+         sscanf(rem_addr, 
+                "%2s%2s%2s%2s%2s%2s%2s%2s%2s%2s%2s%2s%2s%2s%2s%2s",
+                addr6p[0], addr6p[1], addr6p[2], addr6p[3],
+                addr6p[4], addr6p[5], addr6p[6], addr6p[7],
+                addr6p[8], addr6p[9], addr6p[10], addr6p[11],
+                addr6p[12], addr6p[13], addr6p[14], addr6p[15]);
+         sprintf(addr6, "%s%s:%s%s:%s%s:%s%s:%s%s:%s%s:%s%s:%s%s",
+                 addr6p[3], addr6p[2], addr6p[1], addr6p[0],
+                 addr6p[7], addr6p[6], addr6p[5], addr6p[4],
+                 addr6p[11], addr6p[10], addr6p[9], addr6p[8],
+                 addr6p[15], addr6p[14], addr6p[13], addr6p[12]);
+         inet6_aftype.input(1, addr6, (struct sockaddr *)&remaddr);
+         localaddr.sin6_family = AF_INET6;
+         remaddr.sin6_family = AF_INET6;
+#endif
+  } else {
+    sscanf(local_addr, "%X",
+          &((struct sockaddr_in *)&localaddr)->sin_addr.s_addr);
+    sscanf(rem_addr, "%X",
+          &((struct sockaddr_in *)&remaddr)->sin_addr.s_addr);
+    ((struct sockaddr *)&localaddr)->sa_family = AF_INET;
+    ((struct sockaddr *)&remaddr)->sa_family = AF_INET;
+  }
+
+  if (num < 11) {
+    fprintf(stderr, "warning, got bogus tcp line.\n");
+    return; 
+  }
+
+  if ((ap = get_afntype(((struct sockaddr *)&localaddr)->sa_family)) == NULL) {
+    fprintf(stderr, NLS_CATGETS(catfd, netstatSet, netstat_netstat,
+                               "netstat: unsupported address family %d !\n"),
+           ((struct sockaddr *)&localaddr)->sa_family);
+    return;
+  }
+
+  if (state == TCP_LISTEN) {
+    time_len = 0;
+    retr = 0L;
+    rxq=0L;
+    txq=0L;
+  }
+         
+  strcpy(local_addr, ap->sprint((struct sockaddr *)&localaddr, flag_not));
+  strcpy(rem_addr, ap->sprint((struct sockaddr *)&remaddr, flag_not));
+  if (flag_all || rem_port) {
+    sprintf(buffer, "%s", get_sname(htons(local_port), "tcp", flag_not));
+
+    if ((strlen(local_addr) + strlen(buffer)) > 22) 
+      local_addr[22-strlen(buffer)] = '\0';
+
+    strcat(local_addr, ":");
+    strcat(local_addr, buffer);
+    sprintf(buffer,  "%s", get_sname(htons(rem_port), "tcp", flag_not));
+
+    if ((strlen(rem_addr) + strlen(buffer)) > 22)
+      rem_addr[22-strlen(buffer)] = '\0';
+  
+    strcat(rem_addr, ":");
+    strcat(rem_addr, buffer);
+    timers[0] = '\0';
+
+    if (flag_opt) 
+      switch (timer_run) {
+      case 0:
+       sprintf(timers, NLS_CATGETS(catfd, netstatSet, netstat_off,
+                                   "off (0.00/%ld)"), retr);
+       break;
+       
+      case 1:
+       sprintf(timers, NLS_CATGETS(catfd, netstatSet, netstat_on,
+                                   "on (%2.2f/%ld)"),
+               (double)time_len / 100, retr);
+       break;
+       
+      default:
+       sprintf(timers, NLS_CATGETS(catfd, netstatSet, netstat_unkn,
+                                   "unkn-%d (%2.2f/%ld)"),
+               timer_run, (double)time_len / 100, retr);
+       break;
+      }
+    printf("tcp   %6ld %6ld %-23s %-23s %-12s",
+          rxq, txq, local_addr, rem_addr, tcp_state[state]);
+    
+    if (flag_exp > 1) {
+      if (!flag_not && ((pw = getpwuid(uid)) != NULL))
+       printf("%-10s ", pw->pw_name);
+      else
+       printf("%-10d ", uid);
+    }
+    
+    if (flag_opt) printf("%s", timers);
+    printf("\n");
+  }
+}
+
+static int
+tcp_info(void)
+{
+  INFO_GUTS6(_PATH_PROCNET_TCP, _PATH_PROCNET_TCP6, "AF INET (tcp)",
+            tcp_do_one);
+}
+
+static void udp_do_one(int lnr, const char *line)
+{
+  char buffer[8192], local_addr[64], rem_addr[64];
+  char *udp_state, timer_queued, timers[64], more[512];
+  int num, local_port, rem_port, d, state, timer_run;
+#if HAVE_AFINET6
+  struct sockaddr_in6 localaddr, remaddr;
+  char addr6p[8][5];
+  char addr6[128];
+  extern struct aftype inet6_aftype;
+#else
+  struct sockaddr_in localaddr, remaddr;
+#endif
+  struct aftype *ap;
+  unsigned long rxq, txq, time_len, retr;
+
+  if (lnr == 0)
+    return;
+
+  more[0] = '\0';
+  timer_queued = '\0';
+  num = sscanf(line,
+        "%d: %[0-9A-Fa-f]:%X %[0-9A-Fa-f]:%X %X %lX:%lX %X:%lX %lX %c %s\n",
+        &d, local_addr, &local_port,
+        rem_addr, &rem_port, &state,
+        &txq, &rxq, &timer_run, &time_len, &retr, &timer_queued, more);
+       
+  if (strlen(local_addr) > 8) {
+#if HAVE_AFINET6
+    sscanf(local_addr, "%4s%4s%4s%4s%4s%4s%4s%4s",
+          addr6p[0], addr6p[1], addr6p[2], addr6p[3],
+          addr6p[4], addr6p[5], addr6p[6], addr6p[7]);
+    sprintf(addr6, "%s:%s:%s:%s:%s:%s:%s:%s",
+           addr6p[0], addr6p[1], addr6p[2], addr6p[3],
+           addr6p[4], addr6p[5], addr6p[6], addr6p[7]);
+    inet6_aftype.input(1, addr6, (struct sockaddr *)&localaddr);
+    sscanf(rem_addr, "%4s%4s%4s%4s%4s%4s%4s%4s",
+          addr6p[0], addr6p[1], addr6p[2], addr6p[3],
+          addr6p[4], addr6p[5], addr6p[6], addr6p[7]);
+    sprintf(addr6, "%s:%s:%s:%s:%s:%s:%s:%s",
+           addr6p[0], addr6p[1], addr6p[2], addr6p[3],
+           addr6p[4], addr6p[5], addr6p[6], addr6p[7]);
+    inet6_aftype.input(1, addr6, (struct sockaddr *)&remaddr);
+    localaddr.sin6_family = AF_INET6;
+    remaddr.sin6_family = AF_INET6;
+#endif
+  } else {
+    sscanf(local_addr, "%X",
+          &((struct sockaddr_in *)&localaddr)->sin_addr.s_addr);
+    sscanf(rem_addr, "%X",
+          &((struct sockaddr_in *)&remaddr)->sin_addr.s_addr);
+    ((struct sockaddr *)&localaddr)->sa_family = AF_INET;
+    ((struct sockaddr *)&remaddr)->sa_family = AF_INET;
+  }
+
+  retr = 0L;
+  if (!flag_opt) 
+    more[0] = '\0';
+  
+  if (num < 10) {
+    fprintf(stderr, "warning, got bogus udp line.\n");
+    return;
+  }
+  
+  if ((ap = get_afntype(((struct sockaddr *)&localaddr)->sa_family)) == NULL) {
+    fprintf(stderr, NLS_CATGETS(catfd, netstatSet, netstat_netstat,
+                               "netstat: unsupported address family %d !\n"),
+           ((struct sockaddr *)&localaddr)->sa_family);
+    return;
+  }
+  
+  switch (state) {
+  case TCP_ESTABLISHED:
+    udp_state = "ESTABLISHED";
+    break;
+    
+  case TCP_CLOSE:
+    udp_state = "";
+    break;
+    
+  default:
+    udp_state = "UNKNOWN";
+    break;
+  }
+  
+  strcpy(local_addr, ap->sprint((struct sockaddr *)&localaddr, flag_not));
+  strcpy(rem_addr, ap->sprint((struct sockaddr *)&remaddr, flag_not));
+#if HAVE_AFINET6
+  if (flag_all ||
+           ((localaddr.sin6_family == AF_INET6) &&
+            ((localaddr.sin6_addr.s6_addr32[0])||
+             (localaddr.sin6_addr.s6_addr32[1])||
+             (localaddr.sin6_addr.s6_addr32[2])||
+             (localaddr.sin6_addr.s6_addr32[3]))) ||
+      ((localaddr.sin6_family == AF_INET) &&
+       ((struct sockaddr_in *)&localaddr)->sin_addr.s_addr)) 
+#else
+  if (flag_all || localaddr.sin_addr.s_addr) 
+#endif
+  {
+    sprintf(buffer, "%s", get_sname(htons(local_port), "udp", flag_not));
+    if ((strlen(local_addr) + strlen(buffer)) > 22) 
+      local_addr[22-strlen(buffer)] = '\0';
+    
+    strcat(local_addr, ":");
+    strcat(local_addr, buffer);
+    sprintf(buffer, "%s", get_sname(htons(rem_port), "udp", flag_not));
+    if ((strlen(rem_addr) + strlen(buffer)) > 22) 
+      rem_addr[22-strlen(buffer)] = '\0';
+    
+    strcat(rem_addr, ":");
+    strcat(rem_addr, buffer);
+    
+    timers[0] = '\0';
+    if (flag_opt) switch (timer_run) {
+    case 0:
+      sprintf(timers, NLS_CATGETS(catfd, netstatSet, netstat_off2,
+                                 "off (0.00/%ld) %c"),
+             retr, timer_queued);
+      break;
+      
+    case 1:
+      sprintf(timers, NLS_CATGETS(catfd, netstatSet, netstat_on2,
+                                 "on (%2.2f/%ld) %c"),
+             (double)time_len / 100, retr, timer_queued);
+      break;
+      
+    default:
+      sprintf(timers, NLS_CATGETS(catfd, netstatSet, netstat_unkn2,
+                                 "unkn-%d (%2.2f/%ld) %c"),
+             timer_run, (double)time_len / 100,
+             retr, timer_queued);
+      break;
+    }
+    printf("udp   %6ld %6ld %-23s %-23s %-12s",
+          rxq, txq, local_addr, rem_addr, udp_state);
+    
+    if (flag_exp > 1)
+      printf("%-10s ", "");
+    
+    if (flag_opt) printf("%s", timers);
+    printf("\n");
+  }
+}  
+
+static int
+udp_info(void)
+{
+  INFO_GUTS6(_PATH_PROCNET_UDP, _PATH_PROCNET_UDP6, "AF INET (udp)", 
+            udp_do_one);
+}
+
+static void raw_do_one(int lnr, const char *line)
+{
+  char buffer[8192], local_addr[64], rem_addr[64];
+  char *raw_state, timer_queued, timers[64], more[512];
+  int num, local_port, rem_port, d, state, timer_run;
+#if HAVE_AFINET6
+  struct sockaddr_in6 localaddr, remaddr;
+  char addr6p[8][5];
+  char addr6[128];
+  extern struct aftype inet6_aftype;
+#else
+  struct sockaddr_in localaddr, remaddr;
+#endif
+  struct aftype *ap;
+  unsigned long rxq, txq, time_len, retr;
+
+  if (lnr == 0)
+    return;
+
+  more[0] = '\0';
+  timer_queued = '\0';
+  num = sscanf(line,
+          "%d: %[0-9A-Fa-f]:%X %[0-9A-Fa-f]:%X %X %lX:%lX %X:%lX %lX %c %s\n",
+          &d, local_addr, &local_port, rem_addr, &rem_port, &state,
+          &txq, &rxq, &timer_run, &time_len, &retr, &timer_queued, more);
+  
+  if (strlen(local_addr) > 8) {
+#if HAVE_AFINET6
+    sscanf(local_addr, "%4s%4s%4s%4s%4s%4s%4s%4s",
+          addr6p[0], addr6p[1], addr6p[2], addr6p[3],
+          addr6p[4], addr6p[5], addr6p[6], addr6p[7]);
+    sprintf(addr6, "%s:%s:%s:%s:%s:%s:%s:%s",
+           addr6p[0], addr6p[1], addr6p[2], addr6p[3],
+           addr6p[4], addr6p[5], addr6p[6], addr6p[7]);
+    inet6_aftype.input(1, addr6, (struct sockaddr *)&localaddr);
+    sscanf(rem_addr, "%4s%4s%4s%4s%4s%4s%4s%4s",
+          addr6p[0], addr6p[1], addr6p[2], addr6p[3],
+          addr6p[4], addr6p[5], addr6p[6], addr6p[7]);
+    sprintf(addr6, "%s:%s:%s:%s:%s:%s:%s:%s",
+           addr6p[0], addr6p[1], addr6p[2], addr6p[3],
+           addr6p[4], addr6p[5], addr6p[6], addr6p[7]);
+    inet6_aftype.input(1, addr6, (struct sockaddr *)&remaddr);
+    localaddr.sin6_family = AF_INET6;
+    remaddr.sin6_family = AF_INET6;
+#endif
+  } else {
+    sscanf(local_addr, "%X",
+          &((struct sockaddr_in *)&localaddr)->sin_addr.s_addr);
+    sscanf(rem_addr, "%X",
+          &((struct sockaddr_in *)&remaddr)->sin_addr.s_addr);
+    ((struct sockaddr *)&localaddr)->sa_family = AF_INET;
+    ((struct sockaddr *)&remaddr)->sa_family = AF_INET;
+  }
+#if HAVE_AFINET6
+  if ((ap = get_afntype(localaddr.sin6_family)) == NULL) {
+    fprintf(stderr, NLS_CATGETS(catfd, netstatSet, netstat_netstat,
+                               "netstat: unsupported address family %d !\n"),
+           localaddr.sin6_family);
+    return;
+  }
+#else
+  if ((ap = get_afntype(localaddr.sin_family)) == NULL) {
+    fprintf(stderr, NLS_CATGETS(catfd, netstatSet, netstat_netstat,
+                               "netstat: unsupported address family %d !\n"),
+           localaddr.sin_family);
+    return;
+  }
+#endif  
+
+  if (!flag_opt) 
+    more[0] = '\0';
+
+  if (num < 10) {
+    fprintf(stderr, "warning, got bogus raw line.\n");
+    return;
+  }
+
+  raw_state = "";
+  strcpy(local_addr, ap->sprint((struct sockaddr *)&localaddr, flag_not));
+  strcpy(rem_addr, ap->sprint((struct sockaddr *)&remaddr, flag_not));
+#if HAVE_AFINET6
+  if (flag_all ||
+      ((localaddr.sin6_family == AF_INET6) &&
+       ((localaddr.sin6_addr.s6_addr32[0])||
+       (localaddr.sin6_addr.s6_addr32[1])||
+       (localaddr.sin6_addr.s6_addr32[2])||
+       (localaddr.sin6_addr.s6_addr32[3]))) ||
+      ((localaddr.sin6_family == AF_INET) &&
+       ((struct sockaddr_in *)&localaddr)->sin_addr.s_addr))
+#else
+  if (flag_all || localaddr.sin_addr.s_addr) 
+#endif
+  {
+    sprintf(buffer, "%s", get_sname(htons(local_port), "raw", flag_not));
+    if ((strlen(local_addr) + strlen(buffer)) > 22) 
+      local_addr[22-strlen(buffer)] = '\0';
+   
+    strcat(local_addr, ":");
+    strcat(local_addr, buffer);
+    sprintf(buffer, "%s", get_sname(htons(rem_port), "raw", flag_not));
+    if ((strlen(rem_addr) + strlen(buffer)) > 22) 
+      rem_addr[22-strlen(buffer)] = '\0';
+    
+    strcat(rem_addr, ":");
+    strcat(rem_addr, buffer);
+    
+    timers[0] = '\0';
+    if (flag_opt) switch (timer_run) {
+    case 0:
+      sprintf(timers, NLS_CATGETS(catfd, netstatSet, netstat_off3,
+                                 "off (0.00/%ld) %c"),
+             retr, timer_queued);
+      break;
+      
+    case 1:
+      sprintf(timers, NLS_CATGETS(catfd, netstatSet, netstat_on3,
+                                 "on (%2.2f/%ld) %c"),
+             (double)time_len / 100, retr,
+             timer_queued);
+       break;
+       
+    default:
+      sprintf(timers, NLS_CATGETS(catfd, netstatSet, netstat_unkn3,
+                                 "unkn-%d (%2.2f/%ld) %c"),
+             timer_run, (double)time_len / 100,
+             retr, timer_queued);
+      break;
+    }
+      printf("raw   %6ld %6ld %-23s %-23s %-12s",
+            rxq, txq, local_addr, rem_addr, raw_state);
+      
+      if (flag_exp > 1)
+       printf("%-10s ", "");
+      
+      if (flag_opt) printf("%s", timers);
+      printf("\n");
+  }
+}
+
+static int
+raw_info(void)
+{
+  INFO_GUTS6(_PATH_PROCNET_RAW, _PATH_PROCNET_RAW6, "AF INET (raw)",
+            raw_do_one);
+}
+#endif
+
+
+#if HAVE_AFUNIX
+
+#define HAS_INODE 1
+
+static void unix_do_one(int nr, const char *line)
+{
+  static int has = 0;
+  char inode[MAXPATHLEN], path[MAXPATHLEN], ss_flags[32];
+  char *ss_proto, *ss_state, *ss_type;
+  int num, state, type;
+  void *d;
+  unsigned long refcnt, proto, flags;
+
+  if (nr == 0) {
+    if (strstr(line, "Inode"))
+      has |= HAS_INODE;
+    return;
+  }
+
+  path[0] = '\0';
+  inode[0] = '\0';
+  num = sscanf(line, "%p: %lX %lX %lX %X %X %s %s",
+              &d, &refcnt, &proto, &flags, &type, &state, inode, path);
+  if (num < 6) {
+    fprintf(stderr, "warning, got bogus unix line.\n");
+    return;
+  }
+
+  if (!(has&HAS_INODE)) {
+    strcpy(path,inode);
+    strcpy(inode,"-");
+  }
+  if (!flag_all && (state == SS_UNCONNECTED) && (flags & SO_ACCEPTCON))
+    return;
+  
+  switch(proto) {
+  case 0:
+    ss_proto = "unix";
+    break;
+    
+  default:
+    ss_proto = "??";
+  }
+  
+  switch(type) {
+  case SOCK_STREAM:
+    ss_type = "STREAM";
+    break;
+    
+  case SOCK_DGRAM:
+    ss_type = "DGRAM";
+    break;
+    
+  case SOCK_RAW:
+    ss_type = "RAW";
+    break;
+    
+  case SOCK_RDM:
+    ss_type = "RDM";
+    break;
+    
+  case SOCK_SEQPACKET:
+    ss_type = "SEQPACKET";
+    break;
+    
+  default:
+    ss_type = "UNKNOWN";
+  }
+  
+  switch(state) {
+  case SS_FREE:
+    ss_state = "FREE";
+    break;
+    
+  case SS_UNCONNECTED:
+    /*
+     * Unconnected sockets may be listening
+     * for something.
+     */
+    if (flags & SO_ACCEPTCON) {
+      ss_state = "LISTENING";
+    } else {
+      ss_state = "";
+    }
+    break;
+    
+  case SS_CONNECTING:
+    ss_state = "CONNECTING";
+    break;
+    
+  case SS_CONNECTED:
+    ss_state = "CONNECTED";
+    break;
+    
+  case SS_DISCONNECTING:
+    ss_state = "DISCONNECTING";
+    break;
+    
+  default:
+    ss_state = "UNKNOWN";
+  }
+  
+  strcpy(ss_flags, "[ ");
+  if (flags & SO_ACCEPTCON) strcat(ss_flags, "ACC ");
+  if (flags & SO_WAITDATA) strcat(ss_flags, "W ");
+  if (flags & SO_NOSPACE) strcat(ss_flags, "N ");
+  
+  strcat(ss_flags, "]");
+  
+  printf("%-5s %-6ld %-11s %-10s %-13s %-6s %s\n",
+        ss_proto, refcnt, ss_flags, ss_type, ss_state, inode, path);
+}
+
+static int
+unix_info(void)
+{
+  
+  printf(NLS_CATGETS(catfd, netstatSet, netstat_unix, "Active UNIX domain sockets ")); /* xxx */
+  if (flag_all) printf(NLS_CATGETS(catfd, netstatSet, netstat_servers, "(including servers)")); /* xxx */
+           else printf(NLS_CATGETS(catfd, netstatSet, netstat_noservers, "(w/o servers)")); /* xxx */
+
+  printf(NLS_CATGETS(catfd, netstatSet, netstat_header_unix,
+                    "\nProto RefCnt Flags       Type       State         I-Node Path\n")); /* xxx */
+
+  {
+    INFO_GUTS(_PATH_PROCNET_UNIX, "AF UNIX", unix_do_one);
+  }
+}
+#endif
+
+
+#if HAVE_AFAX25
+static int ax25_info(void)
+{
+       FILE *f=fopen(_PATH_PROCNET_AX25, "r");
+       char buffer[256],dev[16];
+       int st,vs,vr,sendq,recvq;
+       static char *ax25_state[5]=
+       {
+               "LISTENING",
+               "SABM SENT",
+               "DISC SENT",
+               "ESTABLISHED",
+               "RECOVERY"
+       };
+       if(!(f=fopen(_PATH_PROCNET_AX25, "r")))
+       {
+               if (errno != ENOENT) {
+                       perror(_PATH_PROCNET_AX25);
+                       return(-1);
+               }
+               if (flag_arg || flag_ver)
+                       ESYSNOT("netstat","AF AX25");
+               if (flag_arg)
+                       return(1);
+               else
+                       return(0);
+       }
+       printf(NLS_CATGETS(catfd, netstatSet, netstat_ax25, "Activate AX.25 sockets\n"));
+       printf(NLS_CATGETS(catfd, netstatSet, netstat_header_ax25, "Dest       Source     Device  State        Vr/Vs  Send-Q  Recv-Q\n"));
+       fgets(buffer,256,f);
+       while(fgets(buffer,256,f))
+       {
+               buffer[9]=0;
+               buffer[19]=0;
+               sscanf(buffer+20,"%s %d %d %d %*d %*d/%*d %*d/%*d %*d/%*d %*d/%*d %*d %*d %d %d",
+                       dev,&st,&vs,&vr,&sendq,&recvq);
+               printf("%-9s  %-9s  %-6s  %-11s  %02d/%02d  %-6d  %-6d\n",
+                       buffer,buffer+10,
+                       dev,
+                       ax25_state[st],
+                       vr,vs,sendq,recvq);
+       }
+       fclose(f);
+       return 0;               
+}
+#endif
+
+
+#if HAVE_AFIPX
+static int ipx_info(void)
+{
+       FILE *f;
+       char buf[256];
+       unsigned long txq,rxq;
+       unsigned int state;
+       unsigned int uid;
+       char *st;
+       int nc;
+       struct aftype *ap;
+       struct passwd *pw;
+       char sad[50],dad[50];
+       struct sockaddr sa;
+       unsigned sport=0,dport=0;
+                       
+       if(!(f=fopen(_PATH_PROCNET_IPX,"r")))
+       {
+               if (errno != ENOENT) {
+                       perror(_PATH_PROCNET_IPX);
+                       return(-1);
+               }
+               if (flag_arg || flag_ver)
+                       ESYSNOT("netstat","AF IPX");
+               if (flag_arg)
+                       return(1);
+               else
+                       return(0);
+       }
+       printf(NLS_CATGETS(catfd, netstatSet, netstat_header_ipx,
+                  "Active IPX sockets\nProto Recv-Q Send-Q Local Address              Foreign Address            State")); /* xxx */
+       if (flag_exp>1)
+               printf(NLS_CATGETS(catfd, netstatSet, netstat_header_ipx2,
+                       " User")); /* xxx */
+       printf("\n");
+       if ((ap = get_afntype(AF_IPX)) == NULL) {
+               EINTERN("netstat.c","AF_IPX missing");
+               return(-1);
+       }
+
+       fgets(buf,255,f);
+       
+       while(fgets(buf,255,f)!=NULL)
+       {
+               sscanf(buf, "%s %s %lX %lX %d %d",
+                       sad,dad,&txq,&rxq,&state,&uid);
+               if ((st = rindex(sad,':'))) {
+                       *st++ = '\0';
+                       sscanf(st,"%X",&sport); /* net byt order */
+                       sport = ntohs(sport);
+               } else {
+                       EINTERN("netstat.c",_PATH_PROCNET_IPX" sport format error");
+                       return(-1);
+               }
+               nc = 0;
+               if (strcmp(dad,"Not_Connected")!=0) {
+                       if ((st = rindex(dad,':'))) {
+                               *st++ = '\0';
+                               sscanf(st,"%X",&dport); /* net byt order */
+                               dport = ntohs(dport);
+                       } else {
+                               EINTERN("netstat.c",_PATH_PROCNET_IPX" dport format error");
+                               return(-1);
+                       }
+               } else
+                       nc = 1;
+                       
+               switch(state)
+               {
+                       case TCP_ESTABLISHED:
+                               st = "ESTAB";
+                               break;
+
+                       case TCP_CLOSE:
+                               st = "";
+                               break;
+
+                       default:
+                               st = "UNK.";
+                               break;
+               }
+
+               /* Fetch and resolve the Source */
+               (void)ap->input(4,sad,&sa);
+               strcpy(buf, ap->sprint(&sa, flag_not));
+               sprintf(sad,"%s:%04X",buf,sport);
+
+               if (!nc) {
+                       /* Fetch and resolve the Destination */
+                       (void)ap->input(4,dad,&sa);
+                       strcpy(buf, ap->sprint(&sa, flag_not));
+                       sprintf(dad,"%s:%04X",buf,dport);
+               } else strcpy(dad,"-");
+
+               printf("IPX   %6ld %6ld %-26s %-26s %-5s", txq, rxq, sad, dad, st);
+               if (flag_exp>1) {
+                       if (!flag_not && ((pw = getpwuid(uid)) != NULL))
+                               printf(" %-10s", pw->pw_name);
+                       else
+                               printf(" %-10d",uid);
+               }
+               printf("\n");
+       }
+       fclose(f);
+       return 0;
+}      
+#endif
+
+static void
+ife_print(struct interface *ptr)
+{
+  printf("%-5.5s ", ptr->name);
+  printf("%5d %3d ", ptr->mtu, ptr->metric);
+  /* If needed, display the interface statistics. */
+  printf("%6lu %6lu %6lu %6lu ",
+        ptr->stats.rx_packets, ptr->stats.rx_errors,
+        ptr->stats.rx_dropped, ptr->stats.rx_fifo_errors);
+  printf("%6lu %6lu %6lu %6lu ",
+        ptr->stats.tx_packets, ptr->stats.tx_errors,
+        ptr->stats.tx_dropped, ptr->stats.tx_fifo_errors);
+  if (ptr->flags == 0) printf(NLS_CATGETS(catfd, netstatSet, netstat_noflags, "[NO FLAGS]"));
+  if (ptr->flags & IFF_ALLMULTI) printf("A");
+  if (ptr->flags & IFF_BROADCAST) printf("B");
+  if (ptr->flags & IFF_DEBUG) printf("D");
+  if (ptr->flags & IFF_LOOPBACK) printf("L");
+  if (ptr->flags & IFF_PROMISC) printf("M");
+  if (ptr->flags & IFF_NOTRAILERS) printf("N");
+  if (ptr->flags & IFF_NOARP) printf("O");
+  if (ptr->flags & IFF_POINTOPOINT) printf("P");
+  if (ptr->flags & IFF_RUNNING) printf("R");
+  if (ptr->flags & IFF_UP) printf("U");
+  printf("\n");
+}
+
+static void if_getstats(char *ifname, struct interface *ife)
+{
+  FILE *f=fopen("/proc/net/dev","r");
+  int have_byte_counters=0;
+  char buf[256];
+  char *bp;
+  if(f==NULL)
+       return;
+  fgets(buf, 255, f);  /* throw away first line of header */
+  fgets(buf, 255, f);
+  if (strstr(buf, "bytes")) have_byte_counters=1;
+  while(fgets(buf,255,f))
+  {
+       bp=buf;
+       while(*bp&&isspace(*bp))
+               bp++;
+       if(strncmp(bp,ifname,strlen(ifname))==0 && bp[strlen(ifname)]==':')
+       {
+               bp=strchr(bp,':');
+               bp++;
+               if (have_byte_counters) {
+                 sscanf(bp,"%ld %ld %ld %ld %ld %ld %ld %ld %ld %ld %ld %ld %ld",
+                        &ife->stats.rx_bytes,
+                        &ife->stats.rx_packets,
+                        &ife->stats.rx_errors,
+                        &ife->stats.rx_dropped,
+                        &ife->stats.rx_fifo_errors,
+                        &ife->stats.rx_frame_errors,
+                        
+                        &ife->stats.tx_bytes,
+                        &ife->stats.tx_packets,
+                        &ife->stats.tx_errors,
+                        &ife->stats.tx_dropped,
+                        &ife->stats.tx_fifo_errors,
+                        &ife->stats.collisions,
+                        
+                        &ife->stats.tx_carrier_errors
+                        );
+               } else {
+                 sscanf(bp,"%ld %ld %ld %ld %ld %ld %ld %ld %ld %ld %ld",
+                        &ife->stats.rx_packets,
+                        &ife->stats.rx_errors,
+                        &ife->stats.rx_dropped,
+                        &ife->stats.rx_fifo_errors,
+                        &ife->stats.rx_frame_errors,
+                        
+                        &ife->stats.tx_packets,
+                        &ife->stats.tx_errors,
+                        &ife->stats.tx_dropped,
+                        &ife->stats.tx_fifo_errors,
+                        &ife->stats.collisions,
+                        
+                        &ife->stats.tx_carrier_errors
+                        );
+                 ife->stats.rx_bytes = 0;
+                 ife->stats.tx_bytes = 0;
+               }
+               fclose(f);
+               return;
+       }
+  }
+  fclose(f);
+}
+  
+/* Fetch the inteface configuration from the kernel. */
+static int
+if_fetch(char *ifname, struct interface *ife)
+{
+  struct ifreq ifr;
+  
+  memset((char *) ife, 0, sizeof(struct interface));
+  strcpy(ife->name, ifname);
+  
+  strcpy(ifr.ifr_name, ifname);
+  if (ioctl(skfd, SIOCGIFFLAGS, &ifr) < 0) {
+       fprintf(stderr, "SIOCGIFFLAGS: %s\n", strerror(errno));
+       return(-1);
+  }
+  ife->flags = ifr.ifr_flags;
+  
+  strcpy(ifr.ifr_name, ifname);
+  if (ioctl(skfd, SIOCGIFADDR, &ifr) < 0) {
+       memset(&ife->addr, 0, sizeof(struct sockaddr));
+  } else ife->addr = ifr.ifr_addr;
+  
+  strcpy(ifr.ifr_name, ifname);
+  if (ioctl(skfd, SIOCGIFHWADDR, &ifr) < 0) {
+       memset(&ife->hwaddr, 0, sizeof(struct sockaddr));
+  } else ife->hwaddr = ifr.ifr_addr;
+  
+  strcpy(ifr.ifr_name, ifname);
+  if (ioctl(skfd, SIOCGIFMETRIC, &ifr) < 0) {
+       ife->metric = 0;
+  } else ife->metric = ifr.ifr_metric;
+  
+  strcpy(ifr.ifr_name, ifname);
+  if (ioctl(skfd, SIOCGIFMTU, &ifr) < 0) {
+       ife->mtu = 0;
+  } else ife->mtu = ifr.ifr_mtu;
+  
+  strcpy(ifr.ifr_name, ifname);
+  if (ioctl(skfd, SIOCGIFDSTADDR, &ifr) < 0) {
+       memset(&ife->dstaddr, 0, sizeof(struct sockaddr));
+  } else ife->dstaddr = ifr.ifr_dstaddr;
+  
+  strcpy(ifr.ifr_name, ifname);
+  if (ioctl(skfd, SIOCGIFBRDADDR, &ifr) < 0) {
+       memset(&ife->broadaddr, 0, sizeof(struct sockaddr));
+  } else ife->broadaddr = ifr.ifr_broadaddr;
+  
+  strcpy(ifr.ifr_name, ifname);
+  if (ioctl(skfd, SIOCGIFNETMASK, &ifr) < 0) {
+       memset(&ife->netmask, 0, sizeof(struct sockaddr));
+  } else {
+       memcpy(ife->netmask.sa_data, &ifr.ifr_data, sizeof(struct sockaddr));
+  }
+    
+  if_getstats(ifname,ife);
+/*  strcpy(ifr.ifr_name, ifname);
+  ifr.ifr_data = (caddr_t) &ife->stats;
+  if (ioctl(skfd, SIOCGIFSTATS, &ifr) < 0) {
+       memset(&ife->stats, 0, sizeof(struct dev_stats));
+  }
+  */
+  return(0);
+}
+
+
+static int
+iface_info(void)
+{
+  char buff[1024];
+  struct interface ife;
+  struct ifconf ifc;
+  struct ifreq *ifr;
+  int i;
+  
+  /* Create a channel to the NET kernel. */
+  if ((skfd = socket(AF_INET,SOCK_DGRAM,0)) < 0) {
+       perror("socket");
+       return(E_READ);
+  }
+  
+  ifc.ifc_len = sizeof(buff);
+  ifc.ifc_buf = buff;
+  if (ioctl(skfd, SIOCGIFCONF, &ifc) < 0) {
+       perror("SIOCGIFCONF");
+       close(skfd);
+       return(E_IOCTL);
+  }
+
+  printf(NLS_CATGETS(catfd, netstatSet, netstat_interface, "Kernel Interface table\n"));
+  printf(NLS_CATGETS(catfd, netstatSet, netstat_header_iface,
+                    "Iface   MTU Met  RX-OK RX-ERR RX-DRP RX-OVR  TX-OK TX-ERR TX-DRP TX-OVR Flags\n"));
+  
+  ifr = ifc.ifc_req;
+  for (i = ifc.ifc_len / sizeof(struct ifreq); --i >= 0; ifr++) {
+       if (if_fetch(ifr->ifr_name, &ife) < 0) {
+               fprintf(stderr, NLS_CATGETS(catfd, netstatSet, netstat_unkn_iface,
+                                           "%s: unknown interface.\n"), ifr->ifr_name);
+       }
+    
+       if (((ife.flags & IFF_UP) == 0) && !flag_all) continue;
+       ife_print(&ife);
+  }
+  close(skfd);
+  return(0);
+}
+
+
+static void
+version(void) 
+{
+       printf("%s\n%s\n%s\n%s\n", Release, Version, Signature, Features);
+       NLS_CATCLOSE(catfd)
+       exit(1);
+}
+
+
+static void
+usage(void)
+{
+  fprintf(stderr, NLS_CATGETS(catfd, netstatSet, netstat_usage1,  "usage: netstat [-veenNcCF] [<Af>] -r         netstat {-V|--version|-h|--help}\n"));
+  fprintf(stderr, NLS_CATGETS(catfd, netstatSet, netstat_usage2,  "       netstat [-vnNcaeo] [<Socket>]\n"));
+  fprintf(stderr, NLS_CATGETS(catfd, netstatSet, netstat_usage3,  "       netstat { [-veenNac] -i | [-vnNc] -L | [-cnNe] -M }\n\n"));
+  fprintf(stderr, NLS_CATGETS(catfd, netstatSet, netstat_usage4,  "        -r, --route              display routing table\n")); /* xxx */
+  fprintf(stderr, NLS_CATGETS(catfd, netstatSet, netstat_usage5,  "        -L, --netlink            display netlink kernel messages\n"));
+  fprintf(stderr, NLS_CATGETS(catfd, netstatSet, netstat_usage6,  "        -i, --interfaces         display interface table\n"));
+  fprintf(stderr, NLS_CATGETS(catfd, netstatSet, netstat_usage7,  "        -M, --masquerade         display masqueraded connections\n\n"));
+  fprintf(stderr, NLS_CATGETS(catfd, netstatSet, netstat_usage8,  "        -v, --verbose            be verbose\n"));
+  fprintf(stderr, NLS_CATGETS(catfd, netstatSet, netstat_usage9,  "        -n, --numeric            dont resolve names\n"));
+  fprintf(stderr, NLS_CATGETS(catfd, netstatSet, netstat_usage10, "        -e, --extend             display other/more informations\n"));
+  fprintf(stderr, NLS_CATGETS(catfd, netstatSet, netstat_usage11, "        -c, --continuous         continuous listing\n\n"));
+  fprintf(stderr, NLS_CATGETS(catfd, netstatSet, netstat_usage12, "        -a, --all, --listening   display all\n"));
+  fprintf(stderr, NLS_CATGETS(catfd, netstatSet, netstat_usage13, "        -o, --timers             display timers\n\n"));
+  fprintf(stderr, NLS_CATGETS(catfd, netstatSet, netstat_usage14, "<Socket>={-t|--tcp} {-u|--udp} {-w|--raw} {-x|--unix} --ax25 --ipx --netrom\n"));
+#if HAVE_AFINET6
+  fprintf(stderr, NLS_CATGETS(catfd, netstatSet, netstat_usage15, "<Af>= -A {inet|inet6|ipx|netrom|ddp|ax25},... --inet --inet6 --ipx --netrom --ddp --ax25\n"));
+#else
+  fprintf(stderr, NLS_CATGETS(catfd, netstatSet, netstat_usage15, "<Af>= -A {inet|ipx|netrom|ddp|ax25},... --inet --ipx --netrom --ddp --ax25\n"));
+#endif
+  NLS_CATCLOSE(catfd)
+  exit(1);
+}
+
+
+int main
+(int argc, char *argv[])
+{
+  int i;
+  int lop;
+  struct option longopts[]=
+  {
+    AFTRANS_OPTS,
+    {"version",                0,      0,      'V'},
+    {"interfaces",     0,      0,      'i'},
+    {"help",           0,      0,      'h'},
+    {"route",          0,      0,      'r'},
+    {"netlink",                2,      0,      'L'},
+    {"masquerade",     0,      0,      'M'},
+    {"protocol",       1,      0,      'A'},
+    {"tcp",            0,      0,      't'},
+    {"udp",            0,      0,      'u'},
+    {"raw",            0,      0,      'w'},
+    {"unix",           0,      0,      'x'},
+    {"listening",      0,      0,      'a'},
+    {"all",            0,      0,      'a'},
+    {"timers",         0,      0,      'o'},
+    {"continuous",     0,      0,      'c'},
+    {"extend",         0,      0,      'e'},
+    {"verbose",                0,      0,      'v'},
+    {"statistics",     0,      0,      's'},
+    {"numeric",                0,      0,      'n'},
+    {"symbolic",       0,      0,      'N'},
+    {"cache",          0,      0,      'C'},
+    {"fib",            0,      0,      'F'},
+    {NULL,             0,      0,      0}
+  };
+  
+#if NLS
+  setlocale (LC_MESSAGES, "");
+  catfd = catopen ("nettools", MCLoadBySet);
+#endif
+
+  getroute_init();                     /* Set up AF routing support */
+
+  afname[0]='\0';
+  while ((i = getopt_long(argc, argv, "MLCFA:acdehinNorstuVv?wx", longopts, &lop)) != EOF) switch(i) {
+  case -1:
+    break;
+  case 1:
+    if (lop < 0 || lop >= AFTRANS_CNT) {
+      EINTERN("netstat.c","longopts 1 range");
+      break;
+    }
+    if (aftrans_opt(longopts[lop].name)) {
+      NLS_CATCLOSE(catfd)
+       exit(1);
+    }
+    break;
+  case 'A':
+    if (aftrans_opt(optarg)) {
+      NLS_CATCLOSE(catfd)
+       exit(1);
+    }
+    break;
+  case 'L':
+    flag_nlp++;
+    break;
+  case 'M':
+    flag_mas++;
+    break;
+  case 'a':
+    flag_all++;
+    break;
+  case 'c':
+    flag_cnt++;
+    break;
+    
+  case 'd':
+    flag_deb++;
+    break;
+  case 'e':
+    flag_exp++;
+    break;
+  case 'i':
+    flag_int++;
+    break;
+    
+  case 'n':
+    flag_not|=FLAG_NUM;
+    break;
+  case 'N':
+    flag_not|=FLAG_SYM;
+    break;
+  case 'C':
+    flag_cf|=FLAG_CACHE;
+    break;
+  case 'F':
+    flag_cf|=FLAG_FIB;
+    break;
+  case 'o':
+    flag_opt++;
+    break;
+  case 'V':
+    version();
+    /*NOTREACHED*/
+  case 'v':
+    flag_ver|=FLAG_VERBOSE;
+    break;
+  case 'r':
+    flag_rou++;
+    break;
+    
+  case 't':
+    flag_tcp++;
+    break;
+    
+  case 'u':
+    flag_udp++;
+    break;
+  case 'w':
+    flag_raw++;
+    break;
+  case 'x':
+    if (aftrans_opt("unix")) {
+      NLS_CATCLOSE(catfd)
+       exit(1);
+    }
+    break;
+  case '?':
+  case 'h':
+    usage();
+  case 's':
+    inittab();
+    parsesnmp();
+    exit(0);
+  }
+  
+  if (flag_int + flag_rou + flag_nlp + flag_mas > 1)
+    usage();
+  
+  if (flag_inet)
+    flag_tcp = flag_udp = flag_raw = 1;
+  
+  flag_arg = flag_tcp + flag_udp + flag_raw + flag_unx + flag_ipx 
+    + flag_ax25 + flag_netrom;
+  
+  if (flag_nlp) {
+#if HAVE_RT_NETLINK && 0
+    i=netlink_print();
+#else
+    ENOSUPP("netstat.c","RT_NETLINK");
+    i=-1;
+#endif 
+    NLS_CATCLOSE(catfd)
+      return(i);
+  }
+  if (flag_mas) {
+#if HAVE_FW_MASQUERADE && HAVE_AFINET
+#if MORE_THAN_ONE_MASQ_AF
+    if (!afname[0])
+      strcpy(afname,DFLT_AF);
+#endif  
+    for(;;) {
+      i = ip_masq_info(flag_not, flag_exp);
+      if (i || !flag_cnt) break;
+      sleep(1);
+    }
+#else
+    ENOSUPP("netstat.c","FW_MASQUERADE");
+    i=-1;
+#endif
+    NLS_CATCLOSE(catfd)
+      return(i);
+  }
+  if (flag_rou) {
+    int options=0;
+    
+    if (!afname[0])
+      strcpy(afname,DFLT_AF);
+    
+    if (flag_exp == 2)
+      flag_exp = 1;
+    else if (flag_exp == 1)
+      flag_exp = 2;
+    
+    options = (flag_exp & FLAG_EXT) | flag_not | flag_cf | flag_ver ;
+    if (!flag_cf)
+      options |= FLAG_FIB;
+    
+    for(;;) {
+      i = route_info(afname,options);
+      if (i || !flag_cnt) break;
+      sleep(1);
+    }
+    NLS_CATCLOSE(catfd)
+      return(i);
+  }
+  
+  if (flag_int) {
+    for (;;) {
+      i = iface_info();
+      if (!flag_cnt || i) break;
+      sleep(1);
+    }
+    NLS_CATCLOSE(catfd)
+      return(i);
+  }
+  
+  for (;;) {
+    if (!flag_arg || flag_tcp || flag_udp || flag_raw) {
+#if HAVE_AFINET
+      printf(NLS_CATGETS(catfd, netstatSet, netstat_internet, "Active Internet connections ")); /* xxx */
+      if (flag_all) printf(NLS_CATGETS(catfd, netstatSet, netstat_servers, "(including servers)")); /* xxx */
+      else printf(NLS_CATGETS(catfd, netstatSet, netstat_noservers, "(w/o servers)")); /* xxx */
+      
+      printf(NLS_CATGETS(catfd, netstatSet, netstat_header_internet,
+                        "\nProto Recv-Q Send-Q Local Address           Foreign Address         State      ")); /* xxx */
+      if (flag_exp > 1)
+       printf(NLS_CATGETS(catfd, netstatSet, netstat_header_internet2,
+                          " User      ")); /* xxx */
+      if (flag_opt)
+       printf(NLS_CATGETS(catfd, netstatSet, netstat_header_internet3,
+                          " Timer")); /* xxx */
+      printf("\n");
+#else
+      if (flag_arg) { 
+       i = 1; 
+       ENOSUPP("netstat","AF INET"); 
+      }
+#endif
+    }
+#if HAVE_AFINET
+    if (!flag_arg || flag_tcp) {
+      i = tcp_info();
+      if (i) {  NLS_CATCLOSE(catfd)  return(i); }
+    }
+    
+    if (!flag_arg || flag_udp) {
+      i = udp_info();
+      if (i) {  NLS_CATCLOSE(catfd)  return(i); }
+    }
+    
+    if (!flag_arg || flag_raw) {
+      i = raw_info();
+      if (i) {  NLS_CATCLOSE(catfd)  return(i); }
+    }
+#endif
+    
+    if (!flag_arg || flag_unx) {
+#if HAVE_AFUNIX
+      i = unix_info();
+      if (i) {  NLS_CATCLOSE(catfd)  return(i); }
+#else
+      if (flag_arg)
+       { i=1; ENOSUPP("netstat","AF UNIX"); }
+#endif
+    }
+    
+    if(!flag_arg || flag_ipx) {
+#if HAVE_AFIPX
+      i = ipx_info();
+      if(i) {  NLS_CATCLOSE(catfd)  return(i); }
+#else
+      if (flag_arg)
+       { i=1; ENOSUPP("netstat","AF IPX"); }
+#endif
+    }
+    
+    if(!flag_arg || flag_ax25) {
+#if HAVE_AFAX25
+      i = ax25_info();
+      if(i) {  NLS_CATCLOSE(catfd)  return(i); }
+#else
+      if (flag_arg)
+       { i=1; ENOSUPP("netstat","AF AX25"); }
+#endif
+    }
+    
+    if(!flag_arg || flag_netrom) {
+#if HAVE_AFNETROM
+      i = netrom_info();
+      if(i) {  NLS_CATCLOSE(catfd)  return(i); }
+#else
+      if (flag_arg)
+       { i=1; ENOSUPP("netstat","AF NETROM"); }
+#endif
+    }
+    
+    if (!flag_cnt || i) break;
+    sleep(1);
+  }
+  
+  NLS_CATCLOSE(catfd)
+    return(i);
+}
diff --git a/nls/Makefile b/nls/Makefile
new file mode 100644 (file)
index 0000000..4ae6db3
--- /dev/null
@@ -0,0 +1,61 @@
+SUBDIRS=       en_US.88591 fr_FR.88591 de_DE.88591
+GENCATNEW=     gencat -new
+GENCAT=                gencat
+
+USE_NLS := $(shell grep -s 'define NLS 1' ../config.h)
+
+ifneq ($(USE_NLS),)
+
+all:   catalogs ../nettools-nls.h
+
+else
+
+all:
+       @echo "Skipping NLS Generation!"
+
+endif
+
+../nettools-nls.h:     nettools.m
+       ${GENCATNEW} /dev/null nettools.m -h ../nettools-nls.h
+
+nettools.m:    en_US.88591/nettools.cat
+
+catalogs:      de_DE.88591/nettools.cat fr_FR.88591/nettools.cat \
+               en_US.88591/nettools.cat
+
+en_US.88591/nettools.cat:      en_US.88591/*.m
+       @echo en_US.88591
+       @cat en_US.88591/*.m > nettools.m
+       @if [ -f en_US.88591/nettools.cat ]; then \
+               ${GENCAT} en_US.88591/nettools.cat nettools.m; \
+       else \
+               ${GENCATNEW} en_US.88591/nettools.cat nettools.m; \
+       fi
+
+fr_FR.88591/nettools.cat:      fr_FR.88591/*.m
+       @echo fr_FR.88591
+       @cat fr_FR.88591/*.m > nettools.m
+       @if [ -f fr_FR.88591/nettools.cat ]; then \
+               ${GENCAT} fr_FR.88591/nettools.cat nettools.m; \
+       else \
+               ${GENCATNEW} fr_FR.88591/nettools.cat nettools.m; \
+       fi
+
+de_DE.88591/nettools.cat:      de_DE.88591/*.m
+       @echo de_DE.88591
+       @cat de_DE.88591/*.m > nettools.m
+       @if [ -f de_DE.88591/nettools.cat ]; then \
+               ${GENCAT} de_DE.88591/nettools.cat nettools.m; \
+       else \
+               ${GENCATNEW} de_DE.88591/nettools.cat nettools.m; \
+       fi
+
+clean:
+       for i in ${SUBDIRS} ; \
+       do \
+           rm -f $$i/*~ $$i/*.orig $$i/DEADJOE ; \
+           rm -f $$i/nettools.cat ; \
+       done; \
+       rm -f ../nettools-nls.h *~ *.orig DEADJOE nettools.m
+
+clobber: clean
diff --git a/nls/de_DE.88591/README b/nls/de_DE.88591/README
new file mode 100644 (file)
index 0000000..d01b01f
--- /dev/null
@@ -0,0 +1,4 @@
+German Language Catalougs
+
+Date: Wed, 23 Aug 1995 13:55:44 +0200
+From: Michael Schmidt <michael@muc.de>
diff --git a/nls/de_DE.88591/arcnet.m b/nls/de_DE.88591/arcnet.m
new file mode 100644 (file)
index 0000000..c871b7c
--- /dev/null
@@ -0,0 +1,20 @@
+$set 10  #arcnet
+
+$ #_none Original Message:([NONE SET])
+# [NICHTS GESETZT]
+
+$ #_debug1 Original Message:(in_arcnet(%s): invalid arcnet address!\n)
+# in_arcnet(%s): ungültige Arcnet-Adresse!\n
+
+$ #_debug2 Original Message:(in_arcnet(%s): invalid arcnet address!\n)
+# in_arcnet(%s): ungültige Arcnet-Adresse!\n
+
+$ #_debug3 Original Message:(in_arcnet(%s): trailing : ignored!\n)
+# in_arcnet(%s): am Ende : ignoriert!\n
+
+$ #_debug4 Original Message:(in_arcnet(%s): trailing junk!\n)
+# in_arcnet(%s): Unsinn am Ende!\n
+
+$ #_arcnet Original Message:(1.5Mbps ARCnet)
+# 1.5Mbps ARCnet
+
diff --git a/nls/de_DE.88591/arp.m b/nls/de_DE.88591/arp.m
new file mode 100644 (file)
index 0000000..0118734
--- /dev/null
@@ -0,0 +1,70 @@
+$set 3  #arp
+
+$ #_hostname Original Message:(arp: need host name\n)
+# arp: benötige Rechnernamen\n
+
+$ #_no_arp Original Message:(No ARP entry for %s\n)
+# Kein ARP-Eintrag für %s\n
+
+$ #_need_hw Original Message:(arp: need hardware address\n)
+# arp: benötige Hardware-Adresse\n
+
+$ #_invalidhw Original Message:(arp: invalid hardware address\n)
+# arp: ungültige Hardware-Adresse\n
+
+$ #_cant_open Original Message:(arp: cannot open etherfile %s !\n)
+# arp: kann Ether-Datei %s nicht Ã¶ffnen!\n
+
+$ #_formaterr Original Message:(arp: format error on line %u of etherfile %s !\n)
+# arp: Formatfehler in Zeile %u der Ether-Datei %s !\n
+
+$ #_cant_set Original Message:(arp: cannot set entry on line %u of etherfile %s !\n)
+# arp: kann Eintrag in Zeile %u der Ether-Datei %s nicht setzen!\n
+
+$ #_address Original Message:(Address\t\tHW type\t\tHW address\t     Flags Mask\t\t   Iface\n)
+# Adresse\t\tHW typ\t\tHW adresse\t     Flags Maske\t\t   Iface\n
+
+$ #_wrong_af Original Message:(arp: %s: kernel only supports '-p inet'.\n)
+# arp: %s: kernel unterstützt nur 'inet'.\n
+
+$ #_sum Original Message:(Entries: %d\tSkiped: %d\tFound: %d\n)
+# Einträge: %d\tÃœbersprungen: %d\tGefunden: %d\n
+
+$ #_usage1 Original Message:(Usage: arp [-vn] [-H type] [-i if] -a [hostname]\n)
+# Benutzung: arp [-vn] [-H typ] [-i if] -a [rechnername]\n
+
+$ #_usage2 Original Message:(       arp [-v] [-i if] -d hostname [pub]\n)
+#            arp [-v] [-i if] -d rechnername [pub]\n
+
+$ #_usage3 Original Message:(       arp [-v] [-H type] [-i if] -s hostname hw_addr [temp] [trail]\n)
+#            arp [-v] [-H typ] [-i if] -s rechnername hw_addr [temp] [trail]\n
+
+$ #_usage4 Original Message:(       arp [-v] [-H type] [-i if] -s hostname hw_addr [netmask nm] pub [trail]\n)
+#            arp [-v] [-H typ] [-i if] -s r.name hw_addr [netmask nm] pub [trail]\n
+
+$ #_usage5 Original Message:(       arp [-vn] [-H type] [-i if] -f filename\n)
+#            arp [-vn] [-H typ] [-i if] -f dateiname\n
+
+$ #_hw_not_supp Original Message:(%s: hardware type not supported!\n)
+# %s: Hardwaretyp nicht unterstützt!\n
+
+$ #_fam_not_supp Original Message:(%s: address family not supported!\n)
+# %s: Adressfamilie nicht unterstützt!\n
+
+$ #_unkn_addr Original Message:(arp: %s: unknown address family.\n)
+# arp: %s: unbekannte Adressfamilie.\n
+
+$ #_unkn_hw Original Message:(arp: %s: unknown hardware type.\n)
+# arp: %s: unbekannter Hardwaretyp.\n
+
+$ #_none Original Message:(arp: in %d entries no match found.\n)
+# arp: In %d Einträgen kein Treffer.\n
+
+$ #_wrong_hw Original Message:(arp: %s: hardware type without ARP support.\n)
+# arp: %s: keine ARP Unterstützung für diesen Hardwaretyp.\n
+
+$ #_einv_pub Original Message:(Probably destination is reached via ARP Interface. See arp(8)\n)
+# Wahrscheinlich ist Ziel Ã¼ber ARP Interface erreichbar. Näheres in arp(8).\n
+
+$ #_einv_nopub Original Message:(Probably destination is on different Interface. See arp(8)\n)
+# Wahrscheinlich ist Ziel auf anderem Interface erreichbar. Näheres in arp(8)\n
diff --git a/nls/de_DE.88591/ax25.m b/nls/de_DE.88591/ax25.m
new file mode 100644 (file)
index 0000000..1f3365b
--- /dev/null
@@ -0,0 +1,17 @@
+$set 11  #ax25
+
+$ #_none Original Message:([NONE SET])
+# [NICHTS GESETZT]
+
+$ #_debug1 Original Message:(Invalid callsign)
+# Ungültiges Rufzeichen
+
+$ #_debug2 Original Message:(Callsign too long)
+# Rufzeichen zu lang
+
+$ #_hw Original Message:(AMPR AX.25)
+# AMPR AX.25
+
+$ #_ax25 Original Message:(AMPR AX.25)
+# AMPR AX.25
+
diff --git a/nls/de_DE.88591/ddp.m b/nls/de_DE.88591/ddp.m
new file mode 100644 (file)
index 0000000..d7ce54a
--- /dev/null
@@ -0,0 +1,10 @@
+$set 12  #ddp
+
+$ #_none Original Message:([NONE SET])
+# [NICHTS GESETZT]
+
+$ #_ddp Original Message:(Appletalk DDP)
+# Appletalk DDP
+
+$ #_notyet Original Message:(Routing table for `ddp' not yet supported.\n)
+# Routingtabelle für `ddp' noch nicht unterstützt.\n
diff --git a/nls/de_DE.88591/ether.m b/nls/de_DE.88591/ether.m
new file mode 100644 (file)
index 0000000..aa9b665
--- /dev/null
@@ -0,0 +1,20 @@
+$set 13  #ether
+
+$ #_none Original Message:([NONE SET])
+# [NICHTS GESETZT]
+
+$ #_debug1 Original Message:(in_ether(%s): invalid ether address!\n)
+# in_ether(%s): ungültige Ethernet-Adresse!\n
+
+$ #_debug2 Original Message:(in_ether(%s): invalid ether address!\n)
+# in_ether(%s): ungültige Ethernet-Adresse!\n
+
+$ #_debug3 Original Message:(in_ether(%s): trailing : ignored!\n)
+# in_ether(%s): am Ende : ignoriert!\n
+
+$ #_debug4 Original Message:(in_ether(%s): trailing junk!\n)
+# in_ether(%s): Unsinn am Ende!\n
+
+$ #_ether Original Message:(10Mbps Ethernet)
+# 10Mbps Ethernet
+
diff --git a/nls/de_DE.88591/hostname.m b/nls/de_DE.88591/hostname.m
new file mode 100644 (file)
index 0000000..f364f5d
--- /dev/null
@@ -0,0 +1,103 @@
+$set 5  #hostname
+
+$ #_root Original Message:(%s: you must be root to change the host name\n)
+# %s: Nur root darf den Rechnernamen Ã¤ndern\n
+
+$ #_toolong Original Message:(%s: name too long\n)
+# %s: Name zu lang\n
+
+$ #_nodns1 Original Message:(%s: You can't change the DNS domain name with this command\n)
+# %s: Sie können den DNS-Name nicht mit diesem Befehl Ã¤ndern\n
+
+$ #_nodns2 Original Message:(\nUnless you are using bind or NIS for host lookups you can change the DNS\n)
+# \nWenn Sie nicht bind oder NIS benutzen, können Sie den DNS-Domainname,\n
+
+$ #_nodns3 Original Message:(domain name (which is part of the FQDN) in the /etc/hosts file.\n)
+# welcher Teil des FQDN ist, in /etc/hosts Ã¤ndern.\n
+
+$ #_cant_open Original Message:(%s: can't open `%s'\n)
+# %s: kann `%s' nicht Ã¶ffnen\n
+
+$ #_usage1 Original Message:(Usage: hostname [-v] {hostname|-F file} set hostname (from file)\n)
+# Benutzung: hostname [-v] {hostname|-F datei}  setzt rechnername (aus datei)\n
+
+$ #_usage2 Original Message:(       domainname [-v] {nisdomain|-F file} set NIS domainname (from file)\n)
+#        domainname [-v] {nisdomain|-F datei}   setzt NIS domainname (aus datei)\n
+
+$ #_usage3 Original Message:(       hostname [-v] [-d|-f|-s|-a|-i|-y] display formated name\n)
+#        hostname [-v] [-d|-f|-s|-a|-i|-y]      zeigt formatierte Namen an\n
+
+$ #_usage4 Original Message:(       hostname [-v] display hostname\n\n)
+#        hostname [-v]                          zeigt Rechnername an\n\n
+
+$ #_usage5 Original Message:(       hostname -V|--version|-h|--help print info and exit\n\n)
+#        hostname -V|--version|-h|--help        gibt Info aus und beendet sich\n\n
+
+$ #_usage6 Original Message:(    dnsdomainname=hostname -d, {yp,nis,}domainname=hostname -y\n\n)
+#     dnsdomainname=hostname -d, {yp,nis,}domainname=hostname -y\n\n
+
+$ #_usage7 Original Message:(    -s, --short           short host name\n)
+#     -s, --short           kurzer Rechnername\n
+
+$ #_usage8 Original Message:(    -a, --alias           alias names\n)
+#     -a, --alias           alias Namen\n
+
+$ #_usage9 Original Message:(    -i, --ip-address      addresses for the hostname\n)
+#     -i, --ip-address      Adressen der Rechnernamen\n
+
+$ #_usage10 Original Message:(    -f, --fqdn, --long    long host name (FQDN)\n)
+#     -f, --fqdn, --long    langer Rechnername (FQDN)\n
+
+$ #_usage11 Original Message:(    -d, --domain          DNS domain name\n)
+#     -d, --domain          DNS Domainname\n
+
+$ #_usage12 Original Message:(    -y, --yp, --nis       NIS/YP domainname\n)
+#     -y, --yp, --nis       NIS/YP Domainname\n
+
+$ #_usage13 Original Message:(    -F, --file            read hostname or nis domainname from given File\n\n)
+#     -F, --file            lese Rechnernamen oder NIS Domainnamen aus Datei\n\n
+
+$ #_usage14 Original Message:(   This comand can get or set the hostname or the NIS domainname. You can\n)
+#    Dieses Programm kann den Rechnernamen und den NIS-Domainnamen setzen und\n
+
+$ #_usage15 Original Message:(   also get the DNS domain or the FQDN (fully qualified domain name).\n)
+#    auslesen. Ausserdem kann es die DNS Domain oder den FQDN auslesen.\n
+
+$ #_usage16 Original Message:(   Unless you are using bind or NIS for host lookups you can change the\n)
+#    Wenn Sie nicht bind oder NIS benutzen, können Sie den FQDN (Vollständig\n
+
+$ #_usage17 Original Message:(   FQDN (Fully Qualified Domain Name) and the DNS domain name (which is\n)
+#    qualifizierter Domain-Name) und den DNS-Domainnamen (welcher Teil\n
+
+$ #_usage18 Original Message:(   part of the FQDN) in the /etc/hosts file.\n)
+#    des FQDN ist) in /etc/hosts Ã¤ndern.\n
+
+$ #_verb_set Original Message:(  Setting hostname to `%s'\n)
+#  Setze Rechnername auf `%s'\n
+
+$ #_verb_res Original Message:(Resolving `%s' ...\n)
+# Ermittle `%s' ...\n
+
+$ #_verb_fnd Original Message:(Result: h_name=`%s'\n)
+# Ergebnis: h_name=`%s'\n
+
+$ #_verb_ali Original Message:(Result: h_aliases=`%s'\n)
+# Ergebnis: h_aliases=`%s'\n
+
+$ #_verb_ipn Original Message:(Result: h_addr_list=`%s'\n)
+# Ergebnis: h_addr_list=`%s'\n
+
+$ #_verb_get Original Message:(gethostname()=`%s'\n)
+# gethostname()=`%s'\n
+
+$ #_verb_dset Original Message:(Setting domainname to `%s'\n)
+# Setze NIS Domainname auf `%s'\n
+
+$ #_verb_dget Original Message:(getdomainname()=`%s'\n)
+# getdomainname()=%s'\n
+
+$ #_dname_root Original Message:(%s: you must be root to change the domain name\n)
+# %s: Sie müssen root sein um den Domainnamen zu Ã¤ndern\n
+
+$ #_dname_toolong Original Message:(%s: name too long\n)
+# %s: Domainname ist zu lang\n
diff --git a/nls/de_DE.88591/ifconfig.m b/nls/de_DE.88591/ifconfig.m
new file mode 100644 (file)
index 0000000..6fa8123
--- /dev/null
@@ -0,0 +1,76 @@
+$set 1  #ifconfig
+
+$ #_over Original Message:(overruns)
+# Ãœberholungen
+
+$ #_compress Original Message:(compressed)
+# komprimiert
+
+$ #_link Original Message:(%-8.8s  Link encap:%s  )
+# %-8.8s  Link encap:%s  
+
+$ #_hw Original Message:(HWaddr %s)
+# HW-Adr %s
+
+$ #_adr Original Message:(\n          %s addr:%s)
+# \n          %s Adr: %s
+
+$ #_pap Original Message:(  P-t-P:%s  )
+#   P-t-P:%s  
+
+$ #_bcast Original Message:(  Bcast:%s  )
+#   Bcast:%s  
+
+$ #_mask Original Message:(Mask:%s\n)
+# Maske:%s\n
+
+$ #_etherII Original Message:(          IPX/Ethernet II addr:%s\n)
+#           IPX/Ethernet II Adresse:%s\n
+
+$ #_SNAP Original Message:(          IPX/Ethernet SNAP addr:%s\n)
+#           IPX/Ethernet SNAP Adresse:%s\n
+
+$ #_8022 Original Message:(          IPX/Ethernet 802.2 addr:%s\n)
+#           IPX/Ethernet 802.2 Adresse:%s\n
+
+$ #_8023 Original Message:(          IPX/Ethernet 802.3 addr:%s\n)
+#           IPX/Ethernet 802.3 Adresse:%s\n
+
+$ #_talk Original Message:(          EtherTalk Phase 2 addr:%s\n)
+#           EtherTalk Phase 2 Adresse:%s\n
+
+$ #_noflags Original Message:([NO FLAGS] )
+# [KEINE OPTIONEN] 
+
+$ #_mtu Original Message:( MTU:%d  Metric:%d\n)
+#  MTU:%d  Metrik:%d\n
+
+$ #_rx Original Message:(RX packets:%u errors:%u dropped:%u %s:%u\n)
+# RX Packete:%u Fehler:%u verloren:%u %s:%u\n
+
+$ #_tx Original Message:(TX packets:%u errors:%u dropped:%u %s:%u\n)
+# TX Packete:%u Fehler:%u verloren:%u %s:%u\n
+
+$ #_interrupt Original Message:(Interrupt:%d )
+# Unterbrechung:%d 
+
+$ #_base Original Message:(Base address:0x%x )
+# Basisadresse:0x%x 
+
+$ #_mem Original Message:(Memory:%lx-%lx )
+# Speicher:%lx-%lx 
+
+$ #_dma Original Message:(DMA chan:%x )
+# DMA Kanal:%x 
+
+$ #_unkn Original Message:(%s: unknown interface.\n)
+# %s: unbekannte Schnittstelle.\n
+
+$ #_usage1 Original Message:(Usage: ifconfig [-a] [-i] [-v] interface\n)
+# Usage: ifconfig [-a] [-i] [-v] Schnittstelle\n
+
+$ #_usage2 Original Message:(                [inet address]\n)
+#                 [inet Adresse]\n
+
+$ #_usage3 Original Message:(                [hw] [ax25 address]\n)
+#                 [hw] [ax25 Adresse]\n
diff --git a/nls/de_DE.88591/inet.m b/nls/de_DE.88591/inet.m
new file mode 100644 (file)
index 0000000..6c2a07b
--- /dev/null
@@ -0,0 +1,25 @@
+$set 14  #inet
+
+$ #_debug1 Original Message:(rresolve: unsupport address family %d !\n)
+# rresolve: Adressfamilie %d nicht unterstützt !\n
+
+$ #_none Original Message:([NONE SET])
+# [NICHTS GESETZT]
+
+$ #_darpa Original Message:(DARPA Internet)
+# DARPA Internet
+
+$ #_table Original Message:(Kernel IP routing table\n)
+# Kernel IP Routing-Tabelle\n
+
+$ #_header1 Original Message:(Destination     Gateway         Genmask         Flags Metric Ref    Use Iface\n)
+# Ziel            Gateway         Maske           Optn  Metrik Ref    Ben Iface\n
+
+$ #_header2 Original Message:(Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface\n)
+# Ziel            Gateway         Maske           Optn    MSS Fenster irtt Iface\n
+
+$ #_header3 Original Message:(Destination     Gateway         Genmask         Flags Metric Ref    Use Iface    MSS   Window irtt\n)
+# Ziel            Gateway         Maske            Optn Metrik Ref    Ben Iface    MSS   Fenst. irtt\n
+
+$ #_route Original Message:(unsupported address family %d !\n)
+# Adressfamilie %d nicht unterstützt!\n
diff --git a/nls/de_DE.88591/ipfw.m b/nls/de_DE.88591/ipfw.m
new file mode 100644 (file)
index 0000000..0623cc5
--- /dev/null
@@ -0,0 +1,343 @@
+$set 9  #ipfw
+
+$ #_ipf_blocking Original Message:(blocking)
+# blockiert
+
+$ #_ipf_fwding Original Message:(forwarding)
+# weiterleitend
+
+$ #_ipf_accnting Original Message:(accounting)
+# abrechnend
+
+$ #_ipf_msqrading Original Message:(masquerading)
+# verkleidend
+
+$ #_usage1 Original Message:(usage:\tipfw [-ndhcVr] [--version] [--help]\n\t     [--numeric] [--count] [--reset] [--debug] [--append]\n)
+# usage:\tipfw [-ndhcVr] [--version] [--help]\n\t     [--numeric] [--count] [--reset] [--debug] [--append]\n
+
+$ #_usage2 Original Message:(\tipfw p[olicy]      {b[locking]|f[orwarding]} {accept|deny|reject}\n)
+# \tipfw p[olicy]      {b[locking]|f[orwarding]} {accept|deny|reject}\n
+
+$ #_usage3 Original Message:(\tipfw [-nrc] l[ist] {b[locking]|f[orwarding]|a[ccounting]}\n)
+# \tipfw [-nrc] l[ist] {b[locking]|f[orwarding]|a[ccounting]}\n
+
+$ #_usage4 Original Message:(\tipfw f[lush]       {b[locking]|f[orwarding]|a[ccounting]}\n)
+# \tipfw f[lush]       {b[locking]|f[orwarding]|a[ccounting]}\n
+
+$ #_usage5 Original Message:(\tipfw {a[dd]|d[el]} {b[locking]|f[orwarding]} {accept|deny|reject} \n\t     Type [iface Addr] from Src to Dst [flags Flags]\n)
+# \tipfw {a[dd]|d[el]} {b[locking]|f[orwarding]} {accept|deny|reject} \n\t     Type [iface Addr] from Src to Dst [flags Flags]\n
+
+$ #_usage6 Original Message:(\tipfw c[heck]       {b[locking]|f[orwarding]}\n\t     Type [iface Addr] from Src to Dst [flags Flags]\n)
+# \tipfw c[heck]       {b[locking]|f[orwarding]}\n\t     Type [iface Addr] from Src to Dst [flags Flags]\n
+
+$ #_usage7 Original Message:(\tipfw {a[dd]|d[el]} a[ccounting]\n\t     Type [iface Addr] from Src to Dst [flags Flags]\n)
+# \tipfw {a[dd]|d[el]} a[ccounting]\n\t     Type [iface Addr] from Src to Dst [flags Flags]\n
+
+$ #_usage8 Original Message:(\tipfw z[ero] {b[locking]|f[orwarding]|a[ccounting]}\n)
+# \tipfw z[ero] {b[locking]|f[orwarding]|a[ccounting]}\n
+
+$ #_usage9 Original Message:(\tipfw {a[dd]|d[el]} m[asquerade] Type from Src to Dst\n\n)
+# \tipfw {a[dd]|d[el]} m[asquerade] Type from Src to Dst\n\n
+
+$ #_usage10 Original Message:(\tType={udp|tcp}:\t\tFlags={bidir|syn|ack|prn} ...\n)
+# \tType={udp|tcp}:\t\tFlags={bidir|syn|ack|prn} ...\n
+
+$ #_usage11 Original Message:(\tSrc,Dst={1.2.3.4/24|Host|Netname} [[Port1:Port2] Port3 ... Port10]\n\n)
+# \tSrc,Dst={1.2.3.4/24|Host|Netname} [[Port1:Port2] Port3 ... Port10]\n\n
+
+$ #_usage12 Original Message:(\tType={icmp}:\t\tFlags={bidir,prn}\n)
+# \tType={icmp}:\t\tFlags={bidir,prn}\n
+
+$ #_usage13 Original Message:(\tSrc={1.2.3.4/24|Host|Netname} [[Type1:Type2] Type3 ... Type10]\n)
+# \tSrc={1.2.3.4/24|Host|Netname} [[Type1:Type2] Type3 ... Type10]\n
+
+$ #_usage14 Original Message:(\tDst={1.2.3.4/24|Host|Netname}\n\n)
+# \tDst={1.2.3.4/24|Host|Netname}\n\n
+
+$ #_usage15 Original Message:(\tType={all}:\t\tFlags={bidir,prn}\n)
+# \tType={all}:\t\tFlags={bidir,prn}\n
+
+$ #_usage16 Original Message:()
+# \tSrc,Dst={1.2.3.4/24|Host|Netname}\n
+
+$ #_range_set Original Message:(ipfw: range flag set but only %d ports\n)
+# ipfw: Bereichsoption gesetzt, aber nur %d Ports\n
+
+$ #_unkn Original Message:(unknown command (%d) passed to do_setsockopt - bye!\n)
+# unbekannter Befehl (%d) an do_setsockopt - tschüssi!\n
+
+$ #_ip Original Message:(ip header length %d, should be %d\n)
+# ip Headerlänge %d, sollte %d sein\n
+
+$ #_data_ip Original Message:(data = struct iphdr : struct %shdr {\n)
+# data = struct iphdr : struct %shdr {\n
+
+$ #_data_ipfw Original Message:(data = struct ip_fw {\n)
+# data = struct ip_fw {\n
+
+$ #_accept Original Message:(\taccept )
+# \taccept 
+
+$ #_deny Original Message:(\tdeny )
+# \tdeny 
+
+$ #_univ Original Message:(\tuniversal\n)
+# \tuniversal\n
+
+$ #_missing Original Message:(ipfw: missing protocol name\n)
+# ipfw: Protokollname fehlt\n
+
+$ #_illegal Original Message:(illegal protocol name \"%s\"\n)
+# ungültiger Protokollname "%s"\n
+
+$ #_missing_ip Original Message:(ipfw: missing ip address\n)
+# ipfw: IP-Adresse fehlt\n
+
+$ #_periods Original Message:(ipfw: two periods in a row in ip address (%s)\n)
+# ipfw: zwei Punkte hintereinander in IP-Adresse (%s)\n
+
+$ #_unkn_host Original Message:(ipfw: unknown host \"%s\"\n)
+# ipfw: unbekannter Rechner "%s"\n
+
+$ #_addr_length Original Message:(ipfw: hostentry addr length = %d, expected %d)
+# ipfw: Rechnereintrag Adreßlänge = %d, erwartet %d
+
+$ #_matched Original Message:(ipfw: Only %d fields matched in IP address!\n)
+# ipfw: Nur %d Felder gefunden in IP-Adresse!\n
+
+$ #_too_large Original Message:(ipfw: number too large in ip address (%s)\n)
+# ipfw: Zahl zu groß in IP-Adresse (%s)\n
+
+$ #_inc_format Original Message:(ipfw: incorrect ip address format \"%s\" (expected 3 periods)\n)
+# ipfw: ungültiges IP-Adreßformat "%s" (habe 3 Punkte erwartet)\n
+
+$ #_not_allowed Original Message:(ipfw: ip netmask not allowed here (%s)\n)
+# ipfw: IP-Netzmaske hier nicht erlaubt (%s)\n
+
+$ #_missing_mask Original Message:(ipfw: missing mask value (%s)\n)
+# ipfw: fehlender Maskenwert (%s)\n
+
+$ #_non_num Original Message:(ipfw: non-numeric mask value (%s)\n)
+# ipfw: nichtnumerischer Maskenwert (%s)\n
+
+$ #_junk_mask Original Message:(ipfw: junk after mask (%s)\n)
+# ipfw: Schrott hinter Maske (%s)\n
+
+$ #_out_range Original Message:(ipfw: mask length value out of range (%s)\n)
+# ipfw: Maskenlänge nicht im gültigen Bereich (%s)\n
+
+$ #_junk_ip Original Message:(ipfw: junk after ip address (%s)\n)
+# ipfw: Schrott hinter IP-Adresse (%s)\n
+
+$ #_illegal_port Original Message:(ipfw: illegal port number (%s)\n)
+# ipfw: ungültige Portnummer (%s)\n
+
+$ #_portnum_out Original Message:(ipfw: port number out of range (%d)\n)
+# ipfw: Portnummer nicht im gültigen Bereich (%d)\n
+
+$ #_unkn_service Original Message:(ipfw: unknown %s service \"%s\"\n)
+# ipfw: unbekannter %s Dienst "%s"\n
+
+$ #_too_port Original Message:(ipfw: too many port numbers (max %d, got at least %d, next parm="%s")\n)
+# ipfw: zuviele Portnummern (max %d, bekam mindestens %d, nächster Wert="%s")\n
+
+$ #_port_ranges Original Message:(port ranges are only allowed for the first port value pair (%s)\n)
+# Portbereiche sind nur für das erste Portwertepaar erlaubt (%s)\n
+
+$ #_no_range Original Message:(ipfw: port range not allowed here (%s)\n)
+# ipfw: Portbereich hier nicht erlaubt (%s)\n
+
+$ #_missing_port Original Message:(ipfw: missing port number%s\n)
+# ipfw: fehlende Portnummer\n
+
+$ #_nomore_port Original Message:(ipfw: not enough port numbers (expected %d, got %d)\n)
+# ipfw: nicht genügend viele Portnummern (erwartet %d, bekam %d)\n
+
+$ #_check_blocking Original Message:(blocking)
+# blocking
+
+$ #_check_forwarding Original Message:(forwarding)
+# forwarding
+
+$ #_check Original Message:(check %s )
+# check %s 
+
+$ #_only_check Original Message:(ipfw: can only check TCP or UDP packets\n)
+# ipfw: kann nur TCP- oder UDP-Packete Ã¼berprüfen\n
+
+$ #_missing_from Original Message:(ipfw: missing \"from\" keyword\n)
+# ipfw: fehlendes "from"\n
+
+$ #_expect_from Original Message:(ipfw: expected \"from\" keyword, got \"%s\"\n)
+# ipfw: habe "from" erwartet, bekam "%s"\n
+
+$ #_missing_to Original Message:(ipfw: missing \"to\" keyword\n)
+# ipfw: fehlendes "to"\n
+
+$ #_expect_to Original Message:(ipfw: expected \"to\" keyword, got \"%s\"\n)
+# ipfw: habe "to" erwaretet, bekam "%s"\n
+
+$ #_paq_accept Original Message:(packet accepted by %s firewall\n)
+# Packet von %s Firewall akzeptiert\n
+
+$ #_blocking Original Message:(blocking)
+# blocking
+
+$ #_forwarding Original Message:(forwarding)
+# forwarding
+
+$ #_paq_reject Original Message:(packet rejected by %s firewall\n)
+# Packet von %s Firewall abgewiesen\n
+
+$ #_extra Original Message:(ipfw: extra parameters at end of command ()
+# ipfw: Ã¼berflüssige Parameter am Ende des Befehls (
+
+$ #_usage21 Original Message:(usage: ipfirewall add %s ...\n)
+# usage: ipfirewall add %s ...\n
+
+$ #_add Original Message:(add %s )
+# add %s 
+
+$ #_missing_acc Original Message:(ipfw: missing \"accept\" or \"deny\" keyword\n)
+# ipfw: fehlendes "accept" oder "deny"\n
+
+$ #_expect_acc Original Message:(ipfw: expected \"accept\", \"deny\" or \"reject\", got \"%s\"\n)
+# ipfw: habe "accept", "deny" oder "reject" erwartet, bekam "%s"\n
+
+$ #_missing_proto Original Message:(ipfw: missing protocol name.\n)
+# ipfw: fehlender Protokollname.\n
+
+$ #_missing_iface Original Message:(ipfw: missing interface address.\n)
+# ipfw: fehlender Schnittstellenname.\n
+
+$ #_invalid_iface Original Message:(Invalid interface address.\n)
+# Ungültige Schnittstellenadresse.\n
+
+$ #_missing_from2 Original Message:(ipfw: missing \"from\" keyword\n)
+# ipfw: fehlendes "from"\n
+
+$ #_expect_from2 Original Message:(ipfw: expected \"from\", got \"%s\"\n)
+# ipfw: habe "from" erwartet, bekam "%s"\n
+
+$ #_missing_to2 Original Message:(ipfw: missing \"to\" keyword\n)
+# ipfw: fehlendes "to"\n
+
+$ #_expect_to2 Original Message:(ipfw: expected \"to\", got \"%s\"\n)
+# ipfw: habe "to" erwartet, bekam "%s"\n
+
+$ #_extra2 Original Message:(ipfw: extra parameters at end of command ()
+# ipfw: Ã¼berflüssige Parameter am Ende des Befehls (
+
+$ #_usage22 Original Message:(usage: ipfirewall delete %s ...\n)
+# usage: ipfirewall delete %s ...\n
+
+$ #_delete Original Message:(delete %s )
+# delete %s 
+
+$ #_missing_acc2 Original Message:(ipfw: missing \"accept\" or \"deny\" keyword\n)
+# ipfw: fehlendes "accept" oder "deny"\n
+
+$ #_expect_acc2 Original Message:(ipfw: expected \"accept\" or \"deny\", got \"%s\"\n)
+# ipfw: habe "accept" oder "deny" erwartet, bekam "%s"\n
+
+$ #_missing_proto2 Original Message:(ipfw: missing protocol name.\n)
+# ipfw: fehlender Protokollname.\n
+
+$ #_missing_iface2 Original Message:(ipfw: missing interface address.\n)
+# ipfw: fehlende Schnittstellenadresse.\n
+
+$ #_invalid_iface2 Original Message:(Invalid interface address.\n)
+# Ungültige Schnittstellenadresse.\n
+
+$ #_missing_from3 Original Message:(ipfw: missing \"from\" keyword\n)
+# ipfw: fehlendes "from"\n
+
+$ #_expect_from3 Original Message:(ipfw: expected \"from\", got \"%s\"\n)
+# ipfw: habe "from" erwartet, bekam "%s"\n
+
+$ #_missing_to3 Original Message:(ipfw: missing \"to\" keyword\n)
+# ipfw: fehlendes "to"\n
+
+$ #_expect_to3 Original Message:(ipfw: expected \"to\", got \"%s\"\n)
+# ipfw: habe "to" erwartet, bekam "%s"\n
+
+$ #_extra3 Original Message:(ipfw: extra parameters at end of command ()
+# ipfw: Ã¼berflüssige Parameter am Ende des Befehls (
+
+$ #_anywhere Original Message:(anywhere)
+# irgendwo
+
+$ #_bytes Original Message:(  Packets    Bytes  )
+#   Packete    Bytes  
+
+$ #_proto Original Message:(Type    Proto Flags From                To                  Iface               Ports\n)
+# Type    Proto Flags From                To                  Iface               Ports\n
+
+$ #_list_accept Original Message:(accept  )
+# accept  
+
+$ #_list_deny Original Message:(deny    )
+# deny    
+
+$ #_list_any Original Message:(any)
+# any
+
+$ #_expect_kwds Original Message:(blocking, forwarding or accounting keyword expected.\n)
+# blocking, forwarding oder accounting erwartet.\n
+
+$ #_found_kwds Original Message:(Found '%s': 'blocking', 'forwarding' or 'accounting' keyword expected.\n)
+# Habe gefunden '%s': 'blocking', 'forwarding' oder 'accounting' erwartet.\n
+
+$ #_raw_socket Original Message:(ipfw: raw socket creation)
+# ipfw: raw socket creation
+
+$ #_expect_main_blocking Original Message:(ipfw: expected \"blocking\" or \"forwarding\".\n)
+# ipfw: habe "blocking" oder "forwarding" erwartet.\n
+
+$ #_expect_main_accept Original Message:(ipfw: expected \"accept\", \"deny\" or \"reject\".\n)
+# ipfw: habe "accept", "deny" oder "reject" erwartet.\n
+
+$ #_expect_main_accounting Original Message:(ipfw: expected \"accounting\", \"blocking\" or \"forwarding\".\n)
+# ipfw: habe "accounting", "blocking" oder "forwarding" erwartet.\n
+
+$ #_illegal_check Original Message:(ipfw: illegal `check' keyword: %s\n)
+# ipfw: ungültiges `check': %s\n
+
+$ #_main_missing Original Message:((missing))
+# (fehlt)
+
+$ #_unkn_cmd Original Message:(ipfw: unknown command `%s'\n\n)
+# ipfw: unbekannter Befehl `%s'\n\n
+
+$ #_unkn_kwd Original Message:(ipfw: unknown `%s' keyword: `%s'\n)
+# ipfw: unbekanntes `%s' Schlüsselwort: `%s'\n
+
+$ #_reject Original Message:(\treject )
+# \treject 
+
+$ #_badflag Original Message:(ipfw: \"%s\" flag only applicable to TCP rules\n)
+# ipfw: "%s" flag only applicable to TCP rules\n
+
+$ #_missing_fromi Original Message:(ipfw: missing \"from\" or \"iface\" keyword\n)
+# ipfw: missing "from" or "iface" keyword\n
+
+$ #_paq_deny Original Message:(packet denied by %s firewall\n)
+# packet denied by %s firewall\n
+
+$ #_list_reject Original Message:(reject  )
+# reject  
+
+$ #_dp_deny Original Message:(Default policy: deny\n)
+# Default policy: deny\n
+
+$ #_dp_accept Original Message:(Default policy: accept\n)
+# Default policy: accept\n
+
+$ #_dp_reject Original Message:(Default policy: reject\n)
+# Default policy: reject\n
+
+$ #_no_support Original Message:(ipfw: no support for `%s'. Please recompile with newer Kernel.\n)
+# ipfw: no support for `%s'. Please recompile with newer Kernel.\n
+
+$ #_list_account Original Message:(account )
+# account 
diff --git a/nls/de_DE.88591/ipx.m b/nls/de_DE.88591/ipx.m
new file mode 100644 (file)
index 0000000..731e455
--- /dev/null
@@ -0,0 +1,10 @@
+$set 15  #ipx
+
+$ #_none Original Message:([NONE SET])
+# [NICHTS GESETZT]
+
+$ #_ipx Original Message:(IPX)
+# IPX
+
+$ #_notyet Original Message:(Routing table for `ipx' not yet supported.\n)
+# Routingtabelle für `ipx' noch nicht unterstützt.\n
diff --git a/nls/de_DE.88591/lib.m b/nls/de_DE.88591/lib.m
new file mode 100644 (file)
index 0000000..a16f2dd
--- /dev/null
@@ -0,0 +1,22 @@
+$set 22  #lib
+
+$ #_unknown_af Original Message:(Unknown address family `%s'.\n)
+# Unbekannte Adressfamilie `%s'.\n
+
+$ #_toomuch_af Original Message:(Too much address family arguments.\n)
+# Zu viele Adressfamilien angegeben.\n
+
+$ #_nofeature Original Message:(%s: feature `%s' not supported. Please recompile with newer kernel.\n)
+# %s: Merkmal `%s' nicht unterstützt. Bitte mit neum Kernel Ã¼bersetzen.\n
+
+$ #_sysnot Original Message:(%s: no support for `%s' on this system.\n)
+# %s: no support for `%s' on this system.\n
+
+$ #_masq Original Message:(IP masquerading entries\n)
+# IP masquerading entries\n
+
+$ #_masq_tit1 Original Message:(prot expire   source               destination         ports\n)
+# prot expire   source               destination         ports\n
+
+$ #_masq_tit2 Original Message:(prot expire   initseq    delta prevd source               destination         ports\n)
+# prot expire   initseq    delta prevd source               destination         ports\n
diff --git a/nls/de_DE.88591/loopback.m b/nls/de_DE.88591/loopback.m
new file mode 100644 (file)
index 0000000..2a5852f
--- /dev/null
@@ -0,0 +1,11 @@
+$set 16  #loopback
+
+$ #_none Original Message:([NONE SET])
+# [NICHTS GESETZT]
+
+$ #_unspec Original Message:(UNSPEC)
+# UNSPEZIFIZIERT
+
+$ #_loop Original Message:(Local Loopback)
+# Lokaler Loopback
+
diff --git a/nls/de_DE.88591/netrom.m b/nls/de_DE.88591/netrom.m
new file mode 100644 (file)
index 0000000..f449796
--- /dev/null
@@ -0,0 +1,20 @@
+$set 20  #netrom
+
+$ #_none Original Message:([NONE SET])
+# [NICHTS GESETZT]
+
+$ #_debug1 Original Message:(Invalid callsign)
+# Ungültiges Rufzeichen
+
+$ #_debug2 Original Message:(Callsign too long)
+# Rufzeichen zu lang
+
+$ #_hw Original Message:(AMPR NET/ROM)
+# AMPR NET/ROM
+
+$ #_netrom Original Message:(AMPR NET/ROM)
+# AMPR NET/ROM
+
+$ #_notyet Original Message:(Routing table for `netrom' not yet supported.\n)
+# Routing table for `netrom' not yet supported.\n
+
diff --git a/nls/de_DE.88591/netstat.m b/nls/de_DE.88591/netstat.m
new file mode 100644 (file)
index 0000000..fb814e2
--- /dev/null
@@ -0,0 +1,149 @@
+$set 4  #netstat
+
+$ #_header Original Message:(Destination     Gateway         Genmask         Flags Metric Ref Use    Iface\n)
+# Ziel            Gateway         Maske           Optn  Metrik Ref Ben    Iface\n
+
+$ #_args Original Message:(%s -> %d args)
+# %s -> %d Argumente
+
+$ #_netstat Original Message:(netstat: unsupported address family %d !\n)
+# netstat: Adressfamilie %d nicht unterstützt !\n
+
+$ #_UNKN Original Message:(UNKNOWN)
+# UNBEKANNT
+
+$ #_off Original Message:(off (0.00/%ld))
+# aus (0.00/%ld)
+
+$ #_on Original Message:(on (%2.2f/%ld))
+# an (%2.2f/%ld)
+
+$ #_unkn Original Message:(unkn-%d (%2.2f/%ld))
+# unbek-%d (%2.2f/%ld)
+
+$ #_off2 Original Message:(off (0.00/%ld) %c)
+# aus (0.00/%ld) %c
+
+$ #_on2 Original Message:(on (%2.2f/%ld) %c)
+# an (%2.2f/%ld) %c
+
+$ #_unkn2 Original Message:(unkn-%d (%2.2f/%ld) %c)
+# unbek-%d (%2.2f/%ld) %c
+
+$ #_off3 Original Message:(off (0.00/%ld) %c)
+# aus (0.00/%ld) %c
+
+$ #_on3 Original Message:(on (%2.2f/%ld) %c)
+# an (%2.2f/%ld) %c
+
+$ #_unkn3 Original Message:(unkn-%d (%2.2f/%ld) %c)
+# unbek-%d (%2.2f/%ld) %c
+
+$ #_unix Original Message:(Active UNIX domain sockets\n)
+# Aktive UNIX Domain-Sockets\n
+
+$ #_header_unix Original Message:(Proto RefCnt Flags      Type            State           Path\n)
+# Proto RefAnz Optn       Typ             Zustand         Pfad\n
+
+$ #_noflags Original Message:([NO FLAGS])
+# [KEINE OPTIONEN]
+
+$ #_interface Original Message:(Kernel Interface table\n)
+# Kernel Schnittstellentabelle\n
+
+$ #_header_iface Original Message:(Iface   MTU Met  RX-OK RX-ERR RX-DRP RX-OVR  TX-OK TX-ERR TX-DRP TX-OVR Flags\n)
+# Iface   MTU Met  RX-OK RX-ERR RX-DRP RX-OVR  TX-OK TX-ERR TX-DRP TX-OVR Flags\n
+
+$ #_unkn_iface Original Message:(%s: unknown interface.\n)
+# %s: unbekannte Schnittstelle.\n
+
+
+$ #_usage1  Original Message:(usage: netstat [-veenc] [<Af>] -r            netstat {-V|--version|-h|--help}\n)
+# usage: netstat [-veenc] [<Af>] -r            netstat {-V|--version|-h|--help}\n
+
+$ #_usage2  Original Message:(       netstat [-vncao] [<Socket>]\n)
+#        netstat [-vncao] [<Socket>]\n
+
+$ #_usage3  Original Message:(       netstat { [-veenac] -i | [-vnc] -N | [-cne] -M }\n\n)
+#        netstat { [-veenac] -i | [-vnc] -N | [-cne] -M }\n\n
+
+$ #_usage4  Original Message:(        -r, --routing            display routing table\n)
+#         -r, --routing            zeige Routingtabelle an\n
+
+$ #_usage5  Original Message:(        -N, --netlink            display netlink kernel messages\n)
+#         -N, --netlink            zeige Netlink Kernelnachrichten an\n
+
+$ #_usage6  Original Message:(        -i, --interfaces         display interface table\n)
+#         -i, --interfaces         zeige Interfacetabelle an\n
+
+$ #_usage7  Original Message:(        -M, --masquerade         display masqueraded connections\n\n)
+#         -M, --masquerade         display masqueraded connections\n\n
+
+$ #_usage8  Original Message:(        -v, --verbose            be verbose\n)
+#         -v, --verbose            sei gesprächig\n
+
+$ #_usage9  Original Message:(        -n, --numeric            dont resolve names\n)
+#         -n, --numeric                   Namen nur numerisch ausgeben\n
+
+$ #_usage10 Original Message:(        -e, --extend             display other/more informations\n)
+#         -e, --extend             Andere/Mehr Infos ausgeben\n
+
+$ #_usage11 Original Message:(        -c, --continous          continous lising\n\n)
+#         -c, --continous          Fortwährend anzeigen\n\n
+
+$ #_usage12 Original Message:(        -a, --all, --listening   display all\n)
+#         -a, --all, --listening   Alle anzeigen\n
+
+$ #_usage13  Original Message:(       -o, --timers             display timers\n\n)
+#         -o, --timers             Timer auch anzeigen\n\n
+
+$ #_usage14  Original Message:(<Socket>={-t|--tcp} {-u|--udp} {-w|--raw} {-x|--unix} --ax25 --ipx --netrom\n)
+# <Socket>={-t|--tcp} {-u|--udp} {-w|--raw} {-x|--unix} --ax25 --ipx --netrom\n
+
+$ #_usage15  Original Message:(<Af>= -A {inet|ipx|netrom|ddp|ax25},... --inet --ipx --netrom --ddp --ax25\n)
+# <Af>= -A {inet|ipx|netrom|ddp|ax25},... --inet --ipx --netrom --ddp --ax25\n
+
+$ #_internet Original Message:(Active Internet connections)
+# Aktive Internetverbindungen
+
+$ #_servers Original Message:( (including servers))
+#  (einschl. Server)
+
+$ #_header_internet Original Message:(\nProto Recv-Q Send-Q Local Address          Foreign Address        (State)       User\n)
+# \nProto Empf-Q Send-Q Lokale Adresse         Fremde Adresse         (Zustand)     Benutzer\n
+
+$ #_header_ipx Original Message:(Active IPX sockets\nProto Recv-Q Send-Q Local Address          Foreign Address        (State)       User\n)
+# Aktive IPX-Sockets\nProto Empf-Q Send-Q Lokale Adresse         Fremde Adresse         (Zustand)     Benutzer\n
+
+$ #_type_no_route Original Message:(No routing for address family `%s'.\n)
+# Kein Routing für Adressfamilie `%s'.\n
+
+$ #_route_no_support Original Message:(Adress family `%s' not supported.\n)
+# Adressfamilie `%s' noch nicht unterstützt.\n
+
+$ #_route_not_yet Original Message:(Address family `%s' Not yet supported.\n)
+# Adaressfamilie `%s' noch nicht unterstützt.\n
+
+$ #_nlp_title Original Message:(Netlink Kernel Messages)
+# Netlink Kernelnachrichten
+
+$ #_nlp_cnt Original Message:( (continous))
+#  (fortwährend)
+
+$ #_noax25 Original Message:(AX.25 not configured in this system.\n)
+# AX.25 not configured in this system.\n
+
+$ #_ax25 Original Message:(Kernel AX.25 routing table\n)
+# Kernel AX.25 routing table\n
+
+$ #_header_ax25 Original Message:(Destination  Iface    Use\n)
+# Destination  Iface    Use\n
+
+$ #_nonetrom Original Message:(NET/ROM not configured in this system.\n)
+# NET/ROM not configured in this system.\n
+
+$ #_netrom Original Message:(Kernel NET/ROM routing table\n)
+# Kernel NET/ROM routing table\n
+
+$ #_header_netrom Original Message:(Destination  Mnemonic  Quality  Neighbour  Iface\n)
+# Destination  Mnemonic  Quality  Neighbour  Iface\n
diff --git a/nls/de_DE.88591/plipconfig.m b/nls/de_DE.88591/plipconfig.m
new file mode 100644 (file)
index 0000000..1a0789d
--- /dev/null
@@ -0,0 +1,10 @@
+$set 6  #plipconfig
+
+$ #_usage1 Original Message:(Usage: plipconfig [-a] [-i] [-v] interface\n)
+# Benutzung: plipconfig [-a] [-i] [-v] Schnittstelle\n
+
+$ #_usage2 Original Message:(                  [nibble NN] [trigger NN]\n)
+#                   [nibble NN] [trigger NN]\n
+
+$ #_plip Original Message:(%s\tnibble %lu  trigger %lu\n)
+# %s\tnibble %lu  trigger %lu\n
diff --git a/nls/de_DE.88591/ppp.m b/nls/de_DE.88591/ppp.m
new file mode 100644 (file)
index 0000000..999e0b3
--- /dev/null
@@ -0,0 +1,8 @@
+$set 17  #ppp
+
+$ #_cant_start Original Message:(You cannot start PPP with this program.\n)
+# Sie können PPP mit diesem Programm nicht starten.\n
+
+$ #_ppp Original Message:(Point-Point Protocol)
+# Punkt-zu-Punkt-Protokoll
+
diff --git a/nls/de_DE.88591/rarp.m b/nls/de_DE.88591/rarp.m
new file mode 100644 (file)
index 0000000..b64d8d6
--- /dev/null
@@ -0,0 +1,22 @@
+$set 7  #rarp
+
+$ #_invalid Original Message:(Invalid Ethernet address: %s\n)
+# Ungültige Ethernet-Adresse: %s\n
+
+$ #_unkn_host Original Message:(rarp: %s: unknown host\n)
+# rarp: %s: unbekannter Rechner\n
+
+$ #_noentry Original Message:(No ARP entry for %s\n)
+# Kein ARP-Eintrag für %s\n
+
+$ #_usage1 Original Message:(Usage: rarp -a                   List Entries in cache.     \n)
+# Benutzung: rarp -a                   Gibt Einträge im Cache aus.\n
+
+$ #_usage2 Original Message:(       rarp -d hostname          Delete hostname from cache.\n)
+#        rarp -d Rechnername          Löscht Einträge im Cache.\n
+
+$ #_usage3 Original Message:(       rarp -s hostname hw_addr  Add hostname to cache.\n)
+#        rarp -s Rechnername hw_Adresse  Füge Rechnernamen zum Cache hinzu.\n
+
+$ #_unkn_hw Original Message:(rarp: %s: unknown hardware type.\n)
+# rarp: %s: unbekannter Hardwaretyp.\n
diff --git a/nls/de_DE.88591/route.m b/nls/de_DE.88591/route.m
new file mode 100644 (file)
index 0000000..d759e21
--- /dev/null
@@ -0,0 +1,6 @@
+$set 2  #route
+
+$ #_rresolve Original Message:(rresolve: unsupport address family %d !\n)
+# rresolve: Adressfamilie nicht unterstützt: %d !\n
+
+$ #_usage1 Original Message:(Usage: route [-nvee] [-A inet|ipx|ddp|netrom],...  route {--version|--help}
\ No newline at end of file
diff --git a/nls/de_DE.88591/slattach.m b/nls/de_DE.88591/slattach.m
new file mode 100644 (file)
index 0000000..a6e46c1
--- /dev/null
@@ -0,0 +1,46 @@
+$set 8  #slattach
+
+$ #_user_unkn Original Message:(slattach: tty_lock: UUCP user %s unknown!\n)
+# slattach: tty_lock: UUCP Benutzer %s unbekannt!\n
+
+$ #_drop Original Message:(slattach: tty_hangup(DROP): %s\n)
+# slattach: tty_hangup(BEENDEN): %s\n
+
+$ #_raise Original Message:(slattach: tty_hangup(RAISE): %s\n)
+# slattach: tty_hangup(STARTEN): %s\n
+
+$ #_cant_state Original Message:(slattach: tty_open: cannot get current state!\n)
+# slattach: tty_open: kann aktuellen Zustand nicht bestimmen!\n
+
+$ #_cant_disc Original Message:(slattach: tty_open: cannot get current line disc!\n)
+# slattach: tty_open: kann aktuelle Leitungsdisziplin nicht bestimmen!\n
+
+$ #_cant_raw Original Message:(slattach: tty_open: cannot set RAW mode!\n)
+# slattach: tty_open: kann RAW-Modus nicht setzen!\n
+
+$ #_cant_bps Original Message:(slattach: tty_open: cannot set %s bps!\n)
+# slattach: tty_open: kann Baudrate %s nicht setzen!\n
+
+$ #_cant_8n1 Original Message:(slattach: tty_open: cannot set 8N1 mode!\n)
+# slattach: tty_open: kann 8N1-Modus nicht setzen!\n
+
+$ #_usage1 Original Message:(Usage: slattach [-ehlLmnqv] [-c cmd] [-s speed] [-p protocol] tty | -\n)
+# Benutzung: slattach [-ehlLmnqv] [-c Bef] [-s Geschw] [-p Proto] tty | -\n
+
+$ #_unsupp Original Message:(slattach: unsupported protocol %s\n)
+# slattach: Protokoll nicht unterstützt: %s\n
+
+$ #_started Original Message:(%s started)
+# %s hat begonnen
+
+$ #_on Original Message:( on %s)
+#  auf %s
+
+$ #_iface Original Message:( interface %s\n)
+#  Schnittstelle %s\n
+
+$ #_locked Original Message:(slattach: /dev/%s already locked\n)
+# slattach: /dev/%s bereits benutzt\n
+
+$ #_cant_pid Original Message:(slattach: cannot write PID to lock file\n)
+# slattach: kann PID nicht ins lockfile schreiben\n
diff --git a/nls/de_DE.88591/slip.m b/nls/de_DE.88591/slip.m
new file mode 100644 (file)
index 0000000..eceb4d3
--- /dev/null
@@ -0,0 +1,17 @@
+$set 18  #slip
+
+$ #_slip Original Message:(Serial Line IP)
+# Serial Line IP
+
+$ #_cslip Original Message:(VJ Serial Line IP)
+# VJ Serial Line IP
+
+$ #_slip6 Original Message:(6-bit Serial Line IP)
+# 6-Bit Serial Line IP
+
+$ #_cslip6 Original Message:(VJ 6-bit Serial Line IP)
+# VJ 6-Bit Serial Line IP
+
+$ #_adaptive Original Message:(Adaptive Serial Line IP)
+# Adaptive Serial Line IP
+
diff --git a/nls/de_DE.88591/tunnel.m b/nls/de_DE.88591/tunnel.m
new file mode 100644 (file)
index 0000000..680ed3c
--- /dev/null
@@ -0,0 +1,4 @@
+$set 21  #tunnel
+
+$ #_hw Original Message:(IPIP Tunnel)
+# IPIP Tunnel
diff --git a/nls/de_DE.88591/unix.m b/nls/de_DE.88591/unix.m
new file mode 100644 (file)
index 0000000..5680ada
--- /dev/null
@@ -0,0 +1,10 @@
+$set 19  #unix
+
+$ #_none Original Message:([NONE SET])
+# [NICHT GESETZT]
+
+$ #_unix Original Message:(UNIX Domain)
+# UNIX Domäne
+
+$ #_unspec Original Message:(UNSPEC)
+# UNSPEZIFIZIERT
diff --git a/nls/en_US.88591/arcnet.m b/nls/en_US.88591/arcnet.m
new file mode 100644 (file)
index 0000000..f134194
--- /dev/null
@@ -0,0 +1,20 @@
+$set 10  #arcnet
+
+$ #_none Original Message:([NONE SET])
+# [NONE SET]
+
+$ #_debug1 Original Message:(in_arcnet(%s): invalid arcnet address!\n)
+# in_arcnet(%s): invalid arcnet address!\n
+
+$ #_debug2 Original Message:(in_arcnet(%s): invalid arcnet address!\n)
+# in_arcnet(%s): invalid arcnet address!\n
+
+$ #_debug3 Original Message:(in_arcnet(%s): trailing : ignored!\n)
+# in_arcnet(%s): trailing : ignored!\n
+
+$ #_debug4 Original Message:(in_arcnet(%s): trailing junk!\n)
+# in_arcnet(%s): trailing junk!\n
+
+$ #_arcnet Original Message:(1.5Mbps ARCnet)
+# 1.5Mbps ARCnet
+
diff --git a/nls/en_US.88591/arp.m b/nls/en_US.88591/arp.m
new file mode 100644 (file)
index 0000000..c08b240
--- /dev/null
@@ -0,0 +1,70 @@
+$set 3  #arp
+
+$ #_hostname Original Message:(arp: need host name\n)
+# arp: need host name\n
+
+$ #_no_arp Original Message:(No ARP entry for %s\n)
+# No ARP entry for %s\n
+
+$ #_need_hw Original Message:(arp: need hardware address\n)
+# arp: need hardware address\n
+
+$ #_invalidhw Original Message:(arp: invalid hardware address\n)
+# arp: invalid hardware address\n
+
+$ #_cant_open Original Message:(arp: cannot open etherfile %s !\n)
+# arp: cannot open etherfile %s !\n
+
+$ #_formaterr Original Message:(arp: format error on line %u of etherfile %s !\n)
+# arp: format error on line %u of etherfile %s !\n
+
+$ #_cant_set Original Message:(arp: cannot set entry on line %u of etherfile %s !\n)
+# arp: cannot set entry on line %u of etherfile %s !\n
+
+$ #_address Original Message:(Address\t\tHW type\t\tHW address\t     Flags Mask\t\t   Iface\n)
+# Address\t\tHW type\t\tHW address\t     Flags Mask\t\t   Iface\n
+
+$ #_wrong_af Original Message:(arp: %s: kernel only supports 'inet'.\n)
+# arp: %s: kernel only supports 'inet'.\n
+
+$ #_sum Original Message:(Entries: %d\tSkiped: %d\tFound: %d\n)
+# Entries: %d\tSkiped: %d\tFound: %d\n
+
+$ #_usage1 Original Message:(Usage: arp [-vn] [-H type] [-i if] -a [hostname]\n)
+# Usage: arp [-vn] [-H type] [-i if] -a [hostname]\n
+
+$ #_usage2 Original Message:(       arp [-v] [-i if] -d hostname [pub]\n)
+#        arp [-v] [-i if] -d hostname [pub]\n
+
+$ #_usage3 Original Message:(       arp [-v] [-H type] [-i if] -s hostname hw_addr [temp] [trail]\n)
+#        arp [-v] [-H type] [-i if] -s hostname hw_addr [temp] [trail]\n
+
+$ #_usage4 Original Message:(       arp [-v] [-H type] [-i if] -s hostname hw_addr [netmask nm] pub [trail]\n)
+#        arp [-v] [-H type] [-i if] -s hostname hw_addr [netmask nm] pub [trail]\n
+
+$ #_usage5 Original Message:(       arp [-vn] [-H type] [-i if] -f filename\n)
+#        arp [-vn] [-H type] [-i if] -f filename\n
+
+$ #_hw_not_supp Original Message:(%s: hardware type not supported!\n)
+# %s: hardware type not supported!\n
+
+$ #_fam_not_supp Original Message:(%s: address family not supported!\n)
+# %s: address family not supported!\n
+
+$ #_unkn_addr Original Message:(arp: %s: unknown address family.\n)
+# arp: %s: unknown address family.\n
+
+$ #_unkn_hw Original Message:(arp: %s: unknown hardware type.\n)
+# arp: %s: unknown hardware type.\n
+
+$ #_none Original Message:(arp: in %d entries no match found.\n)
+# arp: in %d entries no match found.\n
+
+$ #_wrong_hw Original Message:(arp: %s: hardware type without ARP support.\n)
+# arp: %s: hardware type without ARP support.\n
+
+$ #_einv_pub Original Message:(Probably destination is reached via ARP Interface. See arp(8)\n)
+# Probably destination is reached via ARP Interface. See arp(8)\n
+
+$ #_einv_nopub Original Message:(Probably destination is on different Interface. See arp(8)\n)
+# Probably destination is on different Interface. See arp(8)\n
diff --git a/nls/en_US.88591/ax25.m b/nls/en_US.88591/ax25.m
new file mode 100644 (file)
index 0000000..f5a5a37
--- /dev/null
@@ -0,0 +1,17 @@
+$set 11  #ax25
+
+$ #_none Original Message:([NONE SET])
+# [NONE SET]
+
+$ #_debug1 Original Message:(Invalid callsign)
+# Invalid callsign
+
+$ #_debug2 Original Message:(Callsign too long)
+# Callsign too long
+
+$ #_hw Original Message:(AMPR AX.25)
+# AMPR AX.25
+
+$ #_ax25 Original Message:(AMPR AX.25)
+# AMPR AX.25
+
diff --git a/nls/en_US.88591/ddp.m b/nls/en_US.88591/ddp.m
new file mode 100644 (file)
index 0000000..8cc5008
--- /dev/null
@@ -0,0 +1,10 @@
+$set 12  #ddp
+
+$ #_none Original Message:([NONE SET])
+# [NONE SET]
+
+$ #_ddp Original Message:(Appletalk DDP)
+# Appletalk DDP
+
+$ #_notyet Original Message:(Routing table for `ddp' not yet supported.\n)
+# Routing table for `ddp' not yet supported.\n
diff --git a/nls/en_US.88591/ether.m b/nls/en_US.88591/ether.m
new file mode 100644 (file)
index 0000000..828214d
--- /dev/null
@@ -0,0 +1,20 @@
+$set 13  #ether
+
+$ #_none Original Message:([NONE SET])
+# [NONE SET]
+
+$ #_debug1 Original Message:(in_ether(%s): invalid ether address!\n)
+# in_ether(%s): invalid ether address!\n
+
+$ #_debug2 Original Message:(in_ether(%s): invalid ether address!\n)
+# in_ether(%s): invalid ether address!\n
+
+$ #_debug3 Original Message:(in_ether(%s): trailing : ignored!\n)
+# in_ether(%s): trailing : ignored!\n
+
+$ #_debug4 Original Message:(in_ether(%s): trailing junk!\n)
+# in_ether(%s): trailing junk!\n
+
+$ #_ether Original Message:(10Mbps Ethernet)
+# 10Mbps Ethernet
+
diff --git a/nls/en_US.88591/hostname.m b/nls/en_US.88591/hostname.m
new file mode 100644 (file)
index 0000000..83e7d7c
--- /dev/null
@@ -0,0 +1,103 @@
+$set 5  #hostname
+
+$ #_root Original Message:(%s: you must be root to change the host name\n)
+# %s: you must be root to change the host name\n
+
+$ #_toolong Original Message:(%s: name too long\n)
+# %s: name too long\n
+
+$ #_nodns1 Original Message:(%s: You can't change the DNS domain name with this command\n)
+# %s: You can't change the DNS domain name with this command\n
+
+$ #_nodns2 Original Message:(\nUnless you are using bind or NIS for host lookups you can change the DNS\n)
+# \nUnless you are using bind or NIS for host lookups you can change the DNS\n
+
+$ #_nodns3 Original Message:(domain name (which is part of the FQDN) in the /etc/hosts file.\n)
+# which is part of the FQDN) in the /etc/hosts file.\n
+
+$ #_cant_open Original Message:(%s: can't open `%s'\n)
+# %s: can't open `%s'\n
+
+$ #_usage1 Original Message:(Usage: hostname [-v] {hostname|-F file} set hostname (from file)\n)
+# Usage: hostname [-v] {hostname|-F file}      set hostname (from file)\n
+
+$ #_usage2 Original Message:(       domainname [-v] {nisdomain|-F file} set NIS domainname (from file)\n)
+#        domainname [-v] {nisdomain|-F file}   set NIS domainname (from file)\n
+
+$ #_usage3 Original Message:(       hostname [-v] [-d|-f|-s|-a|-i|-y] display formated name\n)
+#        hostname [-v] [-d|-f|-s|-a|-i|-y]     display formated name\n
+
+$ #_usage4 Original Message:(       hostname [-v] display hostname\n\n)
+#        hostname [-v]                         display hostname\n\n
+
+$ #_usage5 Original Message:(       hostname -V|--version|-h|--help print info and exit\n\n)
+#        hostname -V|--version|-h|--help       print info and exit\n\n
+
+$ #_usage6 Original Message:(    dnsdomainname=hostname -d, {yp,nis,}domainname=hostname -y\n\n)
+#     dnsdomainname=hostname -d, {yp,nis,}domainname=hostname -y\n\n
+
+$ #_usage7 Original Message:(    -s, --short           short host name\n)
+#     -s, --short           short host name\n
+
+$ #_usage8 Original Message:(    -a, --alias           alias names\n)
+#     -a, --alias           alias names\n
+
+$ #_usage9 Original Message:(    -i, --ip-address      addresses for the hostname\n)
+#     -i, --ip-address      addresses for the hostname\n
+
+$ #_usage10 Original Message:(    -f, --fqdn, --long    long host name (FQDN)\n)
+#     -f, --fqdn, --long    long host name (FQDN)\n
+
+$ #_usage11 Original Message:(    -d, --domain          DNS domain name\n)
+#     -d, --domain          DNS domain name\n
+
+$ #_usage12 Original Message:(    -y, --yp, --nis       NIS/YP domainname\n)
+#     -y, --yp, --nis       NIS/YP domainname\n
+
+$ #_usage13 Original Message:(    -F, --file            read hostname or nis domainname from given File\n\n)
+#     -F, --file            read hostname or nis domainname from given File\n\n
+
+$ #_usage14 Original Message:(   This comand can get or set the hostname or the NIS domainname. You can\n)
+#    This comand can get or set the hostname or the NIS domainname. You can\n
+
+$ #_usage15 Original Message:(   also get the DNS domain or the FQDN (fully qualified domain name).\n)
+#    also get the DNS domain or the FQDN (fully qualified domain name).\n
+
+$ #_usage16 Original Message:(   Unless you are using bind or NIS for host lookups you can change the\n)
+#    Unless you are using bind or NIS for host lookups you can change the\n
+
+$ #_usage17 Original Message:(   FQDN (Fully Qualified Domain Name) and the DNS domain name (which is\n)
+#    FQDN (Fully Qualified Domain Name) and the DNS domain name (which is\n
+
+$ #_usage18 Original Message:(   part of the FQDN) in the /etc/hosts file.\n)
+#    part of the FQDN) in the /etc/hosts file.\n
+
+$ #_verb_set Original Message:(Setting hostname to `%s'\n)
+# Setting hostname to `%s'\n
+
+$ #_verb_res Original Message:(Resolving `%s' ...\n)
+# Resolving `%s' ...\n
+
+$ #_verb_fnd Original Message:(Result: h_name=`%s'\n)
+# Result: h_name=`%s'\n
+
+$ #_verb_ali Original Message:(Result: h_aliases=`%s'\n)
+# Result: h_aliases=`%s'\n
+
+$ #_verb_ipn Original Message:(Result: h_addr_list=`%s'\n)
+# Result: h_addr_list=`%s'\n
+
+$ #_verb_get Original Message:(gethostname()=`%s'\n)
+# gethostname()=`%s'\n
+
+$ #_verb_dset Original Message:(Setting domainname to %s'\n)
+# Setting domainname to %s'\n
+
+$ #_verb_dget Original Message:(getdomainname()=%s'\n)
+# getdomainname()=%s'\n
+
+$ #_dname_root Original Message:(%s: you must be root to change the domain name\n)
+# %s: you must be root to change the domain name\n
+
+$ #_dname_toolong Original Message:(%s: name too long\n)
+# %s: name too long\n
diff --git a/nls/en_US.88591/ifconfig.m b/nls/en_US.88591/ifconfig.m
new file mode 100644 (file)
index 0000000..c173ebe
--- /dev/null
@@ -0,0 +1,76 @@
+$set 1  #ifconfig
+
+$ #_over Original Message:(overruns)
+# overruns
+
+$ #_compress Original Message:(compressed)
+# compressed
+
+$ #_link Original Message:(%-8.8s  Link encap:%s  )
+# %-8.8s  Link encap:%s  
+
+$ #_hw Original Message:(HWaddr %s)
+# HWaddr %s
+
+$ #_adr Original Message:(\n          %s addr:%s)
+# \n          %s addr:%s
+
+$ #_pap Original Message:(  P-t-P:%s  )
+#   P-t-P:%s  
+
+$ #_bcast Original Message:(  Bcast:%s  )
+#   Bcast:%s  
+
+$ #_mask Original Message:(Mask:%s\n)
+# Mask:%s\n
+
+$ #_etherII Original Message:(          IPX/Ethernet II addr:%s\n)
+#           IPX/Ethernet II addr:%s\n
+
+$ #_SNAP Original Message:(          IPX/Ethernet SNAP addr:%s\n)
+#           IPX/Ethernet SNAP addr:%s\n
+
+$ #_8022 Original Message:(          IPX/Ethernet 802.2 addr:%s\n)
+#           IPX/Ethernet 802.2 addr:%s\n
+
+$ #_8023 Original Message:(          IPX/Ethernet 802.3 addr:%s\n)
+#           IPX/Ethernet 802.3 addr:%s\n
+
+$ #_talk Original Message:(          EtherTalk Phase 2 addr:%s\n)
+#           EtherTalk Phase 2 addr:%s\n
+
+$ #_noflags Original Message:([NO FLAGS] )
+# [NO FLAGS] 
+
+$ #_mtu Original Message:( MTU:%d  Metric:%d\n)
+#  MTU:%d  Metric:%d\n
+
+$ #_rx Original Message:(RX packets:%u errors:%u dropped:%u %s:%u\n)
+# RX packets:%u errors:%u dropped:%u %s:%u\n
+
+$ #_tx Original Message:(TX packets:%u errors:%u dropped:%u %s:%u\n)
+# TX packets:%u errors:%u dropped:%u %s:%u\n
+
+$ #_interrupt Original Message:(Interrupt:%d )
+# Interrupt:%d 
+
+$ #_base Original Message:(Base address:0x%x )
+# Base address:0x%x 
+
+$ #_mem Original Message:(Memory:%lx-%lx )
+# Memory:%lx-%lx 
+
+$ #_dma Original Message:(DMA chan:%x )
+# DMA chan:%x 
+
+$ #_unkn Original Message:(%s: unknown interface.\n)
+# %s: unknown interface.\n
+
+$ #_usage1 Original Message:(Usage: ifconfig [-a] [-i] [-v] interface\n)
+# Usage: ifconfig [-a] [-i] [-v] interface\n
+
+$ #_usage2 Original Message:(                [inet address]\n)
+#                 [inet address]\n
+
+$ #_usage3 Original Message:(                [hw] [ax25 address]\n)
+#                 [hw] [ax25 address]\n
diff --git a/nls/en_US.88591/inet.m b/nls/en_US.88591/inet.m
new file mode 100644 (file)
index 0000000..30091b0
--- /dev/null
@@ -0,0 +1,25 @@
+$set 14  #inet
+
+$ #_debug1 Original Message:(rresolve: unsupport address family %d !\n)
+# rresolve: unsupport address family %d !\n
+
+$ #_none Original Message:([NONE SET])
+# [NONE SET]
+
+$ #_darpa Original Message:(DARPA Internet)
+# DARPA Internet
+
+$ #_table Original Message:(Kernel IP routing table\n)
+# Kernel IP routing table\n
+
+$ #_header1 Original Message:(Destination     Gateway         Genmask         Flags Metric Ref    Use Iface\n)
+# Destination     Gateway         Genmask         Flags Metric Ref    Use Iface\n
+
+$ #_header2 Original Message:(Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface\n)
+# Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface\n
+
+$ #_header3 Original Message:(Destination     Gateway         Genmask         Flags Metric Ref    Use Iface    MSS   Window irtt\n)
+# Destination     Gateway         Genmask         Flags Metric Ref    Use Iface    MSS   Window irtt\n
+
+$ #_route Original Message:(unsupported address family %d !\n)
+# unsupported address family %d !\n
diff --git a/nls/en_US.88591/ipfw.m b/nls/en_US.88591/ipfw.m
new file mode 100644 (file)
index 0000000..609f81b
--- /dev/null
@@ -0,0 +1,343 @@
+$set 9  #ipfw
+
+$ #_ipf_blocking Original Message:(blocking)
+# blocking
+
+$ #_ipf_fwding Original Message:(forwarding)
+# forwarding
+
+$ #_ipf_accnting Original Message:(accounting)
+# accounting
+
+$ #_ipf_msqrading Original Message:(masquerading)
+# masquerading
+
+$ #_usage1 Original Message:(usage:\tipfw [-ndhcVr] [--version] [--help]\n\t     [--numeric] [--count] [--reset] [--debug] [--append]\n)
+# usage:\tipfw [-ndhcVr] [--version] [--help]\n\t     [--numeric] [--count] [--reset] [--debug] [--append]\n
+
+$ #_usage2 Original Message:(\tipfw p[olicy]      {b[locking]|f[orwarding]} {accept|deny|reject}\n)
+# \tipfw p[olicy]      {b[locking]|f[orwarding]} {accept|deny|reject}\n
+
+$ #_usage3 Original Message:(\tipfw [-nrc] l[ist] {b[locking]|f[orwarding]|a[ccounting]}\n)
+# \tipfw [-nrc] l[ist] {b[locking]|f[orwarding]|a[ccounting]}\n
+
+$ #_usage4 Original Message:(\tipfw f[lush]       {b[locking]|f[orwarding]|a[ccounting]}\n)
+# \tipfw f[lush]       {b[locking]|f[orwarding]|a[ccounting]}\n
+
+$ #_usage5 Original Message:(\tipfw {a[dd]|d[el]} {b[locking]|f[orwarding]} {accept|deny|reject} \n\t     Type [iface Addr] from Src to Dst [flags Flags]\n)
+# \tipfw {a[dd]|d[el]} {b[locking]|f[orwarding]} {accept|deny|reject} \n\t     Type [iface Addr] from Src to Dst [flags Flags]\n
+
+$ #_usage6 Original Message:(\tipfw c[heck]       {b[locking]|f[orwarding]}\n\t     Type [iface Addr] from Src to Dst [flags Flags]\n)
+# \tipfw c[heck]       {b[locking]|f[orwarding]}\n\t     Type [iface Addr] from Src to Dst [flags Flags]\n
+
+$ #_usage7 Original Message:(\tipfw {a[dd]|d[el]} a[ccounting]\n\t     Type [iface Addr] from Src to Dst [flags Flags]\n)
+# \tipfw {a[dd]|d[el]} a[ccounting]\n\t     Type [iface Addr] from Src to Dst [flags Flags]\n
+
+$ #_usage8 Original Message:(\tipfw z[ero] {b[locking]|f[orwarding]|a[ccounting]}\n)
+# \tipfw z[ero] {b[locking]|f[orwarding]|a[ccounting]}\n
+
+$ #_usage9 Original Message:(\tipfw {a[dd]|d[el]} m[asquerade] Type from Src to Dst\n\n)
+# \tipfw {a[dd]|d[el]} m[asquerade] Type from Src to Dst\n\n
+
+$ #_usage10 Original Message:(\tType={udp|tcp}:\t\tFlags={bidir|syn|ack|prn} ...\n)
+# \tType={udp|tcp}:\t\tFlags={bidir|syn|ack|prn} ...\n
+
+$ #_usage11 Original Message:(\tSrc,Dst={1.2.3.4/24|Host|Netname} [[Port1:Port2] Port3 ... Port10]\n\n)
+# \tSrc,Dst={1.2.3.4/24|Host|Netname} [[Port1:Port2] Port3 ... Port10]\n\n
+
+$ #_usage12 Original Message:(\tType={icmp}:\t\tFlags={bidir,prn}\n)
+# \tType={icmp}:\t\tFlags={bidir,prn}\n
+
+$ #_usage13 Original Message:(\tSrc={1.2.3.4/24|Host|Netname} [[Type1:Type2] Type3 ... Type10]\n)
+# \tSrc={1.2.3.4/24|Host|Netname} [[Type1:Type2] Type3 ... Type10]\n
+
+$ #_usage14 Original Message:(\tDst={1.2.3.4/24|Host|Netname}\n\n)
+# \tDst={1.2.3.4/24|Host|Netname}\n\n
+
+$ #_usage15 Original Message:(\tType={all}:\t\tFlags={bidir,prn}\n)
+# \tType={all}:\t\tFlags={bidir,prn}\n
+
+$ #_usage16 Original Message:()
+# \tSrc,Dst={1.2.3.4/24|Host|Netname}\n
+
+$ #_range_set Original Message:(ipfw: range flag set but only %d ports\n)
+# ipfw: range flag set but only %d ports\n
+
+$ #_unkn Original Message:(unknown command (%d) passed to do_setsockopt - bye!\n)
+# unknown command (%d) passed to do_setsockopt - bye!\n
+
+$ #_ip Original Message:(ip header length %d, should be %d\n)
+# ip header length %d, should be %d\n
+
+$ #_data_ip Original Message:(data = struct iphdr : struct %shdr {\n)
+# data = struct iphdr : struct %shdr {\n
+
+$ #_data_ipfw Original Message:(data = struct ip_fw {\n)
+# data = struct ip_fw {\n
+
+$ #_accept Original Message:(\taccept )
+# \taccept 
+
+$ #_deny Original Message:(\tdeny )
+# \tdeny 
+
+$ #_univ Original Message:(\tuniversal\n)
+# \tuniversal\n
+
+$ #_missing Original Message:(ipfw: missing protocol name\n)
+# ipfw: missing protocol name\n
+
+$ #_illegal Original Message:(illegal protocol name \"%s\"\n)
+# illegal protocol name "%s"\n
+
+$ #_missing_ip Original Message:(ipfw: missing ip address\n)
+# ipfw: missing ip address\n
+
+$ #_periods Original Message:(ipfw: two periods in a row in ip address (%s)\n)
+# ipfw: two periods in a row in ip address (%s)\n
+
+$ #_unkn_host Original Message:(ipfw: unknown host \"%s\"\n)
+# ipfw: unknown host "%s"\n
+
+$ #_addr_length Original Message:(ipfw: hostentry addr length = %d, expected %d)
+# ipfw: hostentry addr length = %d, expected %d
+
+$ #_matched Original Message:(ipfw: Only %d fields matched in IP address!\n)
+# ipfw: Only %d fields matched in IP address!\n
+
+$ #_too_large Original Message:(ipfw: number too large in ip address (%s)\n)
+# ipfw: number too large in ip address (%s)\n
+
+$ #_inc_format Original Message:(ipfw: incorrect ip address format \"%s\" (expected 3 periods)\n)
+# ipfw: incorrect ip address format "%s" (expected 3 periods)\n
+
+$ #_not_allowed Original Message:(ipfw: ip netmask not allowed here (%s)\n)
+# ipfw: ip netmask not allowed here (%s)\n
+
+$ #_missing_mask Original Message:(ipfw: missing mask value (%s)\n)
+# ipfw: missing mask value (%s)\n
+
+$ #_non_num Original Message:(ipfw: non-numeric mask value (%s)\n)
+# ipfw: non-numeric mask value (%s)\n
+
+$ #_junk_mask Original Message:(ipfw: junk after mask (%s)\n)
+# ipfw: junk after mask (%s)\n
+
+$ #_out_range Original Message:(ipfw: mask length value out of range (%s)\n)
+# ipfw: mask length value out of range (%s)\n
+
+$ #_junk_ip Original Message:(ipfw: junk after ip address (%s)\n)
+# ipfw: junk after ip address (%s)\n
+
+$ #_illegal_port Original Message:(ipfw: illegal port number (%s)\n)
+# ipfw: illegal port number (%s)\n
+
+$ #_portnum_out Original Message:(ipfw: port number out of range (%d)\n)
+# ipfw: port number out of range (%d)\n
+
+$ #_unkn_service Original Message:(ipfw: unknown %s service \"%s\"\n)
+# ipfw: unknown %s service "%s"\n
+
+$ #_too_port Original Message:(ipfw: too many port numbers (max %d, got at least %d, next parm="%s")\n)
+# ipfw: too many port numbers (max %d, got at least %d, next parm="%s")\n
+
+$ #_port_ranges Original Message:(port ranges are only allowed for the first port value pair (%s)\n)
+# port ranges are only allowed for the first port value pair (%s)\n
+
+$ #_no_range Original Message:(ipfw: port range not allowed here (%s)\n)
+# ipfw: port range not allowed here (%s)\n
+
+$ #_missing_port Original Message:(ipfw: missing port number%s\n)
+# ipfw: missing port number%s\n
+
+$ #_nomore_port Original Message:(ipfw: not enough port numbers (expected %d, got %d)\n)
+# ipfw: not enough port numbers (expected %d, got %d)\n
+
+$ #_check_blocking Original Message:(blocking)
+# blocking
+
+$ #_check_forwarding Original Message:(forwarding)
+# forwarding
+
+$ #_check Original Message:(check %s )
+# check %s 
+
+$ #_only_check Original Message:(ipfw: can only check TCP or UDP packets\n)
+# ipfw: can only check TCP or UDP packets\n
+
+$ #_missing_from Original Message:(ipfw: missing \"from\" keyword\n)
+# ipfw: missing "from" keyword\n
+
+$ #_expect_from Original Message:(ipfw: expected \"from\" keyword, got \"%s\"\n)
+# ipfw: expected "from" keyword, got "%s"\n
+
+$ #_missing_to Original Message:(ipfw: missing \"to\" keyword\n)
+# ipfw: missing "to" keyword\n
+
+$ #_expect_to Original Message:(ipfw: expected \"to\" keyword, got \"%s\"\n)
+# ipfw: expected "to" keyword, got "%s"\n
+
+$ #_paq_accept Original Message:(packet accepted by %s firewall\n)
+# packet accepted by %s firewall\n
+
+$ #_blocking Original Message:(blocking)
+# blocking
+
+$ #_forwarding Original Message:(forwarding)
+# forwarding
+
+$ #_paq_reject Original Message:(packet rejected by %s firewall\n)
+# packet rejected by %s firewall\n
+
+$ #_extra Original Message:(ipfw: extra parameters at end of command ()
+# ipfw: extra parameters at end of command (
+
+$ #_usage21 Original Message:(usage: ipfirewall add %s ...\n)
+# usage: ipfirewall add %s ...\n
+
+$ #_add Original Message:(add %s )
+# add %s 
+
+$ #_missing_acc Original Message:(ipfw: missing \"accept\" or \"deny\" keyword\n)
+# ipfw: missing "accept" or "deny" keyword\n
+
+$ #_expect_acc Original Message:(ipfw: expected \"accept\", \"deny\" or \"reject\", got \"%s\"\n)
+# ipfw: expected "accept", "deny" or "reject", got "%s"\n
+
+$ #_missing_proto Original Message:(ipfw: missing protocol name.\n)
+# ipfw: missing protocol name.\n
+
+$ #_missing_iface Original Message:(ipfw: missing interface address.\n)
+# ipfw: missing interface address.\n
+
+$ #_invalid_iface Original Message:(Invalid interface address.\n)
+# Invalid interface address.\n
+
+$ #_missing_from2 Original Message:(ipfw: missing \"from\" keyword\n)
+# ipfw: missing "from" keyword\n
+
+$ #_expect_from2 Original Message:(ipfw: expected \"from\", got \"%s\"\n)
+# ipfw: expected "from", got "%s"\n
+
+$ #_missing_to2 Original Message:(ipfw: missing \"to\" keyword\n)
+# ipfw: missing "to" keyword\n
+
+$ #_expect_to2 Original Message:(ipfw: expected \"to\", got \"%s\"\n)
+# ipfw: expected "to", got "%s"\n
+
+$ #_extra2 Original Message:(ipfw: extra parameters at end of command ()
+# ipfw: extra parameters at end of command (
+
+$ #_usage22 Original Message:(usage: ipfirewall delete %s ...\n)
+# usage: ipfirewall delete %s ...\n
+
+$ #_delete Original Message:(delete %s )
+# delete %s 
+
+$ #_missing_acc2 Original Message:(ipfw: missing \"accept\" or \"deny\" keyword\n)
+# ipfw: missing "accept" or "deny" keyword\n
+
+$ #_expect_acc2 Original Message:(ipfw: expected \"accept\" or \"deny\", got \"%s\"\n)
+# ipfw: expected "accept" or "deny", got "%s"\n
+
+$ #_missing_proto2 Original Message:(ipfw: missing protocol name.\n)
+# ipfw: missing protocol name.\n
+
+$ #_missing_iface2 Original Message:(ipfw: missing interface address.\n)
+# ipfw: missing interface address.\n
+
+$ #_invalid_iface2 Original Message:(Invalid interface address.\n)
+# Invalid interface address.\n
+
+$ #_missing_from3 Original Message:(ipfw: missing \"from\" keyword\n)
+# ipfw: missing "from" keyword\n
+
+$ #_expect_from3 Original Message:(ipfw: expected \"from\", got \"%s\"\n)
+# ipfw: expected "from", got "%s"\n
+
+$ #_missing_to3 Original Message:(ipfw: missing \"to\" keyword\n)
+# ipfw: missing "to" keyword\n
+
+$ #_expect_to3 Original Message:(ipfw: expected \"to\", got \"%s\"\n)
+# ipfw: expected "to", got "%s"\n
+
+$ #_extra3 Original Message:(ipfw: extra parameters at end of command ()
+# ipfw: extra parameters at end of command (
+
+$ #_anywhere Original Message:(anywhere)
+# anywhere
+
+$ #_bytes Original Message:(  Packete    Bytes  )
+#   Packete    Bytes  
+
+$ #_proto Original Message:(Type    Proto Flags From                To                  Iface               Ports\n)
+# Type    Proto Flags From                To                  Iface               Ports\n
+
+$ #_list_accept Original Message:(accept  )
+# accept  
+
+$ #_list_deny Original Message:(deny)
+# deny    
+
+$ #_list_any Original Message:(any)
+# any
+
+$ #_expect_kwds Original Message:(blocking, forwarding or accounting keyword expected.\n)
+# blocking, forwarding or accounting keyword expected.\n
+
+$ #_found_kwds Original Message:(Found '%s': 'blocking', 'forwarding' or 'accounting' keyword expected.\n)
+# Found '%s': 'blocking', 'forwarding' or 'accounting' keyword expected.\n
+
+$ #_raw_socket Original Message:(ipfw: raw socket creation)
+# ipfw: raw socket creation
+
+$ #_expect_main_blocking Original Message:(ipfw: expected \"blocking\" or \"forwarding\".\n)
+# ipfw: expected "blocking" or "forwarding".\n
+
+$ #_expect_main_accept Original Message:(ipfw: expected \"accept\", \"deny\" or \"reject\".\n)
+# ipfw: expected "accept", "deny" or "reject".\n
+
+$ #_expect_main_accounting Original Message:(ipfw: expected \"accounting\", \"blocking\" or \"forwarding\".\n)
+# ipfw: expected "accounting", "blocking" or "forwarding".\n
+
+$ #_illegal_check Original Message:(ipfw: illegal `check' keyword: %s\n)
+# ipfw: illegal `check' keyword: %s\n
+
+$ #_main_missing Original Message:((missing))
+# (missing)
+
+$ #_unkn_cmd Original Message:(ipfw: unknown command `%s'\n\n)
+# ipfw: unknown command `%s'\n\n
+
+$ #_unkn_kwd Original Message:(ipfw: unknown `%s' keyword: `%s'\n)
+# ipfw: unknown `%s' keyword: `%s'\n
+
+$ #_reject Original Message:(\treject )
+# \treject 
+
+$ #_badflag Original Message:(ipfw: \"%s\" flag only applicable to TCP rules\n)
+# ipfw: "%s" flag only applicable to TCP rules\n
+
+$ #_missing_fromi Original Message:(ipfw: missing \"from\" or \"iface\" keyword\n)
+# ipfw: missing "from" or "iface" keyword\n
+
+$ #_paq_deny Original Message:(packet denied by %s firewall\n)
+# packet denied by %s firewall\n
+
+$ #_list_reject Original Message:(reject  )
+# reject  
+
+$ #_dp_deny Original Message:(Default policy: deny\n)
+# Default policy: deny\n
+
+$ #_dp_accept Original Message:(Default policy: accept\n)
+# Default policy: accept\n
+
+$ #_dp_reject Original Message:(Default policy: reject\n)
+# Default policy: reject\n
+
+$ #_no_support Original Message:(ipfw: no support for `%s'. Please recompile with newer Kernel.\n)
+# ipfw: no support for `%s'. Please recompile with newer Kernel.\n
+
+$ #_list_account Original Message:(account )
+# account 
diff --git a/nls/en_US.88591/ipx.m b/nls/en_US.88591/ipx.m
new file mode 100644 (file)
index 0000000..4de2983
--- /dev/null
@@ -0,0 +1,10 @@
+$set 15  #ipx
+
+$ #_none Original Message:([NONE SET])
+# [NONE SET]
+
+$ #_ipx Original Message:(IPX)
+# IPX
+
+$ #_notyet Original Message:(Routing table for `ipx' not yet supported.\n)
+# Routing table for `ipx' not yet supported.\n
diff --git a/nls/en_US.88591/lib.m b/nls/en_US.88591/lib.m
new file mode 100644 (file)
index 0000000..41c9818
--- /dev/null
@@ -0,0 +1,22 @@
+$set 22  #lib
+
+$ #_unknown_af Original Message:(Unknown address family `%s'.\n)
+# Unknown address family `%s'.\n
+
+$ #_toomuch_af Original Message:(Too much address family arguments.\n)
+# Too much address family arguments.\n
+
+$ #_nofeature Original Message:(%s: feature `%s' not supported. Please recompile with newer kernel.\n)
+# %s: feature `%s' not supported. Please recompile with newer kernel.\n
+
+$ #_sysnot Original Message:(%s: no support for `%s' on this system.\n)
+# %s: no support for `%s' on this system.\n
+
+$ #_masq Original Message:(IP masquerading entries\n)
+# IP masquerading entries\n
+
+$ #_masq_tit1 Original Message:(prot expire   source               destination         ports\n)
+# prot expire   source               destination         ports\n
+
+$ #_masq_tit2 Original Message:(prot expire   initseq    delta prevd source               destination         ports\n)
+# prot expire   initseq    delta prevd source               destination         ports\n
diff --git a/nls/en_US.88591/loopback.m b/nls/en_US.88591/loopback.m
new file mode 100644 (file)
index 0000000..cbe3709
--- /dev/null
@@ -0,0 +1,11 @@
+$set 16  #loopback
+
+$ #_none Original Message:([NONE SET])
+# [NONE SET]
+
+$ #_unspec Original Message:(UNSPEC)
+# UNSPEC
+
+$ #_loop Original Message:(Local Loopback)
+# Local Loopback
+
diff --git a/nls/en_US.88591/netrom.m b/nls/en_US.88591/netrom.m
new file mode 100644 (file)
index 0000000..07d4ae2
--- /dev/null
@@ -0,0 +1,20 @@
+$set 20  #netrom
+
+$ #_none Original Message:([NONE SET])
+# [NONE SET]
+
+$ #_debug1 Original Message:(Invalid callsign)
+# Invalid callsign
+
+$ #_debug2 Original Message:(Callsign too long)
+# Callsign too long
+
+$ #_hw Original Message:(AMPR NetROM)
+# AMPR NET/ROM
+
+$ #_netrom Original Message:(AMPR NET/ROM)
+# AMPR NET/ROM
+
+$ #_notyet Original Message:(Routing table for `netrom' not yet supported.\n)
+# Routing table for `netrom' not yet supported.\n
+
diff --git a/nls/en_US.88591/netstat.m b/nls/en_US.88591/netstat.m
new file mode 100644 (file)
index 0000000..2e5249a
--- /dev/null
@@ -0,0 +1,145 @@
+$set 4  #netstat
+
+$ #_args Original Message:(%s -> %d args)
+# %s -> %d args
+
+$ #_netstat Original Message:(netstat: unsupported address family %d !\n)
+# netstat: unsupported address family %d !\n
+
+$ #_UNKN Original Message:(UNKNOWN)
+# UNKNOWN
+
+$ #_off Original Message:(off (0.00/%ld))
+# off (0.00/%ld)
+
+$ #_on Original Message:(on (%2.2f/%ld))
+# on (%2.2f/%ld)
+
+$ #_unkn Original Message:(unkn-%d (%2.2f/%ld))
+# unkn-%d (%2.2f/%ld)
+
+$ #_off2 Original Message:(off (0.00/%ld) %c)
+# off (0.00/%ld) %c
+
+$ #_on2 Original Message:(on (%2.2f/%ld) %c)
+# on (%2.2f/%ld) %c
+
+$ #_unkn2 Original Message:(unkn-%d (%2.2f/%ld) %c)
+# unkn-%d (%2.2f/%ld) %c
+
+$ #_off3 Original Message:(off (0.00/%ld) %c)
+# off (0.00/%ld) %c
+
+$ #_on3 Original Message:(on (%2.2f/%ld) %c)
+# on (%2.2f/%ld) %c
+
+$ #_unkn3 Original Message:(unkn-%d (%2.2f/%ld) %c)
+# unkn-%d (%2.2f/%ld) %c
+
+$ #_unix Original Message:(Active UNIX domain sockets\n)
+# Active UNIX domain sockets\n
+
+$ #_header_unix Original Message:(Proto RefCnt Flags      Type            State           Path\n)
+# Proto RefCnt Flags      Type            State           Path\n
+
+$ #_noflags Original Message:([NO FLAGS])
+# [NO FLAGS]
+
+$ #_interface Original Message:(Kernel Interface table\n)
+# Kernel Interface table\n
+
+$ #_header_iface Original Message:(Iface   MTU Met  RX-OK RX-ERR RX-DRP RX-OVR  TX-OK TX-ERR TX-DRP TX-OVR Flags\n)
+# Iface   MTU Met  RX-OK RX-ERR RX-DRP RX-OVR  TX-OK TX-ERR TX-DRP TX-OVR Flags\n
+
+$ #_unkn_iface Original Message:(%s: unknown interface.\n)
+# %s: unknown interface.\n
+
+$ #_usage1  Original Message:(usage: netstat [-veenc] [<Af>] -r            netstat {-V|--version|-h|--help}\n)
+# usage: netstat [-veenc] [<Af>] -r            netstat {-V|--version|-h|--help}\n
+
+$ #_usage2  Original Message:(       netstat [-vncao] [<Socket>]\n)
+#        netstat [-vncao] [<Socket>]\n
+
+$ #_usage3  Original Message:(       netstat { [-veenac] -i | [-vnc] -N | [-cne] -M }\n\n)
+#        netstat { [-veenac] -i | [-vnc] -N | [-cne] -M }\n\n
+
+$ #_usage4  Original Message:(        -r, --routing            display routing table\n)
+#         -r, --routing            display routing table\n
+
+$ #_usage5  Original Message:(        -N, --netlink            display netlink kernel messages\n)
+#         -N, --netlink            display netlink kernel messages\n
+
+$ #_usage6  Original Message:(        -i, --interfaces         display interface table\n)
+#         -i, --interfaces         display interface table\n
+
+$ #_usage7  Original Message:(        -M, --masquerade         display masqueraded connections\n\n)
+#         -M, --masquerade         display masqueraded connections\n\n
+
+$ #_usage8  Original Message:(        -v, --verbose            be verbose\n)
+#         -v, --verbose            be verbose\n
+
+$ #_usage9  Original Message:(        -n, --numeric            dont resolve names\n)
+#         -n, --numeric                   dont resolve names\n
+
+$ #_usage10 Original Message:(        -e, --extend             display other/more informations\n)
+#         -e, --extend             display other/more informations\n
+
+$ #_usage11 Original Message:(        -c, --continous          continous lising\n\n)
+#         -c, --continous          continous lising\n\n
+
+$ #_usage12 Original Message:(        -a, --all, --listening   display all\n)
+#         -a, --all, --listening   display all\n
+
+$ #_usage13  Original Message:(       -o, --timers             display timers\n\n)
+#         -o, --timers             display timers\n\n
+
+$ #_usage14  Original Message:(<Socket>={-t|--tcp} {-u|--udp} {-w|--raw} {-x|--unix} --ax25 --ipx --netrom\n)
+# <Socket>={-t|--tcp} {-u|--udp} {-w|--raw} {-x|--unix} --ax25 --ipx --netrom\n
+
+$ #_usage15  Original Message:(<Af>= -A {inet|ipx|netrom|ddp|ax25},... --inet --ipx --netrom --ddp --ax25\n)
+# <Af>= -A {inet|ipx|netrom|ddp|ax25},... --inet --ipx --netrom --ddp --ax25\n
+
+$ #_internet Original Message:(Active Internet connections)
+# Active Internet connections
+
+$ #_servers Original Message:( (including servers))
+#  (including servers)
+
+$ #_header_internet Original Message:(\nProto Recv-Q Send-Q Local Address          Foreign Address        (State)       User\n)
+# \nProto Recv-Q Send-Q Local Address          Foreign Address        (State)       User\n
+
+$ #_header_ipx Original Message:(Active IPX sockets\nProto Recv-Q Send-Q Local Address          Foreign Address        (State)       User\n)
+# Active IPX sockets\nProto Recv-Q Send-Q Local Address          Foreign Address        (State)       User\n
+
+$ #_type_no_route Original Message:(No routing for address family `%s'.\n)
+# No routing for address family `%s'.\n
+
+$ #_route_no_support Original Message:(Adress family `%s' not supported.\n)
+# Adress family `%s' not supported.\n
+
+$ #_route_not_yet Original Message:(Address family `%s' Not yet supported.\n)
+# Address family `%s' Not yet supported.\n
+
+$ #_nlp_title Original Message:(Netlink Kernel Messages)
+# Netlink Kernel Messages
+
+$ #_nlp_cnt Original Message:( (continous))
+#  (continous)
+
+$ #_noax25 Original Message:(AX.25 not configured in this system.\n)
+# AX.25 not configured in this system.\n
+
+$ #_ax25 Original Message:(Kernel AX.25 routing table\n)
+# Kernel AX.25 routing table\n
+
+$ #_header_ax25 Original Message:(Destination  Iface    Use\n)
+# Destination  Iface    Use\n
+
+$ #_nonetrom Original Message:(NET/ROM not configured in this system.\n)
+# NET/ROM not configured in this system.\n
+
+$ #_netrom Original Message:(Kernel NET/ROM routing table\n)
+# Kernel NET/ROM routing table\n
+
+$ #_header_netrom Original Message:(Destination  Mnemonic  Quality  Neighbour  Iface\n)
+# Destination  Mnemonic  Quality  Neighbour  Iface\n
diff --git a/nls/en_US.88591/plipconfig.m b/nls/en_US.88591/plipconfig.m
new file mode 100644 (file)
index 0000000..2a306ae
--- /dev/null
@@ -0,0 +1,10 @@
+$set 6  #plipconfig
+
+$ #_usage1 Original Message:(Usage: plipconfig [-a] [-i] [-v] interface\n)
+# Usage: plipconfig [-a] [-i] [-v] interface\n
+
+$ #_usage2 Original Message:(                  [nibble NN] [trigger NN]\n)
+#                   [nibble NN] [trigger NN]\n
+
+$ #_plip Original Message:(%s\tnibble %lu  trigger %lu\n)
+# %s\tnibble %lu  trigger %lu\n
diff --git a/nls/en_US.88591/ppp.m b/nls/en_US.88591/ppp.m
new file mode 100644 (file)
index 0000000..cc8b653
--- /dev/null
@@ -0,0 +1,8 @@
+$set 17  #ppp
+
+$ #_cant_start Original Message:(You cannot start PPP with this program.\n)
+# You cannot start PPP with this program.\n
+
+$ #_ppp Original Message:(Point-Point Protocol)
+# Point-Point Protocol
+
diff --git a/nls/en_US.88591/rarp.m b/nls/en_US.88591/rarp.m
new file mode 100644 (file)
index 0000000..14ca914
--- /dev/null
@@ -0,0 +1,22 @@
+$set 7  #rarp
+
+$ #_invalid Original Message:(Invalid Ethernet address: %s\n)
+# Invalid Ethernet address: %s\n
+
+$ #_unkn_host Original Message:(rarp: %s: unknown host\n)
+# rarp: %s: unknown host\n
+
+$ #_noentry Original Message:(No ARP entry for %s\n)
+# No ARP entry for %s\n
+
+$ #_usage1 Original Message:(Usage: rarp -a                   List Entries in cache.     \n)
+# Usage: rarp -a                   List Entries in cache.     \n
+
+$ #_usage2 Original Message:(       rarp -d hostname          Delete hostname from cache.\n)
+#        rarp -d hostname          Delete hostname from cache.\n
+
+$ #_usage3 Original Message:(       rarp -s hostname hw_addr  Add hostname to cache.\n)
+#        rarp -s hostname hw_addr  Add hostname to cache.\n
+
+$ #_unkn_hw Original Message:(rarp: %s: unknown hardware type.\n)
+# rarp: %s: unknown hardware type.\n
diff --git a/nls/en_US.88591/route.m b/nls/en_US.88591/route.m
new file mode 100644 (file)
index 0000000..1dc0417
--- /dev/null
@@ -0,0 +1,55 @@
+$set 2  #route
+
+$ #_rresolve Original Message:(rresolve: unsupport address family %d !\n)
+# rresolve: unsupport address family %d !\n
+
+$ #_usage1 Original Message:(Usage: route [-nvee] [-A inet|ipx|ddp|netrom],...  route {--version|--help}\n\n)
+# Usage: route [-nvee] [-A inet|ipx|ddp|netrom],...  route {--version|--help}\n\n
+
+$ #_usage2 Original Message:(       route [-v] del {-net|-host} Target [gw Gateway] [netmask Nm]\n)
+#        route [-v] del {-net|-host} Target [gw Gateway] [netmask Nm]\n
+
+$ #_usage3 Original Message:(             [metric N] [[dev] If]\n\n)
+#              [metric N] [[dev] If]\n\n
+
+$ #_usage4 Original Message:(       route [-v] add {-net|-host} Target [gw Gateway] [netmask Nm]\n)
+#        route [-v] add {-net|-host} Target [gw Gateway] [netmask Nm]\n
+
+$ #_usage5 Original Message:(             [metric N] [mss M] [window W] [irtt I] [reject]\n)
+#              [metric N] [mss M] [window W] [irtt I] [reject]\n
+
+$ #_usage6 Original Message:(             [mod] [dyn] [reinstate] [[dev] If]\n)
+#              [mod] [dyn] [reinstate] [[dev] If]\n
+
+$ #_table Original Message:(Kernel routing table\n)
+# Kernel routing table\n
+
+$ #_cant_use Original Message:(route: %s: cannot use a NETWORK as gateway!\n)
+# route: %s: cannot use a NETWORK as gateway!\n
+
+$ #_MSS Original Message:(route: Invalid MSS.\n)
+# route: Invalid MSS.\n
+
+$ #_window Original Message:(route: Invalid window.\n)
+# route: Invalid window.\n
+
+$ #_irtt Original Message:(route: Invalid initial rtt.\n)
+# route: Invalid initial rtt.\n
+
+$ #_netmask1 Original Message:(route: netmask doesn't make sense with host route\n)
+# route: netmask doesn't make sense with host route\n
+
+$ #_netmask2 Original Message:(route: bogus netmask %s\n)
+# route: bogus netmask %s\n
+
+$ #_netmask3 Original Message:(route: netmask doesn't match route address\n)
+# route: netmask doesn't match route address\n
+
+$ #_fam_not_supp Original Message:(%s: address family not supported!\n)
+# %s: address family not supported!\n
+
+$ #_af_no_route Original Message:(route: %s: address family doesn't support routing.\n)
+# route: %s: address family doesn't support routing.\n
+
+$ #_wrong_af Original Message:(route: %s: command only supports 'inet' AF.\n)
+# route: %s: command only supports 'inet' AF.\n
diff --git a/nls/en_US.88591/slattach.m b/nls/en_US.88591/slattach.m
new file mode 100644 (file)
index 0000000..0b71870
--- /dev/null
@@ -0,0 +1,46 @@
+$set 8  #slattach
+
+$ #_user_unkn Original Message:(slattach: tty_lock: UUCP user %s unknown!\n)
+# slattach: tty_lock: UUCP user %s unknown!\n
+
+$ #_drop Original Message:(slattach: tty_hangup(DROP): %s\n)
+# slattach: tty_hangup(DROP): %s\n
+
+$ #_raise Original Message:(slattach: tty_hangup(RAISE): %s\n)
+# slattach: tty_hangup(RAISE): %s\n
+
+$ #_cant_state Original Message:(slattach: tty_open: cannot get current state!\n)
+# slattach: tty_open: cannot get current state!\n
+
+$ #_cant_disc Original Message:(slattach: tty_open: cannot get current line disc!\n)
+# slattach: tty_open: cannot get current line disc!\n
+
+$ #_cant_raw Original Message:(slattach: tty_open: cannot set RAW mode!\n)
+# slattach: tty_open: cannot set RAW mode!\n
+
+$ #_cant_bps Original Message:(slattach: tty_open: cannot set %s bps!\n)
+# slattach: tty_open: cannot set %s bps!\n
+
+$ #_cant_8n1 Original Message:(slattach: tty_open: cannot set 8N1 mode!\n)
+# slattach: tty_open: cannot set 8N1 mode!\n
+
+$ #_usage1 Original Message:(Usage: slattach [-ehlLmnqv] [-c cmd] [-s speed] [-p protocol] tty | -\n)
+# Usage: slattach [-ehlLmnqv] [-c cmd] [-s speed] [-p protocol] tty | -\n
+
+$ #_unsupp Original Message:(slattach: unsupported protocol %s\n)
+# slattach: unsupported protocol %s\n
+
+$ #_started Original Message:(%s started)
+# %s started
+
+$ #_on Original Message:( on %s)
+#  on %s
+
+$ #_iface Original Message:( interface %s\n)
+#  interface %s\n
+
+$ #_locked Original Message:(slattach: /dev/%s already locked\n)
+# slattach: /dev/%s already locked\n
+
+$ #_cant_pid Original Message:(slattach: cannot write PID to lock file\n)
+# slattach: cannot write PID to lock file\n
diff --git a/nls/en_US.88591/slip.m b/nls/en_US.88591/slip.m
new file mode 100644 (file)
index 0000000..7157fb5
--- /dev/null
@@ -0,0 +1,17 @@
+$set 18  #slip
+
+$ #_slip Original Message:(Serial Line IP)
+# Serial Line IP
+
+$ #_cslip Original Message:(VJ Serial Line IP)
+# VJ Serial Line IP
+
+$ #_slip6 Original Message:(6-bit Serial Line IP)
+# 6-bit Serial Line IP
+
+$ #_cslip6 Original Message:(VJ 6-bit Serial Line IP)
+# VJ 6-bit Serial Line IP
+
+$ #_adaptive Original Message:(Adaptive Serial Line IP)
+# Adaptive Serial Line IP
+
diff --git a/nls/en_US.88591/tunnel.m b/nls/en_US.88591/tunnel.m
new file mode 100644 (file)
index 0000000..680ed3c
--- /dev/null
@@ -0,0 +1,4 @@
+$set 21  #tunnel
+
+$ #_hw Original Message:(IPIP Tunnel)
+# IPIP Tunnel
diff --git a/nls/en_US.88591/unix.m b/nls/en_US.88591/unix.m
new file mode 100644 (file)
index 0000000..c09687f
--- /dev/null
@@ -0,0 +1,10 @@
+$set 19  #unix
+
+$ #_none Original Message:([NONE SET])
+# [NONE SET]
+
+$ #_unix Original Message:(UNIX Domain)
+# UNIX Domain
+
+$ #_unspec Original Message:(UNSPEC)
+# UNSPEC
diff --git a/nls/fr_FR.88591/arcnet.m b/nls/fr_FR.88591/arcnet.m
new file mode 100644 (file)
index 0000000..1547b23
--- /dev/null
@@ -0,0 +1,20 @@
+$set 10  #arcnet
+
+$ #_none Original Message:([NONE SET])
+# [PAS DEFINI]
+
+$ #_debug1 Original Message:(in_arcnet(%s): invalid arcnet address!\n)
+# in_arcnet(%s): adresse arcnet incorrecte !\n
+
+$ #_debug2 Original Message:(in_arcnet(%s): invalid arcnet address!\n)
+# in_arcnet(%s): adresse arcnet incorrecte !\n
+
+$ #_debug3 Original Message:(in_arcnet(%s): trailing : ignored!\n)
+# in_arcnet(%s): ignore le reste !\n
+
+$ #_debug4 Original Message:(in_arcnet(%s): trailing junk!\n)
+# in_arcnet(%s): détruit le reste !\n
+
+$ #_arcnet Original Message:(1.5Mbps ARCnet)
+# ARCnet Ã  1.5Mbps
+
diff --git a/nls/fr_FR.88591/arp.m b/nls/fr_FR.88591/arp.m
new file mode 100644 (file)
index 0000000..e734911
--- /dev/null
@@ -0,0 +1,70 @@
+$set 3  #arp
+
+$ #_hostname Original Message:(arp: need host name\n)
+# arp: nécessite un nom d'hôte\n
+
+$ #_no_arp Original Message:(No ARP entry for %s\n)
+# Pas d'entrée ARP pour %s\n
+
+$ #_need_hw Original Message:(arp: need hardware address\n)
+# arp: nécessite une adresse matérielle\n
+
+$ #_invalidhw Original Message:(arp: invalid hardware address\n)
+# arp: adresse matérielle invalide\n
+
+$ #_cant_open Original Message:(arp: cannot open etherfile %s !\n)
+# arp: ne peut ouvrir le fichier %s !\n
+
+$ #_formaterr Original Message:(arp: format error on line %u of etherfile %s !\n)
+# arp: erreur de format Ã  la ligne %u du fichier %s !\n
+
+$ #_cant_set Original Message:(arp: cannot set entry on line %u of etherfile %s !\n)
+# arp: ne peut pas définir l'entrée Ã  la ligne %u du fichier %s !\n
+
+$ #_address Original Message:(Address\t\tHW type\t\tHW address\t     Flags Mask\t\t   Iface\n)
+# Address\t\tHW type\t\tHW address\t     Flags Mask\t\t   Iface\n
+
+$ #_wrong_af Original Message:(arp: %s: kernel only supports 'inet'.\n)
+# arp: %s: kernel only supports 'inet'.\n
+
+$ #_sum Original Message:(Entries: %d\tSkiped: %d\tFound: %d\n)
+# Entries: %d\tSkiped: %d\tFound: %d\n
+
+$ #_usage1 Original Message:(Usage: arp [-vn] [-H type] [-i if] -a [hostname]\n)
+# Usage: arp [-vn] [-H type] [-i if] -a [hostname]\n
+
+$ #_usage2 Original Message:(       arp [-v] [-i if] -d hostname [pub]\n)
+#        arp [-v] [-i if] -d hostname [pub]\n
+
+$ #_usage3 Original Message:(       arp [-v] [-H type] [-i if] -s hostname hw_addr [temp] [trail]\n)
+#        arp [-v] [-H type] [-i if] -s hostname hw_addr [temp] [trail]\n
+
+$ #_usage4 Original Message:(       arp [-v] [-H type] [-i if] -s hostname hw_addr [netmask nm] pub [trail]\n)
+#        arp [-v] [-H type] [-i if] -s hostname hw_addr [netmask nm] pub [trail]\n
+
+$ #_usage5 Original Message:(       arp [-vn] [-H type] [-i if] -f filename\n)
+#        arp [-vn] [-H type] [-i if] -f filename\n
+
+$ #_hw_not_supp Original Message:(%s: hardware type not supported!\n)
+# %s: type de matériel pas supporté!\n
+
+$ #_fam_not_supp Original Message:(%s: address family not supported!\n)
+# %s: famille d'adresse pas supportée !\n
+
+$ #_unkn_addr Original Message:(arp: %s: unknown address family.\n)
+# arp: %s: famille d'adresse inconnue.\n
+
+$ #_unkn_hw Original Message:(arp: %s: unknown hardware type.\n)
+# arp: %s: type de matériel inconnu.\n
+
+$ #_none Original Message:(arp: in %d entries no match found.\n)
+# arp: in %d entries no match found.\n
+
+$ #_wrong_hw Original Message:(arp: %s: hardware type without ARP support.\n)
+# arp: %s: hardware type without ARP support.\n
+
+$ #_einv_pub Original Message:(Probably destination is reached via ARP Interface. See arp(8)\n)
+# Probably destination is reached via ARP Interface. See arp(8)\n
+
+$ #_einv_nopub Original Message:(Probably destination is on different Interface. See arp(8)\n)
+# Probably destination is on different Interface. See arp(8)\n
diff --git a/nls/fr_FR.88591/ax25.m b/nls/fr_FR.88591/ax25.m
new file mode 100644 (file)
index 0000000..90da30d
--- /dev/null
@@ -0,0 +1,17 @@
+$set 11  #ax25
+
+$ #_none Original Message:([NONE SET])
+# [PAS DEFINI]
+
+$ #_debug1 Original Message:(Invalid callsign)
+# Donnée incorrecte
+
+$ #_debug2 Original Message:(Callsign too long)
+# Donnée trop longue
+
+$ #_hw Original Message:(AMPR AX.25)
+# AMPR AX.25
+
+$ #_ax25 Original Message:(AMPR AX.25)
+# AMPR AX.25
+
diff --git a/nls/fr_FR.88591/ddp.m b/nls/fr_FR.88591/ddp.m
new file mode 100644 (file)
index 0000000..77eca5d
--- /dev/null
@@ -0,0 +1,10 @@
+$set 12  #ddp
+
+$ #_none Original Message:([NONE SET])
+# [PAS DEFINI]
+
+$ #_ddp Original Message:(Appletalk DDP)
+# DDP Appletalk 
+
+$ #_notyet Original Message:(Routing table for `ddp' not yet supported.\n)
+# Routing table for `ddp' not yet supported.\n
diff --git a/nls/fr_FR.88591/ether.m b/nls/fr_FR.88591/ether.m
new file mode 100644 (file)
index 0000000..c3d6378
--- /dev/null
@@ -0,0 +1,20 @@
+$set 13  #ether
+
+$ #_none Original Message:([NONE SET])
+# [PAS DEFINI]
+
+$ #_debug1 Original Message:(in_ether(%s): invalid ether address!\n)
+# in_ether(%s): Adresse Ethernet incorrecte !\n
+
+$ #_debug2 Original Message:(in_ether(%s): invalid ether address!\n)
+# in_ether(%s): Adresse Ethernet incorrecte !\n
+
+$ #_debug3 Original Message:(in_ether(%s): trailing : ignored!\n)
+# in_ether(%s): le reste est ignoré !\n
+
+$ #_debug4 Original Message:(in_ether(%s): trailing junk!\n)
+# in_ether(%s): le reste est détruit !\n
+
+$ #_ether Original Message:(10Mbps Ethernet)
+# Ethernet Ã  10Mbps
+
diff --git a/nls/fr_FR.88591/hostname.m b/nls/fr_FR.88591/hostname.m
new file mode 100644 (file)
index 0000000..1b7b9e1
--- /dev/null
@@ -0,0 +1,103 @@
+$set 5  #hostname
+
+$ #_root Original Message:(%s: you must be root to change the host name\n)
+# %s: vous devez etre super-utilisateur pour changer le nom d'hôte\n
+
+$ #_toolong Original Message:(%s: name too long\n)
+# %s: nom trop long\n
+
+$ #_nodns1 Original Message:(%s: You can't change the DNS domain name with this command\n)
+# %s: Vous ne pouvez pas changer le nom de domainde DNS avec cette commande\n
+
+$ #_nodns2 Original Message:(\nUnless you are using bind or NIS for host lookups you can change the DNS\n)
+# \nSauf si vous utilisez `bind' ou NIS pour la recherche des hôtes, vous pouvez changer le nom\n
+
+$ #_nodns3 Original Message:(domain name (which is part of the FQDN) in the /etc/hosts file.\n)
+# de domaine DNS (qui fait partie de FQDN) dans le fichier /etc/hosts.\n
+
+$ #_cant_open Original Message:(%s: can't open `%s'\n)
+# %s: ne peut ouvrir `%s'\n
+
+$ #_usage1 Original Message:(Usage: hostname [-v] {hostname|-F file} set hostname (from file)\n)
+# Usage: hostname [-v] {hostname|-F file}      set hostname (from file)\n
+
+$ #_usage2 Original Message:(       domainname [-v] {nisdomain|-F file} set NIS domainname (from file)\n)
+#        domainname [-v] {nisdomain|-F file}   set NIS domainname (from file)\n
+
+$ #_usage3 Original Message:(       hostname [-v] [-d|-f|-s|-a|-i|-y] display formated name\n)
+#        hostname [-v] [-d|-f|-s|-a|-i|-y]     display formated name\n
+
+$ #_usage4 Original Message:(       hostname [-v] display hostname\n\n)
+#        hostname [-v]                         display hostname\n\n
+
+$ #_usage5 Original Message:(       hostname -V|--version|-h|--help print info and exit\n\n)
+#        hostname -V|--version|-h|--help       print info and exit\n\n
+
+$ #_usage6 Original Message:(    dnsdomainname=hostname -d, {yp,nis,}domainname=hostname -y\n\n)
+#     dnsdomainname=hostname -d, {yp,nis,}domainname=hostname -y\n\n
+
+$ #_usage7 Original Message:(    -s, --short           short host name\n)
+#     -s, --short           short host name\n
+
+$ #_usage8 Original Message:(    -a, --alias           alias names\n)
+#     -a, --alias           alias names\n
+
+$ #_usage9 Original Message:(    -i, --ip-address      addresses for the hostname\n)
+#     -i, --ip-address      addresses for the hostname\n
+
+$ #_usage10 Original Message:(    -f, --fqdn, --long    long host name (FQDN)\n)
+#     -f, --fqdn, --long    long host name (FQDN)\n
+
+$ #_usage11 Original Message:(    -d, --domain          DNS domain name\n)
+#     -d, --domain          DNS domain name\n
+
+$ #_usage12 Original Message:(    -y, --yp, --nis       NIS/YP domainname\n)
+#     -y, --yp, --nis       NIS/YP domainname\n
+
+$ #_usage13 Original Message:(    -F, --file            read hostname or nis domainname from given File\n\n)
+#     -F, --file            read hostname or nis domainname from given File\n\n
+
+$ #_usage14 Original Message:(   This comand can get or set the hostname or the NIS domainname. You can\n)
+#    This comand can get or set the hostname or the NIS domainname. You can\n
+
+$ #_usage15 Original Message:(   also get the DNS domain or the FQDN (fully qualified domain name).\n)
+#    also get the DNS domain or the FQDN (fully qualified domain name).\n
+
+$ #_usage16 Original Message:(   Unless you are using bind or NIS for host lookups you can change the\n)
+#    Unless you are using bind or NIS for host lookups you can change the\n
+
+$ #_usage17 Original Message:(   FQDN (Fully Qualified Domain Name) and the DNS domain name (which is\n)
+#    FQDN (Fully Qualified Domain Name) and the DNS domain name (which is\n
+
+$ #_usage18 Original Message:(   part of the FQDN) in the /etc/hosts file.\n)
+#    part of the FQDN) in the /etc/hosts file.\n
+
+$ #_verb_set Original Message:(  Setting hostname to `%s'\n)
+#    Setting hostname to `%s'\n
+
+$ #_verb_res Original Message:(Resolving `%s' ...\n)
+# Resolving `%s' ...\n
+
+$ #_verb_fnd Original Message:(Result: h_name=`%s'\n)
+# Result: h_name=`%s'\n
+
+$ #_verb_ali Original Message:(Result: h_aliases=`%s'\n)
+# Result: h_aliases=`%s'\n
+
+$ #_verb_ipn Original Message:(Result: h_addr_list=`%s'\n)
+# Result: h_addr_list=`%s'\n
+
+$ #_verb_get Original Message:(gethostname()=`%s'\n)
+# gethostname()=`%s'\n
+
+$ #_verb_dset Original Message:(Setting domainname to %s'\n)
+# Setting domainname to %s'\n
+
+$ #_verb_dget Original Message:(getdomainname()=%s'\n)
+# getdomainname()=%s'\n
+
+$ #_dname_root Original Message:(%s: you must be root to change the domain name\n)
+# %s: you must be root to change the domain name\n
+
+$ #_dname_toolong Original Message:(%s: name too long\n)
+# %s: name too long\n
diff --git a/nls/fr_FR.88591/ifconfig.m b/nls/fr_FR.88591/ifconfig.m
new file mode 100644 (file)
index 0000000..5ad7e89
--- /dev/null
@@ -0,0 +1,76 @@
+$set 1  #ifconfig
+
+$ #_over Original Message:(overruns)
+# expirés
+
+$ #_compress Original Message:(compressed)
+# compressés
+
+$ #_link Original Message:(%-8.8s  Link encap:%s  )
+# %-8.8s  Type de lien:%s  
+
+$ #_hw Original Message:(HWaddr %s)
+# adresse ethernet %s
+
+$ #_adr Original Message:(\n          %s addr:%s)
+# \n          adr %s:%s
+
+$ #_pap Original Message:(  P-t-P:%s  )
+#   P-à-P:%s  
+
+$ #_bcast Original Message:(  Bcast:%s  )
+#   Diffusion:%s  
+
+$ #_mask Original Message:(Mask:%s\n)
+# Masque:%s\n
+
+$ #_etherII Original Message:(          IPX/Ethernet II addr:%s\n)
+#           IPX/Ethernet II adr:%s\n
+
+$ #_SNAP Original Message:(          IPX/Ethernet SNAP addr:%s\n)
+#           IPX/Ethernet SNAP adr:%s\n
+
+$ #_8022 Original Message:(          IPX/Ethernet 802.2 addr:%s\n)
+#           IPX/Ethernet 802.2 adr:%s\n
+
+$ #_8023 Original Message:(          IPX/Ethernet 802.3 addr:%s\n)
+#           IPX/Ethernet 802.3 adr:%s\n
+
+$ #_talk Original Message:(          EtherTalk Phase 2 addr:%s\n)
+#           EtherTalk Phase 2 adr:%s\n
+
+$ #_noflags Original Message:([NO FLAGS] )
+# [PAS D'OPTIONS] 
+
+$ #_mtu Original Message:( MTU:%d  Metric:%d\n)
+#  MTU:%d  Métrique:%d\n
+
+$ #_rx Original Message:(RX packets:%u errors:%u dropped:%u %s:%u\n)
+# RX paquets:%u erreurs:%u perdus:%u %s:%u\n
+
+$ #_tx Original Message:(TX packets:%u errors:%u dropped:%u %s:%u\n)
+# TX paquets:%u erreurs:%u perdus:%u %s:%u\n
+
+$ #_interrupt Original Message:(Interrupt:%d )
+# Interruption:%d 
+
+$ #_base Original Message:(Base address:0x%x )
+# Adresse de base:0x%x 
+
+$ #_mem Original Message:(Memory:%lx-%lx )
+# Mémoire:%lx-%lx 
+
+$ #_dma Original Message:(DMA chan:%x )
+# Canal DMA:%x 
+
+$ #_unkn Original Message:(%s: unknown interface.\n)
+# %s: interface inconnue.\n
+
+$ #_usage1 Original Message:(Usage: ifconfig [-a] [-i] [-v] interface\n)
+# Syntaxe: ifconfig [-a] [-i] [-v] interface\n
+
+$ #_usage2 Original Message:(                [inet address]\n)
+#                 [[inet] adresse inet]\n
+
+$ #_usage3 Original Message:(                [hw] [ax25 address]\n)
+#                 [hw] [adresse ax25]\n
diff --git a/nls/fr_FR.88591/inet.m b/nls/fr_FR.88591/inet.m
new file mode 100644 (file)
index 0000000..f41d2d0
--- /dev/null
@@ -0,0 +1,25 @@
+$set 14  #inet
+
+$ #_debug1 Original Message:(rresolve: unsupport address family %d !\n)
+# rresolve: famille d'adresse pas supportée %d !\n
+
+$ #_none Original Message:([NONE SET])
+# [PAS DEFINI]
+
+$ #_darpa Original Message:(DARPA Internet)
+# DARPA Internet
+
+$ #_table Original Message:(Kernel IP routing table\n)
+# Table de routage IP noyau\n
+
+$ #_header1 Original Message:(Destination     Gateway         Genmask         Flags Metric Ref    Use Iface\n)
+# Destination     Gateway         Genmask         Flags Metric Ref    Use Iface\n
+
+$ #_header2 Original Message:(Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface\n)
+# Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface\n
+
+$ #_header3 Original Message:(Destination     Gateway         Genmask         Flags Metric Ref    Use Iface    MSS   Window irtt\n)
+# Destination     Gateway         Genmask         Flags Metric Ref    Use Iface    MSS   Window irtt\n
+
+$ #_route Original Message:(unsupported address family %d !\n)
+# unsupported address family %d !\n
diff --git a/nls/fr_FR.88591/ipfw.m b/nls/fr_FR.88591/ipfw.m
new file mode 100644 (file)
index 0000000..7f4a78d
--- /dev/null
@@ -0,0 +1,343 @@
+$set 9  #ipfw
+
+$ #_ipf_blocking Original Message:(blocking)
+# blocage
+
+$ #_ipf_fwding Original Message:(forwarding)
+# renvoi
+
+$ #_ipf_accnting Original Message:(accounting)
+# comptabilité
+
+$ #_ipf_msqrading Original Message:(masquerading)
+# déguisement
+
+$ #_usage1 Original Message:(usage:\tipfw [-ndhcVr] [--version] [--help]\n\t     [--numeric] [--count] [--reset] [--debug] [--append]\n)
+# usage:\tipfw [-ndhcVr] [--version] [--help]\n\t     [--numeric] [--count] [--reset] [--debug] [--append]\n
+
+$ #_usage2 Original Message:(\tipfw p[olicy]      {b[locking]|f[orwarding]} {accept|deny|reject}\n)
+# \tipfw p[olicy]      {b[locking]|f[orwarding]} {accept|deny|reject}\n
+
+$ #_usage3 Original Message:(\tipfw [-nrc] l[ist] {b[locking]|f[orwarding]|a[ccounting]}\n)
+# \tipfw [-nrc] l[ist] {b[locking]|f[orwarding]|a[ccounting]}\n
+
+$ #_usage4 Original Message:(\tipfw f[lush]       {b[locking]|f[orwarding]|a[ccounting]}\n)
+# \tipfw f[lush]       {b[locking]|f[orwarding]|a[ccounting]}\n
+
+$ #_usage5 Original Message:(\tipfw {a[dd]|d[el]} {b[locking]|f[orwarding]} {accept|deny|reject} \n\t     Type [iface Addr] from Src to Dst [flags Flags]\n)
+# \tipfw {a[dd]|d[el]} {b[locking]|f[orwarding]} {accept|deny|reject} \n\t     Type [iface Addr] from Src to Dst [flags Flags]\n
+
+$ #_usage6 Original Message:(\tipfw c[heck]       {b[locking]|f[orwarding]}\n\t     Type [iface Addr] from Src to Dst [flags Flags]\n)
+# \tipfw c[heck]       {b[locking]|f[orwarding]}\n\t     Type [iface Addr] from Src to Dst [flags Flags]\n
+
+$ #_usage7 Original Message:(\tipfw {a[dd]|d[el]} a[ccounting]\n\t     Type [iface Addr] from Src to Dst [flags Flags]\n)
+# \tipfw {a[dd]|d[el]} a[ccounting]\n\t     Type [iface Addr] from Src to Dst [flags Flags]\n
+
+$ #_usage8 Original Message:(\tipfw z[ero] {b[locking]|f[orwarding]|a[ccounting]}\n)
+# \tipfw z[ero] {b[locking]|f[orwarding]|a[ccounting]}\n
+
+$ #_usage9 Original Message:(\tipfw {a[dd]|d[el]} m[asquerade] Type from Src to Dst\n\n)
+# \tipfw {a[dd]|d[el]} m[asquerade] Type from Src to Dst\n\n
+
+$ #_usage10 Original Message:(\tType={udp|tcp}:\t\tFlags={bidir|syn|ack|prn} ...\n)
+# \tType={udp|tcp}:\t\tFlags={bidir|syn|ack|prn} ...\n
+
+$ #_usage11 Original Message:(\tSrc,Dst={1.2.3.4/24|Host|Netname} [[Port1:Port2] Port3 ... Port10]\n\n)
+# \tSrc,Dst={1.2.3.4/24|Host|Netname} [[Port1:Port2] Port3 ... Port10]\n\n
+
+$ #_usage12 Original Message:(\tType={icmp}:\t\tFlags={bidir,prn}\n)
+# \tType={icmp}:\t\tFlags={bidir,prn}\n
+
+$ #_usage13 Original Message:(\tSrc={1.2.3.4/24|Host|Netname} [[Type1:Type2] Type3 ... Type10]\n)
+# \tSrc={1.2.3.4/24|Host|Netname} [[Type1:Type2] Type3 ... Type10]\n
+
+$ #_usage14 Original Message:(\tDst={1.2.3.4/24|Host|Netname}\n\n)
+# \tDst={1.2.3.4/24|Host|Netname}\n\n
+
+$ #_usage15 Original Message:(\tType={all}:\t\tFlags={bidir,prn}\n)
+# \tType={all}:\t\tFlags={bidir,prn}\n
+
+$ #_usage16 Original Message:()
+# \tSrc,Dst={1.2.3.4/24|Host|Netname}\n
+
+$ #_range_set Original Message:(ipfw: range flag set but only %d ports\n)
+# ipfw: intervalle d'options positionné mais seulement %d ports\n
+
+$ #_unkn Original Message:(ipfw: unknown command (%d) passed to do_setsockopt - bye!\n)
+# ipfw: commande inconnue (%d) passée Ã  do_setsockopt - bye !\n
+
+$ #_ip Original Message:(ip header length %d, should be %d\n)
+# longueur de l'en-tête ip = %d, devrait Ãªtre %d\n
+
+$ #_data_ip Original Message:(data = struct iphdr : struct %shdr {\n)
+# donnée = struct iphdr : struct %shdr {\n
+
+$ #_data_ipfw Original Message:(data = struct ip_fw {\n)
+# donnée = struct ip_fw {\n
+
+$ #_accept Original Message:(\taccept )
+# \taccepte 
+
+$ #_deny Original Message:(\tdeny )
+# \trefuse 
+
+$ #_univ Original Message:(\tuniversal\n)
+# \tuniversel\n
+
+$ #_missing Original Message:(ipfw: missing protocol name\n)
+# ipfw: nom du protocole manquant\n
+
+$ #_illegal Original Message:(illegal protocol name \"%s\"\n)
+# nom de protocole pas autorisé "%s"\n
+
+$ #_missing_ip Original Message:(ipfw: missing ip address\n)
+# ipfw: adresse IP manquante\n
+
+$ #_periods Original Message:(ipfw: two periods in a row in ip address (%s)\n)
+# ipfw: deux points finaux dans une adresse ip (%s)\n
+
+$ #_unkn_host Original Message:(ipfw: unknown host \"%s\"\n)
+# ipfw: hôte inconnu "%s"\n
+
+$ #_addr_length Original Message:(ipfw: hostentry addr length = %d, expected %d (i.e. sizeof(struct in_addr))\n)
+# ipfw: longueur adresse hôte = %d, attendu %d (i.e. sizeof(struct in_addr))\n
+
+$ #_matched Original Message:(ipfw: Only %d fields matched in IP address!\n)
+# ipfw: Seulement %d champs corrects dans l'adresse IP !\n
+
+$ #_too_large Original Message:(ipfw: number too large in ip address (%s)\n)
+# ipfw: nombre trop grand dans l'adresse IP (%s)\n
+
+$ #_inc_format Original Message:(ipfw: incorrect ip address format \"%s\" (expected 3 periods)\n)
+# ipfw: format d'adresse IP incorrect "%s" (3 points)\n
+
+$ #_not_allowed Original Message:(ipfw: ip netmask not allowed here (%s)\n)
+# ipfw: masque de réseau IP pas autorisé ici (%s)\n
+
+$ #_missing_mask Original Message:(ipfw: missing mask value (%s)\n)
+# ipfw: il manque la valeur du masque (%s)\n
+
+$ #_non_num Original Message:(ipfw: non-numeric mask value (%s)\n)
+# ipfw: valeur du masque pas numérique (%s)\n
+
+$ #_junk_mask Original Message:(ipfw: junk after mask (%s)\n)
+# ipfw: détruit après le masque (%s)\n
+
+$ #_out_range Original Message:(ipfw: mask length value out of range (%s)\n)
+# ipfw: longueur de masque en dehors des limites (%s)\n
+
+$ #_junk_ip Original Message:(ipfw: junk after ip address (%s)\n)
+# ipfw: détruit après l'adresse IP (%s)\n
+
+$ #_illegal_port Original Message:(ipfw: illegal port number (%s)\n)
+# ipfw: numéro de port incorrect (%s)\n
+
+$ #_portnum_out Original Message:(ipfw: port number out of range (%d)\n)
+# ipfw: numéro de port en dehors des limites (%d)\n
+
+$ #_unkn_service Original Message:(ipfw: unknown %s service \"%s\"\n)
+# ipfw: service %s inconnu "%s"\n
+
+$ #_too_port Original Message:(ipfw: too many port numbers (max %d, got at least %d, next parm=\"%s\")\n)
+# ipfw: trop de numéros de port (max %d, eu au moins %d, prochain parm="%s")\n
+
+$ #_port_ranges Original Message:(ipfw: port ranges are only allowed for the first port value pair (%s)\n)
+# ipfw: les intervalles de num. de ports sont permis seulement pour la première paire (%s)\n
+
+$ #_no_range Original Message:(ipfw: port range not allowed here (%s)\n)
+# ipfw: intervalle de num. de ports pas autorisés (%s)\n
+
+$ #_missing_port Original Message:(ipfw: missing port number%s\n)
+# ipfw: numéro%s de port manquant(s)\n
+
+$ #_nomore_port Original Message:(ipfw: not enough port numbers (expected %d, got %d)\n)
+# ipfw: pas assez de numéros de ports (souhaité %d, eu %d)\n
+
+$ #_check_blocking Original Message:(blocking)
+# blocage
+
+$ #_check_forwarding Original Message:(forwarding)
+# renvoi
+
+$ #_check Original Message:(check %s )
+# vérifie le %s 
+
+$ #_only_check Original Message:(ipfw: can only check TCP or UDP packets\n)
+# ipfw: ne peut vérifier que les paquets TCP ou UDP\n
+
+$ #_missing_from Original Message:(ipfw: missing \"from\" keyword\n)
+# ipfw: il manque le mot clé "from"\n
+
+$ #_expect_from Original Message:(ipfw: expected \"from\" keyword, got \"%s\"\n)
+# ipfw: mot clé attendu "from", eu "%s"\n
+
+$ #_missing_to Original Message:(ipfw: missing \"to\" keyword\n)
+# ipfw: il manque le mot clé "to"\n
+
+$ #_expect_to Original Message:(ipfw: expected \"to\" keyword, got \"%s\"\n)
+# ipfw: mot clé attendu "to", eu "%s"\n
+
+$ #_paq_accept Original Message:(packet accepted by %s firewall\n)
+# paquet accepté par le firewall %s\n
+
+$ #_paq_reject Original Message:(packet rejected by %s firewall\n)
+# paquet rejeté par le firewall %s\n
+
+$ #_blocking Original Message:(blocking)
+# blocage
+
+$ #_forwarding Original Message:(forwarding)
+# renvoi
+
+$ #_extra Original Message:(ipfw: extra parameters at end of command ()
+# ipfw: paramètres en trop Ã  la fin de la commande (
+
+$ #_usage21 Original Message:(usage: ipfirewall add %s ...\n)
+# Syntaxe: ipfirewall add %s ...\n
+
+$ #_add Original Message:(add %s )
+# ajoute (add) %s 
+
+$ #_missing_acc Original Message:(ipfw: missing \"accept\" or \"deny\" keyword\n)
+# ipfw: il manque les mots clés "accept" ou "deny"\n
+
+$ #_expect_acc Original Message:(ipfw: expected \"accept\", \"deny\" or \"reject\", got \"%s\"\n)
+# ipfw: mots clés attendus "accept", "deny" ou "reject", eu "%s"\n
+
+$ #_missing_proto Original Message:(ipfw: missing protocol name.\n)
+# ipfw: il manque le nom du protocole.\n
+
+$ #_missing_iface Original Message:(ipfw: missing interface address.\n)
+# ipfw: il manque l'adresse de l'interface.\n
+
+$ #_invalid_iface Original Message:(Invalid interface address.\n)
+# Adresse d'interface incorrecte.\n
+
+$ #_missing_from2 Original Message:(ipfw: missing \"from\" keyword\n)
+# ipfw: il manque le mot clé "from"\n
+
+$ #_expect_from2 Original Message:(ipfw: expected \"from\", got \"%s\"\n)
+# ipfw: mot clé attendu "from", eu "%s"\n
+
+$ #_missing_to2 Original Message:(ipfw: missing \"to\" keyword\n)
+# ipfw: il manque le mot clé "to"\n
+
+$ #_expect_to2 Original Message:(ipfw: expected \"to\", got \"%s\"\n)
+# ipfw: mot clé attendu "to", eu "%s"\n
+
+$ #_extra2 Original Message:(ipfw: extra parameters at end of command ()
+# ipfw: paramètres en trop Ã  la fin de la commande (
+
+$ #_usage22 Original Message:(usage: ipfirewall delete %s ...\n)
+# Syntaxe: ipfirewall delete %s ...\n
+
+$ #_delete Original Message:(delete %s )
+# supprime (delete) %s 
+
+$ #_missing_acc2 Original Message:(ipfw: missing \"accept\" or \"deny\" keyword\n)
+# ipfw: il manque les mots clés "accept" ou "deny"\n
+
+$ #_expect_acc2 Original Message:(ipfw: expected \"accept\" or \"deny\", got \"%s\"\n)
+# ipfw: mots clés attendus "accept" ou "deny", eu "%s"\n
+
+$ #_missing_proto2 Original Message:(ipfw: missing protocol name.\n)
+# ipfw: il manque le nom du protocole.\n
+
+$ #_missing_iface2 Original Message:(ipfw: missing interface address.\n)
+# ipfw: il manque l'adresse de l'interface.\n
+
+$ #_invalid_iface2 Original Message:(Invalid interface address.\n)
+# Adresse d'interface incorrecte.\n
+
+$ #_missing_from3 Original Message:(ipfw: missing \"from\" keyword\n)
+# ipfw: il manque le mot clé "from"\n
+
+$ #_expect_from3 Original Message:(ipfw: expected \"from\", got \"%s\"\n)
+# ipfw: mot clé attendu "from", eu "%s"\n
+
+$ #_missing_to3 Original Message:(ipfw: missing \"to\" keyword\n)
+# ipfw: il manque le mot clé "to"\n
+
+$ #_expect_to3 Original Message:(ipfw: expected \"to\", got \"%s\"\n)
+# ipfw: expected "to", got "%s"\n
+
+$ #_extra3 Original Message:(ipfw: extra parameters at end of command ()
+# ipfw: paramètres en trop Ã  la fin de la commande (
+
+$ #_anywhere Original Message:(anywhere)
+# partout
+
+$ #_bytes Original Message:(  Packete    Bytes  )
+#   Paquets    octets 
+
+$ #_proto Original Message:(Type    Proto Flags From                To                  Iface               Ports\n)
+# Type    Proto Flags From                To                  Iface               Ports\n
+
+$ #_list_accept Original Message:(accept  )
+# accepte 
+
+$ #_list_deny Original Message:(deny    )
+# refuse  
+
+$ #_list_any Original Message:(any)
+# quelconque
+
+$ #_expect_kwds Original Message:(blocking, forwarding or accounting keyword expected.\n)
+# mots clés attendus : `blocking', `forwarding' ou `accounting'.\n
+
+$ #_found_kwds Original Message:(Found '%s': 'blocking', 'forwarding' or 'accounting' keyword expected.\n)
+# Trouvé '%s': mots clés 'blocking', 'forwarding' ou 'accounting' attendus.\n
+
+$ #_raw_socket Original Message:(ipfw: raw socket creation)
+# ipfw: création d'une prise de type `raw'
+
+$ #_expect_main_blocking Original Message:(ipfw: expected \"blocking\" or \"forwarding\".\n)
+# ipfw: "blocking" ou "forwarding" attendus.\n
+
+$ #_expect_main_accept Original Message:(ipfw: expected \"accept\", \"deny\" or \"reject\".\n)
+# ipfw: "accept", "deny" ou "reject" attendus.\n
+
+$ #_expect_main_accounting Original Message:(ipfw: expected \"accounting\", \"blocking\" or \"forwarding\".\n)
+# ipfw: "accounting", "blocking" ou "forwarding" attendus.\n
+
+$ #_illegal_check Original Message:(ipfw: illegal `check' keyword: %s\n)
+# ipfw: mot clé `check' incorrect: %s\n
+
+$ #_main_missing Original Message:((missing))
+# (manquant)
+
+$ #_unkn_cmd Original Message:(ipfw: unknown command `%s'\n\n)
+# ipfw: commande inconnue `%s'\n\n
+
+$ #_unkn_kwd Original Message:(ipfw: unknown `%s' keyword: `%s'\n)
+# ipfw: mot clé inconnu pour `%s': `%s'\n
+
+$ #_reject Original Message:(\treject )
+# \treject 
+
+$ #_badflag Original Message:(ipfw: \"%s\" flag only applicable to TCP rules\n)
+# ipfw: "%s" flag only applicable to TCP rules\n
+
+$ #_missing_fromi Original Message:(ipfw: missing \"from\" or \"iface\" keyword\n)
+# ipfw: missing "from" or "iface" keyword\n
+
+$ #_paq_deny Original Message:(packet denied by %s firewall\n)
+# packet denied by %s firewall\n
+
+$ #_list_reject Original Message:(reject  )
+# reject  
+
+$ #_dp_deny Original Message:(Default policy: deny\n)
+# Default policy: deny\n
+
+$ #_dp_accept Original Message:(Default policy: accept\n)
+# Default policy: accept\n
+
+$ #_dp_reject Original Message:(Default policy: reject\n)
+# Default policy: reject\n
+
+$ #_no_support Original Message:(ipfw: no support for `%s'. Please recompile with newer Kernel.\n)
+# ipfw: no support for `%s'. Please recompile with newer Kernel.\n
+
+$ #_list_account Original Message:(account )
+# account 
diff --git a/nls/fr_FR.88591/ipx.m b/nls/fr_FR.88591/ipx.m
new file mode 100644 (file)
index 0000000..2c4a214
--- /dev/null
@@ -0,0 +1,10 @@
+$set 15  #ipx
+
+$ #_none Original Message:([NONE SET])
+# [PAS DEFINI]
+
+$ #_ipx Original Message:(IPX)
+# IPX
+
+$ #_notyet Original Message:(Routing table for `ipx' not yet supported.\n)
+# Routing table for `ipx' not yet supported.\n
diff --git a/nls/fr_FR.88591/lib.m b/nls/fr_FR.88591/lib.m
new file mode 100644 (file)
index 0000000..41c9818
--- /dev/null
@@ -0,0 +1,22 @@
+$set 22  #lib
+
+$ #_unknown_af Original Message:(Unknown address family `%s'.\n)
+# Unknown address family `%s'.\n
+
+$ #_toomuch_af Original Message:(Too much address family arguments.\n)
+# Too much address family arguments.\n
+
+$ #_nofeature Original Message:(%s: feature `%s' not supported. Please recompile with newer kernel.\n)
+# %s: feature `%s' not supported. Please recompile with newer kernel.\n
+
+$ #_sysnot Original Message:(%s: no support for `%s' on this system.\n)
+# %s: no support for `%s' on this system.\n
+
+$ #_masq Original Message:(IP masquerading entries\n)
+# IP masquerading entries\n
+
+$ #_masq_tit1 Original Message:(prot expire   source               destination         ports\n)
+# prot expire   source               destination         ports\n
+
+$ #_masq_tit2 Original Message:(prot expire   initseq    delta prevd source               destination         ports\n)
+# prot expire   initseq    delta prevd source               destination         ports\n
diff --git a/nls/fr_FR.88591/loopback.m b/nls/fr_FR.88591/loopback.m
new file mode 100644 (file)
index 0000000..4ff7c36
--- /dev/null
@@ -0,0 +1,11 @@
+$set 16  #loopback
+
+$ #_none Original Message:([NONE SET])
+# [PAS DEFINI]
+
+$ #_unspec Original Message:(UNSPEC)
+# INDEFINI
+
+$ #_loop Original Message:(Local Loopback)
+# Boucle locale
+
diff --git a/nls/fr_FR.88591/netrom.m b/nls/fr_FR.88591/netrom.m
new file mode 100644 (file)
index 0000000..c5bc087
--- /dev/null
@@ -0,0 +1,19 @@
+$set 20  #netrom
+
+$ #_none Original Message:([NONE SET])
+# [PAS DEFINI]
+
+$ #_debug1 Original Message:(Invalid callsign)
+# Donne incorrecte
+
+$ #_debug2 Original Message:(Callsign too long)
+# Donne trop longue
+
+$ #_hw Original Message:(AMPR NET/ROM)
+# AMPR NET/ROM
+
+$ #_netrom Original Message:(AMPR NET/ROM)
+# AMPR NET/ROM
+
+$ #_notyet Original Message:(Routing table for `netrom' not yet supported.\n)
+# Routing table for `netrom' not yet supported.\n
diff --git a/nls/fr_FR.88591/netstat.m b/nls/fr_FR.88591/netstat.m
new file mode 100644 (file)
index 0000000..c96c7d5
--- /dev/null
@@ -0,0 +1,145 @@
+$set 4  #netstat
+
+$ #_args Original Message:(%s -> %d args)
+# %s -> %d args
+
+$ #_netstat Original Message:(netstat: unsupported address family %d !\n)
+# netstat: famille d'adresse pas supporté %d !\n
+
+$ #_UNKN Original Message:(UNKNOWN)
+# INCONNU
+
+$ #_off Original Message:(off (0.00/%ld))
+# off (0.00/%ld)
+
+$ #_on Original Message:(on (%2.2f/%ld))
+# on (%2.2f/%ld)
+
+$ #_unkn Original Message:(unkn-%d (%2.2f/%ld))
+# inconnu-%d (%2.2f/%ld)
+
+$ #_off2 Original Message:(off (0.00/%ld) %c)
+# off (0.00/%ld) %c
+
+$ #_on2 Original Message:(on (%2.2f/%ld) %c)
+# on (%2.2f/%ld) %c
+
+$ #_unkn2 Original Message:(unkn-%d (%2.2f/%ld) %c)
+# inconnu-%d (%2.2f/%ld) %c
+
+$ #_off3 Original Message:(off (0.00/%ld) %c)
+# off (0.00/%ld) %c
+
+$ #_on3 Original Message:(on (%2.2f/%ld) %c)
+# on (%2.2f/%ld) %c
+
+$ #_unkn3 Original Message:(unkn-%d (%2.2f/%ld) %c)
+# inconnu-%d (%2.2f/%ld) %c
+
+$ #_unix Original Message:(Active UNIX domain sockets\n)
+# Prises du domaine UNIX actives\n
+
+$ #_header_unix Original Message:(Proto RefCnt Flags      Type            State           Path\n)
+# Proto CptRef Options    Type            Etat            Chemin\n
+
+$ #_noflags Original Message:([NO FLAGS])
+# [PAS D'OPTIONS]
+
+$ #_interface Original Message:(Kernel Interface table\n)
+# Table des interfaces du noyau\n
+
+$ #_header_iface Original Message:(Iface   MTU Met  RX-OK RX-ERR RX-DRP RX-OVR  TX-OK TX-ERR TX-DRP TX-OVR Flags\n)
+# Iface   MTU Met  RX-OK RX-ERR RX-DRP RX-OVR  TX-OK TX-ERR TX-DRP TX-OVR Opts\n
+
+$ #_unkn_iface Original Message:(%s: unknown interface.\n)
+# %s: interface inconnue.\n
+
+$ #_usage1  Original Message:(usage: netstat [-veenc] [<Af>] -r            netstat {-V|--version|-h|--help}\n)
+# usage: netstat [-veenc] [<Af>] -r            netstat {-V|--version|-h|--help}\n
+
+$ #_usage2  Original Message:(       netstat [-vncao] [<Socket>]\n)
+#        netstat [-vncao] [<Socket>]\n
+
+$ #_usage3  Original Message:(       netstat { [-veenac] -i | [-vnc] -N | [-cne] -M }\n\n)
+#        netstat { [-veenac] -i | [-vnc] -N | [-cne] -M }\n\n
+
+$ #_usage4  Original Message:(        -r, --routing            display routing table\n)
+#         -r, --routing            display routing table\n
+
+$ #_usage5  Original Message:(        -N, --netlink            display netlink kernel messages\n)
+#         -N, --netlink            display netlink kernel messages\n
+
+$ #_usage6  Original Message:(        -i, --interfaces         display interface table\n)
+#         -i, --interfaces         display interface table\n
+
+$ #_usage7  Original Message:(        -M, --masquerade         display masqueraded connections\n\n)
+#         -M, --masquerade         display masqueraded connections\n\n
+
+$ #_usage8  Original Message:(        -v, --verbose            be verbose\n)
+#         -v, --verbose            be verbose\n
+
+$ #_usage9  Original Message:(        -n, --numeric            dont resolve names\n)
+#         -n, --numeric                   dont resolve names\n
+
+$ #_usage10 Original Message:(        -e, --extend             display other/more informations\n)
+#         -e, --extend             display other/more informations\n
+
+$ #_usage11 Original Message:(        -c, --continous          continous lising\n\n)
+#         -c, --continous          continous lising\n\n
+
+$ #_usage12 Original Message:(        -a, --all, --listening   display all\n)
+#         -a, --all, --listening   display all\n
+
+$ #_usage13  Original Message:(       -o, --timers             display timers\n\n)
+#         -o, --timers             display timers\n\n
+
+$ #_usage14  Original Message:(<Socket>={-t|--tcp} {-u|--udp} {-w|--raw} {-x|--unix} --ax25 --ipx --netrom\n)
+# <Socket>={-t|--tcp} {-u|--udp} {-w|--raw} {-x|--unix} --ax25 --ipx --netrom\n
+
+$ #_usage15  Original Message:(<Af>= -A {inet|ipx|netrom|ddp|ax25},... --inet --ipx --netrom --ddp --ax25\n)
+# <Af>= -A {inet|ipx|netrom|ddp|ax25},... --inet --ipx --netrom --ddp --ax25\n
+
+$ #_internet Original Message:(Active Internet connections)
+# Connexions Internet Actives
+
+$ #_servers Original Message:( (including servers))
+#  (y compris les serveurs)
+
+$ #_header_internet Original Message:(\nProto Recv-Q Send-Q Local Address          Foreign Address        (State)       User\n)
+# \nProto Recv-Q Send-Q Adresse Locale         Adresse Distante       (Etat)        Utilisateur\n
+
+$ #_header_ipx Original Message:(Active IPX sockets\nProto Recv-Q Send-Q Local Address          Foreign Address        (State)       User\n)
+# Prises IPX actives\nProto Recv-Q Send-Q Adresse Locale         Adresse Distante       (Etat)        Utilisateur\n
+
+$ #_type_no_route Original Message:(No routing for address family `%s'.\n)
+# No routing for address family `%s'.\n
+
+$ #_route_no_support Original Message:(Adress family `%s' not supported.\n)
+# Adress family `%s' not supported.\n
+
+$ #_route_not_yet Original Message:(Address family `%s' Not yet supported.\n)
+# Address family `%s' Not yet supported.\n
+
+$ #_nlp_title Original Message:(Netlink Kernel Messages)
+# Netlink Kernel Messages
+
+$ #_nlp_cnt Original Message:( (continous))
+#  (continous)
+
+$ #_noax25 Original Message:(AX.25 not configured in this system.\n)
+# AX.25 not configured in this system.\n
+
+$ #_ax25 Original Message:(Kernel AX.25 routing table\n)
+# Kernel AX.25 routing table\n
+
+$ #_header_ax25 Original Message:(Destination  Iface    Use\n)
+# Destination  Iface    Use\n
+
+$ #_nonetrom Original Message:(NET/ROM not configured in this system.\n)
+# NET/ROM not configured in this system.\n
+
+$ #_netrom Original Message:(Kernel NET/ROM routing table\n)
+# Kernel NET/ROM routing table\n
+
+$ #_header_netrom Original Message:(Destination  Mnemonic  Quality  Neighbour  Iface\n)
+# Destination  Mnemonic  Quality  Neighbour  Iface\n
diff --git a/nls/fr_FR.88591/plipconfig.m b/nls/fr_FR.88591/plipconfig.m
new file mode 100644 (file)
index 0000000..f9d6265
--- /dev/null
@@ -0,0 +1,10 @@
+$set 6  #plipconfig
+
+$ #_usage1 Original Message:(Usage: plipconfig [-a] [-i] [-v] interface\n)
+# Syntaxe: plipconfig [-a] [-i] [-v] interface\n
+
+$ #_usage2 Original Message:(                  [nibble NN] [trigger NN]\n)
+#                     [nibble NN] [trigger NN]\n
+
+$ #_plip Original Message:(%s\tnibble %lu  trigger %lu\n)
+# %s\tdigit %lu  déclenchement %lu\n
diff --git a/nls/fr_FR.88591/ppp.m b/nls/fr_FR.88591/ppp.m
new file mode 100644 (file)
index 0000000..b4ba9de
--- /dev/null
@@ -0,0 +1,8 @@
+$set 17  #ppp
+
+$ #_cant_start Original Message:(You cannot start PPP with this program.\n)
+# Vous ne pouvez pas démarrer PPP avec ce programme.\n
+
+$ #_ppp Original Message:(Point-Point Protocol)
+# Protocole Point-à-Point
+
diff --git a/nls/fr_FR.88591/rarp.m b/nls/fr_FR.88591/rarp.m
new file mode 100644 (file)
index 0000000..0ad5974
--- /dev/null
@@ -0,0 +1,22 @@
+$set 7  #rarp
+
+$ #_invalid Original Message:(Invalid Ethernet address: %s\n)
+# Adresse Ethernet incorrecte: %s\n
+
+$ #_unkn_host Original Message:(rarp: %s: unknown host\n)
+# rarp: %s: hôte inconnu\n
+
+$ #_noentry Original Message:(No ARP entry for %s\n)
+# Pas d'entrée ARP pour %s\n
+
+$ #_usage1 Original Message:(Usage: rarp -a                   List Entries in cache.     \n)
+# Syntaxe: rarp -a                      Liste les entrées dans le cache.     \n
+
+$ #_usage2 Original Message:(       rarp -d hostname          Delete hostname from cache.\n)
+#          rarp -d nom_d_hôte          Efface le nom d'hôte du cache.\n
+
+$ #_usage3 Original Message:(       rarp -s hostname hw_addr  Add hostname to cache.\n)
+#          rarp -s nom_d_hôte adr_mat  Ajoute le nom d'hôte dans le cache.\n
+
+$ #_unkn_hw Original Message:(rarp: %s: unknown hardware type.\n)
+# rarp: %s: type de matériel inconnu.\n
diff --git a/nls/fr_FR.88591/route.m b/nls/fr_FR.88591/route.m
new file mode 100644 (file)
index 0000000..b8fa1ca
--- /dev/null
@@ -0,0 +1,55 @@
+$set 2  #route
+
+$ #_rresolve Original Message:(rresolve: unsupport address family %d !\n)
+# rresolve: famille d'adresse pas supportée %d !\n
+
+$ #_usage1 Original Message:(Usage: route [-nvee] [-A inet|ipx|ddp|netrom],...  route {--version|--help}\n\n)
+# Usage: route [-nvee] [-A inet|ipx|ddp|netrom],...  route {--version|--help}\n\n
+
+$ #_usage2 Original Message:(       route [-v] del {-net|-host} Target [gw Gateway] [netmask Nm]\n)
+#        route [-v] del {-net|-host} Target [gw Gateway] [netmask Nm]\n
+
+$ #_usage3 Original Message:(             [metric N] [[dev] If]\n\n)
+#              [metric N] [[dev] If]\n\n
+
+$ #_usage4 Original Message:(       route [-v] add {-net|-host} Target [gw Gateway] [netmask Nm]\n)
+#        route [-v] add {-net|-host} Target [gw Gateway] [netmask Nm]\n
+
+$ #_usage5 Original Message:(             [metric N] [mss M] [window W] [irtt I] [reject]\n)
+#              [metric N] [mss M] [window W] [irtt I] [reject]\n
+
+$ #_usage6 Original Message:(             [mod] [dyn] [reinstate] [[dev] If]\n)
+#              [mod] [dyn] [reinstate] [[dev] If]\n
+
+$ #_table Original Message:(Kernel routing table\n)
+# Table de routage noyau\n
+
+$ #_cant_use Original Message:(route: %s: cannot use a NETWORK as gateway!\n)
+# route: %s: ne peut utiliser un RESEAU comme passerelle !\n
+
+$ #_MSS Original Message:(route: Invalid MSS.\n)
+# route: MSS invalide.\n
+
+$ #_window Original Message:(route: Invalid window.\n)
+# route: Taille de fenetre invalide.\n
+
+$ #_irtt Original Message:(route: Invalid initial rtt.\n)
+# route: irtt invalide.\n
+
+$ #_netmask1 Original Message:(route: netmask doesn't make sense with host route\n)
+# route: netmask n'a pas de sens avec une route vers un hôte\n
+
+$ #_netmask2 Original Message:(route: bogus netmask %s\n)
+# route: mauvais netmask %s\n
+
+$ #_netmask3 Original Message:(route: netmask doesn't match route address\n)
+# route: netmask ne correspond pas Ã  l'adresse de route\n
+
+$ #_fam_not_supp Original Message:(%s: address family not supported!\n)
+# %s: address family not supported!\n
+
+$ #_af_no_route Original Message:(route: %s: address family doesn't support routing.\n)
+# route: %s: address family doesn't support routing.\n
+
+$ #_wrong_af Original Message:(route: %s: command only supports 'inet' AF.\n)
+# route: %s: command only supports 'inet' AF.\n
diff --git a/nls/fr_FR.88591/slattach.m b/nls/fr_FR.88591/slattach.m
new file mode 100644 (file)
index 0000000..7ccea65
--- /dev/null
@@ -0,0 +1,46 @@
+$set 8  #slattach
+
+$ #_user_unkn Original Message:(slattach: tty_lock: UUCP user %s unknown!\n)
+# slattach: tty_lock: UUCP utilisateur %s inconnu !\n
+
+$ #_drop Original Message:(slattach: tty_hangup(DROP): %s\n)
+# slattach: tty_hangup(TERMINAISON): %s\n
+
+$ #_raise Original Message:(slattach: tty_hangup(RAISE): %s\n)
+# slattach: tty_hangup(OBTENTION): %s\n
+
+$ #_cant_state Original Message:(slattach: tty_open: cannot get current state!\n)
+# slattach: tty_open: ne peut pas obtenir l'état courant !\n
+
+$ #_cant_disc Original Message:(slattach: tty_open: cannot get current line disc!\n)
+# slattach: tty_open: ne peut pas obtenir la discipline de ligne courante !\n
+
+$ #_cant_raw Original Message:(slattach: tty_open: cannot set RAW mode!\n)
+# slattach: tty_open: ne peut pas positionner le mode RAW !\n
+
+$ #_cant_bps Original Message:(slattach: tty_open: cannot set %s bps!\n)
+# slattach: tty_open: ne peut pas positionner %s bps!\n
+
+$ #_cant_8n1 Original Message:(slattach: tty_open: cannot set 8N1 mode!\n)
+# slattach: tty_open: ne peut pas définir le mode 8N1 !\n
+
+$ #_usage1 Original Message:(Usage: slattach [-ehlLmnqv] [-c cmd] [-s speed] [-p protocol] tty | -\n)
+# Usage: slattach [-ehlLmnqv] [-c cmd] [-s vitesse] [-p protocole] tty | -\n
+
+$ #_unsupp Original Message:(slattach: unsupported protocol %s\n)
+# slattach: protocole %s pas supporté\n
+
+$ #_started Original Message:(%s started)
+# %s démarré
+
+$ #_on Original Message:( on %s)
+#  sur %s
+
+$ #_iface Original Message:( interface %s\n)
+#  interface %s\n
+
+$ #_locked Original Message:(slattach: /dev/%s already locked\n)
+# slattach: /dev/%s already locked\n
+
+$ #_cant_pid Original Message:(slattach: cannot write PID to lock file\n)
+# slattach: cannot write PID to lock file\n
diff --git a/nls/fr_FR.88591/slip.m b/nls/fr_FR.88591/slip.m
new file mode 100644 (file)
index 0000000..8045bc5
--- /dev/null
@@ -0,0 +1,17 @@
+$set 18  #slip
+
+$ #_slip Original Message:(Serial Line IP)
+# Ligne Série IP
+
+$ #_cslip Original Message:(VJ Serial Line IP)
+# Ligne Série `VJ' IP
+
+$ #_slip6 Original Message:(6-bit Serial Line IP)
+# Ligne Série `6-bits' IP
+
+$ #_cslip6 Original Message:(VJ 6-bit Serial Line IP)
+# Ligne Série `VJ 6-bits' IP
+
+$ #_adaptive Original Message:(Adaptive Serial Line IP)
+# Ligne Série `Adaptative' IP
+
diff --git a/nls/fr_FR.88591/unix.m b/nls/fr_FR.88591/unix.m
new file mode 100644 (file)
index 0000000..f6eea1a
--- /dev/null
@@ -0,0 +1,10 @@
+$set 19  #unix
+
+$ #_none Original Message:([NONE SET])
+# [PAS DEFINI]
+
+$ #_unix Original Message:(UNIX Domain)
+# Domaine UNIX
+
+$ #_unspec Original Message:(UNSPEC)
+# INDEFINI
diff --git a/rarp.c b/rarp.c
new file mode 100644 (file)
index 0000000..1edf1b7
--- /dev/null
+++ b/rarp.c
@@ -0,0 +1,322 @@
+/*
+ * rarp                This file contains an implementation of the command
+ *             that maintains the kernel's RARP cache.  It is derived
+ *              from Fred N. van Kempen's arp command.
+ *
+ * Usage:       rarp -d hostname                      Delete entry
+ *             rarp -s hostname ethernet_address     Add entry
+ *              rarp -a                               Print entries
+ *
+ * Rewritten: Phil Blundell <Philip.Blundell@pobox.com>  1997-08-03
+ *
+ */
+
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <sys/ioctl.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+#include <net/if.h>
+#include <net/if_arp.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <netdb.h>
+#include <string.h>
+#include <unistd.h>
+#include <getopt.h>
+
+#include "config.h"
+#include "net-locale.h"
+#include "net-support.h"
+#include "version.h"
+#include "pathnames.h"
+
+#define NO_RARP_MESSAGE         "This kernel does not support RARP.\n"
+
+static char version_string[] = RELEASE "\nrarp 1.01 (1998-01-02)\n";
+
+static struct hwtype *hardware = NULL;
+
+/* Delete an entry from the RARP cache. */
+static int rarp_delete(int fd, struct hostent *hp)
+{
+  struct arpreq req;
+  struct sockaddr_in *si;
+  unsigned int found = 0;
+  char **addr;
+
+  /* The host can have more than one address, so we loop on them. */
+  for (addr = hp->h_addr_list; *addr != NULL; addr++) { 
+    memset((char *) &req, 0, sizeof(req));
+    si = (struct sockaddr_in *) &req.arp_pa;
+    si->sin_family = hp->h_addrtype;
+    memcpy((char *) &si->sin_addr, *addr, hp->h_length);
+    
+    /* Call the kernel. */
+    if (ioctl(fd, SIOCDRARP, &req) == 0) {
+      found++;
+    } else {
+      switch (errno) {
+      case ENXIO:
+       break;
+      case ENODEV:
+       fputs(NO_RARP_MESSAGE, stderr);
+       return 1;
+      default:
+       perror("SIOCDRARP");
+       return 1;
+      }
+    }
+  }
+
+  if (found == 0) 
+    printf(NLS_CATGETS(catfd, rarpSet, rarp_noentry, 
+                      "no RARP entry for %s.\n"), hp->h_name);
+  return 0;
+}
+
+
+/* Set an entry in the RARP cache. */
+static int rarp_set(int fd, struct hostent *hp, char *hw_addr)
+{
+  struct arpreq req;
+  struct sockaddr_in *si;
+  struct sockaddr sap;
+
+  if (hardware->input(hw_addr, &sap)) {
+    fprintf(stderr, "%s: bad hardware address\n", hw_addr);
+    return 1;
+  }
+
+  /* Clear and fill in the request block. */
+  memset((char *) &req, 0, sizeof(req));
+  si = (struct sockaddr_in *) &req.arp_pa;
+  si->sin_family = hp->h_addrtype;
+  memcpy((char *) &si->sin_addr, hp->h_addr_list[0], hp->h_length);
+  req.arp_ha.sa_family = hardware->type;
+  memcpy(req.arp_ha.sa_data, sap.sa_data, hardware->alen);
+
+  /* Call the kernel. */
+  if (ioctl(fd, SIOCSRARP, &req) < 0) {
+    if (errno == ENODEV)
+      fputs(NO_RARP_MESSAGE, stderr);
+    else
+      perror("SIOCSRARP");
+    return  1;
+  }
+  return 0;
+}
+
+/* Process an EtherFile */
+static int rarp_file(int fd, const char *name)
+{
+  char buff[1024];
+  char *host, *addr;
+  int linenr;
+  FILE *fp;
+  struct hostent *hp;
+
+  if ((fp = fopen(name, "r")) == NULL) {
+    fprintf(stderr, NLS_CATGETS(catfd, rarpSet, 
+             rarp_cant_open, "rarp: cannot open file %s:%s.\n"), name, strerror(errno));
+    return -1;
+  }
+
+  /* Read the lines in the file. */
+  linenr = 0;
+  while (fgets(buff, sizeof(buff), fp)) {
+    ++linenr;
+    if (buff[0] == '#' || buff[0] == '\0') 
+      continue;
+    if ((addr = strtok(buff, "\n \t")) == NULL) 
+      continue;
+    if ((host = strtok(NULL, "\n \t")) == NULL) {
+      fprintf(stderr, NLS_CATGETS(catfd, rarpSet, rarp_formaterr, 
+                                 "rarp: format error at %s:%u\n"),
+             name, linenr);
+      continue;
+    }
+    
+    if ((hp = gethostbyname(host)) == NULL) {
+      fprintf(stderr, NLS_CATGETS(catfd, rarpSet, rarp_unkn_host, 
+                                 "rarp: %s: unknown host\n"), host);
+    }
+    if (rarp_set(fd,hp,addr) != 0) {
+      fprintf(stderr, NLS_CATGETS(catfd, rarpSet, rarp_cant_set,
+                                 "rarp: cannot set entry from %s:%u\n"),
+             name, linenr);
+    }
+  }
+  
+  (void) fclose(fp);
+  return 0;
+}
+static int display_cache(void)
+{
+  FILE *fd = fopen(_PATH_PROCNET_RARP, "r");
+  char buffer[256];
+  if (fd == NULL) {
+    if (errno == ENOENT) 
+      fputs(NO_RARP_MESSAGE, stderr);
+    else
+      perror(_PATH_PROCNET_RARP);
+    return 1;
+  }
+  while (feof(fd) == 0) {
+    if (fgets(buffer, 255, fd))
+      fputs(buffer, stdout);
+  }
+  fclose(fd);
+  return 0;
+}
+
+static void usage(void)
+{
+  fprintf(stderr, NLS_CATGETS(catfd, rarpSet, rarp_usage1,
+  "Usage: rarp -a                               list entries in cache.\n"));
+  fprintf(stderr, NLS_CATGETS(catfd, rarpSet, rarp_usage2,
+  "       rarp -d hostname                      delete entry from cache.\n"));
+  fprintf(stderr, NLS_CATGETS(catfd, rarpSet, rarp_usage3,
+  "       rarp [-t hwtype] -s hostname hwaddr   add entry to cache.\n"));
+  fprintf(stderr, NLS_CATGETS(catfd, rarpSet, rarp_usage4,
+  "       rarp -V                               display program version.\n"));
+  NLS_CATCLOSE(catfd)
+  exit(-1);
+}
+
+#define MODE_DISPLAY   1
+#define MODE_DELETE    2
+#define MODE_SET       3
+#define MODE_ETHERS    4
+
+static struct option longopts[] = { 
+  { "version", 0, NULL, 'V' },
+  { "verbose", 0, NULL, 'v' },
+  { "list",    0, NULL, 'a' },
+  { "set",     0, NULL, 's' },
+  { "delete",  0, NULL, 'd' },
+  { "help",    0, NULL, 'h' },
+  { NULL,      0, NULL, 0 }
+};
+  
+int main(int argc, char **argv)
+{
+  int result = 0, mode = 0, c, nargs = 0, verbose = 0;
+  char *args[3];
+  struct hostent *hp;
+  int fd;
+
+#if NLS
+  setlocale (LC_MESSAGES, "");
+  catfd = catopen ("nettools", MCLoadBySet);
+#endif
+
+#if HAVE_HWETHER
+  /* Get a default hardware type.  */
+  hardware = get_hwtype("ether");
+#endif
+
+  do {
+    c = getopt_long(argc, argv, "-ht:adsVvf", longopts, NULL);
+    switch (c) {
+    case EOF:
+      break;
+    case 'h':
+      usage();
+    case 'V':
+      fprintf(stderr, version_string);
+      NLS_CATCLOSE(catfd)
+      exit(1);
+      break;
+    case 'v':
+      verbose++;
+      break;
+    case 'a':
+    case 's':
+    case 'd':
+      if (mode) {
+       fprintf(stderr, "%s: illegal option mix.\n", argv[0]);
+       usage();
+      } else {
+       mode = (c == 'a'?MODE_DISPLAY:(c == 'd'?MODE_DELETE:MODE_SET));
+      }
+      break;
+    case 'f':
+      mode=MODE_ETHERS;
+      break;
+    case 't':
+      if (optarg) {
+       hardware = get_hwtype(optarg);
+      } else {
+       usage();
+      }
+      break;
+    case 1:
+      if (nargs == 2) {
+       usage();
+       exit(1);
+      } else {
+       args[nargs++] = optarg;
+      }
+      break;
+    default:
+      usage();
+    }
+  } while (c != EOF);
+
+  if (hardware == NULL) {
+    fprintf(stderr, NLS_CATGETS(catfd, rarpSet, rarp_unkn_hw,
+                               "rarp: %s: unknown hardware type.\n"), optarg);
+    NLS_CATCLOSE(catfd)
+      exit(1);
+  }
+
+  switch (mode) {
+  case 0:
+    usage();
+
+  case MODE_DISPLAY:
+  if (nargs != (mode-1)) {
+    usage();
+  }
+    result = display_cache();
+    break;
+
+  case MODE_DELETE:
+  case MODE_SET:
+  if (nargs != (mode-1)) {
+    usage();
+  }
+    if ((hp = gethostbyname(args[0])) == NULL) {
+      fprintf(stderr, NLS_CATGETS(catfd, rarpSet, rarp_unkn_host, 
+                                 "rarp: %s: unknown host\n"), args[0]);
+      NLS_CATCLOSE(catfd)
+       exit(1);
+    }
+    if (fd = socket(PF_INET, SOCK_DGRAM, 0), fd < 0) {
+      perror("socket");
+      NLS_CATCLOSE(catfd)
+       exit (1);
+    }
+    result = (mode == MODE_DELETE)?rarp_delete(fd, hp):rarp_set(fd, hp, args[1]);
+    close(fd);
+    break;
+
+  case MODE_ETHERS:
+    if (nargs!=0 && nargs!=1) usage();
+    if (fd = socket(PF_INET, SOCK_DGRAM, 0), fd < 0) {
+      perror("socket");
+      NLS_CATCLOSE(catfd)
+       exit (1);
+    }
+    result = rarp_file(fd, nargs ? args[0] : _PATH_ETHERS);
+    close(fd);
+
+  }
+
+  NLS_CATCLOSE(catfd)
+    exit(result);
+}
diff --git a/route.c b/route.c
new file mode 100644 (file)
index 0000000..96b1a0f
--- /dev/null
+++ b/route.c
@@ -0,0 +1,232 @@
+/*
+ * route        This file contains an implementation of the command
+ *              that manages the IP routing table in the kernel.
+ *
+ * Version:     route 1.94 (1997-09-21)
+ *
+ * Maintainer: Bernd 'eckes' Eckenfels, <net-tools@lina.inka.de>
+ *
+ * Author:      Fred N. van Kempen, <waltje@uwalt.nl.mugnet.org>
+ *             (derived from FvK's 'route.c     1.70    01/04/94')
+ *
+ * Modifications:
+ *             Johannes Stille:        for Net-2Debugged by 
+ *                                     <johannes@titan.os.open.de>
+ *             Linus Torvalds:         Misc Changes
+ *             Alan Cox:               add the new mtu/window stuff
+ *             Miquel van Smoorenburg: rt_add and rt_del
+ *      {1.79} Bernd Eckenfels:        route_info
+ *      {1.80} Bernd Eckenfels:        reject, metric, irtt, 1.2.x support.
+ *      {1.81} Bernd Eckenfels:        reject routes need a dummy device
+ *960127 {1.82} Bernd Eckenfels:       'mod' and 'dyn' 'reinstate' added
+ *960129 {1.83}        Bernd Eckenfels:        resolve and getsock now in lib/, 
+ *                                     REJECT displays '-' as gatway.
+ *960202 {1.84} Bernd Eckenfels:       net-features support added
+ *960203 {1.85} Bernd Eckenfels:       "#ifdef' in '#if' for net-features
+ *                                     -A  (aftrans) support, get_longopts
+ *960206 {1.86} Bernd Eckenfels:       route_init();
+ *960218 {1.87} Bernd Eckenfels:       netinet/in.h added
+ *960221 {1.88}        Bernd Eckenfels:        aftrans_dfl support
+ *960222 {1.90} Bernd Eckenfels:       moved all AF specific code to lib/.
+ *960413 {1.91} Bernd Eckenfels:       new RTACTION support+FLAG_CACHE/FIB
+ *960426 {1.92} Bernd Eckenfels:       FLAG_SYM/-N support
+ *960823 {x.xx} Frank Strauss:         INET6 stuff
+ *
+ */
+#include <sys/types.h>
+#include <sys/ioctl.h>
+#include <sys/socket.h>
+#include <net/if.h>
+#include <net/route.h>
+#include <netinet/in.h>
+#include <netdb.h>
+#include <netinet/in.h>
+#include <arpa/nameser.h>
+#include <resolv.h>
+#include <linux/param.h>
+#include <stdio.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <stdlib.h>
+#include <string.h>
+#include <getopt.h>
+#include <unistd.h>
+#include <ctype.h>
+#include "net-support.h"
+#include "config.h"
+#include "net-locale.h"
+#include "pathnames.h"
+#include "version.h"
+
+#define DFLT_AF "inet"
+
+#define FEATURE_ROUTE
+#include "lib/net-features.h" /* needs some of the system includes above! */
+
+char   *Release = RELEASE,
+       *Version = "route 1.94 (1997-09-21)";
+
+int             opt_n  = 0;    /* numerical output flag        */
+int             opt_v  = 0;    /* debugging output flag        */
+int            opt_e  = 1;     /* 1,2,3=type of routetable     */
+int            opt_fc = 0;     /* routing cache/FIB */
+int            opt_h  = 0;     /* help selected                */
+struct aftype   *ap;           /* current address family       */
+
+static void usage(void)
+{
+       fprintf(stderr, NLS_CATGETS(catfd, routeSet, route_usage1,
+                               "Usage: route [-nNvee] [-FC] [Address_families]  List kernel routing tables\n"));
+       fprintf(stderr, NLS_CATGETS(catfd, routeSet, route_usage2,
+                               "       route {-V|--version}                  Display command version and exit.\n"));
+       fprintf(stderr, NLS_CATGETS(catfd, routeSet, route_usage3,
+                               "       route {-h|--help} [Address_family]    Usage Syntax for specified AF.\n"));
+       fprintf(stderr, NLS_CATGETS(catfd, routeSet, route_usage4,
+                               "       route [-v] [-FC] {add|del|flush} ...  Modify routing table for AF.\n\n"));
+       fprintf(stderr, NLS_CATGETS(catfd, routeSet, route_usage5,
+                               "  Address_families: inet,inet6,ddp,ipx,netrom,ax25\n"));
+       fprintf(stderr, NLS_CATGETS(catfd, routeSet, route_usage6,
+                               "        specify AF: -A af1,af2..  or  --af1 --af2  or  af_route\n"));
+       NLS_CATCLOSE(catfd)
+       exit(E_USAGE);
+}
+
+
+static void version(void)
+{
+       fprintf(stderr,"%s\n%s\n%s\n",Release,Version,Features);
+       NLS_CATCLOSE(catfd)
+       exit(E_VERSION);
+}
+
+
+int main(int argc, char **argv)
+{
+       int i,lop,what=0;
+       struct option longopts[]=
+       {
+               AFTRANS_OPTS,
+               {"extend",      0,      0,      'e'},
+               {"verbose",     0,      0,      'v'},
+               {"version",     0,      0,      'V'},
+               {"numeric",     0,      0,      'n'},
+               {"symbolic",    0,      0,      'N'},
+               {"protocol",    1,      0,      'A'},
+               {"cache",       0,      0,      'C'},
+               {"fib",         0,      0,      'F'},
+               {"help",        0,      0,      'h'},
+               {NULL,          0,      0,      0}
+       };      
+       char **tmp;
+       char *progname;
+       int options;
+
+#if NLS
+       setlocale (LC_MESSAGES, "");
+       catfd = catopen ("nettools", MCLoadBySet);
+#endif
+
+       getroute_init();                        /* Set up AF routing support */
+       setroute_init();
+       afname[0] = '\0';
+       progname=argv[0];
+       
+       /* getopts and -net wont work :-/ */
+       for(tmp=argv;*tmp;tmp++) {
+               if (!strcmp(*tmp, "-net"))
+                       strcpy(*tmp, "#net");
+               else if (!strcmp(*tmp, "-host"))
+                       strcpy(*tmp, "#host");
+       }
+       
+       /* Fetch the command-line arguments. */
+       while ((i = getopt_long(argc, argv, "A:eCFhnNVv?", longopts, &lop)) != EOF) switch(i) {
+               case -1:
+                       break;
+               case 'n':
+                       opt_n |= FLAG_NUM;
+                       break;
+               case 'N':
+                       opt_n |= FLAG_SYM;
+                       break;
+               case 'v':
+                       opt_v |= FLAG_VERBOSE;
+                       break;
+               case 'e':
+                       opt_e++;
+                       break;
+               case 1:
+                       if (lop < 0 || lop >= AFTRANS_CNT) {
+                               EINTERN("route.c","longopts 1 range");
+                               break;
+                       }
+                       if ((i = aftrans_opt(longopts[lop].name))) {
+                               NLS_CATCLOSE(catfd)
+                               exit(i);
+                       }
+                       break;
+               case 'C':
+                       opt_fc |= FLAG_CACHE;
+                       break;
+               case 'F':
+                       opt_fc |= FLAG_FIB;
+                       break;
+               case 'A':
+                       if ((i = aftrans_opt(optarg))) {
+                               NLS_CATCLOSE(catfd)
+                               exit(i);
+                       }
+                       break;
+               case 'V':
+                       version();
+               case 'h':
+               case '?':
+                       opt_h++;
+                       break;
+               default:
+                       usage();
+       }
+       
+       argv += optind;
+       argc -= optind;
+       
+       if (opt_h) {
+               if (!afname[0])
+                       usage();
+               else
+                       what = RTACTION_HELP;
+       } else {        
+               if (!afname[0])
+                       /* this will initialise afname[] */
+                       aftrans_def("route", progname, DFLT_AF);
+
+               /* Do we have to show the contents of the routing table? */
+               if (*argv == NULL) {
+                       what = RTACTION_SHOW;
+               } else {
+                       if (!strcmp(*argv, "add"))
+                               what = RTACTION_ADD;
+                       else if (!strcmp(*argv, "del") || !strcmp(*argv, "delete"))
+                               what = RTACTION_DEL;
+                       else if (!strcmp(*argv,"flush"))
+                               what = RTACTION_FLUSH;
+                       else 
+                               usage();
+               }
+       }
+
+       options = (opt_e & FLAG_EXT) | opt_n | opt_fc | opt_v;
+       if (!opt_fc)
+               options |= FLAG_FIB;
+
+       if (what == RTACTION_SHOW)
+               i = route_info(afname,options);
+       else
+               i = route_edit(what,afname,options,++argv);
+
+       if (i == E_OPTERR)
+               usage();
+
+       NLS_CATCLOSE(catfd)
+       return (i);
+}
diff --git a/statistics.c b/statistics.c
new file mode 100644 (file)
index 0000000..dcd9d9a
--- /dev/null
@@ -0,0 +1,258 @@
+/* Copyright '97 by Andi Kleen. Subject to the GPL. */
+
+#include <ctype.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+int print_static; 
+
+enum State { number = 0, i_forward, i_inp_icmp, i_outp_icmp, i_rto_alg };
+#define normal number
+
+struct entry {
+       char *title;
+       char *out; 
+       enum State type;
+}; 
+
+static enum State state;
+static int indent[] = { 4, 4, 8, 8, 4 };       /* for each state */
+
+#define I_STATIC (1<<16) /* static configuration option. */
+#define I_TITLE  (1<<17)
+
+char *titles[] = { /* for each state */
+       NULL, NULL, 
+       "ICMP input histogram:",
+       "ICMP output histogram:",
+       NULL
+};
+
+/* XXX check against the snmp mib rfc.
+ */
+struct entry Iptab[] = {
+       { "Forwarding", "Forwarding is %s", i_forward|I_STATIC },
+       { "DefaultTTL", "Default TTL is %d", number|I_STATIC },
+       { "InReceives", "%d total packets received", number },
+       { "InHdrErrors", "%d with invalid headers", number },
+       { "InAddrErrors", "%d with invalid addresses", number },
+       { "ForwDatagrams", "%d forwarded", number },
+       { "InUnknownProtos", "%d with unknown protocol", number },
+       { "InDiscards", "%d incoming packets discarded", number },
+       { "InDelivers", "%d incoming packets delivered", number },
+       { "OutRequests", "%d requests sent out", number }, /*?*/
+       { "OutDiscards", "%d outgoing packets dropped", number }, 
+       { "OutNoRoutes", "%d dropped because of missing route", number },
+       { "ReasmTimeout", "%d fragments dropped after timeout", number },
+       { "ReasmReqds", "%d reassemblies required", number }, /* ? */
+       { "ReasmOKs", "%d packets reassembled ok", number }, 
+       { "ReasmFails", "%d packet reassembles failed", number }, 
+       { "FragOKs", "%d fragments received ok", number },
+       { "FragFails", "%d fragments failed", number },
+       { "FragCreates", "%d fragments created", number }
+};
+
+struct entry Icmptab[] = {
+       { "InMsgs", "%d ICMP messages received", number },
+       { "InErrors", "%d input ICMP message failed.", number },
+       { "InDestUnreachs", "destination unreachable: %d", i_inp_icmp|I_TITLE },
+       { "InTimeExcds", "timeout in transit: %d", i_inp_icmp|I_TITLE },
+       { "InParmProbs", "wrong parameters: %d", i_inp_icmp|I_TITLE },  /*?*/
+       { "InSrcQuenchs", "source quenchs: %d", i_inp_icmp|I_TITLE },
+       { "InRedirects", "redirects: %d", i_inp_icmp|I_TITLE },
+       { "InEchos", "echo requests: %d", i_inp_icmp|I_TITLE },
+       { "InEchoReps", "echo replies: %d", i_inp_icmp|I_TITLE },
+       { "InTimestamps", "timestamp request: %d", i_inp_icmp|I_TITLE },
+       { "InTimestampReps", "timestamp reply: %d", i_inp_icmp|I_TITLE },
+       { "InAddrMasks", "address mask request: %d", i_inp_icmp|I_TITLE }, /*?*/
+       { "InAddrMaskReps", "address mask replies", i_inp_icmp|I_TITLE }, /*?*/
+       { "OutMsgs", "%d ICMP messages sent", number },
+       { "OutErrors", "%d ICMP messages failed", number },
+       { "OutDestUnreachs", "destination unreachable: %d", i_outp_icmp|I_TITLE },
+       { "OutTimeExcds", "time exceeded: %d", i_outp_icmp|I_TITLE },
+       { "OutParmProbs", "wrong parameters: %d", i_outp_icmp|I_TITLE }, /*?*/
+       { "OutSrcQuenchs", "source quench: %d", i_outp_icmp|I_TITLE },
+       { "OutRedirects", "redirect: %d", i_outp_icmp|I_TITLE },
+       { "OutEchos", "echo request: %d", i_outp_icmp|I_TITLE },
+       { "OutEchoReps", "echo replies: %d", i_outp_icmp|I_TITLE },
+       { "OutTimestamps", "timestamp requests: %d", i_outp_icmp|I_TITLE },
+       { "OutTimestampReps", "timestamp replies: %d", i_outp_icmp|I_TITLE },
+       { "OutAddrMasks", "address mask requests: %d", i_outp_icmp|I_TITLE },
+       { "OutAddrMaskReps", "address mask replies: %d", i_outp_icmp|I_TITLE },
+};
+
+struct entry Tcptab[] = {
+       { "RtoAlgorithm", "RTO algorithm is %s", i_rto_alg|I_STATIC },
+       { "RtoMin", "", number },
+       { "RtoMax", "", number },
+       { "MaxConn", "", number },
+       { "ActiveOpens", "%d active opens", number },
+       { "PassiveOpens", "%d passive opens", number },
+       { "AttemptFails", "%d failed connection attempts", number },
+       { "EstabResets", "%d connection resets received", number },
+       { "CurrEstab", "%d connections established", number },
+       { "InSegs", "%d segments received", number },
+       { "OutSegs", "%d segments send out", number },
+       { "RetransSegs", "%d segments retransmited", number },
+};
+
+struct entry Udptab[] = {
+       { "InDatagrams", "%d packets received", number },
+       { "NoPorts", "%d packets to unknown port received.", number },
+       { "InErrors", "%d packet receive errors", number },
+       { "OutDatagrams", "%d packets send", number },
+};
+
+struct tabtab {
+       char *title; 
+       struct entry *tab; 
+       size_t size; 
+}; 
+
+struct tabtab snmptabs[] = { 
+       { "Ip", Iptab, sizeof(Iptab) },
+       { "Icmp", Icmptab, sizeof(Icmptab) },
+       { "Tcp", Tcptab, sizeof(Tcptab) },
+       { "Udp", Udptab, sizeof(Udptab) },
+       { NULL }
+}; 
+
+static char *skiptok(char *s)
+{
+       while (!isspace(*s) && *s != '\0')
+               s++; 
+       return s;
+}
+
+
+/* XXX IGMP */ 
+
+int cmpentries(const void *a, const void *b)
+{
+       return strcmp( ((struct entry*)a)->title, ((struct entry*)b)->title);
+}
+
+void printval(struct tabtab *tab, char *title, int val) 
+{
+       struct entry *ent, key; 
+       int type; 
+       char buf[512];
+
+       key.title = title; 
+       ent = bsearch(&key, tab->tab, tab->size/sizeof(struct entry),
+                                 sizeof(struct entry), cmpentries); 
+       if (!ent)  /* XXX warning */ 
+               return;
+       type = ent->type; 
+       if (type & I_STATIC) {
+               type &= ~I_STATIC; 
+               if (!print_static) 
+                       return; 
+       }
+       if (*ent->out == '\0') 
+               return; 
+
+       if (type & I_TITLE) {
+               type &= ~I_TITLE;
+               if (state != type)
+                       printf("%*s%s\n", indent[state], "", titles[type]);
+       }
+
+       buf[0] = '\0';
+       switch (type) {
+       case number:
+               sprintf(buf, ent->out, val);
+               break; 
+       case i_forward:
+               type = normal;
+               sprintf(buf, ent->out, val == 2 ? "enabled" : "disabled");
+               break; 
+       case i_outp_icmp:
+       case i_inp_icmp: 
+               if (val > 0) {
+                       sprintf(buf,ent->out, val); 
+               }
+               break; 
+       case i_rto_alg: /* XXXX */
+               break; 
+       default:
+               abort(); 
+       }
+       if (buf[0]) 
+               printf("%*s%s\n",indent[type],"", buf);
+       
+       state = type;
+}
+
+struct tabtab *newtable(struct tabtab *tabs, char *title) 
+{
+       struct tabtab *t; 
+
+       for (t = tabs; t->title; t++) 
+               if (!strcmp(title, t->title)) {
+                       printf("%s:\n", title); 
+                       state = normal; 
+                       return t; 
+               }
+       return NULL; 
+}
+
+void parsesnmp()
+{
+       FILE *f; 
+       char buf1[512], buf2[512]; 
+       char *sp, *np, *p; 
+
+       f = fopen("/proc/net/snmp", "r"); 
+       if (!f) {
+               perror("cannot open /proc/net/snmp");
+               return;
+       }
+       while (fgets(buf1,sizeof buf1,f)) {
+               int endflag; 
+               struct tabtab *tab; 
+
+               if (!fgets(buf2,sizeof buf2,f)) break; 
+               sp = strchr(buf1, ':');
+               np = strchr(buf2, ':'); 
+               if (!np || !sp) 
+                       goto formaterr; 
+               *sp = '\0'; 
+               tab = newtable(snmptabs, buf1); 
+               if (tab == NULL) /* XXX print warning */  
+                       continue; 
+               np++; sp++; 
+               
+               endflag = 0; 
+               while (!endflag) {
+                       while(isspace(*sp)) sp++; 
+                       while(isspace(*np)) np++; 
+                       /*if (*np == '\0') goto formaterr;*/ 
+
+                       p = skiptok(sp); 
+                       if (*p == '\0') endflag=1; 
+                       *p = '\0'; 
+                       printval(tab, sp, strtoul(np,&np,10)); 
+                       sp = p+1; 
+               }
+       }
+       if (ferror(f)) 
+               perror("/proc/net/snmp"); 
+       fclose(f); 
+       return; 
+
+formaterr: 
+       perror("error parsing /proc/net/snmp"); 
+       return; 
+}
+
+void inittab()
+{
+       struct tabtab *t;
+       /* we sort at runtime because I'm lazy ;) */ 
+       for (t = snmptabs; t->title; t++)  
+               qsort(t->tab, t->size/sizeof(struct entry), 
+                         sizeof(struct entry), cmpentries); 
+}