Add error condition checks. Add lease file binding states. Check all
output formats. Check leases file that is in mad order, cse all sorting
methods when checking this. Use json output to check status classfications.
Add cidr range checks. Add conf include and comment parsing input checks.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
When making --skip to take arguments ignored was for moment a work name for
'suppressed' state, and that was accidentally left to usage() output.
Reference: 3369278fc0
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
This is a bug. The xstrstr_init initialized wrong IP version functions when
this function was the first to run and set function pointers.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Use iso time stamp in both mustach and html outputs. Effectively this is a
removal of libc langinfo D_T_FMT format, that pulled a lot of gnulib stuff
to project almost unnecessarily.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Base level printing; localstime, number of ranges and shared networks,
project version, and file paths and time stamps.
Also print error and stop template processing when unknown tag is
encountered.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Earlier main() had lots of temporary variables related to command line
parsing. By moving these to separate function runtime can forget these
variables when moving on. If nothing else this makes running gdb nicer when
debugging crashes, but as said stack memory should also be spared for better
purpose.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
src/sort.c:255:5: warning: no previous prototype for 'merge'
src/sort.c:290:2: warning: ISO C90 forbids mixed declarations and code
src/mustach-dhcpd-pools.c:67:5: warning: no previous prototype for 'must_put_err'
src/output.c:109:26: warning: comparing floating point with == or != is unsafe (x5)
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Update DataTables and Bootstrap versions. Add free IP counts to table.
Replace yellow as warning with magenta that is easier to read from white
background. Use italic and bold to emphasis warning and critical. Remove
strips. Use ascent percent sort by default.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
This way memory is allocated only for items that are in use, and walking
through shared network items is also more straightforward.
As an unfortunate side effect in --perfdata output shared networks are no
longer printed in reverse order. This should be a cosmetic issue.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Following error did not inform clearly what is wrong.
$ ./dhcpd-pools -l samples/dhcpd.leases -c samples/dhcpd.conf -fm
./dhcpd-pools: must_read_template: open: (null): Bad address
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
This also fixes backup state counts that were added to shared networks
twice, making the numbers to be much greater than they really where.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Earlier variables magically appeared to scope of functions that took void as
argument. One could figure out perhaps they were globals, but programs that
do that are unnessarily hard to follow.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
This function deals situation when mustach put happens before enter, that is
a sign of an invalid input template. Good side of adding this function is
that dhcpd-pools does not need to modify code provided by Jose.
Reference: 66183bc7c7
Proposed-by: José Bollo <jobol@nonadev.net>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Off by one that is caused by must_next_range() advancing pointer, and moving
over the first range. Fix by setting indexes one step backwards, that is
not excellent but better than copying skip_ok stuff to must_enter().
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Fix issues found with afl-fuzz. It is a pity I had to change mustach.c it
is no longer exactly the same as upstream. Lets see if Jose will accept
these changes.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Based on José Bollo's mustache C implementation. This adaptation uses
project specific data structures to avoid overhead with json parsing.
Reference: https://gitlab.com/jobol/mustach.git
Commit: d84608a69033d38c81b8fcff0cb272e225dd5428
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Earlier commit started to use range_output_helper() in output_xml() so
remove the unnecessary calls to get_range_size().
Reference: c55c823753
Signed-off-by: Sami Kerola <kerolasa@iki.fi>