introduce -A arg: treat single subnets as shared-network with CIDR as their name

Current output makes some false-positives for situations when multiple
ranges are specified inside single network, for example:

subnet 10.0.0.0 netmask 255.255.254.0 {
	...
	range 10.0.0.1 10.0.0.254;
	range 10.0.1.1 10.0.1.253;
	...
}

An alert for range 10.0.0.1 - 10.0.0.254 will be raised even in situations
when range 10.0.1.1 - 10.0.1.253 is completely empty.  To cope with this
issue, an -A option is added to treat all single networks as shared-network.
This option changes output for both range and shared networks output if
specified.  Frankly saying, using network CIDR as network name is much more
sane for me than 'All Networks'.

Signed-off-by: Boris Lytochkin <lytboris@yandex-team.ru>
This commit is contained in:
Boris Lytochkin 2016-12-04 17:09:32 +03:00 committed by Sami Kerola
parent dff991666e
commit b9cff0d814
No known key found for this signature in database
GPG key ID: A9553245FDE9B739
6 changed files with 54 additions and 3 deletions

View file

@ -202,6 +202,10 @@ backup leases. This option is meaningful only in context of alarming and
will print lots of data, if there are many networks. By default this option
is not in use.
.TP
\fB\-A\fR, \fB\-\-all\-as\-shared\fR
Treat all stand-alone subnets as shared-network with named formed from it's
CIDR. By default this option is not in use for backwards compatibility.
.TP
\fB\-v\fR, \fB\-\-version\fR
Print version information to standard output and exit successfully.
.TP