diff options
Diffstat (limited to '')
-rw-r--r-- | plugins-root/Makefile.am | 97 | ||||
-rw-r--r-- | plugins-root/Makefile.in | 2504 | ||||
-rw-r--r-- | plugins-root/check_dhcp.c | 1412 | ||||
-rw-r--r-- | plugins-root/check_icmp.c | 2109 | ||||
-rw-r--r-- | plugins-root/pst3.c | 262 | ||||
-rw-r--r-- | plugins-root/t/check_dhcp.t | 74 | ||||
-rw-r--r-- | plugins-root/t/check_icmp.t | 142 |
7 files changed, 6600 insertions, 0 deletions
diff --git a/plugins-root/Makefile.am b/plugins-root/Makefile.am new file mode 100644 index 0000000..40aa020 --- /dev/null +++ b/plugins-root/Makefile.am @@ -0,0 +1,97 @@ +## Process this file with automake to produce Makefile.in + +if RELEASE_PRESENT +NP_VERSION = @NP_RELEASE@ +else +NP-VERSION-FILE: .FORCE-NP-VERSION-FILE + @$(SHELL_PATH) $(top_srcdir)/NP-VERSION-GEN +.FORCE-NP-VERSION-FILE: +-include NP-VERSION-FILE +endif + +AM_CFLAGS = -DNP_VERSION='"$(NP_VERSION)"' + +VPATH = $(top_srcdir) $(top_srcdir)/lib $(top_srcdir)/plugins $(top_srcdir)/plugins/t $(srcdir) + +AM_CPPFLAGS = -I.. -I$(top_srcdir)/lib -I$(top_srcdir)/gl -I$(top_srcdir)/intl -I$(top_srcdir)/plugins @SSLINCLUDE@ + +localedir = $(datadir)/locale +DEFS = -DLOCALEDIR=\"$(localedir)\" @DEFS@ +# Don't add LTLIBINTL to all, as pst3 doesn't need it +#LIBS = @LTLIBINTL@ @LIBS@ + +noinst_PROGRAMS = check_dhcp check_icmp @EXTRAS_ROOT@ + +EXTRA_PROGRAMS = pst3 + +EXTRA_DIST = t pst3.c + +BASEOBJS = ../plugins/utils.o ../lib/libmonitoringplug.a ../gl/libgnu.a $(LIB_CRYPTO) +NETOBJS = ../plugins/netutils.o $(BASEOBJS) $(EXTRA_NETOBJS) +NETLIBS = $(NETOBJS) $(SOCKETLIBS) + +TESTS_ENVIRONMENT = perl -I $(top_builddir) -I $(top_srcdir) + +TESTS = @PLUGIN_TEST@ + +test: + perl -I $(top_builddir) -I $(top_srcdir) ../test.pl + +test-debug: + NPTEST_DEBUG=1 HARNESS_VERBOSE=1 perl -I $(top_builddir) -I $(top_srcdir) ../test.pl + +setuid_root_mode = ug=rx,u+s + +# /* Author Coreutils team - see ACKNOWLEDGEMENTS */ + +INSTALL_SUID = \ + for f in $(noinst_PROGRAMS) ; do \ + p=$$f; \ + echo " $(INSTALL_PROGRAM) $$p $(DESTDIR)$(libexecdir)/$$p"; \ + $(INSTALL_PROGRAM) $$p $(DESTDIR)$(libexecdir)/$$p; \ + echo " chown root $(DESTDIR)$(libexecdir)/$$p"; \ + chown root $(DESTDIR)$(libexecdir)/$$p; \ + echo " chmod $(setuid_root_mode) $(DESTDIR)$(libexecdir)/$$p"; \ + chmod $(setuid_root_mode) $(DESTDIR)$(libexecdir)/$$p; \ + done + +install-root: $(noinst_PROGRAMS) + @$(INSTALL_SUID) + +install-exec-local: $(noinst_PROGRAMS) + @TMPFILE=$(DESTDIR)$(libexecdir)/.setuid-$$$$; \ + rm -f $$TMPFILE; \ + echo > $$TMPFILE; \ + ## See if we can create a setuid root executable in $(libexecdir). + ## If not, then don't even try to install setuid plugins. + can_create_suid_root_executable=no; \ + chown root $$TMPFILE > /dev/null 2>&1 \ + && chmod $(setuid_root_mode) $$TMPFILE > /dev/null 2>&1 \ + && can_create_suid_root_executable=yes; \ + rm -f $$TMPFILE; \ + if test $$can_create_suid_root_executable = yes; then \ + $(INSTALL_SUID); \ + else \ + echo "WARNING: insufficient access; not installing setuid plugins"; \ + echo "NOTE: to install setuid plugins, run 'make install-root' as root"; \ + fi + +# /* Author Coreutils team sub-citation */ + +############################################################################## +# the actual targets +check_dhcp_LDADD = @LTLIBINTL@ $(NETLIBS) +check_icmp_LDADD = @LTLIBINTL@ $(NETLIBS) $(SOCKETLIBS) + +# -m64 needed at compiler and linker phase +pst3_CFLAGS = @PST3CFLAGS@ +pst3_LDFLAGS = @PST3CFLAGS@ +# pst3 must not use monitoringplug/gnulib includes! +pst3_CPPFLAGS = + +check_dhcp_DEPENDENCIES = check_dhcp.c $(NETOBJS) $(DEPLIBS) +check_icmp_DEPENDENCIES = check_icmp.c $(NETOBJS) + +clean-local: + rm -f NP-VERSION-FILE + diff --git a/plugins-root/Makefile.in b/plugins-root/Makefile.in new file mode 100644 index 0000000..5991e82 --- /dev/null +++ b/plugins-root/Makefile.in @@ -0,0 +1,2504 @@ +# Makefile.in generated by automake 1.16.3 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2020 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +noinst_PROGRAMS = check_dhcp$(EXEEXT) check_icmp$(EXEEXT) \ + @EXTRAS_ROOT@ $(am__empty) +EXTRA_PROGRAMS = pst3$(EXEEXT) +subdir = plugins-root +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/libcurl.m4 \ + $(top_srcdir)/m4/np_mysqlclient.m4 \ + $(top_srcdir)/m4/uriparser.m4 $(top_srcdir)/gl/m4/00gnulib.m4 \ + $(top_srcdir)/gl/m4/__inline.m4 \ + $(top_srcdir)/gl/m4/absolute-header.m4 \ + $(top_srcdir)/gl/m4/af_alg.m4 $(top_srcdir)/gl/m4/alloca.m4 \ + $(top_srcdir)/gl/m4/arpa_inet_h.m4 \ + $(top_srcdir)/gl/m4/assert_h.m4 $(top_srcdir)/gl/m4/base64.m4 \ + $(top_srcdir)/gl/m4/btowc.m4 \ + $(top_srcdir)/gl/m4/builtin-expect.m4 \ + $(top_srcdir)/gl/m4/byteswap.m4 $(top_srcdir)/gl/m4/c-bool.m4 \ + $(top_srcdir)/gl/m4/calloc.m4 $(top_srcdir)/gl/m4/close.m4 \ + $(top_srcdir)/gl/m4/codeset.m4 \ + $(top_srcdir)/gl/m4/double-slash-root.m4 \ + $(top_srcdir)/gl/m4/dup2.m4 $(top_srcdir)/gl/m4/eealloc.m4 \ + $(top_srcdir)/gl/m4/environ.m4 $(top_srcdir)/gl/m4/errno_h.m4 \ + $(top_srcdir)/gl/m4/error.m4 $(top_srcdir)/gl/m4/exponentd.m4 \ + $(top_srcdir)/gl/m4/extensions.m4 \ + $(top_srcdir)/gl/m4/extern-inline.m4 \ + $(top_srcdir)/gl/m4/fcntl-o.m4 $(top_srcdir)/gl/m4/fcntl.m4 \ + $(top_srcdir)/gl/m4/fcntl_h.m4 $(top_srcdir)/gl/m4/fflush.m4 \ + $(top_srcdir)/gl/m4/float_h.m4 $(top_srcdir)/gl/m4/floorf.m4 \ + $(top_srcdir)/gl/m4/fopen.m4 $(top_srcdir)/gl/m4/fpurge.m4 \ + $(top_srcdir)/gl/m4/freading.m4 $(top_srcdir)/gl/m4/free.m4 \ + $(top_srcdir)/gl/m4/fseek.m4 $(top_srcdir)/gl/m4/fseeko.m4 \ + $(top_srcdir)/gl/m4/fstat.m4 $(top_srcdir)/gl/m4/fstypename.m4 \ + $(top_srcdir)/gl/m4/fsusage.m4 $(top_srcdir)/gl/m4/ftell.m4 \ + $(top_srcdir)/gl/m4/ftello.m4 \ + $(top_srcdir)/gl/m4/getaddrinfo.m4 \ + $(top_srcdir)/gl/m4/getdelim.m4 \ + $(top_srcdir)/gl/m4/getdtablesize.m4 \ + $(top_srcdir)/gl/m4/gethostname.m4 \ + $(top_srcdir)/gl/m4/getline.m4 \ + $(top_srcdir)/gl/m4/getloadavg.m4 \ + $(top_srcdir)/gl/m4/getopt.m4 \ + $(top_srcdir)/gl/m4/getprogname.m4 \ + $(top_srcdir)/gl/m4/gl-openssl.m4 \ + $(top_srcdir)/gl/m4/gnulib-common.m4 \ + $(top_srcdir)/gl/m4/gnulib-comp.m4 \ + $(top_srcdir)/gl/m4/hostent.m4 $(top_srcdir)/gl/m4/idpriv.m4 \ + $(top_srcdir)/gl/m4/include_next.m4 \ + $(top_srcdir)/gl/m4/inet_ntop.m4 \ + $(top_srcdir)/gl/m4/intmax_t.m4 \ + $(top_srcdir)/gl/m4/inttypes.m4 \ + $(top_srcdir)/gl/m4/inttypes_h.m4 \ + $(top_srcdir)/gl/m4/langinfo_h.m4 \ + $(top_srcdir)/gl/m4/largefile.m4 \ + $(top_srcdir)/gl/m4/libtool.m4 $(top_srcdir)/gl/m4/limits-h.m4 \ + $(top_srcdir)/gl/m4/localcharset.m4 \ + $(top_srcdir)/gl/m4/locale-fr.m4 \ + $(top_srcdir)/gl/m4/locale-ja.m4 \ + $(top_srcdir)/gl/m4/locale-zh.m4 \ + $(top_srcdir)/gl/m4/locale_h.m4 \ + $(top_srcdir)/gl/m4/localeconv.m4 $(top_srcdir)/gl/m4/lock.m4 \ + $(top_srcdir)/gl/m4/lseek.m4 $(top_srcdir)/gl/m4/ltoptions.m4 \ + $(top_srcdir)/gl/m4/ltsugar.m4 \ + $(top_srcdir)/gl/m4/ltversion.m4 \ + $(top_srcdir)/gl/m4/lt~obsolete.m4 \ + $(top_srcdir)/gl/m4/malloc.m4 $(top_srcdir)/gl/m4/malloca.m4 \ + $(top_srcdir)/gl/m4/math_h.m4 $(top_srcdir)/gl/m4/mbrtowc.m4 \ + $(top_srcdir)/gl/m4/mbsinit.m4 \ + $(top_srcdir)/gl/m4/mbstate_t.m4 $(top_srcdir)/gl/m4/mbtowc.m4 \ + $(top_srcdir)/gl/m4/memchr.m4 $(top_srcdir)/gl/m4/minmax.m4 \ + $(top_srcdir)/gl/m4/mktime.m4 $(top_srcdir)/gl/m4/mmap-anon.m4 \ + $(top_srcdir)/gl/m4/mode_t.m4 $(top_srcdir)/gl/m4/mountlist.m4 \ + $(top_srcdir)/gl/m4/msvc-inval.m4 \ + $(top_srcdir)/gl/m4/msvc-nothrow.m4 \ + $(top_srcdir)/gl/m4/multiarch.m4 \ + $(top_srcdir)/gl/m4/netdb_h.m4 \ + $(top_srcdir)/gl/m4/netinet_in_h.m4 \ + $(top_srcdir)/gl/m4/nl_langinfo.m4 \ + $(top_srcdir)/gl/m4/nocrash.m4 $(top_srcdir)/gl/m4/off_t.m4 \ + $(top_srcdir)/gl/m4/open-cloexec.m4 \ + $(top_srcdir)/gl/m4/open-slash.m4 $(top_srcdir)/gl/m4/open.m4 \ + $(top_srcdir)/gl/m4/pathmax.m4 $(top_srcdir)/gl/m4/pid_t.m4 \ + $(top_srcdir)/gl/m4/printf.m4 \ + $(top_srcdir)/gl/m4/pthread_rwlock_rdlock.m4 \ + $(top_srcdir)/gl/m4/realloc.m4 \ + $(top_srcdir)/gl/m4/reallocarray.m4 \ + $(top_srcdir)/gl/m4/regex.m4 $(top_srcdir)/gl/m4/servent.m4 \ + $(top_srcdir)/gl/m4/setenv.m4 \ + $(top_srcdir)/gl/m4/setlocale_null.m4 \ + $(top_srcdir)/gl/m4/sha256.m4 $(top_srcdir)/gl/m4/size_max.m4 \ + $(top_srcdir)/gl/m4/snprintf.m4 \ + $(top_srcdir)/gl/m4/socketlib.m4 \ + $(top_srcdir)/gl/m4/sockets.m4 $(top_srcdir)/gl/m4/socklen.m4 \ + $(top_srcdir)/gl/m4/sockpfaf.m4 $(top_srcdir)/gl/m4/ssize_t.m4 \ + $(top_srcdir)/gl/m4/stat-time.m4 $(top_srcdir)/gl/m4/stat.m4 \ + $(top_srcdir)/gl/m4/std-gnu11.m4 \ + $(top_srcdir)/gl/m4/stdalign.m4 \ + $(top_srcdir)/gl/m4/stddef_h.m4 $(top_srcdir)/gl/m4/stdint.m4 \ + $(top_srcdir)/gl/m4/stdint_h.m4 $(top_srcdir)/gl/m4/stdio_h.m4 \ + $(top_srcdir)/gl/m4/stdlib_h.m4 $(top_srcdir)/gl/m4/strcase.m4 \ + $(top_srcdir)/gl/m4/strcasestr.m4 \ + $(top_srcdir)/gl/m4/strerror.m4 \ + $(top_srcdir)/gl/m4/string_h.m4 \ + $(top_srcdir)/gl/m4/strings_h.m4 $(top_srcdir)/gl/m4/strsep.m4 \ + $(top_srcdir)/gl/m4/strstr.m4 \ + $(top_srcdir)/gl/m4/sys_socket_h.m4 \ + $(top_srcdir)/gl/m4/sys_stat_h.m4 \ + $(top_srcdir)/gl/m4/sys_types_h.m4 \ + $(top_srcdir)/gl/m4/sys_uio_h.m4 \ + $(top_srcdir)/gl/m4/threadlib.m4 $(top_srcdir)/gl/m4/time_h.m4 \ + $(top_srcdir)/gl/m4/time_r.m4 $(top_srcdir)/gl/m4/timegm.m4 \ + $(top_srcdir)/gl/m4/ungetc.m4 $(top_srcdir)/gl/m4/unistd_h.m4 \ + $(top_srcdir)/gl/m4/unlocked-io.m4 \ + $(top_srcdir)/gl/m4/vararrays.m4 \ + $(top_srcdir)/gl/m4/vasnprintf.m4 \ + $(top_srcdir)/gl/m4/vasprintf.m4 \ + $(top_srcdir)/gl/m4/visibility.m4 \ + $(top_srcdir)/gl/m4/vsnprintf.m4 \ + $(top_srcdir)/gl/m4/warn-on-use.m4 \ + $(top_srcdir)/gl/m4/wchar_h.m4 $(top_srcdir)/gl/m4/wchar_t.m4 \ + $(top_srcdir)/gl/m4/wcrtomb.m4 $(top_srcdir)/gl/m4/wctype_h.m4 \ + $(top_srcdir)/gl/m4/wint_t.m4 $(top_srcdir)/gl/m4/xalloc.m4 \ + $(top_srcdir)/gl/m4/xsize.m4 $(top_srcdir)/gl/m4/zzgnulib.m4 \ + $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) +mkinstalldirs = $(SHELL) $(top_srcdir)/build-aux/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +PROGRAMS = $(noinst_PROGRAMS) +check_dhcp_SOURCES = check_dhcp.c +check_dhcp_OBJECTS = check_dhcp.$(OBJEXT) +am__DEPENDENCIES_1 = +am__DEPENDENCIES_2 = ../plugins/utils.o ../lib/libmonitoringplug.a \ + ../gl/libgnu.a $(am__DEPENDENCIES_1) +am__DEPENDENCIES_3 = ../plugins/netutils.o $(am__DEPENDENCIES_2) \ + $(am__DEPENDENCIES_1) +am__DEPENDENCIES_4 = $(am__DEPENDENCIES_3) $(am__DEPENDENCIES_1) +AM_V_lt = $(am__v_lt_@AM_V@) +am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) +am__v_lt_0 = --silent +am__v_lt_1 = +check_icmp_SOURCES = check_icmp.c +check_icmp_OBJECTS = check_icmp.$(OBJEXT) +pst3_SOURCES = pst3.c +pst3_OBJECTS = pst3-pst3.$(OBJEXT) +pst3_LDADD = $(LDADD) +pst3_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(pst3_CFLAGS) $(CFLAGS) \ + $(pst3_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp +am__maybe_remake_depfiles = depfiles +am__depfiles_remade = ./$(DEPDIR)/check_dhcp.Po \ + ./$(DEPDIR)/check_icmp.Po ./$(DEPDIR)/pst3-pst3.Po +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +AM_V_CC = $(am__v_CC_@AM_V@) +am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +am__v_CC_0 = @echo " CC " $@; +am__v_CC_1 = +CCLD = $(CC) +LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CCLD = $(am__v_CCLD_@AM_V@) +am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +am__v_CCLD_0 = @echo " CCLD " $@; +am__v_CCLD_1 = +SOURCES = check_dhcp.c check_icmp.c pst3.c +DIST_SOURCES = check_dhcp.c check_icmp.c pst3.c +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` +ETAGS = etags +CTAGS = ctags +am__tty_colors_dummy = \ + mgn= red= grn= lgn= blu= brg= std=; \ + am__color_tests=no +am__tty_colors = { \ + $(am__tty_colors_dummy); \ + if test "X$(AM_COLOR_TESTS)" = Xno; then \ + am__color_tests=no; \ + elif test "X$(AM_COLOR_TESTS)" = Xalways; then \ + am__color_tests=yes; \ + elif test "X$$TERM" != Xdumb && { test -t 1; } 2>/dev/null; then \ + am__color_tests=yes; \ + fi; \ + if test $$am__color_tests = yes; then \ + red='[0;31m'; \ + grn='[0;32m'; \ + lgn='[1;32m'; \ + blu='[1;34m'; \ + mgn='[0;35m'; \ + brg='[1m'; \ + std='[m'; \ + fi; \ +} +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } +am__recheck_rx = ^[ ]*:recheck:[ ]* +am__global_test_result_rx = ^[ ]*:global-test-result:[ ]* +am__copy_in_global_log_rx = ^[ ]*:copy-in-global-log:[ ]* +# A command that, given a newline-separated list of test names on the +# standard input, print the name of the tests that are to be re-run +# upon "make recheck". +am__list_recheck_tests = $(AWK) '{ \ + recheck = 1; \ + while ((rc = (getline line < ($$0 ".trs"))) != 0) \ + { \ + if (rc < 0) \ + { \ + if ((getline line2 < ($$0 ".log")) < 0) \ + recheck = 0; \ + break; \ + } \ + else if (line ~ /$(am__recheck_rx)[nN][Oo]/) \ + { \ + recheck = 0; \ + break; \ + } \ + else if (line ~ /$(am__recheck_rx)[yY][eE][sS]/) \ + { \ + break; \ + } \ + }; \ + if (recheck) \ + print $$0; \ + close ($$0 ".trs"); \ + close ($$0 ".log"); \ +}' +# A command that, given a newline-separated list of test names on the +# standard input, create the global log from their .trs and .log files. +am__create_global_log = $(AWK) ' \ +function fatal(msg) \ +{ \ + print "fatal: making $@: " msg | "cat >&2"; \ + exit 1; \ +} \ +function rst_section(header) \ +{ \ + print header; \ + len = length(header); \ + for (i = 1; i <= len; i = i + 1) \ + printf "="; \ + printf "\n\n"; \ +} \ +{ \ + copy_in_global_log = 1; \ + global_test_result = "RUN"; \ + while ((rc = (getline line < ($$0 ".trs"))) != 0) \ + { \ + if (rc < 0) \ + fatal("failed to read from " $$0 ".trs"); \ + if (line ~ /$(am__global_test_result_rx)/) \ + { \ + sub("$(am__global_test_result_rx)", "", line); \ + sub("[ ]*$$", "", line); \ + global_test_result = line; \ + } \ + else if (line ~ /$(am__copy_in_global_log_rx)[nN][oO]/) \ + copy_in_global_log = 0; \ + }; \ + if (copy_in_global_log) \ + { \ + rst_section(global_test_result ": " $$0); \ + while ((rc = (getline line < ($$0 ".log"))) != 0) \ + { \ + if (rc < 0) \ + fatal("failed to read from " $$0 ".log"); \ + print line; \ + }; \ + printf "\n"; \ + }; \ + close ($$0 ".trs"); \ + close ($$0 ".log"); \ +}' +# Restructured Text title. +am__rst_title = { sed 's/.*/ & /;h;s/./=/g;p;x;s/ *$$//;p;g' && echo; } +# Solaris 10 'make', and several other traditional 'make' implementations, +# pass "-e" to $(SHELL), and POSIX 2008 even requires this. Work around it +# by disabling -e (using the XSI extension "set +e") if it's set. +am__sh_e_setup = case $$- in *e*) set +e;; esac +# Default flags passed to test drivers. +am__common_driver_flags = \ + --color-tests "$$am__color_tests" \ + --enable-hard-errors "$$am__enable_hard_errors" \ + --expect-failure "$$am__expect_failure" +# To be inserted before the command running the test. Creates the +# directory for the log if needed. Stores in $dir the directory +# containing $f, in $tst the test, in $log the log. Executes the +# developer- defined test setup AM_TESTS_ENVIRONMENT (if any), and +# passes TESTS_ENVIRONMENT. Set up options for the wrapper that +# will run the test scripts (or their associated LOG_COMPILER, if +# thy have one). +am__check_pre = \ +$(am__sh_e_setup); \ +$(am__vpath_adj_setup) $(am__vpath_adj) \ +$(am__tty_colors); \ +srcdir=$(srcdir); export srcdir; \ +case "$@" in \ + */*) am__odir=`echo "./$@" | sed 's|/[^/]*$$||'`;; \ + *) am__odir=.;; \ +esac; \ +test "x$$am__odir" = x"." || test -d "$$am__odir" \ + || $(MKDIR_P) "$$am__odir" || exit $$?; \ +if test -f "./$$f"; then dir=./; \ +elif test -f "$$f"; then dir=; \ +else dir="$(srcdir)/"; fi; \ +tst=$$dir$$f; log='$@'; \ +if test -n '$(DISABLE_HARD_ERRORS)'; then \ + am__enable_hard_errors=no; \ +else \ + am__enable_hard_errors=yes; \ +fi; \ +case " $(XFAIL_TESTS) " in \ + *[\ \ ]$$f[\ \ ]* | *[\ \ ]$$dir$$f[\ \ ]*) \ + am__expect_failure=yes;; \ + *) \ + am__expect_failure=no;; \ +esac; \ +$(AM_TESTS_ENVIRONMENT) $(TESTS_ENVIRONMENT) +# A shell command to get the names of the tests scripts with any registered +# extension removed (i.e., equivalently, the names of the test logs, with +# the '.log' extension removed). The result is saved in the shell variable +# '$bases'. This honors runtime overriding of TESTS and TEST_LOGS. Sadly, +# we cannot use something simpler, involving e.g., "$(TEST_LOGS:.log=)", +# since that might cause problem with VPATH rewrites for suffix-less tests. +# See also 'test-harness-vpath-rewrite.sh' and 'test-trs-basic.sh'. +am__set_TESTS_bases = \ + bases='$(TEST_LOGS)'; \ + bases=`for i in $$bases; do echo $$i; done | sed 's/\.log$$//'`; \ + bases=`echo $$bases` +AM_TESTSUITE_SUMMARY_HEADER = ' for $(PACKAGE_STRING)' +RECHECK_LOGS = $(TEST_LOGS) +AM_RECURSIVE_TARGETS = check recheck +TEST_SUITE_LOG = test-suite.log +TEST_EXTENSIONS = @EXEEXT@ .test +am__test_logs1 = $(TESTS:=.log) +am__test_logs2 = $(am__test_logs1:@EXEEXT@.log=.log) +TEST_LOGS = $(am__test_logs2:.test.log=.log) +TEST_LOG_DRIVER = $(SHELL) $(top_srcdir)/build-aux/test-driver +TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \ + $(TEST_LOG_FLAGS) +am__set_b = \ + case '$@' in \ + */*) \ + case '$*' in \ + */*) b='$*';; \ + *) b=`echo '$@' | sed 's/\.log$$//'`; \ + esac;; \ + *) \ + b='$*';; \ + esac +am__DIST_COMMON = $(srcdir)/Makefile.in \ + $(top_srcdir)/build-aux/depcomp \ + $(top_srcdir)/build-aux/mkinstalldirs \ + $(top_srcdir)/build-aux/test-driver +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +VPATH = $(top_srcdir) $(top_srcdir)/lib $(top_srcdir)/plugins $(top_srcdir)/plugins/t $(srcdir) +ACLOCAL = @ACLOCAL@ +ALLOCA = @ALLOCA@ +ALLOCA_H = @ALLOCA_H@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +APPLE_UNIVERSAL_BUILD = @APPLE_UNIVERSAL_BUILD@ +AR = @AR@ +ARFLAGS = @ARFLAGS@ +ASSERT_H = @ASSERT_H@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BASENAME = @BASENAME@ +BITSIZEOF_PTRDIFF_T = @BITSIZEOF_PTRDIFF_T@ +BITSIZEOF_SIG_ATOMIC_T = @BITSIZEOF_SIG_ATOMIC_T@ +BITSIZEOF_SIZE_T = @BITSIZEOF_SIZE_T@ +BITSIZEOF_WCHAR_T = @BITSIZEOF_WCHAR_T@ +BITSIZEOF_WINT_T = @BITSIZEOF_WINT_T@ +BYTESWAP_H = @BYTESWAP_H@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CFLAG_VISIBILITY = @CFLAG_VISIBILITY@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DBILIBS = @DBILIBS@ +DEFS = -DLOCALEDIR=\"$(localedir)\" @DEFS@ +DEPDIR = @DEPDIR@ +DEPLIBS = @DEPLIBS@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EMULTIHOP_HIDDEN = @EMULTIHOP_HIDDEN@ +EMULTIHOP_VALUE = @EMULTIHOP_VALUE@ +ENOLINK_HIDDEN = @ENOLINK_HIDDEN@ +ENOLINK_VALUE = @ENOLINK_VALUE@ +EOVERFLOW_HIDDEN = @EOVERFLOW_HIDDEN@ +EOVERFLOW_VALUE = @EOVERFLOW_VALUE@ +ERRNO_H = @ERRNO_H@ +EXEEXT = @EXEEXT@ +EXTRAS = @EXTRAS@ +EXTRAS_ROOT = @EXTRAS_ROOT@ +EXTRA_NETOBJS = @EXTRA_NETOBJS@ +EXTRA_TEST = @EXTRA_TEST@ +FGREP = @FGREP@ +FLOAT_H = @FLOAT_H@ +FLOORF_LIBM = @FLOORF_LIBM@ +GETADDRINFO_LIB = @GETADDRINFO_LIB@ +GETHOSTNAME_LIB = @GETHOSTNAME_LIB@ +GETLOADAVG_LIBS = @GETLOADAVG_LIBS@ +GETOPT_CDEFS_H = @GETOPT_CDEFS_H@ +GETOPT_H = @GETOPT_H@ +GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ +GL_CFLAG_ALLOW_WARNINGS = @GL_CFLAG_ALLOW_WARNINGS@ +GL_CFLAG_GNULIB_WARNINGS = @GL_CFLAG_GNULIB_WARNINGS@ +GL_GNULIB_ACCEPT = @GL_GNULIB_ACCEPT@ +GL_GNULIB_ACCEPT4 = @GL_GNULIB_ACCEPT4@ +GL_GNULIB_ACCESS = @GL_GNULIB_ACCESS@ +GL_GNULIB_ACOSF = @GL_GNULIB_ACOSF@ +GL_GNULIB_ACOSL = @GL_GNULIB_ACOSL@ +GL_GNULIB_ALIGNED_ALLOC = @GL_GNULIB_ALIGNED_ALLOC@ +GL_GNULIB_ASINF = @GL_GNULIB_ASINF@ +GL_GNULIB_ASINL = @GL_GNULIB_ASINL@ +GL_GNULIB_ATAN2F = @GL_GNULIB_ATAN2F@ +GL_GNULIB_ATANF = @GL_GNULIB_ATANF@ +GL_GNULIB_ATANL = @GL_GNULIB_ATANL@ +GL_GNULIB_ATOLL = @GL_GNULIB_ATOLL@ +GL_GNULIB_BIND = @GL_GNULIB_BIND@ +GL_GNULIB_BTOWC = @GL_GNULIB_BTOWC@ +GL_GNULIB_CALLOC_GNU = @GL_GNULIB_CALLOC_GNU@ +GL_GNULIB_CALLOC_POSIX = @GL_GNULIB_CALLOC_POSIX@ +GL_GNULIB_CANONICALIZE_FILE_NAME = @GL_GNULIB_CANONICALIZE_FILE_NAME@ +GL_GNULIB_CBRT = @GL_GNULIB_CBRT@ +GL_GNULIB_CBRTF = @GL_GNULIB_CBRTF@ +GL_GNULIB_CBRTL = @GL_GNULIB_CBRTL@ +GL_GNULIB_CEIL = @GL_GNULIB_CEIL@ +GL_GNULIB_CEILF = @GL_GNULIB_CEILF@ +GL_GNULIB_CEILL = @GL_GNULIB_CEILL@ +GL_GNULIB_CHDIR = @GL_GNULIB_CHDIR@ +GL_GNULIB_CHMOD = @GL_GNULIB_CHMOD@ +GL_GNULIB_CHOWN = @GL_GNULIB_CHOWN@ +GL_GNULIB_CLOSE = @GL_GNULIB_CLOSE@ +GL_GNULIB_CONNECT = @GL_GNULIB_CONNECT@ +GL_GNULIB_COPYSIGN = @GL_GNULIB_COPYSIGN@ +GL_GNULIB_COPYSIGNF = @GL_GNULIB_COPYSIGNF@ +GL_GNULIB_COPYSIGNL = @GL_GNULIB_COPYSIGNL@ +GL_GNULIB_COPY_FILE_RANGE = @GL_GNULIB_COPY_FILE_RANGE@ +GL_GNULIB_COSF = @GL_GNULIB_COSF@ +GL_GNULIB_COSHF = @GL_GNULIB_COSHF@ +GL_GNULIB_COSL = @GL_GNULIB_COSL@ +GL_GNULIB_CREAT = @GL_GNULIB_CREAT@ +GL_GNULIB_CTIME = @GL_GNULIB_CTIME@ +GL_GNULIB_DPRINTF = @GL_GNULIB_DPRINTF@ +GL_GNULIB_DUP = @GL_GNULIB_DUP@ +GL_GNULIB_DUP2 = @GL_GNULIB_DUP2@ +GL_GNULIB_DUP3 = @GL_GNULIB_DUP3@ +GL_GNULIB_DUPLOCALE = @GL_GNULIB_DUPLOCALE@ +GL_GNULIB_ENVIRON = @GL_GNULIB_ENVIRON@ +GL_GNULIB_EUIDACCESS = @GL_GNULIB_EUIDACCESS@ +GL_GNULIB_EXECL = @GL_GNULIB_EXECL@ +GL_GNULIB_EXECLE = @GL_GNULIB_EXECLE@ +GL_GNULIB_EXECLP = @GL_GNULIB_EXECLP@ +GL_GNULIB_EXECV = @GL_GNULIB_EXECV@ +GL_GNULIB_EXECVE = @GL_GNULIB_EXECVE@ +GL_GNULIB_EXECVP = @GL_GNULIB_EXECVP@ +GL_GNULIB_EXECVPE = @GL_GNULIB_EXECVPE@ +GL_GNULIB_EXP2 = @GL_GNULIB_EXP2@ +GL_GNULIB_EXP2F = @GL_GNULIB_EXP2F@ +GL_GNULIB_EXP2L = @GL_GNULIB_EXP2L@ +GL_GNULIB_EXPF = @GL_GNULIB_EXPF@ +GL_GNULIB_EXPL = @GL_GNULIB_EXPL@ +GL_GNULIB_EXPLICIT_BZERO = @GL_GNULIB_EXPLICIT_BZERO@ +GL_GNULIB_EXPM1 = @GL_GNULIB_EXPM1@ +GL_GNULIB_EXPM1F = @GL_GNULIB_EXPM1F@ +GL_GNULIB_EXPM1L = @GL_GNULIB_EXPM1L@ +GL_GNULIB_FABSF = @GL_GNULIB_FABSF@ +GL_GNULIB_FABSL = @GL_GNULIB_FABSL@ +GL_GNULIB_FACCESSAT = @GL_GNULIB_FACCESSAT@ +GL_GNULIB_FCHDIR = @GL_GNULIB_FCHDIR@ +GL_GNULIB_FCHMODAT = @GL_GNULIB_FCHMODAT@ +GL_GNULIB_FCHOWNAT = @GL_GNULIB_FCHOWNAT@ +GL_GNULIB_FCLOSE = @GL_GNULIB_FCLOSE@ +GL_GNULIB_FCNTL = @GL_GNULIB_FCNTL@ +GL_GNULIB_FDATASYNC = @GL_GNULIB_FDATASYNC@ +GL_GNULIB_FDOPEN = @GL_GNULIB_FDOPEN@ +GL_GNULIB_FFLUSH = @GL_GNULIB_FFLUSH@ +GL_GNULIB_FFS = @GL_GNULIB_FFS@ +GL_GNULIB_FFSL = @GL_GNULIB_FFSL@ +GL_GNULIB_FFSLL = @GL_GNULIB_FFSLL@ +GL_GNULIB_FGETC = @GL_GNULIB_FGETC@ +GL_GNULIB_FGETS = @GL_GNULIB_FGETS@ +GL_GNULIB_FLOOR = @GL_GNULIB_FLOOR@ +GL_GNULIB_FLOORF = @GL_GNULIB_FLOORF@ +GL_GNULIB_FLOORL = @GL_GNULIB_FLOORL@ +GL_GNULIB_FMA = @GL_GNULIB_FMA@ +GL_GNULIB_FMAF = @GL_GNULIB_FMAF@ +GL_GNULIB_FMAL = @GL_GNULIB_FMAL@ +GL_GNULIB_FMOD = @GL_GNULIB_FMOD@ +GL_GNULIB_FMODF = @GL_GNULIB_FMODF@ +GL_GNULIB_FMODL = @GL_GNULIB_FMODL@ +GL_GNULIB_FOPEN = @GL_GNULIB_FOPEN@ +GL_GNULIB_FOPEN_GNU = @GL_GNULIB_FOPEN_GNU@ +GL_GNULIB_FPRINTF = @GL_GNULIB_FPRINTF@ +GL_GNULIB_FPRINTF_POSIX = @GL_GNULIB_FPRINTF_POSIX@ +GL_GNULIB_FPURGE = @GL_GNULIB_FPURGE@ +GL_GNULIB_FPUTC = @GL_GNULIB_FPUTC@ +GL_GNULIB_FPUTS = @GL_GNULIB_FPUTS@ +GL_GNULIB_FREAD = @GL_GNULIB_FREAD@ +GL_GNULIB_FREE_POSIX = @GL_GNULIB_FREE_POSIX@ +GL_GNULIB_FREOPEN = @GL_GNULIB_FREOPEN@ +GL_GNULIB_FREXP = @GL_GNULIB_FREXP@ +GL_GNULIB_FREXPF = @GL_GNULIB_FREXPF@ +GL_GNULIB_FREXPL = @GL_GNULIB_FREXPL@ +GL_GNULIB_FSCANF = @GL_GNULIB_FSCANF@ +GL_GNULIB_FSEEK = @GL_GNULIB_FSEEK@ +GL_GNULIB_FSEEKO = @GL_GNULIB_FSEEKO@ +GL_GNULIB_FSTAT = @GL_GNULIB_FSTAT@ +GL_GNULIB_FSTATAT = @GL_GNULIB_FSTATAT@ +GL_GNULIB_FSYNC = @GL_GNULIB_FSYNC@ +GL_GNULIB_FTELL = @GL_GNULIB_FTELL@ +GL_GNULIB_FTELLO = @GL_GNULIB_FTELLO@ +GL_GNULIB_FTRUNCATE = @GL_GNULIB_FTRUNCATE@ +GL_GNULIB_FUTIMENS = @GL_GNULIB_FUTIMENS@ +GL_GNULIB_FWRITE = @GL_GNULIB_FWRITE@ +GL_GNULIB_GETADDRINFO = @GL_GNULIB_GETADDRINFO@ +GL_GNULIB_GETC = @GL_GNULIB_GETC@ +GL_GNULIB_GETCHAR = @GL_GNULIB_GETCHAR@ +GL_GNULIB_GETCWD = @GL_GNULIB_GETCWD@ +GL_GNULIB_GETDELIM = @GL_GNULIB_GETDELIM@ +GL_GNULIB_GETDOMAINNAME = @GL_GNULIB_GETDOMAINNAME@ +GL_GNULIB_GETDTABLESIZE = @GL_GNULIB_GETDTABLESIZE@ +GL_GNULIB_GETENTROPY = @GL_GNULIB_GETENTROPY@ +GL_GNULIB_GETGROUPS = @GL_GNULIB_GETGROUPS@ +GL_GNULIB_GETHOSTNAME = @GL_GNULIB_GETHOSTNAME@ +GL_GNULIB_GETLINE = @GL_GNULIB_GETLINE@ +GL_GNULIB_GETLOADAVG = @GL_GNULIB_GETLOADAVG@ +GL_GNULIB_GETLOGIN = @GL_GNULIB_GETLOGIN@ +GL_GNULIB_GETLOGIN_R = @GL_GNULIB_GETLOGIN_R@ +GL_GNULIB_GETOPT_POSIX = @GL_GNULIB_GETOPT_POSIX@ +GL_GNULIB_GETPAGESIZE = @GL_GNULIB_GETPAGESIZE@ +GL_GNULIB_GETPASS = @GL_GNULIB_GETPASS@ +GL_GNULIB_GETPASS_GNU = @GL_GNULIB_GETPASS_GNU@ +GL_GNULIB_GETPEERNAME = @GL_GNULIB_GETPEERNAME@ +GL_GNULIB_GETSOCKNAME = @GL_GNULIB_GETSOCKNAME@ +GL_GNULIB_GETSOCKOPT = @GL_GNULIB_GETSOCKOPT@ +GL_GNULIB_GETSUBOPT = @GL_GNULIB_GETSUBOPT@ +GL_GNULIB_GETUMASK = @GL_GNULIB_GETUMASK@ +GL_GNULIB_GETUSERSHELL = @GL_GNULIB_GETUSERSHELL@ +GL_GNULIB_GRANTPT = @GL_GNULIB_GRANTPT@ +GL_GNULIB_GROUP_MEMBER = @GL_GNULIB_GROUP_MEMBER@ +GL_GNULIB_HYPOT = @GL_GNULIB_HYPOT@ +GL_GNULIB_HYPOTF = @GL_GNULIB_HYPOTF@ +GL_GNULIB_HYPOTL = @GL_GNULIB_HYPOTL@ +GL_GNULIB_ILOGB = @GL_GNULIB_ILOGB@ +GL_GNULIB_ILOGBF = @GL_GNULIB_ILOGBF@ +GL_GNULIB_ILOGBL = @GL_GNULIB_ILOGBL@ +GL_GNULIB_IMAXABS = @GL_GNULIB_IMAXABS@ +GL_GNULIB_IMAXDIV = @GL_GNULIB_IMAXDIV@ +GL_GNULIB_INET_NTOP = @GL_GNULIB_INET_NTOP@ +GL_GNULIB_INET_PTON = @GL_GNULIB_INET_PTON@ +GL_GNULIB_ISATTY = @GL_GNULIB_ISATTY@ +GL_GNULIB_ISFINITE = @GL_GNULIB_ISFINITE@ +GL_GNULIB_ISINF = @GL_GNULIB_ISINF@ +GL_GNULIB_ISNAN = @GL_GNULIB_ISNAN@ +GL_GNULIB_ISNAND = @GL_GNULIB_ISNAND@ +GL_GNULIB_ISNANF = @GL_GNULIB_ISNANF@ +GL_GNULIB_ISNANL = @GL_GNULIB_ISNANL@ +GL_GNULIB_ISWBLANK = @GL_GNULIB_ISWBLANK@ +GL_GNULIB_ISWCTYPE = @GL_GNULIB_ISWCTYPE@ +GL_GNULIB_ISWDIGIT = @GL_GNULIB_ISWDIGIT@ +GL_GNULIB_ISWXDIGIT = @GL_GNULIB_ISWXDIGIT@ +GL_GNULIB_LCHMOD = @GL_GNULIB_LCHMOD@ +GL_GNULIB_LCHOWN = @GL_GNULIB_LCHOWN@ +GL_GNULIB_LDEXPF = @GL_GNULIB_LDEXPF@ +GL_GNULIB_LDEXPL = @GL_GNULIB_LDEXPL@ +GL_GNULIB_LINK = @GL_GNULIB_LINK@ +GL_GNULIB_LINKAT = @GL_GNULIB_LINKAT@ +GL_GNULIB_LISTEN = @GL_GNULIB_LISTEN@ +GL_GNULIB_LOCALECONV = @GL_GNULIB_LOCALECONV@ +GL_GNULIB_LOCALENAME = @GL_GNULIB_LOCALENAME@ +GL_GNULIB_LOCALTIME = @GL_GNULIB_LOCALTIME@ +GL_GNULIB_LOG = @GL_GNULIB_LOG@ +GL_GNULIB_LOG10 = @GL_GNULIB_LOG10@ +GL_GNULIB_LOG10F = @GL_GNULIB_LOG10F@ +GL_GNULIB_LOG10L = @GL_GNULIB_LOG10L@ +GL_GNULIB_LOG1P = @GL_GNULIB_LOG1P@ +GL_GNULIB_LOG1PF = @GL_GNULIB_LOG1PF@ +GL_GNULIB_LOG1PL = @GL_GNULIB_LOG1PL@ +GL_GNULIB_LOG2 = @GL_GNULIB_LOG2@ +GL_GNULIB_LOG2F = @GL_GNULIB_LOG2F@ +GL_GNULIB_LOG2L = @GL_GNULIB_LOG2L@ +GL_GNULIB_LOGB = @GL_GNULIB_LOGB@ +GL_GNULIB_LOGBF = @GL_GNULIB_LOGBF@ +GL_GNULIB_LOGBL = @GL_GNULIB_LOGBL@ +GL_GNULIB_LOGF = @GL_GNULIB_LOGF@ +GL_GNULIB_LOGL = @GL_GNULIB_LOGL@ +GL_GNULIB_LSEEK = @GL_GNULIB_LSEEK@ +GL_GNULIB_LSTAT = @GL_GNULIB_LSTAT@ +GL_GNULIB_MALLOC_GNU = @GL_GNULIB_MALLOC_GNU@ +GL_GNULIB_MALLOC_POSIX = @GL_GNULIB_MALLOC_POSIX@ +GL_GNULIB_MBRLEN = @GL_GNULIB_MBRLEN@ +GL_GNULIB_MBRTOWC = @GL_GNULIB_MBRTOWC@ +GL_GNULIB_MBSCASECMP = @GL_GNULIB_MBSCASECMP@ +GL_GNULIB_MBSCASESTR = @GL_GNULIB_MBSCASESTR@ +GL_GNULIB_MBSCHR = @GL_GNULIB_MBSCHR@ +GL_GNULIB_MBSCSPN = @GL_GNULIB_MBSCSPN@ +GL_GNULIB_MBSINIT = @GL_GNULIB_MBSINIT@ +GL_GNULIB_MBSLEN = @GL_GNULIB_MBSLEN@ +GL_GNULIB_MBSNCASECMP = @GL_GNULIB_MBSNCASECMP@ +GL_GNULIB_MBSNLEN = @GL_GNULIB_MBSNLEN@ +GL_GNULIB_MBSNRTOWCS = @GL_GNULIB_MBSNRTOWCS@ +GL_GNULIB_MBSPBRK = @GL_GNULIB_MBSPBRK@ +GL_GNULIB_MBSPCASECMP = @GL_GNULIB_MBSPCASECMP@ +GL_GNULIB_MBSRCHR = @GL_GNULIB_MBSRCHR@ +GL_GNULIB_MBSRTOWCS = @GL_GNULIB_MBSRTOWCS@ +GL_GNULIB_MBSSEP = @GL_GNULIB_MBSSEP@ +GL_GNULIB_MBSSPN = @GL_GNULIB_MBSSPN@ +GL_GNULIB_MBSSTR = @GL_GNULIB_MBSSTR@ +GL_GNULIB_MBSTOK_R = @GL_GNULIB_MBSTOK_R@ +GL_GNULIB_MBTOWC = @GL_GNULIB_MBTOWC@ +GL_GNULIB_MDA_ACCESS = @GL_GNULIB_MDA_ACCESS@ +GL_GNULIB_MDA_CHDIR = @GL_GNULIB_MDA_CHDIR@ +GL_GNULIB_MDA_CHMOD = @GL_GNULIB_MDA_CHMOD@ +GL_GNULIB_MDA_CLOSE = @GL_GNULIB_MDA_CLOSE@ +GL_GNULIB_MDA_CREAT = @GL_GNULIB_MDA_CREAT@ +GL_GNULIB_MDA_DUP = @GL_GNULIB_MDA_DUP@ +GL_GNULIB_MDA_DUP2 = @GL_GNULIB_MDA_DUP2@ +GL_GNULIB_MDA_ECVT = @GL_GNULIB_MDA_ECVT@ +GL_GNULIB_MDA_EXECL = @GL_GNULIB_MDA_EXECL@ +GL_GNULIB_MDA_EXECLE = @GL_GNULIB_MDA_EXECLE@ +GL_GNULIB_MDA_EXECLP = @GL_GNULIB_MDA_EXECLP@ +GL_GNULIB_MDA_EXECV = @GL_GNULIB_MDA_EXECV@ +GL_GNULIB_MDA_EXECVE = @GL_GNULIB_MDA_EXECVE@ +GL_GNULIB_MDA_EXECVP = @GL_GNULIB_MDA_EXECVP@ +GL_GNULIB_MDA_EXECVPE = @GL_GNULIB_MDA_EXECVPE@ +GL_GNULIB_MDA_FCLOSEALL = @GL_GNULIB_MDA_FCLOSEALL@ +GL_GNULIB_MDA_FCVT = @GL_GNULIB_MDA_FCVT@ +GL_GNULIB_MDA_FDOPEN = @GL_GNULIB_MDA_FDOPEN@ +GL_GNULIB_MDA_FILENO = @GL_GNULIB_MDA_FILENO@ +GL_GNULIB_MDA_GCVT = @GL_GNULIB_MDA_GCVT@ +GL_GNULIB_MDA_GETCWD = @GL_GNULIB_MDA_GETCWD@ +GL_GNULIB_MDA_GETPID = @GL_GNULIB_MDA_GETPID@ +GL_GNULIB_MDA_GETW = @GL_GNULIB_MDA_GETW@ +GL_GNULIB_MDA_ISATTY = @GL_GNULIB_MDA_ISATTY@ +GL_GNULIB_MDA_J0 = @GL_GNULIB_MDA_J0@ +GL_GNULIB_MDA_J1 = @GL_GNULIB_MDA_J1@ +GL_GNULIB_MDA_JN = @GL_GNULIB_MDA_JN@ +GL_GNULIB_MDA_LSEEK = @GL_GNULIB_MDA_LSEEK@ +GL_GNULIB_MDA_MEMCCPY = @GL_GNULIB_MDA_MEMCCPY@ +GL_GNULIB_MDA_MKDIR = @GL_GNULIB_MDA_MKDIR@ +GL_GNULIB_MDA_MKTEMP = @GL_GNULIB_MDA_MKTEMP@ +GL_GNULIB_MDA_OPEN = @GL_GNULIB_MDA_OPEN@ +GL_GNULIB_MDA_PUTENV = @GL_GNULIB_MDA_PUTENV@ +GL_GNULIB_MDA_PUTW = @GL_GNULIB_MDA_PUTW@ +GL_GNULIB_MDA_READ = @GL_GNULIB_MDA_READ@ +GL_GNULIB_MDA_RMDIR = @GL_GNULIB_MDA_RMDIR@ +GL_GNULIB_MDA_STRDUP = @GL_GNULIB_MDA_STRDUP@ +GL_GNULIB_MDA_SWAB = @GL_GNULIB_MDA_SWAB@ +GL_GNULIB_MDA_TEMPNAM = @GL_GNULIB_MDA_TEMPNAM@ +GL_GNULIB_MDA_TZSET = @GL_GNULIB_MDA_TZSET@ +GL_GNULIB_MDA_UMASK = @GL_GNULIB_MDA_UMASK@ +GL_GNULIB_MDA_UNLINK = @GL_GNULIB_MDA_UNLINK@ +GL_GNULIB_MDA_WCSDUP = @GL_GNULIB_MDA_WCSDUP@ +GL_GNULIB_MDA_WRITE = @GL_GNULIB_MDA_WRITE@ +GL_GNULIB_MDA_Y0 = @GL_GNULIB_MDA_Y0@ +GL_GNULIB_MDA_Y1 = @GL_GNULIB_MDA_Y1@ +GL_GNULIB_MDA_YN = @GL_GNULIB_MDA_YN@ +GL_GNULIB_MEMCHR = @GL_GNULIB_MEMCHR@ +GL_GNULIB_MEMMEM = @GL_GNULIB_MEMMEM@ +GL_GNULIB_MEMPCPY = @GL_GNULIB_MEMPCPY@ +GL_GNULIB_MEMRCHR = @GL_GNULIB_MEMRCHR@ +GL_GNULIB_MEMSET_EXPLICIT = @GL_GNULIB_MEMSET_EXPLICIT@ +GL_GNULIB_MKDIR = @GL_GNULIB_MKDIR@ +GL_GNULIB_MKDIRAT = @GL_GNULIB_MKDIRAT@ +GL_GNULIB_MKDTEMP = @GL_GNULIB_MKDTEMP@ +GL_GNULIB_MKFIFO = @GL_GNULIB_MKFIFO@ +GL_GNULIB_MKFIFOAT = @GL_GNULIB_MKFIFOAT@ +GL_GNULIB_MKNOD = @GL_GNULIB_MKNOD@ +GL_GNULIB_MKNODAT = @GL_GNULIB_MKNODAT@ +GL_GNULIB_MKOSTEMP = @GL_GNULIB_MKOSTEMP@ +GL_GNULIB_MKOSTEMPS = @GL_GNULIB_MKOSTEMPS@ +GL_GNULIB_MKSTEMP = @GL_GNULIB_MKSTEMP@ +GL_GNULIB_MKSTEMPS = @GL_GNULIB_MKSTEMPS@ +GL_GNULIB_MKTIME = @GL_GNULIB_MKTIME@ +GL_GNULIB_MODF = @GL_GNULIB_MODF@ +GL_GNULIB_MODFF = @GL_GNULIB_MODFF@ +GL_GNULIB_MODFL = @GL_GNULIB_MODFL@ +GL_GNULIB_NANOSLEEP = @GL_GNULIB_NANOSLEEP@ +GL_GNULIB_NL_LANGINFO = @GL_GNULIB_NL_LANGINFO@ +GL_GNULIB_NONBLOCKING = @GL_GNULIB_NONBLOCKING@ +GL_GNULIB_OBSTACK_PRINTF = @GL_GNULIB_OBSTACK_PRINTF@ +GL_GNULIB_OBSTACK_PRINTF_POSIX = @GL_GNULIB_OBSTACK_PRINTF_POSIX@ +GL_GNULIB_OPEN = @GL_GNULIB_OPEN@ +GL_GNULIB_OPENAT = @GL_GNULIB_OPENAT@ +GL_GNULIB_OVERRIDES_STRUCT_STAT = @GL_GNULIB_OVERRIDES_STRUCT_STAT@ +GL_GNULIB_PCLOSE = @GL_GNULIB_PCLOSE@ +GL_GNULIB_PERROR = @GL_GNULIB_PERROR@ +GL_GNULIB_PIPE = @GL_GNULIB_PIPE@ +GL_GNULIB_PIPE2 = @GL_GNULIB_PIPE2@ +GL_GNULIB_POPEN = @GL_GNULIB_POPEN@ +GL_GNULIB_POSIX_MEMALIGN = @GL_GNULIB_POSIX_MEMALIGN@ +GL_GNULIB_POSIX_OPENPT = @GL_GNULIB_POSIX_OPENPT@ +GL_GNULIB_POWF = @GL_GNULIB_POWF@ +GL_GNULIB_PREAD = @GL_GNULIB_PREAD@ +GL_GNULIB_PRINTF = @GL_GNULIB_PRINTF@ +GL_GNULIB_PRINTF_POSIX = @GL_GNULIB_PRINTF_POSIX@ +GL_GNULIB_PTSNAME = @GL_GNULIB_PTSNAME@ +GL_GNULIB_PTSNAME_R = @GL_GNULIB_PTSNAME_R@ +GL_GNULIB_PUTC = @GL_GNULIB_PUTC@ +GL_GNULIB_PUTCHAR = @GL_GNULIB_PUTCHAR@ +GL_GNULIB_PUTENV = @GL_GNULIB_PUTENV@ +GL_GNULIB_PUTS = @GL_GNULIB_PUTS@ +GL_GNULIB_PWRITE = @GL_GNULIB_PWRITE@ +GL_GNULIB_QSORT_R = @GL_GNULIB_QSORT_R@ +GL_GNULIB_RANDOM = @GL_GNULIB_RANDOM@ +GL_GNULIB_RANDOM_R = @GL_GNULIB_RANDOM_R@ +GL_GNULIB_RAWMEMCHR = @GL_GNULIB_RAWMEMCHR@ +GL_GNULIB_READ = @GL_GNULIB_READ@ +GL_GNULIB_READLINK = @GL_GNULIB_READLINK@ +GL_GNULIB_READLINKAT = @GL_GNULIB_READLINKAT@ +GL_GNULIB_REALLOCARRAY = @GL_GNULIB_REALLOCARRAY@ +GL_GNULIB_REALLOC_GNU = @GL_GNULIB_REALLOC_GNU@ +GL_GNULIB_REALLOC_POSIX = @GL_GNULIB_REALLOC_POSIX@ +GL_GNULIB_REALPATH = @GL_GNULIB_REALPATH@ +GL_GNULIB_RECV = @GL_GNULIB_RECV@ +GL_GNULIB_RECVFROM = @GL_GNULIB_RECVFROM@ +GL_GNULIB_REMAINDER = @GL_GNULIB_REMAINDER@ +GL_GNULIB_REMAINDERF = @GL_GNULIB_REMAINDERF@ +GL_GNULIB_REMAINDERL = @GL_GNULIB_REMAINDERL@ +GL_GNULIB_REMOVE = @GL_GNULIB_REMOVE@ +GL_GNULIB_RENAME = @GL_GNULIB_RENAME@ +GL_GNULIB_RENAMEAT = @GL_GNULIB_RENAMEAT@ +GL_GNULIB_RINT = @GL_GNULIB_RINT@ +GL_GNULIB_RINTF = @GL_GNULIB_RINTF@ +GL_GNULIB_RINTL = @GL_GNULIB_RINTL@ +GL_GNULIB_RMDIR = @GL_GNULIB_RMDIR@ +GL_GNULIB_ROUND = @GL_GNULIB_ROUND@ +GL_GNULIB_ROUNDF = @GL_GNULIB_ROUNDF@ +GL_GNULIB_ROUNDL = @GL_GNULIB_ROUNDL@ +GL_GNULIB_RPMATCH = @GL_GNULIB_RPMATCH@ +GL_GNULIB_SCANF = @GL_GNULIB_SCANF@ +GL_GNULIB_SECURE_GETENV = @GL_GNULIB_SECURE_GETENV@ +GL_GNULIB_SEND = @GL_GNULIB_SEND@ +GL_GNULIB_SENDTO = @GL_GNULIB_SENDTO@ +GL_GNULIB_SETENV = @GL_GNULIB_SETENV@ +GL_GNULIB_SETHOSTNAME = @GL_GNULIB_SETHOSTNAME@ +GL_GNULIB_SETLOCALE = @GL_GNULIB_SETLOCALE@ +GL_GNULIB_SETLOCALE_NULL = @GL_GNULIB_SETLOCALE_NULL@ +GL_GNULIB_SETSOCKOPT = @GL_GNULIB_SETSOCKOPT@ +GL_GNULIB_SHUTDOWN = @GL_GNULIB_SHUTDOWN@ +GL_GNULIB_SIGABBREV_NP = @GL_GNULIB_SIGABBREV_NP@ +GL_GNULIB_SIGDESCR_NP = @GL_GNULIB_SIGDESCR_NP@ +GL_GNULIB_SIGNBIT = @GL_GNULIB_SIGNBIT@ +GL_GNULIB_SINF = @GL_GNULIB_SINF@ +GL_GNULIB_SINHF = @GL_GNULIB_SINHF@ +GL_GNULIB_SINL = @GL_GNULIB_SINL@ +GL_GNULIB_SLEEP = @GL_GNULIB_SLEEP@ +GL_GNULIB_SNPRINTF = @GL_GNULIB_SNPRINTF@ +GL_GNULIB_SOCKET = @GL_GNULIB_SOCKET@ +GL_GNULIB_SPRINTF_POSIX = @GL_GNULIB_SPRINTF_POSIX@ +GL_GNULIB_SQRTF = @GL_GNULIB_SQRTF@ +GL_GNULIB_SQRTL = @GL_GNULIB_SQRTL@ +GL_GNULIB_STAT = @GL_GNULIB_STAT@ +GL_GNULIB_STDIO_H_NONBLOCKING = @GL_GNULIB_STDIO_H_NONBLOCKING@ +GL_GNULIB_STDIO_H_SIGPIPE = @GL_GNULIB_STDIO_H_SIGPIPE@ +GL_GNULIB_STPCPY = @GL_GNULIB_STPCPY@ +GL_GNULIB_STPNCPY = @GL_GNULIB_STPNCPY@ +GL_GNULIB_STRCASESTR = @GL_GNULIB_STRCASESTR@ +GL_GNULIB_STRCHRNUL = @GL_GNULIB_STRCHRNUL@ +GL_GNULIB_STRDUP = @GL_GNULIB_STRDUP@ +GL_GNULIB_STRERROR = @GL_GNULIB_STRERROR@ +GL_GNULIB_STRERRORNAME_NP = @GL_GNULIB_STRERRORNAME_NP@ +GL_GNULIB_STRERROR_R = @GL_GNULIB_STRERROR_R@ +GL_GNULIB_STRFTIME = @GL_GNULIB_STRFTIME@ +GL_GNULIB_STRNCAT = @GL_GNULIB_STRNCAT@ +GL_GNULIB_STRNDUP = @GL_GNULIB_STRNDUP@ +GL_GNULIB_STRNLEN = @GL_GNULIB_STRNLEN@ +GL_GNULIB_STRPBRK = @GL_GNULIB_STRPBRK@ +GL_GNULIB_STRPTIME = @GL_GNULIB_STRPTIME@ +GL_GNULIB_STRSEP = @GL_GNULIB_STRSEP@ +GL_GNULIB_STRSIGNAL = @GL_GNULIB_STRSIGNAL@ +GL_GNULIB_STRSTR = @GL_GNULIB_STRSTR@ +GL_GNULIB_STRTOD = @GL_GNULIB_STRTOD@ +GL_GNULIB_STRTOIMAX = @GL_GNULIB_STRTOIMAX@ +GL_GNULIB_STRTOK_R = @GL_GNULIB_STRTOK_R@ +GL_GNULIB_STRTOL = @GL_GNULIB_STRTOL@ +GL_GNULIB_STRTOLD = @GL_GNULIB_STRTOLD@ +GL_GNULIB_STRTOLL = @GL_GNULIB_STRTOLL@ +GL_GNULIB_STRTOUL = @GL_GNULIB_STRTOUL@ +GL_GNULIB_STRTOULL = @GL_GNULIB_STRTOULL@ +GL_GNULIB_STRTOUMAX = @GL_GNULIB_STRTOUMAX@ +GL_GNULIB_STRVERSCMP = @GL_GNULIB_STRVERSCMP@ +GL_GNULIB_SYMLINK = @GL_GNULIB_SYMLINK@ +GL_GNULIB_SYMLINKAT = @GL_GNULIB_SYMLINKAT@ +GL_GNULIB_SYSTEM_POSIX = @GL_GNULIB_SYSTEM_POSIX@ +GL_GNULIB_TANF = @GL_GNULIB_TANF@ +GL_GNULIB_TANHF = @GL_GNULIB_TANHF@ +GL_GNULIB_TANL = @GL_GNULIB_TANL@ +GL_GNULIB_TIMEGM = @GL_GNULIB_TIMEGM@ +GL_GNULIB_TIMESPEC_GET = @GL_GNULIB_TIMESPEC_GET@ +GL_GNULIB_TIMESPEC_GETRES = @GL_GNULIB_TIMESPEC_GETRES@ +GL_GNULIB_TIME_R = @GL_GNULIB_TIME_R@ +GL_GNULIB_TIME_RZ = @GL_GNULIB_TIME_RZ@ +GL_GNULIB_TMPFILE = @GL_GNULIB_TMPFILE@ +GL_GNULIB_TOWCTRANS = @GL_GNULIB_TOWCTRANS@ +GL_GNULIB_TRUNC = @GL_GNULIB_TRUNC@ +GL_GNULIB_TRUNCATE = @GL_GNULIB_TRUNCATE@ +GL_GNULIB_TRUNCF = @GL_GNULIB_TRUNCF@ +GL_GNULIB_TRUNCL = @GL_GNULIB_TRUNCL@ +GL_GNULIB_TTYNAME_R = @GL_GNULIB_TTYNAME_R@ +GL_GNULIB_TZSET = @GL_GNULIB_TZSET@ +GL_GNULIB_UNISTD_H_GETOPT = @GL_GNULIB_UNISTD_H_GETOPT@ +GL_GNULIB_UNISTD_H_NONBLOCKING = @GL_GNULIB_UNISTD_H_NONBLOCKING@ +GL_GNULIB_UNISTD_H_SIGPIPE = @GL_GNULIB_UNISTD_H_SIGPIPE@ +GL_GNULIB_UNLINK = @GL_GNULIB_UNLINK@ +GL_GNULIB_UNLINKAT = @GL_GNULIB_UNLINKAT@ +GL_GNULIB_UNLOCKPT = @GL_GNULIB_UNLOCKPT@ +GL_GNULIB_UNSETENV = @GL_GNULIB_UNSETENV@ +GL_GNULIB_USLEEP = @GL_GNULIB_USLEEP@ +GL_GNULIB_UTIMENSAT = @GL_GNULIB_UTIMENSAT@ +GL_GNULIB_VASPRINTF = @GL_GNULIB_VASPRINTF@ +GL_GNULIB_VDPRINTF = @GL_GNULIB_VDPRINTF@ +GL_GNULIB_VFPRINTF = @GL_GNULIB_VFPRINTF@ +GL_GNULIB_VFPRINTF_POSIX = @GL_GNULIB_VFPRINTF_POSIX@ +GL_GNULIB_VFSCANF = @GL_GNULIB_VFSCANF@ +GL_GNULIB_VPRINTF = @GL_GNULIB_VPRINTF@ +GL_GNULIB_VPRINTF_POSIX = @GL_GNULIB_VPRINTF_POSIX@ +GL_GNULIB_VSCANF = @GL_GNULIB_VSCANF@ +GL_GNULIB_VSNPRINTF = @GL_GNULIB_VSNPRINTF@ +GL_GNULIB_VSPRINTF_POSIX = @GL_GNULIB_VSPRINTF_POSIX@ +GL_GNULIB_WCPCPY = @GL_GNULIB_WCPCPY@ +GL_GNULIB_WCPNCPY = @GL_GNULIB_WCPNCPY@ +GL_GNULIB_WCRTOMB = @GL_GNULIB_WCRTOMB@ +GL_GNULIB_WCSCASECMP = @GL_GNULIB_WCSCASECMP@ +GL_GNULIB_WCSCAT = @GL_GNULIB_WCSCAT@ +GL_GNULIB_WCSCHR = @GL_GNULIB_WCSCHR@ +GL_GNULIB_WCSCMP = @GL_GNULIB_WCSCMP@ +GL_GNULIB_WCSCOLL = @GL_GNULIB_WCSCOLL@ +GL_GNULIB_WCSCPY = @GL_GNULIB_WCSCPY@ +GL_GNULIB_WCSCSPN = @GL_GNULIB_WCSCSPN@ +GL_GNULIB_WCSDUP = @GL_GNULIB_WCSDUP@ +GL_GNULIB_WCSFTIME = @GL_GNULIB_WCSFTIME@ +GL_GNULIB_WCSLEN = @GL_GNULIB_WCSLEN@ +GL_GNULIB_WCSNCASECMP = @GL_GNULIB_WCSNCASECMP@ +GL_GNULIB_WCSNCAT = @GL_GNULIB_WCSNCAT@ +GL_GNULIB_WCSNCMP = @GL_GNULIB_WCSNCMP@ +GL_GNULIB_WCSNCPY = @GL_GNULIB_WCSNCPY@ +GL_GNULIB_WCSNLEN = @GL_GNULIB_WCSNLEN@ +GL_GNULIB_WCSNRTOMBS = @GL_GNULIB_WCSNRTOMBS@ +GL_GNULIB_WCSPBRK = @GL_GNULIB_WCSPBRK@ +GL_GNULIB_WCSRCHR = @GL_GNULIB_WCSRCHR@ +GL_GNULIB_WCSRTOMBS = @GL_GNULIB_WCSRTOMBS@ +GL_GNULIB_WCSSPN = @GL_GNULIB_WCSSPN@ +GL_GNULIB_WCSSTR = @GL_GNULIB_WCSSTR@ +GL_GNULIB_WCSTOK = @GL_GNULIB_WCSTOK@ +GL_GNULIB_WCSWIDTH = @GL_GNULIB_WCSWIDTH@ +GL_GNULIB_WCSXFRM = @GL_GNULIB_WCSXFRM@ +GL_GNULIB_WCTOB = @GL_GNULIB_WCTOB@ +GL_GNULIB_WCTOMB = @GL_GNULIB_WCTOMB@ +GL_GNULIB_WCTRANS = @GL_GNULIB_WCTRANS@ +GL_GNULIB_WCTYPE = @GL_GNULIB_WCTYPE@ +GL_GNULIB_WCWIDTH = @GL_GNULIB_WCWIDTH@ +GL_GNULIB_WMEMCHR = @GL_GNULIB_WMEMCHR@ +GL_GNULIB_WMEMCMP = @GL_GNULIB_WMEMCMP@ +GL_GNULIB_WMEMCPY = @GL_GNULIB_WMEMCPY@ +GL_GNULIB_WMEMMOVE = @GL_GNULIB_WMEMMOVE@ +GL_GNULIB_WMEMPCPY = @GL_GNULIB_WMEMPCPY@ +GL_GNULIB_WMEMSET = @GL_GNULIB_WMEMSET@ +GL_GNULIB_WRITE = @GL_GNULIB_WRITE@ +GL_GNULIB__EXIT = @GL_GNULIB__EXIT@ +GMSGFMT = @GMSGFMT@ +GMSGFMT_015 = @GMSGFMT_015@ +GNULIBHEADERS_OVERRIDE_WINT_T = @GNULIBHEADERS_OVERRIDE_WINT_T@ +GNULIB_GETTIMEOFDAY = @GNULIB_GETTIMEOFDAY@ +GREP = @GREP@ +HAVE_ACCEPT4 = @HAVE_ACCEPT4@ +HAVE_ACOSF = @HAVE_ACOSF@ +HAVE_ACOSL = @HAVE_ACOSL@ +HAVE_ALIGNED_ALLOC = @HAVE_ALIGNED_ALLOC@ +HAVE_ALLOCA_H = @HAVE_ALLOCA_H@ +HAVE_ARPA_INET_H = @HAVE_ARPA_INET_H@ +HAVE_ASINF = @HAVE_ASINF@ +HAVE_ASINL = @HAVE_ASINL@ +HAVE_ATAN2F = @HAVE_ATAN2F@ +HAVE_ATANF = @HAVE_ATANF@ +HAVE_ATANL = @HAVE_ATANL@ +HAVE_ATOLL = @HAVE_ATOLL@ +HAVE_BTOWC = @HAVE_BTOWC@ +HAVE_C99_STDINT_H = @HAVE_C99_STDINT_H@ +HAVE_CANONICALIZE_FILE_NAME = @HAVE_CANONICALIZE_FILE_NAME@ +HAVE_CBRT = @HAVE_CBRT@ +HAVE_CBRTF = @HAVE_CBRTF@ +HAVE_CBRTL = @HAVE_CBRTL@ +HAVE_CHOWN = @HAVE_CHOWN@ +HAVE_COPYSIGN = @HAVE_COPYSIGN@ +HAVE_COPYSIGNL = @HAVE_COPYSIGNL@ +HAVE_COPY_FILE_RANGE = @HAVE_COPY_FILE_RANGE@ +HAVE_COSF = @HAVE_COSF@ +HAVE_COSHF = @HAVE_COSHF@ +HAVE_COSL = @HAVE_COSL@ +HAVE_CRTDEFS_H = @HAVE_CRTDEFS_H@ +HAVE_DECL_ACOSL = @HAVE_DECL_ACOSL@ +HAVE_DECL_ASINL = @HAVE_DECL_ASINL@ +HAVE_DECL_ATANL = @HAVE_DECL_ATANL@ +HAVE_DECL_CBRTF = @HAVE_DECL_CBRTF@ +HAVE_DECL_CBRTL = @HAVE_DECL_CBRTL@ +HAVE_DECL_CEILF = @HAVE_DECL_CEILF@ +HAVE_DECL_CEILL = @HAVE_DECL_CEILL@ +HAVE_DECL_COPYSIGNF = @HAVE_DECL_COPYSIGNF@ +HAVE_DECL_COSL = @HAVE_DECL_COSL@ +HAVE_DECL_ECVT = @HAVE_DECL_ECVT@ +HAVE_DECL_ENVIRON = @HAVE_DECL_ENVIRON@ +HAVE_DECL_EXECVPE = @HAVE_DECL_EXECVPE@ +HAVE_DECL_EXP2 = @HAVE_DECL_EXP2@ +HAVE_DECL_EXP2F = @HAVE_DECL_EXP2F@ +HAVE_DECL_EXP2L = @HAVE_DECL_EXP2L@ +HAVE_DECL_EXPL = @HAVE_DECL_EXPL@ +HAVE_DECL_EXPM1L = @HAVE_DECL_EXPM1L@ +HAVE_DECL_FCHDIR = @HAVE_DECL_FCHDIR@ +HAVE_DECL_FCLOSEALL = @HAVE_DECL_FCLOSEALL@ +HAVE_DECL_FCVT = @HAVE_DECL_FCVT@ +HAVE_DECL_FDATASYNC = @HAVE_DECL_FDATASYNC@ +HAVE_DECL_FLOORF = @HAVE_DECL_FLOORF@ +HAVE_DECL_FLOORL = @HAVE_DECL_FLOORL@ +HAVE_DECL_FPURGE = @HAVE_DECL_FPURGE@ +HAVE_DECL_FREEADDRINFO = @HAVE_DECL_FREEADDRINFO@ +HAVE_DECL_FREXPL = @HAVE_DECL_FREXPL@ +HAVE_DECL_FSEEKO = @HAVE_DECL_FSEEKO@ +HAVE_DECL_FTELLO = @HAVE_DECL_FTELLO@ +HAVE_DECL_GAI_STRERROR = @HAVE_DECL_GAI_STRERROR@ +HAVE_DECL_GCVT = @HAVE_DECL_GCVT@ +HAVE_DECL_GETADDRINFO = @HAVE_DECL_GETADDRINFO@ +HAVE_DECL_GETDELIM = @HAVE_DECL_GETDELIM@ +HAVE_DECL_GETDOMAINNAME = @HAVE_DECL_GETDOMAINNAME@ +HAVE_DECL_GETLINE = @HAVE_DECL_GETLINE@ +HAVE_DECL_GETLOADAVG = @HAVE_DECL_GETLOADAVG@ +HAVE_DECL_GETLOGIN = @HAVE_DECL_GETLOGIN@ +HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@ +HAVE_DECL_GETNAMEINFO = @HAVE_DECL_GETNAMEINFO@ +HAVE_DECL_GETPAGESIZE = @HAVE_DECL_GETPAGESIZE@ +HAVE_DECL_GETUSERSHELL = @HAVE_DECL_GETUSERSHELL@ +HAVE_DECL_IMAXABS = @HAVE_DECL_IMAXABS@ +HAVE_DECL_IMAXDIV = @HAVE_DECL_IMAXDIV@ +HAVE_DECL_INET_NTOP = @HAVE_DECL_INET_NTOP@ +HAVE_DECL_INET_PTON = @HAVE_DECL_INET_PTON@ +HAVE_DECL_INITSTATE = @HAVE_DECL_INITSTATE@ +HAVE_DECL_LDEXPL = @HAVE_DECL_LDEXPL@ +HAVE_DECL_LOCALTIME_R = @HAVE_DECL_LOCALTIME_R@ +HAVE_DECL_LOG10L = @HAVE_DECL_LOG10L@ +HAVE_DECL_LOG2 = @HAVE_DECL_LOG2@ +HAVE_DECL_LOG2F = @HAVE_DECL_LOG2F@ +HAVE_DECL_LOG2L = @HAVE_DECL_LOG2L@ +HAVE_DECL_LOGB = @HAVE_DECL_LOGB@ +HAVE_DECL_LOGL = @HAVE_DECL_LOGL@ +HAVE_DECL_MEMMEM = @HAVE_DECL_MEMMEM@ +HAVE_DECL_MEMRCHR = @HAVE_DECL_MEMRCHR@ +HAVE_DECL_OBSTACK_PRINTF = @HAVE_DECL_OBSTACK_PRINTF@ +HAVE_DECL_REMAINDER = @HAVE_DECL_REMAINDER@ +HAVE_DECL_REMAINDERL = @HAVE_DECL_REMAINDERL@ +HAVE_DECL_RINTF = @HAVE_DECL_RINTF@ +HAVE_DECL_ROUND = @HAVE_DECL_ROUND@ +HAVE_DECL_ROUNDF = @HAVE_DECL_ROUNDF@ +HAVE_DECL_ROUNDL = @HAVE_DECL_ROUNDL@ +HAVE_DECL_SETENV = @HAVE_DECL_SETENV@ +HAVE_DECL_SETHOSTNAME = @HAVE_DECL_SETHOSTNAME@ +HAVE_DECL_SETSTATE = @HAVE_DECL_SETSTATE@ +HAVE_DECL_SINL = @HAVE_DECL_SINL@ +HAVE_DECL_SNPRINTF = @HAVE_DECL_SNPRINTF@ +HAVE_DECL_SQRTL = @HAVE_DECL_SQRTL@ +HAVE_DECL_STRDUP = @HAVE_DECL_STRDUP@ +HAVE_DECL_STRERROR_R = @HAVE_DECL_STRERROR_R@ +HAVE_DECL_STRNCASECMP = @HAVE_DECL_STRNCASECMP@ +HAVE_DECL_STRNDUP = @HAVE_DECL_STRNDUP@ +HAVE_DECL_STRNLEN = @HAVE_DECL_STRNLEN@ +HAVE_DECL_STRSIGNAL = @HAVE_DECL_STRSIGNAL@ +HAVE_DECL_STRTOIMAX = @HAVE_DECL_STRTOIMAX@ +HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@ +HAVE_DECL_STRTOUMAX = @HAVE_DECL_STRTOUMAX@ +HAVE_DECL_TANL = @HAVE_DECL_TANL@ +HAVE_DECL_TRUNC = @HAVE_DECL_TRUNC@ +HAVE_DECL_TRUNCATE = @HAVE_DECL_TRUNCATE@ +HAVE_DECL_TRUNCF = @HAVE_DECL_TRUNCF@ +HAVE_DECL_TRUNCL = @HAVE_DECL_TRUNCL@ +HAVE_DECL_TTYNAME_R = @HAVE_DECL_TTYNAME_R@ +HAVE_DECL_UNSETENV = @HAVE_DECL_UNSETENV@ +HAVE_DECL_VSNPRINTF = @HAVE_DECL_VSNPRINTF@ +HAVE_DECL_WCSDUP = @HAVE_DECL_WCSDUP@ +HAVE_DECL_WCTOB = @HAVE_DECL_WCTOB@ +HAVE_DECL_WCWIDTH = @HAVE_DECL_WCWIDTH@ +HAVE_DPRINTF = @HAVE_DPRINTF@ +HAVE_DUP3 = @HAVE_DUP3@ +HAVE_DUPLOCALE = @HAVE_DUPLOCALE@ +HAVE_EUIDACCESS = @HAVE_EUIDACCESS@ +HAVE_EXECVPE = @HAVE_EXECVPE@ +HAVE_EXPF = @HAVE_EXPF@ +HAVE_EXPL = @HAVE_EXPL@ +HAVE_EXPLICIT_BZERO = @HAVE_EXPLICIT_BZERO@ +HAVE_EXPM1 = @HAVE_EXPM1@ +HAVE_EXPM1F = @HAVE_EXPM1F@ +HAVE_FABSF = @HAVE_FABSF@ +HAVE_FABSL = @HAVE_FABSL@ +HAVE_FACCESSAT = @HAVE_FACCESSAT@ +HAVE_FCHDIR = @HAVE_FCHDIR@ +HAVE_FCHMODAT = @HAVE_FCHMODAT@ +HAVE_FCHOWNAT = @HAVE_FCHOWNAT@ +HAVE_FCNTL = @HAVE_FCNTL@ +HAVE_FDATASYNC = @HAVE_FDATASYNC@ +HAVE_FEATURES_H = @HAVE_FEATURES_H@ +HAVE_FFS = @HAVE_FFS@ +HAVE_FFSL = @HAVE_FFSL@ +HAVE_FFSLL = @HAVE_FFSLL@ +HAVE_FMA = @HAVE_FMA@ +HAVE_FMAF = @HAVE_FMAF@ +HAVE_FMAL = @HAVE_FMAL@ +HAVE_FMODF = @HAVE_FMODF@ +HAVE_FMODL = @HAVE_FMODL@ +HAVE_FREELOCALE = @HAVE_FREELOCALE@ +HAVE_FREXPF = @HAVE_FREXPF@ +HAVE_FSEEKO = @HAVE_FSEEKO@ +HAVE_FSTATAT = @HAVE_FSTATAT@ +HAVE_FSYNC = @HAVE_FSYNC@ +HAVE_FTELLO = @HAVE_FTELLO@ +HAVE_FTRUNCATE = @HAVE_FTRUNCATE@ +HAVE_FUTIMENS = @HAVE_FUTIMENS@ +HAVE_GETDTABLESIZE = @HAVE_GETDTABLESIZE@ +HAVE_GETENTROPY = @HAVE_GETENTROPY@ +HAVE_GETGROUPS = @HAVE_GETGROUPS@ +HAVE_GETHOSTNAME = @HAVE_GETHOSTNAME@ +HAVE_GETLOGIN = @HAVE_GETLOGIN@ +HAVE_GETOPT_H = @HAVE_GETOPT_H@ +HAVE_GETPAGESIZE = @HAVE_GETPAGESIZE@ +HAVE_GETPASS = @HAVE_GETPASS@ +HAVE_GETSUBOPT = @HAVE_GETSUBOPT@ +HAVE_GETUMASK = @HAVE_GETUMASK@ +HAVE_GRANTPT = @HAVE_GRANTPT@ +HAVE_GROUP_MEMBER = @HAVE_GROUP_MEMBER@ +HAVE_HYPOTF = @HAVE_HYPOTF@ +HAVE_HYPOTL = @HAVE_HYPOTL@ +HAVE_ILOGB = @HAVE_ILOGB@ +HAVE_ILOGBF = @HAVE_ILOGBF@ +HAVE_ILOGBL = @HAVE_ILOGBL@ +HAVE_IMAXDIV_T = @HAVE_IMAXDIV_T@ +HAVE_INITSTATE = @HAVE_INITSTATE@ +HAVE_INTTYPES_H = @HAVE_INTTYPES_H@ +HAVE_ISNAND = @HAVE_ISNAND@ +HAVE_ISNANF = @HAVE_ISNANF@ +HAVE_ISNANL = @HAVE_ISNANL@ +HAVE_ISWBLANK = @HAVE_ISWBLANK@ +HAVE_ISWCNTRL = @HAVE_ISWCNTRL@ +HAVE_LANGINFO_ALTMON = @HAVE_LANGINFO_ALTMON@ +HAVE_LANGINFO_CODESET = @HAVE_LANGINFO_CODESET@ +HAVE_LANGINFO_ERA = @HAVE_LANGINFO_ERA@ +HAVE_LANGINFO_H = @HAVE_LANGINFO_H@ +HAVE_LANGINFO_T_FMT_AMPM = @HAVE_LANGINFO_T_FMT_AMPM@ +HAVE_LANGINFO_YESEXPR = @HAVE_LANGINFO_YESEXPR@ +HAVE_LCHMOD = @HAVE_LCHMOD@ +HAVE_LCHOWN = @HAVE_LCHOWN@ +HAVE_LDEXPF = @HAVE_LDEXPF@ +HAVE_LINK = @HAVE_LINK@ +HAVE_LINKAT = @HAVE_LINKAT@ +HAVE_LOG10F = @HAVE_LOG10F@ +HAVE_LOG10L = @HAVE_LOG10L@ +HAVE_LOG1P = @HAVE_LOG1P@ +HAVE_LOG1PF = @HAVE_LOG1PF@ +HAVE_LOG1PL = @HAVE_LOG1PL@ +HAVE_LOGBF = @HAVE_LOGBF@ +HAVE_LOGBL = @HAVE_LOGBL@ +HAVE_LOGF = @HAVE_LOGF@ +HAVE_LOGL = @HAVE_LOGL@ +HAVE_LSTAT = @HAVE_LSTAT@ +HAVE_MAX_ALIGN_T = @HAVE_MAX_ALIGN_T@ +HAVE_MBRLEN = @HAVE_MBRLEN@ +HAVE_MBRTOWC = @HAVE_MBRTOWC@ +HAVE_MBSINIT = @HAVE_MBSINIT@ +HAVE_MBSLEN = @HAVE_MBSLEN@ +HAVE_MBSNRTOWCS = @HAVE_MBSNRTOWCS@ +HAVE_MBSRTOWCS = @HAVE_MBSRTOWCS@ +HAVE_MBTOWC = @HAVE_MBTOWC@ +HAVE_MEMPCPY = @HAVE_MEMPCPY@ +HAVE_MEMSET_EXPLICIT = @HAVE_MEMSET_EXPLICIT@ +HAVE_MKDIRAT = @HAVE_MKDIRAT@ +HAVE_MKDTEMP = @HAVE_MKDTEMP@ +HAVE_MKFIFO = @HAVE_MKFIFO@ +HAVE_MKFIFOAT = @HAVE_MKFIFOAT@ +HAVE_MKNOD = @HAVE_MKNOD@ +HAVE_MKNODAT = @HAVE_MKNODAT@ +HAVE_MKOSTEMP = @HAVE_MKOSTEMP@ +HAVE_MKOSTEMPS = @HAVE_MKOSTEMPS@ +HAVE_MKSTEMP = @HAVE_MKSTEMP@ +HAVE_MKSTEMPS = @HAVE_MKSTEMPS@ +HAVE_MODFF = @HAVE_MODFF@ +HAVE_MODFL = @HAVE_MODFL@ +HAVE_MSVC_INVALID_PARAMETER_HANDLER = @HAVE_MSVC_INVALID_PARAMETER_HANDLER@ +HAVE_NANOSLEEP = @HAVE_NANOSLEEP@ +HAVE_NETDB_H = @HAVE_NETDB_H@ +HAVE_NETINET_IN_H = @HAVE_NETINET_IN_H@ +HAVE_NEWLOCALE = @HAVE_NEWLOCALE@ +HAVE_NL_LANGINFO = @HAVE_NL_LANGINFO@ +HAVE_OPENAT = @HAVE_OPENAT@ +HAVE_OS_H = @HAVE_OS_H@ +HAVE_PCLOSE = @HAVE_PCLOSE@ +HAVE_PIPE = @HAVE_PIPE@ +HAVE_PIPE2 = @HAVE_PIPE2@ +HAVE_POPEN = @HAVE_POPEN@ +HAVE_POSIX_MEMALIGN = @HAVE_POSIX_MEMALIGN@ +HAVE_POSIX_OPENPT = @HAVE_POSIX_OPENPT@ +HAVE_POWF = @HAVE_POWF@ +HAVE_PREAD = @HAVE_PREAD@ +HAVE_PTSNAME = @HAVE_PTSNAME@ +HAVE_PTSNAME_R = @HAVE_PTSNAME_R@ +HAVE_PWRITE = @HAVE_PWRITE@ +HAVE_QSORT_R = @HAVE_QSORT_R@ +HAVE_RANDOM = @HAVE_RANDOM@ +HAVE_RANDOM_H = @HAVE_RANDOM_H@ +HAVE_RANDOM_R = @HAVE_RANDOM_R@ +HAVE_RAWMEMCHR = @HAVE_RAWMEMCHR@ +HAVE_READLINK = @HAVE_READLINK@ +HAVE_READLINKAT = @HAVE_READLINKAT@ +HAVE_REALLOCARRAY = @HAVE_REALLOCARRAY@ +HAVE_REALPATH = @HAVE_REALPATH@ +HAVE_REMAINDER = @HAVE_REMAINDER@ +HAVE_REMAINDERF = @HAVE_REMAINDERF@ +HAVE_RENAMEAT = @HAVE_RENAMEAT@ +HAVE_RINT = @HAVE_RINT@ +HAVE_RINTL = @HAVE_RINTL@ +HAVE_RPMATCH = @HAVE_RPMATCH@ +HAVE_SA_FAMILY_T = @HAVE_SA_FAMILY_T@ +HAVE_SECURE_GETENV = @HAVE_SECURE_GETENV@ +HAVE_SETENV = @HAVE_SETENV@ +HAVE_SETHOSTNAME = @HAVE_SETHOSTNAME@ +HAVE_SETSTATE = @HAVE_SETSTATE@ +HAVE_SIGABBREV_NP = @HAVE_SIGABBREV_NP@ +HAVE_SIGDESCR_NP = @HAVE_SIGDESCR_NP@ +HAVE_SIGNED_SIG_ATOMIC_T = @HAVE_SIGNED_SIG_ATOMIC_T@ +HAVE_SIGNED_WCHAR_T = @HAVE_SIGNED_WCHAR_T@ +HAVE_SIGNED_WINT_T = @HAVE_SIGNED_WINT_T@ +HAVE_SINF = @HAVE_SINF@ +HAVE_SINHF = @HAVE_SINHF@ +HAVE_SINL = @HAVE_SINL@ +HAVE_SLEEP = @HAVE_SLEEP@ +HAVE_SQRTF = @HAVE_SQRTF@ +HAVE_SQRTL = @HAVE_SQRTL@ +HAVE_STDINT_H = @HAVE_STDINT_H@ +HAVE_STPCPY = @HAVE_STPCPY@ +HAVE_STPNCPY = @HAVE_STPNCPY@ +HAVE_STRCASECMP = @HAVE_STRCASECMP@ +HAVE_STRCASESTR = @HAVE_STRCASESTR@ +HAVE_STRCHRNUL = @HAVE_STRCHRNUL@ +HAVE_STRERRORNAME_NP = @HAVE_STRERRORNAME_NP@ +HAVE_STRINGS_H = @HAVE_STRINGS_H@ +HAVE_STRPBRK = @HAVE_STRPBRK@ +HAVE_STRPTIME = @HAVE_STRPTIME@ +HAVE_STRSEP = @HAVE_STRSEP@ +HAVE_STRTOD = @HAVE_STRTOD@ +HAVE_STRTOL = @HAVE_STRTOL@ +HAVE_STRTOLD = @HAVE_STRTOLD@ +HAVE_STRTOLL = @HAVE_STRTOLL@ +HAVE_STRTOUL = @HAVE_STRTOUL@ +HAVE_STRTOULL = @HAVE_STRTOULL@ +HAVE_STRUCT_ADDRINFO = @HAVE_STRUCT_ADDRINFO@ +HAVE_STRUCT_RANDOM_DATA = @HAVE_STRUCT_RANDOM_DATA@ +HAVE_STRUCT_SOCKADDR_STORAGE = @HAVE_STRUCT_SOCKADDR_STORAGE@ +HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY = @HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY@ +HAVE_STRVERSCMP = @HAVE_STRVERSCMP@ +HAVE_SYMLINK = @HAVE_SYMLINK@ +HAVE_SYMLINKAT = @HAVE_SYMLINKAT@ +HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@ +HAVE_SYS_CDEFS_H = @HAVE_SYS_CDEFS_H@ +HAVE_SYS_INTTYPES_H = @HAVE_SYS_INTTYPES_H@ +HAVE_SYS_LOADAVG_H = @HAVE_SYS_LOADAVG_H@ +HAVE_SYS_PARAM_H = @HAVE_SYS_PARAM_H@ +HAVE_SYS_SOCKET_H = @HAVE_SYS_SOCKET_H@ +HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@ +HAVE_SYS_UIO_H = @HAVE_SYS_UIO_H@ +HAVE_TANF = @HAVE_TANF@ +HAVE_TANHF = @HAVE_TANHF@ +HAVE_TANL = @HAVE_TANL@ +HAVE_TIMEGM = @HAVE_TIMEGM@ +HAVE_TIMESPEC_GET = @HAVE_TIMESPEC_GET@ +HAVE_TIMESPEC_GETRES = @HAVE_TIMESPEC_GETRES@ +HAVE_TIMEZONE_T = @HAVE_TIMEZONE_T@ +HAVE_UNISTD_H = @HAVE_UNISTD_H@ +HAVE_UNLINKAT = @HAVE_UNLINKAT@ +HAVE_UNLOCKPT = @HAVE_UNLOCKPT@ +HAVE_USLEEP = @HAVE_USLEEP@ +HAVE_UTIMENSAT = @HAVE_UTIMENSAT@ +HAVE_VASPRINTF = @HAVE_VASPRINTF@ +HAVE_VDPRINTF = @HAVE_VDPRINTF@ +HAVE_VISIBILITY = @HAVE_VISIBILITY@ +HAVE_WCHAR_H = @HAVE_WCHAR_H@ +HAVE_WCHAR_T = @HAVE_WCHAR_T@ +HAVE_WCPCPY = @HAVE_WCPCPY@ +HAVE_WCPNCPY = @HAVE_WCPNCPY@ +HAVE_WCRTOMB = @HAVE_WCRTOMB@ +HAVE_WCSCASECMP = @HAVE_WCSCASECMP@ +HAVE_WCSCAT = @HAVE_WCSCAT@ +HAVE_WCSCHR = @HAVE_WCSCHR@ +HAVE_WCSCMP = @HAVE_WCSCMP@ +HAVE_WCSCOLL = @HAVE_WCSCOLL@ +HAVE_WCSCPY = @HAVE_WCSCPY@ +HAVE_WCSCSPN = @HAVE_WCSCSPN@ +HAVE_WCSDUP = @HAVE_WCSDUP@ +HAVE_WCSFTIME = @HAVE_WCSFTIME@ +HAVE_WCSLEN = @HAVE_WCSLEN@ +HAVE_WCSNCASECMP = @HAVE_WCSNCASECMP@ +HAVE_WCSNCAT = @HAVE_WCSNCAT@ +HAVE_WCSNCMP = @HAVE_WCSNCMP@ +HAVE_WCSNCPY = @HAVE_WCSNCPY@ +HAVE_WCSNLEN = @HAVE_WCSNLEN@ +HAVE_WCSNRTOMBS = @HAVE_WCSNRTOMBS@ +HAVE_WCSPBRK = @HAVE_WCSPBRK@ +HAVE_WCSRCHR = @HAVE_WCSRCHR@ +HAVE_WCSRTOMBS = @HAVE_WCSRTOMBS@ +HAVE_WCSSPN = @HAVE_WCSSPN@ +HAVE_WCSSTR = @HAVE_WCSSTR@ +HAVE_WCSTOK = @HAVE_WCSTOK@ +HAVE_WCSWIDTH = @HAVE_WCSWIDTH@ +HAVE_WCSXFRM = @HAVE_WCSXFRM@ +HAVE_WCTRANS_T = @HAVE_WCTRANS_T@ +HAVE_WCTYPE_H = @HAVE_WCTYPE_H@ +HAVE_WCTYPE_T = @HAVE_WCTYPE_T@ +HAVE_WINSOCK2_H = @HAVE_WINSOCK2_H@ +HAVE_WINT_T = @HAVE_WINT_T@ +HAVE_WMEMCHR = @HAVE_WMEMCHR@ +HAVE_WMEMCMP = @HAVE_WMEMCMP@ +HAVE_WMEMCPY = @HAVE_WMEMCPY@ +HAVE_WMEMMOVE = @HAVE_WMEMMOVE@ +HAVE_WMEMPCPY = @HAVE_WMEMPCPY@ +HAVE_WMEMSET = @HAVE_WMEMSET@ +HAVE_WS2TCPIP_H = @HAVE_WS2TCPIP_H@ +HAVE_XLOCALE_H = @HAVE_XLOCALE_H@ +HAVE__EXIT = @HAVE__EXIT@ +HOSTENT_LIB = @HOSTENT_LIB@ +HOSTNAME = @HOSTNAME@ +INCLUDE_NEXT = @INCLUDE_NEXT@ +INCLUDE_NEXT_AS_FIRST_DIRECTIVE = @INCLUDE_NEXT_AS_FIRST_DIRECTIVE@ +INET_NTOP_LIB = @INET_NTOP_LIB@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INT32_MAX_LT_INTMAX_MAX = @INT32_MAX_LT_INTMAX_MAX@ +INT64_MAX_EQ_LONG_MAX = @INT64_MAX_EQ_LONG_MAX@ +INTLLIBS = @INTLLIBS@ +INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ +KRBINCLUDE = @KRBINCLUDE@ +LD = @LD@ +LDAPINCLUDE = @LDAPINCLUDE@ +LDAPLIBS = @LDAPLIBS@ +LDFLAGS = @LDFLAGS@ +LIBCURL = @LIBCURL@ +LIBCURLCFLAGS = @LIBCURLCFLAGS@ +LIBCURLINCLUDE = @LIBCURLINCLUDE@ +LIBCURLLIBS = @LIBCURLLIBS@ +LIBCURL_CPPFLAGS = @LIBCURL_CPPFLAGS@ +LIBGNU_LIBDEPS = @LIBGNU_LIBDEPS@ +LIBGNU_LTLIBDEPS = @LIBGNU_LTLIBDEPS@ +LIBICONV = @LIBICONV@ +LIBINTL = @LIBINTL@ +LIBMULTITHREAD = @LIBMULTITHREAD@ +LIBOBJS = @LIBOBJS@ +LIBPMULTITHREAD = @LIBPMULTITHREAD@ +LIBPTHREAD = @LIBPTHREAD@ +LIBS = @LIBS@ +LIBSOCKET = @LIBSOCKET@ +LIBSTDTHREAD = @LIBSTDTHREAD@ +LIBTHREAD = @LIBTHREAD@ +LIBTOOL = @LIBTOOL@ +LIB_CRYPTO = @LIB_CRYPTO@ +LIB_HARD_LOCALE = @LIB_HARD_LOCALE@ +LIB_MBRTOWC = @LIB_MBRTOWC@ +LIB_NL_LANGINFO = @LIB_NL_LANGINFO@ +LIB_SCHED_YIELD = @LIB_SCHED_YIELD@ +LIB_SETLOCALE_NULL = @LIB_SETLOCALE_NULL@ +LIMITS_H = @LIMITS_H@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LOCALCHARSET_TESTS_ENVIRONMENT = @LOCALCHARSET_TESTS_ENVIRONMENT@ +LOCALENAME_ENHANCE_LOCALE_FUNCS = @LOCALENAME_ENHANCE_LOCALE_FUNCS@ +LOCALE_FR = @LOCALE_FR@ +LOCALE_FR_UTF8 = @LOCALE_FR_UTF8@ +LOCALE_JA = @LOCALE_JA@ +LOCALE_ZH_CN = @LOCALE_ZH_CN@ +LTLIBICONV = @LTLIBICONV@ +LTLIBINTL = @LTLIBINTL@ +LTLIBMULTITHREAD = @LTLIBMULTITHREAD@ +LTLIBOBJS = @LTLIBOBJS@ +LTLIBTHREAD = @LTLIBTHREAD@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MATHLIBS = @MATHLIBS@ +MKDIR_P = @MKDIR_P@ +MSGFMT = @MSGFMT@ +MSGMERGE = @MSGMERGE@ +MSGMERGE_FOR_MSGFMT_OPTION = @MSGMERGE_FOR_MSGFMT_OPTION@ +MYSQLCFLAGS = @MYSQLCFLAGS@ +MYSQLINCLUDE = @MYSQLINCLUDE@ +MYSQLLIBS = @MYSQLLIBS@ +NETINET_IN_H = @NETINET_IN_H@ +NEXT_ARPA_INET_H = @NEXT_ARPA_INET_H@ +NEXT_ASSERT_H = @NEXT_ASSERT_H@ +NEXT_AS_FIRST_DIRECTIVE_ARPA_INET_H = @NEXT_AS_FIRST_DIRECTIVE_ARPA_INET_H@ +NEXT_AS_FIRST_DIRECTIVE_ASSERT_H = @NEXT_AS_FIRST_DIRECTIVE_ASSERT_H@ +NEXT_AS_FIRST_DIRECTIVE_ERRNO_H = @NEXT_AS_FIRST_DIRECTIVE_ERRNO_H@ +NEXT_AS_FIRST_DIRECTIVE_FCNTL_H = @NEXT_AS_FIRST_DIRECTIVE_FCNTL_H@ +NEXT_AS_FIRST_DIRECTIVE_FLOAT_H = @NEXT_AS_FIRST_DIRECTIVE_FLOAT_H@ +NEXT_AS_FIRST_DIRECTIVE_GETOPT_H = @NEXT_AS_FIRST_DIRECTIVE_GETOPT_H@ +NEXT_AS_FIRST_DIRECTIVE_INTTYPES_H = @NEXT_AS_FIRST_DIRECTIVE_INTTYPES_H@ +NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H = @NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H@ +NEXT_AS_FIRST_DIRECTIVE_LIMITS_H = @NEXT_AS_FIRST_DIRECTIVE_LIMITS_H@ +NEXT_AS_FIRST_DIRECTIVE_LOCALE_H = @NEXT_AS_FIRST_DIRECTIVE_LOCALE_H@ +NEXT_AS_FIRST_DIRECTIVE_MATH_H = @NEXT_AS_FIRST_DIRECTIVE_MATH_H@ +NEXT_AS_FIRST_DIRECTIVE_NETDB_H = @NEXT_AS_FIRST_DIRECTIVE_NETDB_H@ +NEXT_AS_FIRST_DIRECTIVE_NETINET_IN_H = @NEXT_AS_FIRST_DIRECTIVE_NETINET_IN_H@ +NEXT_AS_FIRST_DIRECTIVE_STDDEF_H = @NEXT_AS_FIRST_DIRECTIVE_STDDEF_H@ +NEXT_AS_FIRST_DIRECTIVE_STDINT_H = @NEXT_AS_FIRST_DIRECTIVE_STDINT_H@ +NEXT_AS_FIRST_DIRECTIVE_STDIO_H = @NEXT_AS_FIRST_DIRECTIVE_STDIO_H@ +NEXT_AS_FIRST_DIRECTIVE_STDLIB_H = @NEXT_AS_FIRST_DIRECTIVE_STDLIB_H@ +NEXT_AS_FIRST_DIRECTIVE_STRINGS_H = @NEXT_AS_FIRST_DIRECTIVE_STRINGS_H@ +NEXT_AS_FIRST_DIRECTIVE_STRING_H = @NEXT_AS_FIRST_DIRECTIVE_STRING_H@ +NEXT_AS_FIRST_DIRECTIVE_SYS_SOCKET_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_SOCKET_H@ +NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H@ +NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H@ +NEXT_AS_FIRST_DIRECTIVE_SYS_UIO_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_UIO_H@ +NEXT_AS_FIRST_DIRECTIVE_TIME_H = @NEXT_AS_FIRST_DIRECTIVE_TIME_H@ +NEXT_AS_FIRST_DIRECTIVE_UNISTD_H = @NEXT_AS_FIRST_DIRECTIVE_UNISTD_H@ +NEXT_AS_FIRST_DIRECTIVE_WCHAR_H = @NEXT_AS_FIRST_DIRECTIVE_WCHAR_H@ +NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H = @NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H@ +NEXT_ERRNO_H = @NEXT_ERRNO_H@ +NEXT_FCNTL_H = @NEXT_FCNTL_H@ +NEXT_FLOAT_H = @NEXT_FLOAT_H@ +NEXT_GETOPT_H = @NEXT_GETOPT_H@ +NEXT_INTTYPES_H = @NEXT_INTTYPES_H@ +NEXT_LANGINFO_H = @NEXT_LANGINFO_H@ +NEXT_LIMITS_H = @NEXT_LIMITS_H@ +NEXT_LOCALE_H = @NEXT_LOCALE_H@ +NEXT_MATH_H = @NEXT_MATH_H@ +NEXT_NETDB_H = @NEXT_NETDB_H@ +NEXT_NETINET_IN_H = @NEXT_NETINET_IN_H@ +NEXT_STDDEF_H = @NEXT_STDDEF_H@ +NEXT_STDINT_H = @NEXT_STDINT_H@ +NEXT_STDIO_H = @NEXT_STDIO_H@ +NEXT_STDLIB_H = @NEXT_STDLIB_H@ +NEXT_STRINGS_H = @NEXT_STRINGS_H@ +NEXT_STRING_H = @NEXT_STRING_H@ +NEXT_SYS_SOCKET_H = @NEXT_SYS_SOCKET_H@ +NEXT_SYS_STAT_H = @NEXT_SYS_STAT_H@ +NEXT_SYS_TYPES_H = @NEXT_SYS_TYPES_H@ +NEXT_SYS_UIO_H = @NEXT_SYS_UIO_H@ +NEXT_TIME_H = @NEXT_TIME_H@ +NEXT_UNISTD_H = @NEXT_UNISTD_H@ +NEXT_WCHAR_H = @NEXT_WCHAR_H@ +NEXT_WCTYPE_H = @NEXT_WCTYPE_H@ +NM = @NM@ +NMEDIT = @NMEDIT@ +NP_RELEASE = @NP_RELEASE@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PATH_TO_APTGET = @PATH_TO_APTGET@ +PATH_TO_DIG = @PATH_TO_DIG@ +PATH_TO_ENV = @PATH_TO_ENV@ +PATH_TO_FPING = @PATH_TO_FPING@ +PATH_TO_FPING6 = @PATH_TO_FPING6@ +PATH_TO_LMSTAT = @PATH_TO_LMSTAT@ +PATH_TO_LSPS = @PATH_TO_LSPS@ +PATH_TO_MAILQ = @PATH_TO_MAILQ@ +PATH_TO_NSLOOKUP = @PATH_TO_NSLOOKUP@ +PATH_TO_PING = @PATH_TO_PING@ +PATH_TO_PING6 = @PATH_TO_PING6@ +PATH_TO_PS = @PATH_TO_PS@ +PATH_TO_QMAIL_QSTAT = @PATH_TO_QMAIL_QSTAT@ +PATH_TO_QSTAT = @PATH_TO_QSTAT@ +PATH_TO_QUAKESTAT = @PATH_TO_QUAKESTAT@ +PATH_TO_RPCINFO = @PATH_TO_RPCINFO@ +PATH_TO_SMBCLIENT = @PATH_TO_SMBCLIENT@ +PATH_TO_SNMPGET = @PATH_TO_SNMPGET@ +PATH_TO_SNMPGETNEXT = @PATH_TO_SNMPGETNEXT@ +PATH_TO_SSH = @PATH_TO_SSH@ +PATH_TO_SUDO = @PATH_TO_SUDO@ +PATH_TO_SWAP = @PATH_TO_SWAP@ +PATH_TO_SWAPINFO = @PATH_TO_SWAPINFO@ +PATH_TO_UPTIME = @PATH_TO_UPTIME@ +PATH_TO_WHO = @PATH_TO_WHO@ +PERL = @PERL@ +PERLMODS_DIR = @PERLMODS_DIR@ +PGINCLUDE = @PGINCLUDE@ +PGLIBS = @PGLIBS@ +PKGCONFIG = @PKGCONFIG@ +PKG_ARCH = @PKG_ARCH@ +PLUGIN_TEST = @PLUGIN_TEST@ +POSUB = @POSUB@ +POW_LIB = @POW_LIB@ +PRAGMA_COLUMNS = @PRAGMA_COLUMNS@ +PRAGMA_SYSTEM_HEADER = @PRAGMA_SYSTEM_HEADER@ +PRIPTR_PREFIX = @PRIPTR_PREFIX@ +PST3CFLAGS = @PST3CFLAGS@ +PTHREAD_H_DEFINES_STRUCT_TIMESPEC = @PTHREAD_H_DEFINES_STRUCT_TIMESPEC@ +PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@ +RADIUSLIBS = @RADIUSLIBS@ +RANLIB = @RANLIB@ +RELEASE = @RELEASE@ +REPLACE_ACCESS = @REPLACE_ACCESS@ +REPLACE_ACOSF = @REPLACE_ACOSF@ +REPLACE_ALIGNED_ALLOC = @REPLACE_ALIGNED_ALLOC@ +REPLACE_ASINF = @REPLACE_ASINF@ +REPLACE_ATAN2F = @REPLACE_ATAN2F@ +REPLACE_ATANF = @REPLACE_ATANF@ +REPLACE_BTOWC = @REPLACE_BTOWC@ +REPLACE_CALLOC_FOR_CALLOC_GNU = @REPLACE_CALLOC_FOR_CALLOC_GNU@ +REPLACE_CALLOC_FOR_CALLOC_POSIX = @REPLACE_CALLOC_FOR_CALLOC_POSIX@ +REPLACE_CANONICALIZE_FILE_NAME = @REPLACE_CANONICALIZE_FILE_NAME@ +REPLACE_CBRTF = @REPLACE_CBRTF@ +REPLACE_CBRTL = @REPLACE_CBRTL@ +REPLACE_CEIL = @REPLACE_CEIL@ +REPLACE_CEILF = @REPLACE_CEILF@ +REPLACE_CEILL = @REPLACE_CEILL@ +REPLACE_CHMOD = @REPLACE_CHMOD@ +REPLACE_CHOWN = @REPLACE_CHOWN@ +REPLACE_CLOSE = @REPLACE_CLOSE@ +REPLACE_COPY_FILE_RANGE = @REPLACE_COPY_FILE_RANGE@ +REPLACE_COSF = @REPLACE_COSF@ +REPLACE_COSHF = @REPLACE_COSHF@ +REPLACE_CREAT = @REPLACE_CREAT@ +REPLACE_CTIME = @REPLACE_CTIME@ +REPLACE_DPRINTF = @REPLACE_DPRINTF@ +REPLACE_DUP = @REPLACE_DUP@ +REPLACE_DUP2 = @REPLACE_DUP2@ +REPLACE_DUPLOCALE = @REPLACE_DUPLOCALE@ +REPLACE_EXECL = @REPLACE_EXECL@ +REPLACE_EXECLE = @REPLACE_EXECLE@ +REPLACE_EXECLP = @REPLACE_EXECLP@ +REPLACE_EXECV = @REPLACE_EXECV@ +REPLACE_EXECVE = @REPLACE_EXECVE@ +REPLACE_EXECVP = @REPLACE_EXECVP@ +REPLACE_EXECVPE = @REPLACE_EXECVPE@ +REPLACE_EXP2 = @REPLACE_EXP2@ +REPLACE_EXP2L = @REPLACE_EXP2L@ +REPLACE_EXPF = @REPLACE_EXPF@ +REPLACE_EXPL = @REPLACE_EXPL@ +REPLACE_EXPM1 = @REPLACE_EXPM1@ +REPLACE_EXPM1F = @REPLACE_EXPM1F@ +REPLACE_EXPM1L = @REPLACE_EXPM1L@ +REPLACE_FABSL = @REPLACE_FABSL@ +REPLACE_FACCESSAT = @REPLACE_FACCESSAT@ +REPLACE_FCHMODAT = @REPLACE_FCHMODAT@ +REPLACE_FCHOWNAT = @REPLACE_FCHOWNAT@ +REPLACE_FCLOSE = @REPLACE_FCLOSE@ +REPLACE_FCNTL = @REPLACE_FCNTL@ +REPLACE_FDOPEN = @REPLACE_FDOPEN@ +REPLACE_FFLUSH = @REPLACE_FFLUSH@ +REPLACE_FFSLL = @REPLACE_FFSLL@ +REPLACE_FLOOR = @REPLACE_FLOOR@ +REPLACE_FLOORF = @REPLACE_FLOORF@ +REPLACE_FLOORL = @REPLACE_FLOORL@ +REPLACE_FMA = @REPLACE_FMA@ +REPLACE_FMAF = @REPLACE_FMAF@ +REPLACE_FMAL = @REPLACE_FMAL@ +REPLACE_FMOD = @REPLACE_FMOD@ +REPLACE_FMODF = @REPLACE_FMODF@ +REPLACE_FMODL = @REPLACE_FMODL@ +REPLACE_FOPEN = @REPLACE_FOPEN@ +REPLACE_FOPEN_FOR_FOPEN_GNU = @REPLACE_FOPEN_FOR_FOPEN_GNU@ +REPLACE_FPRINTF = @REPLACE_FPRINTF@ +REPLACE_FPURGE = @REPLACE_FPURGE@ +REPLACE_FREE = @REPLACE_FREE@ +REPLACE_FREELOCALE = @REPLACE_FREELOCALE@ +REPLACE_FREOPEN = @REPLACE_FREOPEN@ +REPLACE_FREXP = @REPLACE_FREXP@ +REPLACE_FREXPF = @REPLACE_FREXPF@ +REPLACE_FREXPL = @REPLACE_FREXPL@ +REPLACE_FSEEK = @REPLACE_FSEEK@ +REPLACE_FSEEKO = @REPLACE_FSEEKO@ +REPLACE_FSTAT = @REPLACE_FSTAT@ +REPLACE_FSTATAT = @REPLACE_FSTATAT@ +REPLACE_FTELL = @REPLACE_FTELL@ +REPLACE_FTELLO = @REPLACE_FTELLO@ +REPLACE_FTRUNCATE = @REPLACE_FTRUNCATE@ +REPLACE_FUTIMENS = @REPLACE_FUTIMENS@ +REPLACE_GAI_STRERROR = @REPLACE_GAI_STRERROR@ +REPLACE_GETADDRINFO = @REPLACE_GETADDRINFO@ +REPLACE_GETCWD = @REPLACE_GETCWD@ +REPLACE_GETDELIM = @REPLACE_GETDELIM@ +REPLACE_GETDOMAINNAME = @REPLACE_GETDOMAINNAME@ +REPLACE_GETDTABLESIZE = @REPLACE_GETDTABLESIZE@ +REPLACE_GETGROUPS = @REPLACE_GETGROUPS@ +REPLACE_GETLINE = @REPLACE_GETLINE@ +REPLACE_GETLOGIN_R = @REPLACE_GETLOGIN_R@ +REPLACE_GETPAGESIZE = @REPLACE_GETPAGESIZE@ +REPLACE_GETPASS = @REPLACE_GETPASS@ +REPLACE_GETPASS_FOR_GETPASS_GNU = @REPLACE_GETPASS_FOR_GETPASS_GNU@ +REPLACE_GMTIME = @REPLACE_GMTIME@ +REPLACE_HUGE_VAL = @REPLACE_HUGE_VAL@ +REPLACE_HYPOT = @REPLACE_HYPOT@ +REPLACE_HYPOTF = @REPLACE_HYPOTF@ +REPLACE_HYPOTL = @REPLACE_HYPOTL@ +REPLACE_ILOGB = @REPLACE_ILOGB@ +REPLACE_ILOGBF = @REPLACE_ILOGBF@ +REPLACE_ILOGBL = @REPLACE_ILOGBL@ +REPLACE_INET_NTOP = @REPLACE_INET_NTOP@ +REPLACE_INET_PTON = @REPLACE_INET_PTON@ +REPLACE_INITSTATE = @REPLACE_INITSTATE@ +REPLACE_ISATTY = @REPLACE_ISATTY@ +REPLACE_ISFINITE = @REPLACE_ISFINITE@ +REPLACE_ISINF = @REPLACE_ISINF@ +REPLACE_ISNAN = @REPLACE_ISNAN@ +REPLACE_ISWBLANK = @REPLACE_ISWBLANK@ +REPLACE_ISWCNTRL = @REPLACE_ISWCNTRL@ +REPLACE_ISWDIGIT = @REPLACE_ISWDIGIT@ +REPLACE_ISWXDIGIT = @REPLACE_ISWXDIGIT@ +REPLACE_ITOLD = @REPLACE_ITOLD@ +REPLACE_LCHOWN = @REPLACE_LCHOWN@ +REPLACE_LDEXPL = @REPLACE_LDEXPL@ +REPLACE_LINK = @REPLACE_LINK@ +REPLACE_LINKAT = @REPLACE_LINKAT@ +REPLACE_LOCALECONV = @REPLACE_LOCALECONV@ +REPLACE_LOCALTIME = @REPLACE_LOCALTIME@ +REPLACE_LOCALTIME_R = @REPLACE_LOCALTIME_R@ +REPLACE_LOG = @REPLACE_LOG@ +REPLACE_LOG10 = @REPLACE_LOG10@ +REPLACE_LOG10F = @REPLACE_LOG10F@ +REPLACE_LOG10L = @REPLACE_LOG10L@ +REPLACE_LOG1P = @REPLACE_LOG1P@ +REPLACE_LOG1PF = @REPLACE_LOG1PF@ +REPLACE_LOG1PL = @REPLACE_LOG1PL@ +REPLACE_LOG2 = @REPLACE_LOG2@ +REPLACE_LOG2F = @REPLACE_LOG2F@ +REPLACE_LOG2L = @REPLACE_LOG2L@ +REPLACE_LOGB = @REPLACE_LOGB@ +REPLACE_LOGBF = @REPLACE_LOGBF@ +REPLACE_LOGBL = @REPLACE_LOGBL@ +REPLACE_LOGF = @REPLACE_LOGF@ +REPLACE_LOGL = @REPLACE_LOGL@ +REPLACE_LSEEK = @REPLACE_LSEEK@ +REPLACE_LSTAT = @REPLACE_LSTAT@ +REPLACE_MALLOC_FOR_MALLOC_GNU = @REPLACE_MALLOC_FOR_MALLOC_GNU@ +REPLACE_MALLOC_FOR_MALLOC_POSIX = @REPLACE_MALLOC_FOR_MALLOC_POSIX@ +REPLACE_MBRLEN = @REPLACE_MBRLEN@ +REPLACE_MBRTOWC = @REPLACE_MBRTOWC@ +REPLACE_MBSINIT = @REPLACE_MBSINIT@ +REPLACE_MBSNRTOWCS = @REPLACE_MBSNRTOWCS@ +REPLACE_MBSRTOWCS = @REPLACE_MBSRTOWCS@ +REPLACE_MBSTATE_T = @REPLACE_MBSTATE_T@ +REPLACE_MBTOWC = @REPLACE_MBTOWC@ +REPLACE_MEMCHR = @REPLACE_MEMCHR@ +REPLACE_MEMMEM = @REPLACE_MEMMEM@ +REPLACE_MKDIR = @REPLACE_MKDIR@ +REPLACE_MKFIFO = @REPLACE_MKFIFO@ +REPLACE_MKFIFOAT = @REPLACE_MKFIFOAT@ +REPLACE_MKNOD = @REPLACE_MKNOD@ +REPLACE_MKNODAT = @REPLACE_MKNODAT@ +REPLACE_MKSTEMP = @REPLACE_MKSTEMP@ +REPLACE_MKTIME = @REPLACE_MKTIME@ +REPLACE_MODF = @REPLACE_MODF@ +REPLACE_MODFF = @REPLACE_MODFF@ +REPLACE_MODFL = @REPLACE_MODFL@ +REPLACE_NAN = @REPLACE_NAN@ +REPLACE_NANOSLEEP = @REPLACE_NANOSLEEP@ +REPLACE_NEWLOCALE = @REPLACE_NEWLOCALE@ +REPLACE_NL_LANGINFO = @REPLACE_NL_LANGINFO@ +REPLACE_NULL = @REPLACE_NULL@ +REPLACE_OBSTACK_PRINTF = @REPLACE_OBSTACK_PRINTF@ +REPLACE_OPEN = @REPLACE_OPEN@ +REPLACE_OPENAT = @REPLACE_OPENAT@ +REPLACE_PERROR = @REPLACE_PERROR@ +REPLACE_POPEN = @REPLACE_POPEN@ +REPLACE_POSIX_MEMALIGN = @REPLACE_POSIX_MEMALIGN@ +REPLACE_PREAD = @REPLACE_PREAD@ +REPLACE_PRINTF = @REPLACE_PRINTF@ +REPLACE_PTSNAME = @REPLACE_PTSNAME@ +REPLACE_PTSNAME_R = @REPLACE_PTSNAME_R@ +REPLACE_PUTENV = @REPLACE_PUTENV@ +REPLACE_PWRITE = @REPLACE_PWRITE@ +REPLACE_QSORT_R = @REPLACE_QSORT_R@ +REPLACE_RANDOM = @REPLACE_RANDOM@ +REPLACE_RANDOM_R = @REPLACE_RANDOM_R@ +REPLACE_READ = @REPLACE_READ@ +REPLACE_READLINK = @REPLACE_READLINK@ +REPLACE_READLINKAT = @REPLACE_READLINKAT@ +REPLACE_REALLOCARRAY = @REPLACE_REALLOCARRAY@ +REPLACE_REALLOC_FOR_REALLOC_GNU = @REPLACE_REALLOC_FOR_REALLOC_GNU@ +REPLACE_REALLOC_FOR_REALLOC_POSIX = @REPLACE_REALLOC_FOR_REALLOC_POSIX@ +REPLACE_REALPATH = @REPLACE_REALPATH@ +REPLACE_REMAINDER = @REPLACE_REMAINDER@ +REPLACE_REMAINDERF = @REPLACE_REMAINDERF@ +REPLACE_REMAINDERL = @REPLACE_REMAINDERL@ +REPLACE_REMOVE = @REPLACE_REMOVE@ +REPLACE_RENAME = @REPLACE_RENAME@ +REPLACE_RENAMEAT = @REPLACE_RENAMEAT@ +REPLACE_RINTL = @REPLACE_RINTL@ +REPLACE_RMDIR = @REPLACE_RMDIR@ +REPLACE_ROUND = @REPLACE_ROUND@ +REPLACE_ROUNDF = @REPLACE_ROUNDF@ +REPLACE_ROUNDL = @REPLACE_ROUNDL@ +REPLACE_SETENV = @REPLACE_SETENV@ +REPLACE_SETLOCALE = @REPLACE_SETLOCALE@ +REPLACE_SETSTATE = @REPLACE_SETSTATE@ +REPLACE_SIGNBIT = @REPLACE_SIGNBIT@ +REPLACE_SIGNBIT_USING_BUILTINS = @REPLACE_SIGNBIT_USING_BUILTINS@ +REPLACE_SINF = @REPLACE_SINF@ +REPLACE_SINHF = @REPLACE_SINHF@ +REPLACE_SLEEP = @REPLACE_SLEEP@ +REPLACE_SNPRINTF = @REPLACE_SNPRINTF@ +REPLACE_SPRINTF = @REPLACE_SPRINTF@ +REPLACE_SQRTF = @REPLACE_SQRTF@ +REPLACE_SQRTL = @REPLACE_SQRTL@ +REPLACE_STAT = @REPLACE_STAT@ +REPLACE_STDIO_READ_FUNCS = @REPLACE_STDIO_READ_FUNCS@ +REPLACE_STDIO_WRITE_FUNCS = @REPLACE_STDIO_WRITE_FUNCS@ +REPLACE_STPNCPY = @REPLACE_STPNCPY@ +REPLACE_STRCASESTR = @REPLACE_STRCASESTR@ +REPLACE_STRCHRNUL = @REPLACE_STRCHRNUL@ +REPLACE_STRDUP = @REPLACE_STRDUP@ +REPLACE_STRERROR = @REPLACE_STRERROR@ +REPLACE_STRERRORNAME_NP = @REPLACE_STRERRORNAME_NP@ +REPLACE_STRERROR_R = @REPLACE_STRERROR_R@ +REPLACE_STRFTIME = @REPLACE_STRFTIME@ +REPLACE_STRNCAT = @REPLACE_STRNCAT@ +REPLACE_STRNDUP = @REPLACE_STRNDUP@ +REPLACE_STRNLEN = @REPLACE_STRNLEN@ +REPLACE_STRSIGNAL = @REPLACE_STRSIGNAL@ +REPLACE_STRSTR = @REPLACE_STRSTR@ +REPLACE_STRTOD = @REPLACE_STRTOD@ +REPLACE_STRTOIMAX = @REPLACE_STRTOIMAX@ +REPLACE_STRTOK_R = @REPLACE_STRTOK_R@ +REPLACE_STRTOL = @REPLACE_STRTOL@ +REPLACE_STRTOLD = @REPLACE_STRTOLD@ +REPLACE_STRTOLL = @REPLACE_STRTOLL@ +REPLACE_STRTOUL = @REPLACE_STRTOUL@ +REPLACE_STRTOULL = @REPLACE_STRTOULL@ +REPLACE_STRTOUMAX = @REPLACE_STRTOUMAX@ +REPLACE_STRUCT_LCONV = @REPLACE_STRUCT_LCONV@ +REPLACE_SYMLINK = @REPLACE_SYMLINK@ +REPLACE_SYMLINKAT = @REPLACE_SYMLINKAT@ +REPLACE_TANF = @REPLACE_TANF@ +REPLACE_TANHF = @REPLACE_TANHF@ +REPLACE_TIMEGM = @REPLACE_TIMEGM@ +REPLACE_TMPFILE = @REPLACE_TMPFILE@ +REPLACE_TOWLOWER = @REPLACE_TOWLOWER@ +REPLACE_TRUNC = @REPLACE_TRUNC@ +REPLACE_TRUNCATE = @REPLACE_TRUNCATE@ +REPLACE_TRUNCF = @REPLACE_TRUNCF@ +REPLACE_TRUNCL = @REPLACE_TRUNCL@ +REPLACE_TTYNAME_R = @REPLACE_TTYNAME_R@ +REPLACE_TZSET = @REPLACE_TZSET@ +REPLACE_UNLINK = @REPLACE_UNLINK@ +REPLACE_UNLINKAT = @REPLACE_UNLINKAT@ +REPLACE_UNSETENV = @REPLACE_UNSETENV@ +REPLACE_USLEEP = @REPLACE_USLEEP@ +REPLACE_UTIMENSAT = @REPLACE_UTIMENSAT@ +REPLACE_VASPRINTF = @REPLACE_VASPRINTF@ +REPLACE_VDPRINTF = @REPLACE_VDPRINTF@ +REPLACE_VFPRINTF = @REPLACE_VFPRINTF@ +REPLACE_VPRINTF = @REPLACE_VPRINTF@ +REPLACE_VSNPRINTF = @REPLACE_VSNPRINTF@ +REPLACE_VSPRINTF = @REPLACE_VSPRINTF@ +REPLACE_WCRTOMB = @REPLACE_WCRTOMB@ +REPLACE_WCSFTIME = @REPLACE_WCSFTIME@ +REPLACE_WCSNRTOMBS = @REPLACE_WCSNRTOMBS@ +REPLACE_WCSRTOMBS = @REPLACE_WCSRTOMBS@ +REPLACE_WCSTOK = @REPLACE_WCSTOK@ +REPLACE_WCSWIDTH = @REPLACE_WCSWIDTH@ +REPLACE_WCTOB = @REPLACE_WCTOB@ +REPLACE_WCTOMB = @REPLACE_WCTOMB@ +REPLACE_WCWIDTH = @REPLACE_WCWIDTH@ +REPLACE_WRITE = @REPLACE_WRITE@ +REV_DATESTAMP = @REV_DATESTAMP@ +REV_TIMESTAMP = @REV_TIMESTAMP@ +SCRIPT_TEST = @SCRIPT_TEST@ +SED = @SED@ +SERVENT_LIB = @SERVENT_LIB@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SIG_ATOMIC_T_SUFFIX = @SIG_ATOMIC_T_SUFFIX@ +SIZE_T_SUFFIX = @SIZE_T_SUFFIX@ +SOCKETLIBS = @SOCKETLIBS@ +SSLINCLUDE = @SSLINCLUDE@ +SSLLIBS = @SSLLIBS@ +STDALIGN_H = @STDALIGN_H@ +STDCKDINT_H = @STDCKDINT_H@ +STDDEF_H = @STDDEF_H@ +STDINT_H = @STDINT_H@ +STRIP = @STRIP@ +SUPPORT = @SUPPORT@ +SYSTEMDINCLUDE = @SYSTEMDINCLUDE@ +SYSTEMDLIBS = @SYSTEMDLIBS@ +SYS_TIME_H_DEFINES_STRUCT_TIMESPEC = @SYS_TIME_H_DEFINES_STRUCT_TIMESPEC@ +TIME_H_DEFINES_STRUCT_TIMESPEC = @TIME_H_DEFINES_STRUCT_TIMESPEC@ +TIME_H_DEFINES_TIME_UTC = @TIME_H_DEFINES_TIME_UTC@ +UINT32_MAX_LT_UINTMAX_MAX = @UINT32_MAX_LT_UINTMAX_MAX@ +UINT64_MAX_EQ_ULONG_MAX = @UINT64_MAX_EQ_ULONG_MAX@ +UNDEFINE_STRTOK_R = @UNDEFINE_STRTOK_R@ +UNISTD_H_DEFINES_STRUCT_TIMESPEC = @UNISTD_H_DEFINES_STRUCT_TIMESPEC@ +UNISTD_H_HAVE_SYS_RANDOM_H = @UNISTD_H_HAVE_SYS_RANDOM_H@ +UNISTD_H_HAVE_WINSOCK2_H = @UNISTD_H_HAVE_WINSOCK2_H@ +UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS = @UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS@ +URIPARSER = @URIPARSER@ +URIPARSERCFLAGS = @URIPARSERCFLAGS@ +URIPARSERINCLUDE = @URIPARSERINCLUDE@ +URIPARSERLIBS = @URIPARSERLIBS@ +URIPARSER_CPPFLAGS = @URIPARSER_CPPFLAGS@ +USE_NLS = @USE_NLS@ +VERSION = @VERSION@ +WARRANTY = @WARRANTY@ +WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@ +WINDOWS_64_BIT_OFF_T = @WINDOWS_64_BIT_OFF_T@ +WINDOWS_64_BIT_ST_SIZE = @WINDOWS_64_BIT_ST_SIZE@ +WINDOWS_STAT_INODES = @WINDOWS_STAT_INODES@ +WINDOWS_STAT_TIMESPEC = @WINDOWS_STAT_TIMESPEC@ +WINT_T_SUFFIX = @WINT_T_SUFFIX@ +WTSAPI32LIBS = @WTSAPI32LIBS@ +XGETTEXT = @XGETTEXT@ +XGETTEXT_015 = @XGETTEXT_015@ +XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ +_libcurl_config = @_libcurl_config@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +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 = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +check_tcp_ssl = @check_tcp_ssl@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +gl_LIBOBJDEPS = @gl_LIBOBJDEPS@ +gl_LIBOBJS = @gl_LIBOBJS@ +gl_LTLIBOBJS = @gl_LTLIBOBJS@ +gltests_LIBOBJDEPS = @gltests_LIBOBJDEPS@ +gltests_LIBOBJS = @gltests_LIBOBJS@ +gltests_LTLIBOBJS = @gltests_LTLIBOBJS@ +gltests_WITNESS = @gltests_WITNESS@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = $(datadir)/locale +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +np_mysql_config = @np_mysql_config@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +runstatedir = @runstatedir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +with_trusted_path = @with_trusted_path@ +@RELEASE_PRESENT_TRUE@NP_VERSION = @NP_RELEASE@ +AM_CFLAGS = -DNP_VERSION='"$(NP_VERSION)"' +AM_CPPFLAGS = -I.. -I$(top_srcdir)/lib -I$(top_srcdir)/gl -I$(top_srcdir)/intl -I$(top_srcdir)/plugins @SSLINCLUDE@ +EXTRA_DIST = t pst3.c +BASEOBJS = ../plugins/utils.o ../lib/libmonitoringplug.a ../gl/libgnu.a $(LIB_CRYPTO) +NETOBJS = ../plugins/netutils.o $(BASEOBJS) $(EXTRA_NETOBJS) +NETLIBS = $(NETOBJS) $(SOCKETLIBS) +TESTS_ENVIRONMENT = perl -I $(top_builddir) -I $(top_srcdir) +TESTS = @PLUGIN_TEST@ +setuid_root_mode = ug=rx,u+s + +# /* Author Coreutils team - see ACKNOWLEDGEMENTS */ +INSTALL_SUID = \ + for f in $(noinst_PROGRAMS) ; do \ + p=$$f; \ + echo " $(INSTALL_PROGRAM) $$p $(DESTDIR)$(libexecdir)/$$p"; \ + $(INSTALL_PROGRAM) $$p $(DESTDIR)$(libexecdir)/$$p; \ + echo " chown root $(DESTDIR)$(libexecdir)/$$p"; \ + chown root $(DESTDIR)$(libexecdir)/$$p; \ + echo " chmod $(setuid_root_mode) $(DESTDIR)$(libexecdir)/$$p"; \ + chmod $(setuid_root_mode) $(DESTDIR)$(libexecdir)/$$p; \ + done + + +# /* Author Coreutils team sub-citation */ + +############################################################################## +# the actual targets +check_dhcp_LDADD = @LTLIBINTL@ $(NETLIBS) +check_icmp_LDADD = @LTLIBINTL@ $(NETLIBS) $(SOCKETLIBS) + +# -m64 needed at compiler and linker phase +pst3_CFLAGS = @PST3CFLAGS@ +pst3_LDFLAGS = @PST3CFLAGS@ +# pst3 must not use monitoringplug/gnulib includes! +pst3_CPPFLAGS = +check_dhcp_DEPENDENCIES = check_dhcp.c $(NETOBJS) $(DEPLIBS) +check_icmp_DEPENDENCIES = check_icmp.c $(NETOBJS) +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .log .o .obj .test .test$(EXEEXT) .trs +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu plugins-root/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu plugins-root/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__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +clean-noinstPROGRAMS: + @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \ + echo " rm -f" $$list; \ + rm -f $$list || exit $$?; \ + test -n "$(EXEEXT)" || exit 0; \ + list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f" $$list; \ + rm -f $$list + +check_dhcp$(EXEEXT): $(check_dhcp_OBJECTS) $(check_dhcp_DEPENDENCIES) $(EXTRA_check_dhcp_DEPENDENCIES) + @rm -f check_dhcp$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(check_dhcp_OBJECTS) $(check_dhcp_LDADD) $(LIBS) + +check_icmp$(EXEEXT): $(check_icmp_OBJECTS) $(check_icmp_DEPENDENCIES) $(EXTRA_check_icmp_DEPENDENCIES) + @rm -f check_icmp$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(check_icmp_OBJECTS) $(check_icmp_LDADD) $(LIBS) + +pst3$(EXEEXT): $(pst3_OBJECTS) $(pst3_DEPENDENCIES) $(EXTRA_pst3_DEPENDENCIES) + @rm -f pst3$(EXEEXT) + $(AM_V_CCLD)$(pst3_LINK) $(pst3_OBJECTS) $(pst3_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/check_dhcp.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/check_icmp.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pst3-pst3.Po@am__quote@ # am--include-marker + +$(am__depfiles_remade): + @$(MKDIR_P) $(@D) + @echo '# dummy' >$@-t && $(am__mv) $@-t $@ + +am--depfiles: $(am__depfiles_remade) + +.c.o: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< + +.c.obj: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< + +pst3-pst3.o: pst3.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(pst3_CPPFLAGS) $(CPPFLAGS) $(pst3_CFLAGS) $(CFLAGS) -MT pst3-pst3.o -MD -MP -MF $(DEPDIR)/pst3-pst3.Tpo -c -o pst3-pst3.o `test -f 'pst3.c' || echo '$(srcdir)/'`pst3.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/pst3-pst3.Tpo $(DEPDIR)/pst3-pst3.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pst3.c' object='pst3-pst3.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(pst3_CPPFLAGS) $(CPPFLAGS) $(pst3_CFLAGS) $(CFLAGS) -c -o pst3-pst3.o `test -f 'pst3.c' || echo '$(srcdir)/'`pst3.c + +pst3-pst3.obj: pst3.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(pst3_CPPFLAGS) $(CPPFLAGS) $(pst3_CFLAGS) $(CFLAGS) -MT pst3-pst3.obj -MD -MP -MF $(DEPDIR)/pst3-pst3.Tpo -c -o pst3-pst3.obj `if test -f 'pst3.c'; then $(CYGPATH_W) 'pst3.c'; else $(CYGPATH_W) '$(srcdir)/pst3.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/pst3-pst3.Tpo $(DEPDIR)/pst3-pst3.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pst3.c' object='pst3-pst3.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(pst3_CPPFLAGS) $(CPPFLAGS) $(pst3_CFLAGS) $(CFLAGS) -c -o pst3-pst3.obj `if test -f 'pst3.c'; then $(CYGPATH_W) 'pst3.c'; else $(CYGPATH_W) '$(srcdir)/pst3.c'; fi` + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-am +TAGS: tags + +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + set x; \ + here=`pwd`; \ + $(am__define_uniq_tagged_files); \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: ctags-am + +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" +cscopelist: cscopelist-am + +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +# Recover from deleted '.trs' file; this should ensure that +# "rm -f foo.log; make foo.trs" re-run 'foo.test', and re-create +# both 'foo.log' and 'foo.trs'. Break the recipe in two subshells +# to avoid problems with "make -n". +.log.trs: + rm -f $< $@ + $(MAKE) $(AM_MAKEFLAGS) $< + +# Leading 'am--fnord' is there to ensure the list of targets does not +# expand to empty, as could happen e.g. with make check TESTS=''. +am--fnord $(TEST_LOGS) $(TEST_LOGS:.log=.trs): $(am__force_recheck) +am--force-recheck: + @: + +$(TEST_SUITE_LOG): $(TEST_LOGS) + @$(am__set_TESTS_bases); \ + am__f_ok () { test -f "$$1" && test -r "$$1"; }; \ + redo_bases=`for i in $$bases; do \ + am__f_ok $$i.trs && am__f_ok $$i.log || echo $$i; \ + done`; \ + if test -n "$$redo_bases"; then \ + redo_logs=`for i in $$redo_bases; do echo $$i.log; done`; \ + redo_results=`for i in $$redo_bases; do echo $$i.trs; done`; \ + if $(am__make_dryrun); then :; else \ + rm -f $$redo_logs && rm -f $$redo_results || exit 1; \ + fi; \ + fi; \ + if test -n "$$am__remaking_logs"; then \ + echo "fatal: making $(TEST_SUITE_LOG): possible infinite" \ + "recursion detected" >&2; \ + elif test -n "$$redo_logs"; then \ + am__remaking_logs=yes $(MAKE) $(AM_MAKEFLAGS) $$redo_logs; \ + fi; \ + if $(am__make_dryrun); then :; else \ + st=0; \ + errmsg="fatal: making $(TEST_SUITE_LOG): failed to create"; \ + for i in $$redo_bases; do \ + test -f $$i.trs && test -r $$i.trs \ + || { echo "$$errmsg $$i.trs" >&2; st=1; }; \ + test -f $$i.log && test -r $$i.log \ + || { echo "$$errmsg $$i.log" >&2; st=1; }; \ + done; \ + test $$st -eq 0 || exit 1; \ + fi + @$(am__sh_e_setup); $(am__tty_colors); $(am__set_TESTS_bases); \ + ws='[ ]'; \ + results=`for b in $$bases; do echo $$b.trs; done`; \ + test -n "$$results" || results=/dev/null; \ + all=` grep "^$$ws*:test-result:" $$results | wc -l`; \ + pass=` grep "^$$ws*:test-result:$$ws*PASS" $$results | wc -l`; \ + fail=` grep "^$$ws*:test-result:$$ws*FAIL" $$results | wc -l`; \ + skip=` grep "^$$ws*:test-result:$$ws*SKIP" $$results | wc -l`; \ + xfail=`grep "^$$ws*:test-result:$$ws*XFAIL" $$results | wc -l`; \ + xpass=`grep "^$$ws*:test-result:$$ws*XPASS" $$results | wc -l`; \ + error=`grep "^$$ws*:test-result:$$ws*ERROR" $$results | wc -l`; \ + if test `expr $$fail + $$xpass + $$error` -eq 0; then \ + success=true; \ + else \ + success=false; \ + fi; \ + br='==================='; br=$$br$$br$$br$$br; \ + result_count () \ + { \ + if test x"$$1" = x"--maybe-color"; then \ + maybe_colorize=yes; \ + elif test x"$$1" = x"--no-color"; then \ + maybe_colorize=no; \ + else \ + echo "$@: invalid 'result_count' usage" >&2; exit 4; \ + fi; \ + shift; \ + desc=$$1 count=$$2; \ + if test $$maybe_colorize = yes && test $$count -gt 0; then \ + color_start=$$3 color_end=$$std; \ + else \ + color_start= color_end=; \ + fi; \ + echo "$${color_start}# $$desc $$count$${color_end}"; \ + }; \ + create_testsuite_report () \ + { \ + result_count $$1 "TOTAL:" $$all "$$brg"; \ + result_count $$1 "PASS: " $$pass "$$grn"; \ + result_count $$1 "SKIP: " $$skip "$$blu"; \ + result_count $$1 "XFAIL:" $$xfail "$$lgn"; \ + result_count $$1 "FAIL: " $$fail "$$red"; \ + result_count $$1 "XPASS:" $$xpass "$$red"; \ + result_count $$1 "ERROR:" $$error "$$mgn"; \ + }; \ + { \ + echo "$(PACKAGE_STRING): $(subdir)/$(TEST_SUITE_LOG)" | \ + $(am__rst_title); \ + create_testsuite_report --no-color; \ + echo; \ + echo ".. contents:: :depth: 2"; \ + echo; \ + for b in $$bases; do echo $$b; done \ + | $(am__create_global_log); \ + } >$(TEST_SUITE_LOG).tmp || exit 1; \ + mv $(TEST_SUITE_LOG).tmp $(TEST_SUITE_LOG); \ + if $$success; then \ + col="$$grn"; \ + else \ + col="$$red"; \ + test x"$$VERBOSE" = x || cat $(TEST_SUITE_LOG); \ + fi; \ + echo "$${col}$$br$${std}"; \ + echo "$${col}Testsuite summary"$(AM_TESTSUITE_SUMMARY_HEADER)"$${std}"; \ + echo "$${col}$$br$${std}"; \ + create_testsuite_report --maybe-color; \ + echo "$$col$$br$$std"; \ + if $$success; then :; else \ + echo "$${col}See $(subdir)/$(TEST_SUITE_LOG)$${std}"; \ + if test -n "$(PACKAGE_BUGREPORT)"; then \ + echo "$${col}Please report to $(PACKAGE_BUGREPORT)$${std}"; \ + fi; \ + echo "$$col$$br$$std"; \ + fi; \ + $$success || exit 1 + +check-TESTS: + @list='$(RECHECK_LOGS)'; test -z "$$list" || rm -f $$list + @list='$(RECHECK_LOGS:.log=.trs)'; test -z "$$list" || rm -f $$list + @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) + @set +e; $(am__set_TESTS_bases); \ + log_list=`for i in $$bases; do echo $$i.log; done`; \ + trs_list=`for i in $$bases; do echo $$i.trs; done`; \ + log_list=`echo $$log_list`; trs_list=`echo $$trs_list`; \ + $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) TEST_LOGS="$$log_list"; \ + exit $$?; +recheck: all + @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) + @set +e; $(am__set_TESTS_bases); \ + bases=`for i in $$bases; do echo $$i; done \ + | $(am__list_recheck_tests)` || exit 1; \ + log_list=`for i in $$bases; do echo $$i.log; done`; \ + log_list=`echo $$log_list`; \ + $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) \ + am__force_recheck=am--force-recheck \ + TEST_LOGS="$$log_list"; \ + exit $$? +.test.log: + @p='$<'; \ + $(am__set_b); \ + $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +@am__EXEEXT_TRUE@.test$(EXEEXT).log: +@am__EXEEXT_TRUE@ @p='$<'; \ +@am__EXEEXT_TRUE@ $(am__set_b); \ +@am__EXEEXT_TRUE@ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ +@am__EXEEXT_TRUE@ --log-file $$b.log --trs-file $$b.trs \ +@am__EXEEXT_TRUE@ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ +@am__EXEEXT_TRUE@ "$$tst" $(AM_TESTS_FD_REDIRECT) + +distdir: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am + +distdir-am: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am + $(MAKE) $(AM_MAKEFLAGS) check-TESTS +check: check-am +all-am: Makefile $(PROGRAMS) +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + -test -z "$(TEST_LOGS)" || rm -f $(TEST_LOGS) + -test -z "$(TEST_LOGS:.log=.trs)" || rm -f $(TEST_LOGS:.log=.trs) + -test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool clean-local clean-noinstPROGRAMS \ + mostlyclean-am + +distclean: distclean-am + -rm -f ./$(DEPDIR)/check_dhcp.Po + -rm -f ./$(DEPDIR)/check_icmp.Po + -rm -f ./$(DEPDIR)/pst3-pst3.Po + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: install-exec-local + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f ./$(DEPDIR)/check_dhcp.Po + -rm -f ./$(DEPDIR)/check_icmp.Po + -rm -f ./$(DEPDIR)/pst3-pst3.Po + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: check-am install-am install-strip + +.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-TESTS \ + check-am clean clean-generic clean-libtool clean-local \ + clean-noinstPROGRAMS cscopelist-am ctags ctags-am distclean \ + distclean-compile distclean-generic distclean-libtool \ + distclean-tags distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-exec-local \ + install-html install-html-am install-info install-info-am \ + install-man install-pdf install-pdf-am install-ps \ + install-ps-am install-strip installcheck installcheck-am \ + installdirs maintainer-clean maintainer-clean-generic \ + mostlyclean mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am recheck tags tags-am \ + uninstall uninstall-am + +.PRECIOUS: Makefile + +@RELEASE_PRESENT_FALSE@NP-VERSION-FILE: .FORCE-NP-VERSION-FILE +@RELEASE_PRESENT_FALSE@ @$(SHELL_PATH) $(top_srcdir)/NP-VERSION-GEN +@RELEASE_PRESENT_FALSE@.FORCE-NP-VERSION-FILE: +@RELEASE_PRESENT_FALSE@-include NP-VERSION-FILE + +test: + perl -I $(top_builddir) -I $(top_srcdir) ../test.pl + +test-debug: + NPTEST_DEBUG=1 HARNESS_VERBOSE=1 perl -I $(top_builddir) -I $(top_srcdir) ../test.pl + +install-root: $(noinst_PROGRAMS) + @$(INSTALL_SUID) + +install-exec-local: $(noinst_PROGRAMS) + @TMPFILE=$(DESTDIR)$(libexecdir)/.setuid-$$$$; \ + rm -f $$TMPFILE; \ + echo > $$TMPFILE; \ + can_create_suid_root_executable=no; \ + chown root $$TMPFILE > /dev/null 2>&1 \ + && chmod $(setuid_root_mode) $$TMPFILE > /dev/null 2>&1 \ + && can_create_suid_root_executable=yes; \ + rm -f $$TMPFILE; \ + if test $$can_create_suid_root_executable = yes; then \ + $(INSTALL_SUID); \ + else \ + echo "WARNING: insufficient access; not installing setuid plugins"; \ + echo "NOTE: to install setuid plugins, run 'make install-root' as root"; \ + fi + +clean-local: + rm -f NP-VERSION-FILE + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/plugins-root/check_dhcp.c b/plugins-root/check_dhcp.c new file mode 100644 index 0000000..6b07df5 --- /dev/null +++ b/plugins-root/check_dhcp.c @@ -0,0 +1,1412 @@ +/***************************************************************************** + * + * Monitoring check_dhcp plugin + * + * License: GPL + * Copyright (c) 2001-2004 Ethan Galstad (nagios@nagios.org) + * Copyright (c) 2001-2007 Monitoring Plugins Development Team + * + * Description: + * + * This file contains the check_dhcp plugin + * + * This plugin tests the availability of DHCP servers on a network. + * + * Unicast mode was originally implemented by Heiti of Boras Kommun with + * general improvements as well as usability fixes and "forward"-porting by + * Andreas Ericsson of OP5 AB. + * + * + * 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 + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + * + *****************************************************************************/ + +const char *progname = "check_dhcp"; +const char *copyright = "2001-2023"; +const char *email = "devel@monitoring-plugins.org"; + +#include "common.h" +#include "netutils.h" +#include "utils.h" + +#include <ctype.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <errno.h> +#include <unistd.h> +#include <sys/time.h> +#include <sys/ioctl.h> +#include <fcntl.h> +#include <getopt.h> +#include <sys/socket.h> +#include <sys/types.h> +#include <netdb.h> +#include <netinet/in.h> +#include <net/if.h> +#include <arpa/inet.h> + +#if HAVE_SYS_SOCKIO_H +#include <sys/sockio.h> +#endif // HAVE_SYS_SOCKIO_H + +#if defined( __linux__ ) + +#include <linux/if_ether.h> +#include <features.h> + +#elif defined (__bsd__) + +#include <netinet/if_ether.h> +#include <sys/param.h> +#include <sys/sysctl.h> +#include <net/if_dl.h> + +#elif defined(__sun__) || defined(__solaris__) || defined(__hpux__) + +#define INSAP 22 +#define OUTSAP 24 + +#include <signal.h> +#include <ctype.h> +#include <sys/stropts.h> +#include <sys/poll.h> +#include <sys/dlpi.h> + +#define bcopy(source, destination, length) memcpy(destination, source, length) + +#define AREA_SZ 5000 /* buffer length in bytes */ +static u_long ctl_area[AREA_SZ]; +static u_long dat_area[AREA_SZ]; +static struct strbuf ctl = {AREA_SZ, 0, (char *)ctl_area}; +static struct strbuf dat = {AREA_SZ, 0, (char *)dat_area}; + +#define GOT_CTRL 1 +#define GOT_DATA 2 +#define GOT_BOTH 3 +#define GOT_INTR 4 +#define GOT_ERR 128 + +static int get_msg(int); +static int check_ctrl(int); +static int put_ctrl(int, int, int); +static int put_both(int, int, int, int); +static int dl_open(const char *, int, int *); +static int dl_bind(int, int, u_char *); +long mac_addr_dlpi( const char *, int, u_char *); + +#endif // __sun__ || __solaris__ || __hpux + + + +/**** Common definitions ****/ + +#define OK 0 +#define ERROR -1 + + +/**** DHCP definitions ****/ + +#define MAX_DHCP_CHADDR_LENGTH 16 +#define MAX_DHCP_SNAME_LENGTH 64 +#define MAX_DHCP_FILE_LENGTH 128 +#define MAX_DHCP_OPTIONS_LENGTH 312 + + +typedef struct dhcp_packet_struct{ + uint8_t op; /* packet type */ + uint8_t htype; /* type of hardware address for this machine (Ethernet, etc) */ + uint8_t hlen; /* length of hardware address (of this machine) */ + uint8_t hops; /* hops */ + uint32_t xid; /* random transaction id number - chosen by this machine */ + uint16_t secs; /* seconds used in timing */ + uint16_t flags; /* flags */ + struct in_addr ciaddr; /* IP address of this machine (if we already have one) */ + struct in_addr yiaddr; /* IP address of this machine (offered by the DHCP server) */ + struct in_addr siaddr; /* IP address of next server */ + struct in_addr giaddr; /* IP address of DHCP relay */ + unsigned char chaddr [MAX_DHCP_CHADDR_LENGTH]; /* hardware address of this machine */ + char sname [MAX_DHCP_SNAME_LENGTH]; /* name of DHCP server */ + char file [MAX_DHCP_FILE_LENGTH]; /* boot file name (used for diskless booting?) */ + char options[MAX_DHCP_OPTIONS_LENGTH]; /* options */ +}dhcp_packet; + + +typedef struct dhcp_offer_struct{ + struct in_addr server_address; /* address of DHCP server that sent this offer */ + struct in_addr offered_address; /* the IP address that was offered to us */ + uint32_t lease_time; /* lease time in seconds */ + uint32_t renewal_time; /* renewal time in seconds */ + uint32_t rebinding_time; /* rebinding time in seconds */ + bool desired; /* is this offer desired (necessary in exclusive mode) */ + struct dhcp_offer_struct *next; +}dhcp_offer; + + +typedef struct requested_server_struct{ + struct in_addr server_address; + bool answered; + struct requested_server_struct *next; +}requested_server; + + +#define BOOTREQUEST 1 +#define BOOTREPLY 2 + +#define DHCPDISCOVER 1 +#define DHCPOFFER 2 +#define DHCPREQUEST 3 +#define DHCPDECLINE 4 +#define DHCPACK 5 +#define DHCPNACK 6 +#define DHCPRELEASE 7 + +#define DHCP_OPTION_MESSAGE_TYPE 53 +#define DHCP_OPTION_HOST_NAME 12 +#define DHCP_OPTION_BROADCAST_ADDRESS 28 +#define DHCP_OPTION_REQUESTED_ADDRESS 50 +#define DHCP_OPTION_LEASE_TIME 51 +#define DHCP_OPTION_SERVER_IDENTIFIER 54 +#define DHCP_OPTION_RENEWAL_TIME 58 +#define DHCP_OPTION_REBINDING_TIME 59 +#define DHCP_OPTION_END 255 + +#define DHCP_INFINITE_TIME 0xFFFFFFFF + +#define DHCP_BROADCAST_FLAG 32768 + +#define DHCP_SERVER_PORT 67 +#define DHCP_CLIENT_PORT 68 + +#define ETHERNET_HARDWARE_ADDRESS 1 /* used in htype field of dhcp packet */ +#define ETHERNET_HARDWARE_ADDRESS_LENGTH 6 /* length of Ethernet hardware addresses */ + +bool unicast = false; /* unicast mode: mimic a DHCP relay */ +bool exclusive = false; /* exclusive mode aka "rogue DHCP server detection" */ +struct in_addr my_ip; /* our address (required for relay) */ +struct in_addr dhcp_ip; /* server to query (if in unicast mode) */ +unsigned char client_hardware_address[MAX_DHCP_CHADDR_LENGTH]=""; +unsigned char *user_specified_mac=NULL; + +char network_interface_name[IFNAMSIZ]="eth0"; + +uint32_t packet_xid=0; + +uint32_t dhcp_lease_time=0; +uint32_t dhcp_renewal_time=0; +uint32_t dhcp_rebinding_time=0; + +int dhcpoffer_timeout=2; + +dhcp_offer *dhcp_offer_list=NULL; +requested_server *requested_server_list=NULL; + +int valid_responses=0; /* number of valid DHCPOFFERs we received */ +int requested_servers=0; +int requested_responses=0; + +bool request_specific_address=false; +bool received_requested_address=false; +int verbose=0; +struct in_addr requested_address; + + +int process_arguments(int, char **); +int call_getopt(int, char **); +int validate_arguments(int); +void print_usage(void); +void print_help(void); + +void resolve_host(const char *in,struct in_addr *out); +unsigned char *mac_aton(const char *); +void print_hardware_address(const unsigned char *); +int get_hardware_address(int,char *); +int get_ip_address(int,char *); + +int send_dhcp_discover(int); +int get_dhcp_offer(int); + +int get_results(void); + +int add_dhcp_offer(struct in_addr,dhcp_packet *); +int free_dhcp_offer_list(void); +int free_requested_server_list(void); + +int create_dhcp_socket(void); +int close_dhcp_socket(int); +int send_dhcp_packet(void *,int,int,struct sockaddr_in *); +int receive_dhcp_packet(void *,int,int,int,struct sockaddr_in *); + + + +int main(int argc, char **argv){ + int dhcp_socket; + int result = STATE_UNKNOWN; + + setlocale (LC_ALL, ""); + bindtextdomain (PACKAGE, LOCALEDIR); + textdomain (PACKAGE); + + /* Parse extra opts if any */ + argv=np_extra_opts(&argc, argv, progname); + + if(process_arguments(argc,argv)!=OK){ + usage4 (_("Could not parse arguments")); + } + + /* create socket for DHCP communications */ + dhcp_socket=create_dhcp_socket(); + + /* get hardware address of client machine */ + if(user_specified_mac!=NULL) + memcpy(client_hardware_address,user_specified_mac,6); + else + get_hardware_address(dhcp_socket,network_interface_name); + + if(unicast) /* get IP address of client machine */ + get_ip_address(dhcp_socket,network_interface_name); + + /* send DHCPDISCOVER packet */ + send_dhcp_discover(dhcp_socket); + + /* wait for a DHCPOFFER packet */ + get_dhcp_offer(dhcp_socket); + + /* close socket we created */ + close_dhcp_socket(dhcp_socket); + + /* determine state/plugin output to return */ + result=get_results(); + + /* free allocated memory */ + free_dhcp_offer_list(); + free_requested_server_list(); + + return result; +} + + + +/* determines hardware address on client machine */ +int get_hardware_address(int sock,char *interface_name){ + +#if defined(__linux__) + struct ifreq ifr; + + strncpy((char *)&ifr.ifr_name,interface_name,sizeof(ifr.ifr_name)-1); + ifr.ifr_name[sizeof(ifr.ifr_name)-1]='\0'; + + /* try and grab hardware address of requested interface */ + if(ioctl(sock,SIOCGIFHWADDR,&ifr)<0){ + printf(_("Error: Could not get hardware address of interface '%s'\n"),interface_name); + exit(STATE_UNKNOWN); + } + + memcpy(&client_hardware_address[0],&ifr.ifr_hwaddr.sa_data,6); + +#elif defined(__bsd__) + /* King 2004 see ACKNOWLEDGEMENTS */ + + size_t len; + int mib[6]; + char *buf; + unsigned char *ptr; + struct if_msghdr *ifm; + struct sockaddr_dl *sdl; + + mib[0] = CTL_NET; + mib[1] = AF_ROUTE; + mib[2] = 0; + mib[3] = AF_LINK; + mib[4] = NET_RT_IFLIST; + + if((mib[5] = if_nametoindex(interface_name)) == 0){ + printf(_("Error: if_nametoindex error - %s.\n"), strerror(errno)); + exit(STATE_UNKNOWN); + } + + if(sysctl(mib, 6, NULL, &len, NULL, 0) < 0){ + printf(_("Error: Couldn't get hardware address from %s. sysctl 1 error - %s.\n"), interface_name, strerror(errno)); + exit(STATE_UNKNOWN); + } + + if((buf = malloc(len)) == NULL){ + printf(_("Error: Couldn't get hardware address from interface %s. malloc error - %s.\n"), interface_name, strerror(errno)); + exit(4); + } + + if(sysctl(mib, 6, buf, &len, NULL, 0) < 0){ + printf(_("Error: Couldn't get hardware address from %s. sysctl 2 error - %s.\n"), interface_name, strerror(errno)); + exit(STATE_UNKNOWN); + } + + ifm = (struct if_msghdr *)buf; + sdl = (struct sockaddr_dl *)(ifm + 1); + ptr = (unsigned char *)LLADDR(sdl); + memcpy(&client_hardware_address[0], ptr, 6) ; + /* King 2004 */ + +#elif defined(__sun__) || defined(__solaris__) + + /* Kompf 2000-2003 see ACKNOWLEDGEMENTS */ + long stat; + char dev[20] = "/dev/"; + char *p; + int unit; + + /* get last number from interfacename, eg lnc0, e1000g0*/ + int i; + p = interface_name + strlen(interface_name) -1; + for(i = strlen(interface_name) -1; i > 0; p--) { + if(isalpha(*p)) + break; + } + p++; + if( p != interface_name ){ + unit = atoi(p) ; + strncat(dev, interface_name, 6) ; + } + else{ + printf(_("Error: can't find unit number in interface_name (%s) - expecting TypeNumber eg lnc0.\n"), interface_name); + exit(STATE_UNKNOWN); + } + stat = mac_addr_dlpi(dev, unit, client_hardware_address); + if(stat != 0){ + printf(_("Error: can't read MAC address from DLPI streams interface for device %s unit %d.\n"), dev, unit); + exit(STATE_UNKNOWN); + } + +#elif defined(__hpux__) + + long stat; + char dev[20] = "/dev/dlpi" ; + int unit = 0; + + stat = mac_addr_dlpi(dev, unit, client_hardware_address); + if(stat != 0){ + printf(_("Error: can't read MAC address from DLPI streams interface for device %s unit %d.\n"), dev, unit); + exit(STATE_UNKNOWN); + } + /* Kompf 2000-2003 */ + +#else + printf(_("Error: can't get MAC address for this architecture. Use the --mac option.\n")); + exit(STATE_UNKNOWN); +#endif + + if(verbose) + print_hardware_address(client_hardware_address); + + return OK; +} + +/* determines IP address of the client interface */ +int get_ip_address(int sock,char *interface_name){ +#if defined(SIOCGIFADDR) + struct ifreq ifr; + + strncpy((char *)&ifr.ifr_name,interface_name,sizeof(ifr.ifr_name)-1); + ifr.ifr_name[sizeof(ifr.ifr_name)-1]='\0'; + + if(ioctl(sock,SIOCGIFADDR,&ifr)<0){ + printf(_("Error: Cannot determine IP address of interface %s\n"), + interface_name); + exit(STATE_UNKNOWN); + } + + my_ip=((struct sockaddr_in *)&ifr.ifr_addr)->sin_addr; + +#else + printf(_("Error: Cannot get interface IP address on this platform.\n")); + exit(STATE_UNKNOWN); +#endif + + if(verbose) + printf(_("Pretending to be relay client %s\n"),inet_ntoa(my_ip)); + + return OK; +} + +/* sends a DHCPDISCOVER broadcast message in an attempt to find DHCP servers */ +int send_dhcp_discover(int sock){ + dhcp_packet discover_packet; + struct sockaddr_in sockaddr_broadcast; + unsigned short opts; + + + /* clear the packet data structure */ + bzero(&discover_packet,sizeof(discover_packet)); + + + /* boot request flag (backward compatible with BOOTP servers) */ + discover_packet.op=BOOTREQUEST; + + /* hardware address type */ + discover_packet.htype=ETHERNET_HARDWARE_ADDRESS; + + /* length of our hardware address */ + discover_packet.hlen=ETHERNET_HARDWARE_ADDRESS_LENGTH; + + /* + * transaction ID is supposed to be random. + */ + srand(time(NULL)^getpid()); + packet_xid=random(); + discover_packet.xid=htonl(packet_xid); + + /*discover_packet.secs=htons(65535);*/ + discover_packet.secs=0xFF; + + /* + * server needs to know if it should broadcast or unicast its response: + * 0x8000L == 32768 == 1 << 15 == broadcast, 0 == unicast + */ + discover_packet.flags = unicast ? 0 : htons(DHCP_BROADCAST_FLAG); + + /* our hardware address */ + memcpy(discover_packet.chaddr,client_hardware_address,ETHERNET_HARDWARE_ADDRESS_LENGTH); + + /* first four bytes of options field is magic cookie (as per RFC 2132) */ + discover_packet.options[0]='\x63'; + discover_packet.options[1]='\x82'; + discover_packet.options[2]='\x53'; + discover_packet.options[3]='\x63'; + + opts = 4; + /* DHCP message type is embedded in options field */ + discover_packet.options[opts++]=DHCP_OPTION_MESSAGE_TYPE; /* DHCP message type option identifier */ + discover_packet.options[opts++]='\x01'; /* DHCP message option length in bytes */ + discover_packet.options[opts++]=DHCPDISCOVER; + + /* the IP address we're requesting */ + if(request_specific_address){ + discover_packet.options[opts++]=DHCP_OPTION_REQUESTED_ADDRESS; + discover_packet.options[opts++]='\x04'; + memcpy(&discover_packet.options[opts],&requested_address,sizeof(requested_address)); + opts += sizeof(requested_address); + } + discover_packet.options[opts++]=DHCP_OPTION_END; + + /* unicast fields */ + if(unicast) + discover_packet.giaddr.s_addr = my_ip.s_addr; + + /* see RFC 1542, 4.1.1 */ + discover_packet.hops = unicast ? 1 : 0; + + /* send the DHCPDISCOVER packet to broadcast address */ + sockaddr_broadcast.sin_family=AF_INET; + sockaddr_broadcast.sin_port=htons(DHCP_SERVER_PORT); + sockaddr_broadcast.sin_addr.s_addr = unicast ? dhcp_ip.s_addr : INADDR_BROADCAST; + bzero(&sockaddr_broadcast.sin_zero,sizeof(sockaddr_broadcast.sin_zero)); + + + if(verbose){ + printf(_("DHCPDISCOVER to %s port %d\n"),inet_ntoa(sockaddr_broadcast.sin_addr),ntohs(sockaddr_broadcast.sin_port)); + printf("DHCPDISCOVER XID: %u (0x%X)\n",ntohl(discover_packet.xid),ntohl(discover_packet.xid)); + printf("DHCDISCOVER ciaddr: %s\n",inet_ntoa(discover_packet.ciaddr)); + printf("DHCDISCOVER yiaddr: %s\n",inet_ntoa(discover_packet.yiaddr)); + printf("DHCDISCOVER siaddr: %s\n",inet_ntoa(discover_packet.siaddr)); + printf("DHCDISCOVER giaddr: %s\n",inet_ntoa(discover_packet.giaddr)); + } + + /* send the DHCPDISCOVER packet out */ + send_dhcp_packet(&discover_packet,sizeof(discover_packet),sock,&sockaddr_broadcast); + + if(verbose) + printf("\n\n"); + + return OK; +} + + + + +/* waits for a DHCPOFFER message from one or more DHCP servers */ +int get_dhcp_offer(int sock){ + dhcp_packet offer_packet; + struct sockaddr_in source; + struct sockaddr_in via; + int result=OK; + int responses=0; + int x; + time_t start_time; + time_t current_time; + + time(&start_time); + + /* receive as many responses as we can */ + for(responses=0,valid_responses=0;;){ + + time(¤t_time); + if((current_time-start_time)>=dhcpoffer_timeout) + break; + + if(verbose) + printf("\n\n"); + + bzero(&source,sizeof(source)); + bzero(&via,sizeof(via)); + bzero(&offer_packet,sizeof(offer_packet)); + + result=OK; + result=receive_dhcp_packet(&offer_packet,sizeof(offer_packet),sock,dhcpoffer_timeout,&source); + + if(result!=OK){ + if(verbose) + printf(_("Result=ERROR\n")); + + continue; + } + else{ + if(verbose) + printf(_("Result=OK\n")); + + responses++; + } + + /* The "source" is either a server or a relay. */ + /* Save a copy of "source" into "via" even if it's via itself */ + memcpy(&via,&source,sizeof(source)) ; + + if(verbose){ + printf(_("DHCPOFFER from IP address %s"),inet_ntoa(source.sin_addr)); + printf(_(" via %s\n"),inet_ntoa(via.sin_addr)); + printf("DHCPOFFER XID: %u (0x%X)\n",ntohl(offer_packet.xid),ntohl(offer_packet.xid)); + } + + /* check packet xid to see if its the same as the one we used in the discover packet */ + if(ntohl(offer_packet.xid)!=packet_xid){ + if(verbose) + printf(_("DHCPOFFER XID (%u) did not match DHCPDISCOVER XID (%u) - ignoring packet\n"),ntohl(offer_packet.xid),packet_xid); + + continue; + } + + /* check hardware address */ + result=OK; + if(verbose) + printf("DHCPOFFER chaddr: "); + + for(x=0;x<ETHERNET_HARDWARE_ADDRESS_LENGTH;x++){ + if(verbose) + printf("%02X",(unsigned char)offer_packet.chaddr[x]); + + if(offer_packet.chaddr[x]!=client_hardware_address[x]) + result=ERROR; + } + if(verbose) + printf("\n"); + + if(result==ERROR){ + if(verbose) + printf(_("DHCPOFFER hardware address did not match our own - ignoring packet\n")); + + continue; + } + + if(verbose){ + printf("DHCPOFFER ciaddr: %s\n",inet_ntoa(offer_packet.ciaddr)); + printf("DHCPOFFER yiaddr: %s\n",inet_ntoa(offer_packet.yiaddr)); + printf("DHCPOFFER siaddr: %s\n",inet_ntoa(offer_packet.siaddr)); + printf("DHCPOFFER giaddr: %s\n",inet_ntoa(offer_packet.giaddr)); + } + + add_dhcp_offer(source.sin_addr,&offer_packet); + + valid_responses++; + } + + if(verbose){ + printf(_("Total responses seen on the wire: %d\n"),responses); + printf(_("Valid responses for this machine: %d\n"),valid_responses); + } + + return OK; +} + + + +/* sends a DHCP packet */ +int send_dhcp_packet(void *buffer, int buffer_size, int sock, struct sockaddr_in *dest){ + int result; + + result=sendto(sock,(char *)buffer,buffer_size,0,(struct sockaddr *)dest,sizeof(*dest)); + + if(verbose) + printf(_("send_dhcp_packet result: %d\n"),result); + + if(result<0) + return ERROR; + + return OK; +} + + + +/* receives a DHCP packet */ +int receive_dhcp_packet(void *buffer, int buffer_size, int sock, int timeout, struct sockaddr_in *address){ + struct timeval tv; + fd_set readfds; + fd_set oobfds; + int recv_result; + socklen_t address_size; + struct sockaddr_in source_address; + int nfound; + + + /* wait for data to arrive (up time timeout) */ + tv.tv_sec=timeout; + tv.tv_usec=0; + FD_ZERO(&readfds); + FD_ZERO(&oobfds); + FD_SET(sock,&readfds); + FD_SET(sock,&oobfds); + nfound = select(sock+1,&readfds,NULL,&oobfds,&tv); + + /* make sure some data has arrived */ + if(!FD_ISSET(sock,&readfds)){ + if(verbose) + printf(_("No (more) data received (nfound: %d)\n"), nfound); + return ERROR; + } + + else{ + bzero(&source_address,sizeof(source_address)); + address_size=sizeof(source_address); + recv_result=recvfrom(sock,(char *)buffer,buffer_size,0,(struct sockaddr *)&source_address,&address_size); + if(verbose) + printf("recv_result: %d\n",recv_result); + + if(recv_result==-1){ + if(verbose){ + printf(_("recvfrom() failed, ")); + printf("errno: (%d) -> %s\n",errno,strerror(errno)); + } + return ERROR; + } + else{ + if(verbose){ + printf(_("receive_dhcp_packet() result: %d\n"),recv_result); + printf(_("receive_dhcp_packet() source: %s\n"),inet_ntoa(source_address.sin_addr)); + } + + memcpy(address,&source_address,sizeof(source_address)); + return OK; + } + } + + return OK; +} + + +/* creates a socket for DHCP communication */ +int create_dhcp_socket(void){ + struct sockaddr_in myname; + struct ifreq interface; + int sock; + int flag=1; + + /* Set up the address we're going to bind to. */ + bzero(&myname,sizeof(myname)); + myname.sin_family=AF_INET; + /* listen to DHCP server port if we're in unicast mode */ + myname.sin_port = htons(unicast ? DHCP_SERVER_PORT : DHCP_CLIENT_PORT); + myname.sin_addr.s_addr = unicast ? my_ip.s_addr : INADDR_ANY; + bzero(&myname.sin_zero,sizeof(myname.sin_zero)); + + /* create a socket for DHCP communications */ + sock=socket(AF_INET,SOCK_DGRAM,IPPROTO_UDP); + if(sock<0){ + printf(_("Error: Could not create socket!\n")); + exit(STATE_UNKNOWN); + } + + if(verbose) + printf("DHCP socket: %d\n",sock); + + /* set the reuse address flag so we don't get errors when restarting */ + flag=1; + if(setsockopt(sock,SOL_SOCKET,SO_REUSEADDR,(char *)&flag,sizeof(flag))<0){ + printf(_("Error: Could not set reuse address option on DHCP socket!\n")); + exit(STATE_UNKNOWN); + } + + /* set the broadcast option - we need this to listen to DHCP broadcast messages */ + if(!unicast && setsockopt(sock,SOL_SOCKET,SO_BROADCAST,(char *)&flag,sizeof flag)<0){ + printf(_("Error: Could not set broadcast option on DHCP socket!\n")); + exit(STATE_UNKNOWN); + } + + /* bind socket to interface */ +#if defined(__linux__) + strncpy(interface.ifr_ifrn.ifrn_name,network_interface_name,IFNAMSIZ-1); + interface.ifr_ifrn.ifrn_name[IFNAMSIZ-1]='\0'; + if(setsockopt(sock,SOL_SOCKET,SO_BINDTODEVICE,(char *)&interface,sizeof(interface))<0){ + printf(_("Error: Could not bind socket to interface %s. Check your privileges...\n"),network_interface_name); + exit(STATE_UNKNOWN); + } + +#else + strncpy(interface.ifr_name,network_interface_name,IFNAMSIZ-1); + interface.ifr_name[IFNAMSIZ-1]='\0'; +#endif + + /* bind the socket */ + if(bind(sock,(struct sockaddr *)&myname,sizeof(myname))<0){ + printf(_("Error: Could not bind to DHCP socket (port %d)! Check your privileges...\n"),DHCP_CLIENT_PORT); + exit(STATE_UNKNOWN); + } + + return sock; +} + + +/* closes DHCP socket */ +int close_dhcp_socket(int sock){ + + close(sock); + + return OK; +} + + +/* adds a requested server address to list in memory */ +int add_requested_server(struct in_addr server_address){ + requested_server *new_server; + + new_server=(requested_server *)malloc(sizeof(requested_server)); + if(new_server==NULL) + return ERROR; + + new_server->server_address=server_address; + new_server->answered=false; + + new_server->next=requested_server_list; + requested_server_list=new_server; + + requested_servers++; + + if(verbose) + printf(_("Requested server address: %s\n"),inet_ntoa(new_server->server_address)); + + return OK; +} + + + + +/* adds a DHCP OFFER to list in memory */ +int add_dhcp_offer(struct in_addr source,dhcp_packet *offer_packet){ + dhcp_offer *new_offer; + int x; + unsigned option_type; + unsigned option_length; + struct in_addr serv_ident = {0}; + + if(offer_packet==NULL) + return ERROR; + + /* process all DHCP options present in the packet */ + for(x=4;x<MAX_DHCP_OPTIONS_LENGTH-1;){ + + if((int)offer_packet->options[x]==-1) + break; + + /* get option type */ + option_type=offer_packet->options[x++]; + + /* get option length */ + option_length=offer_packet->options[x++]; + + if(verbose) + printf("Option: %d (0x%02X)\n",option_type,option_length); + + /* get option data */ + switch(option_type){ + case DHCP_OPTION_LEASE_TIME: + memcpy(&dhcp_lease_time, &offer_packet->options[x],sizeof(dhcp_lease_time)); + dhcp_lease_time = ntohl(dhcp_lease_time); + break; + case DHCP_OPTION_RENEWAL_TIME: + memcpy(&dhcp_renewal_time, &offer_packet->options[x],sizeof(dhcp_renewal_time)); + dhcp_renewal_time = ntohl(dhcp_renewal_time); + break; + case DHCP_OPTION_REBINDING_TIME: + memcpy(&dhcp_rebinding_time, &offer_packet->options[x],sizeof(dhcp_rebinding_time)); + dhcp_rebinding_time = ntohl(dhcp_rebinding_time); + break; + case DHCP_OPTION_SERVER_IDENTIFIER: + memcpy(&serv_ident.s_addr, &offer_packet->options[x],sizeof(serv_ident.s_addr)); + break; + } + + /* skip option data we're ignoring */ + if(option_type==0) /* "pad" option, see RFC 2132 (3.1) */ + x+=1; + else + x+=option_length; + } + + if(verbose){ + if(dhcp_lease_time==DHCP_INFINITE_TIME) + printf(_("Lease Time: Infinite\n")); + else + printf(_("Lease Time: %lu seconds\n"),(unsigned long)dhcp_lease_time); + if(dhcp_renewal_time==DHCP_INFINITE_TIME) + printf(_("Renewal Time: Infinite\n")); + else + printf(_("Renewal Time: %lu seconds\n"),(unsigned long)dhcp_renewal_time); + if(dhcp_rebinding_time==DHCP_INFINITE_TIME) + printf(_("Rebinding Time: Infinite\n")); + printf(_("Rebinding Time: %lu seconds\n"),(unsigned long)dhcp_rebinding_time); + } + + new_offer=(dhcp_offer *)malloc(sizeof(dhcp_offer)); + + if(new_offer==NULL) + return ERROR; + + /* + * RFC 2131 (2.) says: "DHCP clarifies the interpretation of the + * 'siaddr' field as the address of the server to use in the next step + * of the client's bootstrap process. A DHCP server may return its own + * address in the 'siaddr' field, if the server is prepared to supply + * the next bootstrap service (e.g., delivery of an operating system + * executable image). A DHCP server always returns its own address in + * the 'server identifier' option." 'serv_ident' is the 'server + * identifier' option, 'source' is the IP address we received the + * DHCPOFFER from. If 'serv_ident' isn't available for some reason, we + * use 'source'. + */ + new_offer->server_address=serv_ident.s_addr?serv_ident:source; + new_offer->offered_address=offer_packet->yiaddr; + new_offer->lease_time=dhcp_lease_time; + new_offer->renewal_time=dhcp_renewal_time; + new_offer->rebinding_time=dhcp_rebinding_time; + new_offer->desired=false; /* exclusive mode: we'll check that in get_results */ + + + if(verbose){ + printf(_("Added offer from server @ %s"),inet_ntoa(new_offer->server_address)); + printf(_(" of IP address %s\n"),inet_ntoa(new_offer->offered_address)); + } + + /* add new offer to head of list */ + new_offer->next=dhcp_offer_list; + dhcp_offer_list=new_offer; + + return OK; +} + + +/* frees memory allocated to DHCP OFFER list */ +int free_dhcp_offer_list(void){ + dhcp_offer *this_offer; + dhcp_offer *next_offer; + + for(this_offer=dhcp_offer_list;this_offer!=NULL;this_offer=next_offer){ + next_offer=this_offer->next; + free(this_offer); + } + + return OK; +} + + +/* frees memory allocated to requested server list */ +int free_requested_server_list(void){ + requested_server *this_server; + requested_server *next_server; + + for(this_server=requested_server_list;this_server!=NULL;this_server=next_server){ + next_server=this_server->next; + free(this_server); + } + + return OK; +} + + +/* gets state and plugin output to return */ +int get_results(void){ + dhcp_offer *temp_offer, *undesired_offer=NULL; + requested_server *temp_server; + int result; + uint32_t max_lease_time=0; + + received_requested_address=false; + + /* checks responses from requested servers */ + requested_responses=0; + if(requested_servers>0){ + + for(temp_server=requested_server_list;temp_server!=NULL;temp_server=temp_server->next){ + + for(temp_offer=dhcp_offer_list;temp_offer!=NULL;temp_offer=temp_offer->next){ + + /* get max lease time we were offered */ + if(temp_offer->lease_time>max_lease_time || temp_offer->lease_time==DHCP_INFINITE_TIME) + max_lease_time=temp_offer->lease_time; + + /* see if we got the address we requested */ + if(!memcmp(&requested_address,&temp_offer->offered_address,sizeof(requested_address))) + received_requested_address=true; + + /* see if the servers we wanted a response from talked to us or not */ + if(!memcmp(&temp_offer->server_address,&temp_server->server_address,sizeof(temp_server->server_address))){ + if(verbose){ + printf(_("DHCP Server Match: Offerer=%s"),inet_ntoa(temp_offer->server_address)); + printf(_(" Requested=%s"),inet_ntoa(temp_server->server_address)); + if(temp_server->answered) + printf(_(" (duplicate)")); + printf(_("\n")); + } + if(!temp_server->answered){ + requested_responses++; + temp_server->answered=true; + temp_offer->desired=true; + } + } + } + } + + /* exclusive mode: check for undesired offers */ + for(temp_offer=dhcp_offer_list;temp_offer!=NULL;temp_offer=temp_offer->next) { + if (!temp_offer->desired) { + undesired_offer=temp_offer; /* Checks only for the first undesired offer */ + break; /* no further checks needed */ + } + } + } + + /* else check and see if we got our requested address from any server */ + else{ + + for(temp_offer=dhcp_offer_list;temp_offer!=NULL;temp_offer=temp_offer->next){ + + /* get max lease time we were offered */ + if(temp_offer->lease_time>max_lease_time || temp_offer->lease_time==DHCP_INFINITE_TIME) + max_lease_time=temp_offer->lease_time; + + /* see if we got the address we requested */ + if(!memcmp(&requested_address,&temp_offer->offered_address,sizeof(requested_address))) + received_requested_address=true; + } + } + + result=STATE_OK; + if(valid_responses==0) + result=STATE_CRITICAL; + else if(requested_servers>0 && requested_responses==0) + result=STATE_CRITICAL; + else if(requested_responses<requested_servers) + result=STATE_WARNING; + else if(request_specific_address && !received_requested_address) + result=STATE_WARNING; + + if(exclusive && undesired_offer) + result=STATE_CRITICAL; + + if(result==0) /* garrett honeycutt 2005 */ + printf("OK: "); + else if(result==1) + printf("WARNING: "); + else if(result==2) + printf("CRITICAL: "); + else if(result==3) + printf("UNKNOWN: "); + + /* we didn't receive any DHCPOFFERs */ + if(dhcp_offer_list==NULL){ + printf(_("No DHCPOFFERs were received.\n")); + return result; + } + + printf(_("Received %d DHCPOFFER(s)"),valid_responses); + + + if(exclusive && undesired_offer){ + printf(_(", Rogue DHCP Server detected! Server %s"),inet_ntoa(undesired_offer->server_address)); + printf(_(" offered %s \n"),inet_ntoa(undesired_offer->offered_address)); + return result; + } + + if(requested_servers>0) + printf(_(", %s%d of %d requested servers responded"),((requested_responses<requested_servers) && requested_responses>0)?"only ":"",requested_responses,requested_servers); + + if(request_specific_address) + printf(_(", requested address (%s) was %soffered"),inet_ntoa(requested_address),(received_requested_address)?"":_("not ")); + + printf(_(", max lease time = ")); + if(max_lease_time==DHCP_INFINITE_TIME) + printf(_("Infinity")); + else + printf("%lu sec",(unsigned long)max_lease_time); + + printf(".\n"); + + return result; +} + + +/* process command-line arguments */ +int process_arguments(int argc, char **argv){ + if(argc<1) + return ERROR; + + call_getopt(argc,argv); + return validate_arguments(argc); +} + + + +int call_getopt(int argc, char **argv){ + extern int optind; + int option_index = 0; + static struct option long_options[] = + { + {"serverip", required_argument,0,'s'}, + {"requestedip", required_argument,0,'r'}, + {"timeout", required_argument,0,'t'}, + {"interface", required_argument,0,'i'}, + {"mac", required_argument,0,'m'}, + {"unicast", no_argument, 0,'u'}, + {"exclusive", no_argument, 0,'x'}, + {"verbose", no_argument, 0,'v'}, + {"version", no_argument, 0,'V'}, + {"help", no_argument, 0,'h'}, + {0,0,0,0} + }; + + int c=0; + while(true){ + c=getopt_long(argc,argv,"+hVvxt:s:r:t:i:m:u",long_options,&option_index); + + if(c==-1||c==EOF||c==1) + break; + + switch(c){ + + case 's': /* DHCP server address */ + resolve_host(optarg,&dhcp_ip); + add_requested_server(dhcp_ip); + break; + + case 'r': /* address we are requested from DHCP servers */ + resolve_host(optarg,&requested_address); + request_specific_address=true; + break; + + case 't': /* timeout */ + + /* + if(is_intnonneg(optarg)) + */ + if(atoi(optarg)>0) + dhcpoffer_timeout=atoi(optarg); + /* + else + usage("Time interval must be a nonnegative integer\n"); + */ + break; + + case 'm': /* MAC address */ + + if((user_specified_mac=mac_aton(optarg)) == NULL) + usage("Cannot parse MAC address.\n"); + if(verbose) + print_hardware_address(user_specified_mac); + + break; + + case 'i': /* interface name */ + + strncpy(network_interface_name,optarg,sizeof(network_interface_name)-1); + network_interface_name[sizeof(network_interface_name)-1]='\x0'; + + break; + + case 'u': /* unicast testing */ + unicast=true; + break; + case 'x': /* exclusive testing aka "rogue DHCP server detection" */ + exclusive=true; + break; + + case 'V': /* version */ + print_revision(progname, NP_VERSION); + exit(STATE_UNKNOWN); + + case 'h': /* help */ + print_help(); + exit(STATE_UNKNOWN); + + case 'v': /* verbose */ + verbose=1; + break; + case '?': /* help */ + usage5 (); + break; + + default: + break; + } + } + return optind; +} + + +int validate_arguments(int argc){ + + if(argc - optind > 0) + usage(_("Got unexpected non-option argument")); + + return OK; +} + + +#if defined(__sun__) || defined(__solaris__) || defined(__hpux__) +/* Kompf 2000-2003 see ACKNOWLEDGEMENTS */ + +/* get a message from a stream; return type of message */ +static int get_msg(int fd){ + int flags = 0; + int res, ret; + ctl_area[0] = 0; + dat_area[0] = 0; + ret = 0; + res = getmsg(fd, &ctl, &dat, &flags); + + if(res < 0){ + if(errno == EINTR){ + return(GOT_INTR); + } + else{ + printf("%s\n", "get_msg FAILED."); + return(GOT_ERR); + } + } + if(ctl.len > 0){ + ret |= GOT_CTRL; + } + if(dat.len > 0){ + ret |= GOT_DATA; + } + + return(ret); +} + +/* verify that dl_primitive in ctl_area = prim */ +static int check_ctrl(int prim){ + dl_error_ack_t *err_ack = (dl_error_ack_t *)ctl_area; + + if(err_ack->dl_primitive != prim){ + printf(_("Error: DLPI stream API failed to get MAC in check_ctrl: %s.\n"), strerror(errno)); + exit(STATE_UNKNOWN); + } + + return 0; +} + +/* put a control message on a stream */ +static int put_ctrl(int fd, int len, int pri){ + + ctl.len = len; + if(putmsg(fd, &ctl, 0, pri) < 0){ + printf(_("Error: DLPI stream API failed to get MAC in put_ctrl/putmsg(): %s.\n"), strerror(errno)); + exit(STATE_UNKNOWN); + } + + return 0; +} + +/* put a control + data message on a stream */ +static int put_both(int fd, int clen, int dlen, int pri){ + + ctl.len = clen; + dat.len = dlen; + if(putmsg(fd, &ctl, &dat, pri) < 0){ + printf(_("Error: DLPI stream API failed to get MAC in put_both/putmsg().\n"), strerror(errno)); + exit(STATE_UNKNOWN); + } + + return 0; +} + +/* open file descriptor and attach */ +static int dl_open(const char *dev, int unit, int *fd){ + dl_attach_req_t *attach_req = (dl_attach_req_t *)ctl_area; + + if((*fd = open(dev, O_RDWR)) == -1){ + printf(_("Error: DLPI stream API failed to get MAC in dl_attach_req/open(%s..): %s.\n"), dev, strerror(errno)); + exit(STATE_UNKNOWN); + } + attach_req->dl_primitive = DL_ATTACH_REQ; + attach_req->dl_ppa = unit; + put_ctrl(*fd, sizeof(dl_attach_req_t), 0); + get_msg(*fd); + return check_ctrl(DL_OK_ACK); +} + +/* send DL_BIND_REQ */ +static int dl_bind(int fd, int sap, u_char *addr){ + dl_bind_req_t *bind_req = (dl_bind_req_t *)ctl_area; + dl_bind_ack_t *bind_ack = (dl_bind_ack_t *)ctl_area; + + bind_req->dl_primitive = DL_BIND_REQ; + bind_req->dl_sap = sap; + bind_req->dl_max_conind = 1; + bind_req->dl_service_mode = DL_CLDLS; + bind_req->dl_conn_mgmt = 0; + bind_req->dl_xidtest_flg = 0; + put_ctrl(fd, sizeof(dl_bind_req_t), 0); + get_msg(fd); + if (GOT_ERR == check_ctrl(DL_BIND_ACK)){ + printf(_("Error: DLPI stream API failed to get MAC in dl_bind/check_ctrl(): %s.\n"), strerror(errno)); + exit(STATE_UNKNOWN); + } + bcopy((u_char *)bind_ack + bind_ack->dl_addr_offset, addr, + bind_ack->dl_addr_length); + + return 0; +} + +/*********************************************************************** + * interface: + * function mac_addr_dlpi - get the mac address of the interface with + * type dev (eg lnc, hme) and unit (0, 1 ..) + * + * parameter: addr: an array of six bytes, has to be allocated by the caller + * + * return: 0 if OK, -1 if the address could not be determined + * + * + ***********************************************************************/ + +long mac_addr_dlpi( const char *dev, int unit, u_char *addr){ + int fd; + u_char mac_addr[25]; + + if(GOT_ERR != dl_open(dev, unit, &fd)){ + if(GOT_ERR != dl_bind(fd, INSAP, mac_addr)){ + bcopy( mac_addr, addr, 6); + return 0; + } + } + close(fd); + + return -1; +} + +/* Kompf 2000-2003 */ +#endif + + +/* resolve host name or die (TODO: move this to netutils.c!) */ +void resolve_host(const char *in,struct in_addr *out){ + struct addrinfo hints, *ai; + + memset(&hints,0,sizeof(hints)); + hints.ai_family=PF_INET; + if (getaddrinfo(in,NULL,&hints,&ai) != 0) + usage_va(_("Invalid hostname/address - %s"),optarg); + + memcpy(out,&((struct sockaddr_in *)ai->ai_addr)->sin_addr,sizeof(*out)); + freeaddrinfo(ai); +} + + +/* parse MAC address string, return 6 bytes (unterminated) or NULL */ +unsigned char *mac_aton(const char *string){ + static unsigned char result[6]; + char tmp[3]; + unsigned i, j; + + for(i=0, j=0; string[i] != '\0' && j < sizeof(result); i++){ + /* ignore ':' and any other non-hex character */ + if(!isxdigit(string[i]) || !isxdigit(string[i+1])) + continue; + tmp[0]=string[i]; + tmp[1]=string[i+1]; + tmp[2]='\0'; + result[j]=strtol(tmp,(char **)NULL,16); + i++; + j++; + } + + return (j==6) ? result : NULL; +} + + +void print_hardware_address(const unsigned char *address){ + int i; + + printf(_("Hardware address: ")); + for (i=0; i<5; i++) + printf("%2.2x:", address[i]); + printf("%2.2x", address[i]); + putchar('\n'); +} + + +/* print usage help */ +void print_help(void){ + + print_revision(progname, NP_VERSION); + + printf("Copyright (c) 2001-2004 Ethan Galstad (nagios@nagios.org)\n"); + printf (COPYRIGHT, copyright, email); + + printf("%s\n", _("This plugin tests the availability of DHCP servers on a network.")); + + printf ("\n\n"); + + print_usage(); + + printf (UT_HELP_VRSN); + printf (UT_EXTRA_OPTS); + + printf (UT_VERBOSE); + + printf (" %s\n", "-s, --serverip=IPADDRESS"); + printf (" %s\n", _("IP address of DHCP server that we must hear from")); + printf (" %s\n", "-r, --requestedip=IPADDRESS"); + printf (" %s\n", _("IP address that should be offered by at least one DHCP server")); + printf (" %s\n", "-t, --timeout=INTEGER"); + printf (" %s\n", _("Seconds to wait for DHCPOFFER before timeout occurs")); + printf (" %s\n", "-i, --interface=STRING"); + printf (" %s\n", _("Interface to to use for listening (i.e. eth0)")); + printf (" %s\n", "-m, --mac=STRING"); + printf (" %s\n", _("MAC address to use in the DHCP request")); + printf (" %s\n", "-u, --unicast"); + printf (" %s\n", _("Unicast testing: mimic a DHCP relay, requires -s")); + printf (" %s\n", "-x, --exclusive"); + printf (" %s\n", _("Only requested DHCP server may response (rogue DHCP server detection), requires -s")); + + printf (UT_SUPPORT); + return; +} + + +void +print_usage(void){ + + printf ("%s\n", _("Usage:")); + printf (" %s [-v] [-u] [-x] [-s serverip] [-r requestedip] [-t timeout]\n",progname); + printf (" [-i interface] [-m mac]\n"); + + return; +} diff --git a/plugins-root/check_icmp.c b/plugins-root/check_icmp.c new file mode 100644 index 0000000..303241d --- /dev/null +++ b/plugins-root/check_icmp.c @@ -0,0 +1,2109 @@ +/***************************************************************************** +* +* Monitoring check_icmp plugin +* +* License: GPL +* Copyright (c) 2005-2008 Monitoring Plugins Development Team +* Original Author : Andreas Ericsson <ae@op5.se> +* +* Description: +* +* This file contains the check_icmp plugin +* +* Relevant RFC's: 792 (ICMP), 791 (IP) +* +* This program was modeled somewhat after the check_icmp program, +* which was in turn a hack of fping (www.fping.org) but has been +* completely rewritten since to generate higher precision rta values, +* and support several different modes as well as setting ttl to control. +* redundant routes. The only remainders of fping is currently a few +* function names. +* +* +* 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 +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see <http://www.gnu.org/licenses/>. +* +* +*****************************************************************************/ + +/* progname may change */ +/* char *progname = "check_icmp"; */ +char *progname; +const char *copyright = "2005-2008"; +const char *email = "devel@monitoring-plugins.org"; + +/** Monitoring Plugins basic includes */ +#include "../plugins/common.h" +#include "netutils.h" +#include "utils.h" + +#if HAVE_SYS_SOCKIO_H +#include <sys/sockio.h> +#endif + +#include <sys/time.h> +#include <errno.h> +#include <signal.h> +#include <ctype.h> +#include <float.h> +#include <net/if.h> +#include <netinet/in_systm.h> +#include <netinet/in.h> +#include <netinet/ip.h> +#include <netinet/ip6.h> +#include <netinet/ip_icmp.h> +#include <netinet/icmp6.h> +#include <arpa/inet.h> + + +/** sometimes undefined system macros (quite a few, actually) **/ +#ifndef MAXTTL +# define MAXTTL 255 +#endif +#ifndef INADDR_NONE +# define INADDR_NONE (in_addr_t)(-1) +#endif + +#ifndef SOL_IP +#define SOL_IP 0 +#endif + +/* we bundle these in one #ifndef, since they're all from BSD + * Put individual #ifndef's around those that bother you */ +#ifndef ICMP_UNREACH_NET_UNKNOWN +# define ICMP_UNREACH_NET_UNKNOWN 6 +# define ICMP_UNREACH_HOST_UNKNOWN 7 +# define ICMP_UNREACH_ISOLATED 8 +# define ICMP_UNREACH_NET_PROHIB 9 +# define ICMP_UNREACH_HOST_PROHIB 10 +# define ICMP_UNREACH_TOSNET 11 +# define ICMP_UNREACH_TOSHOST 12 +#endif +/* tru64 has the ones above, but not these */ +#ifndef ICMP_UNREACH_FILTER_PROHIB +# define ICMP_UNREACH_FILTER_PROHIB 13 +# define ICMP_UNREACH_HOST_PRECEDENCE 14 +# define ICMP_UNREACH_PRECEDENCE_CUTOFF 15 +#endif + +typedef unsigned short range_t; /* type for get_range() -- unimplemented */ + +typedef struct rta_host { + unsigned short id; /* id in **table, and icmp pkts */ + char *name; /* arg used for adding this host */ + char *msg; /* icmp error message, if any */ + struct sockaddr_storage saddr_in; /* the address of this host */ + struct sockaddr_storage error_addr; /* stores address of error replies */ + unsigned long long time_waited; /* total time waited, in usecs */ + unsigned int icmp_sent, icmp_recv, icmp_lost; /* counters */ + unsigned char icmp_type, icmp_code; /* type and code from errors */ + unsigned short flags; /* control/status flags */ + double rta; /* measured RTA */ + int rta_status; // check result for RTA checks + double rtmax; /* max rtt */ + double rtmin; /* min rtt */ + double jitter; /* measured jitter */ + int jitter_status; // check result for Jitter checks + double jitter_max; /* jitter rtt maximum */ + double jitter_min; /* jitter rtt minimum */ + double EffectiveLatency; + double mos; /* Mean opnion score */ + int mos_status; // check result for MOS checks + double score; /* score */ + int score_status; // check result for score checks + u_int last_tdiff; + u_int last_icmp_seq; /* Last ICMP_SEQ to check out of order pkts */ + unsigned char pl; /* measured packet loss */ + int pl_status; // check result for packet loss checks + struct rta_host *next; /* linked list */ + int order_status; // check result for packet order checks +} rta_host; + +#define FLAG_LOST_CAUSE 0x01 /* decidedly dead target. */ + +/* threshold structure. all values are maximum allowed, exclusive */ +typedef struct threshold { + unsigned char pl; /* max allowed packet loss in percent */ + unsigned int rta; /* roundtrip time average, microseconds */ + double jitter; /* jitter time average, microseconds */ + double mos; /* MOS */ + double score; /* Score */ +} threshold; + +/* the data structure */ +typedef struct icmp_ping_data { + struct timeval stime; /* timestamp (saved in protocol struct as well) */ + unsigned short ping_id; +} icmp_ping_data; + +typedef union ip_hdr { + struct ip ip; + struct ip6_hdr ip6; +} ip_hdr; + +typedef union icmp_packet { + void *buf; + struct icmp *icp; + struct icmp6_hdr *icp6; + u_short *cksum_in; +} icmp_packet; + +/* the different modes of this program are as follows: + * MODE_RTA: send all packets no matter what (mimic check_icmp and check_ping) + * MODE_HOSTCHECK: Return immediately upon any sign of life + * In addition, sends packets to ALL addresses assigned + * to this host (as returned by gethostbyname() or + * gethostbyaddr() and expects one host only to be checked at + * a time. Therefore, any packet response what so ever will + * count as a sign of life, even when received outside + * crit.rta limit. Do not misspell any additional IP's. + * MODE_ALL: Requires packets from ALL requested IP to return OK (default). + * MODE_ICMP: implement something similar to check_icmp (MODE_RTA without + * tcp and udp args does this) + */ +#define MODE_RTA 0 +#define MODE_HOSTCHECK 1 +#define MODE_ALL 2 +#define MODE_ICMP 3 + +enum enum_threshold_mode { + const_rta_mode, + const_packet_loss_mode, + const_jitter_mode, + const_mos_mode, + const_score_mode +}; + +typedef enum enum_threshold_mode threshold_mode; + +/* the different ping types we can do + * TODO: investigate ARP ping as well */ +#define HAVE_ICMP 1 +#define HAVE_UDP 2 +#define HAVE_TCP 4 +#define HAVE_ARP 8 + +#define MIN_PING_DATA_SIZE sizeof(struct icmp_ping_data) +#define MAX_IP_PKT_SIZE 65536 /* (theoretical) max IP packet size */ +#define IP_HDR_SIZE 20 +#define MAX_PING_DATA (MAX_IP_PKT_SIZE - IP_HDR_SIZE - ICMP_MINLEN) +#define DEFAULT_PING_DATA_SIZE (MIN_PING_DATA_SIZE + 44) + +/* various target states */ +#define TSTATE_INACTIVE 0x01 /* don't ping this host anymore */ +#define TSTATE_WAITING 0x02 /* unanswered packets on the wire */ +#define TSTATE_ALIVE 0x04 /* target is alive (has answered something) */ +#define TSTATE_UNREACH 0x08 + +/** prototypes **/ +void print_help (void); +void print_usage (void); +static u_int get_timevar(const char *); +static u_int get_timevaldiff(struct timeval *, struct timeval *); +static in_addr_t get_ip_address(const char *); +static int wait_for_reply(int, u_int); +static int recvfrom_wto(int, void *, unsigned int, struct sockaddr *, u_int *, struct timeval*); +static int send_icmp_ping(int, struct rta_host *); +static int get_threshold(char *str, threshold *th); +static bool get_threshold2(char *str, size_t length, threshold *, threshold *, threshold_mode mode); +static bool parse_threshold2_helper(char *s, size_t length, threshold *thr, threshold_mode mode); +static void run_checks(void); +static void set_source_ip(char *); +static int add_target(char *); +static int add_target_ip(char *, struct sockaddr_storage *); +static int handle_random_icmp(unsigned char *, struct sockaddr_storage *); +static void parse_address(struct sockaddr_storage *, char *, int); +static unsigned short icmp_checksum(uint16_t *, size_t); +static void finish(int); +static void crash(const char *, ...); + +/** external **/ +extern int optind; +extern char *optarg; +extern char **environ; + +/** global variables **/ +static struct rta_host **table, *cursor, *list; + +static threshold crit = { + .pl = 80, + .rta = 500000, + .jitter = 0.0, + .mos = 0.0, + .score = 0.0 +}; +static threshold warn = { + .pl = 40, + .rta = 200000, + .jitter = 0.0, + .mos = 0.0, + .score = 0.0 +}; + +static int mode, protocols, sockets, debug = 0, timeout = 10; +static unsigned short icmp_data_size = DEFAULT_PING_DATA_SIZE; +static unsigned short icmp_pkt_size = DEFAULT_PING_DATA_SIZE + ICMP_MINLEN; + +static unsigned int icmp_sent = 0, icmp_recv = 0, icmp_lost = 0, ttl = 0; +#define icmp_pkts_en_route (icmp_sent - (icmp_recv + icmp_lost)) +static unsigned short targets_down = 0, targets = 0, packets = 0; +#define targets_alive (targets - targets_down) +static unsigned int retry_interval, pkt_interval, target_interval; +static int icmp_sock, tcp_sock, udp_sock, status = STATE_OK; +static pid_t pid; +static struct timezone tz; +static struct timeval prog_start; +static unsigned long long max_completion_time = 0; +static unsigned int warn_down = 1, crit_down = 1; /* host down threshold values */ +static int min_hosts_alive = -1; +float pkt_backoff_factor = 1.5; +float target_backoff_factor = 1.5; +bool rta_mode=false; +bool pl_mode=false; +bool jitter_mode=false; +bool score_mode=false; +bool mos_mode=false; +bool order_mode=false; + +/** code start **/ +static void +crash(const char *fmt, ...) +{ + va_list ap; + + printf("%s: ", progname); + + va_start(ap, fmt); + vprintf(fmt, ap); + va_end(ap); + + if(errno) printf(": %s", strerror(errno)); + puts(""); + + exit(3); +} + + +static const char * +get_icmp_error_msg(unsigned char icmp_type, unsigned char icmp_code) +{ + const char *msg = "unreachable"; + + if(debug > 1) printf("get_icmp_error_msg(%u, %u)\n", icmp_type, icmp_code); + switch(icmp_type) { + case ICMP_UNREACH: + switch(icmp_code) { + case ICMP_UNREACH_NET: msg = "Net unreachable"; break; + case ICMP_UNREACH_HOST: msg = "Host unreachable"; break; + case ICMP_UNREACH_PROTOCOL: msg = "Protocol unreachable (firewall?)"; break; + case ICMP_UNREACH_PORT: msg = "Port unreachable (firewall?)"; break; + case ICMP_UNREACH_NEEDFRAG: msg = "Fragmentation needed"; break; + case ICMP_UNREACH_SRCFAIL: msg = "Source route failed"; break; + case ICMP_UNREACH_ISOLATED: msg = "Source host isolated"; break; + case ICMP_UNREACH_NET_UNKNOWN: msg = "Unknown network"; break; + case ICMP_UNREACH_HOST_UNKNOWN: msg = "Unknown host"; break; + case ICMP_UNREACH_NET_PROHIB: msg = "Network denied (firewall?)"; break; + case ICMP_UNREACH_HOST_PROHIB: msg = "Host denied (firewall?)"; break; + case ICMP_UNREACH_TOSNET: msg = "Bad TOS for network (firewall?)"; break; + case ICMP_UNREACH_TOSHOST: msg = "Bad TOS for host (firewall?)"; break; + case ICMP_UNREACH_FILTER_PROHIB: msg = "Prohibited by filter (firewall)"; break; + case ICMP_UNREACH_HOST_PRECEDENCE: msg = "Host precedence violation"; break; + case ICMP_UNREACH_PRECEDENCE_CUTOFF: msg = "Precedence cutoff"; break; + default: msg = "Invalid code"; break; + } + break; + + case ICMP_TIMXCEED: + /* really 'out of reach', or non-existent host behind a router serving + * two different subnets */ + switch(icmp_code) { + case ICMP_TIMXCEED_INTRANS: msg = "Time to live exceeded in transit"; break; + case ICMP_TIMXCEED_REASS: msg = "Fragment reassembly time exceeded"; break; + default: msg = "Invalid code"; break; + } + break; + + case ICMP_SOURCEQUENCH: msg = "Transmitting too fast"; break; + case ICMP_REDIRECT: msg = "Redirect (change route)"; break; + case ICMP_PARAMPROB: msg = "Bad IP header (required option absent)"; break; + + /* the following aren't error messages, so ignore */ + case ICMP_TSTAMP: + case ICMP_TSTAMPREPLY: + case ICMP_IREQ: + case ICMP_IREQREPLY: + case ICMP_MASKREQ: + case ICMP_MASKREPLY: + default: msg = ""; break; + } + + return msg; +} + +static int +handle_random_icmp(unsigned char *packet, struct sockaddr_storage *addr) +{ + struct icmp p, sent_icmp; + struct rta_host *host = NULL; + + memcpy(&p, packet, sizeof(p)); + if(p.icmp_type == ICMP_ECHO && ntohs(p.icmp_id) == pid) { + /* echo request from us to us (pinging localhost) */ + return 0; + } + + if(debug) printf("handle_random_icmp(%p, %p)\n", (void *)&p, (void *)addr); + + /* only handle a few types, since others can't possibly be replies to + * us in a sane network (if it is anyway, it will be counted as lost + * at summary time, but not as quickly as a proper response */ + /* TIMXCEED can be an unreach from a router with multiple IP's which + * serves two different subnets on the same interface and a dead host + * on one net is pinged from the other. The router will respond to + * itself and thus set TTL=0 so as to not loop forever. Even when + * TIMXCEED actually sends a proper icmp response we will have passed + * too many hops to have a hope of reaching it later, in which case it + * indicates overconfidence in the network, poor routing or both. */ + if(p.icmp_type != ICMP_UNREACH && p.icmp_type != ICMP_TIMXCEED && + p.icmp_type != ICMP_SOURCEQUENCH && p.icmp_type != ICMP_PARAMPROB) + { + return 0; + } + + /* might be for us. At least it holds the original package (according + * to RFC 792). If it isn't, just ignore it */ + memcpy(&sent_icmp, packet + 28, sizeof(sent_icmp)); + if(sent_icmp.icmp_type != ICMP_ECHO || ntohs(sent_icmp.icmp_id) != pid || + ntohs(sent_icmp.icmp_seq) >= targets*packets) + { + if(debug) printf("Packet is no response to a packet we sent\n"); + return 0; + } + + /* it is indeed a response for us */ + host = table[ntohs(sent_icmp.icmp_seq)/packets]; + if(debug) { + char address[INET6_ADDRSTRLEN]; + parse_address(addr, address, sizeof(address)); + printf("Received \"%s\" from %s for ICMP ECHO sent to %s.\n", + get_icmp_error_msg(p.icmp_type, p.icmp_code), + address, host->name); + } + + icmp_lost++; + host->icmp_lost++; + /* don't spend time on lost hosts any more */ + if(host->flags & FLAG_LOST_CAUSE) return 0; + + /* source quench means we're sending too fast, so increase the + * interval and mark this packet lost */ + if(p.icmp_type == ICMP_SOURCEQUENCH) { + pkt_interval *= pkt_backoff_factor; + target_interval *= target_backoff_factor; + } + else { + targets_down++; + host->flags |= FLAG_LOST_CAUSE; + } + host->icmp_type = p.icmp_type; + host->icmp_code = p.icmp_code; + host->error_addr = *addr; + + return 0; +} + +void parse_address(struct sockaddr_storage *addr, char *address, int size) +{ + switch (address_family) { + case AF_INET: + inet_ntop(address_family, &((struct sockaddr_in *)addr)->sin_addr, address, size); + break; + case AF_INET6: + inet_ntop(address_family, &((struct sockaddr_in6 *)addr)->sin6_addr, address, size); + break; + } +} + +int +main(int argc, char **argv) +{ + int i; + char *ptr; + long int arg; + int icmp_sockerrno, udp_sockerrno, tcp_sockerrno; + int result; + struct rta_host *host; +#ifdef HAVE_SIGACTION + struct sigaction sig_action; +#endif +#ifdef SO_TIMESTAMP + int on = 1; +#endif + char *source_ip = NULL; + char * opts_str = "vhVw:c:n:p:t:H:s:i:b:I:l:m:P:R:J:S:M:O64"; + setlocale (LC_ALL, ""); + bindtextdomain (PACKAGE, LOCALEDIR); + textdomain (PACKAGE); + + /* we only need to be setsuid when we get the sockets, so do + * that before pointer magic (esp. on network data) */ + icmp_sockerrno = udp_sockerrno = tcp_sockerrno = sockets = 0; + + address_family = -1; + int icmp_proto = IPPROTO_ICMP; + + /* get calling name the old-fashioned way for portability instead + * of relying on the glibc-ism __progname */ + ptr = strrchr(argv[0], '/'); + if(ptr) progname = &ptr[1]; + else progname = argv[0]; + + /* now set defaults. Use progname to set them initially (allows for + * superfast check_host program when target host is up */ + cursor = list = NULL; + table = NULL; + + mode = MODE_RTA; + /* Default critical thresholds */ + crit.rta = 500000; + crit.pl = 80; + crit.jitter = 50; + crit.mos= 3; + crit.score=70; + /* Default warning thresholds */ + warn.rta = 200000; + warn.pl = 40; + warn.jitter = 40; + warn.mos= 3.5; + warn.score=80; + + protocols = HAVE_ICMP | HAVE_UDP | HAVE_TCP; + pkt_interval = 80000; /* 80 msec packet interval by default */ + packets = 5; + + if(!strcmp(progname, "check_icmp") || !strcmp(progname, "check_ping")) { + mode = MODE_ICMP; + protocols = HAVE_ICMP; + } + else if(!strcmp(progname, "check_host")) { + mode = MODE_HOSTCHECK; + pkt_interval = 1000000; + packets = 5; + crit.rta = warn.rta = 1000000; + crit.pl = warn.pl = 100; + } + else if(!strcmp(progname, "check_rta_multi")) { + mode = MODE_ALL; + target_interval = 0; + pkt_interval = 50000; + packets = 5; + } + + /* support "--help" and "--version" */ + if(argc == 2) { + if(!strcmp(argv[1], "--help")) + strcpy(argv[1], "-h"); + if(!strcmp(argv[1], "--version")) + strcpy(argv[1], "-V"); + } + + /* Parse protocol arguments first */ + for(i = 1; i < argc; i++) { + while((arg = getopt(argc, argv, opts_str)) != EOF) { + switch(arg) { + case '4': + if (address_family != -1) + crash("Multiple protocol versions not supported"); + address_family = AF_INET; + break; + case '6': +#ifdef USE_IPV6 + if (address_family != -1) + crash("Multiple protocol versions not supported"); + address_family = AF_INET6; +#else + usage (_("IPv6 support not available\n")); +#endif + break; + } + } + } + + /* Reset argument scanning */ + optind = 1; + + unsigned long size; + bool err; + /* parse the arguments */ + for(i = 1; i < argc; i++) { + while((arg = getopt(argc, argv, opts_str)) != EOF) { + switch(arg) { + case 'v': + debug++; + break; + case 'b': + size = strtol(optarg,NULL,0); + if (size >= (sizeof(struct icmp) + sizeof(struct icmp_ping_data)) && + size < MAX_PING_DATA) { + icmp_data_size = size; + icmp_pkt_size = size + ICMP_MINLEN; + } else + usage_va("ICMP data length must be between: %lu and %lu", + sizeof(struct icmp) + sizeof(struct icmp_ping_data), + MAX_PING_DATA - 1); + break; + case 'i': + pkt_interval = get_timevar(optarg); + break; + case 'I': + target_interval = get_timevar(optarg); + break; + case 'w': + get_threshold(optarg, &warn); + break; + case 'c': + get_threshold(optarg, &crit); + break; + case 'n': + case 'p': + packets = strtoul(optarg, NULL, 0); + break; + case 't': + timeout = strtoul(optarg, NULL, 0); + if(!timeout) timeout = 10; + break; + case 'H': + add_target(optarg); + break; + case 'l': + ttl = (int)strtoul(optarg, NULL, 0); + break; + case 'm': + min_hosts_alive = (int)strtoul(optarg, NULL, 0); + break; + case 'd': /* implement later, for cluster checks */ + warn_down = (unsigned char)strtoul(optarg, &ptr, 0); + if(ptr) { + crit_down = (unsigned char)strtoul(ptr + 1, NULL, 0); + } + break; + case 's': /* specify source IP address */ + source_ip = optarg; + break; + case 'V': /* version */ + print_revision (progname, NP_VERSION); + exit (STATE_UNKNOWN); + case 'h': /* help */ + print_help (); + exit (STATE_UNKNOWN); + break; + case 'R': /* RTA mode */ + err = get_threshold2(optarg, strlen(optarg), &warn, &crit, const_rta_mode); + if (!err) { + crash("Failed to parse RTA threshold"); + } + + rta_mode=true; + break; + case 'P': /* packet loss mode */ + err = get_threshold2(optarg, strlen(optarg), &warn, &crit, const_packet_loss_mode); + if (!err) { + crash("Failed to parse packet loss threshold"); + } + + pl_mode=true; + break; + case 'J': /* jitter mode */ + err = get_threshold2(optarg, strlen(optarg), &warn, &crit, const_jitter_mode); + if (!err) { + crash("Failed to parse jitter threshold"); + } + + jitter_mode=true; + break; + case 'M': /* MOS mode */ + err = get_threshold2(optarg, strlen(optarg), &warn, &crit, const_mos_mode); + if (!err) { + crash("Failed to parse MOS threshold"); + } + + mos_mode=true; + break; + case 'S': /* score mode */ + err = get_threshold2(optarg, strlen(optarg), &warn, &crit, const_score_mode); + if (!err) { + crash("Failed to parse score threshold"); + } + + score_mode=true; + break; + case 'O': /* out of order mode */ + order_mode=true; + break; + } + } + } + + /* POSIXLY_CORRECT might break things, so unset it (the portable way) */ + environ = NULL; + + /* use the pid to mark packets as ours */ + /* Some systems have 32-bit pid_t so mask off only 16 bits */ + pid = getpid() & 0xffff; + /* printf("pid = %u\n", pid); */ + + /* Parse extra opts if any */ + argv=np_extra_opts(&argc, argv, progname); + + argv = &argv[optind]; + while(*argv) { + add_target(*argv); + argv++; + } + + if(!targets) { + errno = 0; + crash("No hosts to check"); + } + + // add_target might change address_family + switch ( address_family ){ + case AF_INET: icmp_proto = IPPROTO_ICMP; + break; + case AF_INET6: icmp_proto = IPPROTO_ICMPV6; + break; + default: crash("Address family not supported"); + } + if((icmp_sock = socket(address_family, SOCK_RAW, icmp_proto)) != -1) + sockets |= HAVE_ICMP; + else icmp_sockerrno = errno; + + if( source_ip ) + set_source_ip(source_ip); + +#ifdef SO_TIMESTAMP + if(setsockopt(icmp_sock, SOL_SOCKET, SO_TIMESTAMP, &on, sizeof(on))) + if(debug) printf("Warning: no SO_TIMESTAMP support\n"); +#endif // SO_TIMESTAMP + + /* now drop privileges (no effect if not setsuid or geteuid() == 0) */ + if (setuid(getuid()) == -1) { + printf("ERROR: Failed to drop privileges\n"); + return 1; + } + + if(!sockets) { + if(icmp_sock == -1) { + errno = icmp_sockerrno; + crash("Failed to obtain ICMP socket"); + return -1; + } + /* if(udp_sock == -1) { */ + /* errno = icmp_sockerrno; */ + /* crash("Failed to obtain UDP socket"); */ + /* return -1; */ + /* } */ + /* if(tcp_sock == -1) { */ + /* errno = icmp_sockerrno; */ + /* crash("Failed to obtain TCP socker"); */ + /* return -1; */ + /* } */ + } + if(!ttl) ttl = 64; + + if(icmp_sock) { + result = setsockopt(icmp_sock, SOL_IP, IP_TTL, &ttl, sizeof(ttl)); + if(debug) { + if(result == -1) printf("setsockopt failed\n"); + else printf("ttl set to %u\n", ttl); + } + } + + /* stupid users should be able to give whatever thresholds they want + * (nothing will break if they do), but some anal plugin maintainer + * will probably add some printf() thing here later, so it might be + * best to at least show them where to do it. ;) */ + if(warn.pl > crit.pl) warn.pl = crit.pl; + if(warn.rta > crit.rta) warn.rta = crit.rta; + if(warn_down > crit_down) crit_down = warn_down; + if(warn.jitter > crit.jitter) crit.jitter = warn.jitter; + if(warn.mos < crit.mos) warn.mos = crit.mos; + if(warn.score < crit.score) warn.score = crit.score; + +#ifdef HAVE_SIGACTION + sig_action.sa_sigaction = NULL; + sig_action.sa_handler = finish; + sigfillset(&sig_action.sa_mask); + sig_action.sa_flags = SA_NODEFER|SA_RESTART; + sigaction(SIGINT, &sig_action, NULL); + sigaction(SIGHUP, &sig_action, NULL); + sigaction(SIGTERM, &sig_action, NULL); + sigaction(SIGALRM, &sig_action, NULL); +#else /* HAVE_SIGACTION */ + signal(SIGINT, finish); + signal(SIGHUP, finish); + signal(SIGTERM, finish); + signal(SIGALRM, finish); +#endif /* HAVE_SIGACTION */ + if(debug) printf("Setting alarm timeout to %u seconds\n", timeout); + alarm(timeout); + + /* make sure we don't wait any longer than necessary */ + gettimeofday(&prog_start, &tz); + max_completion_time = + ((targets * packets * pkt_interval) + (targets * target_interval)) + + (targets * packets * crit.rta) + crit.rta; + + if(debug) { + printf("packets: %u, targets: %u\n" + "target_interval: %0.3f, pkt_interval %0.3f\n" + "crit.rta: %0.3f\n" + "max_completion_time: %0.3f\n", + packets, targets, + (float)target_interval / 1000, (float)pkt_interval / 1000, + (float)crit.rta / 1000, + (float)max_completion_time / 1000); + } + + if(debug) { + if(max_completion_time > (u_int)timeout * 1000000) { + printf("max_completion_time: %llu timeout: %u\n", + max_completion_time, timeout); + printf("Timeout must be at least %llu\n", + max_completion_time / 1000000 + 1); + } + } + + if(debug) { + printf("crit = {%u, %u%%}, warn = {%u, %u%%}\n", + crit.rta, crit.pl, warn.rta, warn.pl); + printf("pkt_interval: %u target_interval: %u retry_interval: %u\n", + pkt_interval, target_interval, retry_interval); + printf("icmp_pkt_size: %u timeout: %u\n", + icmp_pkt_size, timeout); + } + + if(packets > 20) { + errno = 0; + crash("packets is > 20 (%d)", packets); + } + + if(min_hosts_alive < -1) { + errno = 0; + crash("minimum alive hosts is negative (%i)", min_hosts_alive); + } + + host = list; + table = malloc(sizeof(struct rta_host *) * targets); + if(!table) { + crash("main(): malloc failed for host table"); + } + + i = 0; + while(host) { + host->id = i*packets; + table[i] = host; + host = host->next; + i++; + } + + run_checks(); + + errno = 0; + finish(0); + + return(0); +} + +static void +run_checks() +{ + u_int i, t; + u_int final_wait, time_passed; + + /* this loop might actually violate the pkt_interval or target_interval + * settings, but only if there aren't any packets on the wire which + * indicates that the target can handle an increased packet rate */ + for(i = 0; i < packets; i++) { + for(t = 0; t < targets; t++) { + /* don't send useless packets */ + if(!targets_alive) finish(0); + if(table[t]->flags & FLAG_LOST_CAUSE) { + if(debug) printf("%s is a lost cause. not sending any more\n", + table[t]->name); + continue; + } + + /* we're still in the game, so send next packet */ + (void)send_icmp_ping(icmp_sock, table[t]); + wait_for_reply(icmp_sock, target_interval); + } + wait_for_reply(icmp_sock, pkt_interval * targets); + } + + if(icmp_pkts_en_route && targets_alive) { + time_passed = get_timevaldiff(NULL, NULL); + final_wait = max_completion_time - time_passed; + + if(debug) { + printf("time_passed: %u final_wait: %u max_completion_time: %llu\n", + time_passed, final_wait, max_completion_time); + } + if(time_passed > max_completion_time) { + if(debug) printf("Time passed. Finishing up\n"); + finish(0); + } + + /* catch the packets that might come in within the timeframe, but + * haven't yet */ + if(debug) printf("Waiting for %u micro-seconds (%0.3f msecs)\n", + final_wait, (float)final_wait / 1000); + wait_for_reply(icmp_sock, final_wait); + } +} + + +/* response structure: + * IPv4: + * ip header : 20 bytes + * icmp header : 28 bytes + * IPv6: + * ip header : 40 bytes + * icmp header : 28 bytes + * both: + * icmp echo reply : the rest + */ +static int +wait_for_reply(int sock, u_int t) +{ + int n, hlen; + static unsigned char buf[65536]; + struct sockaddr_storage resp_addr; + union ip_hdr *ip; + union icmp_packet packet; + struct rta_host *host; + struct icmp_ping_data data; + struct timeval wait_start, now; + u_int tdiff, i, per_pkt_wait; + double jitter_tmp; + + if (!(packet.buf = malloc(icmp_pkt_size))) { + crash("send_icmp_ping(): failed to malloc %d bytes for send buffer", + icmp_pkt_size); + return -1; /* might be reached if we're in debug mode */ + } + + memset(packet.buf, 0, icmp_pkt_size); + + /* if we can't listen or don't have anything to listen to, just return */ + if(!t || !icmp_pkts_en_route) { + free(packet.buf); + return 0; + } + + gettimeofday(&wait_start, &tz); + + i = t; + per_pkt_wait = t / icmp_pkts_en_route; + while(icmp_pkts_en_route && get_timevaldiff(&wait_start, NULL) < i) { + t = per_pkt_wait; + + /* wrap up if all targets are declared dead */ + if(!targets_alive || + get_timevaldiff(&prog_start, NULL) >= max_completion_time || + (mode == MODE_HOSTCHECK && targets_down)) + { + finish(0); + } + + /* reap responses until we hit a timeout */ + n = recvfrom_wto(sock, buf, sizeof(buf), + (struct sockaddr *)&resp_addr, &t, &now); + if(!n) { + if(debug > 1) { + printf("recvfrom_wto() timed out during a %u usecs wait\n", + per_pkt_wait); + } + continue; /* timeout for this one, so keep trying */ + } + if(n < 0) { + if(debug) printf("recvfrom_wto() returned errors\n"); + free(packet.buf); + return n; + } + + // FIXME: with ipv6 we don't have an ip header here + if (address_family != AF_INET6) { + ip = (union ip_hdr *)buf; + + if(debug > 1) { + char address[INET6_ADDRSTRLEN]; + parse_address(&resp_addr, address, sizeof(address)); + printf("received %u bytes from %s\n", + address_family == AF_INET6 ? ntohs(ip->ip6.ip6_plen) + : ntohs(ip->ip.ip_len), + address); + } + } + +/* obsolete. alpha on tru64 provides the necessary defines, but isn't broken */ +/* #if defined( __alpha__ ) && __STDC__ && !defined( __GLIBC__ ) */ + /* alpha headers are decidedly broken. Using an ansi compiler, + * they provide ip_vhl instead of ip_hl and ip_v, so we mask + * off the bottom 4 bits */ +/* hlen = (ip->ip_vhl & 0x0f) << 2; */ +/* #else */ + hlen = (address_family == AF_INET6) ? 0 : ip->ip.ip_hl << 2; +/* #endif */ + + if(n < (hlen + ICMP_MINLEN)) { + char address[INET6_ADDRSTRLEN]; + parse_address(&resp_addr, address, sizeof(address)); + crash("received packet too short for ICMP (%d bytes, expected %d) from %s\n", + n, hlen + icmp_pkt_size, address); + } + /* else if(debug) { */ + /* printf("ip header size: %u, packet size: %u (expected %u, %u)\n", */ + /* hlen, ntohs(ip->ip_len) - hlen, */ + /* sizeof(struct ip), icmp_pkt_size); */ + /* } */ + + /* check the response */ + + memcpy(packet.buf, buf + hlen, icmp_pkt_size); +/* address_family == AF_INET6 ? sizeof(struct icmp6_hdr) + : sizeof(struct icmp));*/ + + if( (address_family == PF_INET && + (ntohs(packet.icp->icmp_id) != pid || packet.icp->icmp_type != ICMP_ECHOREPLY + || ntohs(packet.icp->icmp_seq) >= targets * packets)) + || (address_family == PF_INET6 && + (ntohs(packet.icp6->icmp6_id) != pid || packet.icp6->icmp6_type != ICMP6_ECHO_REPLY + || ntohs(packet.icp6->icmp6_seq) >= targets * packets))) { + if(debug > 2) printf("not a proper ICMP_ECHOREPLY\n"); + handle_random_icmp(buf + hlen, &resp_addr); + continue; + } + + /* this is indeed a valid response */ + if (address_family == PF_INET) { + memcpy(&data, packet.icp->icmp_data, sizeof(data)); + if (debug > 2) + printf("ICMP echo-reply of len %lu, id %u, seq %u, cksum 0x%X\n", + (unsigned long)sizeof(data), ntohs(packet.icp->icmp_id), + ntohs(packet.icp->icmp_seq), packet.icp->icmp_cksum); + host = table[ntohs(packet.icp->icmp_seq)/packets]; + } else { + memcpy(&data, &packet.icp6->icmp6_dataun.icmp6_un_data8[4], sizeof(data)); + if (debug > 2) + printf("ICMP echo-reply of len %lu, id %u, seq %u, cksum 0x%X\n", + (unsigned long)sizeof(data), ntohs(packet.icp6->icmp6_id), + ntohs(packet.icp6->icmp6_seq), packet.icp6->icmp6_cksum); + host = table[ntohs(packet.icp6->icmp6_seq)/packets]; + } + + tdiff = get_timevaldiff(&data.stime, &now); + + if (host->last_tdiff>0) { + /* Calculate jitter */ + if (host->last_tdiff > tdiff) { + jitter_tmp = host->last_tdiff - tdiff; + } else { + jitter_tmp = tdiff - host->last_tdiff; + } + + if (host->jitter==0) { + host->jitter=jitter_tmp; + host->jitter_max=jitter_tmp; + host->jitter_min=jitter_tmp; + } else { + host->jitter+=jitter_tmp; + + if (jitter_tmp < host->jitter_min) { + host->jitter_min=jitter_tmp; + } + + if (jitter_tmp > host->jitter_max) { + host->jitter_max=jitter_tmp; + } + } + + /* Check if packets in order */ + if (host->last_icmp_seq >= packet.icp->icmp_seq) + host->order_status=STATE_CRITICAL; + } + host->last_tdiff=tdiff; + + host->last_icmp_seq=packet.icp->icmp_seq; + + host->time_waited += tdiff; + host->icmp_recv++; + icmp_recv++; + if (tdiff > (unsigned int)host->rtmax) + host->rtmax = tdiff; + if (tdiff < (unsigned int)host->rtmin) + host->rtmin = tdiff; + + if(debug) { + char address[INET6_ADDRSTRLEN]; + parse_address(&resp_addr, address, sizeof(address)); + + switch(address_family) { + case AF_INET: { + printf("%0.3f ms rtt from %s, outgoing ttl: %u, incoming ttl: %u, max: %0.3f, min: %0.3f\n", + (float)tdiff / 1000, + address, + ttl, + ip->ip.ip_ttl, + (float)host->rtmax / 1000, + (float)host->rtmin / 1000); + break; + }; + case AF_INET6: { + printf("%0.3f ms rtt from %s, outgoing ttl: %u, max: %0.3f, min: %0.3f\n", + (float)tdiff / 1000, + address, + ttl, + (float)host->rtmax / 1000, + (float)host->rtmin / 1000); + }; + } + } + + /* if we're in hostcheck mode, exit with limited printouts */ + if(mode == MODE_HOSTCHECK) { + printf("OK - %s responds to ICMP. Packet %u, rta %0.3fms|" + "pkt=%u;;;0;%u rta=%0.3f;%0.3f;%0.3f;;\n", + host->name, icmp_recv, (float)tdiff / 1000, + icmp_recv, packets, (float)tdiff / 1000, + (float)warn.rta / 1000, (float)crit.rta / 1000); + exit(STATE_OK); + } + } + + free(packet.buf); + return 0; +} + +/* the ping functions */ +static int +send_icmp_ping(int sock, struct rta_host *host) +{ + long int len; + size_t addrlen; + struct icmp_ping_data data; + struct msghdr hdr; + struct iovec iov; + struct timeval tv; + void *buf = NULL; + + if(sock == -1) { + errno = 0; + crash("Attempt to send on bogus socket"); + return -1; + } + + if(!buf) { + if (!(buf = malloc(icmp_pkt_size))) { + crash("send_icmp_ping(): failed to malloc %d bytes for send buffer", + icmp_pkt_size); + return -1; /* might be reached if we're in debug mode */ + } + } + memset(buf, 0, icmp_pkt_size); + + if((gettimeofday(&tv, &tz)) == -1) { + free(buf); + return -1; + } + + data.ping_id = 10; /* host->icmp.icmp_sent; */ + memcpy(&data.stime, &tv, sizeof(tv)); + + if (address_family == AF_INET) { + struct icmp *icp = (struct icmp*)buf; + addrlen = sizeof(struct sockaddr_in); + + memcpy(&icp->icmp_data, &data, sizeof(data)); + + icp->icmp_type = ICMP_ECHO; + icp->icmp_code = 0; + icp->icmp_cksum = 0; + icp->icmp_id = htons(pid); + icp->icmp_seq = htons(host->id++); + icp->icmp_cksum = icmp_checksum((uint16_t*)buf, (size_t)icmp_pkt_size); + + if (debug > 2) + printf("Sending ICMP echo-request of len %lu, id %u, seq %u, cksum 0x%X to host %s\n", + (unsigned long)sizeof(data), ntohs(icp->icmp_id), ntohs(icp->icmp_seq), icp->icmp_cksum, host->name); + } + else { + struct icmp6_hdr *icp6 = (struct icmp6_hdr*)buf; + addrlen = sizeof(struct sockaddr_in6); + + memcpy(&icp6->icmp6_dataun.icmp6_un_data8[4], &data, sizeof(data)); + + icp6->icmp6_type = ICMP6_ECHO_REQUEST; + icp6->icmp6_code = 0; + icp6->icmp6_cksum = 0; + icp6->icmp6_id = htons(pid); + icp6->icmp6_seq = htons(host->id++); + // let checksum be calculated automatically + + if (debug > 2) { + printf("Sending ICMP echo-request of len %lu, id %u, seq %u, cksum 0x%X to host %s\n", + (unsigned long)sizeof(data), ntohs(icp6->icmp6_id), + ntohs(icp6->icmp6_seq), icp6->icmp6_cksum, host->name); + } + } + + memset(&iov, 0, sizeof(iov)); + iov.iov_base = buf; + iov.iov_len = icmp_pkt_size; + + memset(&hdr, 0, sizeof(hdr)); + hdr.msg_name = (struct sockaddr *)&host->saddr_in; + hdr.msg_namelen = addrlen; + hdr.msg_iov = &iov; + hdr.msg_iovlen = 1; + + errno = 0; + +/* MSG_CONFIRM is a linux thing and only available on linux kernels >= 2.3.15, see send(2) */ +#ifdef MSG_CONFIRM + len = sendmsg(sock, &hdr, MSG_CONFIRM); +#else + len = sendmsg(sock, &hdr, 0); +#endif + + free(buf); + + if(len < 0 || (unsigned int)len != icmp_pkt_size) { + if(debug) { + char address[INET6_ADDRSTRLEN]; + parse_address((struct sockaddr_storage *)&host->saddr_in, address, sizeof(address)); + printf("Failed to send ping to %s: %s\n", address, strerror(errno)); + } + errno = 0; + return -1; + } + + icmp_sent++; + host->icmp_sent++; + + return 0; +} + +static int +recvfrom_wto(int sock, void *buf, unsigned int len, struct sockaddr *saddr, + u_int *timo, struct timeval* tv) +{ + u_int slen; + int n, ret; + struct timeval to, then, now; + fd_set rd, wr; +#ifdef HAVE_MSGHDR_MSG_CONTROL + char ans_data[4096]; +#endif // HAVE_MSGHDR_MSG_CONTROL + struct msghdr hdr; + struct iovec iov; +#ifdef SO_TIMESTAMP + struct cmsghdr* chdr; +#endif + + if(!*timo) { + if(debug) printf("*timo is not\n"); + return 0; + } + + to.tv_sec = *timo / 1000000; + to.tv_usec = (*timo - (to.tv_sec * 1000000)); + + FD_ZERO(&rd); + FD_ZERO(&wr); + FD_SET(sock, &rd); + errno = 0; + gettimeofday(&then, &tz); + n = select(sock + 1, &rd, &wr, NULL, &to); + if(n < 0) crash("select() in recvfrom_wto"); + gettimeofday(&now, &tz); + *timo = get_timevaldiff(&then, &now); + + if(!n) return 0; /* timeout */ + + slen = sizeof(struct sockaddr_storage); + + memset(&iov, 0, sizeof(iov)); + iov.iov_base = buf; + iov.iov_len = len; + + memset(&hdr, 0, sizeof(hdr)); + hdr.msg_name = saddr; + hdr.msg_namelen = slen; + hdr.msg_iov = &iov; + hdr.msg_iovlen = 1; +#ifdef HAVE_MSGHDR_MSG_CONTROL + hdr.msg_control = ans_data; + hdr.msg_controllen = sizeof(ans_data); +#endif + + ret = recvmsg(sock, &hdr, 0); +#ifdef SO_TIMESTAMP + for(chdr = CMSG_FIRSTHDR(&hdr); chdr; chdr = CMSG_NXTHDR(&hdr, chdr)) { + if(chdr->cmsg_level == SOL_SOCKET + && chdr->cmsg_type == SO_TIMESTAMP + && chdr->cmsg_len >= CMSG_LEN(sizeof(struct timeval))) { + memcpy(tv, CMSG_DATA(chdr), sizeof(*tv)); + break ; + } + } + + if (!chdr) +#endif // SO_TIMESTAMP + gettimeofday(tv, &tz); + return (ret); +} + +static void +finish(int sig) +{ + u_int i = 0; + unsigned char pl; + double rta; + struct rta_host *host; + const char *status_string[] = + {"OK", "WARNING", "CRITICAL", "UNKNOWN", "DEPENDENT"}; + int hosts_ok = 0; + int hosts_warn = 0; + int this_status; + double R; + + alarm(0); + if(debug > 1) printf("finish(%d) called\n", sig); + + if(icmp_sock != -1) close(icmp_sock); + if(udp_sock != -1) close(udp_sock); + if(tcp_sock != -1) close(tcp_sock); + + if(debug) { + printf("icmp_sent: %u icmp_recv: %u icmp_lost: %u\n", + icmp_sent, icmp_recv, icmp_lost); + printf("targets: %u targets_alive: %u\n", targets, targets_alive); + } + + /* iterate thrice to calculate values, give output, and print perfparse */ + status=STATE_OK; + host = list; + + while(host) { + this_status = STATE_OK; + + if(!host->icmp_recv) { + /* rta 0 is ofcourse not entirely correct, but will still show up + * conspicuously as missing entries in perfparse and cacti */ + pl = 100; + rta = 0; + status = STATE_CRITICAL; + /* up the down counter if not already counted */ + if(!(host->flags & FLAG_LOST_CAUSE) && targets_alive) targets_down++; + } else { + pl = ((host->icmp_sent - host->icmp_recv) * 100) / host->icmp_sent; + rta = (double)host->time_waited / host->icmp_recv; + } + + if (host->icmp_recv>1) { + /* + * This algorithm is probably pretty much blindly copied from + * locations like this one: https://www.slac.stanford.edu/comp/net/wan-mon/tutorial.html#mos + * It calculates a MOS value (range of 1 to 5, where 1 is bad and 5 really good). + * According to some quick research MOS originates from the Audio/Video transport network area. + * Whether it can and should be computed from ICMP data, I can not say. + * + * Anyway the basic idea is to map a value "R" with a range of 0-100 to the MOS value + * + * MOS stands likely for Mean Opinion Score ( https://en.wikipedia.org/wiki/Mean_Opinion_Score ) + * + * More links: + * - https://confluence.slac.stanford.edu/display/IEPM/MOS + */ + host->jitter=(host->jitter / (host->icmp_recv - 1)/1000); + + /* + * Take the average round trip latency (in milliseconds), add + * round trip jitter, but double the impact to latency + * then add 10 for protocol latencies (in milliseconds). + */ + host->EffectiveLatency = (rta/1000) + host->jitter * 2 + 10; + + if (host->EffectiveLatency < 160) { + R = 93.2 - (host->EffectiveLatency / 40); + } else { + R = 93.2 - ((host->EffectiveLatency - 120) / 10); + } + + // Now, let us deduct 2.5 R values per percentage of packet loss (i.e. a + // loss of 5% will be entered as 5). + R = R - (pl * 2.5); + + if (R < 0) { + R = 0; + } + + host->score = R; + host->mos= 1 + ((0.035) * R) + ((.000007) * R * (R-60) * (100-R)); + } else { + host->jitter=0; + host->jitter_min=0; + host->jitter_max=0; + host->mos=0; + } + + host->pl = pl; + host->rta = rta; + + /* if no new mode selected, use old schema */ + if (!rta_mode && !pl_mode && !jitter_mode && !score_mode && !mos_mode && !order_mode) { + rta_mode = true; + pl_mode = true; + } + + /* Check which mode is on and do the warn / Crit stuff */ + if (rta_mode) { + if(rta >= crit.rta) { + this_status = STATE_CRITICAL; + status = STATE_CRITICAL; + host->rta_status=STATE_CRITICAL; + } else if(status!=STATE_CRITICAL && (rta >= warn.rta)) { + this_status = (this_status <= STATE_WARNING ? STATE_WARNING : this_status); + status = STATE_WARNING; + host->rta_status=STATE_WARNING; + } + } + + if (pl_mode) { + if(pl >= crit.pl) { + this_status = STATE_CRITICAL; + status = STATE_CRITICAL; + host->pl_status=STATE_CRITICAL; + } else if(status!=STATE_CRITICAL && (pl >= warn.pl)) { + this_status = (this_status <= STATE_WARNING ? STATE_WARNING : this_status); + status = STATE_WARNING; + host->pl_status=STATE_WARNING; + } + } + + if (jitter_mode) { + if(host->jitter >= crit.jitter) { + this_status = STATE_CRITICAL; + status = STATE_CRITICAL; + host->jitter_status=STATE_CRITICAL; + } else if(status!=STATE_CRITICAL && (host->jitter >= warn.jitter)) { + this_status = (this_status <= STATE_WARNING ? STATE_WARNING : this_status); + status = STATE_WARNING; + host->jitter_status=STATE_WARNING; + } + } + + if (mos_mode) { + if(host->mos <= crit.mos) { + this_status = STATE_CRITICAL; + status = STATE_CRITICAL; + host->mos_status=STATE_CRITICAL; + } else if(status!=STATE_CRITICAL && (host->mos <= warn.mos)) { + this_status = (this_status <= STATE_WARNING ? STATE_WARNING : this_status); + status = STATE_WARNING; + host->mos_status=STATE_WARNING; + } + } + + if (score_mode) { + if(host->score <= crit.score) { + this_status = STATE_CRITICAL; + status = STATE_CRITICAL; + host->score_status=STATE_CRITICAL; + } else if(status!=STATE_CRITICAL && (host->score <= warn.score)) { + this_status = (this_status <= STATE_WARNING ? STATE_WARNING : this_status); + status = STATE_WARNING; + host->score_status=STATE_WARNING; + } + } + + if (this_status == STATE_WARNING) { + hosts_warn++; + } else if (this_status == STATE_OK) { + hosts_ok++; + } + + host = host->next; + } + + + /* this is inevitable */ + if(!targets_alive) status = STATE_CRITICAL; + if(min_hosts_alive > -1) { + if(hosts_ok >= min_hosts_alive) status = STATE_OK; + else if((hosts_ok + hosts_warn) >= min_hosts_alive) status = STATE_WARNING; + } + printf("%s - ", status_string[status]); + + host = list; + while(host) { + + if(debug) puts(""); + if(i) { + if(i < targets) printf(" :: "); + else printf("\n"); + } + i++; + if(!host->icmp_recv) { + status = STATE_CRITICAL; + host->rtmin=0; + host->jitter_min=0; + if(host->flags & FLAG_LOST_CAUSE) { + char address[INET6_ADDRSTRLEN]; + parse_address(&host->error_addr, address, sizeof(address)); + printf("%s: %s @ %s. rta nan, lost %d%%", + host->name, + get_icmp_error_msg(host->icmp_type, host->icmp_code), + address, + 100); + } else { /* not marked as lost cause, so we have no flags for it */ + printf("%s: rta nan, lost 100%%", host->name); + } + } else { /* !icmp_recv */ + printf("%s", host->name); + /* rta text output */ + if (rta_mode) { + if (status == STATE_OK) + printf(" rta %0.3fms", host->rta / 1000); + else if (status==STATE_WARNING && host->rta_status==status) + printf(" rta %0.3fms > %0.3fms", (float)host->rta / 1000, (float)warn.rta/1000); + else if (status==STATE_CRITICAL && host->rta_status==status) + printf(" rta %0.3fms > %0.3fms", (float)host->rta / 1000, (float)crit.rta/1000); + } + /* pl text output */ + if (pl_mode) { + if (status == STATE_OK) + printf(" lost %u%%", host->pl); + else if (status==STATE_WARNING && host->pl_status==status) + printf(" lost %u%% > %u%%", host->pl, warn.pl); + else if (status==STATE_CRITICAL && host->pl_status==status) + printf(" lost %u%% > %u%%", host->pl, crit.pl); + } + /* jitter text output */ + if (jitter_mode) { + if (status == STATE_OK) + printf(" jitter %0.3fms", (float)host->jitter); + else if (status==STATE_WARNING && host->jitter_status==status) + printf(" jitter %0.3fms > %0.3fms", (float)host->jitter, warn.jitter); + else if (status==STATE_CRITICAL && host->jitter_status==status) + printf(" jitter %0.3fms > %0.3fms", (float)host->jitter, crit.jitter); + } + /* mos text output */ + if (mos_mode) { + if (status == STATE_OK) + printf(" MOS %0.1f", (float)host->mos); + else if (status==STATE_WARNING && host->mos_status==status) + printf(" MOS %0.1f < %0.1f", (float)host->mos, (float)warn.mos); + else if (status==STATE_CRITICAL && host->mos_status==status) + printf(" MOS %0.1f < %0.1f", (float)host->mos, (float)crit.mos); + } + /* score text output */ + if (score_mode) { + if (status == STATE_OK) + printf(" Score %u", (int)host->score); + else if (status==STATE_WARNING && host->score_status==status ) + printf(" Score %u < %u", (int)host->score, (int)warn.score); + else if (status==STATE_CRITICAL && host->score_status==status ) + printf(" Score %u < %u", (int)host->score, (int)crit.score); + } + /* order statis text output */ + if (order_mode) { + if (status == STATE_OK) + printf(" Packets in order"); + else if (status==STATE_CRITICAL && host->order_status==status) + printf(" Packets out of order"); + } + } + host = host->next; + } + + /* iterate once more for pretty perfparse output */ + if (!(!rta_mode && !pl_mode && !jitter_mode && !score_mode && !mos_mode && order_mode)) { + printf("|"); + } + i = 0; + host = list; + while(host) { + if(debug) puts(""); + + if (rta_mode && host->pl<100) { + printf("%srta=%0.3fms;%0.3f;%0.3f;0; %srtmax=%0.3fms;;;; %srtmin=%0.3fms;;;; ", + (targets > 1) ? host->name : "", + host->rta / 1000, (float)warn.rta / 1000, (float)crit.rta / 1000, + (targets > 1) ? host->name : "", (float)host->rtmax / 1000, + (targets > 1) ? host->name : "", (host->rtmin < INFINITY) ? (float)host->rtmin / 1000 : (float)0); + } + + if (pl_mode) { + printf("%spl=%u%%;%u;%u;0;100 ", (targets > 1) ? host->name : "", host->pl, warn.pl, crit.pl); + } + + if (jitter_mode && host->pl<100) { + printf("%sjitter_avg=%0.3fms;%0.3f;%0.3f;0; %sjitter_max=%0.3fms;;;; %sjitter_min=%0.3fms;;;; ", + (targets > 1) ? host->name : "", + (float)host->jitter, + (float)warn.jitter, + (float)crit.jitter, + (targets > 1) ? host->name : "", + (float)host->jitter_max / 1000, (targets > 1) ? host->name : "", + (float)host->jitter_min / 1000 + ); + } + + if (mos_mode && host->pl<100) { + printf("%smos=%0.1f;%0.1f;%0.1f;0;5 ", + (targets > 1) ? host->name : "", + (float)host->mos, + (float)warn.mos, + (float)crit.mos + ); + } + + if (score_mode && host->pl<100) { + printf("%sscore=%u;%u;%u;0;100 ", + (targets > 1) ? host->name : "", + (int)host->score, + (int)warn.score, + (int)crit.score + ); + } + + host = host->next; + } + + if(min_hosts_alive > -1) { + if(hosts_ok >= min_hosts_alive) status = STATE_OK; + else if((hosts_ok + hosts_warn) >= min_hosts_alive) status = STATE_WARNING; + } + + /* finish with an empty line */ + puts(""); + if(debug) printf("targets: %u, targets_alive: %u, hosts_ok: %u, hosts_warn: %u, min_hosts_alive: %i\n", + targets, targets_alive, hosts_ok, hosts_warn, min_hosts_alive); + + exit(status); +} + +static u_int +get_timevaldiff(struct timeval *early, struct timeval *later) +{ + u_int ret; + struct timeval now; + + if(!later) { + gettimeofday(&now, &tz); + later = &now; + } + if(!early) early = &prog_start; + + /* if early > later we return 0 so as to indicate a timeout */ + if(early->tv_sec > later->tv_sec || + (early->tv_sec == later->tv_sec && early->tv_usec > later->tv_usec)) + { + return 0; + } + ret = (later->tv_sec - early->tv_sec) * 1000000; + ret += later->tv_usec - early->tv_usec; + + return ret; +} + +static int +add_target_ip(char *arg, struct sockaddr_storage *in) +{ + struct rta_host *host; + struct sockaddr_in *sin, *host_sin; + struct sockaddr_in6 *sin6, *host_sin6; + + if (address_family == AF_INET) + sin = (struct sockaddr_in *)in; + else + sin6 = (struct sockaddr_in6 *)in; + + + + /* disregard obviously stupid addresses + * (I didn't find an ipv6 equivalent to INADDR_NONE) */ + if (((address_family == AF_INET && (sin->sin_addr.s_addr == INADDR_NONE + || sin->sin_addr.s_addr == INADDR_ANY))) + || (address_family == AF_INET6 && (sin6->sin6_addr.s6_addr == in6addr_any.s6_addr))) { + return -1; + } + + /* no point in adding two identical IP's, so don't. ;) */ + host = list; + while(host) { + host_sin = (struct sockaddr_in *)&host->saddr_in; + host_sin6 = (struct sockaddr_in6 *)&host->saddr_in; + + if( (address_family == AF_INET && host_sin->sin_addr.s_addr == sin->sin_addr.s_addr) + || (address_family == AF_INET6 && host_sin6->sin6_addr.s6_addr == sin6->sin6_addr.s6_addr)) { + if(debug) printf("Identical IP already exists. Not adding %s\n", arg); + return -1; + } + host = host->next; + } + + /* add the fresh ip */ + host = (struct rta_host*)malloc(sizeof(struct rta_host)); + if(!host) { + char straddr[INET6_ADDRSTRLEN]; + parse_address((struct sockaddr_storage*)&in, straddr, sizeof(straddr)); + crash("add_target_ip(%s, %s): malloc(%lu) failed", + arg, straddr, sizeof(struct rta_host)); + } + memset(host, 0, sizeof(struct rta_host)); + + /* set the values. use calling name for output */ + host->name = strdup(arg); + + + /* fill out the sockaddr_storage struct */ + if(address_family == AF_INET) { + host_sin = (struct sockaddr_in *)&host->saddr_in; + host_sin->sin_family = AF_INET; + host_sin->sin_addr.s_addr = sin->sin_addr.s_addr; + } + else { + host_sin6 = (struct sockaddr_in6 *)&host->saddr_in; + host_sin6->sin6_family = AF_INET6; + memcpy(host_sin6->sin6_addr.s6_addr, sin6->sin6_addr.s6_addr, sizeof host_sin6->sin6_addr.s6_addr); + } + + /* fill out the sockaddr_in struct */ + host->rtmin = INFINITY; + host->rtmax = 0; + host->jitter=0; + host->jitter_max=0; + host->jitter_min=INFINITY; + host->last_tdiff=0; + host->order_status=STATE_OK; + host->last_icmp_seq=0; + host->rta_status=0; + host->pl_status=0; + host->jitter_status=0; + host->mos_status=0; + host->score_status=0; + host->pl_status=0; + + + if(!list) list = cursor = host; + else cursor->next = host; + + cursor = host; + targets++; + + return 0; +} + +/* wrapper for add_target_ip */ +static int +add_target(char *arg) +{ + int error, result = -1; + struct sockaddr_storage ip; + struct addrinfo hints, *res, *p; + struct sockaddr_in *sin; + struct sockaddr_in6 *sin6; + + switch (address_family) { + case -1: + /* -4 and -6 are not specified on cmdline */ + address_family = AF_INET; + sin = (struct sockaddr_in *)&ip; + result = inet_pton(address_family, arg, &sin->sin_addr); +#ifdef USE_IPV6 + if( result != 1 ){ + address_family = AF_INET6; + sin6 = (struct sockaddr_in6 *)&ip; + result = inet_pton(address_family, arg, &sin6->sin6_addr); + } +#endif + /* If we don't find any valid addresses, we still don't know the address_family */ + if ( result != 1) { + address_family = -1; + } + break; + case AF_INET: + sin = (struct sockaddr_in *)&ip; + result = inet_pton(address_family, arg, &sin->sin_addr); + break; + case AF_INET6: + sin6 = (struct sockaddr_in6 *)&ip; + result = inet_pton(address_family, arg, &sin6->sin6_addr); + break; + default: crash("Address family not supported"); + } + + /* don't resolve if we don't have to */ + if(result == 1) { + /* don't add all ip's if we were given a specific one */ + return add_target_ip(arg, &ip); + } + else { + errno = 0; + memset(&hints, 0, sizeof(hints)); + if (address_family == -1) { + hints.ai_family = AF_UNSPEC; + } else { + hints.ai_family = address_family == AF_INET ? PF_INET : PF_INET6; + } + hints.ai_socktype = SOCK_RAW; + if((error = getaddrinfo(arg, NULL, &hints, &res)) != 0) { + errno = 0; + crash("Failed to resolve %s: %s", arg, gai_strerror(error)); + return -1; + } + address_family = res->ai_family; + } + + /* possibly add all the IP's as targets */ + for(p = res; p != NULL; p = p->ai_next) { + memcpy(&ip, p->ai_addr, p->ai_addrlen); + add_target_ip(arg, &ip); + + /* this is silly, but it works */ + if(mode == MODE_HOSTCHECK || mode == MODE_ALL) { + if(debug > 2) printf("mode: %d\n", mode); + continue; + } + break; + } + freeaddrinfo(res); + + return 0; +} + +static void +set_source_ip(char *arg) +{ + struct sockaddr_in src; + + memset(&src, 0, sizeof(src)); + src.sin_family = address_family; + if((src.sin_addr.s_addr = inet_addr(arg)) == INADDR_NONE) + src.sin_addr.s_addr = get_ip_address(arg); + if(bind(icmp_sock, (struct sockaddr *)&src, sizeof(src)) == -1) + crash("Cannot bind to IP address %s", arg); +} + +/* TODO: Move this to netutils.c and also change check_dhcp to use that. */ +static in_addr_t +get_ip_address(const char *ifname) +{ + // TODO: Rewrite this so the function return an error and we exit somewhere else + struct sockaddr_in ip; + ip.sin_addr.s_addr = 0; // Fake initialization to make compiler happy +#if defined(SIOCGIFADDR) + struct ifreq ifr; + + strncpy(ifr.ifr_name, ifname, sizeof(ifr.ifr_name) - 1); + + ifr.ifr_name[sizeof(ifr.ifr_name) - 1] = '\0'; + + if(ioctl(icmp_sock, SIOCGIFADDR, &ifr) == -1) + crash("Cannot determine IP address of interface %s", ifname); + + memcpy(&ip, &ifr.ifr_addr, sizeof(ip)); +#else + (void) ifname; + errno = 0; + crash("Cannot get interface IP address on this platform."); +#endif + return ip.sin_addr.s_addr; +} + +/* + * u = micro + * m = milli + * s = seconds + * return value is in microseconds + */ +static u_int +get_timevar(const char *str) +{ + char p, u, *ptr; + size_t len; + u_int i, d; /* integer and decimal, respectively */ + u_int factor = 1000; /* default to milliseconds */ + + if(!str) return 0; + len = strlen(str); + if(!len) return 0; + + /* unit might be given as ms|m (millisec), + * us|u (microsec) or just plain s, for seconds */ + p = '\0'; + u = str[len - 1]; + if(len >= 2 && !isdigit((int)str[len - 2])) p = str[len - 2]; + if(p && u == 's') u = p; + else if(!p) p = u; + if(debug > 2) printf("evaluating %s, u: %c, p: %c\n", str, u, p); + + if(u == 'u') factor = 1; /* microseconds */ + else if(u == 'm') factor = 1000; /* milliseconds */ + else if(u == 's') factor = 1000000; /* seconds */ + if(debug > 2) printf("factor is %u\n", factor); + + i = strtoul(str, &ptr, 0); + if(!ptr || *ptr != '.' || strlen(ptr) < 2 || factor == 1) + return i * factor; + + /* time specified in usecs can't have decimal points, so ignore them */ + if(factor == 1) return i; + + d = strtoul(ptr + 1, NULL, 0); + + /* d is decimal, so get rid of excess digits */ + while(d >= factor) d /= 10; + + /* the last parenthesis avoids floating point exceptions. */ + return ((i * factor) + (d * (factor / 10))); +} + +/* not too good at checking errors, but it'll do (main() should barfe on -1) */ +static int +get_threshold(char *str, threshold *th) +{ + char *p = NULL, i = 0; + + if(!str || !strlen(str) || !th) return -1; + + /* pointer magic slims code by 10 lines. i is bof-stop on stupid libc's */ + p = &str[strlen(str) - 1]; + while(p != &str[1]) { + if(*p == '%') *p = '\0'; + else if(*p == ',' && i) { + *p = '\0'; /* reset it so get_timevar(str) works nicely later */ + th->pl = (unsigned char)strtoul(p+1, NULL, 0); + break; + } + i = 1; + p--; + } + th->rta = get_timevar(str); + + if(!th->rta) return -1; + + if(th->rta > MAXTTL * 1000000) th->rta = MAXTTL * 1000000; + if(th->pl > 100) th->pl = 100; + + return 0; +} + +/* + * This functions receives a pointer to a string which should contain a threshold for the + * rta, packet_loss, jitter, mos or score mode in the form number,number[m|%]* assigns the + * parsed number to the corresponding threshold variable. + * @param[in,out] str String containing the given threshold values + * @param[in] length strlen(str) + * @param[out] warn Pointer to the warn threshold struct to which the values should be assigned + * @param[out] crit Pointer to the crit threshold struct to which the values should be assigned + * @param[in] mode Determines whether this a threshold for rta, packet_loss, jitter, mos or score (exclusively) + */ +static bool get_threshold2(char *str, size_t length, threshold *warn, threshold *crit, threshold_mode mode) { + if (!str || !length || !warn || !crit) return false; + + + // p points to the last char in str + char *p = &str[length - 1]; + + // first_iteration is bof-stop on stupid libc's + bool first_iteration = true; + + while(p != &str[0]) { + if( (*p == 'm') || (*p == '%') ) { + *p = '\0'; + } else if(*p == ',' && !first_iteration) { + *p = '\0'; /* reset it so get_timevar(str) works nicely later */ + + char *start_of_value = p + 1; + + if (!parse_threshold2_helper(start_of_value, strlen(start_of_value), crit, mode)){ + return false; + } + + } + first_iteration = false; + p--; + } + + return parse_threshold2_helper(p, strlen(p), warn, mode); +} + +static bool parse_threshold2_helper(char *s, size_t length, threshold *thr, threshold_mode mode) { + char *resultChecker = {0}; + + switch (mode) { + case const_rta_mode: + thr->rta = strtod(s, &resultChecker) * 1000; + break; + case const_packet_loss_mode: + thr->pl = (unsigned char)strtoul(s, &resultChecker, 0); + break; + case const_jitter_mode: + thr->jitter = strtod(s, &resultChecker); + + break; + case const_mos_mode: + thr->mos = strtod(s, &resultChecker); + break; + case const_score_mode: + thr->score = strtod(s, &resultChecker); + break; + } + + if (resultChecker == s) { + // Failed to parse + return false; + } + + if (resultChecker != (s + length)) { + // Trailing symbols + return false; + } + + return true; +} + +unsigned short +icmp_checksum(uint16_t *p, size_t n) +{ + unsigned short cksum; + long sum = 0; + + /* sizeof(uint16_t) == 2 */ + while(n >= 2) { + sum += *(p++); + n -= 2; + } + + /* mop up the occasional odd byte */ + if(n == 1) sum += *((uint8_t *)p -1); + + sum = (sum >> 16) + (sum & 0xffff); /* add hi 16 to low 16 */ + sum += (sum >> 16); /* add carry */ + cksum = ~sum; /* ones-complement, trunc to 16 bits */ + + return cksum; +} + +void +print_help(void) +{ + /*print_revision (progname);*/ /* FIXME: Why? */ + printf ("Copyright (c) 2005 Andreas Ericsson <ae@op5.se>\n"); + + printf (COPYRIGHT, copyright, email); + + printf ("\n\n"); + + print_usage (); + + printf (UT_HELP_VRSN); + printf (UT_EXTRA_OPTS); + + printf (" %s\n", "-H"); + printf (" %s\n", _("specify a target")); + printf (" %s\n", "[-4|-6]"); + printf (" %s\n", _("Use IPv4 (default) or IPv6 to communicate with the targets")); + printf (" %s\n", "-w"); + printf (" %s", _("warning threshold (currently ")); + printf ("%0.3fms,%u%%)\n", (float)warn.rta / 1000, warn.pl); + printf (" %s\n", "-c"); + printf (" %s", _("critical threshold (currently ")); + printf ("%0.3fms,%u%%)\n", (float)crit.rta / 1000, crit.pl); + + printf (" %s\n", "-R"); + printf (" %s\n", _("RTA, round trip average, mode warning,critical, ex. 100ms,200ms unit in ms")); + printf (" %s\n", "-P"); + printf (" %s\n", _("packet loss mode, ex. 40%,50% , unit in %")); + printf (" %s\n", "-J"); + printf (" %s\n", _("jitter mode warning,critical, ex. 40.000ms,50.000ms , unit in ms ")); + printf (" %s\n", "-M"); + printf (" %s\n", _("MOS mode, between 0 and 4.4 warning,critical, ex. 3.5,3.0")); + printf (" %s\n", "-S"); + printf (" %s\n", _("score mode, max value 100 warning,critical, ex. 80,70 ")); + printf (" %s\n", "-O"); + printf (" %s\n", _("detect out of order ICMP packts ")); + printf (" %s\n", "-H"); + printf (" %s\n", _("specify a target")); + printf (" %s\n", "-s"); + printf (" %s\n", _("specify a source IP address or device name")); + printf (" %s\n", "-n"); + printf (" %s", _("number of packets to send (currently ")); + printf ("%u)\n",packets); + printf (" %s\n", "-p"); + printf (" %s", _("number of packets to send (currently ")); + printf ("%u)\n",packets); + printf (" %s\n", "-i"); + printf (" %s", _("max packet interval (currently ")); + printf ("%0.3fms)\n",(float)pkt_interval / 1000); + printf (" %s\n", "-I"); + printf (" %s", _("max target interval (currently ")); + printf ("%0.3fms)\n", (float)target_interval / 1000); + printf (" %s\n", "-m"); + printf (" %s",_("number of alive hosts required for success")); + printf ("\n"); + printf (" %s\n", "-l"); + printf (" %s", _("TTL on outgoing packets (currently ")); + printf ("%u)\n", ttl); + printf (" %s\n", "-t"); + printf (" %s",_("timeout value (seconds, currently ")); + printf ("%u)\n", timeout); + printf (" %s\n", "-b"); + printf (" %s\n", _("Number of icmp data bytes to send")); + printf (" %s %u + %d)\n", _("Packet size will be data bytes + icmp header (currently"),icmp_data_size, ICMP_MINLEN); + printf (" %s\n", "-v"); + printf (" %s\n", _("verbose")); + printf ("\n"); + printf ("%s\n", _("Notes:")); + printf (" %s\n", _("If none of R,P,J,M,S or O is specified, default behavior is -R -P")); + printf (" %s\n", _("The -H switch is optional. Naming a host (or several) to check is not.")); + printf ("\n"); + printf (" %s\n", _("Threshold format for -w and -c is 200.25,60% for 200.25 msec RTA and 60%")); + printf (" %s\n", _("packet loss. The default values should work well for most users.")); + printf (" %s\n", _("You can specify different RTA factors using the standardized abbreviations")); + printf (" %s\n", _("us (microseconds), ms (milliseconds, default) or just plain s for seconds.")); + /* -d not yet implemented */ + /* printf ("%s\n", _("Threshold format for -d is warn,crit. 12,14 means WARNING if >= 12 hops")); + printf ("%s\n", _("are spent and CRITICAL if >= 14 hops are spent.")); + printf ("%s\n\n", _("NOTE: Some systems decrease TTL when forming ICMP_ECHOREPLY, others do not."));*/ + printf ("\n"); + printf (" %s\n", _("The -v switch can be specified several times for increased verbosity.")); + /* printf ("%s\n", _("Long options are currently unsupported.")); + printf ("%s\n", _("Options marked with * require an argument")); + */ + + printf (UT_SUPPORT); +} + + + +void +print_usage (void) +{ + printf ("%s\n", _("Usage:")); + printf(" %s [options] [-H] host1 host2 hostN\n", progname); +} diff --git a/plugins-root/pst3.c b/plugins-root/pst3.c new file mode 100644 index 0000000..1f69f3a --- /dev/null +++ b/plugins-root/pst3.c @@ -0,0 +1,262 @@ +/***************************************************************************** +* +* pst3 +* +* License: GPL +* Copyright (c) 2008 Monitoring Plugins Development Team +* +* Description: +* +* This file contains the pst3 executable. This is a replacement ps command +* for Solaris to get output which provides a long argument listing, which +* is not possible with the standard ps command (due to truncation). /usr/ucb/ps +* also has issues where some fields run into each other. +* +* This executable works by reading process address structures, so needs +* to be executed as root +* +* Originally written by R.W.Ingraham +* Rewritten by Duncan Ferguson (Altinity Ltd, June 2008) +* The rewrite was necessary as /dev/kmem is not available within +* non-global zones on Solaris 10 +* +* Details for rewrite came from +* source of /usr/ucb/ps on Solaris: +* http://cvs.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/ucbcmd/ps/ps.c#argvoff +* usenet group posting +* http://groups.google.com/group/comp.unix.solaris/tree/browse_frm/month/2001-09/bfa40c08bac819a2?rnum=141&_done=%2Fgroup%2Fcomp.unix.solaris%2Fbrowse_frm%2Fmonth%2F2001-09%3F +* +* 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 +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see <http://www.gnu.org/licenses/>. +* +*****************************************************************************/ + +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <unistd.h> +#include <dirent.h> +#include <errno.h> +#include <fcntl.h> +#include <procfs.h> +#include <sys/types32.h> + +/* + * Constants + */ + +#define PROC_DIR "/proc" +#define ARGS 30 + +/* + * Globals + */ + +static char * szProg; + +/* + * Prototypes + */ +void usage(); + +/*----------------------------------------------------------------------------*/ + +int main (int argc, char **argv) +{ + DIR *procdir; + struct dirent *proc; + char ps_name[ARGS]; + char as_name[ARGS]; + psinfo_t psinfo; + + /* Set our program name global */ + if ((szProg = strrchr(argv[0], '/')) != NULL) + szProg++; + else + szProg = argv[0]; + + /* if given any parameters, print out help */ + if(argc > 1) { + (void)usage(); + exit(1); + } + + /* Make sure that our euid is root */ + if (geteuid() != 0) + { + fprintf(stderr, "%s: This program can only be run by the root user!\n", szProg); + exit(1); + } + + if ((procdir = opendir(PROC_DIR)) == NULL) { + fprintf(stderr, "%s: cannot open PROC directory %s\n", szProg, PROC_DIR); + exit(1); + } + + /* Display column headings */ + printf("%c %5s %5s %5s %6s %6s %4s %s %s\n", + 'S', + "UID", + "PID", + "PPID", + "VSZ", + "RSS", + "%CPU", + "COMMAND", + "ARGS" + ); + + /* Zip through all of the process entries */ + while((proc = readdir(procdir))) { + int ps_fd; + int as_fd; + off_t argoff; + int i; + char *args; + char *procname; + char *ptr; + int argslen; + uintptr_t args_addr;; + uintptr_t *args_vecs;; + int args_count; + + if(proc->d_name[0] == '.') + continue; + + sprintf(ps_name,"%s/%s/%s",PROC_DIR,proc->d_name,"psinfo"); + sprintf(as_name,"%s/%s/%s",PROC_DIR,proc->d_name,"as"); +try_again: + if((ps_fd = open(ps_name, O_RDONLY)) == -1) + continue; + + if((as_fd = open(as_name, O_RDONLY)) == -1) { + close(ps_fd); + continue; + } + + if(read(ps_fd, &psinfo, sizeof(psinfo)) != sizeof(psinfo)) { + int err = errno; + close(ps_fd); + close(as_fd); + if(err == EAGAIN) goto try_again; + if(err != ENOENT) + fprintf(stderr, "%s: read() on %s: %s\n", szProg, + ps_name, strerror(err)); + continue; + } + close(ps_fd); + + /* system process, ignore since the previous version did */ + if( + psinfo.pr_nlwp == 0 || + strcmp(psinfo.pr_lwp.pr_clname, "SYS") == 0 + ) { + continue; + } + + /* get the procname to match previous versions */ + procname = strdup(psinfo.pr_psargs); + if((ptr = strchr(procname, ' ')) != NULL) + *ptr = '\0'; + if((ptr = strrchr(procname, '/')) != NULL) + ptr++; + else + ptr = procname; + + /* + * print out what we currently know + */ + printf("%c %5d %5d %5d %6lu %6lu %4.1f %s ", + psinfo.pr_lwp.pr_sname, + psinfo.pr_euid, + psinfo.pr_pid, + psinfo.pr_ppid, + psinfo.pr_size, + psinfo.pr_rssize, + ((float)(psinfo.pr_pctcpu) / 0x8000 * 100.0), + ptr + ); + free(procname); + + /* + * and now for the command line stuff + */ + + args_addr = psinfo.pr_argv; + args_count = psinfo.pr_argc; + args_vecs = malloc(args_count * sizeof(uintptr_t)); + + if(psinfo.pr_dmodel == PR_MODEL_NATIVE) { + /* this process matches target process */ + pread(as_fd,args_vecs, args_count * sizeof(uintptr_t), + args_addr); + } else { + /* this process is 64bit, target process is 32 bit*/ + caddr32_t *args_vecs32 = (caddr32_t *)args_vecs; + pread(as_fd,args_vecs32,args_count * sizeof(caddr32_t), + args_addr); + for (i=args_count-1;i>=0;--i) + args_vecs[i]=args_vecs32[i]; + } + + /* + * now read in the args - if what we read in fills buffer + * resize buffer and reread that bit again + */ + argslen=ARGS; + args=malloc(argslen+1); + for(i=0;i<args_count;i++) { + memset(args,'\0',argslen+1); + if(pread(as_fd, args, argslen, args_vecs[i]) <= 0) { + break; + } + args[argslen]='\0'; + if(strlen(args) == argslen){ + argslen += ARGS; + args = realloc(args, argslen + 1); + i--; + continue; + } + printf(" %s", args); + } + free(args_vecs); + free(args); + close(as_fd); + printf("\n"); + } + + (void) closedir(procdir); + + return (0); +} + +/*----------------------------------------------------------------------------*/ + +void usage() { + printf("%s: Help output\n\n", szProg); + printf("If this program is given any arguments, this help is displayed.\n"); + printf("This command is used to print out the full command line for all\n"); + printf("running processes because /usr/bin/ps is limited to 80 chars and\n"); + printf("/usr/ucb/ps can merge columns together.\n\n"); + printf("Columns are:\n"); + printf("\tS - State of process - see 'ps' man page\n"); + printf("\tUID - UID of the process owner\n"); + printf("\tPID - PID of the process\n"); + printf("\tPPID - PID of the parent process\n"); + printf("\tVSZ - Virtual memory usage (kilobytes)\n"); + printf("\tRSS - Real memory usage (kilobytes)\n"); + printf("\t%%CPU - CPU usage\n"); + printf("\tCOMMAND - Command being run\n"); + printf("\tARGS - Full command line with arguments\n"); + return; +} diff --git a/plugins-root/t/check_dhcp.t b/plugins-root/t/check_dhcp.t new file mode 100644 index 0000000..ce62773 --- /dev/null +++ b/plugins-root/t/check_dhcp.t @@ -0,0 +1,74 @@ +#! /usr/bin/perl -w -I .. +# +# DHCP Tests via check_dhcp +# + +use strict; +use Test::More; +use NPTest; + +my $allow_sudo = getTestParameter( "NP_ALLOW_SUDO", + "If sudo is setup for this user to run any command as root ('yes' to allow)", + "no" ); + +if ($allow_sudo eq "yes" or $> == 0) { + plan tests => 6; +} else { + plan skip_all => "Need sudo to test check_dhcp"; +} +my $sudo = $> == 0 ? '' : 'sudo'; + +my $successOutput = '/OK: Received \d+ DHCPOFFER\(s\), \d+ of 1 requested servers responded, max lease time = \d+ sec\./'; +my $failureOutput = '/CRITICAL: (No DHCPOFFERs were received|Received \d+ DHCPOFFER\(s\), 0 of 1 requested servers responded, max lease time = \d+ sec\.)/'; +my $invalidOutput = '/Invalid hostname/'; + +my $host_responsive = getTestParameter( "NP_HOST_DHCP_RESPONSIVE", + "The hostname of system responsive to dhcp requests", + "localhost" ); + +my $host_nonresponsive = getTestParameter( "NP_HOST_NONRESPONSIVE", + "The hostname of system not responsive to dhcp requests", + "10.0.0.1" ); + +my $hostname_invalid = getTestParameter( "NP_HOSTNAME_INVALID", + "An invalid (not known to DNS) hostname", + "nosuchhost" ); + +# try to determince interface +my $interface = ''; + +# find interface used for default route +if (-x '/usr/sbin/ip' and `/usr/sbin/ip route get 1.1.1.1 2>/dev/null` =~ m/\sdev\s(\S+)/) { + $interface = "-i $1"; +} +elsif (`ifconfig -a 2>/dev/null` =~ m/^(e\w*\d+)/mx and $1 ne 'eth0') { + $interface = ' -i '.$1; +} + +my $res; +SKIP: { + skip('need responsive test host', 2) unless $host_responsive; + $res = NPTest->testCmd( + "$sudo ./check_dhcp $interface -u -s $host_responsive" + ); + is( $res->return_code, 0, "Syntax ok" ); + like( $res->output, $successOutput, "Output OK" ); +}; + +SKIP: { + skip('need nonresponsive test host', 2) unless $host_nonresponsive; + $res = NPTest->testCmd( + "$sudo ./check_dhcp $interface -u -s $host_nonresponsive" + ); + is( $res->return_code, 2, "Exit code - host nonresponsive" ); + like( $res->output, $failureOutput, "Output OK" ); +}; + +SKIP: { + skip('need invalid test host', 2) unless $hostname_invalid; + $res = NPTest->testCmd( + "$sudo ./check_dhcp $interface -u -s $hostname_invalid" + ); + is( $res->return_code, 3, "Exit code - host invalid" ); + like( $res->output, $invalidOutput, "Output OK" ); +}; diff --git a/plugins-root/t/check_icmp.t b/plugins-root/t/check_icmp.t new file mode 100644 index 0000000..4f9db86 --- /dev/null +++ b/plugins-root/t/check_icmp.t @@ -0,0 +1,142 @@ +#! /usr/bin/perl -w -I .. +# +# Ping Response Tests via check_icmp +# + +use strict; +use Test::More; +use NPTest; + +my $allow_sudo = getTestParameter( "NP_ALLOW_SUDO", + "If sudo is setup for this user to run any command as root ('yes' to allow)", + "no" ); + +if ($allow_sudo eq "yes" or $> == 0) { + plan tests => 39; +} else { + plan skip_all => "Need sudo to test check_icmp"; +} +my $sudo = $> == 0 ? '' : 'sudo'; + +my $successOutput = '/OK - .*? rta (?:[\d\.]+ms)|(?:nan), lost \d+%/'; +my $failureOutput = '/(WARNING|CRITICAL) - .*? rta (?:[\d\.]+ms > [\d\.]+ms|nan)/'; + +my $host_responsive = getTestParameter( "NP_HOST_RESPONSIVE", + "The hostname of system responsive to network requests", + "localhost" ); + +my $host_nonresponsive = getTestParameter( "NP_HOST_NONRESPONSIVE", + "The hostname of system not responsive to network requests", + "10.0.0.1" ); + +my $hostname_invalid = getTestParameter( "NP_HOSTNAME_INVALID", + "An invalid (not known to DNS) hostname", + "nosuchhost" ); + +my $res; + +$res = NPTest->testCmd( + "$sudo ./check_icmp -H $host_responsive -w 10000ms,100% -c 10000ms,100%" + ); +is( $res->return_code, 0, "Syntax ok" ); +like( $res->output, $successOutput, "Output OK" ); + +$res = NPTest->testCmd( + "$sudo ./check_icmp -H $host_responsive -w 0ms,0% -c 10000ms,100%" + ); +is( $res->return_code, 1, "Syntax ok, with forced warning" ); +like( $res->output, $failureOutput, "Output OK" ); + +$res = NPTest->testCmd( + "$sudo ./check_icmp -H $host_responsive -w 0,0% -c 0,0%" + ); +is( $res->return_code, 2, "Syntax ok, with forced critical" ); +like( $res->output, $failureOutput, "Output OK" ); + +$res = NPTest->testCmd( + "$sudo ./check_icmp -H $host_nonresponsive -w 10000ms,100% -c 10000ms,100% -t 2" + ); +is( $res->return_code, 2, "Timeout - host nonresponsive" ); +like( $res->output, '/100%/', "Error contains '100%' string (for 100% packet loss)" ); + +$res = NPTest->testCmd( + "$sudo ./check_icmp -w 10000ms,100% -c 10000ms,100%" + ); +is( $res->return_code, 3, "No hostname" ); +like( $res->output, '/No hosts to check/', "Output with appropriate error message"); + +$res = NPTest->testCmd( + "$sudo ./check_icmp -H $host_nonresponsive -w 10000ms,100% -c 10000ms,100% -n 1 -m 0 -t 2" + ); +is( $res->return_code, 0, "One host nonresponsive - zero required" ); +like( $res->output, $successOutput, "Output OK" ); + +$res = NPTest->testCmd( + "$sudo ./check_icmp -H $host_responsive -H $host_nonresponsive -w 10000ms,100% -c 10000ms,100% -n 1 -m 1 -t 2" + ); +is( $res->return_code, 0, "One of two host nonresponsive - one required" ); +like( $res->output, $successOutput, "Output OK" ); + +$res = NPTest->testCmd( + "$sudo ./check_icmp -H $host_responsive -H $host_nonresponsive -w 10000ms,100% -c 10000ms,100% -n 1 -m 2" + ); +is( $res->return_code, 2, "One of two host nonresponsive - two required" ); +like( $res->output, $failureOutput, "Output OK" ); + +$res = NPTest->testCmd( + "$sudo ./check_icmp -H $host_responsive -s 127.0.15.15 -w 10000ms,100% -c 10000ms,100% -n 1 -m 2" + ); +is( $res->return_code, 0, "IPv4 source_ip accepted" ); +like( $res->output, $successOutput, "Output OK" ); + +$res = NPTest->testCmd( + "$sudo ./check_icmp -H $host_responsive -b 65507" + ); +is( $res->return_code, 0, "Try max packet size" ); +like( $res->output, $successOutput, "Output OK - Didn't overflow" ); + +$res = NPTest->testCmd( + "$sudo ./check_icmp -H $host_responsive -R 100,100 -n 1 -t 2" + ); +is( $res->return_code, 0, "rta works" ); +like( $res->output, $successOutput, "Output OK" ); +$res = NPTest->testCmd( + "$sudo ./check_icmp -H $host_responsive -P 80,90 -n 1 -t 2" + ); +is( $res->return_code, 0, "pl works" ); +like( $res->output, '/lost 0%/', "Output OK" ); + +$res = NPTest->testCmd( + "$sudo ./check_icmp -H $host_responsive -J 80,90 -t 2" + ); +is( $res->return_code, 0, "jitter works" ); +like( $res->output, '/jitter \d/', "Output OK" ); + +$res = NPTest->testCmd( + "$sudo ./check_icmp -H $host_responsive -M 4,3 -t 2" + ); +is( $res->return_code, 0, "mos works" ); +like( $res->output, '/MOS \d/', "Output OK" ); + +$res = NPTest->testCmd( + "$sudo ./check_icmp -H $host_responsive -S 80,70 -t 2" + ); +is( $res->return_code, 0, "score works" ); +like( $res->output, '/Score \d/', "Output OK" ); + +$res = NPTest->testCmd( + "$sudo ./check_icmp -H $host_responsive -O -t 2" + ); +is( $res->return_code, 0, "order works" ); +like( $res->output, '/Packets in order/', "Output OK" ); + +$res = NPTest->testCmd( + "$sudo ./check_icmp -H $host_responsive -O -S 80,70 -M 4,3 -J 80,90 -P 80,90 -R 100,100 -t 2" + ); +is( $res->return_code, 0, "order works" ); +like( $res->output, '/Packets in order/', "Output OK" ); +like( $res->output, '/Score \d/', "Output OK" ); +like( $res->output, '/MOS \d/', "Output OK" ); +like( $res->output, '/jitter \d/', "Output OK" ); +like( $res->output, '/lost 0%/', "Output OK" ); +like( $res->output, $successOutput, "Output OK" ); |