Compare commits

..

No commits in common. "master" and "v3.1" have entirely different histories.
master ... v3.1

31 changed files with 1287 additions and 2059 deletions

View file

@ -1,6 +1,7 @@
## Makefile.am -- Process this file with automake to produce Makefile.in
AUTOMAKE_OPTIONS = gnu
ACLOCAL_AMFLAGS = -I m4
EXTRA_DIST = \
.version \
@ -39,7 +40,7 @@ edit_cmd = sed \
$(PATHFILES): Makefile
@ rm -f $@ $@.tmp
$(AM_V_at) mkdir -p $$(dirname $@)
$(AM_V_at) test -d $(dir $@) || mkdir -p $(dir $@)
$(AM_V_GEN) srcdir=''; \
test -f ./$@.in || srcdir=$(srcdir)/; \
$(edit_cmd) $${srcdir}$@.in >$@.tmp

34
NEWS
View file

@ -7,40 +7,6 @@ Please send dhcpd-pools bug reports to kerolasa@iki.fi.
gpg: Signature is crated using RSA key ID 8ED396E37E38D471A00530D3A9553245FDE9B739.
Version 3.3
Belkacem Daheb (2):
add start, end and hostname printing support for xml and json
getdata output: add start, end and hostname printing support for xml and json
M. van Brummelen (1):
docs: fix manual page groff warning
Sami Kerola (9):
update project web page
website: use https
chore: update web links
getdata: only emit warning when config include file cannot be read
gnulib: update bootstrap and gitignore files
build-sys: quote subshell execution in the autotools file
build-sys: update bootstrap from gnulib
output: update html javascripts
release: 3.3
luisδμ (1):
fix: avoid generation of unvalid JSON in summary
Version 3.2
Jean Benoit (1):
contrib: snmptest.pl SNMPwalk can't access to all variables/wrong sort
Sami Kerola (5):
contrib: point out where one can find zabbix template
build-sys: update .gitignore files
config: remove unnecessary padding
build-sys: autotools and gnulib related updates
build-sys: routine update
release: 3.2
Version 3.1
Mark Sangster (1):

4
README
View file

@ -28,7 +28,7 @@ Quick start.
Dependencies to other projects.
https://www.gnu.org/software/gnulib/
http://www.gnu.org/software/gnulib/
You can avoid repeated gnulib downloads by setting
GNULIB_SRCDIR environment variable. For example:
@ -39,7 +39,7 @@ Dependencies to other projects.
Assumign detached gnulib please remember to git pull the
latest updates before building dhcpd-pools.
https://troydhanson.github.io/uthash/
http://uthash.sourceforge.net/
See quick start.

5
THANKS
View file

@ -47,8 +47,3 @@ José Bollo
Sebastián Cramatte
Mark Sangster
Brent Swingle
Mathieu Morier
Jean Benoit
Belkacem Daheb
Björn Lässig
Luisδμ

1745
bootstrap

File diff suppressed because it is too large Load diff

View file

@ -1,10 +1,10 @@
# Bootstrap configuration. -*- sh -*-
# Bootstrap configuration.
# Copyright (C) 2006-2025 Free Software Foundation, Inc.
# Copyright (C) 2006-2020 Free Software Foundation, Inc.
# 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 3 of the License, or
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
@ -64,7 +64,7 @@ XGETTEXT_OPTIONS=$XGETTEXT_OPTIONS'\\\
gettext_external=0
grep '^[ ]*AM_GNU_GETTEXT(external\>' configure.ac > /dev/null &&
gettext_external=1
grep '^[ ]*AM_GNU_GETTEXT(\[external]' configure.ac > /dev/null &&
grep '^[ ]*AM_GNU_GETTEXT(\[external\]' configure.ac > /dev/null &&
gettext_external=1
if test $gettext_external = 1; then

View file

