summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Heidelberg <david@ixit.cz>2017-07-31 22:03:10 +0200
committerDavid Heidelberg <david@ixit.cz>2017-08-05 11:09:19 +0200
commitbe0657da8842e90db446b10fbb9335d9033c54f2 (patch)
treeba8476863a72c2e2b05d1c9f9774442a4b83368a
parentf77443ddcc87bd043d440b0a492b4f04e9592fd6 (diff)
downloadiputils-be0657da8842e90db446b10fbb9335d9033c54f2.tar.gz
doc: convert from converting SGML to XML
This work is mostly inspired by systemd manpages procedure creation. [1] With this commit, you can freely throw SGML tools and you should be fine with xsltproc :) Enjoy! Also, please don't be shy fix bugs, it will need more polishing! [1] https://github.com/systemd/systemd/tree/master/man Fixes bug: https://github.com/iputils/iputils/issues/1 Fixes bug: https://github.com/iputils/iputils/issues/27 Signed-off-by: David Heidelberg <david@ixit.cz>
-rw-r--r--Makefile1
-rw-r--r--doc/Makefile70
-rw-r--r--doc/arping.sgml221
-rw-r--r--doc/arping.xml159
-rw-r--r--doc/clockdiff.sgml161
-rw-r--r--doc/clockdiff.xml108
-rw-r--r--doc/custom-html.xsl279
-rw-r--r--doc/custom-man.xsl46
-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/ninfod.xml113
-rw-r--r--doc/pg3.sgml175
-rw-r--r--doc/pg3.xml140
-rw-r--r--doc/ping.sgml716
-rw-r--r--doc/ping.xml655
-rw-r--r--doc/rarpd.sgml170
-rw-r--r--doc/rarpd.xml124
-rw-r--r--doc/rdisc.sgml246
-rw-r--r--doc/rdisc.xml182
-rw-r--r--doc/snapshot.db1
-rw-r--r--doc/tftpd.sgml151
-rw-r--r--doc/tftpd.xml104
-rw-r--r--doc/tracepath.sgml217
-rw-r--r--doc/tracepath.xml165
-rw-r--r--doc/traceroute6.sgml97
-rw-r--r--doc/traceroute6.xml69
29 files changed, 2160 insertions, 3818 deletions
diff --git a/Makefile b/Makefile
index e27b9eb..8185c1a 100644
--- a/Makefile
+++ b/Makefile
@@ -237,7 +237,6 @@ RPMBUILD=rpmbuild
RPMTMP=.rpmtmp
snapshot:
@echo "#define SNAPSHOT \"$(TAG)\"" > SNAPSHOT.h
- @$(MAKE) -C doc snapshot
@$(MAKE) man
@git commit -a -m "iputils-$(TAG)"
@git tag -s -m "iputils-$(TAG)" $(TAG)
diff --git a/doc/Makefile b/doc/Makefile
index b461664..9fc7c83 100644
--- a/doc/Makefile
+++ b/doc/Makefile
@@ -1,64 +1,26 @@
-SHELL:=/bin/bash #required for pushd and popd
+TARGETS_MAN = arping.8 clockdiff.8 ninfod.8 pg3.8 ping.8 rarpd.8 rdisc.8 tftpd.8 tracepath.8 traceroute6.8
+TARGETS_HTML = arping.html clockdiff.html ninfod.html pg3.html ping.html rarpd.html rdisc.html tftpd.html tracepath.html traceroute6.html
-SGMLFILES=$(shell echo *.sgml)
-HTMLFILES=$(subst .sgml,.html,$(SGMLFILES)) index.html
-MANFILES=$(subst .sgml,.8,$(SGMLFILES))
+IPUTILS_VERSION = s$(shell sed 's/[^0-9]*//g' ../SNAPSHOT.h)
-all: html
+XSLTPROC = /usr/bin/xsltproc
+XSLTPROC_FLAGS = --nonet --xinclude --stringparam man.output-quietly 1 --stringparam funcsynopsis.style ansi --stringparam man.authors.section.enabled 0 --stringparam iputils.version $(IPUTILS_VERSION)
-html: $(HTMLFILES) iputils.html
+XSL_MAN = custom-man.xsl
+XSL_HTML = custom-html.xsl
-man: $(MANFILES) fix_sgml2man
+%.html: %.xml $(XSL_HTML)
+ @$(XSLTPROC) -o $@ $(XSLTPROC_FLAGS) $(XSL_HTML) $<
+%.8: %.xml $(XSL_MAN)
+ @$(XSLTPROC) -o $@ $(XSLTPROC_FLAGS) $(XSL_MAN) $<
-# 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.
+all: $(TARGETS_HTML) $(TARGETS_MAN)
-SETUP_TMPDIR = \
- t="tmp.db2html.$@"; \
- rm -rf $$t; \
- mkdir $$t; \
- pushd $$t >/dev/null
-CLEAN_TMPDIR = \
- popd >/dev/null; \
- rm -rf $$t
+man: $(TARGETS_MAN)
+html: $(TARGETS_HTML)
-MAKE_HTML = \
- @set -e; \
- $(SETUP_TMPDIR); \
- docbook2html ../$<; \
- mv *.html ..; \
- $(CLEAN_TMPDIR)
-
-$(HTMLFILES): index.db
- $(MAKE_HTML)
-
-iputils.html: iputils.db
- $(MAKE_HTML)
-
-# 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
- @set -e; \
- $(SETUP_TMPDIR); \
- nsgmls ../$< | sgmlspl ../docbook2man-spec.pl ""; \
- mv $@ ..; \
- $(CLEAN_TMPDIR)
-
-fix_sgml2man: tracepath.8
- @sed -i -e 's!\\fB\\fIdestination\\fB\\fR \[\\fB/\\fIport\\fB\\fR\]!\\fB\\fIdestination\\fB\\fR[\\fB/\\fIport\\fB\\fR]!g' $<
clean:
- @rm -rf $(MANFILES) $(HTMLFILES) iputils.html tmp.db2html* tmp.db2man*
-
-snapshot:
- @date "+%y%m%d" > snapshot.db
-
-
-$(MANFILES): $(SGMLFILES)
-
-$(HTMLFILES): $(SGMLFILES)
-
+ @rm -f *.html
+ @rm -f *.8
diff --git a/doc/arping.sgml b/doc/arping.sgml
deleted file mode 100644
index b23aaac..0000000
--- a/doc/arping.sgml
+++ /dev/null
@@ -1,221 +0,0 @@
-<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="opt">-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, instead wait for
-<replaceable/count/ ARP REPLY packets, or 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/arping.xml b/doc/arping.xml
new file mode 100644
index 0000000..fff9d0f
--- /dev/null
+++ b/doc/arping.xml
@@ -0,0 +1,159 @@
+<?xml version="1.0"?>
+<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
+ "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd">
+<!-- lifted from man+troff by doclifter -->
+<refentry id='arping8'>
+<refmeta>
+ <refentrytitle>ARPING</refentrytitle>
+ <manvolnum>8</manvolnum>
+ <refmiscinfo class='manual'>iputils</refmiscinfo>
+</refmeta>
+<refnamediv>
+ <refname>arping</refname>
+ <refpurpose>send ARP REQUEST to a neighbour host</refpurpose>
+</refnamediv>
+<!-- body begins here -->
+<refsynopsisdiv id='synopsis'>
+ <cmdsynopsis>
+ <command>arping</command>
+ <arg choice='opt'>-AbDfhqUV </arg>
+ <arg choice='opt'>-c <replaceable>count</replaceable></arg>
+ <arg choice='opt'>-w <replaceable>deadline</replaceable></arg>
+ <arg choice='opt'>-s <replaceable>source</replaceable></arg>
+ <arg choice='opt'>-I <replaceable>interface</replaceable></arg>
+ <arg choice='plain'><replaceable>destination</replaceable></arg>
+ <sbr/>
+ </cmdsynopsis>
+</refsynopsisdiv>
+
+
+<refsect1 id='description'>
+ <title>DESCRIPTION</title>
+ <para>Ping <emphasis remap='I'>destination</emphasis> on device <emphasis remap='I'>interface</emphasis> by ARP packets,
+using source address <emphasis remap='I'>source</emphasis>.</para>
+</refsect1>
+
+<refsect1 id='options'><title>OPTIONS</title>
+<variablelist remap='TP'>
+ <varlistentry>
+ <term><option>-A</option></term>
+ <listitem>
+ <para>The same as <option>-U</option>, 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</command> starts
+from sending broadcast, and switch to unicast after reply received.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>-c </option><emphasis remap='I'>count</emphasis></term>
+ <listitem>
+ <para>Stop after sending <emphasis remap='I'>count</emphasis> ARP REQUEST
+packets. With <emphasis remap='I'>deadline</emphasis> option, instead wait for
+<emphasis remap='I'>count</emphasis> ARP REPLY packets, or until the timeout expires.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>-D</option></term>
+ <listitem><para>Duplicate address detection mode (DAD). See RFC2131, 4.4.1. 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>-I </option><emphasis remap='I'>interface</emphasis></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</option></term>
+ <listitem><para>Quiet output. Nothing is displayed.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>-s </option><emphasis remap='I'>source</emphasis></term>
+ <listitem><para>IP source address to use in ARP packets. If this option is absent, source address is:</para>
+ <variablelist remap='TP'>
+ <varlistentry>
+ <listitem><para>&bull; In DAD mode (with option <option>-D</option>) set to 0.0.0.0.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <listitem><para>&bull; In Unsolicited ARP mode (with options <option>-U</option> or <option>-A</option>)
+set to <emphasis remap='I'>destination</emphasis>.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <listitem><para>&bull; Otherwise, it is calculated from routing tables.</para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>-U</option></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>-w </option><emphasis remap='I'>deadline</emphasis></term>
+ <listitem><para>Specify a timeout, in seconds, before
+<command>arping</command>
+exits regardless of how many
+packets have been sent or received. In this case
+<command>arping</command>
+does not stop after
+<emphasis remap='I'>count</emphasis>
+packet are sent, it waits either for
+<emphasis remap='I'>deadline</emphasis>
+expire or until
+<emphasis remap='I'>count</emphasis>
+probes are answered.</para>
+ </listitem>
+ </varlistentry>
+</variablelist>
+</refsect1>
+
+<refsect1 id='see_also'>
+ <title>SEE ALSO</title>
+ <para><citerefentry><refentrytitle>ping</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
+<citerefentry><refentrytitle>clockdiff</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
+<citerefentry><refentrytitle>tracepath</refentrytitle><manvolnum>8</manvolnum></citerefentry>.</para>
+</refsect1>
+
+<refsect1 id='author'>
+ <title>AUTHOR</title>
+ <para><command>arping</command> was written by Alexey Kuznetsov &lt;kuznet@ms2.inr.ac.ru&gt;.</para>
+</refsect1>
+
+<refsect1 id='security'>
+ <title>SECURITY</title>
+ <para><command>arping</command> requires 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 id='availability'>
+ <title>AVAILABILITY</title>
+ <para><command>arping</command> is part of <emphasis remap='I'>iputils</emphasis> package.</para>
+</refsect1>
+</refentry>
+
diff --git a/doc/clockdiff.sgml b/doc/clockdiff.sgml
deleted file mode 100644
index e5ab592..0000000
--- a/doc/clockdiff.sgml
+++ /dev/null
@@ -1,161 +0,0 @@
-<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/clockdiff.xml b/doc/clockdiff.xml
new file mode 100644
index 0000000..211cebf
--- /dev/null
+++ b/doc/clockdiff.xml
@@ -0,0 +1,108 @@
+<?xml version="1.0"?>
+<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
+ "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd">
+<!-- lifted from man+troff by doclifter -->
+<refentry id='clockdiff8'>
+<refmeta>
+ <refentrytitle>CLOCKDIFF</refentrytitle>
+ <manvolnum>8</manvolnum>
+ <refmiscinfo class='manual'>iputils</refmiscinfo>
+</refmeta>
+<refnamediv>
+ <refname>clockdiff</refname>
+ <refpurpose>measure clock difference between hosts</refpurpose>
+</refnamediv>
+<!-- body begins here -->
+<refsynopsisdiv id='synopsis'>
+ <cmdsynopsis>
+ <command>clockdiff</command>
+ <arg choice='opt'>-o </arg>
+ <arg choice='opt'>-o1 </arg>
+ <arg choice='plain'><replaceable>destination</replaceable></arg>
+ <sbr/>
+ </cmdsynopsis>
+</refsynopsisdiv>
+
+
+<refsect1 id='description'>
+ <title>DESCRIPTION</title>
+ <para><command>clockdiff</command> Measures clock difference between us and
+<emphasis remap='I'>destination</emphasis> with 1 msec resolution using ICMP TIMESTAMP [2] packets or, optionally, IP TIMESTAMP option [3] option added to ICMP ECHO.
+[1]</para>
+</refsect1>
+
+<refsect1 id='options'>
+ <title>OPTIONS</title>
+ <variablelist remap='TP'>
+ <varlistentry>
+ <term><option>-o</option></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</option></term>
+ <listitem>
+<para>Slightly different form of <option>-o</option>, 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</option> is better for Linux.</para>
+ </listitem>
+ </varlistentry>
+</variablelist>
+</refsect1>
+
+<refsect1 id='warnings'>
+ <title>WARNINGS</title>
+<variablelist remap='TP'>
+ <varlistentry>
+ <listitem><para>&bull; Some nodes (Cisco) use non-standard timestamps, which is allowed by RFC, but makes timestamps mostly useless.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <listitem><para>&bull; Some nodes generate messed timestamps (Solaris&gt;2.4), when run <emphasis remap='B'>xntpd</emphasis>. 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>
+ </varlistentry>
+ <varlistentry>
+ <listitem><para>&bull; <command>clockdiff</command> shows difference in time modulo 24 days.</para>
+ </listitem>
+ </varlistentry>
+</variablelist>
+</refsect1>
+
+<refsect1 id='see_also'>
+ <title>SEE ALSO</title>
+<para><citerefentry><refentrytitle>ping</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
+<citerefentry><refentrytitle>arping</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
+<citerefentry><refentrytitle>tracepath</refentrytitle><manvolnum>8</manvolnum></citerefentry>.</para>
+</refsect1>
+
+<refsect1 id='references'>
+ <title>REFERENCES</title>
+ <para>[1] ICMP ECHO, RFC0792, page 14.</para>
+ <para>[2] ICMP TIMESTAMP, RFC0792, page 16.</para>
+ <para>[3] IP TIMESTAMP option, RFC0791, 3.1, page 16.</para>
+</refsect1>
+
+<refsect1 id='author'>
+ <title>AUTHOR</title>
+ <para><command>clockdiff</command> was compiled by
+Alexey Kuznetsov
+&lt;kuznet@ms2.inr.ac.ru&gt;. It was based on code borrowed
+from BSD <emphasis remap='B'>timed</emphasis> daemon.</para>
+</refsect1>
+
+<refsect1 id='security'>
+ <title>SECURITY</title>
+ <para><command>clockdiff</command> requires CAP_NET_RAW capability
+to be executed. It is safe to be used as set-uid root.</para>
+</refsect1>
+
+<refsect1 id='availability'>
+ <title>AVAILABILITY</title>
+ <para><command>clockdiff</command> is part of <emphasis remap='I'>iputils</emphasis> package.</para>
+</refsect1>
+</refentry>
diff --git a/doc/custom-html.xsl b/doc/custom-html.xsl
new file mode 100644
index 0000000..c391535
--- /dev/null
+++ b/doc/custom-html.xsl
@@ -0,0 +1,279 @@
+<?xml version='1.0'?> <!--*-nxml-*-->
+
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
+
+<xsl:import href="http://docbook.sourceforge.net/release/xsl/current/html/docbook.xsl"/>
+<!--
+ - The docbook stylesheet injects empty anchor tags into generated HTML, identified by an auto-generated ID.
+ - Ask the docbook stylesheet to generate reproducible output when generating (these) ID values.
+ - This makes the output of this stylesheet reproducible across identical invocations on the same input,
+ - which is an easy and significant win for achieving reproducible builds.
+ -
+ - It may be even better to strip the empty anchors from the document output in addition to turning on consistent IDs,
+ - for this stylesheet contains its own custom ID logic (for generating permalinks) already.
+ -->
+<xsl:param name="generate.consistent.ids" select="1"/>
+
+<!-- translate man page references to links to html pages -->
+<xsl:template match="citerefentry[not(@project)]">
+ <a>
+ <xsl:attribute name="href">
+ <xsl:value-of select="refentrytitle"/><xsl:text>.html#</xsl:text>
+ <xsl:value-of select="refentrytitle/@target"/>
+ </xsl:attribute>
+ <xsl:call-template name="inline.charseq"/>
+ </a>
+</xsl:template>
+
+<xsl:template match="citerefentry[@project='man-pages'] | citerefentry[manvolnum='2'] | citerefentry[manvolnum='4']">
+ <a>
+ <xsl:attribute name="href">
+ <xsl:text>http://man7.org/linux/man-pages/man</xsl:text>
+ <xsl:value-of select="manvolnum"/>
+ <xsl:text>/</xsl:text>
+ <xsl:value-of select="refentrytitle"/>
+ <xsl:text>.</xsl:text>
+ <xsl:value-of select="manvolnum"/>
+ <xsl:text>.html</xsl:text>
+ </xsl:attribute>
+ <xsl:call-template name="inline.charseq"/>
+ </a>
+</xsl:template>
+
+<xsl:template match="citerefentry[@project='die-net']">
+ <a>
+ <xsl:attribute name="href">
+ <xsl:text>http://linux.die.net/man/</xsl:text>
+ <xsl:value-of select="manvolnum"/>
+ <xsl:text>/</xsl:text>
+ <xsl:value-of select="refentrytitle"/>
+ </xsl:attribute>
+ <xsl:call-template name="inline.charseq"/>
+ </a>
+</xsl:template>
+
+<xsl:template match="citerefentry[@project='mankier']">
+ <a>
+ <xsl:attribute name="href">
+ <xsl:text>https://www.mankier.com/</xsl:text>
+ <xsl:value-of select="manvolnum"/>
+ <xsl:text>/</xsl:text>
+ <xsl:value-of select="refentrytitle"/>
+ </xsl:attribute>
+ <xsl:call-template name="inline.charseq"/>
+ </a>
+</xsl:template>
+
+<xsl:template match="citerefentry[@project='archlinux']">
+ <a>
+ <xsl:attribute name="href">
+ <xsl:text>https://www.archlinux.org/</xsl:text>
+ <xsl:value-of select="refentrytitle"/>
+ <xsl:text>/</xsl:text>
+ <xsl:value-of select="refentrytitle"/>
+ <xsl:text>.</xsl:text>
+ <xsl:value-of select="manvolnum"/>
+ <xsl:text>.html</xsl:text>
+ </xsl:attribute>
+ <xsl:call-template name="inline.charseq"/>
+ </a>
+</xsl:template>
+
+<xsl:template match="citerefentry[@project='freebsd']">
+ <a>
+ <xsl:attribute name="href">
+ <xsl:text>https://www.freebsd.org/cgi/man.cgi?</xsl:text>
+ <xsl:value-of select="refentrytitle"/>
+ <xsl:text>(</xsl:text>
+ <xsl:value-of select="manvolnum"/>
+ <xsl:text>)</xsl:text>
+ </xsl:attribute>
+ <xsl:call-template name="inline.charseq"/>
+ </a>
+</xsl:template>
+
+<xsl:template match="citerefentry[@project='dbus']">
+ <a>
+ <xsl:attribute name="href">
+ <xsl:text>http://dbus.freedesktop.org/doc/</xsl:text>
+ <xsl:value-of select="refentrytitle"/>
+ <xsl:text>.</xsl:text>
+ <xsl:value-of select="manvolnum"/>
+ <xsl:text>.html</xsl:text>
+ </xsl:attribute>
+ <xsl:call-template name="inline.charseq"/>
+ </a>
+</xsl:template>
+
+<!--
+ - helper template to do conflict resolution between various headings with the same inferred ID attribute/tag from the headerlink template
+ - this conflict resolution is necessary to prevent malformed HTML output (multiple ID attributes with the same value)
+ - and it fixes xsltproc warnings during compilation of HTML man pages
+ -
+ - A simple top-to-bottom numbering scheme is implemented for nodes with the same ID value to derive unique ID values for HTML output.
+ - It uses two parameters:
+ templateID the proposed ID string to use which must be checked for conflicts
+ keyNode the context node which 'produced' the given templateID.
+ -
+ - Conflicts are detected solely based on keyNode, templateID is not taken into account for that purpose.
+ -->
+<xsl:template name="generateID">
+ <!-- node which generatedID needs to assume as the 'source' of the ID -->
+ <xsl:param name="keyNode"/>
+ <!-- suggested value for generatedID output, a contextually meaningful ID string -->
+ <xsl:param name="templateID"/>
+ <xsl:variable name="conflictSource" select="preceding::refsect1/title|preceding::refsect1/info/title|
+ preceding::refsect2/title|preceding::refsect2/info/title|
+ preceding::varlistentry/term[1]"/>
+ <xsl:variable name="conflictCount" select="count($conflictSource[. = $keyNode])"/>
+ <xsl:choose>
+ <!-- special case conflictCount = 0 to preserve compatibility with URLs generated by previous versions of this XSL stylesheet where possible -->
+ <xsl:when test="$conflictCount = 0">
+ <xsl:value-of select="$templateID"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="concat($templateID, $conflictCount)"/>
+ </xsl:otherwise>
+ </xsl:choose>
+</xsl:template>
+
+<!--
+ - a helper template to abstract over the structure of generated subheading + permalink HTML output
+ - It helps reduce tedious repetition and groups all actual markup output (as opposed to URL/ID logic) in a single location.
+ -->
+<xsl:template name="permalink">
+ <xsl:param name="nodeType"/> <!-- local name of the element node to generate, e.g. 'h2' for <h2></h2> -->
+ <xsl:param name="nodeContent"/> <!-- nodeset to apply further templates to obtain the content of the subheading/term -->
+ <xsl:param name="linkTitle"/> <!-- value for title attribute of generated permalink, e.g. 'this is a permalink' -->
+
+ <!-- parameters passed to generateID template, otherwise unused. -->
+ <xsl:param name="keyNode"/>
+ <xsl:param name="templateID"/>
+
+ <!--
+ - If stable URLs with fragment markers (references to the ID) turn out not to be important:
+ - generatedID could simply take the value of generate-id(), and various other helper templates may be dropped entirely.
+ - Alternatively, if xsltproc is patched to generate reproducible generate-id() output, the same simplifications can be
+ - applied at the cost of breaking compatibility with URLs generated from output of previous versions of this stylesheet.
+ -->
+ <xsl:variable name="generatedID">
+ <xsl:call-template name="generateID">
+ <xsl:with-param name="keyNode" select="$keyNode"/>
+ <xsl:with-param name="templateID" select="$templateID"/>
+ </xsl:call-template>
+ </xsl:variable>
+
+ <xsl:element name="{$nodeType}">
+ <xsl:attribute name="id">
+ <xsl:value-of select="$generatedID"/>
+ </xsl:attribute>
+ <xsl:apply-templates select="$nodeContent"/>
+ <a class="headerlink" title="{$linkTitle}" href="#{$generatedID}">¶</a>
+ </xsl:element>
+</xsl:template>
+
+<!-- simple wrapper around permalink to avoid repeating common info for each level of subheading covered by the permalink logic (h2, h3) -->
+<xsl:template name="headerlink">
+ <xsl:param name="nodeType"/>
+ <xsl:call-template name="permalink">
+ <xsl:with-param name="nodeType" select="$nodeType"/>
+ <xsl:with-param name="linkTitle" select="'Permalink to this headline'"/>
+ <xsl:with-param name="nodeContent" select="node()"/>
+ <xsl:with-param name="keyNode" select="."/>
+ <!--
+ - To retain compatibility with IDs generated by previous versions of the template, inline.charseq must be called.
+ - The purpose of that template is to generate markup (according to docbook documentation its purpose is to mark/format something as plain text).
+ - The only reason to call this template is to get the auto-generated text such as brackets ([]) before flattening it.
+ -->
+ <xsl:with-param name="templateID">
+ <xsl:call-template name="inline.charseq"/>
+ </xsl:with-param>
+ </xsl:call-template>
+</xsl:template>
+
+<xsl:template match="refsect1/title|refsect1/info/title">
+ <!-- the ID is output in the block.object call for refsect1 -->
+ <xsl:call-template name="headerlink">
+ <xsl:with-param name="nodeType" select="'h2'"/>
+ </xsl:call-template>
+</xsl:template>
+
+<xsl:template match="refsect2/title|refsect2/info/title">
+ <xsl:call-template name="headerlink">
+ <xsl:with-param name="nodeType" select="'h3'"/>
+ </xsl:call-template>
+</xsl:template>
+
+<xsl:template match="varlistentry">
+ <xsl:call-template name="permalink">
+ <xsl:with-param name="nodeType" select="'dt'"/>
+ <xsl:with-param name="linkTitle" select="'Permalink to this term'"/>
+ <xsl:with-param name="nodeContent" select="term"/>
+ <xsl:with-param name="keyNode" select="term[1]"/>
+ <!--
+ - To retain compatibility with IDs generated by previous versions of the template, inline.charseq must be called.
+ - The purpose of that template is to generate markup (according to docbook documentation its purpose is to mark/format something as plain text).
+ - The only reason to call this template is to get the auto-generated text such as brackets ([]) before flattening it.
+ -->
+ <xsl:with-param name="templateID">
+ <xsl:call-template name="inline.charseq">
+ <xsl:with-param name="content" select="term[1]"/>
+ </xsl:call-template>
+ </xsl:with-param>
+ </xsl:call-template>
+ <dd>
+ <xsl:apply-templates select="listitem"/>
+ </dd>
+</xsl:template>
+
+
+<!-- add Index link at top of page -->
+<xsl:template name="user.header.content">
+ <style>
+ a.headerlink {
+ color: #c60f0f;
+ font-size: 0.8em;
+ padding: 0 4px 0 4px;
+ text-decoration: none;
+ visibility: hidden;
+ }
+
+ a.headerlink:hover {
+ background-color: #c60f0f;
+ color: white;
+ }
+
+ h1:hover > a.headerlink, h2:hover > a.headerlink, h3:hover > a.headerlink, dt:hover > a.headerlink {
+ visibility: visible;
+ }
+ </style>
+
+ <a>
+ <xsl:attribute name="href">
+ <xsl:text>index.html</xsl:text>
+ </xsl:attribute>
+ <xsl:text>Index </xsl:text>
+ </a>·
+ <a>
+ <xsl:attribute name="href">
+ <xsl:text>iputils.directives.html</xsl:text>
+ </xsl:attribute>
+ <xsl:text>Directives </xsl:text>
+ </a>
+
+ <span style="float:right">
+ <xsl:text>iputils </xsl:text>
+ <xsl:value-of select="$iputils.version"/>
+ </span>
+ <hr/>
+</xsl:template>
+
+<xsl:template match="literal">
+ <xsl:text>"</xsl:text>
+ <xsl:call-template name="inline.monoseq"/>
+ <xsl:text>"</xsl:text>
+</xsl:template>
+
+<xsl:output method="html" encoding="UTF-8" indent="no"/>
+
+</xsl:stylesheet>
diff --git a/doc/custom-man.xsl b/doc/custom-man.xsl
new file mode 100644
index 0000000..058f495
--- /dev/null
+++ b/doc/custom-man.xsl
@@ -0,0 +1,46 @@
+<?xml version='1.0'?> <!--*-nxml-*-->
+
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:exsl="http://exslt.org/common"
+ extension-element-prefixes="exsl"
+ version="1.0">
+
+<xsl:import href="http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl"/>
+
+<xsl:template name="top.comment" />
+
+<xsl:template name="TH.title.line">
+ <xsl:param name="title"/>
+ <xsl:param name="section"/>
+ <xsl:param name="extra1"/>
+ <xsl:param name="extra2"/>
+ <xsl:param name="extra3"/>
+
+ <xsl:call-template name="mark.subheading"/>
+ <xsl:text>.TH "</xsl:text>
+ <xsl:call-template name="string.upper">
+ <xsl:with-param name="string">
+ <xsl:value-of select="normalize-space($title)"/>
+ </xsl:with-param>
+ </xsl:call-template>
+ <xsl:text>" "</xsl:text>
+ <xsl:value-of select="normalize-space($section)"/>
+ <xsl:text>" "" "iputils </xsl:text>
+ <xsl:value-of select="$iputils.version"/>
+ <xsl:text>" "</xsl:text>
+ <xsl:value-of select="normalize-space($extra3)"/>
+ <xsl:text>"&#10;</xsl:text>
+ <xsl:call-template name="mark.subheading"/>
+
+</xsl:template>
+
+<xsl:template match="literal">
+ <xsl:if test="$man.hyphenate.computer.inlines = 0">
+ <xsl:call-template name="suppress.hyphenation"/>
+ </xsl:if>
+ <xsl:text>"</xsl:text>
+ <xsl:call-template name="inline.monoseq"/>
+ <xsl:text>"</xsl:text>
+</xsl:template>
+
+</xsl:stylesheet>
diff --git a/doc/docbook2man-spec.pl b/doc/docbook2man-spec.pl
deleted file mode 100644
index ddf1af7..0000000
--- a/doc/docbook2man-spec.pl
+++ /dev/null
@@ -1,1164 +0,0 @@
-=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 = (@ARGV == 1) ? $ARGV[0] : `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($manpage_date),
- '" "', $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
deleted file mode 100644
index 427c2e9..0000000
--- a/doc/index.db
+++ /dev/null
@@ -1,28 +0,0 @@
-<!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
deleted file mode 100644
index fe8ef2e..0000000
--- a/doc/index.out
+++ /dev/null
@@ -1,87 +0,0 @@
-\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
deleted file mode 100644
index cff17ce..0000000
--- a/doc/iputils.db
+++ /dev/null
@@ -1,209 +0,0 @@
-<!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</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</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
deleted file mode 100644
index 1154a75..0000000
--- a/doc/ninfod.sgml
+++ /dev/null
@@ -1,120 +0,0 @@
-<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/ninfod.xml b/doc/ninfod.xml
new file mode 100644
index 0000000..3f207b3
--- /dev/null
+++ b/doc/ninfod.xml
@@ -0,0 +1,113 @@
+<?xml version="1.0"?>
+<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
+ "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd">
+<!-- lifted from man+troff by doclifter -->
+<refentry id='ninfod8'>
+<refmeta>
+ <refentrytitle>NINFOD</refentrytitle>
+ <manvolnum>8</manvolnum>
+ <refmiscinfo class='manual'>iputils</refmiscinfo>
+</refmeta>
+<refnamediv>
+ <refname>ninfod</refname>
+ <refpurpose>Respond to IPv6 Node Information Queries</refpurpose>
+</refnamediv>
+<!-- body begins here -->
+<refsynopsisdiv id='synopsis'>
+ <cmdsynopsis>
+ <command>ninfod</command>
+ <arg choice='opt'>-dhv </arg>
+ <arg choice='opt'>-p <replaceable>pidfile</replaceable></arg>
+ <arg choice='opt'>-u <replaceable>user</replaceable></arg>
+ <sbr/>
+ </cmdsynopsis>
+</refsynopsisdiv>
+
+
+<refsect1 id='description'>
+ <title>DESCRIPTION</title>
+ <para>Responds to IPv6 Node Information Queries (RFC4620) from clients.
+Queries can be sent by various implementations of <emphasis remap='B'>ping6</emphasis> command.</para>
+</refsect1>
+
+<refsect1 id='options'>
+ <title>OPTIONS</title>
+<variablelist remap='TP'>
+ <varlistentry>
+ <term><option>-a</option></term>
+ <listitem>
+<para>Debug mode. Do not go background.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>-h</option></term>
+ <listitem>
+<para>Show help.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>-v</option></term>
+ <listitem>
+<para>Verbose mode.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>-u </option><emphasis remap='I'>user</emphasis></term>
+ <listitem>
+<para>Run as another user.
+<emphasis remap='I'>user</emphasis> can either be username or user ID.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>-p </option><emphasis remap='I'>pidfile</emphasis></term>
+ <listitem>
+<para>File for process-id storage.
+<emphasis remap='I'>user</emphasis> is required to be able to create the file.</para>
+ </listitem>
+ </varlistentry>
+</variablelist>
+</refsect1>
+
+<refsect1 id='see_also'>
+ <title>SEE ALSO</title>
+ <para><citerefentry><refentrytitle>ping</refentrytitle><manvolnum>8</manvolnum></citerefentry>.</para>
+</refsect1>
+
+<refsect1 id='author'>
+ <title>AUTHOR</title>
+ <para><command>ninfod</command> was written by USAGI/WIDE Project.</para>
+</refsect1>
+
+<refsect1 id='copying'><title>COPYING</title>
+ <literallayout remap='.nf'>
+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 &ldquo;AS IS&rdquo; 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> <!-- .fi -->
+</refsect1>
+</refentry>
+
diff --git a/doc/pg3.sgml b/doc/pg3.sgml
deleted file mode 100644
index 04c80fe..0000000
--- a/doc/pg3.sgml
+++ /dev/null
@@ -1,175 +0,0 @@
-<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/pg3.xml b/doc/pg3.xml
new file mode 100644
index 0000000..487a169
--- /dev/null
+++ b/doc/pg3.xml
@@ -0,0 +1,140 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
+ "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd">
+<!-- lifted from man+troff by doclifter -->
+<refentry id='pg38'>
+<refmeta>
+ <refentrytitle>PG3</refentrytitle>
+ <manvolnum>8</manvolnum>
+ <refmiscinfo class='manual'>iputils</refmiscinfo>
+</refmeta>
+<refnamediv>
+ <refname>pg3</refname>
+ <refname>ipg</refname>
+ <refname>pgset</refname>
+ <refpurpose>send stream of UDP packets</refpurpose>
+</refnamediv>
+<!-- body begins here -->
+<refsynopsisdiv id='synopsis'>
+ <cmdsynopsis>
+ <command>source</command>
+ <arg choice='plain'><replaceable>ipg</replaceable></arg>
+ <sbr/>
+ </cmdsynopsis>
+ <cmdsynopsis>
+ <command>pg</command>
+ <sbr/>
+ </cmdsynopsis>
+ <cmdsynopsis>
+ <command>pgset</command> <arg choice='plain'><replaceable>COMMAND</replaceable></arg>
+ <sbr/>
+ </cmdsynopsis>
+</refsynopsisdiv>
+
+
+<refsect1 id='description'>
+ <title>DESCRIPTION</title>
+ <para><emphasis remap='B'>ipg</emphasis> is not a program, it is script which should be sourced
+to <emphasis remap='B'>bash</emphasis>. When sourced it loads module <emphasis remap='I'>pg3</emphasis> and
+exports a few of functions accessible from parent shell. These macros
+are <command>pg</command> to start packet injection and to get the results of run;
+and <command>pgset</command> to setup packet generator.</para>
+
+ <para><command>pgset</command> can send the following commands to module <emphasis remap='I'>pg3</emphasis>:</para>
+</refsect1>
+
+<refsect1 id='command'>
+ <title>COMMAND</title>
+<variablelist remap='TP'>
+ <varlistentry>
+ <term><emphasis remap='B'>odev </emphasis><emphasis remap='I'>DEVICE</emphasis></term>
+ <listitem>
+<para>Name of Ethernet device to test. See
+warning below.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><emphasis remap='B'>pkt_size </emphasis><emphasis remap='I'>BYTES</emphasis></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><emphasis remap='B'>frags </emphasis><emphasis remap='I'>NUMBER</emphasis></term>
+ <listitem>
+<para>Each packet will contain <emphasis remap='I'>NUMBER</emphasis> of fragments.
+Maximal amount for linux-2.4 is 6. Far not all the devices support
+fragmented buffers.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><emphasis remap='B'>count </emphasis><emphasis remap='I'>NUMBER</emphasis></term>
+ <listitem>
+<para>Send stream of <emphasis remap='I'>NUMBER</emphasis> of packets and stop after this.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><emphasis remap='B'>ipg </emphasis><emphasis remap='I'>TIME</emphasis></term>
+ <listitem>
+<para>Introduce artificial delay between packets of <emphasis remap='I'>TIME</emphasis>
+microseconds.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><emphasis remap='B'>dst </emphasis><emphasis remap='I'>IP_ADDRESS</emphasis></term>
+ <listitem>
+<para>Select IP destination where the stream is sent to.
+Beware, never set this address at random. <emphasis remap='B'>pg3</emphasis> is not a toy,
+it creates really tough stream. Default value is 0.0.0.0.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><emphasis remap='B'>dst </emphasis><emphasis remap='I'>MAC_ADDRESS</emphasis></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><emphasis remap='B'>stop</emphasis></term>
+ <listitem>
+<para>Abort packet injection.</para>
+ </listitem>
+ </varlistentry>
+</variablelist>
+</refsect1>
+
+<refsect1 id='warning'>
+ <title>WARNING</title>
+ <para>When output device is set to some random device different
+of hardware Ethernet device, <emphasis remap='B'>pg3</emphasis> 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 id='author'>
+ <title>AUTHOR</title>
+ <para><emphasis remap='B'>pg3</emphasis> was written by Robert Olsson &lt;robert.olsson@its.uu.se&gt;.</para>
+</refsect1>
+
+<refsect1 id='security'>
+ <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 id='availability'>
+ <title>AVAILABILITY</title>
+ <para><emphasis remap='B'>pg3</emphasis> is part of <emphasis remap='I'>iputils</emphasis> package.</para>
+</refsect1>
+</refentry>
+
diff --git a/doc/ping.sgml b/doc/ping.sgml
deleted file mode 100644
index fa0797e..0000000
--- a/doc/ping.sgml
+++ /dev/null
@@ -1,716 +0,0 @@
-<refentry id="ping">
-
-<refmeta>
-<refentrytitle>ping</refentrytitle>
-<manvolnum>8</manvolnum>
-<refmiscinfo>iputils-&snapshot;</refmiscinfo>
-</refmeta>
-
-<refnamediv>
-<refname>ping</refname>
-<refpurpose>send ICMP ECHO_REQUEST to network hosts</refpurpose>
-</refnamediv>
-
-<refsynopsisdiv>
-<cmdsynopsis>
-<command>ping</command>
-<arg choice="opt"><option>-aAbBdDfhLnOqrRUvV46</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/ping/ works with both IPv4 and IPv6. Using only one of them
-explicitly can be enforced by specifying <option/-4/ or <option/-6/.
-</para>
-<para>
-<command/ping/ can also send IPv6 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/-4/</term>
- <listitem><para>
-Use IPv4 only.
- </para></listitem>
- </varlistentry>
- <varlistentry>
- <term><option/-6/</term>
- <listitem><para>
-Use IPv6 only.
- </para></listitem>
- </varlistentry>
- <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>
-IPv6 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>
- <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 than 0.2 seconds.
- </para></listitem>
- </varlistentry>
- <varlistentry>
- <term><option>-I <replaceable/interface/</option></term>
- <listitem><para>
-<replaceable/interface/ is either an address, or an interface name.
-If <replaceable/interface/ is an address, it sets source address
-to specified interface address.
-If <replaceable/interface/ in an interface name, it sets
-source interface to specified interface.
-For IPv6, when doing ping to a link-local scope
-address, link specification (by the '%'-notation in
-<replaceable/destination/, or by 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>
-IPv6 only.
-Send ICMPv6 Node Information Queries (RFC4620), instead of Echo Request.
-<constant/CAP_NET_RAW/ capability is required.
- <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 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>
-<para>
-As of version s20150815, the <command/ping6/ binary doesn't exist anymore.
-It has been merged into <command/ping/. Creating a symlink named
-<command/ping6/ pointing to <command/ping/ will result in the same
-funcionality as before.
-</para>
-</refsect1>
-
-<refsect1><title>SECURITY</title>
-<para>
-<command/ping/ requires <constant/CAP_NET_RAW/ capability
-to be executed 1) if the program is used for non-echo queries
-(See <option>-N</option> option), or 2) if kernel does not
-support non-raw ICMP sockets, or 3) if the user is not allowed
-to create an ICMP echo socket. The program 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/ping.xml b/doc/ping.xml
new file mode 100644
index 0000000..bd4e3f0
--- /dev/null
+++ b/doc/ping.xml
@@ -0,0 +1,655 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
+ "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd">
+<!-- lifted from man+troff by doclifter -->
+<refentry id='ping8'>
+<refmeta>
+ <refentrytitle>PING</refentrytitle>
+ <manvolnum>8</manvolnum>
+ <refmiscinfo class='manual'>iputils</refmiscinfo>
+</refmeta>
+<refnamediv>
+ <refname>ping</refname>
+ <refpurpose>send ICMP ECHO_REQUEST to network hosts</refpurpose>
+</refnamediv>
+<!-- body begins here -->
+<refsynopsisdiv id='synopsis'>
+ <cmdsynopsis>
+ <command>ping</command>
+ <arg choice='opt'>-aAbBdDfhLnOqrRUvV46 </arg>
+ <arg choice='opt'>-c <replaceable>count</replaceable></arg>
+ <arg choice='opt'>-F <replaceable>flowlabel</replaceable></arg>
+ <arg choice='opt'>-i <replaceable>interval</replaceable></arg>
+ <arg choice='opt'>-I <replaceable>interface</replaceable></arg>
+ <arg choice='opt'>-l <replaceable>preload</replaceable></arg>
+ <arg choice='opt'>-m <replaceable>mark</replaceable></arg>
+ <arg choice='opt'>-M <replaceable>pmtudisc_option</replaceable></arg>
+ <arg choice='opt'>-N <replaceable>nodeinfo_option</replaceable></arg>
+ <arg choice='opt'>-w <replaceable>deadline</replaceable></arg>
+ <arg choice='opt'>-W <replaceable>timeout</replaceable></arg>
+ <arg choice='opt'>-p <replaceable>pattern</replaceable></arg>
+ <arg choice='opt'>-Q <replaceable>tos</replaceable></arg>
+ <arg choice='opt'>-s <replaceable>packetsize</replaceable></arg>
+ <arg choice='opt'>-S <replaceable>sndbuf</replaceable></arg>
+ <arg choice='opt'>-t <replaceable>ttl</replaceable></arg>
+ <arg choice='opt'><arg choice='plain'>-T <replaceable>timestamp</replaceable></arg><arg choice='plain'><replaceable>option</replaceable></arg></arg>
+ <arg choice='opt' rep='repeat'><replaceable>hop</replaceable></arg>
+ <arg choice='plain'><replaceable>destination</replaceable></arg>
+ <sbr/>
+ </cmdsynopsis>
+</refsynopsisdiv>
+
+
+<refsect1 id='description'>
+ <title>DESCRIPTION</title>
+ <para><command>ping</command> uses the ICMP protocol's mandatory ECHO_REQUEST
+datagram to elicit an ICMP ECHO_RESPONSE from a host or gateway.
+ECHO_REQUEST datagrams (&ldquo;pings&rdquo;) have an IP and ICMP
+header, followed by a struct timeval and then an arbitrary
+number of &ldquo;pad&rdquo; bytes used to fill out the packet.</para>
+
+ <para><command>ping</command> works with both IPv4 and IPv6. Using only one of them
+explicitly can be enforced by specifying <option>-4</option> or <option>-6</option>.</para>
+
+ <para><command>ping</command> can also send IPv6 Node Information Queries (RFC4620).
+Intermediate <emphasis remap='I'>hop</emphasis>s may not be allowed, because IPv6 source routing was deprecated (RFC5095).</para>
+</refsect1>
+
+<refsect1 id='options'>
+ <title>OPTIONS</title>
+<variablelist remap='TP'>
+ <varlistentry>
+ <term><option>-4</option></term>
+ <listitem>
+<para>Use IPv4 only.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>-6</option></term>
+ <listitem>
+<para>Use IPv6 only.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>-a</option></term>
+ <listitem>
+<para>Audible ping.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>-A</option></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</option></term>
+ <listitem>
+<para>Allow pinging a broadcast address.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>-B</option></term>
+ <listitem>
+<para>Do not allow <command>ping</command> to change source address of probes.
+The address is bound to one selected when <command>ping</command> starts.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>-c </option><emphasis remap='I'>count</emphasis></term>
+ <listitem>
+<para>Stop after sending <emphasis remap='I'>count</emphasis> ECHO_REQUEST
+packets. With <emphasis remap='I'>deadline</emphasis> option, <command>ping</command> waits for
+<emphasis remap='I'>count</emphasis> ECHO_REPLY packets, until the timeout expires.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>-d</option></term>
+ <listitem>
+<para>Set the 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</option></term>
+ <listitem>
+<para>Print timestamp (unix time + microseconds as in gettimeofday) before
+each line.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>-f</option></term>
+ <listitem>
+<para>Flood ping. For every ECHO_REQUEST sent a period &ldquo;.&rdquo; 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 </option><emphasis remap='I'>flow label</emphasis></term>
+ <listitem>
+<para>IPv6 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</option></term>
+ <listitem>
+<para>Show help.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>-i </option><emphasis remap='I'>interval</emphasis></term>
+ <listitem>
+<para>Wait <emphasis remap='I'>interval</emphasis> 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 than 0.2 seconds.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>-I </option><emphasis remap='I'>interface</emphasis></term>
+ <listitem>
+<para><emphasis remap='I'>interface</emphasis> is either an address, or an interface name.
+If <emphasis remap='I'>interface</emphasis> is an address, it sets source address
+to specified interface address.
+If <emphasis remap='I'>interface</emphasis> in an interface name, it sets
+source interface to specified interface.
+For IPv6, when doing ping to a link-local scope
+address, link specification (by the '%'-notation in
+<emphasis remap='I'>destination</emphasis>, or by this option) is required.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>-l </option><emphasis remap='I'>preload</emphasis></term>
+ <listitem>
+<para>If <emphasis remap='I'>preload</emphasis> is specified,
+<command>ping</command> 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</option></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 </option><emphasis remap='I'>mark</emphasis></term>
+ <listitem>
+<para>use <emphasis remap='I'>mark</emphasis> 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 </option><emphasis remap='I'>pmtudisc_opt</emphasis></term>
+ <listitem>
+<para>Select Path MTU Discovery strategy.
+<emphasis remap='I'>pmtudisc_option</emphasis> may be either <emphasis remap='I'>do</emphasis>
+(prohibit fragmentation, even local one),
+<emphasis remap='I'>want</emphasis> (do PMTU discovery, fragment locally when packet size
+is large), or <emphasis remap='I'>dont</emphasis> (do not set DF flag).</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>-N </option><emphasis remap='I'>nodeinfo_option</emphasis></term>
+ <listitem>
+<para>IPv6 only.
+Send ICMPv6 Node Information Queries (RFC4620), instead of Echo Request.
+CAP_NET_RAW capability is required.</para>
+ <variablelist remap='TP'>
+ <varlistentry>
+ <term><emphasis remap='B'>help</emphasis></term>
+ <listitem>
+<para>Show help for NI support.</para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ <variablelist remap='TP'>
+ <varlistentry>
+ <term><emphasis remap='B'>name</emphasis></term>
+ <listitem>
+<para>Queries for Node Names.</para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ <variablelist remap='TP'>
+ <varlistentry>
+ <term><emphasis remap='B'>ipv6</emphasis></term>
+ <listitem>
+<para>Queries for IPv6 Addresses. There are several IPv6 specific flags.</para>
+ <variablelist remap='TP'>
+ <varlistentry>
+ <term><emphasis remap='B'>ipv6-global</emphasis></term>
+ <listitem>
+<para>Request IPv6 global-scope addresses.</para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ <variablelist remap='TP'>
+ <varlistentry>
+ <term><emphasis remap='B'>ipv6-sitelocal</emphasis></term>
+ <listitem>
+<para>Request IPv6 site-local addresses.</para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ <variablelist remap='TP'>
+ <varlistentry>
+ <term><emphasis remap='B'>ipv6-linklocal</emphasis></term>
+ <listitem>
+<para>Request IPv6 link-local addresses.</para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ <variablelist remap='TP'>
+ <varlistentry>
+ <term><emphasis remap='B'>ipv6-all</emphasis></term>
+ <listitem>
+<para>Request IPv6 addresses on other interfaces.</para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ <variablelist remap='TP'>
+ <varlistentry>
+ <term><emphasis remap='B'>ipv4</emphasis></term>
+ <listitem>
+<para>Queries for IPv4 Addresses. There is one IPv4 specific flag.</para>
+ <variablelist remap='TP'>
+ <varlistentry>
+ <term><emphasis remap='B'>ipv4-all</emphasis></term>
+ <listitem>
+<para>Request IPv4 addresses on other interfaces.</para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ <variablelist remap='TP'>
+ <varlistentry>
+ <term><emphasis remap='B'>subject-ipv6=</emphasis><emphasis remap='I'>ipv6addr</emphasis></term>
+ <listitem>
+<para>IPv6 subject address.</para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ <variablelist remap='TP'>
+ <varlistentry>
+ <term><emphasis remap='B'>subject-ipv4=</emphasis><emphasis remap='I'>ipv4addr</emphasis></term>
+ <listitem>
+<para>IPv4 subject address.</para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ <variablelist remap='TP'>
+ <varlistentry>
+ <term><emphasis remap='B'>subject-name=</emphasis><emphasis remap='I'>nodename</emphasis></term>
+ <listitem>
+<para>Subject name. If it contains more than one dot,
+fully-qualified domain name is assumed.</para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ <variablelist remap='TP'>
+ <varlistentry>
+ <term><emphasis remap='B'>subject-fqdn=</emphasis><emphasis remap='I'>nodename</emphasis></term>
+ <listitem>
+<para>Subject name. Fully-qualified domain name is
+always assumed.</para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>-n</option></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</option></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 </option><emphasis remap='I'>pattern</emphasis></term>
+ <listitem>
+<para>You may specify up to 16 &ldquo;pad&rdquo; 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</option></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 </option><emphasis remap='I'>tos</emphasis></term>
+ <listitem>
+<para>Set Quality of Service -related bits in ICMP datagrams.
+<emphasis remap='I'>tos</emphasis> can be decimal (<command>ping</command> 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</option></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</option> is also
+used.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>-R</option></term>
+ <listitem>
+<para><command>ping</command> 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 </option><emphasis remap='I'>packetsize</emphasis></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 </option><emphasis remap='I'>sndbuf</emphasis></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 </option><emphasis remap='I'>ttl</emphasis></term>
+ <listitem>
+<para><command>ping</command> only.
+Set the IP Time to Live.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>-T </option><emphasis remap='I'>timestamp option</emphasis></term>
+ <listitem>
+<para>Set special IP timestamp options.
+<emphasis remap='I'>timestamp option</emphasis> may be either
+<emphasis remap='I'>tsonly</emphasis> (only timestamps),
+<emphasis remap='I'>tsandaddr</emphasis> (timestamps and addresses) or
+<emphasis remap='I'>tsprespec host1 [host2 [host3 [host4]]]</emphasis>
+(timestamp prespecified hops).</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>-U</option></term>
+ <listitem>
+<para>Print full user-to-user latency (the old behaviour). Normally
+<command>ping</command>
+prints network round trip time, which can be different
+f.e. due to DNS failures.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>-v</option></term>
+ <listitem>
+<para>Verbose output.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>-V</option></term>
+ <listitem>
+<para>Show version and exit.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>-w </option><emphasis remap='I'>deadline</emphasis></term>
+ <listitem>
+<para>Specify a timeout, in seconds, before
+<command>ping</command>
+exits regardless of how many
+packets have been sent or received. In this case
+<command>ping</command>
+does not stop after
+<emphasis remap='I'>count</emphasis>
+packet are sent, it waits either for
+<emphasis remap='I'>deadline</emphasis>
+expire or until
+<emphasis remap='I'>count</emphasis>
+probes are answered or for some error notification from network.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>-W </option><emphasis remap='I'>timeout</emphasis></term>
+ <listitem>
+<para>Time to wait for a response, in seconds. The option affects only timeout
+in absence of any responses, otherwise <command>ping</command> waits for two RTTs.</para>
+
+<para>When using <command>ping</command> 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
+&ldquo;pinged&rdquo;. 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
+SIGINT, a brief summary is displayed. Shorter current statistics
+can be obtained without termination of process with signal
+SIGQUIT.</para>
+
+<para>If <command>ping</command> does not receive any reply packets at all it will
+exit with code 1. If a packet
+<emphasis remap='I'>count</emphasis>
+and
+<emphasis remap='I'>deadline</emphasis>
+are both specified, and fewer than
+<emphasis remap='I'>count</emphasis>
+packets are received by the time the
+<emphasis remap='I'>deadline</emphasis>
+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</command> during normal operations or from automated scripts.</para>
+ </listitem>
+ </varlistentry>
+</variablelist>
+</refsect1>
+
+<refsect1 id='icmp_packet_details'><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 <emphasis remap='I'>packetsize</emphasis> 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 struct timeval
+<command>ping</command> 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 id='duplicate_and_damaged_packets'><title>DUPLICATE AND DAMAGED PACKETS</title>
+<para><command>ping</command> 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</command> packet's path (in the network or in the hosts).</para>
+</refsect1>
+
+<refsect1 id='trying_different_data_patterns'>
+ <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 &ldquo;transitions&rdquo;, 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> option of <command>ping</command>.</para>
+</refsect1>
+
+<refsect1 id='ttl_details'><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 &ldquo;ping&rdquo; some hosts, but not reach them
+with
+<citerefentry><refentrytitle>telnet</refentrytitle><manvolnum>1</manvolnum></citerefentry>
+or
+<citerefentry><refentrytitle>ftp</refentrytitle><manvolnum>1</manvolnum></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>
+<variablelist remap='TP'>
+ <varlistentry>
+ <listitem>
+<para>&bull; 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>
+ </varlistentry>
+ <varlistentry>
+ <listitem>
+<para>&bull; 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 remap='B'>from</emphasis>
+the remote system <emphasis remap='B'>to</emphasis> the <command>ping</command>ing host.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <listitem>
+<para>&bull; 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>
+ </varlistentry>
+</variablelist>
+</refsect1>
+
+<refsect1 id='bugs'><title>BUGS</title>
+<variablelist remap='TP'>
+ <varlistentry>
+ <listitem>
+<para>&bull; Many Hosts and Gateways ignore the RECORD_ROUTE option.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <listitem>
+<para>&bull; The maximum IP header length is too small for options like
+RECORD_ROUTE to be completely useful.
+There's not much that can be done about this, however.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <listitem>
+<para>&bull; Flood pinging is not recommended in general, and flood pinging the
+broadcast address should only be done under very controlled conditions.</para>
+ </listitem>
+ </varlistentry>
+</variablelist>
+</refsect1>
+
+<refsect1 id='see_also'>
+ <title>SEE ALSO</title>
+ <para><citerefentry><refentrytitle>netstat</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
+<citerefentry><refentrytitle>ifconfig</refentrytitle><manvolnum>8</manvolnum></citerefentry>.</para>
+</refsect1>
+
+<refsect1 id='history'>
+ <title>HISTORY</title>
+ <para>The <command>ping</command> command appeared in 4.3BSD.</para>
+
+ <para>The version described here is its descendant specific to Linux.</para>
+
+ <para>As of version s20150815, the <emphasis remap='B'>ping6</emphasis> binary doesn't exist anymore.
+It has been merged into <command>ping</command>. Creating a symlink named
+<emphasis remap='B'>ping6</emphasis> pointing to <command>ping</command> will result in the same
+funcionality as before.</para>
+</refsect1>
+
+<refsect1 id='security'>
+ <title>SECURITY</title>
+<para><command>ping</command> requires CAP_NET_RAW capability
+to be executed 1) if the program is used for non-echo queries
+(See <option>-N</option> option), or 2) if kernel does not
+support non-raw ICMP sockets, or 3) if the user is not allowed
+to create an ICMP echo socket. The program may be used as
+set-uid root.</para>
+</refsect1>
+
+<refsect1 id='availability'>
+ <title>AVAILABILITY</title>
+ <para><command>ping</command> is part of <emphasis remap='I'>iputils</emphasis> package.</para>
+</refsect1>
+</refentry>
diff --git a/doc/rarpd.sgml b/doc/rarpd.sgml
deleted file mode 100644
index 9f86ef0..0000000
--- a/doc/rarpd.sgml
+++ /dev/null
@@ -1,170 +0,0 @@
-<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/rarpd.xml b/doc/rarpd.xml
new file mode 100644
index 0000000..8d3ece8
--- /dev/null
+++ b/doc/rarpd.xml
@@ -0,0 +1,124 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
+ "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd">
+<!-- lifted from man+troff by doclifter -->
+<refentry id='rarpd8'>
+<refmeta>
+ <refentrytitle>RARPD</refentrytitle>
+ <manvolnum>8</manvolnum>
+ <refmiscinfo class='manual'>iputils</refmiscinfo>
+</refmeta>
+<refnamediv>
+ <refname>rarpd</refname>
+ <refpurpose>answer RARP REQUESTs</refpurpose>
+</refnamediv>
+<!-- body begins here -->
+<refsynopsisdiv id='synopsis'>
+ <cmdsynopsis>
+ <command>arping</command>
+ <arg choice='opt'>-aAvde </arg>
+ <arg choice='opt'>-b <replaceable>bootdir</replaceable></arg>
+ <arg choice='opt'><replaceable>interface</replaceable></arg>
+ <sbr/>
+ </cmdsynopsis>
+</refsynopsisdiv>
+
+
+<refsect1 id='description'>
+ <title>DESCRIPTION</title>
+ <para>Listens RARP 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, <emphasis remap='B'>rarpd</emphasis> answers to client with RARPD
+reply carrying an IP address.</para>
+
+ <para>To allow multiple boot servers on the network <emphasis remap='B'>rarpd</emphasis>
+optionally checks for presence Sun-like bootable image in TFTP directory.
+It should have form <emphasis remap='B'>Hexadecimal_IP.ARCH</emphasis>, f.e. to load
+sparc 193.233.7.98 <emphasis remap='I'>C1E90762.SUN4M</emphasis> is linked to
+an image appropriate for SUM4M in directory <filename>/etc/tftpboot</filename>.</para>
+</refsect1>
+
+<refsect1 id='warning'>
+ <title>WARNING</title>
+ <para>This facility is deeply obsoleted by
+BOOTP
+and later
+DHCP protocols.
+However, some clients really still need this to boot.</para>
+</refsect1>
+
+<refsect1 id='options'>
+ <title>OPTIONS</title>
+<variablelist remap='TP'>
+ <varlistentry>
+ <term><option>-a</option></term>
+ <listitem>
+<para>Listen on all the interfaces. Currently it is an internal
+option, its function is overridden with <emphasis remap='I'>interface</emphasis>
+argument. It should not be used.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>-A</option></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</option></term>
+ <listitem>
+<para>Be verbose.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>-d</option></term>
+ <listitem>
+<para>Debug mode. Do not go to background.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>-e</option></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 </option><emphasis remap='I'>bootdir</emphasis></term>
+ <listitem>
+<para>TFTP boot directory. Default is <filename>/etc/tftpboot</filename></para>
+ </listitem>
+ </varlistentry>
+</variablelist>
+</refsect1>
+
+<refsect1 id='see_also'>
+ <title>SEE ALSO</title>
+ <para><citerefentry><refentrytitle>arping</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
+<citerefentry><refentrytitle>tftpd</refentrytitle><manvolnum>8</manvolnum></citerefentry>.</para>
+</refsect1>
+
+<refsect1 id='author'>
+ <title>AUTHOR</title>
+ <para><emphasis remap='B'>rarpd</emphasis> was written by Alexey Kuznetsov &lt;kuznet@ms2.inr.ac.ru&gt;.</para>
+</refsect1>
+
+<refsect1 id='security'>
+ <title>SECURITY</title>
+ <para><emphasis remap='B'>rarpd</emphasis> requires CAP_NET_RAW capability
+to listen and send RARP and ARP packets. It also needs 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 id='availability'>
+ <title>AVAILABILITY</title>
+ <para><emphasis remap='B'>rarpd</emphasis> is part of <emphasis remap='I'>iputils</emphasis> package.</para>
+</refsect1>
+</refentry>
diff --git a/doc/rdisc.sgml b/doc/rdisc.sgml
deleted file mode 100644
index f991cb9..0000000
--- a/doc/rdisc.sgml
+++ /dev/null
@@ -1,246 +0,0 @@
-<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/rdisc.xml b/doc/rdisc.xml
new file mode 100644
index 0000000..73a9dee
--- /dev/null
+++ b/doc/rdisc.xml
@@ -0,0 +1,182 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
+ "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd">
+<!-- lifted from man+troff by doclifter -->
+<refentry id='rdisc8'>
+<refmeta>
+ <refentrytitle>RDISC</refentrytitle>
+ <manvolnum>8</manvolnum>
+ <refmiscinfo class='manual'>iputils</refmiscinfo>
+</refmeta>
+<refnamediv>
+ <refname>rdisc</refname>
+ <refpurpose>network router discovery daemon</refpurpose>
+</refnamediv>
+<!-- body begins here -->
+<refsynopsisdiv id='synopsis'>
+ <cmdsynopsis>
+ <command>rdisc</command>
+ <arg choice='opt'>-abdfrstvV </arg>
+ <arg choice='opt'>-p <replaceable>preference</replaceable></arg>
+ <arg choice='opt'>-T <replaceable>max_interval</replaceable></arg>
+ <arg choice='opt'><replaceable>send_address</replaceable></arg>
+ <arg choice='opt'><replaceable>receive_address</replaceable></arg>
+ <sbr/>
+ </cmdsynopsis>
+</refsynopsisdiv>
+
+<refsect1 id='description'>
+ <title>DESCRIPTION</title>
+ <para><command>rdisc</command> implements client side of the ICMP router discover protocol.
+<command>rdisc</command> is invoked at boot time to populate the network
+routing tables with default routes.</para>
+
+ <para><command>rdisc</command> listens on the ALL_HOSTS (224.0.0.1) multicast address
+(or <emphasis remap='I'>receive_address</emphasis> 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</command> 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 <emphasis remap='I'>send_address</emphasis> 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 remap='B'>advertise</emphasis> message is received from the router.
+The address will also be excluded from consideration if the host receives an
+<emphasis remap='B'>advertise</emphasis>
+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 <emphasis remap='B'>gated</emphasis>.
+Or, <command>rdisc</command> can act as responder, if compiled with -DRDISC_SERVER.</para>
+</refsect1>
+
+<refsect1 id='options'>
+ <title>OPTIONS</title>
+<variablelist remap='TP'>
+ <varlistentry>
+ <term><option>-a</option></term>
+ <listitem>
+<para>Accept all routers independently of the preference they have in their
+<emphasis remap='B'>advertise</emphasis> messages.
+Normally <command>rdisc</command> only accepts (and enters in the kernel routing
+tables) the router or routers with the highest preference.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>-b</option></term>
+ <listitem>
+<para>Opposite to <option>-a</option>, i.e. install only router with the best
+preference value. It is default behaviour.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>-d</option></term>
+ <listitem>
+<para>Send debugging messages to syslog.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>-f</option></term>
+ <listitem>
+<para>Run <command>rdisc</command> forever even if no routers are found.
+Normally <command>rdisc</command> gives up if it has not received any
+<emphasis remap='B'>advertise</emphasis> message after after soliciting three times,
+in which case it exits with a non-zero exit code.
+If <option>-f</option> is not specified in the first form then
+<option>-s</option> must be specified.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>-r</option></term>
+ <listitem>
+<para>Responder mode, available only if compiled with -DRDISC_SERVER.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>-s</option></term>
+ <listitem>
+<para>Send three <emphasis remap='B'>solicitation</emphasis> messages initially to quickly discover
+the routers when the system is booted.
+When <option>-s</option> is specified <command>rdisc</command>
+exits with a non-zero exit code if it can not find any routers.
+This can be overridden with the <option>-f</option> option.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>-p </option><emphasis remap='I'>preference</emphasis></term>
+ <listitem>
+<para>Set preference in advertisement.
+Available only with -r option.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>-T </option><emphasis remap='I'>max_interval</emphasis></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</option></term>
+ <listitem>
+<para>Test mode. Do not go to background.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>-v</option></term>
+ <listitem>
+<para>Be verbose i.e. send lots of debugging messages to syslog.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>-V</option></term>
+ <listitem>
+<para>Print version and exit.</para>
+ </listitem>
+ </varlistentry>
+</variablelist>
+</refsect1>
+
+<refsect1 id='history'>
+ <title>HISTORY</title>
+ <para>This program was developed by Sun Microsystems (see copyright
+notice in source file). It was ported to Linux by
+Alexey Kuznetsov&lt;kuznet@ms2.inr.ac.ru&gt;.</para>
+</refsect1>
+
+<refsect1 id='see_also'>
+ <title>SEE ALSO</title>
+ <para><citerefentry><refentrytitle>icmp</refentrytitle><manvolnum>7</manvolnum></citerefentry>,
+<citerefentry><refentrytitle>inet</refentrytitle><manvolnum>7</manvolnum></citerefentry>,
+<citerefentry><refentrytitle>ping</refentrytitle><manvolnum>8</manvolnum></citerefentry>.</para>
+</refsect1>
+
+<refsect1 id='references'>
+ <title>REFERENCES</title>
+ <para>Deering, S.E.,ed "ICMP Router Discovery Messages",
+RFC1256, Network Information Center, SRI International,
+Menlo Park, Calif., September 1991.</para>
+</refsect1>
+
+<refsect1 id='security'>
+ <title>SECURITY</title>
+ <para><command>rdisc</command> requires CAP_NET_RAW to listen
+and send ICMP messages and capability CAP_NET_ADMIN
+to update routing tables.</para>
+</refsect1>
+
+<refsect1 id='availability'>
+ <title>AVAILABILITY</title>
+ <para><command>rdisc</command> is part of <emphasis remap='I'>iputils</emphasis> package.</para>
+</refsect1>
+</refentry>
+
diff --git a/doc/snapshot.db b/doc/snapshot.db
deleted file mode 100644
index 836fac2..0000000
--- a/doc/snapshot.db
+++ /dev/null
@@ -1 +0,0 @@
-161105
diff --git a/doc/tftpd.sgml b/doc/tftpd.sgml
deleted file mode 100644
index fe7fd7c..0000000
--- a/doc/tftpd.sgml
+++ /dev/null
@@ -1,151 +0,0 @@
-<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/tftpd.xml b/doc/tftpd.xml
new file mode 100644
index 0000000..9a362e7
--- /dev/null
+++ b/doc/tftpd.xml
@@ -0,0 +1,104 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
+ "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd">
+<!-- lifted from man+troff by doclifter -->
+<refentry id='tftpd8'>
+<refmeta>
+ <refentrytitle>TFTPD</refentrytitle>
+ <manvolnum>8</manvolnum>
+ <refmiscinfo class='manual'>iputils</refmiscinfo>
+</refmeta>
+<refnamediv>
+ <refname>tftpd</refname>
+ <refpurpose>Trivial File Transfer Protocol server</refpurpose>
+</refnamediv>
+<!-- body begins here -->
+<refsynopsisdiv id='synopsis'>
+ <cmdsynopsis>
+ <command>tftpd</command>
+ <arg choice='plain'><replaceable>directory</replaceable></arg>
+ <sbr/>
+</cmdsynopsis>
+</refsynopsisdiv>
+
+
+<refsect1 id='description'>
+ <title>DESCRIPTION</title>
+ <para><command>tftpd</command> is a server which supports the DARPA
+Trivial File Transfer Protocol (RFC1350).
+The TFTP server is started by
+<citerefentry><refentrytitle>inetd</refentrytitle><manvolnum>8</manvolnum></citerefentry>.</para>
+
+<para><emphasis remap='I'>directory</emphasis> is required argument; if it is not given
+<command>tftpd</command> aborts. This path is prepended to any file name requested
+via TFTP protocol, effectively chrooting <command>tftpd</command> 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</command> 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</command> is used together with
+<citerefentry><refentrytitle>rarpd</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
+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
+<citerefentry><refentrytitle>rarpd</refentrytitle><manvolnum>8</manvolnum></citerefentry>
+for more details.</para>
+</refsect1>
+
+<refsect1 id='security'>
+ <title>SECURITY</title>
+ <para>TFTP protocol does not provide any authentication.
+Due to this capital flaw <command>tftpd</command> 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 remap='B'>must not</emphasis>
+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 remap='B'>unencrypted</emphasis> passwords and may contain some information
+about the network, which you were not going to make public.</para>
+
+<para>The <command>tftpd</command> server should be executed by <emphasis remap='B'>inetd</emphasis>
+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</command> 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 id='see_also'>
+ <title>SEE ALSO</title>
+ <para><citerefentry><refentrytitle>rarpd</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
+<citerefentry><refentrytitle>tftp</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
+<citerefentry><refentrytitle>inetd</refentrytitle><manvolnum>8</manvolnum></citerefentry>.</para>
+</refsect1>
+
+<refsect1 id='history'>
+ <title>HISTORY</title>
+ <para>The <command>tftpd</command> 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
+(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 id='availability'>
+ <title>AVAILABILITY</title>
+ <para><command>tftpd</command> is part of <emphasis remap='I'>iputils</emphasis> package.</para>
+</refsect1>
+</refentry>
diff --git a/doc/tracepath.sgml b/doc/tracepath.sgml
deleted file mode 100644
index ba47783..0000000
--- a/doc/tracepath.sgml
+++ /dev/null
@@ -1,217 +0,0 @@
-<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">-4</arg>
-<arg choice="opt">-6</arg>
-<arg choice="opt">-n</arg>
-<arg choice="opt">-b</arg>
-<arg choice="opt">-l <replaceable/pktlen/</arg>
-<arg choice="opt">-m <replaceable/max_hops/</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>-4</option></term>
- <listitem><para>
-Use IPv4 only.
- </para></listitem>
- </varlistentry>
-
- <varlistentry>
- <term><option>-6</option></term>
- <listitem><para>
-Use IPv6 only.
- </para></listitem>
- </varlistentry>
-
- <varlistentry>
- <term><option>-n</option></term>
- <listitem><para>
-Print primarily IP addresses numerically.
- </para></listitem>
- </varlistentry>
-
- <varlistentry>
- <term><option>-b</option></term>
- <listitem><para>
-Print both of host names and IP addresses.
- </para></listitem>
- </varlistentry>
-
- <varlistentry>
- <term><option>-l</option></term>
- <listitem><para>
-Sets the initial packet length to <replaceable/pktlen/ instead of
-65535 for <command/tracepath/ or 128000 for <command/tracepath6/.
- </para></listitem>
- </varlistentry>
-
- <varlistentry>
- <term><option>-m</option></term>
- <listitem><para>
-Set maximum hops (or maximum TTLs) to <replaceable/max_hops/
-instead of 30.
- </para></listitem>
- </varlistentry>
-
- <varlistentry>
- <term><option>-p</option></term>
- <listitem><para>
-Sets the initial destination port to use.
- </para></listitem>
- </varlistentry>
-</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/tracepath.xml b/doc/tracepath.xml
new file mode 100644
index 0000000..e44e56a
--- /dev/null
+++ b/doc/tracepath.xml
@@ -0,0 +1,165 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
+ "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd">
+<!-- lifted from man+troff by doclifter -->
+<refentry id='tracepath8'>
+<refmeta>
+ <refentrytitle>TRACEPATH</refentrytitle>
+ <manvolnum>8</manvolnum>
+ <refmiscinfo class='manual'>iputils</refmiscinfo>
+</refmeta>
+<refnamediv>
+ <refname>tracepath</refname>
+ <refname>tracepath6</refname>
+ <refpurpose>traces path to a network host discovering MTU along this path</refpurpose>
+</refnamediv>
+<!-- body begins here -->
+<refsynopsisdiv id='synopsis'>
+<cmdsynopsis>
+ <command>tracepath</command>
+ <arg choice='opt'>-4 </arg>
+ <arg choice='opt'>-6 </arg>
+ <arg choice='opt'>-n </arg>
+ <arg choice='opt'>-b </arg>
+ <arg choice='opt'>-l <replaceable>pktlen</replaceable></arg>
+ <arg choice='opt'>-m <replaceable>max_hops</replaceable></arg>
+ <arg choice='opt'>-p <replaceable>port</replaceable></arg>
+ <arg choice='plain'><replaceable>destination</replaceable></arg>
+ <sbr/>
+ </cmdsynopsis>
+</refsynopsisdiv>
+
+
+<refsect1 id='description'>
+ <title>DESCRIPTION</title>
+ <para>It traces path to <emphasis remap='I'>destination</emphasis> discovering MTU along this path.
+It uses UDP port <emphasis remap='I'>port</emphasis> or some random port.
+It is similar to <emphasis remap='B'>traceroute</emphasis>, only does not require superuser
+privileges and has no fancy options.</para>
+
+ <para><emphasis remap='B'>tracepath6</emphasis> is good replacement for <emphasis remap='B'>traceroute6</emphasis>
+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 id='options'>
+ <title>OPTIONS</title>
+<variablelist remap='TP'>
+ <varlistentry>
+ <term><option>-4</option></term>
+ <listitem>
+<para>Use IPv4 only..</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>-6</option></term>
+ <listitem>
+<para>Use IPv6 only..</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>-n</option></term>
+ <listitem>
+<para>Print primarily IP addresses numerically.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>-b</option></term>
+ <listitem>
+<para>Print both of host names and IP addresses.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>-l</option></term>
+ <listitem>
+<para>Sets the initial packet length to <emphasis remap='I'>pktlen</emphasis> instead of
+65535 for <command>tracepath</command> or 128000 for <emphasis remap='B'>tracepath6</emphasis>.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>-m</option></term>
+ <listitem>
+<para>Set maximum hops (or maximum TTLs) to <emphasis remap='I'>max_hops</emphasis>
+instead of 30.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>-p</option></term>
+ <listitem>
+<para>Sets the initial destination port to use.</para>
+ </listitem>
+ </varlistentry>
+</variablelist>
+</refsect1>
+
+<refsect1 id='output'>
+ <title>OUTPUT</title>
+ <literallayout remap='.nf'>
+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> <!-- .fi -->
+
+<para>The first column shows TTL of the probe, followed by colon.
+Usually value of 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 [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 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 id='see_also'>
+ <title>SEE ALSO</title>
+ <para><citerefentry><refentrytitle>traceroute</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
+<citerefentry><refentrytitle>traceroute6</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
+<citerefentry><refentrytitle>ping</refentrytitle><manvolnum>8</manvolnum></citerefentry>.</para>
+</refsect1>
+
+<refsect1 id='author'>
+ <title>AUTHOR</title>
+ <para><command>tracepath</command> was written by
+Alexey Kuznetsov &lt;kuznet@ms2.inr.ac.ru&gt;.</para>
+</refsect1>
+
+<refsect1 id='security'>
+ <title>SECURITY</title>
+ <para>No security issues.</para>
+
+ <para>This lapidary deserves to be elaborated.
+<command>tracepath</command> is not a privileged program, unlike
+<emphasis remap='B'>traceroute</emphasis>, <emphasis remap='B'>ping</emphasis> and other beasts of this kind.
+<command>tracepath</command> 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 id='availability'>
+ <title>AVAILABILITY</title>
+ <para><command>tracepath</command> is part of <emphasis remap='I'>iputils</emphasis> package.</para>
+</refsect1>
+</refentry>
+
diff --git a/doc/traceroute6.sgml b/doc/traceroute6.sgml
deleted file mode 100644
index e47dd13..0000000
--- a/doc/traceroute6.sgml
+++ /dev/null
@@ -1,97 +0,0 @@
-<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>
diff --git a/doc/traceroute6.xml b/doc/traceroute6.xml
new file mode 100644
index 0000000..58cb412
--- /dev/null
+++ b/doc/traceroute6.xml
@@ -0,0 +1,69 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
+ "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd">
+<!-- lifted from man+troff by doclifter -->
+<refentry id='traceroute68'>
+<refmeta>
+ <refentrytitle>TRACEROUTE6</refentrytitle>
+ <manvolnum>8</manvolnum>
+<refmiscinfo class='manual'>iputils</refmiscinfo>
+</refmeta>
+<refnamediv>
+ <refname>traceroute6</refname>
+ <refpurpose>traces path to a network host</refpurpose>
+</refnamediv>
+<!-- body begins here -->
+<refsynopsisdiv id='synopsis'>
+ <cmdsynopsis>
+ <command>traceroute6</command>
+ <arg choice='opt'>-dnrvV </arg>
+ <arg choice='opt'>-i <replaceable>interface</replaceable></arg>
+ <arg choice='opt'>-m <replaceable>max_ttl</replaceable></arg>
+ <arg choice='opt'>-p <replaceable>port</replaceable></arg>
+ <arg choice='opt'>-q <replaceable>max_probes</replaceable></arg>
+ <arg choice='opt'>-s <replaceable>source</replaceable></arg>
+ <arg choice='opt'><arg choice='plain'>-w <replaceable>wait</replaceable></arg><arg choice='plain'><replaceable>time</replaceable></arg></arg>
+ <arg choice='plain'><replaceable>destination</replaceable></arg>
+ <arg choice='opt'><replaceable>size</replaceable></arg>
+ <sbr/>
+ </cmdsynopsis>
+</refsynopsisdiv>
+
+
+<refsect1 id='description'>
+ <title>DESCRIPTION</title>
+ <para>Description can be found in
+<citerefentry><refentrytitle>traceroute</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
+all the references to IP replaced to IPv6. It is needless to copy
+the description from there.</para>
+</refsect1>
+
+<refsect1 id='see_also'>
+ <title>SEE ALSO</title>
+ <para><citerefentry><refentrytitle>traceroute</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
+<citerefentry><refentrytitle>tracepath</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
+<citerefentry><refentrytitle>ping</refentrytitle><manvolnum>8</manvolnum></citerefentry>.</para>
+</refsect1>
+
+<refsect1 id='history'>
+ <title>HISTORY</title>
+ <para>This program has long history. Author of <emphasis remap='B'>traceroute</emphasis>
+is Van Jacobson and it first appeared in 1988. This clone is
+based on a port of <emphasis remap='B'>traceroute</emphasis> 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 Alexey Kuznetsov
+&lt;kuznet@ms2.inr.ac.ru&gt;. And eventually entered
+<emphasis remap='B'>iputils</emphasis> package.</para>
+</refsect1>
+
+<refsect1 id='security'>
+ <title>SECURITY</title>
+ <para><emphasis remap='B'>tracepath6</emphasis> requires CAP_NET_RAW capability
+to be executed. It is safe to be used as set-uid root.</para>
+</refsect1>
+
+<refsect1 id='availability'>
+ <title>AVAILABILITY</title>
+ <para><command>traceroute6</command> is part of <emphasis remap='I'>iputils</emphasis> package.</para>
+</refsect1>
+</refentry>