summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorAnas Nashif <anas.nashif@intel.com>2012-12-05 02:05:02 -0800
committerAnas Nashif <anas.nashif@intel.com>2012-12-05 02:05:02 -0800
commitc098f623bf888728e262e7813ffcdfe02df74937 (patch)
tree6188990bce1cee38fc0fd44ff2c294b877118887 /doc
downloadiputils-c098f623bf888728e262e7813ffcdfe02df74937.tar.gz
iputils-c098f623bf888728e262e7813ffcdfe02df74937.tar.bz2
iputils-c098f623bf888728e262e7813ffcdfe02df74937.zip
Imported Upstream version 20121126upstream/s20121126upstream/20121126upstream
Diffstat (limited to 'doc')
-rw-r--r--doc/Makefile47
-rw-r--r--doc/arping.sgml221
-rw-r--r--doc/clockdiff.sgml161
-rw-r--r--doc/docbook2man-spec.pl1164
-rw-r--r--doc/index.db28
-rw-r--r--doc/index.out87
-rw-r--r--doc/iputils.db209
-rw-r--r--doc/ninfod.sgml120
-rw-r--r--doc/pg3.sgml175
-rw-r--r--doc/ping.sgml683
-rw-r--r--doc/rarpd.sgml170
-rw-r--r--doc/rdisc.sgml246
-rw-r--r--doc/snapshot.db1
-rw-r--r--doc/tftpd.sgml151
-rw-r--r--doc/tracepath.sgml191
-rw-r--r--doc/traceroute6.sgml97
16 files changed, 3751 insertions, 0 deletions
diff --git a/doc/Makefile b/doc/Makefile
new file mode 100644
index 0000000..7ec4f1c
--- /dev/null
+++ b/doc/Makefile
@@ -0,0 +1,47 @@
+SGMLFILES=$(shell echo *.sgml)
+HTMLFILES=$(subst .sgml,.html,$(SGMLFILES)) index.html
+MANFILES=$(subst .sgml,.8,$(SGMLFILES))
+
+all: html
+
+html: $(HTMLFILES) iputils.html
+
+man: $(MANFILES)
+
+# docbook scripts are incredibly dirty in the sense that they leak
+# lots of some strange temporary junk directories and files.
+# So, scope it to a temporary dir and clean all after each run.
+
+$(HTMLFILES): index.db
+ @-rm -rf tmp.db2html
+ @mkdir tmp.db2html
+ @set -e; cd tmp.db2html; docbook2html ../$< ; mv *.html ..
+ @-rm -rf tmp.db2html
+
+iputils.html: iputils.db
+ @-rm -rf tmp.db2html
+ @mkdir tmp.db2html
+ @set -e; cd tmp.db2html; docbook2html -u -o html ../$< ; mv html/$@ ..
+ @-rm -rf tmp.db2html
+
+# docbook2man produces utterly ugly output and I did not find
+# any way to customize this but hacking backend perl script a little.
+# Well, hence...
+
+$(MANFILES): index.db
+ @-mkdir tmp.db2man
+ @set -e; cd tmp.db2man; nsgmls ../$< | sgmlspl ../docbook2man-spec.pl ; mv $@ ..
+ @-rm -rf tmp.db2man
+
+clean:
+ @rm -rf $(MANFILES) $(HTMLFILES) iputils.html tmp.db2html tmp.db2man
+
+snapshot:
+ @date "+%y%m%d" > snapshot.db
+
+
+$(MANFILES): $(SGMLFILES)
+
+$(HTMLFILES): $(SGMLFILES)
+
+
diff --git a/doc/arping.sgml b/doc/arping.sgml
new file mode 100644
index 0000000..0688ecb
--- /dev/null
+++ b/doc/arping.sgml
@@ -0,0 +1,221 @@
+<refentry id="arping">
+
+<refmeta>
+<refentrytitle>arping</refentrytitle>
+<manvolnum>8</manvolnum>
+<refmiscinfo>iputils-&snapshot;</refmiscinfo>
+</refmeta>
+
+
+<refnamediv>
+<refname>arping</refname>
+<refpurpose>send ARP REQUEST to a neighbour host</refpurpose>
+</refnamediv>
+
+<refsynopsisdiv>
+<cmdsynopsis>
+<command>arping</command>
+<arg choice="opt"><option>-AbDfhqUV</option></arg>
+<arg choice="opt">-c <replaceable/count/</arg>
+<arg choice="opt">-w <replaceable/deadline/</arg>
+<arg choice="opt">-s <replaceable/source/</arg>
+<arg choice="req">-I <replaceable/interface/</arg>
+<arg choice="req"><replaceable/destination/</arg>
+</cmdsynopsis>
+</refsynopsisdiv>
+
+<refsect1><title>DESCRIPTION</title>
+<para>
+Ping <replaceable/destination/ on device <replaceable/interface/ by ARP packets,
+using source address <replaceable/source/.
+</para>
+</refsect1>
+
+<refsect1><title>OPTIONS</title>
+
+<variablelist>
+
+ <varlistentry>
+ <term><option/-A/</term>
+ <listitem><para>
+The same as <option/-U/, but ARP REPLY packets used instead
+of ARP REQUEST.
+ </para></listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option>-b</option></term>
+ <listitem><para>
+Send only MAC level broadcasts. Normally <command/arping/ starts
+from sending broadcast, and switch to unicast after reply received.
+ </para></listitem>
+ </varlistentry>
+
+
+ <varlistentry>
+ <term><option><anchor id="arping.count">-c <replaceable/count/</option></term>
+ <listitem><para>
+Stop after sending <replaceable/count/ ARP REQUEST
+packets. With
+<link linkend="arping.deadline"><replaceable/deadline/</link>
+option, <command/arping/ waits for
+<replaceable/count/ ARP REPLY packets, until the timeout expires.
+ </para></listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option/-D/</term>
+ <listitem><para>
+Duplicate address detection mode (DAD). See
+<ulink url="http://tools.ietf.org/rfc/rfc2131.txt">RFC2131, 4.4.1</ulink>.
+Returns 0, if DAD succeeded i.e. no replies are received
+ </para></listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option>-f</option></term>
+ <listitem><para>
+Finish after the first reply confirming that target is alive.
+ </para></listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option><anchor id="opt.interface">-I <replaceable/interface/</option></term>
+ <listitem><para>
+Name of network device where to send ARP REQUEST packets.
+ </para></listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option>-h</option></term>
+ <listitem><para>
+Print help page and exit.
+ </para></listitem>
+ </varlistentry>
+
+
+ <varlistentry>
+ <term><option/-q/</term>
+ <listitem><para>
+Quiet output. Nothing is displayed.
+ </para></listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option><anchor id="opt.source">-s <replaceable/source/</option></term>
+ <listitem><para>
+IP source address to use in ARP packets.
+If this option is absent, source address is:
+ <itemizedlist>
+ <listitem><para>
+In DAD mode (with option <option/-D/) set to 0.0.0.0.
+ </para></listitem>
+ <listitem><para>
+In Unsolicited ARP mode (with options <option/-U/ or <option/-A/)
+set to <replaceable/destination/.
+ </para></listitem>
+ <listitem><para>
+Otherwise, it is calculated from routing tables.
+ </para></listitem>
+ </itemizedlist>
+ </para></listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option/-U/</term>
+ <listitem><para>
+Unsolicited ARP mode to update neighbours' ARP caches.
+No replies are expected.
+ </para></listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option>-V</option></term>
+ <listitem><para>
+Print version of the program and exit.
+ </para></listitem>
+ </varlistentry>
+
+
+ <varlistentry>
+ <term><option><anchor id="arping.deadline">-w <replaceable/deadline/</option></term>
+ <listitem><para>
+Specify a timeout, in seconds, before
+<command/arping/
+exits regardless of how many
+packets have been sent or received. In this case
+<command/arping/
+does not stop after
+<link linkend="arping.count"><replaceable/count/</link>
+packet are sent, it waits either for
+<link linkend="arping.deadline"><replaceable/deadline/</link>
+expire or until
+<link linkend="arping.count"><replaceable/count/</link>
+probes are answered.
+ </para></listitem>
+ </varlistentry>
+</variablelist>
+</refsect1>
+
+<refsect1><title>SEE ALSO</title>
+<para>
+<link linkend="ping">
+<citerefentry><refentrytitle/ping/<manvolnum/8/</citerefentry></link>,
+<link linkend="clockdiff">
+<citerefentry><refentrytitle/clockdiff/<manvolnum/8/</citerefentry></link>,
+<link linkend="tracepath">
+<citerefentry><refentrytitle/tracepath/<manvolnum/8/</citerefentry></link>.
+</para>
+</refsect1>
+
+<refsect1><title>AUTHOR</title>
+<para>
+<command/arping/ was written by
+<ulink url="mailto:kuznet@ms2.inr.ac.ru">Alexey Kuznetsov
+&lt;kuznet@ms2.inr.ac.ru&gt;</ulink>.
+It is now maintained by
+<ulink url="mailto:yoshfuji@skbuff.net">YOSHIFUJI Hideaki
+&lt;yoshfuji@skbuff.net&gt;</ulink>.
+</para>
+</refsect1>
+
+<refsect1><title>SECURITY</title>
+<para>
+<command/arping/ requires <constant/CAP_NET_RAW/ capability
+to be executed. It is not recommended to be used as set-uid root,
+because it allows user to modify ARP caches of neighbour hosts.
+</para>
+</refsect1>
+
+<refsect1><title>AVAILABILITY</title>
+<para>
+<command/arping/ is part of <filename/iputils/ package
+and the latest versions are available in source form at
+<ulink url="http://www.skbuff.net/iputils/iputils-current.tar.bz2">
+http://www.skbuff.net/iputils/iputils-current.tar.bz2</ulink>.
+</para>
+</refsect1>
+
+<![IGNORE[
+<refsect1><title>COPYING</title>
+<para>
+<literallayout>
+This documentation is free software; you can redistribute
+it and/or modify it under the terms of the GNU General Public
+License Version 2.
+
+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.
+
+For more details see the file COPYING in the source
+distribution of Linux kernel of version 2.4.
+</literallayout>
+</para>
+</refsect1>
+]]>
+
+
+
+</refentry>
diff --git a/doc/clockdiff.sgml b/doc/clockdiff.sgml
new file mode 100644
index 0000000..e5ab592
--- /dev/null
+++ b/doc/clockdiff.sgml
@@ -0,0 +1,161 @@
+<refentry id="clockdiff">
+
+<refmeta>
+<refentrytitle>clockdiff</refentrytitle>
+<manvolnum>8</manvolnum>
+<refmiscinfo>iputils-&snapshot;</refmiscinfo>
+</refmeta>
+
+<refnamediv>
+<refname>clockdiff</refname>
+<refpurpose>measure clock difference between hosts</refpurpose>
+</refnamediv>
+
+<refsynopsisdiv>
+<cmdsynopsis>
+<command>clockdiff</command>
+<arg choice="opt"><option>-o</option></arg>
+<arg choice="opt"><option>-o1</option></arg>
+<arg choice="req"><replaceable/destination/</arg>
+</cmdsynopsis>
+</refsynopsisdiv>
+
+<refsect1><title>DESCRIPTION</title>
+<para>
+<command/clockdiff/ Measures clock difference between us and
+<replaceable/destination/ with 1 msec resolution using ICMP TIMESTAMP
+<link linkend="clockdiff.icmp-timestamp">[2]</link>
+packets or, optionally, IP TIMESTAMP option
+<link linkend="clockdiff.ip-timestamp">[3]</link>
+option added to ICMP ECHO.
+<link linkend="clockdiff.icmp-echo">[1]</link>
+</para>
+</refsect1>
+
+<refsect1><title>OPTIONS</title>
+
+<variablelist>
+
+ <varlistentry>
+ <term><option/-o/</term>
+ <listitem><para>
+Use IP TIMESTAMP with ICMP ECHO instead of ICMP TIMESTAMP
+messages. It is useful with some destinations, which do not support
+ICMP TIMESTAMP (f.e. Solaris &lt;2.4).
+ </para></listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option/-o1/</term>
+ <listitem><para>
+Slightly different form of <option/-o/, namely it uses three-term
+IP TIMESTAMP with prespecified hop addresses instead of four term one.
+What flavor works better depends on target host. Particularly,
+<option/-o/ is better for Linux.
+ </para></listitem>
+ </varlistentry>
+
+</variablelist>
+
+</refsect1>
+
+<refsect1><title>WARNINGS</title>
+<itemizedlist>
+ <listitem><para>
+Some nodes (Cisco) use non-standard timestamps, which is allowed
+by RFC, but makes timestamps mostly useless.
+ </para></listitem>
+ <listitem><para>
+Some nodes generate messed timestamps (Solaris&gt;2.4), when
+run <command/xntpd/. Seems, its IP stack uses a corrupted clock source,
+which is synchronized to time-of-day clock periodically and jumps
+randomly making timestamps mostly useless. Good news is that you can
+use NTP in this case, which is even better.
+ </para></listitem>
+ <listitem><para>
+<command/clockdiff/ shows difference in time modulo 24 days.
+ </para></listitem>
+</itemizedlist>
+
+</refsect1>
+
+<refsect1><title>SEE ALSO</title>
+<para>
+<link linkend="ping">
+<citerefentry><refentrytitle/ping/<manvolnum/8/</citerefentry></link>,
+<link linkend="arping">
+<citerefentry><refentrytitle/arping/<manvolnum/8/</citerefentry></link>,
+<link linkend="tracepath">
+<citerefentry><refentrytitle/tracepath/<manvolnum/8/</citerefentry></link>.
+</para>
+</refsect1>
+
+<refsect1><title>REFERENCES</title>
+<para>
+[1] <anchor id="clockdiff.icmp-echo">ICMP ECHO,
+<ulink url="http://tools.ietf.org/rfc/rfc792.txt">
+RFC0792, page 14</ulink>.
+</para>
+<para>
+[2] <anchor id="clockdiff.icmp-timestamp">ICMP TIMESTAMP,
+<ulink url="http://tools.ietf.org/rfc/rfc792.txt">
+RFC0792, page 16</ulink>.
+</para>
+<para>
+[3] <anchor id="clockdiff.ip-timestamp">IP TIMESTAMP option,
+<ulink url="http://tools.ietf.org/rfc/rfc791.txt">
+RFC0791, 3.1, page 16</ulink>.
+</para>
+</refsect1>
+
+<refsect1><title>AUTHOR</title>
+<para>
+<command/clockdiff/ was compiled by
+<ulink url="mailto:kuznet@ms2.inr.ac.ru">Alexey Kuznetsov
+&lt;kuznet@ms2.inr.ac.ru&gt;</ulink>. It was based on code borrowed
+from BSD <command/timed/ daemon.
+It is now maintained by
+<ulink url="mailto:yoshfuji@skbuff.net">YOSHIFUJI Hideaki
+&lt;yoshfuji@skbuff.net&gt;</ulink>.
+</para>
+</refsect1>
+
+<refsect1><title>SECURITY</title>
+<para>
+<command/clockdiff/ requires <constant/CAP_NET_RAW/ capability
+to be executed. It is safe to be used as set-uid root.
+</para>
+</refsect1>
+
+<refsect1><title>AVAILABILITY</title>
+<para>
+<command/clockdiff/ is part of <filename/iputils/ package
+and the latest versions are available in source form at
+<ulink url="http://www.skbuff.net/iputils/iputils-current.tar.bz2">
+http://www.skbuff.net/iputils/iputils-current.tar.bz2</ulink>.
+</para>
+</refsect1>
+
+<![IGNORE[
+<refsect1><title>COPYING</title>
+<para>
+<literallayout>
+This documentation is free software; you can redistribute
+it and/or modify it under the terms of the GNU General Public
+License Version 2.
+
+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.
+
+For more details see the file COPYING in the source
+distribution of Linux kernel of version 2.4.
+</literallayout>
+</para>
+</refsect1>
+]]>
+
+
+
+</refentry>
diff --git a/doc/docbook2man-spec.pl b/doc/docbook2man-spec.pl
new file mode 100644
index 0000000..16ef7bc
--- /dev/null
+++ b/doc/docbook2man-spec.pl
@@ -0,0 +1,1164 @@
+=head1 NAME
+
+docbook2man-spec - convert DocBook RefEntries to Unix manpages
+
+=head1 SYNOPSIS
+
+The SGMLSpm package from CPAN. This contains the sgmlspl script which
+is used to grok this file. Use it like this:
+
+nsgmls some-docbook-document.sgml | sgmlspl docbook2man-spec.pl
+
+=head1 DESCRIPTION
+
+This is a sgmlspl spec file that produces Unix-style
+manpages from RefEntry markup.
+
+See the accompanying RefEntry man page for 'plain new' documentation. :)
+
+=head1 LIMITATIONS
+
+Trying docbook2man on non-DocBook or non-conformant SGML results in
+undefined behavior. :-)
+
+This program is a slow, dodgy Perl script.
+
+This program does not come close to supporting all the possible markup
+in DocBook, and will produce wrong output in some cases with supported
+markup.
+
+=head1 TODO
+
+Add new element handling and fix existing handling. Be robust.
+Produce cleanest, readable man output as possible (unlike some
+other converters). Follow Linux man(7) convention.
+If this results in added logic in this script,
+that's okay. The code should still be reasonably organized.
+
+Make it faster. If Perl sucks port it to another language.
+
+=head1 COPYRIGHT
+
+Copyright (C) 1998-1999 Steve Cheng <steve@ggi-project.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, or (at your option) any later
+version.
+
+You should have received a copy of the GNU General Public License along with
+this program; see the file COPYING. If not, please write to the Free
+Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+
+=cut
+
+# $Id: docbook2man-spec.pl,v 1.1 2000/07/21 20:22:30 rosalia Exp $
+
+use SGMLS; # Use the SGMLS package.
+use SGMLS::Output; # Use stack-based output.
+use SGMLS::Refs;
+
+########################################################################
+# SGMLSPL script produced automatically by the script sgmlspl.pl
+#
+# Document Type: any, but processes only RefEntries
+# Edited by: me :)
+########################################################################
+
+$write_manpages = 0;
+$blank_xrefs = 0;
+
+sgml('start', sub {
+ push_output('nul');
+ $raw_cdata = 1; # Makes it a bit faster.
+
+ # Links file
+ open(LINKSFILE, ">manpage.links");
+
+ $Refs = new SGMLS::Refs("manpage.refs");
+});
+sgml('end', sub {
+ close(LINKSFILE);
+ if($blank_xrefs) {
+ print STDERR "Warning: output contains unresolved XRefs\n";
+ }
+});
+
+
+
+
+########################################################################
+#
+# Output helpers
+#
+########################################################################
+
+# Our own version of sgml() and output() to allow simple string output
+# to play well with roff's stupid whitespace rules.
+
+sub man_sgml
+{
+ if(ref($_[1]) eq 'CODE') {
+ return &sgml;
+ }
+
+ my $s = $_[1];
+
+ $s =~ s/\\/\\\\/g;
+ $s =~ s/'/\\'/g;
+
+ # \n at the beginning means start at beginning of line
+ if($s =~ s/^\n//) {
+ $sub = 'sub { output "\n" unless $newline_last++; ';
+ if($s eq '') {
+ sgml($_[0], eval('sub { output "\n" unless $newline_last++; }'));
+ } elsif($s =~ /\n$/) {
+ sgml($_[0], eval("sub { output \"\\n\" unless \$newline_last++; output '$s'; }"));
+ } else {
+ sgml($_[0], eval("sub { output \"\\n\" unless \$newline_last; output '$s'; \$newline_last = 0; }"));
+ }
+ } else {
+ if($s =~ /\n$/) {
+ sgml($_[0], eval("sub { output '$s'; \$newline_last = 1; }"));
+ } else {
+ sgml($_[0], eval("sub { output '$s'; \$newline_last = 0; }"));
+ }
+ }
+}
+
+sub man_output
+{
+ $_ = shift;
+ if(s/^\n//) {
+ output "\n" unless $newline_last++;
+ }
+ return if $_ eq '';
+
+ output $_;
+
+ if(@_) {
+ output @_;
+ $newline_last = (pop(@_) =~ /\n$/);
+ } else {
+ $newline_last = ($_ =~ /\n$/)
+ }
+}
+
+# Fold lines into one, quote some characters
+sub fold_string
+{
+ $_ = shift;
+
+ s/\\/\\\\/g;
+ s/"/\\\&"/g;
+
+ # Change tabs to spaces
+ tr/\t\n/ /;
+
+ # Trim whitespace from beginning and end.
+ s/^ +//;
+ s/ +$//;
+
+ return $_;
+}
+
+sub save_cdata()
+{
+ $raw_cdata++;
+ push_output('string');
+}
+
+sub bold_on()
+{
+ # If the last font is also bold, don't change anything.
+ # Basically this is to just get more readable man output.
+ if($fontstack[$#fontstack] ne 'bold') {
+ if(!$raw_cdata) {
+ output '\fB';
+ $newline_last = 0;
+ }
+ }
+ push(@fontstack, 'bold');
+}
+
+sub italic_on()
+{
+ # If the last font is also italic, don't change anything.
+ if($fontstack[$#fontstack] ne 'italic') {
+ if(!$raw_cdata) {
+ output '\fI';
+ $newline_last = 0;
+ }
+ }
+ push(@fontstack, 'italic');
+}
+
+sub font_off()
+{
+ my $thisfont = pop(@fontstack);
+ my $lastfont = $fontstack[$#fontstack];
+
+ # Only output font change if it is different
+ if($thisfont ne $lastfont) {
+ if($raw_cdata) { return; }
+ elsif($lastfont eq 'bold') { output '\fB'; }
+ elsif($lastfont eq 'italic') { output '\fI'; }
+ else { output '\fR'; }
+
+ $newline_last = 0;
+ }
+}
+
+
+
+
+
+
+########################################################################
+#
+# Manpage management
+#
+########################################################################
+
+sgml('<REFENTRY>', sub {
+ # This will be overwritten at end of REFMETA, when we know the name of the page.
+ pop_output();
+
+ $write_manpages = 1; # Currently writing manpage.
+
+ $nocollapse_whitespace = 0; # Current whitespace collapse counter.
+ $newline_last = 1; # At beginning of line?
+ # Just a bit of warning, you will see this variable manipulated
+ # manually a lot. It makes the code harder to follow but it
+ # saves you from having to worry about collapsing at the end of
+ # parse, stopping at verbatims, etc.
+ $raw_cdata = 0; # Instructs certain output functions to
+ # leave CDATA alone, so we can assign
+ # it to a string and process it, etc.
+ @fontstack = (); # Fonts being activated.
+
+ $manpage_title = ''; # Needed for indexing.
+ $manpage_sect = '';
+ @manpage_names = ();
+
+ $manpage_misc = '';
+
+ $list_nestlevel = 0; # Indent certain nested content.
+});
+sgml('</REFENTRY>', sub {
+ if(!$newline_last) {
+ output "\n";
+ }
+
+ $write_manpages = 0;
+ $raw_cdata = 1;
+ push_output('nul');
+});
+
+sgml('</REFMETA>', sub {
+ push_output('file', "$manpage_title.$manpage_sect");
+
+ output <<_END_BANNER;
+.\\" This manpage has been automatically generated by docbook2man
+.\\" from a DocBook document. This tool can be found at:
+.\\" <http://shell.ipoline.com/~elmert/comp/docbook2X/>
+.\\" Please send any bug reports, improvements, comments, patches,
+.\\" etc. to Steve Cheng <steve\@ggi-project.org>.
+_END_BANNER
+
+ my $manpage_date = `date "+%d %B %Y"`;
+
+ output '.TH "';
+
+ # If the title is not mixed-case, convention says to
+ # uppercase the whole title. (The canonical title is
+ # lowercase.)
+ if($manpage_title =~ /[A-Z]/) {
+ output fold_string($manpage_title);
+ } else {
+ output uc(fold_string($manpage_title));
+ }
+
+ output '" "', fold_string($manpage_sect),
+ '" "', fold_string(`date "+%d %B %Y"`),
+ '" "', $manpage_misc,
+ '" "', $manpage_manual,
+ "\"\n";
+
+ $newline_last = 1;
+
+ # References to this RefEntry.
+ my $id = $_[0]->parent->attribute('ID')->value;
+ if($id ne '') {
+ # The 'package name' part of the section should
+ # not be used when citing it.
+ my ($sectnum) = ($manpage_sect =~ /([0-9]*)/);
+
+ if($_[0]->parent->attribute('XREFLABEL')->value eq '') {
+ $Refs->put("refentry:$id", "$manpage_title($sectnum)");
+ } else {
+ $Refs->put("refentry:$id",
+ $_[0]->parent->attribute('XREFLABEL')->value .
+ "($sectnum)");
+ }
+ }
+});
+
+sgml('<REFENTRYTITLE>', sub {
+ if($_[0]->in('REFMETA')) {
+ save_cdata();
+ } else {
+ # Manpage citations are in bold.
+ bold_on();
+ }
+});
+sgml('</REFENTRYTITLE>', sub {
+ if($_[0]->in('REFMETA')) {
+ $raw_cdata--;
+ $manpage_title = pop_output();
+ }
+ else { font_off(); }
+});
+
+sgml('<MANVOLNUM>', sub {
+ if($_[0]->in('REFMETA')) {
+ save_cdata();
+ } else {
+ # Manpage citations use ().
+ output '(';
+ }
+});
+sgml('</MANVOLNUM>', sub {
+ if($_[0]->in('REFMETA')) {
+ $raw_cdata--;
+ $manpage_sect = pop_output();
+ }
+ else { output ')' }
+});
+
+sgml('<REFMISCINFO>', \&save_cdata);
+sgml('</REFMISCINFO>', sub {
+ $raw_cdata--;
+ $manpage_misc = fold_string(pop_output());
+});
+
+
+# NAME section
+man_sgml('<REFNAMEDIV>', "\n.SH NAME\n");
+
+sgml('<REFNAME>', \&save_cdata);
+sgml('</REFNAME>', sub {
+ $raw_cdata--;
+ push(@manpage_names, pop_output());
+});
+
+sgml('<REFPURPOSE>', \&save_cdata);
+sgml('</REFPURPOSE>', sub {
+ $raw_cdata--;
+ my $manpage_purpose = fold_string(pop_output());
+
+ for(my $i = 0; $i < $#manpage_names; $i++) {
+ output fold_string($manpage_names[$i]), ', ';
+ }
+
+ output fold_string($manpage_names[$#manpage_names]);
+ output " \\- $manpage_purpose\n";
+
+ $newline_last = 1;
+
+ foreach(@manpage_names) {
+ # Don't link to itself
+ if($_ ne $manpage_title) {
+ print LINKSFILE "$manpage_title.$manpage_sect $_.$manpage_sect\n";
+ }
+ }
+});
+
+man_sgml('<REFCLASS>', "\n.sp\n");
+
+#RefDescriptor
+
+
+
+
+
+########################################################################
+#
+# SYNOPSIS section and synopses
+#
+########################################################################
+
+man_sgml('<REFSYNOPSISDIV>', "\n.SH SYNOPSIS\n");
+man_sgml('</REFSYNOPSISDIV>', "\n");
+
+## FIXME! Must be made into block elements!!
+#sgml('<FUNCSYNOPSIS>', \&bold_on);
+#sgml('</FUNCSYNOPSIS>', \&font_off);
+#sgml('<CMDSYNOPSIS>', \&bold_on);
+#sgml('</CMDSYNOPSIS>', \&font_off);
+
+man_sgml('<FUNCSYNOPSIS>', sub {
+ man_output("\n.sp\n");
+ bold_on();
+});
+man_sgml('</FUNCSYNOPSIS>', sub {
+ font_off();
+ man_output("\n");
+});
+
+man_sgml('<CMDSYNOPSIS>', "\n\n");
+man_sgml('</CMDSYNOPSIS>', "\n\n");
+
+man_sgml('<FUNCPROTOTYPE>', "\n.sp\n");
+
+# Arguments to functions. This is C convention.
+man_sgml('<PARAMDEF>', '(');
+man_sgml('</PARAMDEF>', ");\n");
+man_sgml('<VOID>', "(void);\n");
+
+
+
+sub arg_start
+{
+ # my $choice = $_[0]->attribute('CHOICE')->value;
+
+ # The content model for CmdSynopsis doesn't include #PCDATA,
+ # so we won't see any of the whitespace in the source file,
+ # so we have to add it after each component.
+ output ' ';
+
+ if($_[0]->attribute('CHOICE')->value =~ /opt/i) {
+ output '[ ';
+ }
+ bold_on();
+}
+sub arg_end
+{
+ font_off();
+ if($_[0]->attribute('REP')->value =~ /^Repeat/i) {
+ italic_on();
+ output ' ...';
+ font_off();
+ }
+ if($_[0]->attribute('CHOICE')->value =~ /opt/i) {
+ output '] ';
+ }
+}
+
+sgml('<ARG>', \&arg_start);
+sgml('</ARG>', \&arg_end);
+sgml('<GROUP>', \&arg_start);
+sgml('</GROUP>', \&arg_end);
+
+sgml('<OPTION>', \&bold_on);
+sgml('</OPTION>', \&font_off);
+
+# FIXME: This is one _blank_ line.
+man_sgml('<SBR>', "\n\n");
+
+
+########################################################################
+#
+# General sections
+#
+########################################################################
+
+# The name of the section is handled by TITLE. This just sets
+# up the roff markup.
+man_sgml('<REFSECT1>', "\n.SH ");
+man_sgml('<REFSECT2>', "\n.SS ");
+man_sgml('<REFSECT3>', "\n.SS ");
+
+
+########################################################################
+#
+# Titles, metadata.
+#
+########################################################################
+
+sgml('<TITLE>', sub {
+ if($_[0]->in('REFERENCE') or $_[0]->in('BOOK')) {
+ $write_manpages = 1;
+ }
+ save_cdata();
+});
+sgml('</TITLE>', sub {
+ my $title = fold_string(pop_output());
+ $raw_cdata--;
+
+ if($_[0]->in('REFERENCE') or $_[0]->in('BOOK')) {
+ # We use TITLE of enclosing Reference or Book as manual name
+ $manpage_manual = $title;
+ $write_manpages = 0;
+ }
+ elsif(exists $_[0]->parent->ext->{'title'}) {
+ # By far the easiest case. Just fold the string as
+ # above, and then set the parent element's variable.
+ $_[0]->parent->ext->{'title'} = $title;
+ }
+ else {
+ # If the parent element's handlers are lazy,
+ # output the folded string for them :)
+ # We assume they want uppercase and a newline.
+ output '"', uc($title), "\"\n";
+ $newline_last = 1;
+ }
+});
+
+sgml('<ATTRIBUTION>', sub { push_output('string') });
+sgml('</ATTRIBUTION>', sub { $_[0]->parent->ext->{'attribution'} = pop_output(); });
+
+
+# IGNORE.
+sgml('<DOCINFO>', sub { push_output('nul'); });
+sgml('</DOCINFO>', sub { pop_output(); });
+sgml('<REFSECT1INFO>', sub { push_output('nul'); });
+sgml('</REFSECT1INFO>', sub { pop_output(); });
+sgml('<REFSECT2INFO>', sub { push_output('nul'); });
+sgml('</REFSECT2INFO>', sub { pop_output(); });
+sgml('<REFSECT3INFO>', sub { push_output('nul'); });
+sgml('</REFSECT3INFO>', sub { pop_output(); });
+
+sgml('<INDEXTERM>', sub { push_output('nul'); });
+sgml('</INDEXTERM>', sub { pop_output(); });
+
+
+########################################################################
+#
+# Set bold on enclosed content
+#
+########################################################################
+
+sgml('<APPLICATION>', \&bold_on); sgml('</APPLICATION>', \&font_off);
+
+sgml('<CLASSNAME>', \&bold_on); sgml('</CLASSNAME>', \&font_off);
+sgml('<STRUCTNANE>', \&bold_on); sgml('</STRUCTNAME>', \&font_off);
+sgml('<STRUCTFIELD>', \&bold_on); sgml('</STRUCTFIELD>', \&font_off);
+sgml('<SYMBOL>', \&bold_on); sgml('</SYMBOL>', \&font_off);
+sgml('<TYPE>', \&bold_on); sgml('</TYPE>', \&font_off);
+
+sgml('<ENVAR>', \&bold_on); sgml('</ENVAR>', \&font_off);
+
+sgml('<FUNCTION>', \&bold_on); sgml('</FUNCTION>', \&font_off);
+
+sgml('<EMPHASIS>', \&bold_on); sgml('</EMPHASIS>', \&font_off);
+
+sgml('<ERRORNAME>', \&bold_on); sgml('</ERRORNAME>', \&font_off);
+# ERRORTYPE
+
+sgml('<COMMAND>', \&bold_on); sgml('</COMMAND>', \&font_off);
+
+sgml('<GUIBUTTON>', \&bold_on); sgml('</GUIBUTTON>', \&font_off);
+sgml('<GUIICON>', \&bold_on); sgml('</GUIICON>', \&font_off);
+# GUILABEL
+# GUIMENU
+# GUIMENUITEM
+# GUISUBMENU
+# MENUCHOICE
+# MOUSEBUTTON
+
+sgml('<ACCEL>', \&bold_on); sgml('</ACCEL>', \&font_off);
+sgml('<KEYCAP>', \&bold_on); sgml('</KEYCAP>', \&font_off);
+sgml('<KEYSYM>', \&bold_on); sgml('</KEYSYM>', \&font_off);
+# KEYCODE
+# KEYCOMBO
+# SHORTCUT
+
+sgml('<USERINPUT>', \&bold_on); sgml('</USERINPUT>', \&font_off);
+
+sgml('<INTERFACEDEFINITION>', \&bold_on);
+sgml('</INTERFACEDEFINITION>', \&font_off);
+
+# May need to look at the CLASS
+sgml('<SYSTEMITEM>', \&bold_on);
+sgml('</SYSTEMITEM>', \&font_off);
+
+
+
+
+
+########################################################################
+#
+# Set italic on enclosed content
+#
+########################################################################
+
+sgml('<FIRSTTERM>', \&italic_on); sgml('</FIRSTTERM>', \&font_off);
+
+sgml('<FILENAME>', \&italic_on); sgml('</FILENAME>', \&font_off);
+sgml('<PARAMETER>', \&italic_on); sgml('</PARAMETER>', \&font_off);
+sgml('<PROPERTY>', \&italic_on); sgml('</PROPERTY>', \&font_off);
+
+sgml('<REPLACEABLE>', sub {
+ italic_on();
+ if($_[0]->in('TOKEN')) {
+ # When tokenizing, follow more 'intuitive' convention
+ output "<";
+ }
+});
+sgml('</REPLACEABLE>', sub {
+ if($_[0]->in('TOKEN')) {
+ output ">";
+ }
+ font_off();
+});
+
+sgml('<CITETITLE>', \&italic_on); sgml('</CITETITLE>', \&font_off);
+sgml('<FOREIGNPHRASE>', \&italic_on); sgml('</FOREIGNPHRASE>', \&font_off);
+
+sgml('<LINEANNOTATION>', \&italic_on); sgml('</LINEANNOTATION>', \&font_off);
+
+
+
+
+
+
+########################################################################
+#
+# Other 'inline' elements
+#
+########################################################################
+
+man_sgml('<EMAIL>', '<');
+man_sgml('</EMAIL>', '>');
+man_sgml('<OPTIONAL>', '[');
+man_sgml('</OPTIONAL>', ']');
+
+man_sgml('</TRADEMARK>', "\\u\\s-2TM\\s+2\\d");
+
+man_sgml('<COMMENT>', "[Comment: ");
+man_sgml('</COMMENT>', "]");
+
+man_sgml('<QUOTE>', "``");
+man_sgml('</QUOTE>', "''");
+
+#man_sgml('<LITERAL>', '"');
+#man_sgml('</LITERAL>', '"');
+
+# No special presentation:
+
+# AUTHOR
+# AUTHORINITIALS
+
+# ABBREV
+# ACTION
+# ACRONYM
+# ALT
+# CITATION
+# PHRASE
+# QUOTE
+# WORDASWORD
+
+# COMPUTEROUTPUT
+# MARKUP
+# PROMPT
+# RETURNVALUE
+# SGMLTAG
+# TOKEN
+
+# DATABASE
+# HARDWARE
+# INTERFACE
+# MEDIALABEL
+
+# There doesn't seem to be a good way to represent LITERAL in -man
+
+
+
+########################################################################
+#
+# Paragraph and paragraph-like elements
+#
+########################################################################
+
+sub para_start {
+ output "\n" unless $newline_last++;
+
+ # In lists, etc., don't start paragraph with .PP since
+ # the indentation will be gone.
+
+ if($_[0]->parent->ext->{'nobreak'}==1) {
+ # Usually this is the FIRST element of
+ # a hanging tag, so we MUST not do a full
+ # paragraph break.
+ $_[0]->parent->ext->{'nobreak'} = 2;
+ } elsif($_[0]->parent->ext->{'nobreak'}==2) {
+ # Usually these are the NEXT elements of
+ # a hanging tag. If we break using a blank
+ # line, we're okay.
+ output "\n";
+ } else {
+ # Normal case. (For indented blocks too, at least
+ # -man isn't so braindead in this area.)
+ output ".PP\n";
+ }
+}
+# Actually applies to a few other block elements as well
+sub para_end {
+ output "\n" unless $newline_last++;
+}
+
+sgml('<PARA>', \&para_start);
+sgml('</PARA>', \&para_end);
+sgml('<SIMPARA>', \&para_start);
+sgml('</SIMPARA>', \&para_end);
+
+# Nothing special, except maybe FIXME set nobreak.
+sgml('<INFORMALEXAMPLE>', \&para_start);
+sgml('</INFORMALEXAMPLE>', \&para_end);
+
+
+
+
+
+########################################################################
+#
+# Blocks using SS sections
+#
+########################################################################
+
+# FIXME: We need to consider the effects of SS
+# in a hanging tag :(
+
+# Complete with the optional-title dilemma (again).
+sgml('<ABSTRACT>', sub {
+ $_[0]->ext->{'title'} = 'ABSTRACT';
+ output "\n" unless $newline_last++;
+ push_output('string');
+});
+sgml('</ABSTRACT>', sub {
+ my $content = pop_output();
+
+ # As ABSTRACT is never on the same level as RefSect1,
+ # this leaves us with only .SS in terms of -man macros.
+ output ".SS \"", uc($_[0]->ext->{'title'}), "\"\n";
+
+ output $content;
+ output "\n" unless $newline_last++;
+});
+
+# Ah, I needed a break. Example always has a title.
+man_sgml('<EXAMPLE>', "\n.SS ");
+sgml('</EXAMPLE>', \&para_end);
+
+# Same with sidebar.
+man_sgml('<SIDEBAR>', "\n.SS ");
+sgml('</SIDEBAR>', \&para_end);
+
+# NO title.
+man_sgml('<HIGHLIGHTS>', "\n.SS HIGHLIGHTS\n");
+sgml('</HIGHLIGHTS>', \&para_end);
+
+
+
+
+########################################################################
+#
+# Indented 'Block' elements
+#
+########################################################################
+
+sub indent_block_start
+{
+ output "\n" unless $newline_last++;
+ output ".sp\n.RS\n";
+}
+sub indent_block_end
+{
+ output "\n" unless $newline_last++;
+ output ".RE\n";
+}
+
+# This element is almost like an admonition (below),
+# only the default title is blank :)
+
+sgml('<BLOCKQUOTE>', sub {
+ $_[0]->ext->{'title'} = '';
+ output "\n" unless $newline_last++;
+ push_output('string');
+});
+sgml('</BLOCKQUOTE>', sub {
+ my $content = pop_output();
+
+ indent_block_start();
+
+ if($_[0]->ext->{'title'}) {
+ output ".B \"", $_[0]->ext->{'title'}, ":\"\n";
+ }
+
+ output $content;
+
+ if($_[0]->ext->{'attribution'}) {
+ output "\n" unless $newline_last++;
+ # One place where roff's space-sensitivity makes sense :)
+ output "\n -- ";
+ output $_[0]->ext->{'attribution'} . "\n";
+ }
+
+ indent_block_end();
+});
+
+# Set off admonitions from the rest of the text by indenting.
+# FIXME: Need to check if this works inside paragraphs, not enclosing them.
+sub admonition_end {
+ my $content = pop_output();
+
+ indent_block_start();
+
+ # When the admonition is only one paragraph,
+ # it looks nicer if the title was inline.
+ my $num_para;
+ while ($content =~ /^\.PP/gm) { $num_para++ }
+ if($num_para==1) {
+ $content =~ s/^\.PP\n//;
+ }
+
+ output ".B \"" . $_[0]->ext->{'title'} . ":\"\n";
+ output $content;
+
+ indent_block_end();
+}
+
+sgml('<NOTE>', sub {
+ # We can't see right now whether or not there is a TITLE
+ # element, so we have to save the output now and add it back
+ # at the end of this admonition.
+ $_[0]->ext->{'title'} = 'Note';
+
+ # Although admonition_end's indent_block_start will do this,
+ # we need to synchronize the output _now_
+ output "\n" unless $newline_last++;
+
+ push_output('string');
+});
+sgml('</NOTE>', \&admonition_end);
+
+# Same as above.
+sgml('<WARNING>', sub {
+ $_[0]->ext->{'title'} = 'Warning';
+ output "\n" unless $newline_last++;
+ push_output('string');
+});
+sgml('</WARNING>', \&admonition_end);
+
+sgml('<TIP>', sub {
+ $_[0]->ext->{'title'} = 'Tip';
+ output "\n" unless $newline_last++;
+ push_output('string');
+});
+sgml('</TIP>', \&admonition_end);
+sgml('<CAUTION>', sub {
+ $_[0]->ext->{'title'} = 'Caution';
+ output "\n" unless $newline_last++;
+ push_output('string');
+});
+sgml('</CAUTION>', \&admonition_end);
+
+sgml('<IMPORTANT>', sub {
+ $_[0]->ext->{'title'} = 'Important';
+ output "\n" unless $newline_last++;
+ push_output('string');
+});
+sgml('</IMPORTANT>', \&admonition_end);
+
+
+
+
+
+
+
+
+
+
+
+
+########################################################################
+#
+# Verbatim displays.
+#
+########################################################################
+
+sub verbatim_start {
+ output "\n" unless $newline_last++;
+
+ if($_[0]->parent->ext->{'nobreak'}==1) {
+ # Usually this is the FIRST element of
+ # a hanging tag, so we MUST not do a full
+ # paragraph break.
+ $_[0]->parent->ext->{'nobreak'} = 2;
+ } else {
+ output "\n";
+ }
+
+ output(".nf\n") unless $nocollapse_whitespace++;
+}
+
+sub verbatim_end {
+ output "\n" unless $newline_last++;
+ output(".fi\n") unless --$nocollapse_whitespace;
+}
+
+sgml('<PROGRAMLISTING>', \&verbatim_start);
+sgml('</PROGRAMLISTING>', \&verbatim_end);
+
+sgml('<SCREEN>', \&verbatim_start);
+sgml('</SCREEN>', \&verbatim_end);
+
+sgml('<LITERALLAYOUT>', \&verbatim_start);
+sgml('</LITERALLAYOUT>', \&verbatim_end);
+
+#sgml('<SYNOPSIS>', sub {
+# if($_[0]->attribute('FORMAT')->value =~ /linespecific/i) {
+# &verbatim_start;
+# } else {
+# roffcmd("");
+# }
+#});
+#
+#sgml('</SYNOPSIS>', sub {
+# if($_[0]->attribute('FORMAT')->value =~ /linespecific/i) {
+# &verbatim_end;
+# }
+# else {
+# roffcmd("");# not sure about this.
+# }
+#});
+sgml('<SYNOPSIS>', \&verbatim_start);
+sgml('</SYNOPSIS>', \&verbatim_end);
+
+
+
+
+
+
+
+
+
+########################################################################
+#
+# Lists
+#
+########################################################################
+
+# Indent nested lists.
+sub indent_list_start {
+ if($list_nestlevel++) {
+ output "\n" unless $newline_last++;
+ output ".RS\n";
+ }
+}
+sub indent_list_end {
+ if(--$list_nestlevel) {
+ output "\n" unless $newline_last++;
+ output ".RE\n";
+ }
+}
+
+sgml('<VARIABLELIST>', \&indent_list_start);
+sgml('</VARIABLELIST>', \&indent_list_end);
+sgml('<ITEMIZEDLIST>', \&indent_list_start);
+sgml('</ITEMIZEDLIST>', \&indent_list_end);
+sgml('<ORDEREDLIST>', sub {
+ indent_list_start();
+ $_[0]->ext->{'count'} = 1;
+});
+sgml('</ORDEREDLIST>', \&indent_list_end);
+
+# Output content on one line, bolded.
+sgml('<TERM>', sub {
+ output "\n" unless $newline_last++;
+ output ".TP\n";
+ bold_on();
+ push_output('string');
+});
+sgml('</TERM>', sub {
+ my $term = pop_output();
+ $term =~ tr/\n/ /;
+ output $term;
+ font_off();
+ output "\n";
+ $newline_last = 1;
+});
+
+sgml('<LISTITEM>', sub {
+ # A bulleted list.
+ if($_[0]->in('ITEMIZEDLIST')) {
+ output "\n" unless $newline_last++;
+ output ".TP 0.2i\n\\(bu\n";
+ }
+
+ # Need numbers.
+ # Assume Arabic numeration for now.
+ elsif($_[0]->in('ORDEREDLIST')) {
+ output "\n" unless $newline_last++;
+ output ".TP ", $_[0]->parent->ext->{'count'}++, ". \n";
+ }
+
+ $_[0]->ext->{'nobreak'} = 1;
+});
+
+sgml('<SIMPLELIST>', sub {
+ $_[0]->ext->{'first_member'} = 1;
+});
+
+sgml('<MEMBER>', sub {
+ my $parent = $_[0]->parent;
+
+ if($parent->attribute('TYPE')->value =~ /Inline/i) {
+ if($parent->ext->{'first_member'}) {
+ # If this is the first member don't put any commas
+ $parent->ext->{'first_member'} = 0;
+ } else {
+ output ", ";
+ }
+ } elsif($parent->attribute('TYPE')->value =~ /Vert/i) {
+ output "\n" unless $newline_last++;
+ output "\n";
+ }
+});
+
+
+
+
+
+########################################################################
+#
+# Stuff we don't know how to handle (yet)
+#
+########################################################################
+
+# Address blocks:
+
+# Credit stuff:
+# ACKNO
+# ADDRESS
+# AFFILIATION
+# ARTPAGENUMS
+# ATTRIBUTION
+# AUTHORBLURB
+# AUTHORGROUP
+# OTHERCREDIT
+# HONORIFIC
+
+# Areas:
+# AREA
+# AREASET
+# AREASPEC
+
+
+
+
+
+########################################################################
+#
+# Linkage, cross references
+#
+########################################################################
+
+# Print the URL
+sgml('</ULINK>', sub {
+# output ' <URL:', $_[0]->attribute('URL')->value, '>';
+ $newline_last = 0;
+});
+
+# If cross reference target is a RefEntry,
+# output CiteRefEntry-style references.
+sgml('<XREF>', sub {
+ my $id = $_[0]->attribute('LINKEND')->value;
+ my $manref = $Refs->get("refentry:$id");
+
+ if($manref) {
+ my ($title, $sect) = ($manref =~ /(.*)(\(.*\))/);
+ bold_on();
+ output $title;
+ font_off();
+ output $sect;
+ } else {
+ $blank_xrefs++ if $write_manpages;
+ output "[XRef to $id]";
+ }
+
+ $newline_last = 0;
+});
+
+# Anchor
+
+
+
+
+########################################################################
+#
+# Other handlers
+#
+########################################################################
+
+man_sgml('|[lt ]|', '<');
+man_sgml('|[gt ]|', '>');
+man_sgml('|[amp ]|', '&');
+
+#
+# Default handlers (uncomment these if needed). Right now, these are set
+# up to gag on any unrecognised elements, sdata, processing-instructions,
+# or entities.
+#
+# sgml('start_element',sub { die "Unknown element: " . $_[0]->name; });
+# sgml('end_element','');
+
+# This is for weeding out and escaping certain characters.
+# This looks like it's inefficient since it's done on every line, but
+# in reality, SGMLSpm and sgmlspl parsing ESIS takes _much_ longer.
+
+sgml('cdata', sub
+{
+ if(!$write_manpages) { return; }
+ elsif($raw_cdata) { output $_[0]; return; }
+
+ # Escape backslashes
+ $_[0] =~ s/\\/\\\\/g;
+
+ # In non-'pre'-type elements:
+ if(!$nocollapse_whitespace) {
+ # Change tabs to spaces
+ $_[0] =~ tr/\t/ /;
+
+ # Do not allow indents at beginning of line
+ # groff chokes on that.
+ if($newline_last) {
+ $_[0] =~ s/^ +//;
+
+ # If the line is all blank, don't do anything.
+ if($_[0] eq '') { return; }
+
+ $_[0] =~ s/^\./\\\&\./;
+
+ # Argh... roff doesn't like ' either...
+ $_[0] =~ s/^\'/\\\&\'/;
+ }
+ }
+
+ $newline_last = 0;
+
+ output $_[0];
+});
+
+
+# When in whitespace-collapsing mode, we disallow consecutive newlines.
+
+sgml('re', sub
+{
+ if($nocollapse_whitespace || !$newline_last) {
+ output "\n";
+ }
+
+ $newline_last = 1;
+});
+
+sgml('sdata',sub { die "Unknown SDATA: " . $_[0]; });
+sgml('pi',sub { die "Unknown processing instruction: " . $_[0]; });
+sgml('entity',sub { die "Unknown external entity: " . $_[0]->name; });
+sgml('start_subdoc',sub { die "Unknown subdoc entity: " . $_[0]->name; });
+sgml('end_subdoc','');
+sgml('conforming','');
+
+1;
+
diff --git a/doc/index.db b/doc/index.db
new file mode 100644
index 0000000..427c2e9
--- /dev/null
+++ b/doc/index.db
@@ -0,0 +1,28 @@
+<!DOCTYPE reference PUBLIC "-//OASIS//DTD DocBook V3.1//EN"[
+<!ENTITY snapshot SYSTEM "snapshot.db">
+<!ENTITY ping SYSTEM "ping.sgml">
+<!ENTITY rdisc SYSTEM "rdisc.sgml">
+<!ENTITY arping SYSTEM "arping.sgml">
+<!ENTITY clockdiff SYSTEM "clockdiff.sgml">
+<!ENTITY tracepath SYSTEM "tracepath.sgml">
+<!ENTITY traceroute6 SYSTEM "traceroute6.sgml">
+<!ENTITY rarpd SYSTEM "rarpd.sgml">
+<!ENTITY ninfod SYSTEM "ninfod.sgml">
+<!ENTITY tftpd SYSTEM "tftpd.sgml">
+<!ENTITY pg3 SYSTEM "pg3.sgml">
+]>
+<reference id="index">
+<title>System Manager's Manual: iputils</title>
+
+&ping;
+&arping;
+&clockdiff;
+&rarpd;
+&tracepath;
+&traceroute6;
+&tftpd;
+&ninfod;
+&rdisc;
+&pg3;
+
+</reference>
diff --git a/doc/index.out b/doc/index.out
new file mode 100644
index 0000000..fe8ef2e
--- /dev/null
+++ b/doc/index.out
@@ -0,0 +1,87 @@
+\BOOKMARK [1]{0.1.1}{ping}{}
+\BOOKMARK [2]{0.1.1.2}{Name}{0.1.1}
+\BOOKMARK [2]{0.1.2.2}{Synopsis}{0.1.1}
+\BOOKMARK [2]{0.1.3.2}{DESCRIPTION}{0.1.1}
+\BOOKMARK [2]{0.1.4.2}{OPTIONS}{0.1.1}
+\BOOKMARK [2]{0.1.5.2}{ICMP PACKET DETAILS}{0.1.1}
+\BOOKMARK [2]{0.1.6.2}{DUPLICATE AND DAMAGED PACKETS}{0.1.1}
+\BOOKMARK [2]{0.1.7.2}{TRYING DIFFERENT DATA PATTERNS}{0.1.1}
+\BOOKMARK [2]{0.1.8.2}{TTL DETAILS}{0.1.1}
+\BOOKMARK [2]{0.1.9.2}{BUGS}{0.1.1}
+\BOOKMARK [2]{0.1.10.2}{SEE ALSO}{0.1.1}
+\BOOKMARK [2]{0.1.11.2}{HISTORY}{0.1.1}
+\BOOKMARK [2]{0.1.12.2}{SECURITY}{0.1.1}
+\BOOKMARK [2]{0.1.13.2}{AVAILABILITY}{0.1.1}
+\BOOKMARK [1]{0.2.1}{arping}{}
+\BOOKMARK [2]{0.2.14.2}{Name}{0.2.1}
+\BOOKMARK [2]{0.2.15.2}{Synopsis}{0.2.1}
+\BOOKMARK [2]{0.2.16.2}{DESCRIPTION}{0.2.1}
+\BOOKMARK [2]{0.2.17.2}{OPTIONS}{0.2.1}
+\BOOKMARK [2]{0.2.18.2}{SEE ALSO}{0.2.1}
+\BOOKMARK [2]{0.2.19.2}{AUTHOR}{0.2.1}
+\BOOKMARK [2]{0.2.20.2}{SECURITY}{0.2.1}
+\BOOKMARK [2]{0.2.21.2}{AVAILABILITY}{0.2.1}
+\BOOKMARK [1]{0.3.1}{clockdiff}{}
+\BOOKMARK [2]{0.3.22.2}{Name}{0.3.1}
+\BOOKMARK [2]{0.3.23.2}{Synopsis}{0.3.1}
+\BOOKMARK [2]{0.3.24.2}{DESCRIPTION}{0.3.1}
+\BOOKMARK [2]{0.3.25.2}{OPTIONS}{0.3.1}
+\BOOKMARK [2]{0.3.26.2}{WARNINGS}{0.3.1}
+\BOOKMARK [2]{0.3.27.2}{SEE ALSO}{0.3.1}
+\BOOKMARK [2]{0.3.28.2}{REFERENCES}{0.3.1}
+\BOOKMARK [2]{0.3.29.2}{AUTHOR}{0.3.1}
+\BOOKMARK [2]{0.3.30.2}{SECURITY}{0.3.1}
+\BOOKMARK [2]{0.3.31.2}{AVAILABILITY}{0.3.1}
+\BOOKMARK [1]{0.4.1}{rarpd}{}
+\BOOKMARK [2]{0.4.32.2}{Name}{0.4.1}
+\BOOKMARK [2]{0.4.33.2}{Synopsis}{0.4.1}
+\BOOKMARK [2]{0.4.34.2}{DESCRIPTION}{0.4.1}
+\BOOKMARK [2]{0.4.35.2}{WARNING}{0.4.1}
+\BOOKMARK [2]{0.4.36.2}{OPTIONS}{0.4.1}
+\BOOKMARK [2]{0.4.37.2}{SEE ALSO}{0.4.1}
+\BOOKMARK [2]{0.4.38.2}{AUTHOR}{0.4.1}
+\BOOKMARK [2]{0.4.39.2}{SECURITY}{0.4.1}
+\BOOKMARK [2]{0.4.40.2}{AVAILABILITY}{0.4.1}
+\BOOKMARK [1]{0.5.1}{tracepath}{}
+\BOOKMARK [2]{0.5.41.2}{Name}{0.5.1}
+\BOOKMARK [2]{0.5.42.2}{Synopsis}{0.5.1}
+\BOOKMARK [2]{0.5.43.2}{DESCRIPTION}{0.5.1}
+\BOOKMARK [2]{0.5.44.2}{SEE ALSO}{0.5.1}
+\BOOKMARK [2]{0.5.45.2}{AUTHOR}{0.5.1}
+\BOOKMARK [2]{0.5.46.2}{SECURITY}{0.5.1}
+\BOOKMARK [2]{0.5.47.2}{AVAILABILITY}{0.5.1}
+\BOOKMARK [1]{0.6.1}{traceroute6}{}
+\BOOKMARK [2]{0.6.48.2}{Name}{0.6.1}
+\BOOKMARK [2]{0.6.49.2}{Synopsis}{0.6.1}
+\BOOKMARK [2]{0.6.50.2}{DESCRIPTION}{0.6.1}
+\BOOKMARK [2]{0.6.51.2}{SEE ALSO}{0.6.1}
+\BOOKMARK [2]{0.6.52.2}{HISTORY}{0.6.1}
+\BOOKMARK [2]{0.6.53.2}{SECURITY}{0.6.1}
+\BOOKMARK [2]{0.6.54.2}{AVAILABILITY}{0.6.1}
+\BOOKMARK [1]{0.7.1}{tftpd}{}
+\BOOKMARK [2]{0.7.55.2}{Name}{0.7.1}
+\BOOKMARK [2]{0.7.56.2}{Synopsis}{0.7.1}
+\BOOKMARK [2]{0.7.57.2}{DESCRIPTION}{0.7.1}
+\BOOKMARK [2]{0.7.58.2}{SECURITY}{0.7.1}
+\BOOKMARK [2]{0.7.59.2}{SEE ALSO}{0.7.1}
+\BOOKMARK [2]{0.7.60.2}{HISTORY}{0.7.1}
+\BOOKMARK [2]{0.7.61.2}{AVAILABILITY}{0.7.1}
+\BOOKMARK [1]{0.8.1}{rdisc}{}
+\BOOKMARK [2]{0.8.62.2}{Name}{0.8.1}
+\BOOKMARK [2]{0.8.63.2}{Synopsis}{0.8.1}
+\BOOKMARK [2]{0.8.64.2}{DESCRIPTION}{0.8.1}
+\BOOKMARK [2]{0.8.65.2}{OPTIONS}{0.8.1}
+\BOOKMARK [2]{0.8.66.2}{HISTORY}{0.8.1}
+\BOOKMARK [2]{0.8.67.2}{SEE ALSO}{0.8.1}
+\BOOKMARK [2]{0.8.68.2}{REFERENCES}{0.8.1}
+\BOOKMARK [2]{0.8.69.2}{SECURITY}{0.8.1}
+\BOOKMARK [2]{0.8.70.2}{AVAILABILITY}{0.8.1}
+\BOOKMARK [1]{0.9.1}{pg3}{}
+\BOOKMARK [2]{0.9.71.2}{Name}{0.9.1}
+\BOOKMARK [2]{0.9.72.2}{Synopsis}{0.9.1}
+\BOOKMARK [2]{0.9.73.2}{DESCRIPTION}{0.9.1}
+\BOOKMARK [2]{0.9.74.2}{COMMAND}{0.9.1}
+\BOOKMARK [2]{0.9.75.2}{WARNING}{0.9.1}
+\BOOKMARK [2]{0.9.76.2}{AUTHOR}{0.9.1}
+\BOOKMARK [2]{0.9.77.2}{SECURITY}{0.9.1}
+\BOOKMARK [2]{0.9.78.2}{AVAILABILITY}{0.9.1}
diff --git a/doc/iputils.db b/doc/iputils.db
new file mode 100644
index 0000000..f29dfad
--- /dev/null
+++ b/doc/iputils.db
@@ -0,0 +1,209 @@
+<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook V3.1//EN"[]>
+<article id="iputils">
+ <artheader>
+ <title>iputils: documentation directory</title>
+ </artheader>
+
+<sect1>
+<title>Index</title>
+
+<itemizedlist>
+ <listitem><para>
+ <ulink url="ping.html">ping, ping6</ulink>.
+ </para></listitem>
+ <listitem><para>
+ <ulink url="arping.html">arping</ulink>.
+ </para></listitem>
+ <listitem><para>
+ <ulink url="clockdiff.html">clockdiff</ulink>.
+ </para></listitem>
+ <listitem><para>
+ <ulink url="rarpd.html">rarpd</ulink>.
+ </para></listitem>
+ <listitem><para>
+ <ulink url="tracepath.html">tracepath, tracepath6</ulink>.
+ </para></listitem>
+ <listitem><para>
+ <ulink url="traceroute6.html">traceroute6</ulink>.
+ </para></listitem>
+ <listitem><para>
+ <ulink url="rdisc.html">rdisc</ulink>.
+ </para></listitem>
+ <listitem><para>
+ <ulink url="tftpd.html">tftpd</ulink>.
+ </para></listitem>
+ <listitem><para>
+ <ulink url="pg3.html">pg3, ipg, pgset</ulink>.
+ </para></listitem>
+</itemizedlist>
+</sect1>
+
+<sect1>
+<title>Historical notes</title>
+
+<para>
+This package appeared as a desperate attempt to bring some life
+to state of basic networking applets: <command/ping/, <command/traceroute/
+etc. Though it was known that port of BSD <command/ping/ to Linux
+was basically broken, neither maintainers of well known (and superb)
+Linux net-tools package nor maintainers of Linux distributions
+worried about fixing well known bugs, which were reported in linux-kernel
+and linux-net mail lists for ages, were identified and nevertheless
+not repaired. So, one day 1001th resuming of the subject happened
+to be the last straw to break camel's back, I just parsed my hard disks
+and collected a set of utilities, which shared the following properties:
+</para>
+
+<itemizedlist>
+ <listitem><para>
+Small
+ </para></listitem>
+ <listitem><para>
+Useful despite of this
+ </para></listitem>
+ <listitem><para>
+I never seen it was made right
+ </para></listitem>
+ <listitem><para>
+Not quite trivial
+ </para></listitem>
+ <listitem><para>
+Demonstrating some important feature of Linux
+ </para></listitem>
+ <listitem><para>
+The last but not the least, I use it more or less regularly
+ </para></listitem>
+</itemizedlist>
+
+<para>
+This utility set was not supposed to be a reference set or something like
+that. Most of them were cloned from some originals:
+<informaltable>
+ <tgroup cols=2><tbody>
+ <row>
+ <entry>ping</entry>
+ <entry>cloned of an ancient NetTools-B-xx</entry>
+ </row>
+ <row>
+ <entry>ping6</entry>
+ <entry>cloned of a very old Pedro's utility set</entry>
+ </row>
+ <row>
+ <entry>traceroute6</entry>
+ <entry>cloned of NRL Sep 96 distribution</entry>
+ </row>
+ <row>
+ <entry>rdisc</entry>
+ <entry>cloned of SUN in.rdisc</entry>
+ </row>
+ <row>
+ <entry>clockdiff</entry>
+ <entry>broken out of some BSD timed</entry>
+ </row>
+ <row>
+ <entry>tftpd</entry>
+ <entry>it is clone of some ancient NetKit package</entry>
+ </row>
+ </tbody></tgroup>
+</informaltable>
+</para>
+
+<para>
+Also I added some utilities written from scratch, namely
+<command/tracepath/, <command/arping/ and later <command/rarpd/
+(the last one does not satisfy all the criteria, I used it two or three
+times).
+</para>
+
+<para>
+Hesitated a bit I overcame temptation to add <command/traceroute/.
+The variant released by LBNL to that time was mostly sane and bugs
+in it were mostly not specific to Linux, but main reason was that
+the latest version of LBNL <command/traceroute/ was not
+<emphasis/small/, it consisted of several files,
+used a wicked (and failing with Linux :-)) autoconfiguration etc.
+So, instead I assembled to iputils a simplistic <command/tracepath/ utility
+and IPv6 version of traceroute, and published my
+<ulink url="ftp://ftp.inr.ac.ru/ip-routing/lbl-tools"> patches</ulink>.
+to LBNL <command/traceroute/ separately.<footnote><para>This was mistake.
+Due to this <command/traceroute/ was in a sad state until recently.
+Good news, redhat-7.2 seems to add these patches to their traceroute
+rpm eventually. So, I think I will refrain of suicide for awhile.
+</para></footnote>
+</para>
+
+</sect1>
+
+<sect1>
+<title>Installation notes</title>
+<para>
+<userinput/make/ to compile utilities. <userinput/make html/ to prepare
+html documentation, <userinput/make man/ if you prefer man pages.
+Nothing fancy, provided you have DocBook package installed.
+</para>
+
+<para>
+<userinput/make install/ installs <emphasis/only/ HTML documentation
+to <filename>/usr/doc/iputils</filename>. It even does not try
+to install binaries and man pages. If you read historical
+notes above, the reason should be evident. Most of utilities
+intersect with utilities distributed in another packages, and
+making such target rewriting existing installation would be a crime
+from my side. The decision what variant of <command/ping/ is preferred,
+how to resolve the conflicts etc. is left to you or to person who
+assembled an rpm. I vote for variant from <command/iputils/ of course.
+</para>
+
+<para>
+Anyway, select utilities which you like and install them to the places
+which you prefer together with their man pages.
+</para>
+
+
+<para>
+It is possible that compilation will fail, if you use some
+funny Linux distribution mangling header files in some unexpected ways
+(expected ones are the ways of redhat of course :-)).
+I validate iputils against <ulink url="http://www.asplinux.ru">asplinux</ulink>
+distribution, which is inevitably followed by validity with respect
+to <ulink url="http://www.redhat.com">redhat</ulink>.
+If your distribution is one of widely known ones, suse or debian,
+it also will compile provided snapshot is elder than month or so and
+someone reported all the problems, if they took place at all.
+</para>
+
+<para>
+<emphasis>
+Anyway, please, do not abuse me complaining about some compilation problems
+in any distribution different of asplinux or redhat.
+If you have a fix, please, send it to
+<ulink url="mailto:kuznet@ms2.inr.ac.ru">me</ulink>,
+I will check that it does not break distributions mentioned above
+and apply it. But I am not going to undertake any investigations,
+bare reports are deemed to be routed to <filename>/dev/null</filename>.
+</emphasis>
+</para>
+
+</sect1>
+
+<sect1><title>Availability</title>
+
+<para>
+The collection of documents is part of <filename/iputils/ package
+and the latest versions are available in source form at
+<ulink url="http://www.skbuff.net/iputils/iputils-current.tar.bz2">
+http://www.skbuff.net/iputils/iputils-current.tar.bz2</ulink>.
+</para>
+</sect1>
+
+
+<sect1>
+<title>Copying</title>
+<para>
+Different files are copyrighted by different persons and organizations
+and distributed under different licenses. For details look into corresponding
+source files.
+</para>
+</sect1>
+
+</article>
diff --git a/doc/ninfod.sgml b/doc/ninfod.sgml
new file mode 100644
index 0000000..1154a75
--- /dev/null
+++ b/doc/ninfod.sgml
@@ -0,0 +1,120 @@
+<refentry id="ninfod">
+
+<refmeta>
+<refentrytitle>ninfod</refentrytitle>
+<manvolnum>8</manvolnum>
+<refmiscinfo>iputils-&snapshot;</refmiscinfo>
+</refmeta>
+
+<refnamediv>
+<refname>ninfod</refname>
+<refpurpose>Respond to IPv6 Node Information Queries</refpurpose>
+</refnamediv>
+
+<refsynopsisdiv>
+<cmdsynopsis>
+<command>ninfod</command>
+<arg choice="opt"><option>-dhv</option></arg>
+<arg choice="opt">-p <replaceable/pidfile/</arg>
+<arg choice="opt">-u <replaceable/user/</arg>
+</cmdsynopsis>
+</refsynopsisdiv>
+
+<refsect1><title>DESCRIPTION</title>
+<para>
+Responds to <ulink url="http://tools.ietf.org/rfc/rfc4620.txt">IPv6 Node Information Queries (RFC4620)</ulink> from clients.
+Queries can be sent by various implementations of <command/ping6/ command.
+</para>
+</refsect1>
+
+<refsect1><title>OPTIONS</title>
+
+<variablelist>
+
+ <varlistentry>
+ <term><option/-a/</term>
+ <listitem><para>
+Debug mode. Do not go background.
+ </para></listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option/-h/</term>
+ <listitem><para>
+Show help.
+ </para></listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option/-v/</term>
+ <listitem><para>
+Verbose mode.
+ </para></listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option>-u <replaceable/user/</option></term>
+ <listitem><para>
+Run as another user.
+<replaceable/user/ can either be username or user ID.
+ </para></listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option>-p <replaceable/pidfile/</option></term>
+ <listitem><para>
+File for process-id storage.
+<replaceable/user/ is required to be able to create the file.
+ </para></listitem>
+ </varlistentry>
+</variablelist>
+</refsect1>
+
+<refsect1><title>SEE ALSO</title>
+<para>
+<link linkend="ping">
+<citerefentry><refentrytitle/ping/<manvolnum/8/</citerefentry></link>.
+</para>
+</refsect1>
+
+<refsect1><title>AUTHOR</title>
+<para>
+<command/ninfod/ was written by USAGI/WIDE Project.
+</para>
+</refsect1>
+
+<refsect1><title>COPYING</title>
+<para>
+<literallayout>
+Copyright (C) 2012 YOSHIFUJI Hideaki.
+Copyright (C) 2002 USAGI/WIDE Project.
+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. Neither the name of the project 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 PROJECT 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 PROJECT 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.
+</literallayout>
+</para>
+</refsect1>
+
+</refentry>
diff --git a/doc/pg3.sgml b/doc/pg3.sgml
new file mode 100644
index 0000000..04c80fe
--- /dev/null
+++ b/doc/pg3.sgml
@@ -0,0 +1,175 @@
+<refentry id="pg3">
+
+<refmeta>
+<refentrytitle>pg3</refentrytitle>
+<manvolnum>8</manvolnum>
+<refmiscinfo>iputils-&snapshot;</refmiscinfo>
+</refmeta>
+
+
+<refnamediv>
+<refname>pg3, ipg, pgset</refname>
+<refpurpose>send stream of UDP packets</refpurpose>
+</refnamediv>
+
+<refsynopsisdiv>
+<cmdsynopsis>
+<command>source ipg</command>
+</cmdsynopsis>
+<cmdsynopsis>
+<command>pg</command>
+</cmdsynopsis>
+<cmdsynopsis>
+<command>pgset</command>
+<arg choice="req"><replaceable/COMMAND/</arg>
+</cmdsynopsis>
+</refsynopsisdiv>
+
+<refsect1><title>DESCRIPTION</title>
+<para>
+<command/ipg/ is not a program, it is script which should be sourced
+to <command/bash/. When sourced it loads module <filename/pg3/ and
+exports a few of functions accessible from parent shell. These macros
+are <command/pg/ to start packet injection and to get the results of run;
+and <command/pgset/ to setup packet generator.
+</para>
+
+<para>
+<command/pgset/ can send the following commands to module <filename/pg3/:
+</para>
+</refsect1>
+
+<refsect1><title>COMMAND</title>
+
+<variablelist>
+
+ <varlistentry>
+ <term><option>odev <replaceable/DEVICE/</option></term>
+ <listitem><para>
+Name of Ethernet device to test. See
+<link linkend="pg3.warning">warning</link> below.
+ </para></listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option>pkt_size <replaceable/BYTES/</option></term>
+ <listitem><para>
+Size of packet to generate. The size includes all the headers: UDP, IP,
+MAC, but does not account for overhead internal to medium, i.e. FCS
+and various paddings.
+ </para></listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option>frags <replaceable/NUMBER/</option></term>
+ <listitem><para>
+Each packet will contain <replaceable/NUMBER/ of fragments.
+Maximal amount for linux-2.4 is 6. Far not all the devices support
+fragmented buffers.
+ </para></listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option>count <replaceable/NUMBER/</option></term>
+ <listitem><para>
+Send stream of <replaceable/NUMBER/ of packets and stop after this.
+ </para></listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option>ipg <replaceable/TIME/</option></term>
+ <listitem><para>
+Introduce artificial delay between packets of <replaceable/TIME/
+microseconds.
+ </para></listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option>dst <replaceable/IP_ADDRESS/</option></term>
+ <listitem><para>
+Select IP destination where the stream is sent to.
+Beware, never set this address at random. <command/pg3/ is not a toy,
+it creates really tough stream. Default value is 0.0.0.0.
+ </para></listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option>dst <replaceable/MAC_ADDRESS/</option></term>
+ <listitem><para>
+Select MAC destination where the stream is sent to.
+Default value is 00:00:00:00:00:00 in hope that this will not be received
+by any node on LAN.
+ </para></listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option>stop</option></term>
+ <listitem><para>
+Abort packet injection.
+ </para></listitem>
+ </varlistentry>
+
+</variablelist>
+</refsect1>
+
+<refsect1 id="pg3.warning"><title>WARNING</title>
+<para>
+When output device is set to some random device different
+of hardware Ethernet device, <command/pg3/ will crash kernel.
+</para>
+<para>
+Do not use it on VLAN, ethertap, VTUN and other devices,
+which emulate Ethernet not being real Ethernet in fact.
+</para>
+</refsect1>
+
+<refsect1><title>AUTHOR</title>
+<para>
+<command/pg3/ was written by <ulink url="mailto:robert.olsson@its.uu.se">
+Robert Olsson &lt;robert.olsson@its.uu.se&gt;</ulink>.
+</para>
+</refsect1>
+
+<refsect1><title>SECURITY</title>
+<para>
+This can be used only by superuser.
+</para>
+<para>
+This tool creates floods of packets which is unlikely to be handled
+even by high-end machines. For example, it saturates gigabit link with
+60 byte packets when used with Intel's e1000. In face of such stream
+switches, routers and end hosts may deadlock, crash, explode.
+Use only in test lab environment.
+</para>
+</refsect1>
+
+<refsect1><title>AVAILABILITY</title>
+<para>
+<command/pg3/ is part of <filename/iputils/ package
+and the latest versions are available in source form at
+<ulink url="http://www.skbuff.net/iputils/iputils-current.tar.bz2">
+http://www.skbuff.net/iputils/iputils-current.tar.bz2</ulink>.
+</para>
+</refsect1>
+
+<![IGNORE[
+<refsect1><title>COPYING</title>
+<para>
+<literallayout>
+This documentation is free software; you can redistribute
+it and/or modify it under the terms of the GNU General Public
+License Version 2.
+
+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.
+
+For more details see the file COPYING in the source
+distribution of Linux kernel of version 2.4.
+</literallayout>
+</para>
+</refsect1>
+]]>
+
+</refentry>
diff --git a/doc/ping.sgml b/doc/ping.sgml
new file mode 100644
index 0000000..f77276b
--- /dev/null
+++ b/doc/ping.sgml
@@ -0,0 +1,683 @@
+<refentry id="ping">
+
+<refmeta>
+<refentrytitle>ping</refentrytitle>
+<manvolnum>8</manvolnum>
+<refmiscinfo>iputils-&snapshot;</refmiscinfo>
+</refmeta>
+
+<refnamediv>
+<refname>ping, ping6</refname>
+<refpurpose>send ICMP ECHO_REQUEST to network hosts</refpurpose>
+</refnamediv>
+
+<refsynopsisdiv>
+<cmdsynopsis>
+<command>ping</command>
+<arg choice="opt"><option>-aAbBdDfhLnOqrRUvV</option></arg>
+<arg choice="opt">-c <replaceable/count/</arg>
+<arg choice="opt">-F <replaceable/flowlabel/</arg>
+<arg choice="opt">-i <replaceable/interval/</arg>
+<arg choice="opt">-I <replaceable/interface/</arg>
+<arg choice="opt">-l <replaceable/preload/</arg>
+<arg choice="opt">-m <replaceable/mark/</arg>
+<arg choice="opt">-M <replaceable/pmtudisc_option/</arg>
+<arg choice="opt">-N <replaceable/nodeinfo_option/</arg>
+<arg choice="opt">-w <replaceable/deadline/</arg>
+<arg choice="opt">-W <replaceable/timeout/</arg>
+<arg choice="opt">-p <replaceable/pattern/</arg>
+<arg choice="opt">-Q <replaceable/tos/</arg>
+<arg choice="opt">-s <replaceable/packetsize/</arg>
+<arg choice="opt">-S <replaceable/sndbuf/</arg>
+<arg choice="opt">-t <replaceable/ttl/</arg>
+<arg choice="opt">-T <replaceable/timestamp option/</arg>
+<arg choice="opt" rep="repeat"><replaceable/hop/</arg>
+<arg choice="req"><replaceable/destination/</arg>
+</cmdsynopsis>
+</refsynopsisdiv>
+
+<refsect1><title>DESCRIPTION</title>
+<para>
+<command/ping/ uses the ICMP protocol's mandatory ECHO_REQUEST
+datagram to elicit an ICMP ECHO_RESPONSE from a host or gateway.
+ECHO_REQUEST datagrams (``pings'') have an IP and ICMP
+header, followed by a <structname/struct timeval/ and then an arbitrary
+number of ``pad'' bytes used to fill out the packet.
+</para>
+<para>
+<command/ping6/ is IPv6 version of <command/ping/, and can also send Node Information Queries (RFC4620).
+Intermediate <replaceable/hop/s may not be allowed, because IPv6 source routing was deprecated (RFC5095).
+</para>
+</refsect1>
+
+<refsect1><title>OPTIONS</title>
+
+<variablelist>
+ <varlistentry>
+ <term><option/-a/</term>
+ <listitem><para>
+Audible ping.
+ </para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option/-A/</term>
+ <listitem><para>
+Adaptive ping. Interpacket interval adapts to round-trip time, so that
+effectively not more than one (or more, if preload is set) unanswered probe
+is present in the network. Minimal interval is 200msec for not super-user.
+On networks with low rtt this mode is essentially equivalent to flood mode.
+ </para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option/-b/</term>
+ <listitem><para>
+Allow pinging a broadcast address.
+ </para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option/-B/</term>
+ <listitem><para>
+Do not allow <command/ping/ to change source address of probes.
+The address is bound to one selected when <command/ping/ starts.
+ </para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option><anchor id="ping.count">-c <replaceable/count/</option></term>
+ <listitem><para>
+Stop after sending <replaceable/count/ ECHO_REQUEST
+packets. With
+<link linkend="ping.deadline"><replaceable/deadline/</link>
+option, <command/ping/ waits for
+<replaceable/count/ ECHO_REPLY packets, until the timeout expires.
+ </para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option/-d/</term>
+ <listitem><para>
+Set the <constant/SO_DEBUG/ option on the socket being used.
+Essentially, this socket option is not used by Linux kernel.
+ </para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option/-D/</term>
+ <listitem><para>
+Print timestamp (unix time + microseconds as in gettimeofday) before
+each line.
+ </para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option/-f/</term>
+ <listitem><para>
+Flood ping. For every ECHO_REQUEST sent a period ``.'' is printed,
+while for ever ECHO_REPLY received a backspace is printed.
+This provides a rapid display of how many packets are being dropped.
+If interval is not given, it sets interval to zero and
+outputs packets as fast as they come back or one hundred times per second,
+whichever is more.
+Only the super-user may use this option with zero interval.
+ </para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>-F <replaceable/flow label/</option></term>
+ <listitem><para>
+<command/ping6/ only.
+Allocate and set 20 bit flow label (in hex) on echo request packets.
+If value is zero, kernel allocates random flow label.
+ </para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option/-h/</term>
+ <listitem><para>
+Show help.
+ </para></listitem>
+ <varlistentry>
+ <term><option>-i <replaceable/interval/</option></term>
+ <listitem><para>
+Wait <replaceable/interval/ seconds between sending each packet.
+The default is to wait for one second between each packet normally,
+or not to wait in flood mode. Only super-user may set interval
+to values less 0.2 seconds.
+ </para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>-I <replaceable/interface address/</option></term>
+ <listitem><para>
+Set source address to specified interface address. Argument
+may be numeric IP address or name of device. When pinging IPv6
+link-local address this option is required.
+ </para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>-l <replaceable/preload/</option></term>
+ <listitem><para>
+If <replaceable/preload/ is specified,
+<command/ping/ sends that many packets not waiting for reply.
+Only the super-user may select preload more than 3.
+ </para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option/-L/</term>
+ <listitem><para>
+Suppress loopback of multicast packets. This flag only applies if the ping
+destination is a multicast address.
+ </para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>-m <replaceable/mark/</option></term>
+ <listitem><para>
+use <replaceable/mark/ to tag the packets going out. This is useful
+for variety of reasons within the kernel such as using policy
+routing to select specific outbound processing.
+ </para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>-M <replaceable/pmtudisc_opt/</option></term>
+ <listitem><para>
+Select Path MTU Discovery strategy.
+<replaceable/pmtudisc_option/ may be either <replaceable/do/
+(prohibit fragmentation, even local one),
+<replaceable/want/ (do PMTU discovery, fragment locally when packet size
+is large), or <replaceable/dont/ (do not set DF flag).
+ </para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>-N <replaceable/nodeinfo_option/</option></term>
+ <listitem><para>
+<command/ping6/ only.
+Send ICMPv6 Node Information Queries (RFC4620), instead of Echo Request.
+ <variablelist>
+ <varlistentry>
+ <term><option>help</option></term>
+ <listitem><para>Show help for NI support.</para></listitem>
+ </varlistentry>
+ </variablelist>
+ <variablelist>
+ <varlistentry>
+ <term><option>name</option></term>
+ <listitem><para>Queries for Node Names.</para></listitem>
+ </varlistentry>
+ </variablelist>
+ <variablelist>
+ <varlistentry>
+ <term><option>ipv6</option></term>
+ <listitem><para>Queries for IPv6 Addresses. There are several IPv6 specific flags.
+ <variablelist>
+ <varlistentry>
+ <term><option>ipv6-global</option></term>
+ <listitem><para>Request IPv6 global-scope addresses.</para></listitem>
+ </varlistentry>
+ </variablelist>
+ <variablelist>
+ <varlistentry>
+ <term><option>ipv6-sitelocal</option></term>
+ <listitem><para>Request IPv6 site-local addresses.</para></listitem>
+ </varlistentry>
+ </variablelist>
+ <variablelist>
+ <varlistentry>
+ <term><option>ipv6-linklocal</option></term>
+ <listitem><para>Request IPv6 link-local addresses.</para></listitem>
+ </varlistentry>
+ </variablelist>
+ <variablelist>
+ <varlistentry>
+ <term><option>ipv6-all</option></term>
+ <listitem><para>Request IPv6 addresses on other interfaces.</para></listitem>
+ </varlistentry>
+ </variablelist>
+ </para></listitem>
+ </varlistentry>
+ </variablelist>
+ <variablelist>
+ <varlistentry>
+ <term><option>ipv4</option></term>
+ <listitem><para>Queries for IPv4 Addresses. There is one IPv4 specific flag.
+ <variablelist>
+ <varlistentry>
+ <term><option>ipv4-all</option></term>
+ <listitem><para>Request IPv4 addresses on other interfaces.</para></listitem>
+ </varlistentry>
+ </variablelist>
+ </para></listitem>
+ </varlistentry>
+ </variablelist>
+ <variablelist>
+ <varlistentry>
+ <term><option>subject-ipv6=<replaceable/ipv6addr/</option></term>
+ <listitem><para>IPv6 subject address.</para></listitem>
+ </varlistentry>
+ </variablelist>
+ <variablelist>
+ <varlistentry>
+ <term><option>subject-ipv4=<replaceable/ipv4addr/</option></term>
+ <listitem><para>IPv4 subject address.</para></listitem>
+ </varlistentry>
+ </variablelist>
+ <variablelist>
+ <varlistentry>
+ <term><option>subject-name=<replaceable/nodename/</option></term>
+ <listitem><para>Subject name. If it contains more than one dot,
+ fully-qualified domain name is assumed.</para></listitem>
+ </varlistentry>
+ </variablelist>
+ <variablelist>
+ <varlistentry>
+ <term><option>subject-fqdn=<replaceable/nodename/</option></term>
+ <listitem><para>Subject name. Fully-qualified domain name is
+ always assumed.</para></listitem>
+ </varlistentry>
+ </variablelist>
+ </para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option/-n/</term>
+ <listitem><para>
+Numeric output only.
+No attempt will be made to lookup symbolic names for host addresses.
+ </para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option/-O/</term>
+ <listitem><para>
+Report outstanding ICMP ECHO reply before sending next packet.
+This is useful together with the timestamp <option>-D</option> to
+log output to a diagnostic file and search for missing answers.
+ </para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>-p <replaceable/pattern/</option></term>
+ <listitem><para>
+You may specify up to 16 ``pad'' bytes to fill out the packet you send.
+This is useful for diagnosing data-dependent problems in a network.
+For example, <option>-p ff</option> will cause the sent packet
+to be filled with all ones.
+ </para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option/-q/</term>
+ <listitem><para>
+Quiet output.
+Nothing is displayed except the summary lines at startup time and
+when finished.
+ </para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>-Q <replaceable/tos/</option></term>
+ <listitem><para>
+ Set Quality of Service -related bits in ICMP datagrams.
+ <replaceable/tos/ can be decimal (<command/ping/ only) or hex number.
+ </para>
+ <para>
+ In RFC2474, these fields are interpreted as 8-bit Differentiated
+ Services (DS), consisting of: bits 0-1 (2 lowest bits) of separate
+ data, and bits 2-7 (highest 6 bits) of Differentiated Services
+ Codepoint (DSCP). In RFC2481 and RFC3168, bits 0-1 are used for ECN.
+ </para>
+ <para>
+ Historically (RFC1349, obsoleted by RFC2474), these were interpreted
+ as: bit 0 (lowest bit) for reserved (currently being redefined as
+ congestion control), 1-4 for Type of Service and bits 5-7
+ (highest bits) for Precedence.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option/-r/</term>
+ <listitem><para>
+Bypass the normal routing tables and send directly to a host on an attached
+interface.
+If the host is not on a directly-attached network, an error is returned.
+This option can be used to ping a local host through an interface
+that has no route through it provided the option <option/-I/ is also
+used.
+ </para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option/-R/</term>
+ <listitem><para>
+<command/ping/ only.
+Record route.
+Includes the RECORD_ROUTE option in the ECHO_REQUEST
+packet and displays the route buffer on returned packets.
+Note that the IP header is only large enough for nine such routes.
+Many hosts ignore or discard this option.
+ </para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>-s <replaceable/packetsize/</option></term>
+ <listitem><para>
+Specifies the number of data bytes to be sent.
+The default is 56, which translates into 64 ICMP
+data bytes when combined with the 8 bytes of ICMP header data.
+ </para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>-S <replaceable/sndbuf/</option></term>
+ <listitem><para>
+Set socket sndbuf. If not specified, it is selected to buffer
+not more than one packet.
+ </para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>-t <replaceable/ttl/</option></term>
+ <listitem><para>
+<command/ping/ only.
+Set the IP Time to Live.
+ </para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>-T <replaceable/timestamp option/</option></term>
+ <listitem><para>
+Set special IP timestamp options.
+<replaceable/timestamp option/ may be either
+<replaceable/tsonly/ (only timestamps),
+<replaceable/tsandaddr/ (timestamps and addresses) or
+<replaceable/tsprespec host1 [host2 [host3 [host4]]]/
+(timestamp prespecified hops).
+ </para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option/-U/</term>
+ <listitem><para>
+Print full user-to-user latency (the old behaviour). Normally
+<command/ping/
+prints network round trip time, which can be different
+f.e. due to DNS failures.
+ </para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option/-v/</term>
+ <listitem><para>
+Verbose output.
+ </para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option/-V/</term>
+ <listitem><para>
+Show version and exit.
+ </para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option><anchor id="ping.deadline">-w <replaceable/deadline/</option></term>
+ <listitem><para>
+Specify a timeout, in seconds, before
+<command/ping/
+exits regardless of how many
+packets have been sent or received. In this case
+<command/ping/
+does not stop after
+<link linkend="ping.count"><replaceable/count/</link>
+packet are sent, it waits either for
+<link linkend="ping.deadline"><replaceable/deadline/</link>
+expire or until
+<link linkend="ping.count"><replaceable/count/</link>
+probes are answered or for some error notification from network.
+ </para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>-W <replaceable/timeout/</option></term>
+ <listitem><para>
+Time to wait for a response, in seconds. The option affects only timeout
+in absence of any responses, otherwise <command/ping/ waits for two RTTs.
+ </para></listitem>
+ </varlistentry>
+</variablelist>
+
+<para>
+When using <command/ping/ for fault isolation, it should first be run
+on the local host, to verify that the local network interface is up
+and running. Then, hosts and gateways further and further away should be
+``pinged''. Round-trip times and packet loss statistics are computed.
+If duplicate packets are received, they are not included in the packet
+loss calculation, although the round trip time of these packets is used
+in calculating the minimum/average/maximum round-trip time numbers.
+When the specified number of packets have been sent (and received) or
+if the program is terminated with a
+<constant/SIGINT/, a brief summary is displayed. Shorter current statistics
+can be obtained without termination of process with signal
+<constant/SIGQUIT/.
+</para>
+
+<para>
+If <command/ping/ does not receive any reply packets at all it will
+exit with code 1. If a packet
+<link linkend="ping.count"><replaceable/count/</link>
+and
+<link linkend="ping.deadline"><replaceable/deadline/</link>
+are both specified, and fewer than
+<link linkend="ping.count"><replaceable/count/</link>
+packets are received by the time the
+<link linkend="ping.deadline"><replaceable/deadline/</link>
+has arrived, it will also exit with code 1.
+On other error it exits with code 2. Otherwise it exits with code 0. This
+makes it possible to use the exit code to see if a host is alive or
+not.
+</para>
+
+
+<para>
+This program is intended for use in network testing, measurement and
+management.
+Because of the load it can impose on the network, it is unwise to use
+<command/ping/ during normal operations or from automated scripts.
+</para>
+
+</refsect1>
+
+
+<refsect1><title>ICMP PACKET DETAILS</title>
+
+<para>
+An IP header without options is 20 bytes.
+An ICMP ECHO_REQUEST packet contains an additional 8 bytes worth
+of ICMP header followed by an arbitrary amount of data.
+When a <replaceable/packetsize/ is given, this indicated the size of this
+extra piece of data (the default is 56). Thus the amount of data received
+inside of an IP packet of type ICMP ECHO_REPLY will always be 8 bytes
+more than the requested data space (the ICMP header).
+</para>
+
+<para>
+If the data space is at least of size of <structname/struct timeval/
+<command/ping/ uses the beginning bytes of this space to include
+a timestamp which it uses in the computation of round trip times.
+If the data space is shorter, no round trip times are given.
+</para>
+
+</refsect1>
+
+<refsect1><title>DUPLICATE AND DAMAGED PACKETS</title>
+
+<para>
+<command/ping/ will report duplicate and damaged packets.
+Duplicate packets should never occur, and seem to be caused by
+inappropriate link-level retransmissions.
+Duplicates may occur in many situations and are rarely (if ever) a
+good sign, although the presence of low levels of duplicates may not
+always be cause for alarm.
+</para>
+
+<para>
+Damaged packets are obviously serious cause for alarm and often
+indicate broken hardware somewhere in the
+<command/ping/ packet's path (in the network or in the hosts).
+</para>
+
+</refsect1>
+
+<refsect1><title>TRYING DIFFERENT DATA PATTERNS</title>
+
+<para>
+The (inter)network layer should never treat packets differently depending
+on the data contained in the data portion.
+Unfortunately, data-dependent problems have been known to sneak into
+networks and remain undetected for long periods of time.
+In many cases the particular pattern that will have problems is something
+that doesn't have sufficient ``transitions'', such as all ones or all
+zeros, or a pattern right at the edge, such as almost all zeros.
+It isn't necessarily enough to specify a data pattern of all zeros (for
+example) on the command line because the pattern that is of interest is
+at the data link level, and the relationship between what you type and
+what the controllers transmit can be complicated.
+</para>
+
+<para>
+This means that if you have a data-dependent problem you will probably
+have to do a lot of testing to find it.
+If you are lucky, you may manage to find a file that either can't be sent
+across your network or that takes much longer to transfer than other
+similar length files.
+You can then examine this file for repeated patterns that you can test
+using the <option/-p/ option of <command/ping/.
+</para>
+
+</refsect1>
+
+<refsect1><title>TTL DETAILS</title>
+
+<para>
+The TTL value of an IP packet represents the maximum number of IP routers
+that the packet can go through before being thrown away.
+In current practice you can expect each router in the Internet to decrement
+the TTL field by exactly one.
+</para>
+
+<para>
+The TCP/IP specification states that the TTL field for TCP
+packets should be set to 60, but many systems use smaller values
+(4.3 BSD uses 30, 4.2 used 15).
+</para>
+
+<para>
+The maximum possible value of this field is 255, and most Unix systems set
+the TTL field of ICMP ECHO_REQUEST packets to 255.
+This is why you will find you can ``ping'' some hosts, but not reach them
+with
+<citerefentry><refentrytitle/telnet/<manvolnum/1/</citerefentry>
+or
+<citerefentry><refentrytitle/ftp/<manvolnum/1/</citerefentry>.
+</para>
+
+<para>
+In normal operation ping prints the TTL value from the packet it receives.
+When a remote system receives a ping packet, it can do one of three things
+with the TTL field in its response:
+</para>
+
+<itemizedlist>
+ <listitem><para>
+Not change it; this is what Berkeley Unix systems did before the
+4.3BSD Tahoe release. In this case the TTL value in the received packet
+will be 255 minus the number of routers in the round-trip path.
+ </para></listitem>
+ <listitem><para>
+Set it to 255; this is what current Berkeley Unix systems do.
+In this case the TTL value in the received packet will be 255 minus the
+number of routers in the path <emphasis/from/
+the remote system <emphasis/to/ the <command/ping/ing host.
+ </para></listitem>
+ <listitem><para>
+Set it to some other value. Some machines use the same value for
+ICMP packets that they use for TCP packets, for example either 30 or 60.
+Others may use completely wild values.
+ </para></listitem>
+</itemizedlist>
+
+</refsect1>
+
+<refsect1><title>BUGS</title>
+
+<itemizedlist>
+ <listitem><para>
+Many Hosts and Gateways ignore the RECORD_ROUTE option.
+ </para></listitem>
+ <listitem><para>
+The maximum IP header length is too small for options like
+RECORD_ROUTE to be completely useful.
+There's not much that that can be done about this, however.
+ </para></listitem>
+ <listitem><para>
+Flood pinging is not recommended in general, and flood pinging the
+broadcast address should only be done under very controlled conditions.
+ </para></listitem>
+</itemizedlist>
+
+</refsect1>
+
+<refsect1><title>SEE ALSO</title>
+<para>
+<citerefentry><refentrytitle/netstat/<manvolnum/1/</citerefentry>,
+<citerefentry><refentrytitle/ifconfig/<manvolnum/8/</citerefentry>.
+</para>
+</refsect1>
+
+<refsect1><title>HISTORY</title>
+<para>
+The <command/ping/ command appeared in 4.3BSD.
+</para>
+<para>
+The version described here is its descendant specific to Linux.
+</para>
+</refsect1>
+
+<refsect1><title>SECURITY</title>
+<para>
+<command/ping/ requires <constant/CAP_NET_RAW/ capability
+to be executed. It may be used as set-uid root.
+</para>
+</refsect1>
+
+<refsect1><title>AVAILABILITY</title>
+<para>
+<command/ping/ is part of <filename/iputils/ package
+and the latest versions are available in source form at
+<ulink url="http://www.skbuff.net/iputils/iputils-current.tar.bz2">
+http://www.skbuff.net/iputils/iputils-current.tar.bz2</ulink>.
+</para>
+</refsect1>
+
+<![IGNORE[
+<refsect1><title>COPYING</title>
+<para>
+<literallayout>
+Copyright (c) 1989 The Regents of the University of California.
+All rights reserved.
+
+This code is derived from software contributed to Berkeley by
+Mike Muuss.
+
+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.
+</literallayout>
+</para>
+</refsect1>
+]]>
+
+
+</refentry>
+
diff --git a/doc/rarpd.sgml b/doc/rarpd.sgml
new file mode 100644
index 0000000..9f86ef0
--- /dev/null
+++ b/doc/rarpd.sgml
@@ -0,0 +1,170 @@
+<refentry id="rarpd">
+
+<refmeta>
+<refentrytitle>rarpd</refentrytitle>
+<manvolnum>8</manvolnum>
+<refmiscinfo>iputils-&snapshot;</refmiscinfo>
+</refmeta>
+
+<refnamediv>
+<refname>rarpd</refname>
+<refpurpose>answer RARP REQUESTs</refpurpose>
+</refnamediv>
+
+<refsynopsisdiv>
+<cmdsynopsis>
+<command>arping</command>
+<arg choice="opt"><option>-aAvde</option></arg>
+<arg choice="opt">-b <replaceable/bootdir/</arg>
+<arg choice="opt"><replaceable/interface/</arg>
+</cmdsynopsis>
+</refsynopsisdiv>
+
+<refsect1><title>DESCRIPTION</title>
+<para>
+Listens
+<ulink url="http://tools.ietf.org/rfc/rfc903.txt">RARP</ulink>
+requests from clients. Provided MAC address of client
+is found in <filename>/etc/ethers</filename> database and
+obtained host name is resolvable to an IP address appropriate
+for attached network, <command/rarpd/ answers to client with RARPD
+reply carrying an IP address.
+</para>
+<para>
+To allow multiple boot servers on the network <command/rarpd/
+optionally checks for presence Sun-like bootable image in TFTP directory.
+It should have form <userinput/Hexadecimal_IP.ARCH/, f.e. to load
+sparc 193.233.7.98 <filename/C1E90762.SUN4M/ is linked to
+an image appropriate for SUM4M in directory <filename>/etc/tftpboot</filename>.
+</para>
+</refsect1>
+
+<refsect1><title>WARNING</title>
+<para>
+This facility is deeply obsoleted by
+<ulink url="http://tools.ietf.org/rfc/rfc951.txt">BOOTP</ulink>
+and later
+<ulink url="http://tools.ietf.org/rfc/rfc2131.txt">DHCP</ulink> protocols.
+However, some clients really still need this to boot.
+</para>
+</refsect1>
+
+
+<refsect1><title>OPTIONS</title>
+
+<variablelist>
+
+ <varlistentry>
+ <term><option/-a/</term>
+ <listitem><para>
+Listen on all the interfaces. Currently it is an internal
+option, its function is overridden with <replaceable/interface/
+argument. It should not be used.
+ </para></listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option/-A/</term>
+ <listitem><para>
+Listen not only RARP but also ARP messages, some rare clients
+use ARP by some unknown reason.
+ </para></listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option/-v/</term>
+ <listitem><para>
+Be verbose.
+ </para></listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option/-d/</term>
+ <listitem><para>
+Debug mode. Do not go to background.
+ </para></listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option/-e/</term>
+ <listitem><para>
+Do not check for presence of a boot image, reply if MAC address
+resolves to a valid IP address using <filename>/etc/ethers</filename>
+database and DNS.
+ </para></listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option>-b <replaceable/bootdir/</option></term>
+ <listitem><para>
+TFTP boot directory. Default is <filename>/etc/tftpboot</filename>
+ </para></listitem>
+ </varlistentry>
+</variablelist>
+</refsect1>
+
+<refsect1><title>SEE ALSO</title>
+<para>
+<link linkend="arping">
+<citerefentry><refentrytitle/arping/<manvolnum/8/</citerefentry></link>,
+<link linkend="tftpd">
+<citerefentry><refentrytitle/tftpd/<manvolnum/8/</citerefentry></link>.
+</para>
+</refsect1>
+
+<refsect1><title>AUTHOR</title>
+<para>
+<command/rarpd/ was written by
+<ulink url="mailto:kuznet@ms2.inr.ac.ru">Alexey Kuznetsov
+&lt;kuznet@ms2.inr.ac.ru&gt;</ulink>.
+It is now maintained by
+<ulink url="mailto:yoshfuji@skbuff.net">YOSHIFUJI Hideaki
+&lt;yoshfuji@skbuff.net&gt;</ulink>.
+</para>
+</refsect1>
+
+<refsect1><title>SECURITY</title>
+<para>
+<command/rarpd/ requires <constant/CAP_NET_RAW/ capability
+to listen and send RARP and ARP packets. It also needs <constant/CAP_NET_ADMIN/
+to give to kernel hint for ARP resolution; this is not strictly required,
+but some (most of, to be more exact) clients are so badly broken that
+are not able to answer ARP before they are finally booted. This is
+not wonderful taking into account that clients using RARPD in 2002
+are all unsupported relic creatures of 90's and even earlier.
+</para>
+</refsect1>
+
+<refsect1><title>AVAILABILITY</title>
+<para>
+<command/rarpd/ is part of <filename/iputils/ package
+and the latest versions are available in source form at
+<ulink url="http://www.skbuff.net/iputils/iputils-current.tar.bz2">
+http://www.skbuff.net/iputils/iputils-current.tar.bz2</ulink>.
+</para>
+</refsect1>
+
+<![IGNORE[
+<refsect1><title>COPYING</title>
+<para>
+<literallayout>
+This documentation is free software; you can redistribute
+it and/or modify it under the terms of the GNU General Public
+License Version 2.
+
+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.
+
+For more details see the file COPYING in the source
+distribution of Linux kernel of version 2.4.
+</literallayout>
+</para>
+</refsect1>
+]]>
+
+
+
+
+</refentry>
diff --git a/doc/rdisc.sgml b/doc/rdisc.sgml
new file mode 100644
index 0000000..f991cb9
--- /dev/null
+++ b/doc/rdisc.sgml
@@ -0,0 +1,246 @@
+<refentry id="rdisc">
+
+<refmeta>
+<refentrytitle>rdisc</refentrytitle>
+<manvolnum>8</manvolnum>
+<refmiscinfo>iputils-&snapshot;</refmiscinfo>
+</refmeta>
+
+<refnamediv>
+<refname>rdisc</refname>
+<refpurpose>network router discovery daemon</refpurpose>
+</refnamediv>
+
+<refsynopsisdiv>
+<cmdsynopsis>
+<command>rdisc</command>
+<arg choice="opt"><option>-abdfrstvV</option></arg>
+<arg choice="opt">-p <replaceable/preference/</arg>
+<arg choice="opt">-T <replaceable/max_interval/</arg>
+<arg choice="opt"><replaceable/send_address/</arg>
+<arg choice="opt"><replaceable/receive_address/</arg>
+</cmdsynopsis>
+</refsynopsisdiv>
+
+<refsect1><title>DESCRIPTION</title>
+<para>
+<command/rdisc/ implements client side of the ICMP router discover protocol.
+<command/rdisc/ is invoked at boot time to populate the network
+routing tables with default routes.
+</para>
+
+<para>
+<command/rdisc/ listens on the ALL_HOSTS (224.0.0.1) multicast address
+(or <replaceable/receive_address/ provided it is given)
+for ROUTER_ADVERTISE messages from routers. The received
+messages are handled by first ignoring those listed router addresses
+with which the host does not share a network. Among the remaining addresses
+the ones with the highest preference are selected as default routers
+and a default route is entered in the kernel routing table
+for each one of them.
+</para>
+
+<para>
+Optionally, <command/rdisc/ can avoid waiting for routers to announce
+themselves by sending out a few ROUTER_SOLICITATION messages
+to the ALL_ROUTERS (224.0.0.2) multicast address
+(or <replaceable/send_address/ provided it is given)
+when it is started.
+</para>
+
+<para>
+A timer is associated with each router address and the address will
+no longer be considered for inclusion in the the routing tables if the
+timer expires before a new
+<emphasis/advertise/ message is received from the router.
+The address will also be excluded from consideration if the host receives an
+<emphasis/advertise/
+message with the preference being maximally negative.
+</para>
+
+<para>
+Server side of router discovery protocol is supported by Cisco IOS
+and by any more or less complete UNIX routing daemon, f.e <command/gated/.
+Or, <command/rdisc/ can act as responder, if compiled with -DRDISC_SERVER.
+</para>
+
+</refsect1>
+
+<refsect1><title>OPTIONS</title>
+
+<variablelist>
+ <varlistentry>
+ <term><option/-a/</term>
+ <listitem><para>
+Accept all routers independently of the preference they have in their
+<emphasis/advertise/ messages.
+Normally <command/rdisc/ only accepts (and enters in the kernel routing
+tables) the router or routers with the highest preference.
+ </para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option/-b/</term>
+ <listitem><para>
+Opposite to <option/-a/, i.e. install only router with the best
+preference value. It is default behaviour.
+ </para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option/-d/</term>
+ <listitem><para>
+Send debugging messages to syslog.
+ </para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option/-f/</term>
+ <listitem><para>
+Run <command/rdisc/ forever even if no routers are found.
+Normally <command/rdisc/ gives up if it has not received any
+<emphasis/advertise/ message after after soliciting three times,
+in which case it exits with a non-zero exit code.
+If <option/-f/ is not specified in the first form then
+<option/-s/ must be specified.
+ </para></listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option/-r/</term>
+ <listitem><para>
+Responder mode, available only if compiled with -DRDISC_SERVER.
+ </para></listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option/-s/</term>
+ <listitem><para>
+Send three <emphasis/solicitation/ messages initially to quickly discover
+the routers when the system is booted.
+When <option/-s/ is specified <command/rdisc/
+exits with a non-zero exit code if it can not find any routers.
+This can be overridden with the <option/-f/ option.
+ </para></listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option>-p <replaceable/preference/</option></term>
+ <listitem><para>
+Set preference in advertisement.
+Available only with -r option.
+ </para></listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option>-T <replaceable/max_interval/</option></term>
+ <listitem><para>
+Set maximum advertisement interval in seconds. Default is 600 secs.
+Available only with -r option.
+ </para></listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option/-t/</term>
+ <listitem><para>
+Test mode. Do not go to background.
+ </para></listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option/-v/</term>
+ <listitem><para>
+Be verbose i.e. send lots of debugging messages to syslog.
+ </para></listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option/-V/</term>
+ <listitem><para>
+Print version and exit.
+ </para></listitem>
+ </varlistentry>
+</variablelist>
+</refsect1>
+
+<refsect1><title>HISTORY</title>
+<para>
+This program was developed by Sun Microsystems (see copyright
+notice in source file). It was ported to Linux by
+<ulink url="mailto:kuznet@ms2.inr.ac.ru">Alexey Kuznetsov
+&lt;kuznet@ms2.inr.ac.ru&gt;</ulink>.
+It is now maintained by
+<ulink url="mailto:yoshfuji@skbuff.net">YOSHIFUJI Hideaki
+&lt;yoshfuji@skbuff.net&gt;</ulink>.
+</para>
+</refsect1>
+
+
+<refsect1><title>SEE ALSO</title>
+<para>
+<citerefentry><refentrytitle/icmp/<manvolnum/7/</citerefentry>,
+<citerefentry><refentrytitle/inet/<manvolnum/7/</citerefentry>,
+<link linkend="ping">
+<citerefentry><refentrytitle/ping/<manvolnum/8/</citerefentry></link>.
+</para>
+</refsect1>
+
+<refsect1><title>REFERENCES</title>
+<para>
+Deering, S.E.,ed "ICMP Router Discovery Messages",
+<ulink url="http://tools.ietf.org/rfc/rfc1256.txt">
+RFC1256</ulink>, Network Information Center, SRI International,
+Menlo Park, Calif., September 1991.
+</para>
+</refsect1>
+
+<refsect1><title>SECURITY</title>
+<para>
+<command/rdisc/ requires <constant/CAP_NET_RAW/ to listen
+and send ICMP messages and capability <constant/CAP_NET_ADMIN/
+to update routing tables.
+</para>
+</refsect1>
+
+<refsect1><title>AVAILABILITY</title>
+<para>
+<command/rdisc/ is part of <filename/iputils/ package
+and the latest versions are available in source form at
+<ulink url="http://www.skbuff.net/iputils/iputils-current.tar.bz2">
+http://www.skbuff.net/iputils/iputils-current.tar.bz2</ulink>.
+</para>
+</refsect1>
+
+<![IGNORE[
+<refsect1><title>COPYING</title>
+<para>
+<literallayout>
+Rdisc (this program) was developed by Sun Microsystems, Inc. and is
+provided for unrestricted use provided that this legend is included on
+all tape media and as a part of the software program in whole or part.
+Users may copy or modify Rdisc without charge, and they may freely
+distribute it.
+
+RDISC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
+WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
+PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
+
+Rdisc is provided with no support and without any obligation on the
+part of Sun Microsystems, Inc. to assist in its use, correction,
+modification or enhancement.
+
+SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
+INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY RDISC
+OR ANY PART THEREOF.
+
+In no event will Sun Microsystems, Inc. be liable for any lost revenue
+or profits or other special, indirect and consequential damages, even if
+Sun has been advised of the possibility of such damages.
+
+Sun Microsystems, Inc.
+2550 Garcia Avenue
+Mountain View, California 94043
+</literallayout>
+</para>
+</refsect1>
+]]>
+
+
+</refentry>
diff --git a/doc/snapshot.db b/doc/snapshot.db
new file mode 100644
index 0000000..a40d174
--- /dev/null
+++ b/doc/snapshot.db
@@ -0,0 +1 @@
+121126
diff --git a/doc/tftpd.sgml b/doc/tftpd.sgml
new file mode 100644
index 0000000..fe7fd7c
--- /dev/null
+++ b/doc/tftpd.sgml
@@ -0,0 +1,151 @@
+<refentry id="tftpd">
+
+<refmeta>
+<refentrytitle>tftpd</refentrytitle>
+<manvolnum>8</manvolnum>
+<refmiscinfo>iputils-&snapshot;</refmiscinfo>
+</refmeta>
+
+<refnamediv>
+<refname>tftpd</refname>
+<refpurpose>Trivial File Transfer Protocol server</refpurpose>
+</refnamediv>
+
+<refsynopsisdiv>
+<cmdsynopsis>
+<command>tftpd</command>
+<arg choice="req"><replaceable/directory/</arg>
+</cmdsynopsis>
+</refsynopsisdiv>
+
+<refsect1><title>DESCRIPTION</title>
+<para>
+<command/tftpd/ is a server which supports the DARPA
+Trivial File Transfer Protocol
+(<ulink url="http://tools.ietf.org/rfc/rfc1350.txt">RFC1350</ulink>).
+The TFTP server is started
+by <citerefentry><refentrytitle/inetd/<manvolnum/8/</citerefentry>.
+</para>
+
+<para>
+<replaceable/directory/ is required argument; if it is not given
+<command/tftpd/ aborts. This path is prepended to any file name requested
+via TFTP protocol, effectively chrooting <command/tftpd/ to this directory.
+File names are validated not to escape out of this directory, however
+administrator may configure such escape using symbolic links.
+</para>
+
+<para>
+It is in difference of variants of <command/tftpd/ usually distributed
+with unix-like systems, which take a list of directories and match
+file names to start from one of given prefixes or to some random
+default, when no arguments were given. There are two reasons not to
+behave in this way: first, it is inconvenient, clients are not expected
+to know something about layout of filesystem on server host.
+And second, TFTP protocol is not a tool for browsing of server's filesystem,
+it is just an agent allowing to boot dumb clients.
+</para>
+
+<para>
+In the case when <command/tftpd/ is used together with
+<link linkend="rarpd">
+<citerefentry><refentrytitle/rarpd/<manvolnum/8/</citerefentry></link>,
+tftp directories in these services should coincide and it is expected
+that each client booted via TFTP has boot image corresponding
+its IP address with an architecture suffix following Sun Microsystems
+conventions. See
+<link linkend="rarpd">
+<citerefentry><refentrytitle/rarpd/<manvolnum/8/</citerefentry></link>
+for more details.
+</para>
+</refsect1>
+
+<refsect1><title>SECURITY</title>
+<para>
+TFTP protocol does not provide any authentication.
+Due to this capital flaw <command/tftpd/ is not able to restrict
+access to files and will allow only publically readable
+files to be accessed. Files may be written only if they already
+exist and are publically writable.
+</para>
+
+<para>
+Impact is evident, directory exported via TFTP <emphasis/must not/
+contain sensitive information of any kind, everyone is allowed
+to read it as soon as a client is allowed. Boot images do not contain
+such information as rule, however you should think twice before
+publishing f.e. Cisco IOS config files via TFTP, they contain
+<emphasis/unencrypted/ passwords and may contain some information
+about the network, which you were not going to make public.
+</para>
+
+<para>
+The <command/tftpd/ server should be executed by <command/inetd/
+with dropped root privileges, namely with a user ID giving minimal
+access to files published in tftp directory. If it is executed
+as superuser occasionally, <command/tftpd/ drops its UID and GID
+to 65534, which is most likely not the thing which you expect.
+However, this is not very essential; remember, only files accessible
+for everyone can be read or written via TFTP.
+</para>
+
+</refsect1>
+
+
+<refsect1><title>SEE ALSO</title>
+<para>
+<link linkend="rarpd">
+<citerefentry><refentrytitle/rarpd/<manvolnum/8/</citerefentry></link>,
+<citerefentry><refentrytitle/tftp/<manvolnum/1/</citerefentry>,
+<citerefentry><refentrytitle/inetd/<manvolnum/8/</citerefentry>.
+</para>
+</refsect1>
+
+<refsect1><title>HISTORY</title>
+<para>
+The <command/tftpd/ command appeared in 4.2BSD. The source in iputils
+is cleaned up both syntactically (ANSIized) and semantically (UDP socket IO).
+</para>
+<para>
+It is distributed with iputils mostly as good demo of an interesting feature
+(<constant/MSG_CONFIRM/) allowing to boot long images by dumb clients
+not answering ARP requests until they are finally booted.
+However, this is full functional and can be used in production.
+</para>
+</refsect1>
+
+
+<refsect1><title>AVAILABILITY</title>
+<para>
+<command/tftpd/ is part of <filename/iputils/ package
+and the latest versions are available in source form at
+<ulink url="http://www.skbuff.net/iputils/iputils-current.tar.bz2">
+http://www.skbuff.net/iputils/iputils-current.tar.bz2</ulink>.
+</para>
+</refsect1>
+
+
+<![IGNORE[
+<refsect1><title>COPYING</title>
+<para>
+<literallayout>
+This documentation is free software; you can redistribute
+it and/or modify it under the terms of the GNU General Public
+License Version 2.
+
+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.
+
+For more details see the file COPYING in the source
+distribution of Linux kernel of version 2.4.
+</literallayout>
+</literallayout>
+</para>
+</refsect1>
+]]>
+
+
+
+</refentry>
diff --git a/doc/tracepath.sgml b/doc/tracepath.sgml
new file mode 100644
index 0000000..8da7cc0
--- /dev/null
+++ b/doc/tracepath.sgml
@@ -0,0 +1,191 @@
+<refentry id="tracepath">
+
+<refmeta>
+<refentrytitle>tracepath</refentrytitle>
+<manvolnum>8</manvolnum>
+<refmiscinfo>iputils-&snapshot;</refmiscinfo>
+</refmeta>
+
+<refnamediv>
+<refname>tracepath, tracepath6</refname>
+<refpurpose>
+traces path to a network host discovering MTU along this path</refpurpose>
+</refnamediv>
+
+<refsynopsisdiv>
+<cmdsynopsis>
+<command>tracepath</command>
+<arg choice="opt">-n</arg>
+<arg choice="opt">-b</arg>
+<arg choice="opt">-l <replaceable/pktlen/</arg>
+<arg choice="opt">-p <replaceable/port/</arg>
+<arg choice="req"><replaceable/destination/</arg>
+</cmdsynopsis>
+</refsynopsisdiv>
+
+<refsect1><title>DESCRIPTION</title>
+<para>
+It traces path to <replaceable/destination/ discovering MTU along this path.
+It uses UDP port <replaceable/port/ or some random port.
+It is similar to <command/traceroute/, only does not require superuser
+privileges and has no fancy options.
+</para>
+
+<para>
+<command/tracepath6/ is good replacement for <command/traceroute6/
+and classic example of application of Linux error queues.
+The situation with IPv4 is worse, because commercial
+IP routers do not return enough information in ICMP error messages.
+Probably, it will change, when they will be updated.
+For now it uses Van Jacobson's trick, sweeping a range
+of UDP ports to maintain trace history.
+</para>
+</refsect1>
+
+<refsect1><title>OPTIONS</title>
+<variablelist>
+
+ <varlistentry>
+ <term><option/-n/</term>
+ <listitem><para>
+Print primarily IP addresses numerically.
+ </para></listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option/-b/</term>
+ <listitem><para>
+Print both of host names and IP addresses.
+ </para></listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option/-l/</term>
+ <listitem><para>
+Sets the initial packet length to <replaceable/pktlen/ instead of
+65536 for <command/tracepath/ or 128000 for <command/tracepath6/.
+ </para></listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option/-p/</term>
+ <listitem><para>
+Sets the initial destination port to use.
+ </para></listitem>
+</variablelist>
+</refsect1>
+
+<refsect1><title>OUTPUT</title>
+<para>
+<literallayout>
+root@mops:~ # tracepath6 3ffe:2400:0:109::2
+ 1?: [LOCALHOST] pmtu 1500
+ 1: dust.inr.ac.ru 0.411ms
+ 2: dust.inr.ac.ru asymm 1 0.390ms pmtu 1480
+ 2: 3ffe:2400:0:109::2 463.514ms reached
+ Resume: pmtu 1480 hops 2 back 2
+</literallayout>
+</para>
+
+<para>
+The first column shows <literal/TTL/ of the probe, followed by colon.
+Usually value of <literal/TTL/ is obtained from reply from network,
+but sometimes reply does not contain necessary information and
+we have to guess it. In this case the number is followed by ?.
+</para>
+
+<para>
+The second column shows the network hop, which replied to the probe.
+It is either address of router or word <literal/[LOCALHOST]/, if
+the probe was not sent to the network.
+</para>
+
+<para>
+The rest of line shows miscellaneous information about path to
+the correspinding network hop. As rule it contains value of RTT.
+Additionally, it can show Path MTU, when it changes.
+If the path is asymmetric
+or the probe finishes before it reach prescribed hop, difference
+between number of hops in forward and backward direction is shown
+following keyword <literal/async/. This information is not reliable.
+F.e. the third line shows asymmetry of 1, it is because the first probe
+with TTL of 2 was rejected at the first hop due to Path MTU Discovery.
+</para>
+
+<para>
+The last line summarizes information about all the path to the destination,
+it shows detected Path MTU, amount of hops to the destination and our
+guess about amount of hops from the destination to us, which can be
+different when the path is asymmetric.
+</para>
+
+</refsect1>
+
+
+
+
+<refsect1><title>SEE ALSO</title>
+<para>
+<citerefentry><refentrytitle/traceroute/<manvolnum/8/</citerefentry>,
+<link linkend="traceroute6">
+<citerefentry><refentrytitle/traceroute6/<manvolnum/8/</citerefentry></link>,
+<link linkend="ping">
+<citerefentry><refentrytitle/ping/<manvolnum/8/</citerefentry></link>.
+</para>
+</refsect1>
+
+<refsect1><title>AUTHOR</title>
+<para>
+<command/tracepath/ was written by
+<ulink url="mailto:kuznet@ms2.inr.ac.ru">Alexey Kuznetsov
+&lt;kuznet@ms2.inr.ac.ru&gt;</ulink>.
+</para>
+</refsect1>
+
+<refsect1><title>SECURITY</title>
+<para>
+No security issues.
+</para>
+<para>
+This lapidary deserves to be elaborated.
+<command/tracepath/ is not a privileged program, unlike
+<command/traceroute/, <command/ping/ and other beasts of this kind.
+<command/tracepath/ may be executed by everyone who has some access
+to network, enough to send UDP datagrams to investigated destination
+using given port.
+</para>
+</refsect1>
+
+<refsect1><title>AVAILABILITY</title>
+<para>
+<command/tracepath/ is part of <filename/iputils/ package
+and the latest versions are available in source form at
+<ulink url="http://www.skbuff.net/iputils/iputils-current.tar.bz2">
+http://www.skbuff.net/iputils/iputils-current.tar.bz2</ulink>.
+</para>
+</refsect1>
+
+<![IGNORE[
+<refsect1><title>COPYING</title>
+<para>
+<literallayout>
+This documentation is free software; you can redistribute
+it and/or modify it under the terms of the GNU General Public
+License Version 2.
+
+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.
+
+For more details see the file COPYING in the source
+distribution of Linux kernel of version 2.4.
+</literallayout>
+</para>
+</refsect1>
+]]>
+
+
+
+
+</refentry>
diff --git a/doc/traceroute6.sgml b/doc/traceroute6.sgml
new file mode 100644
index 0000000..e47dd13
--- /dev/null
+++ b/doc/traceroute6.sgml
@@ -0,0 +1,97 @@
+<refentry id="traceroute6">
+
+<refmeta>
+<refentrytitle>traceroute6</refentrytitle>
+<manvolnum>8</manvolnum>
+<refmiscinfo>iputils-&snapshot;</refmiscinfo>
+</refmeta>
+
+<refnamediv>
+<refname>traceroute6</refname>
+<refpurpose>traces path to a network host</refpurpose>
+</refnamediv>
+
+<refsynopsisdiv>
+<cmdsynopsis>
+<command>traceroute6</command>
+<arg choice="opt"><option>-dnrvV</option></arg>
+<arg choice="opt">-i <replaceable/interface/</arg>
+<arg choice="opt">-m <replaceable/max_ttl/</arg>
+<arg choice="opt">-p <replaceable/port/</arg>
+<arg choice="opt">-q <replaceable/max_probes/</arg>
+<arg choice="opt">-s <replaceable/source/</arg>
+<arg choice="opt">-w <replaceable/wait time/</arg>
+<arg choice="req"><replaceable/destination/</arg>
+<arg choice="opt"><replaceable/size/</arg>
+</cmdsynopsis>
+</refsynopsisdiv>
+
+<refsect1><title>DESCRIPTION</title>
+<para>
+Description can be found in
+<citerefentry><refentrytitle/traceroute/<manvolnum/8/</citerefentry>,
+all the references to IP replaced to IPv6. It is needless to copy
+the description from there.
+</para>
+</refsect1>
+
+<refsect1><title>SEE ALSO</title>
+<para>
+<citerefentry><refentrytitle/traceroute/<manvolnum/8/</citerefentry>,
+<citerefentry><refentrytitle/tracepath/<manvolnum/8/</citerefentry>,
+<citerefentry><refentrytitle/ping/<manvolnum/8/</citerefentry>.
+</para>
+</refsect1>
+
+<refsect1><title>HISTORY</title>
+<para>
+This program has long history. Author of <command/traceroute/
+is Van Jacobson and it first appeared in 1988. This clone is
+based on a port of <command/traceroute/ to IPv6 published
+in NRL IPv6 distribution in 1996. In turn, it was ported
+to Linux by Pedro Roque. After this it was kept in sync by
+<ulink url="mailto:kuznet@ms2.inr.ac.ru">Alexey Kuznetsov
+&lt;kuznet@ms2.inr.ac.ru&gt;</ulink>. And eventually entered
+<command/iputils/ package.
+</para>
+</refsect1>
+
+<refsect1><title>SECURITY</title>
+<para>
+<command/tracepath6/ requires <constant/CAP_NET_RAW/ capability
+to be executed. It is safe to be used as set-uid root.
+</para>
+</refsect1>
+
+<refsect1><title>AVAILABILITY</title>
+<para>
+<command/traceroute6/ is part of <filename/iputils/ package
+and the latest versions are available in source form at
+<ulink url="http://www.skbuff.net/iputils/iputils-current.tar.bz2">
+http://www.skbuff.net/iputils/iputils-current.tar.bz2</ulink>.
+</para>
+</refsect1>
+
+<![IGNORE[
+<refsect1><title>COPYING</title>
+<para>
+<literallayout>
+This documentation is free software; you can redistribute
+it and/or modify it under the terms of the GNU General Public
+License Version 2.
+
+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.
+
+For more details see the file COPYING in the source
+distribution of Linux kernel of version 2.4.
+</literallayout>
+</para>
+</refsect1>
+]]>
+
+
+
+</refentry>