corrected news entry.
[gnutls.git] / src / serv-args.c
blobce71863b932fa8830524ed3e50e1e46ec6764f95
1 /* -*- buffer-read-only: t -*- vi: set ro:
2 *
3 * DO NOT EDIT THIS FILE (serv-args.c)
4 *
5 * It has been AutoGen-ed May 9, 2012 at 08:05:24 PM by AutoGen 5.16
6 * From the definitions serv-args.def
7 * and the template file options
9 * Generated from AutoOpts 36:4:11 templates.
11 * AutoOpts is a copyrighted work. This source file is not encumbered
12 * by AutoOpts licensing, but is provided under the licensing terms chosen
13 * by the gnutls-serv author or copyright holder. AutoOpts is
14 * licensed under the terms of the LGPL. The redistributable library
15 * (``libopts'') is licensed under the terms of either the LGPL or, at the
16 * users discretion, the BSD license. See the AutoOpts and/or libopts sources
17 * for details.
19 * The gnutls-serv program is copyrighted and licensed
20 * under the following terms:
22 * Copyright (C) 2000-2012 Free Software Foundation, all rights reserved.
23 * This is free software. It is licensed for use, modification and
24 * redistribution under the terms of the
25 * GNU General Public License, version 3 or later
26 * <http://gnu.org/licenses/gpl.html>
28 * gnutls-serv is free software: you can redistribute it and/or modify it
29 * under the terms of the GNU General Public License as published by the
30 * Free Software Foundation, either version 3 of the License, or
31 * (at your option) any later version.
33 * gnutls-serv is distributed in the hope that it will be useful, but
34 * WITHOUT ANY WARRANTY; without even the implied warranty of
35 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
36 * See the GNU General Public License for more details.
38 * You should have received a copy of the GNU General Public License along
39 * with this program. If not, see <http://www.gnu.org/licenses/>.
42 #ifndef __doxygen__
43 #define OPTION_CODE_COMPILE 1
44 #include "serv-args.h"
45 #include <sys/types.h>
47 #include <limits.h>
48 #include <stdio.h>
49 #include <stdlib.h>
50 #include <errno.h>
52 #ifdef __cplusplus
53 extern "C" {
54 #endif
55 extern FILE * option_usage_fp;
57 /* TRANSLATORS: choose the translation for option names wisely because you
58 cannot ever change your mind. */
59 #define zCopyright (gnutls_serv_opt_strs+0)
60 #define zLicenseDescrip (gnutls_serv_opt_strs+282)
63 #ifndef NULL
64 # define NULL 0
65 #endif
68 * gnutls-serv option static const strings
70 static char const gnutls_serv_opt_strs[2947] =
71 /* 0 */ "gnutls-serv @VERSION@\n"
72 "Copyright (C) 2000-2012 Free Software Foundation, all rights reserved.\n"
73 "This is free software. It is licensed for use, modification and\n"
74 "redistribution under the terms of the\n"
75 "GNU General Public License, version 3 or later\n"
76 " <http://gnu.org/licenses/gpl.html>\n\0"
77 /* 282 */ "gnutls-serv is free software: you can redistribute it and/or modify it\n"
78 "under the terms of the GNU General Public License as published by the Free\n"
79 "Software Foundation, either version 3 of the License, or (at your option)\n"
80 "any later version.\n\n"
81 "gnutls-serv is distributed in the hope that it will be useful, but WITHOUT\n"
82 "ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or\n"
83 "FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for\n"
84 "more details.\n\n"
85 "You should have received a copy of the GNU General Public License along\n"
86 "with this program. If not, see <http://www.gnu.org/licenses/>.\n\0"
87 /* 893 */ "Enable debugging.\0"
88 /* 911 */ "DEBUG\0"
89 /* 917 */ "debug\0"
90 /* 923 */ "Don't accept session tickets\0"
91 /* 952 */ "NOTICKET\0"
92 /* 961 */ "noticket\0"
93 /* 970 */ "Generate Diffie-Hellman and RSA-export parameters\0"
94 /* 1020 */ "GENERATE\0"
95 /* 1029 */ "generate\0"
96 /* 1038 */ "Suppress some messages\0"
97 /* 1061 */ "QUIET\0"
98 /* 1067 */ "quiet\0"
99 /* 1073 */ "Do not use a resumption database\0"
100 /* 1106 */ "NODB\0"
101 /* 1111 */ "nodb\0"
102 /* 1116 */ "Act as an HTTP server\0"
103 /* 1138 */ "HTTP\0"
104 /* 1143 */ "http\0"
105 /* 1148 */ "Act as an Echo server\0"
106 /* 1170 */ "ECHO\0"
107 /* 1175 */ "echo\0"
108 /* 1180 */ "Use DTLS (datagram TLS) over UDP\0"
109 /* 1213 */ "UDP\0"
110 /* 1217 */ "udp\0"
111 /* 1221 */ "Set MTU for datagram TLS\0"
112 /* 1246 */ "MTU\0"
113 /* 1250 */ "mtu\0"
114 /* 1254 */ "Do not request a client certificate\0"
115 /* 1290 */ "DISABLE_CLIENT_CERT\0"
116 /* 1310 */ "disable-client-cert\0"
117 /* 1330 */ "Require a client certificate\0"
118 /* 1359 */ "REQUIRE_CLIENT_CERT\0"
119 /* 1379 */ "require-client-cert\0"
120 /* 1399 */ "Use DER format for certificates to read from\0"
121 /* 1444 */ "X509FMTDER\0"
122 /* 1455 */ "x509fmtder\0"
123 /* 1466 */ "Priorities string\0"
124 /* 1484 */ "PRIORITY\0"
125 /* 1493 */ "priority\0"
126 /* 1502 */ "DH params file to use\0"
127 /* 1524 */ "DHPARAMS\0"
128 /* 1533 */ "dhparams\0"
129 /* 1542 */ "Certificate file or PKCS #11 URL to use\0"
130 /* 1582 */ "X509CAFILE\0"
131 /* 1593 */ "x509cafile\0"
132 /* 1604 */ "CRL file to use\0"
133 /* 1620 */ "X509CRLFILE\0"
134 /* 1632 */ "x509crlfile\0"
135 /* 1644 */ "PGP Key file to use\0"
136 /* 1664 */ "PGPKEYFILE\0"
137 /* 1675 */ "pgpkeyfile\0"
138 /* 1686 */ "PGP Key ring file to use\0"
139 /* 1711 */ "PGPKEYRING\0"
140 /* 1722 */ "pgpkeyring\0"
141 /* 1733 */ "PGP Public Key (certificate) file to use\0"
142 /* 1774 */ "PGPCERTFILE\0"
143 /* 1786 */ "pgpcertfile\0"
144 /* 1798 */ "X.509 key file or PKCS #11 URL to use\0"
145 /* 1836 */ "X509KEYFILE\0"
146 /* 1848 */ "x509keyfile\0"
147 /* 1860 */ "X.509 Certificate file or PKCS #11 URL to use\0"
148 /* 1906 */ "X509CERTFILE\0"
149 /* 1919 */ "x509certfile\0"
150 /* 1932 */ "Alternative X.509 key file or PKCS #11 URL to use\0"
151 /* 1982 */ "X509DSAKEYFILE\0"
152 /* 1997 */ "x509dsakeyfile\0"
153 /* 2012 */ "Alternative X.509 Certificate file or PKCS #11 URL to use\0"
154 /* 2070 */ "X509DSACERTFILE\0"
155 /* 2086 */ "x509dsacertfile\0"
156 /* 2102 */ "X509ECCKEYFILE\0"
157 /* 2117 */ "x509ecckeyfile\0"
158 /* 2132 */ "X509ECCCERTFILE\0"
159 /* 2148 */ "x509ecccertfile\0"
160 /* 2164 */ "PGP subkey to use (hex or auto)\0"
161 /* 2196 */ "PGPSUBKEY\0"
162 /* 2206 */ "pgpsubkey\0"
163 /* 2216 */ "SRP password file to use\0"
164 /* 2241 */ "SRPPASSWD\0"
165 /* 2251 */ "srppasswd\0"
166 /* 2261 */ "SRP password configuration file to use\0"
167 /* 2300 */ "SRPPASSWDCONF\0"
168 /* 2314 */ "srppasswdconf\0"
169 /* 2328 */ "PSK password file to use\0"
170 /* 2353 */ "PSKPASSWD\0"
171 /* 2363 */ "pskpasswd\0"
172 /* 2373 */ "PSK identity hint to use\0"
173 /* 2398 */ "PSKHINT\0"
174 /* 2406 */ "pskhint\0"
175 /* 2414 */ "The port to connect to\0"
176 /* 2437 */ "PORT\0"
177 /* 2442 */ "port\0"
178 /* 2447 */ "Print a list of the supported algorithms and modes\0"
179 /* 2498 */ "LIST\0"
180 /* 2503 */ "list\0"
181 /* 2508 */ "Display extended usage information and exit\0"
182 /* 2552 */ "help\0"
183 /* 2557 */ "Extended usage information passed thru pager\0"
184 /* 2602 */ "more-help\0"
185 /* 2612 */ "Output version information and exit\0"
186 /* 2648 */ "version\0"
187 /* 2656 */ "GNUTLS_SERV\0"
188 /* 2668 */ "gnutls-serv - GnuTLS server - Ver. @VERSION@\n"
189 "USAGE: %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]...\n\0"
190 /* 2771 */ "bug-gnutls@gnu.org\0"
191 /* 2790 */ "\n\n\0"
192 /* 2793 */ "\n"
193 "Server program that listens to incoming TLS connections.\n\0"
194 /* 2852 */ "gnutls-serv @VERSION@\0"
195 /* 2874 */ "Usage: gnutls-serv [options]\n"
196 "gnutls-serv --help for usage instructions.\n";
199 * debug option description:
201 #define DEBUG_DESC (gnutls_serv_opt_strs+893)
202 #define DEBUG_NAME (gnutls_serv_opt_strs+911)
203 #define DEBUG_name (gnutls_serv_opt_strs+917)
204 #define DEBUG_FLAGS (OPTST_DISABLED \
205 | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC))
208 * noticket option description:
210 #define NOTICKET_DESC (gnutls_serv_opt_strs+923)
211 #define NOTICKET_NAME (gnutls_serv_opt_strs+952)
212 #define NOTICKET_name (gnutls_serv_opt_strs+961)
213 #define NOTICKET_FLAGS (OPTST_DISABLED)
216 * generate option description:
218 #define GENERATE_DESC (gnutls_serv_opt_strs+970)
219 #define GENERATE_NAME (gnutls_serv_opt_strs+1020)
220 #define GENERATE_name (gnutls_serv_opt_strs+1029)
221 #define GENERATE_FLAGS (OPTST_DISABLED)
224 * quiet option description:
226 #define QUIET_DESC (gnutls_serv_opt_strs+1038)
227 #define QUIET_NAME (gnutls_serv_opt_strs+1061)
228 #define QUIET_name (gnutls_serv_opt_strs+1067)
229 #define QUIET_FLAGS (OPTST_DISABLED)
232 * nodb option description:
234 #define NODB_DESC (gnutls_serv_opt_strs+1073)
235 #define NODB_NAME (gnutls_serv_opt_strs+1106)
236 #define NODB_name (gnutls_serv_opt_strs+1111)
237 #define NODB_FLAGS (OPTST_DISABLED)
240 * http option description:
242 #define HTTP_DESC (gnutls_serv_opt_strs+1116)
243 #define HTTP_NAME (gnutls_serv_opt_strs+1138)
244 #define HTTP_name (gnutls_serv_opt_strs+1143)
245 #define HTTP_FLAGS (OPTST_DISABLED)
248 * echo option description:
250 #define ECHO_DESC (gnutls_serv_opt_strs+1148)
251 #define ECHO_NAME (gnutls_serv_opt_strs+1170)
252 #define ECHO_name (gnutls_serv_opt_strs+1175)
253 #define ECHO_FLAGS (OPTST_DISABLED)
256 * udp option description:
258 #define UDP_DESC (gnutls_serv_opt_strs+1180)
259 #define UDP_NAME (gnutls_serv_opt_strs+1213)
260 #define UDP_name (gnutls_serv_opt_strs+1217)
261 #define UDP_FLAGS (OPTST_DISABLED)
264 * mtu option description:
266 #define MTU_DESC (gnutls_serv_opt_strs+1221)
267 #define MTU_NAME (gnutls_serv_opt_strs+1246)
268 #define MTU_name (gnutls_serv_opt_strs+1250)
269 #define MTU_FLAGS (OPTST_DISABLED \
270 | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC))
273 * disable-client-cert option description:
275 #define DISABLE_CLIENT_CERT_DESC (gnutls_serv_opt_strs+1254)
276 #define DISABLE_CLIENT_CERT_NAME (gnutls_serv_opt_strs+1290)
277 #define DISABLE_CLIENT_CERT_name (gnutls_serv_opt_strs+1310)
278 #define DISABLE_CLIENT_CERT_FLAGS (OPTST_DISABLED)
281 * require-client-cert option description:
283 #define REQUIRE_CLIENT_CERT_DESC (gnutls_serv_opt_strs+1330)
284 #define REQUIRE_CLIENT_CERT_NAME (gnutls_serv_opt_strs+1359)
285 #define REQUIRE_CLIENT_CERT_name (gnutls_serv_opt_strs+1379)
286 #define REQUIRE_CLIENT_CERT_FLAGS (OPTST_DISABLED)
289 * x509fmtder option description:
291 #define X509FMTDER_DESC (gnutls_serv_opt_strs+1399)
292 #define X509FMTDER_NAME (gnutls_serv_opt_strs+1444)
293 #define X509FMTDER_name (gnutls_serv_opt_strs+1455)
294 #define X509FMTDER_FLAGS (OPTST_DISABLED)
297 * priority option description:
299 #define PRIORITY_DESC (gnutls_serv_opt_strs+1466)
300 #define PRIORITY_NAME (gnutls_serv_opt_strs+1484)
301 #define PRIORITY_name (gnutls_serv_opt_strs+1493)
302 #define PRIORITY_FLAGS (OPTST_DISABLED \
303 | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
306 * dhparams option description:
308 #define DHPARAMS_DESC (gnutls_serv_opt_strs+1502)
309 #define DHPARAMS_NAME (gnutls_serv_opt_strs+1524)
310 #define DHPARAMS_name (gnutls_serv_opt_strs+1533)
311 #define DHPARAMS_FLAGS (OPTST_DISABLED \
312 | OPTST_SET_ARGTYPE(OPARG_TYPE_FILE))
315 * x509cafile option description:
317 #define X509CAFILE_DESC (gnutls_serv_opt_strs+1542)
318 #define X509CAFILE_NAME (gnutls_serv_opt_strs+1582)
319 #define X509CAFILE_name (gnutls_serv_opt_strs+1593)
320 #define X509CAFILE_FLAGS (OPTST_DISABLED \
321 | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
324 * x509crlfile option description:
326 #define X509CRLFILE_DESC (gnutls_serv_opt_strs+1604)
327 #define X509CRLFILE_NAME (gnutls_serv_opt_strs+1620)
328 #define X509CRLFILE_name (gnutls_serv_opt_strs+1632)
329 #define X509CRLFILE_FLAGS (OPTST_DISABLED \
330 | OPTST_SET_ARGTYPE(OPARG_TYPE_FILE))
333 * pgpkeyfile option description:
335 #define PGPKEYFILE_DESC (gnutls_serv_opt_strs+1644)
336 #define PGPKEYFILE_NAME (gnutls_serv_opt_strs+1664)
337 #define PGPKEYFILE_name (gnutls_serv_opt_strs+1675)
338 #define PGPKEYFILE_FLAGS (OPTST_DISABLED \
339 | OPTST_SET_ARGTYPE(OPARG_TYPE_FILE))
342 * pgpkeyring option description:
344 #define PGPKEYRING_DESC (gnutls_serv_opt_strs+1686)
345 #define PGPKEYRING_NAME (gnutls_serv_opt_strs+1711)
346 #define PGPKEYRING_name (gnutls_serv_opt_strs+1722)
347 #define PGPKEYRING_FLAGS (OPTST_DISABLED \
348 | OPTST_SET_ARGTYPE(OPARG_TYPE_FILE))
351 * pgpcertfile option description:
353 #define PGPCERTFILE_DESC (gnutls_serv_opt_strs+1733)
354 #define PGPCERTFILE_NAME (gnutls_serv_opt_strs+1774)
355 #define PGPCERTFILE_name (gnutls_serv_opt_strs+1786)
356 #define PGPCERTFILE_FLAGS (OPTST_DISABLED \
357 | OPTST_SET_ARGTYPE(OPARG_TYPE_FILE))
360 * x509keyfile option description:
362 #define X509KEYFILE_DESC (gnutls_serv_opt_strs+1798)
363 #define X509KEYFILE_NAME (gnutls_serv_opt_strs+1836)
364 #define X509KEYFILE_name (gnutls_serv_opt_strs+1848)
365 #define X509KEYFILE_FLAGS (OPTST_DISABLED \
366 | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
369 * x509certfile option description:
371 #define X509CERTFILE_DESC (gnutls_serv_opt_strs+1860)
372 #define X509CERTFILE_NAME (gnutls_serv_opt_strs+1906)
373 #define X509CERTFILE_name (gnutls_serv_opt_strs+1919)
374 #define X509CERTFILE_FLAGS (OPTST_DISABLED \
375 | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
378 * x509dsakeyfile option description:
380 #define X509DSAKEYFILE_DESC (gnutls_serv_opt_strs+1932)
381 #define X509DSAKEYFILE_NAME (gnutls_serv_opt_strs+1982)
382 #define X509DSAKEYFILE_name (gnutls_serv_opt_strs+1997)
383 #define X509DSAKEYFILE_FLAGS (OPTST_DISABLED \
384 | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
387 * x509dsacertfile option description:
389 #define X509DSACERTFILE_DESC (gnutls_serv_opt_strs+2012)
390 #define X509DSACERTFILE_NAME (gnutls_serv_opt_strs+2070)
391 #define X509DSACERTFILE_name (gnutls_serv_opt_strs+2086)
392 #define X509DSACERTFILE_FLAGS (OPTST_DISABLED \
393 | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
396 * x509ecckeyfile option description:
398 #define X509ECCKEYFILE_DESC (gnutls_serv_opt_strs+1932)
399 #define X509ECCKEYFILE_NAME (gnutls_serv_opt_strs+2102)
400 #define X509ECCKEYFILE_name (gnutls_serv_opt_strs+2117)
401 #define X509ECCKEYFILE_FLAGS (OPTST_DISABLED \
402 | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
405 * x509ecccertfile option description:
407 #define X509ECCCERTFILE_DESC (gnutls_serv_opt_strs+2012)
408 #define X509ECCCERTFILE_NAME (gnutls_serv_opt_strs+2132)
409 #define X509ECCCERTFILE_name (gnutls_serv_opt_strs+2148)
410 #define X509ECCCERTFILE_FLAGS (OPTST_DISABLED \
411 | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
414 * pgpsubkey option description:
416 #define PGPSUBKEY_DESC (gnutls_serv_opt_strs+2164)
417 #define PGPSUBKEY_NAME (gnutls_serv_opt_strs+2196)
418 #define PGPSUBKEY_name (gnutls_serv_opt_strs+2206)
419 #define PGPSUBKEY_FLAGS (OPTST_DISABLED \
420 | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
423 * srppasswd option description:
425 #define SRPPASSWD_DESC (gnutls_serv_opt_strs+2216)
426 #define SRPPASSWD_NAME (gnutls_serv_opt_strs+2241)
427 #define SRPPASSWD_name (gnutls_serv_opt_strs+2251)
428 #define SRPPASSWD_FLAGS (OPTST_DISABLED \
429 | OPTST_SET_ARGTYPE(OPARG_TYPE_FILE))
432 * srppasswdconf option description:
434 #define SRPPASSWDCONF_DESC (gnutls_serv_opt_strs+2261)
435 #define SRPPASSWDCONF_NAME (gnutls_serv_opt_strs+2300)
436 #define SRPPASSWDCONF_name (gnutls_serv_opt_strs+2314)
437 #define SRPPASSWDCONF_FLAGS (OPTST_DISABLED \
438 | OPTST_SET_ARGTYPE(OPARG_TYPE_FILE))
441 * pskpasswd option description:
443 #define PSKPASSWD_DESC (gnutls_serv_opt_strs+2328)
444 #define PSKPASSWD_NAME (gnutls_serv_opt_strs+2353)
445 #define PSKPASSWD_name (gnutls_serv_opt_strs+2363)
446 #define PSKPASSWD_FLAGS (OPTST_DISABLED \
447 | OPTST_SET_ARGTYPE(OPARG_TYPE_FILE))
450 * pskhint option description:
452 #define PSKHINT_DESC (gnutls_serv_opt_strs+2373)
453 #define PSKHINT_NAME (gnutls_serv_opt_strs+2398)
454 #define PSKHINT_name (gnutls_serv_opt_strs+2406)
455 #define PSKHINT_FLAGS (OPTST_DISABLED \
456 | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
459 * port option description:
461 #define PORT_DESC (gnutls_serv_opt_strs+2414)
462 #define PORT_NAME (gnutls_serv_opt_strs+2437)
463 #define PORT_name (gnutls_serv_opt_strs+2442)
464 #define PORT_FLAGS (OPTST_DISABLED \
465 | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC))
468 * list option description:
470 #define LIST_DESC (gnutls_serv_opt_strs+2447)
471 #define LIST_NAME (gnutls_serv_opt_strs+2498)
472 #define LIST_name (gnutls_serv_opt_strs+2503)
473 #define LIST_FLAGS (OPTST_DISABLED)
476 * Help/More_Help/Version option descriptions:
478 #define HELP_DESC (gnutls_serv_opt_strs+2508)
479 #define HELP_name (gnutls_serv_opt_strs+2552)
480 #ifdef HAVE_WORKING_FORK
481 #define MORE_HELP_DESC (gnutls_serv_opt_strs+2557)
482 #define MORE_HELP_name (gnutls_serv_opt_strs+2602)
483 #define MORE_HELP_FLAGS (OPTST_IMM | OPTST_NO_INIT)
484 #else
485 #define MORE_HELP_DESC NULL
486 #define MORE_HELP_name NULL
487 #define MORE_HELP_FLAGS (OPTST_OMITTED | OPTST_NO_INIT)
488 #endif
489 #ifdef NO_OPTIONAL_OPT_ARGS
490 # define VER_FLAGS (OPTST_IMM | OPTST_NO_INIT)
491 #else
492 # define VER_FLAGS (OPTST_SET_ARGTYPE(OPARG_TYPE_STRING) | \
493 OPTST_ARG_OPTIONAL | OPTST_IMM | OPTST_NO_INIT)
494 #endif
495 #define VER_DESC (gnutls_serv_opt_strs+2612)
496 #define VER_name (gnutls_serv_opt_strs+2648)
498 * Declare option callback procedures
500 extern tOptProc
501 optionBooleanVal, optionNestedVal, optionNumericVal,
502 optionPagedUsage, optionPrintVersion, optionResetOpt,
503 optionStackArg, optionTimeDate, optionTimeVal,
504 optionUnstackArg, optionVendorOption;
505 static tOptProc
506 doOptDebug, doOptDhparams, doOptMtu,
507 doOptPgpcertfile, doOptPgpkeyfile, doOptPgpkeyring,
508 doOptPskpasswd, doOptSrppasswd, doOptSrppasswdconf,
509 doOptX509crlfile, doUsageOpt;
510 #define VER_PROC optionPrintVersion
512 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
514 * Define the gnutls-serv Option Descriptions.
515 * This is an array of OPTION_CT entries, one for each
516 * option that the gnutls-serv program responds to.
518 static tOptDesc optDesc[OPTION_CT] = {
519 { /* entry idx, value */ 0, VALUE_OPT_DEBUG,
520 /* equiv idx, value */ 0, VALUE_OPT_DEBUG,
521 /* equivalenced to */ NO_EQUIVALENT,
522 /* min, max, act ct */ 0, 1, 0,
523 /* opt state flags */ DEBUG_FLAGS, 0,
524 /* last opt argumnt */ { NULL }, /* --debug */
525 /* arg list/cookie */ NULL,
526 /* must/cannot opts */ NULL, NULL,
527 /* option proc */ doOptDebug,
528 /* desc, NAME, name */ DEBUG_DESC, DEBUG_NAME, DEBUG_name,
529 /* disablement strs */ NULL, NULL },
531 { /* entry idx, value */ 1, VALUE_OPT_NOTICKET,
532 /* equiv idx, value */ 1, VALUE_OPT_NOTICKET,
533 /* equivalenced to */ NO_EQUIVALENT,
534 /* min, max, act ct */ 0, 1, 0,
535 /* opt state flags */ NOTICKET_FLAGS, 0,
536 /* last opt argumnt */ { NULL }, /* --noticket */
537 /* arg list/cookie */ NULL,
538 /* must/cannot opts */ NULL, NULL,
539 /* option proc */ NULL,
540 /* desc, NAME, name */ NOTICKET_DESC, NOTICKET_NAME, NOTICKET_name,
541 /* disablement strs */ NULL, NULL },
543 { /* entry idx, value */ 2, VALUE_OPT_GENERATE,
544 /* equiv idx, value */ 2, VALUE_OPT_GENERATE,
545 /* equivalenced to */ NO_EQUIVALENT,
546 /* min, max, act ct */ 0, 1, 0,
547 /* opt state flags */ GENERATE_FLAGS, 0,
548 /* last opt argumnt */ { NULL }, /* --generate */
549 /* arg list/cookie */ NULL,
550 /* must/cannot opts */ NULL, NULL,
551 /* option proc */ NULL,
552 /* desc, NAME, name */ GENERATE_DESC, GENERATE_NAME, GENERATE_name,
553 /* disablement strs */ NULL, NULL },
555 { /* entry idx, value */ 3, VALUE_OPT_QUIET,
556 /* equiv idx, value */ 3, VALUE_OPT_QUIET,
557 /* equivalenced to */ NO_EQUIVALENT,
558 /* min, max, act ct */ 0, 1, 0,
559 /* opt state flags */ QUIET_FLAGS, 0,
560 /* last opt argumnt */ { NULL }, /* --quiet */
561 /* arg list/cookie */ NULL,
562 /* must/cannot opts */ NULL, NULL,
563 /* option proc */ NULL,
564 /* desc, NAME, name */ QUIET_DESC, QUIET_NAME, QUIET_name,
565 /* disablement strs */ NULL, NULL },
567 { /* entry idx, value */ 4, VALUE_OPT_NODB,
568 /* equiv idx, value */ 4, VALUE_OPT_NODB,
569 /* equivalenced to */ NO_EQUIVALENT,
570 /* min, max, act ct */ 0, 1, 0,
571 /* opt state flags */ NODB_FLAGS, 0,
572 /* last opt argumnt */ { NULL }, /* --nodb */
573 /* arg list/cookie */ NULL,
574 /* must/cannot opts */ NULL, NULL,
575 /* option proc */ NULL,
576 /* desc, NAME, name */ NODB_DESC, NODB_NAME, NODB_name,
577 /* disablement strs */ NULL, NULL },
579 { /* entry idx, value */ 5, VALUE_OPT_HTTP,
580 /* equiv idx, value */ 5, VALUE_OPT_HTTP,
581 /* equivalenced to */ NO_EQUIVALENT,
582 /* min, max, act ct */ 0, 1, 0,
583 /* opt state flags */ HTTP_FLAGS, 0,
584 /* last opt argumnt */ { NULL }, /* --http */
585 /* arg list/cookie */ NULL,
586 /* must/cannot opts */ NULL, NULL,
587 /* option proc */ NULL,
588 /* desc, NAME, name */ HTTP_DESC, HTTP_NAME, HTTP_name,
589 /* disablement strs */ NULL, NULL },
591 { /* entry idx, value */ 6, VALUE_OPT_ECHO,
592 /* equiv idx, value */ 6, VALUE_OPT_ECHO,
593 /* equivalenced to */ NO_EQUIVALENT,
594 /* min, max, act ct */ 0, 1, 0,
595 /* opt state flags */ ECHO_FLAGS, 0,
596 /* last opt argumnt */ { NULL }, /* --echo */
597 /* arg list/cookie */ NULL,
598 /* must/cannot opts */ NULL, NULL,
599 /* option proc */ NULL,
600 /* desc, NAME, name */ ECHO_DESC, ECHO_NAME, ECHO_name,
601 /* disablement strs */ NULL, NULL },
603 { /* entry idx, value */ 7, VALUE_OPT_UDP,
604 /* equiv idx, value */ 7, VALUE_OPT_UDP,
605 /* equivalenced to */ NO_EQUIVALENT,
606 /* min, max, act ct */ 0, 1, 0,
607 /* opt state flags */ UDP_FLAGS, 0,
608 /* last opt argumnt */ { NULL }, /* --udp */
609 /* arg list/cookie */ NULL,
610 /* must/cannot opts */ NULL, NULL,
611 /* option proc */ NULL,
612 /* desc, NAME, name */ UDP_DESC, UDP_NAME, UDP_name,
613 /* disablement strs */ NULL, NULL },
615 { /* entry idx, value */ 8, VALUE_OPT_MTU,
616 /* equiv idx, value */ 8, VALUE_OPT_MTU,
617 /* equivalenced to */ NO_EQUIVALENT,
618 /* min, max, act ct */ 0, 1, 0,
619 /* opt state flags */ MTU_FLAGS, 0,
620 /* last opt argumnt */ { NULL }, /* --mtu */
621 /* arg list/cookie */ NULL,
622 /* must/cannot opts */ NULL, NULL,
623 /* option proc */ doOptMtu,
624 /* desc, NAME, name */ MTU_DESC, MTU_NAME, MTU_name,
625 /* disablement strs */ NULL, NULL },
627 { /* entry idx, value */ 9, VALUE_OPT_DISABLE_CLIENT_CERT,
628 /* equiv idx, value */ 9, VALUE_OPT_DISABLE_CLIENT_CERT,
629 /* equivalenced to */ NO_EQUIVALENT,
630 /* min, max, act ct */ 0, 1, 0,
631 /* opt state flags */ DISABLE_CLIENT_CERT_FLAGS, 0,
632 /* last opt argumnt */ { NULL }, /* --disable-client-cert */
633 /* arg list/cookie */ NULL,
634 /* must/cannot opts */ NULL, NULL,
635 /* option proc */ NULL,
636 /* desc, NAME, name */ DISABLE_CLIENT_CERT_DESC, DISABLE_CLIENT_CERT_NAME, DISABLE_CLIENT_CERT_name,
637 /* disablement strs */ NULL, NULL },
639 { /* entry idx, value */ 10, VALUE_OPT_REQUIRE_CLIENT_CERT,
640 /* equiv idx, value */ 10, VALUE_OPT_REQUIRE_CLIENT_CERT,
641 /* equivalenced to */ NO_EQUIVALENT,
642 /* min, max, act ct */ 0, 1, 0,
643 /* opt state flags */ REQUIRE_CLIENT_CERT_FLAGS, 0,
644 /* last opt argumnt */ { NULL }, /* --require-client-cert */
645 /* arg list/cookie */ NULL,
646 /* must/cannot opts */ NULL, NULL,
647 /* option proc */ NULL,
648 /* desc, NAME, name */ REQUIRE_CLIENT_CERT_DESC, REQUIRE_CLIENT_CERT_NAME, REQUIRE_CLIENT_CERT_name,
649 /* disablement strs */ NULL, NULL },
651 { /* entry idx, value */ 11, VALUE_OPT_X509FMTDER,
652 /* equiv idx, value */ 11, VALUE_OPT_X509FMTDER,
653 /* equivalenced to */ NO_EQUIVALENT,
654 /* min, max, act ct */ 0, 1, 0,
655 /* opt state flags */ X509FMTDER_FLAGS, 0,
656 /* last opt argumnt */ { NULL }, /* --x509fmtder */
657 /* arg list/cookie */ NULL,
658 /* must/cannot opts */ NULL, NULL,
659 /* option proc */ NULL,
660 /* desc, NAME, name */ X509FMTDER_DESC, X509FMTDER_NAME, X509FMTDER_name,
661 /* disablement strs */ NULL, NULL },
663 { /* entry idx, value */ 12, VALUE_OPT_PRIORITY,
664 /* equiv idx, value */ 12, VALUE_OPT_PRIORITY,
665 /* equivalenced to */ NO_EQUIVALENT,
666 /* min, max, act ct */ 0, 1, 0,
667 /* opt state flags */ PRIORITY_FLAGS, 0,
668 /* last opt argumnt */ { NULL }, /* --priority */
669 /* arg list/cookie */ NULL,
670 /* must/cannot opts */ NULL, NULL,
671 /* option proc */ NULL,
672 /* desc, NAME, name */ PRIORITY_DESC, PRIORITY_NAME, PRIORITY_name,
673 /* disablement strs */ NULL, NULL },
675 { /* entry idx, value */ 13, VALUE_OPT_DHPARAMS,
676 /* equiv idx, value */ 13, VALUE_OPT_DHPARAMS,
677 /* equivalenced to */ NO_EQUIVALENT,
678 /* min, max, act ct */ 0, 1, 0,
679 /* opt state flags */ DHPARAMS_FLAGS, 0,
680 /* last opt argumnt */ { NULL }, /* --dhparams */
681 /* arg list/cookie */ NULL,
682 /* must/cannot opts */ NULL, NULL,
683 /* option proc */ doOptDhparams,
684 /* desc, NAME, name */ DHPARAMS_DESC, DHPARAMS_NAME, DHPARAMS_name,
685 /* disablement strs */ NULL, NULL },
687 { /* entry idx, value */ 14, VALUE_OPT_X509CAFILE,
688 /* equiv idx, value */ 14, VALUE_OPT_X509CAFILE,
689 /* equivalenced to */ NO_EQUIVALENT,
690 /* min, max, act ct */ 0, 1, 0,
691 /* opt state flags */ X509CAFILE_FLAGS, 0,
692 /* last opt argumnt */ { NULL }, /* --x509cafile */
693 /* arg list/cookie */ NULL,
694 /* must/cannot opts */ NULL, NULL,
695 /* option proc */ NULL,
696 /* desc, NAME, name */ X509CAFILE_DESC, X509CAFILE_NAME, X509CAFILE_name,
697 /* disablement strs */ NULL, NULL },
699 { /* entry idx, value */ 15, VALUE_OPT_X509CRLFILE,
700 /* equiv idx, value */ 15, VALUE_OPT_X509CRLFILE,
701 /* equivalenced to */ NO_EQUIVALENT,
702 /* min, max, act ct */ 0, 1, 0,
703 /* opt state flags */ X509CRLFILE_FLAGS, 0,
704 /* last opt argumnt */ { NULL }, /* --x509crlfile */
705 /* arg list/cookie */ NULL,
706 /* must/cannot opts */ NULL, NULL,
707 /* option proc */ doOptX509crlfile,
708 /* desc, NAME, name */ X509CRLFILE_DESC, X509CRLFILE_NAME, X509CRLFILE_name,
709 /* disablement strs */ NULL, NULL },
711 { /* entry idx, value */ 16, VALUE_OPT_PGPKEYFILE,
712 /* equiv idx, value */ 16, VALUE_OPT_PGPKEYFILE,
713 /* equivalenced to */ NO_EQUIVALENT,
714 /* min, max, act ct */ 0, 1, 0,
715 /* opt state flags */ PGPKEYFILE_FLAGS, 0,
716 /* last opt argumnt */ { NULL }, /* --pgpkeyfile */
717 /* arg list/cookie */ NULL,
718 /* must/cannot opts */ NULL, NULL,
719 /* option proc */ doOptPgpkeyfile,
720 /* desc, NAME, name */ PGPKEYFILE_DESC, PGPKEYFILE_NAME, PGPKEYFILE_name,
721 /* disablement strs */ NULL, NULL },
723 { /* entry idx, value */ 17, VALUE_OPT_PGPKEYRING,
724 /* equiv idx, value */ 17, VALUE_OPT_PGPKEYRING,
725 /* equivalenced to */ NO_EQUIVALENT,
726 /* min, max, act ct */ 0, 1, 0,
727 /* opt state flags */ PGPKEYRING_FLAGS, 0,
728 /* last opt argumnt */ { NULL }, /* --pgpkeyring */
729 /* arg list/cookie */ NULL,
730 /* must/cannot opts */ NULL, NULL,
731 /* option proc */ doOptPgpkeyring,
732 /* desc, NAME, name */ PGPKEYRING_DESC, PGPKEYRING_NAME, PGPKEYRING_name,
733 /* disablement strs */ NULL, NULL },
735 { /* entry idx, value */ 18, VALUE_OPT_PGPCERTFILE,
736 /* equiv idx, value */ 18, VALUE_OPT_PGPCERTFILE,
737 /* equivalenced to */ NO_EQUIVALENT,
738 /* min, max, act ct */ 0, 1, 0,
739 /* opt state flags */ PGPCERTFILE_FLAGS, 0,
740 /* last opt argumnt */ { NULL }, /* --pgpcertfile */
741 /* arg list/cookie */ NULL,
742 /* must/cannot opts */ NULL, NULL,
743 /* option proc */ doOptPgpcertfile,
744 /* desc, NAME, name */ PGPCERTFILE_DESC, PGPCERTFILE_NAME, PGPCERTFILE_name,
745 /* disablement strs */ NULL, NULL },
747 { /* entry idx, value */ 19, VALUE_OPT_X509KEYFILE,
748 /* equiv idx, value */ 19, VALUE_OPT_X509KEYFILE,
749 /* equivalenced to */ NO_EQUIVALENT,
750 /* min, max, act ct */ 0, 1, 0,
751 /* opt state flags */ X509KEYFILE_FLAGS, 0,
752 /* last opt argumnt */ { NULL }, /* --x509keyfile */
753 /* arg list/cookie */ NULL,
754 /* must/cannot opts */ NULL, NULL,
755 /* option proc */ NULL,
756 /* desc, NAME, name */ X509KEYFILE_DESC, X509KEYFILE_NAME, X509KEYFILE_name,
757 /* disablement strs */ NULL, NULL },
759 { /* entry idx, value */ 20, VALUE_OPT_X509CERTFILE,
760 /* equiv idx, value */ 20, VALUE_OPT_X509CERTFILE,
761 /* equivalenced to */ NO_EQUIVALENT,
762 /* min, max, act ct */ 0, 1, 0,
763 /* opt state flags */ X509CERTFILE_FLAGS, 0,
764 /* last opt argumnt */ { NULL }, /* --x509certfile */
765 /* arg list/cookie */ NULL,
766 /* must/cannot opts */ NULL, NULL,
767 /* option proc */ NULL,
768 /* desc, NAME, name */ X509CERTFILE_DESC, X509CERTFILE_NAME, X509CERTFILE_name,
769 /* disablement strs */ NULL, NULL },
771 { /* entry idx, value */ 21, VALUE_OPT_X509DSAKEYFILE,
772 /* equiv idx, value */ 21, VALUE_OPT_X509DSAKEYFILE,
773 /* equivalenced to */ NO_EQUIVALENT,
774 /* min, max, act ct */ 0, 1, 0,
775 /* opt state flags */ X509DSAKEYFILE_FLAGS, 0,
776 /* last opt argumnt */ { NULL }, /* --x509dsakeyfile */
777 /* arg list/cookie */ NULL,
778 /* must/cannot opts */ NULL, NULL,
779 /* option proc */ NULL,
780 /* desc, NAME, name */ X509DSAKEYFILE_DESC, X509DSAKEYFILE_NAME, X509DSAKEYFILE_name,
781 /* disablement strs */ NULL, NULL },
783 { /* entry idx, value */ 22, VALUE_OPT_X509DSACERTFILE,
784 /* equiv idx, value */ 22, VALUE_OPT_X509DSACERTFILE,
785 /* equivalenced to */ NO_EQUIVALENT,
786 /* min, max, act ct */ 0, 1, 0,
787 /* opt state flags */ X509DSACERTFILE_FLAGS, 0,
788 /* last opt argumnt */ { NULL }, /* --x509dsacertfile */
789 /* arg list/cookie */ NULL,
790 /* must/cannot opts */ NULL, NULL,
791 /* option proc */ NULL,
792 /* desc, NAME, name */ X509DSACERTFILE_DESC, X509DSACERTFILE_NAME, X509DSACERTFILE_name,
793 /* disablement strs */ NULL, NULL },
795 { /* entry idx, value */ 23, VALUE_OPT_X509ECCKEYFILE,
796 /* equiv idx, value */ 23, VALUE_OPT_X509ECCKEYFILE,
797 /* equivalenced to */ NO_EQUIVALENT,
798 /* min, max, act ct */ 0, 1, 0,
799 /* opt state flags */ X509ECCKEYFILE_FLAGS, 0,
800 /* last opt argumnt */ { NULL }, /* --x509ecckeyfile */
801 /* arg list/cookie */ NULL,
802 /* must/cannot opts */ NULL, NULL,
803 /* option proc */ NULL,
804 /* desc, NAME, name */ X509ECCKEYFILE_DESC, X509ECCKEYFILE_NAME, X509ECCKEYFILE_name,
805 /* disablement strs */ NULL, NULL },
807 { /* entry idx, value */ 24, VALUE_OPT_X509ECCCERTFILE,
808 /* equiv idx, value */ 24, VALUE_OPT_X509ECCCERTFILE,
809 /* equivalenced to */ NO_EQUIVALENT,
810 /* min, max, act ct */ 0, 1, 0,
811 /* opt state flags */ X509ECCCERTFILE_FLAGS, 0,
812 /* last opt argumnt */ { NULL }, /* --x509ecccertfile */
813 /* arg list/cookie */ NULL,
814 /* must/cannot opts */ NULL, NULL,
815 /* option proc */ NULL,
816 /* desc, NAME, name */ X509ECCCERTFILE_DESC, X509ECCCERTFILE_NAME, X509ECCCERTFILE_name,
817 /* disablement strs */ NULL, NULL },
819 { /* entry idx, value */ 25, VALUE_OPT_PGPSUBKEY,
820 /* equiv idx, value */ 25, VALUE_OPT_PGPSUBKEY,
821 /* equivalenced to */ NO_EQUIVALENT,
822 /* min, max, act ct */ 0, 1, 0,
823 /* opt state flags */ PGPSUBKEY_FLAGS, 0,
824 /* last opt argumnt */ { NULL }, /* --pgpsubkey */
825 /* arg list/cookie */ NULL,
826 /* must/cannot opts */ NULL, NULL,
827 /* option proc */ NULL,
828 /* desc, NAME, name */ PGPSUBKEY_DESC, PGPSUBKEY_NAME, PGPSUBKEY_name,
829 /* disablement strs */ NULL, NULL },
831 { /* entry idx, value */ 26, VALUE_OPT_SRPPASSWD,
832 /* equiv idx, value */ 26, VALUE_OPT_SRPPASSWD,
833 /* equivalenced to */ NO_EQUIVALENT,
834 /* min, max, act ct */ 0, 1, 0,
835 /* opt state flags */ SRPPASSWD_FLAGS, 0,
836 /* last opt argumnt */ { NULL }, /* --srppasswd */
837 /* arg list/cookie */ NULL,
838 /* must/cannot opts */ NULL, NULL,
839 /* option proc */ doOptSrppasswd,
840 /* desc, NAME, name */ SRPPASSWD_DESC, SRPPASSWD_NAME, SRPPASSWD_name,
841 /* disablement strs */ NULL, NULL },
843 { /* entry idx, value */ 27, VALUE_OPT_SRPPASSWDCONF,
844 /* equiv idx, value */ 27, VALUE_OPT_SRPPASSWDCONF,
845 /* equivalenced to */ NO_EQUIVALENT,
846 /* min, max, act ct */ 0, 1, 0,
847 /* opt state flags */ SRPPASSWDCONF_FLAGS, 0,
848 /* last opt argumnt */ { NULL }, /* --srppasswdconf */
849 /* arg list/cookie */ NULL,
850 /* must/cannot opts */ NULL, NULL,
851 /* option proc */ doOptSrppasswdconf,
852 /* desc, NAME, name */ SRPPASSWDCONF_DESC, SRPPASSWDCONF_NAME, SRPPASSWDCONF_name,
853 /* disablement strs */ NULL, NULL },
855 { /* entry idx, value */ 28, VALUE_OPT_PSKPASSWD,
856 /* equiv idx, value */ 28, VALUE_OPT_PSKPASSWD,
857 /* equivalenced to */ NO_EQUIVALENT,
858 /* min, max, act ct */ 0, 1, 0,
859 /* opt state flags */ PSKPASSWD_FLAGS, 0,
860 /* last opt argumnt */ { NULL }, /* --pskpasswd */
861 /* arg list/cookie */ NULL,
862 /* must/cannot opts */ NULL, NULL,
863 /* option proc */ doOptPskpasswd,
864 /* desc, NAME, name */ PSKPASSWD_DESC, PSKPASSWD_NAME, PSKPASSWD_name,
865 /* disablement strs */ NULL, NULL },
867 { /* entry idx, value */ 29, VALUE_OPT_PSKHINT,
868 /* equiv idx, value */ 29, VALUE_OPT_PSKHINT,
869 /* equivalenced to */ NO_EQUIVALENT,
870 /* min, max, act ct */ 0, 1, 0,
871 /* opt state flags */ PSKHINT_FLAGS, 0,
872 /* last opt argumnt */ { NULL }, /* --pskhint */
873 /* arg list/cookie */ NULL,
874 /* must/cannot opts */ NULL, NULL,
875 /* option proc */ NULL,
876 /* desc, NAME, name */ PSKHINT_DESC, PSKHINT_NAME, PSKHINT_name,
877 /* disablement strs */ NULL, NULL },
879 { /* entry idx, value */ 30, VALUE_OPT_PORT,
880 /* equiv idx, value */ 30, VALUE_OPT_PORT,
881 /* equivalenced to */ NO_EQUIVALENT,
882 /* min, max, act ct */ 0, 1, 0,
883 /* opt state flags */ PORT_FLAGS, 0,
884 /* last opt argumnt */ { NULL }, /* --port */
885 /* arg list/cookie */ NULL,
886 /* must/cannot opts */ NULL, NULL,
887 /* option proc */ optionNumericVal,
888 /* desc, NAME, name */ PORT_DESC, PORT_NAME, PORT_name,
889 /* disablement strs */ NULL, NULL },
891 { /* entry idx, value */ 31, VALUE_OPT_LIST,
892 /* equiv idx, value */ 31, VALUE_OPT_LIST,
893 /* equivalenced to */ NO_EQUIVALENT,
894 /* min, max, act ct */ 0, 1, 0,
895 /* opt state flags */ LIST_FLAGS, 0,
896 /* last opt argumnt */ { NULL }, /* --list */
897 /* arg list/cookie */ NULL,
898 /* must/cannot opts */ NULL, NULL,
899 /* option proc */ NULL,
900 /* desc, NAME, name */ LIST_DESC, LIST_NAME, LIST_name,
901 /* disablement strs */ NULL, NULL },
903 { /* entry idx, value */ INDEX_OPT_VERSION, VALUE_OPT_VERSION,
904 /* equiv idx value */ NO_EQUIVALENT, VALUE_OPT_VERSION,
905 /* equivalenced to */ NO_EQUIVALENT,
906 /* min, max, act ct */ 0, 1, 0,
907 /* opt state flags */ VER_FLAGS, 0,
908 /* last opt argumnt */ { NULL },
909 /* arg list/cookie */ NULL,
910 /* must/cannot opts */ NULL, NULL,
911 /* option proc */ VER_PROC,
912 /* desc, NAME, name */ VER_DESC, NULL, VER_name,
913 /* disablement strs */ NULL, NULL },
917 { /* entry idx, value */ INDEX_OPT_HELP, VALUE_OPT_HELP,
918 /* equiv idx value */ NO_EQUIVALENT, VALUE_OPT_HELP,
919 /* equivalenced to */ NO_EQUIVALENT,
920 /* min, max, act ct */ 0, 1, 0,
921 /* opt state flags */ OPTST_IMM | OPTST_NO_INIT, 0,
922 /* last opt argumnt */ { NULL },
923 /* arg list/cookie */ NULL,
924 /* must/cannot opts */ NULL, NULL,
925 /* option proc */ doUsageOpt,
926 /* desc, NAME, name */ HELP_DESC, NULL, HELP_name,
927 /* disablement strs */ NULL, NULL },
929 { /* entry idx, value */ INDEX_OPT_MORE_HELP, VALUE_OPT_MORE_HELP,
930 /* equiv idx value */ NO_EQUIVALENT, VALUE_OPT_MORE_HELP,
931 /* equivalenced to */ NO_EQUIVALENT,
932 /* min, max, act ct */ 0, 1, 0,
933 /* opt state flags */ MORE_HELP_FLAGS, 0,
934 /* last opt argumnt */ { NULL },
935 /* arg list/cookie */ NULL,
936 /* must/cannot opts */ NULL, NULL,
937 /* option proc */ optionPagedUsage,
938 /* desc, NAME, name */ MORE_HELP_DESC, NULL, MORE_HELP_name,
939 /* disablement strs */ NULL, NULL }
943 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
945 * Define the gnutls-serv Option Environment
947 #define zPROGNAME (gnutls_serv_opt_strs+2656)
948 #define zUsageTitle (gnutls_serv_opt_strs+2668)
949 #define zRcName NULL
950 #define apzHomeList NULL
951 #define zBugsAddr (gnutls_serv_opt_strs+2771)
952 #define zExplain (gnutls_serv_opt_strs+2790)
953 #define zDetail (gnutls_serv_opt_strs+2793)
954 #define zFullVersion (gnutls_serv_opt_strs+2852)
955 /* extracted from optcode.tlib near line 350 */
957 #if defined(ENABLE_NLS)
958 # define OPTPROC_BASE OPTPROC_TRANSLATE | OPTPROC_NXLAT_OPT
959 static tOptionXlateProc translate_option_strings;
960 #else
961 # define OPTPROC_BASE OPTPROC_NONE
962 # define translate_option_strings NULL
963 #endif /* ENABLE_NLS */
966 #define gnutls_serv_full_usage (NULL)
968 #define gnutls_serv_short_usage (gnutls_serv_opt_strs+2874)
970 #endif /* not defined __doxygen__ */
973 * Create the static procedure(s) declared above.
976 * The callout function that invokes the optionUsage function.
978 * @param pOptions the AutoOpts option description structure
979 * @param pOptDesc the descriptor for the "help" (usage) option.
980 * @noreturn
982 static void
983 doUsageOpt(tOptions * pOptions, tOptDesc * pOptDesc)
985 optionUsage(&gnutls_servOptions, GNUTLS_SERV_EXIT_SUCCESS);
986 /* NOTREACHED */
987 (void)pOptDesc;
988 (void)pOptions;
991 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
993 * Code to handle the debug option.
995 * @param pOptions the gnutls-serv options data structure
996 * @param pOptDesc the option descriptor for this option.
998 static void
999 doOptDebug(tOptions* pOptions, tOptDesc* pOptDesc)
1001 static struct {long rmin, rmax;} const rng[1] = {
1002 { 0 , 9999 } };
1003 int ix;
1005 if (pOptions <= OPTPROC_EMIT_LIMIT)
1006 goto emit_ranges;
1007 optionNumericVal(pOptions, pOptDesc);
1009 for (ix = 0; ix < 1; ix++) {
1010 if (pOptDesc->optArg.argInt < rng[ix].rmin)
1011 continue; /* ranges need not be ordered. */
1012 if (pOptDesc->optArg.argInt == rng[ix].rmin)
1013 return;
1014 if (rng[ix].rmax == LONG_MIN)
1015 continue;
1016 if (pOptDesc->optArg.argInt <= rng[ix].rmax)
1017 return;
1020 option_usage_fp = stderr;
1022 emit_ranges:
1024 optionShowRange(pOptions, pOptDesc, (void *)rng, 1);
1027 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
1029 * Code to handle the mtu option.
1031 * @param pOptions the gnutls-serv options data structure
1032 * @param pOptDesc the option descriptor for this option.
1034 static void
1035 doOptMtu(tOptions* pOptions, tOptDesc* pOptDesc)
1037 static struct {long rmin, rmax;} const rng[1] = {
1038 { 0, 17000 } };
1039 int ix;
1041 if (pOptions <= OPTPROC_EMIT_LIMIT)
1042 goto emit_ranges;
1043 optionNumericVal(pOptions, pOptDesc);
1045 for (ix = 0; ix < 1; ix++) {
1046 if (pOptDesc->optArg.argInt < rng[ix].rmin)
1047 continue; /* ranges need not be ordered. */
1048 if (pOptDesc->optArg.argInt == rng[ix].rmin)
1049 return;
1050 if (rng[ix].rmax == LONG_MIN)
1051 continue;
1052 if (pOptDesc->optArg.argInt <= rng[ix].rmax)
1053 return;
1056 option_usage_fp = stderr;
1058 emit_ranges:
1060 optionShowRange(pOptions, pOptDesc, (void *)rng, 1);
1063 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
1065 * Code to handle the dhparams option.
1067 * @param pOptions the gnutls-serv options data structure
1068 * @param pOptDesc the option descriptor for this option.
1070 static void
1071 doOptDhparams(tOptions* pOptions, tOptDesc* pOptDesc)
1073 static teOptFileType const type =
1074 FTYPE_MODE_MUST_EXIST + FTYPE_MODE_NO_OPEN;
1075 static tuFileMode mode;
1076 #ifndef O_CLOEXEC
1077 # define O_CLOEXEC 0
1078 #endif
1079 mode.file_flags = O_CLOEXEC;
1081 optionFileCheck(pOptions, pOptDesc, type, mode);
1084 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
1086 * Code to handle the x509crlfile option.
1088 * @param pOptions the gnutls-serv options data structure
1089 * @param pOptDesc the option descriptor for this option.
1091 static void
1092 doOptX509crlfile(tOptions* pOptions, tOptDesc* pOptDesc)
1094 static teOptFileType const type =
1095 FTYPE_MODE_MUST_EXIST + FTYPE_MODE_NO_OPEN;
1096 static tuFileMode mode;
1097 #ifndef O_CLOEXEC
1098 # define O_CLOEXEC 0
1099 #endif
1100 mode.file_flags = O_CLOEXEC;
1102 optionFileCheck(pOptions, pOptDesc, type, mode);
1105 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
1107 * Code to handle the pgpkeyfile option.
1109 * @param pOptions the gnutls-serv options data structure
1110 * @param pOptDesc the option descriptor for this option.
1112 static void
1113 doOptPgpkeyfile(tOptions* pOptions, tOptDesc* pOptDesc)
1115 static teOptFileType const type =
1116 FTYPE_MODE_MUST_EXIST + FTYPE_MODE_NO_OPEN;
1117 static tuFileMode mode;
1118 #ifndef O_CLOEXEC
1119 # define O_CLOEXEC 0
1120 #endif
1121 mode.file_flags = O_CLOEXEC;
1123 optionFileCheck(pOptions, pOptDesc, type, mode);
1126 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
1128 * Code to handle the pgpkeyring option.
1130 * @param pOptions the gnutls-serv options data structure
1131 * @param pOptDesc the option descriptor for this option.
1133 static void
1134 doOptPgpkeyring(tOptions* pOptions, tOptDesc* pOptDesc)
1136 static teOptFileType const type =
1137 FTYPE_MODE_MUST_EXIST + FTYPE_MODE_NO_OPEN;
1138 static tuFileMode mode;
1139 #ifndef O_CLOEXEC
1140 # define O_CLOEXEC 0
1141 #endif
1142 mode.file_flags = O_CLOEXEC;
1144 optionFileCheck(pOptions, pOptDesc, type, mode);
1147 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
1149 * Code to handle the pgpcertfile option.
1151 * @param pOptions the gnutls-serv options data structure
1152 * @param pOptDesc the option descriptor for this option.
1154 static void
1155 doOptPgpcertfile(tOptions* pOptions, tOptDesc* pOptDesc)
1157 static teOptFileType const type =
1158 FTYPE_MODE_MUST_EXIST + FTYPE_MODE_NO_OPEN;
1159 static tuFileMode mode;
1160 #ifndef O_CLOEXEC
1161 # define O_CLOEXEC 0
1162 #endif
1163 mode.file_flags = O_CLOEXEC;
1165 optionFileCheck(pOptions, pOptDesc, type, mode);
1168 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
1170 * Code to handle the srppasswd option.
1172 * @param pOptions the gnutls-serv options data structure
1173 * @param pOptDesc the option descriptor for this option.
1175 static void
1176 doOptSrppasswd(tOptions* pOptions, tOptDesc* pOptDesc)
1178 static teOptFileType const type =
1179 FTYPE_MODE_MUST_EXIST + FTYPE_MODE_NO_OPEN;
1180 static tuFileMode mode;
1181 #ifndef O_CLOEXEC
1182 # define O_CLOEXEC 0
1183 #endif
1184 mode.file_flags = O_CLOEXEC;
1186 optionFileCheck(pOptions, pOptDesc, type, mode);
1189 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
1191 * Code to handle the srppasswdconf option.
1193 * @param pOptions the gnutls-serv options data structure
1194 * @param pOptDesc the option descriptor for this option.
1196 static void
1197 doOptSrppasswdconf(tOptions* pOptions, tOptDesc* pOptDesc)
1199 static teOptFileType const type =
1200 FTYPE_MODE_MUST_EXIST + FTYPE_MODE_NO_OPEN;
1201 static tuFileMode mode;
1202 #ifndef O_CLOEXEC
1203 # define O_CLOEXEC 0
1204 #endif
1205 mode.file_flags = O_CLOEXEC;
1207 optionFileCheck(pOptions, pOptDesc, type, mode);
1210 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
1212 * Code to handle the pskpasswd option.
1214 * @param pOptions the gnutls-serv options data structure
1215 * @param pOptDesc the option descriptor for this option.
1217 static void
1218 doOptPskpasswd(tOptions* pOptions, tOptDesc* pOptDesc)
1220 static teOptFileType const type =
1221 FTYPE_MODE_MUST_EXIST + FTYPE_MODE_NO_OPEN;
1222 static tuFileMode mode;
1223 #ifndef O_CLOEXEC
1224 # define O_CLOEXEC 0
1225 #endif
1226 mode.file_flags = O_CLOEXEC;
1228 optionFileCheck(pOptions, pOptDesc, type, mode);
1230 /* extracted from optmain.tlib near line 1113 */
1233 * The directory containing the data associated with gnutls-serv.
1235 #ifndef PKGDATADIR
1236 # define PKGDATADIR ""
1237 #endif
1240 * Information about the person or institution that packaged gnutls-serv
1241 * for the current distribution.
1243 #ifndef WITH_PACKAGER
1244 # define gnutls_serv_packager_info NULL
1245 #else
1246 static char const gnutls_serv_packager_info[] =
1247 "Packaged by " WITH_PACKAGER
1249 # ifdef WITH_PACKAGER_VERSION
1250 " ("WITH_PACKAGER_VERSION")"
1251 # endif
1253 # ifdef WITH_PACKAGER_BUG_REPORTS
1254 "\nReport gnutls_serv bugs to " WITH_PACKAGER_BUG_REPORTS
1255 # endif
1256 "\n";
1257 #endif
1258 #ifndef __doxygen__
1260 #endif /* __doxygen__ */
1262 * The option definitions for gnutls-serv. The one structure that
1263 * binds them all.
1265 tOptions gnutls_servOptions = {
1266 OPTIONS_STRUCT_VERSION,
1267 0, NULL, /* original argc + argv */
1268 ( OPTPROC_BASE
1269 + OPTPROC_ERRSTOP
1270 + OPTPROC_SHORTOPT
1271 + OPTPROC_LONGOPT
1272 + OPTPROC_NO_REQ_OPT
1273 + OPTPROC_NO_ARGS
1274 + OPTPROC_GNUUSAGE
1275 + OPTPROC_MISUSE ),
1276 0, NULL, /* current option index, current option */
1277 NULL, NULL, zPROGNAME,
1278 zRcName, zCopyright, zLicenseDescrip,
1279 zFullVersion, apzHomeList, zUsageTitle,
1280 zExplain, zDetail, optDesc,
1281 zBugsAddr, /* address to send bugs to */
1282 NULL, NULL, /* extensions/saved state */
1283 optionUsage, /* usage procedure */
1284 translate_option_strings, /* translation procedure */
1286 * Indexes to special options
1288 { INDEX_OPT_MORE_HELP, /* more-help option index */
1289 NO_EQUIVALENT, /* save option index */
1290 NO_EQUIVALENT, /* '-#' option index */
1291 NO_EQUIVALENT /* index of default opt */
1293 35 /* full option count */, 32 /* user option count */,
1294 gnutls_serv_full_usage, gnutls_serv_short_usage,
1295 NULL, NULL,
1296 PKGDATADIR, gnutls_serv_packager_info
1299 #if ENABLE_NLS
1300 #include <stdio.h>
1301 #include <stdlib.h>
1302 #include <string.h>
1303 #include <unistd.h>
1304 #include <autoopts/usage-txt.h>
1306 static char* AO_gettext(char const* pz);
1307 static void coerce_it(void** s);
1310 * AutoGen specific wrapper function for gettext.
1311 * It relies on the macro _() to convert from English to the target
1312 * language, then strdup-duplicates the result string.
1314 * @param[in] pz the input text used as a lookup key.
1315 * @returns the translated text (if there is one),
1316 * or the original text (if not).
1318 static char *
1319 AO_gettext(char const* pz)
1321 char* pzRes;
1322 if (pz == NULL)
1323 return NULL;
1324 pzRes = _(pz);
1325 if (pzRes == pz)
1326 return pzRes;
1327 pzRes = strdup(pzRes);
1328 if (pzRes == NULL) {
1329 fputs(_("No memory for duping translated strings\n"), stderr);
1330 exit(GNUTLS_SERV_EXIT_FAILURE);
1332 return pzRes;
1335 static void coerce_it(void** s) { *s = AO_gettext(*s);
1339 * Translate all the translatable strings in the gnutls_servOptions
1340 * structure defined above. This is done only once.
1342 static void
1343 translate_option_strings(void)
1345 tOptions * const pOpt = &gnutls_servOptions;
1348 * Guard against re-translation. It won't work. The strings will have
1349 * been changed by the first pass through this code. One shot only.
1351 if (option_usage_text.field_ct != 0) {
1353 * Do the translations. The first pointer follows the field count
1354 * field. The field count field is the size of a pointer.
1356 tOptDesc * pOD = pOpt->pOptDesc;
1357 char ** ppz = (char**)(void*)&(option_usage_text);
1358 int ix = option_usage_text.field_ct;
1360 do {
1361 ppz++;
1362 *ppz = AO_gettext(*ppz);
1363 } while (--ix > 0);
1365 coerce_it((void*)&(pOpt->pzCopyright));
1366 coerce_it((void*)&(pOpt->pzCopyNotice));
1367 coerce_it((void*)&(pOpt->pzFullVersion));
1368 coerce_it((void*)&(pOpt->pzUsageTitle));
1369 coerce_it((void*)&(pOpt->pzExplain));
1370 coerce_it((void*)&(pOpt->pzDetail));
1371 coerce_it((void*)&(pOpt->pzPackager));
1372 coerce_it((void*)&(pOpt->pzShortUsage));
1373 option_usage_text.field_ct = 0;
1375 for (ix = pOpt->optCt; ix > 0; ix--, pOD++)
1376 coerce_it((void*)&(pOD->pzText));
1379 if ((pOpt->fOptSet & OPTPROC_NXLAT_OPT_CFG) == 0) {
1380 tOptDesc * pOD = pOpt->pOptDesc;
1381 int ix;
1383 for (ix = pOpt->optCt; ix > 0; ix--, pOD++) {
1384 coerce_it((void*)&(pOD->pz_Name));
1385 coerce_it((void*)&(pOD->pz_DisableName));
1386 coerce_it((void*)&(pOD->pz_DisablePfx));
1388 /* prevent re-translation */
1389 gnutls_servOptions.fOptSet |= OPTPROC_NXLAT_OPT_CFG | OPTPROC_NXLAT_OPT;
1393 #endif /* ENABLE_NLS */
1395 #ifdef __cplusplus
1397 #endif
1398 /* serv-args.c ends here */