Commit graph

445 commits

Author SHA1 Message Date
Sami Kerola
c305e2f82c
tests: add range definition flip test
This test ensure 10b06d88f0 will not get
regression in future.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2016-02-18 23:05:24 +00:00
Sami Kerola
10b06d88f0
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 <mgfnv9@gmail.com>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2016-02-18 22:35:56 +00:00
Sami Kerola
3d0c510475
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 <kerolasa@iki.fi>
2015-12-29 21:52:48 +00:00
Sami Kerola
46641751b4
webpages: make index page mobile device friendly
Use css max-width instead of width this permits narrow screen to wrap lines,
this makes the index page more usable when browsing with a mobile phone or
some other device with limited horizontal dimension.  Also get rid of <pre>
tag, and make the sample usage more realistic.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-12-29 21:29:32 +00:00
Sami Kerola
d717a043bf
use long options in .indent.pro file
Short options are impossible to understand without looking to manual page.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-12-10 22:42:54 +00:00
Sami Kerola
03b1edb188
add sitemap url to robots.txt file
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-12-07 10:55:45 +00:00
Sami Kerola
1dcf762967
add dhcpd-pools website content to a subdirectory
Start using git to backup of the website content.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-12-07 10:32:02 +00:00
Sami Kerola
17f1fb7f5e
tell in README when ./bootstrap is needed
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-12-06 19:08:08 +00:00
Sami Kerola
4cd85b62ff
release: 2.28
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-12-06 17:48:56 +00:00
Sami Kerola
ace697b472
fix out of tree build tests
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-12-06 17:44:30 +00:00
Sami Kerola
1a7d982495
change NAN markup to make tests work on mac
For some unknown reason mac osx does not change NAN to negative in printout
when asking to do so.  To get rid of false positive test results change the
sign of NAN to positive, that may break something for someone if there are
people expecting -NAN when devision with zero happens.  But that sort of
breakage is pretty unlikely because it requires broken dhcpd.conf.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-12-06 11:46:07 +00:00
Sami Kerola
01aa13cf43
test all sorting options
Not perfect test, but atleast something.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-12-05 19:51:53 +00:00
Sami Kerola
da4b7a783a
add --warn-count and --crit-count test, and fix related bug
I should consider writing tests before features.  Sadly recently added new
options did not even work.  Oh well, at least I did not release them before
noticing this.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-12-05 19:38:08 +00:00
Sami Kerola
15802d6648
unify quotation in error messages
Use quote() from gnulib to do this.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-12-05 19:00:32 +00:00
Sami Kerola
d6486e7730
make usage() easier to read
None-continuous print out blocks are difficult.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-12-05 18:59:40 +00:00
Sami Kerola
bd45266f74
drop a core when bug condition happens
Having a core will help enormously debugging these issues.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-12-05 18:50:28 +00:00
Sami Kerola
8fca82f148
print include system error message when output fails
Users want to know why write fail - was it because disk full, or destination
read-only, or IO error, and so on.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-12-04 20:35:35 +00:00
Sami Kerola
f5cd7383e4
fix improve variable names
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-12-04 19:32:50 +00:00
Sami Kerola
49835cccb5
fix doxygen build
And .gitignore doxygen related outputs.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-12-03 21:35:13 +00:00
Sami Kerola
98bcdf9378
simplify output format selection, and passing
Use of enum is a lot more readable than passing strings, and comparing
characters, around.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-12-01 23:25:54 +00:00
Sami Kerola
b524296016
use bitmap for booleans and other config that has known size
Bitmaps are more c style than bool coming from c++ land.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-12-01 23:24:14 +00:00
Sami Kerola
5ed9958b69
fix protocol specifier in html output
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-12-01 21:58:52 +00:00
Sami Kerola
0369340710
remove upper limit of sort order definitions
Unlikely to be needed by anyone, but because arbitrary limits are from code
style point of view ugly.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-11-30 00:50:18 +00:00
Sami Kerola
327691f34a
use more descriptive names in limit bits enum definition
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-11-29 23:36:19 +00:00
Sami Kerola
4aff49ed80
correct return value FIXME items
Not all markups were quite right.  The output_* functions must return an
int.  The rest were as a matter of fact correct.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-11-28 21:03:38 +00:00
Sami Kerola
f11ca0bec2
fix typo in README
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-11-28 20:51:18 +00:00
Sami Kerola
1299737d76
make html output to use Bootstrap and DataTables
This make the table output good looking, and allows users to click table
headings to sort data by column without rerunning the analysis.
Unfortunately this change is breaking change, meaning the old CSS tags are
no longer supported, nor partial html output that printed only the table.

Proposed-by: Aaron Paetznick <aaronp@critd.com>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-11-28 20:37:23 +00:00
Sami Kerola
c7917152d3
improve README file instructions
Proposed-by: Derrick Lin <d.lin@garvan.org.au>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-11-28 11:22:28 +00:00
Sami Kerola
5cede1ff31
add --warn-count and --crit-count options to suppress alarm noise
Alarm criteria based solely on percentage was found to be difficult to be
tricky to setup in environments that has small ranges and big shared-nets
mixed up together.  These two new options should help making alarming more
useful.

