From 958cd210942c8d4c1756957843bd2bf52b57ebb5 Mon Sep 17 00:00:00 2001 From: Phil Sutter Date: Thu, 29 Oct 2015 10:55:21 +0100 Subject: [PATCH 1/5] ifcfg: add manpage --- man/man8/ifcfg.8 | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 man/man8/ifcfg.8 diff --git a/man/man8/ifcfg.8 b/man/man8/ifcfg.8 new file mode 100644 index 00000000..79033bde --- /dev/null +++ b/man/man8/ifcfg.8 @@ -0,0 +1,48 @@ +.TH IFCFG 8 "September 24 2009" "iproute2" "Linux" +.SH NAME +ifcfg \- simplistic script which replaces ifconfig IP managment +.SH SYNOPSIS +.ad l +.in +8 +.ti -8 +.B ifcfg +.RI "[ " DEVICE " ] [ " command " ] " ADDRESS " [ " PEER " ] " +.sp + +.SH DESCRIPTION +This manual page documents briefly the +.B ifcfg +command. +.PP +This is a simplistic script replacing one option of +.B ifconfig +, namely, IP address management. It not only adds +addresses, but also carries out Duplicate Address Detection RFC-DHCP, +sends unsolicited ARP to update the caches of other hosts sharing +the interface, adds some control routes and restarts Router Discovery +when it is necessary. + +.SH IFCONFIG - COMMAND SYNTAX + +.SS +.TP +.B DEVICE +- it may have alias, suffix, separated by colon. + +.TP +.B command +- add, delete or stop. + +.TP +.B ADDRESS +- optionally followed by prefix length. + +.TP +.B peer +- optional peer address for pointpoint interfaces. + +.SH NOTES +This script is not suitable for use with IPv6. + +.SH SEE ALSO +.RB "IP Command reference " ip-cref.ps From 7124942942e530299b3d50b2b11b30265065dd5c Mon Sep 17 00:00:00 2001 From: Phil Sutter Date: Thu, 29 Oct 2015 10:55:22 +0100 Subject: [PATCH 2/5] genl: add manpage --- man/man8/genl.8 | 77 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 man/man8/genl.8 diff --git a/man/man8/genl.8 b/man/man8/genl.8 new file mode 100644 index 00000000..b9de594d --- /dev/null +++ b/man/man8/genl.8 @@ -0,0 +1,77 @@ +.TH GENL 8 "29 Oct 2015" "iproute2" "Linux" +.SH NAME +genl \- generic netlink utility frontend +.SH SYNOPSIS +.in +8 +.ti -8 +.BR genl " [ " -s [ tatistics "] ] [ " -d [ etails "] ] [ " -r [ aw "] ] " OBJECT + +.ti -8 +.BR genl " { " -V [ ersion "] | " -h [ elp "] }" + +.ti -8 +.IR OBJECT " := { " +.B ctrl +.IR CTRL_OPTS " }" + +.ti -8 +.IR CTRL_OPTS " := { " +.BR help " | " list " | " monitor " | " get +.IR PARMS " }" + +.ti -8 +.IR PARMS " := { " +.B name +.IR NAME " | " +.B id +.IR ID " }" +.SH DESCRIPTION +The +.B genl +utility provides a simple frontend to the generic netlink library. Although it's +designed to support multiple +.IR OBJECT s, +for now only the +.B ctrl +object is available, which is used to query the generic netlink controller. +.SS ctrl +The generic netlink controller can be queried in various ways: +.TP +.B help +This command just prints a help text for the +.B ctrl +object. +.TP +.B list +Show the registered netlink users. +.TP +.B monitor +Listen for generic netlink notifications. +.TP +.B get +Query the controller for a given user, identified either by +.BR name " or " id . +.SH OPTIONS +genl supports the following options. +.TP +.B \-h, \-help +Show summary of options. +.TP +.B \-V, \-Version +Show version of program. +.TP +.B \-s, \-stats, \-statistics +Show object statistics. +.TP +.B \-d, \-details +Show object details. +.TP +.B \-r, \-raw +Dump raw output only. +.SH SEE ALSO +.BR ip (8) +.br +.SH AUTHOR +genl was written by Jamal Hadi Salim . +.PP +This manual page was written by Petr Sabata . From 17c53fcd2c76b84c7c7eb2bd082d9e40dd8c41c6 Mon Sep 17 00:00:00 2001 From: Phil Sutter Date: Thu, 29 Oct 2015 10:55:23 +0100 Subject: [PATCH 3/5] ifstat: add manpage --- man/man8/ifstat.8 | 59 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 man/man8/ifstat.8 diff --git a/man/man8/ifstat.8 b/man/man8/ifstat.8 new file mode 100644 index 00000000..e49d8680 --- /dev/null +++ b/man/man8/ifstat.8 @@ -0,0 +1,59 @@ +.TH IFSTAT 8 "28 Oct 2015" "iproute2" "Linux" +.SH NAME +ifstat \- handy utility to read network interface statistics +.SH SYNOPSIS +.in +8 +.ti -8 +.BR ifstat " [ " +.IR OPTIONS " ] [ " INTERFACE_LIST " ]" + +.ti -8 +.IR INTERFACE_LIST " := " INTERFACE_LIST " | " interface +.SH DESCRIPTION +\fBifstat\fP neatly prints out network interface statistics. +The utility keeps records of the previous data displayed in history files and +by default only shows difference between the last and the current call. +Location of the history files defaults to /tmp/.ifstat.u$UID but may be +overridden with the IFSTAT_HISTORY environment variable. +.SH OPTIONS +.TP +.B \-h, \-\-help +Show summary of options. +.TP +.B \-V, \-\-version +Show version of program. +.TP +.B \-a, \-\-ignore +Ignore the history file. +.TP +.B \-d, \-\-scan=SECS +Sample statistics every SECS second. +.TP +.B \-e, \-\-errors +Show errors. +.TP +.B \-n, \-\-nooutput +Don't display any output. Update the history file only. +.TP +.B \-r, \-\-reset +Reset history. +.TP +.B \-s, \-\-noupdate +Don't update the history file. +.TP +.B \-t, \-\-interval=SECS +Report average over the last SECS seconds. +.TP +.B \-z, \-\-zeros +Show entries with zero activity. +.SH ENVIRONMENT +.TP +.B IFSTAT_HISTORY +If set, it's value is interpreted as alternate history file path. +.SH SEE ALSO +.BR ip (8) +.br +.SH AUTHOR +ifstat was written by Alexey Kuznetsov . +.PP +This manual page was written by Petr Sabata . From bd5bbad45007937758ec1339f2612049ce7187d7 Mon Sep 17 00:00:00 2001 From: Phil Sutter Date: Thu, 29 Oct 2015 10:55:24 +0100 Subject: [PATCH 4/5] bridge: fdb: minor syntax fix in help text --- bridge/fdb.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bridge/fdb.c b/bridge/fdb.c index 5ea50abb..4d109251 100644 --- a/bridge/fdb.c +++ b/bridge/fdb.c @@ -31,11 +31,11 @@ static unsigned int filter_index; static void usage(void) { - fprintf(stderr, "Usage: bridge fdb { add | append | del | replace ADDR dev DEV\n" + fprintf(stderr, "Usage: bridge fdb { add | append | del | replace } ADDR dev DEV\n" " [ self ] [ master ] [ use ] [ router ]\n" " [ local | temp ] [ dst IPADDR ] [ vlan VID ]\n" - " [ port PORT] [ vni VNI ] [via DEV]\n"); - fprintf(stderr, " bridge fdb {show} [ br BRDEV ] [ brport DEV ]\n"); + " [ port PORT] [ vni VNI ] [ via DEV ]\n"); + fprintf(stderr, " bridge fdb [ show [ br BRDEV ] [ brport DEV ] ]\n"); exit(-1); } From b5bb1820e8a7666a1cab56bf8370b338647fd7a2 Mon Sep 17 00:00:00 2001 From: Phil Sutter Date: Thu, 29 Oct 2015 17:20:56 +0100 Subject: [PATCH 5/5] lib/utils: improve error messages of get_addr() and get_prefix() Instead of statically complaining about illegal inet address, use get_family() to get the address family right. Based on a patch by Hangbin Liu to print "inet6" for AF_INET6 made more generic by me. Signed-off-by: Phil Sutter --- lib/utils.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/utils.c b/lib/utils.c index 107e3f57..939a44f0 100644 --- a/lib/utils.c +++ b/lib/utils.c @@ -531,7 +531,8 @@ done: int get_addr(inet_prefix *dst, const char *arg, int family) { if (get_addr_1(dst, arg, family)) { - fprintf(stderr, "Error: an inet address is expected rather than \"%s\".\n", arg); + fprintf(stderr, "Error: %s address is expected rather than \"%s\".\n", + family_name(family) ,arg); exit(1); } return 0; @@ -544,7 +545,8 @@ int get_prefix(inet_prefix *dst, char *arg, int family) exit(1); } if (get_prefix_1(dst, arg, family)) { - fprintf(stderr, "Error: an inet prefix is expected rather than \"%s\".\n", arg); + fprintf(stderr, "Error: %s prefix is expected rather than \"%s\".\n", + family_name(family) ,arg); exit(1); } return 0;