Skip to contentSkip to conversation

documentation enhancements

PATCH New Phil Sutter 1 participant 7 messages Sep 18, 2015

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover documentation enhancements

This series extends manpages of ip-address and ip by a few smaller things, practically rewrites lnstat manpage to cover in detail what it is used for and what the meanings of the available statistics are, adds a minimal manpage for the rtpr script and last but not least fixes two remaining file headers listing an incorrect FSF address.

Phil Sutter (6):
man: ip-address: align synopsis with help output
man: ip: add -h[uman-readable] option
comment: Fix remaining listings of wrong FSF address
man: ip-address: document mngtmpaddr and noprefixroute flags
man: lnstat: rewrite manpage
man: rtpr: add minimal manpage

 include/linux/tc_act/tc_skbedit.h |   3 +-
 man/man8/Makefile                 |   2 +-
 man/man8/ip-address.8.in          |  20 +++-
 man/man8/ip.8                     |   5 +
 man/man8/lnstat.8                 | 197 +++++++++++++++++++++++++++++++++++++-
 man/man8/rtpr.8                   |  25 +++++
 tc/m_connmark.c                   |   3 +-
 7 files changed, 243 insertions(+), 12 deletions(-)
 create mode 100644 man/man8/rtpr.8
Signature · 1 line
2.1.2
#1 lore raw

PATCH 1/6 man: ip-address: align synopsis with help output

When fixing the BNF syntax error, I overlooked that 'ip address help' prints a more correct synopsis. This patch aligns them.

Fixes 715296b ("ip-address.8.in: fix BNF syntax error")
---
 man/man8/ip-address.8.in | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
man/man8/ip-address.8.in +1 -1
index f1efc43..43611b9 100644
@@ -60,7 +60,7 @@ ip-address \- protocol address management
 .IR FLAG " := "
 .RB "[ " permanent " | " dynamic " | " secondary " | " primary " | \
 [ - ] " tentative " | [ - ] " deprecated " | [ - ] " dadfailed " | "\
-temporary " ] [ " CONFFLAG-LIST " ]"
+temporary " | " CONFFLAG-LIST " ]"
 
 .ti -8
 .IR CONFFLAG-LIST " := [ "  CONFFLAG-LIST " ] " CONFFLAG
Signature · 1 line
2.1.2
#2 lore raw

PATCH 2/6 man: ip: add -h[uman-readable] option

In reply to Phil Sutter

Since 'ip help' lists it, it should be described in ip.8 as well.

---
 man/man8/ip.8 | 5 +++++
 1 file changed, 5 insertions(+)
man/man8/ip.8 +5 -0
index 9da086d..e6c2b32 100644
@@ -27,6 +27,7 @@ ip \- show / manipulate routing, devices, policy routing and tunnels
 .ti -8
 .IR OPTIONS " := { "
 \fB\-V\fR[\fIersion\fR] |
+\fB\-h\fR[\fIuman-readable\fR] |
 \fB\-s\fR[\fItatistics\fR] |
 \fB\-r\fR[\fIesolve\fR] |
 \fB\-f\fR[\fIamily\fR] {
@@ -46,6 +47,10 @@ Print the version of the
 utility and exit.
 
 .TP
+.BR "\-h", " \-human", " \-human-readable"
+output statistics with human readable values followed by suffix.
+
+.TP
 .BR "\-b", " \-batch " <FILENAME>
 Read commands from provided file or standard input and invoke them.
 First failure will cause termination of ip.
Signature · 1 line
2.1.2
#3 lore raw

PATCH 3/6 comment: Fix remaining listings of wrong FSF address

In reply to Phil Sutter

This patch follows the changes of commit 4d98ab0 ("Fix FSF address in file headers"), fixing file headers added after it.

---
 include/linux/tc_act/tc_skbedit.h | 3 +--
 tc/m_connmark.c                   | 3 +--
 2 files changed, 2 insertions(+), 4 deletions(-)
include/linux/tc_act/tc_skbedit.h +1 -2
index 7a2e910..73026b3 100644
@@ -11,8 +11,7 @@
  * more details.
  *
  * You should have received a copy of the GNU General Public License along with
- * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
- * Place - Suite 330, Boston, MA 02111-1307 USA.
+ * this program; if not, see <http://www.gnu.org/licenses>.
  *
  * Author: Alexander Duyck <[email protected]>
  */
tc/m_connmark.c +1 -2
index 51938dc..41ca4b2 100644
@@ -13,8 +13,7 @@
  * more details.
  *
  * You should have received a copy of the GNU General Public License along with
- * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
- * Place - Suite 330, Boston, MA 02111-1307 USA.
+ * this program; if not, see <http://www.gnu.org/licenses>.
  */
 
 #include <stdio.h>
Signature · 1 line
2.1.2
#4 lore raw

PATCH 4/6 man: ip-address: document mngtmpaddr and noprefixroute flags

In reply to Phil Sutter
---
 man/man8/ip-address.8.in | 18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)
