---
+* [Bug 1512] ntpsnmpd should connect to net-snmpd via a unix-domain
+ socket by default. Provide a command-line 'socket name' option.
* [Bug 1538] update refclock_nmea.c's call to getprotobyname().
---
/*
* EDIT THIS FILE WITH CAUTION (ntpsnmpd-opts.c)
*
- * It has been AutoGen-ed April 27, 2010 at 02:52:13 AM by AutoGen 5.10
+ * It has been AutoGen-ed April 29, 2010 at 07:33:02 AM by AutoGen 5.10
* From the definitions ntpsnmpd-opts.def
* and the template file options
*
tSCC zSyslog_Name[] = "syslog";
#define SYSLOG_FLAGS (OPTST_DISABLED)
+/*
+ * Agentxsocket option description:
+ */
+tSCC zAgentxsocketText[] =
+ "The socket address ntpsnmpd uses to connect to net-snmpd";
+tSCC zAgentxsocket_NAME[] = "AGENTXSOCKET";
+tSCC zAgentxsocket_Name[] = "agentxsocket";
+tSCC zAgentxsocketDefaultArg[] = "unix:/var/agentx/master";
+#define AGENTXSOCKET_FLAGS (OPTST_DISABLED \
+ | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
+
/*
* Help/More_Help/Version option descriptions:
*/
/* desc, NAME, name */ zSyslogText, zSyslog_NAME, zSyslog_Name,
/* disablement strs */ NULL, NULL },
+ { /* entry idx, value */ 2, VALUE_OPT_AGENTXSOCKET,
+ /* equiv idx, value */ 2, VALUE_OPT_AGENTXSOCKET,
+ /* equivalenced to */ NO_EQUIVALENT,
+ /* min, max, act ct */ 0, 1, 0,
+ /* opt state flags */ AGENTXSOCKET_FLAGS, 0,
+ /* last opt argumnt */ { zAgentxsocketDefaultArg },
+ /* arg list/cookie */ NULL,
+ /* must/cannot opts */ NULL, NULL,
+ /* option proc */ NULL,
+ /* desc, NAME, name */ zAgentxsocketText, zAgentxsocket_NAME, zAgentxsocket_Name,
+ /* disablement strs */ NULL, NULL },
+
{ /* entry idx, value */ INDEX_OPT_VERSION, VALUE_OPT_VERSION,
/* equiv idx value */ NO_EQUIVALENT, 0,
/* equivalenced to */ NO_EQUIVALENT,
tSCC zPROGNAME[] = "NTPSNMPD";
tSCC zUsageTitle[] =
"ntpsnmpd - NTP SNMP MIB agent - Ver. 4.2.6p2-RC2\n\
-USAGE: %s [ -<flag> | --<name> ]...\n";
+USAGE: %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]...\n";
tSCC zRcName[] = ".ntprc";
tSCC* apzHomeList[] = {
"$HOME",
#define zExplain NULL
#define zDetail NULL
tSCC zFullVersion[] = NTPSNMPD_FULL_VERSION;
-/* extracted from /usr/local/gnu/share/autogen/optcode.tpl near line 495 */
+/* extracted from /usr/local/share/autogen/optcode.tpl near line 495 */
#if defined(ENABLE_NLS)
# define OPTPROC_BASE OPTPROC_TRANSLATE
NO_EQUIVALENT, /* '-#' option index */
NO_EQUIVALENT /* index of default opt */
},
- 7 /* full option count */, 2 /* user option count */,
+ 8 /* full option count */, 3 /* user option count */,
ntpsnmpd_full_usage, ntpsnmpd_short_usage,
NULL, NULL
};
(void)pOptions;
USAGE( EXIT_SUCCESS );
}
-/* extracted from /usr/local/gnu/share/autogen/optmain.tpl near line 109 */
+/* extracted from /usr/local/share/autogen/optmain.tpl near line 109 */
#if defined(TEST_NTPSNMPD_OPTS) /* TEST MAIN PROCEDURE: */
return res;
}
#endif /* defined TEST_NTPSNMPD_OPTS */
-/* extracted from /usr/local/gnu/share/autogen/optcode.tpl near line 627 */
+/* extracted from /usr/local/share/autogen/optcode.tpl near line 627 */
#if ENABLE_NLS
#include <stdio.h>
doc = <<- _EndOfDoc_
_EndOfDoc_;
};
+
+flag = {
+ name = agentXSocket;
+/* value = x; */
+ arg-type = string;
+ arg-default = "unix:/var/agentx/master";
+ descrip = "The socket address ntpsnmpd uses to connect to net-snmpd";
+ doc = <<- _EndOfDoc_
+ [<transport-specifier>:]<transport-address>
+ The default is the Unix Domain socket "unix:/var/agentx/master". Another common alternative is tcp:localhost:705.
+ _EndOfDoc_;
+};
/*
* EDIT THIS FILE WITH CAUTION (ntpsnmpd-opts.h)
*
- * It has been AutoGen-ed April 27, 2010 at 02:52:13 AM by AutoGen 5.10
+ * It has been AutoGen-ed April 29, 2010 at 07:33:02 AM by AutoGen 5.10
* From the definitions ntpsnmpd-opts.def
* and the template file options
*
* Enumeration of each option:
*/
typedef enum {
- INDEX_OPT_NOFORK = 0,
- INDEX_OPT_SYSLOG = 1,
- INDEX_OPT_VERSION = 2,
- INDEX_OPT_HELP = 3,
- INDEX_OPT_MORE_HELP = 4,
- INDEX_OPT_SAVE_OPTS = 5,
- INDEX_OPT_LOAD_OPTS = 6
+ INDEX_OPT_NOFORK = 0,
+ INDEX_OPT_SYSLOG = 1,
+ INDEX_OPT_AGENTXSOCKET = 2,
+ INDEX_OPT_VERSION = 3,
+ INDEX_OPT_HELP = 4,
+ INDEX_OPT_MORE_HELP = 5,
+ INDEX_OPT_SAVE_OPTS = 6,
+ INDEX_OPT_LOAD_OPTS = 7
} teOptIndex;
-#define OPTION_CT 7
+#define OPTION_CT 8
#define NTPSNMPD_VERSION "4.2.6p2-RC2"
#define NTPSNMPD_FULL_VERSION "ntpsnmpd - NTP SNMP MIB agent - Ver. 4.2.6p2-RC2"
# warning undefining SYSLOG due to option name conflict
# undef SYSLOG
# endif
+# ifdef AGENTXSOCKET
+# warning undefining AGENTXSOCKET due to option name conflict
+# undef AGENTXSOCKET
+# endif
#else /* NO_OPTION_NAME_WARNINGS */
# undef NOFORK
# undef SYSLOG
+# undef AGENTXSOCKET
#endif /* NO_OPTION_NAME_WARNINGS */
/* * * * * *
*/
#define VALUE_OPT_NOFORK 'n'
#define VALUE_OPT_SYSLOG 'p'
+#define VALUE_OPT_AGENTXSOCKET 2
#define VALUE_OPT_HELP '?'
#define VALUE_OPT_MORE_HELP '!'
#define VALUE_OPT_VERSION INDEX_OPT_VERSION
ntpsnmpdOptions.pzCurOpt = NULL )
#define START_OPT RESTART_OPT(1)
#define USAGE(c) (*ntpsnmpdOptions.pUsageProc)( &ntpsnmpdOptions, c )
-/* extracted from /usr/local/gnu/share/autogen/opthead.tpl near line 409 */
+/* extracted from /usr/local/share/autogen/opthead.tpl near line 409 */
/* * * * * *
*
#
# EDIT THIS FILE WITH CAUTION (ntpsnmpd-opts.texi)
#
-# It has been AutoGen-ed April 27, 2010 at 02:52:14 AM by AutoGen 5.10
+# It has been AutoGen-ed April 29, 2010 at 07:33:08 AM by AutoGen 5.10
# From the definitions ntpsnmpd-opts.def
# and the template file aginfo.tpl
@end ignore
@menu
* ntpsnmpd usage:: ntpsnmpd usage help (-?)
+* ntpsnmpd agentxsocket:: agentxsocket option
* ntpsnmpd nofork:: nofork option (-n)
* ntpsnmpd syslog:: syslog option (-p)
@end menu
@exampleindent 0
@example
-ntpsnmpd is unavailable - no --help
+ntpsnmpd - NTP SNMP MIB agent - Ver. 4.2.6p2-RC2
+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 /a/etc/amd.stage/thump2-g3/export/ntp/home/stenn/.ntprc
+ - reading file /a/etc/amd.stage/thump2-g3/export/ntp/home/stenn/ntp-stable-1512-38/ntpsnmpd/.ntprc
+ - examining environment variables named NTPSNMPD_*
+
+please send bug reports to: http://bugs.ntp.org, bugs@@ntp.org
@end example
@exampleindent 4
This is the ``log to syslog()'' option.
+
+@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.
-.TH NTPSNMPD 1 2010-04-27 "( 4.2.6p2-RC2)" "Programmer's Manual"
+.TH NTPSNMPD 1 2010-04-29 "( 4.2.6p2-RC2)" "Programmer's Manual"
.\" EDIT THIS FILE WITH CAUTION (ntpsnmpd.1)
.\"
-.\" It has been AutoGen-ed April 27, 2010 at 02:52:14 AM by AutoGen 5.10
+.\" It has been AutoGen-ed April 29, 2010 at 07:33:08 AM by AutoGen 5.10
.\" From the definitions ntpsnmpd-opts.def
.\" and the template file agman1.tpl
.\"
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.
/* Set AgentX socket interface */
netsnmp_ds_set_string(NETSNMP_DS_APPLICATION_ID,
- NETSNMP_DS_AGENT_X_SOCKET, "tcp:localhost:705");
+ NETSNMP_DS_AGENT_X_SOCKET, OPT_ARG( AGENTXSOCKET ));
init_agent("ntpsnmpd");