@ -1,12 +1,12 @@
#!/bin/sh
# Print a version string.
scriptversion=2022-01-27.18; # UTC
scriptversion=2012-12-31.23; # UTC
# Copyright (C) 2007-2022 Free Software Foundation, Inc.
# Copyright (C) 2007-2013 Free Software Foundation, Inc.
#
# 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 3 of the License, or
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
@ -15,9 +15,9 @@ scriptversion=2022-01-27.18; # UTC
# 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, see <https://www.gnu.org/licenses/>.
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# This script is derived from GIT-VERSION-GEN from GIT: https://git-scm.com/.
# This script is derived from GIT-VERSION-GEN from GIT: http://git.or.cz/.
# It may be run two ways:
# - from a git repository in which the "git describe" command below
# produces useful output (thus requiring at least one signed tag)
@ -65,21 +65,19 @@ scriptversion=2022-01-27.18; # UTC
# EXTRA_DIST = $(top_srcdir)/.version
# BUILT_SOURCES = $(top_srcdir)/.version
# $(top_srcdir)/.version:
# echo '$(VERSION)' > $@-t
# mv $@-t $@
# echo $(VERSION) > $@-t && mv $@-t $@
# dist-hook:
# echo '$(VERSION)' > $(distdir)/.tarball-version
# echo $(VERSION) > $(distdir)/.tarball-version
me=$0
year=`expr "$scriptversion" : '\([^-]*\)'`
version="git-version-gen $scriptversion
Copyright (C) ${year} Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law."
Copyright 2011 Free Software Foundation, Inc.
There is NO warranty. You may redistribute this software
under the terms of the GNU General Public License.
For more information about these matters, see the files named COPYING."
usage="\
Usage: $me [OPTION]... \$srcdir/.tarball-version [TAG-NORMALIZATION-SED-SCRIPT]
@ -87,9 +85,8 @@ Print a version string.
Options:
--prefix PREFIX prefix of git tags (default 'v')
--fallback VERSION
fallback version to use if \"git --version\" fails
--prefix prefix of git tags (default 'v')
--fallback fallback version to use if \"git --version\" fails
--help display this help and exit
--version output version information and exit
@ -103,8 +100,8 @@ while test $# -gt 0; do
case $1 in
--help) echo "$usage"; exit 0;;
--version) echo "$version"; exit 0;;
--prefix) shift; prefix=${1?};;
--fallback) shift; fallback=${1?};;
--prefix) shift; prefix="$1";;
--fallback) shift; fallback="$1";;
-*)
echo "$0: Unknown option '$1'." >&2
echo "$0: Try '--help' for more information." >&2
@ -143,9 +140,11 @@ then
v=`cat $tarball_version_file` || v=
case $v in
*$nl*) v= ;; # reject multi-line output
[0-9]*) ;;
*) v= ;;
esac
test "x$v" = x \
&& echo "$0: WARNING: $tarball_version_file is damaged" 1>&2
&& echo "$0: WARNING: $tarball_version_file is missing or damaged" 1>&2
fi
if test "x$v" != x
@ -167,10 +166,9 @@ then
# tag or the previous older version that did not?
# Newer: v6.10-77-g0f8faeb
# Older: v6.10-g0f8faeb
vprefix=`expr "X$v" : 'X\(.*\)-g[^-]*$'` || vprefix=$v
case $vprefix in
*-*) : git describe is probably okay three part flavor ;;
*)
case $v in
*-*-*) : git describe is okay three part flavor ;;
*-*)
: git describe is older two part flavor
# Recreate the number of commits and rewrite such that the
# result is the same as if we were using the newer version
@ -185,9 +183,9 @@ then
;;
esac
# Change the penultimate "-" to ".", for version-comparing tools.
# Remove the "g" to save a byte.
v=`echo "$v" | sed 's/-\([^-]*\)-g\([^-]*\)$/.\1-\2/'`;
# Change the first '-' to a '.', so version-comparing tools work properly.
# Remove the "g" in git describe's output string, to save a byte.
v=`echo "$v" | sed 's/-/./;s/\(.*\)-g/\1-/'`;
v_from_git=1
elif test "x$fallback" = x || git --version >/dev/null 2>&1; then
v=UNKNOWN
@ -201,7 +199,7 @@ v=`echo "$v" |sed "s/^$prefix//"`
# string we're using came from git. I.e., skip the test if it's "UNKNOWN"
# or if it came from .tarball-version.
if test "x$v_from_git" != x; then
# Don't declare a version "dirty" merely because a timestamp has changed.
# Don't declare a version "dirty" merely because a time stamp has changed.
git update-index --refresh > /dev/null 2>&1
dirty=`exec 2>/dev/null;git diff-index --name-only HEAD` || dirty=
@ -216,12 +214,12 @@ if test "x$v_from_git" != x; then
fi
# Omit the trailing newline, so that m4_esyscmd can use the result directly.
printf %s "$v"
echo "$v" | tr -d "$nl"
# Local variables:
# eval: (add-hook 'before-save-hook 'time-stamp)
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC0"
# time-stamp-time-zone: "UTC"
# time-stamp-end: "; # UTC"
# End:

View file

