ntp-keygen-opts.c revision 330567
1135446Strhodes/* 2174187Sdougb * EDIT THIS FILE WITH CAUTION (ntp-keygen-opts.c) 3135446Strhodes * 4135446Strhodes * It has been AutoGen-ed February 27, 2018 at 05:15:44 PM by AutoGen 5.18.5 5174187Sdougb * From the definitions ntp-keygen-opts.def 6135446Strhodes * and the template file options 7135446Strhodes * 8135446Strhodes * Generated from AutoOpts 41:0:16 templates. 9135446Strhodes * 10135446Strhodes * AutoOpts is a copyrighted work. This source file is not encumbered 11135446Strhodes * by AutoOpts licensing, but is provided under the licensing terms chosen 12135446Strhodes * by the ntp-keygen author or copyright holder. AutoOpts is 13135446Strhodes * licensed under the terms of the LGPL. The redistributable library 14135446Strhodes * (``libopts'') is licensed under the terms of either the LGPL or, at the 15135446Strhodes * users discretion, the BSD license. See the AutoOpts and/or libopts sources 16135446Strhodes * for details. 17135446Strhodes * 18174187Sdougb * The ntp-keygen program is copyrighted and licensed 19135446Strhodes * under the following terms: 20135446Strhodes * 21135446Strhodes * Copyright (C) 1992-2017 The University of Delaware and Network Time Foundation, all rights reserved. 22135446Strhodes * This is free software. It is licensed for use, modification and 23135446Strhodes * redistribution under the terms of the NTP License, copies of which 24135446Strhodes * can be seen at: 25135446Strhodes * <http://ntp.org/license> 26135446Strhodes * <http://opensource.org/licenses/ntp-license.php> 27135446Strhodes * 28135446Strhodes * Permission to use, copy, modify, and distribute this software and its 29135446Strhodes * documentation for any purpose with or without fee is hereby granted, 30135446Strhodes * provided that the above copyright notice appears in all copies and that 31135446Strhodes * both the copyright notice and this permission notice appear in 32135446Strhodes * supporting documentation, and that the name The University of Delaware not be used in 33135446Strhodes * advertising or publicity pertaining to distribution of the software 34135446Strhodes * without specific, written prior permission. The University of Delaware and Network Time Foundation makes no 35135446Strhodes * representations about the suitability this software for any purpose. It 36135446Strhodes * is provided "as is" without express or implied warranty. 37135446Strhodes */ 38135446Strhodes 39135446Strhodes#ifndef __doxygen__ 40135446Strhodes#define OPTION_CODE_COMPILE 1 41135446Strhodes#include "ntp-keygen-opts.h" 42135446Strhodes#include <sys/types.h> 43135446Strhodes 44135446Strhodes#include <limits.h> 45135446Strhodes#include <stdio.h> 46135446Strhodes#include <stdlib.h> 47135446Strhodes#include <errno.h> 48135446Strhodes 49135446Strhodes#ifdef __cplusplus 50135446Strhodesextern "C" { 51135446Strhodes#endif 52135446Strhodesextern FILE * option_usage_fp; 53170222Sdougb#define zCopyright (ntp_keygen_opt_strs+0) 54170222Sdougb#define zLicenseDescrip (ntp_keygen_opt_strs+353) 55135446Strhodes 56135446Strhodes/* 57135446Strhodes * global included definitions 58135446Strhodes */ 59135446Strhodes#include <stdlib.h> 60135446Strhodes 61135446Strhodes#ifdef __windows 62135446Strhodes extern int atoi(const char*); 63135446Strhodes#else 64135446Strhodes# include <stdlib.h> 65135446Strhodes#endif 66135446Strhodes 67135446Strhodes#ifndef NULL 68135446Strhodes# define NULL 0 69135446Strhodes#endif 70135446Strhodes 71135446Strhodes/** 72135446Strhodes * static const strings for ntp-keygen options 73135446Strhodes */ 74135446Strhodesstatic char const ntp_keygen_opt_strs[2442] = 75135446Strhodes/* 0 */ "ntp-keygen (ntp) 4.2.8p11\n" 76135446Strhodes "Copyright (C) 1992-2017 The University of Delaware and Network Time Foundation, all rights reserved.\n" 77135446Strhodes "This is free software. It is licensed for use, modification and\n" 78135446Strhodes "redistribution under the terms of the NTP License, copies of which\n" 79135446Strhodes "can be seen at:\n" 80135446Strhodes " <http://ntp.org/license>\n" 81135446Strhodes " <http://opensource.org/licenses/ntp-license.php>\n\0" 82135446Strhodes/* 353 */ "Permission to use, copy, modify, and distribute this software and its\n" 83135446Strhodes "documentation for any purpose with or without fee is hereby granted,\n" 84135446Strhodes "provided that the above copyright notice appears in all copies and that\n" 85135446Strhodes "both the copyright notice and this permission notice appear in supporting\n" 86135446Strhodes "documentation, and that the name The University of Delaware not be used in\n" 87135446Strhodes "advertising or publicity pertaining to distribution of the software without\n" 88135446Strhodes "specific, written prior permission. The University of Delaware and Network\n" 89135446Strhodes "Time Foundation makes no representations about the suitability this\n" 90135446Strhodes "software for any purpose. It is provided \"as is\" without express or\n" 91135446Strhodes "implied warranty.\n\0" 92135446Strhodes/* 1021 */ "identity modulus bits\0" 93135446Strhodes/* 1043 */ "IMBITS\0" 94135446Strhodes/* 1050 */ "imbits\0" 95135446Strhodes/* 1057 */ "certificate scheme\0" 96135446Strhodes/* 1076 */ "CERTIFICATE\0" 97135446Strhodes/* 1088 */ "certificate\0" 98135446Strhodes/* 1100 */ "privatekey cipher\0" 99135446Strhodes/* 1118 */ "CIPHER\0" 100135446Strhodes/* 1125 */ "cipher\0" 101135446Strhodes/* 1132 */ "Increase debug verbosity level\0" 102135446Strhodes/* 1163 */ "DEBUG_LEVEL\0" 103135446Strhodes/* 1175 */ "debug-level\0" 104135446Strhodes/* 1187 */ "Set the debug verbosity level\0" 105135446Strhodes/* 1217 */ "SET_DEBUG_LEVEL\0" 106135446Strhodes/* 1233 */ "set-debug-level\0" 107135446Strhodes/* 1249 */ "Write IFF or GQ identity keys\0" 108135446Strhodes/* 1279 */ "ID_KEY\0" 109135446Strhodes/* 1286 */ "id-key\0" 110135446Strhodes/* 1293 */ "Generate GQ parameters and keys\0" 111135446Strhodes/* 1325 */ "GQ_PARAMS\0" 112135446Strhodes/* 1335 */ "gq-params\0" 113135446Strhodes/* 1345 */ "generate RSA host key\0" 114135446Strhodes/* 1367 */ "HOST_KEY\0" 115135446Strhodes/* 1376 */ "host-key\0" 116135446Strhodes/* 1385 */ "generate IFF parameters\0" 117135446Strhodes/* 1409 */ "IFFKEY\0" 118135446Strhodes/* 1416 */ "iffkey\0" 119135446Strhodes/* 1423 */ "set Autokey group name\0" 120135446Strhodes/* 1446 */ "IDENT\0" 121135446Strhodes/* 1452 */ "ident\0" 122135446Strhodes/* 1458 */ "set certificate lifetime\0" 123135446Strhodes/* 1483 */ "LIFETIME\0" 124135446Strhodes/* 1492 */ "lifetime\0" 125135446Strhodes/* 1501 */ "prime modulus\0" 126135446Strhodes/* 1515 */ "MODULUS\0" 127135446Strhodes/* 1523 */ "modulus\0" 128135446Strhodes/* 1531 */ "generate symmetric keys\0" 129135446Strhodes/* 1555 */ "MD5KEY\0" 130135446Strhodes/* 1562 */ "md5key\0" 131135446Strhodes/* 1569 */ "generate PC private certificate\0" 132135446Strhodes/* 1601 */ "PVT_CERT\0" 133135446Strhodes/* 1610 */ "pvt-cert\0" 134135446Strhodes/* 1619 */ "local private password\0" 135135446Strhodes/* 1642 */ "PASSWORD\0" 136135446Strhodes/* 1651 */ "password\0" 137135446Strhodes/* 1660 */ "export IFF or GQ group keys with password\0" 138135446Strhodes/* 1702 */ "EXPORT_PASSWD\0" 139135446Strhodes/* 1716 */ "export-passwd\0" 140135446Strhodes/* 1730 */ "set host and optionally group name\0" 141135446Strhodes/* 1765 */ "SUBJECT_NAME\0" 142135446Strhodes/* 1778 */ "subject-name\0" 143135446Strhodes/* 1791 */ "generate sign key (RSA or DSA)\0" 144135446Strhodes/* 1822 */ "SIGN_KEY\0" 145135446Strhodes/* 1831 */ "sign-key\0" 146135446Strhodes/* 1840 */ "trusted certificate (TC scheme)\0" 147135446Strhodes/* 1872 */ "TRUSTED_CERT\0" 148135446Strhodes/* 1885 */ "trusted-cert\0" 149135446Strhodes/* 1898 */ "generate <num> MV parameters\0" 150135446Strhodes/* 1927 */ "MV_PARAMS\0" 151135446Strhodes/* 1937 */ "mv-params\0" 152135446Strhodes/* 1947 */ "update <num> MV keys\0" 153135446Strhodes/* 1968 */ "MV_KEYS\0" 154135446Strhodes/* 1976 */ "mv-keys\0" 155135446Strhodes/* 1984 */ "display extended usage information and exit\0" 156135446Strhodes/* 2028 */ "help\0" 157135446Strhodes/* 2033 */ "extended usage information passed thru pager\0" 158135446Strhodes/* 2078 */ "more-help\0" 159135446Strhodes/* 2088 */ "output version information and exit\0" 160135446Strhodes/* 2124 */ "version\0" 161135446Strhodes/* 2132 */ "save the option state to a config file\0" 162135446Strhodes/* 2171 */ "save-opts\0" 163135446Strhodes/* 2181 */ "load options from a config file\0" 164135446Strhodes/* 2213 */ "LOAD_OPTS\0" 165135446Strhodes/* 2223 */ "no-load-opts\0" 166135446Strhodes/* 2236 */ "no\0" 167135446Strhodes/* 2239 */ "NTP_KEYGEN\0" 168135446Strhodes/* 2250 */ "ntp-keygen (ntp) - Create a NTP host key - Ver. 4.2.8p11\n" 169135446Strhodes "Usage: %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]...\n\0" 170135446Strhodes/* 2365 */ "$HOME\0" 171135446Strhodes/* 2371 */ ".\0" 172135446Strhodes/* 2373 */ ".ntprc\0" 173135446Strhodes/* 2380 */ "http://bugs.ntp.org, bugs@ntp.org\0" 174135446Strhodes/* 2414 */ "\n\0" 175135446Strhodes/* 2416 */ "ntp-keygen (ntp) 4.2.8p11"; 176135446Strhodes 177135446Strhodes/** 178135446Strhodes * imbits option description: 179135446Strhodes */ 180135446Strhodes#ifdef AUTOKEY 181135446Strhodes/** Descriptive text for the imbits option */ 182135446Strhodes#define IMBITS_DESC (ntp_keygen_opt_strs+1021) 183135446Strhodes/** Upper-cased name for the imbits option */ 184135446Strhodes#define IMBITS_NAME (ntp_keygen_opt_strs+1043) 185135446Strhodes/** Name string for the imbits option */ 186135446Strhodes#define IMBITS_name (ntp_keygen_opt_strs+1050) 187135446Strhodes/** Compiled in flag settings for the imbits option */ 188135446Strhodes#define IMBITS_FLAGS (OPTST_DISABLED \ 189135446Strhodes | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC)) 190135446Strhodes 191135446Strhodes#else /* disable imbits */ 192135446Strhodes#define IMBITS_FLAGS (OPTST_OMITTED | OPTST_NO_INIT) 193135446Strhodes#define IMBITS_NAME NULL 194135446Strhodes#define IMBITS_DESC NULL 195135446Strhodes#define IMBITS_name NULL 196135446Strhodes#endif /* AUTOKEY */ 197135446Strhodes 198135446Strhodes/** 199135446Strhodes * certificate option description: 200135446Strhodes */ 201135446Strhodes#ifdef AUTOKEY 202135446Strhodes/** Descriptive text for the certificate option */ 203135446Strhodes#define CERTIFICATE_DESC (ntp_keygen_opt_strs+1057) 204135446Strhodes/** Upper-cased name for the certificate option */ 205135446Strhodes#define CERTIFICATE_NAME (ntp_keygen_opt_strs+1076) 206135446Strhodes/** Name string for the certificate option */ 207135446Strhodes#define CERTIFICATE_name (ntp_keygen_opt_strs+1088) 208135446Strhodes/** Compiled in flag settings for the certificate option */ 209135446Strhodes#define CERTIFICATE_FLAGS (OPTST_DISABLED \ 210135446Strhodes | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) 211135446Strhodes 212135446Strhodes#else /* disable certificate */ 213135446Strhodes#define CERTIFICATE_FLAGS (OPTST_OMITTED | OPTST_NO_INIT) 214135446Strhodes#define CERTIFICATE_NAME NULL 215135446Strhodes#define CERTIFICATE_DESC NULL 216135446Strhodes#define CERTIFICATE_name NULL 217135446Strhodes#endif /* AUTOKEY */ 218135446Strhodes 219135446Strhodes/** 220135446Strhodes * cipher option description: 221135446Strhodes */ 222135446Strhodes#ifdef AUTOKEY 223135446Strhodes/** Descriptive text for the cipher option */ 224135446Strhodes#define CIPHER_DESC (ntp_keygen_opt_strs+1100) 225135446Strhodes/** Upper-cased name for the cipher option */ 226135446Strhodes#define CIPHER_NAME (ntp_keygen_opt_strs+1118) 227135446Strhodes/** Name string for the cipher option */ 228135446Strhodes#define CIPHER_name (ntp_keygen_opt_strs+1125) 229135446Strhodes/** Compiled in flag settings for the cipher option */ 230135446Strhodes#define CIPHER_FLAGS (OPTST_DISABLED \ 231135446Strhodes | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) 232135446Strhodes 233135446Strhodes#else /* disable cipher */ 234135446Strhodes#define CIPHER_FLAGS (OPTST_OMITTED | OPTST_NO_INIT) 235135446Strhodes#define CIPHER_NAME NULL 236135446Strhodes#define CIPHER_DESC NULL 237135446Strhodes#define CIPHER_name NULL 238135446Strhodes#endif /* AUTOKEY */ 239135446Strhodes 240135446Strhodes/** 241135446Strhodes * debug-level option description: 242135446Strhodes */ 243135446Strhodes/** Descriptive text for the debug-level option */ 244135446Strhodes#define DEBUG_LEVEL_DESC (ntp_keygen_opt_strs+1132) 245135446Strhodes/** Upper-cased name for the debug-level option */ 246135446Strhodes#define DEBUG_LEVEL_NAME (ntp_keygen_opt_strs+1163) 247135446Strhodes/** Name string for the debug-level option */ 248135446Strhodes#define DEBUG_LEVEL_name (ntp_keygen_opt_strs+1175) 249135446Strhodes/** Compiled in flag settings for the debug-level option */ 250135446Strhodes#define DEBUG_LEVEL_FLAGS (OPTST_DISABLED) 251135446Strhodes 252135446Strhodes/** 253135446Strhodes * set-debug-level option description: 254135446Strhodes */ 255135446Strhodes/** Descriptive text for the set-debug-level option */ 256135446Strhodes#define SET_DEBUG_LEVEL_DESC (ntp_keygen_opt_strs+1187) 257135446Strhodes/** Upper-cased name for the set-debug-level option */ 258135446Strhodes#define SET_DEBUG_LEVEL_NAME (ntp_keygen_opt_strs+1217) 259135446Strhodes/** Name string for the set-debug-level option */ 260135446Strhodes#define SET_DEBUG_LEVEL_name (ntp_keygen_opt_strs+1233) 261135446Strhodes/** Compiled in flag settings for the set-debug-level option */ 262135446Strhodes#define SET_DEBUG_LEVEL_FLAGS (OPTST_DISABLED \ 263135446Strhodes | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC)) 264135446Strhodes 265135446Strhodes/** 266135446Strhodes * id-key option description: 267135446Strhodes */ 268135446Strhodes#ifdef AUTOKEY 269135446Strhodes/** Descriptive text for the id-key option */ 270135446Strhodes#define ID_KEY_DESC (ntp_keygen_opt_strs+1249) 271135446Strhodes/** Upper-cased name for the id-key option */ 272135446Strhodes#define ID_KEY_NAME (ntp_keygen_opt_strs+1279) 273135446Strhodes/** Name string for the id-key option */ 274135446Strhodes#define ID_KEY_name (ntp_keygen_opt_strs+1286) 275135446Strhodes/** Compiled in flag settings for the id-key option */ 276135446Strhodes#define ID_KEY_FLAGS (OPTST_DISABLED) 277135446Strhodes 278135446Strhodes#else /* disable id-key */ 279135446Strhodes#define ID_KEY_FLAGS (OPTST_OMITTED | OPTST_NO_INIT) 280135446Strhodes#define ID_KEY_NAME NULL 281135446Strhodes#define ID_KEY_DESC NULL 282135446Strhodes#define ID_KEY_name NULL 283135446Strhodes#endif /* AUTOKEY */ 284135446Strhodes 285135446Strhodes/** 286135446Strhodes * gq-params option description: 287135446Strhodes */ 288135446Strhodes#ifdef AUTOKEY 289135446Strhodes/** Descriptive text for the gq-params option */ 290135446Strhodes#define GQ_PARAMS_DESC (ntp_keygen_opt_strs+1293) 291135446Strhodes/** Upper-cased name for the gq-params option */ 292135446Strhodes#define GQ_PARAMS_NAME (ntp_keygen_opt_strs+1325) 293135446Strhodes/** Name string for the gq-params option */ 294135446Strhodes#define GQ_PARAMS_name (ntp_keygen_opt_strs+1335) 295135446Strhodes/** Compiled in flag settings for the gq-params option */ 296135446Strhodes#define GQ_PARAMS_FLAGS (OPTST_DISABLED) 297135446Strhodes 298135446Strhodes#else /* disable gq-params */ 299135446Strhodes#define GQ_PARAMS_FLAGS (OPTST_OMITTED | OPTST_NO_INIT) 300135446Strhodes#define GQ_PARAMS_NAME NULL 301135446Strhodes#define GQ_PARAMS_DESC NULL 302135446Strhodes#define GQ_PARAMS_name NULL 303135446Strhodes#endif /* AUTOKEY */ 304135446Strhodes 305135446Strhodes/** 306135446Strhodes * host-key option description: 307135446Strhodes */ 308135446Strhodes#ifdef AUTOKEY 309135446Strhodes/** Descriptive text for the host-key option */ 310135446Strhodes#define HOST_KEY_DESC (ntp_keygen_opt_strs+1345) 311135446Strhodes/** Upper-cased name for the host-key option */ 312135446Strhodes#define HOST_KEY_NAME (ntp_keygen_opt_strs+1367) 313135446Strhodes/** Name string for the host-key option */ 314135446Strhodes#define HOST_KEY_name (ntp_keygen_opt_strs+1376) 315135446Strhodes/** Compiled in flag settings for the host-key option */ 316135446Strhodes#define HOST_KEY_FLAGS (OPTST_DISABLED) 317135446Strhodes 318135446Strhodes#else /* disable host-key */ 319135446Strhodes#define HOST_KEY_FLAGS (OPTST_OMITTED | OPTST_NO_INIT) 320135446Strhodes#define HOST_KEY_NAME NULL 321135446Strhodes#define HOST_KEY_DESC NULL 322135446Strhodes#define HOST_KEY_name NULL 323135446Strhodes#endif /* AUTOKEY */ 324135446Strhodes 325135446Strhodes/** 326135446Strhodes * iffkey option description: 327135446Strhodes */ 328135446Strhodes#ifdef AUTOKEY 329135446Strhodes/** Descriptive text for the iffkey option */ 330135446Strhodes#define IFFKEY_DESC (ntp_keygen_opt_strs+1385) 331135446Strhodes/** Upper-cased name for the iffkey option */ 332135446Strhodes#define IFFKEY_NAME (ntp_keygen_opt_strs+1409) 333135446Strhodes/** Name string for the iffkey option */ 334135446Strhodes#define IFFKEY_name (ntp_keygen_opt_strs+1416) 335135446Strhodes/** Compiled in flag settings for the iffkey option */ 336135446Strhodes#define IFFKEY_FLAGS (OPTST_DISABLED) 337135446Strhodes 338135446Strhodes#else /* disable iffkey */ 339135446Strhodes#define IFFKEY_FLAGS (OPTST_OMITTED | OPTST_NO_INIT) 340135446Strhodes#define IFFKEY_NAME NULL 341135446Strhodes#define IFFKEY_DESC NULL 342135446Strhodes#define IFFKEY_name NULL 343135446Strhodes#endif /* AUTOKEY */ 344135446Strhodes 345135446Strhodes/** 346135446Strhodes * ident option description: 347135446Strhodes */ 348135446Strhodes#ifdef AUTOKEY 349135446Strhodes/** Descriptive text for the ident option */ 350135446Strhodes#define IDENT_DESC (ntp_keygen_opt_strs+1423) 351135446Strhodes/** Upper-cased name for the ident option */ 352135446Strhodes#define IDENT_NAME (ntp_keygen_opt_strs+1446) 353135446Strhodes/** Name string for the ident option */ 354135446Strhodes#define IDENT_name (ntp_keygen_opt_strs+1452) 355135446Strhodes/** Compiled in flag settings for the ident option */ 356135446Strhodes#define IDENT_FLAGS (OPTST_DISABLED \ 357135446Strhodes | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) 358135446Strhodes 359135446Strhodes#else /* disable ident */ 360135446Strhodes#define IDENT_FLAGS (OPTST_OMITTED | OPTST_NO_INIT) 361135446Strhodes#define IDENT_NAME NULL 362135446Strhodes#define IDENT_DESC NULL 363135446Strhodes#define IDENT_name NULL 364135446Strhodes#endif /* AUTOKEY */ 365135446Strhodes 366135446Strhodes/** 367135446Strhodes * lifetime option description: 368135446Strhodes */ 369135446Strhodes#ifdef AUTOKEY 370135446Strhodes/** Descriptive text for the lifetime option */ 371135446Strhodes#define LIFETIME_DESC (ntp_keygen_opt_strs+1458) 372135446Strhodes/** Upper-cased name for the lifetime option */ 373135446Strhodes#define LIFETIME_NAME (ntp_keygen_opt_strs+1483) 374135446Strhodes/** Name string for the lifetime option */ 375135446Strhodes#define LIFETIME_name (ntp_keygen_opt_strs+1492) 376135446Strhodes/** Compiled in flag settings for the lifetime option */ 377135446Strhodes#define LIFETIME_FLAGS (OPTST_DISABLED \ 378135446Strhodes | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC)) 379135446Strhodes 380135446Strhodes#else /* disable lifetime */ 381135446Strhodes#define LIFETIME_FLAGS (OPTST_OMITTED | OPTST_NO_INIT) 382135446Strhodes#define LIFETIME_NAME NULL 383135446Strhodes#define LIFETIME_DESC NULL 384135446Strhodes#define LIFETIME_name NULL 385135446Strhodes#endif /* AUTOKEY */ 386135446Strhodes 387135446Strhodes/** 388135446Strhodes * modulus option description: 389135446Strhodes */ 390135446Strhodes#ifdef AUTOKEY 391135446Strhodes/** Descriptive text for the modulus option */ 392135446Strhodes#define MODULUS_DESC (ntp_keygen_opt_strs+1501) 393143731Sdougb/** Upper-cased name for the modulus option */ 394135446Strhodes#define MODULUS_NAME (ntp_keygen_opt_strs+1515) 395135446Strhodes/** Name string for the modulus option */ 396135446Strhodes#define MODULUS_name (ntp_keygen_opt_strs+1523) 397135446Strhodes/** Compiled in flag settings for the modulus option */ 398135446Strhodes#define MODULUS_FLAGS (OPTST_DISABLED \ 399135446Strhodes | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC)) 400135446Strhodes 401135446Strhodes#else /* disable modulus */ 402135446Strhodes#define MODULUS_FLAGS (OPTST_OMITTED | OPTST_NO_INIT) 403135446Strhodes#define MODULUS_NAME NULL 404135446Strhodes#define MODULUS_DESC NULL 405135446Strhodes#define MODULUS_name NULL 406135446Strhodes#endif /* AUTOKEY */ 407135446Strhodes 408135446Strhodes/** 409135446Strhodes * md5key option description: 410135446Strhodes */ 411135446Strhodes/** Descriptive text for the md5key option */ 412135446Strhodes#define MD5KEY_DESC (ntp_keygen_opt_strs+1531) 413174187Sdougb/** Upper-cased name for the md5key option */ 414174187Sdougb#define MD5KEY_NAME (ntp_keygen_opt_strs+1555) 415174187Sdougb/** Name string for the md5key option */ 416135446Strhodes#define MD5KEY_name (ntp_keygen_opt_strs+1562) 417135446Strhodes/** Compiled in flag settings for the md5key option */ 418135446Strhodes#define MD5KEY_FLAGS (OPTST_DISABLED) 419135446Strhodes 420135446Strhodes/** 421135446Strhodes * pvt-cert option description: 422135446Strhodes */ 423135446Strhodes#ifdef AUTOKEY 424135446Strhodes/** Descriptive text for the pvt-cert option */ 425135446Strhodes#define PVT_CERT_DESC (ntp_keygen_opt_strs+1569) 426135446Strhodes/** Upper-cased name for the pvt-cert option */ 427135446Strhodes#define PVT_CERT_NAME (ntp_keygen_opt_strs+1601) 428135446Strhodes/** Name string for the pvt-cert option */ 429135446Strhodes#define PVT_CERT_name (ntp_keygen_opt_strs+1610) 430135446Strhodes/** Compiled in flag settings for the pvt-cert option */ 431135446Strhodes#define PVT_CERT_FLAGS (OPTST_DISABLED) 432135446Strhodes 433135446Strhodes#else /* disable pvt-cert */ 434135446Strhodes#define PVT_CERT_FLAGS (OPTST_OMITTED | OPTST_NO_INIT) 435135446Strhodes#define PVT_CERT_NAME NULL 436135446Strhodes#define PVT_CERT_DESC NULL 437135446Strhodes#define PVT_CERT_name NULL 438135446Strhodes#endif /* AUTOKEY */ 439135446Strhodes 440135446Strhodes/** 441135446Strhodes * password option description: 442135446Strhodes */ 443135446Strhodes#ifdef AUTOKEY 444135446Strhodes/** Descriptive text for the password option */ 445135446Strhodes#define PASSWORD_DESC (ntp_keygen_opt_strs+1619) 446135446Strhodes/** Upper-cased name for the password option */ 447135446Strhodes#define PASSWORD_NAME (ntp_keygen_opt_strs+1642) 448135446Strhodes/** Name string for the password option */ 449135446Strhodes#define PASSWORD_name (ntp_keygen_opt_strs+1651) 450135446Strhodes/** Compiled in flag settings for the password option */ 451135446Strhodes#define PASSWORD_FLAGS (OPTST_DISABLED \ 452135446Strhodes | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) 453143731Sdougb 454135446Strhodes#else /* disable password */ 455135446Strhodes#define PASSWORD_FLAGS (OPTST_OMITTED | OPTST_NO_INIT) 456135446Strhodes#define PASSWORD_NAME NULL 457135446Strhodes#define PASSWORD_DESC NULL 458135446Strhodes#define PASSWORD_name NULL 459135446Strhodes#endif /* AUTOKEY */ 460135446Strhodes 461135446Strhodes/** 462135446Strhodes * export-passwd option description: 463135446Strhodes */ 464135446Strhodes#ifdef AUTOKEY 465135446Strhodes/** Descriptive text for the export-passwd option */ 466135446Strhodes#define EXPORT_PASSWD_DESC (ntp_keygen_opt_strs+1660) 467135446Strhodes/** Upper-cased name for the export-passwd option */ 468135446Strhodes#define EXPORT_PASSWD_NAME (ntp_keygen_opt_strs+1702) 469135446Strhodes/** Name string for the export-passwd option */ 470135446Strhodes#define EXPORT_PASSWD_name (ntp_keygen_opt_strs+1716) 471135446Strhodes/** Compiled in flag settings for the export-passwd option */ 472135446Strhodes#define EXPORT_PASSWD_FLAGS (OPTST_DISABLED \ 473135446Strhodes | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) 474135446Strhodes 475135446Strhodes#else /* disable export-passwd */ 476135446Strhodes#define EXPORT_PASSWD_FLAGS (OPTST_OMITTED | OPTST_NO_INIT) 477135446Strhodes#define EXPORT_PASSWD_NAME NULL 478135446Strhodes#define EXPORT_PASSWD_DESC NULL 479135446Strhodes#define EXPORT_PASSWD_name NULL 480135446Strhodes#endif /* AUTOKEY */ 481135446Strhodes 482135446Strhodes/** 483135446Strhodes * subject-name option description: 484135446Strhodes */ 485135446Strhodes#ifdef AUTOKEY 486135446Strhodes/** Descriptive text for the subject-name option */ 487135446Strhodes#define SUBJECT_NAME_DESC (ntp_keygen_opt_strs+1730) 488135446Strhodes/** Upper-cased name for the subject-name option */ 489135446Strhodes#define SUBJECT_NAME_NAME (ntp_keygen_opt_strs+1765) 490135446Strhodes/** Name string for the subject-name option */ 491135446Strhodes#define SUBJECT_NAME_name (ntp_keygen_opt_strs+1778) 492135446Strhodes/** Compiled in flag settings for the subject-name option */ 493135446Strhodes#define SUBJECT_NAME_FLAGS (OPTST_DISABLED \ 494135446Strhodes | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) 495135446Strhodes 496135446Strhodes#else /* disable subject-name */ 497135446Strhodes#define SUBJECT_NAME_FLAGS (OPTST_OMITTED | OPTST_NO_INIT) 498135446Strhodes#define SUBJECT_NAME_NAME NULL 499135446Strhodes#define SUBJECT_NAME_DESC NULL 500135446Strhodes#define SUBJECT_NAME_name NULL 501135446Strhodes#endif /* AUTOKEY */ 502135446Strhodes 503135446Strhodes/** 504135446Strhodes * sign-key option description: 505135446Strhodes */ 506135446Strhodes#ifdef AUTOKEY 507135446Strhodes/** Descriptive text for the sign-key option */ 508135446Strhodes#define SIGN_KEY_DESC (ntp_keygen_opt_strs+1791) 509135446Strhodes/** Upper-cased name for the sign-key option */ 510135446Strhodes#define SIGN_KEY_NAME (ntp_keygen_opt_strs+1822) 511135446Strhodes/** Name string for the sign-key option */ 512135446Strhodes#define SIGN_KEY_name (ntp_keygen_opt_strs+1831) 513135446Strhodes/** Compiled in flag settings for the sign-key option */ 514135446Strhodes#define SIGN_KEY_FLAGS (OPTST_DISABLED \ 515135446Strhodes | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) 516135446Strhodes 517135446Strhodes#else /* disable sign-key */ 518135446Strhodes#define SIGN_KEY_FLAGS (OPTST_OMITTED | OPTST_NO_INIT) 519135446Strhodes#define SIGN_KEY_NAME NULL 520135446Strhodes#define SIGN_KEY_DESC NULL 521135446Strhodes#define SIGN_KEY_name NULL 522135446Strhodes#endif /* AUTOKEY */ 523135446Strhodes 524135446Strhodes/** 525135446Strhodes * trusted-cert option description: 526135446Strhodes */ 527135446Strhodes#ifdef AUTOKEY 528135446Strhodes/** Descriptive text for the trusted-cert option */ 529135446Strhodes#define TRUSTED_CERT_DESC (ntp_keygen_opt_strs+1840) 530135446Strhodes/** Upper-cased name for the trusted-cert option */ 531135446Strhodes#define TRUSTED_CERT_NAME (ntp_keygen_opt_strs+1872) 532135446Strhodes/** Name string for the trusted-cert option */ 533135446Strhodes#define TRUSTED_CERT_name (ntp_keygen_opt_strs+1885) 534135446Strhodes/** Compiled in flag settings for the trusted-cert option */ 535135446Strhodes#define TRUSTED_CERT_FLAGS (OPTST_DISABLED) 536135446Strhodes 537135446Strhodes#else /* disable trusted-cert */ 538135446Strhodes#define TRUSTED_CERT_FLAGS (OPTST_OMITTED | OPTST_NO_INIT) 539135446Strhodes#define TRUSTED_CERT_NAME NULL 540135446Strhodes#define TRUSTED_CERT_DESC NULL 541135446Strhodes#define TRUSTED_CERT_name NULL 542135446Strhodes#endif /* AUTOKEY */ 543135446Strhodes 544135446Strhodes/** 545135446Strhodes * mv-params option description: 546135446Strhodes */ 547135446Strhodes#ifdef AUTOKEY 548135446Strhodes/** Descriptive text for the mv-params option */ 549135446Strhodes#define MV_PARAMS_DESC (ntp_keygen_opt_strs+1898) 550135446Strhodes/** Upper-cased name for the mv-params option */ 551135446Strhodes#define MV_PARAMS_NAME (ntp_keygen_opt_strs+1927) 552135446Strhodes/** Name string for the mv-params option */ 553135446Strhodes#define MV_PARAMS_name (ntp_keygen_opt_strs+1937) 554135446Strhodes/** Compiled in flag settings for the mv-params option */ 555135446Strhodes#define MV_PARAMS_FLAGS (OPTST_DISABLED \ 556135446Strhodes | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC)) 557135446Strhodes 558135446Strhodes#else /* disable mv-params */ 559135446Strhodes#define MV_PARAMS_FLAGS (OPTST_OMITTED | OPTST_NO_INIT) 560135446Strhodes#define MV_PARAMS_NAME NULL 561135446Strhodes#define MV_PARAMS_DESC NULL 562135446Strhodes#define MV_PARAMS_name NULL 563135446Strhodes#endif /* AUTOKEY */ 564135446Strhodes 565135446Strhodes/** 566135446Strhodes * mv-keys option description: 567135446Strhodes */ 568135446Strhodes#ifdef AUTOKEY 569135446Strhodes/** Descriptive text for the mv-keys option */ 570135446Strhodes#define MV_KEYS_DESC (ntp_keygen_opt_strs+1947) 571135446Strhodes/** Upper-cased name for the mv-keys option */ 572135446Strhodes#define MV_KEYS_NAME (ntp_keygen_opt_strs+1968) 573135446Strhodes/** Name string for the mv-keys option */ 574135446Strhodes#define MV_KEYS_name (ntp_keygen_opt_strs+1976) 575135446Strhodes/** Compiled in flag settings for the mv-keys option */ 576135446Strhodes#define MV_KEYS_FLAGS (OPTST_DISABLED \ 577135446Strhodes | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC)) 578135446Strhodes 579135446Strhodes#else /* disable mv-keys */ 580135446Strhodes#define MV_KEYS_FLAGS (OPTST_OMITTED | OPTST_NO_INIT) 581135446Strhodes#define MV_KEYS_NAME NULL 582135446Strhodes#define MV_KEYS_DESC NULL 583135446Strhodes#define MV_KEYS_name NULL 584135446Strhodes#endif /* AUTOKEY */ 585135446Strhodes 586135446Strhodes/* 587135446Strhodes * Help/More_Help/Version option descriptions: 588135446Strhodes */ 589135446Strhodes#define HELP_DESC (ntp_keygen_opt_strs+1984) 590135446Strhodes#define HELP_name (ntp_keygen_opt_strs+2028) 591135446Strhodes#ifdef HAVE_WORKING_FORK 592135446Strhodes#define MORE_HELP_DESC (ntp_keygen_opt_strs+2033) 593135446Strhodes#define MORE_HELP_name (ntp_keygen_opt_strs+2078) 594135446Strhodes#define MORE_HELP_FLAGS (OPTST_IMM | OPTST_NO_INIT) 595135446Strhodes#else 596135446Strhodes#define MORE_HELP_DESC HELP_DESC 597135446Strhodes#define MORE_HELP_name HELP_name 598135446Strhodes#define MORE_HELP_FLAGS (OPTST_OMITTED | OPTST_NO_INIT) 599135446Strhodes#endif 600135446Strhodes#ifdef NO_OPTIONAL_OPT_ARGS 601135446Strhodes# define VER_FLAGS (OPTST_IMM | OPTST_NO_INIT) 602135446Strhodes#else 603135446Strhodes# define VER_FLAGS (OPTST_SET_ARGTYPE(OPARG_TYPE_STRING) | \ 604135446Strhodes OPTST_ARG_OPTIONAL | OPTST_IMM | OPTST_NO_INIT) 605135446Strhodes#endif 606135446Strhodes#define VER_DESC (ntp_keygen_opt_strs+2088) 607135446Strhodes#define VER_name (ntp_keygen_opt_strs+2124) 608135446Strhodes#define SAVE_OPTS_DESC (ntp_keygen_opt_strs+2132) 609135446Strhodes#define SAVE_OPTS_name (ntp_keygen_opt_strs+2171) 610135446Strhodes#define LOAD_OPTS_DESC (ntp_keygen_opt_strs+2181) 611135446Strhodes#define LOAD_OPTS_NAME (ntp_keygen_opt_strs+2213) 612135446Strhodes#define NO_LOAD_OPTS_name (ntp_keygen_opt_strs+2223) 613135446Strhodes#define LOAD_OPTS_pfx (ntp_keygen_opt_strs+2236) 614135446Strhodes#define LOAD_OPTS_name (NO_LOAD_OPTS_name + 3) 615135446Strhodes/** 616135446Strhodes * Declare option callback procedures 617135446Strhodes */ 618135446Strhodes#ifdef AUTOKEY 619135446Strhodes static tOptProc doOptImbits; 620135446Strhodes#else /* not AUTOKEY */ 621135446Strhodes# define doOptImbits NULL 622135446Strhodes#endif /* def/not AUTOKEY */ 623135446Strhodes#ifdef AUTOKEY 624170222Sdougb static tOptProc doOptModulus; 625135446Strhodes#else /* not AUTOKEY */ 626135446Strhodes# define doOptModulus NULL 627170222Sdougb#endif /* def/not AUTOKEY */ 628135446Strhodesextern tOptProc 629135446Strhodes ntpOptionPrintVersion, optionBooleanVal, optionNestedVal, 630135446Strhodes optionNumericVal, optionPagedUsage, optionResetOpt, 631135446Strhodes optionStackArg, optionTimeDate, optionTimeVal, 632135446Strhodes optionUnstackArg, optionVendorOption; 633135446Strhodesstatic tOptProc 634135446Strhodes doOptDebug_Level, doUsageOpt; 635135446Strhodes#define VER_PROC ntpOptionPrintVersion 636135446Strhodes 637135446Strhodes/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 638170222Sdougb/** 639170222Sdougb * Define the ntp-keygen Option Descriptions. 640170222Sdougb * This is an array of OPTION_CT entries, one for each 641170222Sdougb * option that the ntp-keygen program responds to. 642135446Strhodes */ 643135446Strhodesstatic tOptDesc optDesc[OPTION_CT] = { 644135446Strhodes { /* entry idx, value */ 0, VALUE_OPT_IMBITS, 645135446Strhodes /* equiv idx, value */ 0, VALUE_OPT_IMBITS, 646135446Strhodes /* equivalenced to */ NO_EQUIVALENT, 647135446Strhodes /* min, max, act ct */ 0, 1, 0, 648135446Strhodes /* opt state flags */ IMBITS_FLAGS, 0, 649135446Strhodes /* last opt argumnt */ { NULL }, /* --imbits */ 650135446Strhodes /* arg list/cookie */ NULL, 651135446Strhodes /* must/cannot opts */ NULL, NULL, 652135446Strhodes /* option proc */ doOptImbits, 653135446Strhodes /* desc, NAME, name */ IMBITS_DESC, IMBITS_NAME, IMBITS_name, 654135446Strhodes /* disablement strs */ NULL, NULL }, 655135446Strhodes 656135446Strhodes { /* entry idx, value */ 1, VALUE_OPT_CERTIFICATE, 657135446Strhodes /* equiv idx, value */ 1, VALUE_OPT_CERTIFICATE, 658135446Strhodes /* equivalenced to */ NO_EQUIVALENT, 659135446Strhodes /* min, max, act ct */ 0, 1, 0, 660135446Strhodes /* opt state flags */ CERTIFICATE_FLAGS, 0, 661135446Strhodes /* last opt argumnt */ { NULL }, /* --certificate */ 662135446Strhodes /* arg list/cookie */ NULL, 663135446Strhodes /* must/cannot opts */ NULL, NULL, 664135446Strhodes /* option proc */ NULL, 665135446Strhodes /* desc, NAME, name */ CERTIFICATE_DESC, CERTIFICATE_NAME, CERTIFICATE_name, 666135446Strhodes /* disablement strs */ NULL, NULL }, 667135446Strhodes 668135446Strhodes { /* entry idx, value */ 2, VALUE_OPT_CIPHER, 669135446Strhodes /* equiv idx, value */ 2, VALUE_OPT_CIPHER, 670135446Strhodes /* equivalenced to */ NO_EQUIVALENT, 671135446Strhodes /* min, max, act ct */ 0, 1, 0, 672135446Strhodes /* opt state flags */ CIPHER_FLAGS, 0, 673135446Strhodes /* last opt argumnt */ { NULL }, /* --cipher */ 674135446Strhodes /* arg list/cookie */ NULL, 675135446Strhodes /* must/cannot opts */ NULL, NULL, 676135446Strhodes /* option proc */ NULL, 677135446Strhodes /* desc, NAME, name */ CIPHER_DESC, CIPHER_NAME, CIPHER_name, 678135446Strhodes /* disablement strs */ NULL, NULL }, 679135446Strhodes 680135446Strhodes { /* entry idx, value */ 3, VALUE_OPT_DEBUG_LEVEL, 681135446Strhodes /* equiv idx, value */ 3, VALUE_OPT_DEBUG_LEVEL, 682135446Strhodes /* equivalenced to */ NO_EQUIVALENT, 683135446Strhodes /* min, max, act ct */ 0, NOLIMIT, 0, 684135446Strhodes /* opt state flags */ DEBUG_LEVEL_FLAGS, 0, 685135446Strhodes /* last opt argumnt */ { NULL }, /* --debug-level */ 686135446Strhodes /* arg list/cookie */ NULL, 687135446Strhodes /* must/cannot opts */ NULL, NULL, 688135446Strhodes /* option proc */ doOptDebug_Level, 689135446Strhodes /* desc, NAME, name */ DEBUG_LEVEL_DESC, DEBUG_LEVEL_NAME, DEBUG_LEVEL_name, 690135446Strhodes /* disablement strs */ NULL, NULL }, 691135446Strhodes 692135446Strhodes { /* entry idx, value */ 4, VALUE_OPT_SET_DEBUG_LEVEL, 693135446Strhodes /* equiv idx, value */ 4, VALUE_OPT_SET_DEBUG_LEVEL, 694135446Strhodes /* equivalenced to */ NO_EQUIVALENT, 695135446Strhodes /* min, max, act ct */ 0, NOLIMIT, 0, 696135446Strhodes /* opt state flags */ SET_DEBUG_LEVEL_FLAGS, 0, 697135446Strhodes /* last opt argumnt */ { NULL }, /* --set-debug-level */ 698135446Strhodes /* arg list/cookie */ NULL, 699135446Strhodes /* must/cannot opts */ NULL, NULL, 700170222Sdougb /* option proc */ optionNumericVal, 701170222Sdougb /* desc, NAME, name */ SET_DEBUG_LEVEL_DESC, SET_DEBUG_LEVEL_NAME, SET_DEBUG_LEVEL_name, 702135446Strhodes /* disablement strs */ NULL, NULL }, 703135446Strhodes 704135446Strhodes { /* entry idx, value */ 5, VALUE_OPT_ID_KEY, 705135446Strhodes /* equiv idx, value */ 5, VALUE_OPT_ID_KEY, 706135446Strhodes /* equivalenced to */ NO_EQUIVALENT, 707135446Strhodes /* min, max, act ct */ 0, 1, 0, 708135446Strhodes /* opt state flags */ ID_KEY_FLAGS, 0, 709135446Strhodes /* last opt argumnt */ { NULL }, /* --id-key */ 710135446Strhodes /* arg list/cookie */ NULL, 711135446Strhodes /* must/cannot opts */ NULL, NULL, 712135446Strhodes /* option proc */ NULL, 713135446Strhodes /* desc, NAME, name */ ID_KEY_DESC, ID_KEY_NAME, ID_KEY_name, 714135446Strhodes /* disablement strs */ NULL, NULL }, 715135446Strhodes 716135446Strhodes { /* entry idx, value */ 6, VALUE_OPT_GQ_PARAMS, 717135446Strhodes /* equiv idx, value */ 6, VALUE_OPT_GQ_PARAMS, 718135446Strhodes /* equivalenced to */ NO_EQUIVALENT, 719135446Strhodes /* min, max, act ct */ 0, 1, 0, 720135446Strhodes /* opt state flags */ GQ_PARAMS_FLAGS, 0, 721165071Sdougb /* last opt argumnt */ { NULL }, /* --gq-params */ 722135446Strhodes /* arg list/cookie */ NULL, 723135446Strhodes /* must/cannot opts */ NULL, NULL, 724135446Strhodes /* option proc */ NULL, 725135446Strhodes /* desc, NAME, name */ GQ_PARAMS_DESC, GQ_PARAMS_NAME, GQ_PARAMS_name, 726135446Strhodes /* disablement strs */ NULL, NULL }, 727135446Strhodes 728135446Strhodes { /* entry idx, value */ 7, VALUE_OPT_HOST_KEY, 729135446Strhodes /* equiv idx, value */ 7, VALUE_OPT_HOST_KEY, 730135446Strhodes /* equivalenced to */ NO_EQUIVALENT, 731135446Strhodes /* min, max, act ct */ 0, 1, 0, 732135446Strhodes /* opt state flags */ HOST_KEY_FLAGS, 0, 733135446Strhodes /* last opt argumnt */ { NULL }, /* --host-key */ 734135446Strhodes /* arg list/cookie */ NULL, 735135446Strhodes /* must/cannot opts */ NULL, NULL, 736135446Strhodes /* option proc */ NULL, 737135446Strhodes /* desc, NAME, name */ HOST_KEY_DESC, HOST_KEY_NAME, HOST_KEY_name, 738135446Strhodes /* disablement strs */ NULL, NULL }, 739143731Sdougb 740135446Strhodes { /* entry idx, value */ 8, VALUE_OPT_IFFKEY, 741170222Sdougb /* equiv idx, value */ 8, VALUE_OPT_IFFKEY, 742143731Sdougb /* equivalenced to */ NO_EQUIVALENT, 743135446Strhodes /* min, max, act ct */ 0, 1, 0, 744135446Strhodes /* opt state flags */ IFFKEY_FLAGS, 0, 745135446Strhodes /* last opt argumnt */ { NULL }, /* --iffkey */ 746135446Strhodes /* arg list/cookie */ NULL, 747135446Strhodes /* must/cannot opts */ NULL, NULL, 748135446Strhodes /* option proc */ NULL, 749135446Strhodes /* desc, NAME, name */ IFFKEY_DESC, IFFKEY_NAME, IFFKEY_name, 750135446Strhodes /* disablement strs */ NULL, NULL }, 751135446Strhodes 752135446Strhodes { /* entry idx, value */ 9, VALUE_OPT_IDENT, 753135446Strhodes /* equiv idx, value */ 9, VALUE_OPT_IDENT, 754135446Strhodes /* equivalenced to */ NO_EQUIVALENT, 755135446Strhodes /* min, max, act ct */ 0, 1, 0, 756135446Strhodes /* opt state flags */ IDENT_FLAGS, 0, 757135446Strhodes /* last opt argumnt */ { NULL }, /* --ident */ 758135446Strhodes /* arg list/cookie */ NULL, 759135446Strhodes /* must/cannot opts */ NULL, NULL, 760135446Strhodes /* option proc */ NULL, 761135446Strhodes /* desc, NAME, name */ IDENT_DESC, IDENT_NAME, IDENT_name, 762135446Strhodes /* disablement strs */ NULL, NULL }, 763135446Strhodes 764135446Strhodes { /* entry idx, value */ 10, VALUE_OPT_LIFETIME, 765135446Strhodes /* equiv idx, value */ 10, VALUE_OPT_LIFETIME, 766135446Strhodes /* equivalenced to */ NO_EQUIVALENT, 767135446Strhodes /* min, max, act ct */ 0, 1, 0, 768135446Strhodes /* opt state flags */ LIFETIME_FLAGS, 0, 769135446Strhodes /* last opt argumnt */ { NULL }, /* --lifetime */ 770135446Strhodes /* arg list/cookie */ NULL, 771135446Strhodes /* must/cannot opts */ NULL, NULL, 772135446Strhodes /* option proc */ optionNumericVal, 773135446Strhodes /* desc, NAME, name */ LIFETIME_DESC, LIFETIME_NAME, LIFETIME_name, 774135446Strhodes /* disablement strs */ NULL, NULL }, 775135446Strhodes 776135446Strhodes { /* entry idx, value */ 11, VALUE_OPT_MODULUS, 777135446Strhodes /* equiv idx, value */ 11, VALUE_OPT_MODULUS, 778135446Strhodes /* equivalenced to */ NO_EQUIVALENT, 779135446Strhodes /* min, max, act ct */ 0, 1, 0, 780170222Sdougb /* opt state flags */ MODULUS_FLAGS, 0, 781170222Sdougb /* last opt argumnt */ { NULL }, /* --modulus */ 782170222Sdougb /* arg list/cookie */ NULL, 783135446Strhodes /* must/cannot opts */ NULL, NULL, 784135446Strhodes /* option proc */ doOptModulus, 785135446Strhodes /* desc, NAME, name */ MODULUS_DESC, MODULUS_NAME, MODULUS_name, 786135446Strhodes /* disablement strs */ NULL, NULL }, 787135446Strhodes 788135446Strhodes { /* entry idx, value */ 12, VALUE_OPT_MD5KEY, 789135446Strhodes /* equiv idx, value */ 12, VALUE_OPT_MD5KEY, 790135446Strhodes /* equivalenced to */ NO_EQUIVALENT, 791135446Strhodes /* min, max, act ct */ 0, 1, 0, 792135446Strhodes /* opt state flags */ MD5KEY_FLAGS, 0, 793135446Strhodes /* last opt argumnt */ { NULL }, /* --md5key */ 794135446Strhodes /* arg list/cookie */ NULL, 795135446Strhodes /* must/cannot opts */ NULL, NULL, 796135446Strhodes /* option proc */ NULL, 797135446Strhodes /* desc, NAME, name */ MD5KEY_DESC, MD5KEY_NAME, MD5KEY_name, 798135446Strhodes /* disablement strs */ NULL, NULL }, 799135446Strhodes 800135446Strhodes { /* entry idx, value */ 13, VALUE_OPT_PVT_CERT, 801135446Strhodes /* equiv idx, value */ 13, VALUE_OPT_PVT_CERT, 802135446Strhodes /* equivalenced to */ NO_EQUIVALENT, 803135446Strhodes /* min, max, act ct */ 0, 1, 0, 804135446Strhodes /* opt state flags */ PVT_CERT_FLAGS, 0, 805135446Strhodes /* last opt argumnt */ { NULL }, /* --pvt-cert */ 806135446Strhodes /* arg list/cookie */ NULL, 807135446Strhodes /* must/cannot opts */ NULL, NULL, 808135446Strhodes /* option proc */ NULL, 809135446Strhodes /* desc, NAME, name */ PVT_CERT_DESC, PVT_CERT_NAME, PVT_CERT_name, 810135446Strhodes /* disablement strs */ NULL, NULL }, 811135446Strhodes 812135446Strhodes { /* entry idx, value */ 14, VALUE_OPT_PASSWORD, 813135446Strhodes /* equiv idx, value */ 14, VALUE_OPT_PASSWORD, 814135446Strhodes /* equivalenced to */ NO_EQUIVALENT, 815135446Strhodes /* min, max, act ct */ 0, 1, 0, 816135446Strhodes /* opt state flags */ PASSWORD_FLAGS, 0, 817135446Strhodes /* last opt argumnt */ { NULL }, /* --password */ 818135446Strhodes /* arg list/cookie */ NULL, 819135446Strhodes /* must/cannot opts */ NULL, NULL, 820135446Strhodes /* option proc */ NULL, 821135446Strhodes /* desc, NAME, name */ PASSWORD_DESC, PASSWORD_NAME, PASSWORD_name, 822135446Strhodes /* disablement strs */ NULL, NULL }, 823135446Strhodes 824135446Strhodes { /* entry idx, value */ 15, VALUE_OPT_EXPORT_PASSWD, 825135446Strhodes /* equiv idx, value */ 15, VALUE_OPT_EXPORT_PASSWD, 826135446Strhodes /* equivalenced to */ NO_EQUIVALENT, 827135446Strhodes /* min, max, act ct */ 0, 1, 0, 828135446Strhodes /* opt state flags */ EXPORT_PASSWD_FLAGS, 0, 829135446Strhodes /* last opt argumnt */ { NULL }, /* --export-passwd */ 830135446Strhodes /* arg list/cookie */ NULL, 831135446Strhodes /* must/cannot opts */ NULL, NULL, 832135446Strhodes /* option proc */ NULL, 833135446Strhodes /* desc, NAME, name */ EXPORT_PASSWD_DESC, EXPORT_PASSWD_NAME, EXPORT_PASSWD_name, 834135446Strhodes /* disablement strs */ NULL, NULL }, 835135446Strhodes 836135446Strhodes { /* entry idx, value */ 16, VALUE_OPT_SUBJECT_NAME, 837135446Strhodes /* equiv idx, value */ 16, VALUE_OPT_SUBJECT_NAME, 838135446Strhodes /* equivalenced to */ NO_EQUIVALENT, 839135446Strhodes /* min, max, act ct */ 0, 1, 0, 840135446Strhodes /* opt state flags */ SUBJECT_NAME_FLAGS, 0, 841135446Strhodes /* last opt argumnt */ { NULL }, /* --subject-name */ 842135446Strhodes /* arg list/cookie */ NULL, 843135446Strhodes /* must/cannot opts */ NULL, NULL, 844135446Strhodes /* option proc */ NULL, 845135446Strhodes /* desc, NAME, name */ SUBJECT_NAME_DESC, SUBJECT_NAME_NAME, SUBJECT_NAME_name, 846135446Strhodes /* disablement strs */ NULL, NULL }, 847135446Strhodes 848135446Strhodes { /* entry idx, value */ 17, VALUE_OPT_SIGN_KEY, 849135446Strhodes /* equiv idx, value */ 17, VALUE_OPT_SIGN_KEY, 850135446Strhodes /* equivalenced to */ NO_EQUIVALENT, 851135446Strhodes /* min, max, act ct */ 0, 1, 0, 852135446Strhodes /* opt state flags */ SIGN_KEY_FLAGS, 0, 853135446Strhodes /* last opt argumnt */ { NULL }, /* --sign-key */ 854135446Strhodes /* arg list/cookie */ NULL, 855135446Strhodes /* must/cannot opts */ NULL, NULL, 856135446Strhodes /* option proc */ NULL, 857135446Strhodes /* desc, NAME, name */ SIGN_KEY_DESC, SIGN_KEY_NAME, SIGN_KEY_name, 858135446Strhodes /* disablement strs */ NULL, NULL }, 859170222Sdougb 860170222Sdougb { /* entry idx, value */ 18, VALUE_OPT_TRUSTED_CERT, 861135446Strhodes /* equiv idx, value */ 18, VALUE_OPT_TRUSTED_CERT, 862135446Strhodes /* equivalenced to */ NO_EQUIVALENT, 863135446Strhodes /* min, max, act ct */ 0, 1, 0, 864135446Strhodes /* opt state flags */ TRUSTED_CERT_FLAGS, 0, 865135446Strhodes /* last opt argumnt */ { NULL }, /* --trusted-cert */ 866135446Strhodes /* arg list/cookie */ NULL, 867135446Strhodes /* must/cannot opts */ NULL, NULL, 868135446Strhodes /* option proc */ NULL, 869135446Strhodes /* desc, NAME, name */ TRUSTED_CERT_DESC, TRUSTED_CERT_NAME, TRUSTED_CERT_name, 870135446Strhodes /* disablement strs */ NULL, NULL }, 871135446Strhodes 872135446Strhodes { /* entry idx, value */ 19, VALUE_OPT_MV_PARAMS, 873135446Strhodes /* equiv idx, value */ 19, VALUE_OPT_MV_PARAMS, 874135446Strhodes /* equivalenced to */ NO_EQUIVALENT, 875135446Strhodes /* min, max, act ct */ 0, 1, 0, 876135446Strhodes /* opt state flags */ MV_PARAMS_FLAGS, 0, 877135446Strhodes /* last opt argumnt */ { NULL }, /* --mv-params */ 878135446Strhodes /* arg list/cookie */ NULL, 879135446Strhodes /* must/cannot opts */ NULL, NULL, 880135446Strhodes /* option proc */ optionNumericVal, 881135446Strhodes /* desc, NAME, name */ MV_PARAMS_DESC, MV_PARAMS_NAME, MV_PARAMS_name, 882135446Strhodes /* disablement strs */ NULL, NULL }, 883135446Strhodes 884135446Strhodes { /* entry idx, value */ 20, VALUE_OPT_MV_KEYS, 885135446Strhodes /* equiv idx, value */ 20, VALUE_OPT_MV_KEYS, 886135446Strhodes /* equivalenced to */ NO_EQUIVALENT, 887135446Strhodes /* min, max, act ct */ 0, 1, 0, 888135446Strhodes /* opt state flags */ MV_KEYS_FLAGS, 0, 889135446Strhodes /* last opt argumnt */ { NULL }, /* --mv-keys */ 890135446Strhodes /* arg list/cookie */ NULL, 891135446Strhodes /* must/cannot opts */ NULL, NULL, 892 /* option proc */ optionNumericVal, 893 /* desc, NAME, name */ MV_KEYS_DESC, MV_KEYS_NAME, MV_KEYS_name, 894 /* disablement strs */ NULL, NULL }, 895 896 { /* entry idx, value */ INDEX_OPT_VERSION, VALUE_OPT_VERSION, 897 /* equiv idx value */ NO_EQUIVALENT, VALUE_OPT_VERSION, 898 /* equivalenced to */ NO_EQUIVALENT, 899 /* min, max, act ct */ 0, 1, 0, 900 /* opt state flags */ VER_FLAGS, AOUSE_VERSION, 901 /* last opt argumnt */ { NULL }, 902 /* arg list/cookie */ NULL, 903 /* must/cannot opts */ NULL, NULL, 904 /* option proc */ VER_PROC, 905 /* desc, NAME, name */ VER_DESC, NULL, VER_name, 906 /* disablement strs */ NULL, NULL }, 907 908 909 910 { /* entry idx, value */ INDEX_OPT_HELP, VALUE_OPT_HELP, 911 /* equiv idx value */ NO_EQUIVALENT, VALUE_OPT_HELP, 912 /* equivalenced to */ NO_EQUIVALENT, 913 /* min, max, act ct */ 0, 1, 0, 914 /* opt state flags */ OPTST_IMM | OPTST_NO_INIT, AOUSE_HELP, 915 /* last opt argumnt */ { NULL }, 916 /* arg list/cookie */ NULL, 917 /* must/cannot opts */ NULL, NULL, 918 /* option proc */ doUsageOpt, 919 /* desc, NAME, name */ HELP_DESC, NULL, HELP_name, 920 /* disablement strs */ NULL, NULL }, 921 922 { /* entry idx, value */ INDEX_OPT_MORE_HELP, VALUE_OPT_MORE_HELP, 923 /* equiv idx value */ NO_EQUIVALENT, VALUE_OPT_MORE_HELP, 924 /* equivalenced to */ NO_EQUIVALENT, 925 /* min, max, act ct */ 0, 1, 0, 926 /* opt state flags */ MORE_HELP_FLAGS, AOUSE_MORE_HELP, 927 /* last opt argumnt */ { NULL }, 928 /* arg list/cookie */ NULL, 929 /* must/cannot opts */ NULL, NULL, 930 /* option proc */ optionPagedUsage, 931 /* desc, NAME, name */ MORE_HELP_DESC, NULL, MORE_HELP_name, 932 /* disablement strs */ NULL, NULL }, 933 934 { /* entry idx, value */ INDEX_OPT_SAVE_OPTS, VALUE_OPT_SAVE_OPTS, 935 /* equiv idx value */ NO_EQUIVALENT, VALUE_OPT_SAVE_OPTS, 936 /* equivalenced to */ NO_EQUIVALENT, 937 /* min, max, act ct */ 0, 1, 0, 938 /* opt state flags */ OPTST_SET_ARGTYPE(OPARG_TYPE_STRING) 939 | OPTST_ARG_OPTIONAL | OPTST_NO_INIT, AOUSE_SAVE_OPTS, 940 /* last opt argumnt */ { NULL }, 941 /* arg list/cookie */ NULL, 942 /* must/cannot opts */ NULL, NULL, 943 /* option proc */ NULL, 944 /* desc, NAME, name */ SAVE_OPTS_DESC, NULL, SAVE_OPTS_name, 945 /* disablement strs */ NULL, NULL }, 946 947 { /* entry idx, value */ INDEX_OPT_LOAD_OPTS, VALUE_OPT_LOAD_OPTS, 948 /* equiv idx value */ NO_EQUIVALENT, VALUE_OPT_LOAD_OPTS, 949 /* equivalenced to */ NO_EQUIVALENT, 950 /* min, max, act ct */ 0, NOLIMIT, 0, 951 /* opt state flags */ OPTST_SET_ARGTYPE(OPARG_TYPE_STRING) 952 | OPTST_DISABLE_IMM, AOUSE_LOAD_OPTS, 953 /* last opt argumnt */ { NULL }, 954 /* arg list/cookie */ NULL, 955 /* must/cannot opts */ NULL, NULL, 956 /* option proc */ optionLoadOpt, 957 /* desc, NAME, name */ LOAD_OPTS_DESC, LOAD_OPTS_NAME, LOAD_OPTS_name, 958 /* disablement strs */ NO_LOAD_OPTS_name, LOAD_OPTS_pfx } 959}; 960 961 962/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 963/** Reference to the upper cased version of ntp-keygen. */ 964#define zPROGNAME (ntp_keygen_opt_strs+2239) 965/** Reference to the title line for ntp-keygen usage. */ 966#define zUsageTitle (ntp_keygen_opt_strs+2250) 967/** ntp-keygen configuration file name. */ 968#define zRcName (ntp_keygen_opt_strs+2373) 969/** Directories to search for ntp-keygen config files. */ 970static char const * const apzHomeList[3] = { 971 ntp_keygen_opt_strs+2365, 972 ntp_keygen_opt_strs+2371, 973 NULL }; 974/** The ntp-keygen program bug email address. */ 975#define zBugsAddr (ntp_keygen_opt_strs+2380) 976/** Clarification/explanation of what ntp-keygen does. */ 977#define zExplain (ntp_keygen_opt_strs+2414) 978/** Extra detail explaining what ntp-keygen does. */ 979#define zDetail (NULL) 980/** The full version string for ntp-keygen. */ 981#define zFullVersion (ntp_keygen_opt_strs+2416) 982/* extracted from optcode.tlib near line 364 */ 983 984#if defined(ENABLE_NLS) 985# define OPTPROC_BASE OPTPROC_TRANSLATE 986 static tOptionXlateProc translate_option_strings; 987#else 988# define OPTPROC_BASE OPTPROC_NONE 989# define translate_option_strings NULL 990#endif /* ENABLE_NLS */ 991 992#define ntp_keygen_full_usage (NULL) 993#define ntp_keygen_short_usage (NULL) 994 995#endif /* not defined __doxygen__ */ 996 997/* 998 * Create the static procedure(s) declared above. 999 */ 1000/** 1001 * The callout function that invokes the optionUsage function. 1002 * 1003 * @param[in] opts the AutoOpts option description structure 1004 * @param[in] od the descriptor for the "help" (usage) option. 1005 * @noreturn 1006 */ 1007static void 1008doUsageOpt(tOptions * opts, tOptDesc * od) 1009{ 1010 int ex_code; 1011 ex_code = NTP_KEYGEN_EXIT_SUCCESS; 1012 optionUsage(&ntp_keygenOptions, ex_code); 1013 /* NOTREACHED */ 1014 exit(1); 1015 (void)opts; 1016 (void)od; 1017} 1018 1019/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 1020/** 1021 * Code to handle the imbits option, when AUTOKEY is #define-d. 1022 * The number of bits in the identity modulus. The default is 256. 1023 * @param[in] pOptions the ntp-keygen options data structure 1024 * @param[in,out] pOptDesc the option descriptor for this option. 1025 */ 1026#ifdef AUTOKEY 1027static void 1028doOptImbits(tOptions* pOptions, tOptDesc* pOptDesc) 1029{ 1030 static struct {long rmin, rmax;} const rng[1] = { 1031 { 256, 2048 } }; 1032 int ix; 1033 1034 if (pOptions <= OPTPROC_EMIT_LIMIT) 1035 goto emit_ranges; 1036 optionNumericVal(pOptions, pOptDesc); 1037 1038 for (ix = 0; ix < 1; ix++) { 1039 if (pOptDesc->optArg.argInt < rng[ix].rmin) 1040 continue; /* ranges need not be ordered. */ 1041 if (pOptDesc->optArg.argInt == rng[ix].rmin) 1042 return; 1043 if (rng[ix].rmax == LONG_MIN) 1044 continue; 1045 if (pOptDesc->optArg.argInt <= rng[ix].rmax) 1046 return; 1047 } 1048 1049 option_usage_fp = stderr; 1050 1051 emit_ranges: 1052optionShowRange(pOptions, pOptDesc, VOIDP(rng), 1); 1053} 1054#endif /* defined AUTOKEY */ 1055 1056/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 1057/** 1058 * Code to handle the debug-level option. 1059 * 1060 * @param[in] pOptions the ntp-keygen options data structure 1061 * @param[in,out] pOptDesc the option descriptor for this option. 1062 */ 1063static void 1064doOptDebug_Level(tOptions* pOptions, tOptDesc* pOptDesc) 1065{ 1066 /* 1067 * Be sure the flag-code[0] handles special values for the options pointer 1068 * viz. (poptions <= OPTPROC_EMIT_LIMIT) *and also* the special flag bit 1069 * ((poptdesc->fOptState & OPTST_RESET) != 0) telling the option to 1070 * reset its state. 1071 */ 1072 /* extracted from debug-opt.def, line 15 */ 1073OPT_VALUE_SET_DEBUG_LEVEL++; 1074 (void)pOptDesc; 1075 (void)pOptions; 1076} 1077 1078/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 1079/** 1080 * Code to handle the modulus option, when AUTOKEY is #define-d. 1081 * The number of bits in the prime modulus. The default is 512. 1082 * @param[in] pOptions the ntp-keygen options data structure 1083 * @param[in,out] pOptDesc the option descriptor for this option. 1084 */ 1085#ifdef AUTOKEY 1086static void 1087doOptModulus(tOptions* pOptions, tOptDesc* pOptDesc) 1088{ 1089 static struct {long rmin, rmax;} const rng[1] = { 1090 { 256, 2048 } }; 1091 int ix; 1092 1093 if (pOptions <= OPTPROC_EMIT_LIMIT) 1094 goto emit_ranges; 1095 optionNumericVal(pOptions, pOptDesc); 1096 1097 for (ix = 0; ix < 1; ix++) { 1098 if (pOptDesc->optArg.argInt < rng[ix].rmin) 1099 continue; /* ranges need not be ordered. */ 1100 if (pOptDesc->optArg.argInt == rng[ix].rmin) 1101 return; 1102 if (rng[ix].rmax == LONG_MIN) 1103 continue; 1104 if (pOptDesc->optArg.argInt <= rng[ix].rmax) 1105 return; 1106 } 1107 1108 option_usage_fp = stderr; 1109 1110 emit_ranges: 1111optionShowRange(pOptions, pOptDesc, VOIDP(rng), 1); 1112} 1113#endif /* defined AUTOKEY */ 1114/* extracted from optmain.tlib near line 1250 */ 1115 1116/** 1117 * The directory containing the data associated with ntp-keygen. 1118 */ 1119#ifndef PKGDATADIR 1120# define PKGDATADIR "" 1121#endif 1122 1123/** 1124 * Information about the person or institution that packaged ntp-keygen 1125 * for the current distribution. 1126 */ 1127#ifndef WITH_PACKAGER 1128# define ntp_keygen_packager_info NULL 1129#else 1130/** Packager information for ntp-keygen. */ 1131static char const ntp_keygen_packager_info[] = 1132 "Packaged by " WITH_PACKAGER 1133 1134# ifdef WITH_PACKAGER_VERSION 1135 " ("WITH_PACKAGER_VERSION")" 1136# endif 1137 1138# ifdef WITH_PACKAGER_BUG_REPORTS 1139 "\nReport ntp_keygen bugs to " WITH_PACKAGER_BUG_REPORTS 1140# endif 1141 "\n"; 1142#endif 1143#ifndef __doxygen__ 1144 1145#endif /* __doxygen__ */ 1146/** 1147 * The option definitions for ntp-keygen. The one structure that 1148 * binds them all. 1149 */ 1150tOptions ntp_keygenOptions = { 1151 OPTIONS_STRUCT_VERSION, 1152 0, NULL, /* original argc + argv */ 1153 ( OPTPROC_BASE 1154 + OPTPROC_ERRSTOP 1155 + OPTPROC_SHORTOPT 1156 + OPTPROC_LONGOPT 1157 + OPTPROC_NO_REQ_OPT 1158 + OPTPROC_ENVIRON 1159 + OPTPROC_NO_ARGS 1160 + OPTPROC_MISUSE ), 1161 0, NULL, /* current option index, current option */ 1162 NULL, NULL, zPROGNAME, 1163 zRcName, zCopyright, zLicenseDescrip, 1164 zFullVersion, apzHomeList, zUsageTitle, 1165 zExplain, zDetail, optDesc, 1166 zBugsAddr, /* address to send bugs to */ 1167 NULL, NULL, /* extensions/saved state */ 1168 optionUsage, /* usage procedure */ 1169 translate_option_strings, /* translation procedure */ 1170 /* 1171 * Indexes to special options 1172 */ 1173 { INDEX_OPT_MORE_HELP, /* more-help option index */ 1174 INDEX_OPT_SAVE_OPTS, /* save option index */ 1175 NO_EQUIVALENT, /* '-#' option index */ 1176 NO_EQUIVALENT /* index of default opt */ 1177 }, 1178 26 /* full option count */, 21 /* user option count */, 1179 ntp_keygen_full_usage, ntp_keygen_short_usage, 1180 NULL, NULL, 1181 PKGDATADIR, ntp_keygen_packager_info 1182}; 1183 1184#if ENABLE_NLS 1185/** 1186 * This code is designed to translate translatable option text for the 1187 * ntp-keygen program. These translations happen upon entry 1188 * to optionProcess(). 1189 */ 1190#include <stdio.h> 1191#include <stdlib.h> 1192#include <string.h> 1193#include <unistd.h> 1194#ifdef HAVE_DCGETTEXT 1195# include <gettext.h> 1196#endif 1197#include <autoopts/usage-txt.h> 1198 1199static char * AO_gettext(char const * pz); 1200static void coerce_it(void ** s); 1201 1202/** 1203 * AutoGen specific wrapper function for gettext. It relies on the macro _() 1204 * to convert from English to the target language, then strdup-duplicates the 1205 * result string. It tries the "libopts" domain first, then whatever has been 1206 * set via the \a textdomain(3) call. 1207 * 1208 * @param[in] pz the input text used as a lookup key. 1209 * @returns the translated text (if there is one), 1210 * or the original text (if not). 1211 */ 1212static char * 1213AO_gettext(char const * pz) 1214{ 1215 char * res; 1216 if (pz == NULL) 1217 return NULL; 1218#ifdef HAVE_DCGETTEXT 1219 /* 1220 * While processing the option_xlateable_txt data, try to use the 1221 * "libopts" domain. Once we switch to the option descriptor data, 1222 * do *not* use that domain. 1223 */ 1224 if (option_xlateable_txt.field_ct != 0) { 1225 res = dgettext("libopts", pz); 1226 if (res == pz) 1227 res = (char *)VOIDP(_(pz)); 1228 } else 1229 res = (char *)VOIDP(_(pz)); 1230#else 1231 res = (char *)VOIDP(_(pz)); 1232#endif 1233 if (res == pz) 1234 return res; 1235 res = strdup(res); 1236 if (res == NULL) { 1237 fputs(_("No memory for duping translated strings\n"), stderr); 1238 exit(NTP_KEYGEN_EXIT_FAILURE); 1239 } 1240 return res; 1241} 1242 1243/** 1244 * All the pointers we use are marked "* const", but they are stored in 1245 * writable memory. Coerce the mutability and set the pointer. 1246 */ 1247static void coerce_it(void ** s) { *s = AO_gettext(*s); 1248} 1249 1250/** 1251 * Translate all the translatable strings in the ntp_keygenOptions 1252 * structure defined above. This is done only once. 1253 */ 1254static void 1255translate_option_strings(void) 1256{ 1257 tOptions * const opts = &ntp_keygenOptions; 1258 1259 /* 1260 * Guard against re-translation. It won't work. The strings will have 1261 * been changed by the first pass through this code. One shot only. 1262 */ 1263 if (option_xlateable_txt.field_ct != 0) { 1264 /* 1265 * Do the translations. The first pointer follows the field count 1266 * field. The field count field is the size of a pointer. 1267 */ 1268 char ** ppz = (char**)VOIDP(&(option_xlateable_txt)); 1269 int ix = option_xlateable_txt.field_ct; 1270 1271 do { 1272 ppz++; /* skip over field_ct */ 1273 *ppz = AO_gettext(*ppz); 1274 } while (--ix > 0); 1275 /* prevent re-translation and disable "libopts" domain lookup */ 1276 option_xlateable_txt.field_ct = 0; 1277 1278 coerce_it(VOIDP(&(opts->pzCopyright))); 1279 coerce_it(VOIDP(&(opts->pzCopyNotice))); 1280 coerce_it(VOIDP(&(opts->pzFullVersion))); 1281 coerce_it(VOIDP(&(opts->pzUsageTitle))); 1282 coerce_it(VOIDP(&(opts->pzExplain))); 1283 coerce_it(VOIDP(&(opts->pzDetail))); 1284 { 1285 tOptDesc * od = opts->pOptDesc; 1286 for (ix = opts->optCt; ix > 0; ix--, od++) 1287 coerce_it(VOIDP(&(od->pzText))); 1288 } 1289 } 1290} 1291#endif /* ENABLE_NLS */ 1292 1293#ifdef DO_NOT_COMPILE_THIS_CODE_IT_IS_FOR_GETTEXT 1294/** I18N function strictly for xgettext. Do not compile. */ 1295static void bogus_function(void) { 1296 /* TRANSLATORS: 1297 1298 The following dummy function was crated solely so that xgettext can 1299 extract the correct strings. These strings are actually referenced 1300 by a field name in the ntp_keygenOptions structure noted in the 1301 comments below. The literal text is defined in ntp_keygen_opt_strs. 1302 1303 NOTE: the strings below are segmented with respect to the source string 1304 ntp_keygen_opt_strs. The strings above are handed off for translation 1305 at run time a paragraph at a time. Consequently, they are presented here 1306 for translation a paragraph at a time. 1307 1308 ALSO: often the description for an option will reference another option 1309 by name. These are set off with apostrophe quotes (I hope). Do not 1310 translate option names. 1311 */ 1312 /* referenced via ntp_keygenOptions.pzCopyright */ 1313 puts(_("ntp-keygen (ntp) 4.2.8p11\n\ 1314Copyright (C) 1992-2017 The University of Delaware and Network Time Foundation, all rights reserved.\n\ 1315This is free software. It is licensed for use, modification and\n\ 1316redistribution under the terms of the NTP License, copies of which\n\ 1317can be seen at:\n")); 1318 puts(_(" <http://ntp.org/license>\n\ 1319 <http://opensource.org/licenses/ntp-license.php>\n")); 1320 1321 /* referenced via ntp_keygenOptions.pzCopyNotice */ 1322 puts(_("Permission to use, copy, modify, and distribute this software and its\n\ 1323documentation for any purpose with or without fee is hereby granted,\n\ 1324provided that the above copyright notice appears in all copies and that\n\ 1325both the copyright notice and this permission notice appear in supporting\n\ 1326documentation, and that the name The University of Delaware not be used in\n\ 1327advertising or publicity pertaining to distribution of the software without\n\ 1328specific, written prior permission. The University of Delaware and Network\n\ 1329Time Foundation makes no representations about the suitability this\n\ 1330software for any purpose. It is provided \"as is\" without express or\n\ 1331implied warranty.\n")); 1332 1333 /* referenced via ntp_keygenOptions.pOptDesc->pzText */ 1334 puts(_("identity modulus bits")); 1335 1336 /* referenced via ntp_keygenOptions.pOptDesc->pzText */ 1337 puts(_("certificate scheme")); 1338 1339 /* referenced via ntp_keygenOptions.pOptDesc->pzText */ 1340 puts(_("privatekey cipher")); 1341 1342 /* referenced via ntp_keygenOptions.pOptDesc->pzText */ 1343 puts(_("Increase debug verbosity level")); 1344 1345 /* referenced via ntp_keygenOptions.pOptDesc->pzText */ 1346 puts(_("Set the debug verbosity level")); 1347 1348 /* referenced via ntp_keygenOptions.pOptDesc->pzText */ 1349 puts(_("Write IFF or GQ identity keys")); 1350 1351 /* referenced via ntp_keygenOptions.pOptDesc->pzText */ 1352 puts(_("Generate GQ parameters and keys")); 1353 1354 /* referenced via ntp_keygenOptions.pOptDesc->pzText */ 1355 puts(_("generate RSA host key")); 1356 1357 /* referenced via ntp_keygenOptions.pOptDesc->pzText */ 1358 puts(_("generate IFF parameters")); 1359 1360 /* referenced via ntp_keygenOptions.pOptDesc->pzText */ 1361 puts(_("set Autokey group name")); 1362 1363 /* referenced via ntp_keygenOptions.pOptDesc->pzText */ 1364 puts(_("set certificate lifetime")); 1365 1366 /* referenced via ntp_keygenOptions.pOptDesc->pzText */ 1367 puts(_("prime modulus")); 1368 1369 /* referenced via ntp_keygenOptions.pOptDesc->pzText */ 1370 puts(_("generate symmetric keys")); 1371 1372 /* referenced via ntp_keygenOptions.pOptDesc->pzText */ 1373 puts(_("generate PC private certificate")); 1374 1375 /* referenced via ntp_keygenOptions.pOptDesc->pzText */ 1376 puts(_("local private password")); 1377 1378 /* referenced via ntp_keygenOptions.pOptDesc->pzText */ 1379 puts(_("export IFF or GQ group keys with password")); 1380 1381 /* referenced via ntp_keygenOptions.pOptDesc->pzText */ 1382 puts(_("set host and optionally group name")); 1383 1384 /* referenced via ntp_keygenOptions.pOptDesc->pzText */ 1385 puts(_("generate sign key (RSA or DSA)")); 1386 1387 /* referenced via ntp_keygenOptions.pOptDesc->pzText */ 1388 puts(_("trusted certificate (TC scheme)")); 1389 1390 /* referenced via ntp_keygenOptions.pOptDesc->pzText */ 1391 puts(_("generate <num> MV parameters")); 1392 1393 /* referenced via ntp_keygenOptions.pOptDesc->pzText */ 1394 puts(_("update <num> MV keys")); 1395 1396 /* referenced via ntp_keygenOptions.pOptDesc->pzText */ 1397 puts(_("display extended usage information and exit")); 1398 1399 /* referenced via ntp_keygenOptions.pOptDesc->pzText */ 1400 puts(_("extended usage information passed thru pager")); 1401 1402 /* referenced via ntp_keygenOptions.pOptDesc->pzText */ 1403 puts(_("output version information and exit")); 1404 1405 /* referenced via ntp_keygenOptions.pOptDesc->pzText */ 1406 puts(_("save the option state to a config file")); 1407 1408 /* referenced via ntp_keygenOptions.pOptDesc->pzText */ 1409 puts(_("load options from a config file")); 1410 1411 /* referenced via ntp_keygenOptions.pzUsageTitle */ 1412 puts(_("ntp-keygen (ntp) - Create a NTP host key - Ver. 4.2.8p11\n\ 1413Usage: %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]...\n")); 1414 1415 /* referenced via ntp_keygenOptions.pzExplain */ 1416 puts(_("\n")); 1417 1418 /* referenced via ntp_keygenOptions.pzFullVersion */ 1419 puts(_("ntp-keygen (ntp) 4.2.8p11")); 1420 1421 /* referenced via ntp_keygenOptions.pzFullUsage */ 1422 puts(_("<<<NOT-FOUND>>>")); 1423 1424 /* referenced via ntp_keygenOptions.pzShortUsage */ 1425 puts(_("<<<NOT-FOUND>>>")); 1426 /* LIBOPTS-MESSAGES: */ 1427#line 67 "../autoopts.c" 1428 puts(_("allocation of %d bytes failed\n")); 1429#line 93 "../autoopts.c" 1430 puts(_("allocation of %d bytes failed\n")); 1431#line 53 "../init.c" 1432 puts(_("AutoOpts function called without option descriptor\n")); 1433#line 86 "../init.c" 1434 puts(_("\tThis exceeds the compiled library version: ")); 1435#line 84 "../init.c" 1436 puts(_("Automated Options Processing Error!\n" 1437 "\t%s called AutoOpts function with structure version %d:%d:%d.\n")); 1438#line 80 "../autoopts.c" 1439 puts(_("realloc of %d bytes at 0x%p failed\n")); 1440#line 88 "../init.c" 1441 puts(_("\tThis is less than the minimum library version: ")); 1442#line 121 "../version.c" 1443 puts(_("Automated Options version %s\n" 1444 "\tCopyright (C) 1999-2014 by Bruce Korb - all rights reserved\n")); 1445#line 87 "../makeshell.c" 1446 puts(_("(AutoOpts bug): %s.\n")); 1447#line 90 "../reset.c" 1448 puts(_("optionResetOpt() called, but reset-option not configured")); 1449#line 292 "../usage.c" 1450 puts(_("could not locate the 'help' option")); 1451#line 336 "../autoopts.c" 1452 puts(_("optionProcess() was called with invalid data")); 1453#line 748 "../usage.c" 1454 puts(_("invalid argument type specified")); 1455#line 598 "../find.c" 1456 puts(_("defaulted to option with optional arg")); 1457#line 76 "../alias.c" 1458 puts(_("aliasing option is out of range.")); 1459#line 234 "../enum.c" 1460 puts(_("%s error: the keyword '%s' is ambiguous for %s\n")); 1461#line 108 "../find.c" 1462 puts(_(" The following options match:\n")); 1463#line 293 "../find.c" 1464 puts(_("%s: ambiguous option name: %s (matches %d options)\n")); 1465#line 161 "../check.c" 1466 puts(_("%s: Command line arguments required\n")); 1467#line 43 "../alias.c" 1468 puts(_("%d %s%s options allowed\n")); 1469#line 94 "../makeshell.c" 1470 puts(_("%s error %d (%s) calling %s for '%s'\n")); 1471#line 306 "../makeshell.c" 1472 puts(_("interprocess pipe")); 1473#line 168 "../version.c" 1474 puts(_("error: version option argument '%c' invalid. Use:\n" 1475 "\t'v' - version only\n" 1476 "\t'c' - version and copyright\n" 1477 "\t'n' - version and full copyright notice\n")); 1478#line 58 "../check.c" 1479 puts(_("%s error: the '%s' and '%s' options conflict\n")); 1480#line 217 "../find.c" 1481 puts(_("%s: The '%s' option has been disabled.")); 1482#line 430 "../find.c" 1483 puts(_("%s: The '%s' option has been disabled.")); 1484#line 38 "../alias.c" 1485 puts(_("-equivalence")); 1486#line 469 "../find.c" 1487 puts(_("%s: illegal option -- %c\n")); 1488#line 110 "../reset.c" 1489 puts(_("%s: illegal option -- %c\n")); 1490#line 271 "../find.c" 1491 puts(_("%s: illegal option -- %s\n")); 1492#line 755 "../find.c" 1493 puts(_("%s: illegal option -- %s\n")); 1494#line 118 "../reset.c" 1495 puts(_("%s: illegal option -- %s\n")); 1496#line 335 "../find.c" 1497 puts(_("%s: unknown vendor extension option -- %s\n")); 1498#line 159 "../enum.c" 1499 puts(_(" or an integer from %d through %d\n")); 1500#line 169 "../enum.c" 1501 puts(_(" or an integer from %d through %d\n")); 1502#line 747 "../usage.c" 1503 puts(_("%s error: invalid option descriptor for %s\n")); 1504#line 1081 "../usage.c" 1505 puts(_("%s error: invalid option descriptor for %s\n")); 1506#line 385 "../find.c" 1507 puts(_("%s: invalid option name: %s\n")); 1508#line 527 "../find.c" 1509 puts(_("%s: The '%s' option requires an argument.\n")); 1510#line 156 "../autoopts.c" 1511 puts(_("(AutoOpts bug): Equivalenced option '%s' was equivalenced to both\n" 1512 "\t'%s' and '%s'.")); 1513#line 94 "../check.c" 1514 puts(_("%s error: The %s option is required\n")); 1515#line 632 "../find.c" 1516 puts(_("%s: The '%s' option cannot have an argument.\n")); 1517#line 151 "../check.c" 1518 puts(_("%s: Command line arguments are not allowed.\n")); 1519#line 535 "../save.c" 1520 puts(_("error %d (%s) creating %s\n")); 1521#line 234 "../enum.c" 1522 puts(_("%s error: '%s' does not match any %s keywords.\n")); 1523#line 93 "../reset.c" 1524 puts(_("%s error: The '%s' option requires an argument.\n")); 1525#line 184 "../save.c" 1526 puts(_("error %d (%s) stat-ing %s\n")); 1527#line 238 "../save.c" 1528 puts(_("error %d (%s) stat-ing %s\n")); 1529#line 143 "../restore.c" 1530 puts(_("%s error: no saved option state\n")); 1531#line 231 "../autoopts.c" 1532 puts(_("'%s' is not a command line option.\n")); 1533#line 111 "../time.c" 1534 puts(_("%s error: '%s' is not a recognizable date/time.\n")); 1535#line 132 "../save.c" 1536 puts(_("'%s' not defined\n")); 1537#line 50 "../time.c" 1538 puts(_("%s error: '%s' is not a recognizable time duration.\n")); 1539#line 92 "../check.c" 1540 puts(_("%s error: The %s option must appear %d times.\n")); 1541#line 164 "../numeric.c" 1542 puts(_("%s error: '%s' is not a recognizable number.\n")); 1543#line 200 "../enum.c" 1544 puts(_("%s error: %s exceeds %s keyword count\n")); 1545#line 330 "../usage.c" 1546 puts(_("Try '%s %s' for more information.\n")); 1547#line 45 "../alias.c" 1548 puts(_("one %s%s option allowed\n")); 1549#line 208 "../makeshell.c" 1550 puts(_("standard output")); 1551#line 943 "../makeshell.c" 1552 puts(_("standard output")); 1553#line 274 "../usage.c" 1554 puts(_("standard output")); 1555#line 415 "../usage.c" 1556 puts(_("standard output")); 1557#line 625 "../usage.c" 1558 puts(_("standard output")); 1559#line 175 "../version.c" 1560 puts(_("standard output")); 1561#line 274 "../usage.c" 1562 puts(_("standard error")); 1563#line 415 "../usage.c" 1564 puts(_("standard error")); 1565#line 625 "../usage.c" 1566 puts(_("standard error")); 1567#line 175 "../version.c" 1568 puts(_("standard error")); 1569#line 208 "../makeshell.c" 1570 puts(_("write")); 1571#line 943 "../makeshell.c" 1572 puts(_("write")); 1573#line 273 "../usage.c" 1574 puts(_("write")); 1575#line 414 "../usage.c" 1576 puts(_("write")); 1577#line 624 "../usage.c" 1578 puts(_("write")); 1579#line 174 "../version.c" 1580 puts(_("write")); 1581#line 60 "../numeric.c" 1582 puts(_("%s error: %s option value %ld is out of range.\n")); 1583#line 44 "../check.c" 1584 puts(_("%s error: %s option requires the %s option\n")); 1585#line 131 "../save.c" 1586 puts(_("%s warning: cannot save options - %s not regular file\n")); 1587#line 183 "../save.c" 1588 puts(_("%s warning: cannot save options - %s not regular file\n")); 1589#line 237 "../save.c" 1590 puts(_("%s warning: cannot save options - %s not regular file\n")); 1591#line 256 "../save.c" 1592 puts(_("%s warning: cannot save options - %s not regular file\n")); 1593#line 534 "../save.c" 1594 puts(_("%s warning: cannot save options - %s not regular file\n")); 1595 /* END-LIBOPTS-MESSAGES */ 1596 1597 /* USAGE-TEXT: */ 1598#line 873 "../usage.c" 1599 puts(_("\t\t\t\t- an alternate for '%s'\n")); 1600#line 1148 "../usage.c" 1601 puts(_("Version, usage and configuration options:")); 1602#line 924 "../usage.c" 1603 puts(_("\t\t\t\t- default option for unnamed options\n")); 1604#line 837 "../usage.c" 1605 puts(_("\t\t\t\t- disabled as '--%s'\n")); 1606#line 1117 "../usage.c" 1607 puts(_(" --- %-14s %s\n")); 1608#line 1115 "../usage.c" 1609 puts(_("This option has been disabled")); 1610#line 864 "../usage.c" 1611 puts(_("\t\t\t\t- enabled by default\n")); 1612#line 40 "../alias.c" 1613 puts(_("%s error: only ")); 1614#line 1194 "../usage.c" 1615 puts(_(" - examining environment variables named %s_*\n")); 1616#line 168 "../file.c" 1617 puts(_("\t\t\t\t- file must not pre-exist\n")); 1618#line 172 "../file.c" 1619 puts(_("\t\t\t\t- file must pre-exist\n")); 1620#line 380 "../usage.c" 1621 puts(_("Options are specified by doubled hyphens and their name or by a single\n" 1622 "hyphen and the flag character.\n")); 1623#line 921 "../makeshell.c" 1624 puts(_("\n" 1625 "= = = = = = = =\n\n" 1626 "This incarnation of genshell will produce\n" 1627 "a shell script to parse the options for %s:\n\n")); 1628#line 166 "../enum.c" 1629 puts(_(" or an integer mask with any of the lower %d bits set\n")); 1630#line 897 "../usage.c" 1631 puts(_("\t\t\t\t- is a set membership option\n")); 1632#line 918 "../usage.c" 1633 puts(_("\t\t\t\t- must appear between %d and %d times\n")); 1634#line 382 "../usage.c" 1635 puts(_("Options are specified by single or double hyphens and their name.\n")); 1636#line 904 "../usage.c" 1637 puts(_("\t\t\t\t- may appear multiple times\n")); 1638#line 891 "../usage.c" 1639 puts(_("\t\t\t\t- may not be preset\n")); 1640#line 1309 "../usage.c" 1641 puts(_(" Arg Option-Name Description\n")); 1642#line 1245 "../usage.c" 1643 puts(_(" Flg Arg Option-Name Description\n")); 1644#line 1303 "../usage.c" 1645 puts(_(" Flg Arg Option-Name Description\n")); 1646#line 1304 "../usage.c" 1647 puts(_(" %3s %s")); 1648#line 1310 "../usage.c" 1649 puts(_(" %3s %s")); 1650#line 387 "../usage.c" 1651 puts(_("The '-#<number>' option may omit the hash char\n")); 1652#line 383 "../usage.c" 1653 puts(_("All arguments are named options.\n")); 1654#line 971 "../usage.c" 1655 puts(_(" - reading file %s")); 1656#line 409 "../usage.c" 1657 puts(_("\n" 1658 "Please send bug reports to: <%s>\n")); 1659#line 100 "../version.c" 1660 puts(_("\n" 1661 "Please send bug reports to: <%s>\n")); 1662#line 129 "../version.c" 1663 puts(_("\n" 1664 "Please send bug reports to: <%s>\n")); 1665#line 903 "../usage.c" 1666 puts(_("\t\t\t\t- may NOT appear - preset only\n")); 1667#line 944 "../usage.c" 1668 puts(_("\n" 1669 "The following option preset mechanisms are supported:\n")); 1670#line 1192 "../usage.c" 1671 puts(_("\n" 1672 "The following option preset mechanisms are supported:\n")); 1673#line 682 "../usage.c" 1674 puts(_("prohibits these options:\n")); 1675#line 677 "../usage.c" 1676 puts(_("prohibits the option '%s'\n")); 1677#line 81 "../numeric.c" 1678 puts(_("%s%ld to %ld")); 1679#line 79 "../numeric.c" 1680 puts(_("%sgreater than or equal to %ld")); 1681#line 75 "../numeric.c" 1682 puts(_("%s%ld exactly")); 1683#line 68 "../numeric.c" 1684 puts(_("%sit must lie in one of the ranges:\n")); 1685#line 68 "../numeric.c" 1686 puts(_("%sit must be in the range:\n")); 1687#line 88 "../numeric.c" 1688 puts(_(", or\n")); 1689#line 66 "../numeric.c" 1690 puts(_("%sis scalable with a suffix: k/K/m/M/g/G/t/T\n")); 1691#line 77 "../numeric.c" 1692 puts(_("%sless than or equal to %ld")); 1693#line 390 "../usage.c" 1694 puts(_("Operands and options may be intermixed. They will be reordered.\n")); 1695#line 652 "../usage.c" 1696 puts(_("requires the option '%s'\n")); 1697#line 655 "../usage.c" 1698 puts(_("requires these options:\n")); 1699#line 1321 "../usage.c" 1700 puts(_(" Arg Option-Name Req? Description\n")); 1701#line 1315 "../usage.c" 1702 puts(_(" Flg Arg Option-Name Req? Description\n")); 1703#line 167 "../enum.c" 1704 puts(_("or you may use a numeric representation. Preceding these with a '!'\n" 1705 "will clear the bits, specifying 'none' will clear all bits, and 'all'\n" 1706 "will set them all. Multiple entries may be passed as an option\n" 1707 "argument list.\n")); 1708#line 910 "../usage.c" 1709 puts(_("\t\t\t\t- may appear up to %d times\n")); 1710#line 77 "../enum.c" 1711 puts(_("The valid \"%s\" option keywords are:\n")); 1712#line 1152 "../usage.c" 1713 puts(_("The next option supports vendor supported extra options:")); 1714#line 773 "../usage.c" 1715 puts(_("These additional options are:")); 1716 /* END-USAGE-TEXT */ 1717} 1718#endif /* uncompilable code */ 1719#ifdef __cplusplus 1720} 1721#endif 1722/* ntp-keygen-opts.c ends here */ 1723