mirror of
git://git.code.sf.net/p/dhcpd-pools/code
synced 2025-12-16 15:57:00 +00:00
Version 2.5
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
This commit is contained in:
parent
d28d8feb4f
commit
8904b5b82c
21 changed files with 708 additions and 6816 deletions
10
ChangeLog
10
ChangeLog
|
|
@ -1,3 +1,13 @@
|
|||
2008-05-05 Sami Kerola <kerolasa@iki.fi>
|
||||
* Release 2.5
|
||||
* Reverse order for output sorting.
|
||||
* Options parsing fixed.
|
||||
* Bug report by Roar Pettersen
|
||||
- FreeBSD-7.0 output to file does not work.
|
||||
- Not quite sure will it work even this release.
|
||||
Help needed, I don't have FreeBSD-7.0.
|
||||
* Completely new dhcpd.conf parser.
|
||||
|
||||
2008-04-30 Sami Kerola <kerolasa@iki.fi>
|
||||
* Release 2.4
|
||||
* Sorting for range output.
|
||||
|
|
|
|||
|
|
@ -518,6 +518,7 @@ clean-am: clean-generic mostlyclean-am
|
|||
distclean: distclean-recursive
|
||||
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
|
||||
-rm -f Makefile
|
||||
-rm -rf autom4te.cache
|
||||
distclean-am: clean-am distclean-generic distclean-hdr distclean-tags
|
||||
|
||||
dvi: dvi-recursive
|
||||
|
|
|
|||
7
NEWS
7
NEWS
|
|
@ -5,6 +5,13 @@ See the end for copying conditions.
|
|||
|
||||
Please send dhcpd-pools bug reports to kerolasa@iki.fi.
|
||||
|
||||
|
||||
Version 2.5
|
||||
* Feature:
|
||||
* Reverse order sorting
|
||||
* Option parsing fixed.
|
||||
* FreeBSD-7.0 output did not work.
|
||||
* Completely new dhcpd.conf parser.
|
||||
|
||||
Version 2.4
|
||||
* Feature:
|
||||
|
|
|
|||
1
THANKS
1
THANKS
|
|
@ -9,3 +9,4 @@ and exempt of errors.
|
|||
Otto J. Mäkelä
|
||||
Mika Paananen
|
||||
Frank Bulk
|
||||
Roar Pettersen
|
||||
|
|
|
|||
33
TODO
33
TODO
|
|
@ -1,25 +1,16 @@
|
|||
Todo:
|
||||
<Todo state="Begin">
|
||||
|
||||
* dhcpd.conf file parser should understand semantics of
|
||||
configuration directives.
|
||||
* Better use of autoconfig. Author admits to be beginer in
|
||||
using auto tools. Help needed.
|
||||
* Bad english to good english translation for all files that
|
||||
author has touched. Help needed.
|
||||
* Threshold values -> alarm possibility.
|
||||
* Bug perhaps not? ./dhcpd-pools -o /dev/null
|
||||
/dev/null: Inappropriate ioctl for device
|
||||
Reason is fclose (outfile); in src/output.c
|
||||
* Bad english to good english translation in all files that
|
||||
author has touched. Help needed!
|
||||
* Count of touched IPs IE the ones which are leased some time and
|
||||
currently marked as free. Knowing number of these should
|
||||
give idea about possible peak value of reservations. Highly
|
||||
unscientific thou.
|
||||
|
||||
@ version 3.x - tcp server & snmp support etc
|
||||
@ version 3.x (not coming soon)
|
||||
|
||||
* TCP server / client for distant queries + libwrap support
|
||||
and some kind of protocol.
|
||||
* SNMP support. Program should be demon which gives states of
|
||||
pools almost instantly when queried. Calculations should be
|
||||
done periodically. This way huge dhcp lease files will not
|
||||
cause problem. Perhaps one thread could poll some socket
|
||||
waiting for query and mean while other could do periodical
|
||||
calculations, where output would be copying data for socket
|
||||
thread.
|
||||
* Configuration file for this command.
|
||||
* Convert program to snmp subagent daemon.
|
||||
* Threshold values -> alarming possibility by snmp traps.
|
||||
|
||||
</Todo state="Done">
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -1,116 +0,0 @@
|
|||
# This file was generated.
|
||||
# It contains the lists of macros which have been traced.
|
||||
# It can be safely removed.
|
||||
|
||||
@request = (
|
||||
bless( [
|
||||
'0',
|
||||
1,
|
||||
[
|
||||
'/usr/share/autoconf'
|
||||
],
|
||||
[
|
||||
'/usr/share/autoconf/autoconf/autoconf.m4f',
|
||||
'aclocal.m4',
|
||||
'configure.in'
|
||||
],
|
||||
{
|
||||
'm4_pattern_forbid' => 1,
|
||||
'AC_CONFIG_LIBOBJ_DIR' => 1,
|
||||
'AC_C_VOLATILE' => 1,
|
||||
'AC_TYPE_OFF_T' => 1,
|
||||
'AC_FUNC_CLOSEDIR_VOID' => 1,
|
||||
'AC_REPLACE_FNMATCH' => 1,
|
||||
'AC_PROG_LIBTOOL' => 1,
|
||||
'AC_FUNC_STAT' => 1,
|
||||
'AC_FUNC_WAIT3' => 1,
|
||||
'AC_HEADER_TIME' => 1,
|
||||
'AC_FUNC_LSTAT' => 1,
|
||||
'AC_STRUCT_TM' => 1,
|
||||
'AM_AUTOMAKE_VERSION' => 1,
|
||||
'AC_FUNC_GETMNTENT' => 1,
|
||||
'AC_TYPE_MODE_T' => 1,
|
||||
'AC_FUNC_STRTOD' => 1,
|
||||
'AC_CHECK_HEADERS' => 1,
|
||||
'AC_FUNC_STRNLEN' => 1,
|
||||
'm4_sinclude' => 1,
|
||||
'AC_PROG_CXX' => 1,
|
||||
'AC_PATH_X' => 1,
|
||||
'AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK' => 1,
|
||||
'AC_PROG_AWK' => 1,
|
||||
'_m4_warn' => 1,
|
||||
'AC_HEADER_STDC' => 1,
|
||||
'AC_HEADER_MAJOR' => 1,
|
||||
'AC_FUNC_ERROR_AT_LINE' => 1,
|
||||
'AC_PROG_GCC_TRADITIONAL' => 1,
|
||||
'AC_LIBSOURCE' => 1,
|
||||
'AC_FUNC_MBRTOWC' => 1,
|
||||
'AC_STRUCT_ST_BLOCKS' => 1,
|
||||
'AC_TYPE_SIGNAL' => 1,
|
||||
'AC_TYPE_UID_T' => 1,
|
||||
'AC_PROG_MAKE_SET' => 1,
|
||||
'AC_CONFIG_AUX_DIR' => 1,
|
||||
'm4_pattern_allow' => 1,
|
||||
'sinclude' => 1,
|
||||
'AC_DEFINE_TRACE_LITERAL' => 1,
|
||||
'AC_FUNC_STRERROR_R' => 1,
|
||||
'AC_PROG_CC' => 1,
|
||||
'AC_DECL_SYS_SIGLIST' => 1,
|
||||
'AC_FUNC_FORK' => 1,
|
||||
'AC_FUNC_STRCOLL' => 1,
|
||||
'AC_FUNC_VPRINTF' => 1,
|
||||
'AC_PROG_YACC' => 1,
|
||||
'AC_INIT' => 1,
|
||||
'AC_STRUCT_TIMEZONE' => 1,
|
||||
'AC_FUNC_CHOWN' => 1,
|
||||
'AC_SUBST' => 1,
|
||||
'AC_FUNC_ALLOCA' => 1,
|
||||
'AC_CANONICAL_HOST' => 1,
|
||||
'AC_FUNC_GETPGRP' => 1,
|
||||
'AC_PROG_RANLIB' => 1,
|
||||
'AM_INIT_AUTOMAKE' => 1,
|
||||
'AC_FUNC_SETPGRP' => 1,
|
||||
'AC_CONFIG_SUBDIRS' => 1,
|
||||
'AC_FUNC_MMAP' => 1,
|
||||
'AC_FUNC_REALLOC' => 1,
|
||||
'AC_TYPE_SIZE_T' => 1,
|
||||
'AC_CONFIG_LINKS' => 1,
|
||||
'AC_CHECK_TYPES' => 1,
|
||||
'AC_CHECK_MEMBERS' => 1,
|
||||
'AM_MAINTAINER_MODE' => 1,
|
||||
'AC_FUNC_UTIME_NULL' => 1,
|
||||
'AC_FUNC_SELECT_ARGTYPES' => 1,
|
||||
'AC_HEADER_STAT' => 1,
|
||||
'AC_FUNC_STRFTIME' => 1,
|
||||
'AC_PROG_CPP' => 1,
|
||||
'AC_C_INLINE' => 1,
|
||||
'AC_PROG_LEX' => 1,
|
||||
'AC_C_CONST' => 1,
|
||||
'AC_TYPE_PID_T' => 1,
|
||||
'AC_CONFIG_FILES' => 1,
|
||||
'include' => 1,
|
||||
'AC_FUNC_SETVBUF_REVERSED' => 1,
|
||||
'AC_PROG_INSTALL' => 1,
|
||||
'AM_GNU_GETTEXT' => 1,
|
||||
'AC_CHECK_LIB' => 1,
|
||||
'AC_FUNC_OBSTACK' => 1,
|
||||
'AC_FUNC_MALLOC' => 1,
|
||||
'AC_FUNC_GETGROUPS' => 1,
|
||||
'AC_FUNC_GETLOADAVG' => 1,
|
||||
'AH_OUTPUT' => 1,
|
||||
'AC_FUNC_FSEEKO' => 1,
|
||||
'AM_PROG_CC_C_O' => 1,
|
||||
'AC_FUNC_MKTIME' => 1,
|
||||
'AC_CANONICAL_SYSTEM' => 1,
|
||||
'AM_CONDITIONAL' => 1,
|
||||
'AC_CONFIG_HEADERS' => 1,
|
||||
'AC_HEADER_SYS_WAIT' => 1,
|
||||
'AC_PROG_LN_S' => 1,
|
||||
'AC_FUNC_MEMCMP' => 1,
|
||||
'm4_include' => 1,
|
||||
'AC_HEADER_DIRENT' => 1,
|
||||
'AC_CHECK_FUNCS' => 1
|
||||
}
|
||||
], 'Autom4te::Request' )
|
||||
);
|
||||
|
||||
|
|
@ -1,221 +0,0 @@
|
|||
m4trace:configure.in:5: -1- AC_INIT([dhcpd-pools], [2.4], [kerolasa@iki.fi])
|
||||
m4trace:configure.in:5: -1- m4_pattern_forbid([^_?A[CHUM]_])
|
||||
m4trace:configure.in:5: -1- m4_pattern_forbid([_AC_])
|
||||
m4trace:configure.in:5: -1- m4_pattern_forbid([^LIBOBJS$], [do not use LIBOBJS directly, use AC_LIBOBJ (see section `AC_LIBOBJ vs LIBOBJS'])
|
||||
m4trace:configure.in:5: -1- m4_pattern_allow([^AS_FLAGS$])
|
||||
m4trace:configure.in:5: -1- m4_pattern_forbid([^_?m4_])
|
||||
m4trace:configure.in:5: -1- m4_pattern_forbid([^dnl$])
|
||||
m4trace:configure.in:5: -1- m4_pattern_forbid([^_?AS_])
|
||||
m4trace:configure.in:5: -1- AC_SUBST([SHELL], [${CONFIG_SHELL-/bin/sh}])
|
||||
m4trace:configure.in:5: -1- AC_SUBST([PATH_SEPARATOR])
|
||||
m4trace:configure.in:5: -1- AC_SUBST([PACKAGE_NAME], [m4_ifdef([AC_PACKAGE_NAME], ['AC_PACKAGE_NAME'])])
|
||||
m4trace:configure.in:5: -1- AC_SUBST([PACKAGE_TARNAME], [m4_ifdef([AC_PACKAGE_TARNAME], ['AC_PACKAGE_TARNAME'])])
|
||||
m4trace:configure.in:5: -1- AC_SUBST([PACKAGE_VERSION], [m4_ifdef([AC_PACKAGE_VERSION], ['AC_PACKAGE_VERSION'])])
|
||||
m4trace:configure.in:5: -1- AC_SUBST([PACKAGE_STRING], [m4_ifdef([AC_PACKAGE_STRING], ['AC_PACKAGE_STRING'])])
|
||||
m4trace:configure.in:5: -1- AC_SUBST([PACKAGE_BUGREPORT], [m4_ifdef([AC_PACKAGE_BUGREPORT], ['AC_PACKAGE_BUGREPORT'])])
|
||||
m4trace:configure.in:5: -1- AC_SUBST([exec_prefix], [NONE])
|
||||
m4trace:configure.in:5: -1- AC_SUBST([prefix], [NONE])
|
||||
m4trace:configure.in:5: -1- AC_SUBST([program_transform_name], [s,x,x,])
|
||||
m4trace:configure.in:5: -1- AC_SUBST([bindir], ['${exec_prefix}/bin'])
|
||||
m4trace:configure.in:5: -1- AC_SUBST([sbindir], ['${exec_prefix}/sbin'])
|
||||
m4trace:configure.in:5: -1- AC_SUBST([libexecdir], ['${exec_prefix}/libexec'])
|
||||
m4trace:configure.in:5: -1- AC_SUBST([datadir], ['${prefix}/share'])
|
||||
m4trace:configure.in:5: -1- AC_SUBST([sysconfdir], ['${prefix}/etc'])
|
||||
m4trace:configure.in:5: -1- AC_SUBST([sharedstatedir], ['${prefix}/com'])
|
||||
m4trace:configure.in:5: -1- AC_SUBST([localstatedir], ['${prefix}/var'])
|
||||
m4trace:configure.in:5: -1- AC_SUBST([libdir], ['${exec_prefix}/lib'])
|
||||
m4trace:configure.in:5: -1- AC_SUBST([includedir], ['${prefix}/include'])
|
||||
m4trace:configure.in:5: -1- AC_SUBST([oldincludedir], ['/usr/include'])
|
||||
m4trace:configure.in:5: -1- AC_SUBST([infodir], ['${prefix}/info'])
|
||||
m4trace:configure.in:5: -1- AC_SUBST([mandir], ['${prefix}/man'])
|
||||
m4trace:configure.in:5: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_NAME])
|
||||
m4trace:configure.in:5: -1- AH_OUTPUT([PACKAGE_NAME], [/* Define to the full name of this package. */
|
||||
#undef PACKAGE_NAME])
|
||||
m4trace:configure.in:5: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_TARNAME])
|
||||
m4trace:configure.in:5: -1- AH_OUTPUT([PACKAGE_TARNAME], [/* Define to the one symbol short name of this package. */
|
||||
#undef PACKAGE_TARNAME])
|
||||
m4trace:configure.in:5: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_VERSION])
|
||||
m4trace:configure.in:5: -1- AH_OUTPUT([PACKAGE_VERSION], [/* Define to the version of this package. */
|
||||
#undef PACKAGE_VERSION])
|
||||
m4trace:configure.in:5: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_STRING])
|
||||
m4trace:configure.in:5: -1- AH_OUTPUT([PACKAGE_STRING], [/* Define to the full name and version of this package. */
|
||||
#undef PACKAGE_STRING])
|
||||
m4trace:configure.in:5: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_BUGREPORT])
|
||||
m4trace:configure.in:5: -1- AH_OUTPUT([PACKAGE_BUGREPORT], [/* Define to the address where bug reports for this package should be sent. */
|
||||
#undef PACKAGE_BUGREPORT])
|
||||
m4trace:configure.in:5: -1- AC_SUBST([build_alias])
|
||||
m4trace:configure.in:5: -1- AC_SUBST([host_alias])
|
||||
m4trace:configure.in:5: -1- AC_SUBST([target_alias])
|
||||
m4trace:configure.in:5: -1- AC_SUBST([DEFS])
|
||||
m4trace:configure.in:5: -1- AC_SUBST([ECHO_C])
|
||||
m4trace:configure.in:5: -1- AC_SUBST([ECHO_N])
|
||||
m4trace:configure.in:5: -1- AC_SUBST([ECHO_T])
|
||||
m4trace:configure.in:5: -1- AC_SUBST([LIBS])
|
||||
m4trace:configure.in:7: -1- AM_INIT_AUTOMAKE([1.9 foreign])
|
||||
m4trace:configure.in:7: -1- m4_pattern_allow([^AM_[A-Z]+FLAGS$])
|
||||
m4trace:configure.in:7: -1- AM_AUTOMAKE_VERSION([1.9.6])
|
||||
m4trace:configure.in:7: -1- AC_PROG_INSTALL
|
||||
m4trace:configure.in:7: -1- AC_SUBST([INSTALL_PROGRAM])
|
||||
m4trace:configure.in:7: -1- AC_SUBST([INSTALL_SCRIPT])
|
||||
m4trace:configure.in:7: -1- AC_SUBST([INSTALL_DATA])
|
||||
m4trace:configure.in:7: -1- AC_SUBST([CYGPATH_W])
|
||||
m4trace:configure.in:7: -1- AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])
|
||||
m4trace:configure.in:7: -1- AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])
|
||||
m4trace:configure.in:7: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE])
|
||||
m4trace:configure.in:7: -1- AH_OUTPUT([PACKAGE], [/* Name of package */
|
||||
#undef PACKAGE])
|
||||
m4trace:configure.in:7: -1- AC_DEFINE_TRACE_LITERAL([VERSION])
|
||||
m4trace:configure.in:7: -1- AH_OUTPUT([VERSION], [/* Version number of package */
|
||||
#undef VERSION])
|
||||
m4trace:configure.in:7: -1- AC_SUBST([ACLOCAL])
|
||||
m4trace:configure.in:7: -1- AC_SUBST([AUTOCONF])
|
||||
m4trace:configure.in:7: -1- AC_SUBST([AUTOMAKE])
|
||||
m4trace:configure.in:7: -1- AC_SUBST([AUTOHEADER])
|
||||
m4trace:configure.in:7: -1- AC_SUBST([MAKEINFO])
|
||||
m4trace:configure.in:7: -1- AC_SUBST([install_sh])
|
||||
m4trace:configure.in:7: -1- AC_SUBST([STRIP])
|
||||
m4trace:configure.in:7: -1- AC_SUBST([ac_ct_STRIP])
|
||||
m4trace:configure.in:7: -1- AC_SUBST([INSTALL_STRIP_PROGRAM])
|
||||
m4trace:configure.in:7: -1- AC_SUBST([mkdir_p])
|
||||
m4trace:configure.in:7: -1- AC_PROG_AWK
|
||||
m4trace:configure.in:7: -1- AC_SUBST([AWK])
|
||||
m4trace:configure.in:7: -1- AC_PROG_MAKE_SET
|
||||
m4trace:configure.in:7: -1- AC_SUBST([SET_MAKE])
|
||||
m4trace:configure.in:7: -1- AC_SUBST([am__leading_dot])
|
||||
m4trace:configure.in:7: -1- AC_SUBST([AMTAR])
|
||||
m4trace:configure.in:7: -1- AC_SUBST([am__tar])
|
||||
m4trace:configure.in:7: -1- AC_SUBST([am__untar])
|
||||
m4trace:configure.in:9: -1- _m4_warn([obsolete], [The macro `AM_CONFIG_HEADER' is obsolete.
|
||||
You should run autoupdate.], [aclocal.m4:353: AM_CONFIG_HEADER is expanded from...
|
||||
configure.in:9: the top level])
|
||||
m4trace:configure.in:9: -1- AC_CONFIG_HEADERS([config.h])
|
||||
m4trace:configure.in:10: -1- AC_PROG_CC
|
||||
m4trace:configure.in:10: -1- AC_SUBST([CC])
|
||||
m4trace:configure.in:10: -1- AC_SUBST([CFLAGS])
|
||||
m4trace:configure.in:10: -1- AC_SUBST([LDFLAGS])
|
||||
m4trace:configure.in:10: -1- AC_SUBST([CPPFLAGS])
|
||||
m4trace:configure.in:10: -1- AC_SUBST([CC])
|
||||
m4trace:configure.in:10: -1- AC_SUBST([ac_ct_CC])
|
||||
m4trace:configure.in:10: -1- AC_SUBST([CC])
|
||||
m4trace:configure.in:10: -1- AC_SUBST([ac_ct_CC])
|
||||
m4trace:configure.in:10: -1- AC_SUBST([CC])
|
||||
m4trace:configure.in:10: -1- AC_SUBST([CC])
|
||||
m4trace:configure.in:10: -1- AC_SUBST([ac_ct_CC])
|
||||
m4trace:configure.in:10: -1- AC_SUBST([EXEEXT], [$ac_cv_exeext])
|
||||
m4trace:configure.in:10: -1- AC_SUBST([OBJEXT], [$ac_cv_objext])
|
||||
m4trace:configure.in:10: -1- AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])
|
||||
m4trace:configure.in:10: -1- AC_SUBST([am__include])
|
||||
m4trace:configure.in:10: -1- AC_SUBST([am__quote])
|
||||
m4trace:configure.in:10: -1- AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
|
||||
m4trace:configure.in:10: -1- AC_SUBST([AMDEP_TRUE])
|
||||
m4trace:configure.in:10: -1- AC_SUBST([AMDEP_FALSE])
|
||||
m4trace:configure.in:10: -1- AC_SUBST([AMDEPBACKSLASH])
|
||||
m4trace:configure.in:10: -1- AC_SUBST([CCDEPMODE], [depmode=$am_cv_CC_dependencies_compiler_type])
|
||||
m4trace:configure.in:10: -1- AM_CONDITIONAL([am__fastdepCC], [
|
||||
test "x$enable_dependency_tracking" != xno \
|
||||
&& test "$am_cv_CC_dependencies_compiler_type" = gcc3])
|
||||
m4trace:configure.in:10: -1- AC_SUBST([am__fastdepCC_TRUE])
|
||||
m4trace:configure.in:10: -1- AC_SUBST([am__fastdepCC_FALSE])
|
||||
m4trace:configure.in:25: -1- AC_SUBST([dhcpd_conf])
|
||||
m4trace:configure.in:33: -1- AC_SUBST([dhcpd_leases])
|
||||
m4trace:configure.in:41: -1- AC_SUBST([output_format])
|
||||
m4trace:configure.in:49: -1- AC_SUBST([output_limit])
|
||||
m4trace:configure.in:51: -1- AC_CHECK_FUNCS([getopt_long inet_aton inet_addr], [break])
|
||||
m4trace:configure.in:51: -1- AH_OUTPUT([HAVE_GETOPT_LONG], [/* Define to 1 if you have the `getopt_long\' function. */
|
||||
#undef HAVE_GETOPT_LONG])
|
||||
m4trace:configure.in:51: -1- AH_OUTPUT([HAVE_INET_ATON], [/* Define to 1 if you have the `inet_aton\' function. */
|
||||
#undef HAVE_INET_ATON])
|
||||
m4trace:configure.in:51: -1- AH_OUTPUT([HAVE_INET_ADDR], [/* Define to 1 if you have the `inet_addr\' function. */
|
||||
#undef HAVE_INET_ADDR])
|
||||
m4trace:configure.in:53: -1- AC_CHECK_LIB([resolv], [inet_ntoa])
|
||||
m4trace:configure.in:53: -1- AH_OUTPUT([HAVE_LIBRESOLV], [/* Define to 1 if you have the `resolv\' library (-lresolv). */
|
||||
#undef HAVE_LIBRESOLV])
|
||||
m4trace:configure.in:53: -1- AC_DEFINE_TRACE_LITERAL([HAVE_LIBRESOLV])
|
||||
m4trace:configure.in:56: -1- AC_CHECK_HEADERS([arpa/inet.h errno.h netinet/in.h stdio.h \
|
||||
stdlib.h string.h sys/socket.h sys/stat.h sys/types.h unistd.h])
|
||||
m4trace:configure.in:56: -1- AH_OUTPUT([HAVE_ARPA_INET_H], [/* Define to 1 if you have the <arpa/inet.h> header file. */
|
||||
#undef HAVE_ARPA_INET_H])
|
||||
m4trace:configure.in:56: -1- AH_OUTPUT([HAVE_ERRNO_H], [/* Define to 1 if you have the <errno.h> header file. */
|
||||
#undef HAVE_ERRNO_H])
|
||||
m4trace:configure.in:56: -1- AH_OUTPUT([HAVE_NETINET_IN_H], [/* Define to 1 if you have the <netinet/in.h> header file. */
|
||||
#undef HAVE_NETINET_IN_H])
|
||||
m4trace:configure.in:56: -1- AH_OUTPUT([HAVE_STDIO_H], [/* Define to 1 if you have the <stdio.h> header file. */
|
||||
#undef HAVE_STDIO_H])
|
||||
m4trace:configure.in:56: -1- AH_OUTPUT([HAVE_STDLIB_H], [/* Define to 1 if you have the <stdlib.h> header file. */
|
||||
#undef HAVE_STDLIB_H])
|
||||
m4trace:configure.in:56: -1- AH_OUTPUT([HAVE_STRING_H], [/* Define to 1 if you have the <string.h> header file. */
|
||||
#undef HAVE_STRING_H])
|
||||
m4trace:configure.in:56: -1- AH_OUTPUT([HAVE_SYS_SOCKET_H], [/* Define to 1 if you have the <sys/socket.h> header file. */
|
||||
#undef HAVE_SYS_SOCKET_H])
|
||||
m4trace:configure.in:56: -1- AH_OUTPUT([HAVE_SYS_STAT_H], [/* Define to 1 if you have the <sys/stat.h> header file. */
|
||||
#undef HAVE_SYS_STAT_H])
|
||||
m4trace:configure.in:56: -1- AH_OUTPUT([HAVE_SYS_TYPES_H], [/* Define to 1 if you have the <sys/types.h> header file. */
|
||||
#undef HAVE_SYS_TYPES_H])
|
||||
m4trace:configure.in:56: -1- AH_OUTPUT([HAVE_UNISTD_H], [/* Define to 1 if you have the <unistd.h> header file. */
|
||||
#undef HAVE_UNISTD_H])
|
||||
m4trace:configure.in:56: -1- AC_HEADER_STDC
|
||||
m4trace:configure.in:56: -1- AC_PROG_CPP
|
||||
m4trace:configure.in:56: -1- AC_SUBST([CPP])
|
||||
m4trace:configure.in:56: -1- AC_SUBST([CPPFLAGS])
|
||||
m4trace:configure.in:56: -1- AC_SUBST([CPP])
|
||||
m4trace:configure.in:56: -1- AC_SUBST([EGREP])
|
||||
m4trace:configure.in:56: -1- AC_DEFINE_TRACE_LITERAL([STDC_HEADERS])
|
||||
m4trace:configure.in:56: -1- AH_OUTPUT([STDC_HEADERS], [/* Define to 1 if you have the ANSI C header files. */
|
||||
#undef STDC_HEADERS])
|
||||
m4trace:configure.in:56: -1- AC_CHECK_HEADERS([sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
|
||||
inttypes.h stdint.h unistd.h], [], [], [$ac_includes_default])
|
||||
m4trace:configure.in:56: -1- AH_OUTPUT([HAVE_SYS_TYPES_H], [/* Define to 1 if you have the <sys/types.h> header file. */
|
||||
#undef HAVE_SYS_TYPES_H])
|
||||
m4trace:configure.in:56: -1- AH_OUTPUT([HAVE_SYS_STAT_H], [/* Define to 1 if you have the <sys/stat.h> header file. */
|
||||
#undef HAVE_SYS_STAT_H])
|
||||
m4trace:configure.in:56: -1- AH_OUTPUT([HAVE_STDLIB_H], [/* Define to 1 if you have the <stdlib.h> header file. */
|
||||
#undef HAVE_STDLIB_H])
|
||||
m4trace:configure.in:56: -1- AH_OUTPUT([HAVE_STRING_H], [/* Define to 1 if you have the <string.h> header file. */
|
||||
#undef HAVE_STRING_H])
|
||||
m4trace:configure.in:56: -1- AH_OUTPUT([HAVE_MEMORY_H], [/* Define to 1 if you have the <memory.h> header file. */
|
||||
#undef HAVE_MEMORY_H])
|
||||
m4trace:configure.in:56: -1- AH_OUTPUT([HAVE_STRINGS_H], [/* Define to 1 if you have the <strings.h> header file. */
|
||||
#undef HAVE_STRINGS_H])
|
||||
m4trace:configure.in:56: -1- AH_OUTPUT([HAVE_INTTYPES_H], [/* Define to 1 if you have the <inttypes.h> header file. */
|
||||
#undef HAVE_INTTYPES_H])
|
||||
m4trace:configure.in:56: -1- AH_OUTPUT([HAVE_STDINT_H], [/* Define to 1 if you have the <stdint.h> header file. */
|
||||
#undef HAVE_STDINT_H])
|
||||
m4trace:configure.in:56: -1- AH_OUTPUT([HAVE_UNISTD_H], [/* Define to 1 if you have the <unistd.h> header file. */
|
||||
#undef HAVE_UNISTD_H])
|
||||
m4trace:configure.in:59: -2- AC_DEFINE_TRACE_LITERAL([HAVE_GETOPT_H])
|
||||
m4trace:configure.in:60: -1- AC_CHECK_HEADERS([getopt.h], [cat >>confdefs.h <<\_ACEOF
|
||||
@%:@define HAVE_GETOPT_H 1
|
||||
_ACEOF
|
||||
], [import_sources="getopt.c getopt1.c $import_sources"])
|
||||
m4trace:configure.in:60: -1- AH_OUTPUT([HAVE_GETOPT_H], [/* Define to 1 if you have the <getopt.h> header file. */
|
||||
#undef HAVE_GETOPT_H])
|
||||
m4trace:configure.in:63: -1- AC_FUNC_ALLOCA
|
||||
m4trace:configure.in:63: -1- AC_DEFINE_TRACE_LITERAL([HAVE_ALLOCA_H])
|
||||
m4trace:configure.in:63: -1- AH_OUTPUT([HAVE_ALLOCA_H], [/* Define to 1 if you have <alloca.h> and it should be used (not on Ultrix).
|
||||
*/
|
||||
#undef HAVE_ALLOCA_H])
|
||||
m4trace:configure.in:63: -1- AC_DEFINE_TRACE_LITERAL([HAVE_ALLOCA])
|
||||
m4trace:configure.in:63: -1- AH_OUTPUT([HAVE_ALLOCA], [/* Define to 1 if you have `alloca\', as a function or macro. */
|
||||
#undef HAVE_ALLOCA])
|
||||
m4trace:configure.in:63: -1- AC_LIBSOURCE([alloca.c])
|
||||
m4trace:configure.in:63: -1- AC_SUBST([ALLOCA], [alloca.$ac_objext])
|
||||
m4trace:configure.in:63: -1- AC_DEFINE_TRACE_LITERAL([C_ALLOCA])
|
||||
m4trace:configure.in:63: -1- AH_OUTPUT([C_ALLOCA], [/* Define to 1 if using `alloca.c\'. */
|
||||
#undef C_ALLOCA])
|
||||
m4trace:configure.in:63: -1- AC_DEFINE_TRACE_LITERAL([CRAY_STACKSEG_END])
|
||||
m4trace:configure.in:63: -1- AH_OUTPUT([CRAY_STACKSEG_END], [/* Define to one of `_getb67\', `GETB67\', `getb67\' for Cray-2 and Cray-YMP
|
||||
systems. This function is required for `alloca.c\' support on those systems.
|
||||
*/
|
||||
#undef CRAY_STACKSEG_END])
|
||||
m4trace:configure.in:63: -1- AH_OUTPUT([STACK_DIRECTION], [/* If using the C implementation of alloca, define if you know the
|
||||
direction of stack growth for your system; otherwise it will be
|
||||
automatically deduced at run-time.
|
||||
STACK_DIRECTION > 0 => grows toward higher addresses
|
||||
STACK_DIRECTION < 0 => grows toward lower addresses
|
||||
STACK_DIRECTION = 0 => direction of growth unknown */
|
||||
@%:@undef STACK_DIRECTION])
|
||||
m4trace:configure.in:63: -1- AC_DEFINE_TRACE_LITERAL([STACK_DIRECTION])
|
||||
m4trace:configure.in:66: -1- AC_SUBST([PERL])
|
||||
m4trace:configure.in:68: -1- AC_CONFIG_FILES([Makefile man/Makefile src/Makefile])
|
||||
m4trace:configure.in:70: -1- AC_SUBST([LIB@&t@OBJS], [$ac_libobjs])
|
||||
m4trace:configure.in:70: -1- AC_SUBST([LTLIBOBJS], [$ac_ltlibobjs])
|
||||
20
configure
vendored
20
configure
vendored
|
|
@ -1,6 +1,6 @@
|
|||
#! /bin/sh
|
||||
# Guess values for system-dependent variables and create Makefiles.
|
||||
# Generated by GNU Autoconf 2.59 for dhcpd-pools 2.4.
|
||||
# Generated by GNU Autoconf 2.59 for dhcpd-pools 2.5.
|
||||
#
|
||||
# Report bugs to <kerolasa@iki.fi>.
|
||||
#
|
||||
|
|
@ -269,8 +269,8 @@ SHELL=${CONFIG_SHELL-/bin/sh}
|
|||
# Identity of this package.
|
||||
PACKAGE_NAME='dhcpd-pools'
|
||||
PACKAGE_TARNAME='dhcpd-pools'
|
||||
PACKAGE_VERSION='2.4'
|
||||
PACKAGE_STRING='dhcpd-pools 2.4'
|
||||
PACKAGE_VERSION='2.5'
|
||||
PACKAGE_STRING='dhcpd-pools 2.5'
|
||||
PACKAGE_BUGREPORT='kerolasa@iki.fi'
|
||||
|
||||
# Factoring default headers for most tests.
|
||||
|
|
@ -779,7 +779,7 @@ if test "$ac_init_help" = "long"; then
|
|||
# Omit some internal or obsolete options to make the list less imposing.
|
||||
# This message is too long to be a string in the A/UX 3.1 sh.
|
||||
cat <<_ACEOF
|
||||
\`configure' configures dhcpd-pools 2.4 to adapt to many kinds of systems.
|
||||
\`configure' configures dhcpd-pools 2.5 to adapt to many kinds of systems.
|
||||
|
||||
Usage: $0 [OPTION]... [VAR=VALUE]...
|
||||
|
||||
|
|
@ -841,7 +841,7 @@ fi
|
|||
|
||||
if test -n "$ac_init_help"; then
|
||||
case $ac_init_help in
|
||||
short | recursive ) echo "Configuration of dhcpd-pools 2.4:";;
|
||||
short | recursive ) echo "Configuration of dhcpd-pools 2.5:";;
|
||||
esac
|
||||
cat <<\_ACEOF
|
||||
|
||||
|
|
@ -967,7 +967,7 @@ fi
|
|||
test -n "$ac_init_help" && exit 0
|
||||
if $ac_init_version; then
|
||||
cat <<\_ACEOF
|
||||
dhcpd-pools configure 2.4
|
||||
dhcpd-pools configure 2.5
|
||||
generated by GNU Autoconf 2.59
|
||||
|
||||
Copyright (C) 2003 Free Software Foundation, Inc.
|
||||
|
|
@ -981,7 +981,7 @@ cat >&5 <<_ACEOF
|
|||
This file contains any messages produced by compilers while
|
||||
running configure, to aid debugging if configure makes a mistake.
|
||||
|
||||
It was created by dhcpd-pools $as_me 2.4, which was
|
||||
It was created by dhcpd-pools $as_me 2.5, which was
|
||||
generated by GNU Autoconf 2.59. Invocation command line was
|
||||
|
||||
$ $0 $@
|
||||
|
|
@ -1625,7 +1625,7 @@ fi
|
|||
|
||||
# Define the identity of the package.
|
||||
PACKAGE='dhcpd-pools'
|
||||
VERSION='2.4'
|
||||
VERSION='2.5'
|
||||
|
||||
|
||||
cat >>confdefs.h <<_ACEOF
|
||||
|
|
@ -4802,7 +4802,7 @@ _ASBOX
|
|||
} >&5
|
||||
cat >&5 <<_CSEOF
|
||||
|
||||
This file was extended by dhcpd-pools $as_me 2.4, which was
|
||||
This file was extended by dhcpd-pools $as_me 2.5, which was
|
||||
generated by GNU Autoconf 2.59. Invocation command line was
|
||||
|
||||
CONFIG_FILES = $CONFIG_FILES
|
||||
|
|
@ -4865,7 +4865,7 @@ _ACEOF
|
|||
|
||||
cat >>$CONFIG_STATUS <<_ACEOF
|
||||
ac_cs_version="\\
|
||||
dhcpd-pools config.status 2.4
|
||||
dhcpd-pools config.status 2.5
|
||||
configured by $0, generated by GNU Autoconf 2.59,
|
||||
with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ dnl Process this file with autoconf to produce a configure script.
|
|||
|
||||
AC_PREREQ(2.59)
|
||||
|
||||
AC_INIT([dhcpd-pools], [2.4], [kerolasa@iki.fi])
|
||||
AC_INIT([dhcpd-pools], [2.5], [kerolasa@iki.fi])
|
||||
|
||||
AM_INIT_AUTOMAKE([1.9 foreign])
|
||||
|
||||
|
|
|
|||
219
man/Makefile.in
219
man/Makefile.in
|
|
@ -1,8 +1,8 @@
|
|||
# Makefile.in generated by automake 1.9.6 from Makefile.am.
|
||||
# Makefile.in generated by automake 1.6.3 from Makefile.am.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
|
||||
# 2003, 2004, 2005 Free Software Foundation, Inc.
|
||||
# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002
|
||||
# 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.
|
||||
|
|
@ -13,161 +13,111 @@
|
|||
# PARTICULAR PURPOSE.
|
||||
|
||||
@SET_MAKE@
|
||||
SHELL = @SHELL@
|
||||
|
||||
srcdir = @srcdir@
|
||||
top_srcdir = @top_srcdir@
|
||||
VPATH = @srcdir@
|
||||
prefix = @prefix@
|
||||
exec_prefix = @exec_prefix@
|
||||
|
||||
bindir = @bindir@
|
||||
sbindir = @sbindir@
|
||||
libexecdir = @libexecdir@
|
||||
datadir = @datadir@
|
||||
sysconfdir = @sysconfdir@
|
||||
sharedstatedir = @sharedstatedir@
|
||||
localstatedir = @localstatedir@
|
||||
libdir = @libdir@
|
||||
infodir = @infodir@
|
||||
mandir = @mandir@
|
||||
includedir = @includedir@
|
||||
oldincludedir = /usr/include
|
||||
pkgdatadir = $(datadir)/@PACKAGE@
|
||||
pkglibdir = $(libdir)/@PACKAGE@
|
||||
pkgincludedir = $(includedir)/@PACKAGE@
|
||||
top_builddir = ..
|
||||
|
||||
ACLOCAL = @ACLOCAL@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
|
||||
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
|
||||
INSTALL = @INSTALL@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
install_sh_DATA = $(install_sh) -c -m 644
|
||||
install_sh_PROGRAM = $(install_sh) -c
|
||||
install_sh_SCRIPT = $(install_sh) -c
|
||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||
INSTALL_HEADER = $(INSTALL_DATA)
|
||||
transform = $(program_transform_name)
|
||||
transform = @program_transform_name@
|
||||
NORMAL_INSTALL = :
|
||||
PRE_INSTALL = :
|
||||
POST_INSTALL = :
|
||||
NORMAL_UNINSTALL = :
|
||||
PRE_UNINSTALL = :
|
||||
POST_UNINSTALL = :
|
||||
subdir = man
|
||||
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
am__aclocal_m4_deps = $(top_srcdir)/configure.in
|
||||
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
||||
$(ACLOCAL_M4)
|
||||
mkinstalldirs = $(install_sh) -d
|
||||
CONFIG_HEADER = $(top_builddir)/config.h
|
||||
CONFIG_CLEAN_FILES =
|
||||
SCRIPTS = $(noinst_SCRIPTS)
|
||||
SOURCES =
|
||||
DIST_SOURCES =
|
||||
man1dir = $(mandir)/man1
|
||||
am__installdirs = "$(DESTDIR)$(man1dir)"
|
||||
NROFF = nroff
|
||||
MANS = $(man_MANS)
|
||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||
ACLOCAL = @ACLOCAL@
|
||||
ALLOCA = @ALLOCA@
|
||||
AMDEP_FALSE = @AMDEP_FALSE@
|
||||
AMDEP_TRUE = @AMDEP_TRUE@
|
||||
|
||||
EXEEXT = @EXEEXT@
|
||||
OBJEXT = @OBJEXT@
|
||||
PATH_SEPARATOR = @PATH_SEPARATOR@
|
||||
AMTAR = @AMTAR@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
AWK = @AWK@
|
||||
CC = @CC@
|
||||
CCDEPMODE = @CCDEPMODE@
|
||||
CFLAGS = @CFLAGS@
|
||||
CPP = @CPP@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CXX = @CXX@
|
||||
CYGPATH_W = @CYGPATH_W@
|
||||
DEFS = @DEFS@
|
||||
DEPDIR = @DEPDIR@
|
||||
ECHO_C = @ECHO_C@
|
||||
ECHO_N = @ECHO_N@
|
||||
ECHO_T = @ECHO_T@
|
||||
EGREP = @EGREP@
|
||||
EXEEXT = @EXEEXT@
|
||||
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@
|
||||
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@
|
||||
PERL = @PERL@
|
||||
SET_MAKE = @SET_MAKE@
|
||||
SHELL = @SHELL@
|
||||
STRIP = @STRIP@
|
||||
VERSION = @VERSION@
|
||||
ac_ct_CC = @ac_ct_CC@
|
||||
ac_ct_STRIP = @ac_ct_STRIP@
|
||||
am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
|
||||
am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
|
||||
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@
|
||||
datadir = @datadir@
|
||||
dhcpd_conf = @dhcpd_conf@
|
||||
dhcpd_leases = @dhcpd_leases@
|
||||
exec_prefix = @exec_prefix@
|
||||
host_alias = @host_alias@
|
||||
includedir = @includedir@
|
||||
infodir = @infodir@
|
||||
install_sh = @install_sh@
|
||||
libdir = @libdir@
|
||||
libexecdir = @libexecdir@
|
||||
localstatedir = @localstatedir@
|
||||
mandir = @mandir@
|
||||
mkdir_p = @mkdir_p@
|
||||
oldincludedir = @oldincludedir@
|
||||
output_format = @output_format@
|
||||
prefix = @prefix@
|
||||
program_transform_name = @program_transform_name@
|
||||
sbindir = @sbindir@
|
||||
sharedstatedir = @sharedstatedir@
|
||||
sysconfdir = @sysconfdir@
|
||||
target_alias = @target_alias@
|
||||
output_limit = @output_limit@
|
||||
|
||||
man_MANS = dhcpd-pools.1
|
||||
HELP2MAN = help2man
|
||||
noinst_SCRIPTS = $(HELP2MAN)
|
||||
|
||||
EXTRA_DIST = $(man_MANS) $(noinst_SCRIPTS) # $(man_aux)
|
||||
|
||||
MAINTAINERCLEANFILES = $(man_MANS)
|
||||
subdir = man
|
||||
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
|
||||
CONFIG_HEADER = $(top_builddir)/config.h $(top_builddir)/$@)]
|
||||
CONFIG_CLEAN_FILES =
|
||||
SCRIPTS = $(noinst_SCRIPTS)
|
||||
|
||||
DIST_SOURCES =
|
||||
|
||||
NROFF = nroff
|
||||
MANS = $(man_MANS)
|
||||
DIST_COMMON = Makefile.am Makefile.in
|
||||
all: all-am
|
||||
|
||||
.SUFFIXES:
|
||||
$(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 \
|
||||
&& exit 0; \
|
||||
exit 1;; \
|
||||
esac; \
|
||||
done; \
|
||||
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign man/Makefile'; \
|
||||
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
|
||||
cd $(top_srcdir) && \
|
||||
$(AUTOMAKE) --foreign man/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
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)
|
||||
uninstall-info-am:
|
||||
|
||||
man1dir = $(mandir)/man1
|
||||
install-man1: $(man1_MANS) $(man_MANS)
|
||||
@$(NORMAL_INSTALL)
|
||||
test -z "$(man1dir)" || $(mkdir_p) "$(DESTDIR)$(man1dir)"
|
||||
$(mkinstalldirs) $(DESTDIR)$(man1dir)
|
||||
@list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \
|
||||
l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \
|
||||
for i in $$l2; do \
|
||||
|
|
@ -186,8 +136,8 @@ install-man1: $(man1_MANS) $(man_MANS)
|
|||
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"; \
|
||||
echo " $(INSTALL_DATA) $$file $(DESTDIR)$(man1dir)/$$inst"; \
|
||||
$(INSTALL_DATA) $$file $(DESTDIR)$(man1dir)/$$inst; \
|
||||
done
|
||||
uninstall-man1:
|
||||
@$(NORMAL_UNINSTALL)
|
||||
|
|
@ -200,36 +150,27 @@ uninstall-man1:
|
|||
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"; \
|
||||
echo " rm -f $(DESTDIR)$(man1dir)/$$inst"; \
|
||||
rm -f $(DESTDIR)$(man1dir)/$$inst; \
|
||||
done
|
||||
tags: TAGS
|
||||
TAGS:
|
||||
|
||||
ctags: CTAGS
|
||||
CTAGS:
|
||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||
|
||||
top_distdir = ..
|
||||
distdir = $(top_distdir)/$(PACKAGE)-$(VERSION)
|
||||
|
||||
distdir: $(DISTFILES)
|
||||
@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
|
||||
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
|
||||
list='$(DISTFILES)'; for file in $$list; do \
|
||||
case $$file in \
|
||||
$(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
|
||||
$(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
|
||||
esac; \
|
||||
@list='$(DISTFILES)'; for file in $$list; do \
|
||||
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
|
||||
dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
|
||||
if test "$$dir" != "$$file" && test "$$dir" != "."; then \
|
||||
dir="/$$dir"; \
|
||||
$(mkdir_p) "$(distdir)$$dir"; \
|
||||
$(mkinstalldirs) "$(distdir)$$dir"; \
|
||||
else \
|
||||
dir=''; \
|
||||
fi; \
|
||||
|
|
@ -247,10 +188,10 @@ distdir: $(DISTFILES)
|
|||
check-am: all-am
|
||||
check: check-am
|
||||
all-am: Makefile $(SCRIPTS) $(MANS)
|
||||
|
||||
installdirs:
|
||||
for dir in "$(DESTDIR)$(man1dir)"; do \
|
||||
test -z "$$dir" || $(mkdir_p) "$$dir"; \
|
||||
done
|
||||
$(mkinstalldirs) $(DESTDIR)$(man1dir)
|
||||
|
||||
install: install-am
|
||||
install-exec: install-exec-am
|
||||
install-data: install-data-am
|
||||
|
|
@ -262,7 +203,7 @@ install-am: all-am
|
|||
installcheck: installcheck-am
|
||||
install-strip:
|
||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
||||
INSTALL_STRIP_FLAG=-s \
|
||||
`test -z '$(STRIP)' || \
|
||||
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
|
||||
mostlyclean-generic:
|
||||
|
|
@ -270,7 +211,7 @@ mostlyclean-generic:
|
|||
clean-generic:
|
||||
|
||||
distclean-generic:
|
||||
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
|
||||
-rm -f Makefile $(CONFIG_CLEAN_FILES)
|
||||
|
||||
maintainer-clean-generic:
|
||||
@echo "This command is intended for maintainers to use"
|
||||
|
|
@ -281,15 +222,13 @@ clean: clean-am
|
|||
clean-am: clean-generic mostlyclean-am
|
||||
|
||||
distclean: distclean-am
|
||||
-rm -f Makefile
|
||||
|
||||
distclean-am: clean-am distclean-generic
|
||||
|
||||
dvi: dvi-am
|
||||
|
||||
dvi-am:
|
||||
|
||||
html: html-am
|
||||
|
||||
info: info-am
|
||||
|
||||
info-am:
|
||||
|
|
@ -305,33 +244,25 @@ install-man: install-man1
|
|||
installcheck-am:
|
||||
|
||||
maintainer-clean: maintainer-clean-am
|
||||
-rm -f Makefile
|
||||
|
||||
maintainer-clean-am: distclean-am maintainer-clean-generic
|
||||
|
||||
mostlyclean: mostlyclean-am
|
||||
|
||||
mostlyclean-am: mostlyclean-generic
|
||||
|
||||
pdf: pdf-am
|
||||
|
||||
pdf-am:
|
||||
|
||||
ps: ps-am
|
||||
|
||||
ps-am:
|
||||
|
||||
uninstall-am: uninstall-info-am uninstall-man
|
||||
|
||||
uninstall-man: uninstall-man1
|
||||
|
||||
.PHONY: all all-am check check-am clean clean-generic distclean \
|
||||
distclean-generic distdir dvi dvi-am html html-am info info-am \
|
||||
install install-am install-data install-data-am install-exec \
|
||||
distclean-generic distdir dvi dvi-am info info-am install \
|
||||
install-am install-data install-data-am install-exec \
|
||||
install-exec-am install-info install-info-am install-man \
|
||||
install-man1 install-strip installcheck installcheck-am \
|
||||
installdirs maintainer-clean maintainer-clean-generic \
|
||||
mostlyclean mostlyclean-generic pdf pdf-am ps ps-am uninstall \
|
||||
uninstall-am uninstall-info-am uninstall-man uninstall-man1
|
||||
mostlyclean mostlyclean-generic uninstall uninstall-am \
|
||||
uninstall-info-am uninstall-man uninstall-man1
|
||||
|
||||
|
||||
dhcpd-pools.1: ../src/dhcpd-pools $(HELP2MAN)
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
.\" http://www.iki.fi/kerolasa/
|
||||
.\" kerolasa@iki.fi
|
||||
.\"
|
||||
.TH DHCPD-POOLS 1 "Apr 20 2008 - version 2.4"
|
||||
.TH DHCPD-POOLS 1 "May 1 2008 - version 2.5"
|
||||
.SH NAME
|
||||
dhcpd-pools \- ISC dhcp pools usage analysis
|
||||
.SH SYNOPSIS
|
||||
|
|
@ -10,7 +10,7 @@ dhcpd-pools \- ISC dhcp pools usage analysis
|
|||
[-c file] [-l file] [-f thc] [-o file] [-v] [-h]
|
||||
.SH DESCRIPTION
|
||||
The program counts ISC dhcp shared network and pool usage
|
||||
analysis and outputs it in choosen format.
|
||||
analysis and outputs it in selected format.
|
||||
.SH ARGUMENTS
|
||||
.TP
|
||||
.I "\-c, \-\-config"
|
||||
|
|
@ -21,20 +21,23 @@ Path to the dhcpd.leases file.
|
|||
.TP
|
||||
.I "\-s, \-\-sort"
|
||||
Sort ranges by IP, name, maximum, currently in use or percent.
|
||||
IP is default.
|
||||
The IP is default.
|
||||
.TP
|
||||
.I "\-r, \-\-reverse"
|
||||
Sort results in reverse order.
|
||||
.TP
|
||||
.I "\-f, \-\-format"
|
||||
Output format. Currently there is text, html and csv
|
||||
(comma-separated values). Default is text.
|
||||
.TP
|
||||
.I "\-o, \-\-output"
|
||||
File where output is directed. Default is stdout.
|
||||
File where output is written. Default is stdout.
|
||||
.TP
|
||||
.I "\-L, \-\-limit"
|
||||
Limit what is printed. Syntax is similar to chmod permission
|
||||
string. This limit string has two meaningful digits which can be
|
||||
between 0 and 7. First digit limits output of headers and second
|
||||
numeric analysis tables.
|
||||
Limit what will be printed. Syntax is similar to chmod permission
|
||||
string. The limit string uses two digits which vary between 0 and
|
||||
7. First digit will effect on headers and second one to numeric
|
||||
analysis tables.
|
||||
.TP
|
||||
.I "\-v, \-\-version"
|
||||
Print version information to standard output and exit successfully.
|
||||
|
|
@ -53,8 +56,7 @@ Print help to standard output and exit successfully.
|
|||
.br
|
||||
ISC dhcpd lease file.
|
||||
.SH BUGS
|
||||
Not known but plenty of missing features. See TODO file in source
|
||||
distribution.
|
||||
Not known.
|
||||
.SH AUTHOR
|
||||
Sami Kerola <kerolasa@iki.fi>
|
||||
.br
|
||||
|
|
|
|||
1
mkinstalldirs
Symbolic link
1
mkinstalldirs
Symbolic link
|
|
@ -0,0 +1 @@
|
|||
/usr/share/automake-1.6/mkinstalldirs
|
||||
322
src/Makefile.in
322
src/Makefile.in
|
|
@ -1,8 +1,8 @@
|
|||
# Makefile.in generated by automake 1.9.6 from Makefile.am.
|
||||
# Makefile.in generated by automake 1.6.3 from Makefile.am.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
|
||||
# 2003, 2004, 2005 Free Software Foundation, Inc.
|
||||
# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002
|
||||
# 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.
|
||||
|
|
@ -13,179 +13,141 @@
|
|||
# PARTICULAR PURPOSE.
|
||||
|
||||
@SET_MAKE@
|
||||
SHELL = @SHELL@
|
||||
|
||||
srcdir = @srcdir@
|
||||
top_srcdir = @top_srcdir@
|
||||
VPATH = @srcdir@
|
||||
prefix = @prefix@
|
||||
exec_prefix = @exec_prefix@
|
||||
|
||||
bindir = @bindir@
|
||||
sbindir = @sbindir@
|
||||
libexecdir = @libexecdir@
|
||||
datadir = @datadir@
|
||||
sysconfdir = @sysconfdir@
|
||||
sharedstatedir = @sharedstatedir@
|
||||
localstatedir = @localstatedir@
|
||||
libdir = @libdir@
|
||||
infodir = @infodir@
|
||||
mandir = @mandir@
|
||||
includedir = @includedir@
|
||||
oldincludedir = /usr/include
|
||||
pkgdatadir = $(datadir)/@PACKAGE@
|
||||
pkglibdir = $(libdir)/@PACKAGE@
|
||||
pkgincludedir = $(includedir)/@PACKAGE@
|
||||
top_builddir = ..
|
||||
|
||||
ACLOCAL = @ACLOCAL@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
|
||||
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
|
||||
INSTALL = @INSTALL@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
install_sh_DATA = $(install_sh) -c -m 644
|
||||
install_sh_PROGRAM = $(install_sh) -c
|
||||
install_sh_SCRIPT = $(install_sh) -c
|
||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||
INSTALL_HEADER = $(INSTALL_DATA)
|
||||
transform = $(program_transform_name)
|
||||
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.in
|
||||
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
||||
$(ACLOCAL_M4)
|
||||
mkinstalldirs = $(install_sh) -d
|
||||
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. -I$(srcdir) -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@
|
||||
ALLOCA = @ALLOCA@
|
||||
AMDEP_FALSE = @AMDEP_FALSE@
|
||||
AMDEP_TRUE = @AMDEP_TRUE@
|
||||
|
||||
EXEEXT = @EXEEXT@
|
||||
OBJEXT = @OBJEXT@
|
||||
PATH_SEPARATOR = @PATH_SEPARATOR@
|
||||
AMTAR = @AMTAR@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
AWK = @AWK@
|
||||
CC = @CC@
|
||||
CCDEPMODE = @CCDEPMODE@
|
||||
CFLAGS = @CFLAGS@
|
||||
CPP = @CPP@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CXX = @CXX@
|
||||
CYGPATH_W = @CYGPATH_W@
|
||||
DEFS = @DEFS@
|
||||
DEPDIR = @DEPDIR@
|
||||
ECHO_C = @ECHO_C@
|
||||
ECHO_N = @ECHO_N@
|
||||
ECHO_T = @ECHO_T@
|
||||
EGREP = @EGREP@
|
||||
EXEEXT = @EXEEXT@
|
||||
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@
|
||||
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@
|
||||
PERL = @PERL@
|
||||
SET_MAKE = @SET_MAKE@
|
||||
SHELL = @SHELL@
|
||||
STRIP = @STRIP@
|
||||
VERSION = @VERSION@
|
||||
ac_ct_CC = @ac_ct_CC@
|
||||
ac_ct_STRIP = @ac_ct_STRIP@
|
||||
am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
|
||||
am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
|
||||
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@
|
||||
datadir = @datadir@
|
||||
dhcpd_conf = @dhcpd_conf@
|
||||
dhcpd_leases = @dhcpd_leases@
|
||||
exec_prefix = @exec_prefix@
|
||||
host_alias = @host_alias@
|
||||
includedir = @includedir@
|
||||
infodir = @infodir@
|
||||
install_sh = @install_sh@
|
||||
libdir = @libdir@
|
||||
libexecdir = @libexecdir@
|
||||
localstatedir = @localstatedir@
|
||||
mandir = @mandir@
|
||||
mkdir_p = @mkdir_p@
|
||||
oldincludedir = @oldincludedir@
|
||||
output_format = @output_format@
|
||||
prefix = @prefix@
|
||||
program_transform_name = @program_transform_name@
|
||||
sbindir = @sbindir@
|
||||
sharedstatedir = @sharedstatedir@
|
||||
sysconfdir = @sysconfdir@
|
||||
target_alias = @target_alias@
|
||||
output_limit = @output_limit@
|
||||
|
||||
bin_PROGRAMS = dhcpd-pools
|
||||
AC_PROG_RANLIB = resolv
|
||||
dhcpd_pools_SOURCES = dhcpd-pools.c analyze.c getdata.c getopt1.c getopt.c other.c output.c sort.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.
|
||||
subdir = src
|
||||
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
|
||||
CONFIG_HEADER = $(top_builddir)/config.h $(top_builddir)/$@)]
|
||||
CONFIG_CLEAN_FILES =
|
||||
bin_PROGRAMS = dhcpd-pools$(EXEEXT)
|
||||
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)
|
||||
dhcpd_pools_DEPENDENCIES =
|
||||
dhcpd_pools_LDFLAGS =
|
||||
|
||||
DEFS = @DEFS@
|
||||
DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) -I$(top_builddir)
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
LDFLAGS = @LDFLAGS@
|
||||
LIBS = @LIBS@
|
||||
depcomp = $(SHELL) $(top_srcdir)/depcomp
|
||||
am__depfiles_maybe = depfiles
|
||||
@AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/analyze.Po \
|
||||
@AMDEP_TRUE@ ./$(DEPDIR)/dhcpd-pools.Po ./$(DEPDIR)/getdata.Po \
|
||||
@AMDEP_TRUE@ ./$(DEPDIR)/getopt.Po ./$(DEPDIR)/getopt1.Po \
|
||||
@AMDEP_TRUE@ ./$(DEPDIR)/other.Po ./$(DEPDIR)/output.Po \
|
||||
@AMDEP_TRUE@ ./$(DEPDIR)/sort.Po
|
||||
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
|
||||
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
|
||||
CCLD = $(CC)
|
||||
LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
|
||||
CFLAGS = @CFLAGS@
|
||||
DIST_SOURCES = $(dhcpd_pools_SOURCES)
|
||||
DIST_COMMON = Makefile.am Makefile.in
|
||||
SOURCES = $(dhcpd_pools_SOURCES)
|
||||
|
||||
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 \
|
||||
&& exit 0; \
|
||||
exit 1;; \
|
||||
esac; \
|
||||
done; \
|
||||
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/Makefile'; \
|
||||
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
|
||||
cd $(top_srcdir) && \
|
||||
$(AUTOMAKE) --foreign 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
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)
|
||||
binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
|
||||
install-binPROGRAMS: $(bin_PROGRAMS)
|
||||
@$(NORMAL_INSTALL)
|
||||
test -z "$(bindir)" || $(mkdir_p) "$(DESTDIR)$(bindir)"
|
||||
$(mkinstalldirs) $(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; \
|
||||
echo " $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) $$p $(DESTDIR)$(bindir)/$$f"; \
|
||||
$(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) $$p $(DESTDIR)$(bindir)/$$f; \
|
||||
else :; fi; \
|
||||
done
|
||||
|
||||
|
|
@ -193,8 +155,8 @@ 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"; \
|
||||
echo " rm -f $(DESTDIR)$(bindir)/$$f"; \
|
||||
rm -f $(DESTDIR)$(bindir)/$$f; \
|
||||
done
|
||||
|
||||
clean-binPROGRAMS:
|
||||
|
|
@ -204,7 +166,7 @@ dhcpd-pools$(EXEEXT): $(dhcpd_pools_OBJECTS) $(dhcpd_pools_DEPENDENCIES)
|
|||
$(LINK) $(dhcpd_pools_LDFLAGS) $(dhcpd_pools_OBJECTS) $(dhcpd_pools_LDADD) $(LIBS)
|
||||
|
||||
mostlyclean-compile:
|
||||
-rm -f *.$(OBJEXT)
|
||||
-rm -f *.$(OBJEXT) core *.core
|
||||
|
||||
distclean-compile:
|
||||
-rm -f *.tab.c
|
||||
|
|
@ -218,21 +180,28 @@ distclean-compile:
|
|||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/output.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sort.Po@am__quote@
|
||||
|
||||
distclean-depend:
|
||||
-rm -rf ./$(DEPDIR)
|
||||
|
||||
.c.o:
|
||||
@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
|
||||
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
|
||||
@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 $<
|
||||
@AMDEP_TRUE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
$(COMPILE) -c `test -f '$<' || echo '$(srcdir)/'`$<
|
||||
|
||||
.c.obj:
|
||||
@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
|
||||
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
|
||||
@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) '$<'`
|
||||
@AMDEP_TRUE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
$(COMPILE) -c `cygpath -w $<`
|
||||
CCDEPMODE = @CCDEPMODE@
|
||||
uninstall-info-am:
|
||||
|
||||
ETAGS = etags
|
||||
ETAGSFLAGS =
|
||||
|
||||
tags: TAGS
|
||||
|
||||
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
|
|
@ -241,7 +210,6 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
|
|||
$(AWK) ' { files[$$0] = 1; } \
|
||||
END { for (i in files) print i; }'`; \
|
||||
mkid -fID $$unique
|
||||
tags: TAGS
|
||||
|
||||
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
|
|
@ -253,24 +221,8 @@ TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
|||
done | \
|
||||
$(AWK) ' { files[$$0] = 1; } \
|
||||
END { 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=; \
|
||||
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; } \
|
||||
END { for (i in files) print i; }'`; \
|
||||
test -z "$(CTAGS_ARGS)$$tags$$unique" \
|
||||
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
|
||||
test -z "$(ETAGS_ARGS)$$tags$$unique" \
|
||||
|| $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
|
||||
$$tags $$unique
|
||||
|
||||
GTAGS:
|
||||
|
|
@ -279,21 +231,19 @@ GTAGS:
|
|||
&& gtags -i $(GTAGS_ARGS) $$here
|
||||
|
||||
distclean-tags:
|
||||
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
|
||||
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH
|
||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||
|
||||
top_distdir = ..
|
||||
distdir = $(top_distdir)/$(PACKAGE)-$(VERSION)
|
||||
|
||||
distdir: $(DISTFILES)
|
||||
@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
|
||||
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
|
||||
list='$(DISTFILES)'; for file in $$list; do \
|
||||
case $$file in \
|
||||
$(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
|
||||
$(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
|
||||
esac; \
|
||||
@list='$(DISTFILES)'; for file in $$list; do \
|
||||
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
|
||||
dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
|
||||
if test "$$dir" != "$$file" && test "$$dir" != "."; then \
|
||||
dir="/$$dir"; \
|
||||
$(mkdir_p) "$(distdir)$$dir"; \
|
||||
$(mkinstalldirs) "$(distdir)$$dir"; \
|
||||
else \
|
||||
dir=''; \
|
||||
fi; \
|
||||
|
|
@ -311,10 +261,10 @@ distdir: $(DISTFILES)
|
|||
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
|
||||
$(mkinstalldirs) $(DESTDIR)$(bindir)
|
||||
|
||||
install: install-am
|
||||
install-exec: install-exec-am
|
||||
install-data: install-data-am
|
||||
|
|
@ -326,7 +276,7 @@ install-am: all-am
|
|||
installcheck: installcheck-am
|
||||
install-strip:
|
||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
||||
INSTALL_STRIP_FLAG=-s \
|
||||
`test -z '$(STRIP)' || \
|
||||
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
|
||||
mostlyclean-generic:
|
||||
|
|
@ -334,7 +284,7 @@ mostlyclean-generic:
|
|||
clean-generic:
|
||||
|
||||
distclean-generic:
|
||||
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
|
||||
-rm -f Makefile $(CONFIG_CLEAN_FILES)
|
||||
|
||||
maintainer-clean-generic:
|
||||
@echo "This command is intended for maintainers to use"
|
||||
|
|
@ -344,17 +294,14 @@ 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
|
||||
|
||||
distclean-am: clean-am distclean-compile distclean-depend \
|
||||
distclean-generic distclean-tags
|
||||
|
||||
dvi: dvi-am
|
||||
|
||||
dvi-am:
|
||||
|
||||
html: html-am
|
||||
|
||||
info: info-am
|
||||
|
||||
info-am:
|
||||
|
|
@ -370,34 +317,25 @@ install-man:
|
|||
installcheck-am:
|
||||
|
||||
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 uninstall-info-am
|
||||
|
||||
.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-exec install-exec-am \
|
||||
install-info install-info-am install-man install-strip \
|
||||
installcheck installcheck-am installdirs maintainer-clean \
|
||||
.PHONY: GTAGS all all-am check check-am clean clean-binPROGRAMS \
|
||||
clean-generic distclean distclean-compile distclean-depend \
|
||||
distclean-generic distclean-tags distdir dvi dvi-am info \
|
||||
info-am install install-am install-binPROGRAMS install-data \
|
||||
install-data-am install-exec install-exec-am install-info \
|
||||
install-info-am install-man install-strip installcheck \
|
||||
installcheck-am installdirs maintainer-clean \
|
||||
maintainer-clean-generic mostlyclean mostlyclean-compile \
|
||||
mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \
|
||||
uninstall-am uninstall-binPROGRAMS uninstall-info-am
|
||||
mostlyclean-generic tags uninstall uninstall-am \
|
||||
uninstall-binPROGRAMS uninstall-info-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.
|
||||
|
|
|
|||
|
|
@ -25,33 +25,6 @@
|
|||
|
||||
#include "dhcpd-pools.h"
|
||||
|
||||
/* A simple (predicate-like) integer comparison function (for qsort) */
|
||||
int
|
||||
intcomp (const void *x, const void *y)
|
||||
{
|
||||
if (*(unsigned long int *) x < *(unsigned long int *) y)
|
||||
return -1;
|
||||
else if (*(unsigned long int *) y < *(unsigned long int *) x)
|
||||
return 1;
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* A simple (predicate-like) range structure comparison function
|
||||
* (for qsort) */
|
||||
int
|
||||
rangecomp (const void *r1, const void *r2)
|
||||
{
|
||||
if ((((struct range_t *) r1)->first_ip) <
|
||||
(((struct range_t *) r2)->first_ip))
|
||||
return -1;
|
||||
else if ((((struct range_t *) r2)->first_ip) <
|
||||
(((struct range_t *) r1)->first_ip))
|
||||
return 1;
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Clean up data */
|
||||
int
|
||||
prepare_data (void)
|
||||
|
|
|
|||
|
|
@ -32,6 +32,9 @@
|
|||
#ifndef OUTPUT_FORMAT
|
||||
# define OUTPUT_FORMAT "text"
|
||||
#endif
|
||||
#ifndef OUTPUT_ORDER
|
||||
# define OUTPUT_ORDER "i"
|
||||
#endif
|
||||
#ifndef OUTPUT_LIMIT
|
||||
# define OUTPUT_LIMIT "77"
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -36,7 +36,6 @@ extern char *malloc ();
|
|||
#include <strings.h>
|
||||
#endif
|
||||
#include <getopt.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include "dhcpd-pools.h"
|
||||
#include "defaults.h"
|
||||
|
|
@ -45,8 +44,8 @@ int
|
|||
main (int argc, char **argv)
|
||||
{
|
||||
int c;
|
||||
int option_index = 0;
|
||||
char *tmp;
|
||||
FILE *fopen_test;
|
||||
|
||||
/* Options for getopt_long */
|
||||
static struct option const long_options[] = {
|
||||
|
|
@ -54,6 +53,7 @@ main (int argc, char **argv)
|
|||
{"leases", required_argument, 0, (int) 'l'},
|
||||
{"format", required_argument, 0, (int) 'f'},
|
||||
{"sort", required_argument, 0, (int) 's'},
|
||||
{"reverse", no_argument, 0, (int) 'r'},
|
||||
{"output", required_argument, 0, (int) 'o'},
|
||||
{"limit", required_argument, 0, (int) 'L'},
|
||||
{"version", no_argument, 0, (int) 'v'},
|
||||
|
|
@ -81,10 +81,16 @@ main (int argc, char **argv)
|
|||
/* Make sure some output format is selected by default */
|
||||
strncpy (config.output_format, OUTPUT_FORMAT, 1);
|
||||
|
||||
/* Default sort order is by IPs small to big */
|
||||
config.sort[0] = OUTPUT_ORDER;
|
||||
config.reverse_order = false;
|
||||
|
||||
/* Parse command line options */
|
||||
while (1)
|
||||
{
|
||||
c = getopt_long (argc, argv, "clfosLvh", long_options, (int *) 0);
|
||||
c =
|
||||
getopt_long (argc, argv, "c:l:f:o:s:rL:vh", long_options,
|
||||
&option_index);
|
||||
|
||||
if (c == EOF)
|
||||
break;
|
||||
|
|
@ -94,107 +100,96 @@ main (int argc, char **argv)
|
|||
case 0:
|
||||
break;
|
||||
case 'c':
|
||||
if (argv[optind] != NULL)
|
||||
if (optarg != NULL)
|
||||
{
|
||||
strncpy (config.dhcpdconf_file, argv[optind], MAXLEN - 1);
|
||||
strncpy (config.dhcpdconf_file, optarg, MAXLEN - 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
eprintf ("main: for argument -c parameter not set");
|
||||
eprintf
|
||||
("main: for argument configuration file parameter not set");
|
||||
print_help ();
|
||||
exit (EXIT_FAILURE);
|
||||
}
|
||||
break;
|
||||
case 'l':
|
||||
if (argv[optind] != NULL)
|
||||
if (optarg != NULL)
|
||||
{
|
||||
strncpy (config.dhcpdlease_file, argv[optind], MAXLEN - 1);
|
||||
strncpy (config.dhcpdlease_file, optarg, MAXLEN - 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
eprintf ("main: for argument -l parameter not set");
|
||||
eprintf ("main: for argument lease file parameter not set");
|
||||
print_help ();
|
||||
exit (EXIT_FAILURE);
|
||||
}
|
||||
break;
|
||||
case 'f':
|
||||
if (argv[optind] != NULL)
|
||||
if (optarg != NULL)
|
||||
{
|
||||
strncpy (config.output_format, argv[optind], 1);
|
||||
strncpy (config.output_format, optarg, 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
eprintf ("main: for argument -f parameter not set");
|
||||
eprintf ("main: for argument output format parameter not set");
|
||||
print_help ();
|
||||
exit (EXIT_FAILURE);
|
||||
}
|
||||
break;
|
||||
case 's':
|
||||
if (argv[optind] != NULL)
|
||||
if (optarg != NULL)
|
||||
{
|
||||
strncpy (config.sort, argv[optind], 1);
|
||||
strncpy (config.sort, optarg, 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
eprintf ("main: for argument -s parameter not set");
|
||||
eprintf ("main: for argument sort order parameter not set");
|
||||
print_help ();
|
||||
exit (EXIT_FAILURE);
|
||||
}
|
||||
break;
|
||||
case 'r':
|
||||
config.reverse_order = true;
|
||||
break;
|
||||
case 'o':
|
||||
if (argv[optind] != NULL)
|
||||
if (optarg != NULL)
|
||||
{
|
||||
strncpy (config.output_file, argv[optind], (size_t) MAXLEN - 1);
|
||||
/* Test that output file really works */
|
||||
fopen_test = fopen (config.output_file, "w+");
|
||||
if (fopen_test == NULL)
|
||||
{
|
||||
eprintf ("main: %s:", config.output_file);
|
||||
exit (EXIT_FAILURE);
|
||||
}
|
||||
fclose (fopen_test);
|
||||
if (errno)
|
||||
{
|
||||
eprintf ("main: %s:", config.output_file);
|
||||
exit (EXIT_FAILURE);
|
||||
}
|
||||
strncpy (config.output_file, optarg, (size_t) MAXLEN - 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
eprintf ("main: for argument -o parameter not set");
|
||||
eprintf ("main: for argument output file parameter not set");
|
||||
print_help ();
|
||||
exit (EXIT_FAILURE);
|
||||
}
|
||||
break;
|
||||
case 'L':
|
||||
if (argv[optind] != NULL)
|
||||
if (optarg != NULL)
|
||||
{
|
||||
if (argv[optind][0] >= '0' && argv[optind][0] < '8')
|
||||
if (optarg[0] >= '0' && optarg[0] < '8')
|
||||
{
|
||||
config.output_limit[0] = (int) argv[optind][0] - '0';
|
||||
config.output_limit[0] = (int) optarg[0] - '0';
|
||||
}
|
||||
else
|
||||
{
|
||||
eprintf ("main: output limit mask %s illegal",
|
||||
argv[optind]);
|
||||
eprintf ("main: output mask %s illegal", argv[optind]);
|
||||
print_help ();
|
||||
exit (EXIT_FAILURE);
|
||||
}
|
||||
if (argv[optind][1] >= '0' && argv[optind][1] < '8')
|
||||
if (optarg[1] >= '0' && optarg[1] < '8')
|
||||
{
|
||||
config.output_limit[1] = (int) argv[optind][1] - '0';
|
||||
config.output_limit[1] = (int) optarg[1] - '0';
|
||||
}
|
||||
else
|
||||
{
|
||||
eprintf ("main: output limit mask %s illegal",
|
||||
argv[optind]);
|
||||
eprintf ("main: output mask %s illegal", optarg);
|
||||
print_help ();
|
||||
exit (EXIT_FAILURE);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
eprintf ("main: for argument -L parameter not set");
|
||||
eprintf ("main: for argument output mask parameter not set");
|
||||
print_help ();
|
||||
exit (EXIT_FAILURE);
|
||||
}
|
||||
|
|
@ -230,7 +225,7 @@ main (int argc, char **argv)
|
|||
sort_results = sort_percent;
|
||||
break;
|
||||
default:
|
||||
eprintf ("main: unknown sort order");
|
||||
eprintf ("main: unknown sort order: %c", config.sort[0]);
|
||||
print_help ();
|
||||
exit (EXIT_FAILURE);
|
||||
}
|
||||
|
|
@ -257,7 +252,7 @@ main (int argc, char **argv)
|
|||
}
|
||||
|
||||
/* Do actual job */
|
||||
prepare_storage ();
|
||||
prepare_memory ();
|
||||
parse_config (config.dhcpdconf_file);
|
||||
parse_leases ();
|
||||
prepare_data ();
|
||||
|
|
@ -271,7 +266,7 @@ main (int argc, char **argv)
|
|||
|
||||
/* Global allocations, counter resets etc */
|
||||
int
|
||||
prepare_storage ()
|
||||
prepare_memory ()
|
||||
{
|
||||
num_ranges = num_shared_networks = 0;
|
||||
shared_networks =
|
||||
|
|
@ -282,4 +277,5 @@ prepare_storage ()
|
|||
|
||||
/* First shared network entry is all networks */
|
||||
strcpy (shared_net_names, "All networks");
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -37,6 +37,7 @@ struct configuration_t
|
|||
char *dhcpdlease_file;
|
||||
char output_format[2];
|
||||
char sort[2];
|
||||
int reverse_order;
|
||||
char *output_file;
|
||||
int output_limit[2];
|
||||
};
|
||||
|
|
@ -55,8 +56,11 @@ struct range_t
|
|||
};
|
||||
|
||||
/* Global variables */
|
||||
static int true = 1;
|
||||
static int false = 0;
|
||||
|
||||
char *program_name;
|
||||
static const float version_number = 2.4;
|
||||
static const float version_number = 2.5;
|
||||
struct configuration_t config;
|
||||
|
||||
static int output_limit_bit_1 = 1;
|
||||
|
|
@ -74,7 +78,7 @@ unsigned long int *leases;
|
|||
unsigned long int num_leases;
|
||||
|
||||
/* Function prototypes */
|
||||
int prepare_storage (void);
|
||||
int prepare_memory (void);
|
||||
int parse_leases (void);
|
||||
int parse_config (char *);
|
||||
int nth_field (int n, char *dest, const char *src);
|
||||
|
|
@ -88,6 +92,7 @@ void print_help (void);
|
|||
/* qsort requires comp functions */
|
||||
int intcomp (const void *x, const void *y);
|
||||
int rangecomp (const void *r1, const void *r2);
|
||||
int reverserangecomp (const void *r1, const void *r2);
|
||||
int namecomp (const void *n1, const void *n2);
|
||||
int maxcomp (const void *m1, const void *m2);
|
||||
int curcomp (const void *c1, const void *c2);
|
||||
|
|
|
|||
485
src/getdata.c
485
src/getdata.c
|
|
@ -49,190 +49,6 @@ extern char *malloc ();
|
|||
#include "dhcpd-pools.h"
|
||||
#include "defaults.h"
|
||||
|
||||
/* Parser for dhcpd.conf */
|
||||
int
|
||||
parse_config (char *config_file)
|
||||
{
|
||||
FILE *dhcpd_config;
|
||||
char *line, *shared_name_p, *last_shared, *tmp, *matchp;
|
||||
unsigned int braces = 0, linelen, i;
|
||||
struct in_addr inp;
|
||||
struct range_t *range_p;
|
||||
struct shared_network_t *shared_p;
|
||||
|
||||
line = safe_malloc (sizeof (char) * MAXLEN);
|
||||
tmp = safe_malloc (sizeof (char) * MAXLEN);
|
||||
|
||||
shared_p = shared_networks;
|
||||
range_p = ranges;
|
||||
last_shared = SHARED_NETWORKS_NAMES + shared_net_names;
|
||||
shared_name_p = shared_net_names;
|
||||
|
||||
/* Save and skip all networks name */
|
||||
shared_p->name = shared_net_names;
|
||||
shared_name_p += strlen (shared_name_p) + 1;
|
||||
shared_p++;
|
||||
|
||||
dhcpd_config = fopen (config_file, "r");
|
||||
if (dhcpd_config == NULL)
|
||||
{
|
||||
eprintf ("parse_config: %s:", config_file);
|
||||
exit (EXIT_FAILURE);
|
||||
}
|
||||
|
||||
while (!feof (dhcpd_config))
|
||||
{
|
||||
fgets (line, MAXLEN, dhcpd_config);
|
||||
matchp = strchr (line, '#');
|
||||
if (matchp)
|
||||
{
|
||||
*matchp = '\0';
|
||||
}
|
||||
matchp = strchr (line, ';');
|
||||
if (matchp)
|
||||
{
|
||||
*matchp = '\0';
|
||||
}
|
||||
matchp = strchr (line, '\n');
|
||||
if (matchp)
|
||||
{
|
||||
*matchp = '\0';
|
||||
}
|
||||
linelen = strlen (line);
|
||||
if (linelen == 0)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
/* Count braces. What a crappy way to "know" is range in
|
||||
* shared defined in network declaration or not. I must
|
||||
* fix this some day. */
|
||||
for (i = 0; i < linelen; i++)
|
||||
{
|
||||
if (line[i] == '{')
|
||||
{
|
||||
braces++;
|
||||
}
|
||||
else if (line[i] == '}')
|
||||
{
|
||||
braces--;
|
||||
}
|
||||
}
|
||||
|
||||
/* Smells like line that defines range. */
|
||||
matchp = strstr (line, "range");
|
||||
if (matchp)
|
||||
{
|
||||
/* Match "range" that part of some other text. */
|
||||
matchp--;
|
||||
i = matchp[0];
|
||||
if (!isspace (i))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
matchp = matchp + 6;
|
||||
i = matchp[0];
|
||||
if (!isspace (i))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
/* shared_p is incremented too early. This glue is
|
||||
* ugly and should be fixed. */
|
||||
if (braces > 1)
|
||||
{
|
||||
range_p->shared_net = shared_p - 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
range_p->shared_net = NULL;
|
||||
}
|
||||
|
||||
/* Range declaration is presumed to be single line. If
|
||||
* range written on multiple lines output will be most
|
||||
* likely humorous or crash. This bug needs to be
|
||||
* fixed, even thou I don't expect many people to
|
||||
* complain about this bug. */
|
||||
nth_field (2, tmp, line);
|
||||
inet_aton (tmp, &inp);
|
||||
|
||||
/* Small speed up. Range will be greater than range
|
||||
* small and lesser than range great, equal part in
|
||||
* test can be skipped so test that compares all IP's
|
||||
* is perhaps a little faster. This kludge must be
|
||||
* remembered at output of results */
|
||||
range_p->first_ip = htonl (inp.s_addr) - 1;
|
||||
nth_field (3, tmp, line);
|
||||
|
||||
inet_aton (tmp, &inp);
|
||||
range_p->last_ip = htonl (inp.s_addr) + 1;
|
||||
|
||||
range_p->count = 0;
|
||||
|
||||
range_p++;
|
||||
num_ranges++;
|
||||
|
||||
if (num_ranges > RANGES)
|
||||
{
|
||||
eprintf
|
||||
("parse_config: Range space full! Increase RANGES and recompile.");
|
||||
exit (EXIT_FAILURE);
|
||||
}
|
||||
}
|
||||
else if (strstr (line, "shared-network"))
|
||||
{
|
||||
/* Check is pessimistic but its better this way */
|
||||
linelen = strlen (line);
|
||||
if (shared_name_p + linelen > last_shared)
|
||||
{
|
||||
eprintf
|
||||
("parse_config: Shared network name space full! Increase SHARED_NETWORKS_NAMES and recompile.\n");
|
||||
exit (EXIT_FAILURE);
|
||||
}
|
||||
|
||||
/* See range declaration bug above. */
|
||||
nth_field (2, shared_name_p, line);
|
||||
shared_p->name = shared_name_p;
|
||||
shared_p->available = 0;
|
||||
shared_p->used = 0;
|
||||
|
||||
shared_p++;
|
||||
num_shared_networks++;
|
||||
shared_name_p += strlen (shared_name_p) + 1;
|
||||
|
||||
if (num_shared_networks > SHARED_NETWORKS)
|
||||
{
|
||||
eprintf
|
||||
("parse_config: Shared network space full! Increase SHARED_NETWORKS and recompile.\n");
|
||||
exit (EXIT_FAILURE);
|
||||
}
|
||||
}
|
||||
|
||||
/* If include files are allowed to write with relative path
|
||||
* this if needs to be fixed. */
|
||||
else if (strstr (line, "include"))
|
||||
{
|
||||
nth_field (2, tmp, line);
|
||||
/* Perhaps quote mark striping could more pretty, but
|
||||
* it isn't - Yours Sincerely lazy author. */
|
||||
matchp = strrchr (tmp, '"');
|
||||
|
||||
if (matchp)
|
||||
{
|
||||
*matchp = '\0';
|
||||
}
|
||||
if (tmp[0] == '"')
|
||||
{
|
||||
parse_config (++tmp);
|
||||
}
|
||||
else
|
||||
{
|
||||
parse_config (tmp);
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Parse dhcpd.leases file. All performance boosts for this
|
||||
* function are wellcome */
|
||||
int
|
||||
|
|
@ -324,3 +140,304 @@ nth_field (int n, char *dest, const char *src)
|
|||
dest[k] = '\0';
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* UUTTA */
|
||||
|
||||
/* dhcpd.conf interesting words */
|
||||
int
|
||||
is_interesting_config_clause (char *s)
|
||||
{
|
||||
if (strstr (s, "range"))
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
else if (strstr (s, "shared-network"))
|
||||
{
|
||||
return 2;
|
||||
}
|
||||
else if (strstr (s, "include"))
|
||||
{
|
||||
return 3;
|
||||
}
|
||||
else
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
int
|
||||
parse_config (char *config_file)
|
||||
{
|
||||
FILE *dhcpd_config;
|
||||
int ret = 0, i = 0, newclause = 1, comment = 0, braces = 0;
|
||||
char word[MAXLEN], c;
|
||||
char *current_shared_name, *next_free_shared_name, *last_shared_name;
|
||||
int braces_shared = 1000;
|
||||
struct shared_network_t *shared_p;
|
||||
|
||||
shared_p = shared_networks;
|
||||
current_shared_name = shared_net_names;
|
||||
next_free_shared_name = shared_net_names + strlen (shared_net_names) + 1;
|
||||
last_shared_name = SHARED_NETWORKS_NAMES + shared_net_names;
|
||||
|
||||
/* Default place holder for ranges "All networks" */
|
||||
shared_p->name = current_shared_name;
|
||||
shared_p->available = 0;
|
||||
shared_p->used = 0;
|
||||
|
||||
/* Open configuration file */
|
||||
dhcpd_config = fopen (config_file, "r");
|
||||
if (dhcpd_config == NULL)
|
||||
{
|
||||
eprintf ("parse_config: %s:", config_file);
|
||||
exit (EXIT_FAILURE);
|
||||
}
|
||||
|
||||
/* Parse file with a bit hairy style */
|
||||
while (!feof (dhcpd_config))
|
||||
{
|
||||
c = fgetc (dhcpd_config);
|
||||
/* Certain characters are magical */
|
||||
switch (c)
|
||||
{
|
||||
case '#':
|
||||
comment = 1;
|
||||
continue;
|
||||
case '\n':
|
||||
comment = 0;
|
||||
continue;
|
||||
case ';':
|
||||
if (comment == 0)
|
||||
{
|
||||
newclause = 1;
|
||||
i = 0;
|
||||
}
|
||||
continue;
|
||||
case '{':
|
||||
if (comment == 0)
|
||||
{
|
||||
braces++;
|
||||
newclause = 1;
|
||||
}
|
||||
continue;
|
||||
case '}':
|
||||
if (comment == 0)
|
||||
{
|
||||
braces--;
|
||||
if (braces_shared == braces)
|
||||
{
|
||||
current_shared_name = shared_net_names;
|
||||
braces_shared = 1000;
|
||||
shared_p = shared_networks;
|
||||
}
|
||||
newclause = 1;
|
||||
}
|
||||
continue;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
/* Either inside comment or Nth word of clause. */
|
||||
if (comment == 1 || newclause == 0)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
/* Strip white spaces before new clause word. */
|
||||
if (newclause == 1 && isspace (c) && i == 0)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
/* Save to word which clause this is. */
|
||||
if (newclause == 1 && !isspace (c))
|
||||
{
|
||||
word[i] = c;
|
||||
i++;
|
||||
/* Long word which is almost causing overflow. Not any of words
|
||||
* this program is looking for are this long. */
|
||||
if (i > MAXLEN)
|
||||
{
|
||||
newclause = 0;
|
||||
i = 0;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
/* See if clause is something that parser is looking for. */
|
||||
else
|
||||
{
|
||||
/* Insert string end & set state */
|
||||
word[i] = '\0';
|
||||
newclause = 0;
|
||||
i = 0;
|
||||
|
||||
ret = is_interesting_config_clause (word);
|
||||
switch (ret)
|
||||
{
|
||||
case 0:
|
||||
/* printf ("nothing interesting: %s\n", word); */
|
||||
break;
|
||||
case 1:
|
||||
/* printf ("range %s\n", shared_p->name); */
|
||||
save_range (dhcpd_config, shared_p);
|
||||
break;
|
||||
case 2:
|
||||
/* printf("shared-network\n"); */
|
||||
braces_shared = braces;
|
||||
num_shared_networks++;
|
||||
shared_p++;
|
||||
save_shared_network (dhcpd_config, next_free_shared_name,
|
||||
last_shared_name,
|
||||
shared_networks + num_shared_networks);
|
||||
current_shared_name = next_free_shared_name;
|
||||
/* printf ("current name: %s \n", current_shared_name); */
|
||||
next_free_shared_name += strlen (next_free_shared_name) + 1;
|
||||
shared_p = shared_networks + num_shared_networks;
|
||||
break;
|
||||
case 3:
|
||||
/* printf ("include\n"); */
|
||||
follow_include (dhcpd_config);
|
||||
break;
|
||||
default:
|
||||
eprintf ("This cannot happen, report a bug!");
|
||||
exit (EXIT_FAILURE);
|
||||
}
|
||||
}
|
||||
}
|
||||
// mitvit num_ranges--;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
save_range (FILE * dhcpd_config, char *shared_p)
|
||||
{
|
||||
char c, ipstr[17];
|
||||
/* ip string index */
|
||||
int i = 0;
|
||||
/* white spaces before first IP detector */
|
||||
int j = 0;
|
||||
/* index is it first or second IP */
|
||||
int k = 0;
|
||||
/* wishful thingking that this could make performance better */
|
||||
int space = 0;
|
||||
struct in_addr inp;
|
||||
struct range_t *range_p;
|
||||
range_p = ranges + num_ranges;
|
||||
|
||||
while (!feof (dhcpd_config))
|
||||
{
|
||||
c = fgetc (dhcpd_config);
|
||||
/* Avoid constantly running same syscall by saving result. */
|
||||
space = isspace (c);
|
||||
/* white spaces before first IP */
|
||||
if (space != 0 && j == 0)
|
||||
{
|
||||
continue;
|
||||
/* save IP string */
|
||||
}
|
||||
else if (space == 0)
|
||||
{
|
||||
ipstr[i] = c;
|
||||
i++;
|
||||
j = 1;
|
||||
continue;
|
||||
}
|
||||
/* Put IP to structure where it will be analyzed. */
|
||||
if ((space != 0) && i > 0)
|
||||
{
|
||||
ipstr[i] = '\0';
|
||||
/* Remove possible trailing colon */
|
||||
if (ipstr[i - 1] == ';')
|
||||
{
|
||||
ipstr[i - 1] = '\0';
|
||||
}
|
||||
/* Convert string to decimal */
|
||||
inet_aton (ipstr, &inp);
|
||||
if (k == 0)
|
||||
{
|
||||
range_p->first_ip = htonl (inp.s_addr) - 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
range_p->last_ip = htonl (inp.s_addr) + 1;
|
||||
range_p->count = 0;
|
||||
range_p->shared_net = shared_p;
|
||||
num_ranges++;
|
||||
}
|
||||
|
||||
/* This needs to be convert to a dynamic memory engrowing. */
|
||||
if (num_ranges > RANGES)
|
||||
{
|
||||
eprintf
|
||||
("parse_config: Range space full! Increase RANGES and recompile.");
|
||||
exit (EXIT_FAILURE);
|
||||
}
|
||||
|
||||
/* Reset IP string index and start looking for next one */
|
||||
i = 0;
|
||||
k++;
|
||||
}
|
||||
if (k > 1)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
eprintf ("This cannot happen, report a bug!");
|
||||
exit (EXIT_FAILURE);
|
||||
}
|
||||
|
||||
int
|
||||
save_shared_network (FILE * dhcpd_config, char *name, char *last,
|
||||
struct shared_network_t *shared_p)
|
||||
{
|
||||
char c;
|
||||
/* Name in quotes must be saved with spaces */
|
||||
int quoted = 0;
|
||||
/* name string index */
|
||||
int i = 0;
|
||||
/* white spaces before name detector */
|
||||
int j = 0;
|
||||
/* wishful thingking that this could make performance better */
|
||||
int space = 0;
|
||||
|
||||
while (!feof (dhcpd_config))
|
||||
{
|
||||
c = fgetc (dhcpd_config);
|
||||
/* Avoid constantly running same syscall by saving result. */
|
||||
space = isspace (c);
|
||||
/* Skip initial white spaces */
|
||||
if (space != 0 && j == 0)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if (c == '"')
|
||||
{
|
||||
quoted++;
|
||||
j = 1;
|
||||
continue;
|
||||
}
|
||||
if (space != 0 && quoted != 1)
|
||||
{
|
||||
if (&name[i] == last)
|
||||
{
|
||||
eprintf ("Shared network name space out of memory");
|
||||
exit (1);
|
||||
}
|
||||
name[i] = '\0';
|
||||
j = strlen (name);
|
||||
|
||||
break;
|
||||
}
|
||||
name[i] = c;
|
||||
i++;
|
||||
j = 1;
|
||||
}
|
||||
shared_p->name = name;
|
||||
shared_p->available = 0;
|
||||
shared_p->used = 0;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
follow_include (FILE * dhcpd_config)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -100,7 +100,7 @@ clean_up (void)
|
|||
void
|
||||
print_version (void)
|
||||
{
|
||||
fprintf (stdout, "%s version %.2f\n", program_name, version_number);
|
||||
fprintf (stdout, "%s version %.1f\n", program_name, version_number);
|
||||
fprintf (stdout, "Written by Sami Kerola.\n\n");
|
||||
fprintf (stdout,
|
||||
"%s may be copied only under the terms of GNU General Public\n",
|
||||
|
|
@ -135,6 +135,7 @@ This is ISC dhcpd pools usage analyzer.\n\
|
|||
c current\n\
|
||||
p percent\n");
|
||||
fprintf (stdout, "\
|
||||
-r --reverse reverse order sort\n\
|
||||
-o --output file output into a file\n\
|
||||
-L --limit nr output limit mask 77 - 00\n\
|
||||
-v --version version information\n\
|
||||
|
|
|
|||
108
src/sort.c
108
src/sort.c
|
|
@ -1,3 +1,4 @@
|
|||
|
||||
/*
|
||||
** Copyright (C) 2006- Sami Kerola <kerolasa@iki.fi>
|
||||
**
|
||||
|
|
@ -25,47 +26,114 @@
|
|||
|
||||
#include "dhcpd-pools.h"
|
||||
|
||||
/* qsort predicate-like functions */
|
||||
int
|
||||
intcomp (const void *x, const void *y)
|
||||
{
|
||||
if (*(unsigned long int *) x < *(unsigned long int *) y)
|
||||
return -1;
|
||||
else if (*(unsigned long int *) y < *(unsigned long int *) x)
|
||||
return 1;
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
rangecomp (const void *r1, const void *r2)
|
||||
{
|
||||
if ((((struct range_t *) r1)->first_ip) <
|
||||
(((struct range_t *) r2)->first_ip))
|
||||
return -1;
|
||||
else if ((((struct range_t *) r2)->first_ip) <
|
||||
(((struct range_t *) r1)->first_ip))
|
||||
return 1;
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
reverserangecomp (const void *r1, const void *r2)
|
||||
{
|
||||
if ((((struct range_t *) r1)->first_ip) <
|
||||
(((struct range_t *) r2)->first_ip))
|
||||
return 1;
|
||||
else if ((((struct range_t *) r2)->first_ip) <
|
||||
(((struct range_t *) r1)->first_ip))
|
||||
return -1;
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
namecomp (const void *n1, const void *n2)
|
||||
{
|
||||
return strcmp ((((struct range_t *) n1)->shared_net->name),
|
||||
(((struct range_t *) n2)->shared_net->name));
|
||||
int ret;
|
||||
ret = strcmp ((((struct range_t *) n1)->shared_net->name),
|
||||
(((struct range_t *) n2)->shared_net->name));
|
||||
if (config.reverse_order == true)
|
||||
{
|
||||
return ret * -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
int
|
||||
maxcomp (const void *m1, const void *m2)
|
||||
{
|
||||
int ret;
|
||||
if ((((struct range_t *) m1)->last_ip - ((struct range_t *) m1)->first_ip -
|
||||
1) <
|
||||
(((struct range_t *) m2)->last_ip - ((struct range_t *) m2)->first_ip -
|
||||
1))
|
||||
return -1;
|
||||
ret = -1;
|
||||
else
|
||||
if ((((struct range_t *) m2)->last_ip -
|
||||
((struct range_t *) m2)->first_ip - 1) <
|
||||
(((struct range_t *) m1)->last_ip -
|
||||
((struct range_t *) m1)->first_ip - 1))
|
||||
return 1;
|
||||
ret = 1;
|
||||
else
|
||||
return 0;
|
||||
ret = 0;
|
||||
if (config.reverse_order == true)
|
||||
{
|
||||
return ret * -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
int
|
||||
curcomp (const void *c1, const void *c2)
|
||||
{
|
||||
int ret;
|
||||
if ((((struct range_t *) c1)->count) < (((struct range_t *) c2)->count))
|
||||
return -1;
|
||||
ret = -1;
|
||||
else if ((((struct range_t *) c2)->count) <
|
||||
(((struct range_t *) c1)->count))
|
||||
return 1;
|
||||
ret = 1;
|
||||
else
|
||||
return 0;
|
||||
ret = 0;
|
||||
if (config.reverse_order == true)
|
||||
{
|
||||
return ret * -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
int
|
||||
percentcomp (const void *p1, const void *p2)
|
||||
{
|
||||
float f1, f2;
|
||||
int ret;
|
||||
f1 = (float) (((struct range_t *) p1)->count) /
|
||||
(((struct range_t *) p1)->last_ip -
|
||||
((struct range_t *) p1)->first_ip - 1);
|
||||
|
|
@ -75,18 +143,32 @@ percentcomp (const void *p1, const void *p2)
|
|||
1);
|
||||
|
||||
if (f1 < f2)
|
||||
return -1;
|
||||
ret = -1;
|
||||
else if (f1 > f2)
|
||||
return 1;
|
||||
ret = 1;
|
||||
else
|
||||
return 0;
|
||||
ret = 0;
|
||||
if (config.reverse_order == true)
|
||||
{
|
||||
return ret * -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
/* Function pointer functions for output sorting */
|
||||
int
|
||||
sort_ip (void)
|
||||
{
|
||||
/* This function is needed so that function pointer will contain
|
||||
* something. The default sort is IP so nothing needs to be done. */
|
||||
/* There is no need to order results in forward order since ranges are in
|
||||
* that order by default */
|
||||
if (config.reverse_order == true)
|
||||
{
|
||||
qsort (ranges, (size_t) num_ranges, sizeof (struct range_t),
|
||||
&reverserangecomp);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue