aboutsummaryrefslogtreecommitdiffstats
path: root/ntpsnmpd
diff options
context:
space:
mode:
authorCy Schubert <cy@FreeBSD.org>2014-12-20 22:52:39 +0000
committerCy Schubert <cy@FreeBSD.org>2014-12-20 22:52:39 +0000
commitb5e14a1344528861a7016aa2c6b0f2e9630d1526 (patch)
treef04bed14f7e8aed5c0e9d2f7785175c7951036d3 /ntpsnmpd
parent2b45e011ca352ce509bc83ae148230aeee0c7e0d (diff)
downloadsrc-b5e14a1344528861a7016aa2c6b0f2e9630d1526.tar.gz
src-b5e14a1344528861a7016aa2c6b0f2e9630d1526.zip
Vendor import ntp 4.2.8.vendor/ntp/4.2.8
Reviewed by: roberto Security: VUXML: 4033d826-87dd-11e4-9079-3c970e169bc2 Security: http://www.kb.cert.org/vuls/id/852879 Security: CVE-2014-9293 Security CVE-2014-9294 Security CVE-2014-9295 Security CVE-2014-9296
Notes
Notes: svn path=/vendor/ntp/dist/; revision=275970 svn path=/vendor/ntp/4.2.8/; revision=275971; tag=vendor/ntp/4.2.8
Diffstat (limited to 'ntpsnmpd')
-rw-r--r--ntpsnmpd/Makefile.am125
-rw-r--r--ntpsnmpd/Makefile.in542
-rw-r--r--ntpsnmpd/invoke-ntpsnmpd.menu (renamed from ntpsnmpd/ntpsnmpd-opts.menu)0
-rw-r--r--ntpsnmpd/invoke-ntpsnmpd.texi188
-rw-r--r--ntpsnmpd/netsnmp_daemonize.c10
-rw-r--r--ntpsnmpd/ntpSnmpSubagentObject.c2
-rw-r--r--ntpsnmpd/ntpsnmpd-opts.c874
-rw-r--r--ntpsnmpd/ntpsnmpd-opts.def112
-rw-r--r--ntpsnmpd/ntpsnmpd-opts.h112
-rw-r--r--ntpsnmpd/ntpsnmpd-opts.texi82
-rw-r--r--ntpsnmpd/ntpsnmpd.187
-rw-r--r--ntpsnmpd/ntpsnmpd.1ntpsnmpdman203
-rw-r--r--ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc144
-rw-r--r--ntpsnmpd/ntpsnmpd.c2
-rw-r--r--ntpsnmpd/ntpsnmpd.html79
-rw-r--r--ntpsnmpd/ntpsnmpd.man.in203
-rw-r--r--ntpsnmpd/ntpsnmpd.mdoc.in144
-rw-r--r--ntpsnmpd/ntpsnmpd.texi53
18 files changed, 2405 insertions, 557 deletions
diff --git a/ntpsnmpd/Makefile.am b/ntpsnmpd/Makefile.am
index 168de2787310..11ecf1b0dcc9 100644
--- a/ntpsnmpd/Makefile.am
+++ b/ntpsnmpd/Makefile.am
@@ -1,38 +1,72 @@
NULL=
-AUTOMAKE_OPTIONS=
-if NTP_BINSUBDIR_IS_BIN
-bin_PROGRAMS= @MAKE_NTPSNMPD@
-else
-sbin_PROGRAMS= @MAKE_NTPSNMPD@
-endif
+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 @LCRYPTO@ @SNMP_LIBS@ \
- $(LIBOPTS_LDADD)
-AM_CPPFLAGS= -I$(top_srcdir)/ntpq -I$(top_srcdir)/include \
- -I$(top_srcdir)/lib/isc/include \
- -I$(top_srcdir)/lib/isc/nothreads/include \
- -I$(top_srcdir)/lib/isc/unix/include \
- $(LIBOPTS_CFLAGS) @SNMP_CPPFLAGS@
-
-AM_CFLAGS= @SNMP_CFLAGS@
-EXTRA_DIST= ntpsnmpd-opts.def ntpsnmpd.1 ntpsnmpd-opts.texi \
- ntpsnmpd-opts.menu ntpv4-mib.mib
+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=
-noinst_DATA= $(srcdir)/ntpsnmpd-opts.texi $(srcdir)/ntpsnmpd-opts.menu
-man_MANS= $(srcdir)/ntpsnmpd.1
-run_ag= cd $(srcdir) && env PATH="$(abs_builddir):$(PATH)" \
- autogen -L ../include --writable
-std_def_list= $(top_srcdir)/include/autogen-version.def \
- $(top_srcdir)/include/copyright.def \
- $(top_srcdir)/include/homerc.def \
- $(top_srcdir)/include/version.def
+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
@@ -40,15 +74,44 @@ $(srcdir)/ntpsnmpd-opts.h: $(srcdir)/ntpsnmpd-opts.c
$(srcdir)/ntpsnmpd-opts.c: $(srcdir)/ntpsnmpd-opts.def $(std_def_list)
$(run_ag) ntpsnmpd-opts.def
-$(srcdir)/ntpsnmpd.1: $(srcdir)/ntpsnmpd-opts.def $(std_def_list)
- $(run_ag) -Tagman1.tpl -bntpsnmpd ntpsnmpd-opts.def
+###
-$(srcdir)/ntpsnmpd-opts.menu: $(srcdir)/ntpsnmpd-opts.texi
+$(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)/ntpsnmpd-opts.texi: $(srcdir)/ntpsnmpd-opts.def $(std_def_list)
- $(run_ag) -Taginfo.tpl -DLEVEL=section ntpsnmpd-opts.def
- $(top_srcdir)/scripts/check--help $@
+$(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/ntpsnmpd/Makefile.in b/ntpsnmpd/Makefile.in
index 81376b1ef74b..6733b3cb19cb 100644
--- a/ntpsnmpd/Makefile.in
+++ b/ntpsnmpd/Makefile.in
@@ -41,49 +41,94 @@ 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)/depsver.mf
+ $(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)/m4/define_dir.m4 $(top_srcdir)/m4/libtool.m4 \
- $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
- $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
- $(top_srcdir)/m4/ntp_cacheversion.m4 \
- $(top_srcdir)/m4/ntp_dir_sep.m4 \
- $(top_srcdir)/m4/ntp_lineeditlibs.m4 \
- $(top_srcdir)/m4/ntp_openssl.m4 \
- $(top_srcdir)/m4/ntp_vpathhack.m4 \
- $(top_srcdir)/m4/os_cflags.m4 $(top_srcdir)/version.m4 \
- $(top_srcdir)/configure.ac
+ $(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)$(sbindir)" \
- "$(DESTDIR)$(man1dir)"
-PROGRAMS = $(bin_PROGRAMS) $(sbin_PROGRAMS)
+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__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)/depcomp
+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) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
- --mode=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) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
- --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
- $(LDFLAGS) -o $@
+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'`;
@@ -108,27 +153,40 @@ 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 = $(man_MANS)
-DATA = $(noinst_DATA)
+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@
-BINSUBDIR = @BINSUBDIR@
+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@
-CLKTEST = @CLKTEST@
+CONFIG_SHELL = @CONFIG_SHELL@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
+CPPFLAGS_NTP = @CPPFLAGS_NTP@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
DCFD = @DCFD@
DEFS = @DEFS@
@@ -140,21 +198,31 @@ ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EDITLINE_LIBS = @EDITLINE_LIBS@
-EF_LIBS = @EF_LIBS@
-EF_PROGS = @EF_PROGS@
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@
-LCRYPTO = @LCRYPTO@
LD = @LD@
+LDADD_LIBNTP = @LDADD_LIBNTP@
+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@
@@ -162,6 +230,7 @@ LIBOPTS_LDADD = @LIBOPTS_LDADD@
LIBPARSE = @LIBPARSE@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
+LIBTOOL_DEPS = @LIBTOOL_DEPS@
LIPO = @LIPO@
LN_S = @LN_S@
LSCF = @LSCF@
@@ -180,14 +249,68 @@ 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@
-OPENSSL = @OPENSSL@
-OPENSSL_INC = @OPENSSL_INC@
-OPENSSL_LIB = @OPENSSL_LIB@
OTOOL = @OTOOL@
OTOOL64 = @OTOOL64@
PACKAGE = @PACKAGE@
@@ -200,10 +323,12 @@ PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_NET_SNMP_CONFIG = @PATH_NET_SNMP_CONFIG@
PATH_PERL = @PATH_PERL@
PATH_SEPARATOR = @PATH_SEPARATOR@
-PATH_SH = @PATH_SH@
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@
@@ -211,9 +336,27 @@ 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@
@@ -222,6 +365,7 @@ 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@
@@ -270,45 +414,73 @@ top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
NULL =
-AUTOMAKE_OPTIONS =
-@NTP_BINSUBDIR_IS_BIN_TRUE@bin_PROGRAMS = @MAKE_NTPSNMPD@
-@NTP_BINSUBDIR_IS_BIN_FALSE@sbin_PROGRAMS = @MAKE_NTPSNMPD@
+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 @LCRYPTO@ @SNMP_LIBS@ \
- $(LIBOPTS_LDADD)
-
-AM_CPPFLAGS = -I$(top_srcdir)/ntpq -I$(top_srcdir)/include \
- -I$(top_srcdir)/lib/isc/include \
- -I$(top_srcdir)/lib/isc/nothreads/include \
- -I$(top_srcdir)/lib/isc/unix/include \
- $(LIBOPTS_CFLAGS) @SNMP_CPPFLAGS@
-
-AM_CFLAGS = @SNMP_CFLAGS@
-EXTRA_DIST = ntpsnmpd-opts.def ntpsnmpd.1 ntpsnmpd-opts.texi \
- ntpsnmpd-opts.menu ntpv4-mib.mib
-
-BUILT_SOURCES = ntpsnmpd-opts.c ntpsnmpd-opts.h .deps-ver
-CLEANFILES = .deps-ver
-noinst_DATA = $(srcdir)/ntpsnmpd-opts.texi $(srcdir)/ntpsnmpd-opts.menu
-man_MANS = $(srcdir)/ntpsnmpd.1
-run_ag = cd $(srcdir) && env PATH="$(abs_builddir):$(PATH)" \
- autogen -L ../include --writable
-
-std_def_list = $(top_srcdir)/include/autogen-version.def \
- $(top_srcdir)/include/copyright.def \
- $(top_srcdir)/include/homerc.def \
- $(top_srcdir)/include/version.def
-
+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)/depsver.mf $(am__configure_deps)
+$(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*) \
@@ -381,6 +553,49 @@ clean-binPROGRAMS:
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)"
@@ -426,7 +641,7 @@ clean-sbinPROGRAMS:
rm -f $$list
ntpsnmpd$(EXEEXT): $(ntpsnmpd_OBJECTS) $(ntpsnmpd_DEPENDENCIES)
@rm -f ntpsnmpd$(EXEEXT)
- $(LINK) $(ntpsnmpd_OBJECTS) $(ntpsnmpd_LDADD) $(LIBS)
+ $(AM_V_CCLD)$(LINK) $(ntpsnmpd_OBJECTS) $(ntpsnmpd_LDADD) $(LIBS)
mostlyclean-compile:
-rm -f *.$(OBJEXT)
@@ -440,22 +655,25 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntpsnmpd.Po@am__quote@
.c.o:
-@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
-@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@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@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
-@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@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@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
-@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+@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 $@ $<
@@ -465,10 +683,10 @@ mostlyclean-libtool:
clean-libtool:
-rm -rf .libs _libs
-install-man1: $(man_MANS)
+install-man1: $(man1_MANS) $(man_MANS)
@$(NORMAL_INSTALL)
test -z "$(man1dir)" || $(MKDIR_P) "$(DESTDIR)$(man1dir)"
- @list=''; test -n "$(man1dir)" || exit 0; \
+ @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'; \
@@ -494,7 +712,7 @@ install-man1: $(man_MANS)
uninstall-man1:
@$(NORMAL_UNINSTALL)
- @list=''; test -n "$(man1dir)" || exit 0; \
+ @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'; \
@@ -503,6 +721,64 @@ uninstall-man1:
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)'; \
@@ -604,7 +880,7 @@ check: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) check-am
all-am: Makefile $(PROGRAMS) $(MANS) $(DATA)
installdirs:
- for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(man1dir)"; do \
+ 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)
@@ -630,6 +906,7 @@ clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+ -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@@ -637,8 +914,8 @@ maintainer-clean-generic:
-test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
clean: clean-am
-clean-am: clean-binPROGRAMS clean-generic clean-libtool \
- clean-sbinPROGRAMS mostlyclean-am
+clean-am: clean-binPROGRAMS clean-generic clean-libexecPROGRAMS \
+ clean-libtool clean-sbinPROGRAMS mostlyclean-am
distclean: distclean-am
-rm -rf ./$(DEPDIR)
@@ -658,13 +935,14 @@ info: info-am
info-am:
-install-data-am: install-man
+install-data-am: install-data-local install-htmlDATA install-man
install-dvi: install-dvi-am
install-dvi-am:
-install-exec-am: install-binPROGRAMS install-sbinPROGRAMS
+install-exec-am: install-binPROGRAMS install-libexecPROGRAMS \
+ install-sbinPROGRAMS
@$(NORMAL_INSTALL)
$(MAKE) $(AM_MAKEFLAGS) install-exec-hook
install-html: install-html-am
@@ -675,7 +953,7 @@ install-info: install-info-am
install-info-am:
-install-man: install-man1
+install-man: install-man1 install-man8
install-pdf: install-pdf-am
@@ -705,64 +983,109 @@ ps: ps-am
ps-am:
-uninstall-am: uninstall-binPROGRAMS uninstall-man \
- uninstall-sbinPROGRAMS
+uninstall-am: uninstall-binPROGRAMS uninstall-htmlDATA \
+ uninstall-libexecPROGRAMS uninstall-man uninstall-sbinPROGRAMS
-uninstall-man: uninstall-man1
+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-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-dvi install-dvi-am install-exec \
+ 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-info install-info-am install-man install-man1 \
+ 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-man uninstall-man1 uninstall-sbinPROGRAMS
+ 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.1: $(srcdir)/ntpsnmpd-opts.def $(std_def_list)
- $(run_ag) -Tagman1.tpl -bntpsnmpd 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
+
+###
-$(srcdir)/ntpsnmpd-opts.menu: $(srcdir)/ntpsnmpd-opts.texi
+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)/ntpsnmpd-opts.texi: $(srcdir)/ntpsnmpd-opts.def $(std_def_list)
- $(run_ag) -Taginfo.tpl -DLEVEL=section ntpsnmpd-opts.def
- $(top_srcdir)/scripts/check--help $@
+$(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:
- @case ${BINSUBDIR} in \
- bin) ODIR=${sbindir} ;; \
- sbin) ODIR=${bindir} ;; \
- esac; \
- test -z "${bin_PROGRAMS}${bin_SCRIPTS}" \
- || for i in ${bin_PROGRAMS} ${bin_SCRIPTS} " "; do \
- test ! -f $$ODIR/$$i || echo "*** $$i is also in $$ODIR!"; \
+ @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) clean && \
+ $(MAKE) $(AM_MAKEFLAGS) clean && \
echo -n "Prior $(subdir)/$(DEPDIR) version " && \
cat $@ && \
rm -rf $(DEPDIR) && \
@@ -771,17 +1094,10 @@ $(DEPDIR)/deps-ver: $(top_srcdir)/deps-ver
.) \
./config.status Makefile depfiles \
;; \
- ..) \
- cd .. && \
- ./config.status $(subdir)/Makefile depfiles && \
- cd $(subdir) \
- ;; \
*) \
- echo 'Fatal: depsver.mf Automake fragment limited' \
- 'to immediate subdirectories.' && \
- echo "top_builddir: $(top_builddir)" && \
- echo "subdir: $(subdir)" && \
- exit 1 \
+ cd "$(top_builddir)" && \
+ ./config.status $(subdir)/Makefile depfiles && \
+ cd $(subdir) \
;; \
esac && \
echo -n "Cleaned $(subdir)/$(DEPDIR) version " && \
@@ -790,7 +1106,7 @@ $(DEPDIR)/deps-ver: $(top_srcdir)/deps-ver
cp $(top_srcdir)/deps-ver $@
.deps-ver: $(top_srcdir)/deps-ver
- @[ ! -d $(DEPDIR) ] || $(MAKE) $(DEPDIR)/deps-ver
+ @[ ! -d $(DEPDIR) ] || $(MAKE) $(AM_MAKEFLAGS) $(DEPDIR)/deps-ver
@touch $@
#
diff --git a/ntpsnmpd/ntpsnmpd-opts.menu b/ntpsnmpd/invoke-ntpsnmpd.menu
index 886e80a7316f..886e80a7316f 100644
--- a/ntpsnmpd/ntpsnmpd-opts.menu
+++ b/ntpsnmpd/invoke-ntpsnmpd.menu
diff --git a/ntpsnmpd/invoke-ntpsnmpd.texi b/ntpsnmpd/invoke-ntpsnmpd.texi
new file mode 100644
index 000000000000..6631f01a80d6
--- /dev/null
+++ b/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 December 19, 2014 at 07:50: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.8
+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>...&lt;...&gt;...</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/ntpsnmpd/netsnmp_daemonize.c b/ntpsnmpd/netsnmp_daemonize.c
index 43cba8922ca1..969caa0db77a 100644
--- a/ntpsnmpd/netsnmp_daemonize.c
+++ b/ntpsnmpd/netsnmp_daemonize.c
@@ -191,8 +191,10 @@ int
netsnmp_daemonize(int quit_immediately, int stderr_log)
{
int i = 0;
+ int saved_errno;
+
DEBUGMSGT(("daemonize","deamonizing...\n"));
-#if HAVE_WORKING_FORK
+#ifdef HAVE_WORKING_FORK
/*
* Fork to return control to the invoking process and to
* guarantee that we aren't a process group leader.
@@ -200,10 +202,11 @@ netsnmp_daemonize(int quit_immediately, int stderr_log)
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", errno);
+ "netsnmp_daemonize()\n", saved_errno);
return -1;
}
if (quit_immediately) {
@@ -220,10 +223,11 @@ netsnmp_daemonize(int quit_immediately, int stderr_log)
* 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", errno);
+ "netsnmp_daemonize()\n", saved_errno);
}
/* Parent. */
exit(0);
diff --git a/ntpsnmpd/ntpSnmpSubagentObject.c b/ntpsnmpd/ntpSnmpSubagentObject.c
index 57b10ba49b0e..f65fedf600de 100644
--- a/ntpsnmpd/ntpSnmpSubagentObject.c
+++ b/ntpsnmpd/ntpSnmpSubagentObject.c
@@ -121,7 +121,7 @@ ntpsnmpd_parse_string(
if (value[0] == '"') {
val_cnt--;
- strncpy(value, &value[1], valuesize);
+ strlcpy(value, &value[1], valuesize);
if (val_cnt > 0 && value[val_cnt - 1] == '"') {
val_cnt--;
value[val_cnt] = '\0';
diff --git a/ntpsnmpd/ntpsnmpd-opts.c b/ntpsnmpd/ntpsnmpd-opts.c
index 77a8a698a112..4877ffe4ccf1 100644
--- a/ntpsnmpd/ntpsnmpd-opts.c
+++ b/ntpsnmpd/ntpsnmpd-opts.c
@@ -1,11 +1,11 @@
-/*
+/*
* EDIT THIS FILE WITH CAUTION (ntpsnmpd-opts.c)
- *
- * It has been AutoGen-ed December 24, 2011 at 06:34:36 PM by AutoGen 5.12
+ *
+ * It has been AutoGen-ed December 19, 2014 at 07:50:22 AM by AutoGen 5.18.5pre4
* From the definitions ntpsnmpd-opts.def
* and the template file options
*
- * Generated from AutoOpts 35:0:10 templates.
+ * 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
@@ -15,131 +15,185 @@
* users discretion, the BSD license. See the AutoOpts and/or libopts sources
* for details.
*
- * This source file is copyrighted and licensed under the following terms:
+ * The ntpsnmpd program is copyrighted and licensed
+ * under the following terms:
+ *
+ * Copyright (C) 1970-2014 The University of Delaware, 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>
*
- * see html/copyright.html
- *
+ * 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 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>
-#define OPTION_CODE_COMPILE 1
-#include "ntpsnmpd-opts.h"
-
#ifdef __cplusplus
extern "C" {
#endif
extern FILE * option_usage_fp;
+#define zCopyright (ntpsnmpd_opt_strs+0)
+#define zLicenseDescrip (ntpsnmpd_opt_strs+314)
-/* TRANSLATORS: choose the translation for option names wisely because you
- cannot ever change your mind. */
-static char const zCopyright[42] =
-"ntpsnmpd 4.2.6p5\n\
-see html/copyright.html\n";
-static char const zLicenseDescrip[25] =
-"see html/copyright.html\n";
-
-extern tUsageProc optionUsage;
#ifndef NULL
# define NULL 0
#endif
-/*
- * Nofork option description:
+/**
+ * static const strings for ntpsnmpd options
*/
-static char const zNoforkText[] =
- "Do not fork";
-static char const zNofork_NAME[] = "NOFORK";
-static char const zNofork_Name[] = "nofork";
-#define NOFORK_FLAGS (OPTST_DISABLED)
-
-/*
- * Syslog option description:
+static char const ntpsnmpd_opt_strs[1548] =
+/* 0 */ "ntpsnmpd 4.2.8\n"
+ "Copyright (C) 1970-2014 The University of Delaware, 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"
+/* 314 */ "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 makes no\n"
+ "representations about the suitability this software for any purpose. It is\n"
+ "provided \"as is\" without express or implied warranty.\n\0"
+/* 954 */ "Do not fork\0"
+/* 966 */ "NOFORK\0"
+/* 973 */ "nofork\0"
+/* 980 */ "Log to syslog()\0"
+/* 996 */ "SYSLOG\0"
+/* 1003 */ "syslog\0"
+/* 1010 */ "The socket address ntpsnmpd uses to connect to net-snmpd\0"
+/* 1067 */ "AGENTXSOCKET\0"
+/* 1080 */ "agentxsocket\0"
+/* 1093 */ "unix:/var/agentx/master\0"
+/* 1117 */ "display extended usage information and exit\0"
+/* 1161 */ "help\0"
+/* 1166 */ "extended usage information passed thru pager\0"
+/* 1211 */ "more-help\0"
+/* 1221 */ "output version information and exit\0"
+/* 1257 */ "version\0"
+/* 1265 */ "save the option state to a config file\0"
+/* 1304 */ "save-opts\0"
+/* 1314 */ "load options from a config file\0"
+/* 1346 */ "LOAD_OPTS\0"
+/* 1356 */ "no-load-opts\0"
+/* 1369 */ "no\0"
+/* 1372 */ "NTPSNMPD\0"
+/* 1381 */ "ntpsnmpd - NTP SNMP MIB agent - Ver. 4.2.8\n"
+ "Usage: %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]...\n\0"
+/* 1482 */ "$HOME\0"
+/* 1488 */ ".\0"
+/* 1490 */ ".ntprc\0"
+/* 1497 */ "http://bugs.ntp.org, bugs@ntp.org\0"
+/* 1531 */ "\n\0"
+/* 1533 */ "ntpsnmpd 4.2.8";
+
+/**
+ * nofork option description:
*/
-static char const zSyslogText[] =
- "Log to syslog()";
-static char const zSyslog_NAME[] = "SYSLOG";
-static char const zSyslog_Name[] = "syslog";
-#define SYSLOG_FLAGS (OPTST_DISABLED)
-
-/*
- * Agentxsocket option description:
+/** Descriptive text for the nofork option */
+#define NOFORK_DESC (ntpsnmpd_opt_strs+954)
+/** Upper-cased name for the nofork option */
+#define NOFORK_NAME (ntpsnmpd_opt_strs+966)
+/** Name string for the nofork option */
+#define NOFORK_name (ntpsnmpd_opt_strs+973)
+/** 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+980)
+/** Upper-cased name for the syslog option */
+#define SYSLOG_NAME (ntpsnmpd_opt_strs+996)
+/** Name string for the syslog option */
+#define SYSLOG_name (ntpsnmpd_opt_strs+1003)
+/** Compiled in flag settings for the syslog option */
+#define SYSLOG_FLAGS (OPTST_DISABLED)
+
+/**
+ * agentXSocket option description:
*/
-static char const zAgentxsocketText[] =
- "The socket address ntpsnmpd uses to connect to net-snmpd";
-static char const zAgentxsocket_NAME[] = "AGENTXSOCKET";
-static char const zAgentxsocket_Name[] = "agentxsocket";
-static char const zAgentxsocketDefaultArg[] = "unix:/var/agentx/master";
-#define AGENTXSOCKET_FLAGS (OPTST_DISABLED \
+/** Descriptive text for the agentXSocket option */
+#define AGENTXSOCKET_DESC (ntpsnmpd_opt_strs+1010)
+/** Upper-cased name for the agentXSocket option */
+#define AGENTXSOCKET_NAME (ntpsnmpd_opt_strs+1067)
+/** Name string for the agentXSocket option */
+#define AGENTXSOCKET_name (ntpsnmpd_opt_strs+1080)
+/** The compiled in default value for the agentXSocket option argument */
+#define AGENTXSOCKET_DFT_ARG (ntpsnmpd_opt_strs+1093)
+/** 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:
*/
-static char const zHelpText[] = "Display extended usage information and exit";
-static char const zHelp_Name[] = "help";
+#define HELP_DESC (ntpsnmpd_opt_strs+1117)
+#define HELP_name (ntpsnmpd_opt_strs+1161)
#ifdef HAVE_WORKING_FORK
-#define OPTST_MORE_HELP_FLAGS (OPTST_IMM | OPTST_NO_INIT)
-static char const zMore_Help_Name[] = "more-help";
-static char const zMore_HelpText[] = "Extended usage information passed thru pager";
+#define MORE_HELP_DESC (ntpsnmpd_opt_strs+1166)
+#define MORE_HELP_name (ntpsnmpd_opt_strs+1211)
+#define MORE_HELP_FLAGS (OPTST_IMM | OPTST_NO_INIT)
#else
-#define OPTST_MORE_HELP_FLAGS (OPTST_OMITTED | OPTST_NO_INIT)
-#define zMore_Help_Name NULL
-#define zMore_HelpText NULL
+#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 OPTST_VERSION_FLAGS OPTST_IMM | OPTST_NO_INIT
+# define VER_FLAGS (OPTST_IMM | OPTST_NO_INIT)
#else
-# define OPTST_VERSION_FLAGS OPTST_SET_ARGTYPE(OPARG_TYPE_STRING) | \
- OPTST_ARG_OPTIONAL | OPTST_IMM | OPTST_NO_INIT
+# define VER_FLAGS (OPTST_SET_ARGTYPE(OPARG_TYPE_STRING) | \
+ OPTST_ARG_OPTIONAL | OPTST_IMM | OPTST_NO_INIT)
#endif
-
-static char const zVersionText[] = "Output version information and exit";
-static char const zVersion_Name[] = "version";
-static char const zSave_OptsText[] = "Save the option state to a config file";
-static char const zSave_Opts_Name[] = "save-opts";
-static char const zLoad_OptsText[] = "Load options from a config file";
-static char const zLoad_Opts_NAME[] = "LOAD_OPTS";
-static char const zNotLoad_Opts_Name[] = "no-load-opts";
-static char const zNotLoad_Opts_Pfx[] = "no";
-#define zLoad_Opts_Name (zNotLoad_Opts_Name + 3)
-/*
+#define VER_DESC (ntpsnmpd_opt_strs+1221)
+#define VER_name (ntpsnmpd_opt_strs+1257)
+#define SAVE_OPTS_DESC (ntpsnmpd_opt_strs+1265)
+#define SAVE_OPTS_name (ntpsnmpd_opt_strs+1304)
+#define LOAD_OPTS_DESC (ntpsnmpd_opt_strs+1314)
+#define LOAD_OPTS_NAME (ntpsnmpd_opt_strs+1346)
+#define NO_LOAD_OPTS_name (ntpsnmpd_opt_strs+1356)
+#define LOAD_OPTS_pfx (ntpsnmpd_opt_strs+1369)
+#define LOAD_OPTS_name (NO_LOAD_OPTS_name + 3)
+/**
* Declare option callback procedures
*/
-#if defined(TEST_NTPSNMPD_OPTS)
-/*
- * Under test, omit argument processing, or call optionStackArg,
- * if multiple copies are allowed.
- */
-static tOptProc
- doUsageOpt;
-
-#else /* NOT defined TEST_NTPSNMPD_OPTS */
-/*
- * When not under test, there are different procs to use
- */
extern tOptProc
- optionBooleanVal, optionNestedVal, optionNumericVal,
- optionPagedUsage, optionPrintVersion, optionResetOpt,
- optionStackArg, optionTimeDate, optionTimeVal,
- optionUnstackArg, optionVersionStderr;
+ ntpOptionPrintVersion, optionBooleanVal, optionNestedVal,
+ optionNumericVal, optionPagedUsage, optionResetOpt,
+ optionStackArg, optionTimeDate, optionTimeVal,
+ optionUnstackArg, optionVendorOption;
static tOptProc
doUsageOpt;
-#endif /* defined(TEST_NTPSNMPD_OPTS) */
-#ifdef TEST_NTPSNMPD_OPTS
-# define DOVERPROC optionVersionStderr
-#else
-# define DOVERPROC optionPrintVersion
-#endif /* TEST_NTPSNMPD_OPTS */
+#define VER_PROC ntpOptionPrintVersion
-/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
- *
- * Define the Ntpsnmpd Option Descriptions.
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+/**
+ * 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,
@@ -147,11 +201,11 @@ static tOptDesc optDesc[OPTION_CT] = {
/* equivalenced to */ NO_EQUIVALENT,
/* min, max, act ct */ 0, 1, 0,
/* opt state flags */ NOFORK_FLAGS, 0,
- /* last opt argumnt */ { NULL },
+ /* last opt argumnt */ { NULL }, /* --nofork */
/* arg list/cookie */ NULL,
/* must/cannot opts */ NULL, NULL,
/* option proc */ NULL,
- /* desc, NAME, name */ zNoforkText, zNofork_NAME, zNofork_Name,
+ /* desc, NAME, name */ NOFORK_DESC, NOFORK_NAME, NOFORK_name,
/* disablement strs */ NULL, NULL },
{ /* entry idx, value */ 1, VALUE_OPT_SYSLOG,
@@ -159,11 +213,11 @@ static tOptDesc optDesc[OPTION_CT] = {
/* equivalenced to */ NO_EQUIVALENT,
/* min, max, act ct */ 0, 1, 0,
/* opt state flags */ SYSLOG_FLAGS, 0,
- /* last opt argumnt */ { NULL },
+ /* last opt argumnt */ { NULL }, /* --syslog */
/* arg list/cookie */ NULL,
/* must/cannot opts */ NULL, NULL,
/* option proc */ NULL,
- /* desc, NAME, name */ zSyslogText, zSyslog_NAME, zSyslog_Name,
+ /* desc, NAME, name */ SYSLOG_DESC, SYSLOG_NAME, SYSLOG_name,
/* disablement strs */ NULL, NULL },
{ /* entry idx, value */ 2, VALUE_OPT_AGENTXSOCKET,
@@ -171,97 +225,100 @@ static tOptDesc optDesc[OPTION_CT] = {
/* equivalenced to */ NO_EQUIVALENT,
/* min, max, act ct */ 0, 1, 0,
/* opt state flags */ AGENTXSOCKET_FLAGS, 0,
- /* last opt argumnt */ { zAgentxsocketDefaultArg },
+ /* last opt argumnt */ { AGENTXSOCKET_DFT_ARG },
/* arg list/cookie */ NULL,
/* must/cannot opts */ NULL, NULL,
/* option proc */ NULL,
- /* desc, NAME, name */ zAgentxsocketText, zAgentxsocket_NAME, zAgentxsocket_Name,
+ /* 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, 0,
+ /* equiv idx value */ NO_EQUIVALENT, VALUE_OPT_VERSION,
/* equivalenced to */ NO_EQUIVALENT,
/* min, max, act ct */ 0, 1, 0,
- /* opt state flags */ OPTST_VERSION_FLAGS, 0,
+ /* opt state flags */ VER_FLAGS, AOUSE_VERSION,
/* last opt argumnt */ { NULL },
/* arg list/cookie */ NULL,
/* must/cannot opts */ NULL, NULL,
- /* option proc */ DOVERPROC,
- /* desc, NAME, name */ zVersionText, NULL, zVersion_Name,
+ /* 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, 0,
+ /* 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, 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 */ zHelpText, NULL, zHelp_Name,
+ /* 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, 0,
+ /* equiv idx value */ NO_EQUIVALENT, VALUE_OPT_MORE_HELP,
/* equivalenced to */ NO_EQUIVALENT,
/* min, max, act ct */ 0, 1, 0,
- /* opt state flags */ OPTST_MORE_HELP_FLAGS, 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 */ zMore_HelpText, NULL, zMore_Help_Name,
+ /* 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, 0,
+ /* 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, 0,
+ | 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 */ zSave_OptsText, NULL, zSave_Opts_Name,
+ /* 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, 0,
+ /* 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, 0,
+ | 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 */ zLoad_OptsText, zLoad_Opts_NAME, zLoad_Opts_Name,
- /* disablement strs */ zNotLoad_Opts_Name, zNotLoad_Opts_Pfx }
+ /* desc, NAME, name */ LOAD_OPTS_DESC, LOAD_OPTS_NAME, LOAD_OPTS_name,
+ /* disablement strs */ NO_LOAD_OPTS_name, LOAD_OPTS_pfx }
};
-/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
- *
- * Define the Ntpsnmpd Option Environment
- */
-static char const zPROGNAME[9] = "NTPSNMPD";
-static char const zUsageTitle[103] =
-"ntpsnmpd - NTP SNMP MIB agent - Ver. 4.2.6p5\n\
-USAGE: %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]...\n";
-static char const zRcName[7] = ".ntprc";
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+/** Reference to the upper cased version of ntpsnmpd. */
+#define zPROGNAME (ntpsnmpd_opt_strs+1372)
+/** Reference to the title line for ntpsnmpd usage. */
+#define zUsageTitle (ntpsnmpd_opt_strs+1381)
+/** ntpsnmpd configuration file name. */
+#define zRcName (ntpsnmpd_opt_strs+1490)
+/** Directories to search for ntpsnmpd config files. */
static char const * const apzHomeList[3] = {
- "$HOME",
- ".",
+ ntpsnmpd_opt_strs+1482,
+ ntpsnmpd_opt_strs+1488,
NULL };
-
-static char const zBugsAddr[34] = "http://bugs.ntp.org, bugs@ntp.org";
-#define zExplain NULL
-#define zDetail NULL
-static char const zFullVersion[] = NTPSNMPD_FULL_VERSION;
-/* extracted from optcode.tlib near line 515 */
+/** The ntpsnmpd program bug email address. */
+#define zBugsAddr (ntpsnmpd_opt_strs+1497)
+/** Clarification/explanation of what ntpsnmpd does. */
+#define zExplain (ntpsnmpd_opt_strs+1531)
+/** Extra detail explaining what ntpsnmpd does. */
+#define zDetail (NULL)
+/** The full version string for ntpsnmpd. */
+#define zFullVersion (ntpsnmpd_opt_strs+1533)
+/* extracted from optcode.tlib near line 364 */
#if defined(ENABLE_NLS)
# define OPTPROC_BASE OPTPROC_TRANSLATE
@@ -271,16 +328,49 @@ static char const zFullVersion[] = NTPSNMPD_FULL_VERSION;
# define translate_option_strings NULL
#endif /* ENABLE_NLS */
+#define ntpsnmpd_full_usage (NULL)
+#define ntpsnmpd_short_usage (NULL)
-#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
@@ -293,7 +383,13 @@ static char const ntpsnmpd_packager_info[] =
# 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 */
@@ -328,120 +424,486 @@ tOptions ntpsnmpdOptions = {
PKGDATADIR, ntpsnmpd_packager_info
};
-/*
- * Create the static procedure(s) declared above.
- */
-static void
-doUsageOpt(tOptions * pOptions, tOptDesc * pOptDesc)
-{
- (void)pOptions;
- USAGE(NTPSNMPD_EXIT_SUCCESS);
-}
-/* extracted from optmain.tlib near line 128 */
-
-#if defined(TEST_NTPSNMPD_OPTS) /* TEST MAIN PROCEDURE: */
-
-extern void optionPutShell(tOptions*);
-
-int
-main(int argc, char ** argv)
-{
- int res = NTPSNMPD_EXIT_SUCCESS;
- (void)optionProcess(&ntpsnmpdOptions, argc, argv);
- optionPutShell(&ntpsnmpdOptions);
- res = ferror(stdout);
- if (res != 0)
- fputs("output error writing to stdout\n", stderr);
- return res;
-}
-#endif /* defined TEST_NTPSNMPD_OPTS */
-/* extracted from optcode.tlib near line 666 */
-
#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);
+static char * AO_gettext(char const * pz);
+static void coerce_it(void ** s);
-static char*
-AO_gettext(char const* pz)
+/**
+ * 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* pzRes;
+ char * res;
if (pz == NULL)
return NULL;
- pzRes = _(pz);
- if (pzRes == pz)
- return pzRes;
- pzRes = strdup(pzRes);
- if (pzRes == 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 pzRes;
+ return res;
}
-static void coerce_it(void** s) { *s = AO_gettext(*s);
+/**
+ * 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);
}
-/*
- * This invokes the translation code (e.g. gettext(3)).
+/**
+ * Translate all the translatable strings in the ntpsnmpdOptions
+ * structure defined above. This is done only once.
*/
static void
translate_option_strings(void)
{
- tOptions * const pOpt = &ntpsnmpdOptions;
+ 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_usage_text.field_ct != 0) {
+ 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.
*/
- tOptDesc * pOD = pOpt->pOptDesc;
- char ** ppz = (char**)(void*)&(option_usage_text);
- int ix = option_usage_text.field_ct;
+ char ** ppz = (char**)(void*)&(option_xlateable_txt);
+ int ix = option_xlateable_txt.field_ct;
do {
- ppz++;
+ ppz++; /* skip over field_ct */
*ppz = AO_gettext(*ppz);
} while (--ix > 0);
-
- coerce_it((void*)&(pOpt->pzCopyright));
- coerce_it((void*)&(pOpt->pzCopyNotice));
- coerce_it((void*)&(pOpt->pzFullVersion));
- coerce_it((void*)&(pOpt->pzUsageTitle));
- coerce_it((void*)&(pOpt->pzExplain));
- coerce_it((void*)&(pOpt->pzDetail));
- coerce_it((void*)&(pOpt->pzPackager));
- option_usage_text.field_ct = 0;
-
- for (ix = pOpt->optCt; ix > 0; ix--, pOD++)
- coerce_it((void*)&(pOD->pzText));
- }
-
- if ((pOpt->fOptSet & OPTPROC_NXLAT_OPT_CFG) == 0) {
- tOptDesc * pOD = pOpt->pOptDesc;
- int ix;
-
- for (ix = pOpt->optCt; ix > 0; ix--, pOD++) {
- coerce_it((void*)&(pOD->pz_Name));
- coerce_it((void*)&(pOD->pz_DisableName));
- coerce_it((void*)&(pOD->pz_DisablePfx));
+ /* 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));
}
- /* prevent re-translation */
- ntpsnmpdOptions.fOptSet |= OPTPROC_NXLAT_OPT_CFG | OPTPROC_NXLAT_OPT;
}
}
-
#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.8\n\
+Copyright (C) 1970-2014 The University of Delaware, 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 makes no\n\
+representations about the suitability this software for any purpose. It is\n\
+provided \"as is\" without express or 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.8\n\
+Usage: %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]...\n"));
+
+ /* referenced via ntpsnmpdOptions.pzExplain */
+ puts(_("\n"));
+
+ /* referenced via ntpsnmpdOptions.pzFullVersion */
+ puts(_("ntpsnmpd 4.2.8"));
+
+ /* 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
diff --git a/ntpsnmpd/ntpsnmpd-opts.def b/ntpsnmpd/ntpsnmpd-opts.def
index 7145f6347d7b..b3162e58e488 100644
--- a/ntpsnmpd/ntpsnmpd-opts.def
+++ b/ntpsnmpd/ntpsnmpd-opts.def
@@ -9,8 +9,6 @@ autogen definitions options;
prog-name = "ntpsnmpd";
prog-title = "NTP SNMP MIB agent";
-test-main;
-
flag = {
name = nofork;
value = n;
@@ -35,6 +33,114 @@ flag = {
descrip = "The socket address ntpsnmpd uses to connect to net-snmpd";
doc = <<- _EndOfDoc_
[<transport-specifier>:]<transport-address>
- The default is the Unix Domain socket "unix:/var/agentx/master". Another common alternative is tcp:localhost:705.
+ 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/ntpsnmpd/ntpsnmpd-opts.h b/ntpsnmpd/ntpsnmpd-opts.h
index d382425ce27f..67742a23dc77 100644
--- a/ntpsnmpd/ntpsnmpd-opts.h
+++ b/ntpsnmpd/ntpsnmpd-opts.h
@@ -1,11 +1,11 @@
-/*
+/*
* EDIT THIS FILE WITH CAUTION (ntpsnmpd-opts.h)
- *
- * It has been AutoGen-ed December 24, 2011 at 06:34:36 PM by AutoGen 5.12
+ *
+ * It has been AutoGen-ed December 19, 2014 at 07:50:21 AM by AutoGen 5.18.5pre4
* From the definitions ntpsnmpd-opts.def
* and the template file options
*
- * Generated from AutoOpts 35:0:10 templates.
+ * 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
@@ -15,12 +15,27 @@
* users discretion, the BSD license. See the AutoOpts and/or libopts sources
* for details.
*
- * This source file is copyrighted and licensed under the following terms:
+ * The ntpsnmpd program is copyrighted and licensed
+ * under the following terms:
+ *
+ * Copyright (C) 1970-2014 The University of Delaware, 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>
*
- * see html/copyright.html
- *
+ * 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 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
@@ -31,22 +46,22 @@
#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 143360
+#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:
+/**
+ * Enumeration of each option type for ntpsnmpd
*/
typedef enum {
INDEX_OPT_NOFORK = 0,
@@ -58,41 +73,61 @@ typedef enum {
INDEX_OPT_SAVE_OPTS = 6,
INDEX_OPT_LOAD_OPTS = 7
} teOptIndex;
-
+/** count of all options for ntpsnmpd */
#define OPTION_CT 8
-#define NTPSNMPD_VERSION "4.2.6p5"
-#define NTPSNMPD_FULL_VERSION "ntpsnmpd 4.2.6p5"
+/** ntpsnmpd version */
+#define NTPSNMPD_VERSION "4.2.8"
+/** Full ntpsnmpd version text */
+#define NTPSNMPD_FULL_VERSION "ntpsnmpd 4.2.8"
-/*
+/**
* 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_code_t;
-/*
+ 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
@@ -114,22 +149,27 @@ typedef enum {
# 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 2
+#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 '!'
-#define VALUE_OPT_VERSION INDEX_OPT_VERSION
+/** 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) )
+ DESC(SAVE_OPTS).optArg.argString = (char const*)(a))
/*
* Interface defines not associated with particular options
*/
@@ -137,15 +177,15 @@ typedef enum {
#define ERRSTOP_OPTERR STMTS(ntpsnmpdOptions.fOptSet |= OPTPROC_ERRSTOP)
#define RESTART_OPT(n) STMTS( \
ntpsnmpdOptions.curOptIdx = (n); \
- ntpsnmpdOptions.pzCurOpt = NULL)
+ ntpsnmpdOptions.pzCurOpt = NULL )
#define START_OPT RESTART_OPT(1)
#define USAGE(c) (*ntpsnmpdOptions.pUsageProc)(&ntpsnmpdOptions, c)
-/* extracted from opthead.tlib near line 451 */
#ifdef __cplusplus
extern "C" {
#endif
+
/* * * * * *
*
* Declare the ntpsnmpd option descriptor.
@@ -155,6 +195,17 @@ 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);
@@ -188,4 +239,5 @@ static inline char* aoGetsText(char const* pz) {
}
#endif
#endif /* AUTOOPTS_NTPSNMPD_OPTS_H_GUARD */
+
/* ntpsnmpd-opts.h ends here */
diff --git a/ntpsnmpd/ntpsnmpd-opts.texi b/ntpsnmpd/ntpsnmpd-opts.texi
deleted file mode 100644
index 06e6bdb6b137..000000000000
--- a/ntpsnmpd/ntpsnmpd-opts.texi
+++ /dev/null
@@ -1,82 +0,0 @@
-@node ntpsnmpd Invocation
-@section Invoking ntpsnmpd
-@pindex ntpsnmpd
-@cindex NTP SNMP MIB agent
-@ignore
-#
-# EDIT THIS FILE WITH CAUTION (ntpsnmpd-opts.texi)
-#
-# It has been AutoGen-ed December 24, 2011 at 06:34:39 PM by AutoGen 5.12
-# From the definitions ntpsnmpd-opts.def
-# and the template file aginfo.tpl
-@end ignore
-This program has no explanation.
-
-
-
-This section was generated by @strong{AutoGen},
-the aginfo template and the option descriptions for the @command{ntpsnmpd} program. It documents the @command{ntpsnmpd} usage text and option meanings.
-
-This software is released under a specialized copyright license.
-
-@menu
-* ntpsnmpd usage:: ntpsnmpd usage help (-?)
-* ntpsnmpd agentxsocket:: agentxsocket option
-* ntpsnmpd nofork:: nofork option (-n)
-* ntpsnmpd syslog:: syslog option (-p)
-@end menu
-
-@node ntpsnmpd usage
-@subsection ntpsnmpd usage help (-?)
-@cindex ntpsnmpd usage
-
-This is the automatically generated usage text for ntpsnmpd:
-
-@exampleindent 0
-@example
-ntpsnmpd - NTP SNMP MIB agent - Ver. 4.2.6p5
-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.
-[<transport-specifier>:]<transport-address>
-The default is the Unix Domain socket "unix:/var/agentx/master". Another common alternative is tcp:localhost:705.
-
-@node ntpsnmpd nofork
-@subsection nofork option (-n)
-@cindex ntpsnmpd-nofork
-
-This is the ``do not fork'' option.
-
-
-@node ntpsnmpd syslog
-@subsection syslog option (-p)
-@cindex ntpsnmpd-syslog
-
-This is the ``log to syslog()'' option.
diff --git a/ntpsnmpd/ntpsnmpd.1 b/ntpsnmpd/ntpsnmpd.1
deleted file mode 100644
index 7fac938b9faf..000000000000
--- a/ntpsnmpd/ntpsnmpd.1
+++ /dev/null
@@ -1,87 +0,0 @@
-.TH NTPSNMPD 1 2011-12-24 "( 4.2.6p5)" "Programmer's Manual"
-.\" EDIT THIS FILE WITH CAUTION (ntpsnmpd.1)
-.\"
-.\" It has been AutoGen-ed December 24, 2011 at 06:34:39 PM by AutoGen 5.12
-.\" From the definitions ntpsnmpd-opts.def
-.\" and the template file agman1.tpl
-.\"
-.SH NAME
-ntpsnmpd \- NTP SNMP MIB agent
-.SH SYNOPSIS
-.B ntpsnmpd
-.\" Mixture of short (flag) options and long options
-.RB [ \-\fIflag\fP " [\fIvalue\fP]]... [" \--\fIopt-name\fP " [[=| ]\fIvalue\fP]]..."
-.PP
-All arguments must be options.
-.SH "DESCRIPTION"
-This manual page briefly documents the \fBntpsnmpd\fP command.
-Its description is not documented.
-.SH OPTIONS
-.TP
-.BR \-n ", " \--nofork
-Do not fork.
-.sp
-
-.TP
-.BR \-p ", " \--syslog
-Log to syslog().
-.sp
-
-.TP
-.BR \--agentxsocket "=\fIstring\fP"
-The socket address ntpsnmpd uses to connect to net-snmpd.
-The default \fIstring\fP for this option is:
-.ti +4
- unix:/var/agentx/master
-.sp
-[<transport-specifier>:]<transport-address>
-The default is the Unix Domain socket "unix:/var/agentx/master". Another common alternative is tcp:localhost:705.
-.TP
-.BR \-? , " \--help"
-Display extended usage information and exit.
-.TP
-.BR \-! , " \--more-help"
-Extended usage information passed thru pager.
-.TP
-.BR \-> " [\fIrcfile\fP]," " \--save-opts" "[=\fIrcfile\fP]"
-Save the option state to \fIrcfile\fP. The default is the \fIlast\fP
-configuration file listed in the \fBOPTION PRESETS\fP section, below.
-.TP
-.BR \-< " \fIrcfile\fP," " \--load-opts" "=\fIrcfile\fP," " \--no-load-opts"
-Load options from \fIrcfile\fP.
-The \fIno-load-opts\fP form will disable the loading
-of earlier RC/INI files. \fI--no-load-opts\fP is handled early,
-out of order.
-.TP
-.BR \- " [{\fIv|c|n\fP}]," " \--version" "[=\fI{v|c|n}\fP]"
-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.
-.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 AUTHOR
-David L. Mills and/or others
-.br
-Please send bug reports to: http://bugs.ntp.org, bugs@ntp.org
-
-.PP
-.nf
-.na
-see html/copyright.html
-
-.fi
-.ad
-.PP
-This manual page was \fIAutoGen\fP-erated from the \fBntpsnmpd\fP
-option definitions.
diff --git a/ntpsnmpd/ntpsnmpd.1ntpsnmpdman b/ntpsnmpd/ntpsnmpd.1ntpsnmpdman
new file mode 100644
index 000000000000..c1880b7ec40b
--- /dev/null
+++ b/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 "19 Dec 2014" "4.2.8" "User Commands"
+.\"
+.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-FOaywh/ag-ROaqvh)
+.\"
+.\" It has been AutoGen-ed December 19, 2014 at 07:50: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) 1970-2014 The University of Delaware 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/ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc b/ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc
new file mode 100644
index 000000000000..ce76dc14f5d0
--- /dev/null
+++ b/ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc
@@ -0,0 +1,144 @@
+.Dd December 19 2014
+.Dt NTPSNMPD 1ntpsnmpdmdoc User Commands
+.Os
+.\" EDIT THIS FILE WITH CAUTION (ntpsnmpd-opts.mdoc)
+.\"
+.\" It has been AutoGen-ed December 19, 2014 at 07:50: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) 1970\-2014 The University of Delaware 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/ntpsnmpd/ntpsnmpd.c b/ntpsnmpd/ntpsnmpd.c
index 278d5a86e170..d96ad3af453b 100644
--- a/ntpsnmpd/ntpsnmpd.c
+++ b/ntpsnmpd/ntpsnmpd.c
@@ -85,7 +85,7 @@ main (int argc, char **argv) {
init_agent("ntpsnmpd");
/* Try to connect to ntpd */
- if ( ntpq_openhost("localhost") == 0 )
+ if ( ntpq_openhost("localhost", 0) == 0 )
{
fprintf(stderr, "Error: Could not connect to ntpd. Aborting.\n");
exit(1);
diff --git a/ntpsnmpd/ntpsnmpd.html b/ntpsnmpd/ntpsnmpd.html
new file mode 100644
index 000000000000..974b536e5d25
--- /dev/null
+++ b/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:&nbsp;<a rel="next" accesskey="n" href="#ntpsnmpd-Description">ntpsnmpd Description</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#dir">(dir)</a>,
+Up:&nbsp;<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.8 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:&nbsp;<a rel="next" accesskey="n" href="#Usage">Usage</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#Top">Top</a>,
+Up:&nbsp;<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:&nbsp;<a rel="previous" accesskey="p" href="#ntpsnmpd-Description">ntpsnmpd Description</a>,
+Up:&nbsp;<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/ntpsnmpd/ntpsnmpd.man.in b/ntpsnmpd/ntpsnmpd.man.in
new file mode 100644
index 000000000000..da48b668e110
--- /dev/null
+++ b/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@ "19 Dec 2014" "4.2.8" "User Commands"
+.\"
+.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-FOaywh/ag-ROaqvh)
+.\"
+.\" It has been AutoGen-ed December 19, 2014 at 07:50: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) 1970-2014 The University of Delaware 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/ntpsnmpd/ntpsnmpd.mdoc.in b/ntpsnmpd/ntpsnmpd.mdoc.in
new file mode 100644
index 000000000000..d85df74e59c6
--- /dev/null
+++ b/ntpsnmpd/ntpsnmpd.mdoc.in
@@ -0,0 +1,144 @@
+.Dd December 19 2014
+.Dt NTPSNMPD @NTPSNMPD_MS@ User Commands
+.Os
+.\" EDIT THIS FILE WITH CAUTION (ntpsnmpd-opts.mdoc)
+.\"
+.\" It has been AutoGen-ed December 19, 2014 at 07:50: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) 1970\-2014 The University of Delaware 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/ntpsnmpd/ntpsnmpd.texi b/ntpsnmpd/ntpsnmpd.texi
new file mode 100644
index 000000000000..69355967012d
--- /dev/null
+++ b/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?)