Commit graph

29 commits

Author SHA1 Message Date
Sami Kerola
3be3f34bd4 build-sys: allow tests run parallel
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2013-01-15 17:27:50 +00:00
Sami Kerola
3471c91796 docs: add doxygen tags, configuration file, and autotooling
When ./configure --enable-doxygen is used one can browse internal api
documentation from docs/html directory.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2012-12-09 21:06:32 +00:00
Sami Kerola
d34259092d build-sys: more clean ups
The gnulib will set AC_GNU_SOURCE equivivelant if necessary.  The awk is
relevant only for contrib stuff, and compiler program was something I had
not understood quite right some years ago when I added it.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2012-12-04 22:08:15 +00:00
Sami Kerola
71bcee14e9 tests: add basic tests
The tests can be ran using 'make check'.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2012-11-29 21:02:40 +00:00
Sami Kerola
761c9560d7 build-sys: remove c++ compiler check
I have no idea why that was there.  My guess is that I had no idea at the
time I added the line what it does.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2012-11-28 19:48:10 +00:00
Sami Kerola
9df90042e2 build-sys: make alarm warning & critical default configurable
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2012-11-25 18:03:19 +00:00
Sami Kerola
7e403b50b4 build-sys: clean up configure.ac
Remove checks that are done in gnulib, and reindent autotools code.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2012-11-25 18:03:19 +00:00
Sami Kerola
c48a8d411f man: use configured dhcpd.conf and dhcpd.leases paths
Making dhcpd.conf and dhcpd.leases file references being dynamic causes
manual contents being replaced at compile time, so make some other data
items dynamic as well.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2012-11-25 18:03:13 +00:00
Sami Kerola
acba2e265e (un)likely: use __builtin_expect to inform expected path
Remove also unnecessary comparison in getdata nth_field().

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2012-11-12 19:19:01 +00:00
Sami Kerola
dbf3927c39 build-sys: clean gnulib & autotools checks
Add gnulib modules which make sense and remove few.  The stuff gnulib
takes care can be dropped from configure.am.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2012-11-05 20:30:53 +00:00
Sami Kerola
ab699e71ad build-sys: add gnulib
This will mean better portability, and a good reason to get rid of
various portability autotools directives which where part of this
project.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2012-11-05 00:03:03 +00:00
Sami Kerola
7eb2e42625 build-sys: be conservative about posix_fadvice
Check that function availability before use.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2012-10-09 21:52:19 +01:00
Sami Kerola
14d7183c3d build-sys: add what autoscan found bein missing
configure.ac: warning: missing AC_CHECK_FUNCS([atexit]) wanted by: src/dhcpd-pools.c:88
configure.ac: warning: missing AC_CHECK_HEADERS([limits.h]) wanted by: src/dhcpd-pools.c:55
configure.ac: warning: missing AC_FUNC_ERROR_AT_LINE wanted by: src/other.c:213
configure.ac: warning: missing AC_FUNC_STRTOD wanted by: src/other.c:148

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2012-10-09 21:31:43 +01:00
Sami Kerola
37563d8d59 build-sys: create only xz compressed distribution package
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2012-06-26 10:10:40 +02:00
Sami Kerola
3c9226752b build-sys: add --with-uthash=DIR ./configure option
Allow program builder to specify where uthash.h is.

Proposed-by: Ryan Steinmetz <zi@freebsd.org>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2012-05-06 22:09:49 +02:00
Ryan Steinmetz
1c40d8ac1e build-sys: make build work under FreeBSD
Signed-off-by: Ryan Steinmetz <zi@freebsd.org>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2012-05-06 20:53:20 +02:00
Enno Gröper
ae7747db87 analyse: critical bug in the counting code
The problem is, that you simply count all lease occurrences in
dhcpd.leases, but only the last ones for each ip address are
valid.  The lease file is more like a logfile of what has been
done, than a real database.  To fix the counting issue, I'm using
a single hash (from uthash.h [1]) for the counting.  This way
only the last lease entry for each IP gets into my counting
structure.

When you remove the duplicates in prepare_data(), you don't have
the information anymore, if the active lease entry or the free
lease entry came last.  Simply deleting each ip from the touches
array, that is already in the leases array, gives you a big
chance to count wrong.  Another way of fixing this would be to
not only store the ips in your arrays, but a structure containing
the ip and a global lease entry counter.  Then you could delete
all entries except for the latest.

[1] http://uthash.sourceforge.net/

Reported-by: Huangy
Signed-off-by: Enno Gröper <groepeen@cms.hu-berlin.de>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2012-05-02 19:57:45 +02:00
Sami Kerola
6b47d9ffaf all files: use restrict key word for all pointer arguments
Limit the effects of pointer aliasing and aiding caching
optimizations.

http://cellperformance.beyond3d.com/articles/2006/05/demystifying-the-restrict-keyword.html

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-10-23 22:40:10 +02:00
Sami Kerola
704e0fdd4a build-sys: autotools configure.ac update
Add recent changes to autotools header, function and compiler
capability checks. The patch also adds to .gitignore autoscan
outputs.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-07-08 22:58:38 +02:00
Sami Kerola
a31fd0d97a licensing: use FreeBSD license (was GNUv3)
This change will also remove getopt source code and headers,
which has GNU license that I cannot change.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-06-21 22:54:03 +02:00
Sami Kerola
66bfc0d5b2 build-sys: use git version as program version output
The functionality copied is from gnulib.

http://git.savannah.gnu.org/gitweb/?p=gnulib.git;a=blob;f=build-aux/git-version-gen;h=686f7031a6037445bfcb7b43fb4da3c8240d8575;hb=HEAD

Signed-off-by: Sami Kerola <sami.kerola@tomtom.com>
2011-03-31 14:44:42 +02:00
Sami Kerola
d54721b3a4 dhcpd-pools.h: portable program_invocation_short_name
The program_invocation_short_name portability code is copied
from util-linux project almost as is.

Reported-by: Roar Pettersen <rope1968@gmail.com>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-03-23 22:26:57 +01:00
Sami Kerola
b11163012e autotools: point correct location of src
Fix to error where program src is. Also a bit of clean up and
alignment with autoscan output.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-03-19 12:14:52 +01:00
Sami Kerola
8544983585 Release 2.14
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-03-07 22:26:32 +01:00
Sami Kerola
0f7beafd81 configure.ac: autoscan updates
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-02-13 13:24:06 +01:00
Sami Kerola
849c8f5e73 Use what libc will provide
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>
2011-01-22 20:53:15 +01:00
Sami Kerola
e6c32dbdf9 Automake 2.64 is needed.
This is due AC_PACKAGE_URL that is used in AC_INIT, see release
announcement for details.

http://lists.gnu.org/archive/html/autoconf/2009-07/msg00079.html

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-01-22 12:09:33 +01:00
Sami Kerola
17c626c013 The automake missed local m4 directory and libtool init.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-01-21 22:42:43 +01:00
Sami Kerola
74aef1c34e Import from release candidate 2.13.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-01-21 18:15:50 +01:00