Compare commits

...

11 commits

Author SHA1 Message Date
Sami Kerola
a8eadf78bb Version 2.11
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-07-11 14:09:58 +02:00
Sami Kerola
e4282e8a3d Version 2.10
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-07-11 14:09:52 +02:00
Sami Kerola
573418a9e4 Version 2.9
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-07-11 14:09:43 +02:00
Sami Kerola
40edcd2aba Version 2.8
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-07-11 14:09:34 +02:00
Sami Kerola
625cde6b9c Version 2.7
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-07-11 14:09:20 +02:00
Sami Kerola
4f000e7ab6 Version 2.6
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-07-11 14:08:48 +02:00
Sami Kerola
8904b5b82c Version 2.5
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-07-11 14:08:41 +02:00
Sami Kerola
d28d8feb4f Version 2.4
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-07-11 14:08:34 +02:00
Sami Kerola
609b7faeee Version 2.3
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-07-11 14:08:25 +02:00
Sami Kerola
658fe50312 Version 2.2
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-07-11 14:08:16 +02:00
Sami Kerola
61b6acf2f5 Version 2.1
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-07-11 14:07:52 +02:00
34 changed files with 12377 additions and 3246 deletions

603
.#Makefile.in.1.7 Normal file
View file

@ -0,0 +1,603 @@
# Makefile.in generated by automake 1.10.2 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@SET_MAKE@
VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
subdir = .
DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \
$(srcdir)/Makefile.in $(srcdir)/config.h.in \
$(top_srcdir)/configure AUTHORS COPYING ChangeLog INSTALL NEWS \
THANKS TODO depcomp install-sh missing mkinstalldirs
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
configure.lineno config.status.lineno
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = config.h
CONFIG_CLEAN_FILES =
SOURCES =
DIST_SOURCES =
RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
html-recursive info-recursive install-data-recursive \
install-dvi-recursive install-exec-recursive \
install-html-recursive install-info-recursive \
install-pdf-recursive install-ps-recursive install-recursive \
installcheck-recursive installdirs-recursive pdf-recursive \
ps-recursive uninstall-recursive
RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
distclean-recursive maintainer-clean-recursive
ETAGS = etags
CTAGS = ctags
DIST_SUBDIRS = $(SUBDIRS)
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
distdir = $(PACKAGE)-$(VERSION)
top_distdir = $(distdir)
am__remove_distdir = \
{ test ! -d $(distdir) \
|| { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \
&& rm -fr $(distdir); }; }
DIST_ARCHIVES = $(distdir).tar.gz
GZIP_ENV = --best
distuninstallcheck_listfiles = find . -type f -print
distcleancheck_listfiles = find . -type f -print
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
GREP = @GREP@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LTLIBOBJS = @LTLIBOBJS@
MAKEINFO = @MAKEINFO@
MKDIR_P = @MKDIR_P@
OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
VERSION = @VERSION@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_ct_CC = @ac_ct_CC@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build_alias = @build_alias@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
host_alias = @host_alias@
htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
AUTOMAKE_OPTIONS = gnits
SUBDIRS = src man
all: config.h
$(MAKE) $(AM_MAKEFLAGS) all-recursive
.SUFFIXES:
am--refresh:
@:
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
echo ' cd $(srcdir) && $(AUTOMAKE) --gnits '; \
cd $(srcdir) && $(AUTOMAKE) --gnits \
&& exit 0; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnits Makefile'; \
cd $(top_srcdir) && \
$(AUTOMAKE) --gnits Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
echo ' $(SHELL) ./config.status'; \
$(SHELL) ./config.status;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
$(SHELL) ./config.status --recheck
$(top_srcdir)/configure: $(am__configure_deps)
cd $(srcdir) && $(AUTOCONF)
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
config.h: stamp-h1
@if test ! -f $@; then \
rm -f stamp-h1; \
$(MAKE) $(AM_MAKEFLAGS) stamp-h1; \
else :; fi
stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status
@rm -f stamp-h1
cd $(top_builddir) && $(SHELL) ./config.status config.h
$(srcdir)/config.h.in: $(am__configure_deps)
cd $(top_srcdir) && $(AUTOHEADER)
rm -f stamp-h1
touch $@
distclean-hdr:
-rm -f config.h stamp-h1
# This directory's subdirectories are mostly independent; you can cd
# into them and run `make' without going through this Makefile.
# To change the values of `make' variables: instead of editing Makefiles,
# (1) if the variable is set in `config.status', edit `config.status'
# (which will cause the Makefiles to be regenerated when you run `make');
# (2) otherwise, pass the desired values on the `make' command line.
$(RECURSIVE_TARGETS):
@failcom='exit 1'; \
for f in x $$MAKEFLAGS; do \
case $$f in \
*=* | --[!k]*);; \
*k*) failcom='fail=yes';; \
esac; \
done; \
dot_seen=no; \
target=`echo $@ | sed s/-recursive//`; \
list='$(SUBDIRS)'; for subdir in $$list; do \
echo "Making $$target in $$subdir"; \
if test "$$subdir" = "."; then \
dot_seen=yes; \
local_target="$$target-am"; \
else \
local_target="$$target"; \
fi; \
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|| eval $$failcom; \
done; \
if test "$$dot_seen" = "no"; then \
$(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
fi; test -z "$$fail"
$(RECURSIVE_CLEAN_TARGETS):
@failcom='exit 1'; \
for f in x $$MAKEFLAGS; do \
case $$f in \
*=* | --[!k]*);; \
*k*) failcom='fail=yes';; \
esac; \
done; \
dot_seen=no; \
case "$@" in \
distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
*) list='$(SUBDIRS)' ;; \
esac; \
rev=''; for subdir in $$list; do \
if test "$$subdir" = "."; then :; else \
rev="$$subdir $$rev"; \
fi; \
done; \
rev="$$rev ."; \
target=`echo $@ | sed s/-recursive//`; \
for subdir in $$rev; do \
echo "Making $$target in $$subdir"; \
if test "$$subdir" = "."; then \
local_target="$$target-am"; \
else \
local_target="$$target"; \
fi; \
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|| eval $$failcom; \
done && test -z "$$fail"
tags-recursive:
list='$(SUBDIRS)'; for subdir in $$list; do \
test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
done
ctags-recursive:
list='$(SUBDIRS)'; for subdir in $$list; do \
test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
done
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
mkid -fID $$unique
tags: TAGS
TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
include_option=--etags-include; \
empty_fix=.; \
else \
include_option=--include; \
empty_fix=; \
fi; \
list='$(SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
test ! -f $$subdir/TAGS || \
tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
fi; \
done; \
list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$tags $$unique; \
fi
ctags: CTAGS
CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
test -z "$(CTAGS_ARGS)$$tags$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$tags $$unique
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& cd $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) $$here
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
distdir: $(DISTFILES)
@case `sed 15q $(srcdir)/NEWS` in \
*"$(VERSION)"*) : ;; \
*) \
echo "NEWS not updated; not releasing" 1>&2; \
exit 1;; \
esac
$(am__remove_distdir)
test -d $(distdir) || mkdir $(distdir)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
dist_files=`for file in $$list; do echo $$file; done | \
sed -e "s|^$$srcdirstrip/||;t" \
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
case $$dist_files in \
*/*) $(MKDIR_P) `echo "$$dist_files" | \
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
sort -u` ;; \
esac; \
for file in $$dist_files; do \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
if test -d $$d/$$file; then \
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
fi; \
cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
else \
test -f $(distdir)/$$file \
|| cp -p $$d/$$file $(distdir)/$$file \
|| exit 1; \
fi; \
done
list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
test -d "$(distdir)/$$subdir" \
|| $(MKDIR_P) "$(distdir)/$$subdir" \
|| exit 1; \
distdir=`$(am__cd) $(distdir) && pwd`; \
top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
(cd $$subdir && \
$(MAKE) $(AM_MAKEFLAGS) \
top_distdir="$$top_distdir" \
distdir="$$distdir/$$subdir" \
am__remove_distdir=: \
am__skip_length_check=: \
distdir) \
|| exit 1; \
fi; \
done
-find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \
! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
! -type d ! -perm -400 -exec chmod a+r {} \; -o \
! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \
|| chmod -R a+r $(distdir)
dist-gzip: distdir
tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
$(am__remove_distdir)
dist-bzip2: distdir
tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2
$(am__remove_distdir)
dist-lzma: distdir
tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma
$(am__remove_distdir)
dist-tarZ: distdir
tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
$(am__remove_distdir)
dist-shar: distdir
shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
$(am__remove_distdir)
dist-zip: distdir
-rm -f $(distdir).zip
zip -rq $(distdir).zip $(distdir)
$(am__remove_distdir)
dist dist-all: distdir
tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
$(am__remove_distdir)
# This target untars the dist file and tries a VPATH configuration. Then
# it guarantees that the distribution is self-contained by making another
# tarfile.
distcheck: dist
case '$(DIST_ARCHIVES)' in \
*.tar.gz*) \
GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\
*.tar.bz2*) \
bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\
*.tar.lzma*) \
unlzma -c $(distdir).tar.lzma | $(am__untar) ;;\
*.tar.Z*) \
uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
*.shar.gz*) \
GZIP=$(GZIP_ENV) gunzip -c $(distdir).shar.gz | unshar ;;\
*.zip*) \
unzip $(distdir).zip ;;\
esac
chmod -R a-w $(distdir); chmod a+w $(distdir)
mkdir $(distdir)/_build
mkdir $(distdir)/_inst
chmod a-w $(distdir)
dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
&& dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
&& cd $(distdir)/_build \
&& ../configure --srcdir=.. --prefix="$$dc_install_base" \
$(DISTCHECK_CONFIGURE_FLAGS) \
&& $(MAKE) $(AM_MAKEFLAGS) \
&& $(MAKE) $(AM_MAKEFLAGS) dvi \
&& $(MAKE) $(AM_MAKEFLAGS) check \
&& $(MAKE) $(AM_MAKEFLAGS) install \
&& $(MAKE) $(AM_MAKEFLAGS) installcheck \
&& $(MAKE) $(AM_MAKEFLAGS) uninstall \
&& $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \
distuninstallcheck \
&& chmod -R a-w "$$dc_install_base" \
&& ({ \
(cd ../.. && umask 077 && mkdir "$$dc_destdir") \
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \
distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \
} || { rm -rf "$$dc_destdir"; exit 1; }) \
&& rm -rf "$$dc_destdir" \
&& $(MAKE) $(AM_MAKEFLAGS) dist \
&& rm -rf $(DIST_ARCHIVES) \
&& $(MAKE) $(AM_MAKEFLAGS) distcleancheck
$(am__remove_distdir)
@(echo "$(distdir) archives ready for distribution: "; \
list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x'
distuninstallcheck:
@cd $(distuninstallcheck_dir) \
&& test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \
|| { echo "ERROR: files left after uninstall:" ; \
if test -n "$(DESTDIR)"; then \
echo " (check DESTDIR support)"; \
fi ; \
$(distuninstallcheck_listfiles) ; \
exit 1; } >&2
distcleancheck: distclean
@if test '$(srcdir)' = . ; then \
echo "ERROR: distcleancheck can only run from a VPATH build" ; \
exit 1 ; \
fi
@test `$(distcleancheck_listfiles) | wc -l` -eq 0 \
|| { echo "ERROR: files left in build directory after distclean:" ; \
$(distcleancheck_listfiles) ; \
exit 1; } >&2
check-am: all-am
check: check-recursive
all-am: Makefile config.h
installdirs: installdirs-recursive
installdirs-am:
install: install-recursive
install-exec: install-exec-recursive
install-data: install-data-recursive
uninstall: uninstall-recursive
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-recursive
install-strip:
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
`test -z '$(STRIP)' || \
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
mostlyclean-generic:
clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-recursive
clean-am: clean-generic mostlyclean-am
distclean: distclean-recursive
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
-rm -f Makefile
distclean-am: clean-am distclean-generic distclean-hdr distclean-tags
dvi: dvi-recursive
dvi-am:
html: html-recursive
info: info-recursive
info-am:
install-data-am:
install-dvi: install-dvi-recursive
install-exec-am:
install-html: install-html-recursive
install-info: install-info-recursive
install-man:
install-pdf: install-pdf-recursive
install-ps: install-ps-recursive
installcheck-am:
maintainer-clean: maintainer-clean-recursive
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
-rm -rf $(top_srcdir)/autom4te.cache
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-recursive
mostlyclean-am: mostlyclean-generic
pdf: pdf-recursive
pdf-am:
ps: ps-recursive
ps-am:
uninstall-am:
.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) install-am \
install-strip
.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
all all-am am--refresh check check-am clean clean-generic \
ctags ctags-recursive dist dist-all dist-bzip2 dist-gzip \
dist-lzma dist-shar dist-tarZ dist-zip distcheck distclean \
distclean-generic distclean-hdr distclean-tags distcleancheck \
distdir distuninstallcheck dvi dvi-am html html-am info \
info-am install install-am install-data install-data-am \
install-dvi install-dvi-am install-exec install-exec-am \
install-html install-html-am install-info install-info-am \
install-man install-pdf install-pdf-am install-ps \
install-ps-am install-strip installcheck installcheck-am \
installdirs installdirs-am maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-generic pdf \
pdf-am ps ps-am tags tags-recursive uninstall uninstall-am
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:

877
.#aclocal.m4.1.5 Normal file
View file