man/man8/ip-address.8.in +17 -1
index 43611b9..159d906 100644
@@ -67,7 +67,7 @@ temporary " | " CONFFLAG-LIST " ]"
 
 .ti -8
 .IR CONFFLAG " := "
-.RB "[ " home " | " nodad " ]"
+.RB "[ " home " | " mngtmpaddr " | " nodad " | " noprefixroute " ]"
 
 .ti -8
 .IR LIFETIME " := [ "
@@ -181,10 +181,26 @@ outgoing connections. Defaults to
 RFC 6275.
 
 .TP
+.B mngtmpaddr
+(IPv6 only) make the kernel manage temporary addresses created from this one as
+template on behalf of Privacy Extensions (RFC3041). For this to become active,
+the \fBuse_tempaddr\fP sysctl setting has to be set to a value greater than
+zero.  The given address needs to have a prefix length of 64. This flag allows
+to use privacy extensions in a manually configured network, just like if
+stateless auto-configuration was active.
+
+.TP
 .B nodad
 (IPv6 only) do not perform Duplicate Address Detection (RFC 4862) when
 adding this address.
 
+.TP
+.B noprefixroute
+Do not automatically create a route for the network prefix of the added
+address, and don't search for one to delete when removing the address. Changing
+an address to add this flag will remove the automatically added prefix route,
+changing it to remove this flag will create the prefix route automatically.
+
 .SS ip address delete - delete protocol address
 .B Arguments:
 coincide with the arguments of
Signature · 1 line
2.1.2
#5 lore raw

PATCH 5/6 man: lnstat: rewrite manpage

In reply to Phil Sutter
---
 man/man8/lnstat.8 | 197 ++++++++++++++++++++++++++++++++++++++++++++++++++++--
 1 file changed, 192 insertions(+), 5 deletions(-)
man/man8/lnstat.8 +192 -5
index 699ddf4..69fe876 100644
@@ -9,9 +9,21 @@ This manual page documents briefly the
 .B lnstat
 command.
 .PP
-\fBlnstat\fP is a generalized and more feature-complete replacement for the old rtstat program.
-In addition to routing cache statistics, it supports any kind of statistics the linux kernel
-exports via a file in /proc/net/stat/.
+\fBlnstat\fP is a generalized and more feature-complete replacement for the old
+rtstat program. It is commonly used to periodically print a selection of
+statistical values exported by the kernel.
+In addition to routing cache statistics, it supports any kind of statistics the
+linux kernel exports via a file in /proc/net/stat/.
+.PP
+Each file in /proc/net/stat/ contains a header line listing the column names.
+These names are used by \fBlnstat\fP as keys for selecting which statistics to
+print. For every CPU present in the system, a line follows which lists the
+actual values for each column of the file. \fBlnstat\fP sums these values up
+(which in fact are counters) before printing them. After each interval, only
+the difference to the last value is printed.
+.PP
+Files and columns may be selected by using the \fB-f\fP and \fB-k\fP
+parameters. By default, all columns of all files are printed.
 .SH OPTIONS
 lnstat supports the following options.
 .TP
@@ -28,7 +40,7 @@ Print <count> number of intervals.
 Dump list of available files/keys.
 .TP
 .B \-f, \-\-file <file>
-Statistics file to use.
+Statistics file to use, may be specified multiple times. By default all files in /proc/net/stat are scanned.
 .TP
 .B \-i, \-\-interval <intv>
 Set interval to 'intv' seconds.
