/* -*- buffer-read-only: t -*- vi: set ro: * * DO NOT EDIT THIS FILE (serv-args.c) * * It has been AutoGen-ed May 9, 2012 at 08:05:24 PM by AutoGen 5.16 * From the definitions serv-args.def * and the template file options * * Generated from AutoOpts 36:4:11 templates. * * AutoOpts is a copyrighted work. This source file is not encumbered * by AutoOpts licensing, but is provided under the licensing terms chosen * by the gnutls-serv author or copyright holder. AutoOpts is * licensed under the terms of the LGPL. The redistributable library * (``libopts'') is licensed under the terms of either the LGPL or, at the * users discretion, the BSD license. See the AutoOpts and/or libopts sources * for details. * * The gnutls-serv program is copyrighted and licensed * under the following terms: * * Copyright (C) 2000-2012 Free Software Foundation, all rights reserved. * This is free software. It is licensed for use, modification and * redistribution under the terms of the * GNU General Public License, version 3 or later * * * gnutls-serv is free software: you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the * Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * gnutls-serv is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program. If not, see . */ #ifndef __doxygen__ #define OPTION_CODE_COMPILE 1 #include "serv-args.h" #include #include #include #include #include #ifdef __cplusplus extern "C" { #endif extern FILE * option_usage_fp; /* TRANSLATORS: choose the translation for option names wisely because you cannot ever change your mind. */ #define zCopyright (gnutls_serv_opt_strs+0) #define zLicenseDescrip (gnutls_serv_opt_strs+282) #ifndef NULL # define NULL 0 #endif /* * gnutls-serv option static const strings */ static char const gnutls_serv_opt_strs[2947] = /* 0 */ "gnutls-serv @VERSION@\n" "Copyright (C) 2000-2012 Free Software Foundation, all rights reserved.\n" "This is free software. It is licensed for use, modification and\n" "redistribution under the terms of the\n" "GNU General Public License, version 3 or later\n" " \n\0" /* 282 */ "gnutls-serv is free software: you can redistribute it and/or modify it\n" "under the terms of the GNU General Public License as published by the Free\n" "Software Foundation, either version 3 of the License, or (at your option)\n" "any later version.\n\n" "gnutls-serv is distributed in the hope that it will be useful, but WITHOUT\n" "ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or\n" "FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for\n" "more details.\n\n" "You should have received a copy of the GNU General Public License along\n" "with this program. If not, see .\n\0" /* 893 */ "Enable debugging.\0" /* 911 */ "DEBUG\0" /* 917 */ "debug\0" /* 923 */ "Don't accept session tickets\0" /* 952 */ "NOTICKET\0" /* 961 */ "noticket\0" /* 970 */ "Generate Diffie-Hellman and RSA-export parameters\0" /* 1020 */ "GENERATE\0" /* 1029 */ "generate\0" /* 1038 */ "Suppress some messages\0" /* 1061 */ "QUIET\0" /* 1067 */ "quiet\0" /* 1073 */ "Do not use a resumption database\0" /* 1106 */ "NODB\0" /* 1111 */ "nodb\0" /* 1116 */ "Act as an HTTP server\0" /* 1138 */ "HTTP\0" /* 1143 */ "http\0" /* 1148 */ "Act as an Echo server\0" /* 1170 */ "ECHO\0" /* 1175 */ "echo\0" /* 1180 */ "Use DTLS (datagram TLS) over UDP\0" /* 1213 */ "UDP\0" /* 1217 */ "udp\0" /* 1221 */ "Set MTU for datagram TLS\0" /* 1246 */ "MTU\0" /* 1250 */ "mtu\0" /* 1254 */ "Do not request a client certificate\0" /* 1290 */ "DISABLE_CLIENT_CERT\0" /* 1310 */ "disable-client-cert\0" /* 1330 */ "Require a client certificate\0" /* 1359 */ "REQUIRE_CLIENT_CERT\0" /* 1379 */ "require-client-cert\0" /* 1399 */ "Use DER format for certificates to read from\0" /* 1444 */ "X509FMTDER\0" /* 1455 */ "x509fmtder\0" /* 1466 */ "Priorities string\0" /* 1484 */ "PRIORITY\0" /* 1493 */ "priority\0" /* 1502 */ "DH params file to use\0" /* 1524 */ "DHPARAMS\0" /* 1533 */ "dhparams\0" /* 1542 */ "Certificate file or PKCS #11 URL to use\0" /* 1582 */ "X509CAFILE\0" /* 1593 */ "x509cafile\0" /* 1604 */ "CRL file to use\0" /* 1620 */ "X509CRLFILE\0" /* 1632 */ "x509crlfile\0" /* 1644 */ "PGP Key file to use\0" /* 1664 */ "PGPKEYFILE\0" /* 1675 */ "pgpkeyfile\0" /* 1686 */ "PGP Key ring file to use\0" /* 1711 */ "PGPKEYRING\0" /* 1722 */ "pgpkeyring\0" /* 1733 */ "PGP Public Key (certificate) file to use\0" /* 1774 */ "PGPCERTFILE\0" /* 1786 */ "pgpcertfile\0" /* 1798 */ "X.509 key file or PKCS #11 URL to use\0" /* 1836 */ "X509KEYFILE\0" /* 1848 */ "x509keyfile\0" /* 1860 */ "X.509 Certificate file or PKCS #11 URL to use\0" /* 1906 */ "X509CERTFILE\0" /* 1919 */ "x509certfile\0" /* 1932 */ "Alternative X.509 key file or PKCS #11 URL to use\0" /* 1982 */ "X509DSAKEYFILE\0" /* 1997 */ "x509dsakeyfile\0" /* 2012 */ "Alternative X.509 Certificate file or PKCS #11 URL to use\0" /* 2070 */ "X509DSACERTFILE\0" /* 2086 */ "x509dsacertfile\0" /* 2102 */ "X509ECCKEYFILE\0" /* 2117 */ "x509ecckeyfile\0" /* 2132 */ "X509ECCCERTFILE\0" /* 2148 */ "x509ecccertfile\0" /* 2164 */ "PGP subkey to use (hex or auto)\0" /* 2196 */ "PGPSUBKEY\0" /* 2206 */ "pgpsubkey\0" /* 2216 */ "SRP password file to use\0" /* 2241 */ "SRPPASSWD\0" /* 2251 */ "srppasswd\0" /* 2261 */ "SRP password configuration file to use\0" /* 2300 */ "SRPPASSWDCONF\0" /* 2314 */ "srppasswdconf\0" /* 2328 */ "PSK password file to use\0" /* 2353 */ "PSKPASSWD\0" /* 2363 */ "pskpasswd\0" /* 2373 */ "PSK identity hint to use\0" /* 2398 */ "PSKHINT\0" /* 2406 */ "pskhint\0" /* 2414 */ "The port to connect to\0" /* 2437 */ "PORT\0" /* 2442 */ "port\0" /* 2447 */ "Print a list of the supported algorithms and modes\0" /* 2498 */ "LIST\0" /* 2503 */ "list\0" /* 2508 */ "Display extended usage information and exit\0" /* 2552 */ "help\0" /* 2557 */ "Extended usage information passed thru pager\0" /* 2602 */ "more-help\0" /* 2612 */ "Output version information and exit\0" /* 2648 */ "version\0" /* 2656 */ "GNUTLS_SERV\0" /* 2668 */ "gnutls-serv - GnuTLS server - Ver. @VERSION@\n" "USAGE: %s [ - [] | --[{=| }] ]...\n\0" /* 2771 */ "bug-gnutls@gnu.org\0" /* 2790 */ "\n\n\0" /* 2793 */ "\n" "Server program that listens to incoming TLS connections.\n\0" /* 2852 */ "gnutls-serv @VERSION@\0" /* 2874 */ "Usage: gnutls-serv [options]\n" "gnutls-serv --help for usage instructions.\n"; /* * debug option description: */ #define DEBUG_DESC (gnutls_serv_opt_strs+893) #define DEBUG_NAME (gnutls_serv_opt_strs+911) #define DEBUG_name (gnutls_serv_opt_strs+917) #define DEBUG_FLAGS (OPTST_DISABLED \ | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC)) /* * noticket option description: */ #define NOTICKET_DESC (gnutls_serv_opt_strs+923) #define NOTICKET_NAME (gnutls_serv_opt_strs+952) #define NOTICKET_name (gnutls_serv_opt_strs+961) #define NOTICKET_FLAGS (OPTST_DISABLED) /* * generate option description: */ #define GENERATE_DESC (gnutls_serv_opt_strs+970) #define GENERATE_NAME (gnutls_serv_opt_strs+1020) #define GENERATE_name (gnutls_serv_opt_strs+1029) #define GENERATE_FLAGS (OPTST_DISABLED) /* * quiet option description: */ #define QUIET_DESC (gnutls_serv_opt_strs+1038) #define QUIET_NAME (gnutls_serv_opt_strs+1061) #define QUIET_name (gnutls_serv_opt_strs+1067) #define QUIET_FLAGS (OPTST_DISABLED) /* * nodb option description: */ #define NODB_DESC (gnutls_serv_opt_strs+1073) #define NODB_NAME (gnutls_serv_opt_strs+1106) #define NODB_name (gnutls_serv_opt_strs+1111) #define NODB_FLAGS (OPTST_DISABLED) /* * http option description: */ #define HTTP_DESC (gnutls_serv_opt_strs+1116) #define HTTP_NAME (gnutls_serv_opt_strs+1138) #define HTTP_name (gnutls_serv_opt_strs+1143) #define HTTP_FLAGS (OPTST_DISABLED) /* * echo option description: */ #define ECHO_DESC (gnutls_serv_opt_strs+1148) #define ECHO_NAME (gnutls_serv_opt_strs+1170) #define ECHO_name (gnutls_serv_opt_strs+1175) #define ECHO_FLAGS (OPTST_DISABLED) /* * udp option description: */ #define UDP_DESC (gnutls_serv_opt_strs+1180) #define UDP_NAME (gnutls_serv_opt_strs+1213) #define UDP_name (gnutls_serv_opt_strs+1217) #define UDP_FLAGS (OPTST_DISABLED) /* * mtu option description: */ #define MTU_DESC (gnutls_serv_opt_strs+1221) #define MTU_NAME (gnutls_serv_opt_strs+1246) #define MTU_name (gnutls_serv_opt_strs+1250) #define MTU_FLAGS (OPTST_DISABLED \ | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC)) /* * disable-client-cert option description: */ #define DISABLE_CLIENT_CERT_DESC (gnutls_serv_opt_strs+1254) #define DISABLE_CLIENT_CERT_NAME (gnutls_serv_opt_strs+1290) #define DISABLE_CLIENT_CERT_name (gnutls_serv_opt_strs+1310) #define DISABLE_CLIENT_CERT_FLAGS (OPTST_DISABLED) /* * require-client-cert option description: */ #define REQUIRE_CLIENT_CERT_DESC (gnutls_serv_opt_strs+1330) #define REQUIRE_CLIENT_CERT_NAME (gnutls_serv_opt_strs+1359) #define REQUIRE_CLIENT_CERT_name (gnutls_serv_opt_strs+1379) #define REQUIRE_CLIENT_CERT_FLAGS (OPTST_DISABLED) /* * x509fmtder option description: */ #define X509FMTDER_DESC (gnutls_serv_opt_strs+1399) #define X509FMTDER_NAME (gnutls_serv_opt_strs+1444) #define X509FMTDER_name (gnutls_serv_opt_strs+1455) #define X509FMTDER_FLAGS (OPTST_DISABLED) /* * priority option description: */ #define PRIORITY_DESC (gnutls_serv_opt_strs+1466) #define PRIORITY_NAME (gnutls_serv_opt_strs+1484) #define PRIORITY_name (gnutls_serv_opt_strs+1493) #define PRIORITY_FLAGS (OPTST_DISABLED \ | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) /* * dhparams option description: */ #define DHPARAMS_DESC (gnutls_serv_opt_strs+1502) #define DHPARAMS_NAME (gnutls_serv_opt_strs+1524) #define DHPARAMS_name (gnutls_serv_opt_strs+1533) #define DHPARAMS_FLAGS (OPTST_DISABLED \ | OPTST_SET_ARGTYPE(OPARG_TYPE_FILE)) /* * x509cafile option description: */ #define X509CAFILE_DESC (gnutls_serv_opt_strs+1542) #define X509CAFILE_NAME (gnutls_serv_opt_strs+1582) #define X509CAFILE_name (gnutls_serv_opt_strs+1593) #define X509CAFILE_FLAGS (OPTST_DISABLED \ | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) /* * x509crlfile option description: */ #define X509CRLFILE_DESC (gnutls_serv_opt_strs+1604) #define X509CRLFILE_NAME (gnutls_serv_opt_strs+1620) #define X509CRLFILE_name (gnutls_serv_opt_strs+1632) #define X509CRLFILE_FLAGS (OPTST_DISABLED \ | OPTST_SET_ARGTYPE(OPARG_TYPE_FILE)) /* * pgpkeyfile option description: */ #define PGPKEYFILE_DESC (gnutls_serv_opt_strs+1644) #define PGPKEYFILE_NAME (gnutls_serv_opt_strs+1664) #define PGPKEYFILE_name (gnutls_serv_opt_strs+1675) #define PGPKEYFILE_FLAGS (OPTST_DISABLED \ | OPTST_SET_ARGTYPE(OPARG_TYPE_FILE)) /* * pgpkeyring option description: */ #define PGPKEYRING_DESC (gnutls_serv_opt_strs+1686) #define PGPKEYRING_NAME (gnutls_serv_opt_strs+1711) #define PGPKEYRING_name (gnutls_serv_opt_strs+1722) #define PGPKEYRING_FLAGS (OPTST_DISABLED \ | OPTST_SET_ARGTYPE(OPARG_TYPE_FILE)) /* * pgpcertfile option description: */ #define PGPCERTFILE_DESC (gnutls_serv_opt_strs+1733) #define PGPCERTFILE_NAME (gnutls_serv_opt_strs+1774) #define PGPCERTFILE_name (gnutls_serv_opt_strs+1786) #define PGPCERTFILE_FLAGS (OPTST_DISABLED \ | OPTST_SET_ARGTYPE(OPARG_TYPE_FILE)) /* * x509keyfile option description: */ #define X509KEYFILE_DESC (gnutls_serv_opt_strs+1798) #define X509KEYFILE_NAME (gnutls_serv_opt_strs+1836) #define X509KEYFILE_name (gnutls_serv_opt_strs+1848) #define X509KEYFILE_FLAGS (OPTST_DISABLED \ | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) /* * x509certfile option description: */ #define X509CERTFILE_DESC (gnutls_serv_opt_strs+1860) #define X509CERTFILE_NAME (gnutls_serv_opt_strs+1906) #define X509CERTFILE_name (gnutls_serv_opt_strs+1919) #define X509CERTFILE_FLAGS (OPTST_DISABLED \ | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) /* * x509dsakeyfile option description: */ #define X509DSAKEYFILE_DESC (gnutls_serv_opt_strs+1932) #define X509DSAKEYFILE_NAME (gnutls_serv_opt_strs+1982) #define X509DSAKEYFILE_name (gnutls_serv_opt_strs+1997) #define X509DSAKEYFILE_FLAGS (OPTST_DISABLED \ | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) /* * x509dsacertfile option description: */ #define X509DSACERTFILE_DESC (gnutls_serv_opt_strs+2012) #define X509DSACERTFILE_NAME (gnutls_serv_opt_strs+2070) #define X509DSACERTFILE_name (gnutls_serv_opt_strs+2086) #define X509DSACERTFILE_FLAGS (OPTST_DISABLED \ | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) /* * x509ecckeyfile option description: */ #define X509ECCKEYFILE_DESC (gnutls_serv_opt_strs+1932) #define X509ECCKEYFILE_NAME (gnutls_serv_opt_strs+2102) #define X509ECCKEYFILE_name (gnutls_serv_opt_strs+2117) #define X509ECCKEYFILE_FLAGS (OPTST_DISABLED \ | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) /* * x509ecccertfile option description: */ #define X509ECCCERTFILE_DESC (gnutls_serv_opt_strs+2012) #define X509ECCCERTFILE_NAME (gnutls_serv_opt_strs+2132) #define X509ECCCERTFILE_name (gnutls_serv_opt_strs+2148) #define X509ECCCERTFILE_FLAGS (OPTST_DISABLED \ | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) /* * pgpsubkey option description: */ #define PGPSUBKEY_DESC (gnutls_serv_opt_strs+2164) #define PGPSUBKEY_NAME (gnutls_serv_opt_strs+2196) #define PGPSUBKEY_name (gnutls_serv_opt_strs+2206) #define PGPSUBKEY_FLAGS (OPTST_DISABLED \ | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) /* * srppasswd option description: */ #define SRPPASSWD_DESC (gnutls_serv_opt_strs+2216) #define SRPPASSWD_NAME (gnutls_serv_opt_strs+2241) #define SRPPASSWD_name (gnutls_serv_opt_strs+2251) #define SRPPASSWD_FLAGS (OPTST_DISABLED \ | OPTST_SET_ARGTYPE(OPARG_TYPE_FILE)) /* * srppasswdconf option description: */ #define SRPPASSWDCONF_DESC (gnutls_serv_opt_strs+2261) #define SRPPASSWDCONF_NAME (gnutls_serv_opt_strs+2300) #define SRPPASSWDCONF_name (gnutls_serv_opt_strs+2314) #define SRPPASSWDCONF_FLAGS (OPTST_DISABLED \ | OPTST_SET_ARGTYPE(OPARG_TYPE_FILE)) /* * pskpasswd option description: */ #define PSKPASSWD_DESC (gnutls_serv_opt_strs+2328) #define PSKPASSWD_NAME (gnutls_serv_opt_strs+2353) #define PSKPASSWD_name (gnutls_serv_opt_strs+2363) #define PSKPASSWD_FLAGS (OPTST_DISABLED \ | OPTST_SET_ARGTYPE(OPARG_TYPE_FILE)) /* * pskhint option description: */ #define PSKHINT_DESC (gnutls_serv_opt_strs+2373) #define PSKHINT_NAME (gnutls_serv_opt_strs+2398) #define PSKHINT_name (gnutls_serv_opt_strs+2406) #define PSKHINT_FLAGS (OPTST_DISABLED \ | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) /* * port option description: */ #define PORT_DESC (gnutls_serv_opt_strs+2414) #define PORT_NAME (gnutls_serv_opt_strs+2437) #define PORT_name (gnutls_serv_opt_strs+2442) #define PORT_FLAGS (OPTST_DISABLED \ | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC)) /* * list option description: */ #define LIST_DESC (gnutls_serv_opt_strs+2447) #define LIST_NAME (gnutls_serv_opt_strs+2498) #define LIST_name (gnutls_serv_opt_strs+2503) #define LIST_FLAGS (OPTST_DISABLED) /* * Help/More_Help/Version option descriptions: */ #define HELP_DESC (gnutls_serv_opt_strs+2508) #define HELP_name (gnutls_serv_opt_strs+2552) #ifdef HAVE_WORKING_FORK #define MORE_HELP_DESC (gnutls_serv_opt_strs+2557) #define MORE_HELP_name (gnutls_serv_opt_strs+2602) #define MORE_HELP_FLAGS (OPTST_IMM | OPTST_NO_INIT) #else #define MORE_HELP_DESC NULL #define MORE_HELP_name NULL #define MORE_HELP_FLAGS (OPTST_OMITTED | OPTST_NO_INIT) #endif #ifdef NO_OPTIONAL_OPT_ARGS # define VER_FLAGS (OPTST_IMM | OPTST_NO_INIT) #else # define VER_FLAGS (OPTST_SET_ARGTYPE(OPARG_TYPE_STRING) | \ OPTST_ARG_OPTIONAL | OPTST_IMM | OPTST_NO_INIT) #endif #define VER_DESC (gnutls_serv_opt_strs+2612) #define VER_name (gnutls_serv_opt_strs+2648) /* * Declare option callback procedures */ extern tOptProc optionBooleanVal, optionNestedVal, optionNumericVal, optionPagedUsage, optionPrintVersion, optionResetOpt, optionStackArg, optionTimeDate, optionTimeVal, optionUnstackArg, optionVendorOption; static tOptProc doOptDebug, doOptDhparams, doOptMtu, doOptPgpcertfile, doOptPgpkeyfile, doOptPgpkeyring, doOptPskpasswd, doOptSrppasswd, doOptSrppasswdconf, doOptX509crlfile, doUsageOpt; #define VER_PROC optionPrintVersion /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /** * Define the gnutls-serv Option Descriptions. * This is an array of OPTION_CT entries, one for each * option that the gnutls-serv program responds to. */ static tOptDesc optDesc[OPTION_CT] = { { /* entry idx, value */ 0, VALUE_OPT_DEBUG, /* equiv idx, value */ 0, VALUE_OPT_DEBUG, /* equivalenced to */ NO_EQUIVALENT, /* min, max, act ct */ 0, 1, 0, /* opt state flags */ DEBUG_FLAGS, 0, /* last opt argumnt */ { NULL }, /* --debug */ /* arg list/cookie */ NULL, /* must/cannot opts */ NULL, NULL, /* option proc */ doOptDebug, /* desc, NAME, name */ DEBUG_DESC, DEBUG_NAME, DEBUG_name, /* disablement strs */ NULL, NULL }, { /* entry idx, value */ 1, VALUE_OPT_NOTICKET, /* equiv idx, value */ 1, VALUE_OPT_NOTICKET, /* equivalenced to */ NO_EQUIVALENT, /* min, max, act ct */ 0, 1, 0, /* opt state flags */ NOTICKET_FLAGS, 0, /* last opt argumnt */ { NULL }, /* --noticket */ /* arg list/cookie */ NULL, /* must/cannot opts */ NULL, NULL, /* option proc */ NULL, /* desc, NAME, name */ NOTICKET_DESC, NOTICKET_NAME, NOTICKET_name, /* disablement strs */ NULL, NULL }, { /* entry idx, value */ 2, VALUE_OPT_GENERATE, /* equiv idx, value */ 2, VALUE_OPT_GENERATE, /* equivalenced to */ NO_EQUIVALENT, /* min, max, act ct */ 0, 1, 0, /* opt state flags */ GENERATE_FLAGS, 0, /* last opt argumnt */ { NULL }, /* --generate */ /* arg list/cookie */ NULL, /* must/cannot opts */ NULL, NULL, /* option proc */ NULL, /* desc, NAME, name */ GENERATE_DESC, GENERATE_NAME, GENERATE_name, /* disablement strs */ NULL, NULL }, { /* entry idx, value */ 3, VALUE_OPT_QUIET, /* equiv idx, value */ 3, VALUE_OPT_QUIET, /* equivalenced to */ NO_EQUIVALENT, /* min, max, act ct */ 0, 1, 0, /* opt state flags */ QUIET_FLAGS, 0, /* last opt argumnt */ { NULL }, /* --quiet */ /* arg list/cookie */ NULL, /* must/cannot opts */ NULL, NULL, /* option proc */ NULL, /* desc, NAME, name */ QUIET_DESC, QUIET_NAME, QUIET_name, /* disablement strs */ NULL, NULL }, { /* entry idx, value */ 4, VALUE_OPT_NODB, /* equiv idx, value */ 4, VALUE_OPT_NODB, /* equivalenced to */ NO_EQUIVALENT, /* min, max, act ct */ 0, 1, 0, /* opt state flags */ NODB_FLAGS, 0, /* last opt argumnt */ { NULL }, /* --nodb */ /* arg list/cookie */ NULL, /* must/cannot opts */ NULL, NULL, /* option proc */ NULL, /* desc, NAME, name */ NODB_DESC, NODB_NAME, NODB_name, /* disablement strs */ NULL, NULL }, { /* entry idx, value */ 5, VALUE_OPT_HTTP, /* equiv idx, value */ 5, VALUE_OPT_HTTP, /* equivalenced to */ NO_EQUIVALENT, /* min, max, act ct */ 0, 1, 0, /* opt state flags */ HTTP_FLAGS, 0, /* last opt argumnt */ { NULL }, /* --http */ /* arg list/cookie */ NULL, /* must/cannot opts */ NULL, NULL, /* option proc */ NULL, /* desc, NAME, name */ HTTP_DESC, HTTP_NAME, HTTP_name, /* disablement strs */ NULL, NULL }, { /* entry idx, value */ 6, VALUE_OPT_ECHO, /* equiv idx, value */ 6, VALUE_OPT_ECHO, /* equivalenced to */ NO_EQUIVALENT, /* min, max, act ct */ 0, 1, 0, /* opt state flags */ ECHO_FLAGS, 0, /* last opt argumnt */ { NULL }, /* --echo */ /* arg list/cookie */ NULL, /* must/cannot opts */ NULL, NULL, /* option proc */ NULL, /* desc, NAME, name */ ECHO_DESC, ECHO_NAME, ECHO_name, /* disablement strs */ NULL, NULL }, { /* entry idx, value */ 7, VALUE_OPT_UDP, /* equiv idx, value */ 7, VALUE_OPT_UDP, /* equivalenced to */ NO_EQUIVALENT, /* min, max, act ct */ 0, 1, 0, /* opt state flags */ UDP_FLAGS, 0, /* last opt argumnt */ { NULL }, /* --udp */ /* arg list/cookie */ NULL, /* must/cannot opts */ NULL, NULL, /* option proc */ NULL, /* desc, NAME, name */ UDP_DESC, UDP_NAME, UDP_name, /* disablement strs */ NULL, NULL }, { /* entry idx, value */ 8, VALUE_OPT_MTU, /* equiv idx, value */ 8, VALUE_OPT_MTU, /* equivalenced to */ NO_EQUIVALENT, /* min, max, act ct */ 0, 1, 0, /* opt state flags */ MTU_FLAGS, 0, /* last opt argumnt */ { NULL }, /* --mtu */ /* arg list/cookie */ NULL, /* must/cannot opts */ NULL, NULL, /* option proc */ doOptMtu, /* desc, NAME, name */ MTU_DESC, MTU_NAME, MTU_name, /* disablement strs */ NULL, NULL }, { /* entry idx, value */ 9, VALUE_OPT_DISABLE_CLIENT_CERT, /* equiv idx, value */ 9, VALUE_OPT_DISABLE_CLIENT_CERT, /* equivalenced to */ NO_EQUIVALENT, /* min, max, act ct */ 0, 1, 0, /* opt state flags */ DISABLE_CLIENT_CERT_FLAGS, 0, /* last opt argumnt */ { NULL }, /* --disable-client-cert */ /* arg list/cookie */ NULL, /* must/cannot opts */ NULL, NULL, /* option proc */ NULL, /* desc, NAME, name */ DISABLE_CLIENT_CERT_DESC, DISABLE_CLIENT_CERT_NAME, DISABLE_CLIENT_CERT_name, /* disablement strs */ NULL, NULL }, { /* entry idx, value */ 10, VALUE_OPT_REQUIRE_CLIENT_CERT, /* equiv idx, value */ 10, VALUE_OPT_REQUIRE_CLIENT_CERT, /* equivalenced to */ NO_EQUIVALENT, /* min, max, act ct */ 0, 1, 0, /* opt state flags */ REQUIRE_CLIENT_CERT_FLAGS, 0, /* last opt argumnt */ { NULL }, /* --require-client-cert */ /* arg list/cookie */ NULL, /* must/cannot opts */ NULL, NULL, /* option proc */ NULL, /* desc, NAME, name */ REQUIRE_CLIENT_CERT_DESC, REQUIRE_CLIENT_CERT_NAME, REQUIRE_CLIENT_CERT_name, /* disablement strs */ NULL, NULL }, { /* entry idx, value */ 11, VALUE_OPT_X509FMTDER, /* equiv idx, value */ 11, VALUE_OPT_X509FMTDER, /* equivalenced to */ NO_EQUIVALENT, /* min, max, act ct */ 0, 1, 0, /* opt state flags */ X509FMTDER_FLAGS, 0, /* last opt argumnt */ { NULL }, /* --x509fmtder */ /* arg list/cookie */ NULL, /* must/cannot opts */ NULL, NULL, /* option proc */ NULL, /* desc, NAME, name */ X509FMTDER_DESC, X509FMTDER_NAME, X509FMTDER_name, /* disablement strs */ NULL, NULL }, { /* entry idx, value */ 12, VALUE_OPT_PRIORITY, /* equiv idx, value */ 12, VALUE_OPT_PRIORITY, /* equivalenced to */ NO_EQUIVALENT, /* min, max, act ct */ 0, 1, 0, /* opt state flags */ PRIORITY_FLAGS, 0, /* last opt argumnt */ { NULL }, /* --priority */ /* arg list/cookie */ NULL, /* must/cannot opts */ NULL, NULL, /* option proc */ NULL, /* desc, NAME, name */ PRIORITY_DESC, PRIORITY_NAME, PRIORITY_name, /* disablement strs */ NULL, NULL }, { /* entry idx, value */ 13, VALUE_OPT_DHPARAMS, /* equiv idx, value */ 13, VALUE_OPT_DHPARAMS, /* equivalenced to */ NO_EQUIVALENT, /* min, max, act ct */ 0, 1, 0, /* opt state flags */ DHPARAMS_FLAGS, 0, /* last opt argumnt */ { NULL }, /* --dhparams */ /* arg list/cookie */ NULL, /* must/cannot opts */ NULL, NULL, /* option proc */ doOptDhparams, /* desc, NAME, name */ DHPARAMS_DESC, DHPARAMS_NAME, DHPARAMS_name, /* disablement strs */ NULL, NULL }, { /* entry idx, value */ 14, VALUE_OPT_X509CAFILE, /* equiv idx, value */ 14, VALUE_OPT_X509CAFILE, /* equivalenced to */ NO_EQUIVALENT, /* min, max, act ct */ 0, 1, 0, /* opt state flags */ X509CAFILE_FLAGS, 0, /* last opt argumnt */ { NULL }, /* --x509cafile */ /* arg list/cookie */ NULL, /* must/cannot opts */ NULL, NULL, /* option proc */ NULL, /* desc, NAME, name */ X509CAFILE_DESC, X509CAFILE_NAME, X509CAFILE_name, /* disablement strs */ NULL, NULL }, { /* entry idx, value */ 15, VALUE_OPT_X509CRLFILE, /* equiv idx, value */ 15, VALUE_OPT_X509CRLFILE, /* equivalenced to */ NO_EQUIVALENT, /* min, max, act ct */ 0, 1, 0, /* opt state flags */ X509CRLFILE_FLAGS, 0, /* last opt argumnt */ { NULL }, /* --x509crlfile */ /* arg list/cookie */ NULL, /* must/cannot opts */ NULL, NULL, /* option proc */ doOptX509crlfile, /* desc, NAME, name */ X509CRLFILE_DESC, X509CRLFILE_NAME, X509CRLFILE_name, /* disablement strs */ NULL, NULL }, { /* entry idx, value */ 16, VALUE_OPT_PGPKEYFILE, /* equiv idx, value */ 16, VALUE_OPT_PGPKEYFILE, /* equivalenced to */ NO_EQUIVALENT, /* min, max, act ct */ 0, 1, 0, /* opt state flags */ PGPKEYFILE_FLAGS, 0, /* last opt argumnt */ { NULL }, /* --pgpkeyfile */ /* arg list/cookie */ NULL, /* must/cannot opts */ NULL, NULL, /* option proc */ doOptPgpkeyfile, /* desc, NAME, name */ PGPKEYFILE_DESC, PGPKEYFILE_NAME, PGPKEYFILE_name, /* disablement strs */ NULL, NULL }, { /* entry idx, value */ 17, VALUE_OPT_PGPKEYRING, /* equiv idx, value */ 17, VALUE_OPT_PGPKEYRING, /* equivalenced to */ NO_EQUIVALENT, /* min, max, act ct */ 0, 1, 0, /* opt state flags */ PGPKEYRING_FLAGS, 0, /* last opt argumnt */ { NULL }, /* --pgpkeyring */ /* arg list/cookie */ NULL, /* must/cannot opts */ NULL, NULL, /* option proc */ doOptPgpkeyring, /* desc, NAME, name */ PGPKEYRING_DESC, PGPKEYRING_NAME, PGPKEYRING_name, /* disablement strs */ NULL, NULL }, { /* entry idx, value */ 18, VALUE_OPT_PGPCERTFILE, /* equiv idx, value */ 18, VALUE_OPT_PGPCERTFILE, /* equivalenced to */ NO_EQUIVALENT, /* min, max, act ct */ 0, 1, 0, /* opt state flags */ PGPCERTFILE_FLAGS, 0, /* last opt argumnt */ { NULL }, /* --pgpcertfile */ /* arg list/cookie */ NULL, /* must/cannot opts */ NULL, NULL, /* option proc */ doOptPgpcertfile, /* desc, NAME, name */ PGPCERTFILE_DESC, PGPCERTFILE_NAME, PGPCERTFILE_name, /* disablement strs */ NULL, NULL }, { /* entry idx, value */ 19, VALUE_OPT_X509KEYFILE, /* equiv idx, value */ 19, VALUE_OPT_X509KEYFILE, /* equivalenced to */ NO_EQUIVALENT, /* min, max, act ct */ 0, 1, 0, /* opt state flags */ X509KEYFILE_FLAGS, 0, /* last opt argumnt */ { NULL }, /* --x509keyfile */ /* arg list/cookie */ NULL, /* must/cannot opts */ NULL, NULL, /* option proc */ NULL, /* desc, NAME, name */ X509KEYFILE_DESC, X509KEYFILE_NAME, X509KEYFILE_name, /* disablement strs */ NULL, NULL }, { /* entry idx, value */ 20, VALUE_OPT_X509CERTFILE, /* equiv idx, value */ 20, VALUE_OPT_X509CERTFILE, /* equivalenced to */ NO_EQUIVALENT, /* min, max, act ct */ 0, 1, 0, /* opt state flags */ X509CERTFILE_FLAGS, 0, /* last opt argumnt */ { NULL }, /* --x509certfile */ /* arg list/cookie */ NULL, /* must/cannot opts */ NULL, NULL, /* option proc */ NULL, /* desc, NAME, name */ X509CERTFILE_DESC, X509CERTFILE_NAME, X509CERTFILE_name, /* disablement strs */ NULL, NULL }, { /* entry idx, value */ 21, VALUE_OPT_X509DSAKEYFILE, /* equiv idx, value */ 21, VALUE_OPT_X509DSAKEYFILE, /* equivalenced to */ NO_EQUIVALENT, /* min, max, act ct */ 0, 1, 0, /* opt state flags */ X509DSAKEYFILE_FLAGS, 0, /* last opt argumnt */ { NULL }, /* --x509dsakeyfile */ /* arg list/cookie */ NULL, /* must/cannot opts */ NULL, NULL, /* option proc */ NULL, /* desc, NAME, name */ X509DSAKEYFILE_DESC, X509DSAKEYFILE_NAME, X509DSAKEYFILE_name, /* disablement strs */ NULL, NULL }, { /* entry idx, value */ 22, VALUE_OPT_X509DSACERTFILE, /* equiv idx, value */ 22, VALUE_OPT_X509DSACERTFILE, /* equivalenced to */ NO_EQUIVALENT, /* min, max, act ct */ 0, 1, 0, /* opt state flags */ X509DSACERTFILE_FLAGS, 0, /* last opt argumnt */ { NULL }, /* --x509dsacertfile */ /* arg list/cookie */ NULL, /* must/cannot opts */ NULL, NULL, /* option proc */ NULL, /* desc, NAME, name */ X509DSACERTFILE_DESC, X509DSACERTFILE_NAME, X509DSACERTFILE_name, /* disablement strs */ NULL, NULL }, { /* entry idx, value */ 23, VALUE_OPT_X509ECCKEYFILE, /* equiv idx, value */ 23, VALUE_OPT_X509ECCKEYFILE, /* equivalenced to */ NO_EQUIVALENT, /* min, max, act ct */ 0, 1, 0, /* opt state flags */ X509ECCKEYFILE_FLAGS, 0, /* last opt argumnt */ { NULL }, /* --x509ecckeyfile */ /* arg list/cookie */ NULL, /* must/cannot opts */ NULL, NULL, /* option proc */ NULL, /* desc, NAME, name */ X509ECCKEYFILE_DESC, X509ECCKEYFILE_NAME, X509ECCKEYFILE_name, /* disablement strs */ NULL, NULL }, { /* entry idx, value */ 24, VALUE_OPT_X509ECCCERTFILE, /* equiv idx, value */ 24, VALUE_OPT_X509ECCCERTFILE, /* equivalenced to */ NO_EQUIVALENT, /* min, max, act ct */ 0, 1, 0, /* opt state flags */ X509ECCCERTFILE_FLAGS, 0, /* last opt argumnt */ { NULL }, /* --x509ecccertfile */ /* arg list/cookie */ NULL, /* must/cannot opts */ NULL, NULL, /* option proc */ NULL, /* desc, NAME, name */ X509ECCCERTFILE_DESC, X509ECCCERTFILE_NAME, X509ECCCERTFILE_name, /* disablement strs */ NULL, NULL }, { /* entry idx, value */ 25, VALUE_OPT_PGPSUBKEY, /* equiv idx, value */ 25, VALUE_OPT_PGPSUBKEY, /* equivalenced to */ NO_EQUIVALENT, /* min, max, act ct */ 0, 1, 0, /* opt state flags */ PGPSUBKEY_FLAGS, 0, /* last opt argumnt */ { NULL }, /* --pgpsubkey */ /* arg list/cookie */ NULL, /* must/cannot opts */ NULL, NULL, /* option proc */ NULL, /* desc, NAME, name */ PGPSUBKEY_DESC, PGPSUBKEY_NAME, PGPSUBKEY_name, /* disablement strs */ NULL, NULL }, { /* entry idx, value */ 26, VALUE_OPT_SRPPASSWD, /* equiv idx, value */ 26, VALUE_OPT_SRPPASSWD, /* equivalenced to */ NO_EQUIVALENT, /* min, max, act ct */ 0, 1, 0, /* opt state flags */ SRPPASSWD_FLAGS, 0, /* last opt argumnt */ { NULL }, /* --srppasswd */ /* arg list/cookie */ NULL, /* must/cannot opts */ NULL, NULL, /* option proc */ doOptSrppasswd, /* desc, NAME, name */ SRPPASSWD_DESC, SRPPASSWD_NAME, SRPPASSWD_name, /* disablement strs */ NULL, NULL }, { /* entry idx, value */ 27, VALUE_OPT_SRPPASSWDCONF, /* equiv idx, value */ 27, VALUE_OPT_SRPPASSWDCONF, /* equivalenced to */ NO_EQUIVALENT, /* min, max, act ct */ 0, 1, 0, /* opt state flags */ SRPPASSWDCONF_FLAGS, 0, /* last opt argumnt */ { NULL }, /* --srppasswdconf */ /* arg list/cookie */ NULL, /* must/cannot opts */ NULL, NULL, /* option proc */ doOptSrppasswdconf, /* desc, NAME, name */ SRPPASSWDCONF_DESC, SRPPASSWDCONF_NAME, SRPPASSWDCONF_name, /* disablement strs */ NULL, NULL }, { /* entry idx, value */ 28, VALUE_OPT_PSKPASSWD, /* equiv idx, value */ 28, VALUE_OPT_PSKPASSWD, /* equivalenced to */ NO_EQUIVALENT, /* min, max, act ct */ 0, 1, 0, /* opt state flags */ PSKPASSWD_FLAGS, 0, /* last opt argumnt */ { NULL }, /* --pskpasswd */ /* arg list/cookie */ NULL, /* must/cannot opts */ NULL, NULL, /* option proc */ doOptPskpasswd, /* desc, NAME, name */ PSKPASSWD_DESC, PSKPASSWD_NAME, PSKPASSWD_name, /* disablement strs */ NULL, NULL }, { /* entry idx, value */ 29, VALUE_OPT_PSKHINT, /* equiv idx, value */ 29, VALUE_OPT_PSKHINT, /* equivalenced to */ NO_EQUIVALENT, /* min, max, act ct */ 0, 1, 0, /* opt state flags */ PSKHINT_FLAGS, 0, /* last opt argumnt */ { NULL }, /* --pskhint */ /* arg list/cookie */ NULL, /* must/cannot opts */ NULL, NULL, /* option proc */ NULL, /* desc, NAME, name */ PSKHINT_DESC, PSKHINT_NAME, PSKHINT_name, /* disablement strs */ NULL, NULL }, { /* entry idx, value */ 30, VALUE_OPT_PORT, /* equiv idx, value */ 30, VALUE_OPT_PORT, /* equivalenced to */ NO_EQUIVALENT, /* min, max, act ct */ 0, 1, 0, /* opt state flags */ PORT_FLAGS, 0, /* last opt argumnt */ { NULL }, /* --port */ /* arg list/cookie */ NULL, /* must/cannot opts */ NULL, NULL, /* option proc */ optionNumericVal, /* desc, NAME, name */ PORT_DESC, PORT_NAME, PORT_name, /* disablement strs */ NULL, NULL }, { /* entry idx, value */ 31, VALUE_OPT_LIST, /* equiv idx, value */ 31, VALUE_OPT_LIST, /* equivalenced to */ NO_EQUIVALENT, /* min, max, act ct */ 0, 1, 0, /* opt state flags */ LIST_FLAGS, 0, /* last opt argumnt */ { NULL }, /* --list */ /* arg list/cookie */ NULL, /* must/cannot opts */ NULL, NULL, /* option proc */ NULL, /* desc, NAME, name */ LIST_DESC, LIST_NAME, LIST_name, /* disablement strs */ NULL, NULL }, { /* entry idx, value */ INDEX_OPT_VERSION, VALUE_OPT_VERSION, /* equiv idx value */ NO_EQUIVALENT, VALUE_OPT_VERSION, /* equivalenced to */ NO_EQUIVALENT, /* min, max, act ct */ 0, 1, 0, /* opt state flags */ VER_FLAGS, 0, /* last opt argumnt */ { NULL }, /* arg list/cookie */ NULL, /* must/cannot opts */ NULL, NULL, /* option proc */ VER_PROC, /* desc, NAME, name */ VER_DESC, NULL, VER_name, /* disablement strs */ NULL, NULL }, { /* entry idx, value */ INDEX_OPT_HELP, VALUE_OPT_HELP, /* equiv idx value */ NO_EQUIVALENT, VALUE_OPT_HELP, /* equivalenced to */ NO_EQUIVALENT, /* min, max, act ct */ 0, 1, 0, /* opt state flags */ OPTST_IMM | OPTST_NO_INIT, 0, /* last opt argumnt */ { NULL }, /* arg list/cookie */ NULL, /* must/cannot opts */ NULL, NULL, /* option proc */ doUsageOpt, /* desc, NAME, name */ HELP_DESC, NULL, HELP_name, /* disablement strs */ NULL, NULL }, { /* entry idx, value */ INDEX_OPT_MORE_HELP, VALUE_OPT_MORE_HELP, /* equiv idx value */ NO_EQUIVALENT, VALUE_OPT_MORE_HELP, /* equivalenced to */ NO_EQUIVALENT, /* min, max, act ct */ 0, 1, 0, /* opt state flags */ MORE_HELP_FLAGS, 0, /* last opt argumnt */ { NULL }, /* arg list/cookie */ NULL, /* must/cannot opts */ NULL, NULL, /* option proc */ optionPagedUsage, /* desc, NAME, name */ MORE_HELP_DESC, NULL, MORE_HELP_name, /* disablement strs */ NULL, NULL } }; /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Define the gnutls-serv Option Environment */ #define zPROGNAME (gnutls_serv_opt_strs+2656) #define zUsageTitle (gnutls_serv_opt_strs+2668) #define zRcName NULL #define apzHomeList NULL #define zBugsAddr (gnutls_serv_opt_strs+2771) #define zExplain (gnutls_serv_opt_strs+2790) #define zDetail (gnutls_serv_opt_strs+2793) #define zFullVersion (gnutls_serv_opt_strs+2852) /* extracted from optcode.tlib near line 350 */ #if defined(ENABLE_NLS) # define OPTPROC_BASE OPTPROC_TRANSLATE | OPTPROC_NXLAT_OPT static tOptionXlateProc translate_option_strings; #else # define OPTPROC_BASE OPTPROC_NONE # define translate_option_strings NULL #endif /* ENABLE_NLS */ #define gnutls_serv_full_usage (NULL) #define gnutls_serv_short_usage (gnutls_serv_opt_strs+2874) #endif /* not defined __doxygen__ */ /* * Create the static procedure(s) declared above. */ /** * The callout function that invokes the optionUsage function. * * @param pOptions the AutoOpts option description structure * @param pOptDesc the descriptor for the "help" (usage) option. * @noreturn */ static void doUsageOpt(tOptions * pOptions, tOptDesc * pOptDesc) { optionUsage(&gnutls_servOptions, GNUTLS_SERV_EXIT_SUCCESS); /* NOTREACHED */ (void)pOptDesc; (void)pOptions; } /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /** * Code to handle the debug option. * * @param pOptions the gnutls-serv options data structure * @param pOptDesc the option descriptor for this option. */ static void doOptDebug(tOptions* pOptions, tOptDesc* pOptDesc) { static struct {long rmin, rmax;} const rng[1] = { { 0 , 9999 } }; int ix; if (pOptions <= OPTPROC_EMIT_LIMIT) goto emit_ranges; optionNumericVal(pOptions, pOptDesc); for (ix = 0; ix < 1; ix++) { if (pOptDesc->optArg.argInt < rng[ix].rmin) continue; /* ranges need not be ordered. */ if (pOptDesc->optArg.argInt == rng[ix].rmin) return; if (rng[ix].rmax == LONG_MIN) continue; if (pOptDesc->optArg.argInt <= rng[ix].rmax) return; } option_usage_fp = stderr; emit_ranges: optionShowRange(pOptions, pOptDesc, (void *)rng, 1); } /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /** * Code to handle the mtu option. * * @param pOptions the gnutls-serv options data structure * @param pOptDesc the option descriptor for this option. */ static void doOptMtu(tOptions* pOptions, tOptDesc* pOptDesc) { static struct {long rmin, rmax;} const rng[1] = { { 0, 17000 } }; int ix; if (pOptions <= OPTPROC_EMIT_LIMIT) goto emit_ranges; optionNumericVal(pOptions, pOptDesc); for (ix = 0; ix < 1; ix++) { if (pOptDesc->optArg.argInt < rng[ix].rmin) continue; /* ranges need not be ordered. */ if (pOptDesc->optArg.argInt == rng[ix].rmin) return; if (rng[ix].rmax == LONG_MIN) continue; if (pOptDesc->optArg.argInt <= rng[ix].rmax) return; } option_usage_fp = stderr; emit_ranges: optionShowRange(pOptions, pOptDesc, (void *)rng, 1); } /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /** * Code to handle the dhparams option. * * @param pOptions the gnutls-serv options data structure * @param pOptDesc the option descriptor for this option. */ static void doOptDhparams(tOptions* pOptions, tOptDesc* pOptDesc) { static teOptFileType const type = FTYPE_MODE_MUST_EXIST + FTYPE_MODE_NO_OPEN; static tuFileMode mode; #ifndef O_CLOEXEC # define O_CLOEXEC 0 #endif mode.file_flags = O_CLOEXEC; optionFileCheck(pOptions, pOptDesc, type, mode); } /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /** * Code to handle the x509crlfile option. * * @param pOptions the gnutls-serv options data structure * @param pOptDesc the option descriptor for this option. */ static void doOptX509crlfile(tOptions* pOptions, tOptDesc* pOptDesc) { static teOptFileType const type = FTYPE_MODE_MUST_EXIST + FTYPE_MODE_NO_OPEN; static tuFileMode mode; #ifndef O_CLOEXEC # define O_CLOEXEC 0 #endif mode.file_flags = O_CLOEXEC; optionFileCheck(pOptions, pOptDesc, type, mode); } /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /** * Code to handle the pgpkeyfile option. * * @param pOptions the gnutls-serv options data structure * @param pOptDesc the option descriptor for this option. */ static void doOptPgpkeyfile(tOptions* pOptions, tOptDesc* pOptDesc) { static teOptFileType const type = FTYPE_MODE_MUST_EXIST + FTYPE_MODE_NO_OPEN; static tuFileMode mode; #ifndef O_CLOEXEC # define O_CLOEXEC 0 #endif mode.file_flags = O_CLOEXEC; optionFileCheck(pOptions, pOptDesc, type, mode); } /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /** * Code to handle the pgpkeyring option. * * @param pOptions the gnutls-serv options data structure * @param pOptDesc the option descriptor for this option. */ static void doOptPgpkeyring(tOptions* pOptions, tOptDesc* pOptDesc) { static teOptFileType const type = FTYPE_MODE_MUST_EXIST + FTYPE_MODE_NO_OPEN; static tuFileMode mode; #ifndef O_CLOEXEC # define O_CLOEXEC 0 #endif mode.file_flags = O_CLOEXEC; optionFileCheck(pOptions, pOptDesc, type, mode); } /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /** * Code to handle the pgpcertfile option. * * @param pOptions the gnutls-serv options data structure * @param pOptDesc the option descriptor for this option. */ static void doOptPgpcertfile(tOptions* pOptions, tOptDesc* pOptDesc) { static teOptFileType const type = FTYPE_MODE_MUST_EXIST + FTYPE_MODE_NO_OPEN; static tuFileMode mode; #ifndef O_CLOEXEC # define O_CLOEXEC 0 #endif mode.file_flags = O_CLOEXEC; optionFileCheck(pOptions, pOptDesc, type, mode); } /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /** * Code to handle the srppasswd option. * * @param pOptions the gnutls-serv options data structure * @param pOptDesc the option descriptor for this option. */ static void doOptSrppasswd(tOptions* pOptions, tOptDesc* pOptDesc) { static teOptFileType const type = FTYPE_MODE_MUST_EXIST + FTYPE_MODE_NO_OPEN; static tuFileMode mode; #ifndef O_CLOEXEC # define O_CLOEXEC 0 #endif mode.file_flags = O_CLOEXEC; optionFileCheck(pOptions, pOptDesc, type, mode); } /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /** * Code to handle the srppasswdconf option. * * @param pOptions the gnutls-serv options data structure * @param pOptDesc the option descriptor for this option. */ static void doOptSrppasswdconf(tOptions* pOptions, tOptDesc* pOptDesc) { static teOptFileType const type = FTYPE_MODE_MUST_EXIST + FTYPE_MODE_NO_OPEN; static tuFileMode mode; #ifndef O_CLOEXEC # define O_CLOEXEC 0 #endif mode.file_flags = O_CLOEXEC; optionFileCheck(pOptions, pOptDesc, type, mode); } /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /** * Code to handle the pskpasswd option. * * @param pOptions the gnutls-serv options data structure * @param pOptDesc the option descriptor for this option. */ static void doOptPskpasswd(tOptions* pOptions, tOptDesc* pOptDesc) { static teOptFileType const type = FTYPE_MODE_MUST_EXIST + FTYPE_MODE_NO_OPEN; static tuFileMode mode; #ifndef O_CLOEXEC # define O_CLOEXEC 0 #endif mode.file_flags = O_CLOEXEC; optionFileCheck(pOptions, pOptDesc, type, mode); } /* extracted from optmain.tlib near line 1113 */ /** * The directory containing the data associated with gnutls-serv. */ #ifndef PKGDATADIR # define PKGDATADIR "" #endif /** * Information about the person or institution that packaged gnutls-serv * for the current distribution. */ #ifndef WITH_PACKAGER # define gnutls_serv_packager_info NULL #else static char const gnutls_serv_packager_info[] = "Packaged by " WITH_PACKAGER # ifdef WITH_PACKAGER_VERSION " ("WITH_PACKAGER_VERSION")" # endif # ifdef WITH_PACKAGER_BUG_REPORTS "\nReport gnutls_serv bugs to " WITH_PACKAGER_BUG_REPORTS # endif "\n"; #endif #ifndef __doxygen__ #endif /* __doxygen__ */ /** * The option definitions for gnutls-serv. The one structure that * binds them all. */ tOptions gnutls_servOptions = { OPTIONS_STRUCT_VERSION, 0, NULL, /* original argc + argv */ ( OPTPROC_BASE + OPTPROC_ERRSTOP + OPTPROC_SHORTOPT + OPTPROC_LONGOPT + OPTPROC_NO_REQ_OPT + OPTPROC_NO_ARGS + OPTPROC_GNUUSAGE + OPTPROC_MISUSE ), 0, NULL, /* current option index, current option */ NULL, NULL, zPROGNAME, zRcName, zCopyright, zLicenseDescrip, zFullVersion, apzHomeList, zUsageTitle, zExplain, zDetail, optDesc, zBugsAddr, /* address to send bugs to */ NULL, NULL, /* extensions/saved state */ optionUsage, /* usage procedure */ translate_option_strings, /* translation procedure */ /* * Indexes to special options */ { INDEX_OPT_MORE_HELP, /* more-help option index */ NO_EQUIVALENT, /* save option index */ NO_EQUIVALENT, /* '-#' option index */ NO_EQUIVALENT /* index of default opt */ }, 35 /* full option count */, 32 /* user option count */, gnutls_serv_full_usage, gnutls_serv_short_usage, NULL, NULL, PKGDATADIR, gnutls_serv_packager_info }; #if ENABLE_NLS #include #include #include #include #include static char* AO_gettext(char const* pz); static void coerce_it(void** s); /** * AutoGen specific wrapper function for gettext. * It relies on the macro _() to convert from English to the target * language, then strdup-duplicates the result string. * * @param[in] pz the input text used as a lookup key. * @returns the translated text (if there is one), * or the original text (if not). */ static char * AO_gettext(char const* pz) { char* pzRes; if (pz == NULL) return NULL; pzRes = _(pz); if (pzRes == pz) return pzRes; pzRes = strdup(pzRes); if (pzRes == NULL) { fputs(_("No memory for duping translated strings\n"), stderr); exit(GNUTLS_SERV_EXIT_FAILURE); } return pzRes; } static void coerce_it(void** s) { *s = AO_gettext(*s); } /** * Translate all the translatable strings in the gnutls_servOptions * structure defined above. This is done only once. */ static void translate_option_strings(void) { tOptions * const pOpt = &gnutls_servOptions; /* * Guard against re-translation. It won't work. The strings will have * been changed by the first pass through this code. One shot only. */ if (option_usage_text.field_ct != 0) { /* * Do the translations. The first pointer follows the field count * field. The field count field is the size of a pointer. */ tOptDesc * pOD = pOpt->pOptDesc; char ** ppz = (char**)(void*)&(option_usage_text); int ix = option_usage_text.field_ct; do { ppz++; *ppz = AO_gettext(*ppz); } while (--ix > 0); coerce_it((void*)&(pOpt->pzCopyright)); coerce_it((void*)&(pOpt->pzCopyNotice)); coerce_it((void*)&(pOpt->pzFullVersion)); coerce_it((void*)&(pOpt->pzUsageTitle)); coerce_it((void*)&(pOpt->pzExplain)); coerce_it((void*)&(pOpt->pzDetail)); coerce_it((void*)&(pOpt->pzPackager)); coerce_it((void*)&(pOpt->pzShortUsage)); option_usage_text.field_ct = 0; for (ix = pOpt->optCt; ix > 0; ix--, pOD++) coerce_it((void*)&(pOD->pzText)); } if ((pOpt->fOptSet & OPTPROC_NXLAT_OPT_CFG) == 0) { tOptDesc * pOD = pOpt->pOptDesc; int ix; for (ix = pOpt->optCt; ix > 0; ix--, pOD++) { coerce_it((void*)&(pOD->pz_Name)); coerce_it((void*)&(pOD->pz_DisableName)); coerce_it((void*)&(pOD->pz_DisablePfx)); } /* prevent re-translation */ gnutls_servOptions.fOptSet |= OPTPROC_NXLAT_OPT_CFG | OPTPROC_NXLAT_OPT; } } #endif /* ENABLE_NLS */ #ifdef __cplusplus } #endif /* serv-args.c ends here */