@ -0,0 +1,877 @@
# generated automatically by aclocal 1.10.2 -*- Autoconf -*-
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
# 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
m4_ifndef([AC_AUTOCONF_VERSION],
[m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.63],,
[m4_warning([this file was generated for autoconf 2.63.
You have another version of autoconf. It may work, but is not guaranteed to.
If you have problems, you may need to regenerate the build system entirely.
To do so, use the procedure documented by the package, typically `autoreconf'.])])
# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# AM_AUTOMAKE_VERSION(VERSION)
# ----------------------------
# Automake X.Y traces this macro to ensure aclocal.m4 has been
# generated from the m4 files accompanying Automake X.Y.
# (This private macro should not be called outside this file.)
AC_DEFUN([AM_AUTOMAKE_VERSION],
[am__api_version='1.10'
dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
dnl require some minimum version. Point them to the right macro.
m4_if([$1], [1.10.2], [],
[AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
])
# _AM_AUTOCONF_VERSION(VERSION)
# -----------------------------
# aclocal traces this macro to find the Autoconf version.
# This is a private macro too. Using m4_define simplifies
# the logic in aclocal, which can simply ignore this definition.
m4_define([_AM_AUTOCONF_VERSION], [])
# AM_SET_CURRENT_AUTOMAKE_VERSION
# -------------------------------
# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
[AM_AUTOMAKE_VERSION([1.10.2])dnl
m4_ifndef([AC_AUTOCONF_VERSION],
[m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
# AM_AUX_DIR_EXPAND -*- Autoconf -*-
# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to
# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
#
# Of course, Automake must honor this variable whenever it calls a
# tool from the auxiliary directory. The problem is that $srcdir (and
# therefore $ac_aux_dir as well) can be either absolute or relative,
# depending on how configure is run. This is pretty annoying, since
# it makes $ac_aux_dir quite unusable in subdirectories: in the top
# source directory, any form will work fine, but in subdirectories a
# relative path needs to be adjusted first.
#
# $ac_aux_dir/missing
# fails when called from a subdirectory if $ac_aux_dir is relative
# $top_srcdir/$ac_aux_dir/missing
# fails if $ac_aux_dir is absolute,
# fails when called from a subdirectory in a VPATH build with
# a relative $ac_aux_dir
#
# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
# are both prefixed by $srcdir. In an in-source build this is usually
# harmless because $srcdir is `.', but things will broke when you
# start a VPATH build or use an absolute $srcdir.
#
# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
# iff we strip the leading $srcdir from $ac_aux_dir. That would be:
# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
# and then we would define $MISSING as
# MISSING="\${SHELL} $am_aux_dir/missing"
# This will work as long as MISSING is not called from configure, because
# unfortunately $(top_srcdir) has no meaning in configure.
# However there are other variables, like CC, which are often used in
# configure, and could therefore not use this "fixed" $ac_aux_dir.
#
# Another solution, used here, is to always expand $ac_aux_dir to an
# absolute PATH. The drawback is that using absolute paths prevent a
# configured tree to be moved without reconfiguration.
AC_DEFUN([AM_AUX_DIR_EXPAND],
[dnl Rely on autoconf to set up CDPATH properly.
AC_PREREQ([2.50])dnl
# expand $ac_aux_dir to an absolute path
am_aux_dir=`cd $ac_aux_dir && pwd`
])
# AM_CONDITIONAL -*- Autoconf -*-
# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006
# Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# serial 8
# AM_CONDITIONAL(NAME, SHELL-CONDITION)
# -------------------------------------
# Define a conditional.
AC_DEFUN([AM_CONDITIONAL],
[AC_PREREQ(2.52)dnl
ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])],
[$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
AC_SUBST([$1_TRUE])dnl
AC_SUBST([$1_FALSE])dnl
_AM_SUBST_NOTMAKE([$1_TRUE])dnl
_AM_SUBST_NOTMAKE([$1_FALSE])dnl
if $2; then
$1_TRUE=
$1_FALSE='#'
else
$1_TRUE='#'
$1_FALSE=
fi
AC_CONFIG_COMMANDS_PRE(
[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
AC_MSG_ERROR([[conditional "$1" was never defined.
Usually this means the macro was only invoked conditionally.]])
fi])])
# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
# Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# serial 9
# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
# written in clear, in which case automake, when reading aclocal.m4,
# will think it sees a *use*, and therefore will trigger all it's
# C support machinery. Also note that it means that autoscan, seeing
# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
# _AM_DEPENDENCIES(NAME)
# ----------------------
# See how the compiler implements dependency checking.
# NAME is "CC", "CXX", "GCJ", or "OBJC".
# We try a few techniques and use that to set a single cache variable.
#
# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
# dependency, and given that the user is not expected to run this macro,
# just rely on AC_PROG_CC.
AC_DEFUN([_AM_DEPENDENCIES],
[AC_REQUIRE([AM_SET_DEPDIR])dnl
AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
AC_REQUIRE([AM_MAKE_INCLUDE])dnl
AC_REQUIRE([AM_DEP_TRACK])dnl
ifelse([$1], CC, [depcc="$CC" am_compiler_list=],
[$1], CXX, [depcc="$CXX" am_compiler_list=],
[$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
[$1], UPC, [depcc="$UPC" am_compiler_list=],
[$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'],
[depcc="$$1" am_compiler_list=])
AC_CACHE_CHECK([dependency style of $depcc],
[am_cv_$1_dependencies_compiler_type],
[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
# We make a subdir and do the tests there. Otherwise we can end up
# making bogus files that we don't know about and never remove. For
# instance it was reported that on HP-UX the gcc test will end up
# making a dummy file named `D' -- because `-MD' means `put the output
# in D'.
mkdir conftest.dir
# Copy depcomp to subdir because otherwise we won't find it if we're
# using a relative directory.
cp "$am_depcomp" conftest.dir
cd conftest.dir
# We will build objects and dependencies in a subdirectory because
# it helps to detect inapplicable dependency modes. For instance
# both Tru64's cc and ICC support -MD to output dependencies as a
# side effect of compilation, but ICC will put the dependencies in
# the current directory while Tru64 will put them in the object
# directory.
mkdir sub
am_cv_$1_dependencies_compiler_type=none
if test "$am_compiler_list" = ""; then
am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
fi
for depmode in $am_compiler_list; do
# Setup a source with many dependencies, because some compilers
# like to wrap large dependency lists on column 80 (with \), and
# we should not choose a depcomp mode which is confused by this.
#
# We need to recreate these files for each test, as the compiler may
# overwrite some of them when testing with obscure command lines.
# This happens at least with the AIX C compiler.
: > sub/conftest.c
for i in 1 2 3 4 5 6; do
echo '#include "conftst'$i'.h"' >> sub/conftest.c
# Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
# Solaris 8's {/usr,}/bin/sh.
touch sub/conftst$i.h
done
echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
case $depmode in
nosideeffect)
# after this tag, mechanisms are not by side-effect, so they'll
# only be used when explicitly requested
if test "x$enable_dependency_tracking" = xyes; then
continue
else
break
fi
;;
none) break ;;
esac
# We check with `-c' and `-o' for the sake of the "dashmstdout"
# mode. It turns out that the SunPro C++ compiler does not properly
# handle `-M -o', and we need to detect this.
if depmode=$depmode \
source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
$SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
>/dev/null 2>conftest.err &&
grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
${MAKE-make} -s -f confmf > /dev/null 2>&1; then
# icc doesn't choke on unknown options, it will just issue warnings
# or remarks (even with -Werror). So we grep stderr for any message
# that says an option was ignored or not supported.
# When given -MP, icc 7.0 and 7.1 complain thusly:
# icc: Command line warning: ignoring option '-M'; no argument required
# The diagnosis changed in icc 8.0:
# icc: Command line remark: option '-MP' not supported
if (grep 'ignoring option' conftest.err ||
grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
am_cv_$1_dependencies_compiler_type=$depmode
break
fi
fi
done
cd ..
rm -rf conftest.dir
else
am_cv_$1_dependencies_compiler_type=none
fi
])
AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
AM_CONDITIONAL([am__fastdep$1], [
test "x$enable_dependency_tracking" != xno \
&& test "$am_cv_$1_dependencies_compiler_type" = gcc3])
])
# AM_SET_DEPDIR
# -------------
# Choose a directory name for dependency files.
# This macro is AC_REQUIREd in _AM_DEPENDENCIES
AC_DEFUN([AM_SET_DEPDIR],
[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
])
# AM_DEP_TRACK
# ------------
AC_DEFUN([AM_DEP_TRACK],
[AC_ARG_ENABLE(dependency-tracking,
[ --disable-dependency-tracking speeds up one-time build
--enable-dependency-tracking do not reject slow dependency extractors])
if test "x$enable_dependency_tracking" != xno; then
am_depcomp="$ac_aux_dir/depcomp"
AMDEPBACKSLASH='\'
fi
AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
AC_SUBST([AMDEPBACKSLASH])dnl
_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
])
# Generate code to set up dependency tracking. -*- Autoconf -*-
# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008
# Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
#serial 4
# _AM_OUTPUT_DEPENDENCY_COMMANDS
# ------------------------------
AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
[# Autoconf 2.62 quotes --file arguments for eval, but not when files
# are listed without --file. Let's play safe and only enable the eval
# if we detect the quoting.
case $CONFIG_FILES in
*\'*) eval set x "$CONFIG_FILES" ;;
*) set x $CONFIG_FILES ;;
esac
shift
for mf
do
# Strip MF so we end up with the name of the file.
mf=`echo "$mf" | sed -e 's/:.*$//'`
# Check whether this is an Automake generated Makefile or not.
# We used to match only the files named `Makefile.in', but
# some people rename them; so instead we look at the file content.
# Grep'ing the first line is not enough: some people post-process
# each Makefile.in and add a new line on top of each file to say so.
# Grep'ing the whole file is not good either: AIX grep has a line
# limit of 2048, but all sed's we know have understand at least 4000.
if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
dirpart=`AS_DIRNAME("$mf")`
else
continue
fi
# Extract the definition of DEPDIR, am__include, and am__quote
# from the Makefile without running `make'.
DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
test -z "$DEPDIR" && continue
am__include=`sed -n 's/^am__include = //p' < "$mf"`
test -z "am__include" && continue
am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
# When using ansi2knr, U may be empty or an underscore; expand it
U=`sed -n 's/^U = //p' < "$mf"`
# Find all dependency output files, they are included files with
# $(DEPDIR) in their names. We invoke sed twice because it is the
# simplest approach to changing $(DEPDIR) to its actual value in the
# expansion.
for file in `sed -n "
s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
# Make sure the directory exists.
test -f "$dirpart/$file" && continue
fdir=`AS_DIRNAME(["$file"])`
AS_MKDIR_P([$dirpart/$fdir])
# echo "creating $dirpart/$file"
echo '# dummy' > "$dirpart/$file"
done
done
])# _AM_OUTPUT_DEPENDENCY_COMMANDS
# AM_OUTPUT_DEPENDENCY_COMMANDS
# -----------------------------
# This macro should only be invoked once -- use via AC_REQUIRE.
#
# This code is only required when automatic dependency tracking
# is enabled. FIXME. This creates each `.P' file that we will
# need in order to bootstrap the dependency handling code.
AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
[AC_CONFIG_COMMANDS([depfiles],
[test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
[AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
])
# Do all the work for Automake. -*- Autoconf -*-
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
# 2005, 2006, 2008 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# serial 13
# This macro actually does too much. Some checks are only needed if
# your package does certain things. But this isn't really a big deal.
# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
# AM_INIT_AUTOMAKE([OPTIONS])
# -----------------------------------------------
# The call with PACKAGE and VERSION arguments is the old style
# call (pre autoconf-2.50), which is being phased out. PACKAGE
# and VERSION should now be passed to AC_INIT and removed from
# the call to AM_INIT_AUTOMAKE.
# We support both call styles for the transition. After
# the next Automake release, Autoconf can make the AC_INIT
# arguments mandatory, and then we can depend on a new Autoconf
# release and drop the old call support.
AC_DEFUN([AM_INIT_AUTOMAKE],
[AC_PREREQ([2.60])dnl
dnl Autoconf wants to disallow AM_ names. We explicitly allow
dnl the ones we care about.
m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
AC_REQUIRE([AC_PROG_INSTALL])dnl
if test "`cd $srcdir && pwd`" != "`pwd`"; then
# Use -I$(srcdir) only when $(srcdir) != ., so that make's output
# is not polluted with repeated "-I."
AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
# test to see if srcdir already configured
if test -f $srcdir/config.status; then
AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
fi
fi
# test whether we have cygpath
if test -z "$CYGPATH_W"; then
if (cygpath --version) >/dev/null 2>/dev/null; then
CYGPATH_W='cygpath -w'
else
CYGPATH_W=echo
fi
fi
AC_SUBST([CYGPATH_W])
# Define the identity of the package.
dnl Distinguish between old-style and new-style calls.
m4_ifval([$2],
[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
AC_SUBST([PACKAGE], [$1])dnl
AC_SUBST([VERSION], [$2])],
[_AM_SET_OPTIONS([$1])dnl
dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
[m4_fatal([AC_INIT should be called with package and version arguments])])dnl
AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
_AM_IF_OPTION([no-define],,
[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
# Some tools Automake needs.
AC_REQUIRE([AM_SANITY_CHECK])dnl
AC_REQUIRE([AC_ARG_PROGRAM])dnl
AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
AM_MISSING_PROG(AUTOCONF, autoconf)
AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
AM_MISSING_PROG(AUTOHEADER, autoheader)
AM_MISSING_PROG(MAKEINFO, makeinfo)
AM_PROG_INSTALL_SH
AM_PROG_INSTALL_STRIP
AC_REQUIRE([AM_PROG_MKDIR_P])dnl
# We need awk for the "check" target. The system "awk" is bad on
# some platforms.
AC_REQUIRE([AC_PROG_AWK])dnl
AC_REQUIRE([AC_PROG_MAKE_SET])dnl
AC_REQUIRE([AM_SET_LEADING_DOT])dnl
_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
[_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
[_AM_PROG_TAR([v7])])])
_AM_IF_OPTION([no-dependencies],,
[AC_PROVIDE_IFELSE([AC_PROG_CC],
[_AM_DEPENDENCIES(CC)],
[define([AC_PROG_CC],
defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
AC_PROVIDE_IFELSE([AC_PROG_CXX],
[_AM_DEPENDENCIES(CXX)],
[define([AC_PROG_CXX],
defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
AC_PROVIDE_IFELSE([AC_PROG_OBJC],
[_AM_DEPENDENCIES(OBJC)],
[define([AC_PROG_OBJC],
defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
])
])
# When config.status generates a header, we must update the stamp-h file.
# This file resides in the same directory as the config header
# that is generated. The stamp files are numbered to have different names.
# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
# loop where config.status creates the headers, so we can generate
# our stamp files there.
AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
[# Compute $1's index in $config_headers.
_am_arg=$1
_am_stamp_count=1
for _am_header in $config_headers :; do
case $_am_header in
$_am_arg | $_am_arg:* )
break ;;
* )
_am_stamp_count=`expr $_am_stamp_count + 1` ;;
esac
done
echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# AM_PROG_INSTALL_SH
# ------------------
# Define $install_sh.
AC_DEFUN([AM_PROG_INSTALL_SH],
[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
install_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"}
AC_SUBST(install_sh)])
# Copyright (C) 2003, 2005 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# serial 2
# Check whether the underlying file-system supports filenames
# with a leading dot. For instance MS-DOS doesn't.
AC_DEFUN([AM_SET_LEADING_DOT],
[rm -rf .tst 2>/dev/null
mkdir .tst 2>/dev/null
if test -d .tst; then
am__leading_dot=.
else
am__leading_dot=_
fi
rmdir .tst 2>/dev/null
AC_SUBST([am__leading_dot])])
# Check to see how 'make' treats includes. -*- Autoconf -*-
# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# serial 3
# AM_MAKE_INCLUDE()
# -----------------
# Check to see how make treats includes.
AC_DEFUN([AM_MAKE_INCLUDE],
[am_make=${MAKE-make}
cat > confinc << 'END'
am__doit:
@echo done
.PHONY: am__doit
END
# If we don't find an include directive, just comment out the code.
AC_MSG_CHECKING([for style of include used by $am_make])
am__include="#"
am__quote=
_am_result=none
# First try GNU make style include.
echo "include confinc" > confmf
# We grep out `Entering directory' and `Leaving directory'
# messages which can occur if `w' ends up in MAKEFLAGS.
# In particular we don't look at `^make:' because GNU make might
# be invoked under some other name (usually "gmake"), in which
# case it prints its new name instead of `make'.
if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
am__include=include
am__quote=
_am_result=GNU
fi
# Now try BSD make style include.
if test "$am__include" = "#"; then
echo '.include "confinc"' > confmf
if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
am__include=.include
am__quote="\""
_am_result=BSD
fi
fi
AC_SUBST([am__include])
AC_SUBST([am__quote])
AC_MSG_RESULT([$_am_result])
rm -f confinc confmf
])
# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005
# Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# serial 5
# AM_MISSING_PROG(NAME, PROGRAM)
# ------------------------------
AC_DEFUN([AM_MISSING_PROG],
[AC_REQUIRE([AM_MISSING_HAS_RUN])
$1=${$1-"${am_missing_run}$2"}
AC_SUBST($1)])
# AM_MISSING_HAS_RUN
# ------------------
# Define MISSING if not defined so far and test if it supports --run.
# If it does, set am_missing_run to use it, otherwise, to nothing.
AC_DEFUN([AM_MISSING_HAS_RUN],
[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
AC_REQUIRE_AUX_FILE([missing])dnl
test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
# Use eval to expand $SHELL
if eval "$MISSING --run true"; then
am_missing_run="$MISSING --run "
else
am_missing_run=
AC_MSG_WARN([`missing' script is too old or missing])
fi
])
# Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# AM_PROG_MKDIR_P
# ---------------
# Check for `mkdir -p'.
AC_DEFUN([AM_PROG_MKDIR_P],
[AC_PREREQ([2.60])dnl
AC_REQUIRE([AC_PROG_MKDIR_P])dnl
dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P,
dnl while keeping a definition of mkdir_p for backward compatibility.
dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
dnl Makefile.ins that do not define MKDIR_P, so we do our own
dnl adjustment using top_builddir (which is defined more often than
dnl MKDIR_P).
AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
case $mkdir_p in
[[\\/$]]* | ?:[[\\/]]*) ;;
*/*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
esac
])
# Helper functions for option handling. -*- Autoconf -*-
# Copyright (C) 2001, 2002, 2003, 2005, 2008 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# serial 4
# _AM_MANGLE_OPTION(NAME)
# -----------------------
AC_DEFUN([_AM_MANGLE_OPTION],
[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
# _AM_SET_OPTION(NAME)
# ------------------------------
# Set option NAME. Presently that only means defining a flag for this option.
AC_DEFUN([_AM_SET_OPTION],
[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
# _AM_SET_OPTIONS(OPTIONS)
# ----------------------------------
# OPTIONS is a space-separated list of Automake options.
AC_DEFUN([_AM_SET_OPTIONS],
[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
# -------------------------------------------
# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
AC_DEFUN([_AM_IF_OPTION],
[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
# Check to make sure that the build environment is sane. -*- Autoconf -*-
# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
# Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# serial 4
# AM_SANITY_CHECK
# ---------------
AC_DEFUN([AM_SANITY_CHECK],
[AC_MSG_CHECKING([whether build environment is sane])
# Just in case
sleep 1
echo timestamp > conftest.file
# Do `set' in a subshell so we don't clobber the current shell's
# arguments. Must try -L first in case configure is actually a
# symlink; some systems play weird games with the mod time of symlinks
# (eg FreeBSD returns the mod time of the symlink's containing
# directory).
if (
set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
if test "$[*]" = "X"; then
# -L didn't work.
set X `ls -t $srcdir/configure conftest.file`
fi
rm -f conftest.file
if test "$[*]" != "X $srcdir/configure conftest.file" \
&& test "$[*]" != "X conftest.file $srcdir/configure"; then
# If neither matched, then we have a broken ls. This can happen
# if, for instance, CONFIG_SHELL is bash and it inherits a
# broken ls alias from the environment. This has actually
# happened. Such a system could not be considered "sane".
AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
alias in your environment])
fi
test "$[2]" = conftest.file
)
then
# Ok.
:
else
AC_MSG_ERROR([newly created file is older than distributed files!
Check your system clock])
fi
AC_MSG_RESULT(yes)])
# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# AM_PROG_INSTALL_STRIP
# ---------------------
# One issue with vendor `install' (even GNU) is that you can't
# specify the program used to strip binaries. This is especially
# annoying in cross-compiling environments, where the build's strip
# is unlikely to handle the host's binaries.
# Fortunately install-sh will honor a STRIPPROG variable, so we
# always use install-sh in `make install-strip', and initialize
# STRIPPROG with the value of the STRIP variable (set by the user).
AC_DEFUN([AM_PROG_INSTALL_STRIP],
[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
# Installed binaries are usually stripped using `strip' when the user
# run `make install-strip'. However `strip' might not be the right
# tool to use in cross-compilation environments, therefore Automake
# will honor the `STRIP' environment variable to overrule this program.
dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
if test "$cross_compiling" != no; then
AC_CHECK_TOOL([STRIP], [strip], :)
fi
INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
AC_SUBST([INSTALL_STRIP_PROGRAM])])
# Copyright (C) 2006 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# _AM_SUBST_NOTMAKE(VARIABLE)
# ---------------------------
# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
# This macro is traced by Automake.
AC_DEFUN([_AM_SUBST_NOTMAKE])
# Check how to create a tarball. -*- Autoconf -*-
# Copyright (C) 2004, 2005 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# serial 2
# _AM_PROG_TAR(FORMAT)
# --------------------
# Check how to create a tarball in format FORMAT.
# FORMAT should be one of `v7', `ustar', or `pax'.
#
# Substitute a variable $(am__tar) that is a command
# writing to stdout a FORMAT-tarball containing the directory
# $tardir.
# tardir=directory && $(am__tar) > result.tar
#
# Substitute a variable $(am__untar) that extract such
# a tarball read from stdin.
# $(am__untar) < result.tar
AC_DEFUN([_AM_PROG_TAR],
[# Always define AMTAR for backward compatibility.
AM_MISSING_PROG([AMTAR], [tar])
m4_if([$1], [v7],
[am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
[m4_case([$1], [ustar],, [pax],,
[m4_fatal([Unknown tar format])])
AC_MSG_CHECKING([how to create a $1 tar archive])
# Loop over all known methods to create a tar archive until one works.
_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
_am_tools=${am_cv_prog_tar_$1-$_am_tools}
# Do not fold the above two line into one, because Tru64 sh and
# Solaris sh will not grok spaces in the rhs of `-'.
for _am_tool in $_am_tools
do
case $_am_tool in
gnutar)
for _am_tar in tar gnutar gtar;
do
AM_RUN_LOG([$_am_tar --version]) && break
done
am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
am__untar="$_am_tar -xf -"
;;
plaintar)
# Must skip GNU tar: if it does not support --format= it doesn't create
# ustar tarball either.
(tar --version) >/dev/null 2>&1 && continue
am__tar='tar chf - "$$tardir"'
am__tar_='tar chf - "$tardir"'
am__untar='tar xf -'
;;
pax)
am__tar='pax -L -x $1 -w "$$tardir"'
am__tar_='pax -L -x $1 -w "$tardir"'
am__untar='pax -r'
;;
cpio)
am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
am__untar='cpio -i -H $1 -d'
;;
none)
am__tar=false
am__tar_=false
am__untar=false
;;
esac
# If the value was cached, stop now. We just wanted to have am__tar
# and am__untar set.
test -n "${am_cv_prog_tar_$1}" && break
# tar/untar a dummy directory, and stop if the command works
rm -rf conftest.dir
mkdir conftest.dir
echo GrepMe > conftest.dir/file
AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
rm -rf conftest.dir
if test -s conftest.tar; then
AM_RUN_LOG([$am__untar <conftest.tar])
grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
fi
done
rm -rf conftest.dir
AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
AC_MSG_RESULT([$am_cv_prog_tar_$1])])
AC_SUBST([am__tar])
AC_SUBST([am__untar])
]) # _AM_PROG_TAR

110
.#config.h.in.1.4 Normal file
View file

@ -0,0 +1,110 @@
/* config.h.in. Generated from configure.ac by autoheader. */
/* default path of dhcpd.conf */
#undef DHCPDCONF_FILE
/* default path of dhcpd.leases */
#undef DHCPDLEASE_FILE
/* Define to 1 if you have the <arpa/inet.h> header file. */
#undef HAVE_ARPA_INET_H
/* Define to 1 if you have the <fcntl.h> header file. */
#undef HAVE_FCNTL_H
/* Define to 1 if you have the <getopt.h> header file. */
#undef HAVE_GETOPT_H
/* Define to 1 if you have the `inet_ntoa' function. */
#undef HAVE_INET_NTOA
/* Define to 1 if you have the <inttypes.h> header file. */
#undef HAVE_INTTYPES_H
/* Define to 1 if you have the <libintl.h> header file. */
#undef HAVE_LIBINTL_H
/* Define to 1 if your system has a GNU libc compatible `malloc' function, and
to 0 otherwise. */
#undef HAVE_MALLOC
/* Define to 1 if you have the <memory.h> header file. */
#undef HAVE_MEMORY_H
/* Define to 1 if you have the `memset' function. */
#undef HAVE_MEMSET
/* Define to 1 if you have the <netinet/in.h> header file. */
#undef HAVE_NETINET_IN_H
/* Define to 1 if stdbool.h conforms to C99. */
#undef HAVE_STDBOOL_H
/* Define to 1 if you have the <stdint.h> header file. */
#undef HAVE_STDINT_H
/* Define to 1 if you have the <stdlib.h> header file. */
#undef HAVE_STDLIB_H
/* Define to 1 if you have the `strerror' function. */
#undef HAVE_STRERROR
/* Define to 1 if you have the <strings.h> header file. */
#undef HAVE_STRINGS_H
/* Define to 1 if you have the <string.h> header file. */
#undef HAVE_STRING_H
/* Define to 1 if you have the `strstr' function. */
#undef HAVE_STRSTR
/* Define to 1 if you have the <sys/socket.h> header file. */
#undef HAVE_SYS_SOCKET_H
/* Define to 1 if you have the <sys/stat.h> header file. */
#undef HAVE_SYS_STAT_H
/* Define to 1 if you have the <sys/types.h> header file. */
#undef HAVE_SYS_TYPES_H
/* Define to 1 if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
/* Define to 1 if the system has the type `_Bool'. */
#undef HAVE__BOOL
/* default output format */
#undef OUTPUT_FORMAT
/* default output limitations */
#undef OUTPUT_LIMIT
/* Name of package */
#undef PACKAGE
/* Define to the address where bug reports for this package should be sent. */
#undef PACKAGE_BUGREPORT
/* Define to the full name of this package. */
#undef PACKAGE_NAME
/* Define to the full name and version of this package. */
#undef PACKAGE_STRING
/* Define to the one symbol short name of this package. */
#undef PACKAGE_TARNAME
/* Define to the version of this package. */
#undef PACKAGE_VERSION
/* Define to 1 if you have the ANSI C header files. */
#undef STDC_HEADERS
/* Version number of package */
#undef VERSION
/* Define to rpl_malloc if the replacement function should be used. */
#undef malloc
/* Define to `unsigned int' if <sys/types.h> does not define. */
#undef size_t

6578
.#configure.1.13 Executable file

File diff suppressed because it is too large Load diff

View file

@ -1,23 +1,3 @@
2011-01-21 Sami Kerola <kerolasa@iki.fi>
* Autoreconf done & PACKAGE_URL introduced.
* PACKAGE_URL introduced to configure.ac
* Dominic Germain sent xml, and detailed xml, outputs
patch.
* Dominic Germain pointed out include directive bug,
which broke shared network name.
* Anonymous contrib addition snmptest.pl which should
provide some sort of SNMP integration.
* Range statements have dynamic-bootp flag and it no
longer will break analysis.
2009-11-04 Sami Kerola <kerolasa@iki.fi>
* Roar Pettersen pointed out portability bug related to
posixfadvice arguments.
* Roar Pettersen pointed out fclose(stdout) portability
bug.
* Clean up function set to be ran at exit instead of end
of main().
2009-05-14 Dan Thorson 2009-05-14 Dan Thorson
* Memory boundary check. Lack of this caused illegal memory * Memory boundary check. Lack of this caused illegal memory
refrences when there was plenty of backup leases. refrences when there was plenty of backup leases.

View file

@ -2,4 +2,4 @@
AUTOMAKE_OPTIONS = gnits AUTOMAKE_OPTIONS = gnits
SUBDIRS = src man contrib SUBDIRS = src man

View file

@ -1,9 +1,8 @@
# Makefile.in generated by automake 1.11.1 from Makefile.am. # Makefile.in generated by automake 1.10.2 from Makefile.am.
# @configure_input@ # @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, # 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
# Inc.
# This Makefile.in is free software; the Free Software Foundation # This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it, # gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved. # with or without modifications, as long as this notice is preserved.
@ -16,9 +15,8 @@
@SET_MAKE@ @SET_MAKE@
VPATH = @srcdir@ VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@ pkgdatadir = $(datadir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@
pkglibexecdir = $(libexecdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644 install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c install_sh_PROGRAM = $(install_sh) -c
@ -45,7 +43,6 @@ am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = config.h CONFIG_HEADER = config.h
CONFIG_CLEAN_FILES = CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
SOURCES = SOURCES =
DIST_SOURCES = DIST_SOURCES =
RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
@ -57,9 +54,6 @@ RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
ps-recursive uninstall-recursive ps-recursive uninstall-recursive
RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
distclean-recursive maintainer-clean-recursive distclean-recursive maintainer-clean-recursive
AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
$(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \
distdir dist dist-all distcheck
ETAGS = etags ETAGS = etags
CTAGS = ctags CTAGS = ctags
DIST_SUBDIRS = $(SUBDIRS) DIST_SUBDIRS = $(SUBDIRS)
@ -67,34 +61,9 @@ DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
distdir = $(PACKAGE)-$(VERSION) distdir = $(PACKAGE)-$(VERSION)
top_distdir = $(distdir) top_distdir = $(distdir)
am__remove_distdir = \ am__remove_distdir = \
{ test ! -d "$(distdir)" \ { test ! -d $(distdir) \
|| { find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ || { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \
&& rm -fr "$(distdir)"; }; } && rm -fr $(distdir); }; }
am__relativize = \
dir0=`pwd`; \
sed_first='s,^\([^/]*\)/.*$$,\1,'; \
sed_rest='s,^[^/]*/*,,'; \
sed_last='s,^.*/\([^/]*\)$$,\1,'; \
sed_butlast='s,/*[^/]*$$,,'; \
while test -n "$$dir1"; do \
first=`echo "$$dir1" | sed -e "$$sed_first"`; \
if test "$$first" != "."; then \
if test "$$first" = ".."; then \
dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
else \
first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
if test "$$first2" = "$$first"; then \
dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
else \
dir2="../$$dir2"; \
fi; \
dir0="$$dir0"/"$$first"; \
fi; \
fi; \
dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
done; \
reldir="$$dir2"
DIST_ARCHIVES = $(distdir).tar.gz DIST_ARCHIVES = $(distdir).tar.gz
GZIP_ENV = --best GZIP_ENV = --best
distuninstallcheck_listfiles = find . -type f -print distuninstallcheck_listfiles = find . -type f -print
@ -136,7 +105,6 @@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@ PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@ PATH_SEPARATOR = @PATH_SEPARATOR@
SET_MAKE = @SET_MAKE@ SET_MAKE = @SET_MAKE@
@ -186,7 +154,7 @@ top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@ top_builddir = @top_builddir@
top_srcdir = @top_srcdir@ top_srcdir = @top_srcdir@
AUTOMAKE_OPTIONS = gnits AUTOMAKE_OPTIONS = gnits
SUBDIRS = src man contrib SUBDIRS = src man
all: config.h all: config.h
$(MAKE) $(AM_MAKEFLAGS) all-recursive $(MAKE) $(AM_MAKEFLAGS) all-recursive
@ -198,13 +166,13 @@ $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
case '$(am__configure_deps)' in \ case '$(am__configure_deps)' in \
*$$dep*) \ *$$dep*) \
echo ' cd $(srcdir) && $(AUTOMAKE) --gnits '; \ echo ' cd $(srcdir) && $(AUTOMAKE) --gnits '; \
$(am__cd) $(srcdir) && $(AUTOMAKE) --gnits \ cd $(srcdir) && $(AUTOMAKE) --gnits \
&& exit 0; \ && exit 0; \
exit 1;; \ exit 1;; \
esac; \ esac; \
done; \ done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnits Makefile'; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnits Makefile'; \
$(am__cd) $(top_srcdir) && \ cd $(top_srcdir) && \
$(AUTOMAKE) --gnits Makefile $(AUTOMAKE) --gnits Makefile
.PRECIOUS: Makefile .PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@ -221,10 +189,9 @@ $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENC
$(SHELL) ./config.status --recheck $(SHELL) ./config.status --recheck
$(top_srcdir)/configure: $(am__configure_deps) $(top_srcdir)/configure: $(am__configure_deps)
$(am__cd) $(srcdir) && $(AUTOCONF) cd $(srcdir) && $(AUTOCONF)
$(ACLOCAL_M4): $(am__aclocal_m4_deps) $(ACLOCAL_M4): $(am__aclocal_m4_deps)
$(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
$(am__aclocal_m4_deps):
config.h: stamp-h1 config.h: stamp-h1
@if test ! -f $@; then \ @if test ! -f $@; then \
@ -236,7 +203,7 @@ stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status
@rm -f stamp-h1 @rm -f stamp-h1
cd $(top_builddir) && $(SHELL) ./config.status config.h cd $(top_builddir) && $(SHELL) ./config.status config.h
$(srcdir)/config.h.in: $(am__configure_deps) $(srcdir)/config.h.in: $(am__configure_deps)
($(am__cd) $(top_srcdir) && $(AUTOHEADER)) cd $(top_srcdir) && $(AUTOHEADER)
rm -f stamp-h1 rm -f stamp-h1
touch $@ touch $@
@ -250,7 +217,7 @@ distclean-hdr:
# (which will cause the Makefiles to be regenerated when you run `make'); # (which will cause the Makefiles to be regenerated when you run `make');
# (2) otherwise, pass the desired values on the `make' command line. # (2) otherwise, pass the desired values on the `make' command line.
$(RECURSIVE_TARGETS): $(RECURSIVE_TARGETS):
@fail= failcom='exit 1'; \ @failcom='exit 1'; \
for f in x $$MAKEFLAGS; do \ for f in x $$MAKEFLAGS; do \
case $$f in \ case $$f in \
*=* | --[!k]*);; \ *=* | --[!k]*);; \
@ -267,7 +234,7 @@ $(RECURSIVE_TARGETS):
else \ else \
local_target="$$target"; \ local_target="$$target"; \
fi; \ fi; \
($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|| eval $$failcom; \ || eval $$failcom; \
done; \ done; \
if test "$$dot_seen" = "no"; then \ if test "$$dot_seen" = "no"; then \
@ -275,7 +242,7 @@ $(RECURSIVE_TARGETS):
fi; test -z "$$fail" fi; test -z "$$fail"
$(RECURSIVE_CLEAN_TARGETS): $(RECURSIVE_CLEAN_TARGETS):
@fail= failcom='exit 1'; \ @failcom='exit 1'; \
for f in x $$MAKEFLAGS; do \ for f in x $$MAKEFLAGS; do \
case $$f in \ case $$f in \
*=* | --[!k]*);; \ *=* | --[!k]*);; \
@ -301,16 +268,16 @@ $(RECURSIVE_CLEAN_TARGETS):
else \ else \
local_target="$$target"; \ local_target="$$target"; \
fi; \ fi; \
($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|| eval $$failcom; \ || eval $$failcom; \
done && test -z "$$fail" done && test -z "$$fail"
tags-recursive: tags-recursive:
list='$(SUBDIRS)'; for subdir in $$list; do \ list='$(SUBDIRS)'; for subdir in $$list; do \
test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
done done
ctags-recursive: ctags-recursive:
list='$(SUBDIRS)'; for subdir in $$list; do \ list='$(SUBDIRS)'; for subdir in $$list; do \
test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
done done
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
@ -325,7 +292,7 @@ tags: TAGS
TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP) $(TAGS_FILES) $(LISP)
set x; \ tags=; \
here=`pwd`; \ here=`pwd`; \
if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
include_option=--etags-include; \ include_option=--etags-include; \
@ -337,7 +304,7 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
list='$(SUBDIRS)'; for subdir in $$list; do \ list='$(SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \ if test "$$subdir" = .; then :; else \
test ! -f $$subdir/TAGS || \ test ! -f $$subdir/TAGS || \
set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
fi; \ fi; \
done; \ done; \
list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \
@ -346,34 +313,29 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
done | \ done | \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \ END { if (nonempty) { for (i in files) print i; }; }'`; \
shift; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \ test -n "$$unique" || unique=$$empty_fix; \
if test $$# -gt 0; then \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
"$$@" $$unique; \ $$tags $$unique; \
else \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$unique; \
fi; \
fi fi
ctags: CTAGS ctags: CTAGS
CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP) $(TAGS_FILES) $(LISP)
tags=; \
list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \ unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \ done | \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \ END { if (nonempty) { for (i in files) print i; }; }'`; \
test -z "$(CTAGS_ARGS)$$unique" \ test -z "$(CTAGS_ARGS)$$tags$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$unique $$tags $$unique
GTAGS: GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \ here=`$(am__cd) $(top_builddir) && pwd` \
&& $(am__cd) $(top_srcdir) \ && cd $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) "$$here" && gtags -i $(GTAGS_ARGS) $$here
distclean-tags: distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
@ -386,7 +348,7 @@ distdir: $(DISTFILES)
exit 1;; \ exit 1;; \
esac esac
$(am__remove_distdir) $(am__remove_distdir)
test -d "$(distdir)" || mkdir "$(distdir)" test -d $(distdir) || mkdir $(distdir)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \ list='$(DISTFILES)'; \
@ -402,55 +364,38 @@ distdir: $(DISTFILES)
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
if test -d $$d/$$file; then \ if test -d $$d/$$file; then \
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
if test -d "$(distdir)/$$file"; then \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \ fi; \
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
else \ else \
test -f "$(distdir)/$$file" \ test -f $(distdir)/$$file \
|| cp -p $$d/$$file "$(distdir)/$$file" \ || cp -p $$d/$$file $(distdir)/$$file \
|| exit 1; \ || exit 1; \
fi; \ fi; \
done done
@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \ if test "$$subdir" = .; then :; else \
test -d "$(distdir)/$$subdir" \ test -d "$(distdir)/$$subdir" \
|| $(MKDIR_P) "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \
|| exit 1; \ || exit 1; \
fi; \ distdir=`$(am__cd) $(distdir) && pwd`; \
done top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ (cd $$subdir && \
if test "$$subdir" = .; then :; else \
dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
$(am__relativize); \
new_distdir=$$reldir; \
dir1=$$subdir; dir2="$(top_distdir)"; \
$(am__relativize); \
new_top_distdir=$$reldir; \
echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
($(am__cd) $$subdir && \
$(MAKE) $(AM_MAKEFLAGS) \ $(MAKE) $(AM_MAKEFLAGS) \
top_distdir="$$new_top_distdir" \ top_distdir="$$top_distdir" \
distdir="$$new_distdir" \ distdir="$$distdir/$$subdir" \
am__remove_distdir=: \ am__remove_distdir=: \
am__skip_length_check=: \ am__skip_length_check=: \
am__skip_mode_fix=: \
distdir) \ distdir) \
|| exit 1; \ || exit 1; \
fi; \ fi; \
done done
-test -n "$(am__skip_mode_fix)" \ -find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \
|| find "$(distdir)" -type d ! -perm -755 \
-exec chmod u+rwx,go+rx {} \; -o \
! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
! -type d ! -perm -400 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \
! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \
|| chmod -R a+r "$(distdir)" || chmod -R a+r $(distdir)
dist-gzip: distdir dist-gzip: distdir
tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
$(am__remove_distdir) $(am__remove_distdir)
@ -463,10 +408,6 @@ dist-lzma: distdir
tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma
$(am__remove_distdir) $(am__remove_distdir)
dist-xz: distdir
tardir=$(distdir) && $(am__tar) | xz -c >$(distdir).tar.xz
$(am__remove_distdir)
dist-tarZ: distdir dist-tarZ: distdir
tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
$(am__remove_distdir) $(am__remove_distdir)
@ -490,17 +431,15 @@ dist dist-all: distdir
distcheck: dist distcheck: dist
case '$(DIST_ARCHIVES)' in \ case '$(DIST_ARCHIVES)' in \
*.tar.gz*) \ *.tar.gz*) \
GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\ GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\
*.tar.bz2*) \ *.tar.bz2*) \
bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\
*.tar.lzma*) \ *.tar.lzma*) \
lzma -dc $(distdir).tar.lzma | $(am__untar) ;;\ unlzma -c $(distdir).tar.lzma | $(am__untar) ;;\
*.tar.xz*) \
xz -dc $(distdir).tar.xz | $(am__untar) ;;\
*.tar.Z*) \ *.tar.Z*) \
uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
*.shar.gz*) \ *.shar.gz*) \
GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\ GZIP=$(GZIP_ENV) gunzip -c $(distdir).shar.gz | unshar ;;\
*.zip*) \ *.zip*) \
unzip $(distdir).zip ;;\ unzip $(distdir).zip ;;\
esac esac
@ -508,11 +447,9 @@ distcheck: dist
mkdir $(distdir)/_build mkdir $(distdir)/_build
mkdir $(distdir)/_inst mkdir $(distdir)/_inst
chmod a-w $(distdir) chmod a-w $(distdir)
test -d $(distdir)/_build || exit 0; \
dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
&& dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
&& am__cwd=`pwd` \ && cd $(distdir)/_build \
&& $(am__cd) $(distdir)/_build \
&& ../configure --srcdir=.. --prefix="$$dc_install_base" \ && ../configure --srcdir=.. --prefix="$$dc_install_base" \
$(DISTCHECK_CONFIGURE_FLAGS) \ $(DISTCHECK_CONFIGURE_FLAGS) \
&& $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) \
@ -534,15 +471,13 @@ distcheck: dist
&& rm -rf "$$dc_destdir" \ && rm -rf "$$dc_destdir" \
&& $(MAKE) $(AM_MAKEFLAGS) dist \ && $(MAKE) $(AM_MAKEFLAGS) dist \
&& rm -rf $(DIST_ARCHIVES) \ && rm -rf $(DIST_ARCHIVES) \
&& $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck
&& cd "$$am__cwd" \
|| exit 1
$(am__remove_distdir) $(am__remove_distdir)
@(echo "$(distdir) archives ready for distribution: "; \ @(echo "$(distdir) archives ready for distribution: "; \
list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x'
distuninstallcheck: distuninstallcheck:
@$(am__cd) '$(distuninstallcheck_dir)' \ @cd $(distuninstallcheck_dir) \
&& test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \ && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \
|| { echo "ERROR: files left after uninstall:" ; \ || { echo "ERROR: files left after uninstall:" ; \
if test -n "$(DESTDIR)"; then \ if test -n "$(DESTDIR)"; then \
@ -584,7 +519,6 @@ clean-generic:
distclean-generic: distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
maintainer-clean-generic: maintainer-clean-generic:
@echo "This command is intended for maintainers to use" @echo "This command is intended for maintainers to use"
@ -604,8 +538,6 @@ dvi-am:
html: html-recursive html: html-recursive
html-am:
info: info-recursive info: info-recursive
info-am: info-am:
@ -614,28 +546,18 @@ install-data-am:
install-dvi: install-dvi-recursive install-dvi: install-dvi-recursive
install-dvi-am:
install-exec-am: install-exec-am:
install-html: install-html-recursive install-html: install-html-recursive
install-html-am:
install-info: install-info-recursive install-info: install-info-recursive
install-info-am:
install-man: install-man:
install-pdf: install-pdf-recursive install-pdf: install-pdf-recursive
install-pdf-am:
install-ps: install-ps-recursive install-ps: install-ps-recursive
install-ps-am:
installcheck-am: installcheck-am:
maintainer-clean: maintainer-clean-recursive maintainer-clean: maintainer-clean-recursive
@ -658,25 +580,24 @@ ps-am:
uninstall-am: uninstall-am:
.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) all \ .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) install-am \
ctags-recursive install-am install-strip tags-recursive install-strip
.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
all all-am am--refresh check check-am clean clean-generic \ all all-am am--refresh check check-am clean clean-generic \
ctags ctags-recursive dist dist-all dist-bzip2 dist-gzip \ ctags ctags-recursive dist dist-all dist-bzip2 dist-gzip \
dist-lzma dist-shar dist-tarZ dist-xz dist-zip distcheck \ dist-lzma dist-shar dist-tarZ dist-zip distcheck distclean \
distclean distclean-generic distclean-hdr distclean-tags \ distclean-generic distclean-hdr distclean-tags distcleancheck \
distcleancheck distdir distuninstallcheck dvi dvi-am html \ distdir distuninstallcheck dvi dvi-am html html-am info \
html-am info info-am install install-am install-data \ info-am install install-am install-data install-data-am \
install-data-am install-dvi install-dvi-am install-exec \ install-dvi install-dvi-am install-exec install-exec-am \
install-exec-am install-html install-html-am install-info \ install-html install-html-am install-info install-info-am \
install-info-am install-man install-pdf install-pdf-am \ install-man install-pdf install-pdf-am install-ps \
install-ps install-ps-am install-strip installcheck \ install-ps-am install-strip installcheck installcheck-am \
installcheck-am installdirs installdirs-am maintainer-clean \ installdirs installdirs-am maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-generic pdf \ maintainer-clean-generic mostlyclean mostlyclean-generic pdf \
pdf-am ps ps-am tags tags-recursive uninstall uninstall-am pdf-am ps ps-am tags tags-recursive uninstall uninstall-am
# Tell versions [3.59,3.63) of GNU make to not export all variables. # Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded. # Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT: .NOEXPORT:

18
NEWS
View file

@ -5,24 +5,6 @@ See the end for copying conditions.
Please send dhcpd-pools bug reports to kerolasa@iki.fi. Please send dhcpd-pools bug reports to kerolasa@iki.fi.
Version 2.13
* Autoreconf to get ./configure et al up to date.
* PACKAGE_URL introduced to configure.ac
* Dominic Germain sent xml, and detailed xml, outputs patch.
* Dominic Germain pointed out include directive bug, which broke
shared network name.
* Anonymous contrib addition snmptest.pl which should provide
some sort of SNMP integration.
* Range statements have dynamic-bootp flag and it no longer will
break analysis.
Version 2.12
* Dan Thorson fixed formating.
* Roar Pettersen pointed out posix_fadvice portability bug.
* Roar Pettersen pointed out fclose(stdout) portability bug.
* Clean up will ran at exit instead of end of program.
* Stian Øvrevåge pointed out shared network assignment bug.
Version 2.11 Version 2.11
* Dan Thorson fixed memory boundary check for backup leases. * Dan Thorson fixed memory boundary check for backup leases.

2
README
View file

@ -21,7 +21,7 @@ Source code is pretty printed by using indent command switches.
If you write a patch please use same coding style. In general the If you write a patch please use same coding style. In general the
style is copy from Linux kernel. style is copy from Linux kernel.
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=blob_plain;f=Documentation/CodingStyle;hb=HEAD http://escher.sourceforge.net/current/etc/linux-coding-style
A dhcpd-pools home page is located at SourceForge. A dhcpd-pools home page is located at SourceForge.

2
THANKS
View file

@ -13,5 +13,3 @@ Jeff Wieland
Rusty Rusty
Fredrik Vöcks Fredrik Vöcks
Dan Thorson Dan Thorson
Stian Øvrevåge
Dominic Germain

40
TODO
View file

@ -1,22 +1,22 @@
1 Well structured code, with extendible sane architecture. <Todo>
2 Server, which has analysis in cache for N seconds and will
answer via socket.
3 Configuration file for server.
4 State file, where different ranges, shared networks etc have
unique identifiers (needed for graphs).
5 Support for snmp and munin protocols.
6 SNMP traps when limits get exceeded.
7 Some clever check_dhcpd_pools binary for Nagios & other
monitoring software.
8 Super server support, which will collect analysis from other * Configuration parser that does not fail.
dhcpd-pool servers. * Memory allocations to such that recopilation is _never_ needed.
9 Nice http view interface on super server, much can be copied * Bad english to good english translation in all files that
from http://piwik.org/ author has touched. Help needed!
10 IPv6 support. * Shared network sorting. Actual data must not be sorted, but perhaps
11 And some other things perhaps... sorting pointer array might work. That means writing sort
functions and rewrite ouput functions. Don't expect soon.
* All networks analyse.c semantics problem.
* Allocations analysis which is whole new section of output.
* More ./configure options.
When items 1-7 are done v3 can be released. To support rewrite Version 3.x (not in coming soon)
there should be a design document with nice blue print, which is
a web page. Also getting rid of cvs and taking git in use must * Configuration file for this command.
happen. * Convert program to snmp subagent daemon.
* Analysis caching.
* Threshold values -> alarming possibility by snmp traps.
* Template based html page.
</Todo>

166
aclocal.m4 vendored
View file

@ -1,7 +1,7 @@
# generated automatically by aclocal 1.11.1 -*- Autoconf -*- # generated automatically by aclocal 1.10.2 -*- Autoconf -*-
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
# 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. # 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation # This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it, # gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved. # with or without modifications, as long as this notice is preserved.
@ -13,8 +13,8 @@
m4_ifndef([AC_AUTOCONF_VERSION], m4_ifndef([AC_AUTOCONF_VERSION],
[m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.67.69-a1ef66],, m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.63],,
[m4_warning([this file was generated for autoconf 2.67.69-a1ef66. [m4_warning([this file was generated for autoconf 2.63.
You have another version of autoconf. It may work, but is not guaranteed to. You have another version of autoconf. It may work, but is not guaranteed to.
If you have problems, you may need to regenerate the build system entirely. If you have problems, you may need to regenerate the build system entirely.
To do so, use the procedure documented by the package, typically `autoreconf'.])]) To do so, use the procedure documented by the package, typically `autoreconf'.])])
@ -31,10 +31,10 @@ To do so, use the procedure documented by the package, typically `autoreconf'.])
# generated from the m4 files accompanying Automake X.Y. # generated from the m4 files accompanying Automake X.Y.
# (This private macro should not be called outside this file.) # (This private macro should not be called outside this file.)
AC_DEFUN([AM_AUTOMAKE_VERSION], AC_DEFUN([AM_AUTOMAKE_VERSION],
[am__api_version='1.11' [am__api_version='1.10'
dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
dnl require some minimum version. Point them to the right macro. dnl require some minimum version. Point them to the right macro.
m4_if([$1], [1.11.1], [], m4_if([$1], [1.10.2], [],
[AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
]) ])
@ -50,7 +50,7 @@ m4_define([_AM_AUTOCONF_VERSION], [])
# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
# This function is AC_REQUIREd by AM_INIT_AUTOMAKE. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
[AM_AUTOMAKE_VERSION([1.11.1])dnl [AM_AUTOMAKE_VERSION([1.10.2])dnl
m4_ifndef([AC_AUTOCONF_VERSION], m4_ifndef([AC_AUTOCONF_VERSION],
[m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
@ -110,14 +110,14 @@ am_aux_dir=`cd $ac_aux_dir && pwd`
# AM_CONDITIONAL -*- Autoconf -*- # AM_CONDITIONAL -*- Autoconf -*-
# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008 # Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006
# Free Software Foundation, Inc. # Free Software Foundation, Inc.
# #
# This file is free software; the Free Software Foundation # This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it, # gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved. # with or without modifications, as long as this notice is preserved.
# serial 9 # serial 8
# AM_CONDITIONAL(NAME, SHELL-CONDITION) # AM_CONDITIONAL(NAME, SHELL-CONDITION)
# ------------------------------------- # -------------------------------------
@ -130,7 +130,6 @@ AC_SUBST([$1_TRUE])dnl
AC_SUBST([$1_FALSE])dnl AC_SUBST([$1_FALSE])dnl
_AM_SUBST_NOTMAKE([$1_TRUE])dnl _AM_SUBST_NOTMAKE([$1_TRUE])dnl
_AM_SUBST_NOTMAKE([$1_FALSE])dnl _AM_SUBST_NOTMAKE([$1_FALSE])dnl
m4_define([_AM_COND_VALUE_$1], [$2])dnl
if $2; then if $2; then
$1_TRUE= $1_TRUE=
$1_FALSE='#' $1_FALSE='#'
@ -144,14 +143,14 @@ AC_CONFIG_COMMANDS_PRE(
Usually this means the macro was only invoked conditionally.]]) Usually this means the macro was only invoked conditionally.]])
fi])]) fi])])
# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009 # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
# Free Software Foundation, Inc. # Free Software Foundation, Inc.
# #
# This file is free software; the Free Software Foundation # This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it, # gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved. # with or without modifications, as long as this notice is preserved.
# serial 10 # serial 9
# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
# written in clear, in which case automake, when reading aclocal.m4, # written in clear, in which case automake, when reading aclocal.m4,
@ -208,16 +207,6 @@ AC_CACHE_CHECK([dependency style of $depcc],
if test "$am_compiler_list" = ""; then if test "$am_compiler_list" = ""; then
am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
fi fi
am__universal=false
m4_case([$1], [CC],
[case " $depcc " in #(
*\ -arch\ *\ -arch\ *) am__universal=true ;;
esac],
[CXX],
[case " $depcc " in #(
*\ -arch\ *\ -arch\ *) am__universal=true ;;
esac])
for depmode in $am_compiler_list; do for depmode in $am_compiler_list; do
# Setup a source with many dependencies, because some compilers # Setup a source with many dependencies, because some compilers
# like to wrap large dependency lists on column 80 (with \), and # like to wrap large dependency lists on column 80 (with \), and
@ -235,17 +224,7 @@ AC_CACHE_CHECK([dependency style of $depcc],
done done
echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
# We check with `-c' and `-o' for the sake of the "dashmstdout"
# mode. It turns out that the SunPro C++ compiler does not properly
# handle `-M -o', and we need to detect this. Also, some Intel
# versions had trouble with output in subdirs
am__obj=sub/conftest.${OBJEXT-o}
am__minus_obj="-o $am__obj"
case $depmode in case $depmode in
gcc)
# This depmode causes a compiler race in universal mode.
test "$am__universal" = false || continue
;;
nosideeffect) nosideeffect)
# after this tag, mechanisms are not by side-effect, so they'll # after this tag, mechanisms are not by side-effect, so they'll
# only be used when explicitly requested # only be used when explicitly requested
@ -255,23 +234,19 @@ AC_CACHE_CHECK([dependency style of $depcc],
break break
fi fi
;; ;;
msvisualcpp | msvcmsys)
# This compiler won't grok `-c -o', but also, the minuso test has
# not run yet. These depmodes are late enough in the game, and
# so weak that their functioning should not be impacted.
am__obj=conftest.${OBJEXT-o}
am__minus_obj=
;;
none) break ;; none) break ;;
esac esac
# We check with `-c' and `-o' for the sake of the "dashmstdout"
# mode. It turns out that the SunPro C++ compiler does not properly
# handle `-M -o', and we need to detect this.
if depmode=$depmode \ if depmode=$depmode \
source=sub/conftest.c object=$am__obj \ source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
$SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
>/dev/null 2>conftest.err && >/dev/null 2>conftest.err &&
grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
grep $am__obj sub/conftest.Po > /dev/null 2>&1 && grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
${MAKE-make} -s -f confmf > /dev/null 2>&1; then ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
# icc doesn't choke on unknown options, it will just issue warnings # icc doesn't choke on unknown options, it will just issue warnings
# or remarks (even with -Werror). So we grep stderr for any message # or remarks (even with -Werror). So we grep stderr for any message
@ -335,13 +310,12 @@ _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
# gives unlimited permission to copy and/or distribute it, # gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved. # with or without modifications, as long as this notice is preserved.
#serial 5 #serial 4
# _AM_OUTPUT_DEPENDENCY_COMMANDS # _AM_OUTPUT_DEPENDENCY_COMMANDS
# ------------------------------ # ------------------------------
AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
[{ [# Autoconf 2.62 quotes --file arguments for eval, but not when files
# Autoconf 2.62 quotes --file arguments for eval, but not when files
# are listed without --file. Let's play safe and only enable the eval # are listed without --file. Let's play safe and only enable the eval
# if we detect the quoting. # if we detect the quoting.
case $CONFIG_FILES in case $CONFIG_FILES in
@ -389,7 +363,6 @@ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
echo '# dummy' > "$dirpart/$file" echo '# dummy' > "$dirpart/$file"
done done
done done
}
])# _AM_OUTPUT_DEPENDENCY_COMMANDS ])# _AM_OUTPUT_DEPENDENCY_COMMANDS
@ -409,13 +382,13 @@ AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
# Do all the work for Automake. -*- Autoconf -*- # Do all the work for Automake. -*- Autoconf -*-
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
# 2005, 2006, 2008, 2009 Free Software Foundation, Inc. # 2005, 2006, 2008 Free Software Foundation, Inc.
# #
# This file is free software; the Free Software Foundation # This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it, # gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved. # with or without modifications, as long as this notice is preserved.
# serial 16 # serial 13
# This macro actually does too much. Some checks are only needed if # This macro actually does too much. Some checks are only needed if
# your package does certain things. But this isn't really a big deal. # your package does certain things. But this isn't really a big deal.
@ -432,7 +405,7 @@ AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
# arguments mandatory, and then we can depend on a new Autoconf # arguments mandatory, and then we can depend on a new Autoconf
# release and drop the old call support. # release and drop the old call support.
AC_DEFUN([AM_INIT_AUTOMAKE], AC_DEFUN([AM_INIT_AUTOMAKE],
[AC_PREREQ([2.62])dnl [AC_PREREQ([2.60])dnl
dnl Autoconf wants to disallow AM_ names. We explicitly allow dnl Autoconf wants to disallow AM_ names. We explicitly allow
dnl the ones we care about. dnl the ones we care about.
m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
@ -483,8 +456,8 @@ AM_MISSING_PROG(AUTOCONF, autoconf)
AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
AM_MISSING_PROG(AUTOHEADER, autoheader) AM_MISSING_PROG(AUTOHEADER, autoheader)
AM_MISSING_PROG(MAKEINFO, makeinfo) AM_MISSING_PROG(MAKEINFO, makeinfo)
AC_REQUIRE([AM_PROG_INSTALL_SH])dnl AM_PROG_INSTALL_SH
AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl AM_PROG_INSTALL_STRIP
AC_REQUIRE([AM_PROG_MKDIR_P])dnl AC_REQUIRE([AM_PROG_MKDIR_P])dnl
# We need awk for the "check" target. The system "awk" is bad on # We need awk for the "check" target. The system "awk" is bad on
# some platforms. # some platforms.
@ -508,21 +481,8 @@ AC_PROVIDE_IFELSE([AC_PROG_OBJC],
[define([AC_PROG_OBJC], [define([AC_PROG_OBJC],
defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
]) ])
_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl
dnl The `parallel-tests' driver may need to know about EXEEXT, so add the
dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This macro
dnl is hooked onto _AC_COMPILER_EXEEXT early, see below.
AC_CONFIG_COMMANDS_PRE(dnl
[m4_provide_if([_AM_COMPILER_EXEEXT],
[AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
]) ])
dnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion. Do not
dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
dnl mangled by Autoconf and run in a shell conditional statement.
m4_define([_AC_COMPILER_EXEEXT],
m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
# When config.status generates a header, we must update the stamp-h file. # When config.status generates a header, we must update the stamp-h file.
# This file resides in the same directory as the config header # This file resides in the same directory as the config header
@ -545,7 +505,7 @@ for _am_header in $config_headers :; do
done done
echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
# Copyright (C) 2001, 2003, 2005, 2008 Free Software Foundation, Inc. # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
# #
# This file is free software; the Free Software Foundation # This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it, # gives unlimited permission to copy and/or distribute it,
@ -556,14 +516,7 @@ echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_co
# Define $install_sh. # Define $install_sh.
AC_DEFUN([AM_PROG_INSTALL_SH], AC_DEFUN([AM_PROG_INSTALL_SH],
[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
if test x"${install_sh}" != xset; then install_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"}
case $am_aux_dir in
*\ * | *\ *)
install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
*)
install_sh="\${SHELL} $am_aux_dir/install-sh"
esac
fi
AC_SUBST(install_sh)]) AC_SUBST(install_sh)])
# Copyright (C) 2003, 2005 Free Software Foundation, Inc. # Copyright (C) 2003, 2005 Free Software Foundation, Inc.
@ -589,13 +542,13 @@ AC_SUBST([am__leading_dot])])
# Check to see how 'make' treats includes. -*- Autoconf -*- # Check to see how 'make' treats includes. -*- Autoconf -*-
# Copyright (C) 2001, 2002, 2003, 2005, 2009 Free Software Foundation, Inc. # Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc.
# #
# This file is free software; the Free Software Foundation # This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it, # gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved. # with or without modifications, as long as this notice is preserved.
# serial 4 # serial 3
# AM_MAKE_INCLUDE() # AM_MAKE_INCLUDE()
# ----------------- # -----------------
@ -604,7 +557,7 @@ AC_DEFUN([AM_MAKE_INCLUDE],
[am_make=${MAKE-make} [am_make=${MAKE-make}
cat > confinc << 'END' cat > confinc << 'END'
am__doit: am__doit:
@echo this is the am__doit target @echo done
.PHONY: am__doit .PHONY: am__doit
END END
# If we don't find an include directive, just comment out the code. # If we don't find an include directive, just comment out the code.
@ -614,24 +567,24 @@ am__quote=
_am_result=none _am_result=none
# First try GNU make style include. # First try GNU make style include.
echo "include confinc" > confmf echo "include confinc" > confmf
# Ignore all kinds of additional output from `make'. # We grep out `Entering directory' and `Leaving directory'
case `$am_make -s -f confmf 2> /dev/null` in #( # messages which can occur if `w' ends up in MAKEFLAGS.
*the\ am__doit\ target*) # In particular we don't look at `^make:' because GNU make might
# be invoked under some other name (usually "gmake"), in which
# case it prints its new name instead of `make'.
if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
am__include=include am__include=include
am__quote= am__quote=
_am_result=GNU _am_result=GNU
;; fi
esac
# Now try BSD make style include. # Now try BSD make style include.
if test "$am__include" = "#"; then if test "$am__include" = "#"; then
echo '.include "confinc"' > confmf echo '.include "confinc"' > confmf
case `$am_make -s -f confmf 2> /dev/null` in #( if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
*the\ am__doit\ target*)
am__include=.include am__include=.include
am__quote="\"" am__quote="\""
_am_result=BSD _am_result=BSD
;; fi
esac
fi fi
AC_SUBST([am__include]) AC_SUBST([am__include])
AC_SUBST([am__quote]) AC_SUBST([am__quote])
@ -641,14 +594,14 @@ rm -f confinc confmf
# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008 # Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005
# Free Software Foundation, Inc. # Free Software Foundation, Inc.
# #
# This file is free software; the Free Software Foundation # This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it, # gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved. # with or without modifications, as long as this notice is preserved.
# serial 6 # serial 5
# AM_MISSING_PROG(NAME, PROGRAM) # AM_MISSING_PROG(NAME, PROGRAM)
# ------------------------------ # ------------------------------
@ -665,14 +618,7 @@ AC_SUBST($1)])
AC_DEFUN([AM_MISSING_HAS_RUN], AC_DEFUN([AM_MISSING_HAS_RUN],
[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
AC_REQUIRE_AUX_FILE([missing])dnl AC_REQUIRE_AUX_FILE([missing])dnl
if test x"${MISSING+set}" != xset; then test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
case $am_aux_dir in
*\ * | *\ *)
MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
*)
MISSING="\${SHELL} $am_aux_dir/missing" ;;
esac
fi
# Use eval to expand $SHELL # Use eval to expand $SHELL
if eval "$MISSING --run true"; then if eval "$MISSING --run true"; then
am_missing_run="$MISSING --run " am_missing_run="$MISSING --run "
@ -743,14 +689,14 @@ AC_DEFUN([_AM_IF_OPTION],
# Check to make sure that the build environment is sane. -*- Autoconf -*- # Check to make sure that the build environment is sane. -*- Autoconf -*-
# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008 # Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
# Free Software Foundation, Inc. # Free Software Foundation, Inc.
# #
# This file is free software; the Free Software Foundation # This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it, # gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved. # with or without modifications, as long as this notice is preserved.
# serial 5 # serial 4
# AM_SANITY_CHECK # AM_SANITY_CHECK
# --------------- # ---------------
@ -759,29 +705,16 @@ AC_DEFUN([AM_SANITY_CHECK],
# Just in case # Just in case
sleep 1 sleep 1
echo timestamp > conftest.file echo timestamp > conftest.file
# Reject unsafe characters in $srcdir or the absolute working directory
# name. Accept space and tab only in the latter.
am_lf='
'
case `pwd` in
*[[\\\"\#\$\&\'\`$am_lf]]*)
AC_MSG_ERROR([unsafe absolute working directory name]);;
esac
case $srcdir in
*[[\\\"\#\$\&\'\`$am_lf\ \ ]]*)
AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);;
esac
# Do `set' in a subshell so we don't clobber the current shell's # Do `set' in a subshell so we don't clobber the current shell's
# arguments. Must try -L first in case configure is actually a # arguments. Must try -L first in case configure is actually a
# symlink; some systems play weird games with the mod time of symlinks # symlink; some systems play weird games with the mod time of symlinks
# (eg FreeBSD returns the mod time of the symlink's containing # (eg FreeBSD returns the mod time of the symlink's containing
# directory). # directory).
if ( if (
set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
if test "$[*]" = "X"; then if test "$[*]" = "X"; then
# -L didn't work. # -L didn't work.
set X `ls -t "$srcdir/configure" conftest.file` set X `ls -t $srcdir/configure conftest.file`
fi fi
rm -f conftest.file rm -f conftest.file
if test "$[*]" != "X $srcdir/configure conftest.file" \ if test "$[*]" != "X $srcdir/configure conftest.file" \
@ -834,25 +767,18 @@ fi
INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
AC_SUBST([INSTALL_STRIP_PROGRAM])]) AC_SUBST([INSTALL_STRIP_PROGRAM])])
# Copyright (C) 2006, 2008 Free Software Foundation, Inc. # Copyright (C) 2006 Free Software Foundation, Inc.
# #
# This file is free software; the Free Software Foundation # This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it, # gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved. # with or without modifications, as long as this notice is preserved.
# serial 2
# _AM_SUBST_NOTMAKE(VARIABLE) # _AM_SUBST_NOTMAKE(VARIABLE)
# --------------------------- # ---------------------------
# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
# This macro is traced by Automake. # This macro is traced by Automake.
AC_DEFUN([_AM_SUBST_NOTMAKE]) AC_DEFUN([_AM_SUBST_NOTMAKE])
# AM_SUBST_NOTMAKE(VARIABLE)
# ---------------------------
# Public sister of _AM_SUBST_NOTMAKE.
AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
# Check how to create a tarball. -*- Autoconf -*- # Check how to create a tarball. -*- Autoconf -*-
# Copyright (C) 2004, 2005 Free Software Foundation, Inc. # Copyright (C) 2004, 2005 Free Software Foundation, Inc.

View file

@ -94,9 +94,6 @@
/* Define to the one symbol short name of this package. */ /* Define to the one symbol short name of this package. */
#undef PACKAGE_TARNAME #undef PACKAGE_TARNAME
/* Define to the home page for this package. */
#undef PACKAGE_URL
/* Define to the version of this package. */ /* Define to the version of this package. */
#undef PACKAGE_VERSION #undef PACKAGE_VERSION

4039
configure vendored

File diff suppressed because it is too large Load diff

View file

@ -2,8 +2,8 @@
# Process this file with autoconf to produce a configure script. # Process this file with autoconf to produce a configure script.
AC_PREREQ(2.63) AC_PREREQ(2.63)
AC_INIT([dhcpd-pools],[2.13],[kerolasa@iki.fi],,[http://dhcpd-pools.sourceforge.net/]) AC_INIT([dhcpd-pools],[1.10],[kerolasa@iki.fi])
AM_INIT_AUTOMAKE(dhcpd-pools, 2.13) AM_INIT_AUTOMAKE(dhcpd-pools, 1.10)
AC_CONFIG_SRCDIR([config.h.in]) AC_CONFIG_SRCDIR([config.h.in])
AC_CONFIG_HEADERS([config.h]) AC_CONFIG_HEADERS([config.h])
@ -29,8 +29,7 @@ AC_CHECK_HEADERS(getopt.h, AC_DEFINE(HAVE_GETOPT_H),
AC_CONFIG_FILES([Makefile AC_CONFIG_FILES([Makefile
man/Makefile man/Makefile
src/Makefile src/Makefile])
contrib/Makefile])
AC_ARG_WITH(dhcpd-conf, AC_ARG_WITH(dhcpd-conf,
[AC_HELP_STRING([--with-dhcpd-conf], [default path of dhcpd.conf])], [AC_HELP_STRING([--with-dhcpd-conf], [default path of dhcpd.conf])],

View file

@ -1,2 +0,0 @@
contribdir = $(datadir)/dhcpd-pools/
dist_contrib_SCRIPTS = dhcpd-pools.cgi snmptest.pl

View file

@ -1,472 +0,0 @@
#!/usr/bin/perl
# <Note from="Sami Kerola">
# This script is anonymous user contribution (due legal
# department did not let the person the get credit because
# they are afraid open source contributions). You know who you
# are, and I am graceful to get this to be part of the
# package.
# </Note>
# 1) modify snmpd.conf and add the following line. Note that the
# last field must match the path/name of the script:
#
# pass_persist .1.3.6.1.4.1.2021.250.255 /root/snmptest.pl
#
# This assumes you've already configured snmpd, i.e. community
# strings, etc.
#
# 2) Install the following script. Note that if you changed the
# OID string above, then you'll need to change the value for
# $root in this file, too. Be sure that $datafile is set to
# the location of the .CSV output from dhcpd-pools. NOTE: if
# you set $dbg to 1 then output will be generated in /tmp.
use strict;
# Version info:
my $SNMPver = "snmp1.0";
my $DHCPver = "dhcp1.0";
my $VERSION = "$SNMPver/$DHCPver";
#
# set $dbg to a non-zero value to get debug output in /tmp
#
my $dbg=0;
#
# Here's an example entry for snmpd.conf:
# pass_persist .1.3.6.1.4.1.2021.250.255 /path/to/this/script.pl
# so in this case $root should be '.1.3.6.1.4.1.2021.250.255'
#
# $root.1.x : shared network name for index x
# $root.2.x : IP range name for index x
# $root.3.x : Range Contained-In for index x
# $root.4.x : Shared Net Stats for index x
# $root.5.x : IP range stats for index x
#
# $root.4.1.x : 'max' value for shared network at index=x
# $root.4.2.x : 'cur' value for shared network at index=x
# $root.4.3.x : 'tou' value for shared network at index=x
#
# $root.5.1.x : 'max' value for IP range at index=x
# $root.5.2.x : 'cur' value for IP range at index=x
# $root.5.3.x : 'tou' value for IP range at index=x
#
# $root must match pass_persis entry in snmpd.conf
#
my $root='.1.3.6.1.4.1.2021.250.255';
#
# $datafile is the location of the .CSV file created by dhcpd-pools.
# NOTE: It is assumed that this file is routinely updated, i.e. at least
# every 5 minutes, by some other process, i.e. cron.
#
my $datafile='/var/lib/dhcp/dhcpstats.csv';
#
# $cachetime determines how long we can cache parse data from $datafile. If
# more than $cachetime has elapsed we'll re-read $datafile, otherwise we'll
# just send back the last-parsed data
#
# Generally 60 seconds seems pretty reasonable, but any positive value is
# permitted.
#
my $cachetime = 60;
#
# global variables for DHCP
#
my %SharedNetwork;
my %RangeName;
my %RangeContained;
my @SNNindex;
my @IPRNindex;
#
# global variables for SNMP
#
my @validoidlist;
########## BEGIN UNIQUE-CODE FOR YOUR SNMP-QUERY NEEDS
#
# ParseDataFile does just that, and stores info in %SharedNetwork for later
# processing.
#
# The routine ParseDataFile is calls at invocation to initialize all
# datasets and also periodically (based on $cachetime).
#
my @where = qw( unknown Ranges SharedNets SumData );
sub ParseDataFile () {
print DBG "ParseDataFile\n" if $dbg;
my $where = 0; # location in file unknown
# used to generate ifIndex-like values for each Shared network
my $shareindex = 1;
# used to generate ifIndex-like values for each Shared network
my $rangeindex = 1;
undef %SharedNetwork;
undef %RangeName;
undef %RangeContained;
undef @SNNindex;
undef @IPRNindex;
@validoidlist = ();
open(IN, $datafile) || return undef;
while (<IN>) {
chomp;
print DBG "...Read: $_\n" if $dbg;
next if /^\s*$/; # skip blank lines
next if /^"shared net name"/; # skip titles
next if /^"name","max","cur"/; # skip titles
if (/^"Ranges/) { $where = 1; next; }
if (/^"Shared/) { $where = 2; next; }
if (/^"Sum of/) { $where = 3; next; }
print DBG "...Found data for @where[$where]: $_\n" if $dbg;
#
# "Ranges:"
# 0 1 2 3 4 5 6 7 8
# "shared net name","1stIP","lastIP","max","cur","%","touch","t+c","t+c %"
#
# "Shared networks:" and "Sum of all ranges:"
# 0 1 2 3 4 5 6
# "name","max","cur","%","touch","t+c","t+c %"
#
my @data = split /,/;
my ($nam, $max, $cur, $tou, $fir);
($nam = @data[0]) =~ s/"//g; # shared net name
($fir = @data[1]) =~ s/"//g if ($where == 1); # Range ID (1st IP)
($max = @data[3]) =~ s/"//g if ($where == 1); # max # of IPs
($max = @data[1]) =~ s/"//g if ($where > 1); # max # of IPs
($cur = @data[4]) =~ s/"//g if ($where == 1); # cur # of IPs
($cur = @data[2]) =~ s/"//g if ($where > 1); # cur # of IPs
($tou = @data[6]) =~ s/"//g if ($where == 1); # touched IP's
($tou = @data[4]) =~ s/"//g if ($where > 1); # touched IP's
print DBG "...idx sh/rg=$shareindex/$rangeindex : nam=$nam : max=$max : cur=$cur : tou=$tou\n" if $dbg;
#
# Summary data for each IP range
#
if ($where == 1) { # Store IP range data
if (defined($RangeName{$fir})) {
print DBG "...WARNING: duplicate name '$fir'\n" if $dbg
}
$IPRNindex[$rangeindex] = $fir;
$RangeName{$fir} = pack("LLLL", $rangeindex, $max, $cur, $tou);
$RangeContained{$fir} = $nam;
push @validoidlist, "$root.2.$rangeindex"; # IP range name
push @validoidlist, "$root.3.$rangeindex"; # Contained In
push @validoidlist, "$root.5.1.$rangeindex"; # range stats
push @validoidlist, "$root.5.2.$rangeindex"; # range stats
push @validoidlist, "$root.5.3.$rangeindex"; # range stats
$rangeindex++;
}
#
# Summary data for each Shared network
#
if ($where == 2) { # Store Shared network summary data
if (defined($SharedNetwork{$nam})) {
print DBG "...WARNING: duplicate name '$nam'\n" if $dbg
}
$SNNindex[$shareindex] = $nam;
$SharedNetwork{$nam} = pack("LLLL", $shareindex, $max, $cur, $tou);
push @validoidlist, "$root.1.$shareindex"; # shared name
push @validoidlist, "$root.4.1.$shareindex"; # shared stats
push @validoidlist, "$root.4.2.$shareindex"; # shared stats
push @validoidlist, "$root.4.3.$shareindex"; # shared stats
$shareindex++;
}
#
# Summary data for everything
#
if ($where == 3) { # Store "All" network summary data
print DBG "...We don't store 'All' info yet!\n" if $dbg;
}
}
close IN;
if ($dbg) {
foreach (sort @validoidlist) { print DBG "ValidOID: $_\n"; }
}
if ($dbg) {
foreach (@IPRNindex) {
print DBG "IP range $_\n";
}
foreach (@SNNindex) {
print DBG "Shared Net $_\n";
}
}
}
#############################################################################
#############################################################################
#############################################################################
# Forward Declarations
#
sub SendReturnNone ();
sub SendReturn($$$);
#
# GetData gets data, but will leverage caching of data if last parse was
# over 60 seconds ago
#
my $lasttime = 0;
sub GetData ($) {
my $oid = shift;
(my $suboid = $oid) =~ s/$root//;
#
# If enough time has elapsed, go fetch fresh data, otherwise use cached
# data
#
print DBG "GetData: Time is: ", time, " : oid $oid->$suboid\n" if $dbg;
if ((time - $lasttime) > $cachetime) {
ParseDataFile();
$lasttime = time;
}
#
# Quick sanity check of OID string:
#
if ( (!($oid =~ /^$root/)) ||
($suboid eq '') ) {
SendReturnNone();
return;
}
#
# split the remaining OID pieces to analyse
#
my @oidlist = split(/\./, $suboid);
###################### EDIT THIS FOR YOUR APPLICATION ######################
#
# If we only get a single value, then barf (we need 2)
#
my $good = 0;
$good = 1 if (($oidlist[1] eq '1') && ($#oidlist == 2)); # shared name
$good = 1 if (($oidlist[1] eq '2') && ($#oidlist == 2)); # ip range name
$good = 1 if (($oidlist[1] eq '3') && ($#oidlist == 2)); # contained in
$good = 1 if (($oidlist[1] eq '4') && ($#oidlist == 3)); # shared-range stats
$good = 1 if (($oidlist[1] eq '5') && ($#oidlist == 3)); # ip-range stats
if (!$good) {
print DBG "oidlistcount = $#oidlist and oidlist1 is ", $oidlist[1], "\n" if $dbg;
SendReturnNone();
return;
}
# $oidlist[1] = 1-5
# $oidlist[2] = index for shared-name or range-name
# or datatype to return
# $oidlist[3] = index for datatype
#
if ($oidlist[1] eq '1') { # looking for name associated with shared net
SendReturn($oid, 'string', $SNNindex[$oidlist[2]]);
return;
}
if ($oidlist[1] eq '2') { # looking for name associated with ip range
print DBG "Responding with IPRNindex[$oidlist[2]]\n" if $dbg;
SendReturn($oid, 'string', $IPRNindex[$oidlist[2]]);
return;
}
if ($oidlist[1] eq '3') { # looking for contained-in info
if (defined($IPRNindex[$oidlist[2]])) { # valid subnet!
my $fir = $IPRNindex[$oidlist[2]];
my $con = $RangeContained{$fir};
my @vals= unpack("LLLL", $SharedNetwork{$con});
print DBG "fir=$fir : con=$con : vals=@vals : vals0=$vals[0]\n" if $dbg;
SendReturn($oid, 'integer', @vals[0]);
return;
} else {
SendReturnNone();
return;
}
}
if ($oidlist[1] eq '4') {
if (defined($SNNindex[$oidlist[3]])) { # valid subnet!
my $nam = $SNNindex[$oidlist[3]];
my @vals= unpack("LLLL", $SharedNetwork{$nam});
print DBG "nam=$nam, vals=@vals, oidlist[2]=$oidlist[2]\n" if $dbg;
SendReturn($oid, 'integer', @vals[$oidlist[2]]);
return;
} else {
print DBG "invalid subnet SNN $oidlist[3]\n" if $dbg;
SendReturnNone();
return;
}
}
if ($oidlist[1] eq '5') {
if (defined($IPRNindex[$oidlist[3]])) { # valid subnet!
my $fir = $IPRNindex[$oidlist[3]];
my @vals= unpack("LLLL", $RangeName{$fir});
print DBG "fir=$fir, vals=@vals, oidlist[2]=", $oidlist[2], "\n" if $dbg;
SendReturn($oid, 'integer', @vals[$oidlist[2]]);
return;
} else {
print DBG "invalid subnet IPRN $oidlist[3]\n" if $dbg;
SendReturnNone();
return;
}
}
################## END EDIT THIS FOR YOUR APPLICATION ######################
}
#############################################################################
#############################################################################
#############################################################################
#
# From here down the routines should NEVER change
#
#
# SNMP-specific routines
#
{ ######## limit scope for some variable
#
# Compare looks at the OID validoid and userquery
# and returns +1 if userquery > validoid
# and returns -1 if userquery < validoid
# and returns 0 if userquery = validoid
#
my @validoid;
my @userquery;
sub Compare () {
my $i=1;
while (($i <= $#validoid) && ($i <= $#userquery)) {
# print DBG "Comparing $validoid[$i] vs $userquery[$i]\n" if $dbg;
if ($userquery[$i] > $validoid[$i]) { return +1; }
if ($userquery[$i] < $validoid[$i]) { return -1; }
$i++;
}
$i--;
my $returnval = 0;
$returnval = +1 if (($i < $#userquery) && ($i == $#validoid));
$returnval = -1 if (($i == $#userquery) && ($i < $#validoid));
return $returnval;
}
#
# FindNext looks through the list of validoid's trying to find the Next
# oid after $oid (aka @userquery)
#
sub FindNext ($) {
my $userqueryoid = shift;
print DBG "FindNext($userqueryoid)\n" if $dbg;
my $next = $validoidlist[0];
@userquery = split (/\./, $userqueryoid);
my $found = 0;
foreach (sort @validoidlist) {
$next = $_;
print DBG "Comparing $userqueryoid vs. $_\n" if $dbg;
@validoid = split (/\./, $_);
my $x = Compare();
if ($x < 0) {
$found = 1;
last;
}
}
if (!$found) { return undef; }
print DBG "Returning $next as next valid OID\n" if $dbg;
return $next;
}
} ######### end scope limit
sub SendReturnNone () {
print "NONE\n";
print DBG "Sent NONE\n" if $dbg;
}
sub SendReturn($$$) {
printf "%s\n%s\n%s\n", shift, shift, shift;
}
my $line=0;
sub Get ($$) {
my $cmd = shift;
my $oid = shift;
GetData($oid);
$line = 0;
}
sub GetNext ($$) {
my $cmd = shift;
my $oid = shift;
$oid = FindNext($oid);
if (defined($oid)) {
GetData($oid);
} else {
SendReturnNone();
}
$line = 0;
}
sub Set ($$$) {
my $cmd = shift;
my $oid = shift;
my $tv = shift;
print "not-writable\n"; # we don't support snmpset
print DBG "Sent not-writable\n" if $dbg;
$line = 0;
}
sub Pong {
print "PONG\n";
print DBG "PONG Sent\n" if $dbg;
$line = 0;
}
################################## START ##################################
#
# Main
#
select((select(STDOUT), $| = 1)[0]);
if ($dbg) {
open(DBG, ">/tmp/snmp.dbg") || die ("Can't open debug!");
select((select(DBG), $| = 1)[0]);
print DBG "Version $VERSION\n";
}
# Initialize Data
ParseDataFile();
my $cmd;
my $oid;
my $tv;
while (<STDIN>) {
$line++;
chomp;
s/ //g;
tr/A-Z/a-z/;
printf DBG "%3d '%s'\n", $line, $_ if $dbg;
last if ($_ eq '');
$cmd = $_ if ($line == 1);
$oid = $_ if ($line == 2);
$tv = $_ if ($line == 3);
Pong() if ($cmd eq 'ping');
Get($cmd, $oid) if (($cmd eq 'get') && ($line == 2));
GetNext($cmd, $oid) if (($cmd eq 'getnext') && ($line == 2));
Set($cmd, $oid, $tv) if (($cmd eq 'set') && ($line == 3));
}
print DBG "Clean Exit\n" if $dbg;
close DBG if $dbg;
exit 0;

View file

@ -1,9 +1,8 @@
# Makefile.in generated by automake 1.11.1 from Makefile.am. # Makefile.in generated by automake 1.10.2 from Makefile.am.
# @configure_input@ # @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, # 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
# Inc.
# This Makefile.in is free software; the Free Software Foundation # This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it, # gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved. # with or without modifications, as long as this notice is preserved.
@ -14,12 +13,10 @@
# PARTICULAR PURPOSE. # PARTICULAR PURPOSE.
@SET_MAKE@ @SET_MAKE@
VPATH = @srcdir@ VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@ pkgdatadir = $(datadir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@
pkglibexecdir = $(libexecdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644 install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c install_sh_PROGRAM = $(install_sh) -c
@ -32,9 +29,8 @@ POST_INSTALL = :
NORMAL_UNINSTALL = : NORMAL_UNINSTALL = :
PRE_UNINSTALL = : PRE_UNINSTALL = :
POST_UNINSTALL = : POST_UNINSTALL = :
subdir = contrib subdir = man
DIST_COMMON = $(dist_contrib_SCRIPTS) $(srcdir)/Makefile.am \ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
$(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__aclocal_m4_deps = $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
@ -42,32 +38,12 @@ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = $(top_builddir)/config.h CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES = CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
am__vpath_adj = case $$p in \
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
*) f=$$p;; \
esac;
am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
am__install_max = 40
am__nobase_strip_setup = \
srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
am__nobase_strip = \
for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
am__nobase_list = $(am__nobase_strip_setup); \
for p in $$list; do echo "$$p $$p"; done | \
sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
$(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
if (++n[$$2] == $(am__install_max)) \
{ print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
END { for (dir in files) print dir, files[dir] }'
am__base_list = \
sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
am__installdirs = "$(DESTDIR)$(contribdir)"
SCRIPTS = $(dist_contrib_SCRIPTS)
SOURCES = SOURCES =
DIST_SOURCES = DIST_SOURCES =
man1dir = $(mandir)/man1
am__installdirs = "$(DESTDIR)$(man1dir)"
NROFF = nroff
MANS = $(man_MANS)
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@ ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@ AMTAR = @AMTAR@
@ -106,7 +82,6 @@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@ PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@ PATH_SEPARATOR = @PATH_SEPARATOR@
SET_MAKE = @SET_MAKE@ SET_MAKE = @SET_MAKE@
@ -155,8 +130,9 @@ target_alias = @target_alias@
top_build_prefix = @top_build_prefix@ top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@ top_builddir = @top_builddir@
top_srcdir = @top_srcdir@ top_srcdir = @top_srcdir@
contribdir = $(datadir)/dhcpd-pools/ man_MANS = dhcpd-pools.1
dist_contrib_SCRIPTS = dhcpd-pools.cgi snmptest.pl EXTRA_DIST = $(man_MANS)
MAINTAINERCLEANFILES = $(man_MANS)
all: all-am all: all-am
.SUFFIXES: .SUFFIXES:
@ -169,9 +145,9 @@ $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
exit 1;; \ exit 1;; \
esac; \ esac; \
done; \ done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu contrib/Makefile'; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnits man/Makefile'; \
$(am__cd) $(top_srcdir) && \ cd $(top_srcdir) && \
$(AUTOMAKE) --gnu contrib/Makefile $(AUTOMAKE) --gnits man/Makefile
.PRECIOUS: Makefile .PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \ @case '$?' in \
@ -189,41 +165,51 @@ $(top_srcdir)/configure: $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): $(am__aclocal_m4_deps) $(ACLOCAL_M4): $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(am__aclocal_m4_deps): install-man1: $(man1_MANS) $(man_MANS)
install-dist_contribSCRIPTS: $(dist_contrib_SCRIPTS)
@$(NORMAL_INSTALL) @$(NORMAL_INSTALL)
test -z "$(contribdir)" || $(MKDIR_P) "$(DESTDIR)$(contribdir)" test -z "$(man1dir)" || $(MKDIR_P) "$(DESTDIR)$(man1dir)"
@list='$(dist_contrib_SCRIPTS)'; test -n "$(contribdir)" || list=; \ @list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \
for p in $$list; do \ l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ for i in $$l2; do \
if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \ case "$$i" in \
done | \ *.1*) list="$$list $$i" ;; \
sed -e 'p;s,.*/,,;n' \ esac; \
-e 'h;s|.*|.|' \ done; \
-e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \ for i in $$list; do \
$(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \ if test -f $$i; then file=$$i; \
{ d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ else file=$(srcdir)/$$i; fi; \
if ($$2 == $$4) { files[d] = files[d] " " $$1; \ ext=`echo $$i | sed -e 's/^.*\\.//'`; \
if (++n[d] == $(am__install_max)) { \ case "$$ext" in \
print "f", d, files[d]; n[d] = 0; files[d] = "" } } \ 1*) ;; \
else { print "f", d "/" $$4, $$1 } } \ *) ext='1' ;; \
END { for (d in files) print "f", d, files[d] }' | \ esac; \
while read type dir files; do \ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ inst=`echo $$inst | sed -e 's/^.*\///'`; \
test -z "$$files" || { \ inst=`echo $$inst | sed '$(transform)'`.$$ext; \
echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(contribdir)$$dir'"; \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \
$(INSTALL_SCRIPT) $$files "$(DESTDIR)$(contribdir)$$dir" || exit $$?; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst"; \
} \ done
; done uninstall-man1:
uninstall-dist_contribSCRIPTS:
@$(NORMAL_UNINSTALL) @$(NORMAL_UNINSTALL)
@list='$(dist_contrib_SCRIPTS)'; test -n "$(contribdir)" || exit 0; \ @list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \
files=`for p in $$list; do echo "$$p"; done | \ l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \
sed -e 's,.*/,,;$(transform)'`; \ for i in $$l2; do \
test -n "$$list" || exit 0; \ case "$$i" in \
echo " ( cd '$(DESTDIR)$(contribdir)' && rm -f" $$files ")"; \ *.1*) list="$$list $$i" ;; \
cd "$(DESTDIR)$(contribdir)" && rm -f $$files esac; \
done; \
for i in $$list; do \
ext=`echo $$i | sed -e 's/^.*\\.//'`; \
case "$$ext" in \
1*) ;; \
*) ext='1' ;; \
esac; \
inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
inst=`echo $$inst | sed -e 's/^.*\///'`; \
inst=`echo $$inst | sed '$(transform)'`.$$ext; \
echo " rm -f '$(DESTDIR)$(man1dir)/$$inst'"; \
rm -f "$(DESTDIR)$(man1dir)/$$inst"; \
done
tags: TAGS tags: TAGS
TAGS: TAGS:
@ -247,25 +233,21 @@ distdir: $(DISTFILES)
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
if test -d $$d/$$file; then \ if test -d $$d/$$file; then \
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
if test -d "$(distdir)/$$file"; then \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \ fi; \
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
else \ else \
test -f "$(distdir)/$$file" \ test -f $(distdir)/$$file \
|| cp -p $$d/$$file "$(distdir)/$$file" \ || cp -p $$d/$$file $(distdir)/$$file \
|| exit 1; \ || exit 1; \
fi; \ fi; \
done done
check-am: all-am check-am: all-am
check: check-am check: check-am
all-am: Makefile $(SCRIPTS) all-am: Makefile $(MANS)
installdirs: installdirs:
for dir in "$(DESTDIR)$(contribdir)"; do \ for dir in "$(DESTDIR)$(man1dir)"; do \
test -z "$$dir" || $(MKDIR_P) "$$dir"; \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \
done done
install: install-am install: install-am
@ -288,11 +270,11 @@ clean-generic:
distclean-generic: distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
maintainer-clean-generic: maintainer-clean-generic:
@echo "This command is intended for maintainers to use" @echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild." @echo "it deletes files that may require special tools to rebuild."
-test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
clean: clean-am clean: clean-am
clean-am: clean-generic mostlyclean-am clean-am: clean-generic mostlyclean-am
@ -307,38 +289,26 @@ dvi-am:
html: html-am html: html-am
html-am:
info: info-am info: info-am
info-am: info-am:
install-data-am: install-dist_contribSCRIPTS install-data-am: install-man
install-dvi: install-dvi-am install-dvi: install-dvi-am
install-dvi-am:
install-exec-am: install-exec-am:
install-html: install-html-am install-html: install-html-am
install-html-am:
install-info: install-info-am install-info: install-info-am
install-info-am: install-man: install-man1
install-man:
install-pdf: install-pdf-am install-pdf: install-pdf-am
install-pdf-am:
install-ps: install-ps-am install-ps: install-ps-am
install-ps-am:
installcheck-am: installcheck-am:
maintainer-clean: maintainer-clean-am maintainer-clean: maintainer-clean-am
@ -357,22 +327,22 @@ ps: ps-am
ps-am: ps-am:
uninstall-am: uninstall-dist_contribSCRIPTS uninstall-am: uninstall-man
uninstall-man: uninstall-man1
.MAKE: install-am install-strip .MAKE: install-am install-strip
.PHONY: all all-am check check-am clean clean-generic distclean \ .PHONY: all all-am check check-am clean clean-generic distclean \
distclean-generic distdir dvi dvi-am html html-am info info-am \ distclean-generic distdir dvi dvi-am html html-am info info-am \
install install-am install-data install-data-am \ install install-am install-data install-data-am install-dvi \
install-dist_contribSCRIPTS install-dvi install-dvi-am \ install-dvi-am install-exec install-exec-am install-html \
install-exec install-exec-am install-html install-html-am \ install-html-am install-info install-info-am install-man \
install-info install-info-am install-man install-pdf \ install-man1 install-pdf install-pdf-am install-ps \
install-pdf-am install-ps install-ps-am install-strip \ install-ps-am install-strip installcheck installcheck-am \
installcheck installcheck-am installdirs maintainer-clean \ installdirs maintainer-clean maintainer-clean-generic \
maintainer-clean-generic mostlyclean mostlyclean-generic pdf \ mostlyclean mostlyclean-generic pdf pdf-am ps ps-am uninstall \
pdf-am ps ps-am uninstall uninstall-am \ uninstall-am uninstall-man uninstall-man1
uninstall-dist_contribSCRIPTS
# Tell versions [3.59,3.63) of GNU make to not export all variables. # Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded. # Otherwise a system limit (for SysV at least) may be exceeded.

View file

@ -1,9 +1,8 @@
# Makefile.in generated by automake 1.11.1 from Makefile.am. # Makefile.in generated by automake 1.10.2 from Makefile.am.
# @configure_input@ # @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, # 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
# Inc.
# This Makefile.in is free software; the Free Software Foundation # This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it, # gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved. # with or without modifications, as long as this notice is preserved.
@ -16,9 +15,8 @@
@SET_MAKE@ @SET_MAKE@
VPATH = @srcdir@ VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@ pkgdatadir = $(datadir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@
pkglibexecdir = $(libexecdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644 install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c install_sh_PROGRAM = $(install_sh) -c
@ -40,30 +38,8 @@ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = $(top_builddir)/config.h CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES = CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
SOURCES = SOURCES =
DIST_SOURCES = DIST_SOURCES =
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
am__vpath_adj = case $$p in \
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
*) f=$$p;; \
esac;
am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
am__install_max = 40
am__nobase_strip_setup = \
srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
am__nobase_strip = \
for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
am__nobase_list = $(am__nobase_strip_setup); \
for p in $$list; do echo "$$p $$p"; done | \
sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
$(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
if (++n[$$2] == $(am__install_max)) \
{ print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
END { for (dir in files) print dir, files[dir] }'
am__base_list = \
sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
man1dir = $(mandir)/man1 man1dir = $(mandir)/man1
am__installdirs = "$(DESTDIR)$(man1dir)" am__installdirs = "$(DESTDIR)$(man1dir)"
NROFF = nroff NROFF = nroff
@ -106,7 +82,6 @@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@ PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@ PATH_SEPARATOR = @PATH_SEPARATOR@
SET_MAKE = @SET_MAKE@ SET_MAKE = @SET_MAKE@
@ -171,7 +146,7 @@ $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
esac; \ esac; \
done; \ done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu man/Makefile'; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu man/Makefile'; \
$(am__cd) $(top_srcdir) && \ cd $(top_srcdir) && \
$(AUTOMAKE) --gnu man/Makefile $(AUTOMAKE) --gnu man/Makefile
.PRECIOUS: Makefile .PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@ -190,45 +165,51 @@ $(top_srcdir)/configure: $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): $(am__aclocal_m4_deps) $(ACLOCAL_M4): $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(am__aclocal_m4_deps): install-man1: $(man1_MANS) $(man_MANS)
install-man1: $(man_MANS)
@$(NORMAL_INSTALL) @$(NORMAL_INSTALL)
test -z "$(man1dir)" || $(MKDIR_P) "$(DESTDIR)$(man1dir)" test -z "$(man1dir)" || $(MKDIR_P) "$(DESTDIR)$(man1dir)"
@list=''; test -n "$(man1dir)" || exit 0; \ @list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \
{ for i in $$list; do echo "$$i"; done; \ l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \
l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ for i in $$l2; do \
sed -n '/\.1[a-z]*$$/p'; \ case "$$i" in \
} | while read p; do \ *.1*) list="$$list $$i" ;; \
if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ esac; \
echo "$$d$$p"; echo "$$p"; \
done | \
sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \
-e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \
sed 'N;N;s,\n, ,g' | { \
list=; while read file base inst; do \
if test "$$base" = "$$inst"; then list="$$list $$file"; else \
echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \
$(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \
fi; \
done; \ done; \
for i in $$list; do echo "$$i"; done | $(am__base_list) | \ for i in $$list; do \
while read files; do \ if test -f $$i; then file=$$i; \
test -z "$$files" || { \ else file=$(srcdir)/$$i; fi; \
echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \ ext=`echo $$i | sed -e 's/^.*\\.//'`; \
$(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \ case "$$ext" in \
done; } 1*) ;; \
*) ext='1' ;; \
esac; \
inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
inst=`echo $$inst | sed -e 's/^.*\///'`; \
inst=`echo $$inst | sed '$(transform)'`.$$ext; \
echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \
$(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst"; \
done
uninstall-man1: uninstall-man1:
@$(NORMAL_UNINSTALL) @$(NORMAL_UNINSTALL)
@list=''; test -n "$(man1dir)" || exit 0; \ @list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \
files=`{ for i in $$list; do echo "$$i"; done; \ l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \
l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ for i in $$l2; do \
sed -n '/\.1[a-z]*$$/p'; \ case "$$i" in \
} | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ *.1*) list="$$list $$i" ;; \
-e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ esac; \
test -z "$$files" || { \ done; \
echo " ( cd '$(DESTDIR)$(man1dir)' && rm -f" $$files ")"; \ for i in $$list; do \
cd "$(DESTDIR)$(man1dir)" && rm -f $$files; } ext=`echo $$i | sed -e 's/^.*\\.//'`; \
case "$$ext" in \
1*) ;; \
*) ext='1' ;; \
esac; \
inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
inst=`echo $$inst | sed -e 's/^.*\///'`; \
inst=`echo $$inst | sed '$(transform)'`.$$ext; \
echo " rm -f '$(DESTDIR)$(man1dir)/$$inst'"; \
rm -f "$(DESTDIR)$(man1dir)/$$inst"; \
done
tags: TAGS tags: TAGS
TAGS: TAGS:
@ -237,19 +218,6 @@ CTAGS:
distdir: $(DISTFILES) distdir: $(DISTFILES)
@list='$(MANS)'; if test -n "$$list"; then \
list=`for p in $$list; do \
if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
if test -f "$$d$$p"; then echo "$$d$$p"; else :; fi; done`; \
if test -n "$$list" && \
grep 'ab help2man is required to generate this page' $$list >/dev/null; then \
echo "error: found man pages containing the \`missing help2man' replacement text:" >&2; \
grep -l 'ab help2man is required to generate this page' $$list | sed 's/^/ /' >&2; \
echo " to fix them, install help2man, remove and regenerate the man pages;" >&2; \
echo " typically \`make maintainer-clean' will remove them" >&2; \
exit 1; \
else :; fi; \
else :; fi
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \ list='$(DISTFILES)'; \
@ -265,17 +233,13 @@ distdir: $(DISTFILES)
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
if test -d $$d/$$file; then \ if test -d $$d/$$file; then \
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
if test -d "$(distdir)/$$file"; then \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \ fi; \
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
else \ else \
test -f "$(distdir)/$$file" \ test -f $(distdir)/$$file \
|| cp -p $$d/$$file "$(distdir)/$$file" \ || cp -p $$d/$$file $(distdir)/$$file \
|| exit 1; \ || exit 1; \
fi; \ fi; \
done done
@ -306,7 +270,6 @@ clean-generic:
distclean-generic: distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
maintainer-clean-generic: maintainer-clean-generic:
@echo "This command is intended for maintainers to use" @echo "This command is intended for maintainers to use"
@ -326,8 +289,6 @@ dvi-am:
html: html-am html: html-am
html-am:
info: info-am info: info-am
info-am: info-am:
@ -336,28 +297,18 @@ install-data-am: install-man
install-dvi: install-dvi-am install-dvi: install-dvi-am
install-dvi-am:
install-exec-am: install-exec-am:
install-html: install-html-am install-html: install-html-am
install-html-am:
install-info: install-info-am install-info: install-info-am
install-info-am:
install-man: install-man1 install-man: install-man1
install-pdf: install-pdf-am install-pdf: install-pdf-am
install-pdf-am:
install-ps: install-ps-am install-ps: install-ps-am
install-ps-am:
installcheck-am: installcheck-am:
maintainer-clean: maintainer-clean-am maintainer-clean: maintainer-clean-am
@ -393,7 +344,6 @@ uninstall-man: uninstall-man1
mostlyclean mostlyclean-generic pdf pdf-am ps ps-am uninstall \ mostlyclean mostlyclean-generic pdf pdf-am ps ps-am uninstall \
uninstall-am uninstall-man uninstall-man1 uninstall-am uninstall-man uninstall-man1
# Tell versions [3.59,3.63) of GNU make to not export all variables. # Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded. # Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT: .NOEXPORT:

View file

@ -5,12 +5,12 @@
.\" Add'l ontributions by: .\" Add'l ontributions by:
.\" Dan Thorson .\" Dan Thorson
.\" .\"
.TH DHCPD-POOLS 1 "Jan 21 2011" "SourceForge" "ISC dhcpd analysis" .TH DHCPD-POOLS 1 "Feb 11 2009" "SourceForge" "ISC dhcpd analysis"
.SH NAME .SH NAME
dhcpd-pools \- ISC dhcpd pools usage analysis dhcpd-pools \- ISC dhcpd pools usage analysis
.SH SYNOPSIS .SH SYNOPSIS
.B dhcpd-pools .B dhcpd-pools
[-c file] [-l file] [-f thcxX] [-s nimcptTe] [-r] [-o file] [-L nr] [-v] [-h] [-c file] [-l file] [-f thHc] [-s nimcptTe] [-r] [-o file] [-L nr] [-v] [-h]
.SH DESCRIPTION .SH DESCRIPTION
The program analyses ISC dhcpd shared network and pool usage and outputs the The program analyses ISC dhcpd shared network and pool usage and outputs the
results in a user selectable format. results in a user selectable format.
@ -74,8 +74,6 @@ Output format. Currently there is text, html, full-html and csv
(comma-separated values). Default is text. Standard html (h) outputs only (comma-separated values). Default is text. Standard html (h) outputs only
the HTML tables, and is useful for embeding more complex web pages. the HTML tables, and is useful for embeding more complex web pages.
Full-html (H) provides complete HTML headers, etc., including in-line CSS. Full-html (H) provides complete HTML headers, etc., including in-line CSS.
Output format xml (x) is similar to the dhcpstatus Perl module output. The
extended xml (X) format will print ethernet address details.
.TP .TP
.I "\-o, \-\-output" .I "\-o, \-\-output"
File where output is written. Default is stdout. File where output is written. Default is stdout.

434
src/.#Makefile.in.1.6 Normal file
View file

@ -0,0 +1,434 @@
# Makefile.in generated by automake 1.10.2 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@SET_MAKE@
VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
bin_PROGRAMS = dhcpd-pools$(EXEEXT)
subdir = src
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
am__installdirs = "$(DESTDIR)$(bindir)"
binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
PROGRAMS = $(bin_PROGRAMS)
am_dhcpd_pools_OBJECTS = dhcpd-pools.$(OBJEXT) analyze.$(OBJEXT) \
getdata.$(OBJEXT) getopt1.$(OBJEXT) getopt.$(OBJEXT) \
other.$(OBJEXT) sort.$(OBJEXT) output.$(OBJEXT)
dhcpd_pools_OBJECTS = $(am_dhcpd_pools_OBJECTS)
dhcpd_pools_LDADD = $(LDADD)
DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
depcomp = $(SHELL) $(top_srcdir)/depcomp
am__depfiles_maybe = depfiles
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
CCLD = $(CC)
LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
SOURCES = $(dhcpd_pools_SOURCES)
DIST_SOURCES = $(dhcpd_pools_SOURCES)
ETAGS = etags
CTAGS = ctags
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
GREP = @GREP@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LTLIBOBJS = @LTLIBOBJS@
MAKEINFO = @MAKEINFO@
MKDIR_P = @MKDIR_P@
OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
VERSION = @VERSION@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_ct_CC = @ac_ct_CC@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build_alias = @build_alias@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
host_alias = @host_alias@
htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
AC_PROG_RANLIB = resolv
dhcpd_pools_SOURCES = dhcpd-pools.c analyze.c getdata.c getopt1.c getopt.c other.c sort.c output.c getopt.h
INCLUDES = -I. -I..
all: all-am
.SUFFIXES:
.SUFFIXES: .c .o .obj
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
&& { if test -f $@; then exit 0; else break; fi; }; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnits src/Makefile'; \
cd $(top_srcdir) && \
$(AUTOMAKE) --gnits src/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(top_srcdir)/configure: $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
install-binPROGRAMS: $(bin_PROGRAMS)
@$(NORMAL_INSTALL)
test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)"
@list='$(bin_PROGRAMS)'; for p in $$list; do \
p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
if test -f $$p \
; then \
f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
echo " $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \
$(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \
else :; fi; \
done
uninstall-binPROGRAMS:
@$(NORMAL_UNINSTALL)
@list='$(bin_PROGRAMS)'; for p in $$list; do \
f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \
rm -f "$(DESTDIR)$(bindir)/$$f"; \
done
clean-binPROGRAMS:
-test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
installcheck-binPROGRAMS: $(bin_PROGRAMS)
bad=0; pid=$$$$; list="$(bin_PROGRAMS)"; for p in $$list; do \
case ' $(AM_INSTALLCHECK_STD_OPTIONS_EXEMPT) ' in \
*" $$p "* | *" $(srcdir)/$$p "*) continue;; \
esac; \
f=`echo "$$p" | \
sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
for opt in --help --version; do \
if "$(DESTDIR)$(bindir)/$$f" $$opt >c$${pid}_.out \
2>c$${pid}_.err </dev/null \
&& test -n "`cat c$${pid}_.out`" \
&& test -z "`cat c$${pid}_.err`"; then :; \
else echo "$$f does not support $$opt" 1>&2; bad=1; fi; \
done; \
done; rm -f c$${pid}_.???; exit $$bad
dhcpd-pools$(EXEEXT): $(dhcpd_pools_OBJECTS) $(dhcpd_pools_DEPENDENCIES)
@rm -f dhcpd-pools$(EXEEXT)
$(LINK) $(dhcpd_pools_OBJECTS) $(dhcpd_pools_LDADD) $(LIBS)
mostlyclean-compile:
-rm -f *.$(OBJEXT)
distclean-compile:
-rm -f *.tab.c
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/analyze.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dhcpd-pools.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getdata.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getopt.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getopt1.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/other.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/output.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sort.Po@am__quote@
.c.o:
@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(COMPILE) -c $<
.c.obj:
@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
mkid -fID $$unique
tags: TAGS
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$tags $$unique; \
fi
ctags: CTAGS
CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
test -z "$(CTAGS_ARGS)$$tags$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$tags $$unique
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& cd $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) $$here
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
distdir: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
dist_files=`for file in $$list; do echo $$file; done | \
sed -e "s|^$$srcdirstrip/||;t" \
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
case $$dist_files in \
*/*) $(MKDIR_P) `echo "$$dist_files" | \
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
sort -u` ;; \
esac; \
for file in $$dist_files; do \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
if test -d $$d/$$file; then \
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
fi; \
cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
else \
test -f $(distdir)/$$file \
|| cp -p $$d/$$file $(distdir)/$$file \
|| exit 1; \
fi; \
done
check-am: all-am
check: check-am
all-am: Makefile $(PROGRAMS)
installdirs:
for dir in "$(DESTDIR)$(bindir)"; do \
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
done
install: install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-am
install-strip:
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
`test -z '$(STRIP)' || \
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
mostlyclean-generic:
clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-am
clean-am: clean-binPROGRAMS clean-generic mostlyclean-am
distclean: distclean-am
-rm -rf ./$(DEPDIR)
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-tags
dvi: dvi-am
dvi-am:
html: html-am
info: info-am
info-am:
install-data-am:
install-dvi: install-dvi-am
install-exec-am: install-binPROGRAMS
install-html: install-html-am
install-info: install-info-am
install-man:
install-pdf: install-pdf-am
install-ps: install-ps-am
installcheck-am: installcheck-binPROGRAMS
maintainer-clean: maintainer-clean-am
-rm -rf ./$(DEPDIR)
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-compile mostlyclean-generic
pdf: pdf-am
pdf-am:
ps: ps-am
ps-am:
uninstall-am: uninstall-binPROGRAMS
.MAKE: install-am install-strip
.PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \
clean-generic ctags distclean distclean-compile \
distclean-generic distclean-tags distdir dvi dvi-am html \
html-am info info-am install install-am install-binPROGRAMS \
install-data install-data-am install-dvi install-dvi-am \
install-exec install-exec-am install-html install-html-am \
install-info install-info-am install-man install-pdf \
install-pdf-am install-ps install-ps-am install-strip \
installcheck installcheck-am installcheck-binPROGRAMS \
installdirs maintainer-clean maintainer-clean-generic \
mostlyclean mostlyclean-compile mostlyclean-generic pdf pdf-am \
ps ps-am tags uninstall uninstall-am uninstall-binPROGRAMS
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:

130
src/.#dhcpd-pools.h.1.14 Normal file
View file

@ -0,0 +1,130 @@
/*
** Copyright (C) 2006- Sami Kerola <kerolasa@iki.fi>
**
** 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
** the Free Software Foundation; either version 2 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** 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, write to the Free Software
** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef DHCPD_POOLS_H
# define DHCPD_POOLS_H 1
/* Feature test switches */
#define _POSIX_SOURCE 1
#define POSIXLY_CORRECT 1
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#else /* Not STDC_HEADERS */
extern void exit ();
extern char *malloc ();
#endif /* STDC_HEADERS */
#include <stdio.h>
/* Structures and unions */
struct configuration_t
{
char *dhcpdconf_file;
char *dhcpdlease_file;
char output_format[2];
char sort[6];
int reverse_order;
char *output_file;
int output_limit[2];
};
struct shared_network_t
{
char *name;
unsigned long int available;
unsigned long int used;
unsigned long int touched;
unsigned long int backups;
};
struct range_t
{
struct shared_network_t *shared_net;
unsigned long int first_ip;
unsigned long int last_ip;
unsigned long int count;
unsigned long int touched;
unsigned long int backups;
};
/* Global variables */
static int true = 1;
static int false = 0;
char *program_name;
struct configuration_t config;
static int output_limit_bit_1 = 1;
static int output_limit_bit_2 = 2;
static int output_limit_bit_3 = 4;
unsigned int fullhtml;
struct shared_network_t *shared_networks;
char *shared_net_names;
unsigned int num_shared_networks;
struct range_t *ranges;
unsigned int num_ranges;
unsigned long int *leases;
unsigned long int num_leases;
unsigned long int *touches;
unsigned long int num_touches;
unsigned long int *backups;
unsigned long int num_backups;
/* Function prototypes */
int prepare_memory (void);
int parse_leases (void);
char * parse_config (char *, char *, char *, struct shared_network_t *);
int nth_field (int n, char *dest, const char *src);
int prepare_data (void);
int do_counting (void);
void flip_ranges(struct range_t *ranges, struct range_t *tmp_ranges);
void html_header(FILE *f);
void html_footer(FILE *f);
/* General support functions */
void *safe_malloc (size_t size);
void eprintf (char *, ...);
void print_version (void);
void print_help (void);
/* qsort required functions... */
/* ...for ranges and... */
int intcomp (const void *x, const void *y);
int rangecomp (const void *r1, const void *r2);
/* sort function pointer and functions */
int sort_name (void);
unsigned long int (*returner) (struct range_t r);
unsigned long int ret_ip(struct range_t r);
unsigned long int ret_cur(struct range_t r);
unsigned long int ret_max(struct range_t r);
unsigned long int ret_percent(struct range_t r);
unsigned long int ret_touched(struct range_t r);
unsigned long int ret_tc(struct range_t r);
unsigned long int ret_tcperc(struct range_t r);
void field_selector(char c);
int get_order(struct range_t *left, struct range_t *right);
void mergesort_ranges (struct range_t *orig, int size, struct range_t *temp);
/* output function pointer and functions */
int (*output_analysis) (void);
int output_txt (void);
int output_html (void);
int output_csv (void);
/* Memory release, file closing etc */
void clean_up (void);
#endif /* DHCPD_POOLS_H */

633
src/.#output.c.1.9 Normal file
View file

@ -0,0 +1,633 @@
/*
** Copyright (C) 2006- Sami Kerola <kerolasa@iki.fi>
**
** 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
** the Free Software Foundation; either version 2 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** 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, write to the Free Software
** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <stdio.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include "dhcpd-pools.h"
int output_txt(void)
{
unsigned int i;
struct in_addr first, last;
struct range_t *range_p;
struct shared_network_t *shared_p;
int ret;
FILE *outfile;
if (config.output_file[0]) {
outfile = fopen(config.output_file, "w+");
if (outfile == NULL) {
eprintf("output_txt: %s:", config.output_file);
exit(EXIT_FAILURE);
}
} else {
outfile = stdout;
}
range_p = ranges;
shared_p = shared_networks;
if (config.output_limit[0] & output_limit_bit_1) {
fprintf(outfile, "Ranges:\n");
fprintf
(outfile,
"shared net name first ip last ip max cur percent touch t+c t+c perc");
if (num_backups > 0) {
fprintf(outfile, " bu bu perc");
}
fprintf(outfile, "\n");
}
if (config.output_limit[1] & output_limit_bit_1) {
for (i = 0; i < num_ranges; i++) {
first.s_addr = ntohl(range_p->first_ip + 1);
last.s_addr = ntohl(range_p->last_ip - 1);
if (range_p->shared_net) {
fprintf(outfile, "%-20s",
range_p->shared_net->name);
} else {
fprintf(outfile, "not_defined ");
}
fprintf(outfile, "%-16s", inet_ntoa(first));
fprintf(outfile,
" - %-16s %5lu %5lu %10.3f %5lu %5lu %9.3f",
inet_ntoa(last),
range_p->last_ip - range_p->first_ip - 1,
range_p->count,
(float) (100 * range_p->count) /
(range_p->last_ip - range_p->first_ip - 1),
range_p->touched,
range_p->touched + range_p->count,
(float) (100 *
(range_p->touched +
range_p->count)) /
(range_p->last_ip - range_p->first_ip -
1));
if (num_backups > 0) {
fprintf(outfile, "%7lu %8.3f",
range_p->backups,
(float) (100 * range_p->backups) /
(range_p->last_ip -
range_p->first_ip - 1));
}
fprintf(outfile, "\n");
range_p++;
}
}
if (config.output_limit[1] & output_limit_bit_1
&& config.output_limit[0] & output_limit_bit_2) {
fprintf(outfile, "\n");
}
if (config.output_limit[0] & output_limit_bit_2) {
fprintf(outfile, "Shared networks:\n");
fprintf(outfile,
"name max cur percent touch t+c t+c perc");
if (num_backups > 0) {
fprintf(outfile, " bu bu perc");
}
fprintf(outfile, "\n");
}
if (config.output_limit[1] & output_limit_bit_2) {
for (i = 0; i < num_shared_networks; i++) {
shared_p++;
fprintf(outfile,
"%-20s %5lu %5lu %10.3f %7lu %6lu %9.3f",
shared_p->name, shared_p->available,
shared_p->used,
(float) (100 * shared_p->used) /
shared_p->available, shared_p->touched,
shared_p->touched + shared_p->used,
(float) (100 *
(shared_p->touched +
shared_p->used)) /
shared_p->available);
if (num_backups > 0) {
fprintf(outfile, "%7lu %8.3f",
shared_p->backups,
(float) (100 * shared_p->backups) /
shared_p->available);
}
fprintf(outfile, "\n");
}
}
if (config.output_limit[1] & output_limit_bit_2
&& config.output_limit[0] & output_limit_bit_3) {
fprintf(outfile, "\n");
}
if (config.output_limit[0] & output_limit_bit_3) {
fprintf(outfile, "Sum of all ranges:\n");
fprintf(outfile,
"name max cur percent touch t+c t+c perc");
if (num_backups > 0) {
fprintf(outfile, " bu bu perc");
}
fprintf(outfile, "\n");
}
if (config.output_limit[1] & output_limit_bit_3) {
fprintf(outfile, "%-20s %5lu %5lu %10.3f %7lu %6lu %9.3f",
shared_networks->name,
shared_networks->available,
shared_networks->used,
(float) (100 * shared_networks->used) /
shared_networks->available,
shared_networks->touched,
shared_networks->touched + shared_networks->used,
(float) (100 *
(shared_networks->touched +
shared_networks->used)) /
shared_networks->available);
if (num_backups > 0) {
fprintf(outfile, "%7lu %8.3f",
shared_networks->backups,
(float) (100 * shared_networks->backups) /
shared_networks->available);
}
fprintf(outfile, "\n");
}
if (outfile == stdout) {
ret = fflush(stdout);
if (ret) {
eprintf("output_txt: fflush:");
}
} else {
ret = fclose(outfile);
if (ret) {
eprintf("output_txt: fclose:");
}
}
return 0;
}
void html_header(FILE *f)
{
fprintf(f, "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\" \n");
fprintf(f, " \"http://www.w3.org/TR/html4/strict.dtd\">\n");
fprintf(f, "<html>\n");
fprintf(f, "<head>\n");
fprintf(f, "<meta http-equiv=\"Content-Type\" ");
fprintf(f, "content=\"text/html; charset=iso-8859-1\">\n");
fprintf(f, " <title>ISC dhcpd stats</title>\n");
fprintf(f, " <style TYPE=\"text/css\">\n");
fprintf(f, " <!--\n");
fprintf(f, " table.dhcpd-pools {\n");
fprintf(f, " color: black;\n");
fprintf(f, " vertical-align: middle;\n");
fprintf(f, " text-align: center;\n");
fprintf(f, " }\n");
fprintf(f, " table.dhcpd-pools th.section {\n");
fprintf(f, " color: black;\n");
fprintf(f, " font-size: large;\n");
fprintf(f, " vertical-align: middle;\n");
fprintf(f, " text-align: left;\n");
fprintf(f, " }\n");
fprintf(f, " table.dhcpd-pools th.calign {\n");
fprintf(f, " color: black;\n");
fprintf(f, " vertical-align: middle;\n");
fprintf(f, " text-align: center;\n");
fprintf(f, " text-decoration: underline;\n");
fprintf(f, " }\n");
fprintf(f, " table.dhcpd-pools th.ralign {\n");
fprintf(f, " color: black;\n");
fprintf(f, " vertical-align: middle;\n");
fprintf(f, " text-align: right;\n");
fprintf(f, " text-decoration: underline;\n");
fprintf(f, " }\n");
fprintf(f, " table.dhcpd-pools td.calign {\n");
fprintf(f, " color: black;\n");
fprintf(f, " vertical-align: middle;\n");
fprintf(f, " text-align: center;\n");
fprintf(f, " }\n");
fprintf(f, " table.dhcpd-pools td.ralign {\n");
fprintf(f, " color: black;\n");
fprintf(f, " vertical-align: middle;\n");
fprintf(f, " text-align: right;\n");
fprintf(f, " }\n");
fprintf(f, " p.created {\n");
fprintf(f, " font-size: small;\n");
fprintf(f, " color: grey;\n");
fprintf(f, " }\n");
fprintf(f, " p.updated {\n");
fprintf(f, " font-size: small;\n");
fprintf(f, " color: grey;\n");
fprintf(f, " font-style: italic;\n");
fprintf(f, " }\n");
fprintf(f, " -->\n");
fprintf(f, " </style>\n");
fprintf(f, "</head>\n");
fprintf(f, "<body>\n");
}
void html_footer(FILE *f)
{
fprintf(f, "<p><br></p>\n");
fprintf(f, "<hr>\n");
fprintf(f, "<p class=created>\nData generated by ");
fprintf(f, "<a href=\"http://dhcpd-pools.sourceforge.net/\">");
fprintf(f, "dhcpd-pools</a>.\n</p>\n");
fprintf(f, "<p class=updated>\n");
fprintf(f, "<script type=\"text/javascript\">\n");
fprintf(f, " document.write(\"Last Updated On \" + ");
fprintf(f, "document.lastModified + \".\")\n");
fprintf(f, "</script>\n<br>\n</p>\n");
fprintf(f, "</body>\n");
fprintf(f, "</html>\n");
}
void newrow(FILE *f) { fprintf(f, "<tr>\n"); }
void endrow(FILE *f) { fprintf(f, "</tr>\n\n"); }
void output_line(FILE *f, char *type, char *class, char *text)
{
fprintf(f, " <%s class=%s>%s</%s>\n", type, class, text, type);
}
void output_long(FILE *f, char *type, unsigned long unlong)
{
fprintf(f, " <%s class=ralign>%lu</%s>\n", type, unlong, type);
}
void output_float(FILE *f, char *type, float fl)
{
fprintf(f, " <%s class=ralign>%.3f</%s>\n", type, fl, type);
}
void table_start(FILE *f)
{
fprintf(f, "<table width=\"75%\" ");
fprintf(f, "class=\"dhcpd-pools\" ");
fprintf(f, "summary=\"ISC dhcpd pool usage report\">\n");
}
void table_end(FILE *f)
{
fprintf(f, "</table>\n");
}
void newsection(FILE *f, char *title)
{
newrow(f);
output_line(f, "td", "calign", "&nbsp;");
endrow(f);
newrow(f);
output_line(f, "th", "section", title);
endrow(f);
}
int output_html(void)
{
unsigned int i;
struct in_addr first, last;
struct range_t *range_p;
struct shared_network_t *shared_p;
int ret;
FILE *outfile;
if (config.output_file[0]) {
outfile = fopen(config.output_file, "w+");
if (outfile == NULL) {
eprintf("output_html: %s:", config.output_file);
exit(EXIT_FAILURE);
}
} else {
outfile = stdout;
}
range_p = ranges;
shared_p = shared_networks;
if (fullhtml) {
html_header(outfile);
}
table_start(outfile);
if (config.output_limit[0] & output_limit_bit_1) {
newsection(outfile, "Ranges:");
newrow(outfile);
output_line(outfile, "th", "calign", "shared net name");
output_line(outfile, "th", "calign", "first ip");
output_line(outfile, "th", "calign", "last ip");
output_line(outfile, "th", "ralign", "max");
output_line(outfile, "th", "ralign", "cur");
output_line(outfile, "th", "ralign", "percent");
output_line(outfile, "th", "ralign", "touch");
output_line(outfile, "th", "ralign", "t+c");
output_line(outfile, "th", "ralign", "t+c perc");
if (num_backups > 0) {
output_line(outfile, "th", "ralign", "bu");
output_line(outfile, "th", "ralign", "bu perc");
}
endrow(outfile);
}
if (config.output_limit[1] & output_limit_bit_1) {
for (i = 0; i < num_ranges; i++) {
first.s_addr = ntohl(range_p->first_ip + 1);
last.s_addr = ntohl(range_p->last_ip - 1);
newrow(outfile);
if (range_p->shared_net) {
output_line(outfile, "td", "calign", range_p->shared_net->name);
} else {
output_line(outfile, "td", "calign", "not_defined");
}
output_line(outfile, "td", "calign", inet_ntoa(first));
output_line(outfile, "td", "calign", inet_ntoa(last));
output_long(outfile, "td", range_p->last_ip - range_p->first_ip - 1);
output_long(outfile, "td", range_p->count);
output_float(outfile, "td", (float) (100 * range_p->count) /
(range_p->last_ip - range_p->first_ip - 1));
output_long(outfile, "td", range_p->touched);
output_long(outfile, "td", range_p->touched + range_p->count);
output_float(outfile, "td", (float) (100 *
(range_p->touched +
range_p->count)) /
(range_p->last_ip - range_p->first_ip - 1));
if (num_backups > 0) {
output_long(outfile, "td", range_p->backups);
output_float(outfile, "td", (float) (100 * range_p->backups) /
(range_p->last_ip - range_p->first_ip - 1));
}
endrow(outfile);
range_p++;
}
}
table_end(outfile);
table_start(outfile);
if (config.output_limit[0] & output_limit_bit_2) {
newsection(outfile, "Shared networks:");
newrow(outfile);
output_line(outfile, "th", "calign", "name");
output_line(outfile, "th", "ralign", "max");
output_line(outfile, "th", "ralign", "cur");
output_line(outfile, "th", "ralign", "percent");
output_line(outfile, "th", "ralign", "touch");
output_line(outfile, "th", "ralign", "t+c");
output_line(outfile, "th", "ralign", "t+c perc");
if (num_backups > 0) {
output_line(outfile, "th", "ralign", "bu");
output_line(outfile, "th", "ralign", "bu perc");
}
endrow(outfile);
}
if (config.output_limit[1] & output_limit_bit_2) {
for (i = 0; i < num_shared_networks; i++) {
shared_p++;
newrow(outfile);
output_line(outfile, "td", "calign", shared_p->name);
output_long(outfile, "td", shared_p->available);
output_long(outfile, "td", shared_p->used);
output_float(outfile, "td", (float) (100 * shared_p->used) /
shared_p->available);
output_long(outfile, "td", shared_p->touched);
output_long(outfile, "td", shared_p->touched + shared_p->used);
output_float(outfile, "td", (float) (100 *
(shared_p->touched +
shared_p->used)) /
shared_p->available);
if (num_backups > 0) {
output_long(outfile, "td", shared_p->backups);
output_float(outfile, "td", (float) (100 * shared_p->backups) /
shared_p->available);
}
endrow(outfile);
}
}
if (config.output_limit[0] & output_limit_bit_3) {
newsection(outfile, "Sum of all ranges:");
newrow(outfile);
output_line(outfile, "th", "calign", "name");
output_line(outfile, "th", "ralign", "max");
output_line(outfile, "th", "ralign", "cur");
output_line(outfile, "th", "ralign", "percent");
output_line(outfile, "th", "ralign", "touch");
output_line(outfile, "th", "ralign", "t+c");
output_line(outfile, "th", "ralign", "t+c perc");
if (num_backups > 0) {
output_line(outfile, "th", "ralign", "bu");
output_line(outfile, "th", "ralign", "bu perc");
}
endrow(outfile);
}
if (config.output_limit[1] & output_limit_bit_3) {
newrow(outfile);
output_line(outfile, "td", "calign", shared_networks->name);
output_long(outfile, "td", shared_networks->available);
output_long(outfile, "td", shared_networks->used);
output_float(outfile, "td", (float) (100 * shared_networks->used) /
shared_networks->available);
output_long(outfile, "td", shared_networks->touched);
output_long(outfile, "td", shared_networks->touched + shared_networks->used);
output_float(outfile, "td", (float) (100 *
(shared_networks->touched +
shared_networks->used)) /
shared_networks->available);
if (num_backups > 0) {
output_long(outfile, "td", shared_networks->backups);
output_float(outfile, "td", (float) (100 * shared_networks->backups) /
shared_networks->available);
}
endrow(outfile);
}
table_end(outfile);
if (fullhtml) {
html_footer(outfile);
}
if (outfile == stdout) {
ret = fflush(stdout);
if (ret) {
eprintf("output_html: fflush:");
}
} else {
ret = fclose(outfile);
if (ret) {
eprintf("output_html: fclose:");
}
}
return 0;
}
int output_csv(void)
{
unsigned int i;
struct in_addr first, last;
struct range_t *range_p;
struct shared_network_t *shared_p;
FILE *outfile;
int ret;
if (config.output_file[0]) {
outfile = fopen(config.output_file, "w+");
if (outfile == NULL) {
eprintf("output_csv: %s:", config.output_file);
exit(EXIT_FAILURE);
}
} else {
outfile = stdout;
}
range_p = ranges;
shared_p = shared_networks;
if (config.output_limit[0] & output_limit_bit_1) {
fprintf(outfile, "\"Ranges:\"\n");
fprintf
(outfile,
"\"shared net name\",\"first ip\",\"last ip\",\"max\",\"cur\",\"percent\",\"touch\",\"t+c\",\"t+c perc\"");
if (num_backups > 0) {
fprintf(outfile, ",\"bu\",\"bu perc\"");
}
fprintf(outfile, "\n");
}
if (config.output_limit[1] & output_limit_bit_1) {
for (i = 0; i < num_ranges; i++) {
first.s_addr = ntohl(range_p->first_ip + 1);
last.s_addr = ntohl(range_p->last_ip - 1);
if (range_p->shared_net) {
fprintf(outfile, "\"%s\",",
range_p->shared_net->name);
} else {
fprintf(outfile, "\"not_defined\",");
}
fprintf(outfile, "\"%s\",", inet_ntoa(first));
fprintf(outfile,
"\"%s\",\"%lu\",\"%lu\",\"%.3f\",\"%lu\",\"%lu\",\"%.3f\"",
inet_ntoa(last),
range_p->last_ip - range_p->first_ip - 1,
range_p->count,
(float) (100 * range_p->count) /
(range_p->last_ip - range_p->first_ip - 1),
range_p->touched,
range_p->touched + range_p->count,
(float) (100 *
(range_p->touched +
range_p->count)) /
(range_p->last_ip - range_p->first_ip -
1));
if (num_backups > 0) {
fprintf(outfile, ",\"%lu\",\"%.3f\"",
range_p->backups,
(float) (100 * range_p->backups) /
(range_p->last_ip -
range_p->first_ip - 1));
}
fprintf(outfile, "\n");
range_p++;
}
fprintf(outfile, "\n");
}
if (config.output_limit[0] & output_limit_bit_2) {
fprintf(outfile, "\"Shared networks:\"\n");
fprintf(outfile,
"\"name\",\"max\",\"cur\",\"percent\",\"touch\",\"t+c\",\"t+c perc\"");
if (num_backups > 0) {
fprintf(outfile, ",\"bu\",\"bu perc\"");
}
fprintf(outfile, "\n");
}
if (config.output_limit[1] & output_limit_bit_2) {
for (i = 0; i < num_shared_networks; i++) {
shared_p++;
fprintf(outfile,
"\"%s\",\"%lu\",\"%lu\",\"%.3f\",\"%lu\",\"%lu\",\"%.3f\"",
shared_p->name, shared_p->available,
shared_p->used,
(float) (100 * shared_p->used) /
shared_p->available, shared_p->touched,
shared_p->touched + shared_p->used,
(float) (100 *
(shared_p->touched +
shared_p->used)) /
shared_p->available);
if (num_backups > 0) {
fprintf(outfile, ",\"%lu\",\"%.3f\"",
shared_p->backups,
(float) (100 * shared_p->backups) /
shared_p->available);
}
fprintf(outfile, "\n");
}
fprintf(outfile, "\n");
}
if (config.output_limit[0] & output_limit_bit_3) {
fprintf(outfile, "\"Sum of all ranges:\"\n");
fprintf(outfile,
"\"name\",\"max\",\"cur\",\"percent\",\"touch\",\"t+c\",\"t+c perc\"");
if (num_backups > 0) {
fprintf(outfile, ",\"bu\",\"bu perc\"");
}
fprintf(outfile, "\n");
}
if (config.output_limit[1] & output_limit_bit_3) {
fprintf(outfile,
"\"%s\",\"%lu\",\"%lu\",\"%.3f\",\"%lu\",\"%lu\",\"%.3f\"",
shared_networks->name, shared_networks->available,
shared_networks->used,
(float) (100 * shared_networks->used) /
shared_networks->available,
shared_networks->touched,
shared_networks->touched + shared_networks->used,
(float) (100 *
(shared_networks->touched +
shared_networks->used)) /
shared_networks->available);
if (num_backups > 0) {
fprintf(outfile, "%7lu %8.3f",
shared_networks->backups,
(float) (100 * shared_networks->backups) /
shared_networks->available);
}
fprintf(outfile, "\n");
}
if (outfile == stdout) {
ret = fflush(stdout);
if (ret) {
eprintf("output_cvs: fflush:");
}
} else {
ret = fclose(outfile);
if (ret) {
eprintf("output_cvs: fclose:");
}
}
return 0;
}

View file

@ -3,6 +3,6 @@
bin_PROGRAMS = dhcpd-pools bin_PROGRAMS = dhcpd-pools
AC_PROG_RANLIB = resolv AC_PROG_RANLIB = resolv
dhcpd_pools_SOURCES = dhcpd-pools.h defaults.h dhcpd-pools.c analyze.c getdata.c getopt1.c getopt.c other.c sort.c output.c getopt.h dhcpd_pools_SOURCES = dhcpd-pools.c analyze.c getdata.c getopt1.c getopt.c other.c sort.c output.c getopt.h
INCLUDES = -I. -I.. INCLUDES = -I. -I..

View file

@ -1,9 +1,8 @@
# Makefile.in generated by automake 1.11.1 from Makefile.am. # Makefile.in generated by automake 1.10.2 from Makefile.am.
# @configure_input@ # @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, # 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
# Inc.
# This Makefile.in is free software; the Free Software Foundation # This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it, # gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved. # with or without modifications, as long as this notice is preserved.
@ -17,9 +16,8 @@
VPATH = @srcdir@ VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@ pkgdatadir = $(datadir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@
pkglibexecdir = $(libexecdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644 install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c install_sh_PROGRAM = $(install_sh) -c
@ -42,8 +40,8 @@ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = $(top_builddir)/config.h CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES = CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
am__installdirs = "$(DESTDIR)$(bindir)" am__installdirs = "$(DESTDIR)$(bindir)"
binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
PROGRAMS = $(bin_PROGRAMS) PROGRAMS = $(bin_PROGRAMS)
am_dhcpd_pools_OBJECTS = dhcpd-pools.$(OBJEXT) analyze.$(OBJEXT) \ am_dhcpd_pools_OBJECTS = dhcpd-pools.$(OBJEXT) analyze.$(OBJEXT) \
getdata.$(OBJEXT) getopt1.$(OBJEXT) getopt.$(OBJEXT) \ getdata.$(OBJEXT) getopt1.$(OBJEXT) getopt.$(OBJEXT) \
@ -53,7 +51,6 @@ dhcpd_pools_LDADD = $(LDADD)
DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
depcomp = $(SHELL) $(top_srcdir)/depcomp depcomp = $(SHELL) $(top_srcdir)/depcomp
am__depfiles_maybe = depfiles am__depfiles_maybe = depfiles
am__mv = mv -f
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
CCLD = $(CC) CCLD = $(CC)
@ -100,7 +97,6 @@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@ PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@ PATH_SEPARATOR = @PATH_SEPARATOR@
SET_MAKE = @SET_MAKE@ SET_MAKE = @SET_MAKE@
@ -150,7 +146,7 @@ top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@ top_builddir = @top_builddir@
top_srcdir = @top_srcdir@ top_srcdir = @top_srcdir@
AC_PROG_RANLIB = resolv AC_PROG_RANLIB = resolv
dhcpd_pools_SOURCES = dhcpd-pools.h defaults.h dhcpd-pools.c analyze.c getdata.c getopt1.c getopt.c other.c sort.c output.c getopt.h dhcpd_pools_SOURCES = dhcpd-pools.c analyze.c getdata.c getopt1.c getopt.c other.c sort.c output.c getopt.h
INCLUDES = -I. -I.. INCLUDES = -I. -I..
all: all-am all: all-am
@ -166,7 +162,7 @@ $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
esac; \ esac; \
done; \ done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/Makefile'; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/Makefile'; \
$(am__cd) $(top_srcdir) && \ cd $(top_srcdir) && \
$(AUTOMAKE) --gnu src/Makefile $(AUTOMAKE) --gnu src/Makefile
.PRECIOUS: Makefile .PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@ -185,41 +181,26 @@ $(top_srcdir)/configure: $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): $(am__aclocal_m4_deps) $(ACLOCAL_M4): $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(am__aclocal_m4_deps):
install-binPROGRAMS: $(bin_PROGRAMS) install-binPROGRAMS: $(bin_PROGRAMS)
@$(NORMAL_INSTALL) @$(NORMAL_INSTALL)
test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)"
@list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ @list='$(bin_PROGRAMS)'; for p in $$list; do \
for p in $$list; do echo "$$p $$p"; done | \ p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
sed 's/$(EXEEXT)$$//' | \ if test -f $$p \
while read p p1; do if test -f $$p; \ ; then \
then echo "$$p"; echo "$$p"; else :; fi; \ f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
done | \ echo " $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \
sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \ $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \
-e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ else :; fi; \
sed 'N;N;N;s,\n, ,g' | \ done
$(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
{ d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
if ($$2 == $$4) files[d] = files[d] " " $$1; \
else { print "f", $$3 "/" $$4, $$1; } } \
END { for (d in files) print "f", d, files[d] }' | \
while read type dir files; do \
if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
test -z "$$files" || { \
echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \
$(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
} \
; done
uninstall-binPROGRAMS: uninstall-binPROGRAMS:
@$(NORMAL_UNINSTALL) @$(NORMAL_UNINSTALL)
@list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ @list='$(bin_PROGRAMS)'; for p in $$list; do \
files=`for p in $$list; do echo "$$p"; done | \ f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \
-e 's/$$/$(EXEEXT)/' `; \ rm -f "$(DESTDIR)$(bindir)/$$f"; \
test -n "$$list" || exit 0; \ done
echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
cd "$(DESTDIR)$(bindir)" && rm -f $$files
clean-binPROGRAMS: clean-binPROGRAMS:
-test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
@ -244,14 +225,14 @@ distclean-compile:
.c.o: .c.o:
@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(COMPILE) -c $< @am__fastdepCC_FALSE@ $(COMPILE) -c $<
.c.obj: .c.obj:
@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
@ -268,7 +249,7 @@ tags: TAGS
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP) $(TAGS_FILES) $(LISP)
set x; \ tags=; \
here=`pwd`; \ here=`pwd`; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \ unique=`for i in $$list; do \
@ -276,34 +257,29 @@ TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
done | \ done | \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \ END { if (nonempty) { for (i in files) print i; }; }'`; \
shift; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \ test -n "$$unique" || unique=$$empty_fix; \
if test $$# -gt 0; then \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
"$$@" $$unique; \ $$tags $$unique; \
else \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$unique; \
fi; \
fi fi
ctags: CTAGS ctags: CTAGS
CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP) $(TAGS_FILES) $(LISP)
tags=; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \ unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \ done | \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \ END { if (nonempty) { for (i in files) print i; }; }'`; \
test -z "$(CTAGS_ARGS)$$unique" \ test -z "$(CTAGS_ARGS)$$tags$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$unique $$tags $$unique
GTAGS: GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \ here=`$(am__cd) $(top_builddir) && pwd` \
&& $(am__cd) $(top_srcdir) \ && cd $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) "$$here" && gtags -i $(GTAGS_ARGS) $$here
distclean-tags: distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
@ -324,17 +300,13 @@ distdir: $(DISTFILES)
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
if test -d $$d/$$file; then \ if test -d $$d/$$file; then \
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
if test -d "$(distdir)/$$file"; then \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \ fi; \
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
else \ else \
test -f "$(distdir)/$$file" \ test -f $(distdir)/$$file \
|| cp -p $$d/$$file "$(distdir)/$$file" \ || cp -p $$d/$$file $(distdir)/$$file \
|| exit 1; \ || exit 1; \
fi; \ fi; \
done done
@ -365,7 +337,6 @@ clean-generic:
distclean-generic: distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
maintainer-clean-generic: maintainer-clean-generic:
@echo "This command is intended for maintainers to use" @echo "This command is intended for maintainers to use"
@ -386,8 +357,6 @@ dvi-am:
html: html-am html: html-am
html-am:
info: info-am info: info-am
info-am: info-am:
@ -396,28 +365,18 @@ install-data-am:
install-dvi: install-dvi-am install-dvi: install-dvi-am
install-dvi-am:
install-exec-am: install-binPROGRAMS install-exec-am: install-binPROGRAMS
install-html: install-html-am install-html: install-html-am
install-html-am:
install-info: install-info-am install-info: install-info-am
install-info-am:
install-man: install-man:
install-pdf: install-pdf-am install-pdf: install-pdf-am
install-pdf-am:
install-ps: install-ps-am install-ps: install-ps-am
install-ps-am:
installcheck-am: installcheck-am:
maintainer-clean: maintainer-clean-am maintainer-clean: maintainer-clean-am
@ -454,7 +413,6 @@ uninstall-am: uninstall-binPROGRAMS
mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \ mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \
uninstall-am uninstall-binPROGRAMS uninstall-am uninstall-binPROGRAMS
# Tell versions [3.59,3.63) of GNU make to not export all variables. # Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded. # Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT: .NOEXPORT:

View file

@ -81,7 +81,8 @@ int do_counting(void)
/* Walk through ranges */ /* Walk through ranges */
for (k = 0; k < num_ranges; k++) { for (k = 0; k < num_ranges; k++) {
/* Count IPs in use */ /* Count IPs in use */
for (; range_p->last_ip > leases[i] for (;
range_p->last_ip > leases[i]
&& (unsigned long) i < num_leases; i++) { && (unsigned long) i < num_leases; i++) {
if (range_p->first_ip > leases[i]) { if (range_p->first_ip > leases[i]) {
continue; continue;
@ -94,7 +95,8 @@ int do_counting(void)
} }
/* Count touched IPs */ /* Count touched IPs */
for (; range_p->last_ip > touches[j] for (;
range_p->last_ip > touches[j]
&& (unsigned long) j < num_touches; j++) { && (unsigned long) j < num_touches; j++) {
if (range_p->first_ip > touches[j]) { if (range_p->first_ip > touches[j]) {
continue; continue;

View file

@ -29,7 +29,7 @@ static const int SHARED_NETWORKS_NAMES = 24576;
static const int SHARED_NETWORKS = 1024; static const int SHARED_NETWORKS = 1024;
/* Maximum number of ranges */ /* Maximum number of ranges */
static const unsigned int RANGES = 65536; static const int RANGES = 65536;
/* Merge sort split size */ /* Merge sort split size */
static const int MIN_MERGE_SIZE = 8; static const int MIN_MERGE_SIZE = 8;

View file

@ -42,7 +42,7 @@ extern char *malloc();
int main(int argc, char **argv) int main(int argc, char **argv)
{ {
int c, sorts = 0; int c, i, sorts = 0;
int option_index = 0; int option_index = 0;
char *tmp; char *tmp;
struct range_t *tmp_ranges; struct range_t *tmp_ranges;
@ -62,7 +62,6 @@ int main(int argc, char **argv)
}; };
program_name = argv[0]; program_name = argv[0];
atexit(clean_up);
/* TODO: make either dynamic or find out max path lenght that auto config /* TODO: make either dynamic or find out max path lenght that auto config
* provides */ * provides */
@ -110,7 +109,8 @@ int main(int argc, char **argv)
} else { } else {
eprintf eprintf
("main: for argument configuration file parameter not set"); ("main: for argument configuration file parameter not set");
usage(EXIT_FAILURE); print_help();
exit(EXIT_FAILURE);
} }
break; break;
case 'l': case 'l':
@ -121,7 +121,8 @@ int main(int argc, char **argv)
} else { } else {
eprintf eprintf
("main: for argument lease file parameter not set"); ("main: for argument lease file parameter not set");
usage(EXIT_FAILURE); print_help();
exit(EXIT_FAILURE);
} }
break; break;
case 'f': case 'f':
@ -132,7 +133,8 @@ int main(int argc, char **argv)
} else { } else {
eprintf eprintf
("main: for argument output format parameter not set"); ("main: for argument output format parameter not set");
usage(EXIT_FAILURE); print_help();
exit(EXIT_FAILURE);
} }
break; break;
case 's': case 's':
@ -152,7 +154,8 @@ int main(int argc, char **argv)
} else { } else {
eprintf eprintf
("main: for argument sort order parameter not set"); ("main: for argument sort order parameter not set");
usage(EXIT_FAILURE); print_help();
exit(EXIT_FAILURE);
} }
break; break;
case 'r': case 'r':
@ -167,7 +170,8 @@ int main(int argc, char **argv)
} else { } else {
eprintf eprintf
("main: for argument output file parameter not set"); ("main: for argument output file parameter not set");
usage(EXIT_FAILURE); print_help();
exit(EXIT_FAILURE);
} }
break; break;
case 'L': case 'L':
@ -180,7 +184,8 @@ int main(int argc, char **argv)
eprintf eprintf
("main: output mask %s illegal", ("main: output mask %s illegal",
argv[optind]); argv[optind]);
usage(EXIT_FAILURE); print_help();
exit(EXIT_FAILURE);
} }
if (optarg[1] >= '0' && optarg[1] < '8') { if (optarg[1] >= '0' && optarg[1] < '8') {
config.output_limit[1] = config.output_limit[1] =
@ -189,12 +194,14 @@ int main(int argc, char **argv)
eprintf eprintf
("main: output mask %s illegal", ("main: output mask %s illegal",
optarg); optarg);
usage(EXIT_FAILURE); print_help();
exit(EXIT_FAILURE);
} }
} else { } else {
eprintf eprintf
("main: for argument output mask parameter not set"); ("main: for argument output mask parameter not set");
usage(EXIT_FAILURE); print_help();
exit(EXIT_FAILURE);
} }
break; break;
case 'v': case 'v':
@ -203,9 +210,11 @@ int main(int argc, char **argv)
exit(EXIT_SUCCESS); exit(EXIT_SUCCESS);
case 'h': case 'h':
/* Print help */ /* Print help */
usage(EXIT_SUCCESS); print_help();
exit(EXIT_SUCCESS);
default: default:
usage(EXIT_FAILURE); print_help();
exit(EXIT_FAILURE);
} }
} }
@ -221,12 +230,6 @@ int main(int argc, char **argv)
output_analysis = output_html; output_analysis = output_html;
fullhtml = true; fullhtml = true;
break; break;
case 'x':
output_analysis = output_xml;
break;
case 'X':
output_analysis = output_xml;
break;
case 'c': case 'c':
output_analysis = output_csv; output_analysis = output_csv;
break; break;
@ -236,20 +239,15 @@ int main(int argc, char **argv)
break; break;
default: default:
eprintf("main: unknown ouput format"); eprintf("main: unknown ouput format");
usage(EXIT_FAILURE); print_help();
exit(EXIT_FAILURE);
} }
/* Do the job */ /* Do the job */
prepare_memory(); prepare_memory();
parse_config(true, config.dhcpdconf_file, shared_net_names, parse_config(config.dhcpdconf_file, shared_net_names,
shared_net_names + strlen(shared_net_names) + 1, shared_net_names + strlen(shared_net_names) + 1,
shared_networks); shared_networks);
if ((config.output_format[0] == 'x')
|| (config.output_format[0] == 'X')) {
printf("<dhcpstatus>\n");
};
parse_leases(); parse_leases();
prepare_data(); prepare_data();
do_counting(); do_counting();
@ -262,13 +260,9 @@ int main(int argc, char **argv)
} }
free(tmp_ranges); free(tmp_ranges);
output_analysis(); output_analysis();
clean_up();
if ((config.output_format[0] == 'x') return 0;
|| (config.output_format[0] == 'X')) {
printf("</dhcpstatus>\n");
};
exit(EXIT_SUCCESS);
} }
/* Global allocations, counter resets etc */ /* Global allocations, counter resets etc */

View file

@ -91,7 +91,7 @@ unsigned long int num_backups;
/* Function prototypes */ /* Function prototypes */
int prepare_memory (void); int prepare_memory (void);
int parse_leases (void); int parse_leases (void);
char * parse_config (int, char *, char *, char *, struct shared_network_t *); char * parse_config (char *, char *, char *, struct shared_network_t *);
int nth_field (int n, char *dest, const char *src); int nth_field (int n, char *dest, const char *src);
int prepare_data (void); int prepare_data (void);
int do_counting (void); int do_counting (void);
@ -100,7 +100,7 @@ void flip_ranges(struct range_t *ranges, struct range_t *tmp_ranges);
void *safe_malloc (size_t size); void *safe_malloc (size_t size);
void eprintf (char *, ...); void eprintf (char *, ...);
void print_version (void); void print_version (void);
void usage (int status); void print_help (void);
/* qsort required functions... */ /* qsort required functions... */
/* ...for ranges and... */ /* ...for ranges and... */
int intcomp (const void *x, const void *y); int intcomp (const void *x, const void *y);
@ -122,7 +122,6 @@ void mergesort_ranges (struct range_t *orig, int size, struct range_t *temp);
int (*output_analysis) (void); int (*output_analysis) (void);
int output_txt (void); int output_txt (void);
int output_html (void); int output_html (void);
int output_xml (void);
int output_csv (void); int output_csv (void);
/* Memory release, file closing etc */ /* Memory release, file closing etc */
void clean_up (void); void clean_up (void);

View file

@ -1,5 +1,5 @@
/* /*
** Copyright (C) 2006- Sami Kerola < > ** Copyright (C) 2006- Sami Kerola <kerolasa@iki.fi>
** **
** This program is free software; you can redistribute it and/or modify ** 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 ** it under the terms of the GNU General Public License as published by
@ -48,8 +48,6 @@ extern char *malloc();
#define _XOPEN_SOURCE 600 #define _XOPEN_SOURCE 600
#include <fcntl.h> #include <fcntl.h>
#include <errno.h> #include <errno.h>
#include <ctype.h>
#include <limits.h>
#include "dhcpd-pools.h" #include "dhcpd-pools.h"
#include "defaults.h" #include "defaults.h"
@ -59,13 +57,12 @@ extern char *malloc();
int parse_leases(void) int parse_leases(void)
{ {
FILE *dhcpd_leases; FILE *dhcpd_leases;
char *line, *ipstring, *macstring, *macstring2; char *line, *ipstring;
struct in_addr inp; struct in_addr inp;
struct stat lease_file_stats; struct stat lease_file_stats;
unsigned long leasesmallocsize; unsigned long leasesmallocsize;
unsigned long touchesmallocsize; unsigned long touchesmallocsize;
unsigned long backupsmallocsize; unsigned long backupsmallocsize;
int sw_active_lease = 0;
num_touches = num_leases = num_backups = 0; num_touches = num_leases = num_backups = 0;
@ -74,20 +71,16 @@ int parse_leases(void)
eprintf("parse_leases: %s:", config.dhcpdlease_file); eprintf("parse_leases: %s:", config.dhcpdlease_file);
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
#ifdef POSIX_FADV_NOREUSE
posix_fadvise((long) dhcpd_leases, 0, 0, POSIX_FADV_NOREUSE); posix_fadvise((long) dhcpd_leases, 0, 0, POSIX_FADV_NOREUSE);
if (errno) { if (errno) {
eprintf("parse_leases: fadvise:"); eprintf("parse_leases: fadvise:");
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
#endif /* POSIX_FADV_NOREUSE */
#ifdef POSIX_FADV_SEQUENTIAL
posix_fadvise((long) dhcpd_leases, 0, 0, POSIX_FADV_SEQUENTIAL); posix_fadvise((long) dhcpd_leases, 0, 0, POSIX_FADV_SEQUENTIAL);
if (errno) { if (errno) {
eprintf("parse_leases: fadvise:"); eprintf("parse_leases: fadvise:");
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
#endif /* POSIX_FADV_SEQUENTIAL */
/* I found out that there's one lease address per 300 bytes in /* I found out that there's one lease address per 300 bytes in
* dhcpd.leases file. Malloc is little bit pessimistic and uses * dhcpd.leases file. Malloc is little bit pessimistic and uses
* 250. If someone has higher density in lease file I'm * 250. If someone has higher density in lease file I'm
@ -99,14 +92,13 @@ int parse_leases(void)
leasesmallocsize = (lease_file_stats.st_size / 250) + MAXLEN - 2; leasesmallocsize = (lease_file_stats.st_size / 250) + MAXLEN - 2;
touchesmallocsize = (lease_file_stats.st_size / 250) + MAXLEN - 2; touchesmallocsize = (lease_file_stats.st_size / 250) + MAXLEN - 2;
backupsmallocsize = (lease_file_stats.st_size / 120) + MAXLEN - 2; backupsmallocsize = (lease_file_stats.st_size / 120) + MAXLEN - 2;
leases = safe_malloc(sizeof(long int) * leasesmallocsize); leases =
safe_malloc(sizeof(long int) * leasesmallocsize);
touches = touches =
safe_malloc((size_t) sizeof(long int) * touchesmallocsize); safe_malloc((size_t) sizeof(long int) * touchesmallocsize);
line = safe_malloc(sizeof(long int) * MAXLEN); line = safe_malloc(sizeof(long int) * MAXLEN);
ipstring = safe_malloc(sizeof(long int) * MAXLEN); ipstring = safe_malloc(sizeof(long int) * MAXLEN);
macstring = safe_malloc(sizeof(long int) * MAXLEN);
macstring2 = safe_malloc(sizeof(long int) * MAXLEN);
while (!feof(dhcpd_leases)) { while (!feof(dhcpd_leases)) {
fgets(line, MAXLEN, dhcpd_leases); fgets(line, MAXLEN, dhcpd_leases);
@ -115,49 +107,29 @@ int parse_leases(void)
strncpy(ipstring, line, (size_t) MAXLEN); strncpy(ipstring, line, (size_t) MAXLEN);
nth_field(2, ipstring, ipstring); nth_field(2, ipstring, ipstring);
inet_aton(ipstring, &inp); inet_aton(ipstring, &inp);
sw_active_lease = 0;
} }
/* Copy IP to correct array */ /* Copy IP to correct array */
else if (strstr(line, "binding state active")) { else if (strstr(line, "binding state active")) {
leases[num_leases] = htonl(inp.s_addr); leases[num_leases] = htonl(inp.s_addr);
num_leases++; num_leases++;
sw_active_lease = 1;
} else if (strstr(line, " binding state free")) { } else if (strstr(line, " binding state free")) {
touches[num_touches] = htonl(inp.s_addr); touches[num_touches] = htonl(inp.s_addr);
num_touches++; num_touches++;
} else if (strstr(line, " binding state backup")) { } else if (strstr(line, " binding state backup")) {
if (num_backups == 0) { if (num_backups == 0) {
backups = backups =
safe_malloc((size_t) sizeof(long int) * safe_malloc((size_t) sizeof(long int) * backupsmallocsize);
backupsmallocsize);
} }
backups[num_backups] = htonl(inp.s_addr); backups[num_backups] = htonl(inp.s_addr);
num_backups++; num_backups++;
} }
if ((sw_active_lease == 1)
&& (strstr(line, "hardware ethernet"))) {
nth_field(3, macstring, line);
macstring[strlen(macstring) - 1] = '\0';
if (config.output_format[0] == 'X') {
printf
("<active_lease>\n\t<ip>%s</ip>\n\t<macaddress>%s</macaddress>\n</active_lease>\n",
ipstring, macstring);
};
}
if ((num_leases > leasesmallocsize) || if ((num_leases > leasesmallocsize) ||
(num_touches > touchesmallocsize) || (num_touches > touchesmallocsize) ||
(num_backups > backupsmallocsize)) { (num_backups > backupsmallocsize)) {
printf("WARNING: running out of memory\n"); printf("WARNING: running out of memory\n");
printf("\tlease/touch/backup = %lu/%lu/%lu\n", printf("\tlease/touch/backup = %lu/%lu/%lu\n", leasesmallocsize, touchesmallocsize, backupsmallocsize);
leasesmallocsize, touchesmallocsize, printf("\tlease/touch/backup = %lu/%lu/%lu\n", num_leases, num_touches, num_backups);
backupsmallocsize); printf("Code should realloc() and init new memory, but no time to write that now!\n");
printf("\tlease/touch/backup = %lu/%lu/%lu\n",
num_leases, num_touches, num_backups);
printf
("Code should realloc() and init new memory, but no time to write that now!\n");
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
} }
@ -212,15 +184,14 @@ int is_interesting_config_clause(char *s)
/* TODO: This spagetti monster function need to be rewrote at /* TODO: This spagetti monster function need to be rewrote at
* least ones. */ * least ones. */
char *parse_config(int is_include, char *config_file, char *parse_config(char *config_file, char *current_shared_name,
char *current_shared_name,
char *next_free_shared_name, char *next_free_shared_name,
struct shared_network_t *shared_p) struct shared_network_t *shared_p)
{ {
FILE *dhcpd_config; FILE *dhcpd_config;
int i = 0, newclause = true, argument = false, comment = int i = 0, newclause = true, argument = false, comment =
false, braces = 0, quote = false; false, braces = 0, quote = false;
char *word, c; char word[MAXLEN], c;
int braces_shared = 1000; int braces_shared = 1000;
struct in_addr inp; struct in_addr inp;
struct range_t *range_p; struct range_t *range_p;
@ -228,12 +199,9 @@ char *parse_config(int is_include, char *config_file,
char *last_shared_name; char *last_shared_name;
last_shared_name = SHARED_NETWORKS_NAMES + shared_net_names; last_shared_name = SHARED_NETWORKS_NAMES + shared_net_names;
word = safe_malloc(sizeof(char) * MAXLEN); /* Default place holder for ranges "All networks".
* If this is include file basicly nothing happens. */
if (is_include) {
/* Default place holder for ranges "All networks". */
shared_p->name = current_shared_name; shared_p->name = current_shared_name;
}
/* Open configuration file */ /* Open configuration file */
dhcpd_config = fopen(config_file, "r"); dhcpd_config = fopen(config_file, "r");
@ -241,20 +209,17 @@ char *parse_config(int is_include, char *config_file,
eprintf("parse_config: %s:", config_file); eprintf("parse_config: %s:", config_file);
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
#ifdef POSIX_FADV_NOREUSE
posix_fadvise((long) dhcpd_config, 0, 0, POSIX_FADV_NOREUSE); posix_fadvise((long) dhcpd_config, 0, 0, POSIX_FADV_NOREUSE);
if (errno) { if (errno) {
eprintf("parse_config: fadvise:"); eprintf("parse_config: fadvise:");
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
#endif /* POSIX_FADV_NOREUSE */
#ifdef POSIX_FADV_SEQUENTIAL
posix_fadvise((long) dhcpd_config, 0, 0, POSIX_FADV_SEQUENTIAL); posix_fadvise((long) dhcpd_config, 0, 0, POSIX_FADV_SEQUENTIAL);
if (errno) { if (errno) {
eprintf("parse_config: fadvise:"); eprintf("parse_config: fadvise:");
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
#endif /* POSIX_FADV_SEQUENTIAL */
/* Very hairy stuff begins. */ /* Very hairy stuff begins. */
while (!feof(dhcpd_config)) { while (!feof(dhcpd_config)) {
c = fgetc(dhcpd_config); c = fgetc(dhcpd_config);
@ -402,7 +367,6 @@ char *parse_config(int is_include, char *config_file,
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
argument = 0; argument = 0;
braces_shared = braces;
break; break;
case 2: case 2:
/* printf ("range 2nd ip: %s\n", word); */ /* printf ("range 2nd ip: %s\n", word); */
@ -427,17 +391,13 @@ char *parse_config(int is_include, char *config_file,
range_p = ranges + num_ranges; range_p = ranges + num_ranges;
inet_aton(word, &inp); inet_aton(word, &inp);
range_p->first_ip = htonl(inp.s_addr) - 1; range_p->first_ip = htonl(inp.s_addr) - 1;
if (range_p->first_ip == UINT_MAX) {
/* word was not ip, try again */
break;
}
argument = 2; argument = 2;
break; break;
case 4: case 4:
/* printf ("include file: %s\n", word); */ /* printf ("include file: %s\n", word); */
argument = 0; argument = 0;
next_free_shared_name = next_free_shared_name =
parse_config(false, word, current_shared_name, parse_config(word, current_shared_name,
next_free_shared_name, next_free_shared_name,
shared_p); shared_p);
newclause = true; newclause = true;
@ -449,6 +409,5 @@ char *parse_config(int is_include, char *config_file,
} }
} }
} }
free(word);
return next_free_shared_name; return next_free_shared_name;
} }

View file

@ -425,7 +425,8 @@ const char *optstring;
strlen(orig_str); strlen(orig_str);
if (nonoption_flags_max_len < argc) if (nonoption_flags_max_len < argc)
nonoption_flags_max_len = argc; nonoption_flags_max_len = argc;
__getopt_nonoption_flags = (char *) __getopt_nonoption_flags =
(char *)
malloc(nonoption_flags_max_len); malloc(nonoption_flags_max_len);
if (__getopt_nonoption_flags == NULL) if (__getopt_nonoption_flags == NULL)
nonoption_flags_max_len = -1; nonoption_flags_max_len = -1;
@ -700,7 +701,8 @@ int long_only;
_ _
("%s: option `--%s' doesn't allow an argument\n"), ("%s: option `--%s' doesn't allow an argument\n"),
argv[0], argv[0],
pfound->name); pfound->
name);
else else
/* +option or -option */ /* +option or -option */
fprintf(stderr, fprintf(stderr,
@ -710,7 +712,8 @@ int long_only;
argv[optind argv[optind
- -
1][0], 1][0],
pfound->name); pfound->
name);
} }
nextchar += strlen(nextchar); nextchar += strlen(nextchar);
@ -884,7 +887,8 @@ int long_only;
else { else {
if (print_errors) if (print_errors)
fprintf(stderr, _("\ fprintf(stderr, _("\
%s: option `-W %s' doesn't allow an argument\n"), argv[0], pfound->name); %s: option `-W %s' doesn't allow an argument\n"), argv[0], pfound->
name);
nextchar += nextchar +=
strlen(nextchar); strlen(nextchar);

View file

@ -66,17 +66,12 @@ void eprintf(char *fmt, ...)
if (fmt[0] != '\0' && fmt[strlen(fmt) - 1] == ':') if (fmt[0] != '\0' && fmt[strlen(fmt) - 1] == ':')
fprintf(stderr, " %s", strerror(errno)); fprintf(stderr, " %s", strerror(errno));
/* Should be safe, after all dhcpd-pools has only one
* thread. */
errno = 0;
fprintf(stderr, "\n"); fprintf(stderr, "\n");
fflush(stderr);
} }
void flip_ranges(struct range_t *ranges, struct range_t *tmp_ranges) void flip_ranges(struct range_t *ranges, struct range_t *tmp_ranges)
{ {
unsigned int i = num_ranges - 1, j; int i = num_ranges - 1, j;
for (j = 0; j < num_ranges; j++) { for (j = 0; j < num_ranges; j++) {
*(tmp_ranges + j) = *(ranges + i); *(tmp_ranges + j) = *(ranges + i);
@ -91,33 +86,28 @@ void flip_ranges(struct range_t *ranges, struct range_t *tmp_ranges)
void clean_up(void) void clean_up(void)
{ {
int ret; int ret;
if (errno) {
eprintf
("clean_up: errno (%d) set but not checked in correct place; if this is repeatable send strace output as a bug report:",
errno);
}
/* Just in case there something in buffers */
ret = fflush(stdout);
if (errno || ret) {
eprintf("clean_up: stdout:");
}
ret = fflush(stderr);
if (errno || ret) {
eprintf("clean_up: stderr:");
}
free(config.dhcpdconf_file); free(config.dhcpdconf_file);
free(config.dhcpdlease_file); free(config.dhcpdlease_file);
free(config.output_file); free(config.output_file);
free(ranges); free(ranges);
free(shared_net_names); free(shared_net_names);
free(shared_networks); free(shared_networks);
/* Just in case there something in buffers */
ret = fclose(stdout);
if (errno || ret) {
eprintf("clean_up: stdout:");
exit(EXIT_FAILURE);
}
ret = fclose(stderr);
if (errno || ret) {
eprintf("clean_up: stderr:");
exit(EXIT_FAILURE);
}
} }
void print_version(void) void print_version(void)
{ {
fprintf(stdout, "%s\n", PACKAGE_STRING); fprintf(stdout, "%s\n", PACKAGE_STRING);
fprintf(stdout,
"Written by Sami Kerola.\nXML support by Dominic Germain, Sogetel inc.\n\n");
fprintf(stdout, fprintf(stdout,
"License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>\n"); "License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>\n");
fprintf(stdout, fprintf(stdout,
@ -126,31 +116,25 @@ void print_version(void)
"There is NO WARRANTY, to the extent permitted by law.\n"); "There is NO WARRANTY, to the extent permitted by law.\n");
} }
void usage(int status) void print_help(void)
{ {
FILE *out; fprintf(stdout, "Usage: %s [OPTIONS]\n", PACKAGE_NAME);
out = status != 0 ? stderr : stdout; fprintf(stdout, "\
fprintf(out, "\
Usage: %s [OPTIONS]\n", program_name);
fprintf(out, "\
This is ISC dhcpd pools usage analyzer.\n\ This is ISC dhcpd pools usage analyzer.\n\
\n"); \n");
fprintf(out, "\ fprintf(stdout, "\
-c --config file path to the dhcpd.conf file\n\ -c --config file path to the dhcpd.conf file\n\
-l --leases file path to the dhcpd.leases file\n\ -l --leases file path to the dhcpd.leases file\n\
-f --format [thcxX] output format\n"); -f --format [thc] output format\n");
fprintf(out, "\ fprintf(stdout, "\
t for text\n\ t for text\n\
h for html table\n\ h for html table\n\
H for full html page\n\ H for full html page\n\
x for xml\n\
X for xml with active lease details\n\
c for comma separated values\n"); c for comma separated values\n");
/* TODO /* TODO
s for snmp\n"); s for snmp\n");
*/ */
fprintf(out, "\ fprintf(stdout, "\
-s --sort [nimcptTe] sort ranges by\n\ -s --sort [nimcptTe] sort ranges by\n\
n name\n\ n name\n\
i IP\n\ i IP\n\
@ -160,15 +144,12 @@ This is ISC dhcpd pools usage analyzer.\n\
t touched\n\ t touched\n\
T t+c\n\ T t+c\n\
e t+c perc\n"); e t+c perc\n");
fprintf(out, "\ fprintf(stdout, "\
-r --reverse reverse order sort\n\ -r --reverse reverse order sort\n\
-o --output file output into a file\n\ -o --output file output into a file\n\
-L --limit nr output limit mask 77 - 00\n\ -L --limit nr output limit mask 77 - 00\n\
-v --version version information\n\ -v --version version information\n\
-h --help this screen\n\ -h --help this screen\n\
\n\ \n\
Report bugs to <%s>\n\ Report bugs to <%s>\n", PACKAGE_BUGREPORT);
Homepage: %s\n", PACKAGE_BUGREPORT, PACKAGE_URL);
exit(out == stderr ? EXIT_FAILURE : EXIT_SUCCESS);
} }

View file

@ -184,114 +184,9 @@ int output_txt(void)
return 0; return 0;
} }
int output_xml(void)
{
unsigned int i;
struct in_addr first, last;
struct range_t *range_p;
struct shared_network_t *shared_p;
int ret;
FILE *outfile;
if (config.output_file[0]) {
outfile = fopen(config.output_file, "w+");
if (outfile == NULL) {
eprintf("output_xml: %s:", config.output_file);
exit(EXIT_FAILURE);
}
} else {
outfile = stdout;
}
range_p = ranges;
shared_p = shared_networks;
if (config.output_limit[1] & output_limit_bit_1) {
for (i = 0; i < num_ranges; i++) {
first.s_addr = ntohl(range_p->first_ip + 1);
last.s_addr = ntohl(range_p->last_ip - 1);
fprintf(outfile, "<subnet>\n");
if (range_p->shared_net) {
fprintf(outfile,
"\t<location>%s</location>\n",
range_p->shared_net->name);
} else {
fprintf(outfile,
"\t<location></location>\n");
}
fprintf(outfile, "\t<network></network>\n");
fprintf(outfile, "\t<netmask></netmask>\n");
fprintf(outfile, "\t<range>%s ", inet_ntoa(first));
fprintf(outfile, "- %s</range>\n",
inet_ntoa(last));
fprintf(outfile, "\t<gateway></gateway>\n");
fprintf(outfile, "\t<defined>%lu</defined>\n",
range_p->last_ip - range_p->first_ip - 1);
fprintf(outfile, "\t<used>%lu</used>\n",
range_p->count);
fprintf(outfile, "\t<free>%lu</free>\n",
range_p->last_ip - range_p->first_ip - 1 -
range_p->count);
range_p++;
fprintf(outfile, "</subnet>\n");
}
}
if (config.output_limit[1] & output_limit_bit_2) {
for (i = 0; i < num_shared_networks; i++) {
shared_p++;
fprintf(outfile, "<shared-network>\n");
fprintf(outfile, "\t<location>%s</location>\n",
shared_p->name);
fprintf(outfile, "\t<defined>%lu</defined>\n",
shared_p->available);
fprintf(outfile, "\t<used>%lu</used>\n",
shared_p->used);
fprintf(outfile, "\t<free>%lu</free>\n",
shared_p->available - shared_p->used);
fprintf(outfile, "</shared-network>\n");
}
}
if (config.output_limit[0] & output_limit_bit_3) {
fprintf(outfile, "<summary>\n");
fprintf(outfile, "\t<location>%s</location>\n",
shared_networks->name);
fprintf(outfile, "\t<defined>%lu</defined>\n",
shared_networks->available);
fprintf(outfile, "\t<used>%lu</used>\n",
shared_networks->used);
fprintf(outfile, "\t<free>%lu</free>\n",
shared_networks->available -
shared_networks->used);
fprintf(outfile, "</summary>\n");
}
if (outfile == stdout) {
ret = fflush(stdout);
if (ret) {
eprintf("output_xml: fflush:");
}
} else {
ret = fclose(outfile);
if (ret) {
eprintf("output_xml: fclose:");
}
}
return 0;
}
void html_header(FILE *f) void html_header(FILE *f)
{ {
fprintf(f, fprintf(f, "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\" \n");
"<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\" \n");
fprintf(f, " \"http://www.w3.org/TR/html4/strict.dtd\">\n"); fprintf(f, " \"http://www.w3.org/TR/html4/strict.dtd\">\n");
fprintf(f, "<html>\n"); fprintf(f, "<html>\n");
fprintf(f, "<head>\n"); fprintf(f, "<head>\n");
@ -353,7 +248,7 @@ void html_footer(FILE * f)
fprintf(f, "<p><br></p>\n"); fprintf(f, "<p><br></p>\n");
fprintf(f, "<hr>\n"); fprintf(f, "<hr>\n");
fprintf(f, "<p class=created>\nData generated by "); fprintf(f, "<p class=created>\nData generated by ");
fprintf(f, "<a href=\"%s\">", PACKAGE_URL); fprintf(f, "<a href=\"http://dhcpd-pools.sourceforge.net/\">");
fprintf(f, "dhcpd-pools</a>.\n</p>\n"); fprintf(f, "dhcpd-pools</a>.\n</p>\n");
fprintf(f, "<p class=updated>\n"); fprintf(f, "<p class=updated>\n");
@ -365,26 +260,17 @@ void html_footer(FILE * f)
fprintf(f, "</html>\n"); fprintf(f, "</html>\n");
} }
void newrow(FILE * f) void newrow(FILE *f) { fprintf(f, "<tr>\n"); }
{ void endrow(FILE *f) { fprintf(f, "</tr>\n\n"); }
fprintf(f, "<tr>\n");
}
void endrow(FILE * f)
{
fprintf(f, "</tr>\n\n");
}
void output_line(FILE *f, char *type, char *class, char *text) void output_line(FILE *f, char *type, char *class, char *text)
{ {
fprintf(f, " <%s class=%s>%s</%s>\n", type, class, text, type); fprintf(f, " <%s class=%s>%s</%s>\n", type, class, text, type);
} }
void output_long(FILE *f, char *type, unsigned long unlong) void output_long(FILE *f, char *type, unsigned long unlong)
{ {
fprintf(f, " <%s class=ralign>%lu</%s>\n", type, unlong, type); fprintf(f, " <%s class=ralign>%lu</%s>\n", type, unlong, type);
} }
void output_float(FILE *f, char *type, float fl) void output_float(FILE *f, char *type, float fl)
{ {
fprintf(f, " <%s class=ralign>%.3f</%s>\n", type, fl, type); fprintf(f, " <%s class=ralign>%.3f</%s>\n", type, fl, type);
@ -392,7 +278,7 @@ void output_float(FILE * f, char *type, float fl)
void table_start(FILE *f) void table_start(FILE *f)
{ {
fprintf(f, "<table width=\"75%%\" "); fprintf(f, "<table width=\"75%\" ");
fprintf(f, "class=\"dhcpd-pools\" "); fprintf(f, "class=\"dhcpd-pools\" ");
fprintf(f, "summary=\"ISC dhcpd pool usage report\">\n"); fprintf(f, "summary=\"ISC dhcpd pool usage report\">\n");
} }
@ -435,9 +321,7 @@ int output_html(void)
range_p = ranges; range_p = ranges;
shared_p = shared_networks; shared_p = shared_networks;
if (fullhtml) { if (fullhtml) { html_header(outfile); }
html_header(outfile);
}
table_start(outfile); table_start(outfile);
if (config.output_limit[0] & output_limit_bit_1) { if (config.output_limit[0] & output_limit_bit_1) {
newsection(outfile, "Ranges:"); newsection(outfile, "Ranges:");
@ -464,41 +348,26 @@ int output_html(void)
newrow(outfile); newrow(outfile);
if (range_p->shared_net) { if (range_p->shared_net) {
output_line(outfile, "td", "calign", output_line(outfile, "td", "calign", range_p->shared_net->name);
range_p->shared_net->name);
} else { } else {
output_line(outfile, "td", "calign", output_line(outfile, "td", "calign", "not_defined");
"not_defined");
} }
output_line(outfile, "td", "calign", output_line(outfile, "td", "calign", inet_ntoa(first));
inet_ntoa(first)); output_line(outfile, "td", "calign", inet_ntoa(last));
output_line(outfile, "td", "calign", output_long(outfile, "td", range_p->last_ip - range_p->first_ip - 1);
inet_ntoa(last));
output_long(outfile, "td",
range_p->last_ip - range_p->first_ip -
1);
output_long(outfile, "td", range_p->count); output_long(outfile, "td", range_p->count);
output_float(outfile, "td", output_float(outfile, "td", (float) (100 * range_p->count) /
(float) (100 * range_p->count) / (range_p->last_ip - range_p->first_ip - 1));
(range_p->last_ip -
range_p->first_ip - 1));
output_long(outfile, "td", range_p->touched); output_long(outfile, "td", range_p->touched);
output_long(outfile, "td", output_long(outfile, "td", range_p->touched + range_p->count);
range_p->touched + range_p->count); output_float(outfile, "td", (float) (100 *
output_float(outfile, "td",
(float) (100 *
(range_p->touched + (range_p->touched +
range_p->count)) / range_p->count)) /
(range_p->last_ip - (range_p->last_ip - range_p->first_ip - 1));
range_p->first_ip - 1));
if (num_backups > 0) { if (num_backups > 0) {
output_long(outfile, "td", output_long(outfile, "td", range_p->backups);
range_p->backups); output_float(outfile, "td", (float) (100 * range_p->backups) /
output_float(outfile, "td", (range_p->last_ip - range_p->first_ip - 1));
(float) (100 *
range_p->backups) /
(range_p->last_ip -
range_p->first_ip - 1));
} }
endrow(outfile); endrow(outfile);
range_p++; range_p++;
@ -527,27 +396,20 @@ int output_html(void)
for (i = 0; i < num_shared_networks; i++) { for (i = 0; i < num_shared_networks; i++) {
shared_p++; shared_p++;
newrow(outfile); newrow(outfile);
output_line(outfile, "td", "calign", output_line(outfile, "td", "calign", shared_p->name);
shared_p->name);
output_long(outfile, "td", shared_p->available); output_long(outfile, "td", shared_p->available);
output_long(outfile, "td", shared_p->used); output_long(outfile, "td", shared_p->used);
output_float(outfile, "td", output_float(outfile, "td", (float) (100 * shared_p->used) /
(float) (100 * shared_p->used) /
shared_p->available); shared_p->available);
output_long(outfile, "td", shared_p->touched); output_long(outfile, "td", shared_p->touched);
output_long(outfile, "td", output_long(outfile, "td", shared_p->touched + shared_p->used);
shared_p->touched + shared_p->used); output_float(outfile, "td", (float) (100 *
output_float(outfile, "td",
(float) (100 *
(shared_p->touched + (shared_p->touched +
shared_p->used)) / shared_p->used)) /
shared_p->available); shared_p->available);
if (num_backups > 0) { if (num_backups > 0) {
output_long(outfile, "td", output_long(outfile, "td", shared_p->backups);
shared_p->backups); output_float(outfile, "td", (float) (100 * shared_p->backups) /
output_float(outfile, "td",
(float) (100 *
shared_p->backups) /
shared_p->available); shared_p->available);
} }
@ -574,36 +436,26 @@ int output_html(void)
} }
if (config.output_limit[1] & output_limit_bit_3) { if (config.output_limit[1] & output_limit_bit_3) {
newrow(outfile); newrow(outfile);
output_line(outfile, "td", "calign", output_line(outfile, "td", "calign", shared_networks->name);
shared_networks->name);
output_long(outfile, "td", shared_networks->available); output_long(outfile, "td", shared_networks->available);
output_long(outfile, "td", shared_networks->used); output_long(outfile, "td", shared_networks->used);
output_float(outfile, "td", output_float(outfile, "td", (float) (100 * shared_networks->used) /
(float) (100 * shared_networks->used) /
shared_networks->available); shared_networks->available);
output_long(outfile, "td", shared_networks->touched); output_long(outfile, "td", shared_networks->touched);
output_long(outfile, "td", output_long(outfile, "td", shared_networks->touched + shared_networks->used);
shared_networks->touched + output_float(outfile, "td", (float) (100 *
shared_networks->used);
output_float(outfile, "td",
(float) (100 *
(shared_networks->touched + (shared_networks->touched +
shared_networks->used)) / shared_networks->used)) /
shared_networks->available); shared_networks->available);
if (num_backups > 0) { if (num_backups > 0) {
output_long(outfile, "td", output_long(outfile, "td", shared_networks->backups);
shared_networks->backups); output_float(outfile, "td", (float) (100 * shared_networks->backups) /
output_float(outfile, "td",
(float) (100 *
shared_networks->backups) /
shared_networks->available); shared_networks->available);
} }
endrow(outfile); endrow(outfile);
} }
table_end(outfile); table_end(outfile);
if (fullhtml) { if (fullhtml) { html_footer(outfile); }
html_footer(outfile);
}
if (outfile == stdout) { if (outfile == stdout) {
ret = fflush(stdout); ret = fflush(stdout);
if (ret) { if (ret) {
@ -614,6 +466,7 @@ int output_html(void)
if (ret) { if (ret) {
eprintf("output_html: fclose:"); eprintf("output_html: fclose:");
} }
} }
return 0; return 0;
} }

View file

@ -118,7 +118,8 @@ void field_selector(char c)
default: default:
eprintf("field_selector: unknown sort order: %c", eprintf("field_selector: unknown sort order: %c",
config.sort[0]); config.sort[0]);
usage(EXIT_FAILURE); print_help;
exit(EXIT_FAILURE);
} }
} }
@ -165,6 +166,7 @@ int get_order(struct range_t *left, struct range_t *right)
void mergesort_ranges(struct range_t *orig, int size, struct range_t *temp) void mergesort_ranges(struct range_t *orig, int size, struct range_t *temp)
{ {
int left, right, i; int left, right, i;
long int val;
struct range_t hold; struct range_t hold;
if (size < MIN_MERGE_SIZE) { if (size < MIN_MERGE_SIZE) {