ipset/doc: make emphasis markup consistent

Consistently apply markup so that only replaceable items are italic,
and only items to be typed verbatim are bold. Also apply the command
syntax "BNF" (where and when to use [], {}) that is used in the
iptables manpages to ipset.8.

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
This commit is contained in:
Jan Engelhardt
2009-11-11 11:48:34 +01:00
parent 2eaa5c5606
commit 24bb655130

View File

@@ -20,17 +20,19 @@
.SH NAME
ipset \- administration tool for IP sets
.SH SYNOPSIS
.BR "ipset -N " "set type-specification [options]"
.br
.BR "ipset -[XFLSHh] " "[set] [options]"
.br
.BR "ipset -[EW] " "from-set to-set"
.br
.BR "ipset -[ADT] " "set entry"
.br
.BR "ipset -R "
.br
.BR "ipset -[Vv] "
.PP
\fBipset \-N\fP \fIset\fP \fItype-specification\fP [\fIoptions\fP...]
.PP
\fBipset\fP {\fB\-F\fP|\fB\-H\fP|\fB\-L\fP|\fB\-S\fP|\fB\-X\fP} [\fIset\fP]
[\fIoptions\fP...]
.PP
\fBipset\fP {\fB\-E\fP|\fB\-W\fP} \fIfrom-set\fP \fIto-set\fP
.PP
\fBipset\fP {\fB\-A\fP|\fB\-D\fP|\fB\-T\fP} \fIset\fP \fIentry\fP
.PP
\fBipset \-R\fP
.PP
\fBipset\fP {\fB-V\fP|\fB\-v\fP}
.SH DESCRIPTION
.B ipset
is used to set up, maintain and inspect so called IP sets in the Linux
@@ -53,41 +55,41 @@ need to use only enough letters to ensure that
.B ipset
can differentiate it from all other options.
.TP
.BI "-N, --create " "\fIsetname\fP type type-specific-options"
\fB\-N\fP, \fB\-\-create\fP \fIsetname\fP \fItype\fP \fItype-specific-options\fP
Create a set identified with setname and specified type.
Type-specific options must be supplied.
.TP
.BI "-X, --destroy " "[\fIsetname\fP]"
\fB\-X\fP, \fB\-\-destroy\fP [\fIsetname\fP]
Destroy the specified set or all the sets if none is given.
If the set has got references, nothing is done.
.TP
.BI "-F, --flush " "[\fIsetname\fP]"
\fB\-F\fP, \fB\-\-flush\fP [\fIsetname\fP]
Delete all entries from the specified set or flush
all sets if none is given.
.TP
.BI "-E, --rename " "\fIfrom-setname\fP \fIto-setname\fP"
\fB\-E\fP, \fB\-\-rename\fP \fIfrom-setname\fP \fIto-setname\fP
Rename a set. Set identified by to-setname must not exist.
.TP
.BI "-W, --swap " "\fIfrom-setname\fP \fIto-setname\fP"
\fB\-W\fP, \fB\-\-swap\fP \fIfrom-setname\fP \fIto-setname\fP
Swap the content of two sets, or in another words,
exchange the name of two sets. The referred sets must exist and
identical type of sets can be swapped only.
.TP
.BI "-L, --list " "[\fIsetname\fP]"
\fB\-L\fP, \fB\-\-list\fP [\fIsetname\fP]
List the entries for the specified set, or for
all sets if none is given. The
.B "-r, --resolve"
\fB\-r\fP/\fB\-\-resolve\fP
option can be used to force name lookups (which may be slow). When the
.B "-s, --sorted"
\fB\-s\fP/\fB\-\-sorted\fP
option is given, the entries are listed sorted (if the given set
type supports the operation).
.TP
.BI "-S, --save " "[\fIsetname\fP]"
\fB\-S\fP, \fB\-\-save\fP [\fIsetname\fP]
Save the given set, or all sets if none is given
to stdout in a format that --restore can read.
.TP
.BI "-R, --restore "
\fB\-R\fP, \fB\-\-restore\fP
Restore a saved session generated by --save. The saved session
can be fed from stdin.
@@ -97,27 +99,27 @@ the set, then add all elements. Then create the next set, add all its elements
and so on. Also, it is a restore operation, so the sets being restored must
not exist.
.TP
.BI "-A, --add " "\fIsetname\fP \fIIP\fP"
\fB\-A\fP, \fB\-\-add\fP \fIsetname\fP \fIIP\fP
Add an IP entry to a set.
.TP
.BI "-D, --del " "\fIsetname\fP \fIIP\fP"
\fB\-D\fP, \fB\-\-del\fP \fIsetname\fP \fIIP\fP
Delete an IP entry from a set.
.TP
.BI "-T, --test " "\fIsetname\fP \fIIP\fP
\fB-T\fP, \fB\-\-test\fP \fIsetname\fP \fIIP\fP
Test wether an IP entry is in a set or not. Exit status number is zero
if the tested IP is in the set and nonzero if it is missing from
the set.
.TP
.BI "-H, --help " "[settype]"
\fB\-H\fP, \fB\-\-help\fP [\fIsettype\fP]
Print help and settype specific help if settype specified.
.TP
.BI "-V, -v, --version "
\fB\-V\fP, \fB\-v\fP, \fB\-\-version\fP
Print program version and protocol version.
.P
.SS "OTHER OPTIONS"
The following additional options can be specified:
.TP
.B "-r, --resolve"
\fB\-r\fP, \fB\-\-resolve\fP
When listing sets, enforce name lookup. The
program will try to display the IP entries resolved to
host names or services (whenever applicable), which can trigger
@@ -126,14 +128,14 @@ slow
DNS
lookups.
.TP
.B "-s, --sorted"
\fB\-s\fP, \fB\-\-sorted\fP
Sorted output. When listing sets, entries are listed sorted.
.TP
.B "-n, --numeric"
\fB\-n\fP, \fB\-\-numeric\fP
Numeric output. When listing sets, IP addresses and
port numbers will be printed in numeric format. This is the default.
.TP
.B "-q, --quiet"
\fB\-q\fP, \fB\-\-quiet\fP
Suppress any output to stdout and stderr. ipset will still return
possible errors.
.SH SET TYPES
@@ -151,20 +153,20 @@ by masking the address with the specified netmask, can be found in the set.
.P
Options to use when creating an ipmap set:
.TP
.BR "--from " from-IP
\fB\-\-from\fP \fIfrom-ip\fP
.TP
.BR "--to " to-IP
\fB\-\-to\fP \fIto-ip\fP
Create an ipmap set from the specified range.
.TP
.BR "--network " IP/mask
\fB\-\-network\fP \fIip\fP\fB/\fP\fImask\fP
Create an ipmap set from the specified network.
.TP
.BR "--netmask " CIDR-netmask
\fB\-\-netmask\fP \fIcidr-netmask\fP
When the optional
.B "--netmask"
parameter specified, network addresses will be
stored in the set instead of IP addresses, and the from-IP parameter
must be a network address. The CIDR-netmask value must be between 1-31.
stored in the set instead of IP addresses, and the \fIfrom-ip\fP parameter
must be a network address. The \fIcidr-netmask\fP value must be between 1-31.
.PP
Example:
.IP
@@ -174,19 +176,19 @@ The macipmap set type uses a memory range, where each 8 bytes
represents one IP and a MAC addresses. A macipmap set type can store
up to 65536 (B-class network) IP addresses with MAC.
When adding an entry to a macipmap set, you must specify the entry as
.I IP,MAC.
"\fIip\fP\fB,\fP\fImac\fP".
When deleting or testing macipmap entries, the
.I ,MAC
"\fB,\fP\fImac\fP"
part is not mandatory.
.P
Options to use when creating an macipmap set:
.TP
.BR "--from " from-IP
\fB\-\-from\fP \fIfrom-ip\fP
.TP
.BR "--to " to-IP
\fB\-\-to\fP \fIto-ip\fP
Create a macipmap set from the specified range.
.TP
.BR "--network " IP/mask
\fB\-\-network\fP \fIip\fP\fB/\fP\fImask\fP
Create a macipmap set from the specified network.
.TP
.BR "--matchunset"
@@ -196,11 +198,9 @@ parameter specified, IP addresses which could be stored
in the set but not set yet, will always match.
.P
Please note, the
.I
set
"set"
and
.I
SET
"SET"
netfilter kernel modules
.B
always
@@ -213,9 +213,9 @@ The portmap set type is very fast and memory cheap.
.P
Options to use when creating an portmap set:
.TP
.BR "--from " from-port
\fB\-\-from\fP \fIfrom-port\fP
.TP
.BR "--to " to-port
\fB\-\-to\fP \fIto-port\fP
Create a portmap set from the specified range.
.SS iphash
The iphash set type uses a hash to store IP addresses.
@@ -230,25 +230,24 @@ by masking the address with the specified netmask, can be found in the set.
.P
Options to use when creating an iphash set:
.TP
.BR "--hashsize " hashsize
\fB\-\-hashsize\fP \fIhashsize\fP
The initial hash size (default 1024)
.TP
.BR "--probes " probes
\fB\-\-probes\fP \fIprobes\fP
How many times try to resolve clashing at adding an IP to the hash
by double-hashing (default 8).
.TP
.BR "--resize " percent
\fB\-\-resize\fP \fIpercent\fP
Increase the hash size by this many percent (default 50) when adding
an IP to the hash could not be performed after
.B
probes
\fIprobes\fP
number of double-hashing.
.TP
.BR "--netmask " CIDR-netmask
\fB\-\-netmask\fP \fIcidr-netmask\fP
When the optional
.B "--netmask"
parameter specified, network addresses will be
stored in the set instead of IP addresses. The CIDR-netmask value must
stored in the set instead of IP addresses. The \fIcidr-netmask\fP value must
be between 1-31.
.P
The iphash type of sets can store up to 65536 entries. If a set is full,
@@ -257,11 +256,9 @@ no new entries can be added to it.
Sets created by zero valued resize parameter won't be resized at all.
The lookup time in an iphash type of set grows approximately linearly with
the value of the
.B
probes
\fIprobes\fP
parameter. In general higher
.B
probe
\fIprobes\fP
value results better utilized hash while smaller value
produces larger, sparser hash.
.PP
@@ -274,22 +271,21 @@ network addresses. The
.I
IP
"address" used in the ipset commands must be in the form
.I
IP-address/cidr-size
"\fIip-address\fP\fB/\fP\fIcidr-size\fP"
where the CIDR block size must be in the inclusive range of 1-31.
In order to avoid clashes in the hash
double-hashing, and as a last resort, dynamic growing of the hash performed.
.P
Options to use when creating an nethash set:
.TP
.BR "--hashsize " hashsize
\fB\-\-hashsize\fP \fIhashsize\fP
The initial hash size (default 1024)
.TP
.BR "--probes " probes
\fB\-\-probes\fP \fIprobes\fP
How many times try to resolve clashing at adding an IP to the hash
by double-hashing (default 4).
.TP
.BR "--resize " percent
\fB\-\-resize\fP \fIpercent\fP
Increase the hash size by this many percent (default 50) when adding
an IP to the hash could not be performed after
.P
@@ -301,15 +297,13 @@ netblocks added to the set. The matching always start from the smallest
size of netblock (most specific netmask) to the largest ones (least
specific netmasks). When adding/deleting IP addresses
to a nethash set by the
.I
SET
"SET"
netfilter kernel module, it will be added/deleted by the smallest
netblock size which can be found in the set, or by /31 if the set is empty.
.P
The lookup time in a nethash type of set grows approximately linearly
with the times of the
.B
probes
\fIprobes\fP
parameter and the number of different mask parameters in the hash.
Otherwise the same speed and memory efficiency comments applies here
as at the iphash type.
@@ -320,39 +314,35 @@ resort, dynamic growing of the hash performed. An ipporthash set can
store up to 65536 (B-class network) IP addresses with all possible port
values. When adding, deleting and testing values in an ipporthash type of
set, the entries must be specified as
.B
"IP,port".
"\fIip\fP\fB,\fP\fIport\fP".
.P
The ipporthash types of sets evaluates two src/dst parameters of the
.I
set
"set"
match and
.I
SET
"SET"
target.
.P
Options to use when creating an ipporthash set:
.TP
.BR "--from " from-IP
\fB\-\-from\fP \fIfrom-ip\fP
.TP
.BR "--to " to-IP
\fB\-\-to\fP \fIto-ip\fP
Create an ipporthash set from the specified range.
.TP
.BR "--network " IP/mask
\fB\-\-network\fP \fIip\fP\fB/\fP\fImask\fP
Create an ipporthash set from the specified network.
.TP
.BR "--hashsize " hashsize
\fB\-\-hashsize\fP \fIhashsize\fP
The initial hash size (default 1024)
.TP
.BR "--probes " probes
\fB\-\-probes\fP \fIprobes\fP
How many times try to resolve clashing at adding an IP to the hash
by double-hashing (default 8).
.TP
.BR "--resize " percent
\fB\-\-resize\fP \fIpercent\fP
Increase the hash size by this many percent (default 50) when adding
an IP to the hash could not be performed after
.B
probes
\fIprobes\fP
number of double-hashing.
.P
The same resizing, speed and memory efficiency comments applies here
@@ -363,39 +353,35 @@ address triples. The first IP address must come form a maximum /16
sized network or range while the port number and the second IP address
parameters are arbitrary. When adding, deleting and testing values in an
ipportiphash type of set, the entries must be specified as
.B
"IP,port,IP".
"\fIip\fP\fB,\fP\fIport\fP\fB,\fP\fIip\fP".
.P
The ipportiphash types of sets evaluates three src/dst parameters of the
.I
set
"set"
match and
.I
SET
"SET"
target.
.P
Options to use when creating an ipportiphash set:
.TP
.BR "--from " from-IP
\fB\-\-from\fP \fIfrom-ip\fP
.TP
.BR "--to " to-IP
\fB\-\-to\fP \fIto-ip\fP
Create an ipportiphash set from the specified range.
.TP
.BR "--network " IP/mask
\fB\-\-network\fP \fIip\fP\fB/\fP\fImask\fP
Create an ipportiphash set from the specified network.
.TP
.BR "--hashsize " hashsize
\fB\-\-hashsize\fP \fIhashsize\fP
The initial hash size (default 1024)
.TP
.BR "--probes " probes
\fB\-\-probes\fP \fIprobes\fP
How many times try to resolve clashing at adding an IP to the hash
by double-hashing (default 8).
.TP
.BR "--resize " percent
\fB\-\-resize\fP \fIpercent\fP
Increase the hash size by this many percent (default 50) when adding
an IP to the hash could not be performed after
.B
probes
\fIprobes\fP
number of double-hashing.
.P
The same resizing, speed and memory efficiency comments applies here
@@ -408,39 +394,35 @@ parameters are arbitrary, but the size of the network address must be
between /1-/31. When adding, deleting
and testing values in an ipportnethash type of set, the entries must be
specified as
.B
"IP,port,IP/cidr-size".
"\fIip\fP\fB,\fP\fIip\fP\fB/\fP\fIcidr-size\fP".
.P
The ipportnethash types of sets evaluates three src/dst parameters of the
.I
set
"set"
match and
.I
SET
"SET"
target.
.P
Options to use when creating an ipportnethash set:
.TP
.BR "--from " from-IP
\fB\-\-from\fP \fIfrom-ip\fP
.TP
.BR "--to " to-IP
\fB\-\-to\fP \fIto-ip\fP
Create an ipporthash set from the specified range.
.TP
.BR "--network " IP/mask
\fB\-\-network\fP \fIip\fP\fB/\fP\fImask\fP
Create an ipporthash set from the specified network.
.TP
.BR "--hashsize " hashsize
\fB\-\-hashsize\fP \fIhashsize\fP
The initial hash size (default 1024)
.TP
.BR "--probes " probes
\fB\-\-probes\fP \fIprobes\fP
How many times try to resolve clashing at adding an IP to the hash
by double-hashing (default 8).
.TP
.BR "--resize " percent
\fB\-\-resize\fP \fIpercent\fP
Increase the hash size by this many percent (default 50) when adding
an IP to the hash could not be performed after
.B
probes
\fIprobes\fP
number of double-hashing.
.P
The same resizing, speed and memory efficiency comments applies here
@@ -451,14 +433,14 @@ with timeout values.
.P
Options to use when creating an iptree set:
.TP
.BR "--timeout " value
\fB\-\-timeout\fP \fIvalue\fP
The timeout value for the entries in seconds (default 0)
.P
If a set was created with a nonzero valued
.B "--timeout"
parameter then one may add IP addresses to the set with a specific
timeout value using the syntax
.I IP,timeout-value.
"\fIip\fP\fB,\fP\fItimeout-value\fP".
Similarly to the hash types, the iptree type of sets can store up to 65536
entries.
.SS iptreemap
@@ -466,37 +448,32 @@ The iptreemap set type uses a tree to store IP addresses or networks,
where the last octet of an IP address are stored in a bitmap.
As input entry, you can add IP addresses, CIDR blocks or network ranges
to the set. Network ranges can be specified in the format
.I IP1-IP2
"\fIip1\fP\fB-\fP\fIip2\fP".
.P
Options to use when creating an iptreemap set:
.TP
.BR "--gc " value
\fB\-\-gc\fP \fIvalue\fP
How often the garbage collection should be called, in seconds (default 300)
.SS setlist
The setlist type uses a simple list in which you can store sets. By the
.I
ipset
command you can add, delete and test sets in a setlist type of set.
You can specify the sets as
.B
"setname[,after|before,setname]".
"\fIsetname\fP[\fB,\fP{\fBafter\fP|\fBbefore\fP},\fIsetname\fP]".
By default new sets are added after (appended to) the existing
elements. Setlist type of sets cannot be added to a setlist type of set.
.P
Options to use when creating a setlist type of set:
.TP
.BR "--size " size
\fB\-\-size\fP \fIsize\fP
Create a setlist type of set with the given size (default 8).
.PP
By the
.I
set
"set"
match or
.I
SET
"SET"
target of
.I
iptables
\fBiptables\fP(8)
you can test, add or delete entries in the sets. The match
will try to find a matching IP address/port in the sets and
the target will try to add the IP address/port to the first set
@@ -524,7 +501,7 @@ data storage in
.I a
set and add src to the first single or src,dst to the first double
data storage set in
.I b.
\fIb\fP.
.P
You can imagine a setlist type of set as an ordered union of
the set elements.