@ -2,11 +2,11 @@
# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.69])
AC_CONFIG_MACRO_DIRS([m4])
AC_CONFIG_MACRO_DIR([m4])
AC_INIT([dhcpd-pools],
[m4_esyscmd([build-aux/git-version-gen .tarball-version])],
[kerolasa@iki.fi],[],
[https://dhcpd-pools.sourceforge.net/])
[http://dhcpd-pools.sourceforge.net/])
PACKAGE_MAINTAINER="Sami Kerola"
AC_SUBST([PACKAGE_MAINTAINER])
AC_CONFIG_AUX_DIR([build-aux])

View file

@ -7,7 +7,7 @@ pkgver=0
pkgrel=1
pkgdesc="ISC dhcpd lease status utility"
arch=('i686' 'x86_64')
url=https://dhcpd-pools.sourceforge.net/
url=http://dhcpd-pools.sourceforge.net/
license=('BSD')
depends=('pacman')
makedepends=('uthash' 'git')

View file

@ -23,10 +23,9 @@
# you set $dbg to 1 then output will be generated in /tmp.
use strict;
use NetSNMP::OID;
# Version info:
my $SNMPver = "snmp1.1";
my $SNMPver = "snmp1.0";
my $DHCPver = "dhcp1.0";
my $VERSION = "$SNMPver/$DHCPver";
#
@ -194,7 +193,7 @@ sub ParseDataFile () {
}
close IN;
if ($dbg) {
foreach (sort Oidcmp @validoidlist) { print DBG "ValidOID: $_\n"; }
foreach (sort @validoidlist) { print DBG "ValidOID: $_\n"; }
}
if ($dbg) {
@ -371,7 +370,7 @@ sub GetData ($) {
@userquery = split (/\./, $userqueryoid);
my $found = 0;
foreach (sort Oidcmp @validoidlist) {
foreach (sort @validoidlist) {
$next = $_;
print DBG "Comparing $userqueryoid vs. $_\n" if $dbg;
@validoid = split (/\./, $_);
@ -433,12 +432,6 @@ sub Pong {
$line = 0;
}
sub Oidcmp {
my $oida = new NetSNMP::OID($a);
my $oidb = new NetSNMP::OID($b);
snmp_oid_compare($oida, $oidb);
}
################################## START ##################################
#
# Main

View file

@ -1,4 +0,0 @@
Zabbix 5 template, and instructions how to use it, can be found from
Mathieu's repository.
https://github.com/mmorier86/dhcpd-pools-zabbix-template

117
lib/.gitignore vendored
View file

@ -1,22 +1,13 @@
/alloca.h
/alloca.in.h
/arg-nonnull.h
/arpa/
/arpa_inet.c
/arpa/inet.h
/arpa_inet.in.h
/assert.in.h
/attribute.h
/basename-lgpl.c
/basename-lgpl.h
/c32is-impl.h
/c32isprint.c
/calloc.c
/c-ctype.c
/c-ctype.h
/c++defs.h
/cdefs.h
/cloexec.c
/cloexec.h
/close.c
/closeout.c
/closeout.h
@ -26,15 +17,15 @@
/c-strcaseeq.h
/c-strcase.h
/c-strncasecmp.c
/dup2.c
/dirname.h
/dirname-lgpl.c
/dosname.h
/errno.in.h
/error.c
/error.h
/error.in.h
/exitfail.c
/exitfail.h
/fclose.c
/fcntl.c
/fcntl.h
/fcntl.in.h
/fd-hook.c
@ -45,7 +36,6 @@
/flexmember.h
/float.c
/float+.h
/float.h
/float.in.h
/fopen.c
/fpending.c
@ -53,15 +43,11 @@
/fpurge.c
/freading.c
/freading.h
/free.c
/fseek.c
/fseeko.c
/fstat.c
/ftell.c
/ftello.c
/getdtablesize.c
/getlocalename_l-unsafe.c
/getlocalename_l-unsafe.h
/getopt1.c
/getopt.c
/getopt-cdefs.in.h
@ -74,14 +60,11 @@
/getprogname.c
/getprogname.h
/gettext.h
/glthread/*
/hard-locale.c
/hard-locale.h
/ialloc.c
/ialloc.h
/idx.h
/inet_pton.c
/intprops.h
/intprops-internal.h
/inttypes.h
/inttypes.in.h
/isnan.c
@ -93,60 +76,16 @@
/lc-charset-dispatch.h
/libc-config.h
/libdhcpd_pools.la
/libdhcpd_pools_la-arpa_inet.lo
/libdhcpd_pools_la-basename-lgpl.lo
/libdhcpd_pools_la-c32isprint.lo
/libdhcpd_pools_la-c-ctype.lo
/libdhcpd_pools_la-cloexec.lo
/libdhcpd_pools_la-closeout.lo
/libdhcpd_pools_la-close-stream.lo
/libdhcpd_pools_la-c-strcasecmp.lo
/libdhcpd_pools_la-exitfail.lo
/libdhcpd_pools_la-fclose.lo
/libdhcpd_pools_la-fcntl.lo
/libdhcpd_pools_la-fd-hook.lo
/libdhcpd_pools_la-fflush.lo
/libdhcpd_pools_la-float.lo
/libdhcpd_pools_la-fopen.lo
/libdhcpd_pools_la-fpurge.lo
/libdhcpd_pools_la-freading.lo
/libdhcpd_pools_la-fseek.lo
/libdhcpd_pools_la-fseeko.lo
/libdhcpd_pools_la-getprogname.lo
/libdhcpd_pools_la-hard-locale.lo
/libdhcpd_pools_la-ialloc.lo
/libdhcpd_pools_la-localcharset.lo
/libdhcpd_pools_la-malloca.lo
/libdhcpd_pools_la-math.lo
/libdhcpd_pools_la-mbrtoc32.lo
/libdhcpd_pools_la-mbrtowc.lo
/libdhcpd_pools_la-mbszero.lo
/libdhcpd_pools_la-mktime.lo
/libdhcpd_pools_la-nstrftime.lo
/libdhcpd_pools_la-progname.lo
/libdhcpd_pools_la-quotearg.lo
/libdhcpd_pools_la-reallocarray.lo
/libdhcpd_pools_la-realloc.lo
/libdhcpd_pools_la-setlocale_null.lo
/libdhcpd_pools_la-setlocale_null-unlocked.lo
/libdhcpd_pools_la-stat-time.lo
/libdhcpd_pools_la-stdlib.lo
/libdhcpd_pools_la-sys_socket.lo
/libdhcpd_pools_la-timegm.lo
/libdhcpd_pools_la-time_rz.lo
/libdhcpd_pools_la-unistd.lo
/libdhcpd_pools_la-wctype-h.lo
/libdhcpd_pools_la-xalloc-die.lo
/libdhcpd_pools_la-xmalloc.lo
/.libs/
/limits.h
/limits.in.h
/*.lo
/localcharset.c
/localcharset.h
/locale.h
/locale.in.h
/localename.h
/localename-unsafe.c
/localtime-buffer.c
/localtime-buffer.h
/lseek.c
/Makefile.am
/malloca.c
@ -155,12 +94,10 @@
/math.c
/math.h
/math.in.h
/mbrtoc32.c
/mbrtowc.c
/mbrtowc-impl.h
/mbrtowc-impl-utf8.h
/mbsinit.c
/mbszero.c
/mbtowc-lock.c
/mbtowc-lock.h
/memchr.c
@ -175,36 +112,29 @@
/netinet_in.in.h
/_Noreturn.h
/nstrftime.c
/open.c
/pathmax.h
/progname.c
/progname.h
/quotearg.c
/quotearg.h
/quote.h
/reallocarray.c
/realloc.c
/setenv.c
/setlocale-lock.c
/setlocale_null.c
/setlocale_null.h
/setlocale_null-unlocked.c
/stat.c
/stat-time.c
/stat-time.h
/stat-w32.c
/stat-w32.h
/stdckdint.h
/stdckdint.in.h
/stddef.h
/stdalign.in.h
/stdbool.in.h
/stddef.in.h
/stdint.in.h
/stdio.h
/stdio-impl.h
/stdio.in.h
/stdio-read.c
/stdio-write.c
/stdlib.c
/stdlib.h
/stdlib.in.h
/stpncpy.c
@ -213,18 +143,21 @@
/strerror.c
/strerror-override.c
/strerror-override.h
/strftime.c
/strftime.h
/string.h
/string.in.h
/stripslash.c
/strstr.c
/strtod.c
/str-two-way.h
/sys/
/sys_socket.c
/sys/socket.h
/sys_socket.in.h
/sys/stat.h
/sys_stat.in.h
/sys/types.h
/sys_types.in.h
/sys/uio.h
/sys_uio.in.h
/timegm.c
/time.h
@ -233,21 +166,11 @@
/time_r.c
/time_rz.c
/tzset.c
/uchar.h
/uchar.in.h
/unictype/
/unictype/bitmap.h
/unictype/ctype_print.c
/unictype/ctype_print.h
/unictype/.gitignore
/unictype.h
/unictype.in.h
/unistd.c
/unistd.h
/unistd.in.h
/unitypes.h
/unitypes.in.h
/unsetenv.c
/unused-parameter.h
/verify.h
/warn-on-use.h
/wchar.h
@ -256,6 +179,14 @@
/wctype-h.c
/wctype.in.h
/windows-initguard.h
/windows-mutex.c
/windows-mutex.h
/windows-once.c
/windows-once.h
/windows-recmutex.c
/windows-recmutex.h
/windows-rwlock.c
/windows-rwlock.h
/xalloc-die.c
/xalloc.h
/xalloc-oversized.h

View file

@ -1,5 +1,4 @@
'\" t
.TH DHCPD-POOLS "1" "2024-08-09" "@VERSION@" "User Commands"
.TH DHCPD-POOLS "1" "2017-11-15" "@VERSION@" "User Commands"
.SH NAME
dhcpd-pools \- ISC dhcpd pools usage analysis
.SH SYNOPSIS

View file

@ -3,9 +3,9 @@
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
xmlns:foaf="http://xmlns.com/foaf/0.1/">
<Project rdf:about="https://dhcpd-pools.sourceforge.net/">
<Project rdf:about="http://dhcpd-pools.sourceforge.net/">
<name>dhcpd-pools</name>
<homepage rdf:resource="https://dhcpd-pools.sourceforge.net/" />
<homepage rdf:resource="http://dhcpd-pools.sourceforge.net/" />
<shortdesc>This is dhcpd-pools ISC dhcp shared network and pool
range usage analysis tool.</shortdesc>
<description>Purpose of command is to count usage ratio of each

View file

@ -343,7 +343,8 @@ int main(int argc, char **argv)
.header_limit = 8,
.ranges_size = 64,
.ip_version = IPvUNKNOWN,
.color_mode = color_auto
.color_mode = color_auto,
0
};
int ret_val;

View file

@ -102,9 +102,6 @@ enum prefix_t {
PREFIX_BINDING_STATE_ACTIVE,
PREFIX_BINDING_STATE_BACKUP,
PREFIX_HARDWARE_ETHERNET,
PREFIX_STARTS,
PREFIX_ENDS,
PREFIX_HOSTNAME,
NUM_OF_PREFIX
};
@ -130,6 +127,7 @@ struct shared_network_t {
double backups;
struct shared_network_t *next;
int netmask;
uint32_t pad;
};
/*! \struct range_t
@ -154,6 +152,7 @@ struct output_helper_t {
double tcp;
double bup;
int status;
uint32_t pad;
};
/*! \struct status_counts_t
@ -183,9 +182,7 @@ struct leases_t {
char *ethernet;
UT_hash_handle hh;
enum ltype type;
char *ends;
char *starts;
char *hostname;
uint32_t pad;
};
/*! \enum limbits
@ -254,7 +251,8 @@ struct conf_t {
skip_critical:1, /*!< Skip critical values from output. */
skip_minsize:1, /*!< Skip alarming values that are below minsize from output. */
skip_suppressed:1, /*!< Skip alarming values that are suppressed with --snet-alarms option, or they are shared networks without IP availability. */
color_mode:2; /*!< Indicator if colors should be used in output. */
color_mode:2, /*!< Indicator if colors should be used in output. */
pad_bits:4;
};
/* Function prototypes */

View file

@ -83,7 +83,7 @@ enum isc_conf_parser {
int parse_leases(struct conf_t *state)
{
FILE *dhcpd_leases;
char *line, *ipstring, macstring[20], *stop, endsstr[30], startsstr[30], hostnamestr[MAXLEN];
char *line, *ipstring, macstring[20], *stop;
union ipaddr_t addr;
struct leases_t *lease;
@ -100,9 +100,6 @@ int parse_leases(struct conf_t *state)
line[0] = '\0';
ipstring = xmalloc(sizeof(char) * MAXLEN);
ipstring[0] = '\0';
endsstr[0] = '\0';
startsstr[0] = '\0';
hostnamestr[0] = '\0';
while (!feof(dhcpd_leases)) {
if (!fgets(line, MAXLEN, dhcpd_leases) && ferror(dhcpd_leases))
error(EXIT_FAILURE, errno, "parse_leases: %s", state->dhcpdlease_file);
@ -145,35 +142,8 @@ int parse_leases(struct conf_t *state)
break;
memcpy(macstring, line + 20, 17);
macstring[17] = '\0';
if ((lease = find_lease(state, &addr)) != NULL) {
if ((lease = find_lease(state, &addr)) != NULL)
lease->ethernet = xstrdup(macstring);
lease->starts = xstrdup(startsstr);
startsstr[0] = '\0';
lease->ends = xstrdup(endsstr);
endsstr[0] = '\0';
}
break;
case PREFIX_ENDS:
if (state->print_mac_addreses == 0)
break;
strncpy(endsstr, line + 7, sizeof(endsstr)-1);
endsstr[strlen(endsstr)-2] = '\0';
break;
case PREFIX_STARTS:
if (state->print_mac_addreses == 0)
break;
strncpy(startsstr, line + 9, sizeof(startsstr)-1);
startsstr[strlen(startsstr)-2] = '\0';
break;
case PREFIX_HOSTNAME:
if (state->print_mac_addreses == 0)
break;
strncpy(hostnamestr, line + 19, sizeof(hostnamestr)-1);
hostnamestr[strlen(hostnamestr)-3] = '\0';
if ((lease = find_lease(state, &addr)) != NULL) {
lease->hostname = xstrdup(hostnamestr);
}
hostnamestr[0] = '\0';
break;
default:
/* do nothing */ ;
@ -241,14 +211,8 @@ void parse_config(struct conf_t *state, const int is_include, const char *restri
shared_p->name = state->shared_net_root->name;
/* Open configuration file */
dhcpd_config = fopen(config_file, "r");
if (dhcpd_config == NULL) {
if (is_include) {
error(0, errno, "cannot open inlude: %s", config_file);
return;
}
/* config if from command line, just exit with error */
if (dhcpd_config == NULL)
error(EXIT_FAILURE, errno, "parse_config: %s", config_file);
}
#ifdef HAVE_POSIX_FADVISE
# ifdef POSIX_FADV_SEQUENTIAL
if (posix_fadvise(fileno(dhcpd_config), 0, 0, POSIX_FADV_SEQUENTIAL) != 0)

View file

@ -66,9 +66,6 @@ void add_lease_v4(struct conf_t *state, union ipaddr_t *addr, enum ltype type)
l->type = type;
HASH_ADD_INT(state->leases, ip.v4, l);
l->ethernet = NULL;
l->ends = NULL;
l->starts = NULL;
l->hostname = NULL;
}
void add_lease_v6(struct conf_t *state, union ipaddr_t *addr, enum ltype type)
@ -80,9 +77,6 @@ void add_lease_v6(struct conf_t *state, union ipaddr_t *addr, enum ltype type)
l->type = type;
HASH_ADD_V6(state->leases, ip.v6, l);
l->ethernet = NULL;
l->ends = NULL;
l->starts = NULL;
l->hostname = NULL;
}
/*! \brief Find pointer to lease from hash array.
@ -116,9 +110,6 @@ struct leases_t *find_lease_v6(struct conf_t *state, union ipaddr_t *addr)
void delete_lease(struct conf_t *state, struct leases_t *lease)
{
free(lease->ethernet);
free(lease->ends);
free(lease->starts);
free(lease->hostname);
HASH_DEL(state->leases, lease);
free(lease);
}
@ -131,9 +122,6 @@ void delete_all_leases(struct conf_t *state)
HASH_ITER(hh, state->leases, l, tmp) {
free(l->ethernet);
free(l->ends);
free(l->starts);
free(l->hostname);
HASH_DEL(state->leases, l);
free(l);
}
@ -146,9 +134,6 @@ void delete_all_leases(struct conf_t *state)
l = state->leases;
free(l->ethernet);
free(l->ends);
free(l->starts);
free(l->hostname);
HASH_DEL(state->leases, l); /* leases advances to next on delete */
free(l);
}

View file

@ -8,7 +8,7 @@
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
@ -19,8 +19,6 @@
#define _GNU_SOURCE
#include "config.h"
#include <stdlib.h>
#include <stdio.h>
#include <string.h>

View file

@ -8,7 +8,7 @@
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,

View file

@ -417,12 +417,6 @@ int
}
if (!memcmp("lease ", str, 6))
return PREFIX_LEASE;
else if (!memcmp(" starts ", str, 9))
return PREFIX_STARTS;
else if (!memcmp(" ends ", str, 7))
return PREFIX_ENDS;
else if (!memcmp(" client-hostname ", str, 18))
return PREFIX_HOSTNAME;
return NUM_OF_PREFIX;
}
@ -478,12 +472,6 @@ int
}
if (!memcmp(" iaaddr ", str, 9))
return PREFIX_LEASE;
else if (!memcmp(" starts ", str, 9))
return PREFIX_STARTS;
else if (!memcmp(" ends ", str, 7))
return PREFIX_ENDS;
else if (!memcmp(" client-hostname ", str, 18))
return PREFIX_HOSTNAME;
return NUM_OF_PREFIX;
}

View file

@ -387,19 +387,7 @@ static int output_xml(struct conf_t *state)
if (l->ethernet != NULL) {
fputs(l->ethernet, outfile);
}
fputs("</macaddress>\n\t<starts>", outfile);
if (l->starts != NULL) {
fputs(l->starts, outfile);
}
fputs("</starts>\n\t<ends>", outfile);
if (l->ends != NULL) {
fputs(l->ends, outfile);
}
fputs("</ends>\n\t<hostname>", outfile);
if (l->hostname != NULL) {
fputs(l->hostname, outfile);
}
fputs("</hostname>\n</active_lease>\n", outfile);
fputs("</macaddress>\n</active_lease>\n", outfile);
}
}
}
@ -493,18 +481,6 @@ static int output_json(struct conf_t *state)
if (l->ethernet != NULL) {
fputs(l->ethernet, outfile);
}
fputs("\", \"starts\":\"", outfile);
if (l->starts != NULL) {
fputs(l->starts, outfile);
}
fputs("\", \"ends\":\"", outfile);
if (l->ends != NULL) {
fputs(l->ends, outfile);
}
fputs("\", \"hostname\":\"", outfile);
if (l->hostname != NULL) {
fputs(l->hostname, outfile);
}
fputs("\" }", outfile);
}
}
@ -611,15 +587,9 @@ static int output_json(struct conf_t *state)
fprintf(outfile, " \"touched\":%g,\n", state->shared_net_root->touched);
fprintf(outfile, " \"free\":%g,\n",
state->shared_net_root->available - state->shared_net_root->used);
if (fpclassify(state->shared_net_root->available) == FP_ZERO)
fprintf(outfile, " \"percent\":\"%g\",\n", oh.percent);
else
fprintf(outfile, " \"percent\":%g,\n", oh.percent);
fprintf(outfile, " \"percent\":%g,\n", oh.percent);
fprintf(outfile, " \"touch_count\":%g,\n", oh.tc);
if (fpclassify(state->shared_net_root->available) == FP_ZERO)
fprintf(outfile, " \"touch_percent\":\"%g\",\n", oh.tcp);
else
fprintf(outfile, " \"touch_percent\":%g,\n", oh.tcp);
fprintf(outfile, " \"touch_percent\":%g,\n", oh.tcp);
if (state->backups_found == 1) {
fprintf(outfile, " \"backup_count\":%g,\n",
state->shared_net_root->backups);
@ -658,8 +628,8 @@ static void html_header(struct conf_t *state, FILE *restrict f)
fprintf(f, "<meta charset=\"utf-8\">\n");
fprintf(f, "<meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\">\n");
fprintf(f, "<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n");
fprintf(f, "<link rel=\"stylesheet\" href=\"https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css\" type=\"text/css\">\n");
fprintf(f, "<link rel=\"stylesheet\" type=\"text/css\" href=\"https://cdn.datatables.net/v/dt/dt-2.2.2/datatables.min.css\">\n");
fprintf(f, "<link rel=\"stylesheet\" href=\"https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css\" type=\"text/css\">\n");
fprintf(f, "<link rel=\"stylesheet\" type=\"text/css\" href=\"https://cdn.datatables.net/1.10.20/css/jquery.dataTables.min.css\">\n");
fprintf(f, "<style type=\"text/css\">\n");
fprintf(f, "table.dhcpd-pools th { text-transform: capitalize }\n");
fprintf(f, "</style>\n");
@ -682,8 +652,8 @@ static void html_footer(FILE *restrict f)
fprintf(f, "<small>Generated using %s<br />\n", PACKAGE_STRING);
fprintf(f, "More info at <a href=\"%s\">%s</a>\n", PACKAGE_URL, PACKAGE_URL);
fprintf(f, "</small></div></div>\n");
fprintf(f, "<script src=\"https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.min.js\" type=\"text/javascript\"></script>\n");
fprintf(f, "<script type=\"text/javascript\" src=\"https://cdn.datatables.net/v/dt/dt-2.2.2/datatables.min.js\"></script>\n");
fprintf(f, "<script src=\"https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js\" type=\"text/javascript\"></script>\n");
fprintf(f, "<script type=\"text/javascript\" src=\"https://cdn.datatables.net/v/bs/jq-3.2.1/dt-1.10.16/datatables.min.js\"></script>\n");
fprintf(f, "<script type=\"text/javascript\" class=\"init\">$(document).ready(function() { $('#s').DataTable({ \"iDisplayLength\": 50, \"lengthMenu\": [ [25, 50, 100, -1], [25, 50, 100, \"All\"] ], \"order\": [[ 4, \"desc\" ]] } ); } );</script>\n");
fprintf(f, "<script type=\"text/javascript\" class=\"init\">$(document).ready(function() { $('#r').DataTable({ \"iDisplayLength\": 100, \"lengthMenu\": [ [25, 50, 100, -1], [25, 50, 100, \"All\"] ], \"order\": [[ 6, \"desc\" ]] } ); } );</script>\n");
fprintf(f, "</body></html>\n");

View file

@ -7,16 +7,7 @@ dhcpd-pools: unknown color mode: 'sometimes'
=== IPv5
dhcpd-pools: unknown --ip-version argument: 5
=== missing conf
dhcpd-pools: cannot open inlude: ./tests/confs/complete_NXFILE: No such file or directory
Ranges:
shared net name first ip last ip max cur percent touch t+c t+c perc
Shared networks:
name max cur percent touch t+c t+c perc
Sum of all ranges:
name max cur percent touch t+c t+c perc
All networks 0 0 nan 0 0 nan
dhcpd-pools: parse_config: ./tests/confs/complete_NXFILE: No such file or directory
=== missing leases
dhcpd-pools: parse_leases: ./tests/leases/complete_NXFILE: No such file or directory
=== html table

View file

@ -23,8 +23,8 @@ All networks 100 43 43.000 0 43 43.000
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" type="text/css">
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/v/dt/dt-2.2.2/datatables.min.css">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" type="text/css">
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.10.20/css/jquery.dataTables.min.css">
<style type="text/css">
table.dhcpd-pools th { text-transform: capitalize }
</style>
@ -176,10 +176,10 @@ table.dhcpd-pools th { text-transform: capitalize }
</tbody>
</table>
<br /><div class="well well-lg">
More info at <a href="https://dhcpd-pools.sourceforge.net/">https://dhcpd-pools.sourceforge.net/</a>
More info at <a href="http://dhcpd-pools.sourceforge.net/">http://dhcpd-pools.sourceforge.net/</a>
</small></div></div>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.min.js" type="text/javascript"></script>
<script type="text/javascript" src="https://cdn.datatables.net/v/dt/dt-2.2.2/datatables.min.js"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js" type="text/javascript"></script>
<script type="text/javascript" src="https://cdn.datatables.net/v/bs/jq-3.2.1/dt-1.10.16/datatables.min.js"></script>
<script type="text/javascript" class="init">$(document).ready(function() { $('#s').DataTable({ "iDisplayLength": 50, "lengthMenu": [ [25, 50, 100, -1], [25, 50, 100, "All"] ], "order": [[ 4, "desc" ]] } ); } );</script>
<script type="text/javascript" class="init">$(document).ready(function() { $('#r').DataTable({ "iDisplayLength": 100, "lengthMenu": [ [25, 50, 100, -1], [25, 50, 100, "All"] ], "order": [[ 6, "desc" ]] } ); } );</script>
</body></html>

View file

@ -1,6 +1,6 @@
{
"active_leases": [
{ "ip":"10.0.0.5", "macaddress":"00:00:00:00:00:00", "starts":"", "ends":"", "hostname":"" }
{ "ip":"10.0.0.5", "macaddress":"00:00:00:00:00:00" }
],
"subnets": [
{ "location":"All networks", "range":"10.0.0.1 - 10.0.0.10", "first_ip":"10.0.0.1", "last_ip":"10.0.0.10", "defined":10, "used":1, "touched":0, "free":9, "percent":10, "touch_count":1, "touch_percent":10, "status":0 }

View file

@ -2,9 +2,6 @@
<active_lease>
<ip>10.0.0.5</ip>
<macaddress>00:00:00:00:00:00</macaddress>
<starts></starts>
<ends></ends>
<hostname></hostname>
</active_lease>
<subnet>
<location>All networks</location>

View file

@ -4,11 +4,12 @@
# analysis algorithm is sane. This script is no longer
# maintained, and can be considered as historic reference.
#
# Licensed under the Open Software License version 1.0
# https://opensource.org/license/osl-1-0/
# Licensed under the Open Software License version 1.1
# http://opensource.org/licenses/osl.php
#
# Sami Kerola <sami.kerola@teliasonera.com>
#
# Latest version is available from http://www.iki.fi/kerolasa/dhcp/
# This is version 1.4
BEGIN {

View file

@ -30,7 +30,7 @@ font-variant: normal;
</style>
</head>
<body>
<div itemscope itemtype="https://schema.org/SoftwareApplication">
<div itemscope itemtype="http://schema.org/SoftwareApplication">
<h1>ISC dhcpd lease analysis and reporting</h1>
<p>This is <span itemprop="name">dhcpd-pools</span>
<a href="https://www.isc.org/software/dhcp" itemprop="applicationSuite">ISC dhcp</a>
@ -49,18 +49,9 @@ any significant difference in getting analysis done.</p>
prompt&gt; ./dhcpd-pools --config=/etc/dhcpd.conf
--leases=/var/lib/dhcp/dhcpd.leases --format=H
--color=always --warning=40 --critical=50 --output=<a
href="https://dhcpd-pools.sourceforge.net/sampleoutput.html">sampleoutput.html</a>
href="http://dhcpd-pools.sourceforge.net/sampleoutput.html">sampleoutput.html</a>
</div>
<hr />
<h3>Is dhcpd-pools still developed?</h3>
<p>In short no, it is not.</p>
<p>
<a href="https://www.isc.org/blogs/isc-dhcp-eol/">ISC DHCPD has reached
EOL</a>. Users are Kea DHCP server instead. Kea has <a
href="https://kea.readthedocs.io/en/kea-2.2.0/arm/stats.html">native
statistics</a>, so it does not require this tool and therefore the
dhcpd-pools is obsolte.
</p>
<h3>Where I can get dhcpd-pools?</h3>
<p>Download
<a href="https://sourceforge.net/projects/dhcpd-pools/files/" itemprop="downloadUrl">release package</a>
@ -70,11 +61,11 @@ file.
<br /></p>
<div class="tt">git clone git://git.code.sf.net/p/dhcpd-pools/code dhcpd-pools</div>
<p>See also
<a href="https://sourceforge.net/projects/dhcpd-pools">SourceForge</a> project page.</p>
<a href="http://sourceforge.net/projects/dhcpd-pools">SourceForge</a> project page.</p>
<h3>Documentation</h3>
<p>The dhcpd-pools
<a href="https://dhcpd-pools.sourceforge.net/man.html">manual page</a>, and
<a href="https://dhcpd-pools.sourceforge.net/doxygen/">Doxygen</a> software
<a href="http://dhcpd-pools.sourceforge.net/man.html">manual page</a>, and
<a href="http://dhcpd-pools.sourceforge.net/doxygen/">Doxygen</a> software
reference documentation are available online.</p>
<h3>Getting the output you need</h3>
<ol>
@ -89,8 +80,8 @@ try:<br />
<li>Start filtering output. Options to try:<br />
<span style="font-family:monospace">--skip --limit</span></li>
<li>Change <span style="font-family:monospace">--format</span>
option to what you need, and maybe include <span style="font-family:monospace">
--perfdata</span> if you want nagios alarm
option to what you need, and maybe include <span style=
"font-family:monospace">--perfdata</span> if you want nagios alarm
format.</li>
<li>Done.</li>
</ol>
@ -99,33 +90,33 @@ format.</li>
<script type='text/javascript' src='https://www.openhub.net/p/dhcpd-pools/widgets/project_factoids_stats?format=js'></script>
</p>
<p>The program was written because
<a href="https://dhcpstatus.sourceforge.net/">DHCPStatus</a>,
<a href="https://freshmeat.net/projects/dhcpusestats/">DHCP Usage Statistics</a>,
<a href="https://www.omar.org/opensource/reportdhcp/">reportdhcp.pl</a>,
<a href="https://www.ofb.net/%7Ejheiss/lease_analyzer">lease_analyzer</a> and
<a href="https://www.net-track.ch/opensource/dhcpd-snmp/">dhcpd-snmp</a>
<a href="http://dhcpstatus.sourceforge.net/">DHCPStatus</a>,
<a href="http://freshmeat.net/projects/dhcpusestats/">DHCP Usage Statistics</a>,
<a href="http://www.omar.org/opensource/reportdhcp/">reportdhcp.pl</a>,
<a href="http://www.ofb.net/%7Ejheiss/lease_analyzer">lease_analyzer</a> and
<a href="http://www.net-track.ch/opensource/dhcpd-snmp/">dhcpd-snmp</a>
where too slow to handle huge number of leases. There is also difference in
printed details. The dhcpd-pools does not print quite as much information as
some other tools.</p>
<p>Notice that this utility is not the same as
<a href="https://folk.uio.no/trondham/software/dhcpd-pool.html">dhcpd-pool</a>
<a href="http://folk.uio.no/trondham/software/dhcpd-pool.html">dhcpd-pool</a>
that is maintained by Trond Hasle Amundsen.</p>
<p>Just for laugh, obsolete awk proof of concept (version 1.4)
<a href="https://dhcpd-pools.sourceforge.net/dhcpd-pools.awk">dhcpd-pools.awk</a></p>
<a href="http://dhcpd-pools.sourceforge.net/dhcpd-pools.awk">dhcpd-pools.awk</a></p>
<h3>Where to send questions, bug reports, code contributions...</h3>
<p><a href="https://kerolasa.iki.fi/" itemprop="copyrightHolder">Sami Kerola</a>
<p><a href="http://www.iki.fi/kerolasa/" itemprop="copyrightHolder">Sami Kerola</a>
&lt;<a href="mailto:kerolasa@iki.fi">kerolasa@iki.fi</a>&gt;</p>
<div style="visibility:hidden">
<span itemprop="datePublished" datetime="2006-03-13T00:00:00+0000">Mon Mar 13 00:00:00 GMT 2006</span>
<span itemprop="dateModified" datetime="2022-11-26T09:58:28+0000">Sat Nov 26 09:58:28 GMT 2022</span>
<span itemprop="dateModified" datetime="2017-11-15T12:47:30+0000">Wed Nov 15 12:47:30 GMT 2017</span>
<span itemprop="version">3.0</span>
<span itemprop="license">FreeBSD License</span>
<a href="https://dhcpd-pools.sourceforge.net/" itemprop="url"></a>
<div itemprop="offers" itemscope itemtype="https://schema.org/Offer">
<a href="http://dhcpd-pools.sourceforge.net/" itemprop="url"></a>
<div itemprop="offers" itemscope itemtype="http://schema.org/Offer">
<span itemprop="price">0</span>
<meta itemprop="priceCurrency" content="EUR" />
</div>
<div itemprop="aggregateRating" itemscope itemtype="https://schema.org/AggregateRating">
<div itemprop="aggregateRating" itemscope itemtype="http://schema.org/AggregateRating">
<span itemprop="ratingValue">5</span> (
<span itemprop="ratingCount">2</span> ratings )
</div>

View file

@ -1,3 +1,3 @@
Sitemap: https://dhcpd-pools.sourceforge.net/sitemap.txt
Sitemap: http://dhcpd-pools.sourceforge.net/sitemap.txt
User-agent: *
Disallow:

View file

@ -5,8 +5,8 @@
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" type="text/css">
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/v/dt/dt-2.2.2/datatables.min.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" type="text/css">
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/v/bs/jq-3.2.1/dt-1.10.16/datatables.min.css">
<style type="text/css">
table.dhcpd-pools th { text-transform: capitalize }
</style>
@ -14,7 +14,7 @@ table.dhcpd-pools th { text-transform: capitalize }
<body>
<div class="container">
<h2>ISC DHCPD status</h2>
<small>File tests/leases/formats was last modified at 2025-04-15T14:32:48+0100</small><hr />
<small>File samples/dhcpd.leases was last modified at 2017-11-11T23:59:04+0000</small><hr />
<h3>Sum of all</h3>
<table id="a" class="dhcpd-pools order-column table table-hover" summary="all">
<thead>
@ -27,6 +27,8 @@ table.dhcpd-pools th { text-transform: capitalize }
<th>touch</th>
<th>t+c</th>
<th>t+c perc</th>
<th>bu</th>
<th>bu perc</th>
</tr>
</thead>
<tbody>
@ -39,6 +41,8 @@ table.dhcpd-pools th { text-transform: capitalize }
<td>0</td>
<td>43</td>
<td>43.000</td>
<td>2</td>
<td>43.000</td>
</tr>
</tbody>
</table>
@ -54,6 +58,8 @@ table.dhcpd-pools th { text-transform: capitalize }
<th>touch</th>
<th>t+c</th>
<th>t+c perc</th>
<th>bu</th>
<th>bu perc</th>
</tr>
</thead>
<tbody>
@ -66,6 +72,8 @@ table.dhcpd-pools th { text-transform: capitalize }
<td>0</td>
<td>21</td>
<td>52.500</td>
<td>1</td>
<td>2.500</td>
</tr>
<tr>
<td>example2</td>
@ -76,6 +84,8 @@ table.dhcpd-pools th { text-transform: capitalize }
<td>0</td>
<td>17</td>
<td>42.500</td>
<td>0</td>
<td>0.000</td>
</tr>
</tbody>
</table>
@ -93,6 +103,8 @@ table.dhcpd-pools th { text-transform: capitalize }
<th>touch</th>
<th>t+c</th>
<th>t+c perc</th>
<th>bu</th>
<th>bu perc</th>
</tr>
</thead>
<tbody>
@ -107,6 +119,8 @@ table.dhcpd-pools th { text-transform: capitalize }
<td>0</td>
<td>11</td>
<td>55.000</td>
<td>1</td>
<td>5.000</td>
</tr>
<tr>
<td>example1</td>
@ -119,6 +133,8 @@ table.dhcpd-pools th { text-transform: capitalize }
<td>0</td>
<td>10</td>
<td>50.000</td>
<td>0</td>
<td>0.000</td>
</tr>
<tr>
<td>example2</td>
@ -131,6 +147,8 @@ table.dhcpd-pools th { text-transform: capitalize }
<td>0</td>
<td>8</td>
<td>40.000</td>
<td>0</td>
<td>0.000</td>
</tr>
<tr>
<td>example2</td>
@ -143,6 +161,8 @@ table.dhcpd-pools th { text-transform: capitalize }
<td>0</td>
<td>9</td>
<td>45.000</td>
<td>0</td>
<td>0.000</td>
</tr>
<tr>
<td>All networks</td>
@ -155,15 +175,17 @@ table.dhcpd-pools th { text-transform: capitalize }
<td>0</td>
<td>5</td>
<td>25.000</td>
<td>1</td>
<td>5.000</td>
</tr>
</tbody>
</table>
<br /><div class="well well-lg">
<small>Generated using dhcpd-pools 3.3<br />
More info at <a href="https://dhcpd-pools.sourceforge.net/">https://dhcpd-pools.sourceforge.net/</a>
<small>Generated using dhcpd-pools 3.0<br />
More info at <a href="http://dhcpd-pools.sourceforge.net/">http://dhcpd-pools.sourceforge.net/</a>
</small></div></div>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.min.js" type="text/javascript"></script>
<script type="text/javascript" src="https://cdn.datatables.net/v/dt/dt-2.2.2/datatables.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" type="text/javascript"></script>
<script type="text/javascript" src="https://cdn.datatables.net/v/bs/jq-3.2.1/dt-1.10.16/datatables.min.js"></script>
<script type="text/javascript" class="init">$(document).ready(function() { $('#s').DataTable({ "iDisplayLength": 50, "lengthMenu": [ [25, 50, 100, -1], [25, 50, 100, "All"] ], "order": [[ 4, "desc" ]] } ); } );</script>
<script type="text/javascript" class="init">$(document).ready(function() { $('#r').DataTable({ "iDisplayLength": 100, "lengthMenu": [ [25, 50, 100, -1], [25, 50, 100, "All"] ], "order": [[ 6, "desc" ]] } ); } );</script>
</body></html>

File diff suppressed because it is too large Load diff