Imported Upstream version 1.4.12
This commit is contained in:
parent
1d1585cd09
commit
4ab9f0d24c
291 changed files with 27277 additions and 11364 deletions
|
@ -4,10 +4,10 @@ VPATH = $(top_srcdir) $(top_srcdir)/lib $(top_srcdir)/plugins $(top_srcdir)/plug
|
|||
|
||||
INCLUDES = -I.. -I$(top_srcdir)/lib -I$(top_srcdir)/gl -I$(top_srcdir)/intl -I$(top_srcdir)/plugins @SSLINCLUDE@
|
||||
|
||||
datadir = @datadir@
|
||||
localedir = $(datadir)/locale
|
||||
DEFS = -DLOCALEDIR=\"$(localedir)\" @DEFS@
|
||||
LIBS = @LIBINTL@ @LIBS@ @SSLLIBS@
|
||||
# Don't add LTLIBINTL to all, as pst3 doesn't need it
|
||||
#LIBS = @LTLIBINTL@ @LIBS@
|
||||
|
||||
noinst_PROGRAMS = check_dhcp check_icmp @EXTRAS_ROOT@
|
||||
|
||||
|
@ -66,8 +66,11 @@ install-exec-local: $(noinst_PROGRAMS)
|
|||
|
||||
##############################################################################
|
||||
# the actual targets
|
||||
check_dhcp_LDADD = $(NETLIBS)
|
||||
check_icmp_LDADD = $(NETLIBS) $(SOCKETLIBS)
|
||||
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_LDADD = -lkvm
|
||||
|
||||
check_dhcp_DEPENDENCIES = check_dhcp.c $(NETOBJS) $(DEPLIBS)
|
||||
|
|
|
@ -41,36 +41,40 @@ subdir = plugins-root
|
|||
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
am__aclocal_m4_deps = $(top_srcdir)/m4/np_mysqlclient.m4 \
|
||||
$(top_srcdir)/gl/m4/absolute-header.m4 \
|
||||
$(top_srcdir)/gl/m4/alloca.m4 \
|
||||
$(top_srcdir)/gl/m4/arpa_inet_h.m4 \
|
||||
$(top_srcdir)/gl/m4/c-strtod.m4 $(top_srcdir)/gl/m4/cloexec.m4 \
|
||||
$(top_srcdir)/gl/m4/codeset.m4 $(top_srcdir)/gl/m4/dirname.m4 \
|
||||
$(top_srcdir)/gl/m4/dos.m4 \
|
||||
$(top_srcdir)/gl/m4/base64.m4 $(top_srcdir)/gl/m4/c-strtod.m4 \
|
||||
$(top_srcdir)/gl/m4/cloexec.m4 $(top_srcdir)/gl/m4/codeset.m4 \
|
||||
$(top_srcdir)/gl/m4/dirname.m4 $(top_srcdir)/gl/m4/dos.m4 \
|
||||
$(top_srcdir)/gl/m4/double-slash-root.m4 \
|
||||
$(top_srcdir)/gl/m4/eoverflow.m4 $(top_srcdir)/gl/m4/error.m4 \
|
||||
$(top_srcdir)/gl/m4/exitfail.m4 \
|
||||
$(top_srcdir)/gl/m4/extensions.m4 \
|
||||
$(top_srcdir)/gl/m4/fcntl-safer.m4 \
|
||||
$(top_srcdir)/gl/m4/float_h.m4 $(top_srcdir)/gl/m4/floorf.m4 \
|
||||
$(top_srcdir)/gl/m4/fstypename.m4 \
|
||||
$(top_srcdir)/gl/m4/fsusage.m4 \
|
||||
$(top_srcdir)/gl/m4/getaddrinfo.m4 \
|
||||
$(top_srcdir)/gl/m4/gethostname.m4 \
|
||||
$(top_srcdir)/gl/m4/getloadavg.m4 \
|
||||
$(top_srcdir)/gl/m4/getopt.m4 $(top_srcdir)/gl/m4/gettext.m4 \
|
||||
$(top_srcdir)/gl/m4/glibc21.m4 \
|
||||
$(top_srcdir)/gl/m4/gnulib-common.m4 \
|
||||
$(top_srcdir)/gl/m4/gnulib-comp.m4 \
|
||||
$(top_srcdir)/gl/m4/iconv.m4 $(top_srcdir)/gl/m4/inet_ntop.m4 \
|
||||
$(top_srcdir)/gl/m4/inline.m4 $(top_srcdir)/gl/m4/intmax_t.m4 \
|
||||
$(top_srcdir)/gl/m4/iconv.m4 \
|
||||
$(top_srcdir)/gl/m4/include_next.m4 \
|
||||
$(top_srcdir)/gl/m4/inet_ntop.m4 $(top_srcdir)/gl/m4/inline.m4 \
|
||||
$(top_srcdir)/gl/m4/intlmacosx.m4 \
|
||||
$(top_srcdir)/gl/m4/intmax_t.m4 \
|
||||
$(top_srcdir)/gl/m4/inttypes_h.m4 \
|
||||
$(top_srcdir)/gl/m4/lib-ld.m4 $(top_srcdir)/gl/m4/lib-link.m4 \
|
||||
$(top_srcdir)/gl/m4/lib-prefix.m4 $(top_srcdir)/gl/m4/lock.m4 \
|
||||
$(top_srcdir)/gl/m4/longdouble.m4 \
|
||||
$(top_srcdir)/gl/m4/lib-prefix.m4 \
|
||||
$(top_srcdir)/gl/m4/localcharset.m4 \
|
||||
$(top_srcdir)/gl/m4/longlong.m4 \
|
||||
$(top_srcdir)/gl/m4/ls-mntd-fs.m4 \
|
||||
$(top_srcdir)/gl/m4/mbchar.m4 $(top_srcdir)/gl/m4/mbiter.m4 \
|
||||
$(top_srcdir)/gl/m4/mbrtowc.m4 $(top_srcdir)/gl/m4/memchr.m4 \
|
||||
$(top_srcdir)/gl/m4/minmax.m4 $(top_srcdir)/gl/m4/mountlist.m4 \
|
||||
$(top_srcdir)/gl/m4/malloc.m4 $(top_srcdir)/gl/m4/math_h.m4 \
|
||||
$(top_srcdir)/gl/m4/mbstate_t.m4 \
|
||||
$(top_srcdir)/gl/m4/mountlist.m4 \
|
||||
$(top_srcdir)/gl/m4/netinet_in_h.m4 $(top_srcdir)/gl/m4/nls.m4 \
|
||||
$(top_srcdir)/gl/m4/onceonly_2_57.m4 $(top_srcdir)/gl/m4/po.m4 \
|
||||
$(top_srcdir)/gl/m4/progtest.m4 $(top_srcdir)/gl/m4/regex.m4 \
|
||||
|
@ -80,21 +84,21 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/np_mysqlclient.m4 \
|
|||
$(top_srcdir)/gl/m4/snprintf.m4 $(top_srcdir)/gl/m4/socklen.m4 \
|
||||
$(top_srcdir)/gl/m4/sockpfaf.m4 $(top_srcdir)/gl/m4/ssize_t.m4 \
|
||||
$(top_srcdir)/gl/m4/stdbool.m4 $(top_srcdir)/gl/m4/stdint.m4 \
|
||||
$(top_srcdir)/gl/m4/stdint_h.m4 $(top_srcdir)/gl/m4/strcase.m4 \
|
||||
$(top_srcdir)/gl/m4/strdup.m4 $(top_srcdir)/gl/m4/strndup.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/strdup.m4 \
|
||||
$(top_srcdir)/gl/m4/strerror.m4 \
|
||||
$(top_srcdir)/gl/m4/string_h.m4 $(top_srcdir)/gl/m4/strndup.m4 \
|
||||
$(top_srcdir)/gl/m4/strnlen.m4 \
|
||||
$(top_srcdir)/gl/m4/sys_socket_h.m4 \
|
||||
$(top_srcdir)/gl/m4/ulonglong.m4 \
|
||||
$(top_srcdir)/gl/m4/unistd-safer.m4 \
|
||||
$(top_srcdir)/gl/m4/unistd_h.m4 \
|
||||
$(top_srcdir)/gl/m4/vasnprintf.m4 \
|
||||
$(top_srcdir)/gl/m4/vasprintf.m4 \
|
||||
$(top_srcdir)/gl/m4/vsnprintf.m4 $(top_srcdir)/gl/m4/wchar.m4 \
|
||||
$(top_srcdir)/gl/m4/wchar_t.m4 $(top_srcdir)/gl/m4/wctype.m4 \
|
||||
$(top_srcdir)/gl/m4/wcwidth.m4 $(top_srcdir)/gl/m4/wint_t.m4 \
|
||||
$(top_srcdir)/gl/m4/xalloc.m4 $(top_srcdir)/gl/m4/xsize.m4 \
|
||||
$(top_srcdir)/gl/m4/xstrndup.m4 $(top_srcdir)/acinclude.m4 \
|
||||
$(top_srcdir)/configure.in
|
||||
$(top_srcdir)/gl/m4/wint_t.m4 $(top_srcdir)/gl/m4/xalloc.m4 \
|
||||
$(top_srcdir)/gl/m4/xsize.m4 $(top_srcdir)/gl/m4/xstrndup.m4 \
|
||||
$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in
|
||||
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
||||
$(ACLOCAL_M4)
|
||||
mkinstalldirs = $(SHELL) $(top_srcdir)/build-aux/mkinstalldirs
|
||||
|
@ -112,7 +116,7 @@ am__DEPENDENCIES_4 = $(am__DEPENDENCIES_3) $(am__DEPENDENCIES_2)
|
|||
check_icmp_SOURCES = check_icmp.c
|
||||
check_icmp_OBJECTS = check_icmp.$(OBJEXT)
|
||||
pst3_SOURCES = pst3.c
|
||||
pst3_OBJECTS = pst3.$(OBJEXT)
|
||||
pst3_OBJECTS = pst3-pst3.$(OBJEXT)
|
||||
pst3_DEPENDENCIES =
|
||||
DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
|
||||
depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp
|
||||
|
@ -132,10 +136,6 @@ CTAGS = ctags
|
|||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||
VPATH = $(top_srcdir) $(top_srcdir)/lib $(top_srcdir)/plugins $(top_srcdir)/plugins/t $(srcdir)
|
||||
INSTALL = @INSTALL@
|
||||
ABSOLUTE_STDINT_H = @ABSOLUTE_STDINT_H@
|
||||
ABSOLUTE_UNISTD_H = @ABSOLUTE_UNISTD_H@
|
||||
ABSOLUTE_WCHAR_H = @ABSOLUTE_WCHAR_H@
|
||||
ABSOLUTE_WCTYPE_H = @ABSOLUTE_WCTYPE_H@
|
||||
ACLOCAL = @ACLOCAL@
|
||||
ALLOCA = @ALLOCA@
|
||||
ALLOCA_H = @ALLOCA_H@
|
||||
|
@ -180,27 +180,177 @@ EXTRA_NETOBJS = @EXTRA_NETOBJS@
|
|||
EXTRA_TEST = @EXTRA_TEST@
|
||||
F77 = @F77@
|
||||
FFLAGS = @FFLAGS@
|
||||
FLOAT_H = @FLOAT_H@
|
||||
FLOORF_LIBM = @FLOORF_LIBM@
|
||||
GETLOADAVG_LIBS = @GETLOADAVG_LIBS@
|
||||
GETOPT_H = @GETOPT_H@
|
||||
GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
|
||||
GLIBC21 = @GLIBC21@
|
||||
GL_COND_LIBTOOL_FALSE = @GL_COND_LIBTOOL_FALSE@
|
||||
GL_COND_LIBTOOL_TRUE = @GL_COND_LIBTOOL_TRUE@
|
||||
GMSGFMT = @GMSGFMT@
|
||||
GMSGFMT_015 = @GMSGFMT_015@
|
||||
GNULIB_CALLOC_POSIX = @GNULIB_CALLOC_POSIX@
|
||||
GNULIB_CEILF = @GNULIB_CEILF@
|
||||
GNULIB_CEILL = @GNULIB_CEILL@
|
||||
GNULIB_CHOWN = @GNULIB_CHOWN@
|
||||
GNULIB_DUP2 = @GNULIB_DUP2@
|
||||
GNULIB_FCHDIR = @GNULIB_FCHDIR@
|
||||
GNULIB_FFLUSH = @GNULIB_FFLUSH@
|
||||
GNULIB_FLOORF = @GNULIB_FLOORF@
|
||||
GNULIB_FLOORL = @GNULIB_FLOORL@
|
||||
GNULIB_FOPEN = @GNULIB_FOPEN@
|
||||
GNULIB_FPRINTF_POSIX = @GNULIB_FPRINTF_POSIX@
|
||||
GNULIB_FREOPEN = @GNULIB_FREOPEN@
|
||||
GNULIB_FREXP = @GNULIB_FREXP@
|
||||
GNULIB_FREXPL = @GNULIB_FREXPL@
|
||||
GNULIB_FSEEK = @GNULIB_FSEEK@
|
||||
GNULIB_FSEEKO = @GNULIB_FSEEKO@
|
||||
GNULIB_FTELL = @GNULIB_FTELL@
|
||||
GNULIB_FTELLO = @GNULIB_FTELLO@
|
||||
GNULIB_FTRUNCATE = @GNULIB_FTRUNCATE@
|
||||
GNULIB_GETCWD = @GNULIB_GETCWD@
|
||||
GNULIB_GETDELIM = @GNULIB_GETDELIM@
|
||||
GNULIB_GETLINE = @GNULIB_GETLINE@
|
||||
GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@
|
||||
GNULIB_GETPAGESIZE = @GNULIB_GETPAGESIZE@
|
||||
GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@
|
||||
GNULIB_ISFINITE = @GNULIB_ISFINITE@
|
||||
GNULIB_LCHOWN = @GNULIB_LCHOWN@
|
||||
GNULIB_LDEXPL = @GNULIB_LDEXPL@
|
||||
GNULIB_LSEEK = @GNULIB_LSEEK@
|
||||
GNULIB_MALLOC_POSIX = @GNULIB_MALLOC_POSIX@
|
||||
GNULIB_MATHL = @GNULIB_MATHL@
|
||||
GNULIB_MBSCASECMP = @GNULIB_MBSCASECMP@
|
||||
GNULIB_MBSCASESTR = @GNULIB_MBSCASESTR@
|
||||
GNULIB_MBSCHR = @GNULIB_MBSCHR@
|
||||
GNULIB_MBSCSPN = @GNULIB_MBSCSPN@
|
||||
GNULIB_MBSLEN = @GNULIB_MBSLEN@
|
||||
GNULIB_MBSNCASECMP = @GNULIB_MBSNCASECMP@
|
||||
GNULIB_MBSNLEN = @GNULIB_MBSNLEN@
|
||||
GNULIB_MBSPBRK = @GNULIB_MBSPBRK@
|
||||
GNULIB_MBSPCASECMP = @GNULIB_MBSPCASECMP@
|
||||
GNULIB_MBSRCHR = @GNULIB_MBSRCHR@
|
||||
GNULIB_MBSSEP = @GNULIB_MBSSEP@
|
||||
GNULIB_MBSSPN = @GNULIB_MBSSPN@
|
||||
GNULIB_MBSSTR = @GNULIB_MBSSTR@
|
||||
GNULIB_MBSTOK_R = @GNULIB_MBSTOK_R@
|
||||
GNULIB_MEMMEM = @GNULIB_MEMMEM@
|
||||
GNULIB_MEMPCPY = @GNULIB_MEMPCPY@
|
||||
GNULIB_MEMRCHR = @GNULIB_MEMRCHR@
|
||||
GNULIB_MKDTEMP = @GNULIB_MKDTEMP@
|
||||
GNULIB_MKSTEMP = @GNULIB_MKSTEMP@
|
||||
GNULIB_PRINTF_POSIX = @GNULIB_PRINTF_POSIX@
|
||||
GNULIB_PUTENV = @GNULIB_PUTENV@
|
||||
GNULIB_READLINK = @GNULIB_READLINK@
|
||||
GNULIB_REALLOC_POSIX = @GNULIB_REALLOC_POSIX@
|
||||
GNULIB_ROUND = @GNULIB_ROUND@
|
||||
GNULIB_ROUNDF = @GNULIB_ROUNDF@
|
||||
GNULIB_ROUNDL = @GNULIB_ROUNDL@
|
||||
GNULIB_SETENV = @GNULIB_SETENV@
|
||||
GNULIB_SIGNBIT = @GNULIB_SIGNBIT@
|
||||
GNULIB_SLEEP = @GNULIB_SLEEP@
|
||||
GNULIB_SNPRINTF = @GNULIB_SNPRINTF@
|
||||
GNULIB_SPRINTF_POSIX = @GNULIB_SPRINTF_POSIX@
|
||||
GNULIB_STPCPY = @GNULIB_STPCPY@
|
||||
GNULIB_STPNCPY = @GNULIB_STPNCPY@
|
||||
GNULIB_STRCASESTR = @GNULIB_STRCASESTR@
|
||||
GNULIB_STRCHRNUL = @GNULIB_STRCHRNUL@
|
||||
GNULIB_STRDUP = @GNULIB_STRDUP@
|
||||
GNULIB_STRERROR = @GNULIB_STRERROR@
|
||||
GNULIB_STRNDUP = @GNULIB_STRNDUP@
|
||||
GNULIB_STRNLEN = @GNULIB_STRNLEN@
|
||||
GNULIB_STRPBRK = @GNULIB_STRPBRK@
|
||||
GNULIB_STRSEP = @GNULIB_STRSEP@
|
||||
GNULIB_STRSIGNAL = @GNULIB_STRSIGNAL@
|
||||
GNULIB_STRSTR = @GNULIB_STRSTR@
|
||||
GNULIB_STRTOK_R = @GNULIB_STRTOK_R@
|
||||
GNULIB_TRUNC = @GNULIB_TRUNC@
|
||||
GNULIB_TRUNCF = @GNULIB_TRUNCF@
|
||||
GNULIB_TRUNCL = @GNULIB_TRUNCL@
|
||||
GNULIB_UNSETENV = @GNULIB_UNSETENV@
|
||||
GNULIB_VASPRINTF = @GNULIB_VASPRINTF@
|
||||
GNULIB_VFPRINTF_POSIX = @GNULIB_VFPRINTF_POSIX@
|
||||
GNULIB_VPRINTF_POSIX = @GNULIB_VPRINTF_POSIX@
|
||||
GNULIB_VSNPRINTF = @GNULIB_VSNPRINTF@
|
||||
GNULIB_VSPRINTF_POSIX = @GNULIB_VSPRINTF_POSIX@
|
||||
GNULIB_WCWIDTH = @GNULIB_WCWIDTH@
|
||||
GREP = @GREP@
|
||||
HAVE_CALLOC_POSIX = @HAVE_CALLOC_POSIX@
|
||||
HAVE_DECL_ACOSL = @HAVE_DECL_ACOSL@
|
||||
HAVE_DECL_ASINL = @HAVE_DECL_ASINL@
|
||||
HAVE_DECL_ATANL = @HAVE_DECL_ATANL@
|
||||
HAVE_DECL_COSL = @HAVE_DECL_COSL@
|
||||
HAVE_DECL_EXPL = @HAVE_DECL_EXPL@
|
||||
HAVE_DECL_FREXPL = @HAVE_DECL_FREXPL@
|
||||
HAVE_DECL_GETDELIM = @HAVE_DECL_GETDELIM@
|
||||
HAVE_DECL_GETLINE = @HAVE_DECL_GETLINE@
|
||||
HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@
|
||||
HAVE_DECL_LDEXPL = @HAVE_DECL_LDEXPL@
|
||||
HAVE_DECL_LOGL = @HAVE_DECL_LOGL@
|
||||
HAVE_DECL_MEMMEM = @HAVE_DECL_MEMMEM@
|
||||
HAVE_DECL_MEMRCHR = @HAVE_DECL_MEMRCHR@
|
||||
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 = @HAVE_DECL_STRERROR@
|
||||
HAVE_DECL_STRNDUP = @HAVE_DECL_STRNDUP@
|
||||
HAVE_DECL_STRNLEN = @HAVE_DECL_STRNLEN@
|
||||
HAVE_DECL_STRSIGNAL = @HAVE_DECL_STRSIGNAL@
|
||||
HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@
|
||||
HAVE_DECL_TANL = @HAVE_DECL_TANL@
|
||||
HAVE_DECL_TRUNC = @HAVE_DECL_TRUNC@
|
||||
HAVE_DECL_TRUNCF = @HAVE_DECL_TRUNCF@
|
||||
HAVE_DECL_TRUNCL = @HAVE_DECL_TRUNCL@
|
||||
HAVE_DECL_VSNPRINTF = @HAVE_DECL_VSNPRINTF@
|
||||
HAVE_DECL_WCWIDTH = @HAVE_DECL_WCWIDTH@
|
||||
HAVE_DUP2 = @HAVE_DUP2@
|
||||
HAVE_FSEEKO = @HAVE_FSEEKO@
|
||||
HAVE_FTELLO = @HAVE_FTELLO@
|
||||
HAVE_FTRUNCATE = @HAVE_FTRUNCATE@
|
||||
HAVE_GETPAGESIZE = @HAVE_GETPAGESIZE@
|
||||
HAVE_GETSUBOPT = @HAVE_GETSUBOPT@
|
||||
HAVE_INTTYPES_H = @HAVE_INTTYPES_H@
|
||||
HAVE_ISWCNTRL = @HAVE_ISWCNTRL@
|
||||
HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@
|
||||
HAVE_MALLOC_POSIX = @HAVE_MALLOC_POSIX@
|
||||
HAVE_MEMPCPY = @HAVE_MEMPCPY@
|
||||
HAVE_MKDTEMP = @HAVE_MKDTEMP@
|
||||
HAVE_NETINET_IN_H = @HAVE_NETINET_IN_H@
|
||||
HAVE_OS_H = @HAVE_OS_H@
|
||||
HAVE_READLINK = @HAVE_READLINK@
|
||||
HAVE_REALLOC_POSIX = @HAVE_REALLOC_POSIX@
|
||||
HAVE_SETENV = @HAVE_SETENV@
|
||||
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_SLEEP = @HAVE_SLEEP@
|
||||
HAVE_STDINT_H = @HAVE_STDINT_H@
|
||||
HAVE_STPCPY = @HAVE_STPCPY@
|
||||
HAVE_STPNCPY = @HAVE_STPNCPY@
|
||||
HAVE_STRCASESTR = @HAVE_STRCASESTR@
|
||||
HAVE_STRCHRNUL = @HAVE_STRCHRNUL@
|
||||
HAVE_STRNDUP = @HAVE_STRNDUP@
|
||||
HAVE_STRPBRK = @HAVE_STRPBRK@
|
||||
HAVE_STRSEP = @HAVE_STRSEP@
|
||||
HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@
|
||||
HAVE_SYS_INTTYPES_H = @HAVE_SYS_INTTYPES_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_UNISTD_H = @HAVE_UNISTD_H@
|
||||
HAVE_UNSETENV = @HAVE_UNSETENV@
|
||||
HAVE_UNSIGNED_LONG_LONG_INT = @HAVE_UNSIGNED_LONG_LONG_INT@
|
||||
HAVE_VASPRINTF = @HAVE_VASPRINTF@
|
||||
HAVE_WCHAR_H = @HAVE_WCHAR_H@
|
||||
HAVE_WCTYPE_H = @HAVE_WCTYPE_H@
|
||||
HAVE_WINSOCK2_H = @HAVE_WINSOCK2_H@
|
||||
HAVE_WINT_T = @HAVE_WINT_T@
|
||||
HAVE_WS2TCPIP_H = @HAVE_WS2TCPIP_H@
|
||||
HAVE__BOOL = @HAVE__BOOL@
|
||||
HOSTNAME = @HOSTNAME@
|
||||
INCLUDE_NEXT = @INCLUDE_NEXT@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||
|
@ -218,9 +368,10 @@ LIBGNU_LTLIBDEPS = @LIBGNU_LTLIBDEPS@
|
|||
LIBICONV = @LIBICONV@
|
||||
LIBINTL = @LIBINTL@
|
||||
LIBOBJS = @LIBOBJS@
|
||||
LIBS = @LIBINTL@ @LIBS@ @SSLLIBS@
|
||||
LIBS = @LIBS@
|
||||
LIBTOOL = @LIBTOOL@
|
||||
LN_S = @LN_S@
|
||||
LOCALCHARSET_TESTS_ENVIRONMENT = @LOCALCHARSET_TESTS_ENVIRONMENT@
|
||||
LTLIBICONV = @LTLIBICONV@
|
||||
LTLIBINTL = @LTLIBINTL@
|
||||
LTLIBOBJS = @LTLIBOBJS@
|
||||
|
@ -234,6 +385,17 @@ MYSQLINCLUDE = @MYSQLINCLUDE@
|
|||
MYSQLLIBS = @MYSQLLIBS@
|
||||
NEED_SETGID = @NEED_SETGID@
|
||||
NETINET_IN_H = @NETINET_IN_H@
|
||||
NEXT_FLOAT_H = @NEXT_FLOAT_H@
|
||||
NEXT_MATH_H = @NEXT_MATH_H@
|
||||
NEXT_NETINET_IN_H = @NEXT_NETINET_IN_H@
|
||||
NEXT_STDINT_H = @NEXT_STDINT_H@
|
||||
NEXT_STDIO_H = @NEXT_STDIO_H@
|
||||
NEXT_STDLIB_H = @NEXT_STDLIB_H@
|
||||
NEXT_STRING_H = @NEXT_STRING_H@
|
||||
NEXT_SYS_SOCKET_H = @NEXT_SYS_SOCKET_H@
|
||||
NEXT_UNISTD_H = @NEXT_UNISTD_H@
|
||||
NEXT_WCHAR_H = @NEXT_WCHAR_H@
|
||||
NEXT_WCTYPE_H = @NEXT_WCTYPE_H@
|
||||
OBJEXT = @OBJEXT@
|
||||
PACKAGE = @PACKAGE@
|
||||
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
|
||||
|
@ -272,11 +434,56 @@ PKG_ARCH = @PKG_ARCH@
|
|||
PLUGIN_TEST = @PLUGIN_TEST@
|
||||
POSUB = @POSUB@
|
||||
POW_LIB = @POW_LIB@
|
||||
PST3CFLAGS = @PST3CFLAGS@
|
||||
PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@
|
||||
PYTHON = @PYTHON@
|
||||
RADIUSLIBS = @RADIUSLIBS@
|
||||
RANLIB = @RANLIB@
|
||||
RELEASE = @RELEASE@
|
||||
REPLACE_CEILF = @REPLACE_CEILF@
|
||||
REPLACE_CEILL = @REPLACE_CEILL@
|
||||
REPLACE_CHOWN = @REPLACE_CHOWN@
|
||||
REPLACE_FCHDIR = @REPLACE_FCHDIR@
|
||||
REPLACE_FFLUSH = @REPLACE_FFLUSH@
|
||||
REPLACE_FLOORF = @REPLACE_FLOORF@
|
||||
REPLACE_FLOORL = @REPLACE_FLOORL@
|
||||
REPLACE_FOPEN = @REPLACE_FOPEN@
|
||||
REPLACE_FPRINTF = @REPLACE_FPRINTF@
|
||||
REPLACE_FREOPEN = @REPLACE_FREOPEN@
|
||||
REPLACE_FREXP = @REPLACE_FREXP@
|
||||
REPLACE_FREXPL = @REPLACE_FREXPL@
|
||||
REPLACE_FSEEK = @REPLACE_FSEEK@
|
||||
REPLACE_FSEEKO = @REPLACE_FSEEKO@
|
||||
REPLACE_FTELL = @REPLACE_FTELL@
|
||||
REPLACE_FTELLO = @REPLACE_FTELLO@
|
||||
REPLACE_GETCWD = @REPLACE_GETCWD@
|
||||
REPLACE_GETLINE = @REPLACE_GETLINE@
|
||||
REPLACE_GETPAGESIZE = @REPLACE_GETPAGESIZE@
|
||||
REPLACE_ISFINITE = @REPLACE_ISFINITE@
|
||||
REPLACE_LCHOWN = @REPLACE_LCHOWN@
|
||||
REPLACE_LDEXPL = @REPLACE_LDEXPL@
|
||||
REPLACE_LSEEK = @REPLACE_LSEEK@
|
||||
REPLACE_MEMMEM = @REPLACE_MEMMEM@
|
||||
REPLACE_MKSTEMP = @REPLACE_MKSTEMP@
|
||||
REPLACE_PRINTF = @REPLACE_PRINTF@
|
||||
REPLACE_PUTENV = @REPLACE_PUTENV@
|
||||
REPLACE_ROUND = @REPLACE_ROUND@
|
||||
REPLACE_ROUNDF = @REPLACE_ROUNDF@
|
||||
REPLACE_ROUNDL = @REPLACE_ROUNDL@
|
||||
REPLACE_SIGNBIT = @REPLACE_SIGNBIT@
|
||||
REPLACE_SIGNBIT_USING_GCC = @REPLACE_SIGNBIT_USING_GCC@
|
||||
REPLACE_SNPRINTF = @REPLACE_SNPRINTF@
|
||||
REPLACE_SPRINTF = @REPLACE_SPRINTF@
|
||||
REPLACE_STRCASESTR = @REPLACE_STRCASESTR@
|
||||
REPLACE_STRERROR = @REPLACE_STRERROR@
|
||||
REPLACE_STRSIGNAL = @REPLACE_STRSIGNAL@
|
||||
REPLACE_STRSTR = @REPLACE_STRSTR@
|
||||
REPLACE_VASPRINTF = @REPLACE_VASPRINTF@
|
||||
REPLACE_VFPRINTF = @REPLACE_VFPRINTF@
|
||||
REPLACE_VPRINTF = @REPLACE_VPRINTF@
|
||||
REPLACE_VSNPRINTF = @REPLACE_VSNPRINTF@
|
||||
REPLACE_VSPRINTF = @REPLACE_VSPRINTF@
|
||||
REPLACE_WCWIDTH = @REPLACE_WCWIDTH@
|
||||
REV_DATESTAMP = @REV_DATESTAMP@
|
||||
REV_TIMESTAMP = @REV_TIMESTAMP@
|
||||
SCRIPT_TEST = @SCRIPT_TEST@
|
||||
|
@ -293,9 +500,11 @@ STDINT_H = @STDINT_H@
|
|||
STRIP = @STRIP@
|
||||
SUPPORT = @SUPPORT@
|
||||
SYS_SOCKET_H = @SYS_SOCKET_H@
|
||||
UNISTD_H = @UNISTD_H@
|
||||
USE_NLS = @USE_NLS@
|
||||
USE_PARSE_INI_FALSE = @USE_PARSE_INI_FALSE@
|
||||
USE_PARSE_INI_TRUE = @USE_PARSE_INI_TRUE@
|
||||
VERSION = @VERSION@
|
||||
VOID_UNSETENV = @VOID_UNSETENV@
|
||||
WARRANTY = @WARRANTY@
|
||||
WCHAR_H = @WCHAR_H@
|
||||
WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@
|
||||
|
@ -303,6 +512,7 @@ WCTYPE_H = @WCTYPE_H@
|
|||
WINT_T_SUFFIX = @WINT_T_SUFFIX@
|
||||
XGETTEXT = @XGETTEXT@
|
||||
XGETTEXT_015 = @XGETTEXT_015@
|
||||
XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
|
||||
ac_ct_CC = @ac_ct_CC@
|
||||
ac_ct_CXX = @ac_ct_CXX@
|
||||
ac_ct_F77 = @ac_ct_F77@
|
||||
|
@ -329,6 +539,8 @@ dvidir = @dvidir@
|
|||
exec_prefix = @exec_prefix@
|
||||
gl_LIBOBJS = @gl_LIBOBJS@
|
||||
gl_LTLIBOBJS = @gl_LTLIBOBJS@
|
||||
gltests_LIBOBJS = @gltests_LIBOBJS@
|
||||
gltests_LTLIBOBJS = @gltests_LTLIBOBJS@
|
||||
host = @host@
|
||||
host_alias = @host_alias@
|
||||
host_cpu = @host_cpu@
|
||||
|
@ -381,8 +593,11 @@ INSTALL_SUID = \
|
|||
|
||||
##############################################################################
|
||||
# the actual targets
|
||||
check_dhcp_LDADD = $(NETLIBS)
|
||||
check_icmp_LDADD = $(NETLIBS) $(SOCKETLIBS)
|
||||
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_LDADD = -lkvm
|
||||
check_dhcp_DEPENDENCIES = check_dhcp.c $(NETOBJS) $(DEPLIBS)
|
||||
check_icmp_DEPENDENCIES = check_icmp.c $(NETOBJS)
|
||||
|
@ -444,7 +659,7 @@ distclean-compile:
|
|||
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/check_dhcp.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/check_icmp.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pst3.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pst3-pst3.Po@am__quote@
|
||||
|
||||
.c.o:
|
||||
@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
|
||||
|
@ -467,6 +682,20 @@ distclean-compile:
|
|||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
|
||||
|
||||
pst3-pst3.o: pst3.c
|
||||
@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_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@ then mv -f "$(DEPDIR)/pst3-pst3.Tpo" "$(DEPDIR)/pst3-pst3.Po"; else rm -f "$(DEPDIR)/pst3-pst3.Tpo"; exit 1; fi
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='pst3.c' object='pst3-pst3.o' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_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@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_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@ then mv -f "$(DEPDIR)/pst3-pst3.Tpo" "$(DEPDIR)/pst3-pst3.Po"; else rm -f "$(DEPDIR)/pst3-pst3.Tpo"; exit 1; fi
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='pst3.c' object='pst3-pst3.obj' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_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
|
||||
|
||||
|
|
|
@ -1,49 +1,44 @@
|
|||
/******************************************************************************
|
||||
*
|
||||
/*****************************************************************************
|
||||
*
|
||||
* Nagios check_dhcp plugin
|
||||
*
|
||||
*
|
||||
* License: GPL
|
||||
* Copyright (c) 2001-2004 Ethan Galstad (nagios@nagios.org)
|
||||
* Copyright (c) 2001-2006 Nagios Plugin Development Team
|
||||
*
|
||||
* Last Modified: $Date: 2007-10-25 21:43:04 +0100 (Thu, 25 Oct 2007) $
|
||||
*
|
||||
* Copyright (c) 2001-2007 Nagios Plugin Development Team
|
||||
*
|
||||
* Last Modified: $Date: 2008-05-07 11:02:42 +0100 (Wed, 07 May 2008) $
|
||||
*
|
||||
* Description:
|
||||
*
|
||||
*
|
||||
* This file contains the check_dhcp plugin
|
||||
*
|
||||
* This plugin tests the availability of DHCP servers on a network.
|
||||
*
|
||||
*
|
||||
* License Information:
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
*
|
||||
* 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 2 of the License, or
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*
|
||||
* $Id: check_dhcp.c 1810 2007-10-25 20:43:04Z tonvoon $
|
||||
*
|
||||
* ------------------------------------------------------------------------
|
||||
* 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.
|
||||
* ------------------------------------------------------------------------
|
||||
*
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* $Id: check_dhcp.c 1991 2008-05-07 10:02:42Z dermoth $
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
const char *progname = "check_dhcp";
|
||||
const char *revision = "$Revision: 1810 $";
|
||||
const char *copyright = "2001-2006";
|
||||
const char *revision = "$Revision: 1991 $";
|
||||
const char *copyright = "2001-2007";
|
||||
const char *email = "nagiosplug-devel@lists.sourceforge.net";
|
||||
|
||||
#include "common.h"
|
||||
|
@ -273,13 +268,16 @@ int main(int argc, char **argv){
|
|||
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"));
|
||||
}
|
||||
|
||||
/* this plugin almost certainly needs root permissions. */
|
||||
np_warn_if_not_root();
|
||||
|
||||
|
||||
/* create socket for DHCP communications */
|
||||
dhcp_socket=create_dhcp_socket();
|
||||
|
||||
|
@ -321,7 +319,7 @@ int get_hardware_address(int sock,char *interface_name){
|
|||
|
||||
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);
|
||||
|
@ -511,7 +509,7 @@ int send_dhcp_discover(int sock){
|
|||
opts += sizeof(requested_address);
|
||||
}
|
||||
discover_packet.options[opts++]=DHCP_OPTION_END;
|
||||
|
||||
|
||||
/* unicast fields */
|
||||
if(unicast)
|
||||
discover_packet.giaddr.s_addr = my_ip.s_addr;
|
||||
|
@ -576,7 +574,7 @@ int get_dhcp_offer(int sock){
|
|||
|
||||
result=OK;
|
||||
result=receive_dhcp_packet(&offer_packet,sizeof(offer_packet),sock,dhcpoffer_timeout,&source);
|
||||
|
||||
|
||||
if(result!=OK){
|
||||
if(verbose)
|
||||
printf(_("Result=ERROR\n"));
|
||||
|
@ -957,7 +955,7 @@ int free_requested_server_list(void){
|
|||
next_server=this_server->next;
|
||||
free(this_server);
|
||||
}
|
||||
|
||||
|
||||
return OK;
|
||||
}
|
||||
|
||||
|
@ -982,7 +980,7 @@ int get_results(void){
|
|||
/* 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;
|
||||
|
@ -1014,7 +1012,7 @@ int get_results(void){
|
|||
/* 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;
|
||||
|
@ -1392,7 +1390,7 @@ void print_help(void){
|
|||
|
||||
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");
|
||||
|
@ -1400,6 +1398,7 @@ void print_help(void){
|
|||
print_usage();
|
||||
|
||||
printf (_(UT_HELP_VRSN));
|
||||
printf (_(UT_EXTRA_OPTS));
|
||||
|
||||
printf (_(UT_VERBOSE));
|
||||
|
||||
|
@ -1416,17 +1415,24 @@ void print_help(void){
|
|||
printf (" %s\n", "-u, --unicast");
|
||||
printf (" %s\n", _("Unicast testing: mimic a DHCP relay, requires -s"));
|
||||
|
||||
#ifdef NP_EXTRA_OPTS
|
||||
printf ("\n");
|
||||
printf ("%s\n", _("Notes:"));
|
||||
printf (_(UT_EXTRA_OPTS_NOTES));
|
||||
#endif
|
||||
|
||||
printf (_(UT_SUPPORT));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
print_usage(void){
|
||||
|
||||
|
||||
printf (_("Usage:"));
|
||||
printf (" %s [-v] [-u] [-s serverip] [-r requestedip] [-t timeout]\n",progname);
|
||||
printf (" [-i interface] [-m mac]\n");
|
||||
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,52 +1,49 @@
|
|||
/******************************************************************************
|
||||
*
|
||||
/*****************************************************************************
|
||||
*
|
||||
* Nagios check_icmp plugin
|
||||
*
|
||||
*
|
||||
* License: GPL
|
||||
* Copyright (c) 2005-2007 nagios-plugins team
|
||||
*
|
||||
* Copyright (c) 2005-2008 Nagios Plugins Development Team
|
||||
* Original Author : Andreas Ericsson <ae@op5.se>
|
||||
*
|
||||
* Last Modified: $Date: 2007-12-11 05:57:35 +0000 (Tue, 11 Dec 2007) $
|
||||
*
|
||||
*
|
||||
* Last Modified: $Date: 2008-05-07 11:02:42 +0100 (Wed, 07 May 2008) $
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* License Information:
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
*
|
||||
* 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 2 of the License, or
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*
|
||||
* $Id: check_icmp.c 1861 2007-12-11 05:57:35Z dermoth $
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* $Id: check_icmp.c 1991 2008-05-07 10:02:42Z dermoth $
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
/* progname may change */
|
||||
/* char *progname = "check_icmp"; */
|
||||
char *progname;
|
||||
const char *revision = "$Revision: 1861 $";
|
||||
const char *copyright = "2005-2007";
|
||||
const char *revision = "$Revision: 1991 $";
|
||||
const char *copyright = "2005-2008";
|
||||
const char *email = "nagiosplug-devel@lists.sourceforge.net";
|
||||
|
||||
/** nagios plugins basic includes */
|
||||
|
@ -54,6 +51,10 @@ const char *email = "nagiosplug-devel@lists.sourceforge.net";
|
|||
#include "netutils.h"
|
||||
#include "utils.h"
|
||||
|
||||
#if HAVE_SYS_SOCKIO_H
|
||||
#include <sys/sockio.h>
|
||||
#endif
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/time.h>
|
||||
#include <sys/types.h>
|
||||
#include <stdio.h>
|
||||
|
@ -66,6 +67,7 @@ const char *email = "nagiosplug-devel@lists.sourceforge.net";
|
|||
#include <ctype.h>
|
||||
#include <netdb.h>
|
||||
#include <sys/socket.h>
|
||||
#include <net/if.h>
|
||||
#include <netinet/in_systm.h>
|
||||
#include <netinet/in.h>
|
||||
#include <netinet/ip.h>
|
||||
|
@ -79,7 +81,7 @@ const char *email = "nagiosplug-devel@lists.sourceforge.net";
|
|||
# define MAXTTL 255
|
||||
#endif
|
||||
#ifndef INADDR_NONE
|
||||
# define INADDR_NONE 0xffffffU
|
||||
# define INADDR_NONE (in_addr_t)(-1)
|
||||
#endif
|
||||
|
||||
#ifndef SOL_IP
|
||||
|
@ -178,14 +180,16 @@ 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, char *, unsigned int, struct sockaddr *, u_int *);
|
||||
static int send_icmp_ping(int, struct rta_host *);
|
||||
static int get_threshold(char *str, threshold *th);
|
||||
static void run_checks(void);
|
||||
static void set_source_ip(char *);
|
||||
static int add_target(char *);
|
||||
static int add_target_ip(char *, struct in_addr *);
|
||||
static int handle_random_icmp(struct icmp *, struct sockaddr_in *);
|
||||
static int handle_random_icmp(char *, struct sockaddr_in *);
|
||||
static unsigned short icmp_checksum(unsigned short *, int);
|
||||
static void finish(int);
|
||||
static void crash(const char *, ...);
|
||||
|
@ -235,10 +239,10 @@ crash(const char *fmt, ...)
|
|||
}
|
||||
|
||||
|
||||
static char *
|
||||
static const char *
|
||||
get_icmp_error_msg(unsigned char icmp_type, unsigned char icmp_code)
|
||||
{
|
||||
char *msg = "unreachable";
|
||||
const char *msg = "unreachable";
|
||||
|
||||
if(debug > 1) printf("get_icmp_error_msg(%u, %u)\n", icmp_type, icmp_code);
|
||||
switch(icmp_type) {
|
||||
|
@ -292,19 +296,18 @@ get_icmp_error_msg(unsigned char icmp_type, unsigned char icmp_code)
|
|||
}
|
||||
|
||||
static int
|
||||
handle_random_icmp(struct icmp *p, struct sockaddr_in *addr)
|
||||
handle_random_icmp(char *packet, struct sockaddr_in *addr)
|
||||
{
|
||||
struct icmp sent_icmp;
|
||||
struct icmp p, sent_icmp;
|
||||
struct rta_host *host = NULL;
|
||||
unsigned char *ptr;
|
||||
|
||||
if(p->icmp_type == ICMP_ECHO && p->icmp_id == pid) {
|
||||
memcpy(&p, packet, sizeof(p));
|
||||
if(p.icmp_type == ICMP_ECHO && p.icmp_id == pid) {
|
||||
/* echo request from us to us (pinging localhost) */
|
||||
return 0;
|
||||
}
|
||||
|
||||
ptr = (unsigned char *)p;
|
||||
if(debug) printf("handle_random_icmp(%p, %p)\n", (void *)p, (void *)addr);
|
||||
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
|
||||
|
@ -316,15 +319,15 @@ handle_random_icmp(struct icmp *p, struct sockaddr_in *addr)
|
|||
* 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)
|
||||
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, ptr + 28, sizeof(sent_icmp));
|
||||
memcpy(&sent_icmp, packet + 28, sizeof(sent_icmp));
|
||||
if(sent_icmp.icmp_type != ICMP_ECHO || sent_icmp.icmp_id != pid ||
|
||||
sent_icmp.icmp_seq >= targets)
|
||||
{
|
||||
|
@ -336,7 +339,7 @@ handle_random_icmp(struct icmp *p, struct sockaddr_in *addr)
|
|||
host = table[sent_icmp.icmp_seq];
|
||||
if(debug) {
|
||||
printf("Received \"%s\" from %s for ICMP ECHO sent to %s.\n",
|
||||
get_icmp_error_msg(p->icmp_type, p->icmp_code),
|
||||
get_icmp_error_msg(p.icmp_type, p.icmp_code),
|
||||
inet_ntoa(addr->sin_addr), host->name);
|
||||
}
|
||||
|
||||
|
@ -347,7 +350,7 @@ handle_random_icmp(struct icmp *p, struct sockaddr_in *addr)
|
|||
|
||||
/* source quench means we're sending too fast, so increase the
|
||||
* interval and mark this packet lost */
|
||||
if(p->icmp_type == ICMP_SOURCEQUENCH) {
|
||||
if(p.icmp_type == ICMP_SOURCEQUENCH) {
|
||||
pkt_interval *= pkt_backoff_factor;
|
||||
target_interval *= target_backoff_factor;
|
||||
}
|
||||
|
@ -355,8 +358,8 @@ handle_random_icmp(struct icmp *p, struct sockaddr_in *addr)
|
|||
targets_down++;
|
||||
host->flags |= FLAG_LOST_CAUSE;
|
||||
}
|
||||
host->icmp_type = p->icmp_type;
|
||||
host->icmp_code = p->icmp_code;
|
||||
host->icmp_type = p.icmp_type;
|
||||
host->icmp_code = p.icmp_code;
|
||||
host->error_addr.s_addr = addr->sin_addr.s_addr;
|
||||
|
||||
return 0;
|
||||
|
@ -375,7 +378,7 @@ main(int argc, char **argv)
|
|||
setlocale (LC_ALL, "");
|
||||
bindtextdomain (PACKAGE, LOCALEDIR);
|
||||
textdomain (PACKAGE);
|
||||
|
||||
|
||||
/* print a helpful error message if geteuid != 0 */
|
||||
np_warn_if_not_root();
|
||||
|
||||
|
@ -444,9 +447,12 @@ main(int argc, char **argv)
|
|||
packets = 5;
|
||||
}
|
||||
|
||||
/* Parse extra opts if any */
|
||||
argv=np_extra_opts(&argc, argv, progname);
|
||||
|
||||
/* parse the arguments */
|
||||
for(i = 1; i < argc; i++) {
|
||||
while((arg = getopt(argc, argv, "vhVw:c:n:p:t:H:i:b:I:l:m:")) != EOF) {
|
||||
while((arg = getopt(argc, argv, "vhVw:c:n:p:t:H:s:i:b:I:l:m:")) != EOF) {
|
||||
switch(arg) {
|
||||
case 'v':
|
||||
debug++;
|
||||
|
@ -489,6 +495,9 @@ main(int argc, char **argv)
|
|||
crit_down = (unsigned char)strtoul(ptr + 1, NULL, 0);
|
||||
}
|
||||
break;
|
||||
case 's': /* specify source IP address */
|
||||
set_source_ip(optarg);
|
||||
break;
|
||||
case 'V': /* version */
|
||||
/*print_revision (progname, revision);*/ /* FIXME: Why? */
|
||||
exit (STATE_OK);
|
||||
|
@ -640,7 +649,7 @@ run_checks()
|
|||
table[t]->name);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
/* we're still in the game, so send next packet */
|
||||
(void)send_icmp_ping(icmp_sock, table[t]);
|
||||
result = wait_for_reply(icmp_sock, target_interval);
|
||||
|
@ -748,13 +757,13 @@ wait_for_reply(int sock, u_int t)
|
|||
memcpy(&icp, buf + hlen, sizeof(icp));
|
||||
|
||||
if(icp.icmp_id != pid) {
|
||||
handle_random_icmp(&icp, &resp_addr);
|
||||
handle_random_icmp(buf + hlen, &resp_addr);
|
||||
continue;
|
||||
}
|
||||
|
||||
if(icp.icmp_type != ICMP_ECHOREPLY || icp.icmp_seq >= targets) {
|
||||
if(debug > 2) printf("not a proper ICMP_ECHOREPLY\n");
|
||||
handle_random_icmp(&icp, &resp_addr);
|
||||
handle_random_icmp(buf + hlen, &resp_addr);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -887,7 +896,7 @@ finish(int sig)
|
|||
unsigned char pl;
|
||||
double rta;
|
||||
struct rta_host *host;
|
||||
char *status_string[] =
|
||||
const char *status_string[] =
|
||||
{"OK", "WARNING", "CRITICAL", "UNKNOWN", "DEPENDENT"};
|
||||
int hosts_ok = 0;
|
||||
int hosts_warn = 0;
|
||||
|
@ -1101,7 +1110,7 @@ add_target(char *arg)
|
|||
|
||||
/* this is silly, but it works */
|
||||
if(mode == MODE_HOSTCHECK || mode == MODE_ALL) {
|
||||
printf("mode: %d\n", mode);
|
||||
if(debug > 2) printf("mode: %d\n", mode);
|
||||
continue;
|
||||
}
|
||||
break;
|
||||
|
@ -1109,6 +1118,40 @@ add_target(char *arg)
|
|||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void
|
||||
set_source_ip(char *arg)
|
||||
{
|
||||
struct sockaddr_in src;
|
||||
|
||||
memset(&src, 0, sizeof(src));
|
||||
src.sin_family = AF_INET;
|
||||
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)
|
||||
{
|
||||
#if defined(SIOCGIFADDR)
|
||||
struct ifreq ifr;
|
||||
struct sockaddr_in ip;
|
||||
|
||||
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));
|
||||
return ip.sin_addr.s_addr;
|
||||
#else
|
||||
errno = 0;
|
||||
crash("Cannot get interface IP address on this platform.");
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
* u = micro
|
||||
* m = milli
|
||||
|
@ -1213,16 +1256,17 @@ print_help(void)
|
|||
{
|
||||
|
||||
/*print_revision (progname, revision);*/ /* 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", "-w");
|
||||
|
@ -1231,6 +1275,8 @@ print_help(void)
|
|||
printf (" %s\n", "-c");
|
||||
printf (" %s", _("critical threshold (currently "));
|
||||
printf ("%0.3fms,%u%%)\n", (float)crit.rta, crit.pl);
|
||||
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);
|
||||
|
@ -1255,23 +1301,28 @@ print_help(void)
|
|||
printf (" %s\n", _("verbose"));
|
||||
|
||||
printf ("\n");
|
||||
printf ("%s\n\n", _("The -H switch is optional. Naming a host (or several) to check is not."));
|
||||
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\n", _("us (microseconds), ms (milliseconds, default) or just plain s for seconds."));
|
||||
printf ("%s\n", _("Notes:"));
|
||||
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 ("%s\n\n", _("The -v switch can be specified several times for increased verbosity."));
|
||||
|
||||
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"));
|
||||
*/
|
||||
#ifdef NP_EXTRA_OPTS
|
||||
printf ("\n");
|
||||
printf (_(UT_EXTRA_OPTS_NOTES));
|
||||
#endif
|
||||
|
||||
printf (_(UT_SUPPORT));
|
||||
|
||||
printf (_(UT_NOWARRANTY));
|
||||
}
|
||||
|
||||
|
||||
|
@ -1280,5 +1331,5 @@ void
|
|||
print_usage (void)
|
||||
{
|
||||
printf (_("Usage:"));
|
||||
printf(" %s [options] [-H] host1 host2 hostn\n", progname);
|
||||
printf(" %s [options] [-H] host1 host2 hostN\n", progname);
|
||||
}
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
/* pst3.c
|
||||
*
|
||||
* Third version to get process arg info; this time by using
|
||||
* a combination of reading the /proc/<pid>/psinfo structures
|
||||
* and reading the complete arg vector from kernel memory structures.
|
||||
*
|
||||
* Developed and tested under Solaris 5.8 (both 32 and 64 bit modes).
|
||||
*
|
||||
* NOTE: This program must be setuid-root (or run by root) to work!
|
||||
*
|
||||
* Written: 2005-04-28 R.W.Ingraham
|
||||
*/
|
||||
*
|
||||
* Third version to get process arg info; this time by using
|
||||
* a combination of reading the /proc/<pid>/psinfo structures
|
||||
* and reading the complete arg vector from kernel memory structures.
|
||||
*
|
||||
* Developed and tested under Solaris 5.8 (both 32 and 64 bit modes).
|
||||
*
|
||||
* NOTE: This program must be setuid-root (or run by root) to work!
|
||||
*
|
||||
* Written: 2005-04-28 R.W.Ingraham
|
||||
*/
|
||||
|
||||
|
||||
#define _KMEMUSER 1
|
||||
|
@ -99,7 +99,7 @@ int main (int argc, char **argv)
|
|||
if ((pDir = opendir(PROC_DIR)) != NULL)
|
||||
{
|
||||
/* Display column headings */
|
||||
printf("S UID PPID VSZ RSS %%CPU COMMAND ARGS\n");
|
||||
printf("S UID PID PPID VSZ RSS %%CPU COMMAND ARGS\n");
|
||||
|
||||
/* Zip through all of the process entries */
|
||||
while ((pDent = readdir(pDir)) != NULL)
|
||||
|
@ -187,9 +187,10 @@ static int HandlePsInfo (char *szPath, psinfo_t *pPsInfo)
|
|||
thisProg = myArgv[0];
|
||||
|
||||
/* Display the ps columns (except for argv) */
|
||||
printf("%c %5d %5d %6lu %6lu %4.1f %s ",
|
||||
printf("%c %5d %5d %5d %6lu %6lu %4.1f %s ",
|
||||
pPsInfo->pr_lwp.pr_sname,
|
||||
(int)(pPsInfo->pr_euid),
|
||||
(int)(pPsInfo->pr_pid),
|
||||
(int)(pPsInfo->pr_ppid),
|
||||
(unsigned long)(pPsInfo->pr_size),
|
||||
(unsigned long)(pPsInfo->pr_rssize),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue