ntp-keygen-opts.c revision 310419
16059Samurai/*
26059Samurai *  EDIT THIS FILE WITH CAUTION  (ntp-keygen-opts.c)
36059Samurai *
46059Samurai *  It has been AutoGen-ed  November 21, 2016 at 08:03:30 AM by AutoGen 5.18.5
56059Samurai *  From the definitions    ntp-keygen-opts.def
66059Samurai *  and the template file   options
76059Samurai *
86059Samurai * Generated from AutoOpts 41:0:16 templates.
96059Samurai *
106059Samurai *  AutoOpts is a copyrighted work.  This source file is not encumbered
116059Samurai *  by AutoOpts licensing, but is provided under the licensing terms chosen
126059Samurai *  by the ntp-keygen author or copyright holder.  AutoOpts is
136059Samurai *  licensed under the terms of the LGPL.  The redistributable library
146059Samurai *  (``libopts'') is licensed under the terms of either the LGPL or, at the
156059Samurai *  users discretion, the BSD license.  See the AutoOpts and/or libopts sources
166059Samurai *  for details.
176059Samurai *
186059Samurai * The ntp-keygen program is copyrighted and licensed
198857Srgrimes * under the following terms:
2050479Speter *
218857Srgrimes *  Copyright (C) 1992-2016 The University of Delaware and Network Time Foundation, all rights reserved.
226059Samurai *  This is free software. It is licensed for use, modification and
236059Samurai *  redistribution under the terms of the NTP License, copies of which
2443313Sbrian *  can be seen at:
2530715Sbrian *    <http://ntp.org/license>
2636285Sbrian *    <http://opensource.org/licenses/ntp-license.php>
2736285Sbrian *
2836285Sbrian *  Permission to use, copy, modify, and distribute this software and its
2930715Sbrian *  documentation for any purpose with or without fee is hereby granted,
3043888Sbrian *  provided that the above copyright notice appears in all copies and that
3143888Sbrian *  both the copyright notice and this permission notice appear in
3237192Sbrian *  supporting documentation, and that the name The University of Delaware not be used in
3336287Sbrian *  advertising or publicity pertaining to distribution of the software
3437192Sbrian *  without specific, written prior permission. The University of Delaware and Network Time Foundation makes no
3530715Sbrian *  representations about the suitability this software for any purpose. It
3643888Sbrian *  is provided "as is" without express or implied warranty.
3743888Sbrian */
3849976Sbrian
3930715Sbrian#ifndef __doxygen__
4044106Sbrian#define OPTION_CODE_COMPILE 1
4143888Sbrian#include "ntp-keygen-opts.h"
4236285Sbrian#include <sys/types.h>
4343888Sbrian
4429840Sbrian#include <limits.h>
4546686Sbrian#include <stdio.h>
4630715Sbrian#include <stdlib.h>
4730715Sbrian#include <errno.h>
4830715Sbrian
4930715Sbrian#ifdef  __cplusplus
506059Samuraiextern "C" {
5146686Sbrian#endif
526059Samuraiextern FILE * option_usage_fp;
5336285Sbrian#define zCopyright      (ntp_keygen_opt_strs+0)
546059Samurai#define zLicenseDescrip (ntp_keygen_opt_strs+352)
556735Samurai
5636285Sbrian/*
5736285Sbrian *  global included definitions
5836285Sbrian */
5943888Sbrian#include <stdlib.h>
6036285Sbrian
6136285Sbrian#ifdef __windows
6236285Sbrian  extern int atoi(const char*);
6336285Sbrian#else
6436285Sbrian# include <stdlib.h>
6536285Sbrian#endif
6636285Sbrian
6736285Sbrian#ifndef NULL
6843313Sbrian#  define NULL 0
6943313Sbrian#endif
7043313Sbrian
7136285Sbrian/**
7236285Sbrian *  static const strings for ntp-keygen options
7338174Sbrian */
7443888Sbrianstatic char const ntp_keygen_opt_strs[2419] =
7536285Sbrian/*     0 */ "ntp-keygen (ntp) 4.2.8p9\n"
7637192Sbrian            "Copyright (C) 1992-2016 The University of Delaware and Network Time Foundation, all rights reserved.\n"
7736287Sbrian            "This is free software. It is licensed for use, modification and\n"
7837192Sbrian            "redistribution under the terms of the NTP License, copies of which\n"
796059Samurai            "can be seen at:\n"
8055146Sbrian            "  <http://ntp.org/license>\n"
8119866Sphk            "  <http://opensource.org/licenses/ntp-license.php>\n\0"
826059Samurai/*   352 */ "Permission to use, copy, modify, and distribute this software and its\n"
8343693Sbrian            "documentation for any purpose with or without fee is hereby granted,\n"
846059Samurai            "provided that the above copyright notice appears in all copies and that\n"
8530715Sbrian            "both the copyright notice and this permission notice appear in supporting\n"
8636285Sbrian            "documentation, and that the name The University of Delaware not be used in\n"
8743693Sbrian            "advertising or publicity pertaining to distribution of the software without\n"
886059Samurai            "specific, written prior permission.  The University of Delaware and Network\n"
896059Samurai            "Time Foundation makes no representations about the suitability this\n"
906059Samurai            "software for any purpose.  It is provided \"as is\" without express or\n"
916059Samurai            "implied warranty.\n\0"
926059Samurai/*  1020 */ "identity modulus bits\0"
9328679Sbrian/*  1042 */ "IMBITS\0"
946059Samurai/*  1049 */ "imbits\0"
956059Samurai/*  1056 */ "certificate scheme\0"
966059Samurai/*  1075 */ "CERTIFICATE\0"
9754912Sbrian/*  1087 */ "certificate\0"
9830715Sbrian/*  1099 */ "privatekey cipher\0"
996059Samurai/*  1117 */ "CIPHER\0"
10030715Sbrian/*  1124 */ "cipher\0"
10136285Sbrian/*  1131 */ "Increase debug verbosity level\0"
10237926Sbrian/*  1162 */ "DEBUG_LEVEL\0"
10337926Sbrian/*  1174 */ "debug-level\0"
10437926Sbrian/*  1186 */ "Set the debug verbosity level\0"
10537926Sbrian/*  1216 */ "SET_DEBUG_LEVEL\0"
10646686Sbrian/*  1232 */ "set-debug-level\0"
10750867Sbrian/*  1248 */ "Write IFF or GQ identity keys\0"
1086059Samurai/*  1278 */ "ID_KEY\0"
1096059Samurai/*  1285 */ "id-key\0"
11043693Sbrian/*  1292 */ "Generate GQ parameters and keys\0"
11144123Sbrian/*  1324 */ "GQ_PARAMS\0"
11244123Sbrian/*  1334 */ "gq-params\0"
11344123Sbrian/*  1344 */ "generate RSA host key\0"
11444123Sbrian/*  1366 */ "HOST_KEY\0"
11544123Sbrian/*  1375 */ "host-key\0"
1166059Samurai/*  1384 */ "generate IFF parameters\0"
11743693Sbrian/*  1408 */ "IFFKEY\0"
11843693Sbrian/*  1415 */ "iffkey\0"
11943693Sbrian/*  1422 */ "set Autokey group name\0"
12043693Sbrian/*  1445 */ "IDENT\0"
12143693Sbrian/*  1451 */ "ident\0"
12243693Sbrian/*  1457 */ "set certificate lifetime\0"
12343693Sbrian/*  1482 */ "LIFETIME\0"
12444106Sbrian/*  1491 */ "lifetime\0"
12543693Sbrian/*  1500 */ "generate MD5 keys\0"
12643693Sbrian/*  1518 */ "MD5KEY\0"
12743693Sbrian/*  1525 */ "md5key\0"
12843693Sbrian/*  1532 */ "modulus\0"
12943693Sbrian/*  1540 */ "MODULUS\0"
13043693Sbrian/*  1548 */ "generate PC private certificate\0"
13143693Sbrian/*  1580 */ "PVT_CERT\0"
13244106Sbrian/*  1589 */ "pvt-cert\0"
13344106Sbrian/*  1598 */ "local private password\0"
13444106Sbrian/*  1621 */ "PASSWORD\0"
13544106Sbrian/*  1630 */ "password\0"
13644106Sbrian/*  1639 */ "export IFF or GQ group keys with password\0"
13744106Sbrian/*  1681 */ "EXPORT_PASSWD\0"
13844106Sbrian/*  1695 */ "export-passwd\0"
13944106Sbrian/*  1709 */ "generate sign key (RSA or DSA)\0"
14044106Sbrian/*  1740 */ "SIGN_KEY\0"
14143693Sbrian/*  1749 */ "sign-key\0"
14244106Sbrian/*  1758 */ "set host and optionally group name\0"
14344106Sbrian/*  1793 */ "SUBJECT_NAME\0"
14444106Sbrian/*  1806 */ "subject-name\0"
14544106Sbrian/*  1819 */ "trusted certificate (TC scheme)\0"
14644106Sbrian/*  1851 */ "TRUSTED_CERT\0"
14744106Sbrian/*  1864 */ "trusted-cert\0"
14844106Sbrian/*  1877 */ "generate <num> MV parameters\0"
14944106Sbrian/*  1906 */ "MV_PARAMS\0"
15044106Sbrian/*  1916 */ "mv-params\0"
15144106Sbrian/*  1926 */ "update <num> MV keys\0"
15244106Sbrian/*  1947 */ "MV_KEYS\0"
15344106Sbrian/*  1955 */ "mv-keys\0"
15444106Sbrian/*  1963 */ "display extended usage information and exit\0"
15544106Sbrian/*  2007 */ "help\0"
15644106Sbrian/*  2012 */ "extended usage information passed thru pager\0"
15744106Sbrian/*  2057 */ "more-help\0"
15844106Sbrian/*  2067 */ "output version information and exit\0"
15944106Sbrian/*  2103 */ "version\0"
16044106Sbrian/*  2111 */ "save the option state to a config file\0"
16143693Sbrian/*  2150 */ "save-opts\0"
16243693Sbrian/*  2160 */ "load options from a config file\0"
16344106Sbrian/*  2192 */ "LOAD_OPTS\0"
16444106Sbrian/*  2202 */ "no-load-opts\0"
16544106Sbrian/*  2215 */ "no\0"
16644106Sbrian/*  2218 */ "NTP_KEYGEN\0"
16744106Sbrian/*  2229 */ "ntp-keygen (ntp) - Create a NTP host key - Ver. 4.2.8p9\n"
16843693Sbrian            "Usage:  %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]...\n\0"
16943693Sbrian/*  2343 */ "$HOME\0"
17043693Sbrian/*  2349 */ ".\0"
17143693Sbrian/*  2351 */ ".ntprc\0"
17243693Sbrian/*  2358 */ "http://bugs.ntp.org, bugs@ntp.org\0"
17343693Sbrian/*  2392 */ "\n\0"
17443693Sbrian/*  2394 */ "ntp-keygen (ntp) 4.2.8p9";
17543693Sbrian
17643693Sbrian/**
17743693Sbrian *  imbits option description:
17843693Sbrian */
17943693Sbrian#ifdef AUTOKEY
18043693Sbrian/** Descriptive text for the imbits option */
18143693Sbrian#define IMBITS_DESC      (ntp_keygen_opt_strs+1020)
18243693Sbrian/** Upper-cased name for the imbits option */
18343693Sbrian#define IMBITS_NAME      (ntp_keygen_opt_strs+1042)
18443693Sbrian/** Name string for the imbits option */
18543693Sbrian#define IMBITS_name      (ntp_keygen_opt_strs+1049)
18643693Sbrian/** Compiled in flag settings for the imbits option */
18743693Sbrian#define IMBITS_FLAGS     (OPTST_DISABLED \
18843693Sbrian        | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC))
18943693Sbrian
19043693Sbrian#else   /* disable imbits */
19143693Sbrian#define IMBITS_FLAGS     (OPTST_OMITTED | OPTST_NO_INIT)
19243693Sbrian#define IMBITS_NAME      NULL
19343693Sbrian#define IMBITS_DESC      NULL
19443693Sbrian#define IMBITS_name      NULL
19543693Sbrian#endif  /* AUTOKEY */
19643888Sbrian
19743888Sbrian/**
19843888Sbrian *  certificate option description:
19943888Sbrian */
20043888Sbrian#ifdef AUTOKEY
20147849Sbrian/** Descriptive text for the certificate option */
20243888Sbrian#define CERTIFICATE_DESC      (ntp_keygen_opt_strs+1056)
20343888Sbrian/** Upper-cased name for the certificate option */
20443888Sbrian#define CERTIFICATE_NAME      (ntp_keygen_opt_strs+1075)
20543888Sbrian/** Name string for the certificate option */
20643888Sbrian#define CERTIFICATE_name      (ntp_keygen_opt_strs+1087)
20743888Sbrian/** Compiled in flag settings for the certificate option */
20843888Sbrian#define CERTIFICATE_FLAGS     (OPTST_DISABLED \
20943888Sbrian        | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
21043888Sbrian
21143888Sbrian#else   /* disable certificate */
21243888Sbrian#define CERTIFICATE_FLAGS     (OPTST_OMITTED | OPTST_NO_INIT)
21343888Sbrian#define CERTIFICATE_NAME      NULL
21443888Sbrian#define CERTIFICATE_DESC      NULL
21543888Sbrian#define CERTIFICATE_name      NULL
21643888Sbrian#endif  /* AUTOKEY */
21743888Sbrian
21843888Sbrian/**
21943888Sbrian *  cipher option description:
22047849Sbrian */
22143888Sbrian#ifdef AUTOKEY
22243888Sbrian/** Descriptive text for the cipher option */
22343888Sbrian#define CIPHER_DESC      (ntp_keygen_opt_strs+1099)
22443888Sbrian/** Upper-cased name for the cipher option */
22543888Sbrian#define CIPHER_NAME      (ntp_keygen_opt_strs+1117)
22643888Sbrian/** Name string for the cipher option */
22743888Sbrian#define CIPHER_name      (ntp_keygen_opt_strs+1124)
22843888Sbrian/** Compiled in flag settings for the cipher option */
22943888Sbrian#define CIPHER_FLAGS     (OPTST_DISABLED \
23043888Sbrian        | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
23143888Sbrian
23243888Sbrian#else   /* disable cipher */
23354914Sbrian#define CIPHER_FLAGS     (OPTST_OMITTED | OPTST_NO_INIT)
23454914Sbrian#define CIPHER_NAME      NULL
23554914Sbrian#define CIPHER_DESC      NULL
23654914Sbrian#define CIPHER_name      NULL
23754914Sbrian#endif  /* AUTOKEY */
23854914Sbrian
23954914Sbrian/**
24054914Sbrian *  debug-level option description:
24154914Sbrian */
24243888Sbrian/** Descriptive text for the debug-level option */
24343888Sbrian#define DEBUG_LEVEL_DESC      (ntp_keygen_opt_strs+1131)
24449976Sbrian/** Upper-cased name for the debug-level option */
24549976Sbrian#define DEBUG_LEVEL_NAME      (ntp_keygen_opt_strs+1162)
24643888Sbrian/** Name string for the debug-level option */
24743888Sbrian#define DEBUG_LEVEL_name      (ntp_keygen_opt_strs+1174)
24849976Sbrian/** Compiled in flag settings for the debug-level option */
24949976Sbrian#define DEBUG_LEVEL_FLAGS     (OPTST_DISABLED)
25043888Sbrian
25143888Sbrian/**
25243888Sbrian *  set-debug-level option description:
25343888Sbrian */
25449976Sbrian/** Descriptive text for the set-debug-level option */
25549976Sbrian#define SET_DEBUG_LEVEL_DESC      (ntp_keygen_opt_strs+1186)
25655252Sbrian/** Upper-cased name for the set-debug-level option */
25743888Sbrian#define SET_DEBUG_LEVEL_NAME      (ntp_keygen_opt_strs+1216)
25847849Sbrian/** Name string for the set-debug-level option */
25943888Sbrian#define SET_DEBUG_LEVEL_name      (ntp_keygen_opt_strs+1232)
26049976Sbrian/** Compiled in flag settings for the set-debug-level option */
26149976Sbrian#define SET_DEBUG_LEVEL_FLAGS     (OPTST_DISABLED \
26243888Sbrian        | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC))
26343888Sbrian
26443888Sbrian/**
26543888Sbrian *  id-key option description:
26643888Sbrian */
26743888Sbrian#ifdef AUTOKEY
26843888Sbrian/** Descriptive text for the id-key option */
26943888Sbrian#define ID_KEY_DESC      (ntp_keygen_opt_strs+1248)
27045907Sbrian/** Upper-cased name for the id-key option */
27143888Sbrian#define ID_KEY_NAME      (ntp_keygen_opt_strs+1278)
27243888Sbrian/** Name string for the id-key option */
27343888Sbrian#define ID_KEY_name      (ntp_keygen_opt_strs+1285)
27443888Sbrian/** Compiled in flag settings for the id-key option */
27543888Sbrian#define ID_KEY_FLAGS     (OPTST_DISABLED)
27643888Sbrian
27743888Sbrian#else   /* disable id-key */
27843888Sbrian#define ID_KEY_FLAGS     (OPTST_OMITTED | OPTST_NO_INIT)
27943888Sbrian#define ID_KEY_NAME      NULL
28043888Sbrian#define ID_KEY_DESC      NULL
28143888Sbrian#define ID_KEY_name      NULL
28243888Sbrian#endif  /* AUTOKEY */
28343888Sbrian
28443888Sbrian/**
28543888Sbrian *  gq-params option description:
28643888Sbrian */
28743888Sbrian#ifdef AUTOKEY
28843888Sbrian/** Descriptive text for the gq-params option */
28943888Sbrian#define GQ_PARAMS_DESC      (ntp_keygen_opt_strs+1292)
29043888Sbrian/** Upper-cased name for the gq-params option */
29143888Sbrian#define GQ_PARAMS_NAME      (ntp_keygen_opt_strs+1324)
29243888Sbrian/** Name string for the gq-params option */
29343888Sbrian#define GQ_PARAMS_name      (ntp_keygen_opt_strs+1334)
29443888Sbrian/** Compiled in flag settings for the gq-params option */
29543888Sbrian#define GQ_PARAMS_FLAGS     (OPTST_DISABLED)
29643888Sbrian
29743888Sbrian#else   /* disable gq-params */
29843888Sbrian#define GQ_PARAMS_FLAGS     (OPTST_OMITTED | OPTST_NO_INIT)
29945907Sbrian#define GQ_PARAMS_NAME      NULL
30044123Sbrian#define GQ_PARAMS_DESC      NULL
30144106Sbrian#define GQ_PARAMS_name      NULL
30244123Sbrian#endif  /* AUTOKEY */
30343888Sbrian
30443888Sbrian/**
30543888Sbrian *  host-key option description:
30644123Sbrian */
30744123Sbrian#ifdef AUTOKEY
30844123Sbrian/** Descriptive text for the host-key option */
30944123Sbrian#define HOST_KEY_DESC      (ntp_keygen_opt_strs+1344)
31044123Sbrian/** Upper-cased name for the host-key option */
31143888Sbrian#define HOST_KEY_NAME      (ntp_keygen_opt_strs+1366)
31244106Sbrian/** Name string for the host-key option */
31343888Sbrian#define HOST_KEY_name      (ntp_keygen_opt_strs+1375)
31445907Sbrian/** Compiled in flag settings for the host-key option */
31544123Sbrian#define HOST_KEY_FLAGS     (OPTST_DISABLED)
31644123Sbrian
31744123Sbrian#else   /* disable host-key */
31844123Sbrian#define HOST_KEY_FLAGS     (OPTST_OMITTED | OPTST_NO_INIT)
31943888Sbrian#define HOST_KEY_NAME      NULL
32043888Sbrian#define HOST_KEY_DESC      NULL
32143888Sbrian#define HOST_KEY_name      NULL
32243888Sbrian#endif  /* AUTOKEY */
32344123Sbrian
32444106Sbrian/**
32544123Sbrian *  iffkey option description:
32643888Sbrian */
32743888Sbrian#ifdef AUTOKEY
32843888Sbrian/** Descriptive text for the iffkey option */
32943888Sbrian#define IFFKEY_DESC      (ntp_keygen_opt_strs+1384)
33043888Sbrian/** Upper-cased name for the iffkey option */
33143888Sbrian#define IFFKEY_NAME      (ntp_keygen_opt_strs+1408)
33243888Sbrian/** Name string for the iffkey option */
33343888Sbrian#define IFFKEY_name      (ntp_keygen_opt_strs+1415)
33443888Sbrian/** Compiled in flag settings for the iffkey option */
33543888Sbrian#define IFFKEY_FLAGS     (OPTST_DISABLED)
33643888Sbrian
33743888Sbrian#else   /* disable iffkey */
33843888Sbrian#define IFFKEY_FLAGS     (OPTST_OMITTED | OPTST_NO_INIT)
33943888Sbrian#define IFFKEY_NAME      NULL
34043888Sbrian#define IFFKEY_DESC      NULL
34143888Sbrian#define IFFKEY_name      NULL
34243888Sbrian#endif  /* AUTOKEY */
34343888Sbrian
34443888Sbrian/**
34543888Sbrian *  ident option description:
34643888Sbrian */
34743888Sbrian#ifdef AUTOKEY
34843888Sbrian/** Descriptive text for the ident option */
34943888Sbrian#define IDENT_DESC      (ntp_keygen_opt_strs+1422)
35043888Sbrian/** Upper-cased name for the ident option */
35143888Sbrian#define IDENT_NAME      (ntp_keygen_opt_strs+1445)
35243888Sbrian/** Name string for the ident option */
35343888Sbrian#define IDENT_name      (ntp_keygen_opt_strs+1451)
35443888Sbrian/** Compiled in flag settings for the ident option */
35543888Sbrian#define IDENT_FLAGS     (OPTST_DISABLED \
35643888Sbrian        | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
35743888Sbrian
35843888Sbrian#else   /* disable ident */
35943888Sbrian#define IDENT_FLAGS     (OPTST_OMITTED | OPTST_NO_INIT)
36043888Sbrian#define IDENT_NAME      NULL
36143888Sbrian#define IDENT_DESC      NULL
36243888Sbrian#define IDENT_name      NULL
36343888Sbrian#endif  /* AUTOKEY */
36443888Sbrian
36543888Sbrian/**
36643888Sbrian *  lifetime option description:
36743888Sbrian */
36843888Sbrian#ifdef AUTOKEY
36943888Sbrian/** Descriptive text for the lifetime option */
37043888Sbrian#define LIFETIME_DESC      (ntp_keygen_opt_strs+1457)
37143888Sbrian/** Upper-cased name for the lifetime option */
37243888Sbrian#define LIFETIME_NAME      (ntp_keygen_opt_strs+1482)
37343888Sbrian/** Name string for the lifetime option */
37443888Sbrian#define LIFETIME_name      (ntp_keygen_opt_strs+1491)
37543888Sbrian/** Compiled in flag settings for the lifetime option */
37643888Sbrian#define LIFETIME_FLAGS     (OPTST_DISABLED \
37743888Sbrian        | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC))
37843888Sbrian
37943888Sbrian#else   /* disable lifetime */
38043888Sbrian#define LIFETIME_FLAGS     (OPTST_OMITTED | OPTST_NO_INIT)
38143888Sbrian#define LIFETIME_NAME      NULL
38243888Sbrian#define LIFETIME_DESC      NULL
38343888Sbrian#define LIFETIME_name      NULL
38443888Sbrian#endif  /* AUTOKEY */
38543888Sbrian
38643888Sbrian/**
38743888Sbrian *  md5key option description:
38844123Sbrian */
38944106Sbrian/** Descriptive text for the md5key option */
39044106Sbrian#define MD5KEY_DESC      (ntp_keygen_opt_strs+1500)
39144106Sbrian/** Upper-cased name for the md5key option */
39244106Sbrian#define MD5KEY_NAME      (ntp_keygen_opt_strs+1518)
39344123Sbrian/** Name string for the md5key option */
39444106Sbrian#define MD5KEY_name      (ntp_keygen_opt_strs+1525)
39543888Sbrian/** Compiled in flag settings for the md5key option */
39643888Sbrian#define MD5KEY_FLAGS     (OPTST_DISABLED)
39743888Sbrian
39843888Sbrian/**
39943888Sbrian *  modulus option description:
40043888Sbrian */
40143888Sbrian#ifdef AUTOKEY
40244123Sbrian/** Descriptive text for the modulus option */
40344123Sbrian#define MODULUS_DESC      (ntp_keygen_opt_strs+1532)
40444123Sbrian/** Upper-cased name for the modulus option */
40544123Sbrian#define MODULUS_NAME      (ntp_keygen_opt_strs+1540)
40644123Sbrian/** Name string for the modulus option */
40743888Sbrian#define MODULUS_name      (ntp_keygen_opt_strs+1532)
40843888Sbrian/** Compiled in flag settings for the modulus option */
40943888Sbrian#define MODULUS_FLAGS     (OPTST_DISABLED \
41043888Sbrian        | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC))
41143888Sbrian
41243888Sbrian#else   /* disable modulus */
41343888Sbrian#define MODULUS_FLAGS     (OPTST_OMITTED | OPTST_NO_INIT)
41443888Sbrian#define MODULUS_NAME      NULL
41543888Sbrian#define MODULUS_DESC      NULL
41643888Sbrian#define MODULUS_name      NULL
41743888Sbrian#endif  /* AUTOKEY */
41843888Sbrian
41943888Sbrian/**
42043888Sbrian *  pvt-cert option description:
42143693Sbrian */
42243693Sbrian#ifdef AUTOKEY
42343693Sbrian/** Descriptive text for the pvt-cert option */
42413379Sphk#define PVT_CERT_DESC      (ntp_keygen_opt_strs+1548)
4256059Samurai/** Upper-cased name for the pvt-cert option */
4266059Samurai#define PVT_CERT_NAME      (ntp_keygen_opt_strs+1580)
42743888Sbrian/** Name string for the pvt-cert option */
42843401Sbrian#define PVT_CERT_name      (ntp_keygen_opt_strs+1589)
42945907Sbrian/** Compiled in flag settings for the pvt-cert option */
43043888Sbrian#define PVT_CERT_FLAGS     (OPTST_DISABLED)
43145907Sbrian
43243888Sbrian#else   /* disable pvt-cert */
43343313Sbrian#define PVT_CERT_FLAGS     (OPTST_OMITTED | OPTST_NO_INIT)
43443888Sbrian#define PVT_CERT_NAME      NULL
43543888Sbrian#define PVT_CERT_DESC      NULL
43643888Sbrian#define PVT_CERT_name      NULL
43743888Sbrian#endif  /* AUTOKEY */
43843888Sbrian
43943888Sbrian/**
44043313Sbrian *  password option description:
44143888Sbrian */
44244106Sbrian#ifdef AUTOKEY
44344106Sbrian/** Descriptive text for the password option */
44444106Sbrian#define PASSWORD_DESC      (ntp_keygen_opt_strs+1598)
44544106Sbrian/** Upper-cased name for the password option */
44644106Sbrian#define PASSWORD_NAME      (ntp_keygen_opt_strs+1621)
44744106Sbrian/** Name string for the password option */
44845907Sbrian#define PASSWORD_name      (ntp_keygen_opt_strs+1630)
44943888Sbrian/** Compiled in flag settings for the password option */
45043888Sbrian#define PASSWORD_FLAGS     (OPTST_DISABLED \
45143888Sbrian        | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
45243313Sbrian
45345907Sbrian#else   /* disable password */
45445907Sbrian#define PASSWORD_FLAGS     (OPTST_OMITTED | OPTST_NO_INIT)
4556059Samurai#define PASSWORD_NAME      NULL
4566059Samurai#define PASSWORD_DESC      NULL
45730715Sbrian#define PASSWORD_name      NULL
45843693Sbrian#endif  /* AUTOKEY */
4596059Samurai
46043693Sbrian/**
46143693Sbrian *  export-passwd option description:
46243693Sbrian */
46343693Sbrian#ifdef AUTOKEY
46443693Sbrian/** Descriptive text for the export-passwd option */
4656059Samurai#define EXPORT_PASSWD_DESC      (ntp_keygen_opt_strs+1639)
46643693Sbrian/** Upper-cased name for the export-passwd option */
46743693Sbrian#define EXPORT_PASSWD_NAME      (ntp_keygen_opt_strs+1681)
46843693Sbrian/** Name string for the export-passwd option */
46943693Sbrian#define EXPORT_PASSWD_name      (ntp_keygen_opt_strs+1695)
47043693Sbrian/** Compiled in flag settings for the export-passwd option */
47143693Sbrian#define EXPORT_PASSWD_FLAGS     (OPTST_DISABLED \
47243693Sbrian        | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
4736059Samurai
47443693Sbrian#else   /* disable export-passwd */
47543693Sbrian#define EXPORT_PASSWD_FLAGS     (OPTST_OMITTED | OPTST_NO_INIT)
47643693Sbrian#define EXPORT_PASSWD_NAME      NULL
47743693Sbrian#define EXPORT_PASSWD_DESC      NULL
47843693Sbrian#define EXPORT_PASSWD_name      NULL
47943693Sbrian#endif  /* AUTOKEY */
48037926Sbrian
48144106Sbrian/**
48244123Sbrian *  sign-key option description:
48344123Sbrian */
48444123Sbrian#ifdef AUTOKEY
48544123Sbrian/** Descriptive text for the sign-key option */
48644123Sbrian#define SIGN_KEY_DESC      (ntp_keygen_opt_strs+1709)
48744106Sbrian/** Upper-cased name for the sign-key option */
48844106Sbrian#define SIGN_KEY_NAME      (ntp_keygen_opt_strs+1740)
48944106Sbrian/** Name string for the sign-key option */
49044123Sbrian#define SIGN_KEY_name      (ntp_keygen_opt_strs+1749)
49144106Sbrian/** Compiled in flag settings for the sign-key option */
49244106Sbrian#define SIGN_KEY_FLAGS     (OPTST_DISABLED \
49344106Sbrian        | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
49444106Sbrian
49544106Sbrian#else   /* disable sign-key */
49644123Sbrian#define SIGN_KEY_FLAGS     (OPTST_OMITTED | OPTST_NO_INIT)
49744123Sbrian#define SIGN_KEY_NAME      NULL
49844123Sbrian#define SIGN_KEY_DESC      NULL
49944106Sbrian#define SIGN_KEY_name      NULL
50044106Sbrian#endif  /* AUTOKEY */
50144106Sbrian
50244106Sbrian/**
50344106Sbrian *  subject-name option description:
50444123Sbrian */
50544106Sbrian#ifdef AUTOKEY
50644106Sbrian/** Descriptive text for the subject-name option */
50744106Sbrian#define SUBJECT_NAME_DESC      (ntp_keygen_opt_strs+1758)
50844106Sbrian/** Upper-cased name for the subject-name option */
50944106Sbrian#define SUBJECT_NAME_NAME      (ntp_keygen_opt_strs+1793)
51045907Sbrian/** Name string for the subject-name option */
51144106Sbrian#define SUBJECT_NAME_name      (ntp_keygen_opt_strs+1806)
51244106Sbrian/** Compiled in flag settings for the subject-name option */
51344106Sbrian#define SUBJECT_NAME_FLAGS     (OPTST_DISABLED \
51444106Sbrian        | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
51544106Sbrian
51644106Sbrian#else   /* disable subject-name */
51744123Sbrian#define SUBJECT_NAME_FLAGS     (OPTST_OMITTED | OPTST_NO_INIT)
51844106Sbrian#define SUBJECT_NAME_NAME      NULL
51943693Sbrian#define SUBJECT_NAME_DESC      NULL
52043693Sbrian#define SUBJECT_NAME_name      NULL
52143693Sbrian#endif  /* AUTOKEY */
52243888Sbrian
52343888Sbrian/**
52443888Sbrian *  trusted-cert option description:
52543888Sbrian */
52643888Sbrian#ifdef AUTOKEY
52743888Sbrian/** Descriptive text for the trusted-cert option */
52843888Sbrian#define TRUSTED_CERT_DESC      (ntp_keygen_opt_strs+1819)
52943693Sbrian/** Upper-cased name for the trusted-cert option */
53045907Sbrian#define TRUSTED_CERT_NAME      (ntp_keygen_opt_strs+1851)
53144123Sbrian/** Name string for the trusted-cert option */
53244106Sbrian#define TRUSTED_CERT_name      (ntp_keygen_opt_strs+1864)
53344106Sbrian/** Compiled in flag settings for the trusted-cert option */
53444123Sbrian#define TRUSTED_CERT_FLAGS     (OPTST_DISABLED)
53543693Sbrian
53629840Sbrian#else   /* disable trusted-cert */
53743693Sbrian#define TRUSTED_CERT_FLAGS     (OPTST_OMITTED | OPTST_NO_INIT)
53843888Sbrian#define TRUSTED_CERT_NAME      NULL
53943888Sbrian#define TRUSTED_CERT_DESC      NULL
54043888Sbrian#define TRUSTED_CERT_name      NULL
54143888Sbrian#endif  /* AUTOKEY */
54243888Sbrian
54346686Sbrian/**
54446686Sbrian *  mv-params option description:
54543693Sbrian */
54646686Sbrian#ifdef AUTOKEY
54743693Sbrian/** Descriptive text for the mv-params option */
54844106Sbrian#define MV_PARAMS_DESC      (ntp_keygen_opt_strs+1877)
54944123Sbrian/** Upper-cased name for the mv-params option */
55048817Sbrian#define MV_PARAMS_NAME      (ntp_keygen_opt_strs+1906)
55144123Sbrian/** Name string for the mv-params option */
55244123Sbrian#define MV_PARAMS_name      (ntp_keygen_opt_strs+1916)
55344123Sbrian/** Compiled in flag settings for the mv-params option */
55429840Sbrian#define MV_PARAMS_FLAGS     (OPTST_DISABLED \
55546686Sbrian        | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC))
55646686Sbrian
55754912Sbrian#else   /* disable mv-params */
55846686Sbrian#define MV_PARAMS_FLAGS     (OPTST_OMITTED | OPTST_NO_INIT)
55946686Sbrian#define MV_PARAMS_NAME      NULL
56046686Sbrian#define MV_PARAMS_DESC      NULL
56146686Sbrian#define MV_PARAMS_name      NULL
56246686Sbrian#endif  /* AUTOKEY */
56345220Sbrian
56454912Sbrian/**
56546686Sbrian *  mv-keys option description:
56645220Sbrian */
56745220Sbrian#ifdef AUTOKEY
56854912Sbrian/** Descriptive text for the mv-keys option */
56944159Sbrian#define MV_KEYS_DESC      (ntp_keygen_opt_strs+1926)
57044159Sbrian/** Upper-cased name for the mv-keys option */
57144159Sbrian#define MV_KEYS_NAME      (ntp_keygen_opt_strs+1947)
57243693Sbrian/** Name string for the mv-keys option */
57343693Sbrian#define MV_KEYS_name      (ntp_keygen_opt_strs+1955)
57443693Sbrian/** Compiled in flag settings for the mv-keys option */
57543693Sbrian#define MV_KEYS_FLAGS     (OPTST_DISABLED \
57654912Sbrian        | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC))
57743693Sbrian
57843693Sbrian#else   /* disable mv-keys */
57943693Sbrian#define MV_KEYS_FLAGS     (OPTST_OMITTED | OPTST_NO_INIT)
58043693Sbrian#define MV_KEYS_NAME      NULL
58146686Sbrian#define MV_KEYS_DESC      NULL
58243693Sbrian#define MV_KEYS_name      NULL
58343693Sbrian#endif  /* AUTOKEY */
58443693Sbrian
58543693Sbrian/*
58654912Sbrian *  Help/More_Help/Version option descriptions:
58746686Sbrian */
58825630Sbrian#define HELP_DESC       (ntp_keygen_opt_strs+1963)
58943693Sbrian#define HELP_name       (ntp_keygen_opt_strs+2007)
59029840Sbrian#ifdef HAVE_WORKING_FORK
59144123Sbrian#define MORE_HELP_DESC  (ntp_keygen_opt_strs+2012)
59244106Sbrian#define MORE_HELP_name  (ntp_keygen_opt_strs+2057)
59344123Sbrian#define MORE_HELP_FLAGS (OPTST_IMM | OPTST_NO_INIT)
59443693Sbrian#else
59543693Sbrian#define MORE_HELP_DESC  HELP_DESC
59644106Sbrian#define MORE_HELP_name  HELP_name
59744106Sbrian#define MORE_HELP_FLAGS (OPTST_OMITTED | OPTST_NO_INIT)
59843693Sbrian#endif
59943693Sbrian#ifdef NO_OPTIONAL_OPT_ARGS
60054912Sbrian#  define VER_FLAGS     (OPTST_IMM | OPTST_NO_INIT)
60146686Sbrian#else
60243693Sbrian#  define VER_FLAGS     (OPTST_SET_ARGTYPE(OPARG_TYPE_STRING) | \
60345907Sbrian                         OPTST_ARG_OPTIONAL | OPTST_IMM | OPTST_NO_INIT)
60445907Sbrian#endif
60543693Sbrian#define VER_DESC        (ntp_keygen_opt_strs+2067)
60644123Sbrian#define VER_name        (ntp_keygen_opt_strs+2103)
60744106Sbrian#define SAVE_OPTS_DESC  (ntp_keygen_opt_strs+2111)
60844106Sbrian#define SAVE_OPTS_name  (ntp_keygen_opt_strs+2150)
60944106Sbrian#define LOAD_OPTS_DESC     (ntp_keygen_opt_strs+2160)
61044123Sbrian#define LOAD_OPTS_NAME     (ntp_keygen_opt_strs+2192)
61143693Sbrian#define NO_LOAD_OPTS_name  (ntp_keygen_opt_strs+2202)
61243313Sbrian#define LOAD_OPTS_pfx      (ntp_keygen_opt_strs+2215)
61343693Sbrian#define LOAD_OPTS_name     (NO_LOAD_OPTS_name + 3)
61443693Sbrian/**
61543693Sbrian *  Declare option callback procedures
61643693Sbrian */
61743693Sbrian#ifdef AUTOKEY
61843693Sbrian  static tOptProc doOptImbits;
61954912Sbrian#else /* not AUTOKEY */
62046686Sbrian# define doOptImbits NULL
62143693Sbrian#endif /* def/not AUTOKEY */
62243693Sbrian#ifdef AUTOKEY
62343693Sbrian  static tOptProc doOptModulus;
62454912Sbrian#else /* not AUTOKEY */
62546686Sbrian# define doOptModulus NULL
62643693Sbrian#endif /* def/not AUTOKEY */
62743693Sbrianextern tOptProc
62843693Sbrian    ntpOptionPrintVersion, optionBooleanVal,      optionNestedVal,
62943693Sbrian    optionNumericVal,      optionPagedUsage,      optionResetOpt,
63043693Sbrian    optionStackArg,        optionTimeDate,        optionTimeVal,
63144123Sbrian    optionUnstackArg,      optionVendorOption;
63244106Sbrianstatic tOptProc
63344123Sbrian    doOptDebug_Level, doUsageOpt;
63443693Sbrian#define VER_PROC        ntpOptionPrintVersion
63543313Sbrian
63643693Sbrian/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
63743693Sbrian/**
63843693Sbrian *  Define the ntp-keygen Option Descriptions.
63943693Sbrian * This is an array of OPTION_CT entries, one for each
64043693Sbrian * option that the ntp-keygen program responds to.
64154912Sbrian */
64246686Sbrianstatic tOptDesc optDesc[OPTION_CT] = {
64343693Sbrian  {  /* entry idx, value */ 0, VALUE_OPT_IMBITS,
64443693Sbrian     /* equiv idx, value */ 0, VALUE_OPT_IMBITS,
64543693Sbrian     /* equivalenced to  */ NO_EQUIVALENT,
64643693Sbrian     /* min, max, act ct */ 0, 1, 0,
64743401Sbrian     /* opt state flags  */ IMBITS_FLAGS, 0,
64836285Sbrian     /* last opt argumnt */ { NULL }, /* --imbits */
64943693Sbrian     /* arg list/cookie  */ NULL,
65043693Sbrian     /* must/cannot opts */ NULL, NULL,
65143693Sbrian     /* option proc      */ doOptImbits,
65243693Sbrian     /* desc, NAME, name */ IMBITS_DESC, IMBITS_NAME, IMBITS_name,
65344106Sbrian     /* disablement strs */ NULL, NULL },
65444106Sbrian
65544106Sbrian  {  /* entry idx, value */ 1, VALUE_OPT_CERTIFICATE,
65644123Sbrian     /* equiv idx, value */ 1, VALUE_OPT_CERTIFICATE,
65744106Sbrian     /* equivalenced to  */ NO_EQUIVALENT,
65844123Sbrian     /* min, max, act ct */ 0, 1, 0,
65944123Sbrian     /* opt state flags  */ CERTIFICATE_FLAGS, 0,
66044123Sbrian     /* last opt argumnt */ { NULL }, /* --certificate */
66143693Sbrian     /* arg list/cookie  */ NULL,
66244106Sbrian     /* must/cannot opts */ NULL, NULL,
66344106Sbrian     /* option proc      */ NULL,
66444123Sbrian     /* desc, NAME, name */ CERTIFICATE_DESC, CERTIFICATE_NAME, CERTIFICATE_name,
66544106Sbrian     /* disablement strs */ NULL, NULL },
66644123Sbrian
66744123Sbrian  {  /* entry idx, value */ 2, VALUE_OPT_CIPHER,
66844123Sbrian     /* equiv idx, value */ 2, VALUE_OPT_CIPHER,
66943693Sbrian     /* equivalenced to  */ NO_EQUIVALENT,
67036285Sbrian     /* min, max, act ct */ 0, 1, 0,
67143693Sbrian     /* opt state flags  */ CIPHER_FLAGS, 0,
67243693Sbrian     /* last opt argumnt */ { NULL }, /* --cipher */
67343693Sbrian     /* arg list/cookie  */ NULL,
67443693Sbrian     /* must/cannot opts */ NULL, NULL,
67543693Sbrian     /* option proc      */ NULL,
67643693Sbrian     /* desc, NAME, name */ CIPHER_DESC, CIPHER_NAME, CIPHER_name,
67743693Sbrian     /* disablement strs */ NULL, NULL },
67843693Sbrian
67943693Sbrian  {  /* entry idx, value */ 3, VALUE_OPT_DEBUG_LEVEL,
6806059Samurai     /* equiv idx, value */ 3, VALUE_OPT_DEBUG_LEVEL,
6816059Samurai     /* equivalenced to  */ NO_EQUIVALENT,
68243693Sbrian     /* min, max, act ct */ 0, NOLIMIT, 0,
68343693Sbrian     /* opt state flags  */ DEBUG_LEVEL_FLAGS, 0,
68446686Sbrian     /* last opt argumnt */ { NULL }, /* --debug-level */
68546686Sbrian     /* arg list/cookie  */ NULL,
68646686Sbrian     /* must/cannot opts */ NULL, NULL,
68743888Sbrian     /* option proc      */ doOptDebug_Level,
68846686Sbrian     /* desc, NAME, name */ DEBUG_LEVEL_DESC, DEBUG_LEVEL_NAME, DEBUG_LEVEL_name,
68946686Sbrian     /* disablement strs */ NULL, NULL },
69044123Sbrian
69144123Sbrian  {  /* entry idx, value */ 4, VALUE_OPT_SET_DEBUG_LEVEL,
69244123Sbrian     /* equiv idx, value */ 4, VALUE_OPT_SET_DEBUG_LEVEL,
69344123Sbrian     /* equivalenced to  */ NO_EQUIVALENT,
69443693Sbrian     /* min, max, act ct */ 0, NOLIMIT, 0,
6956059Samurai     /* opt state flags  */ SET_DEBUG_LEVEL_FLAGS, 0,
69643693Sbrian     /* last opt argumnt */ { NULL }, /* --set-debug-level */
69743693Sbrian     /* arg list/cookie  */ NULL,
69843693Sbrian     /* must/cannot opts */ NULL, NULL,
69943693Sbrian     /* option proc      */ optionNumericVal,
70046686Sbrian     /* desc, NAME, name */ SET_DEBUG_LEVEL_DESC, SET_DEBUG_LEVEL_NAME, SET_DEBUG_LEVEL_name,
70148817Sbrian     /* disablement strs */ NULL, NULL },
70248817Sbrian
70345907Sbrian  {  /* entry idx, value */ 5, VALUE_OPT_ID_KEY,
70445907Sbrian     /* equiv idx, value */ 5, VALUE_OPT_ID_KEY,
70546686Sbrian     /* equivalenced to  */ NO_EQUIVALENT,
70645907Sbrian     /* min, max, act ct */ 0, 1, 0,
70745907Sbrian     /* opt state flags  */ ID_KEY_FLAGS, 0,
70845907Sbrian     /* last opt argumnt */ { NULL }, /* --id-key */
70943693Sbrian     /* arg list/cookie  */ NULL,
71043693Sbrian     /* must/cannot opts */ NULL, NULL,
71143693Sbrian     /* option proc      */ NULL,
71246686Sbrian     /* desc, NAME, name */ ID_KEY_DESC, ID_KEY_NAME, ID_KEY_name,
71343693Sbrian     /* disablement strs */ NULL, NULL },
71444106Sbrian
71544123Sbrian  {  /* entry idx, value */ 6, VALUE_OPT_GQ_PARAMS,
71644106Sbrian     /* equiv idx, value */ 6, VALUE_OPT_GQ_PARAMS,
71744106Sbrian     /* equivalenced to  */ NO_EQUIVALENT,
71844106Sbrian     /* min, max, act ct */ 0, 1, 0,
71944106Sbrian     /* opt state flags  */ GQ_PARAMS_FLAGS, 0,
72043693Sbrian     /* last opt argumnt */ { NULL }, /* --gq-params */
72144122Sbrian     /* arg list/cookie  */ NULL,
72244122Sbrian     /* must/cannot opts */ NULL, NULL,
72344106Sbrian     /* option proc      */ NULL,
72444106Sbrian     /* desc, NAME, name */ GQ_PARAMS_DESC, GQ_PARAMS_NAME, GQ_PARAMS_name,
72544106Sbrian     /* disablement strs */ NULL, NULL },
72644106Sbrian
72744123Sbrian  {  /* entry idx, value */ 7, VALUE_OPT_HOST_KEY,
72844123Sbrian     /* equiv idx, value */ 7, VALUE_OPT_HOST_KEY,
72944123Sbrian     /* equivalenced to  */ NO_EQUIVALENT,
73044106Sbrian     /* min, max, act ct */ 0, 1, 0,
73145907Sbrian     /* opt state flags  */ HOST_KEY_FLAGS, 0,
73244123Sbrian     /* last opt argumnt */ { NULL }, /* --host-key */
73344123Sbrian     /* arg list/cookie  */ NULL,
73444123Sbrian     /* must/cannot opts */ NULL, NULL,
73544123Sbrian     /* option proc      */ NULL,
73644123Sbrian     /* desc, NAME, name */ HOST_KEY_DESC, HOST_KEY_NAME, HOST_KEY_name,
73744106Sbrian     /* disablement strs */ NULL, NULL },
73843693Sbrian
73944106Sbrian  {  /* entry idx, value */ 8, VALUE_OPT_IFFKEY,
74044123Sbrian     /* equiv idx, value */ 8, VALUE_OPT_IFFKEY,
74144123Sbrian     /* equivalenced to  */ NO_EQUIVALENT,
74244123Sbrian     /* min, max, act ct */ 0, 1, 0,
74344123Sbrian     /* opt state flags  */ IFFKEY_FLAGS, 0,
74444123Sbrian     /* last opt argumnt */ { NULL }, /* --iffkey */
74544123Sbrian     /* arg list/cookie  */ NULL,
74644106Sbrian     /* must/cannot opts */ NULL, NULL,
74744106Sbrian     /* option proc      */ NULL,
74844106Sbrian     /* desc, NAME, name */ IFFKEY_DESC, IFFKEY_NAME, IFFKEY_name,
74943693Sbrian     /* disablement strs */ NULL, NULL },
75043693Sbrian
7516059Samurai  {  /* entry idx, value */ 9, VALUE_OPT_IDENT,
75243693Sbrian     /* equiv idx, value */ 9, VALUE_OPT_IDENT,
75343693Sbrian     /* equivalenced to  */ NO_EQUIVALENT,
75443693Sbrian     /* min, max, act ct */ 0, 1, 0,
75543693Sbrian     /* opt state flags  */ IDENT_FLAGS, 0,
75643693Sbrian     /* last opt argumnt */ { NULL }, /* --ident */
7576059Samurai     /* arg list/cookie  */ NULL,
75843693Sbrian     /* must/cannot opts */ NULL, NULL,
7596059Samurai     /* option proc      */ NULL,
7606059Samurai     /* desc, NAME, name */ IDENT_DESC, IDENT_NAME, IDENT_name,
76143693Sbrian     /* disablement strs */ NULL, NULL },
76243693Sbrian
76343693Sbrian  {  /* entry idx, value */ 10, VALUE_OPT_LIFETIME,
76443693Sbrian     /* equiv idx, value */ 10, VALUE_OPT_LIFETIME,
76543693Sbrian     /* equivalenced to  */ NO_EQUIVALENT,
76643693Sbrian     /* min, max, act ct */ 0, 1, 0,
76743693Sbrian     /* opt state flags  */ LIFETIME_FLAGS, 0,
76843693Sbrian     /* last opt argumnt */ { NULL }, /* --lifetime */
76943693Sbrian     /* arg list/cookie  */ NULL,
77043693Sbrian     /* must/cannot opts */ NULL, NULL,
77143693Sbrian     /* option proc      */ optionNumericVal,
77243693Sbrian     /* desc, NAME, name */ LIFETIME_DESC, LIFETIME_NAME, LIFETIME_name,
7736059Samurai     /* disablement strs */ NULL, NULL },
77443693Sbrian
77543693Sbrian  {  /* entry idx, value */ 11, VALUE_OPT_MD5KEY,
7766059Samurai     /* equiv idx, value */ 11, VALUE_OPT_MD5KEY,
77743693Sbrian     /* equivalenced to  */ NO_EQUIVALENT,
7786059Samurai     /* min, max, act ct */ 0, 1, 0,
77943693Sbrian     /* opt state flags  */ MD5KEY_FLAGS, 0,
78054912Sbrian     /* last opt argumnt */ { NULL }, /* --md5key */
78146686Sbrian     /* arg list/cookie  */ NULL,
7826059Samurai     /* must/cannot opts */ NULL, NULL,
783     /* option proc      */ NULL,
784     /* desc, NAME, name */ MD5KEY_DESC, MD5KEY_NAME, MD5KEY_name,
785     /* disablement strs */ NULL, NULL },
786
787  {  /* entry idx, value */ 12, VALUE_OPT_MODULUS,
788     /* equiv idx, value */ 12, VALUE_OPT_MODULUS,
789     /* equivalenced to  */ NO_EQUIVALENT,
790     /* min, max, act ct */ 0, 1, 0,
791     /* opt state flags  */ MODULUS_FLAGS, 0,
792     /* last opt argumnt */ { NULL }, /* --modulus */
793     /* arg list/cookie  */ NULL,
794     /* must/cannot opts */ NULL, NULL,
795     /* option proc      */ doOptModulus,
796     /* desc, NAME, name */ MODULUS_DESC, MODULUS_NAME, MODULUS_name,
797     /* disablement strs */ NULL, NULL },
798
799  {  /* entry idx, value */ 13, VALUE_OPT_PVT_CERT,
800     /* equiv idx, value */ 13, VALUE_OPT_PVT_CERT,
801     /* equivalenced to  */ NO_EQUIVALENT,
802     /* min, max, act ct */ 0, 1, 0,
803     /* opt state flags  */ PVT_CERT_FLAGS, 0,
804     /* last opt argumnt */ { NULL }, /* --pvt-cert */
805     /* arg list/cookie  */ NULL,
806     /* must/cannot opts */ NULL, NULL,
807     /* option proc      */ NULL,
808     /* desc, NAME, name */ PVT_CERT_DESC, PVT_CERT_NAME, PVT_CERT_name,
809     /* disablement strs */ NULL, NULL },
810
811  {  /* entry idx, value */ 14, VALUE_OPT_PASSWORD,
812     /* equiv idx, value */ 14, VALUE_OPT_PASSWORD,
813     /* equivalenced to  */ NO_EQUIVALENT,
814     /* min, max, act ct */ 0, 1, 0,
815     /* opt state flags  */ PASSWORD_FLAGS, 0,
816     /* last opt argumnt */ { NULL }, /* --password */
817     /* arg list/cookie  */ NULL,
818     /* must/cannot opts */ NULL, NULL,
819     /* option proc      */ NULL,
820     /* desc, NAME, name */ PASSWORD_DESC, PASSWORD_NAME, PASSWORD_name,
821     /* disablement strs */ NULL, NULL },
822
823  {  /* entry idx, value */ 15, VALUE_OPT_EXPORT_PASSWD,
824     /* equiv idx, value */ 15, VALUE_OPT_EXPORT_PASSWD,
825     /* equivalenced to  */ NO_EQUIVALENT,
826     /* min, max, act ct */ 0, 1, 0,
827     /* opt state flags  */ EXPORT_PASSWD_FLAGS, 0,
828     /* last opt argumnt */ { NULL }, /* --export-passwd */
829     /* arg list/cookie  */ NULL,
830     /* must/cannot opts */ NULL, NULL,
831     /* option proc      */ NULL,
832     /* desc, NAME, name */ EXPORT_PASSWD_DESC, EXPORT_PASSWD_NAME, EXPORT_PASSWD_name,
833     /* disablement strs */ NULL, NULL },
834
835  {  /* entry idx, value */ 16, VALUE_OPT_SIGN_KEY,
836     /* equiv idx, value */ 16, VALUE_OPT_SIGN_KEY,
837     /* equivalenced to  */ NO_EQUIVALENT,
838     /* min, max, act ct */ 0, 1, 0,
839     /* opt state flags  */ SIGN_KEY_FLAGS, 0,
840     /* last opt argumnt */ { NULL }, /* --sign-key */
841     /* arg list/cookie  */ NULL,
842     /* must/cannot opts */ NULL, NULL,
843     /* option proc      */ NULL,
844     /* desc, NAME, name */ SIGN_KEY_DESC, SIGN_KEY_NAME, SIGN_KEY_name,
845     /* disablement strs */ NULL, NULL },
846
847  {  /* entry idx, value */ 17, VALUE_OPT_SUBJECT_NAME,
848     /* equiv idx, value */ 17, VALUE_OPT_SUBJECT_NAME,
849     /* equivalenced to  */ NO_EQUIVALENT,
850     /* min, max, act ct */ 0, 1, 0,
851     /* opt state flags  */ SUBJECT_NAME_FLAGS, 0,
852     /* last opt argumnt */ { NULL }, /* --subject-name */
853     /* arg list/cookie  */ NULL,
854     /* must/cannot opts */ NULL, NULL,
855     /* option proc      */ NULL,
856     /* desc, NAME, name */ SUBJECT_NAME_DESC, SUBJECT_NAME_NAME, SUBJECT_NAME_name,
857     /* disablement strs */ NULL, NULL },
858
859  {  /* entry idx, value */ 18, VALUE_OPT_TRUSTED_CERT,
860     /* equiv idx, value */ 18, VALUE_OPT_TRUSTED_CERT,
861     /* equivalenced to  */ NO_EQUIVALENT,
862     /* min, max, act ct */ 0, 1, 0,
863     /* opt state flags  */ TRUSTED_CERT_FLAGS, 0,
864     /* last opt argumnt */ { NULL }, /* --trusted-cert */
865     /* arg list/cookie  */ NULL,
866     /* must/cannot opts */ NULL, NULL,
867     /* option proc      */ NULL,
868     /* desc, NAME, name */ TRUSTED_CERT_DESC, TRUSTED_CERT_NAME, TRUSTED_CERT_name,
869     /* disablement strs */ NULL, NULL },
870
871  {  /* entry idx, value */ 19, VALUE_OPT_MV_PARAMS,
872     /* equiv idx, value */ 19, VALUE_OPT_MV_PARAMS,
873     /* equivalenced to  */ NO_EQUIVALENT,
874     /* min, max, act ct */ 0, 1, 0,
875     /* opt state flags  */ MV_PARAMS_FLAGS, 0,
876     /* last opt argumnt */ { NULL }, /* --mv-params */
877     /* arg list/cookie  */ NULL,
878     /* must/cannot opts */ NULL, NULL,
879     /* option proc      */ optionNumericVal,
880     /* desc, NAME, name */ MV_PARAMS_DESC, MV_PARAMS_NAME, MV_PARAMS_name,
881     /* disablement strs */ NULL, NULL },
882
883  {  /* entry idx, value */ 20, VALUE_OPT_MV_KEYS,
884     /* equiv idx, value */ 20, VALUE_OPT_MV_KEYS,
885     /* equivalenced to  */ NO_EQUIVALENT,
886     /* min, max, act ct */ 0, 1, 0,
887     /* opt state flags  */ MV_KEYS_FLAGS, 0,
888     /* last opt argumnt */ { NULL }, /* --mv-keys */
889     /* arg list/cookie  */ NULL,
890     /* must/cannot opts */ NULL, NULL,
891     /* option proc      */ optionNumericVal,
892     /* desc, NAME, name */ MV_KEYS_DESC, MV_KEYS_NAME, MV_KEYS_name,
893     /* disablement strs */ NULL, NULL },
894
895  {  /* entry idx, value */ INDEX_OPT_VERSION, VALUE_OPT_VERSION,
896     /* equiv idx value  */ NO_EQUIVALENT, VALUE_OPT_VERSION,
897     /* equivalenced to  */ NO_EQUIVALENT,
898     /* min, max, act ct */ 0, 1, 0,
899     /* opt state flags  */ VER_FLAGS, AOUSE_VERSION,
900     /* last opt argumnt */ { NULL },
901     /* arg list/cookie  */ NULL,
902     /* must/cannot opts */ NULL, NULL,
903     /* option proc      */ VER_PROC,
904     /* desc, NAME, name */ VER_DESC, NULL, VER_name,
905     /* disablement strs */ NULL, NULL },
906
907
908
909  {  /* entry idx, value */ INDEX_OPT_HELP, VALUE_OPT_HELP,
910     /* equiv idx value  */ NO_EQUIVALENT, VALUE_OPT_HELP,
911     /* equivalenced to  */ NO_EQUIVALENT,
912     /* min, max, act ct */ 0, 1, 0,
913     /* opt state flags  */ OPTST_IMM | OPTST_NO_INIT, AOUSE_HELP,
914     /* last opt argumnt */ { NULL },
915     /* arg list/cookie  */ NULL,
916     /* must/cannot opts */ NULL, NULL,
917     /* option proc      */ doUsageOpt,
918     /* desc, NAME, name */ HELP_DESC, NULL, HELP_name,
919     /* disablement strs */ NULL, NULL },
920
921  {  /* entry idx, value */ INDEX_OPT_MORE_HELP, VALUE_OPT_MORE_HELP,
922     /* equiv idx value  */ NO_EQUIVALENT, VALUE_OPT_MORE_HELP,
923     /* equivalenced to  */ NO_EQUIVALENT,
924     /* min, max, act ct */ 0, 1, 0,
925     /* opt state flags  */ MORE_HELP_FLAGS, AOUSE_MORE_HELP,
926     /* last opt argumnt */ { NULL },
927     /* arg list/cookie  */ NULL,
928     /* must/cannot opts */ NULL,  NULL,
929     /* option proc      */ optionPagedUsage,
930     /* desc, NAME, name */ MORE_HELP_DESC, NULL, MORE_HELP_name,
931     /* disablement strs */ NULL, NULL },
932
933  {  /* entry idx, value */ INDEX_OPT_SAVE_OPTS, VALUE_OPT_SAVE_OPTS,
934     /* equiv idx value  */ NO_EQUIVALENT, VALUE_OPT_SAVE_OPTS,
935     /* equivalenced to  */ NO_EQUIVALENT,
936     /* min, max, act ct */ 0, 1, 0,
937     /* opt state flags  */ OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)
938                       | OPTST_ARG_OPTIONAL | OPTST_NO_INIT, AOUSE_SAVE_OPTS,
939     /* last opt argumnt */ { NULL },
940     /* arg list/cookie  */ NULL,
941     /* must/cannot opts */ NULL,  NULL,
942     /* option proc      */ NULL,
943     /* desc, NAME, name */ SAVE_OPTS_DESC, NULL, SAVE_OPTS_name,
944     /* disablement strs */ NULL, NULL },
945
946  {  /* entry idx, value */ INDEX_OPT_LOAD_OPTS, VALUE_OPT_LOAD_OPTS,
947     /* equiv idx value  */ NO_EQUIVALENT, VALUE_OPT_LOAD_OPTS,
948     /* equivalenced to  */ NO_EQUIVALENT,
949     /* min, max, act ct */ 0, NOLIMIT, 0,
950     /* opt state flags  */ OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)
951			  | OPTST_DISABLE_IMM, AOUSE_LOAD_OPTS,
952     /* last opt argumnt */ { NULL },
953     /* arg list/cookie  */ NULL,
954     /* must/cannot opts */ NULL, NULL,
955     /* option proc      */ optionLoadOpt,
956     /* desc, NAME, name */ LOAD_OPTS_DESC, LOAD_OPTS_NAME, LOAD_OPTS_name,
957     /* disablement strs */ NO_LOAD_OPTS_name, LOAD_OPTS_pfx }
958};
959
960
961/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
962/** Reference to the upper cased version of ntp-keygen. */
963#define zPROGNAME       (ntp_keygen_opt_strs+2218)
964/** Reference to the title line for ntp-keygen usage. */
965#define zUsageTitle     (ntp_keygen_opt_strs+2229)
966/** ntp-keygen configuration file name. */
967#define zRcName         (ntp_keygen_opt_strs+2351)
968/** Directories to search for ntp-keygen config files. */
969static char const * const apzHomeList[3] = {
970    ntp_keygen_opt_strs+2343,
971    ntp_keygen_opt_strs+2349,
972    NULL };
973/** The ntp-keygen program bug email address. */
974#define zBugsAddr       (ntp_keygen_opt_strs+2358)
975/** Clarification/explanation of what ntp-keygen does. */
976#define zExplain        (ntp_keygen_opt_strs+2392)
977/** Extra detail explaining what ntp-keygen does. */
978#define zDetail         (NULL)
979/** The full version string for ntp-keygen. */
980#define zFullVersion    (ntp_keygen_opt_strs+2394)
981/* extracted from optcode.tlib near line 364 */
982
983#if defined(ENABLE_NLS)
984# define OPTPROC_BASE OPTPROC_TRANSLATE
985  static tOptionXlateProc translate_option_strings;
986#else
987# define OPTPROC_BASE OPTPROC_NONE
988# define translate_option_strings NULL
989#endif /* ENABLE_NLS */
990
991#define ntp_keygen_full_usage (NULL)
992#define ntp_keygen_short_usage (NULL)
993
994#endif /* not defined __doxygen__ */
995
996/*
997 *  Create the static procedure(s) declared above.
998 */
999/**
1000 * The callout function that invokes the optionUsage function.
1001 *
1002 * @param[in] opts the AutoOpts option description structure
1003 * @param[in] od   the descriptor for the "help" (usage) option.
1004 * @noreturn
1005 */
1006static void
1007doUsageOpt(tOptions * opts, tOptDesc * od)
1008{
1009    int ex_code;
1010    ex_code = NTP_KEYGEN_EXIT_SUCCESS;
1011    optionUsage(&ntp_keygenOptions, ex_code);
1012    /* NOTREACHED */
1013    exit(1);
1014    (void)opts;
1015    (void)od;
1016}
1017
1018/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
1019/**
1020 * Code to handle the imbits option, when AUTOKEY is #define-d.
1021 * The number of bits in the identity modulus.  The default is 256.
1022 * @param[in] pOptions the ntp-keygen options data structure
1023 * @param[in,out] pOptDesc the option descriptor for this option.
1024 */
1025#ifdef AUTOKEY
1026static void
1027doOptImbits(tOptions* pOptions, tOptDesc* pOptDesc)
1028{
1029    static struct {long rmin, rmax;} const rng[1] = {
1030        { 256, 2048 } };
1031    int  ix;
1032
1033    if (pOptions <= OPTPROC_EMIT_LIMIT)
1034        goto emit_ranges;
1035    optionNumericVal(pOptions, pOptDesc);
1036
1037    for (ix = 0; ix < 1; ix++) {
1038        if (pOptDesc->optArg.argInt < rng[ix].rmin)
1039            continue;  /* ranges need not be ordered. */
1040        if (pOptDesc->optArg.argInt == rng[ix].rmin)
1041            return;
1042        if (rng[ix].rmax == LONG_MIN)
1043            continue;
1044        if (pOptDesc->optArg.argInt <= rng[ix].rmax)
1045            return;
1046    }
1047
1048    option_usage_fp = stderr;
1049
1050 emit_ranges:
1051optionShowRange(pOptions, pOptDesc, VOIDP(rng), 1);
1052}
1053#endif /* defined AUTOKEY */
1054
1055/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
1056/**
1057 * Code to handle the debug-level option.
1058 *
1059 * @param[in] pOptions the ntp-keygen options data structure
1060 * @param[in,out] pOptDesc the option descriptor for this option.
1061 */
1062static void
1063doOptDebug_Level(tOptions* pOptions, tOptDesc* pOptDesc)
1064{
1065    /*
1066     * Be sure the flag-code[0] handles special values for the options pointer
1067     * viz. (poptions <= OPTPROC_EMIT_LIMIT) *and also* the special flag bit
1068     * ((poptdesc->fOptState & OPTST_RESET) != 0) telling the option to
1069     * reset its state.
1070     */
1071    /* extracted from debug-opt.def, line 15 */
1072OPT_VALUE_SET_DEBUG_LEVEL++;
1073    (void)pOptDesc;
1074    (void)pOptions;
1075}
1076
1077/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
1078/**
1079 * Code to handle the modulus option, when AUTOKEY is #define-d.
1080 * The number of bits in the prime modulus.  The default is 512.
1081 * @param[in] pOptions the ntp-keygen options data structure
1082 * @param[in,out] pOptDesc the option descriptor for this option.
1083 */
1084#ifdef AUTOKEY
1085static void
1086doOptModulus(tOptions* pOptions, tOptDesc* pOptDesc)
1087{
1088    static struct {long rmin, rmax;} const rng[1] = {
1089        { 256, 2048 } };
1090    int  ix;
1091
1092    if (pOptions <= OPTPROC_EMIT_LIMIT)
1093        goto emit_ranges;
1094    optionNumericVal(pOptions, pOptDesc);
1095
1096    for (ix = 0; ix < 1; ix++) {
1097        if (pOptDesc->optArg.argInt < rng[ix].rmin)
1098            continue;  /* ranges need not be ordered. */
1099        if (pOptDesc->optArg.argInt == rng[ix].rmin)
1100            return;
1101        if (rng[ix].rmax == LONG_MIN)
1102            continue;
1103        if (pOptDesc->optArg.argInt <= rng[ix].rmax)
1104            return;
1105    }
1106
1107    option_usage_fp = stderr;
1108
1109 emit_ranges:
1110optionShowRange(pOptions, pOptDesc, VOIDP(rng), 1);
1111}
1112#endif /* defined AUTOKEY */
1113/* extracted from optmain.tlib near line 1250 */
1114
1115/**
1116 * The directory containing the data associated with ntp-keygen.
1117 */
1118#ifndef  PKGDATADIR
1119# define PKGDATADIR ""
1120#endif
1121
1122/**
1123 * Information about the person or institution that packaged ntp-keygen
1124 * for the current distribution.
1125 */
1126#ifndef  WITH_PACKAGER
1127# define ntp_keygen_packager_info NULL
1128#else
1129/** Packager information for ntp-keygen. */
1130static char const ntp_keygen_packager_info[] =
1131    "Packaged by " WITH_PACKAGER
1132
1133# ifdef WITH_PACKAGER_VERSION
1134        " ("WITH_PACKAGER_VERSION")"
1135# endif
1136
1137# ifdef WITH_PACKAGER_BUG_REPORTS
1138    "\nReport ntp_keygen bugs to " WITH_PACKAGER_BUG_REPORTS
1139# endif
1140    "\n";
1141#endif
1142#ifndef __doxygen__
1143
1144#endif /* __doxygen__ */
1145/**
1146 * The option definitions for ntp-keygen.  The one structure that
1147 * binds them all.
1148 */
1149tOptions ntp_keygenOptions = {
1150    OPTIONS_STRUCT_VERSION,
1151    0, NULL,                    /* original argc + argv    */
1152    ( OPTPROC_BASE
1153    + OPTPROC_ERRSTOP
1154    + OPTPROC_SHORTOPT
1155    + OPTPROC_LONGOPT
1156    + OPTPROC_NO_REQ_OPT
1157    + OPTPROC_ENVIRON
1158    + OPTPROC_NO_ARGS
1159    + OPTPROC_MISUSE ),
1160    0, NULL,                    /* current option index, current option */
1161    NULL,         NULL,         zPROGNAME,
1162    zRcName,      zCopyright,   zLicenseDescrip,
1163    zFullVersion, apzHomeList,  zUsageTitle,
1164    zExplain,     zDetail,      optDesc,
1165    zBugsAddr,                  /* address to send bugs to */
1166    NULL, NULL,                 /* extensions/saved state  */
1167    optionUsage, /* usage procedure */
1168    translate_option_strings,   /* translation procedure */
1169    /*
1170     *  Indexes to special options
1171     */
1172    { INDEX_OPT_MORE_HELP, /* more-help option index */
1173      INDEX_OPT_SAVE_OPTS, /* save option index */
1174      NO_EQUIVALENT, /* '-#' option index */
1175      NO_EQUIVALENT /* index of default opt */
1176    },
1177    26 /* full option count */, 21 /* user option count */,
1178    ntp_keygen_full_usage, ntp_keygen_short_usage,
1179    NULL, NULL,
1180    PKGDATADIR, ntp_keygen_packager_info
1181};
1182
1183#if ENABLE_NLS
1184/**
1185 * This code is designed to translate translatable option text for the
1186 * ntp-keygen program.  These translations happen upon entry
1187 * to optionProcess().
1188 */
1189#include <stdio.h>
1190#include <stdlib.h>
1191#include <string.h>
1192#include <unistd.h>
1193#ifdef HAVE_DCGETTEXT
1194# include <gettext.h>
1195#endif
1196#include <autoopts/usage-txt.h>
1197
1198static char * AO_gettext(char const * pz);
1199static void   coerce_it(void ** s);
1200
1201/**
1202 * AutoGen specific wrapper function for gettext.  It relies on the macro _()
1203 * to convert from English to the target language, then strdup-duplicates the
1204 * result string.  It tries the "libopts" domain first, then whatever has been
1205 * set via the \a textdomain(3) call.
1206 *
1207 * @param[in] pz the input text used as a lookup key.
1208 * @returns the translated text (if there is one),
1209 *   or the original text (if not).
1210 */
1211static char *
1212AO_gettext(char const * pz)
1213{
1214    char * res;
1215    if (pz == NULL)
1216        return NULL;
1217#ifdef HAVE_DCGETTEXT
1218    /*
1219     * While processing the option_xlateable_txt data, try to use the
1220     * "libopts" domain.  Once we switch to the option descriptor data,
1221     * do *not* use that domain.
1222     */
1223    if (option_xlateable_txt.field_ct != 0) {
1224        res = dgettext("libopts", pz);
1225        if (res == pz)
1226            res = (char *)VOIDP(_(pz));
1227    } else
1228        res = (char *)VOIDP(_(pz));
1229#else
1230    res = (char *)VOIDP(_(pz));
1231#endif
1232    if (res == pz)
1233        return res;
1234    res = strdup(res);
1235    if (res == NULL) {
1236        fputs(_("No memory for duping translated strings\n"), stderr);
1237        exit(NTP_KEYGEN_EXIT_FAILURE);
1238    }
1239    return res;
1240}
1241
1242/**
1243 * All the pointers we use are marked "* const", but they are stored in
1244 * writable memory.  Coerce the mutability and set the pointer.
1245 */
1246static void coerce_it(void ** s) { *s = AO_gettext(*s);
1247}
1248
1249/**
1250 * Translate all the translatable strings in the ntp_keygenOptions
1251 * structure defined above.  This is done only once.
1252 */
1253static void
1254translate_option_strings(void)
1255{
1256    tOptions * const opts = &ntp_keygenOptions;
1257
1258    /*
1259     *  Guard against re-translation.  It won't work.  The strings will have
1260     *  been changed by the first pass through this code.  One shot only.
1261     */
1262    if (option_xlateable_txt.field_ct != 0) {
1263        /*
1264         *  Do the translations.  The first pointer follows the field count
1265         *  field.  The field count field is the size of a pointer.
1266         */
1267        char ** ppz = (char**)VOIDP(&(option_xlateable_txt));
1268        int     ix  = option_xlateable_txt.field_ct;
1269
1270        do {
1271            ppz++; /* skip over field_ct */
1272            *ppz = AO_gettext(*ppz);
1273        } while (--ix > 0);
1274        /* prevent re-translation and disable "libopts" domain lookup */
1275        option_xlateable_txt.field_ct = 0;
1276
1277        coerce_it(VOIDP(&(opts->pzCopyright)));
1278        coerce_it(VOIDP(&(opts->pzCopyNotice)));
1279        coerce_it(VOIDP(&(opts->pzFullVersion)));
1280        coerce_it(VOIDP(&(opts->pzUsageTitle)));
1281        coerce_it(VOIDP(&(opts->pzExplain)));
1282        coerce_it(VOIDP(&(opts->pzDetail)));
1283        {
1284            tOptDesc * od = opts->pOptDesc;
1285            for (ix = opts->optCt; ix > 0; ix--, od++)
1286                coerce_it(VOIDP(&(od->pzText)));
1287        }
1288    }
1289}
1290#endif /* ENABLE_NLS */
1291
1292#ifdef DO_NOT_COMPILE_THIS_CODE_IT_IS_FOR_GETTEXT
1293/** I18N function strictly for xgettext.  Do not compile. */
1294static void bogus_function(void) {
1295  /* TRANSLATORS:
1296
1297     The following dummy function was crated solely so that xgettext can
1298     extract the correct strings.  These strings are actually referenced
1299     by a field name in the ntp_keygenOptions structure noted in the
1300     comments below.  The literal text is defined in ntp_keygen_opt_strs.
1301
1302     NOTE: the strings below are segmented with respect to the source string
1303     ntp_keygen_opt_strs.  The strings above are handed off for translation
1304     at run time a paragraph at a time.  Consequently, they are presented here
1305     for translation a paragraph at a time.
1306
1307     ALSO: often the description for an option will reference another option
1308     by name.  These are set off with apostrophe quotes (I hope).  Do not
1309     translate option names.
1310   */
1311  /* referenced via ntp_keygenOptions.pzCopyright */
1312  puts(_("ntp-keygen (ntp) 4.2.8p9\n\
1313Copyright (C) 1992-2016 The University of Delaware and Network Time Foundation, all rights reserved.\n\
1314This is free software. It is licensed for use, modification and\n\
1315redistribution under the terms of the NTP License, copies of which\n\
1316can be seen at:\n"));
1317  puts(_("  <http://ntp.org/license>\n\
1318  <http://opensource.org/licenses/ntp-license.php>\n"));
1319
1320  /* referenced via ntp_keygenOptions.pzCopyNotice */
1321  puts(_("Permission to use, copy, modify, and distribute this software and its\n\
1322documentation for any purpose with or without fee is hereby granted,\n\
1323provided that the above copyright notice appears in all copies and that\n\
1324both the copyright notice and this permission notice appear in supporting\n\
1325documentation, and that the name The University of Delaware not be used in\n\
1326advertising or publicity pertaining to distribution of the software without\n\
1327specific, written prior permission.  The University of Delaware and Network\n\
1328Time Foundation makes no representations about the suitability this\n\
1329software for any purpose.  It is provided \"as is\" without express or\n\
1330implied warranty.\n"));
1331
1332  /* referenced via ntp_keygenOptions.pOptDesc->pzText */
1333  puts(_("identity modulus bits"));
1334
1335  /* referenced via ntp_keygenOptions.pOptDesc->pzText */
1336  puts(_("certificate scheme"));
1337
1338  /* referenced via ntp_keygenOptions.pOptDesc->pzText */
1339  puts(_("privatekey cipher"));
1340
1341  /* referenced via ntp_keygenOptions.pOptDesc->pzText */
1342  puts(_("Increase debug verbosity level"));
1343
1344  /* referenced via ntp_keygenOptions.pOptDesc->pzText */
1345  puts(_("Set the debug verbosity level"));
1346
1347  /* referenced via ntp_keygenOptions.pOptDesc->pzText */
1348  puts(_("Write IFF or GQ identity keys"));
1349
1350  /* referenced via ntp_keygenOptions.pOptDesc->pzText */
1351  puts(_("Generate GQ parameters and keys"));
1352
1353  /* referenced via ntp_keygenOptions.pOptDesc->pzText */
1354  puts(_("generate RSA host key"));
1355
1356  /* referenced via ntp_keygenOptions.pOptDesc->pzText */
1357  puts(_("generate IFF parameters"));
1358
1359  /* referenced via ntp_keygenOptions.pOptDesc->pzText */
1360  puts(_("set Autokey group name"));
1361
1362  /* referenced via ntp_keygenOptions.pOptDesc->pzText */
1363  puts(_("set certificate lifetime"));
1364
1365  /* referenced via ntp_keygenOptions.pOptDesc->pzText */
1366  puts(_("generate MD5 keys"));
1367
1368  /* referenced via ntp_keygenOptions.pOptDesc->pzText */
1369  puts(_("modulus"));
1370
1371  /* referenced via ntp_keygenOptions.pOptDesc->pzText */
1372  puts(_("generate PC private certificate"));
1373
1374  /* referenced via ntp_keygenOptions.pOptDesc->pzText */
1375  puts(_("local private password"));
1376
1377  /* referenced via ntp_keygenOptions.pOptDesc->pzText */
1378  puts(_("export IFF or GQ group keys with password"));
1379
1380  /* referenced via ntp_keygenOptions.pOptDesc->pzText */
1381  puts(_("generate sign key (RSA or DSA)"));
1382
1383  /* referenced via ntp_keygenOptions.pOptDesc->pzText */
1384  puts(_("set host and optionally group name"));
1385
1386  /* referenced via ntp_keygenOptions.pOptDesc->pzText */
1387  puts(_("trusted certificate (TC scheme)"));
1388
1389  /* referenced via ntp_keygenOptions.pOptDesc->pzText */
1390  puts(_("generate <num> MV parameters"));
1391
1392  /* referenced via ntp_keygenOptions.pOptDesc->pzText */
1393  puts(_("update <num> MV keys"));
1394
1395  /* referenced via ntp_keygenOptions.pOptDesc->pzText */
1396  puts(_("display extended usage information and exit"));
1397
1398  /* referenced via ntp_keygenOptions.pOptDesc->pzText */
1399  puts(_("extended usage information passed thru pager"));
1400
1401  /* referenced via ntp_keygenOptions.pOptDesc->pzText */
1402  puts(_("output version information and exit"));
1403
1404  /* referenced via ntp_keygenOptions.pOptDesc->pzText */
1405  puts(_("save the option state to a config file"));
1406
1407  /* referenced via ntp_keygenOptions.pOptDesc->pzText */
1408  puts(_("load options from a config file"));
1409
1410  /* referenced via ntp_keygenOptions.pzUsageTitle */
1411  puts(_("ntp-keygen (ntp) - Create a NTP host key - Ver. 4.2.8p9\n\
1412Usage:  %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]...\n"));
1413
1414  /* referenced via ntp_keygenOptions.pzExplain */
1415  puts(_("\n"));
1416
1417  /* referenced via ntp_keygenOptions.pzFullVersion */
1418  puts(_("ntp-keygen (ntp) 4.2.8p9"));
1419
1420  /* referenced via ntp_keygenOptions.pzFullUsage */
1421  puts(_("<<<NOT-FOUND>>>"));
1422
1423  /* referenced via ntp_keygenOptions.pzShortUsage */
1424  puts(_("<<<NOT-FOUND>>>"));
1425  /* LIBOPTS-MESSAGES: */
1426#line 67 "../autoopts.c"
1427  puts(_("allocation of %d bytes failed\n"));
1428#line 93 "../autoopts.c"
1429  puts(_("allocation of %d bytes failed\n"));
1430#line 53 "../init.c"
1431  puts(_("AutoOpts function called without option descriptor\n"));
1432#line 86 "../init.c"
1433  puts(_("\tThis exceeds the compiled library version:  "));
1434#line 84 "../init.c"
1435  puts(_("Automated Options Processing Error!\n"
1436       "\t%s called AutoOpts function with structure version %d:%d:%d.\n"));
1437#line 80 "../autoopts.c"
1438  puts(_("realloc of %d bytes at 0x%p failed\n"));
1439#line 88 "../init.c"
1440  puts(_("\tThis is less than the minimum library version:  "));
1441#line 121 "../version.c"
1442  puts(_("Automated Options version %s\n"
1443       "\tCopyright (C) 1999-2014 by Bruce Korb - all rights reserved\n"));
1444#line 87 "../makeshell.c"
1445  puts(_("(AutoOpts bug):  %s.\n"));
1446#line 90 "../reset.c"
1447  puts(_("optionResetOpt() called, but reset-option not configured"));
1448#line 292 "../usage.c"
1449  puts(_("could not locate the 'help' option"));
1450#line 336 "../autoopts.c"
1451  puts(_("optionProcess() was called with invalid data"));
1452#line 748 "../usage.c"
1453  puts(_("invalid argument type specified"));
1454#line 598 "../find.c"
1455  puts(_("defaulted to option with optional arg"));
1456#line 76 "../alias.c"
1457  puts(_("aliasing option is out of range."));
1458#line 234 "../enum.c"
1459  puts(_("%s error:  the keyword '%s' is ambiguous for %s\n"));
1460#line 108 "../find.c"
1461  puts(_("  The following options match:\n"));
1462#line 293 "../find.c"
1463  puts(_("%s: ambiguous option name: %s (matches %d options)\n"));
1464#line 161 "../check.c"
1465  puts(_("%s: Command line arguments required\n"));
1466#line 43 "../alias.c"
1467  puts(_("%d %s%s options allowed\n"));
1468#line 94 "../makeshell.c"
1469  puts(_("%s error %d (%s) calling %s for '%s'\n"));
1470#line 306 "../makeshell.c"
1471  puts(_("interprocess pipe"));
1472#line 168 "../version.c"
1473  puts(_("error: version option argument '%c' invalid.  Use:\n"
1474       "\t'v' - version only\n"
1475       "\t'c' - version and copyright\n"
1476       "\t'n' - version and full copyright notice\n"));
1477#line 58 "../check.c"
1478  puts(_("%s error:  the '%s' and '%s' options conflict\n"));
1479#line 217 "../find.c"
1480  puts(_("%s: The '%s' option has been disabled."));
1481#line 430 "../find.c"
1482  puts(_("%s: The '%s' option has been disabled."));
1483#line 38 "../alias.c"
1484  puts(_("-equivalence"));
1485#line 469 "../find.c"
1486  puts(_("%s: illegal option -- %c\n"));
1487#line 110 "../reset.c"
1488  puts(_("%s: illegal option -- %c\n"));
1489#line 271 "../find.c"
1490  puts(_("%s: illegal option -- %s\n"));
1491#line 755 "../find.c"
1492  puts(_("%s: illegal option -- %s\n"));
1493#line 118 "../reset.c"
1494  puts(_("%s: illegal option -- %s\n"));
1495#line 335 "../find.c"
1496  puts(_("%s: unknown vendor extension option -- %s\n"));
1497#line 159 "../enum.c"
1498  puts(_("  or an integer from %d through %d\n"));
1499#line 169 "../enum.c"
1500  puts(_("  or an integer from %d through %d\n"));
1501#line 747 "../usage.c"
1502  puts(_("%s error:  invalid option descriptor for %s\n"));
1503#line 1081 "../usage.c"
1504  puts(_("%s error:  invalid option descriptor for %s\n"));
1505#line 385 "../find.c"
1506  puts(_("%s: invalid option name: %s\n"));
1507#line 527 "../find.c"
1508  puts(_("%s: The '%s' option requires an argument.\n"));
1509#line 156 "../autoopts.c"
1510  puts(_("(AutoOpts bug):  Equivalenced option '%s' was equivalenced to both\n"
1511       "\t'%s' and '%s'."));
1512#line 94 "../check.c"
1513  puts(_("%s error:  The %s option is required\n"));
1514#line 632 "../find.c"
1515  puts(_("%s: The '%s' option cannot have an argument.\n"));
1516#line 151 "../check.c"
1517  puts(_("%s: Command line arguments are not allowed.\n"));
1518#line 535 "../save.c"
1519  puts(_("error %d (%s) creating %s\n"));
1520#line 234 "../enum.c"
1521  puts(_("%s error:  '%s' does not match any %s keywords.\n"));
1522#line 93 "../reset.c"
1523  puts(_("%s error: The '%s' option requires an argument.\n"));
1524#line 184 "../save.c"
1525  puts(_("error %d (%s) stat-ing %s\n"));
1526#line 238 "../save.c"
1527  puts(_("error %d (%s) stat-ing %s\n"));
1528#line 143 "../restore.c"
1529  puts(_("%s error: no saved option state\n"));
1530#line 231 "../autoopts.c"
1531  puts(_("'%s' is not a command line option.\n"));
1532#line 111 "../time.c"
1533  puts(_("%s error:  '%s' is not a recognizable date/time.\n"));
1534#line 132 "../save.c"
1535  puts(_("'%s' not defined\n"));
1536#line 50 "../time.c"
1537  puts(_("%s error:  '%s' is not a recognizable time duration.\n"));
1538#line 92 "../check.c"
1539  puts(_("%s error:  The %s option must appear %d times.\n"));
1540#line 164 "../numeric.c"
1541  puts(_("%s error:  '%s' is not a recognizable number.\n"));
1542#line 200 "../enum.c"
1543  puts(_("%s error:  %s exceeds %s keyword count\n"));
1544#line 330 "../usage.c"
1545  puts(_("Try '%s %s' for more information.\n"));
1546#line 45 "../alias.c"
1547  puts(_("one %s%s option allowed\n"));
1548#line 208 "../makeshell.c"
1549  puts(_("standard output"));
1550#line 943 "../makeshell.c"
1551  puts(_("standard output"));
1552#line 274 "../usage.c"
1553  puts(_("standard output"));
1554#line 415 "../usage.c"
1555  puts(_("standard output"));
1556#line 625 "../usage.c"
1557  puts(_("standard output"));
1558#line 175 "../version.c"
1559  puts(_("standard output"));
1560#line 274 "../usage.c"
1561  puts(_("standard error"));
1562#line 415 "../usage.c"
1563  puts(_("standard error"));
1564#line 625 "../usage.c"
1565  puts(_("standard error"));
1566#line 175 "../version.c"
1567  puts(_("standard error"));
1568#line 208 "../makeshell.c"
1569  puts(_("write"));
1570#line 943 "../makeshell.c"
1571  puts(_("write"));
1572#line 273 "../usage.c"
1573  puts(_("write"));
1574#line 414 "../usage.c"
1575  puts(_("write"));
1576#line 624 "../usage.c"
1577  puts(_("write"));
1578#line 174 "../version.c"
1579  puts(_("write"));
1580#line 60 "../numeric.c"
1581  puts(_("%s error:  %s option value %ld is out of range.\n"));
1582#line 44 "../check.c"
1583  puts(_("%s error:  %s option requires the %s option\n"));
1584#line 131 "../save.c"
1585  puts(_("%s warning:  cannot save options - %s not regular file\n"));
1586#line 183 "../save.c"
1587  puts(_("%s warning:  cannot save options - %s not regular file\n"));
1588#line 237 "../save.c"
1589  puts(_("%s warning:  cannot save options - %s not regular file\n"));
1590#line 256 "../save.c"
1591  puts(_("%s warning:  cannot save options - %s not regular file\n"));
1592#line 534 "../save.c"
1593  puts(_("%s warning:  cannot save options - %s not regular file\n"));
1594  /* END-LIBOPTS-MESSAGES */
1595
1596  /* USAGE-TEXT: */
1597#line 873 "../usage.c"
1598  puts(_("\t\t\t\t- an alternate for '%s'\n"));
1599#line 1148 "../usage.c"
1600  puts(_("Version, usage and configuration options:"));
1601#line 924 "../usage.c"
1602  puts(_("\t\t\t\t- default option for unnamed options\n"));
1603#line 837 "../usage.c"
1604  puts(_("\t\t\t\t- disabled as '--%s'\n"));
1605#line 1117 "../usage.c"
1606  puts(_(" --- %-14s %s\n"));
1607#line 1115 "../usage.c"
1608  puts(_("This option has been disabled"));
1609#line 864 "../usage.c"
1610  puts(_("\t\t\t\t- enabled by default\n"));
1611#line 40 "../alias.c"
1612  puts(_("%s error:  only "));
1613#line 1194 "../usage.c"
1614  puts(_(" - examining environment variables named %s_*\n"));
1615#line 168 "../file.c"
1616  puts(_("\t\t\t\t- file must not pre-exist\n"));
1617#line 172 "../file.c"
1618  puts(_("\t\t\t\t- file must pre-exist\n"));
1619#line 380 "../usage.c"
1620  puts(_("Options are specified by doubled hyphens and their name or by a single\n"
1621       "hyphen and the flag character.\n"));
1622#line 921 "../makeshell.c"
1623  puts(_("\n"
1624       "= = = = = = = =\n\n"
1625       "This incarnation of genshell will produce\n"
1626       "a shell script to parse the options for %s:\n\n"));
1627#line 166 "../enum.c"
1628  puts(_("  or an integer mask with any of the lower %d bits set\n"));
1629#line 897 "../usage.c"
1630  puts(_("\t\t\t\t- is a set membership option\n"));
1631#line 918 "../usage.c"
1632  puts(_("\t\t\t\t- must appear between %d and %d times\n"));
1633#line 382 "../usage.c"
1634  puts(_("Options are specified by single or double hyphens and their name.\n"));
1635#line 904 "../usage.c"
1636  puts(_("\t\t\t\t- may appear multiple times\n"));
1637#line 891 "../usage.c"
1638  puts(_("\t\t\t\t- may not be preset\n"));
1639#line 1309 "../usage.c"
1640  puts(_("   Arg Option-Name    Description\n"));
1641#line 1245 "../usage.c"
1642  puts(_("  Flg Arg Option-Name    Description\n"));
1643#line 1303 "../usage.c"
1644  puts(_("  Flg Arg Option-Name    Description\n"));
1645#line 1304 "../usage.c"
1646  puts(_(" %3s %s"));
1647#line 1310 "../usage.c"
1648  puts(_(" %3s %s"));
1649#line 387 "../usage.c"
1650  puts(_("The '-#<number>' option may omit the hash char\n"));
1651#line 383 "../usage.c"
1652  puts(_("All arguments are named options.\n"));
1653#line 971 "../usage.c"
1654  puts(_(" - reading file %s"));
1655#line 409 "../usage.c"
1656  puts(_("\n"
1657       "Please send bug reports to:  <%s>\n"));
1658#line 100 "../version.c"
1659  puts(_("\n"
1660       "Please send bug reports to:  <%s>\n"));
1661#line 129 "../version.c"
1662  puts(_("\n"
1663       "Please send bug reports to:  <%s>\n"));
1664#line 903 "../usage.c"
1665  puts(_("\t\t\t\t- may NOT appear - preset only\n"));
1666#line 944 "../usage.c"
1667  puts(_("\n"
1668       "The following option preset mechanisms are supported:\n"));
1669#line 1192 "../usage.c"
1670  puts(_("\n"
1671       "The following option preset mechanisms are supported:\n"));
1672#line 682 "../usage.c"
1673  puts(_("prohibits these options:\n"));
1674#line 677 "../usage.c"
1675  puts(_("prohibits the option '%s'\n"));
1676#line 81 "../numeric.c"
1677  puts(_("%s%ld to %ld"));
1678#line 79 "../numeric.c"
1679  puts(_("%sgreater than or equal to %ld"));
1680#line 75 "../numeric.c"
1681  puts(_("%s%ld exactly"));
1682#line 68 "../numeric.c"
1683  puts(_("%sit must lie in one of the ranges:\n"));
1684#line 68 "../numeric.c"
1685  puts(_("%sit must be in the range:\n"));
1686#line 88 "../numeric.c"
1687  puts(_(", or\n"));
1688#line 66 "../numeric.c"
1689  puts(_("%sis scalable with a suffix: k/K/m/M/g/G/t/T\n"));
1690#line 77 "../numeric.c"
1691  puts(_("%sless than or equal to %ld"));
1692#line 390 "../usage.c"
1693  puts(_("Operands and options may be intermixed.  They will be reordered.\n"));
1694#line 652 "../usage.c"
1695  puts(_("requires the option '%s'\n"));
1696#line 655 "../usage.c"
1697  puts(_("requires these options:\n"));
1698#line 1321 "../usage.c"
1699  puts(_("   Arg Option-Name   Req?  Description\n"));
1700#line 1315 "../usage.c"
1701  puts(_("  Flg Arg Option-Name   Req?  Description\n"));
1702#line 167 "../enum.c"
1703  puts(_("or you may use a numeric representation.  Preceding these with a '!'\n"
1704       "will clear the bits, specifying 'none' will clear all bits, and 'all'\n"
1705       "will set them all.  Multiple entries may be passed as an option\n"
1706       "argument list.\n"));
1707#line 910 "../usage.c"
1708  puts(_("\t\t\t\t- may appear up to %d times\n"));
1709#line 77 "../enum.c"
1710  puts(_("The valid \"%s\" option keywords are:\n"));
1711#line 1152 "../usage.c"
1712  puts(_("The next option supports vendor supported extra options:"));
1713#line 773 "../usage.c"
1714  puts(_("These additional options are:"));
1715  /* END-USAGE-TEXT */
1716}
1717#endif /* uncompilable code */
1718#ifdef  __cplusplus
1719}
1720#endif
1721/* ntp-keygen-opts.c ends here */
1722