]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
Use the same "debug" mechanism that the rest of NTP uses
authorHarlan Stenn <stenn@ntp.org>
Sun, 9 Jan 2011 06:52:29 +0000 (06:52 +0000)
committerHarlan Stenn <stenn@ntp.org>
Sun, 9 Jan 2011 06:52:29 +0000 (06:52 +0000)
bk: 4d295b2dfemY1lhIEHU5O8MhIz3EtA

12 files changed:
sntp/configure.ac
sntp/crypto.c
sntp/kod_management.c
sntp/main.c
sntp/main.h
sntp/networking.c
sntp/sntp-opts.c
sntp/sntp-opts.def
sntp/sntp-opts.h
sntp/sntp-opts.texi
sntp/sntp.1
sntp/sntp.html

index 3d1137c697ced239baf677155de3c19b1e4a00b4..46c0adf815ad2eb3b09fbcaf5634ee457e385ba6 100644 (file)
@@ -669,6 +669,22 @@ case "$isc_cv_platform_havesalen" in
         [struct sockaddr has sa_len?])
 esac
 
+AC_MSG_CHECKING([if we're including sntp debugging code])
+AC_ARG_ENABLE(
+    [debugging],
+    [AS_HELP_STRING(
+        [--enable-debugging],
+        [+ include sntp debugging code]
+    )],
+    [ans=$enableval],
+    [ans=yes]
+)
+case "$ans" in
+ yes)
+    AC_DEFINE([DEBUG], [1], [Enable sntp debugging code?])
+esac
+AC_MSG_RESULT([$ans])
+
 AC_ARG_ENABLE(
     [ipv6],
     [AS_HELP_STRING(
index 7a462329196962724c627f11a26c641dfa3e2ba9..b427e1fab7728eab8da7ed6fac90242474f59f58 100644 (file)
@@ -99,12 +99,12 @@ auth_init(
        char keystring[129];
 
        if (keyf == NULL) {
-               if (ENABLED_OPT(NORMALVERBOSE))
+               if (debug)
                        printf("sntp auth_init: Couldn't open key file %s for reading!\n", keyfile);
                return -1;
        }
        if (feof(keyf)) {
-               if (ENABLED_OPT(NORMALVERBOSE))
+               if (debug)
                        printf("sntp auth_init: Key file %s is empty!\n", keyfile);
                fclose(keyf);
                return -1;
index 33ea031fc6956a4fbd22555079975819120642b4..e94d14895e394c4d4bc82d467166a5b65ee0ef34 100644 (file)
@@ -191,7 +191,7 @@ kod_init_kod_db(
                return;
        }
 
-       if (ENABLED_OPT(NORMALVERBOSE))
+       if (debug)
                printf("Starting to read KoD file %s...\n", db_file);
        /* First let's see how many entries there are and check for right syntax */
 
index 6b5b70b9817c63ae0c4e656c6a0afa2ecea1772e..a03a838caefa0c4e60928afe37b5d56e07c04a50 100644 (file)
@@ -82,6 +82,11 @@ sntp_main (
        argc -= optct;
        argv += optct;
 
+#ifdef DEBUG
+       debug = DESC(DEBUG_LEVEL).optOccCt;
+       DPRINTF(1, ("%s\n", Version));
+#endif
+
        /* Initialize logging system */
        init_logging();
        if (HAVE_OPT(FILELOG))
@@ -377,7 +382,7 @@ printf("dns_cb: checking <%s>\n", hostname);
 
                                        /* Let's try using a wildcard... */
                                        ZERO(name);
-                                       AF(&name) = AF_INET;
+                                       AF(&name) = AF_INET6;
                                        SET_ADDR6N(&name, in6addr_any);
                                        SET_PORT(&name, 0);
 
@@ -490,12 +495,13 @@ ntp_cb(
 {
        struct ntp_ctx *ctx = ptr;
 
-       printf("Got an event on socket %d:%s%s%s%s [%s%s] <%s>",
+       if (debug)
+           printf("Got an event on socket %d:%s%s%s%s [%s%s] <%s>\n",
                (int) fd,
-               (what&EV_TIMEOUT) ? " timeout" : "",
-               (what&EV_READ)    ? " read" : "",
-               (what&EV_WRITE)   ? " write" : "",
-               (what&EV_SIGNAL)  ? " signal" : "",
+               (what & EV_TIMEOUT) ? " timeout" : "",
+               (what & EV_READ)    ? " read" : "",
+               (what & EV_WRITE)   ? " write" : "",
+               (what & EV_SIGNAL)  ? " signal" : "",
                (ctx->flags & CTX_BCST) ? "BCST" : "",
                (ctx->flags & CTX_UCST) ? "UCST" : "",
                ctx->name
@@ -595,7 +601,7 @@ handle_pkt (
                ref = (char *)&rpkt->refid;
                add_entry(hostname, ref);
 
-               if (ENABLED_OPT(NORMALVERBOSE))
+               if (debug)
                        printf("sntp handle_pkt: Received KOD packet with code: %c%c%c%c from %s, demobilizing all connections\n",
                                   ref[0], ref[1], ref[2], ref[3],
                                   hostname);
@@ -609,7 +615,7 @@ handle_pkt (
                break;
 
            case 1:
-               if (ENABLED_OPT(NORMALVERBOSE)) {
+               if (debug) {
                        getnameinfo(host->ai_addr, host->ai_addrlen, addr_buf,
                                sizeof(addr_buf), NULL, 0, NI_NUMERICHOST);
                        printf("sntp handle_pkt: Received %i bytes from %s\n",
@@ -726,7 +732,7 @@ offset_calculation (
        *offset = (t21 + t34) / 2.;
        delta = t21 - t34;
 
-       if (ENABLED_OPT(NORMALVERBOSE))
+       if (debug)
                printf("sntp offset_calculation:\tt21: %.6f\t\t t34: %.6f\n\t\tdelta: %.6f\t offset: %.6f\n",
                           t21, t34, delta, *offset);
 }
index e6965e17286ab753d5ebc6d86c799f6910afebff..ab41350331d44f2265f09a9d01203fef6bc20ff2 100644 (file)
@@ -4,6 +4,7 @@
 #include <l_stdlib.h>
 #include <ntp_fp.h>
 #include <ntp.h>
+#include <ntp_debug.h>
 #include <ntp_stdlib.h>
 #include <ntp_unixtime.h>
 #include <isc/result.h>
index 0b888d936e75d2708793082c6600aa2af804d623..5ae94f15f4dca55f98d0e425ec56c5540afb95d0 100644 (file)
@@ -92,7 +92,7 @@ create_socket (
 {
        *rsock = socket(AF(dest), SOCK_DGRAM, 0);
 
-       if (-1 == *rsock && ENABLED_OPT(NORMALVERBOSE))
+       if (-1 == *rsock && debug)
                printf("Failed to create UDP socket with family %d\n", AF(dest));
 }
 
@@ -113,7 +113,7 @@ sendpkt (
        pkt_output(pkt, len, stdout);
 #endif
 
-       if (ENABLED_OPT(NORMALVERBOSE)) {
+       if (debug) {
                printf("sntp sendpkt: Sending packet to %s ...\n", sptoa(dest));
        }
 
@@ -125,7 +125,7 @@ sendpkt (
                if (errno != EWOULDBLOCK && errno != ENOBUFS) {
                        /* oh well */
                }
-       } else if (ENABLED_OPT(NORMALVERBOSE)) {
+       } else if (debug) {
                printf("Packet sent.\n");
        }
 }
@@ -199,7 +199,7 @@ recv_bcst_data (
        setsockopt(rsock, SOL_SOCKET, SO_REUSEADDR, &btrue, sizeof(btrue));
        if (IS_IPV4(sas)) {
                if (bind(rsock, &sas->sa, SOCKLEN(sas)) < 0) {
-                       if (ENABLED_OPT(NORMALVERBOSE))
+                       if (debug)
                                printf("sntp recv_bcst_data: Couldn't bind() address %s.\n",
                                       sptoa(sas));
                }
@@ -212,14 +212,14 @@ recv_bcst_data (
                mdevadr.imr_multiaddr.s_addr = NSRCADR(sas); 
                mdevadr.imr_interface.s_addr = htonl(INADDR_ANY);
                if (mdevadr.imr_multiaddr.s_addr == -1) {
-                       if (ENABLED_OPT(NORMALVERBOSE)) {
+                       if (debug) {
                                printf("sntp recv_bcst_data: %s is not a broad-/multicast address, aborting...\n",
                                       sptoa(sas));
                        }
                        return BROADCAST_FAILED;
                }
                if (setsockopt(rsock, IPPROTO_IP, IP_ADD_MEMBERSHIP, &mdevadr, sizeof(mdevadr)) < 0) {
-                       if (ENABLED_OPT(NORMALVERBOSE)) {
+                       if (debug) {
                                buf = ss_to_str(sas);
                                printf("sntp recv_bcst_data: Couldn't add IP membership for %s\n", buf);
                                free(buf);
@@ -230,7 +230,7 @@ recv_bcst_data (
 #ifdef ISC_PLATFORM_HAVEIPV6
        else if (IS_IPV6(sas)) {
                if (bind(rsock, &sas->sa, SOCKLEN(sas)) < 0) {
-                       if (ENABLED_OPT(NORMALVERBOSE))
+                       if (debug)
                                printf("sntp recv_bcst_data: Couldn't bind() address.\n");
                }
 #ifdef INCLUDE_IPV6_MULTICAST_SUPPORT
@@ -241,7 +241,7 @@ recv_bcst_data (
                memset(&mdevadr6, 0, sizeof(mdevadr6));
                mdevadr6.ipv6mr_multiaddr = SOCK_ADDR6(sas);
                if (!IN6_IS_ADDR_MULTICAST(&mdevadr6.ipv6mr_multiaddr)) {
-                       if (ENABLED_OPT(NORMALVERBOSE)) {
+                       if (debug) {
                                buf = ss_to_str(sas); 
                                printf("sntp recv_bcst_data: %s is not a broad-/multicast address, aborting...\n", buf);
                                free(buf);
@@ -250,7 +250,7 @@ recv_bcst_data (
                }
                if (setsockopt(rsock, IPPROTO_IPV6, IPV6_JOIN_GROUP,
                               &mdevadr6, sizeof(mdevadr6)) < 0) {
-                       if (ENABLED_OPT(NORMALVERBOSE)) {
+                       if (debug) {
                                buf = ss_to_str(sas); 
                                printf("sntp recv_bcst_data: Couldn't join group for %s\n", buf);
                                free(buf);
@@ -269,12 +269,12 @@ recv_bcst_data (
        rdy_socks = select(rsock + 1, &bcst_fd, 0, 0, &timeout_tv);
        switch (rdy_socks) {
            case -1: 
-               if (ENABLED_OPT(NORMALVERBOSE)
+               if (debug
                        perror("sntp recv_bcst_data: select()");
                return BROADCAST_FAILED;
                break;
            case 0:
-               if (ENABLED_OPT(NORMALVERBOSE))
+               if (debug)
                        printf("sntp recv_bcst_data: select() reached timeout (%u sec), aborting.\n", 
                               (unsigned)timeout_tv.tv_sec);
                return BROADCAST_FAILED;
@@ -285,7 +285,7 @@ recv_bcst_data (
                break;
        }
        if (recv_bytes == -1) {
-               if (ENABLED_OPT(NORMALVERBOSE))
+               if (debug)
                        perror("sntp recv_bcst_data: recvfrom:");
                recv_bytes = BROADCAST_FAILED;
        }
@@ -333,7 +333,7 @@ process_pkt (
         */
        if (pkt_len < LEN_PKT_NOMAC || (pkt_len & 3) != 0) {
 unusable:
-               if (ENABLED_OPT(NORMALVERBOSE))
+               if (debug)
                        printf("sntp %s: Funny packet length: %i. Discarding package.\n", func_name, pkt_len);
                return PACKET_UNUSEABLE;
        }
@@ -381,7 +381,7 @@ unusable:
                        break;
                }
                /* Yay! Things worked out! */
-               if (ENABLED_OPT(NORMALVERBOSE)) {
+               if (debug) {
                        char *hostname = ss_to_str(sas);
                        printf("sntp %s: packet received from %s successfully authenticated using key id %i.\n",
                                func_name, hostname, key_id);
@@ -396,7 +396,7 @@ unusable:
        if (!is_authentic) {
                if (ENABLED_OPT(AUTHENTICATION)) {
                        /* We want a authenticated packet */
-                       if (ENABLED_OPT(NORMALVERBOSE)) {
+                       if (debug) {
                                char *hostname = ss_to_str(sas);
                                printf("sntp %s: packet received from %s is not authentic. Will discard it.\n",
                                        func_name, hostname);
@@ -408,7 +408,7 @@ unusable:
                ** We don't know if the user wanted authentication so let's
                ** use it anyways
                */
-               if (ENABLED_OPT(NORMALVERBOSE)) {
+               if (debug) {
                        char *hostname = ss_to_str(sas);
 
                        printf("sntp %s: packet received from %s is not authentic. Authentication not enforced.\n",
@@ -419,7 +419,7 @@ unusable:
        /* Check for server's ntp version */
        if (PKT_VERSION(rpkt->li_vn_mode) < NTP_OLDVERSION ||
                PKT_VERSION(rpkt->li_vn_mode) > NTP_VERSION) {
-               if (ENABLED_OPT(NORMALVERBOSE))
+               if (debug)
                        printf("sntp %s: Packet shows wrong version (%i)\n",
                                func_name, PKT_VERSION(rpkt->li_vn_mode));
                return SERVER_UNUSEABLE;
@@ -427,7 +427,7 @@ unusable:
        /* We want a server to sync with */
        if (PKT_MODE(rpkt->li_vn_mode) != mode &&
            PKT_MODE(rpkt->li_vn_mode) != MODE_PASSIVE) {
-               if (ENABLED_OPT(NORMALVERBOSE))
+               if (debug)
                        printf("sntp %s: mode %d stratum %i\n", func_name, 
                               PKT_MODE(rpkt->li_vn_mode), rpkt->stratum);
                return SERVER_UNUSEABLE;
@@ -436,11 +436,11 @@ unusable:
        if (STRATUM_PKT_UNSPEC == rpkt->stratum) {
                char *ref_char;
 
-               if (ENABLED_OPT(NORMALVERBOSE))
+               if (debug)
                        printf("sntp %s: Stratum unspecified, going to check for KOD (stratum: %i)\n", 
                                func_name, rpkt->stratum);
                ref_char = (char *) &rpkt->refid;
-               if (ENABLED_OPT(NORMALVERBOSE))
+               if (debug)
                        printf("sntp %s: Packet refid: %c%c%c%c\n", func_name,
                               ref_char[0], ref_char[1], ref_char[2], ref_char[3]);
                /* If it's a KOD packet we'll just use the KOD information */
@@ -459,7 +459,7 @@ unusable:
        }
        /* If the server is not synced it's not really useable for us */
        if (LEAP_NOTINSYNC == PKT_LEAP(rpkt->li_vn_mode)) {
-               if (ENABLED_OPT(NORMALVERBOSE)
+               if (debug
                        printf("sntp %s: Server not in sync, skipping this server\n", func_name);
                return SERVER_UNUSEABLE;
        }
@@ -475,7 +475,7 @@ unusable:
        l_fp_output(&spkt->xmt, stdout);
 #endif
        if (mode != MODE_BROADCAST && !L_ISEQU(&rpkt->org, &spkt->xmt)) {
-               if (ENABLED_OPT(NORMALVERBOSE))
+               if (debug)
                        printf("sntp process_pkt: pkt.org and peer.xmt differ\n");
                return PACKET_UNUSEABLE;
        }
@@ -534,12 +534,12 @@ recvpkt (
        rdy_socks = select(rsock + 1, &recv_fd, 0, 0, &timeout_tv);
        switch (rdy_socks) {
            case -1: 
-               if (ENABLED_OPT(NORMALVERBOSE)
+               if (debug
                        perror("sntp recvpkt: select()");
                return PACKET_UNUSEABLE;
                break;
            case 0:
-               if (ENABLED_OPT(NORMALVERBOSE))
+               if (debug)
                        printf("sntp recvpkt: select() reached timeout (%u sec), aborting.\n", 
                               (unsigned)timeout_tv.tv_sec);
                return PACKET_UNUSEABLE;
index 9e427c216a5e50e2fcec0835860a0e43d126c32a..d7450a62d76ed89fe108015ca76d1bd1450cd82a 100644 (file)
@@ -1,7 +1,7 @@
 /*  
  *  EDIT THIS FILE WITH CAUTION  (sntp-opts.c)
  *  
- *  It has been AutoGen-ed  January  8, 2011 at 09:34:22 AM by AutoGen 5.11.6pre7
+ *  It has been AutoGen-ed  January  9, 2011 at 06:03:48 AM by AutoGen 5.11.6pre7
  *  From the definitions    sntp-opts.def
  *  and the template file   options
  *
@@ -45,6 +45,15 @@ tSCC zCopyrightNotice[24] =
 
 extern tUsageProc optionUsage;
 
+/*
+ *  global included definitions
+ */
+#ifdef __windows
+  extern int atoi(const char*);
+#else
+# include <stdlib.h>
+#endif
+
 #ifndef NULL
 #  define NULL 0
 #endif
@@ -55,6 +64,25 @@ extern tUsageProc optionUsage;
 #  define  EXIT_FAILURE 1
 #endif
 
+/*
+ *  Debug_Level option description:
+ */
+static char const zDebug_LevelText[] =
+        "Increase output debug message level";
+static char const zDebug_Level_NAME[]        = "DEBUG_LEVEL";
+static char const zDebug_Level_Name[]        = "debug-level";
+#define DEBUG_LEVEL_FLAGS       (OPTST_DISABLED)
+
+/*
+ *  Set_Debug_Level option description:
+ */
+static char const zSet_Debug_LevelText[] =
+        "Set the output debug message level";
+static char const zSet_Debug_Level_NAME[]    = "SET_DEBUG_LEVEL";
+static char const zSet_Debug_Level_Name[]    = "set-debug-level";
+#define SET_DEBUG_LEVEL_FLAGS       (OPTST_DISABLED \
+        | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
+
 /*
  *  Ipv4 option description with
  *  "Must also have options" and "Incompatible options":
@@ -81,15 +109,6 @@ static const int
     INDEX_OPT_IPV4, NO_EQUIVALENT };
 #define IPV6_FLAGS       (OPTST_DISABLED)
 
-/*
- *  Normalverbose option description:
- */
-static char const zNormalverboseText[] =
-        "Normal verbose";
-static char const zNormalverbose_NAME[]      = "NORMALVERBOSE";
-static char const zNormalverbose_Name[]      = "normalverbose";
-#define NORMALVERBOSE_FLAGS       (OPTST_DISABLED)
-
 /*
  *  Kod option description:
  */
@@ -235,6 +254,12 @@ static char const zNotLoad_Opts_Pfx[]  = "no";
 static tOptProc
     doUsageOpt;
 
+/*
+ *  #define map the "normal" callout procs to the test ones...
+ */
+#define SET_DEBUG_LEVEL_OPT_PROC optionStackArg
+
+
 #else /* NOT defined TEST_SNTP_OPTS */
 /*
  *  When not under test, there are different procs to use
@@ -245,7 +270,14 @@ extern tOptProc
     optionStackArg,      optionTimeVal,       optionUnstackArg,
     optionVersionStderr;
 static tOptProc
-    doUsageOpt;
+    doOptSet_Debug_Level, doUsageOpt;
+
+/*
+ *  #define map the "normal" callout procs
+ */
+#define SET_DEBUG_LEVEL_OPT_PROC doOptSet_Debug_Level
+
+#define SET_DEBUG_LEVEL_OPT_PROC doOptSet_Debug_Level
 #endif /* defined(TEST_SNTP_OPTS) */
 #ifdef TEST_SNTP_OPTS
 # define DOVERPROC optionVersionStderr
@@ -258,44 +290,56 @@ static tOptProc
  *  Define the Sntp Option Descriptions.
  */
 static tOptDesc optDesc[ OPTION_CT ] = {
-  {  /* entry idx, value */ 0, VALUE_OPT_IPV4,
-     /* equiv idx, value */ 0, VALUE_OPT_IPV4,
+  {  /* entry idx, value */ 0, VALUE_OPT_DEBUG_LEVEL,
+     /* equiv idx, value */ 0, VALUE_OPT_DEBUG_LEVEL,
      /* equivalenced to  */ NO_EQUIVALENT,
-     /* min, max, act ct */ 0, 1, 0,
-     /* opt state flags  */ IPV4_FLAGS, 0,
+     /* min, max, act ct */ 0, NOLIMIT, 0,
+     /* opt state flags  */ DEBUG_LEVEL_FLAGS, 0,
      /* last opt argumnt */ { NULL },
      /* arg list/cookie  */ NULL,
-     /* must/cannot opts */ NULL, aIpv4CantList,
+     /* must/cannot opts */ NULL, NULL,
      /* option proc      */ NULL,
-     /* desc, NAME, name */ zIpv4Text, zIpv4_NAME, zIpv4_Name,
+     /* desc, NAME, name */ zDebug_LevelText, zDebug_Level_NAME, zDebug_Level_Name,
+     /* disablement strs */ NULL, NULL },
+
+  {  /* entry idx, value */ 1, VALUE_OPT_SET_DEBUG_LEVEL,
+     /* equiv idx, value */ 1, VALUE_OPT_SET_DEBUG_LEVEL,
+     /* equivalenced to  */ NO_EQUIVALENT,
+     /* min, max, act ct */ 0, NOLIMIT, 0,
+     /* opt state flags  */ SET_DEBUG_LEVEL_FLAGS, 0,
+     /* last opt argumnt */ { NULL },
+     /* arg list/cookie  */ NULL,
+     /* must/cannot opts */ NULL, NULL,
+     /* option proc      */ SET_DEBUG_LEVEL_OPT_PROC,
+     /* desc, NAME, name */ zSet_Debug_LevelText, zSet_Debug_Level_NAME, zSet_Debug_Level_Name,
      /* disablement strs */ NULL, NULL },
 
-  {  /* entry idx, value */ 1, VALUE_OPT_IPV6,
-     /* equiv idx, value */ 1, VALUE_OPT_IPV6,
+  {  /* entry idx, value */ 2, VALUE_OPT_IPV4,
+     /* equiv idx, value */ 2, VALUE_OPT_IPV4,
      /* equivalenced to  */ NO_EQUIVALENT,
      /* min, max, act ct */ 0, 1, 0,
-     /* opt state flags  */ IPV6_FLAGS, 0,
+     /* opt state flags  */ IPV4_FLAGS, 0,
      /* last opt argumnt */ { NULL },
      /* arg list/cookie  */ NULL,
-     /* must/cannot opts */ NULL, aIpv6CantList,
+     /* must/cannot opts */ NULL, aIpv4CantList,
      /* option proc      */ NULL,
-     /* desc, NAME, name */ zIpv6Text, zIpv6_NAME, zIpv6_Name,
+     /* desc, NAME, name */ zIpv4Text, zIpv4_NAME, zIpv4_Name,
      /* disablement strs */ NULL, NULL },
 
-  {  /* entry idx, value */ 2, VALUE_OPT_NORMALVERBOSE,
-     /* equiv idx, value */ 2, VALUE_OPT_NORMALVERBOSE,
+  {  /* entry idx, value */ 3, VALUE_OPT_IPV6,
+     /* equiv idx, value */ 3, VALUE_OPT_IPV6,
      /* equivalenced to  */ NO_EQUIVALENT,
      /* min, max, act ct */ 0, 1, 0,
-     /* opt state flags  */ NORMALVERBOSE_FLAGS, 0,
+     /* opt state flags  */ IPV6_FLAGS, 0,
      /* last opt argumnt */ { NULL },
      /* arg list/cookie  */ NULL,
-     /* must/cannot opts */ NULL, NULL,
+     /* must/cannot opts */ NULL, aIpv6CantList,
      /* option proc      */ NULL,
-     /* desc, NAME, name */ zNormalverboseText, zNormalverbose_NAME, zNormalverbose_Name,
+     /* desc, NAME, name */ zIpv6Text, zIpv6_NAME, zIpv6_Name,
      /* disablement strs */ NULL, NULL },
 
-  {  /* entry idx, value */ 3, VALUE_OPT_KOD,
-     /* equiv idx, value */ 3, VALUE_OPT_KOD,
+  {  /* entry idx, value */ 4, VALUE_OPT_KOD,
+     /* equiv idx, value */ 4, VALUE_OPT_KOD,
      /* equivalenced to  */ NO_EQUIVALENT,
      /* min, max, act ct */ 0, 1, 0,
      /* opt state flags  */ KOD_FLAGS, 0,
@@ -306,8 +350,8 @@ static tOptDesc optDesc[ OPTION_CT ] = {
      /* desc, NAME, name */ zKodText, zKod_NAME, zKod_Name,
      /* disablement strs */ NULL, NULL },
 
-  {  /* entry idx, value */ 4, VALUE_OPT_SYSLOG,
-     /* equiv idx, value */ 4, VALUE_OPT_SYSLOG,
+  {  /* entry idx, value */ 5, VALUE_OPT_SYSLOG,
+     /* equiv idx, value */ 5, VALUE_OPT_SYSLOG,
      /* equivalenced to  */ NO_EQUIVALENT,
      /* min, max, act ct */ 0, 1, 0,
      /* opt state flags  */ SYSLOG_FLAGS, 0,
@@ -318,8 +362,8 @@ static tOptDesc optDesc[ OPTION_CT ] = {
      /* desc, NAME, name */ zSyslogText, zSyslog_NAME, zSyslog_Name,
      /* disablement strs */ NULL, NULL },
 
-  {  /* entry idx, value */ 5, VALUE_OPT_FILELOG,
-     /* equiv idx, value */ 5, VALUE_OPT_FILELOG,
+  {  /* entry idx, value */ 6, VALUE_OPT_FILELOG,
+     /* equiv idx, value */ 6, VALUE_OPT_FILELOG,
      /* equivalenced to  */ NO_EQUIVALENT,
      /* min, max, act ct */ 0, 1, 0,
      /* opt state flags  */ FILELOG_FLAGS, 0,
@@ -330,8 +374,8 @@ static tOptDesc optDesc[ OPTION_CT ] = {
      /* desc, NAME, name */ zFilelogText, zFilelog_NAME, zFilelog_Name,
      /* disablement strs */ NULL, NULL },
 
-  {  /* entry idx, value */ 6, VALUE_OPT_SETTOD,
-     /* equiv idx, value */ 6, VALUE_OPT_SETTOD,
+  {  /* entry idx, value */ 7, VALUE_OPT_SETTOD,
+     /* equiv idx, value */ 7, VALUE_OPT_SETTOD,
      /* equivalenced to  */ NO_EQUIVALENT,
      /* min, max, act ct */ 0, 1, 0,
      /* opt state flags  */ SETTOD_FLAGS, 0,
@@ -342,8 +386,8 @@ static tOptDesc optDesc[ OPTION_CT ] = {
      /* desc, NAME, name */ zSettodText, zSettod_NAME, zSettod_Name,
      /* disablement strs */ NULL, NULL },
 
-  {  /* entry idx, value */ 7, VALUE_OPT_ADJTIME,
-     /* equiv idx, value */ 7, VALUE_OPT_ADJTIME,
+  {  /* entry idx, value */ 8, VALUE_OPT_ADJTIME,
+     /* equiv idx, value */ 8, VALUE_OPT_ADJTIME,
      /* equivalenced to  */ NO_EQUIVALENT,
      /* min, max, act ct */ 0, 1, 0,
      /* opt state flags  */ ADJTIME_FLAGS, 0,
@@ -354,8 +398,8 @@ static tOptDesc optDesc[ OPTION_CT ] = {
      /* desc, NAME, name */ zAdjtimeText, zAdjtime_NAME, zAdjtime_Name,
      /* disablement strs */ NULL, NULL },
 
-  {  /* entry idx, value */ 8, VALUE_OPT_BROADCAST,
-     /* equiv idx, value */ 8, VALUE_OPT_BROADCAST,
+  {  /* entry idx, value */ 9, VALUE_OPT_BROADCAST,
+     /* equiv idx, value */ 9, VALUE_OPT_BROADCAST,
      /* equivalenced to  */ NO_EQUIVALENT,
      /* min, max, act ct */ 0, 1, 0,
      /* opt state flags  */ BROADCAST_FLAGS, 0,
@@ -366,8 +410,8 @@ static tOptDesc optDesc[ OPTION_CT ] = {
      /* desc, NAME, name */ zBroadcastText, zBroadcast_NAME, zBroadcast_Name,
      /* disablement strs */ NULL, NULL },
 
-  {  /* entry idx, value */ 9, VALUE_OPT_TIMEOUT,
-     /* equiv idx, value */ 9, VALUE_OPT_TIMEOUT,
+  {  /* entry idx, value */ 10, VALUE_OPT_TIMEOUT,
+     /* equiv idx, value */ 10, VALUE_OPT_TIMEOUT,
      /* equivalenced to  */ NO_EQUIVALENT,
      /* min, max, act ct */ 0, 1, 0,
      /* opt state flags  */ TIMEOUT_FLAGS, 0,
@@ -378,8 +422,8 @@ static tOptDesc optDesc[ OPTION_CT ] = {
      /* desc, NAME, name */ zTimeoutText, zTimeout_NAME, zTimeout_Name,
      /* disablement strs */ NULL, NULL },
 
-  {  /* entry idx, value */ 10, VALUE_OPT_AUTHENTICATION,
-     /* equiv idx, value */ 10, VALUE_OPT_AUTHENTICATION,
+  {  /* entry idx, value */ 11, VALUE_OPT_AUTHENTICATION,
+     /* equiv idx, value */ 11, VALUE_OPT_AUTHENTICATION,
      /* equivalenced to  */ NO_EQUIVALENT,
      /* min, max, act ct */ 0, 1, 0,
      /* opt state flags  */ AUTHENTICATION_FLAGS, 0,
@@ -390,8 +434,8 @@ static tOptDesc optDesc[ OPTION_CT ] = {
      /* desc, NAME, name */ zAuthenticationText, zAuthentication_NAME, zAuthentication_Name,
      /* disablement strs */ NULL, NULL },
 
-  {  /* entry idx, value */ 11, VALUE_OPT_KEYFILE,
-     /* equiv idx, value */ 11, VALUE_OPT_KEYFILE,
+  {  /* entry idx, value */ 12, VALUE_OPT_KEYFILE,
+     /* equiv idx, value */ 12, VALUE_OPT_KEYFILE,
      /* equivalenced to  */ NO_EQUIVALENT,
      /* min, max, act ct */ 0, 1, 0,
      /* opt state flags  */ KEYFILE_FLAGS, 0,
@@ -491,7 +535,7 @@ It can be run interactively from the command line or as a cron job.\n\n\
 NTP and SNTP are defined by RFC 5905, which obsoletes RFC 4330 and RFC\n\
 1305.\n";
 static char const zFullVersion[] = SNTP_FULL_VERSION;
-/* extracted from /usr/local/gnu/share/autogen/optcode.tpl near line 504 */
+/* extracted from /usr/local/share/autogen/optcode.tpl near line 504 */
 
 #if defined(ENABLE_NLS)
 # define OPTPROC_BASE OPTPROC_TRANSLATE
@@ -536,7 +580,7 @@ tOptions sntpOptions = {
       NO_EQUIVALENT, /* '-#' option index */
       NO_EQUIVALENT /* index of default opt */
     },
-    17 /* full option count */, 12 /* user option count */,
+    18 /* full option count */, 13 /* user option count */,
     sntp_full_usage, sntp_short_usage,
     NULL, NULL,
     PKGDATADIR
@@ -553,7 +597,21 @@ doUsageOpt(
     (void)pOptions;
     USAGE(EXIT_SUCCESS);
 }
-/* extracted from /usr/local/gnu/share/autogen/optmain.tpl near line 107 */
+
+#if ! defined(TEST_SNTP_OPTS)
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ *
+ *   For the set-debug-level option.
+ */
+static void
+doOptSet_Debug_Level(tOptions* pOptions, tOptDesc* pOptDesc)
+{
+    /* extracted from ../include/debug-opt.def, line 27 */
+DESC(DEBUG_LEVEL).optOccCt = atoi( pOptDesc->pzLastArg );
+}
+#endif /* defined(TEST_SNTP_OPTS) */
+/* extracted from /usr/local/share/autogen/optmain.tpl near line 107 */
 
 #if defined(TEST_SNTP_OPTS) /* TEST MAIN PROCEDURE: */
 
@@ -571,7 +629,7 @@ main(int argc, char** argv)
     return res;
 }
 #endif  /* defined TEST_SNTP_OPTS */
-/* extracted from /usr/local/gnu/share/autogen/optcode.tpl near line 641 */
+/* extracted from /usr/local/share/autogen/optcode.tpl near line 641 */
 
 #if ENABLE_NLS
 #include <stdio.h>
index 78f143bf92245cdc7400fc75e6e7b53397bf788b..2a90323ee681dd24a62c375e3f90e86cb6f35187 100644 (file)
@@ -4,6 +4,7 @@ autogen definitions options;
 
 #include autogen-version.def
 #include copyright.def
+#include debug-opt.def
 
 prog-name      = "sntp";
 prog-title     = "standard SNTP program";
@@ -49,18 +50,6 @@ flag = {
 };
 
 
-flag = {
-    name      = normalverbose;
-    value     = d;
-    descrip   = "Normal verbose";
-    doc = <<-  _EndOfDoc_
-       Diagnostic messages for non-fatal errors and a limited amount of
-       tracing should be written to standard error.  Fatal ones always
-       produce a diagnostic.  This option should be set when there is a
-       suspected problem with the server, network or the source.
-       _EndOfDoc_;
-};
-
 flag = {
     name      = kod;
     value     = K;
index a6719b141992a2f070fef121d365de651be2a095..a11cba3fbedc03adef1b0ee4bdbf78b6c08ab8ef 100644 (file)
@@ -1,7 +1,7 @@
 /*  
  *  EDIT THIS FILE WITH CAUTION  (sntp-opts.h)
  *  
- *  It has been AutoGen-ed  January  8, 2011 at 09:34:22 AM by AutoGen 5.11.6pre7
+ *  It has been AutoGen-ed  January  9, 2011 at 06:03:48 AM by AutoGen 5.11.6pre7
  *  From the definitions    sntp-opts.def
  *  and the template file   options
  *
  *  Enumeration of each option:
  */
 typedef enum {
-    INDEX_OPT_IPV4            =  0,
-    INDEX_OPT_IPV6            =  1,
-    INDEX_OPT_NORMALVERBOSE   =  2,
-    INDEX_OPT_KOD             =  3,
-    INDEX_OPT_SYSLOG          =  4,
-    INDEX_OPT_FILELOG         =  5,
-    INDEX_OPT_SETTOD          =  6,
-    INDEX_OPT_ADJTIME         =  7,
-    INDEX_OPT_BROADCAST       =  8,
-    INDEX_OPT_TIMEOUT         =  9,
-    INDEX_OPT_AUTHENTICATION  = 10,
-    INDEX_OPT_KEYFILE         = 11,
-    INDEX_OPT_VERSION         = 12,
-    INDEX_OPT_HELP            = 13,
-    INDEX_OPT_MORE_HELP       = 14,
-    INDEX_OPT_SAVE_OPTS       = 15,
-    INDEX_OPT_LOAD_OPTS       = 16
+    INDEX_OPT_DEBUG_LEVEL      =  0,
+    INDEX_OPT_SET_DEBUG_LEVEL  =  1,
+    INDEX_OPT_IPV4             =  2,
+    INDEX_OPT_IPV6             =  3,
+    INDEX_OPT_KOD              =  4,
+    INDEX_OPT_SYSLOG           =  5,
+    INDEX_OPT_FILELOG          =  6,
+    INDEX_OPT_SETTOD           =  7,
+    INDEX_OPT_ADJTIME          =  8,
+    INDEX_OPT_BROADCAST        =  9,
+    INDEX_OPT_TIMEOUT          = 10,
+    INDEX_OPT_AUTHENTICATION   = 11,
+    INDEX_OPT_KEYFILE          = 12,
+    INDEX_OPT_VERSION          = 13,
+    INDEX_OPT_HELP             = 14,
+    INDEX_OPT_MORE_HELP        = 15,
+    INDEX_OPT_SAVE_OPTS        = 16,
+    INDEX_OPT_LOAD_OPTS        = 17
 } teOptIndex;
 
-#define OPTION_CT    17
+#define OPTION_CT    18
 #define SNTP_VERSION       "4.2.7p114"
 #define SNTP_FULL_VERSION  "sntp - standard SNTP program - Ver. 4.2.7p114"
 
 /*
  *  Interface defines for all options.  Replace "n" with the UPPER_CASED
  *  option name (as in the teOptIndex enumeration above).
- *  e.g. HAVE_OPT(IPV4)
+ *  e.g. HAVE_OPT(DEBUG_LEVEL)
  */
 #define         DESC(n) (sntpOptions.pOptDesc[INDEX_OPT_## n])
 #define     HAVE_OPT(n) (! UNUSED_OPT(& DESC(n)))
@@ -107,6 +108,14 @@ typedef enum {
  *  Make sure there are no #define name conflicts with the option names
  */
 #ifndef     NO_OPTION_NAME_WARNINGS
+# ifdef    DEBUG_LEVEL
+#  warning undefining DEBUG_LEVEL due to option name conflict
+#  undef   DEBUG_LEVEL
+# endif
+# ifdef    SET_DEBUG_LEVEL
+#  warning undefining SET_DEBUG_LEVEL due to option name conflict
+#  undef   SET_DEBUG_LEVEL
+# endif
 # ifdef    IPV4
 #  warning undefining IPV4 due to option name conflict
 #  undef   IPV4
@@ -115,10 +124,6 @@ typedef enum {
 #  warning undefining IPV6 due to option name conflict
 #  undef   IPV6
 # endif
-# ifdef    NORMALVERBOSE
-#  warning undefining NORMALVERBOSE due to option name conflict
-#  undef   NORMALVERBOSE
-# endif
 # ifdef    KOD
 #  warning undefining KOD due to option name conflict
 #  undef   KOD
@@ -156,9 +161,10 @@ typedef enum {
 #  undef   KEYFILE
 # endif
 #else  /* NO_OPTION_NAME_WARNINGS */
+# undef DEBUG_LEVEL
+# undef SET_DEBUG_LEVEL
 # undef IPV4
 # undef IPV6
-# undef NORMALVERBOSE
 # undef KOD
 # undef SYSLOG
 # undef FILELOG
@@ -174,9 +180,10 @@ typedef enum {
  *
  *  Interface defines for specific options.
  */
+#define VALUE_OPT_DEBUG_LEVEL    'd'
+#define VALUE_OPT_SET_DEBUG_LEVEL 'D'
 #define VALUE_OPT_IPV4           '4'
 #define VALUE_OPT_IPV6           '6'
-#define VALUE_OPT_NORMALVERBOSE  'd'
 #define VALUE_OPT_KOD            'K'
 #define VALUE_OPT_SYSLOG         'p'
 #define VALUE_OPT_FILELOG        'l'
@@ -209,7 +216,7 @@ typedef enum {
                 sntpOptions.pzCurOpt  = NULL)
 #define START_OPT       RESTART_OPT(1)
 #define USAGE(c)        (*sntpOptions.pUsageProc)(&sntpOptions, c)
-/* extracted from /usr/local/gnu/share/autogen/opthead.tpl near line 435 */
+/* extracted from /usr/local/share/autogen/opthead.tpl near line 435 */
 
 /* * * * * *
  *
index f023912624dc9ebd8e6a83bf59efdc4f2e033304..a1808b9619117826b7c14e855a251068a33e1d61 100644 (file)
@@ -6,7 +6,7 @@
 # 
 # EDIT THIS FILE WITH CAUTION  (sntp-opts.texi)
 # 
-# It has been AutoGen-ed  January  8, 2011 at 04:45:30 AM by AutoGen 5.11.6pre7
+# It has been AutoGen-ed  January  9, 2011 at 06:07:36 AM by AutoGen 5.11.6pre7
 # From the definitions    sntp-opts.def
 # and the template file   aginfo.tpl
 @end ignore
@@ -50,12 +50,13 @@ This software is released under a specialized copyright license.
 * sntp adjtime::               adjtime option (-j)
 * sntp authentication::        authentication option (-a)
 * sntp broadcast::             broadcast option (-b)
+* sntp debug-level::           debug-level option (-d)
 * sntp filelog::               filelog option (-l)
 * sntp ipv4::                  ipv4 option (-4)
 * sntp ipv6::                  ipv6 option (-6)
 * sntp keyfile::               keyfile option (-k)
 * sntp kod::                   kod option (-K)
-* sntp normalverbose::         normalverbose option (-d)
+* sntp set-debug-level::       set-debug-level option (-D)
 * sntp settod::                settod option (-s)
 * sntp syslog::                syslog option (-p)
 * sntp timeout::               timeout option (-t)
@@ -72,13 +73,16 @@ This is the automatically generated usage text for sntp:
 sntp - standard SNTP program - Ver. 4.2.7p114
 USAGE:  sntp [ -<flag> [<val>] | --<name>[@{=| @}<val>] ]... hostname-or-IP ...
   Flg Arg Option-Name    Description
+   -d no  debug-level    Increase output debug message level
+                                - may appear multiple times
+   -D Str set-debug-level Set the output debug message level
+                                - may appear multiple times
    -4 no  ipv4           Force IPv4 DNS name resolution
                                 - prohibits these options:
                                 ipv6
    -6 no  ipv6           Force IPv6 DNS name resolution
                                 - prohibits these options:
                                 ipv4
-   -d no  normalverbose  Normal verbose
    -K Str kod            KoD history filename
    -p no  syslog         Logging with syslog
                                 - prohibits these options:
@@ -160,6 +164,20 @@ If specified SNTP will listen to the specified broadcast address
 for NTP broadcasts.  The default maximum wait time,
 68 seconds, can be modified with -t.
 
+@node sntp debug-level
+@subsection debug-level option (-d)
+@cindex sntp-debug-level
+
+This is the ``increase output debug message level'' option.
+
+This option has some usage constraints.  It:
+@itemize @bullet
+@item
+may appear an unlimited number of times.
+@end itemize
+
+Increase the debugging message output level.
+
 @node sntp filelog
 @subsection filelog option (-l)
 @cindex sntp-filelog
@@ -236,15 +254,20 @@ Modifies the filename to be used to persist the history of KoD
 responses received from servers.  The default is
 /var/db/ntp-kod.
 
-@node sntp normalverbose
-@subsection normalverbose option (-d)
-@cindex sntp-normalverbose
+@node sntp set-debug-level
+@subsection set-debug-level option (-D)
+@cindex sntp-set-debug-level
+
+This is the ``set the output debug message level'' option.
+
+This option has some usage constraints.  It:
+@itemize @bullet
+@item
+may appear an unlimited number of times.
+@end itemize
 
-This is the ``normal verbose'' option.
-Diagnostic messages for non-fatal errors and a limited amount of
-tracing should be written to standard error.  Fatal ones always
-produce a diagnostic.  This option should be set when there is a
-suspected problem with the server, network or the source.
+Set the output debugging level.  Can be supplied multiple times,
+but each overrides the previous value(s).
 
 @node sntp settod
 @subsection settod option (-s)
index d31cacf2d78557aa2623dacb0ea4b40db06913a7..c1df8671d0f482004da74354f81e319ef493d4e5 100644 (file)
@@ -1,7 +1,7 @@
-.TH SNTP 1 2011-01-08 "( 4.2.7p114)" "Programmer's Manual"
+.TH SNTP 1 2011-01-09 "( 4.2.7p114)" "Programmer's Manual"
 .\"  EDIT THIS FILE WITH CAUTION  (sntp.1)
 .\"  
-.\"  It has been AutoGen-ed  January  8, 2011 at 04:45:30 AM by AutoGen 5.11.6pre7
+.\"  It has been AutoGen-ed  January  9, 2011 at 06:07:35 AM by AutoGen 5.11.6pre7
 .\"  From the definitions    sntp-opts.def
 .\"  and the template file   agman1.tpl
 .\"
@@ -47,6 +47,19 @@ is believed to be correct to within
 seconds.
 .SH OPTIONS
 .TP
+.BR \-d ", " \--debug-level
+Increase output debug message level.
+This option may appear an unlimited number of times.
+.sp
+Increase the debugging message output level.
+.TP
+.BR \-D " \fIstring\fP, " \--set-debug-level "=" \fIstring\fP
+Set the output debug message level.
+This option may appear an unlimited number of times.
+.sp
+Set the output debugging level.  Can be supplied multiple times,
+but each overrides the previous value(s).
+.TP
 .BR \-4 ", " \--ipv4
 Force IPv4 DNS name resolution.
 This option must not appear in combination with any of the following options:
@@ -63,14 +76,6 @@ ipv4.
 Force DNS resolution of following host names on the command line
 to the IPv6 namespace.
 .TP
-.BR \-d ", " \--normalverbose
-Normal verbose.
-.sp
-Diagnostic messages for non-fatal errors and a limited amount of
-tracing should be written to standard error.  Fatal ones always
-produce a diagnostic.  This option should be set when there is a
-suspected problem with the server, network or the source.
-.TP
 .BR \-K " \fIfile-name\fP, " \--kod "=" \fIfile-name\fP
 KoD history filename.
 .sp
index b7923daf0ef3ebbe5cc8518e365b0db4c139dab6..7da2de6c9208fcbfe1ae4c58af6352104473a029 100644 (file)
@@ -3,7 +3,7 @@
 <title>Sntp User's Manual</title>
 <meta http-equiv="Content-Type" content="text/html">
 <meta name="description" content="Sntp User's Manual">
-<meta name="generator" content="makeinfo 4.7">
+<meta name="generator" content="makeinfo 4.8">
 <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">
   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; } 
+  span.sc    { font-variant:small-caps }
+  span.roman { font-family:serif; font-weight:normal; } 
+  span.sansserif { font-family:sans-serif; font-weight:normal; } 
 --></style>
 </head>
 <body>
 <h1 class="settitle">Sntp User's Manual</h1>
 <div class="node">
 <p><hr>
-<a name="Top"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#sntp-Description">sntp Description</a>,
+<a name="Top"></a>
+Next:&nbsp;<a rel="next" accesskey="n" href="#sntp-Description">sntp 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">Simple Network Time Protocol User Manual</h2>
@@ -57,7 +59,8 @@ IETF specification.
 <div class="node">
 <p><hr>
 <a name="sntp-Description"></a>
-<br>
+
+
 </div>
 
 <!-- node-name,  next,  previous,  up -->
@@ -74,7 +77,8 @@ error bound of the system clock relative to the server clock.
 <div class="node">
 <p><hr>
 <a name="sntp-Invocation"></a>
-<br>
+
+
 </div>
 
 <h3 class="section">Invoking sntp</h3>
@@ -107,7 +111,7 @@ is believed to be correct to within
 seconds.
 
   <p>This section was generated by <strong>AutoGen</strong>,
-the aginfo template and the option descriptions for the <span class="command">sntp</span> program.  It documents the sntp usage text and option meanings.
+the aginfo template and the option descriptions for the <samp><span class="command">sntp</span></samp> program.  It documents the sntp usage text and option meanings.
 
   <p>This software is released under a specialized copyright license.
 
@@ -116,12 +120,13 @@ the aginfo template and the option descriptions for the <span class="command">sn
 <li><a accesskey="2" href="#sntp-adjtime">sntp adjtime</a>:                adjtime option (-j)
 <li><a accesskey="3" href="#sntp-authentication">sntp authentication</a>:         authentication option (-a)
 <li><a accesskey="4" href="#sntp-broadcast">sntp broadcast</a>:              broadcast option (-b)
-<li><a accesskey="5" href="#sntp-filelog">sntp filelog</a>:                filelog option (-l)
-<li><a accesskey="6" href="#sntp-ipv4">sntp ipv4</a>:                   ipv4 option (-4)
-<li><a accesskey="7" href="#sntp-ipv6">sntp ipv6</a>:                   ipv6 option (-6)
-<li><a accesskey="8" href="#sntp-keyfile">sntp keyfile</a>:                keyfile option (-k)
-<li><a accesskey="9" href="#sntp-kod">sntp kod</a>:                    kod option (-K)
-<li><a href="#sntp-normalverbose">sntp normalverbose</a>:          normalverbose option (-d)
+<li><a accesskey="5" href="#sntp-debug_002dlevel">sntp debug-level</a>:            debug-level option (-d)
+<li><a accesskey="6" href="#sntp-filelog">sntp filelog</a>:                filelog option (-l)
+<li><a accesskey="7" href="#sntp-ipv4">sntp ipv4</a>:                   ipv4 option (-4)
+<li><a accesskey="8" href="#sntp-ipv6">sntp ipv6</a>:                   ipv6 option (-6)
+<li><a accesskey="9" href="#sntp-keyfile">sntp keyfile</a>:                keyfile option (-k)
+<li><a href="#sntp-kod">sntp kod</a>:                    kod option (-K)
+<li><a href="#sntp-set_002ddebug_002dlevel">sntp set-debug-level</a>:        set-debug-level option (-D)
 <li><a href="#sntp-settod">sntp settod</a>:                 settod option (-s)
 <li><a href="#sntp-syslog">sntp syslog</a>:                 syslog option (-p)
 <li><a href="#sntp-timeout">sntp timeout</a>:                timeout option (-t)
@@ -129,9 +134,10 @@ the aginfo template and the option descriptions for the <span class="command">sn
 
 <div class="node">
 <p><hr>
-<a name="sntp-usage"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#sntp-adjtime">sntp adjtime</a>,
+<a name="sntp-usage"></a>
+Next:&nbsp;<a rel="next" accesskey="n" href="#sntp-adjtime">sntp adjtime</a>,
 Up:&nbsp;<a rel="up" accesskey="u" href="#sntp-Invocation">sntp Invocation</a>
-<br>
+
 </div>
 
 <h4 class="subsection">sntp usage help (-?)</h4>
@@ -142,13 +148,16 @@ This is the automatically generated usage text for sntp:
 <pre class="example">sntp - standard SNTP program - Ver. 4.2.7p114
 USAGE:  sntp [ -&lt;flag&gt; [&lt;val&gt;] | --&lt;name&gt;[{=| }&lt;val&gt;] ]... hostname-or-IP ...
   Flg Arg Option-Name    Description
+   -d no  debug-level    Increase output debug message level
+                                - may appear multiple times
+   -D Str set-debug-level Set the output debug message level
+                                - may appear multiple times
    -4 no  ipv4           Force IPv4 DNS name resolution
                                 - prohibits these options:
                                 ipv6
    -6 no  ipv6           Force IPv6 DNS name resolution
                                 - prohibits these options:
                                 ipv4
-   -d no  normalverbose  Normal verbose
    -K Str kod            KoD history filename
    -p no  syslog         Logging with syslog
                                 - prohibits these options:
@@ -197,10 +206,11 @@ please send bug reports to:  http://bugs.ntp.org, bugs@ntp.org
 </pre>
   <div class="node">
 <p><hr>
-<a name="sntp-adjtime"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#sntp-authentication">sntp authentication</a>,
+<a name="sntp-adjtime"></a>
+Next:&nbsp;<a rel="next" accesskey="n" href="#sntp-authentication">sntp authentication</a>,
 Previous:&nbsp;<a rel="previous" accesskey="p" href="#sntp-usage">sntp usage</a>,
 Up:&nbsp;<a rel="up" accesskey="u" href="#sntp-Invocation">sntp Invocation</a>
-<br>
+
 </div>
 
 <h4 class="subsection">adjtime option (-j)</h4>
@@ -216,10 +226,11 @@ settod.
 
 <div class="node">
 <p><hr>
-<a name="sntp-authentication"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#sntp-broadcast">sntp broadcast</a>,
+<a name="sntp-authentication"></a>
+Next:&nbsp;<a rel="next" accesskey="n" href="#sntp-broadcast">sntp broadcast</a>,
 Previous:&nbsp;<a rel="previous" accesskey="p" href="#sntp-adjtime">sntp adjtime</a>,
 Up:&nbsp;<a rel="up" accesskey="u" href="#sntp-Invocation">sntp Invocation</a>
-<br>
+
 </div>
 
 <h4 class="subsection">authentication option (-a)</h4>
@@ -232,10 +243,11 @@ key's identifier. See the keyfile option (-k) for more details.
 
 <div class="node">
 <p><hr>
-<a name="sntp-broadcast"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#sntp-filelog">sntp filelog</a>,
+<a name="sntp-broadcast"></a>
+Next:&nbsp;<a rel="next" accesskey="n" href="#sntp-debug_002dlevel">sntp debug-level</a>,
 Previous:&nbsp;<a rel="previous" accesskey="p" href="#sntp-authentication">sntp authentication</a>,
 Up:&nbsp;<a rel="up" accesskey="u" href="#sntp-Invocation">sntp Invocation</a>
-<br>
+
 </div>
 
 <h4 class="subsection">broadcast option (-b)</h4>
@@ -248,15 +260,38 @@ for NTP broadcasts.  The default maximum wait time,
 
 <div class="node">
 <p><hr>
-<a name="sntp-filelog"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#sntp-ipv4">sntp ipv4</a>,
+<a name="sntp-debug-level"></a>
+<a name="sntp-debug_002dlevel"></a>
+Next:&nbsp;<a rel="next" accesskey="n" href="#sntp-filelog">sntp filelog</a>,
 Previous:&nbsp;<a rel="previous" accesskey="p" href="#sntp-broadcast">sntp broadcast</a>,
 Up:&nbsp;<a rel="up" accesskey="u" href="#sntp-Invocation">sntp Invocation</a>
-<br>
+
+</div>
+
+<h4 class="subsection">debug-level option (-d)</h4>
+
+<p><a name="index-sntp_002ddebug_002dlevel-7"></a>
+This is the &ldquo;increase output debug message level&rdquo; option.
+
+  <p>This option has some usage constraints.  It:
+     <ul>
+<li>may appear an unlimited number of times. 
+</ul>
+
+  <p>Increase the debugging message output level.
+
+<div class="node">
+<p><hr>
+<a name="sntp-filelog"></a>
+Next:&nbsp;<a rel="next" accesskey="n" href="#sntp-ipv4">sntp ipv4</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#sntp-debug_002dlevel">sntp debug-level</a>,
+Up:&nbsp;<a rel="up" accesskey="u" href="#sntp-Invocation">sntp Invocation</a>
+
 </div>
 
 <h4 class="subsection">filelog option (-l)</h4>
 
-<p><a name="index-sntp_002dfilelog-7"></a>
+<p><a name="index-sntp_002dfilelog-8"></a>
 This is the &ldquo;log to specified logfile&rdquo; option.
 
   <p>This option has some usage constraints.  It:
@@ -270,15 +305,16 @@ logfile.
 
 <div class="node">
 <p><hr>
-<a name="sntp-ipv4"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#sntp-ipv6">sntp ipv6</a>,
+<a name="sntp-ipv4"></a>
+Next:&nbsp;<a rel="next" accesskey="n" href="#sntp-ipv6">sntp ipv6</a>,
 Previous:&nbsp;<a rel="previous" accesskey="p" href="#sntp-filelog">sntp filelog</a>,
 Up:&nbsp;<a rel="up" accesskey="u" href="#sntp-Invocation">sntp Invocation</a>
-<br>
+
 </div>
 
 <h4 class="subsection">ipv4 option (-4)</h4>
 
-<p><a name="index-sntp_002dipv4-8"></a>
+<p><a name="index-sntp_002dipv4-9"></a>
 This is the &ldquo;force ipv4 dns name resolution&rdquo; option.
 
   <p>This option has some usage constraints.  It:
@@ -292,15 +328,16 @@ to the IPv4 namespace.
 
 <div class="node">
 <p><hr>
-<a name="sntp-ipv6"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#sntp-keyfile">sntp keyfile</a>,
+<a name="sntp-ipv6"></a>
+Next:&nbsp;<a rel="next" accesskey="n" href="#sntp-keyfile">sntp keyfile</a>,
 Previous:&nbsp;<a rel="previous" accesskey="p" href="#sntp-ipv4">sntp ipv4</a>,
 Up:&nbsp;<a rel="up" accesskey="u" href="#sntp-Invocation">sntp Invocation</a>
-<br>
+
 </div>
 
 <h4 class="subsection">ipv6 option (-6)</h4>
 
-<p><a name="index-sntp_002dipv6-9"></a>
+<p><a name="index-sntp_002dipv6-10"></a>
 This is the &ldquo;force ipv6 dns name resolution&rdquo; option.
 
   <p>This option has some usage constraints.  It:
@@ -314,15 +351,16 @@ to the IPv6 namespace.
 
 <div class="node">
 <p><hr>
-<a name="sntp-keyfile"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#sntp-kod">sntp kod</a>,
+<a name="sntp-keyfile"></a>
+Next:&nbsp;<a rel="next" accesskey="n" href="#sntp-kod">sntp kod</a>,
 Previous:&nbsp;<a rel="previous" accesskey="p" href="#sntp-ipv6">sntp ipv6</a>,
 Up:&nbsp;<a rel="up" accesskey="u" href="#sntp-Invocation">sntp Invocation</a>
-<br>
+
 </div>
 
 <h4 class="subsection">keyfile option (-k)</h4>
 
-<p><a name="index-sntp_002dkeyfile-10"></a>
+<p><a name="index-sntp_002dkeyfile-11"></a>
 This is the &ldquo;specify a keyfile. sntp will look in this file for the key specified with -a&rdquo; option. 
 This option specifies the keyfile. SNTP will search for the key specified with -a keyno in this
 file. Key files follow the following format:
@@ -340,15 +378,16 @@ M  Key in a 1-to-8 character ASCII string using the MD5 authentication scheme.
 
 <div class="node">
 <p><hr>
-<a name="sntp-kod"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#sntp-normalverbose">sntp normalverbose</a>,
+<a name="sntp-kod"></a>
+Next:&nbsp;<a rel="next" accesskey="n" href="#sntp-set_002ddebug_002dlevel">sntp set-debug-level</a>,
 Previous:&nbsp;<a rel="previous" accesskey="p" href="#sntp-keyfile">sntp keyfile</a>,
 Up:&nbsp;<a rel="up" accesskey="u" href="#sntp-Invocation">sntp Invocation</a>
-<br>
+
 </div>
 
 <h4 class="subsection">kod option (-K)</h4>
 
-<p><a name="index-sntp_002dkod-11"></a>
+<p><a name="index-sntp_002dkod-12"></a>
 This is the &ldquo;kod history filename&rdquo; option. 
 Modifies the filename to be used to persist the history of KoD
 responses received from servers.  The default is
@@ -356,32 +395,39 @@ responses received from servers.  The default is
 
 <div class="node">
 <p><hr>
-<a name="sntp-normalverbose"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#sntp-settod">sntp settod</a>,
+<a name="sntp-set-debug-level"></a>
+<a name="sntp-set_002ddebug_002dlevel"></a>
+Next:&nbsp;<a rel="next" accesskey="n" href="#sntp-settod">sntp settod</a>,
 Previous:&nbsp;<a rel="previous" accesskey="p" href="#sntp-kod">sntp kod</a>,
 Up:&nbsp;<a rel="up" accesskey="u" href="#sntp-Invocation">sntp Invocation</a>
-<br>
+
 </div>
 
-<h4 class="subsection">normalverbose option (-d)</h4>
+<h4 class="subsection">set-debug-level option (-D)</h4>
 
-<p><a name="index-sntp_002dnormalverbose-12"></a>
-This is the &ldquo;normal verbose&rdquo; option. 
-Diagnostic messages for non-fatal errors and a limited amount of
-tracing should be written to standard error.  Fatal ones always
-produce a diagnostic.  This option should be set when there is a
-suspected problem with the server, network or the source.
+<p><a name="index-sntp_002dset_002ddebug_002dlevel-13"></a>
+This is the &ldquo;set the output debug message level&rdquo; option.
+
+  <p>This option has some usage constraints.  It:
+     <ul>
+<li>may appear an unlimited number of times. 
+</ul>
+
+  <p>Set the output debugging level.  Can be supplied multiple times,
+but each overrides the previous value(s).
 
 <div class="node">
 <p><hr>
-<a name="sntp-settod"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#sntp-syslog">sntp syslog</a>,
-Previous:&nbsp;<a rel="previous" accesskey="p" href="#sntp-normalverbose">sntp normalverbose</a>,
+<a name="sntp-settod"></a>
+Next:&nbsp;<a rel="next" accesskey="n" href="#sntp-syslog">sntp syslog</a>,
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#sntp-set_002ddebug_002dlevel">sntp set-debug-level</a>,
 Up:&nbsp;<a rel="up" accesskey="u" href="#sntp-Invocation">sntp Invocation</a>
-<br>
+
 </div>
 
 <h4 class="subsection">settod option (-s)</h4>
 
-<p><a name="index-sntp_002dsettod-13"></a>
+<p><a name="index-sntp_002dsettod-14"></a>
 This is the &ldquo;set (step) the time with settimeofday()&rdquo; option.
 
   <p>This option has some usage constraints.  It:
@@ -392,15 +438,16 @@ adjtime.
 
 <div class="node">
 <p><hr>
-<a name="sntp-syslog"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#sntp-timeout">sntp timeout</a>,
+<a name="sntp-syslog"></a>
+Next:&nbsp;<a rel="next" accesskey="n" href="#sntp-timeout">sntp timeout</a>,
 Previous:&nbsp;<a rel="previous" accesskey="p" href="#sntp-settod">sntp settod</a>,
 Up:&nbsp;<a rel="up" accesskey="u" href="#sntp-Invocation">sntp Invocation</a>
-<br>
+
 </div>
 
 <h4 class="subsection">syslog option (-p)</h4>
 
-<p><a name="index-sntp_002dsyslog-14"></a>
+<p><a name="index-sntp_002dsyslog-15"></a>
 This is the &ldquo;logging with syslog&rdquo; option.
 
   <p>This option has some usage constraints.  It:
@@ -413,14 +460,15 @@ filelog.
 
 <div class="node">
 <p><hr>
-<a name="sntp-timeout"></a>Previous:&nbsp;<a rel="previous" accesskey="p" href="#sntp-syslog">sntp syslog</a>,
+<a name="sntp-timeout"></a>
+Previous:&nbsp;<a rel="previous" accesskey="p" href="#sntp-syslog">sntp syslog</a>,
 Up:&nbsp;<a rel="up" accesskey="u" href="#sntp-Invocation">sntp Invocation</a>
-<br>
+
 </div>
 
 <h4 class="subsection">timeout option (-t)</h4>
 
-<p><a name="index-sntp_002dtimeout-15"></a>
+<p><a name="index-sntp_002dtimeout-16"></a>
 This is the &ldquo;specify the number of seconds to wait for broadcasts&rdquo; option. 
 When waiting for a broadcast packet SNTP will wait the number
 of seconds specified before giving up.  Default 68 seconds.
@@ -428,7 +476,8 @@ of seconds specified before giving up.  Default 68 seconds.
 <div class="node">
 <p><hr>
 <a name="Usage"></a>
-<br>
+
+
 </div>
 
 <!-- node-name,  next,  previous,  up -->