From 17f1fb7f5edae8fff0cf1d41a60bee1889b26073 Mon Sep 17 00:00:00 2001
From: Sami Kerola
Date: Sun, 6 Dec 2015 19:08:08 +0000
Subject: [PATCH 001/158] tell in README when ./bootstrap is needed
Signed-off-by: Sami Kerola
---
README | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/README b/README
index 42b6388..1b347e2 100644
--- a/README
+++ b/README
@@ -11,7 +11,7 @@ Quick start.
Build the dhcpd-pools project.
cd /tmp/dhcpd-pools
- ./bootstrap
+ ./bootstrap # only when building git clone
./configure --with-uthash=/tmp/uthash-master/include
make
make check
From 1dcf762967567ff676af359d81106083e783cf2c Mon Sep 17 00:00:00 2001
From: Sami Kerola
Date: Mon, 7 Dec 2015 10:29:38 +0000
Subject: [PATCH 002/158] add dhcpd-pools website content to a subdirectory
Start using git to backup of the website content.
Signed-off-by: Sami Kerola
---
webpages/dhcpd-pools.awk | 164 +++++
webpages/google3df4cc29123f74e0.html | 1 +
webpages/index.html | 96 +++
webpages/robots.txt | 2 +
webpages/sampleoutput.txt | 985 +++++++++++++++++++++++++++
webpages/sitemap.txt | 522 ++++++++++++++
6 files changed, 1770 insertions(+)
create mode 100644 webpages/dhcpd-pools.awk
create mode 100644 webpages/google3df4cc29123f74e0.html
create mode 100644 webpages/index.html
create mode 100644 webpages/robots.txt
create mode 100644 webpages/sampleoutput.txt
create mode 100644 webpages/sitemap.txt
diff --git a/webpages/dhcpd-pools.awk b/webpages/dhcpd-pools.awk
new file mode 100644
index 0000000..ed2e35b
--- /dev/null
+++ b/webpages/dhcpd-pools.awk
@@ -0,0 +1,164 @@
+# This is ISC dhcpd pool statistics script.
+#
+# Licensed under the Open Software License version 1.1
+# http://opensource.org/licenses/osl.php
+#
+# Sami Kerola
+#
+# Latest version is available from http://www.iki.fi/kerolasa/dhcp/
+# This is version 1.4
+
+BEGIN {
+ # Do you want to see statistics per pool? 1 = yes, 0 = no.
+ PrintRanges = 1
+
+ leasefile="/opt/dhcp/db/dhcpd.leases"
+ #conffile="/opt/dhcp/etc/dhcpd.conf"
+
+ # External commands.
+ uniq = "sort -nu > afterlp"
+ sort = "sort -nu -k 2 > aftercp"
+ uniqstdout = "sort -u"
+
+ # Do the trick.
+ main()
+}
+
+# Convert ip to decimal number.
+function ip2num(addr) {
+ split(addr, z, ".");
+ numb = z[4]+256*(z[3]+256*(z[2]+256*z[1]))
+ return numb
+}
+
+# Print decimal ip in dotted format.
+function printip(number) {
+ a = int(number/16777216)
+ number = (number-(a*16777216))
+ b = int(number/65536)
+ number = int((number-(b*65536)))
+ c = int(number/256)
+ number = (number-(c*256))
+ ipstring = sprintf("%d.%d.%d.%d", a, b, c, number)
+ printf "%16s", ipstring
+}
+
+# Parse dhcpd lease file.
+function parseleases() {
+ if (system("test -r " leasefile) != 0) {
+ print "File " leasefile " is not readable, exiting."
+ exit 1
+ }
+ while (getline < leasefile) {
+ if ($0 ~ /^lease/) {
+ A = ip2num($2)
+ }
+ if ($0 ~ /^[ ]*binding state active/) {
+ printf "%d\n", A | uniq
+ }
+ }
+ close(leasefile)
+ close(uniq)
+}
+
+# Parse dhcpd configuration file.
+function parseconf() {
+ while (getline) {
+ if ($0 ~ /^[ ]*shared-network/) {
+ sharnet = $2
+ }
+ if ($0 ~ /^[ ]*range/) {
+ printf "%s %d %d\n", sharnet, ip2num($2), ip2num($3) | sort
+ }
+ }
+ close(sort)
+}
+
+# Join preparsed tmp files and output pool status.
+function join() {
+ # Get shared networks and pool ranges.
+ i = 1
+ while (getline < "aftercp") {
+ split($0, j, " ")
+ cnf[i,1] = j[1]
+ cnf[i,2] = j[2]
+ if (j[3] == 0) {
+ j[3] = j[2]
+ }
+ cnf[i,3] = j[3]
+ shnet[j[1],1] += j[3]-j[2]+1
+ shnet[j[1],2] = 0
+ allofall[1] += j[3]-j[2]+1
+ i++
+ }
+ close("aftercp")
+ i = 1
+ allofall[2] = k = 0
+ thisnet = ""
+ # Count IPs in pools.
+ if (PrintRanges) {
+ # Print header.
+ print "shared-network 1st in pool last in pool max cur usage%"
+ }
+ k = 0;
+ while (getline < "afterlp") {
+ ip = $0
+ allofall[2]++
+ # Ip out of the range, pool is changing.
+ while (ip > cnf[i,3]) {
+ if (PrintRanges) {
+ printf "%-20s ", cnf[i,1]
+ printip(cnf[i,2])
+ printip(cnf[i,3])
+ printf " %5d %5d %9.2f\n", cnf[i,3]-cnf[i,2]+1, k, k/(cnf[i,3]-cnf[i,2]+1)
+ k = 0;
+ }
+ if (cnf[i,1] != thisnet) {
+ # Shared network changed.
+ thisnet = cnf[i,1]
+ }
+ i++
+ }
+ if (ip > cnf[i,2] && ip < cnf[i,3]) {
+ # Add ip.
+ shnet[cnf[i,1],2]++
+ }
+ k++;
+ }
+
+ # Print pool statistics.
+
+
+ if (PrintRanges) {
+ printf "%-20s ", cnf[i,1]
+ printip(cnf[i,2])
+ printip(cnf[i,3])
+ printf " %5d %5d %9.2f\n", cnf[i,3]-cnf[i,2]+1, k, k/(cnf[i,3]-cnf[i,2]+1)
+ }
+ close("afterlp")
+ # Print header and shared network statistics.
+ print "#shared-network max cur usage%"
+ for (items in shnet) {
+ x = substr(items, 1, length(items)-2)
+ printf "%-20s %8d %8d %8.4f\n", x, shnet[x,1], shnet[x,2], shnet[x,2]/shnet[x,1] | uniqstdout
+ }
+ close(uniqstdout)
+ print "#--------------"
+ printf "%-20s %8d %8d %8.4f\n", "all_pools", allofall[1], allofall[2], allofall[2]/allofall[1]
+}
+
+# Remove temporary files.
+function cleanup() {
+ system("rm -f aftercp afterlp")
+}
+
+# Main.
+function main() {
+ system("touch afterlp aftercp")
+ parseleases()
+ parseconf()
+ join()
+ cleanup()
+}
+
+# EOF
diff --git a/webpages/google3df4cc29123f74e0.html b/webpages/google3df4cc29123f74e0.html
new file mode 100644
index 0000000..806122e
--- /dev/null
+++ b/webpages/google3df4cc29123f74e0.html
@@ -0,0 +1 @@
+google-site-verification: google3df4cc29123f74e0.html
\ No newline at end of file
diff --git a/webpages/index.html b/webpages/index.html
new file mode 100644
index 0000000..861c4e8
--- /dev/null
+++ b/webpages/index.html
@@ -0,0 +1,96 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ISC dhcpd lease analysis and reporting
+
+
+
+
+
ISC dhcpd lease analysis and reporting
+
This is dhcpd-pools
+ISC dhcp
+shared network and pool range
+usage analysis.
+Purpose of command is to count usage ratio of
+each IP range and shared network pool which ISC dhcpd is in control
+of. Users of the command are most likely ISPs and other organizations
+that have large IP space.
+
Program is written C. Design goal is to get analysis done quickly where
+there is lots of data. On cheap laptop the speed of analysis is more than
+100k leases per second. Number of ranges, or shared networks, does not make
+any significant difference in getting analysis done.
The dhcpd-pools
+manual page, and
+Doxygen software
+reference documentation are available online.
+
Reference information
+
+
+
+
The program was written because
+DHCPStatus,
+DHCP Usage Statistics,
+reportdhcp.pl,
+lease_analyzer and
+dhcpd-snmp
+where too slow to handle huge number of leases. There is also difference in
+printed details. The dhcpd-pools does not print quote as much information as
+some other tools.
+
Notice that this utility is not the same as
+dhcpd-pool
+that is maintained by Trond Hasle Amundsen.
+
Just for laugh, obsolete awk proof of concept (version 1.4)
+dhcpd-pools.awk
+
Where to send questions, bug reports, code contributions...
tag, and make the sample usage more realistic.
Signed-off-by: Sami Kerola
---
webpages/index.html | 18 +++++++++++++-----
1 file changed, 13 insertions(+), 5 deletions(-)
diff --git a/webpages/index.html b/webpages/index.html
index 861c4e8..7fb097d 100644
--- a/webpages/index.html
+++ b/webpages/index.html
@@ -19,7 +19,13 @@
BODY {
background-color:#ffffff;
margin:20px;
-width:520px;
+max-width:700px;
+}
+DIV.tt {
+font-family: Lucida Sans Typewriter,Lucida Console,monaco,Bitstream Vera Sans Mono,monospace;
+font-size: 12px;
+font-style: normal;
+font-variant: normal;
}
@@ -39,15 +45,17 @@ there is lots of data. On cheap laptop the speed of analysis is more than
100k leases per second. Number of ranges, or shared networks, does not make
any significant difference in getting analysis done.
From 3d0c510475d09c667aca5474f85c5bff34c174eb Mon Sep 17 00:00:00 2001
From: Sami Kerola
Date: Tue, 29 Dec 2015 21:52:48 +0000
Subject: [PATCH 006/158] webpages: compress sitemap.txt file
More than 90% is hefty pay-off.
$ gzip -v -d sitemap.txt.gz
sitemap.txt.gz: 93.5% -- replaced with sitemap.txt
Signed-off-by: Sami Kerola
---
webpages/robots.txt | 2 +-
webpages/sitemap.txt | 522 ----------------------------------------
webpages/sitemap.txt.gz | Bin 0 -> 2191 bytes
3 files changed, 1 insertion(+), 523 deletions(-)
delete mode 100644 webpages/sitemap.txt
create mode 100644 webpages/sitemap.txt.gz
diff --git a/webpages/robots.txt b/webpages/robots.txt
index 25e6762..796dbd6 100644
--- a/webpages/robots.txt
+++ b/webpages/robots.txt
@@ -1,3 +1,3 @@
-Sitemap: http://dhcpd-pools.sourceforge.net/sitemap.txt
+Sitemap: http://dhcpd-pools.sourceforge.net/sitemap.txt.gz
User-agent: *
Disallow:
diff --git a/webpages/sitemap.txt b/webpages/sitemap.txt
deleted file mode 100644
index 8683dc2..0000000
--- a/webpages/sitemap.txt
+++ /dev/null
@@ -1,522 +0,0 @@
-http://dhcpd-pools.sourceforge.net/
-http://dhcpd-pools.sourceforge.net/dhcpd-pools.awk
-http://dhcpd-pools.sourceforge.net/man.html
-http://dhcpd-pools.sourceforge.net/sampleoutput.txt
-http://dhcpd-pools.sourceforge.net/doxygen/alloca_8h.html
-http://dhcpd-pools.sourceforge.net/doxygen/alloca_8h_source.html
-http://dhcpd-pools.sourceforge.net/doxygen/alloca_8in_8h.html
-http://dhcpd-pools.sourceforge.net/doxygen/alloca_8in_8h_source.html
-http://dhcpd-pools.sourceforge.net/doxygen/analyze_8c.html
-http://dhcpd-pools.sourceforge.net/doxygen/annotated.html
-http://dhcpd-pools.sourceforge.net/doxygen/arg-nonnull_8h.html
-http://dhcpd-pools.sourceforge.net/doxygen/arg-nonnull_8h_source.html
-http://dhcpd-pools.sourceforge.net/doxygen/arpa__inet_8in_8h.html
-http://dhcpd-pools.sourceforge.net/doxygen/arpa__inet_8in_8h_source.html
-http://dhcpd-pools.sourceforge.net/doxygen/c-ctype_8c.html
-http://dhcpd-pools.sourceforge.net/doxygen/c-ctype_8h.html
-http://dhcpd-pools.sourceforge.net/doxygen/c-ctype_8h_source.html
-http://dhcpd-pools.sourceforge.net/doxygen/c-strcase_8h.html
-http://dhcpd-pools.sourceforge.net/doxygen/c-strcase_8h_source.html
-http://dhcpd-pools.sourceforge.net/doxygen/c-strcasecmp_8c.html
-http://dhcpd-pools.sourceforge.net/doxygen/c-strcaseeq_8h.html
-http://dhcpd-pools.sourceforge.net/doxygen/c-strcaseeq_8h_source.html
-http://dhcpd-pools.sourceforge.net/doxygen/c-strncasecmp_8c.html
-http://dhcpd-pools.sourceforge.net/doxygen/c_09_09defs_8h.html
-http://dhcpd-pools.sourceforge.net/doxygen/c_09_09defs_8h_source.html
-http://dhcpd-pools.sourceforge.net/doxygen/classes.html
-http://dhcpd-pools.sourceforge.net/doxygen/close-stream_8c.html
-http://dhcpd-pools.sourceforge.net/doxygen/close-stream_8h.html
-http://dhcpd-pools.sourceforge.net/doxygen/close-stream_8h_source.html
-http://dhcpd-pools.sourceforge.net/doxygen/close_8c.html
-http://dhcpd-pools.sourceforge.net/doxygen/closeout_8c.html
-http://dhcpd-pools.sourceforge.net/doxygen/closeout_8h.html
-http://dhcpd-pools.sourceforge.net/doxygen/closeout_8h_source.html
-http://dhcpd-pools.sourceforge.net/doxygen/config_8h.html
-http://dhcpd-pools.sourceforge.net/doxygen/config_8h_source.html
-http://dhcpd-pools.sourceforge.net/doxygen/configmake_8h.html
-http://dhcpd-pools.sourceforge.net/doxygen/configmake_8h_source.html
-http://dhcpd-pools.sourceforge.net/doxygen/defaults_8h.html
-http://dhcpd-pools.sourceforge.net/doxygen/defaults_8h_source.html
-http://dhcpd-pools.sourceforge.net/doxygen/dhcpd-pools_8c.html
-http://dhcpd-pools.sourceforge.net/doxygen/dhcpd-pools_8h.html
-http://dhcpd-pools.sourceforge.net/doxygen/dhcpd-pools_8h_source.html
-http://dhcpd-pools.sourceforge.net/doxygen/dir_000000_000001.html
-http://dhcpd-pools.sourceforge.net/doxygen/dir_000001_000002.html
-http://dhcpd-pools.sourceforge.net/doxygen/dir_1dacc5f4fcb865f1d9e042339dad3519.html
-http://dhcpd-pools.sourceforge.net/doxygen/dir_97aefd0d527b934f1d99a682da8fe6a9.html
-http://dhcpd-pools.sourceforge.net/doxygen/dir_fb441f6c77667ce4c9ebd4a5c47eafac.html
-http://dhcpd-pools.sourceforge.net/doxygen/dosname_8h.html
-http://dhcpd-pools.sourceforge.net/doxygen/dosname_8h_source.html
-http://dhcpd-pools.sourceforge.net/doxygen/errno_8in_8h.html
-http://dhcpd-pools.sourceforge.net/doxygen/errno_8in_8h_source.html
-http://dhcpd-pools.sourceforge.net/doxygen/error_8c.html
-http://dhcpd-pools.sourceforge.net/doxygen/error_8h.html
-http://dhcpd-pools.sourceforge.net/doxygen/error_8h_source.html
-http://dhcpd-pools.sourceforge.net/doxygen/exitfail_8c.html
-http://dhcpd-pools.sourceforge.net/doxygen/exitfail_8h.html
-http://dhcpd-pools.sourceforge.net/doxygen/exitfail_8h_source.html
-http://dhcpd-pools.sourceforge.net/doxygen/fclose_8c.html
-http://dhcpd-pools.sourceforge.net/doxygen/fcntl_8h.html
-http://dhcpd-pools.sourceforge.net/doxygen/fcntl_8h_source.html
-http://dhcpd-pools.sourceforge.net/doxygen/fcntl_8in_8h.html
-http://dhcpd-pools.sourceforge.net/doxygen/fcntl_8in_8h_source.html
-http://dhcpd-pools.sourceforge.net/doxygen/fd-hook_8c.html
-http://dhcpd-pools.sourceforge.net/doxygen/fd-hook_8h.html
-http://dhcpd-pools.sourceforge.net/doxygen/fd-hook_8h_source.html
-http://dhcpd-pools.sourceforge.net/doxygen/fdopen_8c.html
-http://dhcpd-pools.sourceforge.net/doxygen/fflush_8c.html
-http://dhcpd-pools.sourceforge.net/doxygen/files.html
-http://dhcpd-pools.sourceforge.net/doxygen/float_09_8h.html
-http://dhcpd-pools.sourceforge.net/doxygen/float_09_8h_source.html
-http://dhcpd-pools.sourceforge.net/doxygen/float_8c.html
-http://dhcpd-pools.sourceforge.net/doxygen/float_8in_8h.html
-http://dhcpd-pools.sourceforge.net/doxygen/float_8in_8h_source.html
-http://dhcpd-pools.sourceforge.net/doxygen/fopen_8c.html
-http://dhcpd-pools.sourceforge.net/doxygen/fpending_8c.html
-http://dhcpd-pools.sourceforge.net/doxygen/fpending_8h.html
-http://dhcpd-pools.sourceforge.net/doxygen/fpending_8h_source.html
-http://dhcpd-pools.sourceforge.net/doxygen/fpurge_8c.html
-http://dhcpd-pools.sourceforge.net/doxygen/freading_8c.html
-http://dhcpd-pools.sourceforge.net/doxygen/freading_8h.html
-http://dhcpd-pools.sourceforge.net/doxygen/freading_8h_source.html
-http://dhcpd-pools.sourceforge.net/doxygen/fseek_8c.html
-http://dhcpd-pools.sourceforge.net/doxygen/fseeko_8c.html
-http://dhcpd-pools.sourceforge.net/doxygen/fstat_8c.html
-http://dhcpd-pools.sourceforge.net/doxygen/ftell_8c.html
-http://dhcpd-pools.sourceforge.net/doxygen/ftello_8c.html
-http://dhcpd-pools.sourceforge.net/doxygen/functions.html
-http://dhcpd-pools.sourceforge.net/doxygen/functions_func.html
-http://dhcpd-pools.sourceforge.net/doxygen/functions_vars.html
-http://dhcpd-pools.sourceforge.net/doxygen/getdata_8c.html
-http://dhcpd-pools.sourceforge.net/doxygen/getopt1_8c.html
-http://dhcpd-pools.sourceforge.net/doxygen/getopt_8c.html
-http://dhcpd-pools.sourceforge.net/doxygen/getopt_8in_8h.html
-http://dhcpd-pools.sourceforge.net/doxygen/getopt_8in_8h_source.html
-http://dhcpd-pools.sourceforge.net/doxygen/getopt__int_8h.html
-http://dhcpd-pools.sourceforge.net/doxygen/getopt__int_8h_source.html
-http://dhcpd-pools.sourceforge.net/doxygen/gettext_8h.html
-http://dhcpd-pools.sourceforge.net/doxygen/gettext_8h_source.html
-http://dhcpd-pools.sourceforge.net/doxygen/gettimeofday_8c.html
-http://dhcpd-pools.sourceforge.net/doxygen/globals.html
-http://dhcpd-pools.sourceforge.net/doxygen/globals_a.html
-http://dhcpd-pools.sourceforge.net/doxygen/globals_b.html
-http://dhcpd-pools.sourceforge.net/doxygen/globals_c.html
-http://dhcpd-pools.sourceforge.net/doxygen/globals_d.html
-http://dhcpd-pools.sourceforge.net/doxygen/globals_defs.html
-http://dhcpd-pools.sourceforge.net/doxygen/globals_defs_a.html
-http://dhcpd-pools.sourceforge.net/doxygen/globals_defs_b.html
-http://dhcpd-pools.sourceforge.net/doxygen/globals_defs_c.html
-http://dhcpd-pools.sourceforge.net/doxygen/globals_defs_d.html
-http://dhcpd-pools.sourceforge.net/doxygen/globals_defs_e.html
-http://dhcpd-pools.sourceforge.net/doxygen/globals_defs_f.html
-http://dhcpd-pools.sourceforge.net/doxygen/globals_defs_g.html
-http://dhcpd-pools.sourceforge.net/doxygen/globals_defs_h.html
-http://dhcpd-pools.sourceforge.net/doxygen/globals_defs_i.html
-http://dhcpd-pools.sourceforge.net/doxygen/globals_defs_k.html
-http://dhcpd-pools.sourceforge.net/doxygen/globals_defs_l.html
-http://dhcpd-pools.sourceforge.net/doxygen/globals_defs_m.html
-http://dhcpd-pools.sourceforge.net/doxygen/globals_defs_n.html
-http://dhcpd-pools.sourceforge.net/doxygen/globals_defs_o.html
-http://dhcpd-pools.sourceforge.net/doxygen/globals_defs_p.html
-http://dhcpd-pools.sourceforge.net/doxygen/globals_defs_r.html
-http://dhcpd-pools.sourceforge.net/doxygen/globals_defs_s.html
-http://dhcpd-pools.sourceforge.net/doxygen/globals_defs_t.html
-http://dhcpd-pools.sourceforge.net/doxygen/globals_defs_u.html
-http://dhcpd-pools.sourceforge.net/doxygen/globals_defs_v.html
-http://dhcpd-pools.sourceforge.net/doxygen/globals_defs_w.html
-http://dhcpd-pools.sourceforge.net/doxygen/globals_defs_x.html
-http://dhcpd-pools.sourceforge.net/doxygen/globals_defs_y.html
-http://dhcpd-pools.sourceforge.net/doxygen/globals_e.html
-http://dhcpd-pools.sourceforge.net/doxygen/globals_enum.html
-http://dhcpd-pools.sourceforge.net/doxygen/globals_eval.html
-http://dhcpd-pools.sourceforge.net/doxygen/globals_f.html
-http://dhcpd-pools.sourceforge.net/doxygen/globals_func.html
-http://dhcpd-pools.sourceforge.net/doxygen/globals_func_a.html
-http://dhcpd-pools.sourceforge.net/doxygen/globals_func_c.html
-http://dhcpd-pools.sourceforge.net/doxygen/globals_func_d.html
-http://dhcpd-pools.sourceforge.net/doxygen/globals_func_e.html
-http://dhcpd-pools.sourceforge.net/doxygen/globals_func_f.html
-http://dhcpd-pools.sourceforge.net/doxygen/globals_func_g.html
-http://dhcpd-pools.sourceforge.net/doxygen/globals_func_h.html
-http://dhcpd-pools.sourceforge.net/doxygen/globals_func_i.html
-http://dhcpd-pools.sourceforge.net/doxygen/globals_func_l.html
-http://dhcpd-pools.sourceforge.net/doxygen/globals_func_m.html
-http://dhcpd-pools.sourceforge.net/doxygen/globals_func_n.html
-http://dhcpd-pools.sourceforge.net/doxygen/globals_func_o.html
-http://dhcpd-pools.sourceforge.net/doxygen/globals_func_p.html
-http://dhcpd-pools.sourceforge.net/doxygen/globals_func_q.html
-http://dhcpd-pools.sourceforge.net/doxygen/globals_func_r.html
-http://dhcpd-pools.sourceforge.net/doxygen/globals_func_s.html
-http://dhcpd-pools.sourceforge.net/doxygen/globals_func_t.html
-http://dhcpd-pools.sourceforge.net/doxygen/globals_func_u.html
-http://dhcpd-pools.sourceforge.net/doxygen/globals_func_v.html
-http://dhcpd-pools.sourceforge.net/doxygen/globals_func_x.html
-http://dhcpd-pools.sourceforge.net/doxygen/globals_func_y.html
-http://dhcpd-pools.sourceforge.net/doxygen/globals_g.html
-http://dhcpd-pools.sourceforge.net/doxygen/globals_h.html
-http://dhcpd-pools.sourceforge.net/doxygen/globals_i.html
-http://dhcpd-pools.sourceforge.net/doxygen/globals_k.html
-http://dhcpd-pools.sourceforge.net/doxygen/globals_l.html
-http://dhcpd-pools.sourceforge.net/doxygen/globals_m.html
-http://dhcpd-pools.sourceforge.net/doxygen/globals_n.html
-http://dhcpd-pools.sourceforge.net/doxygen/globals_o.html
-http://dhcpd-pools.sourceforge.net/doxygen/globals_p.html
-http://dhcpd-pools.sourceforge.net/doxygen/globals_q.html
-http://dhcpd-pools.sourceforge.net/doxygen/globals_r.html
-http://dhcpd-pools.sourceforge.net/doxygen/globals_s.html
-http://dhcpd-pools.sourceforge.net/doxygen/globals_t.html
-http://dhcpd-pools.sourceforge.net/doxygen/globals_type.html
-http://dhcpd-pools.sourceforge.net/doxygen/globals_u.html
-http://dhcpd-pools.sourceforge.net/doxygen/globals_v.html
-http://dhcpd-pools.sourceforge.net/doxygen/globals_vars.html
-http://dhcpd-pools.sourceforge.net/doxygen/globals_w.html
-http://dhcpd-pools.sourceforge.net/doxygen/globals_x.html
-http://dhcpd-pools.sourceforge.net/doxygen/globals_y.html
-http://dhcpd-pools.sourceforge.net/doxygen/graph_legend.html
-http://dhcpd-pools.sourceforge.net/doxygen/hash_8c.html
-http://dhcpd-pools.sourceforge.net/doxygen/index.html
-http://dhcpd-pools.sourceforge.net/doxygen/inet_8h.html
-http://dhcpd-pools.sourceforge.net/doxygen/inet_8h_source.html
-http://dhcpd-pools.sourceforge.net/doxygen/inet__pton_8c.html
-http://dhcpd-pools.sourceforge.net/doxygen/intprops_8h.html
-http://dhcpd-pools.sourceforge.net/doxygen/intprops_8h_source.html
-http://dhcpd-pools.sourceforge.net/doxygen/introduction_8dox.html
-http://dhcpd-pools.sourceforge.net/doxygen/isnan_8c.html
-http://dhcpd-pools.sourceforge.net/doxygen/isnand_8c.html
-http://dhcpd-pools.sourceforge.net/doxygen/isnanf_8c.html
-http://dhcpd-pools.sourceforge.net/doxygen/isnanl_8c.html
-http://dhcpd-pools.sourceforge.net/doxygen/itold_8c.html
-http://dhcpd-pools.sourceforge.net/doxygen/langinfo_8h.html
-http://dhcpd-pools.sourceforge.net/doxygen/langinfo_8h_source.html
-http://dhcpd-pools.sourceforge.net/doxygen/langinfo_8in_8h.html
-http://dhcpd-pools.sourceforge.net/doxygen/langinfo_8in_8h_source.html
-http://dhcpd-pools.sourceforge.net/doxygen/localcharset_8c.html
-http://dhcpd-pools.sourceforge.net/doxygen/localcharset_8h.html
-http://dhcpd-pools.sourceforge.net/doxygen/localcharset_8h_source.html
-http://dhcpd-pools.sourceforge.net/doxygen/lseek_8c.html
-http://dhcpd-pools.sourceforge.net/doxygen/malloc_8c.html
-http://dhcpd-pools.sourceforge.net/doxygen/malloca_8c.html
-http://dhcpd-pools.sourceforge.net/doxygen/malloca_8h.html
-http://dhcpd-pools.sourceforge.net/doxygen/malloca_8h_source.html
-http://dhcpd-pools.sourceforge.net/doxygen/math_8c.html
-http://dhcpd-pools.sourceforge.net/doxygen/math_8h.html
-http://dhcpd-pools.sourceforge.net/doxygen/math_8h_source.html
-http://dhcpd-pools.sourceforge.net/doxygen/math_8in_8h.html
-http://dhcpd-pools.sourceforge.net/doxygen/math_8in_8h_source.html
-http://dhcpd-pools.sourceforge.net/doxygen/mbrtowc_8c.html
-http://dhcpd-pools.sourceforge.net/doxygen/mbsinit_8c.html
-http://dhcpd-pools.sourceforge.net/doxygen/memchr_8c.html
-http://dhcpd-pools.sourceforge.net/doxygen/mktime-internal_8h.html
-http://dhcpd-pools.sourceforge.net/doxygen/mktime-internal_8h_source.html
-http://dhcpd-pools.sourceforge.net/doxygen/mktime_8c.html
-http://dhcpd-pools.sourceforge.net/doxygen/msvc-inval_8c.html
-http://dhcpd-pools.sourceforge.net/doxygen/msvc-inval_8h.html
-http://dhcpd-pools.sourceforge.net/doxygen/msvc-inval_8h_source.html
-http://dhcpd-pools.sourceforge.net/doxygen/msvc-nothrow_8c.html
-http://dhcpd-pools.sourceforge.net/doxygen/msvc-nothrow_8h.html
-http://dhcpd-pools.sourceforge.net/doxygen/msvc-nothrow_8h_source.html
-http://dhcpd-pools.sourceforge.net/doxygen/netinet__in_8in_8h.html
-http://dhcpd-pools.sourceforge.net/doxygen/netinet__in_8in_8h_source.html
-http://dhcpd-pools.sourceforge.net/doxygen/other_8c.html
-http://dhcpd-pools.sourceforge.net/doxygen/output_8c.html
-http://dhcpd-pools.sourceforge.net/doxygen/pathmax_8h.html
-http://dhcpd-pools.sourceforge.net/doxygen/pathmax_8h_source.html
-http://dhcpd-pools.sourceforge.net/doxygen/progname_8c.html
-http://dhcpd-pools.sourceforge.net/doxygen/progname_8h.html
-http://dhcpd-pools.sourceforge.net/doxygen/progname_8h_source.html
-http://dhcpd-pools.sourceforge.net/doxygen/quote_8h.html
-http://dhcpd-pools.sourceforge.net/doxygen/quote_8h_source.html
-http://dhcpd-pools.sourceforge.net/doxygen/quotearg_8c.html
-http://dhcpd-pools.sourceforge.net/doxygen/quotearg_8h.html
-http://dhcpd-pools.sourceforge.net/doxygen/quotearg_8h_source.html
-http://dhcpd-pools.sourceforge.net/doxygen/realloc_8c.html
-http://dhcpd-pools.sourceforge.net/doxygen/search/all_0.html
-http://dhcpd-pools.sourceforge.net/doxygen/search/all_1.html
-http://dhcpd-pools.sourceforge.net/doxygen/search/all_10.html
-http://dhcpd-pools.sourceforge.net/doxygen/search/all_11.html
-http://dhcpd-pools.sourceforge.net/doxygen/search/all_12.html
-http://dhcpd-pools.sourceforge.net/doxygen/search/all_13.html
-http://dhcpd-pools.sourceforge.net/doxygen/search/all_14.html
-http://dhcpd-pools.sourceforge.net/doxygen/search/all_15.html
-http://dhcpd-pools.sourceforge.net/doxygen/search/all_16.html
-http://dhcpd-pools.sourceforge.net/doxygen/search/all_17.html
-http://dhcpd-pools.sourceforge.net/doxygen/search/all_18.html
-http://dhcpd-pools.sourceforge.net/doxygen/search/all_2.html
-http://dhcpd-pools.sourceforge.net/doxygen/search/all_3.html
-http://dhcpd-pools.sourceforge.net/doxygen/search/all_4.html
-http://dhcpd-pools.sourceforge.net/doxygen/search/all_5.html
-http://dhcpd-pools.sourceforge.net/doxygen/search/all_6.html
-http://dhcpd-pools.sourceforge.net/doxygen/search/all_7.html
-http://dhcpd-pools.sourceforge.net/doxygen/search/all_8.html
-http://dhcpd-pools.sourceforge.net/doxygen/search/all_9.html
-http://dhcpd-pools.sourceforge.net/doxygen/search/all_a.html
-http://dhcpd-pools.sourceforge.net/doxygen/search/all_b.html
-http://dhcpd-pools.sourceforge.net/doxygen/search/all_c.html
-http://dhcpd-pools.sourceforge.net/doxygen/search/all_d.html
-http://dhcpd-pools.sourceforge.net/doxygen/search/all_e.html
-http://dhcpd-pools.sourceforge.net/doxygen/search/all_f.html
-http://dhcpd-pools.sourceforge.net/doxygen/search/classes_0.html
-http://dhcpd-pools.sourceforge.net/doxygen/search/classes_1.html
-http://dhcpd-pools.sourceforge.net/doxygen/search/classes_2.html
-http://dhcpd-pools.sourceforge.net/doxygen/search/classes_3.html
-http://dhcpd-pools.sourceforge.net/doxygen/search/classes_4.html
-http://dhcpd-pools.sourceforge.net/doxygen/search/classes_5.html
-http://dhcpd-pools.sourceforge.net/doxygen/search/classes_6.html
-http://dhcpd-pools.sourceforge.net/doxygen/search/classes_7.html
-http://dhcpd-pools.sourceforge.net/doxygen/search/classes_8.html
-http://dhcpd-pools.sourceforge.net/doxygen/search/classes_9.html
-http://dhcpd-pools.sourceforge.net/doxygen/search/defines_0.html
-http://dhcpd-pools.sourceforge.net/doxygen/search/defines_1.html
-http://dhcpd-pools.sourceforge.net/doxygen/search/defines_10.html
-http://dhcpd-pools.sourceforge.net/doxygen/search/defines_11.html
-http://dhcpd-pools.sourceforge.net/doxygen/search/defines_12.html
-http://dhcpd-pools.sourceforge.net/doxygen/search/defines_13.html
-http://dhcpd-pools.sourceforge.net/doxygen/search/defines_14.html
-http://dhcpd-pools.sourceforge.net/doxygen/search/defines_15.html
-http://dhcpd-pools.sourceforge.net/doxygen/search/defines_16.html
-http://dhcpd-pools.sourceforge.net/doxygen/search/defines_17.html
-http://dhcpd-pools.sourceforge.net/doxygen/search/defines_2.html
-http://dhcpd-pools.sourceforge.net/doxygen/search/defines_3.html
-http://dhcpd-pools.sourceforge.net/doxygen/search/defines_4.html
-http://dhcpd-pools.sourceforge.net/doxygen/search/defines_5.html
-http://dhcpd-pools.sourceforge.net/doxygen/search/defines_6.html
-http://dhcpd-pools.sourceforge.net/doxygen/search/defines_7.html
-http://dhcpd-pools.sourceforge.net/doxygen/search/defines_8.html
-http://dhcpd-pools.sourceforge.net/doxygen/search/defines_9.html
-http://dhcpd-pools.sourceforge.net/doxygen/search/defines_a.html
-http://dhcpd-pools.sourceforge.net/doxygen/search/defines_b.html
-http://dhcpd-pools.sourceforge.net/doxygen/search/defines_c.html
-http://dhcpd-pools.sourceforge.net/doxygen/search/defines_d.html
-http://dhcpd-pools.sourceforge.net/doxygen/search/defines_e.html
-http://dhcpd-pools.sourceforge.net/doxygen/search/defines_f.html
-http://dhcpd-pools.sourceforge.net/doxygen/search/enums_0.html
-http://dhcpd-pools.sourceforge.net/doxygen/search/enums_1.html
-http://dhcpd-pools.sourceforge.net/doxygen/search/enums_2.html
-http://dhcpd-pools.sourceforge.net/doxygen/search/enums_3.html
-http://dhcpd-pools.sourceforge.net/doxygen/search/enums_4.html
-http://dhcpd-pools.sourceforge.net/doxygen/search/enums_5.html
-http://dhcpd-pools.sourceforge.net/doxygen/search/enumvalues_0.html
-http://dhcpd-pools.sourceforge.net/doxygen/search/enumvalues_1.html
-http://dhcpd-pools.sourceforge.net/doxygen/search/enumvalues_2.html
-http://dhcpd-pools.sourceforge.net/doxygen/search/enumvalues_3.html
-http://dhcpd-pools.sourceforge.net/doxygen/search/enumvalues_4.html
-http://dhcpd-pools.sourceforge.net/doxygen/search/enumvalues_5.html
-http://dhcpd-pools.sourceforge.net/doxygen/search/enumvalues_6.html
-http://dhcpd-pools.sourceforge.net/doxygen/search/enumvalues_7.html
-http://dhcpd-pools.sourceforge.net/doxygen/search/enumvalues_8.html
-http://dhcpd-pools.sourceforge.net/doxygen/search/enumvalues_9.html
-http://dhcpd-pools.sourceforge.net/doxygen/search/enumvalues_a.html
-http://dhcpd-pools.sourceforge.net/doxygen/search/enumvalues_b.html
-http://dhcpd-pools.sourceforge.net/doxygen/search/enumvalues_c.html
-http://dhcpd-pools.sourceforge.net/doxygen/search/enumvalues_d.html
-http://dhcpd-pools.sourceforge.net/doxygen/search/files_0.html
-http://dhcpd-pools.sourceforge.net/doxygen/search/files_1.html
-http://dhcpd-pools.sourceforge.net/doxygen/search/files_10.html
-http://dhcpd-pools.sourceforge.net/doxygen/search/files_11.html
-http://dhcpd-pools.sourceforge.net/doxygen/search/files_12.html
-http://dhcpd-pools.sourceforge.net/doxygen/search/files_13.html
-http://dhcpd-pools.sourceforge.net/doxygen/search/files_14.html
-http://dhcpd-pools.sourceforge.net/doxygen/search/files_2.html
-http://dhcpd-pools.sourceforge.net/doxygen/search/files_3.html
-http://dhcpd-pools.sourceforge.net/doxygen/search/files_4.html
-http://dhcpd-pools.sourceforge.net/doxygen/search/files_5.html
-http://dhcpd-pools.sourceforge.net/doxygen/search/files_6.html
-http://dhcpd-pools.sourceforge.net/doxygen/search/files_7.html
-http://dhcpd-pools.sourceforge.net/doxygen/search/files_8.html
-http://dhcpd-pools.sourceforge.net/doxygen/search/files_9.html
-http://dhcpd-pools.sourceforge.net/doxygen/search/files_a.html
-http://dhcpd-pools.sourceforge.net/doxygen/search/files_b.html
-http://dhcpd-pools.sourceforge.net/doxygen/search/files_c.html
-http://dhcpd-pools.sourceforge.net/doxygen/search/files_d.html
-http://dhcpd-pools.sourceforge.net/doxygen/search/files_e.html
-http://dhcpd-pools.sourceforge.net/doxygen/search/files_f.html
-http://dhcpd-pools.sourceforge.net/doxygen/search/functions_0.html
-http://dhcpd-pools.sourceforge.net/doxygen/search/functions_1.html
-http://dhcpd-pools.sourceforge.net/doxygen/search/functions_10.html
-http://dhcpd-pools.sourceforge.net/doxygen/search/functions_11.html
-http://dhcpd-pools.sourceforge.net/doxygen/search/functions_12.html
-http://dhcpd-pools.sourceforge.net/doxygen/search/functions_13.html
-http://dhcpd-pools.sourceforge.net/doxygen/search/functions_14.html
-http://dhcpd-pools.sourceforge.net/doxygen/search/functions_15.html
-http://dhcpd-pools.sourceforge.net/doxygen/search/functions_2.html
-http://dhcpd-pools.sourceforge.net/doxygen/search/functions_3.html
-http://dhcpd-pools.sourceforge.net/doxygen/search/functions_4.html
-http://dhcpd-pools.sourceforge.net/doxygen/search/functions_5.html
-http://dhcpd-pools.sourceforge.net/doxygen/search/functions_6.html
-http://dhcpd-pools.sourceforge.net/doxygen/search/functions_7.html
-http://dhcpd-pools.sourceforge.net/doxygen/search/functions_8.html
-http://dhcpd-pools.sourceforge.net/doxygen/search/functions_9.html
-http://dhcpd-pools.sourceforge.net/doxygen/search/functions_a.html
-http://dhcpd-pools.sourceforge.net/doxygen/search/functions_b.html
-http://dhcpd-pools.sourceforge.net/doxygen/search/functions_c.html
-http://dhcpd-pools.sourceforge.net/doxygen/search/functions_d.html
-http://dhcpd-pools.sourceforge.net/doxygen/search/functions_e.html
-http://dhcpd-pools.sourceforge.net/doxygen/search/functions_f.html
-http://dhcpd-pools.sourceforge.net/doxygen/search/nomatches.html
-http://dhcpd-pools.sourceforge.net/doxygen/search/typedefs_0.html
-http://dhcpd-pools.sourceforge.net/doxygen/search/typedefs_1.html
-http://dhcpd-pools.sourceforge.net/doxygen/search/typedefs_2.html
-http://dhcpd-pools.sourceforge.net/doxygen/search/typedefs_3.html
-http://dhcpd-pools.sourceforge.net/doxygen/search/typedefs_4.html
-http://dhcpd-pools.sourceforge.net/doxygen/search/typedefs_5.html
-http://dhcpd-pools.sourceforge.net/doxygen/search/typedefs_6.html
-http://dhcpd-pools.sourceforge.net/doxygen/search/typedefs_7.html
-http://dhcpd-pools.sourceforge.net/doxygen/search/typedefs_8.html
-http://dhcpd-pools.sourceforge.net/doxygen/search/typedefs_9.html
-http://dhcpd-pools.sourceforge.net/doxygen/search/variables_0.html
-http://dhcpd-pools.sourceforge.net/doxygen/search/variables_1.html
-http://dhcpd-pools.sourceforge.net/doxygen/search/variables_10.html
-http://dhcpd-pools.sourceforge.net/doxygen/search/variables_11.html
-http://dhcpd-pools.sourceforge.net/doxygen/search/variables_12.html
-http://dhcpd-pools.sourceforge.net/doxygen/search/variables_13.html
-http://dhcpd-pools.sourceforge.net/doxygen/search/variables_14.html
-http://dhcpd-pools.sourceforge.net/doxygen/search/variables_15.html
-http://dhcpd-pools.sourceforge.net/doxygen/search/variables_16.html
-http://dhcpd-pools.sourceforge.net/doxygen/search/variables_2.html
-http://dhcpd-pools.sourceforge.net/doxygen/search/variables_3.html
-http://dhcpd-pools.sourceforge.net/doxygen/search/variables_4.html
-http://dhcpd-pools.sourceforge.net/doxygen/search/variables_5.html
-http://dhcpd-pools.sourceforge.net/doxygen/search/variables_6.html
-http://dhcpd-pools.sourceforge.net/doxygen/search/variables_7.html
-http://dhcpd-pools.sourceforge.net/doxygen/search/variables_8.html
-http://dhcpd-pools.sourceforge.net/doxygen/search/variables_9.html
-http://dhcpd-pools.sourceforge.net/doxygen/search/variables_a.html
-http://dhcpd-pools.sourceforge.net/doxygen/search/variables_b.html
-http://dhcpd-pools.sourceforge.net/doxygen/search/variables_c.html
-http://dhcpd-pools.sourceforge.net/doxygen/search/variables_d.html
-http://dhcpd-pools.sourceforge.net/doxygen/search/variables_e.html
-http://dhcpd-pools.sourceforge.net/doxygen/search/variables_f.html
-http://dhcpd-pools.sourceforge.net/doxygen/setenv_8c.html
-http://dhcpd-pools.sourceforge.net/doxygen/socket_8h.html
-http://dhcpd-pools.sourceforge.net/doxygen/socket_8h_source.html
-http://dhcpd-pools.sourceforge.net/doxygen/sort_8c.html
-http://dhcpd-pools.sourceforge.net/doxygen/stat_8c.html
-http://dhcpd-pools.sourceforge.net/doxygen/stat_8h.html
-http://dhcpd-pools.sourceforge.net/doxygen/stat_8h_source.html
-http://dhcpd-pools.sourceforge.net/doxygen/stdalign_8in_8h.html
-http://dhcpd-pools.sourceforge.net/doxygen/stdalign_8in_8h_source.html
-http://dhcpd-pools.sourceforge.net/doxygen/stdbool_8in_8h.html
-http://dhcpd-pools.sourceforge.net/doxygen/stdbool_8in_8h_source.html
-http://dhcpd-pools.sourceforge.net/doxygen/stddef_8in_8h.html
-http://dhcpd-pools.sourceforge.net/doxygen/stddef_8in_8h_source.html
-http://dhcpd-pools.sourceforge.net/doxygen/stdint_8in_8h.html
-http://dhcpd-pools.sourceforge.net/doxygen/stdint_8in_8h_source.html
-http://dhcpd-pools.sourceforge.net/doxygen/stdio-impl_8h.html
-http://dhcpd-pools.sourceforge.net/doxygen/stdio-impl_8h_source.html
-http://dhcpd-pools.sourceforge.net/doxygen/stdio_8h.html
-http://dhcpd-pools.sourceforge.net/doxygen/stdio_8h_source.html
-http://dhcpd-pools.sourceforge.net/doxygen/stdio_8in_8h.html
-http://dhcpd-pools.sourceforge.net/doxygen/stdio_8in_8h_source.html
-http://dhcpd-pools.sourceforge.net/doxygen/stdlib_8h.html
-http://dhcpd-pools.sourceforge.net/doxygen/stdlib_8h_source.html
-http://dhcpd-pools.sourceforge.net/doxygen/stdlib_8in_8h.html
-http://dhcpd-pools.sourceforge.net/doxygen/stdlib_8in_8h_source.html
-http://dhcpd-pools.sourceforge.net/doxygen/stpncpy_8c.html
-http://dhcpd-pools.sourceforge.net/doxygen/str-two-way_8h.html
-http://dhcpd-pools.sourceforge.net/doxygen/str-two-way_8h_source.html
-http://dhcpd-pools.sourceforge.net/doxygen/strdup_8c.html
-http://dhcpd-pools.sourceforge.net/doxygen/streq_8h.html
-http://dhcpd-pools.sourceforge.net/doxygen/streq_8h_source.html
-http://dhcpd-pools.sourceforge.net/doxygen/strerror-override_8c.html
-http://dhcpd-pools.sourceforge.net/doxygen/strerror-override_8h.html
-http://dhcpd-pools.sourceforge.net/doxygen/strerror-override_8h_source.html
-http://dhcpd-pools.sourceforge.net/doxygen/strerror_8c.html
-http://dhcpd-pools.sourceforge.net/doxygen/strftime_8c.html
-http://dhcpd-pools.sourceforge.net/doxygen/strftime_8h.html
-http://dhcpd-pools.sourceforge.net/doxygen/strftime_8h_source.html
-http://dhcpd-pools.sourceforge.net/doxygen/string_8h.html
-http://dhcpd-pools.sourceforge.net/doxygen/string_8h_source.html
-http://dhcpd-pools.sourceforge.net/doxygen/string_8in_8h.html
-http://dhcpd-pools.sourceforge.net/doxygen/string_8in_8h_source.html
-http://dhcpd-pools.sourceforge.net/doxygen/strstr_8c.html
-http://dhcpd-pools.sourceforge.net/doxygen/struct____time__t__must__be__integral-members.html
-http://dhcpd-pools.sourceforge.net/doxygen/struct____time__t__must__be__integral.html
-http://dhcpd-pools.sourceforge.net/doxygen/struct__getopt__data-members.html
-http://dhcpd-pools.sourceforge.net/doxygen/struct__getopt__data.html
-http://dhcpd-pools.sourceforge.net/doxygen/structconfiguration__t-members.html
-http://dhcpd-pools.sourceforge.net/doxygen/structconfiguration__t.html
-http://dhcpd-pools.sourceforge.net/doxygen/structiovec-members.html
-http://dhcpd-pools.sourceforge.net/doxygen/structiovec.html
-http://dhcpd-pools.sourceforge.net/doxygen/structleases__t-members.html
-http://dhcpd-pools.sourceforge.net/doxygen/structleases__t.html
-http://dhcpd-pools.sourceforge.net/doxygen/structmsghdr-members.html
-http://dhcpd-pools.sourceforge.net/doxygen/structmsghdr.html
-http://dhcpd-pools.sourceforge.net/doxygen/structoption-members.html
-http://dhcpd-pools.sourceforge.net/doxygen/structoption.html
-http://dhcpd-pools.sourceforge.net/doxygen/structoutput__sort-members.html
-http://dhcpd-pools.sourceforge.net/doxygen/structoutput__sort.html
-http://dhcpd-pools.sourceforge.net/doxygen/structquoting__options-members.html
-http://dhcpd-pools.sourceforge.net/doxygen/structquoting__options.html
-http://dhcpd-pools.sourceforge.net/doxygen/structrange__t-members.html
-http://dhcpd-pools.sourceforge.net/doxygen/structrange__t.html
-http://dhcpd-pools.sourceforge.net/doxygen/structshared__network__t-members.html
-http://dhcpd-pools.sourceforge.net/doxygen/structshared__network__t.html
-http://dhcpd-pools.sourceforge.net/doxygen/structslotvec-members.html
-http://dhcpd-pools.sourceforge.net/doxygen/structslotvec.html
-http://dhcpd-pools.sourceforge.net/doxygen/structsockaddr__storage-members.html
-http://dhcpd-pools.sourceforge.net/doxygen/structsockaddr__storage.html
-http://dhcpd-pools.sourceforge.net/doxygen/structtimespec-members.html
-http://dhcpd-pools.sourceforge.net/doxygen/structtimespec.html
-http://dhcpd-pools.sourceforge.net/doxygen/structtimeval-members.html
-http://dhcpd-pools.sourceforge.net/doxygen/structtimeval.html
-http://dhcpd-pools.sourceforge.net/doxygen/structtm__zone-members.html
-http://dhcpd-pools.sourceforge.net/doxygen/structtm__zone.html
-http://dhcpd-pools.sourceforge.net/doxygen/sys_2time_8h.html
-http://dhcpd-pools.sourceforge.net/doxygen/sys_2time_8h_source.html
-http://dhcpd-pools.sourceforge.net/doxygen/sys__socket_8c.html
-http://dhcpd-pools.sourceforge.net/doxygen/sys__socket_8in_8h.html
-http://dhcpd-pools.sourceforge.net/doxygen/sys__socket_8in_8h_source.html
-http://dhcpd-pools.sourceforge.net/doxygen/sys__stat_8in_8h.html
-http://dhcpd-pools.sourceforge.net/doxygen/sys__stat_8in_8h_source.html
-http://dhcpd-pools.sourceforge.net/doxygen/sys__time_8in_8h.html
-http://dhcpd-pools.sourceforge.net/doxygen/sys__time_8in_8h_source.html
-http://dhcpd-pools.sourceforge.net/doxygen/sys__types_8in_8h.html
-http://dhcpd-pools.sourceforge.net/doxygen/sys__types_8in_8h_source.html
-http://dhcpd-pools.sourceforge.net/doxygen/sys__uio_8in_8h.html
-http://dhcpd-pools.sourceforge.net/doxygen/sys__uio_8in_8h_source.html
-http://dhcpd-pools.sourceforge.net/doxygen/time-internal_8h.html
-http://dhcpd-pools.sourceforge.net/doxygen/time-internal_8h_source.html
-http://dhcpd-pools.sourceforge.net/doxygen/time_8h.html
-http://dhcpd-pools.sourceforge.net/doxygen/time_8h_source.html
-http://dhcpd-pools.sourceforge.net/doxygen/time_8in_8h.html
-http://dhcpd-pools.sourceforge.net/doxygen/time_8in_8h_source.html
-http://dhcpd-pools.sourceforge.net/doxygen/time__r_8c.html
-http://dhcpd-pools.sourceforge.net/doxygen/time__rz_8c.html
-http://dhcpd-pools.sourceforge.net/doxygen/timegm_8c.html
-http://dhcpd-pools.sourceforge.net/doxygen/types_8h.html
-http://dhcpd-pools.sourceforge.net/doxygen/types_8h_source.html
-http://dhcpd-pools.sourceforge.net/doxygen/uio_8h.html
-http://dhcpd-pools.sourceforge.net/doxygen/uio_8h_source.html
-http://dhcpd-pools.sourceforge.net/doxygen/unionipaddr__t-members.html
-http://dhcpd-pools.sourceforge.net/doxygen/unionipaddr__t.html
-http://dhcpd-pools.sourceforge.net/doxygen/unionmax__align__t-members.html
-http://dhcpd-pools.sourceforge.net/doxygen/unionmax__align__t.html
-http://dhcpd-pools.sourceforge.net/doxygen/unionmemory__double-members.html
-http://dhcpd-pools.sourceforge.net/doxygen/unionmemory__double.html
-http://dhcpd-pools.sourceforge.net/doxygen/unistd_8c.html
-http://dhcpd-pools.sourceforge.net/doxygen/unistd_8h.html
-http://dhcpd-pools.sourceforge.net/doxygen/unistd_8h_source.html
-http://dhcpd-pools.sourceforge.net/doxygen/unistd_8in_8h.html
-http://dhcpd-pools.sourceforge.net/doxygen/unistd_8in_8h_source.html
-http://dhcpd-pools.sourceforge.net/doxygen/unsetenv_8c.html
-http://dhcpd-pools.sourceforge.net/doxygen/unused-parameter_8h.html
-http://dhcpd-pools.sourceforge.net/doxygen/unused-parameter_8h_source.html
-http://dhcpd-pools.sourceforge.net/doxygen/verify_8h.html
-http://dhcpd-pools.sourceforge.net/doxygen/verify_8h_source.html
-http://dhcpd-pools.sourceforge.net/doxygen/warn-on-use_8h.html
-http://dhcpd-pools.sourceforge.net/doxygen/warn-on-use_8h_source.html
-http://dhcpd-pools.sourceforge.net/doxygen/wchar_8h.html
-http://dhcpd-pools.sourceforge.net/doxygen/wchar_8h_source.html
-http://dhcpd-pools.sourceforge.net/doxygen/wchar_8in_8h.html
-http://dhcpd-pools.sourceforge.net/doxygen/wchar_8in_8h_source.html
-http://dhcpd-pools.sourceforge.net/doxygen/wctype-h_8c.html
-http://dhcpd-pools.sourceforge.net/doxygen/wctype_8h.html
-http://dhcpd-pools.sourceforge.net/doxygen/wctype_8h_source.html
-http://dhcpd-pools.sourceforge.net/doxygen/wctype_8in_8h.html
-http://dhcpd-pools.sourceforge.net/doxygen/wctype_8in_8h_source.html
-http://dhcpd-pools.sourceforge.net/doxygen/xalloc-die_8c.html
-http://dhcpd-pools.sourceforge.net/doxygen/xalloc-oversized_8h.html
-http://dhcpd-pools.sourceforge.net/doxygen/xalloc-oversized_8h_source.html
-http://dhcpd-pools.sourceforge.net/doxygen/xalloc_8h.html
-http://dhcpd-pools.sourceforge.net/doxygen/xalloc_8h_source.html
-http://dhcpd-pools.sourceforge.net/doxygen/xmalloc_8c.html
diff --git a/webpages/sitemap.txt.gz b/webpages/sitemap.txt.gz
new file mode 100644
index 0000000000000000000000000000000000000000..354ae7ba4036d51be722928dc0b6f6696733b612
GIT binary patch
literal 2191
zcmV;A2ypiwiwFp6Uu9MT19NF~Wo=<_E_8Tw0Ii+ta;qu>hW~%}lGP?Lr|)JQ1Po3U
zT!=aJ>Njc*rrk5UeP7meRy%E;hZhheo?=31|Nr);jBM4Sb*}FIbguVOm(CycAFIRL
z|IB~CX8t#E{`d*f2>Zu`rvAxmJJGbYc7163@F!ftk0QCt^{DNesB0%hzBfNE?Hid-
zuYd)WWr`nZID!@R^;742382;m5w!X}>5mKRtnKR>s`v{I*W9-vU+=xC6c#&?s^t
z!?lGv;ei?g#dCMTOVNSFKVdq6Y+9`KZoK|WRbj-bN?4{A`THS$DP49@EnaZA7PaU)
z-2t5I^w0uYG*IPVc*F8|^#S&?QS?O7{@31HhpxWnFcH9cWcb`b1A}nlOBG5{)lldMYZw-dUc&pxQrZBe
zzJqw=k;gXBISdC-3*+1e)M$6q5GbD8wc0|l%ewCjL{>Gh{w!-J!mt8H+Ud!{4K*r|
z+D;(2Y0h9cIo!jMQ(E|9$C49h3+Hsd7YJ8Yb9l$$fx~+aKXLel!|}Ze
zKGgA1jt_8r!HLfb_=JGZ1^6_8&j9$~$HzTB5ZD2`8;q}Z@hJ(I
zjl5`0UhDYt?-x!+V5fj8tMmn+G;}!a#-Yd3Mm%qWvshI_>s{Mn!5=IhK6t14@c?wb
zkH7uBp|b+3`2Z@IEMXElu}}q9Lt$%SkCiPQ(!nzp?ck>ZJK+9>hhsP?YH8wpsiCt5
zue@P-xEkm=v}U}@8z%*Y8UjU|su96pp$E>O92XZGBQq8*zVN}Fu??i?DqBILs?m)!
z(1laY$8i2=5qBTjTLE3v^IZWq-e`iV(Vb*Wa1u338;*vnK1i$!#=A3Ig$Hj~9<4_F
zd0Ivdg9sah-xX+>SQ`xuis{BBglyvs(ufOE?wuoDVOTV}*YH}Ti$zN_+_9FwGw_mvxuUtUR}{Ub=!~K_6uqVB9YyaMn(8pB
zzo_n_dW-5Ts;{W7Ixw(c;DUjvX;d+=X5bQqZ+8gddw{!O$qH7iV9g3LRcbd1KkaDFYH+X
zJu?YbP_P2Y3KT2QtN>oA3|H3?dxr^Ma`=kF*BqX4_=dqxqV6@>{5Qukfn$}xu}W=_IaqM+W;Jr&CYiWD(YOb1Pte7FPJUoFTRceg62;DW
z=rUULabpu_P!6tUP@=Am@FmY*cp^p-UqGao;Y5hI+95JLX(Gb-NG~|TlV&2gMb)%5
z8sR}x5#ZAKg7MaOeB;+u0hT_IY|(J#pEMq!wX(fp)2CmAvs;{phshZd$MbvDw_tqi
zb0h8`5qW%$^unFu_eyCr{TGQzB4KL
zUWPpW8#^G6KQ?_A|1b3Th)sR;qFyw*DKzk~g&)~r>-|Zf!vk39h;tbznLZGs_hP)A
zKM!Q4uR2gu#YshyQAP*I)>;gg8Pm=2@PK^N9gXs2h)Dv%ar=rrNhX*iC_LRFnGf&q
z*c>wzs2J|18|J=zs#8ZM`lVe=C1iYe(mxVydIsw
z@RBS#^82AU$>HG2@|%LIOAus~Ad&=`I)(@`6L3MU?Qo=@Nis7~QF`Lo%`1<_pdUz*
z>Tx9KpeM&WvsEV8AgA|N&|AP8`iZhf=o2Szo4$cTw559N_-aobUF~gLkyh=r#=w_y
zuNn*=o>r1iCob3|FDg)>8|Sa_ZMW--T9a{JT!^C!&_m|#q`^sI!x{zH#PdSq5%9B|
zz3n?4UnIO}qQqmB_~t;Xa?-vkp`+*z5-s{Hyj?iE=&{d%e#PMs!!!Dz;%^{XFt!!X
zVLZUFUs*uU%say$9)4y&JNzy{8*WCU5iaBNj25bbP8;0l;lxK*eQIbD{TByU89W42
R^p}TJ{sY>yYmzjA004vGJ_G;&
literal 0
HcmV?d00001
From 10b06d88f0bd5d14fb2e90fab8df8f680543c321 Mon Sep 17 00:00:00 2001
From: Sami Kerola
Date: Thu, 18 Feb 2016 22:35:56 +0000
Subject: [PATCH 007/158] getdata: flip ranges if they are in greater smaller
order
Apparently ISC dhcpd allows marking ranges in order from greater IP to
smaller. In these cases first and last IPs are fliped, so that the rest of
the processing can be done without alterations.
Reported-by: Ivanov Ivan
Signed-off-by: Sami Kerola
---
THANKS | 1 +
src/getdata.c | 14 ++++++++++++++
2 files changed, 15 insertions(+)
diff --git a/THANKS b/THANKS
index 8c8f80b..1302c03 100644
--- a/THANKS
+++ b/THANKS
@@ -37,3 +37,4 @@ Tim Cantin
Martijn van Brummelen
Anton Tkachev
Derrick Lin
+Ivanov Ivan
diff --git a/src/getdata.c b/src/getdata.c
index 03a0b13..3e3be1f 100644
--- a/src/getdata.c
+++ b/src/getdata.c
@@ -163,6 +163,19 @@ static int is_interesting_config_clause(char const *restrict s)
return ITS_NOTHING_INTERESTING;
}
+/*! \brief Flip first and last IP in range if they are in unusual order.
+ */
+void reorder_last_first(struct range_t *range_p)
+{
+ if (ipcomp(&range_p->first_ip, &range_p->last_ip) > 0) {
+ union ipaddr_t tmp;
+
+ tmp = range_p->first_ip;
+ range_p->first_ip = range_p->last_ip;
+ range_p->last_ip = tmp;
+ }
+}
+
/*! \brief The dhcpd.conf file parser.
* FIXME: This spaghetti monster function need to be rewrote at least
* ones.
@@ -334,6 +347,7 @@ void parse_config(int is_include, const char *restrict config_file,
copy_ipaddr(&range_p->first_ip, &addr);
}
copy_ipaddr(&range_p->last_ip, &addr);
+ reorder_last_first(range_p);
newrange:
range_p->count = 0;
range_p->touched = 0;
From c305e2f82cd5c3997f36d7004fdc33a4973cf753 Mon Sep 17 00:00:00 2001
From: Sami Kerola
Date: Thu, 18 Feb 2016 23:03:15 +0000
Subject: [PATCH 008/158] tests: add range definition flip test
This test ensure 10b06d88f0bd5d14fb2e90fab8df8f680543c321 will not get
regression in future.
Signed-off-by: Sami Kerola
---
tests/Makemodule.am | 1 +
tests/big-small | 1 +
tests/confs/big-small | 5 +++++
tests/expected/big-small | 10 ++++++++++
tests/leases/big-small | 1 +
5 files changed, 18 insertions(+)
create mode 120000 tests/big-small
create mode 100644 tests/confs/big-small
create mode 100644 tests/expected/big-small
create mode 120000 tests/leases/big-small
diff --git a/tests/Makemodule.am b/tests/Makemodule.am
index b4c0a94..12d6907 100644
--- a/tests/Makemodule.am
+++ b/tests/Makemodule.am
@@ -10,6 +10,7 @@ TESTS = \
tests/alarm-warning-ranges \
tests/alarm-warning-snets \
tests/shnet-alarm \
+ tests/big-small \
tests/bootp \
tests/complete \
tests/empty \
diff --git a/tests/big-small b/tests/big-small
new file mode 120000
index 0000000..61a58b0
--- /dev/null
+++ b/tests/big-small
@@ -0,0 +1 @@
+test.sh
\ No newline at end of file
diff --git a/tests/confs/big-small b/tests/confs/big-small
new file mode 100644
index 0000000..7cc8997
--- /dev/null
+++ b/tests/confs/big-small
@@ -0,0 +1,5 @@
+subnet 10.0.0.0 netmask 255.255.255.0 {
+ pool {
+ range 10.0.0.10 10.0.0.1;
+ }
+}
diff --git a/tests/expected/big-small b/tests/expected/big-small
new file mode 100644
index 0000000..da14b05
--- /dev/null
+++ b/tests/expected/big-small
@@ -0,0 +1,10 @@
+Ranges:
+shared net name first ip last ip max cur percent touch t+c t+c perc
+All networks 10.0.0.1 - 10.0.0.10 10 10 100.000 0 10 100.000
+
+Shared networks:
+name max cur percent touch t+c t+c perc
+
+Sum of all ranges:
+name max cur percent touch t+c t+c perc
+All networks 10 10 100.000 0 10 100.000
diff --git a/tests/leases/big-small b/tests/leases/big-small
new file mode 120000
index 0000000..8fd3246
--- /dev/null
+++ b/tests/leases/big-small
@@ -0,0 +1 @@
+simple
\ No newline at end of file
From 32e2d399a00041bd4c0720debf36c2260800f034 Mon Sep 17 00:00:00 2001
From: Manuel Hachtkemper
Date: Tue, 29 Mar 2016 14:49:06 +0200
Subject: [PATCH 009/158] alarming: add additional performance data
Options -p or --perfdata (in alarming mode) now enable the output of
additional performance data, i.e. used, touched and backup addresses per
subnet.
Signed-off-by: Manuel Hachtkemper
Signed-off-by: Sami Kerola
---
THANKS | 1 +
man/dhcpd-pools.1.in | 6 ++++
src/dhcpd-pools.c | 8 +++++-
src/dhcpd-pools.h | 1 +
src/other.c | 1 +
src/output.c | 47 ++++++++++++++++++++++++++++++-
tests/Makemodule.am | 4 ++-
tests/complete-perfdata | 16 +++++++++++
tests/expected/alarm-count-option | 1 -
tests/expected/complete-perfdata | 3 ++
tests/expected/v6-perfdata | 3 ++
tests/v6-perfdata | 16 +++++++++++
12 files changed, 103 insertions(+), 4 deletions(-)
create mode 100755 tests/complete-perfdata
create mode 100644 tests/expected/complete-perfdata
create mode 100644 tests/expected/v6-perfdata
create mode 100755 tests/v6-perfdata
diff --git a/THANKS b/THANKS
index 1302c03..8375381 100644
--- a/THANKS
+++ b/THANKS
@@ -38,3 +38,4 @@ Martijn van Brummelen
Anton Tkachev
Derrick Lin
Ivanov Ivan
+Manuel Hachtkemper
diff --git a/man/dhcpd-pools.1.in b/man/dhcpd-pools.1.in
index df78f84..88794d8 100644
--- a/man/dhcpd-pools.1.in
+++ b/man/dhcpd-pools.1.in
@@ -192,6 +192,12 @@ defined size. This option is meaningful only in context of alarming, and
will intented to supress for example single host ranges. By default this
option is not in use.
.TP
+\fB\-p\fR, \fB\-\-perfdata\fR
+Print additional performance data, like lease count, touched leases and
+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\-v\fR, \fB\-\-version\fR
Print version information to standard output and exit successfully.
.TP
diff --git a/src/dhcpd-pools.c b/src/dhcpd-pools.c
index d7f57f0..e3b775a 100644
--- a/src/dhcpd-pools.c
+++ b/src/dhcpd-pools.c
@@ -129,6 +129,7 @@ int main(int argc, char **argv)
{"warn-count", required_argument, NULL, OPT_WARN_COUNT},
{"crit-count", required_argument, NULL, OPT_CRIT_COUNT},
{"minsize", required_argument, NULL, OPT_MINSIZE},
+ {"perfdata", no_argument, NULL, 'p'},
{NULL, 0, NULL, 0}
};
@@ -148,6 +149,7 @@ int main(int argc, char **argv)
config.critical = ALARM_CRIT;
config.warn_count = 0x100000000; /* == 2^32 that is the entire IPv4 space */
config.crit_count = 0x100000000; /* basically turns off the count criteria */
+ config.perfdata = false;
/* File location defaults */
strncpy(config.dhcpdconf_file, DHCPDCONF_FILE, MAXLEN - 1);
strncpy(config.dhcpdlease_file, DHCPDLEASE_FILE, MAXLEN - 1);
@@ -165,7 +167,7 @@ int main(int argc, char **argv)
while (1) {
int c;
- c = getopt_long(argc, argv, "c:l:f:o:s:rL:vh", long_options, &option_index);
+ c = getopt_long(argc, argv, "c:l:f:o:s:rL:pvh", long_options, &option_index);
if (c == EOF)
break;
switch (c) {
@@ -235,6 +237,10 @@ int main(int argc, char **argv)
case OPT_MINSIZE:
config.minsize = strtod_or_err(optarg, "illegal argument");
break;
+ case 'p':
+ /* Print additional performance data in alarming mode */
+ config.perfdata = true;
+ break;
case 'v':
/* Print version */
print_version();
diff --git a/src/dhcpd-pools.h b/src/dhcpd-pools.h
index c20b72f..4415d62 100644
--- a/src/dhcpd-pools.h
+++ b/src/dhcpd-pools.h
@@ -210,6 +210,7 @@ struct configuration_t {
backups_found:1,
snet_alarms:1,
print_mac_addreses:1,
+ perfdata:1,
header_limit:3,
number_limit:3;
};
diff --git a/src/other.c b/src/other.c
index cd2cb3a..5e54367 100644
--- a/src/other.c
+++ b/src/other.c
@@ -474,6 +474,7 @@ void __attribute__ ((__noreturn__)) usage(int status)
fputs( " --crit-count=NR a number of free leases before critical raised\n", out);
fputs( " --minsize=size disable alarms for small ranges and shared-nets\n", out);
fputs( " --snet-alarms suppress range alarms that are part of a shared-net\n", out);
+ fputs( " -p --perfdata print additional perfdata in alarming mode\n", out);
fputs( " -v, --version output version information and exit\n", out);
fputs( " -h, --help display this help and exit\n", out);
fputs( "\n", out);
diff --git a/src/output.c b/src/output.c
index e220243..35af873 100644
--- a/src/output.c
+++ b/src/output.c
@@ -1014,6 +1014,29 @@ int output_alarming(void)
if (ri != 0) {
fprintf(outfile, " range_ignored=%d", ri);
}
+ if (config.perfdata == 1 && config.number_limit & R_BIT) {
+ for (i = 0; i < num_ranges; i++) {
+ range_p--;
+ range_size = get_range_size(range_p);
+ if (config.minsize < range_size) {
+ fprintf(outfile, " %s_r=",
+ ntop_ipaddr(&range_p->first_ip));
+ fprintf(outfile, "%g;%g;%g;0;%g",
+ range_p->count,
+ (range_size * config.warning / 100),
+ (range_size * config.critical / 100),
+ range_size);
+ fprintf(outfile, " %s_rt=%g",
+ ntop_ipaddr(&range_p->first_ip),
+ range_p->touched);
+ if (config.backups_found == 1) {
+ fprintf(outfile, " %s_rbu=%g",
+ ntop_ipaddr(&range_p->first_ip),
+ range_p->backups);
+ }
+ }
+ }
+ }
fprintf(outfile, "\n");
} else {
fprintf(outfile, " ");
@@ -1025,7 +1048,29 @@ int output_alarming(void)
}
fprintf(outfile, "; | snet_crit=%d snet_warn=%d snet_ok=%d", sc, sw, so);
if (si != 0) {
- fprintf(outfile, " snet_ignored=%d\n", si);
+ fprintf(outfile, " snet_ignored=%d", si);
+ }
+ if (config.perfdata == 1 && config.header_limit & R_BIT) {
+ for (i = 0; i < num_shared_networks; i++) {
+ if (config.minsize < shared_p->available) {
+ fprintf(outfile, " '%s_s'=%g;%g;%g;0;%g",
+ shared_p->name,
+ shared_p->used,
+ (shared_p->available * config.warning / 100),
+ (shared_p->available * config.critical / 100),
+ shared_p->available);
+ fprintf(outfile, " '%s_st'=%g",
+ shared_p->name,
+ shared_p->touched);
+ if (config.backups_found == 1) {
+ fprintf(outfile, " '%s_sbu'=%g",
+ shared_p->name,
+ shared_p->backups);
+ }
+ }
+ shared_p--;
+ }
+ fprintf(outfile, "\n");
}
}
fprintf(outfile, "\n");
diff --git a/tests/Makemodule.am b/tests/Makemodule.am
index 12d6907..46bac47 100644
--- a/tests/Makemodule.am
+++ b/tests/Makemodule.am
@@ -13,6 +13,7 @@ TESTS = \
tests/big-small \
tests/bootp \
tests/complete \
+ tests/complete-perfdata \
tests/empty \
tests/full-json \
tests/full-xml \
@@ -22,7 +23,8 @@ TESTS = \
tests/same-twice \
tests/simple \
tests/sorts \
- tests/v6
+ tests/v6 \
+ tests/v6-perfdata
EXTRA_DIST += \
tests/confs \
diff --git a/tests/complete-perfdata b/tests/complete-perfdata
new file mode 100755
index 0000000..2765fd4
--- /dev/null
+++ b/tests/complete-perfdata
@@ -0,0 +1,16 @@
+#!/bin/sh
+#
+# Minimal regression test suite.
+
+IAM=$(basename $0)
+TESTDATA=${IAM%-*}
+
+if [ ! -d tests/outputs ]; then
+ mkdir tests/outputs
+fi
+
+dhcpd-pools -c $top_srcdir/tests/confs/$TESTDATA \
+ -l $top_srcdir/tests/leases/$TESTDATA -o tests/outputs/$IAM \
+ --warning 80 --perfdata
+diff -u $top_srcdir/tests/expected/$IAM tests/outputs/$IAM
+exit $?
diff --git a/tests/expected/alarm-count-option b/tests/expected/alarm-count-option
index 5b00b83..a535df7 100644
--- a/tests/expected/alarm-count-option
+++ b/tests/expected/alarm-count-option
@@ -9,7 +9,6 @@ Shared nets - crit: 1 warn: 0 ok: 1; | snet_crit=1 snet_warn=0 snet_ok=1
== minsize ==
OK: Ranges - crit: 0 warn: 0 ok: 0 ignored: 5; | range_crit=0 range_warn=0 range_ok=0 range_ignored=5
Shared nets - crit: 0 warn: 0 ok: 0 ignored: 2; | snet_crit=0 snet_warn=0 snet_ok=0 snet_ignored=2
-
0
== snet alarms ==
WARNING: dhcpd-pools: Ranges - crit: 0 warn: 0 ok: 0; | range_crit=0 range_warn=0 range_ok=0
diff --git a/tests/expected/complete-perfdata b/tests/expected/complete-perfdata
new file mode 100644
index 0000000..d9219e9
--- /dev/null
+++ b/tests/expected/complete-perfdata
@@ -0,0 +1,3 @@
+OK: Ranges - crit: 0 warn: 0 ok: 5; | range_crit=0 range_warn=0 range_ok=5 10.4.0.1_r=5;16;18;0;20 10.4.0.1_rt=0 10.3.0.1_r=9;16;18;0;20 10.3.0.1_rt=0 10.2.0.1_r=8;16;18;0;20 10.2.0.1_rt=0 10.1.0.1_r=10;16;18;0;20 10.1.0.1_rt=0 10.0.0.1_r=11;16;18;0;20 10.0.0.1_rt=0
+Shared nets - crit: 0 warn: 0 ok: 2; | snet_crit=0 snet_warn=0 snet_ok=2 'example2_s'=17;32;36;0;40 'example2_st'=0 'example1_s'=21;32;36;0;40 'example1_st'=0
+
diff --git a/tests/expected/v6-perfdata b/tests/expected/v6-perfdata
new file mode 100644
index 0000000..50ea786
--- /dev/null
+++ b/tests/expected/v6-perfdata
@@ -0,0 +1,3 @@
+OK: Ranges - crit: 0 warn: 0 ok: 2; | range_crit=0 range_warn=0 range_ok=2 dead:abba:4000::2_r=1;203.2;228.6;0;254 dead:abba:4000::2_rt=0 dead:abba:1000::2_r=2;3.77789e+21;4.25013e+21;0;4.72237e+21 dead:abba:1000::2_rt=1
+Shared nets - crit: 0 warn: 0 ok: 0; | snet_crit=0 snet_warn=0 snet_ok=0
+
diff --git a/tests/v6-perfdata b/tests/v6-perfdata
new file mode 100755
index 0000000..2765fd4
--- /dev/null
+++ b/tests/v6-perfdata
@@ -0,0 +1,16 @@
+#!/bin/sh
+#
+# Minimal regression test suite.
+
+IAM=$(basename $0)
+TESTDATA=${IAM%-*}
+
+if [ ! -d tests/outputs ]; then
+ mkdir tests/outputs
+fi
+
+dhcpd-pools -c $top_srcdir/tests/confs/$TESTDATA \
+ -l $top_srcdir/tests/leases/$TESTDATA -o tests/outputs/$IAM \
+ --warning 80 --perfdata
+diff -u $top_srcdir/tests/expected/$IAM tests/outputs/$IAM
+exit $?
From e5f9a7751176b7bf080d165e8fd874515175e9b4 Mon Sep 17 00:00:00 2001
From: Sami Kerola
Date: Fri, 1 Apr 2016 22:34:11 +0100
Subject: [PATCH 010/158] contrib: add archlinux package build file
Signed-off-by: Sami Kerola
---
contrib/PKGBUILD | 36 ++++++++++++++++++++++++++++++++++++
1 file changed, 36 insertions(+)
create mode 100644 contrib/PKGBUILD
diff --git a/contrib/PKGBUILD b/contrib/PKGBUILD
new file mode 100644
index 0000000..6fbb5cf
--- /dev/null
+++ b/contrib/PKGBUILD
@@ -0,0 +1,36 @@
+# Archlinux package file. Just download this file, and
+# makepkg PKGBUILD
+# pacman -U ./dhcpd-pools*.pkg.tar.xz
+
+pkgname=dhcpd-pools
+pkgver=0
+pkgrel=1
+pkgdesc="ISC dhcpd lease status utility"
+arch=('i686' 'x86_64')
+url=http://dhcpd-pools.sourceforge.net/
+license=('BSD')
+depends=('pacman')
+makedepends=('uthash' 'git')
+source=("$pkgname"::'git://git.code.sf.net/p/dhcpd-pools/code')
+md5sums=('SKIP')
+
+pkgver() {
+ cd "$srcdir/$pkgname"
+ # Use the tag of the last commit
+ git describe --long | sed -E 's/([^-]*-g)/r\1/;s/-/./g'
+}
+
+build() {
+ cd "$srcdir/$pkgname"
+ ./bootstrap
+ ./configure \
+ --prefix=/usr \
+ --bindir=/usr/bin
+ make
+}
+
+package() {
+ cd "$srcdir/$pkgname"
+ make PREFIX=/ DESTDIR="$pkgdir" install
+ install -D -m644 COPYING "${pkgdir}/usr/share/licenses/${pkgname}/COPYING"
+}
From 5a33b619d15ffdf87b10bdb35280450d2c907dfe Mon Sep 17 00:00:00 2001
From: Sami Kerola
Date: Fri, 1 Apr 2016 22:51:51 +0100
Subject: [PATCH 011/158] contrib: remove unnecessary cgi script
The html format is done using Bootstrap and DataTables. That deprecatated
need for having cgi to wrap dhcpd-pools.
Reference: 1299737d76dfabc17bb79d8eb2475b1a3784b9c7
Signed-off-by: Sami Kerola
---
contrib/.gitignore | 1 -
contrib/Makemodule.am | 4 ++--
contrib/dhcpd-pools.cgi.in | 34 ----------------------------------
3 files changed, 2 insertions(+), 37 deletions(-)
delete mode 100755 contrib/dhcpd-pools.cgi.in
diff --git a/contrib/.gitignore b/contrib/.gitignore
index 591c7bd..f28c483 100644
--- a/contrib/.gitignore
+++ b/contrib/.gitignore
@@ -1,2 +1 @@
-/dhcpd-pools.cgi
/nagios.conf
diff --git a/contrib/Makemodule.am b/contrib/Makemodule.am
index a6bbc1e..289c7f9 100644
--- a/contrib/Makemodule.am
+++ b/contrib/Makemodule.am
@@ -1,5 +1,5 @@
contribdir = $(datadir)/dhcpd-pools/
-PATHFILES += contrib/dhcpd-pools.cgi contrib/nagios.conf
-dist_contrib_SCRIPTS = contrib/dhcpd-pools.cgi contrib/snmptest.pl
+PATHFILES += contrib/nagios.conf
+dist_contrib_SCRIPTS = contrib/snmptest.pl
dist_contrib_DATA = contrib/nagios.conf
EXTRA_DIST += contrib/munin_plugins
diff --git a/contrib/dhcpd-pools.cgi.in b/contrib/dhcpd-pools.cgi.in
deleted file mode 100755
index 117a7cf..0000000
--- a/contrib/dhcpd-pools.cgi.in
+++ /dev/null
@@ -1,34 +0,0 @@
-#!@SHELL@
-#
-# Simple CGI for dhcpd-pools.
-
-echo Content-type: text/html
-echo
-
-# To make lease table more fancy use CSS definition something
-# like this in your style.css file.
-#
-# TABLE.dhcpd-pools {
-# border-style : groove;
-# margin-left : 2px;
-# foo : bar;
-# }
-#
-# http://www.w3.org/TR/REC-CSS2/tables.html
-#
-# And uncomment this line.
-#
-#echo
-
-echo ""
-echo ""
-echo "
This was situation at "
-date
-echo "
"
-
-@bindir@/dhcpd-pools --format html
-
-echo ""
-echo ""
-
-# EOF
From 8a8c28a17e0e528d346e39d44c6ce9b9304390c1 Mon Sep 17 00:00:00 2001
From: Sami Kerola
Date: Fri, 1 Apr 2016 23:08:09 +0100
Subject: [PATCH 012/158] contrib: remove awk file duplicate
Signed-off-by: Sami Kerola
---
contrib/dhcpd-pools.awk | 168 ---------------------------------------
webpages/dhcpd-pools.awk | 4 +
2 files changed, 4 insertions(+), 168 deletions(-)
delete mode 100644 contrib/dhcpd-pools.awk
diff --git a/contrib/dhcpd-pools.awk b/contrib/dhcpd-pools.awk
deleted file mode 100644
index 38d5f18..0000000
--- a/contrib/dhcpd-pools.awk
+++ /dev/null
@@ -1,168 +0,0 @@
-# This is ISC dhcpd pool statistics script.
-#
-# The script is first version which was used to test that
-# analysis algorithm is sane. This script is no longer
-# maintained, and can be considered as historic reference.
-#
-# Licensed under the Open Software License version 1.1
-# http://opensource.org/licenses/osl.php
-#
-# Sami Kerola
-#
-# Latest version is available from http://www.iki.fi/kerolasa/dhcp/
-# This is version 1.4
-
-BEGIN {
- # Do you want to see statistics per pool? 1 = yes, 0 = no.
- PrintRanges = 1
-
- leasefile="/opt/dhcp/db/dhcpd.leases"
- #conffile="/opt/dhcp/etc/dhcpd.conf"
-
- # External commands.
- uniq = "sort -nu > afterlp"
- sort = "sort -nu -k 2 > aftercp"
- uniqstdout = "sort -u"
-
- # Do the trick.
- main()
-}
-
-# Convert ip to decimal number.
-function ip2num(addr) {
- split(addr, z, ".");
- numb = z[4]+256*(z[3]+256*(z[2]+256*z[1]))
- return numb
-}
-
-# Print decimal ip in dotted format.
-function printip(number) {
- a = int(number/16777216)
- number = (number-(a*16777216))
- b = int(number/65536)
- number = int((number-(b*65536)))
- c = int(number/256)
- number = (number-(c*256))
- ipstring = sprintf("%d.%d.%d.%d", a, b, c, number)
- printf "%16s", ipstring
-}
-
-# Parse dhcpd lease file.
-function parseleases() {
- if (system("test -r " leasefile) != 0) {
- print "File " leasefile " is not readable, exiting."
- exit 1
- }
- while (getline < leasefile) {
- if ($0 ~ /^lease/) {
- A = ip2num($2)
- }
- if ($0 ~ /^[ ]*binding state active/) {
- printf "%d\n", A | uniq
- }
- }
- close(leasefile)
- close(uniq)
-}
-
-# Parse dhcpd configuration file.
-function parseconf() {
- while (getline) {
- if ($0 ~ /^[ ]*shared-network/) {
- sharnet = $2
- }
- if ($0 ~ /^[ ]*range/) {
- printf "%s %d %d\n", sharnet, ip2num($2), ip2num($3) | sort
- }
- }
- close(sort)
-}
-
-# Join preparsed tmp files and output pool status.
-function join() {
- # Get shared networks and pool ranges.
- i = 1
- while (getline < "aftercp") {
- split($0, j, " ")
- cnf[i,1] = j[1]
- cnf[i,2] = j[2]
- if (j[3] == 0) {
- j[3] = j[2]
- }
- cnf[i,3] = j[3]
- shnet[j[1],1] += j[3]-j[2]+1
- shnet[j[1],2] = 0
- allofall[1] += j[3]-j[2]+1
- i++
- }
- close("aftercp")
- i = 1
- allofall[2] = k = 0
- thisnet = ""
- # Count IPs in pools.
- if (PrintRanges) {
- # Print header.
- print "shared-network 1st in pool last in pool max cur usage%"
- }
- k = 0;
- while (getline < "afterlp") {
- ip = $0
- allofall[2]++
- # Ip out of the range, pool is changing.
- while (ip > cnf[i,3]) {
- if (PrintRanges) {
- printf "%-20s ", cnf[i,1]
- printip(cnf[i,2])
- printip(cnf[i,3])
- printf " %5d %5d %9.2f\n", cnf[i,3]-cnf[i,2]+1, k, k/(cnf[i,3]-cnf[i,2]+1)
- k = 0;
- }
- if (cnf[i,1] != thisnet) {
- # Shared network changed.
- thisnet = cnf[i,1]
- }
- i++
- }
- if (ip > cnf[i,2] && ip < cnf[i,3]) {
- # Add ip.
- shnet[cnf[i,1],2]++
- }
- k++;
- }
-
- # Print pool statistics.
-
-
- if (PrintRanges) {
- printf "%-20s ", cnf[i,1]
- printip(cnf[i,2])
- printip(cnf[i,3])
- printf " %5d %5d %9.2f\n", cnf[i,3]-cnf[i,2]+1, k, k/(cnf[i,3]-cnf[i,2]+1)
- }
- close("afterlp")
- # Print header and shared network statistics.
- print "#shared-network max cur usage%"
- for (items in shnet) {
- x = substr(items, 1, length(items)-2)
- printf "%-20s %8d %8d %8.4f\n", x, shnet[x,1], shnet[x,2], shnet[x,2]/shnet[x,1] | uniqstdout
- }
- close(uniqstdout)
- print "#--------------"
- printf "%-20s %8d %8d %8.4f\n", "all_pools", allofall[1], allofall[2], allofall[2]/allofall[1]
-}
-
-# Remove temporary files.
-function cleanup() {
- system("rm -f aftercp afterlp")
-}
-
-# Main.
-function main() {
- system("touch afterlp aftercp")
- parseleases()
- parseconf()
- join()
- cleanup()
-}
-
-# EOF
diff --git a/webpages/dhcpd-pools.awk b/webpages/dhcpd-pools.awk
index ed2e35b..38d5f18 100644
--- a/webpages/dhcpd-pools.awk
+++ b/webpages/dhcpd-pools.awk
@@ -1,5 +1,9 @@
# This is ISC dhcpd pool statistics script.
#
+# The script is first version which was used to test that
+# analysis algorithm is sane. This script is no longer
+# maintained, and can be considered as historic reference.
+#
# Licensed under the Open Software License version 1.1
# http://opensource.org/licenses/osl.php
#
From 87c06a1b134c2ac75bd0411ef09d400950fbc941 Mon Sep 17 00:00:00 2001
From: Sami Kerola
Date: Sat, 23 Apr 2016 16:32:08 +0100
Subject: [PATCH 013/158] getdata: get rid of remaining stdbool usage
Signed-off-by: Sami Kerola
---
src/dhcpd-pools.c | 18 +++++++-------
src/getdata.c | 61 +++++++++++++++++++++++------------------------
2 files changed, 39 insertions(+), 40 deletions(-)
diff --git a/src/dhcpd-pools.c b/src/dhcpd-pools.c
index e3b775a..83b1223 100644
--- a/src/dhcpd-pools.c
+++ b/src/dhcpd-pools.c
@@ -144,12 +144,12 @@ int main(int argc, char **argv)
* command line option */
config.output_file[0] = '\0';
/* Alarming defaults. */
- config.snet_alarms = false;
+ config.snet_alarms = 0;
config.warning = ALARM_WARN;
config.critical = ALARM_CRIT;
config.warn_count = 0x100000000; /* == 2^32 that is the entire IPv4 space */
config.crit_count = 0x100000000; /* basically turns off the count criteria */
- config.perfdata = false;
+ config.perfdata = 0;
/* File location defaults */
strncpy(config.dhcpdconf_file, DHCPDCONF_FILE, MAXLEN - 1);
strncpy(config.dhcpdlease_file, DHCPDLEASE_FILE, MAXLEN - 1);
@@ -160,8 +160,8 @@ int main(int argc, char **argv)
/* Make sure some output format is selected by default */
print_mac_addreses_tmp = OUTPUT_FORMAT;
/* Default sort order is by IPs small to big */
- config.reverse_order = false;
- config.backups_found = false;
+ config.reverse_order = 0;
+ config.backups_found = 0;
prepare_memory();
/* Parse command line options */
while (1) {
@@ -204,7 +204,7 @@ int main(int argc, char **argv)
break;
case 'r':
/* What ever sort in reverse order */
- config.reverse_order = true;
+ config.reverse_order = 1;
break;
case 'o':
/* Output file */
@@ -216,7 +216,7 @@ int main(int argc, char **argv)
config.number_limit = return_limit(optarg[1]);
break;
case OPT_SNET_ALARMS:
- config.snet_alarms = true;
+ config.snet_alarms = 1;
break;
case OPT_WARN:
print_mac_addreses_tmp = "a";
@@ -239,7 +239,7 @@ int main(int argc, char **argv)
break;
case 'p':
/* Print additional performance data in alarming mode */
- config.perfdata = true;
+ config.perfdata = 1;
break;
case 'v':
/* Print version */
@@ -295,14 +295,14 @@ int main(int argc, char **argv)
}
/* Do the job */
set_ipv_functions(IPvUNKNOWN);
- parse_config(true, config.dhcpdconf_file, shared_networks);
+ parse_config(1, config.dhcpdconf_file, shared_networks);
parse_leases();
prepare_data();
do_counting();
tmp_ranges = xmalloc(sizeof(struct range_t) * num_ranges);
if (config.sorts != NULL)
mergesort_ranges(ranges, num_ranges, tmp_ranges);
- if (config.reverse_order == true)
+ if (config.reverse_order == 1)
flip_ranges(ranges, tmp_ranges);
free(tmp_ranges);
ret_val = output_analysis();
diff --git a/src/getdata.c b/src/getdata.c
index 3e3be1f..d72b9cc 100644
--- a/src/getdata.c
+++ b/src/getdata.c
@@ -44,7 +44,6 @@
#include
#include
#include
-#include
#include
#include
#include
@@ -65,7 +64,7 @@ int parse_leases(void)
char *line, *ipstring, macstring[20], *stop;
union ipaddr_t addr;
struct stat lease_file_stats;
- bool ethernets = false;
+ int ethernets = 0; /* boolean */
struct leases_t *lease;
dhcpd_leases = fopen(config.dhcpdlease_file, "r");
@@ -92,7 +91,7 @@ int parse_leases(void)
ipstring = xmalloc(sizeof(char) * MAXLEN);
ipstring[0] = '\0';
if (config.print_mac_addreses == 1)
- ethernets = true;
+ ethernets = 1;
while (!feof(dhcpd_leases)) {
if (!fgets(line, MAXLEN, dhcpd_leases) && ferror(dhcpd_leases))
error(EXIT_FAILURE, errno, "parse_leases: %s", config.dhcpdlease_file);
@@ -128,10 +127,10 @@ int parse_leases(void)
if ((lease = find_lease(&addr)) != NULL)
delete_lease(lease);
add_lease(&addr, BACKUP);
- config.backups_found = true;
+ config.backups_found = 1;
break;
case PREFIX_HARDWARE_ETHERNET:
- if (ethernets == false)
+ if (ethernets == 0)
break;
memcpy(macstring, line + 20, 17);
macstring[17] = '\0';
@@ -184,7 +183,7 @@ void parse_config(int is_include, const char *restrict config_file,
struct shared_network_t *restrict shared_p)
{
FILE *dhcpd_config;
- bool newclause = true, comment = false, one_ip_range = false;
+ int newclause = 1, comment = 0, one_ip_range = 0; /* booleans */
int quote = 0, braces = 0, argument = ITS_NOTHING_INTERESTING;
size_t i = 0;
char *word;
@@ -220,10 +219,10 @@ void parse_config(int is_include, const char *restrict config_file,
/* Handle comments if they are not quoted */
case '#':
if (quote == 0)
- comment = true;
+ comment = 1;
continue;
case '"':
- if (comment == false) {
+ if (comment == 0) {
quote++;
/* Either one or zero */
quote = quote % 2;
@@ -233,18 +232,18 @@ void parse_config(int is_include, const char *restrict config_file,
/* New line resets comment section, but
* not if quoted */
if (quote == 0)
- comment = false;
+ comment = 0;
break;
case ';':
/* Quoted colon does not mean new clause */
if (0 < quote)
break;
- if (comment == false
+ if (comment == 0
&& argument != ITS_A_RANGE_FIRST_IP
&& argument != ITS_A_RANGE_SECOND_IP && argument != ITS_AN_INCLUCE) {
- newclause = true;
+ newclause = 1;
i = 0;
- } else if (argument == ITS_A_RANGE_FIRST_IP && one_ip_range == true) {
+ } else if (argument == ITS_A_RANGE_FIRST_IP && one_ip_range == 1) {
argument = ITS_A_RANGE_SECOND_IP;
c = ' ';
} else if (argument == ITS_A_RANGE_SECOND_IP && 0 < i) {
@@ -274,14 +273,14 @@ void parse_config(int is_include, const char *restrict config_file,
*
* shared-network DSL{ ... */
if (i == 0) {
- newclause = true;
+ newclause = 1;
continue;
} else
break;
case '}':
if (0 < quote)
break;
- if (comment == false) {
+ if (comment == 0) {
braces--;
/* End of shared-network */
if (braces_shared == braces) {
@@ -290,23 +289,23 @@ void parse_config(int is_include, const char *restrict config_file,
braces_shared = 1000;
shared_p = shared_networks;
}
- /* Not literally true, but works for this
+ /* Not literally 1, but works for this
* program */
- newclause = true;
+ newclause = 1;
}
continue;
default:
break;
}
/* Either inside comment or Nth word of clause. */
- if (comment == true || (newclause == false && argument == ITS_NOTHING_INTERESTING))
+ if (comment == 1 || (newclause == 0 && argument == ITS_NOTHING_INTERESTING))
continue;
/* Strip white spaces before new clause word. */
- if ((newclause == true || argument != ITS_NOTHING_INTERESTING)
- && isspace(c) && i == 0 && one_ip_range == false)
+ if ((newclause == 1 || argument != ITS_NOTHING_INTERESTING)
+ && isspace(c) && i == 0 && one_ip_range == 0)
continue;
/* Save to word which clause this is. */
- if ((newclause == true || argument != ITS_NOTHING_INTERESTING)
+ if ((newclause == 1 || argument != ITS_NOTHING_INTERESTING)
&& (!isspace(c) || 0 < quote)) {
word[i] = c;
i++;
@@ -314,26 +313,26 @@ void parse_config(int is_include, const char *restrict config_file,
* of words are this long which the program is
* searching. */
if (MAXLEN == i) {
- newclause = false;
+ newclause = 0;
i = 0;
continue;
}
}
/* See if clause is something that parser is looking for. */
- else if (newclause == true) {
+ else if (newclause == 1) {
/* Insert string end & set state */
word[i] = '\0';
if (word[i - 1] != '{')
- newclause = false;
+ newclause = 0;
i = 0;
argument = is_interesting_config_clause(word);
if (argument == ITS_A_RANGE_FIRST_IP)
- one_ip_range = true;
+ one_ip_range = 1;
}
/* words after range, shared-network or include */
else if (argument != ITS_NOTHING_INTERESTING) {
word[i] = '\0';
- newclause = false;
+ newclause = 0;
i = 0;
switch (argument) {
@@ -342,8 +341,8 @@ void parse_config(int is_include, const char *restrict config_file,
range_p = ranges + num_ranges;
argument = ITS_NOTHING_INTERESTING;
parse_ipaddr(word, &addr);
- if (one_ip_range == true) {
- one_ip_range = false;
+ if (one_ip_range == 1) {
+ one_ip_range = 0;
copy_ipaddr(&range_p->first_ip, &addr);
}
copy_ipaddr(&range_p->last_ip, &addr);
@@ -359,7 +358,7 @@ void parse_config(int is_include, const char *restrict config_file,
ranges = xrealloc(ranges, sizeof(struct range_t) * RANGES);
range_p = ranges + num_ranges;
}
- newclause = true;
+ newclause = 1;
break;
case ITS_A_RANGE_FIRST_IP:
/* printf ("range 1nd ip: %s\n", word); */
@@ -368,7 +367,7 @@ void parse_config(int is_include, const char *restrict config_file,
/* word was not ip, try again */
break;
copy_ipaddr(&range_p->first_ip, &addr);
- one_ip_range = false;
+ one_ip_range = 0;
argument = ITS_A_RANGE_SECOND_IP;
break;
case ITS_A_SHAREDNET:
@@ -390,8 +389,8 @@ void parse_config(int is_include, const char *restrict config_file,
case ITS_AN_INCLUCE:
/* printf ("include file: %s\n", word); */
argument = ITS_NOTHING_INTERESTING;
- parse_config(false, word, shared_p);
- newclause = true;
+ parse_config(0, word, shared_p);
+ newclause = 1;
break;
case ITS_NOTHING_INTERESTING:
/* printf ("nothing interesting: %s\n", word); */
From c4ebafb106f426b5214e6de5aa2a29e757150057 Mon Sep 17 00:00:00 2001
From: Sami Kerola
Date: Sat, 23 Apr 2016 16:35:38 +0100
Subject: [PATCH 014/158] argument parsing: fix compiler warning
src/dhcpd-pools.c:193:18: warning: comparison of integers of different
signs: 'int' and 'unsigned long' [-Wsign-compare]
Signed-off-by: Sami Kerola
---
src/dhcpd-pools.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/dhcpd-pools.c b/src/dhcpd-pools.c
index 83b1223..29ad041 100644
--- a/src/dhcpd-pools.c
+++ b/src/dhcpd-pools.c
@@ -98,7 +98,6 @@ static int return_limit(const char c)
* alarming. */
int main(int argc, char **argv)
{
- int i;
int option_index = 0;
char const *tmp;
char *print_mac_addreses_tmp;
@@ -187,10 +186,11 @@ int main(int argc, char **argv)
{
/* Output sorting option */
struct output_sort *p = config.sorts;
+ size_t len;
while (p && p->next)
p = p->next;
- for (i = 0; i < strlen(optarg); i++) {
+ for (len = 0; len < strlen(optarg); len++) {
if (config.sorts == NULL) {
config.sorts = xcalloc(1, sizeof(struct output_sort));
p = config.sorts;
@@ -198,7 +198,7 @@ int main(int argc, char **argv)
p->next = xcalloc(1, sizeof(struct output_sort));
p = p->next;
}
- p->func = field_selector(optarg[i]);
+ p->func = field_selector(optarg[len]);
}
}
break;
From ccd5370d9c0ec84767eafb61668880ad22826a48 Mon Sep 17 00:00:00 2001
From: Sami Kerola
Date: Sat, 23 Apr 2016 22:14:20 +0100
Subject: [PATCH 015/158] add dhcpd-pools Description Of A Project file
Reference: https://github.com/edumbill/doap/wiki
Signed-off-by: Sami Kerola
---
project.doap | 38 ++++++++++++++++++++++++++++++++++++++
1 file changed, 38 insertions(+)
create mode 100644 project.doap
diff --git a/project.doap b/project.doap
new file mode 100644
index 0000000..98fff0b
--- /dev/null
+++ b/project.doap
@@ -0,0 +1,38 @@
+
+
+
+ dhcpd-pools
+
+ This is dhcpd-pools ISC dhcp shared network and pool
+ range usage analysis tool.
+ Purpose of command is to count usage ratio of each
+ IP range and shared network pool which ISC dhcpd is in control
+ of. Program is written C. Design goal is to get analysis done
+ quickly where there is lots of data. On cheap laptop the speed
+ of analysis is more than 100k leases per second. Number of
+ ranges, or shared networks, does not make any significant
+ difference in getting analysis done.
+
+
+ C
+
+
+
+
+
+
+
+ BSD
+
+
+
+
+ Sami Kerola
+
+
+
+
+
From f6e256243de76e572d70d90762354fcfd2fd0b62 Mon Sep 17 00:00:00 2001
From: Sami Kerola
Date: Sat, 23 Apr 2016 22:55:21 +0100
Subject: [PATCH 016/158] fix doap file git repository and license section
Signed-off-by: Sami Kerola
---
project.doap | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/project.doap b/project.doap
index 98fff0b..e3cf0f6 100644
--- a/project.doap
+++ b/project.doap
@@ -20,13 +20,13 @@ xmlns:foaf="http://xmlns.com/foaf/0.1/">
C
-
+
-
- BSD
-
+
+ BSD 2-Clause license
+
From a3ef3d617fb6066efe69c6e75247b51be6f65427 Mon Sep 17 00:00:00 2001
From: Sami Kerola
Date: Sun, 24 Apr 2016 12:29:50 +0100
Subject: [PATCH 017/158] output: check alarming mode can output successfully
Fixes also a resource leak.
Signed-off-by: Sami Kerola
---
src/output.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/src/output.c b/src/output.c
index 35af873..450b7af 100644
--- a/src/output.c
+++ b/src/output.c
@@ -1002,8 +1002,12 @@ int output_alarming(void)
} else {
if (config.number_limit & A_BIT)
fprintf(outfile, "OK:");
- else
+ else {
+ if (close_stream(outfile)) {
+ error(EXIT_FAILURE, errno, "output_alarming: fclose");
+ }
return ret_val;
+ }
}
if (config.header_limit & R_BIT) {
fprintf(outfile, " Ranges - crit: %d warn: %d ok: %d", rc, rw, ro);
From 840d2143e664069227a5fb7fb964b37784fa4d1f Mon Sep 17 00:00:00 2001
From: Sami Kerola
Date: Sun, 29 May 2016 21:20:39 +0100
Subject: [PATCH 018/158] build-sys: update bootstrap from gnulib
Signed-off-by: Sami Kerola
---
bootstrap | 24 ++++++++++++++++++++----
1 file changed, 20 insertions(+), 4 deletions(-)
diff --git a/bootstrap b/bootstrap
index 60ff8cd..92dac46 100755
--- a/bootstrap
+++ b/bootstrap
@@ -1,10 +1,10 @@
#! /bin/sh
# Print a version string.
-scriptversion=2013-12-05.23; # UTC
+scriptversion=2016-01-24.06; # UTC
# Bootstrap this package from checked-out sources.
-# Copyright (C) 2003-2014 Free Software Foundation, Inc.
+# Copyright (C) 2003-2016 Free Software Foundation, Inc.
# 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
@@ -42,6 +42,9 @@ export LC_ALL
local_gl_dir=gl
+# Honor $PERL, but work even if there is none.
+PERL="${PERL-perl}"
+
me=$0
usage() {
@@ -457,6 +460,7 @@ check_versions() {
test "$appvar" = TAR && appvar=AMTAR
case $appvar in
GZIP) ;; # Do not use $GZIP: it contains gzip options.
+ PERL::*) ;; # Keep perl modules as-is
*) eval "app=\${$appvar-$app}" ;;
esac
@@ -474,6 +478,17 @@ check_versions() {
ret=1
continue
} ;;
+ # Another check is for perl modules. These can be written as
+ # e.g. perl::XML::XPath in case of XML::XPath module, etc.
+ perl::*)
+ # Extract module name
+ app="${app#perl::}"
+ if ! $PERL -m"$app" -e 'exit 0' >/dev/null 2>&1; then
+ warn_ "Error: perl module '$app' not found"
+ ret=1
+ fi
+ continue
+ ;;
esac
if [ "$req_ver" = "-" ]; then
# Merely require app to exist; not all prereq apps are well-behaved
@@ -901,7 +916,8 @@ if test $use_libtool = 1; then
esac
fi
echo "$0: $gnulib_tool $gnulib_tool_options --import ..."
-$gnulib_tool $gnulib_tool_options --import $gnulib_modules &&
+$gnulib_tool $gnulib_tool_options --import $gnulib_modules \
+ || die "gnulib-tool failed"
for file in $gnulib_files; do
symlink_to_dir "$GNULIB_SRCDIR" $file \
@@ -1006,6 +1022,6 @@ echo "$0: done. Now you can run './configure'."
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
-# time-stamp-time-zone: "UTC"
+# time-stamp-time-zone: "UTC0"
# time-stamp-end: "; # UTC"
# End:
From d26c858c1301dca1de3ea5b8d147c67b4704f4b1 Mon Sep 17 00:00:00 2001
From: Sami Kerola
Date: Sun, 29 May 2016 21:22:13 +0100
Subject: [PATCH 019/158] build-sys: update gnulib .gitignore file
Signed-off-by: Sami Kerola
---
lib/.gitignore | 2 ++
1 file changed, 2 insertions(+)
diff --git a/lib/.gitignore b/lib/.gitignore
index b0e5275..234d761 100644
--- a/lib/.gitignore
+++ b/lib/.gitignore
@@ -63,6 +63,8 @@
/getopt_int.h
/gettext.h
/gettimeofday.c
+/hard-locale.c
+/hard-locale.h
/inet_pton.c
/intprops.h
/isnan.c
From 1b35a16d95a94707c8dcb3bd8668b47ce3ef2616 Mon Sep 17 00:00:00 2001
From: Sami Kerola
Date: Sun, 3 Jul 2016 14:00:00 +0100
Subject: [PATCH 020/158] analyze: use while() when for() is less fit to
purpose
Signed-off-by: Sami Kerola
---
src/analyze.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/analyze.c b/src/analyze.c
index 072c07e..1d5c456 100644
--- a/src/analyze.c
+++ b/src/analyze.c
@@ -65,8 +65,8 @@ void do_counting(void)
/* Walk through ranges */
range_p = ranges;
for (i = 0; i < num_ranges; i++) {
- for (; l != NULL && ipcomp(&range_p->first_ip, &l->ip) < 0; l = l->hh.prev)
- /* rewind */ ;
+ while (l != NULL && ipcomp(&range_p->first_ip, &l->ip) < 0)
+ l = l->hh.prev; /* rewind */
if (l == NULL)
l = leases;
for (; l != NULL && ipcomp(&l->ip, &range_p->last_ip) <= 0; l = l->hh.next) {
From 9bb30b29cafc631862fd3ee60c3bdf0ced9b15e4 Mon Sep 17 00:00:00 2001
From: Sami Kerola
Date: Mon, 15 Aug 2016 21:18:29 +0100
Subject: [PATCH 021/158] build-sys: default to ./configure
--enable-silent-rules
This makes compiler to options not to be shown when running make, and that
allows noticing warnings more easily.
Signed-off-by: Sami Kerola
---
configure.ac | 3 +++
1 file changed, 3 insertions(+)
diff --git a/configure.ac b/configure.ac
index ec993c7..cbef03a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -24,6 +24,9 @@ AM_INIT_AUTOMAKE([
AC_CONFIG_SRCDIR([src/dhcpd-pools.h])
AC_CONFIG_HEADERS([config.h])
+m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])],
+ [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])])
+
# Checks for programs
AC_USE_SYSTEM_EXTENSIONS
AC_C_RESTRICT
From 77409277214a91f7ca5d2ecb501f1b2c1432fc99 Mon Sep 17 00:00:00 2001
From: Sami Kerola
Date: Tue, 16 Aug 2016 13:25:23 +0100
Subject: [PATCH 022/158] build-sys: always use restrict found by autoconf
Signed-off-by: Sami Kerola
---
src/dhcpd-pools.c | 2 +-
src/dhcpd-pools.h | 20 ++++++++++----------
2 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/src/dhcpd-pools.c b/src/dhcpd-pools.c
index 29ad041..f07386b 100644
--- a/src/dhcpd-pools.c
+++ b/src/dhcpd-pools.c
@@ -70,7 +70,7 @@ int (*parse_ipaddr) (const char *restrict src, union ipaddr_t *restrict dst);
void (*copy_ipaddr) (union ipaddr_t *restrict dst, const union ipaddr_t *restrict src);
const char *(*ntop_ipaddr) (const union ipaddr_t *ip);
double (*get_range_size) (const struct range_t *r);
-int (*xstrstr) (const char *__restrict str);
+int (*xstrstr) (const char *restrict str);
int (*ipcomp) (const union ipaddr_t *restrict a, const union ipaddr_t *restrict b);
int (*leasecomp) (const struct leases_t *restrict a, const struct leases_t *restrict b);
int (*output_analysis) (void);
diff --git a/src/dhcpd-pools.h b/src/dhcpd-pools.h
index 4415d62..1cdba5d 100644
--- a/src/dhcpd-pools.h
+++ b/src/dhcpd-pools.h
@@ -236,11 +236,11 @@ extern unsigned int RANGES;
extern void prepare_memory(void);
extern void set_ipv_functions(int version);
extern int parse_leases(void);
-extern void parse_config(int, const char *__restrict, struct shared_network_t *__restrict)
+extern void parse_config(int, const char *restrict, struct shared_network_t *restrict)
__attribute__ ((nonnull(2, 3)));
extern void prepare_data(void);
extern void do_counting(void);
-extern void flip_ranges(struct range_t *__restrict ranges, struct range_t *__restrict tmp_ranges)
+extern void flip_ranges(struct range_t *restrict ranges, struct range_t *restrict tmp_ranges)
__attribute__ ((nonnull(1, 2)));
/* support functions */
extern int (*parse_ipaddr) (const char *restrict src, union ipaddr_t *restrict dst);
@@ -265,14 +265,14 @@ extern double get_range_size_init(const struct range_t *r) _DP_ATTRIBUTE_CONST;
extern double get_range_size_v4(const struct range_t *r) _DP_ATTRIBUTE_PURE;
extern double get_range_size_v6(const struct range_t *r) _DP_ATTRIBUTE_PURE;
-extern int (*xstrstr) (const char *__restrict str);
-extern int xstrstr_init(const char *__restrict str) _DP_ATTRIBUTE_CONST;
-extern int xstrstr_v4(const char *__restrict str)
+extern int (*xstrstr) (const char *restrict str);
+extern int xstrstr_init(const char *restrict str) _DP_ATTRIBUTE_CONST;
+extern int xstrstr_v4(const char *restrict str)
_DP_ATTRIBUTE_HOT _DP_ATTRIBUTE_PURE;
-extern int xstrstr_v6(const char *__restrict str)
+extern int xstrstr_v6(const char *restrict str)
_DP_ATTRIBUTE_HOT _DP_ATTRIBUTE_PURE;
-extern double strtod_or_err(const char *__restrict str, const char *__restrict errmesg);
+extern double strtod_or_err(const char *restrict str, const char *restrict errmesg);
extern void print_version(void) __attribute__ ((noreturn));
extern void usage(int status) __attribute__ ((noreturn));
/* qsort required functions... */
@@ -300,15 +300,15 @@ extern int comp_percent(struct range_t *r1, struct range_t *r2);
extern int comp_tc(struct range_t *r1, struct range_t *r2) _DP_ATTRIBUTE_PURE;
extern int comp_tcperc(struct range_t *r1, struct range_t *r2);
extern int comp_touched(struct range_t *r1, struct range_t *r2) _DP_ATTRIBUTE_PURE;
-extern int rangecomp(const void *__restrict r1, const void *__restrict r2)
+extern int rangecomp(const void *restrict r1, const void *restrict r2)
__attribute__ ((nonnull(1, 2)));
/* sort function pointer and functions */
extern comparer_t field_selector(char c);
extern double ret_percent(struct range_t r);
extern double ret_tc(struct range_t r) _DP_ATTRIBUTE_CONST;
extern double ret_tcperc(struct range_t r);
-extern void mergesort_ranges(struct range_t *__restrict orig, int size,
- struct range_t *__restrict temp)
+extern void mergesort_ranges(struct range_t *restrict orig, int size,
+ struct range_t *restrict temp)
__attribute__ ((nonnull(1, 3)));
/* output function pointer and functions */
extern int (*output_analysis) (void);
From a6b77ab78594de1311ae59e6300b135bd2c696b4 Mon Sep 17 00:00:00 2001
From: Sami Kerola
Date: Sun, 2 Oct 2016 21:34:30 +0100
Subject: [PATCH 023/158] docs: fix couple typos and improve a sentence in
README
Signed-off-by: Sami Kerola
---
README | 2 +-
man/dhcpd-pools.1.in | 6 +++---
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/README b/README
index 1b347e2..6a9ae41 100644
--- a/README
+++ b/README
@@ -22,7 +22,7 @@ Quick start.
./configure --help
- Read the manual to see what options are available, and what they to.
+ Remember to read the friendly manual page.
man ./man/dhcpd-pools.1
diff --git a/man/dhcpd-pools.1.in b/man/dhcpd-pools.1.in
index 88794d8..8216ee4 100644
--- a/man/dhcpd-pools.1.in
+++ b/man/dhcpd-pools.1.in
@@ -168,7 +168,7 @@ and count
.I number
are required to be exceeded in order to alarm criteria being fulfilled.
.IP
-This option is intented to be used in setup where very large and small
+This option is intended to be used in setup where very large and small
shared-networks and ranges co-exists. In such environments percent based
alarming can lead to either flood of alarms about small ranges, or way too
great overhead of free addresses in large shared-networks. Suggested usage
@@ -189,7 +189,7 @@ configurations that has lots of small ranges in big shared-networks.
\fB\-\-minsize\fR=\fIsize\fR
Ignore ranges and shared networks that are smaller or equal to the
defined size. This option is meaningful only in context of alarming, and
-will intented to supress for example single host ranges. By default this
+will intended to suppress for example single host ranges. By default this
option is not in use.
.TP
\fB\-p\fR, \fB\-\-perfdata\fR
@@ -226,7 +226,7 @@ $ dhcpd-pools \-c dhcpd.conf \-l dhcpd.leases \-L 22 \-\-critical 70 \-\-warning
.br
[no-output]
.br
-Supress printing OK, and make alarm only to go off if shared networks
+Suppress printing OK, and make alarm only to go off if shared networks
exceed critial or warning levels.
.SH FILES
.TP
From aaad35a8c9e59247f72d67d3d930769a2a093627 Mon Sep 17 00:00:00 2001
From: Sami Kerola
Date: Mon, 2 Jan 2017 21:21:27 +0000
Subject: [PATCH 024/158] output: remove unnecessary increment
Signed-off-by: Sami Kerola
---
src/output.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/src/output.c b/src/output.c
index 450b7af..c3ad488 100644
--- a/src/output.c
+++ b/src/output.c
@@ -433,7 +433,6 @@ int output_json(void)
fprintf(outfile, " \"free\":%g\n",
shared_networks->available - shared_networks->used);
fprintf(outfile, " }"); /* end of summary */
- sep++;
}
fprintf(outfile, "\n}\n");
From 11c0b23d77c52286873797cec836812a74f7081f Mon Sep 17 00:00:00 2001
From: Sami Kerola
Date: Fri, 6 Jan 2017 22:19:29 +0000
Subject: [PATCH 025/158] portability: add gnulib modules earlier missing
Found with help if autoscan. In same go update lib/.gitignore file.
Signed-off-by: Sami Kerola
---
bootstrap.conf | 3 +++
lib/.gitignore | 35 +++++++++++++++++++++--------------
2 files changed, 24 insertions(+), 14 deletions(-)
diff --git a/bootstrap.conf b/bootstrap.conf
index a3ae473..9cddfe4 100644
--- a/bootstrap.conf
+++ b/bootstrap.conf
@@ -31,6 +31,7 @@ gnulib_modules="
isnan
langinfo
netinet_in
+ nl_langinfo
progname
quote
realloc-gnu
@@ -42,6 +43,8 @@ gnulib_modules="
strdup-posix
strftime
strstr
+ strtod
+ time_r
xalloc
"
diff --git a/lib/.gitignore b/lib/.gitignore
index 234d761..01559e4 100644
--- a/lib/.gitignore
+++ b/lib/.gitignore
@@ -6,13 +6,12 @@
/Makefile
/Makefile.am
/Makefile.in
-/_Exit.c
/alloca.h
/alloca.in.h
/arg-nonnull.h
-/arpa/
+/arpa/inet.h
/arpa_inet.in.h
-/atexit.c
+/basename-lgpl.c
/c++defs.h
/c-ctype.c
/c-ctype.h
@@ -20,7 +19,6 @@
/c-strcasecmp.c
/c-strcaseeq.h
/c-strncasecmp.c
-/calloc.c
/charset.alias
/close-stream.c
/close-stream.h
@@ -29,6 +27,8 @@
/closeout.h
/config.charset
/configmake.h
+/dirname-lgpl.c
+/dirname.h
/dosname.h
/errno.in.h
/error.c
@@ -42,6 +42,7 @@
/fd-hook.h
/fdopen.c
/fflush.c
+/flexmember.h
/float+.h
/float.c
/float.in.h
@@ -51,7 +52,6 @@
/fpurge.c
/freading.c
/freading.h
-/free.c
/fseek.c
/fseeko.c
/fstat.c
@@ -61,6 +61,8 @@
/getopt.in.h
/getopt1.c
/getopt_int.h
+/getprogname.c
+/getprogname.h
/gettext.h
/gettimeofday.c
/hard-locale.c
@@ -75,8 +77,13 @@
/langinfo.h
/langinfo.in.h
/libdhcpd_pools.la
+/limits.h
+/limits.in.h
/localcharset.c
/localcharset.h
+/locale.h
+/locale.in.h
+/localeconv.c
/lseek.c
/malloc.c
/malloca.c
@@ -89,7 +96,7 @@
/mbsinit.c
/memchr.c
/memchr.valgrind
-/memcpy.c
+/minmax.h
/mktime-internal.h
/mktime.c
/msvc-inval.c
@@ -97,6 +104,7 @@
/msvc-nothrow.c
/msvc-nothrow.h
/netinet_in.in.h
+/nl_langinfo.c
/pathmax.h
/progname.c
/progname.h
@@ -110,14 +118,12 @@
/ref-del.sin
/setenv.c
/stat.c
-/stdalign.h
/stdalign.in.h
-/stdarg.in.h
/stdbool.in.h
/stddef.in.h
+/stdint.h
/stdint.in.h
/stdio-impl.h
-/stdio.c
/stdio.h
/stdio.in.h
/stdlib.h
@@ -133,9 +139,14 @@
/strftime.h
/string.h
/string.in.h
+/stripslash.c
/strstr.c
/strtod.c
-/sys/
+/sys/socket.h
+/sys/stat.h
+/sys/time.h
+/sys/types.h
+/sys/uio.h
/sys_socket.c
/sys_socket.in.h
/sys_stat.in.h
@@ -164,7 +175,3 @@
/xalloc-oversized.h
/xalloc.h
/xmalloc.c
-/xprintf.c
-/xprintf.h
-/xstrtod.c
-/xstrtod.h
From ea7fd9187633782329021b1b4d31bc817ff6127f Mon Sep 17 00:00:00 2001
From: Sami Kerola
Date: Fri, 6 Jan 2017 23:12:34 +0000
Subject: [PATCH 026/158] remove const and pure function attributes
Most of these functions take pointers as input argument, so they cannot be
considered neiter const or pure. In same go fix few issues noticed when
compiling with smatch.
Signed-off-by: Sami Kerola
---
src/dhcpd-pools.h | 61 ++++++++++++++++++-----------------------------
src/getdata.c | 2 +-
2 files changed, 24 insertions(+), 39 deletions(-)
diff --git a/src/dhcpd-pools.h b/src/dhcpd-pools.h
index 1cdba5d..3765b26 100644
--- a/src/dhcpd-pools.h
+++ b/src/dhcpd-pools.h
@@ -63,21 +63,6 @@
# define unlikely(x) (x)
# endif
-/* The __attribute__ feature is available in gcc versions 2.5 and later.
- * The attribute __pure__ was added in gcc 2.96. */
-# if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96)
-# define _DP_ATTRIBUTE_PURE __attribute__ ((__pure__))
-# else
-# define _DP_ATTRIBUTE_PURE /* empty */
-# endif
-
-/* The __const__ attribute was added in gcc 2.95. */
-# if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95)
-# define _DP_ATTRIBUTE_CONST __attribute__ ((__const__))
-# else
-# define _DP_ATTRIBUTE_CONST /* empty */
-# endif
-
/* The attribute __hot__ was added in gcc 4.3. */
# if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)
# define _DP_ATTRIBUTE_HOT __attribute__ ((__hot__))
@@ -245,45 +230,45 @@ extern void flip_ranges(struct range_t *restrict ranges, struct range_t *restric
/* support functions */
extern int (*parse_ipaddr) (const char *restrict src, union ipaddr_t *restrict dst);
extern int parse_ipaddr_init(const char *restrict src,
- union ipaddr_t *restrict dst) _DP_ATTRIBUTE_CONST;
+ union ipaddr_t *restrict dst);
extern int parse_ipaddr_v4(const char *restrict src, union ipaddr_t *restrict dst);
extern int parse_ipaddr_v6(const char *restrict src, union ipaddr_t *restrict dst);
extern void (*copy_ipaddr) (union ipaddr_t *restrict dst, const union ipaddr_t *restrict src);
extern void copy_ipaddr_init(union ipaddr_t *restrict dst,
- const union ipaddr_t *restrict src) _DP_ATTRIBUTE_CONST;
+ const union ipaddr_t *restrict src);
extern void copy_ipaddr_v4(union ipaddr_t *restrict dst, const union ipaddr_t *restrict src);
extern void copy_ipaddr_v6(union ipaddr_t *restrict dst, const union ipaddr_t *restrict src);
extern const char *(*ntop_ipaddr) (const union ipaddr_t *ip);
-extern const char *ntop_ipaddr_init(const union ipaddr_t *ip) _DP_ATTRIBUTE_CONST;
+extern const char *ntop_ipaddr_init(const union ipaddr_t *ip);
extern const char *ntop_ipaddr_v4(const union ipaddr_t *ip);
extern const char *ntop_ipaddr_v6(const union ipaddr_t *ip);
extern double (*get_range_size) (const struct range_t *r);
-extern double get_range_size_init(const struct range_t *r) _DP_ATTRIBUTE_CONST;
-extern double get_range_size_v4(const struct range_t *r) _DP_ATTRIBUTE_PURE;
-extern double get_range_size_v6(const struct range_t *r) _DP_ATTRIBUTE_PURE;
+extern double get_range_size_init(const struct range_t *r);
+extern double get_range_size_v4(const struct range_t *r);
+extern double get_range_size_v6(const struct range_t *r);
extern int (*xstrstr) (const char *restrict str);
-extern int xstrstr_init(const char *restrict str) _DP_ATTRIBUTE_CONST;
+extern int xstrstr_init(const char *restrict str);
extern int xstrstr_v4(const char *restrict str)
-_DP_ATTRIBUTE_HOT _DP_ATTRIBUTE_PURE;
+_DP_ATTRIBUTE_HOT;
extern int xstrstr_v6(const char *restrict str)
-_DP_ATTRIBUTE_HOT _DP_ATTRIBUTE_PURE;
+_DP_ATTRIBUTE_HOT;
extern double strtod_or_err(const char *restrict str, const char *restrict errmesg);
-extern void print_version(void) __attribute__ ((noreturn));
-extern void usage(int status) __attribute__ ((noreturn));
+extern void __attribute__ ((noreturn)) print_version(void);
+extern void __attribute__ ((noreturn)) usage(int status);
/* qsort required functions... */
/* ...for ranges and... */
extern int (*ipcomp) (const union ipaddr_t *restrict a, const union ipaddr_t *restrict b);
extern int ipcomp_init(const union ipaddr_t *restrict a,
- const union ipaddr_t *restrict b) _DP_ATTRIBUTE_CONST;
+ const union ipaddr_t *restrict b);
extern int ipcomp_v4(const union ipaddr_t *restrict a,
- const union ipaddr_t *restrict b) _DP_ATTRIBUTE_PURE;
+ const union ipaddr_t *restrict b);
extern int ipcomp_v6(const union ipaddr_t *restrict a,
- const union ipaddr_t *restrict b) _DP_ATTRIBUTE_PURE;
+ const union ipaddr_t *restrict b);
extern int (*leasecomp) (const struct leases_t *restrict a, const struct leases_t *restrict b);
extern int leasecomp_init(const struct leases_t *restrict a
@@ -292,20 +277,20 @@ extern int leasecomp_init(const struct leases_t *restrict a
extern int leasecomp_v4(const struct leases_t *restrict a, const struct leases_t *restrict b);
extern int leasecomp_v6(const struct leases_t *restrict a, const struct leases_t *restrict b);
-extern int comp_cur(struct range_t *r1, struct range_t *r2) _DP_ATTRIBUTE_PURE;
-extern int comp_double(double f1, double f2) _DP_ATTRIBUTE_CONST;
+extern int comp_cur(struct range_t *r1, struct range_t *r2);
+extern int comp_double(double f1, double f2);
extern int comp_ip(struct range_t *r1, struct range_t *r2);
extern int comp_max(struct range_t *r1, struct range_t *r2);
extern int comp_percent(struct range_t *r1, struct range_t *r2);
-extern int comp_tc(struct range_t *r1, struct range_t *r2) _DP_ATTRIBUTE_PURE;
+extern int comp_tc(struct range_t *r1, struct range_t *r2);
extern int comp_tcperc(struct range_t *r1, struct range_t *r2);
-extern int comp_touched(struct range_t *r1, struct range_t *r2) _DP_ATTRIBUTE_PURE;
+extern int comp_touched(struct range_t *r1, struct range_t *r2);
extern int rangecomp(const void *restrict r1, const void *restrict r2)
__attribute__ ((nonnull(1, 2)));
/* sort function pointer and functions */
extern comparer_t field_selector(char c);
extern double ret_percent(struct range_t r);
-extern double ret_tc(struct range_t r) _DP_ATTRIBUTE_CONST;
+extern double ret_tc(struct range_t r);
extern double ret_tcperc(struct range_t r);
extern void mergesort_ranges(struct range_t *restrict orig, int size,
struct range_t *restrict temp)
@@ -322,14 +307,14 @@ extern int output_alarming(void);
extern void clean_up(void);
/* Hash functions */
extern void (*add_lease) (union ipaddr_t *ip, enum ltype type);
-extern void add_lease_init(union ipaddr_t *ip, enum ltype type) _DP_ATTRIBUTE_CONST;
+extern void add_lease_init(union ipaddr_t *ip, enum ltype type);
extern void add_lease_v4(union ipaddr_t *ip, enum ltype type);
extern void add_lease_v6(union ipaddr_t *ip, enum ltype type);
extern struct leases_t *(*find_lease) (union ipaddr_t *ip);
-extern struct leases_t *find_lease_init(union ipaddr_t *ip) _DP_ATTRIBUTE_CONST;
-extern struct leases_t *find_lease_v4(union ipaddr_t *ip) _DP_ATTRIBUTE_PURE;
-extern struct leases_t *find_lease_v6(union ipaddr_t *ip) _DP_ATTRIBUTE_PURE;
+extern struct leases_t *find_lease_init(union ipaddr_t *ip);
+extern struct leases_t *find_lease_v4(union ipaddr_t *ip);
+extern struct leases_t *find_lease_v6(union ipaddr_t *ip);
extern void delete_lease(struct leases_t *lease);
extern void delete_all_leases(void);
diff --git a/src/getdata.c b/src/getdata.c
index d72b9cc..05adee5 100644
--- a/src/getdata.c
+++ b/src/getdata.c
@@ -164,7 +164,7 @@ static int is_interesting_config_clause(char const *restrict s)
/*! \brief Flip first and last IP in range if they are in unusual order.
*/
-void reorder_last_first(struct range_t *range_p)
+static void reorder_last_first(struct range_t *range_p)
{
if (ipcomp(&range_p->first_ip, &range_p->last_ip) > 0) {
union ipaddr_t tmp;
From 5eae1b41a723f4e93b19fef907f49f9fc6be50e9 Mon Sep 17 00:00:00 2001
From: Sami Kerola
Date: Fri, 6 Jan 2017 23:34:00 +0000
Subject: [PATCH 027/158] man: improve synopsis and output limit
Signed-off-by: Sami Kerola
---
man/dhcpd-pools.1.in | 56 ++++++++++++++++++++++++--------------------
1 file changed, 30 insertions(+), 26 deletions(-)
diff --git a/man/dhcpd-pools.1.in b/man/dhcpd-pools.1.in
index 8216ee4..9327749 100644
--- a/man/dhcpd-pools.1.in
+++ b/man/dhcpd-pools.1.in
@@ -1,9 +1,25 @@
-.TH DHCPD-POOLS "1" "2015-09-04" "@VERSION@" "User Commands"
+.TH DHCPD-POOLS "1" "2017-01-06" "@VERSION@" "User Commands"
.SH NAME
dhcpd-pools \- ISC dhcpd pools usage analysis
.SH SYNOPSIS
-.B dhcpd-pools
-[options]
+.SY dhcpd-pools
+.OP \-\-config file
+.OP \-\-leases file
+.OP \-\-sort nimcptTe
+.OP \-\-reverse
+.OP \-\-format thHcxXjJ
+.OP \-\-output file
+.OP \-\-limit nr
+.OP \-\-warning percent
+.OP \-\-critical percent
+.OP \-\-warn\-count number
+.OP \-\-crit\-count number
+.OP \-\-snet\-alarms
+.OP \-\-minsize size
+.OP \-\-perfdata
+.OP \-\-version
+.OP \-\-help
+.YS
.SH DESCRIPTION
The program analyses ISC dhcpd shared network and pool usage and outputs the
results in a format selected by user.
@@ -104,29 +120,17 @@ determines which numeric analysis tables to include in the output. The
following values are "OR'd" together to create the desired output. The
default is
.IR @OUTPUT_LIMIT@ .
-.PP
-.RS
-.PD 0
-.TP
-.B 01
-Print ranges
-.TP
-.B 02
-Print shared networks
-.TP
-.B 04
-Print total summary
-.TP
-.B 10
-Print range header
-.TP
-.B 20
-Print shared network header
-.TP
-.B 40
-Print total summary header
-.PD
-.RE
+.IP
+.TS
+tab(:);
+ll.
+0\fI1\fR:Print ranges
+0\fI2\fR:Print shared networks
+0\fI4\fR:Print total summary
+\fI1\fR0:Print range header
+\fI2\fR0:Print shared network header
+\fI4\fR0:Print total summary header
+.TE
.IP
The output limit for total summary has special meaning in
.B \-\-warning
From ae2edb0fbc80e237359a8156ada30d2835535bfa Mon Sep 17 00:00:00 2001
From: Sami Kerola
Date: Sat, 7 Jan 2017 11:01:22 +0000
Subject: [PATCH 028/158] man: remove old html table only option argument from
manual
Incomplete html page, that was just a html table, was removed some time ago
but deprecated option arguments were unfortunately left to manual that are
now removed.
Reference: 1299737d76dfabc17bb79d8eb2475b1a3784b9c7
Signed-off-by: Sami Kerola
---
man/dhcpd-pools.1.in | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/man/dhcpd-pools.1.in b/man/dhcpd-pools.1.in
index 9327749..6b7a74b 100644
--- a/man/dhcpd-pools.1.in
+++ b/man/dhcpd-pools.1.in
@@ -7,7 +7,7 @@ dhcpd-pools \- ISC dhcpd pools usage analysis
.OP \-\-leases file
.OP \-\-sort nimcptTe
.OP \-\-reverse
-.OP \-\-format thHcxXjJ
+.OP \-\-format tHcxXjJ
.OP \-\-output file
.OP \-\-limit nr
.OP \-\-warning percent
@@ -80,7 +80,7 @@ field is default sort key.
\fB\-r\fR, \fB\-\-reverse\fR
Sort results in reverse order.
.TP
-\fB\-f\fR, \fB\-\-format\fR=\fI[thHcxXjJ]\fR
+\fB\-f\fR, \fB\-\-format\fR=\fI[tHcxXjJ]\fR
Output format.
Text
.RI ( t ).
From a905b50943e93db917b785d07cb6eebd3e2efff8 Mon Sep 17 00:00:00 2001
From: Sami Kerola
Date: Sun, 8 Jan 2017 11:49:41 +0000
Subject: [PATCH 029/158] getdata: report position in config file when parsing
fails
It seems that one can reach the abort() with severely broken configuration
file, that is extremely unlikely to run without parser error when given to
ISC dhcpd. So such files ought to be impossible, and it is good enough for
this software to report position where parsing cannot be continued.
Signed-off-by: Sami Kerola
---
src/getdata.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/getdata.c b/src/getdata.c
index 05adee5..906fa27 100644
--- a/src/getdata.c
+++ b/src/getdata.c
@@ -257,8 +257,9 @@ void parse_config(int is_include, const char *restrict config_file,
break;
} else if (argument == ITS_A_RANGE_SECOND_IP && i == 0) {
if (!range_p) {
- puts("parse_config: range_p uninitialized: report a bug");
- abort();
+ fpos_t pos;
+ fgetpos(dhcpd_config, &pos);
+ error(EXIT_FAILURE, 0, "parse_config: parsing failed at position: %Ld", pos);
}
range_p->last_ip = range_p->first_ip;
goto newrange;
From c4a654a1497149e9470078b5ab067305a2016361 Mon Sep 17 00:00:00 2001
From: Sami Kerola
Date: Thu, 12 Jan 2017 22:40:33 +0000
Subject: [PATCH 030/158] output: fix timestamp localization on html page
Signed-off-by: Sami Kerola
---
src/output.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/output.c b/src/output.c
index c3ad488..7c29d4f 100644
--- a/src/output.c
+++ b/src/output.c
@@ -468,6 +468,8 @@ static void html_header(FILE *restrict f)
if (tmp == NULL) {
error(EXIT_FAILURE, errno, "html_header: localtime");
}
+ setlocale(LC_CTYPE, "");
+ setlocale(LC_NUMERIC, "");
if (strftime(outstr, sizeof(outstr), nl_langinfo(D_T_FMT), &result) == 0) {
error(EXIT_FAILURE, 0, "html_header: strftime returned 0");
}
From 344e01c1f62217484b91396474b5e9e2f9310128 Mon Sep 17 00:00:00 2001
From: Sami Kerola
Date: Sat, 4 Feb 2017 18:00:02 +0000
Subject: [PATCH 031/158] output: add include avoid referringt to undefined
definition
Reference: c4a654a1497149e9470078b5ab067305a2016361
Signed-off-by: Sami Kerola
---
src/output.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/output.c b/src/output.c
index 7c29d4f..407b2a8 100644
--- a/src/output.c
+++ b/src/output.c
@@ -43,6 +43,7 @@
#include
#include
#include
+#include
#include
#include
#include
From 2b75a0d78e12ebdace42dd2812600b0adf7ae320 Mon Sep 17 00:00:00 2001
From: Sami Kerola
Date: Sat, 4 Feb 2017 23:11:43 +0000
Subject: [PATCH 032/158] getdata: remove POSIX_FADV_NOREUSE
It is too difficult to know what users might want to do. Maybe some run
this software all the time from a monitoring system, and in cases like that
it is best to have caches helping.
Signed-off-by: Sami Kerola
---
src/getdata.c | 8 --------
1 file changed, 8 deletions(-)
diff --git a/src/getdata.c b/src/getdata.c
index 906fa27..13b882a 100644
--- a/src/getdata.c
+++ b/src/getdata.c
@@ -71,10 +71,6 @@ int parse_leases(void)
if (dhcpd_leases == NULL)
error(EXIT_FAILURE, errno, "parse_leases: %s", config.dhcpdlease_file);
#ifdef HAVE_POSIX_FADVISE
-# ifdef POSIX_FADV_NOREUSE
- if (posix_fadvise(fileno(dhcpd_leases), 0, 0, POSIX_FADV_NOREUSE) != 0)
- error(EXIT_FAILURE, errno, "parse_leases: fadvise %s", config.dhcpdlease_file);
-# endif /* POSIX_FADV_NOREUSE */
# ifdef POSIX_FADV_SEQUENTIAL
if (posix_fadvise(fileno(dhcpd_leases), 0, 0, POSIX_FADV_SEQUENTIAL) != 0)
error(EXIT_FAILURE, errno, "parse_leases: fadvise %s", config.dhcpdlease_file);
@@ -200,10 +196,6 @@ void parse_config(int is_include, const char *restrict config_file,
if (dhcpd_config == NULL)
error(EXIT_FAILURE, errno, "parse_config: %s", config_file);
#ifdef HAVE_POSIX_FADVISE
-# ifdef POSIX_FADV_NOREUSE
- if (posix_fadvise(fileno(dhcpd_config), 0, 0, POSIX_FADV_NOREUSE) != 0)
- error(EXIT_FAILURE, errno, "parse_config: fadvise %s", config_file);
-# endif /* POSIX_FADV_NOREUSE */
# ifdef POSIX_FADV_SEQUENTIAL
if (posix_fadvise(fileno(dhcpd_config), 0, 0, POSIX_FADV_SEQUENTIAL) != 0)
error(EXIT_FAILURE, errno, "parse_config: fadvise %s", config_file);
From 9a526193853620e451aa6ebd5d10f9288825971e Mon Sep 17 00:00:00 2001
From: Sami Kerola
Date: Fri, 7 Apr 2017 22:56:19 +0100
Subject: [PATCH 033/158] style: use same argument names in header and source
file
Signed-off-by: Sami Kerola
---
src/dhcpd-pools.h | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/src/dhcpd-pools.h b/src/dhcpd-pools.h
index 3765b26..5b2dbc7 100644
--- a/src/dhcpd-pools.h
+++ b/src/dhcpd-pools.h
@@ -225,7 +225,7 @@ extern void parse_config(int, const char *restrict, struct shared_network_t *res
__attribute__ ((nonnull(2, 3)));
extern void prepare_data(void);
extern void do_counting(void);
-extern void flip_ranges(struct range_t *restrict ranges, struct range_t *restrict tmp_ranges)
+extern void flip_ranges(struct range_t *restrict flip_me, struct range_t *restrict tmp_ranges)
__attribute__ ((nonnull(1, 2)));
/* support functions */
extern int (*parse_ipaddr) (const char *restrict src, union ipaddr_t *restrict dst);
@@ -306,15 +306,15 @@ extern int output_alarming(void);
/* Memory release, file closing etc */
extern void clean_up(void);
/* Hash functions */
-extern void (*add_lease) (union ipaddr_t *ip, enum ltype type);
-extern void add_lease_init(union ipaddr_t *ip, enum ltype type);
-extern void add_lease_v4(union ipaddr_t *ip, enum ltype type);
-extern void add_lease_v6(union ipaddr_t *ip, enum ltype type);
+extern void (*add_lease) (union ipaddr_t *addr, enum ltype type);
+extern void add_lease_init(union ipaddr_t *addr, enum ltype type);
+extern void add_lease_v4(union ipaddr_t *addr, enum ltype type);
+extern void add_lease_v6(union ipaddr_t *addr, enum ltype type);
-extern struct leases_t *(*find_lease) (union ipaddr_t *ip);
-extern struct leases_t *find_lease_init(union ipaddr_t *ip);
-extern struct leases_t *find_lease_v4(union ipaddr_t *ip);
-extern struct leases_t *find_lease_v6(union ipaddr_t *ip);
+extern struct leases_t *(*find_lease) (union ipaddr_t *addr);
+extern struct leases_t *find_lease_init(union ipaddr_t *addr);
+extern struct leases_t *find_lease_v4(union ipaddr_t *addr);
+extern struct leases_t *find_lease_v6(union ipaddr_t *addr);
extern void delete_lease(struct leases_t *lease);
extern void delete_all_leases(void);
From e9223a852c90e47e6ff49b40c39f11d7c89c1bef Mon Sep 17 00:00:00 2001
From: Sami Kerola
Date: Mon, 10 Apr 2017 13:12:34 +0100
Subject: [PATCH 034/158] contrib: Klaus Slott told about opensuse package
Add opensuse rpm as an example how to build one.
Signed-off-by: Sami Kerola
---
THANKS | 1 +
contrib/rpm.spec | 4 ++++
2 files changed, 5 insertions(+)
create mode 100644 contrib/rpm.spec
diff --git a/THANKS b/THANKS
index 8375381..7a9ce82 100644
--- a/THANKS
+++ b/THANKS
@@ -39,3 +39,4 @@ Anton Tkachev
Derrick Lin
Ivanov Ivan
Manuel Hachtkemper
+Klaus Slott
diff --git a/contrib/rpm.spec b/contrib/rpm.spec
new file mode 100644
index 0000000..46826d8
--- /dev/null
+++ b/contrib/rpm.spec
@@ -0,0 +1,4 @@
+Klaus Slott made a package that works for opensuse, and is
+a good starting point for whom ever happens to need an rpm.
+
+https://build.opensuse.org/package/show/home:Mr_Manor/dhcpd-pools
From c3c3fc6e406763914c1a6163d311320298a1663d Mon Sep 17 00:00:00 2001
From: Sami Kerola
Date: Sat, 15 Apr 2017 20:42:07 +0100
Subject: [PATCH 035/158] getdata: fpos_t is not easy to print correctly
On some systems fpos_t may be a complex object, so printing it is not as
easy as ftell() position.
Signed-off-by: Sami Kerola
---
src/getdata.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/getdata.c b/src/getdata.c
index 13b882a..2083440 100644
--- a/src/getdata.c
+++ b/src/getdata.c
@@ -249,9 +249,9 @@ void parse_config(int is_include, const char *restrict config_file,
break;
} else if (argument == ITS_A_RANGE_SECOND_IP && i == 0) {
if (!range_p) {
- fpos_t pos;
- fgetpos(dhcpd_config, &pos);
- error(EXIT_FAILURE, 0, "parse_config: parsing failed at position: %Ld", pos);
+ long int pos;
+ pos = ftell(dhcpd_config);
+ error(EXIT_FAILURE, 0, "parse_config: parsing failed at position: %ld", pos);
}
range_p->last_ip = range_p->first_ip;
goto newrange;
From e93fc5dba49a50ecaab516e6d3e3a5b8cc32b200 Mon Sep 17 00:00:00 2001
From: Sami Kerola
Date: Sat, 15 Apr 2017 20:42:58 +0100
Subject: [PATCH 036/158] lib: update .gitignore
Signed-off-by: Sami Kerola
---
lib/.gitignore | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/lib/.gitignore b/lib/.gitignore
index 01559e4..203f90d 100644
--- a/lib/.gitignore
+++ b/lib/.gitignore
@@ -6,6 +6,7 @@
/Makefile
/Makefile.am
/Makefile.in
+/_Noreturn.h
/alloca.h
/alloca.in.h
/arg-nonnull.h
@@ -57,6 +58,11 @@
/fstat.c
/ftell.c
/ftello.c
+/getopt-cdefs.in.h
+/getopt-core.h
+/getopt-ext.h
+/getopt-pfx-core.h
+/getopt-pfx-ext.h
/getopt.c
/getopt.in.h
/getopt1.c
From 1c8b799799409c9446ef326894f5ba94356b1b63 Mon Sep 17 00:00:00 2001
From: Sami Kerola
Date: Sat, 6 May 2017 16:44:19 +0100
Subject: [PATCH 037/158] fix typo
Signed-off-by: Sami Kerola
---
webpages/index.html | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/webpages/index.html b/webpages/index.html
index 7fb097d..5e9f398 100644
--- a/webpages/index.html
+++ b/webpages/index.html
@@ -74,7 +74,7 @@ reference documentation are available online.
lease_analyzer and
dhcpd-snmp
where too slow to handle huge number of leases. There is also difference in
-printed details. The dhcpd-pools does not print quote as much information as
+printed details. The dhcpd-pools does not print quite as much information as
some other tools.
Notice that this utility is not the same as
dhcpd-pool
From 242ef3109b979e08a1db890e40bf4c6969f0bc7e Mon Sep 17 00:00:00 2001
From: Sami Kerola
Date: Sun, 21 May 2017 17:21:57 +0100
Subject: [PATCH 038/158] variable: add const to print_mac_addreses_tmp
Signed-off-by: Sami Kerola
---
src/dhcpd-pools.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/dhcpd-pools.c b/src/dhcpd-pools.c
index f07386b..0d9718d 100644
--- a/src/dhcpd-pools.c
+++ b/src/dhcpd-pools.c
@@ -100,7 +100,7 @@ int main(int argc, char **argv)
{
int option_index = 0;
char const *tmp;
- char *print_mac_addreses_tmp;
+ const char *print_mac_addreses_tmp;
struct range_t *tmp_ranges;
enum {
OPT_SNET_ALARMS = CHAR_MAX + 1,
From dff991666e400ab08dcb55c98b5808473fefdb3f Mon Sep 17 00:00:00 2001
From: Sami Kerola
Date: Sun, 21 May 2017 17:30:24 +0100
Subject: [PATCH 039/158] lib: update .gitignore
Signed-off-by: Sami Kerola
---
lib/.gitignore | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/lib/.gitignore b/lib/.gitignore
index 203f90d..bd99cb1 100644
--- a/lib/.gitignore
+++ b/lib/.gitignore
@@ -43,6 +43,7 @@
/fd-hook.h
/fdopen.c
/fflush.c
+/filename.h
/flexmember.h
/float+.h
/float.c
@@ -90,6 +91,8 @@
/locale.h
/locale.in.h
/localeconv.c
+/localtime-buffer.c
+/localtime-buffer.h
/lseek.c
/malloc.c
/malloca.c
@@ -123,6 +126,8 @@
/ref-del.sed
/ref-del.sin
/setenv.c
+/stat-w32.c
+/stat-w32.h
/stat.c
/stdalign.in.h
/stdbool.in.h
@@ -165,6 +170,7 @@
/time_r.c
/time_rz.c
/timegm.c
+/tzset.c
/unistd.c
/unistd.h
/unistd.in.h
From b9cff0d814dd886f38ff1dabe76f632d7829f3e4 Mon Sep 17 00:00:00 2001
From: Boris Lytochkin
Date: Sun, 4 Dec 2016 17:09:32 +0300
Subject: [PATCH 040/158] 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
---
THANKS | 1 +
man/dhcpd-pools.1.in | 4 ++++
src/dhcpd-pools.c | 9 ++++++++-
src/dhcpd-pools.h | 6 +++++-
src/getdata.c | 34 ++++++++++++++++++++++++++++++++++
src/other.c | 3 ++-
6 files changed, 54 insertions(+), 3 deletions(-)
diff --git a/THANKS b/THANKS
index 7a9ce82..ae23230 100644
--- a/THANKS
+++ b/THANKS
@@ -40,3 +40,4 @@ Derrick Lin
Ivanov Ivan
Manuel Hachtkemper
Klaus Slott
+Boris Lytochkin
diff --git a/man/dhcpd-pools.1.in b/man/dhcpd-pools.1.in
index 6b7a74b..8a55165 100644
--- a/man/dhcpd-pools.1.in
+++ b/man/dhcpd-pools.1.in
@@ -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
diff --git a/src/dhcpd-pools.c b/src/dhcpd-pools.c
index 0d9718d..16d685e 100644
--- a/src/dhcpd-pools.c
+++ b/src/dhcpd-pools.c
@@ -129,6 +129,7 @@ int main(int argc, char **argv)
{"crit-count", required_argument, NULL, OPT_CRIT_COUNT},
{"minsize", required_argument, NULL, OPT_MINSIZE},
{"perfdata", no_argument, NULL, 'p'},
+ {"all-as-shared", no_argument, NULL, 'A'},
{NULL, 0, NULL, 0}
};
@@ -161,12 +162,14 @@ int main(int argc, char **argv)
/* Default sort order is by IPs small to big */
config.reverse_order = 0;
config.backups_found = 0;
+ /* Treat single networks as shared with network CIDR as name */
+ config.all_as_shared = 0;
prepare_memory();
/* Parse command line options */
while (1) {
int c;
- c = getopt_long(argc, argv, "c:l:f:o:s:rL:pvh", long_options, &option_index);
+ c = getopt_long(argc, argv, "c:l:f:o:s:rL:pAvh", long_options, &option_index);
if (c == EOF)
break;
switch (c) {
@@ -241,6 +244,10 @@ int main(int argc, char **argv)
/* Print additional performance data in alarming mode */
config.perfdata = 1;
break;
+ case 'A':
+ /* Treat single networks as shared with network CIDR as name */
+ config.all_as_shared = 1;
+ break;
case 'v':
/* Print version */
print_version();
diff --git a/src/dhcpd-pools.h b/src/dhcpd-pools.h
index 5b2dbc7..53df74a 100644
--- a/src/dhcpd-pools.h
+++ b/src/dhcpd-pools.h
@@ -108,6 +108,7 @@ struct shared_network_t {
double used;
double touched;
double backups;
+ int netmask;
};
/*! \struct range_t
* \brief Counters for an individual range.
@@ -128,7 +129,9 @@ enum isc_conf_parser {
ITS_A_RANGE_FIRST_IP,
ITS_A_RANGE_SECOND_IP,
ITS_A_SHAREDNET,
- ITS_AN_INCLUCE
+ ITS_AN_INCLUCE,
+ ITS_A_SUBNET,
+ ITS_A_NETMASK
};
/*! \enum ltype
* \brief Lease state types.
@@ -196,6 +199,7 @@ struct configuration_t {
snet_alarms:1,
print_mac_addreses:1,
perfdata:1,
+ all_as_shared:1,
header_limit:3,
number_limit:3;
};
diff --git a/src/getdata.c b/src/getdata.c
index 2083440..995e1a9 100644
--- a/src/getdata.c
+++ b/src/getdata.c
@@ -153,6 +153,12 @@ static int is_interesting_config_clause(char const *restrict s)
return ITS_A_RANGE_FIRST_IP;
if (strstr(s, "shared-network"))
return ITS_A_SHAREDNET;
+ if (config.all_as_shared) {
+ if (strstr(s, "subnet"))
+ return ITS_A_SUBNET;
+ if (strstr(s, "netmask"))
+ return ITS_A_NETMASK;
+ }
if (strstr(s, "include"))
return ITS_AN_INCLUCE;
return ITS_NOTHING_INTERESTING;
@@ -364,6 +370,12 @@ void parse_config(int is_include, const char *restrict config_file,
argument = ITS_A_RANGE_SECOND_IP;
break;
case ITS_A_SHAREDNET:
+ case ITS_A_SUBNET:
+ /* ignore subnets inside a shared-network */
+ if (argument == ITS_A_SUBNET && shared_p != shared_networks) {
+ argument = ITS_NOTHING_INTERESTING;
+ break;
+ }
/* printf ("shared-network named: %s\n", word); */
num_shared_networks++;
shared_p = shared_networks + num_shared_networks;
@@ -372,10 +384,32 @@ void parse_config(int is_include, const char *restrict config_file,
shared_p->used = 0;
shared_p->touched = 0;
shared_p->backups = 0;
+ shared_p->netmask = (argument == ITS_A_SUBNET ? -1 : 0); /* do not fill in netmask */
if (SHARED_NETWORKS < num_shared_networks + 2)
/* FIXME: make this to go away by reallocating more space. */
error(EXIT_FAILURE, 0,
"parse_config: increase default.h SHARED_NETWORKS and recompile");
+ /* record network's mask too */
+ if (argument == ITS_A_SUBNET)
+ newclause = 1;
+ argument = ITS_NOTHING_INTERESTING;
+ braces_shared = braces;
+ break;
+ case ITS_A_NETMASK:
+ /* fill in only when requested to do so */
+ if (shared_p->netmask) {
+ if (!(parse_ipaddr(word, &addr)))
+ break;
+ shared_p->netmask = 32;
+ while ((addr.v4 & 0x01) == 0) {
+ addr.v4 >>= 1;
+ shared_p->netmask--;
+ }
+ snprintf(word, MAXLEN-1, "%s/%d", shared_p->name, shared_p->netmask);
+ if (shared_p->name)
+ free(shared_p->name);
+ shared_p->name = xstrdup(word);
+ }
argument = ITS_NOTHING_INTERESTING;
braces_shared = braces;
break;
diff --git a/src/other.c b/src/other.c
index 5e54367..5794ccc 100644
--- a/src/other.c
+++ b/src/other.c
@@ -474,7 +474,8 @@ void __attribute__ ((__noreturn__)) usage(int status)
fputs( " --crit-count=NR a number of free leases before critical raised\n", out);
fputs( " --minsize=size disable alarms for small ranges and shared-nets\n", out);
fputs( " --snet-alarms suppress range alarms that are part of a shared-net\n", out);
- fputs( " -p --perfdata print additional perfdata in alarming mode\n", out);
+ fputs( " -p, --perfdata print additional perfdata in alarming mode\n", out);
+ fputs( " -A, --all-as-shared treat single subnets as shared-network with CIDR as their name\n", out);
fputs( " -v, --version output version information and exit\n", out);
fputs( " -h, --help display this help and exit\n", out);
fputs( "\n", out);
From 782f63c3ad2ec9ae46af90ae4507693e2a873f63 Mon Sep 17 00:00:00 2001
From: Sami Kerola
Date: Sat, 9 Sep 2017 10:09:35 +0100
Subject: [PATCH 041/158] add --ip-version option to force either IPv4 or IPv6
analysis
Proposed-by: Jeff Balley
Signed-off-by: Sami Kerola
---
man/dhcpd-pools.1.in | 6 ++++++
src/dhcpd-pools.c | 18 ++++++++++++++++--
src/other.c | 1 +
3 files changed, 23 insertions(+), 2 deletions(-)
diff --git a/man/dhcpd-pools.1.in b/man/dhcpd-pools.1.in
index 8a55165..0eee034 100644
--- a/man/dhcpd-pools.1.in
+++ b/man/dhcpd-pools.1.in
@@ -206,6 +206,12 @@ is not in use.
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\-\-ip\-version\fR=\fI4|6\fR
+Force command to read configuration and leases files in IPv4 or IPv6 mode.
+Notice that when inputs do not match with what is forced analysis output is
+garbage. This option should not be necessary to use, and exists only to
+allow debugging.
+.TP
\fB\-v\fR, \fB\-\-version\fR
Print version information to standard output and exit successfully.
.TP
diff --git a/src/dhcpd-pools.c b/src/dhcpd-pools.c
index 16d685e..4f6f22b 100644
--- a/src/dhcpd-pools.c
+++ b/src/dhcpd-pools.c
@@ -108,7 +108,8 @@ int main(int argc, char **argv)
OPT_CRIT,
OPT_MINSIZE,
OPT_WARN_COUNT,
- OPT_CRIT_COUNT
+ OPT_CRIT_COUNT,
+ OPT_SET_IPV
};
int ret_val;
@@ -130,6 +131,7 @@ int main(int argc, char **argv)
{"minsize", required_argument, NULL, OPT_MINSIZE},
{"perfdata", no_argument, NULL, 'p'},
{"all-as-shared", no_argument, NULL, 'A'},
+ {"ip-version", required_argument, NULL, OPT_SET_IPV},
{NULL, 0, NULL, 0}
};
@@ -165,6 +167,7 @@ int main(int argc, char **argv)
/* Treat single networks as shared with network CIDR as name */
config.all_as_shared = 0;
prepare_memory();
+ set_ipv_functions(IPvUNKNOWN);
/* Parse command line options */
while (1) {
int c;
@@ -240,6 +243,18 @@ int main(int argc, char **argv)
case OPT_MINSIZE:
config.minsize = strtod_or_err(optarg, "illegal argument");
break;
+ case OPT_SET_IPV:
+ switch(optarg[0]) {
+ case '4':
+ set_ipv_functions(IPv4);
+ break;
+ case '6':
+ set_ipv_functions(IPv6);
+ break;
+ default:
+ error(EXIT_FAILURE, 0, "unknown --ip-version argument: %s", optarg);
+ }
+ break;
case 'p':
/* Print additional performance data in alarming mode */
config.perfdata = 1;
@@ -301,7 +316,6 @@ int main(int argc, char **argv)
error(EXIT_FAILURE, 0, "unknown output format: %s", quote(print_mac_addreses_tmp));
}
/* Do the job */
- set_ipv_functions(IPvUNKNOWN);
parse_config(1, config.dhcpdconf_file, shared_networks);
parse_leases();
prepare_data();
diff --git a/src/other.c b/src/other.c
index 5794ccc..7ac69c9 100644
--- a/src/other.c
+++ b/src/other.c
@@ -476,6 +476,7 @@ void __attribute__ ((__noreturn__)) usage(int status)
fputs( " --snet-alarms suppress range alarms that are part of a shared-net\n", out);
fputs( " -p, --perfdata print additional perfdata in alarming mode\n", out);
fputs( " -A, --all-as-shared treat single subnets as shared-network with CIDR as their name\n", out);
+ fputs( " --ip-version=4|6 force analysis to use either IPv4 or IPv6 functions\n", out);
fputs( " -v, --version output version information and exit\n", out);
fputs( " -h, --help display this help and exit\n", out);
fputs( "\n", out);
From 48d0629881a255fc1a3c445c867e694b38df6369 Mon Sep 17 00:00:00 2001
From: Sami Kerola
Date: Sat, 9 Sep 2017 10:19:20 +0100
Subject: [PATCH 042/158] lib: update .gitignore
Signed-off-by: Sami Kerola
---
lib/.gitignore | 1 +
1 file changed, 1 insertion(+)
diff --git a/lib/.gitignore b/lib/.gitignore
index bd99cb1..e138fda 100644
--- a/lib/.gitignore
+++ b/lib/.gitignore
@@ -114,6 +114,7 @@
/msvc-nothrow.h
/netinet_in.in.h
/nl_langinfo.c
+/nstrftime.c
/pathmax.h
/progname.c
/progname.h
From bb0fa9adaeb9ae8da2e52aa9b2767fce5ff6b337 Mon Sep 17 00:00:00 2001
From: Sami Kerola
Date: Sun, 17 Sep 2017 00:03:06 +0100
Subject: [PATCH 043/158] getdata: add cidr range support
This makes 'range6 123::/45' style cidr notation to be understood as address
range. Earlier ranges that used cidr failed to parse completely.
Reported-by: Jeff Bailey
Signed-off-by: Sami Kerola
---
THANKS | 1 +
src/dhcpd-pools.h | 2 +
src/getdata.c | 16 +++++---
src/other.c | 94 +++++++++++++++++++++++++++++++++++++++++++
tests/Makemodule.am | 2 +
tests/confs/range4 | 31 ++++++++++++++
tests/confs/range6 | 4 ++
tests/expected/range4 | 16 ++++++++
tests/expected/range6 | 10 +++++
tests/leases/range4 | 1 +
tests/leases/range6 | 1 +
tests/range4 | 1 +
tests/range6 | 1 +
13 files changed, 175 insertions(+), 5 deletions(-)
create mode 100644 tests/confs/range4
create mode 100644 tests/confs/range6
create mode 100644 tests/expected/range4
create mode 100644 tests/expected/range6
create mode 120000 tests/leases/range4
create mode 120000 tests/leases/range6
create mode 120000 tests/range4
create mode 120000 tests/range6
diff --git a/THANKS b/THANKS
index ae23230..f230fcd 100644
--- a/THANKS
+++ b/THANKS
@@ -41,3 +41,4 @@ Ivanov Ivan
Manuel Hachtkemper
Klaus Slott
Boris Lytochkin
+Jeff Bailey
diff --git a/src/dhcpd-pools.h b/src/dhcpd-pools.h
index 53df74a..47e246e 100644
--- a/src/dhcpd-pools.h
+++ b/src/dhcpd-pools.h
@@ -238,6 +238,8 @@ extern int parse_ipaddr_init(const char *restrict src,
extern int parse_ipaddr_v4(const char *restrict src, union ipaddr_t *restrict dst);
extern int parse_ipaddr_v6(const char *restrict src, union ipaddr_t *restrict dst);
+extern void parse_cidr(struct range_t *range_p, const char *word);
+
extern void (*copy_ipaddr) (union ipaddr_t *restrict dst, const union ipaddr_t *restrict src);
extern void copy_ipaddr_init(union ipaddr_t *restrict dst,
const union ipaddr_t *restrict src);
diff --git a/src/getdata.c b/src/getdata.c
index 995e1a9..6f53b1a 100644
--- a/src/getdata.c
+++ b/src/getdata.c
@@ -339,13 +339,19 @@ void parse_config(int is_include, const char *restrict config_file,
/* printf ("range 2nd ip: %s\n", word); */
range_p = ranges + num_ranges;
argument = ITS_NOTHING_INTERESTING;
- parse_ipaddr(word, &addr);
- if (one_ip_range == 1) {
+ if (strchr(word, '/')) {
+ parse_cidr(range_p, word);
one_ip_range = 0;
- copy_ipaddr(&range_p->first_ip, &addr);
+ } else {
+ /* not cidr */
+ parse_ipaddr(word, &addr);
+ if (one_ip_range == 1) {
+ one_ip_range = 0;
+ copy_ipaddr(&range_p->first_ip, &addr);
+ }
+ copy_ipaddr(&range_p->last_ip, &addr);
+ reorder_last_first(range_p);
}
- copy_ipaddr(&range_p->last_ip, &addr);
- reorder_last_first(range_p);
newrange:
range_p->count = 0;
range_p->touched = 0;
diff --git a/src/other.c b/src/other.c
index 7ac69c9..4eda1ad 100644
--- a/src/other.c
+++ b/src/other.c
@@ -52,10 +52,15 @@
#include "error.h"
#include "progname.h"
#include "quote.h"
+#include "xalloc.h"
#include "dhcpd-pools.h"
#include "defaults.h"
+char *(*cidr_last)(union ipaddr_t *restrict addr, const int mask);
+static char *cidr_last_v4(union ipaddr_t *restrict addr, const int mask);
+static char *cidr_last_v6(union ipaddr_t *restrict addr, const int mask);
+
/*! \brief Set function pointers depending on IP version.
* \param ip IP version.
*/
@@ -73,6 +78,7 @@ void set_ipv_functions(int version)
leasecomp = leasecomp_v4;
ntop_ipaddr = ntop_ipaddr_v4;
parse_ipaddr = parse_ipaddr_v4;
+ cidr_last = cidr_last_v4;
xstrstr = xstrstr_v4;
break;
@@ -86,6 +92,7 @@ void set_ipv_functions(int version)
leasecomp = leasecomp_v6;
ntop_ipaddr = ntop_ipaddr_v6;
parse_ipaddr = parse_ipaddr_v6;
+ cidr_last = cidr_last_v6;
xstrstr = xstrstr_v6;
break;
@@ -99,6 +106,7 @@ void set_ipv_functions(int version)
leasecomp = leasecomp_init;
ntop_ipaddr = ntop_ipaddr_init;
parse_ipaddr = parse_ipaddr_init;
+ cidr_last = NULL;
xstrstr = xstrstr_init;
break;
@@ -148,6 +156,92 @@ int parse_ipaddr_v6(const char *restrict src, union ipaddr_t *restrict dst)
return rv == 1;
}
+static int strtol_mask(const char *str)
+{
+ long num;
+ char *end = NULL;
+
+ errno = 0;
+ if (str == NULL || *str == '\0')
+ goto err;
+ num = strtol(str, &end, 10);
+
+ if (errno || str == end || (end && *end))
+ goto err;
+ if (num < 0 || 128 < num)
+ goto err;
+ return (int)num;
+ err:
+ return -1;
+}
+
+static char *cidr_last_v4(union ipaddr_t *restrict addr, const int mask)
+{
+ union ipaddr_t last_ip;
+ uint32_t netmask;
+ const char *ip;
+
+ if (mask)
+ netmask = (1U << (32 - mask)) - 1;
+ else
+ netmask = 0;
+ last_ip.v4 = addr->v4 | netmask;
+
+ ip = ntop_ipaddr(&last_ip);
+ return xstrdup(ip);
+}
+
+static char *cidr_last_v6(union ipaddr_t *restrict addr, const int mask)
+{
+ union ipaddr_t bitmask;
+ int i, j;
+ char ip[128];
+
+ memset(&bitmask, 0x0, sizeof(bitmask));
+ for (i = mask, j = 0; i > 0; i -= 8, j++) {
+ if (i >= 8)
+ bitmask.v6[j] = 0xff;
+ else
+ bitmask.v6[j] = (unsigned char)(0xffU << (8 - i));
+ }
+ for (i = 0; i < (int)sizeof(bitmask); i++)
+ addr->v6[i] |= ~bitmask.v6[i];
+ inet_ntop(AF_INET6, addr, ip, sizeof(ip));
+ return xstrdup(ip);
+}
+
+void parse_cidr(struct range_t *range_p, const char *word)
+{
+ char *divider;
+ int mask;
+ union ipaddr_t addr;
+ char *last;
+
+ /* determine cidr */
+ divider = strchr(word, '/');
+ *divider++ = '\0';
+ mask = strtol_mask(divider);
+ if (mask < 0)
+ error(EXIT_FAILURE, 0, "cidr %s invalid mask %s", word,
+ divider);
+ if (config.ip_version == IPvUNKNOWN) {
+ if (!strchr(word, ':'))
+ set_ipv_functions(IPv4);
+ else
+ set_ipv_functions(IPv6);
+ }
+
+ /* start of the range is easy */
+ parse_ipaddr(word, &addr);
+ copy_ipaddr(&range_p->first_ip, &addr);
+
+ /* end of the range depends cidr size */
+ last = cidr_last(&addr, mask);
+ parse_ipaddr(last, &addr);
+ copy_ipaddr(&range_p->last_ip, &addr);
+ free(last);
+}
+
/*! \brief Copy IP address to union.
*
* \param dst Destination for a binary IP address.
diff --git a/tests/Makemodule.am b/tests/Makemodule.am
index 46bac47..2784298 100644
--- a/tests/Makemodule.am
+++ b/tests/Makemodule.am
@@ -20,6 +20,8 @@ TESTS = \
tests/leading0 \
tests/one-ip \
tests/one-line \
+ tests/range4 \
+ tests/range6 \
tests/same-twice \
tests/simple \
tests/sorts \
diff --git a/tests/confs/range4 b/tests/confs/range4
new file mode 100644
index 0000000..6540de7
--- /dev/null
+++ b/tests/confs/range4
@@ -0,0 +1,31 @@
+shared-network example1 {
+ subnet 10.0.0.0 netmask 255.255.255.0 {
+ pool {
+ range 10.0.0.0/27;
+ }
+ }
+ subnet 10.1.0.0 netmask 255.255.255.0 {
+ pool {
+ range 10.1.0.1/27;
+ }
+ }
+}
+
+shared-network example2 {
+ subnet 10.2.0.0 netmask 255.255.255.0 {
+ pool {
+ range 10.2.0.1/28;
+ }
+ }
+ subnet 10.3.0.0 netmask 255.255.255.0 {
+ pool {
+ range 10.3.0.1/29;
+ }
+ }
+}
+
+subnet 10.4.0.0 netmask 255.255.255.0 {
+ pool {
+ range 10.4.0.1/32;
+ }
+}
diff --git a/tests/confs/range6 b/tests/confs/range6
new file mode 100644
index 0000000..b15d615
--- /dev/null
+++ b/tests/confs/range6
@@ -0,0 +1,4 @@
+subnet6 dead:abba:1000::/56 {
+ range6 dead:abba:1000::/56;
+ prefix6 dead:abba:1000:0100:: dead:abba:1000:ff00::/56;
+}
diff --git a/tests/expected/range4 b/tests/expected/range4
new file mode 100644
index 0000000..f22e11d
--- /dev/null
+++ b/tests/expected/range4
@@ -0,0 +1,16 @@
+Ranges:
+shared net name first ip last ip max cur percent touch t+c t+c perc
+example1 10.0.0.0 - 10.0.0.31 32 12 37.500 0 12 37.500
+example1 10.1.0.1 - 10.1.0.31 31 10 32.258 0 10 32.258
+example2 10.2.0.1 - 10.2.0.15 15 8 53.333 0 8 53.333
+example2 10.3.0.1 - 10.3.0.7 7 7 100.000 0 7 100.000
+All networks 10.4.0.1 - 10.4.0.1 1 1 100.000 0 1 100.000
+
+Shared networks:
+name max cur percent touch t+c t+c perc
+example1 63 22 34.921 0 22 34.921
+example2 22 15 68.182 0 15 68.182
+
+Sum of all ranges:
+name max cur percent touch t+c t+c perc
+All networks 86 38 44.186 0 38 44.186
diff --git a/tests/expected/range6 b/tests/expected/range6
new file mode 100644
index 0000000..fe06786
--- /dev/null
+++ b/tests/expected/range6
@@ -0,0 +1,10 @@
+Ranges:
+shared net name first ip last ip max cur percent touch t+c t+c perc
+All networks dead:abba:1000:: - dead:abba:1000:ff:ffff:ffff:ffff:ffff 4.72237e+21 2 0.000 1 3 0.000
+
+Shared networks:
+name max cur percent touch t+c t+c perc
+
+Sum of all ranges:
+name max cur percent touch t+c t+c perc
+All networks 4.72237e+21 2 0.000 1 3 0.000
diff --git a/tests/leases/range4 b/tests/leases/range4
new file mode 120000
index 0000000..ceb7cbb
--- /dev/null
+++ b/tests/leases/range4
@@ -0,0 +1 @@
+complete
\ No newline at end of file
diff --git a/tests/leases/range6 b/tests/leases/range6
new file mode 120000
index 0000000..82e3978
--- /dev/null
+++ b/tests/leases/range6
@@ -0,0 +1 @@
+v6
\ No newline at end of file
diff --git a/tests/range4 b/tests/range4
new file mode 120000
index 0000000..61a58b0
--- /dev/null
+++ b/tests/range4
@@ -0,0 +1 @@
+test.sh
\ No newline at end of file
diff --git a/tests/range6 b/tests/range6
new file mode 120000
index 0000000..61a58b0
--- /dev/null
+++ b/tests/range6
@@ -0,0 +1 @@
+test.sh
\ No newline at end of file
From 0c32a67ff1dfa0512536b325d4955129acd01c7f Mon Sep 17 00:00:00 2001
From: Sami Kerola
Date: Sun, 17 Sep 2017 08:33:53 +0100
Subject: [PATCH 044/158] build-sys: update bootstrap from gnulib
Signed-off-by: Sami Kerola
---
bootstrap | 48 +++++++++++++++++++++++++-----------------------
bootstrap.conf | 2 +-
2 files changed, 26 insertions(+), 24 deletions(-)
diff --git a/bootstrap b/bootstrap
index 92dac46..43c8545 100755
--- a/bootstrap
+++ b/bootstrap
@@ -1,10 +1,10 @@
#! /bin/sh
# Print a version string.
-scriptversion=2016-01-24.06; # UTC
+scriptversion=2017-09-13.06; # UTC
# Bootstrap this package from checked-out sources.
-# Copyright (C) 2003-2016 Free Software Foundation, Inc.
+# Copyright (C) 2003-2017 Free Software Foundation, Inc.
# 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
@@ -17,7 +17,7 @@ scriptversion=2016-01-24.06; # UTC
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
-# along with this program. If not, see .
+# along with this program. If not, see .
# Originally written by Paul Eggert. The canonical version of this
# script is maintained as build-aux/bootstrap in gnulib, however, to
@@ -141,7 +141,7 @@ po_download_command_format=\
# Fallback for downloading .po files (if rsync fails).
po_download_command_format2=\
"wget --mirror -nd -q -np -A.po -P '%s' \
- http://translationproject.org/latest/%s/"
+ https://translationproject.org/latest/%s/"
# Prefer a non-empty tarname (4th argument of AC_INIT if given), else
# fall back to the package name (1st argument with munging)
@@ -419,28 +419,30 @@ sort_ver() { # sort -V is not generally available
done
}
+get_version_sed='
+# Move version to start of line.
+s/.*[v ]\([0-9]\)/\1/
+
+# Skip lines that do not start with version.
+/^[0-9]/!d
+
+# Remove characters after the version.
+s/[^.a-z0-9-].*//
+
+# The first component must be digits only.
+s/^\([0-9]*\)[a-z-].*/\1/
+
+#the following essentially does s/5.005/5.5/
+s/\.0*\([1-9]\)/.\1/g
+p
+q'
+
get_version() {
app=$1
$app --version >/dev/null 2>&1 || { $app --version; return 1; }
- $app --version 2>&1 |
- sed -n '# Move version to start of line.
- s/.*[v ]\([0-9]\)/\1/
-
- # Skip lines that do not start with version.
- /^[0-9]/!d
-
- # Remove characters after the version.
- s/[^.a-z0-9-].*//
-
- # The first component must be digits only.
- s/^\([0-9]*\)[a-z-].*/\1/
-
- #the following essentially does s/5.005/5.5/
- s/\.0*\([1-9]\)/.\1/g
- p
- q'
+ $app --version 2>&1 | sed -n "$get_version_sed"
}
check_versions() {
@@ -789,9 +791,9 @@ symlink_to_dir()
# Leave any existing symlink alone, if it already points to the source,
# so that broken build tools that care about symlink times
# aren't confused into doing unnecessary builds. Conversely, if the
- # existing symlink's time stamp is older than the source, make it afresh,
+ # existing symlink's timestamp is older than the source, make it afresh,
# so that broken tools aren't confused into skipping needed builds. See
- # .
+ # .
test -h "$dst" &&
src_ls=$(ls -diL "$src" 2>/dev/null) && set $src_ls && src_i=$1 &&
dst_ls=$(ls -diL "$dst" 2>/dev/null) && set $dst_ls && dst_i=$1 &&
diff --git a/bootstrap.conf b/bootstrap.conf
index 9cddfe4..5647477 100644
--- a/bootstrap.conf
+++ b/bootstrap.conf
@@ -1,6 +1,6 @@
# Bootstrap configuration.
-# Copyright (C) 2006-2012 Free Software Foundation, Inc.
+# Copyright (C) 2006-2017 Free Software Foundation, Inc.
# 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
From 1d47eb9a1cbce1781258cd5f3acf7757aadf3132 Mon Sep 17 00:00:00 2001
From: Sami Kerola
Date: Sun, 17 Sep 2017 08:43:19 +0100
Subject: [PATCH 045/158] docs: update doxygen configuration file
Signed-off-by: Sami Kerola
---
doc/doxy.conf.in | 172 ++++++++++++++++++++++++++++-------------------
1 file changed, 104 insertions(+), 68 deletions(-)
diff --git a/doc/doxy.conf.in b/doc/doxy.conf.in
index d64080e..776809f 100644
--- a/doc/doxy.conf.in
+++ b/doc/doxy.conf.in
@@ -1,4 +1,4 @@
-# Doxyfile 1.8.10
+# Doxyfile 1.8.13
# This file describes the settings to be used by the documentation system
# doxygen (www.doxygen.org) for a project.
@@ -51,7 +51,7 @@ PROJECT_BRIEF = "ISC dhcpd lease usage analyser"
# pixels and the maximum width should not exceed 200 pixels. Doxygen will copy
# the logo to the output directory.
-PROJECT_LOGO =
+PROJECT_LOGO =
# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path
# into which the generated documentation will be written. If a relative path is
@@ -118,7 +118,7 @@ REPEAT_BRIEF = YES
# the entity):The $name class, The $name widget, The $name file, is, provides,
# specifies, contains, represents, a, an and the.
-ABBREVIATE_BRIEF =
+ABBREVIATE_BRIEF =
# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then
# doxygen will generate a detailed section even if there is only a brief
@@ -161,7 +161,7 @@ STRIP_FROM_PATH = src
# specify the list of include paths that are normally passed to the compiler
# using the -I flag.
-STRIP_FROM_INC_PATH =
+STRIP_FROM_INC_PATH =
# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter (but
# less readable) file names. This can be useful is your file systems doesn't
@@ -228,13 +228,13 @@ TAB_SIZE = 4
# "Side Effects:". You can put \n's in the value part of an alias to insert
# newlines.
-ALIASES =
+ALIASES =
# This tag can be used to specify a number of word-keyword mappings (TCL only).
# A mapping has the form "name=value". For example adding "class=itcl::class"
# will allow you to use the command class in the itcl::class meaning.
-TCL_SUBST =
+TCL_SUBST =
# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources
# only. Doxygen will then generate output that is more tailored for C. For
@@ -242,7 +242,7 @@ TCL_SUBST =
# members will be omitted, etc.
# The default value is: NO.
-OPTIMIZE_OUTPUT_FOR_C = NO
+OPTIMIZE_OUTPUT_FOR_C = YES
# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java or
# Python sources only. Doxygen will then generate output that is more tailored
@@ -281,7 +281,7 @@ OPTIMIZE_OUTPUT_VHDL = NO
# Note that for custom extensions you also need to set FILE_PATTERNS otherwise
# the files are not read by doxygen.
-EXTENSION_MAPPING =
+EXTENSION_MAPPING =
# If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments
# according to the Markdown format, which allows for more readable
@@ -293,6 +293,15 @@ EXTENSION_MAPPING =
MARKDOWN_SUPPORT = YES
+# When the TOC_INCLUDE_HEADINGS tag is set to a non-zero value, all headings up
+# to that level are automatically included in the table of contents, even if
+# they do not have an id attribute.
+# Note: This feature currently applies only to Markdown headings.
+# Minimum value: 0, maximum value: 99, default value: 0.
+# This tag requires that the tag MARKDOWN_SUPPORT is set to YES.
+
+TOC_INCLUDE_HEADINGS = 0
+
# When enabled doxygen tries to link words that correspond to documented
# classes, or namespaces to their corresponding documentation. Such a link can
# be prevented in individual cases by putting a % sign in front of the word or
@@ -512,7 +521,7 @@ CASE_SENSE_NAMES = YES
# scope will be hidden.
# The default value is: NO.
-HIDE_SCOPE_NAMES = NO
+HIDE_SCOPE_NAMES = YES
# If the HIDE_COMPOUND_REFERENCE tag is set to NO (default) then doxygen will
# append additional text to a page's title, such as Class Reference. If set to
@@ -629,7 +638,7 @@ GENERATE_DEPRECATEDLIST= YES
# sections, marked by \if ... \endif and \cond
# ... \endcond blocks.
-ENABLED_SECTIONS =
+ENABLED_SECTIONS =
# The MAX_INITIALIZER_LINES tag determines the maximum number of lines that the
# initial value of a variable or macro / define can have for it to appear in the
@@ -671,7 +680,7 @@ SHOW_NAMESPACES = YES
# by doxygen. Whatever the program writes to standard output is used as the file
# version. For an example see the documentation.
-FILE_VERSION_FILTER =
+FILE_VERSION_FILTER =
# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed
# by doxygen. The layout file controls the global structure of the generated
@@ -684,7 +693,7 @@ FILE_VERSION_FILTER =
# DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE
# tag is left empty.
-LAYOUT_FILE =
+LAYOUT_FILE =
# The CITE_BIB_FILES tag can be used to specify one or more bib files containing
# the reference definitions. This must be a list of .bib files. The .bib
@@ -694,7 +703,7 @@ LAYOUT_FILE =
# LATEX_BIB_STYLE. To use this feature you need bibtex and perl available in the
# search path. See also \cite for info how to create references.
-CITE_BIB_FILES =
+CITE_BIB_FILES =
#---------------------------------------------------------------------------
# Configuration options related to warning and progress messages
@@ -739,6 +748,12 @@ WARN_IF_DOC_ERROR = YES
WARN_NO_PARAMDOC = NO
+# If the WARN_AS_ERROR tag is set to YES then doxygen will immediately stop when
+# a warning is encountered.
+# The default value is: NO.
+
+WARN_AS_ERROR = NO
+
# The WARN_FORMAT tag determines the format of the warning messages that doxygen
# can produce. The string should contain the $file, $line, and $text tags, which
# will be replaced by the file and line number from which the warning originated
@@ -753,7 +768,7 @@ WARN_FORMAT = "$file:$line: $text"
# messages should be written. If left blank the output is written to standard
# error (stderr).
-WARN_LOGFILE =
+WARN_LOGFILE =
#---------------------------------------------------------------------------
# Configuration options related to the input files
@@ -787,8 +802,8 @@ INPUT_ENCODING = UTF-8
# If left blank the following patterns are tested:*.c, *.cc, *.cxx, *.cpp,
# *.c++, *.java, *.ii, *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h,
# *.hh, *.hxx, *.hpp, *.h++, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, *.inc,
-# *.m, *.markdown, *.md, *.mm, *.dox, *.py, *.f90, *.f, *.for, *.tcl, *.vhd,
-# *.vhdl, *.ucf, *.qsf, *.as and *.js.
+# *.m, *.markdown, *.md, *.mm, *.dox, *.py, *.pyw, *.f90, *.f95, *.f03, *.f08,
+# *.f, *.for, *.tcl, *.vhd, *.vhdl, *.ucf and *.qsf.
FILE_PATTERNS = *.c \
*.h \
@@ -824,7 +839,7 @@ EXCLUDE_SYMLINKS = NO
# Note that the wildcards are matched against the file with absolute path, so to
# exclude all test directories for example use the pattern */test/*
-EXCLUDE_PATTERNS =
+EXCLUDE_PATTERNS =
# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
# (namespaces, classes, functions, etc.) that should be excluded from the
@@ -835,20 +850,20 @@ EXCLUDE_PATTERNS =
# Note that the wildcards are matched against the file with absolute path, so to
# exclude all test directories use the pattern */test/*
-EXCLUDE_SYMBOLS =
+EXCLUDE_SYMBOLS =
# The EXAMPLE_PATH tag can be used to specify one or more files or directories
# that contain example code fragments that are included (see the \include
# command).
-EXAMPLE_PATH =
+EXAMPLE_PATH =
# If the value of the EXAMPLE_PATH tag contains directories, you can use the
# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and
# *.h) to filter out the source-files in the directories. If left blank all
# files are included.
-EXAMPLE_PATTERNS =
+EXAMPLE_PATTERNS =
# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be
# searched for input files to be used with the \include or \dontinclude commands
@@ -861,7 +876,7 @@ EXAMPLE_RECURSIVE = NO
# that contain images that are to be included in the documentation (see the
# \image command).
-IMAGE_PATH =
+IMAGE_PATH =
# The INPUT_FILTER tag can be used to specify a program that doxygen should
# invoke to filter for each input file. Doxygen will invoke the filter program
@@ -877,8 +892,12 @@ IMAGE_PATH =
# Note that the filter must not add or remove lines; it is applied before the
# code is scanned, but not when the output code is generated. If lines are added
# or removed, the anchors will not be placed correctly.
+#
+# Note that for custom extensions or not directly supported extensions you also
+# need to set EXTENSION_MAPPING for the extension otherwise the files are not
+# properly processed by doxygen.
-INPUT_FILTER =
+INPUT_FILTER =
# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern
# basis. Doxygen will compare the file name with each pattern and apply the
@@ -886,8 +905,12 @@ INPUT_FILTER =
# (like *.cpp=my_cpp_filter). See INPUT_FILTER for further information on how
# filters are used. If the FILTER_PATTERNS tag is empty or if none of the
# patterns match the file name, INPUT_FILTER is applied.
+#
+# Note that for custom extensions or not directly supported extensions you also
+# need to set EXTENSION_MAPPING for the extension otherwise the files are not
+# properly processed by doxygen.
-FILTER_PATTERNS =
+FILTER_PATTERNS =
# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using
# INPUT_FILTER) will also be used to filter the input files that are used for
@@ -910,7 +933,7 @@ FILTER_SOURCE_PATTERNS = *.c \
# (index.html). This can be useful if you have a project on for instance GitHub
# and want to reuse the introduction page also for the doxygen output.
-USE_MDFILE_AS_MAINPAGE =
+USE_MDFILE_AS_MAINPAGE =
#---------------------------------------------------------------------------
# Configuration options related to source browsing
@@ -1022,7 +1045,7 @@ COLS_IN_ALPHA_INDEX = 5
# while generating the index headers.
# This tag requires that the tag ALPHABETICAL_INDEX is set to YES.
-IGNORE_PREFIX =
+IGNORE_PREFIX =
#---------------------------------------------------------------------------
# Configuration options related to the HTML output
@@ -1066,7 +1089,7 @@ HTML_FILE_EXTENSION = .html
# of the possible markers and block names see the documentation.
# This tag requires that the tag GENERATE_HTML is set to YES.
-HTML_HEADER =
+HTML_HEADER =
# The HTML_FOOTER tag can be used to specify a user-defined HTML footer for each
# generated HTML page. If the tag is left blank doxygen will generate a standard
@@ -1076,7 +1099,7 @@ HTML_HEADER =
# that doxygen normally uses.
# This tag requires that the tag GENERATE_HTML is set to YES.
-HTML_FOOTER =
+HTML_FOOTER =
# The HTML_STYLESHEET tag can be used to specify a user-defined cascading style
# sheet that is used by each HTML page. It can be used to fine-tune the look of
@@ -1088,7 +1111,7 @@ HTML_FOOTER =
# obsolete.
# This tag requires that the tag GENERATE_HTML is set to YES.
-HTML_STYLESHEET =
+HTML_STYLESHEET =
# The HTML_EXTRA_STYLESHEET tag can be used to specify additional user-defined
# cascading style sheets that are included after the standard style sheets
@@ -1101,7 +1124,7 @@ HTML_STYLESHEET =
# list). For an example see the documentation.
# This tag requires that the tag GENERATE_HTML is set to YES.
-HTML_EXTRA_STYLESHEET =
+HTML_EXTRA_STYLESHEET =
# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or
# other source files which should be copied to the HTML output directory. Note
@@ -1111,7 +1134,7 @@ HTML_EXTRA_STYLESHEET =
# files will be copied as-is; there are no commands or markers available.
# This tag requires that the tag GENERATE_HTML is set to YES.
-HTML_EXTRA_FILES =
+HTML_EXTRA_FILES =
# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen
# will adjust the colors in the style sheet and background images according to
@@ -1240,7 +1263,7 @@ GENERATE_HTMLHELP = NO
# written to the html output directory.
# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
-CHM_FILE =
+CHM_FILE =
# The HHC_LOCATION tag can be used to specify the location (absolute path
# including file name) of the HTML help compiler (hhc.exe). If non-empty,
@@ -1248,7 +1271,7 @@ CHM_FILE =
# The file has to be specified with full path.
# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
-HHC_LOCATION =
+HHC_LOCATION =
# The GENERATE_CHI flag controls if a separate .chi index file is generated
# (YES) or that it should be included in the master .chm file (NO).
@@ -1261,7 +1284,7 @@ GENERATE_CHI = NO
# and project file content.
# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
-CHM_INDEX_ENCODING =
+CHM_INDEX_ENCODING =
# The BINARY_TOC flag controls whether a binary table of contents is generated
# (YES) or a normal table of contents (NO) in the .chm file. Furthermore it
@@ -1292,7 +1315,7 @@ GENERATE_QHP = NO
# the HTML output folder.
# This tag requires that the tag GENERATE_QHP is set to YES.
-QCH_FILE =
+QCH_FILE =
# The QHP_NAMESPACE tag specifies the namespace to use when generating Qt Help
# Project output. For more information please see Qt Help Project / Namespace
@@ -1317,7 +1340,7 @@ QHP_VIRTUAL_FOLDER = doc
# filters).
# This tag requires that the tag GENERATE_QHP is set to YES.
-QHP_CUST_FILTER_NAME =
+QHP_CUST_FILTER_NAME =
# The QHP_CUST_FILTER_ATTRS tag specifies the list of the attributes of the
# custom filter to add. For more information please see Qt Help Project / Custom
@@ -1325,21 +1348,21 @@ QHP_CUST_FILTER_NAME =
# filters).
# This tag requires that the tag GENERATE_QHP is set to YES.
-QHP_CUST_FILTER_ATTRS =
+QHP_CUST_FILTER_ATTRS =
# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this
# project's filter section matches. Qt Help Project / Filter Attributes (see:
# http://qt-project.org/doc/qt-4.8/qthelpproject.html#filter-attributes).
# This tag requires that the tag GENERATE_QHP is set to YES.
-QHP_SECT_FILTER_ATTRS =
+QHP_SECT_FILTER_ATTRS =
# The QHG_LOCATION tag can be used to specify the location of Qt's
# qhelpgenerator. If non-empty doxygen will try to run qhelpgenerator on the
# generated .qhp file.
# This tag requires that the tag GENERATE_QHP is set to YES.
-QHG_LOCATION =
+QHG_LOCATION =
# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files will be
# generated, together with the HTML files, they form an Eclipse help plugin. To
@@ -1472,7 +1495,7 @@ MATHJAX_RELPATH = http://cdn.mathjax.org/mathjax/latest
# MATHJAX_EXTENSIONS = TeX/AMSmath TeX/AMSsymbols
# This tag requires that the tag USE_MATHJAX is set to YES.
-MATHJAX_EXTENSIONS =
+MATHJAX_EXTENSIONS =
# The MATHJAX_CODEFILE tag can be used to specify a file with javascript pieces
# of code that will be used on startup of the MathJax code. See the MathJax site
@@ -1480,7 +1503,7 @@ MATHJAX_EXTENSIONS =
# example see the documentation.
# This tag requires that the tag USE_MATHJAX is set to YES.
-MATHJAX_CODEFILE =
+MATHJAX_CODEFILE =
# When the SEARCHENGINE tag is enabled doxygen will generate a search box for
# the HTML output. The underlying search engine uses javascript and DHTML and
@@ -1540,7 +1563,7 @@ EXTERNAL_SEARCH = NO
# Searching" for details.
# This tag requires that the tag SEARCHENGINE is set to YES.
-SEARCHENGINE_URL =
+SEARCHENGINE_URL =
# When SERVER_BASED_SEARCH and EXTERNAL_SEARCH are both enabled the unindexed
# search data is written to a file for indexing by an external tool. With the
@@ -1556,7 +1579,7 @@ SEARCHDATA_FILE = searchdata.xml
# projects and redirect the results back to the right project.
# This tag requires that the tag SEARCHENGINE is set to YES.
-EXTERNAL_SEARCH_ID =
+EXTERNAL_SEARCH_ID =
# The EXTRA_SEARCH_MAPPINGS tag can be used to enable searching through doxygen
# projects other than the one defined by this configuration file, but that are
@@ -1566,7 +1589,7 @@ EXTERNAL_SEARCH_ID =
# EXTRA_SEARCH_MAPPINGS = tagname1=loc1 tagname2=loc2 ...
# This tag requires that the tag SEARCHENGINE is set to YES.
-EXTRA_SEARCH_MAPPINGS =
+EXTRA_SEARCH_MAPPINGS =
#---------------------------------------------------------------------------
# Configuration options related to the LaTeX output
@@ -1630,7 +1653,7 @@ PAPER_TYPE = a4
# If left blank no extra packages will be included.
# This tag requires that the tag GENERATE_LATEX is set to YES.
-EXTRA_PACKAGES =
+EXTRA_PACKAGES =
# The LATEX_HEADER tag can be used to specify a personal LaTeX header for the
# generated LaTeX document. The header should contain everything until the first
@@ -1646,7 +1669,7 @@ EXTRA_PACKAGES =
# to HTML_HEADER.
# This tag requires that the tag GENERATE_LATEX is set to YES.
-LATEX_HEADER =
+LATEX_HEADER =
# The LATEX_FOOTER tag can be used to specify a personal LaTeX footer for the
# generated LaTeX document. The footer should contain everything after the last
@@ -1657,7 +1680,7 @@ LATEX_HEADER =
# Note: Only use a user-defined footer if you know what you are doing!
# This tag requires that the tag GENERATE_LATEX is set to YES.
-LATEX_FOOTER =
+LATEX_FOOTER =
# The LATEX_EXTRA_STYLESHEET tag can be used to specify additional user-defined
# LaTeX style sheets that are included after the standard style sheets created
@@ -1668,7 +1691,7 @@ LATEX_FOOTER =
# list).
# This tag requires that the tag GENERATE_LATEX is set to YES.
-LATEX_EXTRA_STYLESHEET =
+LATEX_EXTRA_STYLESHEET =
# The LATEX_EXTRA_FILES tag can be used to specify one or more extra images or
# other source files which should be copied to the LATEX_OUTPUT output
@@ -1676,7 +1699,7 @@ LATEX_EXTRA_STYLESHEET =
# markers available.
# This tag requires that the tag GENERATE_LATEX is set to YES.
-LATEX_EXTRA_FILES =
+LATEX_EXTRA_FILES =
# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated is
# prepared for conversion to PDF (using ps2pdf or pdflatex). The PDF file will
@@ -1729,6 +1752,14 @@ LATEX_SOURCE_CODE = NO
LATEX_BIB_STYLE = plain
+# If the LATEX_TIMESTAMP tag is set to YES then the footer of each generated
+# page will contain the date and time when the page was generated. Setting this
+# to NO can help when comparing the output of multiple runs.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+LATEX_TIMESTAMP = NO
+
#---------------------------------------------------------------------------
# Configuration options related to the RTF output
#---------------------------------------------------------------------------
@@ -1776,14 +1807,14 @@ RTF_HYPERLINKS = NO
# default style sheet that doxygen normally uses.
# This tag requires that the tag GENERATE_RTF is set to YES.
-RTF_STYLESHEET_FILE =
+RTF_STYLESHEET_FILE =
# Set optional variables used in the generation of an RTF document. Syntax is
# similar to doxygen's config file. A template extensions file can be generated
# using doxygen -e rtf extensionFile.
# This tag requires that the tag GENERATE_RTF is set to YES.
-RTF_EXTENSIONS_FILE =
+RTF_EXTENSIONS_FILE =
# If the RTF_SOURCE_CODE tag is set to YES then doxygen will include source code
# with syntax highlighting in the RTF output.
@@ -1828,7 +1859,7 @@ MAN_EXTENSION = .3
# MAN_EXTENSION with the initial . removed.
# This tag requires that the tag GENERATE_MAN is set to YES.
-MAN_SUBDIR =
+MAN_SUBDIR =
# If the MAN_LINKS tag is set to YES and doxygen generates man output, then it
# will generate one additional man file for each entity documented in the real
@@ -1941,7 +1972,7 @@ PERLMOD_PRETTY = YES
# overwrite each other's variables.
# This tag requires that the tag GENERATE_PERLMOD is set to YES.
-PERLMOD_MAKEVAR_PREFIX =
+PERLMOD_MAKEVAR_PREFIX =
#---------------------------------------------------------------------------
# Configuration options related to the preprocessor
@@ -1982,7 +2013,7 @@ SEARCH_INCLUDES = YES
# preprocessor.
# This tag requires that the tag SEARCH_INCLUDES is set to YES.
-INCLUDE_PATH =
+INCLUDE_PATH =
# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
# patterns (like *.h and *.hpp) to filter out the header-files in the
@@ -1990,7 +2021,7 @@ INCLUDE_PATH =
# used.
# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
-INCLUDE_FILE_PATTERNS =
+INCLUDE_FILE_PATTERNS =
# The PREDEFINED tag can be used to specify one or more macro names that are
# defined before the preprocessor is started (similar to the -D option of e.g.
@@ -2000,7 +2031,7 @@ INCLUDE_FILE_PATTERNS =
# recursively expanded use the := operator instead of the = operator.
# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
-PREDEFINED =
+PREDEFINED =
# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this
# tag can be used to specify a list of macro names that should be expanded. The
@@ -2009,7 +2040,7 @@ PREDEFINED =
# definition found in the source code.
# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
-EXPAND_AS_DEFINED =
+EXPAND_AS_DEFINED =
# If the SKIP_FUNCTION_MACROS tag is set to YES then doxygen's preprocessor will
# remove all references to function-like macros that are alone on a line, have
@@ -2038,13 +2069,13 @@ SKIP_FUNCTION_MACROS = YES
# the path). If a tag file is not located in the directory in which doxygen is
# run, you must also specify the path to the tagfile here.
-TAGFILES =
+TAGFILES =
# When a file name is specified after GENERATE_TAGFILE, doxygen will create a
# tag file that is based on the input files it reads. See section "Linking to
# external documentation" for more information about the usage of tag files.
-GENERATE_TAGFILE =
+GENERATE_TAGFILE =
# If the ALLEXTERNALS tag is set to YES, all external class will be listed in
# the class index. If set to NO, only the inherited external classes will be
@@ -2084,7 +2115,7 @@ PERL_PATH = /usr/bin/perl
# powerful graphs.
# The default value is: YES.
-CLASS_DIAGRAMS = YES
+CLASS_DIAGRAMS = NO
# You can define message sequence charts within doxygen comments using the \msc
# command. Doxygen will then run the mscgen tool (see:
@@ -2093,14 +2124,14 @@ CLASS_DIAGRAMS = YES
# the mscgen tool resides. If left empty the tool is assumed to be found in the
# default search path.
-MSCGEN_PATH =
+MSCGEN_PATH =
# You can include diagrams made with dia in doxygen documentation. Doxygen will
# then run dia to produce the diagram and insert it in the documentation. The
# DIA_PATH tag allows you to specify the directory where the dia binary resides.
# If left empty dia is assumed to be found in the default search path.
-DIA_PATH =
+DIA_PATH =
# If set to YES the inheritance and collaboration graphs will hide inheritance
# and usage relations if the target is undocumented or is not a class.
@@ -2149,7 +2180,7 @@ DOT_FONTSIZE = 10
# the path where dot can find it using this tag.
# This tag requires that the tag HAVE_DOT is set to YES.
-DOT_FONTPATH =
+DOT_FONTPATH =
# If the CLASS_GRAPH tag is set to YES then doxygen will generate a graph for
# each documented class showing the direct and indirect inheritance relations.
@@ -2293,26 +2324,26 @@ INTERACTIVE_SVG = NO
# found. If left blank, it is assumed the dot tool can be found in the path.
# This tag requires that the tag HAVE_DOT is set to YES.
-DOT_PATH =
+DOT_PATH =
# The DOTFILE_DIRS tag can be used to specify one or more directories that
# contain dot files that are included in the documentation (see the \dotfile
# command).
# This tag requires that the tag HAVE_DOT is set to YES.
-DOTFILE_DIRS =
+DOTFILE_DIRS =
# The MSCFILE_DIRS tag can be used to specify one or more directories that
# contain msc files that are included in the documentation (see the \mscfile
# command).
-MSCFILE_DIRS =
+MSCFILE_DIRS =
# The DIAFILE_DIRS tag can be used to specify one or more directories that
# contain dia files that are included in the documentation (see the \diafile
# command).
-DIAFILE_DIRS =
+DIAFILE_DIRS =
# When using plantuml, the PLANTUML_JAR_PATH tag should be used to specify the
# path where java can find the plantuml.jar file. If left blank, it is assumed
@@ -2320,12 +2351,17 @@ DIAFILE_DIRS =
# generate a warning when it encounters a \startuml command in this case and
# will not generate output for the diagram.
-PLANTUML_JAR_PATH =
+PLANTUML_JAR_PATH =
+
+# When using plantuml, the PLANTUML_CFG_FILE tag can be used to specify a
+# configuration file for plantuml.
+
+PLANTUML_CFG_FILE =
# When using plantuml, the specified paths are searched for files specified by
# the !include statement in a plantuml block.
-PLANTUML_INCLUDE_PATH =
+PLANTUML_INCLUDE_PATH =
# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of nodes
# that will be shown in the graph. If the number of nodes in a graph becomes
From fefd8d26cf92b5686d759da41ffd15119b8a98dd Mon Sep 17 00:00:00 2001
From: Sami Kerola
Date: Sun, 17 Sep 2017 09:00:25 +0100
Subject: [PATCH 046/158] docs: tell what needs to be done when releasing new
version
Signed-off-by: Sami Kerola
---
TODO | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/TODO b/TODO
index fa08675..ebc6e9b 100644
--- a/TODO
+++ b/TODO
@@ -14,3 +14,16 @@ o When time stamps are part of lease situation evaluation (see
bug 1) add a --now switch which will one can use to change when
expiry happens.
o Add lease time histogram support.
+
+### When releasing
+
+o Update gnulib
+o Update bootstrap
+o Make annotated git tag
+o ./configure --enable-doxygen && make distcheck
+o gpg --armor --detach-sign dhcpd-pools*tar*
+o Upload files to sourceforge
+o mv doc/html webpages/doxygen
+o PAGER=cat man -H ./man/dhcpd-pools.1 | tee ./webpages/man.html
+o Update webpages/index.html dateModified & version (remove old doxygen before uploading new)
+o Send email to dhcpd-pools-announce@lists.sourceforge.net subject: Version 2.nn is released
From af1ae9411236aa6454d3086311149261c60f07f5 Mon Sep 17 00:00:00 2001
From: Sami Kerola
Date: Sun, 17 Sep 2017 09:17:15 +0100
Subject: [PATCH 047/158] docs: add build instruction link to the project web
page
Signed-off-by: Sami Kerola
---
webpages/index.html | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/webpages/index.html b/webpages/index.html
index 5e9f398..e3d5864 100644
--- a/webpages/index.html
+++ b/webpages/index.html
@@ -54,7 +54,10 @@ prompt> cat ./s