diff options
Diffstat (limited to 'contrib/ntp/ntpsnmpd')
20 files changed, 5566 insertions, 0 deletions
diff --git a/contrib/ntp/ntpsnmpd/Makefile.am b/contrib/ntp/ntpsnmpd/Makefile.am new file mode 100644 index 0000000..11ecf1b --- /dev/null +++ b/contrib/ntp/ntpsnmpd/Makefile.am @@ -0,0 +1,117 @@ +NULL= + +bin_PROGRAMS= $(NTPSNMPD_DB) +libexec_PROGRAMS= $(NTPSNMPD_DL) +sbin_PROGRAMS= $(NTPSNMPD_DS) + +EXTRA_PROGRAMS= ntpsnmpd +ntpsnmpd_SOURCES= netsnmp_daemonize.c ntpsnmpd.c ntpSnmpSubagentObject.c \ + ntpsnmpd-opts.c ntpsnmpd-opts.h ntpSnmpSubagentObject.h \ + ntp_snmp.h +# HMS: we probably want a version.o file here, too. +LDADD = ../ntpq/libntpq.a ../libntp/libntp.a +LDADD += $(SNMP_LIBS) $(LDADD_LIBNTP) $(LIBM) +LDADD += $(PTHREAD_LIBS) $(LDADD_NTP) $(LIBOPTS_LDADD) + +AM_CFLAGS = $(SNMP_CFLAGS) $(CFLAGS_NTP) + +AM_CPPFLAGS = -I$(top_srcdir)/ntpq +AM_CPPFLAGS += $(NTP_INCS) +AM_CPPFLAGS += $(LIBOPTS_CFLAGS) +AM_CPPFLAGS += $(SNMP_CPPFLAGS) +AM_CPPFLAGS += $(CPPFLAGS_NTP) + +AM_LDFLAGS = $(LDFLAGS_NTP) + +EXTRA_DIST= \ + invoke-ntpsnmpd.menu \ + invoke-ntpsnmpd.texi \ + ntpsnmpd-opts.def \ + ntpsnmpd.1ntpsnmpdman \ + ntpsnmpd.1ntpsnmpdmdoc \ + ntpsnmpd.man.in \ + ntpsnmpd.mdoc.in \ + ntpsnmpd.html \ + ntpsnmpd.texi \ + ntpv4-mib.mib \ + $(NULL) + +BUILT_SOURCES= ntpsnmpd-opts.c ntpsnmpd-opts.h +CLEANFILES= +DISTCLEANFILES= config.log $(man_MANS) + +html_DATA= \ + $(srcdir)/ntpsnmpd.html \ + $(NULL) + +noinst_DATA= \ + $(srcdir)/invoke-ntpsnmpd.menu \ + $(srcdir)/invoke-ntpsnmpd.texi \ + $(srcdir)/ntpsnmpd.man.in \ + $(srcdir)/ntpsnmpd.mdoc.in \ + $(NULL) + +install-data-local: install-html + +man1_MANS= +man8_MANS= +man_MANS= ntpsnmpd.$(NTPSNMPD_MS) + +run_ag= cd $(srcdir) && env PATH="$(abs_builddir):$(PATH)" AUTOGEN_DNE_DATE=-D \ + autogen -L ../sntp/include -L ../sntp/ag-tpl --writable +std_def_list = \ + $(top_srcdir)/sntp/include/debug-opt.def \ + $(top_srcdir)/sntp/include/autogen-version.def \ + $(top_srcdir)/sntp/include/copyright.def \ + $(top_srcdir)/sntp/include/homerc.def \ + $(top_srcdir)/sntp/include/ntp.lic \ + $(top_srcdir)/sntp/include/version.def \ + $(NULL) + +$(srcdir)/ntpsnmpd-opts.h: $(srcdir)/ntpsnmpd-opts.c + @: do-nothing action to avoid default SCCS get, .h built with .c + +$(srcdir)/ntpsnmpd-opts.c: $(srcdir)/ntpsnmpd-opts.def $(std_def_list) + $(run_ag) ntpsnmpd-opts.def + +### + +$(srcdir)/ntpsnmpd.1ntpsnmpdman: $(srcdir)/ntpsnmpd-opts.def $(std_def_list) + $(run_ag) -DMAN_SECTION=1ntpsnmpdman -Tagman-cmd.tpl ntpsnmpd-opts.def + +$(srcdir)/ntpsnmpd.man.in: $(srcdir)/ntpsnmpd.1ntpsnmpdman $(top_srcdir)/sntp/scripts/mansec2subst.sed + sed -f $(top_srcdir)/sntp/scripts/mansec2subst.sed $(srcdir)/ntpsnmpd.1ntpsnmpdman > $(srcdir)/ntpsnmpd.man.in+ + mv $(srcdir)/ntpsnmpd.man.in+ $(srcdir)/ntpsnmpd.man.in + +### + +$(srcdir)/ntpsnmpd.1ntpsnmpdmdoc: $(srcdir)/ntpsnmpd-opts.def $(std_def_list) + $(run_ag) -DMAN_SECTION=1ntpsnmpdmdoc -Tagmdoc-cmd.tpl ntpsnmpd-opts.def + +$(srcdir)/ntpsnmpd.mdoc.in: $(srcdir)/ntpsnmpd.1ntpsnmpdmdoc $(top_srcdir)/sntp/scripts/mansec2subst.sed + sed -f $(top_srcdir)/sntp/scripts/mansec2subst.sed $(srcdir)/ntpsnmpd.1ntpsnmpdmdoc > $(srcdir)/ntpsnmpd.mdoc.in+ + mv $(srcdir)/ntpsnmpd.mdoc.in+ $(srcdir)/ntpsnmpd.mdoc.in + +### + +ntpsnmpd.$(NTPSNMPD_MS): $(srcdir)/ntpsnmpd.$(MANTAGFMT).in $(top_builddir)/config.status + $(top_builddir)/config.status --file=ntpsnmpd.$(NTPSNMPD_MS)+:$(srcdir)/ntpsnmpd.$(MANTAGFMT).in + mv ntpsnmpd.$(NTPSNMPD_MS)+ ntpsnmpd.$(NTPSNMPD_MS) + +### + +$(srcdir)/invoke-ntpsnmpd.menu: $(srcdir)/invoke-ntpsnmpd.texi + @: do-nothing action to avoid default SCCS get, .menu built with .texi + +$(srcdir)/invoke-ntpsnmpd.texi: $(srcdir)/ntpsnmpd-opts.def $(std_def_list) + $(run_ag) -Tagtexi-cmd.tpl -DLEVEL=section ntpsnmpd-opts.def + $(top_srcdir)/scripts/build/check--help $@ + +$(srcdir)/ntpsnmpd.html: $(srcdir)/ntpsnmpd.texi $(top_srcdir)/sntp/include/version.texi + cd $(srcdir) && ( makeinfo --force --html --no-split -o ntpsnmpd.html ntpsnmpd.texi || true ) + +include $(top_srcdir)/bincheck.mf +include $(top_srcdir)/sntp/check-libntp.mf +include $(top_srcdir)/check-libopts.mf +include $(top_srcdir)/depsver.mf +include $(top_srcdir)/includes.mf diff --git a/contrib/ntp/ntpsnmpd/Makefile.in b/contrib/ntp/ntpsnmpd/Makefile.in new file mode 100644 index 0000000..2532f07 --- /dev/null +++ b/contrib/ntp/ntpsnmpd/Makefile.in @@ -0,0 +1,1145 @@ +# Makefile.in generated by automake 1.11.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 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@ + +# we traditionally installed software in bindir, while it should have gone +# in sbindir. Now that we offer a choice, look in the "other" installation +# subdir to warn folks if there is another version there. + + +VPATH = @srcdir@ +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@ +EXTRA_PROGRAMS = ntpsnmpd$(EXEEXT) +DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ + $(top_srcdir)/bincheck.mf $(top_srcdir)/check-libopts.mf \ + $(top_srcdir)/depsver.mf $(top_srcdir)/includes.mf \ + $(top_srcdir)/sntp/check-libntp.mf +subdir = ntpsnmpd +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \ + $(top_srcdir)/sntp/libopts/m4/stdnoreturn.m4 \ + $(top_srcdir)/sntp/libevent/m4/openldap-thread-check.m4 \ + $(top_srcdir)/sntp/libevent/m4/openldap.m4 \ + $(top_srcdir)/sntp/m4/define_dir.m4 \ + $(top_srcdir)/sntp/m4/hms_search_lib.m4 \ + $(top_srcdir)/sntp/m4/libtool.m4 \ + $(top_srcdir)/sntp/m4/ltoptions.m4 \ + $(top_srcdir)/sntp/m4/ltsugar.m4 \ + $(top_srcdir)/sntp/m4/ltversion.m4 \ + $(top_srcdir)/sntp/m4/lt~obsolete.m4 \ + $(top_srcdir)/sntp/m4/ntp_cacheversion.m4 \ + $(top_srcdir)/sntp/m4/ntp_compiler.m4 \ + $(top_srcdir)/sntp/m4/ntp_crosscompile.m4 \ + $(top_srcdir)/sntp/m4/ntp_crypto_rand.m4 \ + $(top_srcdir)/sntp/m4/ntp_debug.m4 \ + $(top_srcdir)/sntp/m4/ntp_dir_sep.m4 \ + $(top_srcdir)/sntp/m4/ntp_facilitynames.m4 \ + $(top_srcdir)/sntp/m4/ntp_googletest.m4 \ + $(top_srcdir)/sntp/m4/ntp_ipv6.m4 \ + $(top_srcdir)/sntp/m4/ntp_lib_m.m4 \ + $(top_srcdir)/sntp/m4/ntp_libevent.m4 \ + $(top_srcdir)/sntp/m4/ntp_libntp.m4 \ + $(top_srcdir)/sntp/m4/ntp_lineeditlibs.m4 \ + $(top_srcdir)/sntp/m4/ntp_locinfo.m4 \ + $(top_srcdir)/sntp/m4/ntp_openssl.m4 \ + $(top_srcdir)/sntp/m4/ntp_pkg_config.m4 \ + $(top_srcdir)/sntp/m4/ntp_prog_cc.m4 \ + $(top_srcdir)/sntp/m4/ntp_rlimit.m4 \ + $(top_srcdir)/sntp/m4/ntp_sntp.m4 \ + $(top_srcdir)/sntp/m4/ntp_ver_suffix.m4 \ + $(top_srcdir)/sntp/m4/ntp_vpathhack.m4 \ + $(top_srcdir)/sntp/m4/os_cflags.m4 \ + $(top_srcdir)/sntp/m4/snprintf.m4 \ + $(top_srcdir)/sntp/m4/version.m4 $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(libexecdir)" \ + "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(man1dir)" \ + "$(DESTDIR)$(man8dir)" "$(DESTDIR)$(htmldir)" +PROGRAMS = $(bin_PROGRAMS) $(libexec_PROGRAMS) $(sbin_PROGRAMS) +am_ntpsnmpd_OBJECTS = netsnmp_daemonize.$(OBJEXT) ntpsnmpd.$(OBJEXT) \ + ntpSnmpSubagentObject.$(OBJEXT) ntpsnmpd-opts.$(OBJEXT) +ntpsnmpd_OBJECTS = $(am_ntpsnmpd_OBJECTS) +ntpsnmpd_LDADD = $(LDADD) +am__DEPENDENCIES_1 = +ntpsnmpd_DEPENDENCIES = ../ntpq/libntpq.a ../libntp/libntp.a \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +AM_V_lt = $(am__v_lt_$(V)) +am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY)) +am__v_lt_0 = --silent +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/sntp/libevent/build-aux/depcomp +am__depfiles_maybe = depfiles +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_$(V)) +am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY)) +am__v_CC_0 = @echo " CC " $@; +AM_V_at = $(am__v_at_$(V)) +am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY)) +am__v_at_0 = @ +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_$(V)) +am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY)) +am__v_CCLD_0 = @echo " CCLD " $@; +AM_V_GEN = $(am__v_GEN_$(V)) +am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY)) +am__v_GEN_0 = @echo " GEN " $@; +SOURCES = $(ntpsnmpd_SOURCES) +DIST_SOURCES = $(ntpsnmpd_SOURCES) +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +man1dir = $(mandir)/man1 +man8dir = $(mandir)/man8 +NROFF = nroff +MANS = $(man1_MANS) $(man8_MANS) $(man_MANS) +DATA = $(html_DATA) $(noinst_DATA) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ALLOCA = @ALLOCA@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CALC_TICKADJ_DB = @CALC_TICKADJ_DB@ +CALC_TICKADJ_DL = @CALC_TICKADJ_DL@ +CALC_TICKADJ_DS = @CALC_TICKADJ_DS@ +CALC_TICKADJ_MS = @CALC_TICKADJ_MS@ +CALC_TICKADJ_NI = @CALC_TICKADJ_NI@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CFLAGS_NTP = @CFLAGS_NTP@ +CHUTEST = @CHUTEST@ +CONFIG_SHELL = @CONFIG_SHELL@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CPPFLAGS_LIBEVENT = @CPPFLAGS_LIBEVENT@ +CPPFLAGS_NTP = @CPPFLAGS_NTP@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DCFD = @DCFD@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EDITLINE_LIBS = @EDITLINE_LIBS@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GREP = @GREP@ +GTEST_CONFIG = @GTEST_CONFIG@ +GTEST_CPPFLAGS = @GTEST_CPPFLAGS@ +GTEST_CXXFLAGS = @GTEST_CXXFLAGS@ +GTEST_LDFLAGS = @GTEST_LDFLAGS@ +GTEST_LIBS = @GTEST_LIBS@ +HAVE_INLINE = @HAVE_INLINE@ +HAVE_RLIMIT_MEMLOCK = @HAVE_RLIMIT_MEMLOCK@ +HAVE_RLIMIT_STACK = @HAVE_RLIMIT_STACK@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LD = @LD@ +LDADD_LIBEVENT = @LDADD_LIBEVENT@ +LDADD_LIBNTP = @LDADD_LIBNTP@ +LDADD_LIBUTIL = @LDADD_LIBUTIL@ +LDADD_NLIST = @LDADD_NLIST@ +LDADD_NTP = @LDADD_NTP@ +LDFLAGS = @LDFLAGS@ +LDFLAGS_NTP = @LDFLAGS_NTP@ +LIBISC_PTHREADS_NOTHREADS = @LIBISC_PTHREADS_NOTHREADS@ +LIBM = @LIBM@ +LIBOBJS = @LIBOBJS@ +LIBOPTS_CFLAGS = @LIBOPTS_CFLAGS@ +LIBOPTS_DIR = @LIBOPTS_DIR@ +LIBOPTS_LDADD = @LIBOPTS_LDADD@ +LIBPARSE = @LIBPARSE@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIBTOOL_DEPS = @LIBTOOL_DEPS@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LSCF = @LSCF@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MAKE_ADJTIMED = @MAKE_ADJTIMED@ +MAKE_CHECK_LAYOUT = @MAKE_CHECK_LAYOUT@ +MAKE_CHECK_Y2K = @MAKE_CHECK_Y2K@ +MAKE_LIBNTPSIM = @MAKE_LIBNTPSIM@ +MAKE_LIBPARSE = @MAKE_LIBPARSE@ +MAKE_LIBPARSE_KERNEL = @MAKE_LIBPARSE_KERNEL@ +MAKE_NTPDSIM = @MAKE_NTPDSIM@ +MAKE_NTPSNMPD = @MAKE_NTPSNMPD@ +MAKE_NTPTIME = @MAKE_NTPTIME@ +MAKE_PARSEKMODULE = @MAKE_PARSEKMODULE@ +MAKE_TICKADJ = @MAKE_TICKADJ@ +MAKE_TIMETRIM = @MAKE_TIMETRIM@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MANTAGFMT = @MANTAGFMT@ +MKDIR_P = @MKDIR_P@ +NM = @NM@ +NMEDIT = @NMEDIT@ +NTPDATE_DB = @NTPDATE_DB@ +NTPDATE_DL = @NTPDATE_DL@ +NTPDATE_DS = @NTPDATE_DS@ +NTPDATE_MS = @NTPDATE_MS@ +NTPDATE_NI = @NTPDATE_NI@ +NTPDC_DB = @NTPDC_DB@ +NTPDC_DL = @NTPDC_DL@ +NTPDC_DS = @NTPDC_DS@ +NTPDC_MS = @NTPDC_MS@ +NTPDC_NI = @NTPDC_NI@ +NTPDSIM_DB = @NTPDSIM_DB@ +NTPDSIM_DL = @NTPDSIM_DL@ +NTPDSIM_DS = @NTPDSIM_DS@ +NTPDSIM_MS = @NTPDSIM_MS@ +NTPDSIM_NI = @NTPDSIM_NI@ +NTPD_DB = @NTPD_DB@ +NTPD_DL = @NTPD_DL@ +NTPD_DS = @NTPD_DS@ +NTPD_MS = @NTPD_MS@ +NTPD_NI = @NTPD_NI@ +NTPQ_DB = @NTPQ_DB@ +NTPQ_DL = @NTPQ_DL@ +NTPQ_DS = @NTPQ_DS@ +NTPQ_MS = @NTPQ_MS@ +NTPQ_NI = @NTPQ_NI@ +NTPSNMPD_DB = @NTPSNMPD_DB@ +NTPSNMPD_DL = @NTPSNMPD_DL@ +NTPSNMPD_DS = @NTPSNMPD_DS@ +NTPSNMPD_MS = @NTPSNMPD_MS@ +NTPSNMPD_NI = @NTPSNMPD_NI@ +NTPSWEEP_DB = @NTPSWEEP_DB@ +NTPSWEEP_DL = @NTPSWEEP_DL@ +NTPSWEEP_DS = @NTPSWEEP_DS@ +NTPSWEEP_MS = @NTPSWEEP_MS@ +NTPSWEEP_NI = @NTPSWEEP_NI@ +NTPTIME_DB = @NTPTIME_DB@ +NTPTIME_DL = @NTPTIME_DL@ +NTPTIME_DS = @NTPTIME_DS@ +NTPTIME_MS = @NTPTIME_MS@ +NTPTIME_NI = @NTPTIME_NI@ +NTPTRACE_DB = @NTPTRACE_DB@ +NTPTRACE_DL = @NTPTRACE_DL@ +NTPTRACE_DS = @NTPTRACE_DS@ +NTPTRACE_MS = @NTPTRACE_MS@ +NTPTRACE_NI = @NTPTRACE_NI@ +NTP_KEYGEN_DB = @NTP_KEYGEN_DB@ +NTP_KEYGEN_DL = @NTP_KEYGEN_DL@ +NTP_KEYGEN_DS = @NTP_KEYGEN_DS@ +NTP_KEYGEN_MS = @NTP_KEYGEN_MS@ +NTP_KEYGEN_NI = @NTP_KEYGEN_NI@ +NTP_KEYSDIR = @NTP_KEYSDIR@ +NTP_WAIT_DB = @NTP_WAIT_DB@ +NTP_WAIT_DL = @NTP_WAIT_DL@ +NTP_WAIT_DS = @NTP_WAIT_DS@ +NTP_WAIT_MS = @NTP_WAIT_MS@ +NTP_WAIT_NI = @NTP_WAIT_NI@ +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_NET_SNMP_CONFIG = @PATH_NET_SNMP_CONFIG@ +PATH_PERL = @PATH_PERL@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PATH_TEST = @PATH_TEST@ +PERLLIBDIR = @PERLLIBDIR@ +PKG_CONFIG = @PKG_CONFIG@ +POSIX_SHELL = @POSIX_SHELL@ +PROPDELAY = @PROPDELAY@ +PTHREAD_LIBS = @PTHREAD_LIBS@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SNMP_CFLAGS = @SNMP_CFLAGS@ +SNMP_CPPFLAGS = @SNMP_CPPFLAGS@ +SNMP_LIBS = @SNMP_LIBS@ +SNTP = @SNTP@ +SNTP_DB = @SNTP_DB@ +SNTP_DL = @SNTP_DL@ +SNTP_DS = @SNTP_DS@ +SNTP_MS = @SNTP_MS@ +SNTP_NI = @SNTP_NI@ +STDNORETURN_H = @STDNORETURN_H@ +STRIP = @STRIP@ +TESTDCF = @TESTDCF@ +TICKADJ_DB = @TICKADJ_DB@ +TICKADJ_DL = @TICKADJ_DL@ +TICKADJ_DS = @TICKADJ_DS@ +TICKADJ_MS = @TICKADJ_MS@ +TICKADJ_NI = @TICKADJ_NI@ +TIMETRIM_DB = @TIMETRIM_DB@ +TIMETRIM_DL = @TIMETRIM_DL@ +TIMETRIM_DS = @TIMETRIM_DS@ +TIMETRIM_MS = @TIMETRIM_MS@ +TIMETRIM_NI = @TIMETRIM_NI@ +VERSION = @VERSION@ +VER_SUFFIX = @VER_SUFFIX@ +YACC = @YACC@ +YFLAGS = @YFLAGS@ +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_CXX = @ac_ct_CXX@ +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@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +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 = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +subdirs = @subdirs@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +NULL = +bin_PROGRAMS = $(NTPSNMPD_DB) +libexec_PROGRAMS = $(NTPSNMPD_DL) +sbin_PROGRAMS = $(NTPSNMPD_DS) +ntpsnmpd_SOURCES = netsnmp_daemonize.c ntpsnmpd.c ntpSnmpSubagentObject.c \ + ntpsnmpd-opts.c ntpsnmpd-opts.h ntpSnmpSubagentObject.h \ + ntp_snmp.h + +# HMS: we probably want a version.o file here, too. +LDADD = ../ntpq/libntpq.a ../libntp/libntp.a $(SNMP_LIBS) \ + $(LDADD_LIBNTP) $(LIBM) $(PTHREAD_LIBS) $(LDADD_NTP) \ + $(LIBOPTS_LDADD) +AM_CFLAGS = $(SNMP_CFLAGS) $(CFLAGS_NTP) +AM_CPPFLAGS = -I$(top_srcdir)/ntpq $(NTP_INCS) $(LIBOPTS_CFLAGS) \ + $(SNMP_CPPFLAGS) $(CPPFLAGS_NTP) +AM_LDFLAGS = $(LDFLAGS_NTP) +EXTRA_DIST = \ + invoke-ntpsnmpd.menu \ + invoke-ntpsnmpd.texi \ + ntpsnmpd-opts.def \ + ntpsnmpd.1ntpsnmpdman \ + ntpsnmpd.1ntpsnmpdmdoc \ + ntpsnmpd.man.in \ + ntpsnmpd.mdoc.in \ + ntpsnmpd.html \ + ntpsnmpd.texi \ + ntpv4-mib.mib \ + $(NULL) + +BUILT_SOURCES = ntpsnmpd-opts.c ntpsnmpd-opts.h check-libntp \ + check-libopts .deps-ver +CLEANFILES = check-libntp check-libopts .deps-ver +DISTCLEANFILES = config.log $(man_MANS) +html_DATA = \ + $(srcdir)/ntpsnmpd.html \ + $(NULL) + +noinst_DATA = \ + $(srcdir)/invoke-ntpsnmpd.menu \ + $(srcdir)/invoke-ntpsnmpd.texi \ + $(srcdir)/ntpsnmpd.man.in \ + $(srcdir)/ntpsnmpd.mdoc.in \ + $(NULL) + +man1_MANS = +man8_MANS = +man_MANS = ntpsnmpd.$(NTPSNMPD_MS) +run_ag = cd $(srcdir) && env PATH="$(abs_builddir):$(PATH)" AUTOGEN_DNE_DATE=-D \ + autogen -L ../sntp/include -L ../sntp/ag-tpl --writable + +std_def_list = \ + $(top_srcdir)/sntp/include/debug-opt.def \ + $(top_srcdir)/sntp/include/autogen-version.def \ + $(top_srcdir)/sntp/include/copyright.def \ + $(top_srcdir)/sntp/include/homerc.def \ + $(top_srcdir)/sntp/include/ntp.lic \ + $(top_srcdir)/sntp/include/version.def \ + $(NULL) + +NTP_INCS = -I$(top_srcdir)/include -I$(top_srcdir)/lib/isc/include \ + -I$(top_srcdir)/lib/isc/$(LIBISC_PTHREADS_NOTHREADS)/include \ + -I$(top_srcdir)/lib/isc/unix/include +all: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/bincheck.mf $(top_srcdir)/sntp/check-libntp.mf $(top_srcdir)/check-libopts.mf $(top_srcdir)/depsver.mf $(top_srcdir)/includes.mf $(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) --foreign ntpsnmpd/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign ntpsnmpd/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): +install-binPROGRAMS: $(bin_PROGRAMS) + @$(NORMAL_INSTALL) + test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" + @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ + for p in $$list; do echo "$$p $$p"; done | \ + sed 's/$(EXEEXT)$$//' | \ + while read p p1; do if test -f $$p || test -f $$p1; \ + then echo "$$p"; echo "$$p"; else :; fi; \ + done | \ + sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \ + -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ + sed 'N;N;N;s,\n, ,g' | \ + $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ + { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ + if ($$2 == $$4) files[d] = files[d] " " $$1; \ + else { print "f", $$3 "/" $$4, $$1; } } \ + END { for (d in files) print "f", d, files[d] }' | \ + while read type dir files; do \ + if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ + test -z "$$files" || { \ + echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ + $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ + } \ + ; done + +uninstall-binPROGRAMS: + @$(NORMAL_UNINSTALL) + @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ + files=`for p in $$list; do echo "$$p"; done | \ + sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ + -e 's/$$/$(EXEEXT)/' `; \ + test -n "$$list" || exit 0; \ + echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(bindir)" && rm -f $$files + +clean-binPROGRAMS: + @list='$(bin_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 +install-libexecPROGRAMS: $(libexec_PROGRAMS) + @$(NORMAL_INSTALL) + test -z "$(libexecdir)" || $(MKDIR_P) "$(DESTDIR)$(libexecdir)" + @list='$(libexec_PROGRAMS)'; test -n "$(libexecdir)" || list=; \ + for p in $$list; do echo "$$p $$p"; done | \ + sed 's/$(EXEEXT)$$//' | \ + while read p p1; do if test -f $$p || test -f $$p1; \ + then echo "$$p"; echo "$$p"; else :; fi; \ + done | \ + sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \ + -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ + sed 'N;N;N;s,\n, ,g' | \ + $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ + { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ + if ($$2 == $$4) files[d] = files[d] " " $$1; \ + else { print "f", $$3 "/" $$4, $$1; } } \ + END { for (d in files) print "f", d, files[d] }' | \ + while read type dir files; do \ + if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ + test -z "$$files" || { \ + echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(libexecdir)$$dir'"; \ + $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(libexecdir)$$dir" || exit $$?; \ + } \ + ; done + +uninstall-libexecPROGRAMS: + @$(NORMAL_UNINSTALL) + @list='$(libexec_PROGRAMS)'; test -n "$(libexecdir)" || list=; \ + files=`for p in $$list; do echo "$$p"; done | \ + sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ + -e 's/$$/$(EXEEXT)/' `; \ + test -n "$$list" || exit 0; \ + echo " ( cd '$(DESTDIR)$(libexecdir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(libexecdir)" && rm -f $$files + +clean-libexecPROGRAMS: + @list='$(libexec_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 +install-sbinPROGRAMS: $(sbin_PROGRAMS) + @$(NORMAL_INSTALL) + test -z "$(sbindir)" || $(MKDIR_P) "$(DESTDIR)$(sbindir)" + @list='$(sbin_PROGRAMS)'; test -n "$(sbindir)" || list=; \ + for p in $$list; do echo "$$p $$p"; done | \ + sed 's/$(EXEEXT)$$//' | \ + while read p p1; do if test -f $$p || test -f $$p1; \ + then echo "$$p"; echo "$$p"; else :; fi; \ + done | \ + sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \ + -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ + sed 'N;N;N;s,\n, ,g' | \ + $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ + { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ + if ($$2 == $$4) files[d] = files[d] " " $$1; \ + else { print "f", $$3 "/" $$4, $$1; } } \ + END { for (d in files) print "f", d, files[d] }' | \ + while read type dir files; do \ + if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ + test -z "$$files" || { \ + echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(sbindir)$$dir'"; \ + $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(sbindir)$$dir" || exit $$?; \ + } \ + ; done + +uninstall-sbinPROGRAMS: + @$(NORMAL_UNINSTALL) + @list='$(sbin_PROGRAMS)'; test -n "$(sbindir)" || list=; \ + files=`for p in $$list; do echo "$$p"; done | \ + sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ + -e 's/$$/$(EXEEXT)/' `; \ + test -n "$$list" || exit 0; \ + echo " ( cd '$(DESTDIR)$(sbindir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(sbindir)" && rm -f $$files + +clean-sbinPROGRAMS: + @list='$(sbin_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 +ntpsnmpd$(EXEEXT): $(ntpsnmpd_OBJECTS) $(ntpsnmpd_DEPENDENCIES) + @rm -f ntpsnmpd$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ntpsnmpd_OBJECTS) $(ntpsnmpd_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/netsnmp_daemonize.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntpSnmpSubagentObject.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntpsnmpd-opts.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntpsnmpd.Po@am__quote@ + +.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 +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c $< + +.c.obj: +@am__fastdepCC_TRUE@ $(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 +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` + +.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 +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +install-man1: $(man1_MANS) $(man_MANS) + @$(NORMAL_INSTALL) + test -z "$(man1dir)" || $(MKDIR_P) "$(DESTDIR)$(man1dir)" + @list='$(man1_MANS)'; test -n "$(man1dir)" || exit 0; \ + { for i in $$list; do echo "$$i"; done; \ + l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ + sed -n '/\.1[a-z]*$$/p'; \ + } | while read p; do \ + if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; echo "$$p"; \ + done | \ + sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ + -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ + sed 'N;N;s,\n, ,g' | { \ + list=; while read file base inst; do \ + if test "$$base" = "$$inst"; then list="$$list $$file"; else \ + echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \ + $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \ + fi; \ + done; \ + for i in $$list; do echo "$$i"; done | $(am__base_list) | \ + while read files; do \ + test -z "$$files" || { \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \ + done; } + +uninstall-man1: + @$(NORMAL_UNINSTALL) + @list='$(man1_MANS)'; test -n "$(man1dir)" || exit 0; \ + files=`{ for i in $$list; do echo "$$i"; done; \ + l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ + sed -n '/\.1[a-z]*$$/p'; \ + } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ + -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ + test -z "$$files" || { \ + echo " ( cd '$(DESTDIR)$(man1dir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(man1dir)" && rm -f $$files; } +install-man8: $(man8_MANS) $(man_MANS) + @$(NORMAL_INSTALL) + test -z "$(man8dir)" || $(MKDIR_P) "$(DESTDIR)$(man8dir)" + @list='$(man8_MANS)'; test -n "$(man8dir)" || exit 0; \ + { for i in $$list; do echo "$$i"; done; \ + l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ + sed -n '/\.8[a-z]*$$/p'; \ + } | while read p; do \ + if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; echo "$$p"; \ + done | \ + sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^8][0-9a-z]*$$,8,;x' \ + -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ + sed 'N;N;s,\n, ,g' | { \ + list=; while read file base inst; do \ + if test "$$base" = "$$inst"; then list="$$list $$file"; else \ + echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man8dir)/$$inst'"; \ + $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man8dir)/$$inst" || exit $$?; \ + fi; \ + done; \ + for i in $$list; do echo "$$i"; done | $(am__base_list) | \ + while read files; do \ + test -z "$$files" || { \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man8dir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(man8dir)" || exit $$?; }; \ + done; } + +uninstall-man8: + @$(NORMAL_UNINSTALL) + @list='$(man8_MANS)'; test -n "$(man8dir)" || exit 0; \ + files=`{ for i in $$list; do echo "$$i"; done; \ + l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ + sed -n '/\.8[a-z]*$$/p'; \ + } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^8][0-9a-z]*$$,8,;x' \ + -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ + test -z "$$files" || { \ + echo " ( cd '$(DESTDIR)$(man8dir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(man8dir)" && rm -f $$files; } +install-htmlDATA: $(html_DATA) + @$(NORMAL_INSTALL) + test -z "$(htmldir)" || $(MKDIR_P) "$(DESTDIR)$(htmldir)" + @list='$(html_DATA)'; test -n "$(htmldir)" || list=; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(htmldir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(htmldir)" || exit $$?; \ + done + +uninstall-htmlDATA: + @$(NORMAL_UNINSTALL) + @list='$(html_DATA)'; test -n "$(htmldir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + test -n "$$files" || exit 0; \ + echo " ( cd '$(DESTDIR)$(htmldir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(htmldir)" && rm -f $$files + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + set x; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + 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 +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @list='$(MANS)'; if test -n "$$list"; then \ + list=`for p in $$list; do \ + if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ + if test -f "$$d$$p"; then echo "$$d$$p"; else :; fi; done`; \ + if test -n "$$list" && \ + grep 'ab help2man is required to generate this page' $$list >/dev/null; then \ + echo "error: found man pages containing the \`missing help2man' replacement text:" >&2; \ + grep -l 'ab help2man is required to generate this page' $$list | sed 's/^/ /' >&2; \ + echo " to fix them, install help2man, remove and regenerate the man pages;" >&2; \ + echo " typically \`make maintainer-clean' will remove them" >&2; \ + exit 1; \ + else :; fi; \ + else :; fi + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + 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 +check: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) check-am +all-am: Makefile $(PROGRAMS) $(MANS) $(DATA) +installdirs: + for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(libexecdir)" "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(man8dir)" "$(DESTDIR)$(htmldir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +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) + -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." + -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) +clean: clean-am + +clean-am: clean-binPROGRAMS clean-generic clean-libexecPROGRAMS \ + clean-libtool clean-sbinPROGRAMS mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: install-data-local install-htmlDATA install-man + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: install-binPROGRAMS install-libexecPROGRAMS \ + install-sbinPROGRAMS + @$(NORMAL_INSTALL) + $(MAKE) $(AM_MAKEFLAGS) install-exec-hook +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: install-man1 install-man8 + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-binPROGRAMS uninstall-htmlDATA \ + uninstall-libexecPROGRAMS uninstall-man uninstall-sbinPROGRAMS + +uninstall-man: uninstall-man1 uninstall-man8 + +.MAKE: all check install install-am install-exec-am install-strip + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \ + clean-generic clean-libexecPROGRAMS clean-libtool \ + clean-sbinPROGRAMS ctags distclean distclean-compile \ + distclean-generic distclean-libtool distclean-tags distdir dvi \ + dvi-am html html-am info info-am install install-am \ + install-binPROGRAMS install-data install-data-am \ + install-data-local install-dvi install-dvi-am install-exec \ + install-exec-am install-exec-hook install-html install-html-am \ + install-htmlDATA install-info install-info-am \ + install-libexecPROGRAMS install-man install-man1 install-man8 \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-sbinPROGRAMS install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags uninstall uninstall-am uninstall-binPROGRAMS \ + uninstall-htmlDATA uninstall-libexecPROGRAMS uninstall-man \ + uninstall-man1 uninstall-man8 uninstall-sbinPROGRAMS + + +install-data-local: install-html + +$(srcdir)/ntpsnmpd-opts.h: $(srcdir)/ntpsnmpd-opts.c + @: do-nothing action to avoid default SCCS get, .h built with .c + +$(srcdir)/ntpsnmpd-opts.c: $(srcdir)/ntpsnmpd-opts.def $(std_def_list) + $(run_ag) ntpsnmpd-opts.def + +### + +$(srcdir)/ntpsnmpd.1ntpsnmpdman: $(srcdir)/ntpsnmpd-opts.def $(std_def_list) + $(run_ag) -DMAN_SECTION=1ntpsnmpdman -Tagman-cmd.tpl ntpsnmpd-opts.def + +$(srcdir)/ntpsnmpd.man.in: $(srcdir)/ntpsnmpd.1ntpsnmpdman $(top_srcdir)/sntp/scripts/mansec2subst.sed + sed -f $(top_srcdir)/sntp/scripts/mansec2subst.sed $(srcdir)/ntpsnmpd.1ntpsnmpdman > $(srcdir)/ntpsnmpd.man.in+ + mv $(srcdir)/ntpsnmpd.man.in+ $(srcdir)/ntpsnmpd.man.in + +### + +$(srcdir)/ntpsnmpd.1ntpsnmpdmdoc: $(srcdir)/ntpsnmpd-opts.def $(std_def_list) + $(run_ag) -DMAN_SECTION=1ntpsnmpdmdoc -Tagmdoc-cmd.tpl ntpsnmpd-opts.def + +$(srcdir)/ntpsnmpd.mdoc.in: $(srcdir)/ntpsnmpd.1ntpsnmpdmdoc $(top_srcdir)/sntp/scripts/mansec2subst.sed + sed -f $(top_srcdir)/sntp/scripts/mansec2subst.sed $(srcdir)/ntpsnmpd.1ntpsnmpdmdoc > $(srcdir)/ntpsnmpd.mdoc.in+ + mv $(srcdir)/ntpsnmpd.mdoc.in+ $(srcdir)/ntpsnmpd.mdoc.in + +### + +ntpsnmpd.$(NTPSNMPD_MS): $(srcdir)/ntpsnmpd.$(MANTAGFMT).in $(top_builddir)/config.status + $(top_builddir)/config.status --file=ntpsnmpd.$(NTPSNMPD_MS)+:$(srcdir)/ntpsnmpd.$(MANTAGFMT).in + mv ntpsnmpd.$(NTPSNMPD_MS)+ ntpsnmpd.$(NTPSNMPD_MS) + +### + +$(srcdir)/invoke-ntpsnmpd.menu: $(srcdir)/invoke-ntpsnmpd.texi + @: do-nothing action to avoid default SCCS get, .menu built with .texi + +$(srcdir)/invoke-ntpsnmpd.texi: $(srcdir)/ntpsnmpd-opts.def $(std_def_list) + $(run_ag) -Tagtexi-cmd.tpl -DLEVEL=section ntpsnmpd-opts.def + $(top_srcdir)/scripts/build/check--help $@ + +$(srcdir)/ntpsnmpd.html: $(srcdir)/ntpsnmpd.texi $(top_srcdir)/sntp/include/version.texi + cd $(srcdir) && ( makeinfo --force --html --no-split -o ntpsnmpd.html ntpsnmpd.texi || true ) + +install-exec-hook: + @test -z "${bin_PROGRAMS}${bin_SCRIPTS}" \ + || for i in ${bin_PROGRAMS} ${bin_SCRIPTS} " "; do \ + test ! -f ${sbindir}/$$i \ + || echo "*** $$i is also in ${sbindir}!"; \ + done + @test -z "${sbin_PROGRAMS}${asbin_SCRIPTS}" \ + || for i in ${sbin_PROGRAMS} ${sbin_SCRIPTS} " "; do \ + test ! -f ${bindir}/$$i \ + || echo "*** $$i is also in ${bindir}!"; \ + done + +# + +check-libntp: ../libntp/libntp.a + @echo stamp > $@ + +../libntp/libntp.a: + cd ../libntp && $(MAKE) $(AM_MAKEFLAGS) libntp.a + +check-libopts: ../sntp/libopts/libopts.la + @echo stamp > $@ + +../sntp/libopts/libopts.la: + -cd ../sntp/libopts && $(MAKE) $(AM_MAKEFLAGS) libopts.la +$(DEPDIR)/deps-ver: $(top_srcdir)/deps-ver + @[ -f $@ ] || \ + cp $(top_srcdir)/deps-ver $@ + @[ -w $@ ] || \ + chmod ug+w $@ + @cmp $(top_srcdir)/deps-ver $@ > /dev/null || ( \ + $(MAKE) $(AM_MAKEFLAGS) clean && \ + echo -n "Prior $(subdir)/$(DEPDIR) version " && \ + cat $@ && \ + rm -rf $(DEPDIR) && \ + mkdir $(DEPDIR) && \ + case "$(top_builddir)" in \ + .) \ + ./config.status Makefile depfiles \ + ;; \ + *) \ + cd "$(top_builddir)" && \ + ./config.status $(subdir)/Makefile depfiles && \ + cd $(subdir) \ + ;; \ + esac && \ + echo -n "Cleaned $(subdir)/$(DEPDIR) version " && \ + cat $(top_srcdir)/deps-ver \ + ) + cp $(top_srcdir)/deps-ver $@ + +.deps-ver: $(top_srcdir)/deps-ver + @[ ! -d $(DEPDIR) ] || $(MAKE) $(AM_MAKEFLAGS) $(DEPDIR)/deps-ver + @touch $@ + +# +# depsver.mf included in Makefile.am for directories with .deps +# +# When building in the same directory with sources that change over +# time, such as when tracking using bk, the .deps files can become +# stale with respect to moved, deleted, or superceded headers. Most +# commonly, this would exhibit as make reporting a failure to make a +# header file which is no longer in the location given. To address +# this issue, we use a deps-ver file which is updated with each change +# that breaks old .deps files. A copy of deps-ver is made into +# $(DEPDIR) if not already present. If $(DEPDIR)/deps-ver is present +# with different contents than deps-ver, we make clean to ensure all +# .o files built before the incompatible change are rebuilt along with +# their updated .deps files, then remove $(DEPDIR) and recreate it as +# empty stubs. +# +# It is normal when configured with --disable-dependency-tracking for +# the DEPDIR to not have been created. For this reason, we use the +# intermediate target .deps-ver, which invokes make recursively if +# DEPDIR exists. +# +# If you modify depsver.mf, please make the changes to the master +# copy, the one in sntp is copied by the bootstrap script from it. +# +# This comment block follows rather than leads the related code so that +# it stays with it in the generated Makefile.in and Makefile. +# + +# 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/contrib/ntp/ntpsnmpd/README b/contrib/ntp/ntpsnmpd/README new file mode 100644 index 0000000..5227f40 --- /dev/null +++ b/contrib/ntp/ntpsnmpd/README @@ -0,0 +1,40 @@ +NTP SNMP subagent for Net-SNMP + +Installation Guides: + +- install net-snmp from source (configure, make;, make install) +- edit the snmpd configuration file (/usr/local/share/snmp/snmpd.conf): + add the lines + master agentx + agentXSocket tcp:localhost:705 + and check which read-only community is configured (should be "rocommunity public") +- start snmpd (sudo /usr/local/sbin/snmpd) and check that it is running correctly by running the command + snmpwalk -v2c -c public localhost + (which should output a lot of data values for the supported built-in MIBs of net-snmp) +- build the libntpq and the libntp library +- build the ntpsnmpd application (make) and run it (./ntpsnmpd) +- now you can run + snmpwalk -v2c -c public localhost enterprises.5597.99 + which should give you a list of all currently supported NTP MIB objects and their current values + +Please note that currently I use a private MIB OID (enterprises.5597 is the Meinberg top level OEM OID and 99 is my temporary working space for this project). +The final OID has to be registered with IANA and this is done by the RFC Editor when the NTPv4 MIB RFC is standardized. +I will try to do this earlier in order to be able to have a working solution at the end of this project. + +In its current state the daemon supports these objects: + +ntpEntSoftwareName +ntpEntSoftwareVersion +ntpEntSoftwareVersionVal +ntpEntSoftwareVendor +ntpEntSystemType +ntpEntTimeResolution +ntpEntTimeResolutionVal +ntpEntTimePrecision +ntpEntTimePrecisionVal +ntpEntTimeDistance + +They all use the libntpq library to access information from the ntpd instance with mode 6 packets. + +Next step is to implement the status section of the MIB (section 2). + diff --git a/contrib/ntp/ntpsnmpd/invoke-ntpsnmpd.menu b/contrib/ntp/ntpsnmpd/invoke-ntpsnmpd.menu new file mode 100644 index 0000000..886e80a --- /dev/null +++ b/contrib/ntp/ntpsnmpd/invoke-ntpsnmpd.menu @@ -0,0 +1 @@ +* ntpsnmpd Invocation:: Invoking ntpsnmpd diff --git a/contrib/ntp/ntpsnmpd/invoke-ntpsnmpd.texi b/contrib/ntp/ntpsnmpd/invoke-ntpsnmpd.texi new file mode 100644 index 0000000..513d70c --- /dev/null +++ b/contrib/ntp/ntpsnmpd/invoke-ntpsnmpd.texi @@ -0,0 +1,188 @@ +@node ntpsnmpd Invocation +@section Invoking ntpsnmpd +@pindex ntpsnmpd +@cindex NTP SNMP MIB agent +@ignore +# +# EDIT THIS FILE WITH CAUTION (invoke-ntpsnmpd.texi) +# +# It has been AutoGen-ed February 4, 2015 at 02:43:32 AM by AutoGen 5.18.5pre4 +# From the definitions ntpsnmpd-opts.def +# and the template file agtexi-cmd.tpl +@end ignore + + + +@code{ntpsnmpd} +is an SNMP MIB agent designed to interface with +@code{ntpd(1ntpdmdoc)}. + +This section was generated by @strong{AutoGen}, +using the @code{agtexi-cmd} template and the option descriptions for the @code{ntpsnmpd} program. +This software is released under the NTP license, <http://ntp.org/license>. + +@menu +* ntpsnmpd usage:: ntpsnmpd help/usage (@option{--help}) +* ntpsnmpd agentxsocket:: agentxsocket option +* ntpsnmpd config:: presetting/configuring ntpsnmpd +* ntpsnmpd exit status:: exit status +* ntpsnmpd Usage:: Usage +* ntpsnmpd Notes:: Notes +* ntpsnmpd Authors:: Authors +@end menu + +@node ntpsnmpd usage +@subsection ntpsnmpd help/usage (@option{--help}) +@cindex ntpsnmpd help + +This is the automatically generated usage text for ntpsnmpd. + +The text printed is the same whether selected with the @code{help} option +(@option{--help}) or the @code{more-help} option (@option{--more-help}). @code{more-help} will print +the usage text by passing it through a pager program. +@code{more-help} is disabled on platforms without a working +@code{fork(2)} function. The @code{PAGER} environment variable is +used to select the program, defaulting to @file{more}. Both will exit +with a status code of 0. + +@exampleindent 0 +@example +ntpsnmpd - NTP SNMP MIB agent - Ver. 4.2.8p1 +Usage: ntpsnmpd [ -<flag> [<val>] | --<name>[@{=| @}<val>] ]... + Flg Arg Option-Name Description + -n no nofork Do not fork + -p no syslog Log to syslog() + Str agentxsocket The socket address ntpsnmpd uses to connect to net-snmpd + opt version output version information and exit + -? no help display extended usage information and exit + -! no more-help extended usage information passed thru pager + -> opt save-opts save the option state to a config file + -< Str load-opts load options from a config file + - disabled as '--no-load-opts' + - may appear multiple times + +Options are specified by doubled hyphens and their name or by a single +hyphen and the flag character. + + +The following option preset mechanisms are supported: + - reading file $HOME/.ntprc + - reading file ./.ntprc + - examining environment variables named NTPSNMPD_* + +Please send bug reports to: <http://bugs.ntp.org, bugs@@ntp.org> +@end example +@exampleindent 4 + +@node ntpsnmpd agentxsocket +@subsection agentxsocket option +@cindex ntpsnmpd-agentxsocket + +This is the ``the socket address ntpsnmpd uses to connect to net-snmpd'' option. +This option takes a string argument. +[<transport-specifier>:]<transport-address> +The default "agent X socket" is the Unix Domain socket +@file{unix:/var/agentx/master}. +Another common alternative is @file{tcp:localhost:705}. + + +@node ntpsnmpd config +@subsection presetting/configuring ntpsnmpd + +Any option that is not marked as @i{not presettable} may be preset by +loading values from configuration ("rc" or "ini") files, and values from environment variables named @code{NTPSNMPD} and @code{NTPSNMPD_<OPTION_NAME>}. @code{<OPTION_NAME>} must be one of +the options listed above in upper case and segmented with underscores. +The @code{NTPSNMPD} variable will be tokenized and parsed like +the command line. The remaining variables are tested for existence and their +values are treated like option arguments. + + +@noindent +@code{libopts} will search in 2 places for configuration files: +@itemize @bullet +@item +$HOME +@item +$PWD +@end itemize +The environment variables @code{HOME}, and @code{PWD} +are expanded and replaced when @file{ntpsnmpd} runs. +For any of these that are plain files, they are simply processed. +For any that are directories, then a file named @file{.ntprc} is searched for +within that directory and processed. + +Configuration files may be in a wide variety of formats. +The basic format is an option name followed by a value (argument) on the +same line. Values may be separated from the option name with a colon, +equal sign or simply white space. Values may be continued across multiple +lines by escaping the newline with a backslash. + +Multiple programs may also share the same initialization file. +Common options are collected at the top, followed by program specific +segments. The segments are separated by lines like: +@example +[NTPSNMPD] +@end example +@noindent +or by +@example +<?program ntpsnmpd> +@end example +@noindent +Do not mix these styles within one configuration file. + +Compound values and carefully constructed string values may also be +specified using XML syntax: +@example +<option-name> + <sub-opt>...<...>...</sub-opt> +</option-name> +@end example +@noindent +yielding an @code{option-name.sub-opt} string value of +@example +"...<...>..." +@end example +@code{AutoOpts} does not track suboptions. You simply note that it is a +hierarchicly valued option. @code{AutoOpts} does provide a means for searching +the associated name/value pair list (see: optionFindValue). + +The command line options relating to configuration and/or usage help are: + +@subsubheading version (-) + +Print the program version to standard out, optionally with licensing +information, then exit 0. The optional argument specifies how much licensing +detail to provide. The default is to print just the version. The licensing infomation may be selected with an option argument. +Only the first letter of the argument is examined: + +@table @samp +@item version +Only print the version. This is the default. +@item copyright +Name the copyright usage licensing terms. +@item verbose +Print the full copyright usage licensing terms. +@end table + +@node ntpsnmpd exit status +@subsection ntpsnmpd exit status + +One of the following exit values will be returned: +@table @samp +@item 0 (EXIT_SUCCESS) +Successful program execution. +@item 1 (EXIT_FAILURE) +The operation failed or the command syntax was not valid. +@item 66 (EX_NOINPUT) +A specified configuration file could not be loaded. +@item 70 (EX_SOFTWARE) +libopts had an internal operational error. Please report +it to autogen-users@@lists.sourceforge.net. Thank you. +@end table +@node ntpsnmpd Usage +@subsection ntpsnmpd Usage +@node ntpsnmpd Notes +@subsection ntpsnmpd Notes +@node ntpsnmpd Authors +@subsection ntpsnmpd Authors diff --git a/contrib/ntp/ntpsnmpd/netsnmp_daemonize.c b/contrib/ntp/ntpsnmpd/netsnmp_daemonize.c new file mode 100644 index 0000000..4311bac --- /dev/null +++ b/contrib/ntp/ntpsnmpd/netsnmp_daemonize.c @@ -0,0 +1,271 @@ +/* + * system.c + */ +/* Portions of this file are subject to the following copyright(s). See + * the Net-SNMP's COPYING file for more details and other copyrights + * that may apply: + */ +/*********************************************************** + Copyright 1992 by Carnegie Mellon University + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of CMU not be +used in advertising or publicity pertaining to distribution of the +software without specific, written prior permission. + +CMU DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL +CMU BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. +******************************************************************/ +/* + * Portions of this file are copyrighted by: + * Copyright © 2003 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms specified in the COPYING file + * distributed with the Net-SNMP package. + */ +/* + * System dependent routines go here + */ +#include <net-snmp/net-snmp-config.h> +#undef PACKAGE_BUGREPORT +#undef PACKAGE_NAME +#undef PACKAGE_STRING +#undef PACKAGE_TARNAME +#undef PACKAGE_URL +#undef PACKAGE_VERSION +#include <config.h> + +#ifdef NEED_NETSNMP_DAEMONIZE + +#include <stdio.h> +#include <ctype.h> +#include <errno.h> + +#if HAVE_UNISTD_H +#include <unistd.h> +#endif +#if HAVE_STDLIB_H +#include <stdlib.h> +#endif + +#if TIME_WITH_SYS_TIME +# ifdef WIN32 +# include <sys/timeb.h> +# else +# include <sys/time.h> +# endif +# include <time.h> +#else +# if HAVE_SYS_TIME_H +# include <sys/time.h> +# else +# include <time.h> +# endif +#endif + +#include <sys/types.h> + +#if HAVE_NETINET_IN_H +#include <netinet/in.h> +#endif + +#if HAVE_WINSOCK_H +#include <winsock.h> +#endif +#if HAVE_SYS_SOCKET_H +#include <sys/socket.h> +#endif +#if HAVE_NET_IF_H +#include <net/if.h> +#endif + +#if HAVE_SYS_SOCKIO_H +#include <sys/sockio.h> +#endif + +#if HAVE_SYS_IOCTL_H +#include <sys/ioctl.h> +#endif + +#ifdef HAVE_NLIST_H +#include <nlist.h> +#endif + +#if HAVE_SYS_FILE_H +#include <sys/file.h> +#endif + +#if HAVE_KSTAT_H +#include <kstat.h> +#endif + +#if HAVE_SYS_PARAM_H +#include <sys/param.h> +#endif +#if HAVE_SYS_SYSCTL_H +#include <sys/sysctl.h> +#endif + +#if HAVE_STRING_H +#include <string.h> +#else +#include <strings.h> +#endif + +#if HAVE_DMALLOC_H +#include <dmalloc.h> +#endif + +#ifdef HAVE_SYS_STAT_H +#include <sys/stat.h> +#endif +#if HAVE_FCNTL_H +#include <fcntl.h> +#endif + +#if defined(hpux10) || defined(hpux11) +#include <sys/pstat.h> +#endif + +#if HAVE_SYS_UTSNAME_H +#include <sys/utsname.h> +#endif + +#if HAVE_SYS_SYSTEMCFG_H +#include <sys/systemcfg.h> +#endif + +#if HAVE_SYS_SYSTEMINFO_H +#include <sys/systeminfo.h> +#endif + +#include <net-snmp/types.h> +#include <net-snmp/output_api.h> +#include <net-snmp/utilities.h> +#include <net-snmp/library/system.h> /* for "internal" definitions */ + +#include <net-snmp/library/snmp_api.h> +#include <net-snmp/library/read_config.h> /* for get_temp_file_pattern() */ + +#ifndef IFF_LOOPBACK +# define IFF_LOOPBACK 0 +#endif + +#ifdef INADDR_LOOPBACK +# define LOOPBACK INADDR_LOOPBACK +#else +# define LOOPBACK 0x7f000001 +#endif + +/** + * fork current process into the background. + * + * This function forks a process into the background, in order to + * become a daemon process. It does a few things along the way: + * + * - becoming a process/session group leader, and forking a second time so + * that process/session group leader can exit. + * + * - changing the working directory to / + * + * - closing stdin, stdout and stderr (unless stderr_log is set) and + * redirecting them to /dev/null + * + * @param quit_immediately : indicates if the parent process should + * exit after a successful fork. + * @param stderr_log : indicates if stderr is being used for + * logging and shouldn't be closed + * @returns -1 : fork error + * 0 : child process returning + * >0 : parent process returning. returned value is the child PID. + */ +int +netsnmp_daemonize(int quit_immediately, int stderr_log) +{ + int i = 0; + int saved_errno; + + DEBUGMSGT(("daemonize","deamonizing...\n")); +#ifdef HAVE_WORKING_FORK + /* + * Fork to return control to the invoking process and to + * guarantee that we aren't a process group leader. + */ + i = fork(); + if (i != 0) { + /* Parent. */ + saved_errno = errno; + DEBUGMSGT(("daemonize","first fork returned %d.\n", i)); + if(i == -1) { + snmp_log(LOG_ERR,"first fork failed (errno %d) in " + "netsnmp_daemonize()\n", saved_errno); + return -1; + } + if (quit_immediately) { + DEBUGMSGT(("daemonize","parent exiting\n")); + exit(0); + } + } else { + /* Child. */ +#ifdef HAVE_SETSID + /* Become a process/session group leader. */ + setsid(); +#endif + /* + * Fork to let the process/session group leader exit. + */ + if ((i = fork()) != 0) { + saved_errno = errno; + DEBUGMSGT(("daemonize","second fork returned %d.\n", i)); + if(i == -1) { + snmp_log(LOG_ERR,"second fork failed (errno %d) in " + "netsnmp_daemonize()\n", saved_errno); + } + /* Parent. */ + exit(0); + } +#ifndef WIN32 + else { + /* Child. */ + + DEBUGMSGT(("daemonize","child continuing\n")); + + /* Avoid keeping any directory in use. */ + chdir("/"); + + if (!stderr_log) { + /* + * Close inherited file descriptors to avoid + * keeping unnecessary references. + */ + close(0); + close(1); + close(2); + + /* + * Redirect std{in,out,err} to /dev/null, just in + * case. + */ + open("/dev/null", O_RDWR); + dup(0); + dup(0); + } + } +#endif /* !WIN32 */ + } +#endif /* HAVE_WORKING_FORK */ + return i; +} + +#else /* !NEED_NETSNMP_DAEMONIZE */ +int netsnp_daemonize_bs; +#endif diff --git a/contrib/ntp/ntpsnmpd/ntpSnmpSubagentObject.c b/contrib/ntp/ntpsnmpd/ntpSnmpSubagentObject.c new file mode 100644 index 0000000..f65fedf --- /dev/null +++ b/contrib/ntp/ntpsnmpd/ntpSnmpSubagentObject.c @@ -0,0 +1,549 @@ +/***************************************************************************** + * + * ntpSnmpSubAgentObject.c + * + * This file provides the callback functions for net-snmp and registers the + * serviced MIB objects with the master agent. + * + * Each object has its own callback function that is called by the + * master agent process whenever someone queries the corresponding MIB + * object. + * + * At the moment this triggers a full send/receive procedure for each + * queried MIB object, one of the things that are still on my todo list: + * a caching mechanism that reduces the number of requests sent to the + * ntpd process. + * + ****************************************************************************/ +#include <ntp_snmp.h> +#include <ctype.h> +#include <ntp.h> +#include <libntpq.h> + +/* general purpose buffer length definition */ +#define NTPQ_BUFLEN 2048 + +char ntpvalue[NTPQ_BUFLEN]; + + +/***************************************************************************** + * + * ntpsnmpd_parse_string + * + * This function will parse a given NULL terminated string and cut it + * into a fieldname and a value part (using the '=' as the delimiter. + * The fieldname will be converted to uppercase and all whitespace + * characters are removed from it. + * The value part is stripped, e.g. all whitespace characters are removed + * from the beginning and end of the string. + * If the value is started and ended with quotes ("), they will be removed + * and everything between the quotes is left untouched (including + * whitespace) + * Example: + * server host name = hello world! + * will result in a field string "SERVERHOSTNAME" and a value + * of "hello world!". + * My first Parameter = " is this! " + * results in a field string "MYFIRSTPARAMETER" and a value " is this! " + **************************************************************************** + * Parameters: + * string const char * The source string to parse. + * NOTE: must be NULL terminated! + * field char * The buffer for the field name. + * fieldsize size_t The size of the field buffer. + * value char * The buffer for the value. + * valuesize size_t The size of the value buffer. + * + * Returns: + * size_t length of value string + ****************************************************************************/ + +size_t +ntpsnmpd_parse_string( + const char * string, + char * field, + size_t fieldsize, + char * value, + size_t valuesize + ) +{ + int i; + int j; + int loop; + size_t str_cnt; + size_t val_cnt; + + /* we need at least one byte to work with to simplify */ + if (fieldsize < 1 || valuesize < 1) + return 0; + + str_cnt = strlen(string); + + /* Parsing the field name */ + j = 0; + loop = TRUE; + for (i = 0; loop && i <= str_cnt; i++) { + switch (string[i]) { + + case '\t': /* Tab */ + case '\n': /* LF */ + case '\r': /* CR */ + case ' ': /* Space */ + break; + + case '=': + loop = FALSE; + break; + + default: + if (j < fieldsize) + field[j++] = toupper(string[i]); + } + } + + j = min(j, fieldsize - 1); + field[j] = '\0'; + + /* Now parsing the value */ + value[0] = '\0'; + j = 0; + for (val_cnt = 0; i < str_cnt; i++) { + if (string[i] > 0x0D && string[i] != ' ') + val_cnt = min(j + 1, valuesize - 1); + + if (value[0] != '\0' || + (string[i] > 0x0D && string[i] != ' ')) { + if (j < valuesize) + value[j++] = string[i]; + } + } + value[val_cnt] = '\0'; + + if (value[0] == '"') { + val_cnt--; + strlcpy(value, &value[1], valuesize); + if (val_cnt > 0 && value[val_cnt - 1] == '"') { + val_cnt--; + value[val_cnt] = '\0'; + } + } + + return val_cnt; +} + + +/***************************************************************************** + * + * ntpsnmpd_cut_string + * + * This function will parse a given NULL terminated string and cut it + * into fields using the specified delimiter character. + * It will then copy the requested field into a destination buffer + * Example: + * ntpsnmpd_cut_string(read:my:lips:fool, RESULT, ':', 2, sizeof(RESULT)) + * will copy "lips" to RESULT. + **************************************************************************** + * Parameters: + * src const char * The name of the source string variable + * NOTE: must be NULL terminated! + * dest char * The name of the string which takes the + * requested field content + * delim char The delimiter character + * fieldnumber int The number of the required field + * (start counting with 0) + * maxsize size_t The maximum size of dest + * + * Returns: + * size_t length of resulting dest string + ****************************************************************************/ + +size_t +ntpsnmpd_cut_string( + const char * string, + char * dest, + char delim, + int fieldnumber, + size_t maxsize + ) +{ + size_t i; + size_t j; + int l; + size_t str_cnt; + + if (maxsize < 1) + return 0; + + str_cnt = strlen(string); + j = 0; + memset(dest, 0, maxsize); + + /* Parsing the field name */ + for (i = 0, l = 0; i < str_cnt && l <= fieldnumber; i++) { + if (string[i] == delim) + l++; /* next field */ + else if (l == fieldnumber && j < maxsize) + dest[j++] = string[i]; + } + j = min(j, maxsize - 1); + dest[j] = '\0'; + + return j; +} + + +/***************************************************************************** + * + * read_ntp_value + * + * This function retrieves the value for a given variable, currently + * this only supports sysvars. It starts a full mode 6 send/receive/parse + * iteration and needs to be optimized, e.g. by using a caching mechanism + * + **************************************************************************** + * Parameters: + * variable char* The name of the required variable + * rbuffer char* The buffer where the value goes + * maxlength int Max. number of bytes for resultbuf + * + * Returns: + * u_int number of chars that have been copied to + * rbuffer + ****************************************************************************/ + +size_t +read_ntp_value( + const char * variable, + char * value, + size_t valuesize + ) +{ + size_t sv_len; + char sv_data[NTPQ_BUFLEN]; + + memset(sv_data, 0, sizeof(sv_data)); + sv_len = ntpq_read_sysvars(sv_data, sizeof(sv_data)); + + if (0 == sv_len) + return 0; + else + return ntpq_getvar(sv_data, sv_len, variable, value, + valuesize); +} + + +/***************************************************************************** + * + * The get_xxx functions + * + * The following function calls are callback functions that will be + * used by the master agent process to retrieve a value for a requested + * MIB object. + * + ****************************************************************************/ + + +int get_ntpEntSoftwareName (netsnmp_mib_handler *handler, + netsnmp_handler_registration *reginfo, + netsnmp_agent_request_info *reqinfo, + netsnmp_request_info *requests) +{ + char ntp_softwarename[NTPQ_BUFLEN]; + + memset (ntp_softwarename, 0, NTPQ_BUFLEN); + + switch (reqinfo->mode) { + case MODE_GET: + { + if ( read_ntp_value("product", ntpvalue, NTPQ_BUFLEN) ) + { + snmp_set_var_typed_value(requests->requestvb, ASN_OCTET_STR, + (u_char *)ntpvalue, + strlen(ntpvalue) + ); + } + else if ( read_ntp_value("version", ntpvalue, NTPQ_BUFLEN) ) + { + ntpsnmpd_cut_string(ntpvalue, ntp_softwarename, ' ', 0, sizeof(ntp_softwarename)-1); + snmp_set_var_typed_value(requests->requestvb, ASN_OCTET_STR, + (u_char *)ntp_softwarename, + strlen(ntp_softwarename) + ); + } else { + snmp_set_var_typed_value(requests->requestvb, ASN_OCTET_STR, + (u_char *)"N/A", + 3 + ); + } + break; + + } + + + default: + /* If we cannot get the information we need, we will return a generic error to the SNMP client */ + return SNMP_ERR_GENERR; + } + + return SNMP_ERR_NOERROR; +} + + +int get_ntpEntSoftwareVersion (netsnmp_mib_handler *handler, + netsnmp_handler_registration *reginfo, + netsnmp_agent_request_info *reqinfo, + netsnmp_request_info *requests) +{ + + switch (reqinfo->mode) { + case MODE_GET: + { + + if ( read_ntp_value("version", ntpvalue, NTPQ_BUFLEN) ) + { + snmp_set_var_typed_value(requests->requestvb, ASN_OCTET_STR, + (u_char *)ntpvalue, + strlen(ntpvalue) + ); + } else { + snmp_set_var_typed_value(requests->requestvb, ASN_OCTET_STR, + (u_char *)"N/A", + 3 + ); + } + break; + + } + + + default: + /* If we cannot get the information we need, we will return a generic error to the SNMP client */ + return SNMP_ERR_GENERR; + } + + return SNMP_ERR_NOERROR; +} + + +int get_ntpEntSoftwareVendor (netsnmp_mib_handler *handler, + netsnmp_handler_registration *reginfo, + netsnmp_agent_request_info *reqinfo, + netsnmp_request_info *requests) +{ + + switch (reqinfo->mode) { + case MODE_GET: + { + + if ( read_ntp_value("vendor", ntpvalue, NTPQ_BUFLEN) ) + { + snmp_set_var_typed_value(requests->requestvb, ASN_OCTET_STR, + (u_char *)ntpvalue, + strlen(ntpvalue) + ); + } else { + snmp_set_var_typed_value(requests->requestvb, ASN_OCTET_STR, + (u_char *)"N/A", + 3 + ); + } + break; + + default: + /* If we cannot get the information we need, we will return a generic error to the SNMP client */ + return SNMP_ERR_GENERR; + } + } + return SNMP_ERR_NOERROR; +} + + +int get_ntpEntSystemType (netsnmp_mib_handler *handler, + netsnmp_handler_registration *reginfo, + netsnmp_agent_request_info *reqinfo, + netsnmp_request_info *requests) +{ + + switch (reqinfo->mode) { + case MODE_GET: + { + + if ( read_ntp_value("systemtype", ntpvalue, NTPQ_BUFLEN) ) + { + snmp_set_var_typed_value(requests->requestvb, ASN_OCTET_STR, + (u_char *)ntpvalue, + strlen(ntpvalue) + ); + } + + if ( read_ntp_value("system", ntpvalue, NTPQ_BUFLEN) ) + { + snmp_set_var_typed_value(requests->requestvb, ASN_OCTET_STR, + (u_char *)ntpvalue, + strlen(ntpvalue) + ); + } else { + snmp_set_var_typed_value(requests->requestvb, ASN_OCTET_STR, + (u_char *)"N/A", + 3 + ); + } + break; + + } + + + default: + /* If we cannot get the information we need, we will return a generic error to the SNMP client */ + return SNMP_ERR_GENERR; + } + + return SNMP_ERR_NOERROR; +} + + +/* + * ntpEntTimeResolution + * "The time resolution in integer format, where the resolution + * is represented as divisions of a second, e.g., a value of 1000 + * translates to 1.0 ms." + * + * ntpEntTimeResolution is a challenge for ntpd, as the resolution is + * not known nor exposed by ntpd, only the measured precision (time to + * read the clock). + * + * Logically the resolution must be at least the precision, so report + * it as our best approximation of resolution until/unless ntpd provides + * better. + */ +int +get_ntpEntTimeResolution( + netsnmp_mib_handler * handler, + netsnmp_handler_registration * reginfo, + netsnmp_agent_request_info * reqinfo, + netsnmp_request_info * requests + ) +{ + int precision; + u_int32 resolution; + + switch (reqinfo->mode) { + + case MODE_GET: + if (!read_ntp_value("precision", ntpvalue, + sizeof(ntpvalue))) + return SNMP_ERR_GENERR; + if (1 != sscanf(ntpvalue, "%d", &precision)) + return SNMP_ERR_GENERR; + if (precision >= 0) + return SNMP_ERR_GENERR; + precision = max(precision, -31); + resolution = 1 << -precision; + snmp_set_var_typed_value( + requests->requestvb, + ASN_UNSIGNED, + (void *)&resolution, + sizeof(resolution)); + break; + + default: + return SNMP_ERR_GENERR; + } + + return SNMP_ERR_NOERROR; +} + + +/* + * ntpEntTimePrecision + * "The entity's precision in integer format, shows the precision. + * A value of -5 would mean 2^-5 = 31.25 ms." + */ +int +get_ntpEntTimePrecision( + netsnmp_mib_handler * handler, + netsnmp_handler_registration * reginfo, + netsnmp_agent_request_info * reqinfo, + netsnmp_request_info * requests + ) +{ + int precision; + int32 precision32; + + switch (reqinfo->mode) { + + case MODE_GET: + if (!read_ntp_value("precision", ntpvalue, + sizeof(ntpvalue))) + return SNMP_ERR_GENERR; + if (1 != sscanf(ntpvalue, "%d", &precision)) + return SNMP_ERR_GENERR; + precision32 = (int32)precision; + snmp_set_var_typed_value( + requests->requestvb, + ASN_INTEGER, + (void *)&precision32, + sizeof(precision32)); + break; + + default: + return SNMP_ERR_GENERR; + } + + return SNMP_ERR_NOERROR; +} + + +int get_ntpEntTimeDistance (netsnmp_mib_handler *handler, + netsnmp_handler_registration *reginfo, + netsnmp_agent_request_info *reqinfo, + netsnmp_request_info *requests) +{ + switch (reqinfo->mode) { + case MODE_GET: + { + + if ( read_ntp_value("rootdelay", ntpvalue, NTPQ_BUFLEN) ) + { + snmp_set_var_typed_value(requests->requestvb, ASN_OCTET_STR, + (u_char *)ntpvalue, + strlen(ntpvalue) + ); + } else { + snmp_set_var_typed_value(requests->requestvb, ASN_OCTET_STR, + (u_char *)"N/A", + 3 + ); + } + break; + + } + + + default: + /* If we cannot get the information we need, we will return a generic error to the SNMP client */ + return SNMP_ERR_GENERR; + } + + return SNMP_ERR_NOERROR; +} + + +/* + * + * Initialize sub agent + */ + +void +init_ntpSnmpSubagentObject(void) +{ + /* Register all MIB objects with the agentx master */ + NTP_OID_RO( ntpEntSoftwareName, 1, 1, 1, 0); + NTP_OID_RO( ntpEntSoftwareVersion, 1, 1, 2, 0); + NTP_OID_RO( ntpEntSoftwareVendor, 1, 1, 3, 0); + NTP_OID_RO( ntpEntSystemType, 1, 1, 4, 0); + NTP_OID_RO( ntpEntTimeResolution, 1, 1, 5, 0); + NTP_OID_RO( ntpEntTimePrecision, 1, 1, 6, 0); + NTP_OID_RO( ntpEntTimeDistance, 1, 1, 7, 0); +} + diff --git a/contrib/ntp/ntpsnmpd/ntpSnmpSubagentObject.h b/contrib/ntp/ntpsnmpd/ntpSnmpSubagentObject.h new file mode 100644 index 0000000..41d5ac9 --- /dev/null +++ b/contrib/ntp/ntpsnmpd/ntpSnmpSubagentObject.h @@ -0,0 +1,81 @@ +/***************************************************************************** + * + * ntpSnmpSubAgentObject.h + * + * Definitions and macros for ntpSnmpSubAgentObject.c + * + ****************************************************************************/ + + +#ifndef NTPSNMPSUBAGENTOBJECT_H +#define NTPSNMPSUBAGENTOBJECT_H + +/* Function Prototypes */ +size_t ntpsnmpd_parse_string(const char *string, char *field, size_t + fieldsize, char *value, size_t valuesize); +size_t ntpsnmpd_cut_string(const char *string, char *dest, char delim, + int fieldnumber, size_t maxsize); +size_t read_ntp_value(const char *variable, char *value, + size_t valuesize); + +/* Initialization */ +void init_ntpSnmpSubagentObject(void); + +/* MIB Section 1 Callback Functions*/ +Netsnmp_Node_Handler get_ntpEntSoftwareName; +Netsnmp_Node_Handler get_ntpEntSoftwareVersion; +Netsnmp_Node_Handler get_ntpEntSoftwareVendor; +Netsnmp_Node_Handler get_ntpEntSystemType; +Netsnmp_Node_Handler get_ntpEntTimeResolution; +Netsnmp_Node_Handler get_ntpEntTimePrecision; +Netsnmp_Node_Handler get_ntpEntTimeDistance; + +/* MIB Section 2 Callback Functions (TODO) */ +Netsnmp_Node_Handler get_ntpEntStatusCurrentMode; +Netsnmp_Node_Handler get_ntpEntStatusCurrentModeVal; +Netsnmp_Node_Handler get_ntpEntStatusStratum; +Netsnmp_Node_Handler get_ntpEntStatusActiveRefSourceId; +Netsnmp_Node_Handler get_ntpEntStatusActiveRefSourceName; +Netsnmp_Node_Handler get_ntpEntStatusActiveOffset; + +#define NTPV4_OID 1,3,6,1,2,1,197 /* mib-2 197 */ + + +/* + * The following macros simplify the registration of the callback + * functions and register the name and OID of either read-only (RO) or + * read-write (RW) functions. + */ + +#define SETUP_OID_RO(oidname, ...) \ +static oid oidname##_oid [] = { __VA_ARGS__ }; \ +{ \ + netsnmp_register_read_only_instance( \ + netsnmp_create_handler_registration( \ + "#oidname", \ + get_##oidname, \ + oidname##_oid, \ + OID_LENGTH \ + ( oidname##_oid ), \ + HANDLER_CAN_RONLY)); \ +} + +#define SETUP_OID_RW(oidname, ...) \ +static oid oidname##_oid [] = { __VA_ARGS__ }; \ +{ \ + netsnmp_register_instance( \ + netsnmp_create_handler_registration( \ + "#oidname", \ + do_##oidname, \ + oidname##_oid, \ + OID_LENGTH \ + ( oidname##_oid ), \ + HANDLER_CAN_RWRITE)); \ +} + +#define NTP_OID_RO(oidname, w, x, y, z) \ + SETUP_OID_RO(oidname, NTPV4_OID, w, x, y, z) +#define NTP_OID_RW(oidname, w, x, y, z) \ + SETUP_OID_RW(oidname, NTPV4_OID, w, x, y, z) + +#endif diff --git a/contrib/ntp/ntpsnmpd/ntp_snmp.h b/contrib/ntp/ntpsnmpd/ntp_snmp.h new file mode 100644 index 0000000..b605758 --- /dev/null +++ b/contrib/ntp/ntpsnmpd/ntp_snmp.h @@ -0,0 +1,37 @@ +/* + * ntp_snmp.h -- common net-snmp header includes and workaround + * for Autoconf-related PACKAGE_* redefinitions between + * net-snmp and NTP. + * + * Currently ntpsnmpd *.c files are exceptions to the rule that every .c + * file should include <config.h> before any other headers. It would be + * ideal to rearrange its includes so that our config.h is first, but + * that is complicated by the redefinitions between our config.h and + * net-snmp/net-snmp-config.h. + */ + +#include <net-snmp/net-snmp-config.h> +#include <net-snmp/net-snmp-includes.h> +#include <net-snmp/agent/net-snmp-agent-includes.h> + +#ifdef PACKAGE_BUGREPORT +# undef PACKAGE_BUGREPORT +#endif +#ifdef PACKAGE_NAME +# undef PACKAGE_NAME +#endif +#ifdef PACKAGE_STRING +# undef PACKAGE_STRING +#endif +#ifdef PACKAGE_TARNAME +# undef PACKAGE_TARNAME +#endif +#ifdef PACKAGE_URL +# undef PACKAGE_URL +#endif +#ifdef PACKAGE_VERSION +# undef PACKAGE_VERSION +#endif + +#include <ntpSnmpSubagentObject.h> +#include <config.h> diff --git a/contrib/ntp/ntpsnmpd/ntpsnmpd-opts.c b/contrib/ntp/ntpsnmpd/ntpsnmpd-opts.c new file mode 100644 index 0000000..0f8622e --- /dev/null +++ b/contrib/ntp/ntpsnmpd/ntpsnmpd-opts.c @@ -0,0 +1,912 @@ +/* + * EDIT THIS FILE WITH CAUTION (ntpsnmpd-opts.c) + * + * It has been AutoGen-ed February 4, 2015 at 02:43:22 AM by AutoGen 5.18.5pre4 + * From the definitions ntpsnmpd-opts.def + * and the template file options + * + * Generated from AutoOpts 41:0:16 templates. + * + * AutoOpts is a copyrighted work. This source file is not encumbered + * by AutoOpts licensing, but is provided under the licensing terms chosen + * by the ntpsnmpd author or copyright holder. AutoOpts is + * licensed under the terms of the LGPL. The redistributable library + * (``libopts'') is licensed under the terms of either the LGPL or, at the + * users discretion, the BSD license. See the AutoOpts and/or libopts sources + * for details. + * + * The ntpsnmpd program is copyrighted and licensed + * under the following terms: + * + * Copyright (C) 1992-2015 The University of Delaware and Network Time Foundation, all rights reserved. + * This is free software. It is licensed for use, modification and + * redistribution under the terms of the NTP License, copies of which + * can be seen at: + * <http://ntp.org/license> + * <http://opensource.org/licenses/ntp-license.php> + * + * Permission to use, copy, modify, and distribute this software and its + * documentation for any purpose with or without fee is hereby granted, + * provided that the above copyright notice appears in all copies and that + * both the copyright notice and this permission notice appear in + * supporting documentation, and that the name The University of Delaware not be used in + * advertising or publicity pertaining to distribution of the software + * without specific, written prior permission. The University of Delaware and Network Time Foundation makes no + * representations about the suitability this software for any purpose. It + * is provided "as is" without express or implied warranty. + */ + +#ifndef __doxygen__ +#define OPTION_CODE_COMPILE 1 +#include "ntpsnmpd-opts.h" +#include <sys/types.h> + +#include <limits.h> +#include <stdio.h> +#include <stdlib.h> + +#ifdef __cplusplus +extern "C" { +#endif +extern FILE * option_usage_fp; +#define zCopyright (ntpsnmpd_opt_strs+0) +#define zLicenseDescrip (ntpsnmpd_opt_strs+344) + + +#ifndef NULL +# define NULL 0 +#endif + +/** + * static const strings for ntpsnmpd options + */ +static char const ntpsnmpd_opt_strs[1610] = +/* 0 */ "ntpsnmpd 4.2.8p1\n" + "Copyright (C) 1992-2015 The University of Delaware and Network Time Foundation, all rights reserved.\n" + "This is free software. It is licensed for use, modification and\n" + "redistribution under the terms of the NTP License, copies of which\n" + "can be seen at:\n" + " <http://ntp.org/license>\n" + " <http://opensource.org/licenses/ntp-license.php>\n\0" +/* 344 */ "Permission to use, copy, modify, and distribute this software and its\n" + "documentation for any purpose with or without fee is hereby granted,\n" + "provided that the above copyright notice appears in all copies and that\n" + "both the copyright notice and this permission notice appear in supporting\n" + "documentation, and that the name The University of Delaware not be used in\n" + "advertising or publicity pertaining to distribution of the software without\n" + "specific, written prior permission. The University of Delaware and Network\n" + "Time Foundation makes no representations about the suitability this\n" + "software for any purpose. It is provided \"as is\" without express or\n" + "implied warranty.\n\0" +/* 1012 */ "Do not fork\0" +/* 1024 */ "NOFORK\0" +/* 1031 */ "nofork\0" +/* 1038 */ "Log to syslog()\0" +/* 1054 */ "SYSLOG\0" +/* 1061 */ "syslog\0" +/* 1068 */ "The socket address ntpsnmpd uses to connect to net-snmpd\0" +/* 1125 */ "AGENTXSOCKET\0" +/* 1138 */ "agentxsocket\0" +/* 1151 */ "unix:/var/agentx/master\0" +/* 1175 */ "display extended usage information and exit\0" +/* 1219 */ "help\0" +/* 1224 */ "extended usage information passed thru pager\0" +/* 1269 */ "more-help\0" +/* 1279 */ "output version information and exit\0" +/* 1315 */ "version\0" +/* 1323 */ "save the option state to a config file\0" +/* 1362 */ "save-opts\0" +/* 1372 */ "load options from a config file\0" +/* 1404 */ "LOAD_OPTS\0" +/* 1414 */ "no-load-opts\0" +/* 1427 */ "no\0" +/* 1430 */ "NTPSNMPD\0" +/* 1439 */ "ntpsnmpd - NTP SNMP MIB agent - Ver. 4.2.8p1\n" + "Usage: %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]...\n\0" +/* 1542 */ "$HOME\0" +/* 1548 */ ".\0" +/* 1550 */ ".ntprc\0" +/* 1557 */ "http://bugs.ntp.org, bugs@ntp.org\0" +/* 1591 */ "\n\0" +/* 1593 */ "ntpsnmpd 4.2.8p1"; + +/** + * nofork option description: + */ +/** Descriptive text for the nofork option */ +#define NOFORK_DESC (ntpsnmpd_opt_strs+1012) +/** Upper-cased name for the nofork option */ +#define NOFORK_NAME (ntpsnmpd_opt_strs+1024) +/** Name string for the nofork option */ +#define NOFORK_name (ntpsnmpd_opt_strs+1031) +/** Compiled in flag settings for the nofork option */ +#define NOFORK_FLAGS (OPTST_DISABLED) + +/** + * syslog option description: + */ +/** Descriptive text for the syslog option */ +#define SYSLOG_DESC (ntpsnmpd_opt_strs+1038) +/** Upper-cased name for the syslog option */ +#define SYSLOG_NAME (ntpsnmpd_opt_strs+1054) +/** Name string for the syslog option */ +#define SYSLOG_name (ntpsnmpd_opt_strs+1061) +/** Compiled in flag settings for the syslog option */ +#define SYSLOG_FLAGS (OPTST_DISABLED) + +/** + * agentXSocket option description: + */ +/** Descriptive text for the agentXSocket option */ +#define AGENTXSOCKET_DESC (ntpsnmpd_opt_strs+1068) +/** Upper-cased name for the agentXSocket option */ +#define AGENTXSOCKET_NAME (ntpsnmpd_opt_strs+1125) +/** Name string for the agentXSocket option */ +#define AGENTXSOCKET_name (ntpsnmpd_opt_strs+1138) +/** The compiled in default value for the agentXSocket option argument */ +#define AGENTXSOCKET_DFT_ARG (ntpsnmpd_opt_strs+1151) +/** Compiled in flag settings for the agentXSocket option */ +#define AGENTXSOCKET_FLAGS (OPTST_DISABLED \ + | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) + +/* + * Help/More_Help/Version option descriptions: + */ +#define HELP_DESC (ntpsnmpd_opt_strs+1175) +#define HELP_name (ntpsnmpd_opt_strs+1219) +#ifdef HAVE_WORKING_FORK +#define MORE_HELP_DESC (ntpsnmpd_opt_strs+1224) +#define MORE_HELP_name (ntpsnmpd_opt_strs+1269) +#define MORE_HELP_FLAGS (OPTST_IMM | OPTST_NO_INIT) +#else +#define MORE_HELP_DESC HELP_DESC +#define MORE_HELP_name HELP_name +#define MORE_HELP_FLAGS (OPTST_OMITTED | OPTST_NO_INIT) +#endif +#ifdef NO_OPTIONAL_OPT_ARGS +# define VER_FLAGS (OPTST_IMM | OPTST_NO_INIT) +#else +# define VER_FLAGS (OPTST_SET_ARGTYPE(OPARG_TYPE_STRING) | \ + OPTST_ARG_OPTIONAL | OPTST_IMM | OPTST_NO_INIT) +#endif +#define VER_DESC (ntpsnmpd_opt_strs+1279) +#define VER_name (ntpsnmpd_opt_strs+1315) +#define SAVE_OPTS_DESC (ntpsnmpd_opt_strs+1323) +#define SAVE_OPTS_name (ntpsnmpd_opt_strs+1362) +#define LOAD_OPTS_DESC (ntpsnmpd_opt_strs+1372) +#define LOAD_OPTS_NAME (ntpsnmpd_opt_strs+1404) +#define NO_LOAD_OPTS_name (ntpsnmpd_opt_strs+1414) +#define LOAD_OPTS_pfx (ntpsnmpd_opt_strs+1427) +#define LOAD_OPTS_name (NO_LOAD_OPTS_name + 3) +/** + * Declare option callback procedures + */ +extern tOptProc + ntpOptionPrintVersion, optionBooleanVal, optionNestedVal, + optionNumericVal, optionPagedUsage, optionResetOpt, + optionStackArg, optionTimeDate, optionTimeVal, + optionUnstackArg, optionVendorOption; +static tOptProc + doUsageOpt; +#define VER_PROC ntpOptionPrintVersion + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/** + * Define the ntpsnmpd Option Descriptions. + * This is an array of OPTION_CT entries, one for each + * option that the ntpsnmpd program responds to. + */ +static tOptDesc optDesc[OPTION_CT] = { + { /* entry idx, value */ 0, VALUE_OPT_NOFORK, + /* equiv idx, value */ 0, VALUE_OPT_NOFORK, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ NOFORK_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --nofork */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ NOFORK_DESC, NOFORK_NAME, NOFORK_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 1, VALUE_OPT_SYSLOG, + /* equiv idx, value */ 1, VALUE_OPT_SYSLOG, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ SYSLOG_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --syslog */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ SYSLOG_DESC, SYSLOG_NAME, SYSLOG_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 2, VALUE_OPT_AGENTXSOCKET, + /* equiv idx, value */ 2, VALUE_OPT_AGENTXSOCKET, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ AGENTXSOCKET_FLAGS, 0, + /* last opt argumnt */ { AGENTXSOCKET_DFT_ARG }, + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ AGENTXSOCKET_DESC, AGENTXSOCKET_NAME, AGENTXSOCKET_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ INDEX_OPT_VERSION, VALUE_OPT_VERSION, + /* equiv idx value */ NO_EQUIVALENT, VALUE_OPT_VERSION, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ VER_FLAGS, AOUSE_VERSION, + /* last opt argumnt */ { NULL }, + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ VER_PROC, + /* desc, NAME, name */ VER_DESC, NULL, VER_name, + /* disablement strs */ NULL, NULL }, + + + + { /* entry idx, value */ INDEX_OPT_HELP, VALUE_OPT_HELP, + /* equiv idx value */ NO_EQUIVALENT, VALUE_OPT_HELP, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ OPTST_IMM | OPTST_NO_INIT, AOUSE_HELP, + /* last opt argumnt */ { NULL }, + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ doUsageOpt, + /* desc, NAME, name */ HELP_DESC, NULL, HELP_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ INDEX_OPT_MORE_HELP, VALUE_OPT_MORE_HELP, + /* equiv idx value */ NO_EQUIVALENT, VALUE_OPT_MORE_HELP, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ MORE_HELP_FLAGS, AOUSE_MORE_HELP, + /* last opt argumnt */ { NULL }, + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ optionPagedUsage, + /* desc, NAME, name */ MORE_HELP_DESC, NULL, MORE_HELP_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ INDEX_OPT_SAVE_OPTS, VALUE_OPT_SAVE_OPTS, + /* equiv idx value */ NO_EQUIVALENT, VALUE_OPT_SAVE_OPTS, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ OPTST_SET_ARGTYPE(OPARG_TYPE_STRING) + | OPTST_ARG_OPTIONAL | OPTST_NO_INIT, AOUSE_SAVE_OPTS, + /* last opt argumnt */ { NULL }, + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ SAVE_OPTS_DESC, NULL, SAVE_OPTS_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ INDEX_OPT_LOAD_OPTS, VALUE_OPT_LOAD_OPTS, + /* equiv idx value */ NO_EQUIVALENT, VALUE_OPT_LOAD_OPTS, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, NOLIMIT, 0, + /* opt state flags */ OPTST_SET_ARGTYPE(OPARG_TYPE_STRING) + | OPTST_DISABLE_IMM, AOUSE_LOAD_OPTS, + /* last opt argumnt */ { NULL }, + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ optionLoadOpt, + /* desc, NAME, name */ LOAD_OPTS_DESC, LOAD_OPTS_NAME, LOAD_OPTS_name, + /* disablement strs */ NO_LOAD_OPTS_name, LOAD_OPTS_pfx } +}; + + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/** Reference to the upper cased version of ntpsnmpd. */ +#define zPROGNAME (ntpsnmpd_opt_strs+1430) +/** Reference to the title line for ntpsnmpd usage. */ +#define zUsageTitle (ntpsnmpd_opt_strs+1439) +/** ntpsnmpd configuration file name. */ +#define zRcName (ntpsnmpd_opt_strs+1550) +/** Directories to search for ntpsnmpd config files. */ +static char const * const apzHomeList[3] = { + ntpsnmpd_opt_strs+1542, + ntpsnmpd_opt_strs+1548, + NULL }; +/** The ntpsnmpd program bug email address. */ +#define zBugsAddr (ntpsnmpd_opt_strs+1557) +/** Clarification/explanation of what ntpsnmpd does. */ +#define zExplain (ntpsnmpd_opt_strs+1591) +/** Extra detail explaining what ntpsnmpd does. */ +#define zDetail (NULL) +/** The full version string for ntpsnmpd. */ +#define zFullVersion (ntpsnmpd_opt_strs+1593) +/* extracted from optcode.tlib near line 364 */ + +#if defined(ENABLE_NLS) +# define OPTPROC_BASE OPTPROC_TRANSLATE + static tOptionXlateProc translate_option_strings; +#else +# define OPTPROC_BASE OPTPROC_NONE +# define translate_option_strings NULL +#endif /* ENABLE_NLS */ + +#define ntpsnmpd_full_usage (NULL) +#define ntpsnmpd_short_usage (NULL) + +#endif /* not defined __doxygen__ */ + +/* + * Create the static procedure(s) declared above. + */ +/** + * The callout function that invokes the optionUsage function. + * + * @param[in] opts the AutoOpts option description structure + * @param[in] od the descriptor for the "help" (usage) option. + * @noreturn + */ +static void +doUsageOpt(tOptions * opts, tOptDesc * od) +{ + int ex_code; + ex_code = NTPSNMPD_EXIT_SUCCESS; + optionUsage(&ntpsnmpdOptions, ex_code); + /* NOTREACHED */ + exit(1); + (void)opts; + (void)od; +} +/* extracted from optmain.tlib near line 1245 */ + +/** + * The directory containing the data associated with ntpsnmpd. + */ +#ifndef PKGDATADIR +# define PKGDATADIR "" +#endif + +/** + * Information about the person or institution that packaged ntpsnmpd + * for the current distribution. + */ +#ifndef WITH_PACKAGER +# define ntpsnmpd_packager_info NULL +#else +/** Packager information for ntpsnmpd. */ +static char const ntpsnmpd_packager_info[] = + "Packaged by " WITH_PACKAGER + +# ifdef WITH_PACKAGER_VERSION + " ("WITH_PACKAGER_VERSION")" +# endif + +# ifdef WITH_PACKAGER_BUG_REPORTS + "\nReport ntpsnmpd bugs to " WITH_PACKAGER_BUG_REPORTS +# endif + "\n"; +#endif +#ifndef __doxygen__ + +#endif /* __doxygen__ */ +/** + * The option definitions for ntpsnmpd. The one structure that + * binds them all. + */ +tOptions ntpsnmpdOptions = { + OPTIONS_STRUCT_VERSION, + 0, NULL, /* original argc + argv */ + ( OPTPROC_BASE + + OPTPROC_ERRSTOP + + OPTPROC_SHORTOPT + + OPTPROC_LONGOPT + + OPTPROC_NO_REQ_OPT + + OPTPROC_ENVIRON + + OPTPROC_NO_ARGS + + OPTPROC_MISUSE ), + 0, NULL, /* current option index, current option */ + NULL, NULL, zPROGNAME, + zRcName, zCopyright, zLicenseDescrip, + zFullVersion, apzHomeList, zUsageTitle, + zExplain, zDetail, optDesc, + zBugsAddr, /* address to send bugs to */ + NULL, NULL, /* extensions/saved state */ + optionUsage, /* usage procedure */ + translate_option_strings, /* translation procedure */ + /* + * Indexes to special options + */ + { INDEX_OPT_MORE_HELP, /* more-help option index */ + INDEX_OPT_SAVE_OPTS, /* save option index */ + NO_EQUIVALENT, /* '-#' option index */ + NO_EQUIVALENT /* index of default opt */ + }, + 8 /* full option count */, 3 /* user option count */, + ntpsnmpd_full_usage, ntpsnmpd_short_usage, + NULL, NULL, + PKGDATADIR, ntpsnmpd_packager_info +}; + +#if ENABLE_NLS +/** + * This code is designed to translate translatable option text for the + * ntpsnmpd program. These translations happen upon entry + * to optionProcess(). + */ +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <unistd.h> +#ifdef HAVE_DCGETTEXT +# include <gettext.h> +#endif +#include <autoopts/usage-txt.h> + +static char * AO_gettext(char const * pz); +static void coerce_it(void ** s); + +/** + * AutoGen specific wrapper function for gettext. It relies on the macro _() + * to convert from English to the target language, then strdup-duplicates the + * result string. It tries the "libopts" domain first, then whatever has been + * set via the \a textdomain(3) call. + * + * @param[in] pz the input text used as a lookup key. + * @returns the translated text (if there is one), + * or the original text (if not). + */ +static char * +AO_gettext(char const * pz) +{ + char * res; + if (pz == NULL) + return NULL; +#ifdef HAVE_DCGETTEXT + /* + * While processing the option_xlateable_txt data, try to use the + * "libopts" domain. Once we switch to the option descriptor data, + * do *not* use that domain. + */ + if (option_xlateable_txt.field_ct != 0) { + res = dgettext("libopts", pz); + if (res == pz) + res = (char *)(void *)_(pz); + } else + res = (char *)(void *)_(pz); +#else + res = (char *)(void *)_(pz); +#endif + if (res == pz) + return res; + res = strdup(res); + if (res == NULL) { + fputs(_("No memory for duping translated strings\n"), stderr); + exit(NTPSNMPD_EXIT_FAILURE); + } + return res; +} + +/** + * All the pointers we use are marked "* const", but they are stored in + * writable memory. Coerce the mutability and set the pointer. + */ +static void coerce_it(void ** s) { *s = AO_gettext(*s); +} + +/** + * Translate all the translatable strings in the ntpsnmpdOptions + * structure defined above. This is done only once. + */ +static void +translate_option_strings(void) +{ + tOptions * const opts = &ntpsnmpdOptions; + + /* + * Guard against re-translation. It won't work. The strings will have + * been changed by the first pass through this code. One shot only. + */ + if (option_xlateable_txt.field_ct != 0) { + /* + * Do the translations. The first pointer follows the field count + * field. The field count field is the size of a pointer. + */ + char ** ppz = (char**)(void*)&(option_xlateable_txt); + int ix = option_xlateable_txt.field_ct; + + do { + ppz++; /* skip over field_ct */ + *ppz = AO_gettext(*ppz); + } while (--ix > 0); + /* prevent re-translation and disable "libopts" domain lookup */ + option_xlateable_txt.field_ct = 0; + + coerce_it((void*)&(opts->pzCopyright)); + coerce_it((void*)&(opts->pzCopyNotice)); + coerce_it((void*)&(opts->pzFullVersion)); + coerce_it((void*)&(opts->pzUsageTitle)); + coerce_it((void*)&(opts->pzExplain)); + coerce_it((void*)&(opts->pzDetail)); + { + tOptDesc * od = opts->pOptDesc; + for (ix = opts->optCt; ix > 0; ix--, od++) + coerce_it((void*)&(od->pzText)); + } + } +} +#endif /* ENABLE_NLS */ + +#ifdef DO_NOT_COMPILE_THIS_CODE_IT_IS_FOR_GETTEXT +/** I18N function strictly for xgettext. Do not compile. */ +static void bogus_function(void) { + /* TRANSLATORS: + + The following dummy function was crated solely so that xgettext can + extract the correct strings. These strings are actually referenced + by a field name in the ntpsnmpdOptions structure noted in the + comments below. The literal text is defined in ntpsnmpd_opt_strs. + + NOTE: the strings below are segmented with respect to the source string + ntpsnmpd_opt_strs. The strings above are handed off for translation + at run time a paragraph at a time. Consequently, they are presented here + for translation a paragraph at a time. + + ALSO: often the description for an option will reference another option + by name. These are set off with apostrophe quotes (I hope). Do not + translate option names. + */ + /* referenced via ntpsnmpdOptions.pzCopyright */ + puts(_("ntpsnmpd 4.2.8p1\n\ +Copyright (C) 1992-2015 The University of Delaware and Network Time Foundation, all rights reserved.\n\ +This is free software. It is licensed for use, modification and\n\ +redistribution under the terms of the NTP License, copies of which\n\ +can be seen at:\n")); + puts(_(" <http://ntp.org/license>\n\ + <http://opensource.org/licenses/ntp-license.php>\n")); + + /* referenced via ntpsnmpdOptions.pzCopyNotice */ + puts(_("Permission to use, copy, modify, and distribute this software and its\n\ +documentation for any purpose with or without fee is hereby granted,\n\ +provided that the above copyright notice appears in all copies and that\n\ +both the copyright notice and this permission notice appear in supporting\n\ +documentation, and that the name The University of Delaware not be used in\n\ +advertising or publicity pertaining to distribution of the software without\n\ +specific, written prior permission. The University of Delaware and Network\n\ +Time Foundation makes no representations about the suitability this\n\ +software for any purpose. It is provided \"as is\" without express or\n\ +implied warranty.\n")); + + /* referenced via ntpsnmpdOptions.pOptDesc->pzText */ + puts(_("Do not fork")); + + /* referenced via ntpsnmpdOptions.pOptDesc->pzText */ + puts(_("Log to syslog()")); + + /* referenced via ntpsnmpdOptions.pOptDesc->pzText */ + puts(_("The socket address ntpsnmpd uses to connect to net-snmpd")); + + /* referenced via ntpsnmpdOptions.pOptDesc->pzText */ + puts(_("display extended usage information and exit")); + + /* referenced via ntpsnmpdOptions.pOptDesc->pzText */ + puts(_("extended usage information passed thru pager")); + + /* referenced via ntpsnmpdOptions.pOptDesc->pzText */ + puts(_("output version information and exit")); + + /* referenced via ntpsnmpdOptions.pOptDesc->pzText */ + puts(_("save the option state to a config file")); + + /* referenced via ntpsnmpdOptions.pOptDesc->pzText */ + puts(_("load options from a config file")); + + /* referenced via ntpsnmpdOptions.pzUsageTitle */ + puts(_("ntpsnmpd - NTP SNMP MIB agent - Ver. 4.2.8p1\n\ +Usage: %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]...\n")); + + /* referenced via ntpsnmpdOptions.pzExplain */ + puts(_("\n")); + + /* referenced via ntpsnmpdOptions.pzFullVersion */ + puts(_("ntpsnmpd 4.2.8p1")); + + /* referenced via ntpsnmpdOptions.pzFullUsage */ + puts(_("<<<NOT-FOUND>>>")); + + /* referenced via ntpsnmpdOptions.pzShortUsage */ + puts(_("<<<NOT-FOUND>>>")); + /* LIBOPTS-MESSAGES: */ +#line 67 "../autoopts.c" + puts(_("allocation of %d bytes failed\n")); +#line 93 "../autoopts.c" + puts(_("allocation of %d bytes failed\n")); +#line 53 "../init.c" + puts(_("AutoOpts function called without option descriptor\n")); +#line 86 "../init.c" + puts(_("\tThis exceeds the compiled library version: ")); +#line 84 "../init.c" + puts(_("Automated Options Processing Error!\n" + "\t%s called AutoOpts function with structure version %d:%d:%d.\n")); +#line 80 "../autoopts.c" + puts(_("realloc of %d bytes at 0x%p failed\n")); +#line 88 "../init.c" + puts(_("\tThis is less than the minimum library version: ")); +#line 121 "../version.c" + puts(_("Automated Options version %s\n" + "\tCopyright (C) 1999-2014 by Bruce Korb - all rights reserved\n")); +#line 82 "../makeshell.c" + puts(_("(AutoOpts bug): %s.\n")); +#line 90 "../reset.c" + puts(_("optionResetOpt() called, but reset-option not configured")); +#line 292 "../usage.c" + puts(_("could not locate the 'help' option")); +#line 336 "../autoopts.c" + puts(_("optionProcess() was called with invalid data")); +#line 748 "../usage.c" + puts(_("invalid argument type specified")); +#line 598 "../find.c" + puts(_("defaulted to option with optional arg")); +#line 76 "../alias.c" + puts(_("aliasing option is out of range.")); +#line 234 "../enum.c" + puts(_("%s error: the keyword '%s' is ambiguous for %s\n")); +#line 108 "../find.c" + puts(_(" The following options match:\n")); +#line 293 "../find.c" + puts(_("%s: ambiguous option name: %s (matches %d options)\n")); +#line 161 "../check.c" + puts(_("%s: Command line arguments required\n")); +#line 43 "../alias.c" + puts(_("%d %s%s options allowed\n")); +#line 89 "../makeshell.c" + puts(_("%s error %d (%s) calling %s for '%s'\n")); +#line 301 "../makeshell.c" + puts(_("interprocess pipe")); +#line 168 "../version.c" + puts(_("error: version option argument '%c' invalid. Use:\n" + "\t'v' - version only\n" + "\t'c' - version and copyright\n" + "\t'n' - version and full copyright notice\n")); +#line 58 "../check.c" + puts(_("%s error: the '%s' and '%s' options conflict\n")); +#line 217 "../find.c" + puts(_("%s: The '%s' option has been disabled.")); +#line 430 "../find.c" + puts(_("%s: The '%s' option has been disabled.")); +#line 38 "../alias.c" + puts(_("-equivalence")); +#line 469 "../find.c" + puts(_("%s: illegal option -- %c\n")); +#line 110 "../reset.c" + puts(_("%s: illegal option -- %c\n")); +#line 271 "../find.c" + puts(_("%s: illegal option -- %s\n")); +#line 755 "../find.c" + puts(_("%s: illegal option -- %s\n")); +#line 118 "../reset.c" + puts(_("%s: illegal option -- %s\n")); +#line 335 "../find.c" + puts(_("%s: unknown vendor extension option -- %s\n")); +#line 159 "../enum.c" + puts(_(" or an integer from %d through %d\n")); +#line 169 "../enum.c" + puts(_(" or an integer from %d through %d\n")); +#line 747 "../usage.c" + puts(_("%s error: invalid option descriptor for %s\n")); +#line 1081 "../usage.c" + puts(_("%s error: invalid option descriptor for %s\n")); +#line 385 "../find.c" + puts(_("%s: invalid option name: %s\n")); +#line 527 "../find.c" + puts(_("%s: The '%s' option requires an argument.\n")); +#line 156 "../autoopts.c" + puts(_("(AutoOpts bug): Equivalenced option '%s' was equivalenced to both\n" + "\t'%s' and '%s'.")); +#line 94 "../check.c" + puts(_("%s error: The %s option is required\n")); +#line 632 "../find.c" + puts(_("%s: The '%s' option cannot have an argument.\n")); +#line 151 "../check.c" + puts(_("%s: Command line arguments are not allowed.\n")); +#line 535 "../save.c" + puts(_("error %d (%s) creating %s\n")); +#line 234 "../enum.c" + puts(_("%s error: '%s' does not match any %s keywords.\n")); +#line 93 "../reset.c" + puts(_("%s error: The '%s' option requires an argument.\n")); +#line 184 "../save.c" + puts(_("error %d (%s) stat-ing %s\n")); +#line 238 "../save.c" + puts(_("error %d (%s) stat-ing %s\n")); +#line 143 "../restore.c" + puts(_("%s error: no saved option state\n")); +#line 231 "../autoopts.c" + puts(_("'%s' is not a command line option.\n")); +#line 111 "../time.c" + puts(_("%s error: '%s' is not a recognizable date/time.\n")); +#line 132 "../save.c" + puts(_("'%s' not defined\n")); +#line 50 "../time.c" + puts(_("%s error: '%s' is not a recognizable time duration.\n")); +#line 92 "../check.c" + puts(_("%s error: The %s option must appear %d times.\n")); +#line 164 "../numeric.c" + puts(_("%s error: '%s' is not a recognizable number.\n")); +#line 200 "../enum.c" + puts(_("%s error: %s exceeds %s keyword count\n")); +#line 330 "../usage.c" + puts(_("Try '%s %s' for more information.\n")); +#line 45 "../alias.c" + puts(_("one %s%s option allowed\n")); +#line 203 "../makeshell.c" + puts(_("standard output")); +#line 938 "../makeshell.c" + puts(_("standard output")); +#line 274 "../usage.c" + puts(_("standard output")); +#line 415 "../usage.c" + puts(_("standard output")); +#line 625 "../usage.c" + puts(_("standard output")); +#line 175 "../version.c" + puts(_("standard output")); +#line 274 "../usage.c" + puts(_("standard error")); +#line 415 "../usage.c" + puts(_("standard error")); +#line 625 "../usage.c" + puts(_("standard error")); +#line 175 "../version.c" + puts(_("standard error")); +#line 203 "../makeshell.c" + puts(_("write")); +#line 938 "../makeshell.c" + puts(_("write")); +#line 273 "../usage.c" + puts(_("write")); +#line 414 "../usage.c" + puts(_("write")); +#line 624 "../usage.c" + puts(_("write")); +#line 174 "../version.c" + puts(_("write")); +#line 60 "../numeric.c" + puts(_("%s error: %s option value %ld is out of range.\n")); +#line 44 "../check.c" + puts(_("%s error: %s option requires the %s option\n")); +#line 131 "../save.c" + puts(_("%s warning: cannot save options - %s not regular file\n")); +#line 183 "../save.c" + puts(_("%s warning: cannot save options - %s not regular file\n")); +#line 237 "../save.c" + puts(_("%s warning: cannot save options - %s not regular file\n")); +#line 256 "../save.c" + puts(_("%s warning: cannot save options - %s not regular file\n")); +#line 534 "../save.c" + puts(_("%s warning: cannot save options - %s not regular file\n")); + /* END-LIBOPTS-MESSAGES */ + + /* USAGE-TEXT: */ +#line 873 "../usage.c" + puts(_("\t\t\t\t- an alternate for '%s'\n")); +#line 1148 "../usage.c" + puts(_("Version, usage and configuration options:")); +#line 924 "../usage.c" + puts(_("\t\t\t\t- default option for unnamed options\n")); +#line 837 "../usage.c" + puts(_("\t\t\t\t- disabled as '--%s'\n")); +#line 1117 "../usage.c" + puts(_(" --- %-14s %s\n")); +#line 1115 "../usage.c" + puts(_("This option has been disabled")); +#line 864 "../usage.c" + puts(_("\t\t\t\t- enabled by default\n")); +#line 40 "../alias.c" + puts(_("%s error: only ")); +#line 1194 "../usage.c" + puts(_(" - examining environment variables named %s_*\n")); +#line 168 "../file.c" + puts(_("\t\t\t\t- file must not pre-exist\n")); +#line 172 "../file.c" + puts(_("\t\t\t\t- file must pre-exist\n")); +#line 380 "../usage.c" + puts(_("Options are specified by doubled hyphens and their name or by a single\n" + "hyphen and the flag character.\n")); +#line 916 "../makeshell.c" + puts(_("\n" + "= = = = = = = =\n\n" + "This incarnation of genshell will produce\n" + "a shell script to parse the options for %s:\n\n")); +#line 166 "../enum.c" + puts(_(" or an integer mask with any of the lower %d bits set\n")); +#line 897 "../usage.c" + puts(_("\t\t\t\t- is a set membership option\n")); +#line 918 "../usage.c" + puts(_("\t\t\t\t- must appear between %d and %d times\n")); +#line 382 "../usage.c" + puts(_("Options are specified by single or double hyphens and their name.\n")); +#line 904 "../usage.c" + puts(_("\t\t\t\t- may appear multiple times\n")); +#line 891 "../usage.c" + puts(_("\t\t\t\t- may not be preset\n")); +#line 1309 "../usage.c" + puts(_(" Arg Option-Name Description\n")); +#line 1245 "../usage.c" + puts(_(" Flg Arg Option-Name Description\n")); +#line 1303 "../usage.c" + puts(_(" Flg Arg Option-Name Description\n")); +#line 1304 "../usage.c" + puts(_(" %3s %s")); +#line 1310 "../usage.c" + puts(_(" %3s %s")); +#line 387 "../usage.c" + puts(_("The '-#<number>' option may omit the hash char\n")); +#line 383 "../usage.c" + puts(_("All arguments are named options.\n")); +#line 971 "../usage.c" + puts(_(" - reading file %s")); +#line 409 "../usage.c" + puts(_("\n" + "Please send bug reports to: <%s>\n")); +#line 100 "../version.c" + puts(_("\n" + "Please send bug reports to: <%s>\n")); +#line 129 "../version.c" + puts(_("\n" + "Please send bug reports to: <%s>\n")); +#line 903 "../usage.c" + puts(_("\t\t\t\t- may NOT appear - preset only\n")); +#line 944 "../usage.c" + puts(_("\n" + "The following option preset mechanisms are supported:\n")); +#line 1192 "../usage.c" + puts(_("\n" + "The following option preset mechanisms are supported:\n")); +#line 682 "../usage.c" + puts(_("prohibits these options:\n")); +#line 677 "../usage.c" + puts(_("prohibits the option '%s'\n")); +#line 81 "../numeric.c" + puts(_("%s%ld to %ld")); +#line 79 "../numeric.c" + puts(_("%sgreater than or equal to %ld")); +#line 75 "../numeric.c" + puts(_("%s%ld exactly")); +#line 68 "../numeric.c" + puts(_("%sit must lie in one of the ranges:\n")); +#line 68 "../numeric.c" + puts(_("%sit must be in the range:\n")); +#line 88 "../numeric.c" + puts(_(", or\n")); +#line 66 "../numeric.c" + puts(_("%sis scalable with a suffix: k/K/m/M/g/G/t/T\n")); +#line 77 "../numeric.c" + puts(_("%sless than or equal to %ld")); +#line 390 "../usage.c" + puts(_("Operands and options may be intermixed. They will be reordered.\n")); +#line 652 "../usage.c" + puts(_("requires the option '%s'\n")); +#line 655 "../usage.c" + puts(_("requires these options:\n")); +#line 1321 "../usage.c" + puts(_(" Arg Option-Name Req? Description\n")); +#line 1315 "../usage.c" + puts(_(" Flg Arg Option-Name Req? Description\n")); +#line 167 "../enum.c" + puts(_("or you may use a numeric representation. Preceding these with a '!'\n" + "will clear the bits, specifying 'none' will clear all bits, and 'all'\n" + "will set them all. Multiple entries may be passed as an option\n" + "argument list.\n")); +#line 910 "../usage.c" + puts(_("\t\t\t\t- may appear up to %d times\n")); +#line 77 "../enum.c" + puts(_("The valid \"%s\" option keywords are:\n")); +#line 1152 "../usage.c" + puts(_("The next option supports vendor supported extra options:")); +#line 773 "../usage.c" + puts(_("These additional options are:")); + /* END-USAGE-TEXT */ +} +#endif /* uncompilable code */ +#ifdef __cplusplus +} +#endif +/* ntpsnmpd-opts.c ends here */ diff --git a/contrib/ntp/ntpsnmpd/ntpsnmpd-opts.def b/contrib/ntp/ntpsnmpd/ntpsnmpd-opts.def new file mode 100644 index 0000000..b3162e5 --- /dev/null +++ b/contrib/ntp/ntpsnmpd/ntpsnmpd-opts.def @@ -0,0 +1,146 @@ +/* -*- Mode: Text -*- */ + +autogen definitions options; + +#include copyright.def +#include homerc.def +#include autogen-version.def + +prog-name = "ntpsnmpd"; +prog-title = "NTP SNMP MIB agent"; + +flag = { + name = nofork; + value = n; + descrip = "Do not fork"; + doc = <<- _EndOfDoc_ + _EndOfDoc_; +}; + +flag = { + name = syslog; + value = p; + descrip = "Log to syslog()"; + doc = <<- _EndOfDoc_ + _EndOfDoc_; +}; + +flag = { + name = agentXSocket; +/* value = x; */ + arg-type = string; + arg-default = "unix:/var/agentx/master"; + descrip = "The socket address ntpsnmpd uses to connect to net-snmpd"; + doc = <<- _EndOfDoc_ + [<transport-specifier>:]<transport-address> + The default "agent X socket" is the Unix Domain socket + @file{unix:/var/agentx/master}. + Another common alternative is @file{tcp:localhost:705}. + _EndOfDoc_; +}; + +/* explain: Additional information whenever the usage routine is invoked */ +explain = <<- _END_EXPLAIN + _END_EXPLAIN; + +doc-section = { + ds-type = 'DESCRIPTION'; + ds-format = 'mdoc'; + ds-text = <<- _END_PROG_MDOC_DESCRIP + .Nm + is an SNMP MIB agent designed to interface with + .Xr ntpd 1ntpdmdoc . + _END_PROG_MDOC_DESCRIP; +}; + +/* +prog-info-descrip = <<- _END_PROG_INFO_DESCRIP + _END_PROG_INFO_DESCRIP; +*/ + +doc-section = { + ds-type = 'USAGE'; + ds-format = 'mdoc'; + ds-text = <<- _END_MDOC_USAGE + .Nm + currently uses a private MIB OID, + .Ql enterprises.5597 , + which is the Meinberg top level OEM OID, and + .Ql 99 + is the temporary working space for this project. + The final OID has to be registered with IANA + and this is done by the RFC Editor + when the NTPv4 MIB RFC is standardized. + .Pp + If you have + .Xr snmpwalk 1 + installed you can run + .Dl % snmpwalk -v2c -c public localhost enterprises.5597.99 + to see a list of all currently supported NTP MIB objects + and their current values. + _END_MDOC_USAGE; +}; + +doc-section = { + ds-type = 'NOTES'; + ds-format = 'mdoc'; + ds-text = <<- _END_MDOC_NOTES +The following objects are currently supported: +.Pp +.Bl -tag -width ".Li ntpEntSoftwareVersionVal" -compact -offset indent +.It Li ntpEntSoftwareName +please fill me in... +.It Li ntpEntSoftwareVersion +please fill me in... +.It Li ntpEntSoftwareVersionVal +please fill me in... +.It Li ntpEntSoftwareVendor +please fill me in... +.It Li ntpEntSystemType +please fill me in... +.It Li ntpEntTimeResolution +please fill me in... +.It Li ntpEntTimeResolutionVal +please fill me in... +.It Li ntpEntTimePrecision +please fill me in... +.It Li ntpEntTimePrecisionVal +please fill me in... +.It Li ntpEntTimeDistance +please fill me in... +.El + _END_MDOC_NOTES; +}; + +doc-section = { + ds-type = 'AUTHORS'; + ds-format = 'mdoc'; + ds-text = <<- _END_MDOC_AUTHORS +.An "Heiko Gerstung" + _END_MDOC_AUTHORS; +}; + +/* +doc-section = { + ds-type = 'SEE ALSO'; + ds-format = 'mdoc'; + ds-text = <<- _END_MDOC_SEE_ALSO +.Rs +.%A H. Gerstung +.%A C. Elliott +.%A B. Haberman, Ed. +.%T Definitions of Managed Objects for Network Time Protocol Version 4: (NTPv4) +.%O RFC5907 +.Re + _END_MDOC_SEE_ALSO; +}; +*/ + +/* +doc-section = { + ds-type = 'BUGS'; + ds-format = 'mdoc'; + ds-text = <<- _END_MDOC_BUGS + _END_MDOC_BUGS; +}; +*/ diff --git a/contrib/ntp/ntpsnmpd/ntpsnmpd-opts.h b/contrib/ntp/ntpsnmpd/ntpsnmpd-opts.h new file mode 100644 index 0000000..9b92041 --- /dev/null +++ b/contrib/ntp/ntpsnmpd/ntpsnmpd-opts.h @@ -0,0 +1,243 @@ +/* + * EDIT THIS FILE WITH CAUTION (ntpsnmpd-opts.h) + * + * It has been AutoGen-ed February 4, 2015 at 02:43:21 AM by AutoGen 5.18.5pre4 + * From the definitions ntpsnmpd-opts.def + * and the template file options + * + * Generated from AutoOpts 41:0:16 templates. + * + * AutoOpts is a copyrighted work. This header file is not encumbered + * by AutoOpts licensing, but is provided under the licensing terms chosen + * by the ntpsnmpd author or copyright holder. AutoOpts is + * licensed under the terms of the LGPL. The redistributable library + * (``libopts'') is licensed under the terms of either the LGPL or, at the + * users discretion, the BSD license. See the AutoOpts and/or libopts sources + * for details. + * + * The ntpsnmpd program is copyrighted and licensed + * under the following terms: + * + * Copyright (C) 1992-2015 The University of Delaware and Network Time Foundation, all rights reserved. + * This is free software. It is licensed for use, modification and + * redistribution under the terms of the NTP License, copies of which + * can be seen at: + * <http://ntp.org/license> + * <http://opensource.org/licenses/ntp-license.php> + * + * Permission to use, copy, modify, and distribute this software and its + * documentation for any purpose with or without fee is hereby granted, + * provided that the above copyright notice appears in all copies and that + * both the copyright notice and this permission notice appear in + * supporting documentation, and that the name The University of Delaware not be used in + * advertising or publicity pertaining to distribution of the software + * without specific, written prior permission. The University of Delaware and Network Time Foundation makes no + * representations about the suitability this software for any purpose. It + * is provided "as is" without express or implied warranty. + */ +/** + * This file contains the programmatic interface to the Automated + * Options generated for the ntpsnmpd program. + * These macros are documented in the AutoGen info file in the + * "AutoOpts" chapter. Please refer to that doc for usage help. + */ +#ifndef AUTOOPTS_NTPSNMPD_OPTS_H_GUARD +#define AUTOOPTS_NTPSNMPD_OPTS_H_GUARD 1 +#include "config.h" +#include <autoopts/options.h> + +/** + * Ensure that the library used for compiling this generated header is at + * least as new as the version current when the header template was released + * (not counting patch version increments). Also ensure that the oldest + * tolerable version is at least as old as what was current when the header + * template was released. + */ +#define AO_TEMPLATE_VERSION 167936 +#if (AO_TEMPLATE_VERSION < OPTIONS_MINIMUM_VERSION) \ + || (AO_TEMPLATE_VERSION > OPTIONS_STRUCT_VERSION) +# error option template version mismatches autoopts/options.h header + Choke Me. +#endif + +/** + * Enumeration of each option type for ntpsnmpd + */ +typedef enum { + INDEX_OPT_NOFORK = 0, + INDEX_OPT_SYSLOG = 1, + INDEX_OPT_AGENTXSOCKET = 2, + INDEX_OPT_VERSION = 3, + INDEX_OPT_HELP = 4, + INDEX_OPT_MORE_HELP = 5, + INDEX_OPT_SAVE_OPTS = 6, + INDEX_OPT_LOAD_OPTS = 7 +} teOptIndex; +/** count of all options for ntpsnmpd */ +#define OPTION_CT 8 +/** ntpsnmpd version */ +#define NTPSNMPD_VERSION "4.2.8p1" +/** Full ntpsnmpd version text */ +#define NTPSNMPD_FULL_VERSION "ntpsnmpd 4.2.8p1" + +/** + * Interface defines for all options. Replace "n" with the UPPER_CASED + * option name (as in the teOptIndex enumeration above). + * e.g. HAVE_OPT(NOFORK) + */ +#define DESC(n) (ntpsnmpdOptions.pOptDesc[INDEX_OPT_## n]) +/** 'true' if an option has been specified in any way */ +#define HAVE_OPT(n) (! UNUSED_OPT(& DESC(n))) +/** The string argument to an option. The argument type must be \"string\". */ +#define OPT_ARG(n) (DESC(n).optArg.argString) +/** Mask the option state revealing how an option was specified. + * It will be one and only one of \a OPTST_SET, \a OPTST_PRESET, + * \a OPTST_DEFINED, \a OPTST_RESET or zero. + */ +#define STATE_OPT(n) (DESC(n).fOptState & OPTST_SET_MASK) +/** Count of option's occurrances *on the command line*. */ +#define COUNT_OPT(n) (DESC(n).optOccCt) +/** mask of \a OPTST_SET and \a OPTST_DEFINED. */ +#define ISSEL_OPT(n) (SELECTED_OPT(&DESC(n))) +/** 'true' if \a HAVE_OPT would yield 'false'. */ +#define ISUNUSED_OPT(n) (UNUSED_OPT(& DESC(n))) +/** 'true' if OPTST_DISABLED bit not set. */ +#define ENABLED_OPT(n) (! DISABLED_OPT(& DESC(n))) +/** number of stacked option arguments. + * Valid only for stacked option arguments. */ +#define STACKCT_OPT(n) (((tArgList*)(DESC(n).optCookie))->useCt) +/** stacked argument vector. + * Valid only for stacked option arguments. */ +#define STACKLST_OPT(n) (((tArgList*)(DESC(n).optCookie))->apzArgs) +/** Reset an option. */ +#define CLEAR_OPT(n) STMTS( \ + DESC(n).fOptState &= OPTST_PERSISTENT_MASK; \ + if ((DESC(n).fOptState & OPTST_INITENABLED) == 0) \ + DESC(n).fOptState |= OPTST_DISABLED; \ + DESC(n).optCookie = NULL ) +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/** + * Enumeration of ntpsnmpd exit codes + */ +typedef enum { + NTPSNMPD_EXIT_SUCCESS = 0, + NTPSNMPD_EXIT_FAILURE = 1, + NTPSNMPD_EXIT_USAGE_ERROR = 64, + NTPSNMPD_EXIT_NO_CONFIG_INPUT = 66, + NTPSNMPD_EXIT_LIBOPTS_FAILURE = 70 +} ntpsnmpd_exit_code_t; +/** @} */ +/** + * Make sure there are no #define name conflicts with the option names + */ +#ifndef NO_OPTION_NAME_WARNINGS +# ifdef NOFORK +# warning undefining NOFORK due to option name conflict +# undef NOFORK +# endif +# ifdef SYSLOG +# warning undefining SYSLOG due to option name conflict +# undef SYSLOG +# endif +# ifdef AGENTXSOCKET +# warning undefining AGENTXSOCKET due to option name conflict +# undef AGENTXSOCKET +# endif +#else /* NO_OPTION_NAME_WARNINGS */ +# undef NOFORK +# undef SYSLOG +# undef AGENTXSOCKET +#endif /* NO_OPTION_NAME_WARNINGS */ + +/** + * Interface defines for specific options. + * @{ + */ +#define VALUE_OPT_NOFORK 'n' +#define VALUE_OPT_SYSLOG 'p' +#define VALUE_OPT_AGENTXSOCKET 0x1001 +/** option flag (value) for help-value option */ +#define VALUE_OPT_HELP '?' +/** option flag (value) for more-help-value option */ +#define VALUE_OPT_MORE_HELP '!' +/** option flag (value) for version-value option */ +#define VALUE_OPT_VERSION 0x1002 +/** option flag (value) for save-opts-value option */ +#define VALUE_OPT_SAVE_OPTS '>' +/** option flag (value) for load-opts-value option */ +#define VALUE_OPT_LOAD_OPTS '<' +#define SET_OPT_SAVE_OPTS(a) STMTS( \ + DESC(SAVE_OPTS).fOptState &= OPTST_PERSISTENT_MASK; \ + DESC(SAVE_OPTS).fOptState |= OPTST_SET; \ + DESC(SAVE_OPTS).optArg.argString = (char const*)(a)) +/* + * Interface defines not associated with particular options + */ +#define ERRSKIP_OPTERR STMTS(ntpsnmpdOptions.fOptSet &= ~OPTPROC_ERRSTOP) +#define ERRSTOP_OPTERR STMTS(ntpsnmpdOptions.fOptSet |= OPTPROC_ERRSTOP) +#define RESTART_OPT(n) STMTS( \ + ntpsnmpdOptions.curOptIdx = (n); \ + ntpsnmpdOptions.pzCurOpt = NULL ) +#define START_OPT RESTART_OPT(1) +#define USAGE(c) (*ntpsnmpdOptions.pUsageProc)(&ntpsnmpdOptions, c) + +#ifdef __cplusplus +extern "C" { +#endif + + +/* * * * * * + * + * Declare the ntpsnmpd option descriptor. + */ +extern tOptions ntpsnmpdOptions; + +#if defined(ENABLE_NLS) +# ifndef _ +# include <stdio.h> +# ifndef HAVE_GETTEXT + extern char * gettext(char const *); +# else +# include <libintl.h> +# endif + +# ifndef ATTRIBUTE_FORMAT_ARG +# define ATTRIBUTE_FORMAT_ARG(_a) +# endif + +static inline char* aoGetsText(char const* pz) ATTRIBUTE_FORMAT_ARG(1); +static inline char* aoGetsText(char const* pz) { + if (pz == NULL) return NULL; + return (char*)gettext(pz); +} +# define _(s) aoGetsText(s) +# endif /* _() */ + +# define OPT_NO_XLAT_CFG_NAMES STMTS(ntpsnmpdOptions.fOptSet |= \ + OPTPROC_NXLAT_OPT_CFG;) +# define OPT_NO_XLAT_OPT_NAMES STMTS(ntpsnmpdOptions.fOptSet |= \ + OPTPROC_NXLAT_OPT|OPTPROC_NXLAT_OPT_CFG;) + +# define OPT_XLAT_CFG_NAMES STMTS(ntpsnmpdOptions.fOptSet &= \ + ~(OPTPROC_NXLAT_OPT|OPTPROC_NXLAT_OPT_CFG);) +# define OPT_XLAT_OPT_NAMES STMTS(ntpsnmpdOptions.fOptSet &= \ + ~OPTPROC_NXLAT_OPT;) + +#else /* ENABLE_NLS */ +# define OPT_NO_XLAT_CFG_NAMES +# define OPT_NO_XLAT_OPT_NAMES + +# define OPT_XLAT_CFG_NAMES +# define OPT_XLAT_OPT_NAMES + +# ifndef _ +# define _(_s) _s +# endif +#endif /* ENABLE_NLS */ + +#ifdef __cplusplus +} +#endif +#endif /* AUTOOPTS_NTPSNMPD_OPTS_H_GUARD */ + +/* ntpsnmpd-opts.h ends here */ diff --git a/contrib/ntp/ntpsnmpd/ntpsnmpd.1ntpsnmpdman b/contrib/ntp/ntpsnmpd/ntpsnmpd.1ntpsnmpdman new file mode 100644 index 0000000..1c44243 --- /dev/null +++ b/contrib/ntp/ntpsnmpd/ntpsnmpd.1ntpsnmpdman @@ -0,0 +1,203 @@ +.de1 NOP +. it 1 an-trap +. if \\n[.$] \,\\$*\/ +.. +.ie t \ +.ds B-Font [CB] +.ds I-Font [CI] +.ds R-Font [CR] +.el \ +.ds B-Font B +.ds I-Font I +.ds R-Font R +.TH ntpsnmpd 1ntpsnmpdman "04 Feb 2015" "4.2.8p1" "User Commands" +.\" +.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-T1aO3s/ag-51aG2s) +.\" +.\" It has been AutoGen-ed February 4, 2015 at 02:43:29 AM by AutoGen 5.18.5pre4 +.\" From the definitions ntpsnmpd-opts.def +.\" and the template file agman-cmd.tpl +.SH NAME +\f\*[B-Font]ntpsnmpd\fP +\- NTP SNMP MIB agent +.SH SYNOPSIS +\f\*[B-Font]ntpsnmpd\fP +.\" Mixture of short (flag) options and long options +[\f\*[B-Font]\-flags\f[]] +[\f\*[B-Font]\-flag\f[] [\f\*[I-Font]value\f[]]] +[\f\*[B-Font]\-\-option-name\f[][[=| ]\f\*[I-Font]value\f[]]] +.sp \n(Ppu +.ne 2 + +All arguments must be options. +.sp \n(Ppu +.ne 2 + +.SH DESCRIPTION +\f\*[B-Font]ntpsnmpd\fP +is an SNMP MIB agent designed to interface with +\fCntpd\fR(1ntpdmdoc)\f[]. +.SH "OPTIONS" +.TP +.NOP \f\*[B-Font]\-n\f[], \f\*[B-Font]\-\-nofork\f[] +Do not fork. +.sp +.TP +.NOP \f\*[B-Font]\-p\f[], \f\*[B-Font]\-\-syslog\f[] +Log to syslog(). +.sp +.TP +.NOP \f\*[B-Font]\-\-agentxsocket\f[]=\f\*[I-Font]string\f[] +The socket address ntpsnmpd uses to connect to net-snmpd. +The default +\f\*[I-Font]string\f[] +for this option is: +.ti +4 + unix:/var/agentx/master +.sp +[<transport-specifier>:]<transport-address> +The default "agent X socket" is the Unix Domain socket +\fIunix:/var/agentx/master\fP. +Another common alternative is \fItcp:localhost:705\fP. +.TP +.NOP \f\*[B-Font]\-\&?\f[], \f\*[B-Font]\-\-help\f[] +Display usage information and exit. +.TP +.NOP \f\*[B-Font]\-\&!\f[], \f\*[B-Font]\-\-more-help\f[] +Pass the extended usage information through a pager. +.TP +.NOP \f\*[B-Font]\->\f[] [\f\*[I-Font]cfgfile\f[]], \f\*[B-Font]\-\-save-opts\f[] [=\f\*[I-Font]cfgfile\f[]] +Save the option state to \fIcfgfile\fP. The default is the \fIlast\fP +configuration file listed in the \fBOPTION PRESETS\fP section, below. +The command will exit after updating the config file. +.TP +.NOP \f\*[B-Font]\-<\f[] \f\*[I-Font]cfgfile\f[], \f\*[B-Font]\-\-load-opts\f[]=\f\*[I-Font]cfgfile\f[], \f\*[B-Font]\-\-no-load-opts\f[] +Load options from \fIcfgfile\fP. +The \fIno-load-opts\fP form will disable the loading +of earlier config/rc/ini files. \fI\-\-no-load-opts\fP is handled early, +out of order. +.TP +.NOP \f\*[B-Font]\-\-version\f[] [{\f\*[I-Font]v|c|n\f[]}] +Output version of program and exit. The default mode is `v', a simple +version. The `c' mode will print copyright information and `n' will +print the full copyright notice. +.PP +.SH "OPTION PRESETS" +Any option that is not marked as \fInot presettable\fP may be preset +by loading values from configuration ("RC" or ".INI") file(s) and values from +environment variables named: +.nf + \fBNTPSNMPD_<option-name>\fP or \fBNTPSNMPD\fP +.fi +.ad +The environmental presets take precedence (are processed later than) +the configuration files. +The \fIhomerc\fP files are "\fI$HOME\fP", and "\fI.\fP". +If any of these are directories, then the file \fI.ntprc\fP +is searched for within those directories. +.SH USAGE +\f\*[B-Font]ntpsnmpd\fP +currently uses a private MIB OID, +\[oq]enterprises.5597\[cq], +which is the Meinberg top level OEM OID, and +\[oq]99\[cq] +is the temporary working space for this project. +The final OID has to be registered with IANA +and this is done by the RFC Editor +when the NTPv4 MIB RFC is standardized. +.sp \n(Ppu +.ne 2 + +If you have +\fCsnmpwalk\fR(1)\f[] +installed you can run +.Dl % snmpwalk \-v2c \-c public localhost enterprises.5597.99 +to see a list of all currently supported NTP MIB objects +and their current values. +.SH "ENVIRONMENT" +See \fBOPTION PRESETS\fP for configuration environment variables. +.SH "FILES" +See \fBOPTION PRESETS\fP for configuration files. +.SH "EXIT STATUS" +One of the following exit values will be returned: +.TP +.NOP 0 " (EXIT_SUCCESS)" +Successful program execution. +.TP +.NOP 1 " (EXIT_FAILURE)" +The operation failed or the command syntax was not valid. +.TP +.NOP 66 " (EX_NOINPUT)" +A specified configuration file could not be loaded. +.TP +.NOP 70 " (EX_SOFTWARE)" +libopts had an internal operational error. Please report +it to autogen-users@lists.sourceforge.net. Thank you. +.PP +.SH AUTHORS +.NOP "Heiko Gerstung" +.br +.SH "COPYRIGHT" +Copyright (C) 1992-2015 The University of Delaware and Network Time Foundation all rights reserved. +This program is released under the terms of the NTP license, <http://ntp.org/license>. +.SH "BUGS" +Please send bug reports to: http://bugs.ntp.org, bugs@ntp.org +.SH NOTES +The following objects are currently supported: +.sp \n(Ppu +.ne 2 + +.TP 29 +.NOP \f[C]ntpEntSoftwareName\f[] +please fill me in... +.br +.ns +.TP 29 +.NOP \f[C]ntpEntSoftwareVersion\f[] +please fill me in... +.br +.ns +.TP 29 +.NOP \f[C]ntpEntSoftwareVersionVal\f[] +please fill me in... +.br +.ns +.TP 29 +.NOP \f[C]ntpEntSoftwareVendor\f[] +please fill me in... +.br +.ns +.TP 29 +.NOP \f[C]ntpEntSystemType\f[] +please fill me in... +.br +.ns +.TP 29 +.NOP \f[C]ntpEntTimeResolution\f[] +please fill me in... +.br +.ns +.TP 29 +.NOP \f[C]ntpEntTimeResolutionVal\f[] +please fill me in... +.br +.ns +.TP 29 +.NOP \f[C]ntpEntTimePrecision\f[] +please fill me in... +.br +.ns +.TP 29 +.NOP \f[C]ntpEntTimePrecisionVal\f[] +please fill me in... +.br +.ns +.TP 29 +.NOP \f[C]ntpEntTimeDistance\f[] +please fill me in... +.PP +.sp \n(Ppu +.ne 2 + +This manual page was \fIAutoGen\fP-erated from the \fBntpsnmpd\fP +option definitions. diff --git a/contrib/ntp/ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc b/contrib/ntp/ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc new file mode 100644 index 0000000..9374142 --- /dev/null +++ b/contrib/ntp/ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc @@ -0,0 +1,144 @@ +.Dd February 4 2015 +.Dt NTPSNMPD 1ntpsnmpdmdoc User Commands +.Os +.\" EDIT THIS FILE WITH CAUTION (ntpsnmpd-opts.mdoc) +.\" +.\" It has been AutoGen-ed February 4, 2015 at 02:43:34 AM by AutoGen 5.18.5pre4 +.\" From the definitions ntpsnmpd-opts.def +.\" and the template file agmdoc-cmd.tpl +.Sh NAME +.Nm ntpsnmpd +.Nd NTP SNMP MIB agent +.Sh SYNOPSIS +.Nm +.\" Mixture of short (flag) options and long options +.Op Fl flags +.Op Fl flag Op Ar value +.Op Fl \-option\-name Ns Oo Oo Ns "=| " Oc Ns Ar value Oc +.Pp +All arguments must be options. +.Pp +.Sh DESCRIPTION +.Nm +is an SNMP MIB agent designed to interface with +.Xr ntpd 1ntpdmdoc . +.Sh "OPTIONS" +.Bl -tag +.It Fl n , Fl \-nofork +Do not fork. +.sp +.It Fl p , Fl \-syslog +Log to syslog(). +.sp +.It Fl \-agentxsocket Ns = Ns Ar string +The socket address ntpsnmpd uses to connect to net\-snmpd. +The default +.Ar string +for this option is: +.ti +4 + unix:/var/agentx/master +.sp +[<transport\-specifier>:]<transport\-address> +The default "agent X socket" is the Unix Domain socket +\fIunix:/var/agentx/master\fP. +Another common alternative is \fItcp:localhost:705\fP. +.It Fl \&? , Fl \-help +Display usage information and exit. +.It Fl \&! , Fl \-more\-help +Pass the extended usage information through a pager. +.It Fl > Oo Ar cfgfile Oc , Fl \-save\-opts Oo Ns = Ns Ar cfgfile Oc +Save the option state to \fIcfgfile\fP. The default is the \fIlast\fP +configuration file listed in the \fBOPTION PRESETS\fP section, below. +The command will exit after updating the config file. +.It Fl < Ar cfgfile , Fl \-load\-opts Ns = Ns Ar cfgfile , Fl \-no\-load\-opts +Load options from \fIcfgfile\fP. +The \fIno\-load\-opts\fP form will disable the loading +of earlier config/rc/ini files. \fI\-\-no\-load\-opts\fP is handled early, +out of order. +.It Fl \-version Op Brq Ar v|c|n +Output version of program and exit. The default mode is `v', a simple +version. The `c' mode will print copyright information and `n' will +print the full copyright notice. +.El +.Sh "OPTION PRESETS" +Any option that is not marked as \fInot presettable\fP may be preset +by loading values from configuration ("RC" or ".INI") file(s) and values from +environment variables named: +.nf + \fBNTPSNMPD_<option\-name>\fP or \fBNTPSNMPD\fP +.fi +.ad +The environmental presets take precedence (are processed later than) +the configuration files. +The \fIhomerc\fP files are "\fI$HOME\fP", and "\fI.\fP". +If any of these are directories, then the file \fI.ntprc\fP +is searched for within those directories. +.Sh USAGE +.Nm +currently uses a private MIB OID, +.Ql enterprises.5597 , +which is the Meinberg top level OEM OID, and +.Ql 99 +is the temporary working space for this project. +The final OID has to be registered with IANA +and this is done by the RFC Editor +when the NTPv4 MIB RFC is standardized. +.Pp +If you have +.Xr snmpwalk 1 +installed you can run +.Dl % snmpwalk \-v2c \-c public localhost enterprises.5597.99 +to see a list of all currently supported NTP MIB objects +and their current values. +.Sh "ENVIRONMENT" +See \fBOPTION PRESETS\fP for configuration environment variables. +.Sh "FILES" +See \fBOPTION PRESETS\fP for configuration files. +.Sh "EXIT STATUS" +One of the following exit values will be returned: +.Bl -tag +.It 0 " (EXIT_SUCCESS)" +Successful program execution. +.It 1 " (EXIT_FAILURE)" +The operation failed or the command syntax was not valid. +.It 66 " (EX_NOINPUT)" +A specified configuration file could not be loaded. +.It 70 " (EX_SOFTWARE)" +libopts had an internal operational error. Please report +it to autogen\-users@lists.sourceforge.net. Thank you. +.El +.Sh AUTHORS +.An "Heiko Gerstung" +.Sh "COPYRIGHT" +Copyright (C) 1992\-2015 The University of Delaware and Network Time Foundation all rights reserved. +This program is released under the terms of the NTP license, <http://ntp.org/license>. +.Sh "BUGS" +Please send bug reports to: http://bugs.ntp.org, bugs@ntp.org +.Sh NOTES +The following objects are currently supported: +.Pp +.Bl -tag -width ".Li ntpEntSoftwareVersionVal" -compact -offset indent +.It Li ntpEntSoftwareName +please fill me in... +.It Li ntpEntSoftwareVersion +please fill me in... +.It Li ntpEntSoftwareVersionVal +please fill me in... +.It Li ntpEntSoftwareVendor +please fill me in... +.It Li ntpEntSystemType +please fill me in... +.It Li ntpEntTimeResolution +please fill me in... +.It Li ntpEntTimeResolutionVal +please fill me in... +.It Li ntpEntTimePrecision +please fill me in... +.It Li ntpEntTimePrecisionVal +please fill me in... +.It Li ntpEntTimeDistance +please fill me in... +.El +.Pp +This manual page was \fIAutoGen\fP\-erated from the \fBntpsnmpd\fP +option definitions. diff --git a/contrib/ntp/ntpsnmpd/ntpsnmpd.c b/contrib/ntp/ntpsnmpd/ntpsnmpd.c new file mode 100644 index 0000000..d96ad3a --- /dev/null +++ b/contrib/ntp/ntpsnmpd/ntpsnmpd.c @@ -0,0 +1,118 @@ +/***************************************************************************** + * + * ntpsnmpd.c + * + * The NTP SNMP daemon is an Agent X subagent application that + * registers itself with a running SNMP Agent X master process running + * on the same machine on port TCP 705. It utilizes the libntqp library + * which accesses status and general data of a running ntpd process on + * the same machine and enables the user to monitor the status of a + * ntp daemon process via SNMP. + * + * This started as a Google Summer of Code 2008 project, + * including the ntpsnmpd sub agent and the libntpq library. + * + * For more information please visit + * http://support.ntp.org/bin/view/Dev/GSoC2008snmp + * Or contact: + * Harlan Stenn (Mentor) at stenn@ntp.org + * Heiko Gerstung (Student) at gerstung@ntp.org + * + ****************************************************************************/ + +#include <ntp_snmp.h> +#include <signal.h> +#include <sys/time.h> + +#ifdef SOLARIS /* needed with at least Solaris 8 */ +#include <siginfo.h> +#endif + +#include <libntpq.h> +#include <ntpsnmpd-opts.h> + +static int keep_running; +RETSIGTYPE stop_server(int); + +RETSIGTYPE +stop_server(int a) { + keep_running = 0; +} + +/* The main function just sets up a few things and then enters a loop in which it will + * wait for SNMP requests coming from the master agent + */ + +int +main (int argc, char **argv) { + int background = 0; /* start as background process */ + int use_syslog = 1; /* use syslog for logging */ + + { + int optct = optionProcess(&ntpsnmpdOptions, argc, argv); + argc -= optct; + argv += optct; + } + + if (!HAVE_OPT(NOFORK)) + background = 1; + + if (!HAVE_OPT(SYSLOG)) + use_syslog = 0; + + /* using the net-snmp syslog facility */ + if (use_syslog) + snmp_enable_calllog(); + else + snmp_enable_stderrlog(); + + /* Become Subagent */ + netsnmp_ds_set_boolean(NETSNMP_DS_APPLICATION_ID, NETSNMP_DS_AGENT_ROLE, 1); + + /* go into background mode, if requested */ + if (background && netsnmp_daemonize(1, !use_syslog)) + exit(1); + + /* Now register with the master Agent X process */ + + /* call Netsnmp socket startup macro, which will initialize the network stuff if required */ + SOCK_STARTUP; + + /* Set AgentX socket interface */ + netsnmp_ds_set_string(NETSNMP_DS_APPLICATION_ID, + NETSNMP_DS_AGENT_X_SOCKET, OPT_ARG( AGENTXSOCKET )); + + init_agent("ntpsnmpd"); + + /* Try to connect to ntpd */ + if ( ntpq_openhost("localhost", 0) == 0 ) + { + fprintf(stderr, "Error: Could not connect to ntpd. Aborting.\n"); + exit(1); + } + + + /* Register callback functions ... */ + init_ntpSnmpSubagentObject(); + init_snmp("ntpsnmpd"); + + /* Signal handler */ + keep_running = 1; + signal(SIGTERM, stop_server); + signal(SIGINT, stop_server); + + snmp_log(LOG_INFO,"ntpsnmpd started.\n"); + + /* main loop here... */ + while(keep_running) { + agent_check_and_process(1); /* 0 == don't block */ + } + + /* at shutdown time */ + ntpq_closehost(); + snmp_shutdown("ntpsnmpd"); + SOCK_CLEANUP; + + return 0; +} + diff --git a/contrib/ntp/ntpsnmpd/ntpsnmpd.html b/contrib/ntp/ntpsnmpd/ntpsnmpd.html new file mode 100644 index 0000000..983b6de --- /dev/null +++ b/contrib/ntp/ntpsnmpd/ntpsnmpd.html @@ -0,0 +1,79 @@ +<html lang="en"> +<head> +<title>ntpsnmpd: Network Time Protocol SNMP Daemon User's Manual</title> +<meta http-equiv="Content-Type" content="text/html"> +<meta name="description" content="ntpsnmpd: Network Time Protocol SNMP Daemon User's Manual"> +<meta name="generator" content="makeinfo 4.7"> +<link title="Top" rel="top" href="#Top"> +<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage"> +<meta http-equiv="Content-Style-Type" content="text/css"> +<style type="text/css"><!-- + pre.display { font-family:inherit } + pre.format { font-family:inherit } + pre.smalldisplay { font-family:inherit; font-size:smaller } + pre.smallformat { font-family:inherit; font-size:smaller } + pre.smallexample { font-size:smaller } + pre.smalllisp { font-size:smaller } + span.sc { font-variant:small-caps } + span.roman { font-family: serif; font-weight: normal; } +--></style> +</head> +<body> +<h1 class="settitle">ntpsnmpd: Network Time Protocol SNMP Daemon User's Manual</h1> + <div class="shortcontents"> +<h2>Short Contents</h2> +<ul> +<a href="#Top">ntpsnmpd: Network Time Protocol Query User Manual</a> +</ul> +</div> + + + +<div class="node"> +<p><hr> +<a name="Top"></a>Next: <a rel="next" accesskey="n" href="#ntpsnmpd-Description">ntpsnmpd Description</a>, +Previous: <a rel="previous" accesskey="p" href="#dir">(dir)</a>, +Up: <a rel="up" accesskey="u" href="#dir">(dir)</a> +<br> +</div> + +<h2 class="unnumbered">ntpsnmpd: Network Time Protocol Query User Manual</h2> + +<p>The <code>ntpsnmpd</code> utility program is used to monitor NTP daemon <code>ntpd</code> +operations and determine performance. It uses the standard NTP mode 6 control + + <p>This document applies to version 4.2.8p1 of <code>ntpsnmpd</code>. + +<ul class="menu"> +<li><a accesskey="1" href="#ntpsnmpd-Description">ntpsnmpd Description</a>: Description +<li><a accesskey="2" href="#ntpsnmpd-Invocation">ntpsnmpd Invocation</a>: Invoking ntpsnmpd +<li><a accesskey="3" href="#Usage">Usage</a>: Usage +</ul> + +<div class="node"> +<p><hr> +<a name="ntpsnmpd-Description"></a>Next: <a rel="next" accesskey="n" href="#Usage">Usage</a>, +Previous: <a rel="previous" accesskey="p" href="#Top">Top</a>, +Up: <a rel="up" accesskey="u" href="#Top">Top</a> +<br> +</div> + +<!-- node-name, next, previous, up --> +<h3 class="section">Description</h3> + +<p>The <code>ntpsnmpd</code> utility program provides an SNMP MIB agent for <code>ntpd</code>. + +<div class="node"> +<p><hr> +<a name="Usage"></a>Previous: <a rel="previous" accesskey="p" href="#ntpsnmpd-Description">ntpsnmpd Description</a>, +Up: <a rel="up" accesskey="u" href="#Top">Top</a> +<br> +</div> + +<!-- node-name, next, previous, up --> +<h3 class="section">Usage</h3> + +<p>(what should we say here?) + +</body></html> + diff --git a/contrib/ntp/ntpsnmpd/ntpsnmpd.man.in b/contrib/ntp/ntpsnmpd/ntpsnmpd.man.in new file mode 100644 index 0000000..f0de336 --- /dev/null +++ b/contrib/ntp/ntpsnmpd/ntpsnmpd.man.in @@ -0,0 +1,203 @@ +.de1 NOP +. it 1 an-trap +. if \\n[.$] \,\\$*\/ +.. +.ie t \ +.ds B-Font [CB] +.ds I-Font [CI] +.ds R-Font [CR] +.el \ +.ds B-Font B +.ds I-Font I +.ds R-Font R +.TH ntpsnmpd @NTPSNMPD_MS@ "04 Feb 2015" "4.2.8p1" "User Commands" +.\" +.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-T1aO3s/ag-51aG2s) +.\" +.\" It has been AutoGen-ed February 4, 2015 at 02:43:29 AM by AutoGen 5.18.5pre4 +.\" From the definitions ntpsnmpd-opts.def +.\" and the template file agman-cmd.tpl +.SH NAME +\f\*[B-Font]ntpsnmpd\fP +\- NTP SNMP MIB agent +.SH SYNOPSIS +\f\*[B-Font]ntpsnmpd\fP +.\" Mixture of short (flag) options and long options +[\f\*[B-Font]\-flags\f[]] +[\f\*[B-Font]\-flag\f[] [\f\*[I-Font]value\f[]]] +[\f\*[B-Font]\-\-option-name\f[][[=| ]\f\*[I-Font]value\f[]]] +.sp \n(Ppu +.ne 2 + +All arguments must be options. +.sp \n(Ppu +.ne 2 + +.SH DESCRIPTION +\f\*[B-Font]ntpsnmpd\fP +is an SNMP MIB agent designed to interface with +\fCntpd\fR(@NTPD_MS@)\f[]. +.SH "OPTIONS" +.TP +.NOP \f\*[B-Font]\-n\f[], \f\*[B-Font]\-\-nofork\f[] +Do not fork. +.sp +.TP +.NOP \f\*[B-Font]\-p\f[], \f\*[B-Font]\-\-syslog\f[] +Log to syslog(). +.sp +.TP +.NOP \f\*[B-Font]\-\-agentxsocket\f[]=\f\*[I-Font]string\f[] +The socket address ntpsnmpd uses to connect to net-snmpd. +The default +\f\*[I-Font]string\f[] +for this option is: +.ti +4 + unix:/var/agentx/master +.sp +[<transport-specifier>:]<transport-address> +The default "agent X socket" is the Unix Domain socket +\fIunix:/var/agentx/master\fP. +Another common alternative is \fItcp:localhost:705\fP. +.TP +.NOP \f\*[B-Font]\-\&?\f[], \f\*[B-Font]\-\-help\f[] +Display usage information and exit. +.TP +.NOP \f\*[B-Font]\-\&!\f[], \f\*[B-Font]\-\-more-help\f[] +Pass the extended usage information through a pager. +.TP +.NOP \f\*[B-Font]\->\f[] [\f\*[I-Font]cfgfile\f[]], \f\*[B-Font]\-\-save-opts\f[] [=\f\*[I-Font]cfgfile\f[]] +Save the option state to \fIcfgfile\fP. The default is the \fIlast\fP +configuration file listed in the \fBOPTION PRESETS\fP section, below. +The command will exit after updating the config file. +.TP +.NOP \f\*[B-Font]\-<\f[] \f\*[I-Font]cfgfile\f[], \f\*[B-Font]\-\-load-opts\f[]=\f\*[I-Font]cfgfile\f[], \f\*[B-Font]\-\-no-load-opts\f[] +Load options from \fIcfgfile\fP. +The \fIno-load-opts\fP form will disable the loading +of earlier config/rc/ini files. \fI\-\-no-load-opts\fP is handled early, +out of order. +.TP +.NOP \f\*[B-Font]\-\-version\f[] [{\f\*[I-Font]v|c|n\f[]}] +Output version of program and exit. The default mode is `v', a simple +version. The `c' mode will print copyright information and `n' will +print the full copyright notice. +.PP +.SH "OPTION PRESETS" +Any option that is not marked as \fInot presettable\fP may be preset +by loading values from configuration ("RC" or ".INI") file(s) and values from +environment variables named: +.nf + \fBNTPSNMPD_<option-name>\fP or \fBNTPSNMPD\fP +.fi +.ad +The environmental presets take precedence (are processed later than) +the configuration files. +The \fIhomerc\fP files are "\fI$HOME\fP", and "\fI.\fP". +If any of these are directories, then the file \fI.ntprc\fP +is searched for within those directories. +.SH USAGE +\f\*[B-Font]ntpsnmpd\fP +currently uses a private MIB OID, +\[oq]enterprises.5597\[cq], +which is the Meinberg top level OEM OID, and +\[oq]99\[cq] +is the temporary working space for this project. +The final OID has to be registered with IANA +and this is done by the RFC Editor +when the NTPv4 MIB RFC is standardized. +.sp \n(Ppu +.ne 2 + +If you have +\fCsnmpwalk\fR(1)\f[] +installed you can run +.Dl % snmpwalk \-v2c \-c public localhost enterprises.5597.99 +to see a list of all currently supported NTP MIB objects +and their current values. +.SH "ENVIRONMENT" +See \fBOPTION PRESETS\fP for configuration environment variables. +.SH "FILES" +See \fBOPTION PRESETS\fP for configuration files. +.SH "EXIT STATUS" +One of the following exit values will be returned: +.TP +.NOP 0 " (EXIT_SUCCESS)" +Successful program execution. +.TP +.NOP 1 " (EXIT_FAILURE)" +The operation failed or the command syntax was not valid. +.TP +.NOP 66 " (EX_NOINPUT)" +A specified configuration file could not be loaded. +.TP +.NOP 70 " (EX_SOFTWARE)" +libopts had an internal operational error. Please report +it to autogen-users@lists.sourceforge.net. Thank you. +.PP +.SH AUTHORS +.NOP "Heiko Gerstung" +.br +.SH "COPYRIGHT" +Copyright (C) 1992-2015 The University of Delaware and Network Time Foundation all rights reserved. +This program is released under the terms of the NTP license, <http://ntp.org/license>. +.SH "BUGS" +Please send bug reports to: http://bugs.ntp.org, bugs@ntp.org +.SH NOTES +The following objects are currently supported: +.sp \n(Ppu +.ne 2 + +.TP 29 +.NOP \f[C]ntpEntSoftwareName\f[] +please fill me in... +.br +.ns +.TP 29 +.NOP \f[C]ntpEntSoftwareVersion\f[] +please fill me in... +.br +.ns +.TP 29 +.NOP \f[C]ntpEntSoftwareVersionVal\f[] +please fill me in... +.br +.ns +.TP 29 +.NOP \f[C]ntpEntSoftwareVendor\f[] +please fill me in... +.br +.ns +.TP 29 +.NOP \f[C]ntpEntSystemType\f[] +please fill me in... +.br +.ns +.TP 29 +.NOP \f[C]ntpEntTimeResolution\f[] +please fill me in... +.br +.ns +.TP 29 +.NOP \f[C]ntpEntTimeResolutionVal\f[] +please fill me in... +.br +.ns +.TP 29 +.NOP \f[C]ntpEntTimePrecision\f[] +please fill me in... +.br +.ns +.TP 29 +.NOP \f[C]ntpEntTimePrecisionVal\f[] +please fill me in... +.br +.ns +.TP 29 +.NOP \f[C]ntpEntTimeDistance\f[] +please fill me in... +.PP +.sp \n(Ppu +.ne 2 + +This manual page was \fIAutoGen\fP-erated from the \fBntpsnmpd\fP +option definitions. diff --git a/contrib/ntp/ntpsnmpd/ntpsnmpd.mdoc.in b/contrib/ntp/ntpsnmpd/ntpsnmpd.mdoc.in new file mode 100644 index 0000000..d8d183d --- /dev/null +++ b/contrib/ntp/ntpsnmpd/ntpsnmpd.mdoc.in @@ -0,0 +1,144 @@ +.Dd February 4 2015 +.Dt NTPSNMPD @NTPSNMPD_MS@ User Commands +.Os +.\" EDIT THIS FILE WITH CAUTION (ntpsnmpd-opts.mdoc) +.\" +.\" It has been AutoGen-ed February 4, 2015 at 02:43:34 AM by AutoGen 5.18.5pre4 +.\" From the definitions ntpsnmpd-opts.def +.\" and the template file agmdoc-cmd.tpl +.Sh NAME +.Nm ntpsnmpd +.Nd NTP SNMP MIB agent +.Sh SYNOPSIS +.Nm +.\" Mixture of short (flag) options and long options +.Op Fl flags +.Op Fl flag Op Ar value +.Op Fl \-option\-name Ns Oo Oo Ns "=| " Oc Ns Ar value Oc +.Pp +All arguments must be options. +.Pp +.Sh DESCRIPTION +.Nm +is an SNMP MIB agent designed to interface with +.Xr ntpd @NTPD_MS@ . +.Sh "OPTIONS" +.Bl -tag +.It Fl n , Fl \-nofork +Do not fork. +.sp +.It Fl p , Fl \-syslog +Log to syslog(). +.sp +.It Fl \-agentxsocket Ns = Ns Ar string +The socket address ntpsnmpd uses to connect to net\-snmpd. +The default +.Ar string +for this option is: +.ti +4 + unix:/var/agentx/master +.sp +[<transport\-specifier>:]<transport\-address> +The default "agent X socket" is the Unix Domain socket +\fIunix:/var/agentx/master\fP. +Another common alternative is \fItcp:localhost:705\fP. +.It Fl \&? , Fl \-help +Display usage information and exit. +.It Fl \&! , Fl \-more\-help +Pass the extended usage information through a pager. +.It Fl > Oo Ar cfgfile Oc , Fl \-save\-opts Oo Ns = Ns Ar cfgfile Oc +Save the option state to \fIcfgfile\fP. The default is the \fIlast\fP +configuration file listed in the \fBOPTION PRESETS\fP section, below. +The command will exit after updating the config file. +.It Fl < Ar cfgfile , Fl \-load\-opts Ns = Ns Ar cfgfile , Fl \-no\-load\-opts +Load options from \fIcfgfile\fP. +The \fIno\-load\-opts\fP form will disable the loading +of earlier config/rc/ini files. \fI\-\-no\-load\-opts\fP is handled early, +out of order. +.It Fl \-version Op Brq Ar v|c|n +Output version of program and exit. The default mode is `v', a simple +version. The `c' mode will print copyright information and `n' will +print the full copyright notice. +.El +.Sh "OPTION PRESETS" +Any option that is not marked as \fInot presettable\fP may be preset +by loading values from configuration ("RC" or ".INI") file(s) and values from +environment variables named: +.nf + \fBNTPSNMPD_<option\-name>\fP or \fBNTPSNMPD\fP +.fi +.ad +The environmental presets take precedence (are processed later than) +the configuration files. +The \fIhomerc\fP files are "\fI$HOME\fP", and "\fI.\fP". +If any of these are directories, then the file \fI.ntprc\fP +is searched for within those directories. +.Sh USAGE +.Nm +currently uses a private MIB OID, +.Ql enterprises.5597 , +which is the Meinberg top level OEM OID, and +.Ql 99 +is the temporary working space for this project. +The final OID has to be registered with IANA +and this is done by the RFC Editor +when the NTPv4 MIB RFC is standardized. +.Pp +If you have +.Xr snmpwalk 1 +installed you can run +.Dl % snmpwalk \-v2c \-c public localhost enterprises.5597.99 +to see a list of all currently supported NTP MIB objects +and their current values. +.Sh "ENVIRONMENT" +See \fBOPTION PRESETS\fP for configuration environment variables. +.Sh "FILES" +See \fBOPTION PRESETS\fP for configuration files. +.Sh "EXIT STATUS" +One of the following exit values will be returned: +.Bl -tag +.It 0 " (EXIT_SUCCESS)" +Successful program execution. +.It 1 " (EXIT_FAILURE)" +The operation failed or the command syntax was not valid. +.It 66 " (EX_NOINPUT)" +A specified configuration file could not be loaded. +.It 70 " (EX_SOFTWARE)" +libopts had an internal operational error. Please report +it to autogen\-users@lists.sourceforge.net. Thank you. +.El +.Sh AUTHORS +.An "Heiko Gerstung" +.Sh "COPYRIGHT" +Copyright (C) 1992\-2015 The University of Delaware and Network Time Foundation all rights reserved. +This program is released under the terms of the NTP license, <http://ntp.org/license>. +.Sh "BUGS" +Please send bug reports to: http://bugs.ntp.org, bugs@ntp.org +.Sh NOTES +The following objects are currently supported: +.Pp +.Bl -tag -width ".Li ntpEntSoftwareVersionVal" -compact -offset indent +.It Li ntpEntSoftwareName +please fill me in... +.It Li ntpEntSoftwareVersion +please fill me in... +.It Li ntpEntSoftwareVersionVal +please fill me in... +.It Li ntpEntSoftwareVendor +please fill me in... +.It Li ntpEntSystemType +please fill me in... +.It Li ntpEntTimeResolution +please fill me in... +.It Li ntpEntTimeResolutionVal +please fill me in... +.It Li ntpEntTimePrecision +please fill me in... +.It Li ntpEntTimePrecisionVal +please fill me in... +.It Li ntpEntTimeDistance +please fill me in... +.El +.Pp +This manual page was \fIAutoGen\fP\-erated from the \fBntpsnmpd\fP +option definitions. diff --git a/contrib/ntp/ntpsnmpd/ntpsnmpd.texi b/contrib/ntp/ntpsnmpd/ntpsnmpd.texi new file mode 100644 index 0000000..6935596 --- /dev/null +++ b/contrib/ntp/ntpsnmpd/ntpsnmpd.texi @@ -0,0 +1,53 @@ +\input texinfo @c -*-texinfo-*- +@c %**start of header +@setfilename ntpsnmpd.info +@settitle ntpsnmpd: Network Time Protocol SNMP Daemon User's Manual +@include ../sntp/include/version.texi +@paragraphindent 2 +@c %**end of header + +@ifinfo +This file documents the use of the NTP Project's ntpsnmpd, a program for +querying the state of an NTP server via SNMP. +@end ifinfo + +@direntry +* ntpsnmpd: (ntpsnmpd). NTP SNMP Daemon program +@end direntry + +@titlepage +@title ntpsnmpd: Network Time Protocol SNMP Daemon User's Manual +@subtitle ntpsnmpd, version @value{VERSION}, @value{UPDATED} +@c @author Max @email{foo@ntp.org} +@end titlepage + +@c @page +@c @vskip 0pt plus 1filll + +@shortcontents + +@node Top, ntpsnmpd Description, (dir), (dir) +@top ntpsnmpd: Network Time Protocol Query User Manual + +The @code{ntpsnmpd} utility program is used to monitor NTP daemon @code{ntpd} +operations and determine performance. It uses the standard NTP mode 6 control + +This document applies to version @value{VERSION} of @code{ntpsnmpd}. + +@menu +* ntpsnmpd Description:: Description +* ntpsnmpd Invocation:: Invoking ntpsnmpd +* Usage:: Usage +@end menu + +@node ntpsnmpd Description, Usage, Top, Top +@comment node-name, next, previous, up +@section Description + +The @code{ntpsnmpd} utility program provides an SNMP MIB agent for @code{ntpd}. + +@node Usage, , ntpsnmpd Description, Top +@comment node-name, next, previous, up +@section Usage + +(what should we say here?) diff --git a/contrib/ntp/ntpsnmpd/ntpv4-mib.mib b/contrib/ntp/ntpsnmpd/ntpv4-mib.mib new file mode 100644 index 0000000..e8cb016 --- /dev/null +++ b/contrib/ntp/ntpsnmpd/ntpv4-mib.mib @@ -0,0 +1,892 @@ +-- ********************************************************************* +-- +-- The Network Time Protocol Version 4 +-- Management Information Base (MIB) +-- +-- Authors: Heiko Gerstung (heiko.gerstung@meinberg.de) +-- Chris Elliott (chelliot@pobox.com) +-- +-- for the Internet Engineering Task Force (IETF) +-- NTP Working Group (ntpwg) +-- +-- +-- ********************************************************************* +-- Rev 1.00 +-- Published as RFC 5907 +-- +-- ********************************************************************* + +NTPv4-MIB DEFINITIONS ::= BEGIN + +IMPORTS + MODULE-IDENTITY, OBJECT-TYPE , mib-2, Integer32, NOTIFICATION-TYPE, + Unsigned32, Counter32, TimeTicks + FROM SNMPv2-SMI -- RFC 2578 + MODULE-COMPLIANCE, OBJECT-GROUP, NOTIFICATION-GROUP + FROM SNMPv2-CONF -- RFC 2580 + DisplayString, TEXTUAL-CONVENTION + FROM SNMPv2-TC -- RFC 2579 + InetAddressType, InetAddress + FROM INET-ADDRESS-MIB -- RFC 4001 + Utf8String + FROM SYSAPPL-MIB; -- RFC 2287 + +ntpSnmpMIB MODULE-IDENTITY + LAST-UPDATED "201005170000Z" -- May 17, 2010 + ORGANIZATION "The IETF NTP Working Group (ntpwg)" + CONTACT-INFO + " WG Email: ntpwg@lists.ntp.isc.org + Subscribe: + https://lists.ntp.isc.org/mailman/listinfo/ntpwg + + Heiko Gerstung + Meinberg Funkuhren Gmbh & Co. KG + Lange Wand 9 + Bad Pyrmont 31812 + Germany + + Phone: +49 5281 9309 25 + Email: heiko.gerstung@meinberg.de + + Chris Elliott + 1516 Kent St. + Durham, NC 27707 + USA + + Phone: +1-919-308-1216 + Email: chelliot@pobox.com + + Brian Haberman + 11100 Johns Hopkins Road + Laurel, MD 20723 + USA + + Phone: +1-443-778-1319 + Email: brian@innovationslab.net" + DESCRIPTION + "The Management Information Base for NTP time entities. + + Copyright (c) 2010 IETF Trust and the persons identified as + authors of the code. All rights reserved. + + Redistribution and use in source and binary forms, with or + without modification, is permitted pursuant to, and subject + to the license terms contained in, the Simplified BSD License + set forth in Section 4.c of the IETF Trust's Legal Provisions + Relating to IETF Documents + (http://trustee.ietf.org/license-info)." + + REVISION "201005170000Z" + DESCRIPTION + "This revision of the MIB module is published as RFC 5907." + + ::= { mib-2 197 } + +ntpSnmpMIBObjects OBJECT IDENTIFIER ::= { ntpSnmpMIB 1 } + +-- MIB contains 6 groups + +ntpEntInfo OBJECT IDENTIFIER ::= { ntpSnmpMIBObjects 1 } +ntpEntStatus OBJECT IDENTIFIER ::= { ntpSnmpMIBObjects 2 } +ntpAssociation OBJECT IDENTIFIER ::= { ntpSnmpMIBObjects 3 } +ntpEntControl OBJECT IDENTIFIER ::= { ntpSnmpMIBObjects 4 } +ntpEntNotifObjects OBJECT IDENTIFIER ::= { ntpSnmpMIBObjects 5 } + +-- +-- Textual Conventions +-- + +NtpStratum ::= TEXTUAL-CONVENTION + DISPLAY-HINT "d" + STATUS current + DESCRIPTION + "The NTP stratum, with 16 representing no stratum." + SYNTAX Unsigned32 (1..16) + +NtpDateTime ::= TEXTUAL-CONVENTION + DISPLAY-HINT "4d:4d:4d.4d" + STATUS current + DESCRIPTION + "NTP date/time on the device, in 128-bit + NTP date format. If time is not syncronized, this + field shall be a zero-length string. + + This trusted certificate (TC) is not to be used for objects + that are used to set the time of the node querying this + object. NTP should be used for this -- or at least SNTP." + REFERENCE "RFC 5905, section 6" + SYNTAX OCTET STRING (SIZE (0 | 16)) + +-- +-- Section 1: General NTP Entity information objects +-- (relatively static information) +-- + +ntpEntSoftwareName OBJECT-TYPE + SYNTAX Utf8String + MAX-ACCESS read-only + STATUS current + DESCRIPTION + "The product name of the running NTP version, e.g., 'ntpd'." + ::= { ntpEntInfo 1 } + +ntpEntSoftwareVersion OBJECT-TYPE + SYNTAX Utf8String + MAX-ACCESS read-only + STATUS current + DESCRIPTION + "The software version of the installed NTP implementation + as a full version string, e.g., 'ntpd-4.2.0b@1.1433 ...'" + ::= { ntpEntInfo 2 } + +ntpEntSoftwareVendor OBJECT-TYPE + SYNTAX Utf8String + MAX-ACCESS read-only + STATUS current + DESCRIPTION + "The vendor/author of the installed NTP version." + ::= { ntpEntInfo 3 } + +ntpEntSystemType OBJECT-TYPE + SYNTAX Utf8String + MAX-ACCESS read-only + STATUS current + DESCRIPTION + "General hardware/os platform information, + e.g., 'Linux 2.6.12 / x86'." + -- freely configurable, default is OS Version / Hardware platform + ::= { ntpEntInfo 4 } + +ntpEntTimeResolution OBJECT-TYPE + SYNTAX Unsigned32 + MAX-ACCESS read-only + STATUS current + DESCRIPTION + "The time resolution in integer format, where the resolution + is represented as divisions of a second, e.g., a value of 1000 + translates to 1.0 ms." + ::= { ntpEntInfo 5 } + +ntpEntTimePrecision OBJECT-TYPE + SYNTAX Integer32 + MAX-ACCESS read-only + STATUS current + DESCRIPTION + "The entity's precision in integer format, shows the precision. + A value of -5 would mean 2^-5 = 31.25 ms." + ::= { ntpEntInfo 6 } + +ntpEntTimeDistance OBJECT-TYPE + SYNTAX DisplayString + MAX-ACCESS read-only + STATUS current + DESCRIPTION + "The distance from this NTP entity to the root time reference + (stratum 0) source including the unit, e.g., '13.243 ms'." + ::= { ntpEntInfo 7 } + +-- +-- Section 2: Current NTP status (dynamic information) +-- + +ntpEntStatusCurrentMode OBJECT-TYPE + SYNTAX INTEGER { + notRunning(1), + notSynchronized(2), + noneConfigured(3), + syncToLocal(4), + syncToRefclock(5), + syncToRemoteServer(6), + unknown(99) + } + MAX-ACCESS read-only + STATUS current + DESCRIPTION + "The current mode of the NTP. The definition of each possible + value is: + notRunning(1) - NTP is not running. + notSynchronized(2) - NTP is not synchronized to any time + source (stratum = 16). + noneConfigured(3) - NTP is not synchronized and does not + have a reference configured + (stratum = 16). + syncToLocal(4) - NTP is distributing time based on its + local clock (degraded accuracy and/or + reliability). + syncToRefclock(5) - NTP is synchronized to a local + hardware refclock (e.g., GPS). + syncToRemoteServer(6) - NTP is synchronized to a remote + NTP server ('upstream' server). + unknown(99) - The state of NTP is unknown." + ::= { ntpEntStatus 1 } + +ntpEntStatusStratum OBJECT-TYPE + SYNTAX NtpStratum + MAX-ACCESS read-only + STATUS current + DESCRIPTION + "The NTP entity's own stratum value. Should be a stratum of + syspeer + 1 (or 16 if no syspeer)." + ::= { ntpEntStatus 2 } + +ntpEntStatusActiveRefSourceId OBJECT-TYPE + SYNTAX Unsigned32 ( 0..99999 ) + MAX-ACCESS read-only + STATUS current + DESCRIPTION + "The association ID of the current syspeer." + ::= { ntpEntStatus 3 } + +ntpEntStatusActiveRefSourceName OBJECT-TYPE + SYNTAX Utf8String + MAX-ACCESS read-only + STATUS current + DESCRIPTION + "The hostname/descriptive name of the current reference source + selected as syspeer, e.g., 'ntp1.ptb.de' or 'GPS' or + 'DCFi', ..." + ::= { ntpEntStatus 4 } + +ntpEntStatusActiveOffset OBJECT-TYPE + SYNTAX DisplayString + MAX-ACCESS read-only + STATUS current + DESCRIPTION + "The time offset to the current selected reference time source + as a string including unit, e.g., '0.032 ms' or '1.232 s'." + ::= { ntpEntStatus 5 } + +ntpEntStatusNumberOfRefSources OBJECT-TYPE + SYNTAX Unsigned32 (0..99) + MAX-ACCESS read-only + STATUS current + DESCRIPTION + "The number of reference sources configured for NTP." + ::= { ntpEntStatus 6 } + +ntpEntStatusDispersion OBJECT-TYPE + SYNTAX DisplayString + MAX-ACCESS read-only + STATUS current + DESCRIPTION + "The root dispersion of the running NTP entity, e.g., '6.927'." + ::= { ntpEntStatus 7 } + +ntpEntStatusEntityUptime OBJECT-TYPE + SYNTAX TimeTicks + MAX-ACCESS read-only + STATUS current + DESCRIPTION + "The uptime of the NTP entity, (i.e., the time since ntpd was + (re-)initialized not sysUptime!). The time is represented in + hundreds of seconds since Jan 1, 1970 (00:00:00.000) UTC." + ::= { ntpEntStatus 8 } + +ntpEntStatusDateTime OBJECT-TYPE + SYNTAX NtpDateTime + MAX-ACCESS read-only + STATUS current + DESCRIPTION + "The current NTP date/time on the device, in 128-bit + NTP date format. If time is not syncronized, this + field shall be a zero-length string. + + This object can be used to timestamp events on this + node and allow a management station to correlate + different time objects. For example, a management + station could query this object and sysUpTime in + the same operation to be able to relate sysUpTime + to NTP time. + + This object is not to be used to set the time of + the node querying this object. NTP should be used + for this -- or at least SNTP." + REFERENCE "RFC 5905, section 6" + ::= { ntpEntStatus 9 } + +ntpEntStatusLeapSecond OBJECT-TYPE + SYNTAX NtpDateTime + MAX-ACCESS read-only + STATUS current + DESCRIPTION + "Date the next known leap second will occur. If there is + no leap second announced, then this object should be 0." + ::= { ntpEntStatus 10 } + +ntpEntStatusLeapSecDirection OBJECT-TYPE + SYNTAX Integer32 (-1..1) + MAX-ACCESS read-only + STATUS current + DESCRIPTION + "Direction of next known leap second. If there is no + leap second announced, then this object should be 0." + ::= { ntpEntStatus 11 } + +ntpEntStatusInPkts OBJECT-TYPE + SYNTAX Counter32 + UNITS "packets" + MAX-ACCESS read-only + STATUS current + DESCRIPTION + "The total number of NTP messages delivered to the + NTP entity from the transport service. + Discountinuities in the value of this counter can occur + upon cold start or reinitialization of the NTP entity, the + management system and at other times as indicated by + discontinuities in the value of sysUpTime." + ::= { ntpEntStatus 12 } + +ntpEntStatusOutPkts OBJECT-TYPE + SYNTAX Counter32 + UNITS "packets" + MAX-ACCESS read-only + STATUS current + DESCRIPTION + "The total number of NTP messages delivered to the + transport service by this NTP entity. + Discountinuities in the value of this counter can occur + upon cold start or reinitialization of the NTP entity, the + management system and at other times as indicated by + discontinuities in the value of sysUpTime." + ::= { ntpEntStatus 13 } + +ntpEntStatusBadVersion OBJECT-TYPE + SYNTAX Counter32 + UNITS "packets" + MAX-ACCESS read-only + STATUS current + DESCRIPTION + "The total number of NTP messages that were delivered + to this NTP entity and were for an unsupported NTP + version. + Discountinuities in the value of this counter can occur + upon cold start or reinitialization of the NTP entity, the + management system and at other times as indicated by + discontinuities in the value of sysUpTime." + ::= { ntpEntStatus 14 } + +ntpEntStatusProtocolError OBJECT-TYPE + SYNTAX Counter32 + UNITS "packets" + MAX-ACCESS read-only + STATUS current + DESCRIPTION + "The total number of NTP messages that were delivered + to this NTP entity and this entity was not able to + process due to an NTP protocol error. + Discountinuities in the value of this counter can occur + upon cold start or reinitialization of the NTP entity, the + management system and at other times as indicated by + discontinuities in the value of sysUpTime." + ::= { ntpEntStatus 15 } + +ntpEntStatusNotifications OBJECT-TYPE + SYNTAX Counter32 + UNITS "notifications" + MAX-ACCESS read-only + STATUS current + DESCRIPTION + "The total number of SNMP notifications that this NTP + entity has generated. + Discountinuities in the value of this counter can occur + upon cold start or reinitialization of the NTP entity, the + management system and at other times as indicated by + discontinuities in the value of sysUpTime." + ::= { ntpEntStatus 16 } + +ntpEntStatPktModeTable OBJECT-TYPE + SYNTAX SEQUENCE OF NtpEntStatPktModeEntry + MAX-ACCESS not-accessible + STATUS current + DESCRIPTION + "The number of packets sent and received by packet mode. + One entry per packet mode." + ::= { ntpEntStatus 17 } + +ntpEntStatPktModeEntry OBJECT-TYPE + SYNTAX NtpEntStatPktModeEntry + MAX-ACCESS not-accessible + STATUS current + DESCRIPTION + "A statistical record of the number of packets sent and + received for each packet mode." + INDEX { ntpEntStatPktMode } + ::= { ntpEntStatPktModeTable 1 } + +NtpEntStatPktModeEntry ::= SEQUENCE { + ntpEntStatPktMode INTEGER, + ntpEntStatPktSent Counter32, + ntpEntStatPktReceived Counter32 +} + +ntpEntStatPktMode OBJECT-TYPE + SYNTAX INTEGER { + symetricactive(1), + symetricpassive(2), + client(3), + server(4), + broadcastserver(5), + broadcastclient(6) + } + MAX-ACCESS not-accessible + STATUS current + DESCRIPTION + "The NTP packet mode." + ::= { ntpEntStatPktModeEntry 1 } + +ntpEntStatPktSent OBJECT-TYPE + SYNTAX Counter32 + UNITS "packets" + MAX-ACCESS read-only + STATUS current + DESCRIPTION + "The number of NTP packets sent with this packet mode. + Discountinuities in the value of this counter can occur + upon cold start or reinitialization of the NTP entity, the + management system and at other times as indicated by + discontinuities in the value of sysUpTime." + ::= { ntpEntStatPktModeEntry 2 } + +ntpEntStatPktReceived OBJECT-TYPE + SYNTAX Counter32 + UNITS "packets" + MAX-ACCESS read-only + STATUS current + DESCRIPTION + "The number of NTP packets received with this packet mode. + + Discountinuities in the value of this counter can occur + upon cold start or reinitialization of the NTP entity, the + management system and at other times as indicated by + discontinuities in the value of sysUpTime." + ::= { ntpEntStatPktModeEntry 3 } + +-- +-- Section 3: The status of all currently mobilized associations +-- + +ntpAssociationTable OBJECT-TYPE + SYNTAX SEQUENCE OF NtpAssociationEntry + MAX-ACCESS not-accessible + STATUS current + DESCRIPTION + "The table of currently mobilized associations." + ::= { ntpAssociation 1 } + +ntpAssociationEntry OBJECT-TYPE + SYNTAX NtpAssociationEntry + MAX-ACCESS not-accessible + STATUS current + DESCRIPTION + "The table entry of currently mobilized associations." + INDEX { ntpAssocId } + ::= { ntpAssociationTable 1 } + +NtpAssociationEntry ::= SEQUENCE { + ntpAssocId Unsigned32, + ntpAssocName Utf8String, + ntpAssocRefId DisplayString, + ntpAssocAddressType InetAddressType, + ntpAssocAddress InetAddress, + ntpAssocOffset DisplayString, + ntpAssocStratum NtpStratum, + ntpAssocStatusJitter DisplayString, + ntpAssocStatusDelay DisplayString, + ntpAssocStatusDispersion DisplayString +} + +ntpAssocId OBJECT-TYPE + SYNTAX Unsigned32 ( 1..99999 ) + MAX-ACCESS not-accessible + STATUS current + DESCRIPTION + "The association ID. This is an internal, unique ID." + ::= { ntpAssociationEntry 1 } + +ntpAssocName OBJECT-TYPE + SYNTAX Utf8String + MAX-ACCESS read-only + STATUS current + DESCRIPTION + "The hostname or other descriptive name for the association." + ::= { ntpAssociationEntry 2 } + +ntpAssocRefId OBJECT-TYPE + SYNTAX DisplayString + MAX-ACCESS read-only + STATUS current + DESCRIPTION + "The refclock driver ID, if available." + -- a refclock driver ID like "127.127.1.0" for non + -- uni/multi/broadcast associations + ::= { ntpAssociationEntry 3 } + +ntpAssocAddressType OBJECT-TYPE + SYNTAX InetAddressType { ipv4(1), ipv6(2), ipv4z(3), ipv6z(4) } + MAX-ACCESS read-only + STATUS current + DESCRIPTION + "The type of address of the association. Can be either IPv4 or + IPv6 (both with or without zone index) and contains the type of + address for unicast, multicast, and broadcast associations." + ::= { ntpAssociationEntry 4 } + +ntpAssocAddress OBJECT-TYPE + SYNTAX InetAddress (SIZE (4|8|16|20)) + MAX-ACCESS read-only + STATUS current + DESCRIPTION + "The IP address (IPv4 or IPv6, with or without zone index) of + the association. The type and size depends on the + ntpAssocAddressType object. Represents the IP address of a + uni/multi/broadcast association." + ::= { ntpAssociationEntry 5 } + +ntpAssocOffset OBJECT-TYPE + SYNTAX DisplayString + MAX-ACCESS read-only + STATUS current + DESCRIPTION + "The time offset to the association as a string." + -- including unit, e.g., "0.032 ms" or "1.232 s" + ::= { ntpAssociationEntry 6 } + +ntpAssocStratum OBJECT-TYPE + SYNTAX NtpStratum + MAX-ACCESS read-only + STATUS current + DESCRIPTION + "The association stratum value." + ::= { ntpAssociationEntry 7 } + +ntpAssocStatusJitter OBJECT-TYPE + SYNTAX DisplayString + MAX-ACCESS read-only + STATUS current + DESCRIPTION + "The jitter in milliseconds as a string." + ::= { ntpAssociationEntry 8 } + +ntpAssocStatusDelay OBJECT-TYPE + SYNTAX DisplayString + MAX-ACCESS read-only + STATUS current + DESCRIPTION + "The network delay in milliseconds as a string." + ::= { ntpAssociationEntry 9 } + +ntpAssocStatusDispersion OBJECT-TYPE + SYNTAX DisplayString + MAX-ACCESS read-only + STATUS current + DESCRIPTION + "The root dispersion of the association." + -- e.g., "6.927" + ::= { ntpAssociationEntry 10 } + +ntpAssociationStatisticsTable OBJECT-TYPE + SYNTAX SEQUENCE OF NtpAssociationStatisticsEntry + MAX-ACCESS not-accessible + STATUS current + DESCRIPTION + "The table of statistics for current associations." + ::= { ntpAssociation 2 } + +ntpAssociationStatisticsEntry OBJECT-TYPE + SYNTAX NtpAssociationStatisticsEntry + MAX-ACCESS not-accessible + STATUS current + DESCRIPTION + "The table entry of statistics for current associations." + INDEX { ntpAssocId } + ::= { ntpAssociationStatisticsTable 1 } + +NtpAssociationStatisticsEntry ::= SEQUENCE { + ntpAssocStatInPkts Counter32, + ntpAssocStatOutPkts Counter32, + ntpAssocStatProtocolError Counter32 +} + +ntpAssocStatInPkts OBJECT-TYPE + SYNTAX Counter32 + UNITS "packets" + MAX-ACCESS read-only + STATUS current + DESCRIPTION + "The total number of NTP messages delivered to the + NTP entity from this association. + Discountinuities in the value of this counter can occur + upon cold start or reinitialization of the NTP entity, the + management system and at other times as indicated by + discontinuities in the value of sysUpTime." + ::= { ntpAssociationStatisticsEntry 1 } + +ntpAssocStatOutPkts OBJECT-TYPE + SYNTAX Counter32 + UNITS "packets" + MAX-ACCESS read-only + STATUS current + DESCRIPTION + "The total number of NTP messages delivered to the + transport service by this NTP entity for this + association. + Discountinuities in the value of this counter can occur + upon cold start or reinitialization of the NTP entity, the + management system and at other times as indicated by + discontinuities in the value of sysUpTime." + ::= { ntpAssociationStatisticsEntry 2 } + +ntpAssocStatProtocolError OBJECT-TYPE + SYNTAX Counter32 + UNITS "packets" + MAX-ACCESS read-only + STATUS current + DESCRIPTION + "The total number of NTP messages that were delivered + to this NTP entity from this association and this entity + was not able to process due to an NTP protocol error. + Discountinuities in the value of this counter can occur + upon cold start or reinitialization of the NTP entity, the + management system and at other times as indicated by + discontinuities in the value of sysUpTime." + ::= { ntpAssociationStatisticsEntry 3 } + +-- +-- Section 4: Control objects +-- + +ntpEntHeartbeatInterval OBJECT-TYPE + SYNTAX Unsigned32 + UNITS "seconds" + MAX-ACCESS read-write + STATUS current + DESCRIPTION + "The interval at which the ntpEntNotifHeartbeat notification + should be sent, in seconds. If set to 0 and the + entNotifHeartbeat bit in ntpEntNotifBits is 1, then + ntpEntNotifHeartbeat is sent once. + This value is stored persistently and will be restored to its + last set value upon cold start or restart." + DEFVAL { 60 } + ::= { ntpEntControl 1 } + +ntpEntNotifBits OBJECT-TYPE + SYNTAX BITS { + notUsed(0), -- Used to sync up bit and notification + -- indices + entNotifModeChange(1), + entNotifStratumChange(2), + entNotifSyspeerChanged(3), + entNotifAddAssociation(4), + entNotifRemoveAssociation(5), + entNotifConfigChanged(6), + entNotifLeapSecondAnnounced(7), + entNotifHeartbeat(8) + } + MAX-ACCESS read-write + STATUS current + DESCRIPTION + "A bit for each notification. A 1 for a particular bit enables + that particular notification, a 0 disables it. + This value is stored persistently and will be restored to its + last set value upon cold start or restart." + ::= { ntpEntControl 2 } + +-- +-- Section 5: Notification objects +-- + +ntpEntNotifMessage OBJECT-TYPE + SYNTAX Utf8String + MAX-ACCESS accessible-for-notify + STATUS current + DESCRIPTION + "Used as a payload object for all notifications. Holds a + cleartext event message." + DEFVAL { "no event" } + ::= { ntpEntNotifObjects 1 } + +-- +-- SNMP notification definitions +-- + +ntpEntNotifications OBJECT IDENTIFIER ::= { ntpSnmpMIB 0 } + +ntpEntNotifModeChange NOTIFICATION-TYPE + OBJECTS { ntpEntStatusCurrentMode } + STATUS current + DESCRIPTION + "The notification to be sent when the NTP entity changes mode, + including starting and stopping (if possible)." + ::= { ntpEntNotifications 1 } + +ntpEntNotifStratumChange NOTIFICATION-TYPE + OBJECTS { ntpEntStatusDateTime, ntpEntStatusStratum, + ntpEntNotifMessage } + STATUS current + DESCRIPTION + "The notification to be sent when stratum level of NTP changes." + ::= { ntpEntNotifications 2 } + +ntpEntNotifSyspeerChanged NOTIFICATION-TYPE + OBJECTS { ntpEntStatusDateTime, ntpEntStatusActiveRefSourceId, + ntpEntNotifMessage } + STATUS current + DESCRIPTION + "The notification to be sent when a (new) syspeer has been + selected." + ::= { ntpEntNotifications 3 } + +ntpEntNotifAddAssociation NOTIFICATION-TYPE + OBJECTS { ntpEntStatusDateTime, ntpAssocName, ntpEntNotifMessage } + STATUS current + DESCRIPTION + "The notification to be sent when a new association is + mobilized." + ::= { ntpEntNotifications 4 } + +ntpEntNotifRemoveAssociation NOTIFICATION-TYPE + OBJECTS { ntpEntStatusDateTime, ntpAssocName, ntpEntNotifMessage } + STATUS current + DESCRIPTION + "The notification to be sent when an association is + demobilized." + ::= { ntpEntNotifications 5 } + +ntpEntNotifConfigChanged NOTIFICATION-TYPE + OBJECTS { ntpEntStatusDateTime, ntpEntNotifMessage } + STATUS current + DESCRIPTION + "The notification to be sent when the NTP configuration has + changed, e.g., when the system connected to the Internet and + was assigned a new IP address by the ISPs DHCP server." + ::= { ntpEntNotifications 6 } + +ntpEntNotifLeapSecondAnnounced NOTIFICATION-TYPE + OBJECTS { ntpEntStatusDateTime, ntpEntNotifMessage } + STATUS current + DESCRIPTION + "The notification to be sent when a leap second has been + announced." + ::= { ntpEntNotifications 7 } + +ntpEntNotifHeartbeat NOTIFICATION-TYPE + OBJECTS { ntpEntStatusDateTime, ntpEntStatusCurrentMode, + ntpEntHeartbeatInterval, ntpEntNotifMessage } + STATUS current + DESCRIPTION + "The notification to be sent periodically (as defined by + ntpEntHeartbeatInterval) to indicate that the NTP entity is + still alive." + ::= { ntpEntNotifications 8 } + +-- +-- Conformance/Compliance statements +-- + +ntpEntConformance OBJECT IDENTIFIER ::= { ntpSnmpMIB 2 } + +ntpEntCompliances OBJECT IDENTIFIER ::= { ntpEntConformance 1 } +ntpEntGroups OBJECT IDENTIFIER ::= { ntpEntConformance 2 } + +ntpEntNTPCompliance MODULE-COMPLIANCE + STATUS current + DESCRIPTION + "The compliance statement for SNMP entities that use NTP and + implement the NTP MIB." + MODULE -- this module + MANDATORY-GROUPS { + ntpEntObjectsGroup1 + } + ::= { ntpEntCompliances 1 } + +ntpEntSNTPCompliance MODULE-COMPLIANCE + STATUS current + DESCRIPTION + "The compliance statement for SNMP entities that use SNTP and + implement the NTP MIB." + MODULE -- this module + MANDATORY-GROUPS { + ntpEntObjectsGroup1 + } + GROUP ntpEntObjectsGroup2 + DESCRIPTION + "Optional object group." + GROUP ntpEntNotifGroup + DESCRIPTION + "Optional notifications for this MIB." + ::= { ntpEntCompliances 2 } + +ntpEntObjectsGroup1 OBJECT-GROUP + OBJECTS { + ntpEntSoftwareName, + ntpEntSoftwareVersion, + ntpEntSoftwareVendor, + ntpEntSystemType, + ntpEntStatusEntityUptime, + ntpEntStatusDateTime, + ntpAssocName, + ntpAssocRefId, + ntpAssocAddressType, + ntpAssocAddress + } + STATUS current + DESCRIPTION + "A collection of objects for the NTP MIB." + ::= { ntpEntGroups 1 } + +ntpEntObjectsGroup2 OBJECT-GROUP + OBJECTS { + ntpEntTimeResolution, + ntpEntTimePrecision, + ntpEntTimeDistance, + ntpEntStatusCurrentMode, + ntpEntStatusStratum, + ntpEntStatusActiveRefSourceId, + ntpEntStatusActiveRefSourceName, + ntpEntStatusActiveOffset, + ntpEntStatusNumberOfRefSources, + ntpEntStatusDispersion, + ntpEntStatusLeapSecond, + ntpEntStatusLeapSecDirection, + ntpEntStatusInPkts, + ntpEntStatusOutPkts, + ntpEntStatusBadVersion, + ntpEntStatusProtocolError, + ntpEntStatusNotifications, + ntpEntStatPktSent, + ntpEntStatPktReceived, + ntpAssocOffset, + ntpAssocStratum, + ntpAssocStatusJitter, + ntpAssocStatusDelay, + ntpAssocStatusDispersion, + ntpAssocStatInPkts, + ntpAssocStatOutPkts, + ntpAssocStatProtocolError, + ntpEntHeartbeatInterval, + ntpEntNotifBits, + ntpEntNotifMessage + } + STATUS current + DESCRIPTION + "A collection of objects for the NTP MIB." + ::= { ntpEntGroups 2 } + +ntpEntNotifGroup NOTIFICATION-GROUP + NOTIFICATIONS { + ntpEntNotifModeChange, + ntpEntNotifStratumChange, + ntpEntNotifSyspeerChanged, + ntpEntNotifAddAssociation, + ntpEntNotifRemoveAssociation, + ntpEntNotifConfigChanged, + ntpEntNotifLeapSecondAnnounced, + ntpEntNotifHeartbeat + } + STATUS current + DESCRIPTION + "A collection of notifications for the NTP MIB" + ::= { ntpEntGroups 3 } + +END |