@@ -37,7 +49,9 @@ Set interval to 'intv' seconds.
 Display results in JSON format
 .TP
 .B \-k, \-\-keys k,k,k,...
-Display only keys specified.
+Display only keys specified. Each key \fBk\fP is of the form \fB[file:]key\fP. If \fB<file>\fP
+is given, the search for the given key is limited to that file. Otherwise the first file containing
+the searched key is being used.
 .TP
 .B \-s, \-\-subject [0-2]
 Specify display of subject/header. '0' means no header at all, '1' prints a header only at start of the program and '2' prints a header every 20 lines.
@@ -66,6 +80,179 @@ Print a header at start and every 20 lines.
 .TP
 .B # lnstat -c -1 -i 1 -f rt_cache -k entries,in_hit,in_slow_tot
 Display statistics for keys entries, in_hit and in_slow_tot of field rt_cache every second.
+
+.SH FILES
+.TP
+.B /proc/net/stat/arp_cache, /proc/net/stat/ndisc_cache
+Statistics around neighbor cache and ARP. \fBarp_cache\fP is for IPv4, \fBndisc_cache\fP is the same for IPv6.
+.sp
+.B entries
+Number of entries in the neighbor table.
+.sp
+.B allocs
+How many neighbor entries have been allocated.
+.sp
+.B destroys
+How many neighbor entries have been removed.
+.sp
+.B hash_grows
+How often the neighbor (hash) table was increased.
+.sp
+.B lookups
+How many lookups were performed.
+.sp
+.B hits
+How many \fBlookups\fP were successful.
+.sp
+.B res_failed
+How many neighbor lookups failed.
+.sp
+.B rcv_probes_mcast
+How many multicast neighbor solicitations were received. (IPv6 only.)
+.sp
+.B rcv_probes_ucast
+How many unicast neighbor solicitations were received. (IPv6 only.)
+.sp
+.B periodic_gc_runs
+How many garbage collection runs were executed.
+.sp
+.B forced_gc_runs
+How many forced garbage collection runs were executed. Happens when adding an
+entry and the table is too full.
+.sp
+.B unresolved_discards
+How many neighbor table entries were discarded due to lookup failure.
+.sp
+.B table_fulls
+Number of table overflows. Happens if table is full and forced GC run (see
+\fBforced_gc_runs\fP) has failed.
+
+.TP
+.B /proc/net/stat/ip_conntrack, /proc/net/stat/nf_conntrack
+Conntrack related counters. \fBip_conntrack\fP is for backwards compatibility
+with older userspace only and shows the same data as \fBnf_conntrack\fP.
+.sp
+.B entries
+Number of entries in conntrack table.
+.sp
+.B searched
+Number of conntrack table lookups performed.
+.sp
+.B found
+Number of \fBsearched\fP entries which were successful.
+.sp
+.B new
+Number of conntrack entries added which were not expected before.
+.sp
+.B invalid
+Number of packets seen which can not be tracked.
+.sp
+.B ignore
+Number of packets seen which are already connected to a conntrack entry.
+.sp
+.B delete
+Number of conntrack entries which were removed.
+.sp
+.B delete_list
+Number of conntrack entries which were put to dying list.
+.sp
+.B insert
+Number of entries inserted into the list.
+.sp
+.B insert_failed
+Number of entries for which list insertion was attempted but failed (happens if
+the same entry is already present).
+.sp
+.B drop
+Number of packets dropped due to conntrack failure. Either new conntrack entry
+allocation failed, or protocol helper dropped the packet.
+.sp
+.B early_drop
+Number of dropped conntrack entries to make room for new ones, if maximum table
+size was reached.
+.sp
+.B icmp_error
+Number of packets wich could not be tracked due to error situation. This is a
+subset of \fBinvalid\fP.
+.sp
+.B expect_new
+Number of conntrack entries added after an expectation for them was already
+present.
+.sp
+.B expect_create
+Number of expectations added.
+.sp
+.B expect_delete
+Number of expectations deleted.
+.sp
+.B search_restart
+Number of conntrack table lookups which had to be restarted due to hashtable
+resizes.
+
+.TP
+.B /proc/net/stat/rt_cache
+Routing cache statistics.
+.sp
+.B entries
+Number of entries in routing cache.
+.sp
+.B in_hit
+Number of route cache hits for incoming packets. Deprecated since IP route
+cache removal, therefore always zero.
+.sp
+.B in_slow_tot
+Number of routing cache entries added for input traffic.
+.sp
+.B in_slow_mc
+Number of multicast routing cache entries added for input traffic.
+.sp
+.B in_no_route
+Number of input packets for which no routing table entry was found.
+.sp
+.B in_brd
+Number of matched input broadcast packets.
+.sp
+.B in_martian_dst
+Number of incoming martian destination packets.
+.sp
+.B in_martian_src
+Number of incoming martian source packets.
+.sp
+.B out_hit
+Number of route cache hits for outgoing packets. Deprecated since IP route
+cache removal, therefore always zero.
+.sp
+.B out_slow_tot
+Number of routing cache entries added for output traffic.
+.sp
+.B out_slow_mc
+Number of multicast routing cache entries added for output traffic.
+.sp
+.B gc_total
+Total number of garbage collection runs. Deprecated since IP route cache
+removal, therefore always zero.
+.sp
+.B gc_ignored
+Number of ignored garbage collection runs due to minimum GC interval not
+reached and routing cache not full. Deprecated since IP route cache removal,
+therefore always zero.
+.sp
+.B gc_goal_miss
+Number of garbage collector goal misses. Deprecated since IP route cache
+removal, therefore always zero.
+.sp
+.B gc_dst_overflow
+Number of destination cache overflows. Deprecated since IP route cache removal,
+therefore always zero.
+.sp
+.B in_hlist_search
+Number of hash table list traversals for input traffic. Deprecated since IP
+route cache removal, therefore always zero.
+.sp
+.B out_hlist_search
+Number of hash table list traversals for output traffic. Deprecated since IP
+route cache removal, therefore always zero.
+
 .SH SEE ALSO
 .BR ip (8),
 and /usr/share/doc/iproute-doc/README.lnstat (package iproute-doc on Debian)
Signature · 1 line
2.1.2
#6 lore raw

PATCH 6/6 man: rtpr: add minimal manpage

In reply to Phil Sutter

While there is not much to explain about this rather trivial shell script, having a manpage for it serves as good point of reference for users wondering what it might be for.

---
 man/man8/Makefile |  2 +-
 man/man8/rtpr.8   | 25 +++++++++++++++++++++++++
 2 files changed, 26 insertions(+), 1 deletion(-)
 create mode 100644 man/man8/rtpr.8
man/man8/Makefile +1 -1
index 3df9961..c97d816 100644
@@ -1,6 +1,6 @@
 TARGETS = ip-address.8 ip-link.8 ip-route.8
 
-MAN8PAGES = $(TARGETS) ip.8 arpd.8 lnstat.8 routel.8 rtacct.8 rtmon.8 ss.8 \
+MAN8PAGES = $(TARGETS) ip.8 arpd.8 lnstat.8 routel.8 rtacct.8 rtmon.8 rtpr.8 ss.8 \
 	tc.8 tc-bfifo.8 tc-bpf.8 tc-cbq.8 tc-cbq-details.8 tc-choke.8 tc-codel.8 \
 	tc-drr.8 tc-ematch.8 tc-fq_codel.8 tc-hfsc.8 tc-htb.8 tc-pie.8 \
 	tc-mqprio.8 tc-netem.8 tc-pfifo.8 tc-pfifo_fast.8 tc-prio.8 tc-red.8 \
man/man8/rtpr.8 new file +25 -0
new file mode 100644
index 0000000..5e32b2e
@@ -0,0 +1,25 @@
+.TH RTPR 8 "18 September, 2015"
+
+.SH NAME
+rtpr \- replace backslashes with newlines.
+
+.SH DESCRIPTION
+.B rtpr
+is a trivial bash script which converts backslashes in standard input to newlines. It's sole purpose is to be fed with input from
+.B ip
+when executed with it's
+.B --oneline
+flag.
+
+.SH EXAMPLES
+.TP
+ip --onenline address show | rtpr
+Undo oneline converted
+.B ip-address
+output.
+
+.SH SEE ALSO
+.BR ip (8)
+
+.SH AUTHORS
+Stephen Hemminger <[email protected]>
Signature · 1 line
2.1.2