Requested-by: Frank Bulk <fbulk@mypremieronline.com>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-11-28 00:33:12 +00:00
Sami Kerola
7f3d553c7f
add --snet-alarms option to suppress excess range alarms
Some users may not want to have alarms about ranges that are part of a
shared-network, so allow them to suppress such.

Requested-by: Frank Bulk <fbulk@mypremieronline.com>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-11-27 23:42:23 +00:00
Sami Kerola
99b6af70ef
update doxygen.conf file
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-11-25 22:02:41 +00:00
Sami Kerola
2528c4c9d6
make binary exec path dynamic in scripts referring to it
Everything should just work out of the box without poking.  This change
makes that goal to be yet agian one step closer.  In same go make all
autotools related variable substitutions better.

Requested-by: Martijn van Brummelen <martijn@brumit.nl>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-11-25 21:53:29 +00:00
Sami Kerola
c30c122027
fix couple compiler warnings
src/getdata.c:248:22: warning: 'range_p' may be used uninitialized in this
function [-Wmaybe-uninitialized]
src/other.c:383:1: warning: control reaches end of non-void function
[-Wreturn-type]

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-10-26 22:43:31 +00:00
Sami Kerola
535dfc4fc2
portability: Solaris 10 does not have err.h
Use error(3) function, that has gnulib portability fixes, instead of err(3)
and warn(3) family.

Reported-by: Anton Tkachev <antont@bk.ru>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-10-26 22:29:32 +00:00
Sami Kerola
fae20302cf release: 2.27
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-09-05 13:35:44 +01:00
Sami Kerola
167c4b6989 gitignore: update gnulib file list
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-09-05 13:34:41 +01:00
Sami Kerola
d8aef85d01 man: fix character class change
Debian package lint found going back to roman mode was broken.

Reported-by: Martijn van Brummelen <martijn@brumit.nl>
Signed-off-by: Sami Kerola <kerolasa@cloudflare.com>
2015-09-05 13:15:19 +01:00
Sami Kerola
cf26e17fe7 add hint about configure options to README
Proposed-by: Tim Cantin <tcantin@wellesley.edu>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-05-29 09:18:08 +01:00
Sami Kerola
9d1241c006 improve html output
Remove unnecessary html indentation, so that there is less page content
to transfer.  Right align the network names, and IP's so that they are
easier to read.  And ensure quoting is done correctly.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-05-02 19:40:06 +01:00
Sami Kerola
c4e5ef6198 add xml format check
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-05-02 18:51:39 +01:00
Sami Kerola
0d6c61d437 add touched addresses counts to xml and json reports
For some reason missing information has been overlooked for years.
Perhaps there is aren't that many users who are interested of the touched
addresses.

Proposed-by: Aaron Paetznick <aaronp@critd.com>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-05-02 18:48:52 +01:00
Sami Kerola
73b357484d output: remove empty element from xml
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-05-02 18:00:10 +01:00
Sami Kerola
735c5db817 docs: remove todo items that will never happen
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-04-01 23:15:38 +01:00
Sami Kerola
34dd1dee6e docs: remove very basic git usage info
This is not a git beginner manual project.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-04-01 23:11:28 +01:00
Sami Kerola
c7379e3e25 release: 2.26
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-11-15 10:03:41 +00:00
Sami Kerola
cfbd69c20b maint: remove unnecessary braces, spaces, update gnulib .gitignore
Improve code readability, and small maintenance.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-11-15 09:44:28 +00:00
Sami Kerola
33894fba74 other: disallow unsigned counter ever to have minus value
src/other.c:398:4: runtime error: unsigned integer overflow: 0 - 1 cannot
be represented in type 'unsigned int'

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-11-14 21:57:21 +00:00
Sami Kerola
8e076fcc4f output: avoid division by zero
This correction makes the shared networks alarming to work when all
available leases are used.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-11-14 21:54:27 +00:00
Sami Kerola
0705b0c17f tests: add regression test to avoid shared-net off by one alarming issue
This tests ensures the problem fixed by Wolfgang Steudel cannot reoccur.
See the reference commit for details.

Reference: 5519763ba9
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-11-14 20:13:08 +00:00
Wolfgang Steudel
5519763ba9 alarming: include last shared network in alarming [off by one]
We have defined some shared networks with a couple of address ranges
and wanted to monitor the availability of free IP addresses in the
shared networks.  We were wondering why in some cases there was no
warning, although one shared network's usage was above the threshold.

We found the reason.  In output_alarming() the code was not skipping
"All networks", but missing the last shared network in the list.
Moving "shared_p++" to the beginning of the loop seems to solve the
bug.

Reviewed-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Wolfgang Steudel <wolfgang.steudel@tu-ilmenau.de>
2014-11-14 19:41:21 +00:00