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>
The code selection will be set with function pointer, which avoids
numerous IP version checks. As a result with some inputs the analysis
runs quicker. Most users will not notice much of difference.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Some systems, such as freebsd, does not have program_invocation_short_name
available. There are also problems finding AF_INET{,6} definitions.
CC: Peter Fraser <p_fraser@hotmail.com>
Reported-by: Ryan Steinmetz <zi@freebsd.org>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
No other function than mergesort_ranges() can use the merge(), so calling
it with rather generic name and making it static seems right to me.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
When ./configure --enable-doxygen is used one can browse internal api
documentation from docs/html directory.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
The DHCP version is determined according to the first IP address that
appears in the configuration file. Caveat; counters are of native long
type. Since IPv6 address space has 2^128 addresses, they are subject to
overflow.
[Sami Kerola: This commit also fixed a percent sorting bug, which has
been broken always. See changes ret_percent() for the fix.]
CC: LI Zimu <lzm@cernet.edu.cn>
CC: Xing Li <xing@cernet.edu.cn>
Reviewed-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Cheer Xiao <xiaqqaix@gmail.com>
Remove unnecessary type casting, move .gitignore file contents to
right location, reindent to use Linux coding style, fix few type
mismatches, clean up to help & version output and hint compiler
call to these functions will end program.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
After uint32_t fix from 1e82461875
it was good idea to check which headers where needed where. And
generally clean up the includes while doing the check.
There where long and unsigned long used for IPs in use which
caused occasional off by one errors. The word occasional should
be read: pretty much every one with large enough configuration
has been affected.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Usage of includes are set up the way found to be in use, with a help of
magnificent utility.
http://code.google.com/p/include-what-you-use/
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
This is a test fix after commit
5cbe8d07fb
to see what can be done. Truth is that not much. I could fix how
ranges are allocated, but the fact there is pointers to shared
networks and network names reallocating the memory spaces is not
really going to work. The only way to truly fix this issue is to
create better data structures. As you can expect that is a major
change, and will take some time to implement.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
The eprintf removed and replaced with err & warn. Option parsing
no longer tries to find missing optargs, which are getopts should
notice. Few complier warnings got to be removed as well. Finally
the commments will no longer exceed standard terminal width.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>