Added "Since" field to new functions.
[gnutls.git] / src / serv-args.c
blob35dafc1309fa5bfe68edb6d03487475b9ed23c86
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 September 30, 2012 at 03:29:31 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[3058] =
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 */ "Activate heartbeat support\0"
121 /* 1426 */ "HEARTBEAT\0"
122 /* 1436 */ "heartbeat\0"
123 /* 1446 */ "Use DER format for certificates to read from\0"
124 /* 1491 */ "X509FMTDER\0"
125 /* 1502 */ "x509fmtder\0"
126 /* 1513 */ "Priorities string\0"
127 /* 1531 */ "PRIORITY\0"
128 /* 1540 */ "priority\0"
129 /* 1549 */ "DH params file to use\0"
130 /* 1571 */ "DHPARAMS\0"
131 /* 1580 */ "dhparams\0"
132 /* 1589 */ "Certificate file or PKCS #11 URL to use\0"
133 /* 1629 */ "X509CAFILE\0"
134 /* 1640 */ "x509cafile\0"
135 /* 1651 */ "CRL file to use\0"
136 /* 1667 */ "X509CRLFILE\0"
137 /* 1679 */ "x509crlfile\0"
138 /* 1691 */ "PGP Key file to use\0"
139 /* 1711 */ "PGPKEYFILE\0"
140 /* 1722 */ "pgpkeyfile\0"
141 /* 1733 */ "PGP Key ring file to use\0"
142 /* 1758 */ "PGPKEYRING\0"
143 /* 1769 */ "pgpkeyring\0"
144 /* 1780 */ "PGP Public Key (certificate) file to use\0"
145 /* 1821 */ "PGPCERTFILE\0"
146 /* 1833 */ "pgpcertfile\0"
147 /* 1845 */ "X.509 key file or PKCS #11 URL to use\0"
148 /* 1883 */ "X509KEYFILE\0"
149 /* 1895 */ "x509keyfile\0"
150 /* 1907 */ "X.509 Certificate file or PKCS #11 URL to use\0"
151 /* 1953 */ "X509CERTFILE\0"
152 /* 1966 */ "x509certfile\0"
153 /* 1979 */ "Alternative X.509 key file or PKCS #11 URL to use\0"
154 /* 2029 */ "X509DSAKEYFILE\0"
155 /* 2044 */ "x509dsakeyfile\0"
156 /* 2059 */ "Alternative X.509 Certificate file or PKCS #11 URL to use\0"
157 /* 2117 */ "X509DSACERTFILE\0"
158 /* 2133 */ "x509dsacertfile\0"
159 /* 2149 */ "X509ECCKEYFILE\0"
160 /* 2164 */ "x509ecckeyfile\0"
161 /* 2179 */ "X509ECCCERTFILE\0"
162 /* 2195 */ "x509ecccertfile\0"
163 /* 2211 */ "PGP subkey to use (hex or auto)\0"
164 /* 2243 */ "PGPSUBKEY\0"
165 /* 2253 */ "pgpsubkey\0"
166 /* 2263 */ "SRP password file to use\0"
167 /* 2288 */ "SRPPASSWD\0"
168 /* 2298 */ "srppasswd\0"
169 /* 2308 */ "SRP password configuration file to use\0"
170 /* 2347 */ "SRPPASSWDCONF\0"
171 /* 2361 */ "srppasswdconf\0"
172 /* 2375 */ "PSK password file to use\0"
173 /* 2400 */ "PSKPASSWD\0"
174 /* 2410 */ "pskpasswd\0"
175 /* 2420 */ "PSK identity hint to use\0"
176 /* 2445 */ "PSKHINT\0"
177 /* 2453 */ "pskhint\0"
178 /* 2461 */ "The OCSP response to send to client\0"
179 /* 2497 */ "OCSP_RESPONSE\0"
180 /* 2511 */ "ocsp-response\0"
181 /* 2525 */ "The port to connect to\0"
182 /* 2548 */ "PORT\0"
183 /* 2553 */ "port\0"
184 /* 2558 */ "Print a list of the supported algorithms and modes\0"
185 /* 2609 */ "LIST\0"
186 /* 2614 */ "list\0"
187 /* 2619 */ "Display extended usage information and exit\0"
188 /* 2663 */ "help\0"
189 /* 2668 */ "Extended usage information passed thru pager\0"
190 /* 2713 */ "more-help\0"
191 /* 2723 */ "Output version information and exit\0"
192 /* 2759 */ "version\0"
193 /* 2767 */ "GNUTLS_SERV\0"
194 /* 2779 */ "gnutls-serv - GnuTLS server - Ver. @VERSION@\n"
195 "USAGE: %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]...\n\0"
196 /* 2882 */ "bug-gnutls@gnu.org\0"
197 /* 2901 */ "\n\n\0"
198 /* 2904 */ "\n"
199 "Server program that listens to incoming TLS connections.\n\0"
200 /* 2963 */ "gnutls-serv @VERSION@\0"
201 /* 2985 */ "Usage: gnutls-serv [options]\n"
202 "gnutls-serv --help for usage instructions.\n";
205 * debug option description:
207 #define DEBUG_DESC (gnutls_serv_opt_strs+893)
208 #define DEBUG_NAME (gnutls_serv_opt_strs+911)
209 #define DEBUG_name (gnutls_serv_opt_strs+917)
210 #define DEBUG_FLAGS (OPTST_DISABLED \
211 | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC))
214 * noticket option description:
216 #define NOTICKET_DESC (gnutls_serv_opt_strs+923)
217 #define NOTICKET_NAME (gnutls_serv_opt_strs+952)
218 #define NOTICKET_name (gnutls_serv_opt_strs+961)
219 #define NOTICKET_FLAGS (OPTST_DISABLED)
222 * generate option description:
224 #define GENERATE_DESC (gnutls_serv_opt_strs+970)
225 #define GENERATE_NAME (gnutls_serv_opt_strs+1020)
226 #define GENERATE_name (gnutls_serv_opt_strs+1029)
227 #define GENERATE_FLAGS (OPTST_DISABLED)
230 * quiet option description:
232 #define QUIET_DESC (gnutls_serv_opt_strs+1038)
233 #define QUIET_NAME (gnutls_serv_opt_strs+1061)
234 #define QUIET_name (gnutls_serv_opt_strs+1067)
235 #define QUIET_FLAGS (OPTST_DISABLED)
238 * nodb option description:
240 #define NODB_DESC (gnutls_serv_opt_strs+1073)
241 #define NODB_NAME (gnutls_serv_opt_strs+1106)
242 #define NODB_name (gnutls_serv_opt_strs+1111)
243 #define NODB_FLAGS (OPTST_DISABLED)
246 * http option description:
248 #define HTTP_DESC (gnutls_serv_opt_strs+1116)
249 #define HTTP_NAME (gnutls_serv_opt_strs+1138)
250 #define HTTP_name (gnutls_serv_opt_strs+1143)
251 #define HTTP_FLAGS (OPTST_DISABLED)
254 * echo option description:
256 #define ECHO_DESC (gnutls_serv_opt_strs+1148)
257 #define ECHO_NAME (gnutls_serv_opt_strs+1170)
258 #define ECHO_name (gnutls_serv_opt_strs+1175)
259 #define ECHO_FLAGS (OPTST_DISABLED)
262 * udp option description:
264 #define UDP_DESC (gnutls_serv_opt_strs+1180)
265 #define UDP_NAME (gnutls_serv_opt_strs+1213)
266 #define UDP_name (gnutls_serv_opt_strs+1217)
267 #define UDP_FLAGS (OPTST_DISABLED)
270 * mtu option description:
272 #define MTU_DESC (gnutls_serv_opt_strs+1221)
273 #define MTU_NAME (gnutls_serv_opt_strs+1246)
274 #define MTU_name (gnutls_serv_opt_strs+1250)
275 #define MTU_FLAGS (OPTST_DISABLED \
276 | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC))
279 * disable-client-cert option description:
281 #define DISABLE_CLIENT_CERT_DESC (gnutls_serv_opt_strs+1254)
282 #define DISABLE_CLIENT_CERT_NAME (gnutls_serv_opt_strs+1290)
283 #define DISABLE_CLIENT_CERT_name (gnutls_serv_opt_strs+1310)
284 #define DISABLE_CLIENT_CERT_FLAGS (OPTST_DISABLED)
287 * require-client-cert option description:
289 #define REQUIRE_CLIENT_CERT_DESC (gnutls_serv_opt_strs+1330)
290 #define REQUIRE_CLIENT_CERT_NAME (gnutls_serv_opt_strs+1359)
291 #define REQUIRE_CLIENT_CERT_name (gnutls_serv_opt_strs+1379)
292 #define REQUIRE_CLIENT_CERT_FLAGS (OPTST_DISABLED)
295 * heartbeat option description:
297 #define HEARTBEAT_DESC (gnutls_serv_opt_strs+1399)
298 #define HEARTBEAT_NAME (gnutls_serv_opt_strs+1426)
299 #define HEARTBEAT_name (gnutls_serv_opt_strs+1436)
300 #define HEARTBEAT_FLAGS (OPTST_DISABLED)
303 * x509fmtder option description:
305 #define X509FMTDER_DESC (gnutls_serv_opt_strs+1446)
306 #define X509FMTDER_NAME (gnutls_serv_opt_strs+1491)
307 #define X509FMTDER_name (gnutls_serv_opt_strs+1502)
308 #define X509FMTDER_FLAGS (OPTST_DISABLED)
311 * priority option description:
313 #define PRIORITY_DESC (gnutls_serv_opt_strs+1513)
314 #define PRIORITY_NAME (gnutls_serv_opt_strs+1531)
315 #define PRIORITY_name (gnutls_serv_opt_strs+1540)
316 #define PRIORITY_FLAGS (OPTST_DISABLED \
317 | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
320 * dhparams option description:
322 #define DHPARAMS_DESC (gnutls_serv_opt_strs+1549)
323 #define DHPARAMS_NAME (gnutls_serv_opt_strs+1571)
324 #define DHPARAMS_name (gnutls_serv_opt_strs+1580)
325 #define DHPARAMS_FLAGS (OPTST_DISABLED \
326 | OPTST_SET_ARGTYPE(OPARG_TYPE_FILE))
329 * x509cafile option description:
331 #define X509CAFILE_DESC (gnutls_serv_opt_strs+1589)
332 #define X509CAFILE_NAME (gnutls_serv_opt_strs+1629)
333 #define X509CAFILE_name (gnutls_serv_opt_strs+1640)
334 #define X509CAFILE_FLAGS (OPTST_DISABLED \
335 | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
338 * x509crlfile option description:
340 #define X509CRLFILE_DESC (gnutls_serv_opt_strs+1651)
341 #define X509CRLFILE_NAME (gnutls_serv_opt_strs+1667)
342 #define X509CRLFILE_name (gnutls_serv_opt_strs+1679)
343 #define X509CRLFILE_FLAGS (OPTST_DISABLED \
344 | OPTST_SET_ARGTYPE(OPARG_TYPE_FILE))
347 * pgpkeyfile option description:
349 #define PGPKEYFILE_DESC (gnutls_serv_opt_strs+1691)
350 #define PGPKEYFILE_NAME (gnutls_serv_opt_strs+1711)
351 #define PGPKEYFILE_name (gnutls_serv_opt_strs+1722)
352 #define PGPKEYFILE_FLAGS (OPTST_DISABLED \
353 | OPTST_SET_ARGTYPE(OPARG_TYPE_FILE))
356 * pgpkeyring option description:
358 #define PGPKEYRING_DESC (gnutls_serv_opt_strs+1733)
359 #define PGPKEYRING_NAME (gnutls_serv_opt_strs+1758)
360 #define PGPKEYRING_name (gnutls_serv_opt_strs+1769)
361 #define PGPKEYRING_FLAGS (OPTST_DISABLED \
362 | OPTST_SET_ARGTYPE(OPARG_TYPE_FILE))
365 * pgpcertfile option description:
367 #define PGPCERTFILE_DESC (gnutls_serv_opt_strs+1780)
368 #define PGPCERTFILE_NAME (gnutls_serv_opt_strs+1821)
369 #define PGPCERTFILE_name (gnutls_serv_opt_strs+1833)
370 #define PGPCERTFILE_FLAGS (OPTST_DISABLED \
371 | OPTST_SET_ARGTYPE(OPARG_TYPE_FILE))
374 * x509keyfile option description:
376 #define X509KEYFILE_DESC (gnutls_serv_opt_strs+1845)
377 #define X509KEYFILE_NAME (gnutls_serv_opt_strs+1883)
378 #define X509KEYFILE_name (gnutls_serv_opt_strs+1895)
379 #define X509KEYFILE_FLAGS (OPTST_DISABLED \
380 | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
383 * x509certfile option description:
385 #define X509CERTFILE_DESC (gnutls_serv_opt_strs+1907)
386 #define X509CERTFILE_NAME (gnutls_serv_opt_strs+1953)
387 #define X509CERTFILE_name (gnutls_serv_opt_strs+1966)
388 #define X509CERTFILE_FLAGS (OPTST_DISABLED \
389 | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
392 * x509dsakeyfile option description:
394 #define X509DSAKEYFILE_DESC (gnutls_serv_opt_strs+1979)
395 #define X509DSAKEYFILE_NAME (gnutls_serv_opt_strs+2029)
396 #define X509DSAKEYFILE_name (gnutls_serv_opt_strs+2044)
397 #define X509DSAKEYFILE_FLAGS (OPTST_DISABLED \
398 | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
401 * x509dsacertfile option description:
403 #define X509DSACERTFILE_DESC (gnutls_serv_opt_strs+2059)
404 #define X509DSACERTFILE_NAME (gnutls_serv_opt_strs+2117)
405 #define X509DSACERTFILE_name (gnutls_serv_opt_strs+2133)
406 #define X509DSACERTFILE_FLAGS (OPTST_DISABLED \
407 | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
410 * x509ecckeyfile option description:
412 #define X509ECCKEYFILE_DESC (gnutls_serv_opt_strs+1979)
413 #define X509ECCKEYFILE_NAME (gnutls_serv_opt_strs+2149)
414 #define X509ECCKEYFILE_name (gnutls_serv_opt_strs+2164)
415 #define X509ECCKEYFILE_FLAGS (OPTST_DISABLED \
416 | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
419 * x509ecccertfile option description:
421 #define X509ECCCERTFILE_DESC (gnutls_serv_opt_strs+2059)
422 #define X509ECCCERTFILE_NAME (gnutls_serv_opt_strs+2179)
423 #define X509ECCCERTFILE_name (gnutls_serv_opt_strs+2195)
424 #define X509ECCCERTFILE_FLAGS (OPTST_DISABLED \
425 | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
428 * pgpsubkey option description:
430 #define PGPSUBKEY_DESC (gnutls_serv_opt_strs+2211)
431 #define PGPSUBKEY_NAME (gnutls_serv_opt_strs+2243)
432 #define PGPSUBKEY_name (gnutls_serv_opt_strs+2253)
433 #define PGPSUBKEY_FLAGS (OPTST_DISABLED \
434 | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
437 * srppasswd option description:
439 #define SRPPASSWD_DESC (gnutls_serv_opt_strs+2263)
440 #define SRPPASSWD_NAME (gnutls_serv_opt_strs+2288)
441 #define SRPPASSWD_name (gnutls_serv_opt_strs+2298)
442 #define SRPPASSWD_FLAGS (OPTST_DISABLED \
443 | OPTST_SET_ARGTYPE(OPARG_TYPE_FILE))
446 * srppasswdconf option description:
448 #define SRPPASSWDCONF_DESC (gnutls_serv_opt_strs+2308)
449 #define SRPPASSWDCONF_NAME (gnutls_serv_opt_strs+2347)
450 #define SRPPASSWDCONF_name (gnutls_serv_opt_strs+2361)
451 #define SRPPASSWDCONF_FLAGS (OPTST_DISABLED \
452 | OPTST_SET_ARGTYPE(OPARG_TYPE_FILE))
455 * pskpasswd option description:
457 #define PSKPASSWD_DESC (gnutls_serv_opt_strs+2375)
458 #define PSKPASSWD_NAME (gnutls_serv_opt_strs+2400)
459 #define PSKPASSWD_name (gnutls_serv_opt_strs+2410)
460 #define PSKPASSWD_FLAGS (OPTST_DISABLED \
461 | OPTST_SET_ARGTYPE(OPARG_TYPE_FILE))
464 * pskhint option description:
466 #define PSKHINT_DESC (gnutls_serv_opt_strs+2420)
467 #define PSKHINT_NAME (gnutls_serv_opt_strs+2445)
468 #define PSKHINT_name (gnutls_serv_opt_strs+2453)
469 #define PSKHINT_FLAGS (OPTST_DISABLED \
470 | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
473 * ocsp-response option description:
475 #define OCSP_RESPONSE_DESC (gnutls_serv_opt_strs+2461)
476 #define OCSP_RESPONSE_NAME (gnutls_serv_opt_strs+2497)
477 #define OCSP_RESPONSE_name (gnutls_serv_opt_strs+2511)
478 #define OCSP_RESPONSE_FLAGS (OPTST_DISABLED \
479 | OPTST_SET_ARGTYPE(OPARG_TYPE_FILE))
482 * port option description:
484 #define PORT_DESC (gnutls_serv_opt_strs+2525)
485 #define PORT_NAME (gnutls_serv_opt_strs+2548)
486 #define PORT_name (gnutls_serv_opt_strs+2553)
487 #define PORT_FLAGS (OPTST_DISABLED \
488 | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC))
491 * list option description:
493 #define LIST_DESC (gnutls_serv_opt_strs+2558)
494 #define LIST_NAME (gnutls_serv_opt_strs+2609)
495 #define LIST_name (gnutls_serv_opt_strs+2614)
496 #define LIST_FLAGS (OPTST_DISABLED)
499 * Help/More_Help/Version option descriptions:
501 #define HELP_DESC (gnutls_serv_opt_strs+2619)
502 #define HELP_name (gnutls_serv_opt_strs+2663)
503 #ifdef HAVE_WORKING_FORK
504 #define MORE_HELP_DESC (gnutls_serv_opt_strs+2668)
505 #define MORE_HELP_name (gnutls_serv_opt_strs+2713)
506 #define MORE_HELP_FLAGS (OPTST_IMM | OPTST_NO_INIT)
507 #else
508 #define MORE_HELP_DESC NULL
509 #define MORE_HELP_name NULL
510 #define MORE_HELP_FLAGS (OPTST_OMITTED | OPTST_NO_INIT)
511 #endif
512 #ifdef NO_OPTIONAL_OPT_ARGS
513 # define VER_FLAGS (OPTST_IMM | OPTST_NO_INIT)
514 #else
515 # define VER_FLAGS (OPTST_SET_ARGTYPE(OPARG_TYPE_STRING) | \
516 OPTST_ARG_OPTIONAL | OPTST_IMM | OPTST_NO_INIT)
517 #endif
518 #define VER_DESC (gnutls_serv_opt_strs+2723)
519 #define VER_name (gnutls_serv_opt_strs+2759)
521 * Declare option callback procedures
523 extern tOptProc
524 optionBooleanVal, optionNestedVal, optionNumericVal,
525 optionPagedUsage, optionPrintVersion, optionResetOpt,
526 optionStackArg, optionTimeDate, optionTimeVal,
527 optionUnstackArg, optionVendorOption;
528 static tOptProc
529 doOptDebug, doOptDhparams, doOptMtu,
530 doOptOcsp_Response, doOptPgpcertfile, doOptPgpkeyfile,
531 doOptPgpkeyring, doOptPskpasswd, doOptSrppasswd,
532 doOptSrppasswdconf, doOptX509crlfile, doUsageOpt;
533 #define VER_PROC optionPrintVersion
535 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
537 * Define the gnutls-serv Option Descriptions.
538 * This is an array of OPTION_CT entries, one for each
539 * option that the gnutls-serv program responds to.
541 static tOptDesc optDesc[OPTION_CT] = {
542 { /* entry idx, value */ 0, VALUE_OPT_DEBUG,
543 /* equiv idx, value */ 0, VALUE_OPT_DEBUG,
544 /* equivalenced to */ NO_EQUIVALENT,
545 /* min, max, act ct */ 0, 1, 0,
546 /* opt state flags */ DEBUG_FLAGS, 0,
547 /* last opt argumnt */ { NULL }, /* --debug */
548 /* arg list/cookie */ NULL,
549 /* must/cannot opts */ NULL, NULL,
550 /* option proc */ doOptDebug,
551 /* desc, NAME, name */ DEBUG_DESC, DEBUG_NAME, DEBUG_name,
552 /* disablement strs */ NULL, NULL },
554 { /* entry idx, value */ 1, VALUE_OPT_NOTICKET,
555 /* equiv idx, value */ 1, VALUE_OPT_NOTICKET,
556 /* equivalenced to */ NO_EQUIVALENT,
557 /* min, max, act ct */ 0, 1, 0,
558 /* opt state flags */ NOTICKET_FLAGS, 0,
559 /* last opt argumnt */ { NULL }, /* --noticket */
560 /* arg list/cookie */ NULL,
561 /* must/cannot opts */ NULL, NULL,
562 /* option proc */ NULL,
563 /* desc, NAME, name */ NOTICKET_DESC, NOTICKET_NAME, NOTICKET_name,
564 /* disablement strs */ NULL, NULL },
566 { /* entry idx, value */ 2, VALUE_OPT_GENERATE,
567 /* equiv idx, value */ 2, VALUE_OPT_GENERATE,
568 /* equivalenced to */ NO_EQUIVALENT,
569 /* min, max, act ct */ 0, 1, 0,
570 /* opt state flags */ GENERATE_FLAGS, 0,
571 /* last opt argumnt */ { NULL }, /* --generate */
572 /* arg list/cookie */ NULL,
573 /* must/cannot opts */ NULL, NULL,
574 /* option proc */ NULL,
575 /* desc, NAME, name */ GENERATE_DESC, GENERATE_NAME, GENERATE_name,
576 /* disablement strs */ NULL, NULL },
578 { /* entry idx, value */ 3, VALUE_OPT_QUIET,
579 /* equiv idx, value */ 3, VALUE_OPT_QUIET,
580 /* equivalenced to */ NO_EQUIVALENT,
581 /* min, max, act ct */ 0, 1, 0,
582 /* opt state flags */ QUIET_FLAGS, 0,
583 /* last opt argumnt */ { NULL }, /* --quiet */
584 /* arg list/cookie */ NULL,
585 /* must/cannot opts */ NULL, NULL,
586 /* option proc */ NULL,
587 /* desc, NAME, name */ QUIET_DESC, QUIET_NAME, QUIET_name,
588 /* disablement strs */ NULL, NULL },
590 { /* entry idx, value */ 4, VALUE_OPT_NODB,
591 /* equiv idx, value */ 4, VALUE_OPT_NODB,
592 /* equivalenced to */ NO_EQUIVALENT,
593 /* min, max, act ct */ 0, 1, 0,
594 /* opt state flags */ NODB_FLAGS, 0,
595 /* last opt argumnt */ { NULL }, /* --nodb */
596 /* arg list/cookie */ NULL,
597 /* must/cannot opts */ NULL, NULL,
598 /* option proc */ NULL,
599 /* desc, NAME, name */ NODB_DESC, NODB_NAME, NODB_name,
600 /* disablement strs */ NULL, NULL },
602 { /* entry idx, value */ 5, VALUE_OPT_HTTP,
603 /* equiv idx, value */ 5, VALUE_OPT_HTTP,
604 /* equivalenced to */ NO_EQUIVALENT,
605 /* min, max, act ct */ 0, 1, 0,
606 /* opt state flags */ HTTP_FLAGS, 0,
607 /* last opt argumnt */ { NULL }, /* --http */
608 /* arg list/cookie */ NULL,
609 /* must/cannot opts */ NULL, NULL,
610 /* option proc */ NULL,
611 /* desc, NAME, name */ HTTP_DESC, HTTP_NAME, HTTP_name,
612 /* disablement strs */ NULL, NULL },
614 { /* entry idx, value */ 6, VALUE_OPT_ECHO,
615 /* equiv idx, value */ 6, VALUE_OPT_ECHO,
616 /* equivalenced to */ NO_EQUIVALENT,
617 /* min, max, act ct */ 0, 1, 0,
618 /* opt state flags */ ECHO_FLAGS, 0,
619 /* last opt argumnt */ { NULL }, /* --echo */
620 /* arg list/cookie */ NULL,
621 /* must/cannot opts */ NULL, NULL,
622 /* option proc */ NULL,
623 /* desc, NAME, name */ ECHO_DESC, ECHO_NAME, ECHO_name,
624 /* disablement strs */ NULL, NULL },
626 { /* entry idx, value */ 7, VALUE_OPT_UDP,
627 /* equiv idx, value */ 7, VALUE_OPT_UDP,
628 /* equivalenced to */ NO_EQUIVALENT,
629 /* min, max, act ct */ 0, 1, 0,
630 /* opt state flags */ UDP_FLAGS, 0,
631 /* last opt argumnt */ { NULL }, /* --udp */
632 /* arg list/cookie */ NULL,
633 /* must/cannot opts */ NULL, NULL,
634 /* option proc */ NULL,
635 /* desc, NAME, name */ UDP_DESC, UDP_NAME, UDP_name,
636 /* disablement strs */ NULL, NULL },
638 { /* entry idx, value */ 8, VALUE_OPT_MTU,
639 /* equiv idx, value */ 8, VALUE_OPT_MTU,
640 /* equivalenced to */ NO_EQUIVALENT,
641 /* min, max, act ct */ 0, 1, 0,
642 /* opt state flags */ MTU_FLAGS, 0,
643 /* last opt argumnt */ { NULL }, /* --mtu */
644 /* arg list/cookie */ NULL,
645 /* must/cannot opts */ NULL, NULL,
646 /* option proc */ doOptMtu,
647 /* desc, NAME, name */ MTU_DESC, MTU_NAME, MTU_name,
648 /* disablement strs */ NULL, NULL },
650 { /* entry idx, value */ 9, VALUE_OPT_DISABLE_CLIENT_CERT,
651 /* equiv idx, value */ 9, VALUE_OPT_DISABLE_CLIENT_CERT,
652 /* equivalenced to */ NO_EQUIVALENT,
653 /* min, max, act ct */ 0, 1, 0,
654 /* opt state flags */ DISABLE_CLIENT_CERT_FLAGS, 0,
655 /* last opt argumnt */ { NULL }, /* --disable-client-cert */
656 /* arg list/cookie */ NULL,
657 /* must/cannot opts */ NULL, NULL,
658 /* option proc */ NULL,
659 /* desc, NAME, name */ DISABLE_CLIENT_CERT_DESC, DISABLE_CLIENT_CERT_NAME, DISABLE_CLIENT_CERT_name,
660 /* disablement strs */ NULL, NULL },
662 { /* entry idx, value */ 10, VALUE_OPT_REQUIRE_CLIENT_CERT,
663 /* equiv idx, value */ 10, VALUE_OPT_REQUIRE_CLIENT_CERT,
664 /* equivalenced to */ NO_EQUIVALENT,
665 /* min, max, act ct */ 0, 1, 0,
666 /* opt state flags */ REQUIRE_CLIENT_CERT_FLAGS, 0,
667 /* last opt argumnt */ { NULL }, /* --require-client-cert */
668 /* arg list/cookie */ NULL,
669 /* must/cannot opts */ NULL, NULL,
670 /* option proc */ NULL,
671 /* desc, NAME, name */ REQUIRE_CLIENT_CERT_DESC, REQUIRE_CLIENT_CERT_NAME, REQUIRE_CLIENT_CERT_name,
672 /* disablement strs */ NULL, NULL },
674 { /* entry idx, value */ 11, VALUE_OPT_HEARTBEAT,
675 /* equiv idx, value */ 11, VALUE_OPT_HEARTBEAT,
676 /* equivalenced to */ NO_EQUIVALENT,
677 /* min, max, act ct */ 0, 1, 0,
678 /* opt state flags */ HEARTBEAT_FLAGS, 0,
679 /* last opt argumnt */ { NULL }, /* --heartbeat */
680 /* arg list/cookie */ NULL,
681 /* must/cannot opts */ NULL, NULL,
682 /* option proc */ NULL,
683 /* desc, NAME, name */ HEARTBEAT_DESC, HEARTBEAT_NAME, HEARTBEAT_name,
684 /* disablement strs */ NULL, NULL },
686 { /* entry idx, value */ 12, VALUE_OPT_X509FMTDER,
687 /* equiv idx, value */ 12, VALUE_OPT_X509FMTDER,
688 /* equivalenced to */ NO_EQUIVALENT,
689 /* min, max, act ct */ 0, 1, 0,
690 /* opt state flags */ X509FMTDER_FLAGS, 0,
691 /* last opt argumnt */ { NULL }, /* --x509fmtder */
692 /* arg list/cookie */ NULL,
693 /* must/cannot opts */ NULL, NULL,
694 /* option proc */ NULL,
695 /* desc, NAME, name */ X509FMTDER_DESC, X509FMTDER_NAME, X509FMTDER_name,
696 /* disablement strs */ NULL, NULL },
698 { /* entry idx, value */ 13, VALUE_OPT_PRIORITY,
699 /* equiv idx, value */ 13, VALUE_OPT_PRIORITY,
700 /* equivalenced to */ NO_EQUIVALENT,
701 /* min, max, act ct */ 0, 1, 0,
702 /* opt state flags */ PRIORITY_FLAGS, 0,
703 /* last opt argumnt */ { NULL }, /* --priority */
704 /* arg list/cookie */ NULL,
705 /* must/cannot opts */ NULL, NULL,
706 /* option proc */ NULL,
707 /* desc, NAME, name */ PRIORITY_DESC, PRIORITY_NAME, PRIORITY_name,
708 /* disablement strs */ NULL, NULL },
710 { /* entry idx, value */ 14, VALUE_OPT_DHPARAMS,
711 /* equiv idx, value */ 14, VALUE_OPT_DHPARAMS,
712 /* equivalenced to */ NO_EQUIVALENT,
713 /* min, max, act ct */ 0, 1, 0,
714 /* opt state flags */ DHPARAMS_FLAGS, 0,
715 /* last opt argumnt */ { NULL }, /* --dhparams */
716 /* arg list/cookie */ NULL,
717 /* must/cannot opts */ NULL, NULL,
718 /* option proc */ doOptDhparams,
719 /* desc, NAME, name */ DHPARAMS_DESC, DHPARAMS_NAME, DHPARAMS_name,
720 /* disablement strs */ NULL, NULL },
722 { /* entry idx, value */ 15, VALUE_OPT_X509CAFILE,
723 /* equiv idx, value */ 15, VALUE_OPT_X509CAFILE,
724 /* equivalenced to */ NO_EQUIVALENT,
725 /* min, max, act ct */ 0, 1, 0,
726 /* opt state flags */ X509CAFILE_FLAGS, 0,
727 /* last opt argumnt */ { NULL }, /* --x509cafile */
728 /* arg list/cookie */ NULL,
729 /* must/cannot opts */ NULL, NULL,
730 /* option proc */ NULL,
731 /* desc, NAME, name */ X509CAFILE_DESC, X509CAFILE_NAME, X509CAFILE_name,
732 /* disablement strs */ NULL, NULL },
734 { /* entry idx, value */ 16, VALUE_OPT_X509CRLFILE,
735 /* equiv idx, value */ 16, VALUE_OPT_X509CRLFILE,
736 /* equivalenced to */ NO_EQUIVALENT,
737 /* min, max, act ct */ 0, 1, 0,
738 /* opt state flags */ X509CRLFILE_FLAGS, 0,
739 /* last opt argumnt */ { NULL }, /* --x509crlfile */
740 /* arg list/cookie */ NULL,
741 /* must/cannot opts */ NULL, NULL,
742 /* option proc */ doOptX509crlfile,
743 /* desc, NAME, name */ X509CRLFILE_DESC, X509CRLFILE_NAME, X509CRLFILE_name,
744 /* disablement strs */ NULL, NULL },
746 { /* entry idx, value */ 17, VALUE_OPT_PGPKEYFILE,
747 /* equiv idx, value */ 17, VALUE_OPT_PGPKEYFILE,
748 /* equivalenced to */ NO_EQUIVALENT,
749 /* min, max, act ct */ 0, 1, 0,
750 /* opt state flags */ PGPKEYFILE_FLAGS, 0,
751 /* last opt argumnt */ { NULL }, /* --pgpkeyfile */
752 /* arg list/cookie */ NULL,
753 /* must/cannot opts */ NULL, NULL,
754 /* option proc */ doOptPgpkeyfile,
755 /* desc, NAME, name */ PGPKEYFILE_DESC, PGPKEYFILE_NAME, PGPKEYFILE_name,
756 /* disablement strs */ NULL, NULL },
758 { /* entry idx, value */ 18, VALUE_OPT_PGPKEYRING,
759 /* equiv idx, value */ 18, VALUE_OPT_PGPKEYRING,
760 /* equivalenced to */ NO_EQUIVALENT,
761 /* min, max, act ct */ 0, 1, 0,
762 /* opt state flags */ PGPKEYRING_FLAGS, 0,
763 /* last opt argumnt */ { NULL }, /* --pgpkeyring */
764 /* arg list/cookie */ NULL,
765 /* must/cannot opts */ NULL, NULL,
766 /* option proc */ doOptPgpkeyring,
767 /* desc, NAME, name */ PGPKEYRING_DESC, PGPKEYRING_NAME, PGPKEYRING_name,
768 /* disablement strs */ NULL, NULL },
770 { /* entry idx, value */ 19, VALUE_OPT_PGPCERTFILE,
771 /* equiv idx, value */ 19, VALUE_OPT_PGPCERTFILE,
772 /* equivalenced to */ NO_EQUIVALENT,
773 /* min, max, act ct */ 0, 1, 0,
774 /* opt state flags */ PGPCERTFILE_FLAGS, 0,
775 /* last opt argumnt */ { NULL }, /* --pgpcertfile */
776 /* arg list/cookie */ NULL,
777 /* must/cannot opts */ NULL, NULL,
778 /* option proc */ doOptPgpcertfile,
779 /* desc, NAME, name */ PGPCERTFILE_DESC, PGPCERTFILE_NAME, PGPCERTFILE_name,
780 /* disablement strs */ NULL, NULL },
782 { /* entry idx, value */ 20, VALUE_OPT_X509KEYFILE,
783 /* equiv idx, value */ 20, VALUE_OPT_X509KEYFILE,
784 /* equivalenced to */ NO_EQUIVALENT,
785 /* min, max, act ct */ 0, 1, 0,
786 /* opt state flags */ X509KEYFILE_FLAGS, 0,
787 /* last opt argumnt */ { NULL }, /* --x509keyfile */
788 /* arg list/cookie */ NULL,
789 /* must/cannot opts */ NULL, NULL,
790 /* option proc */ NULL,
791 /* desc, NAME, name */ X509KEYFILE_DESC, X509KEYFILE_NAME, X509KEYFILE_name,
792 /* disablement strs */ NULL, NULL },
794 { /* entry idx, value */ 21, VALUE_OPT_X509CERTFILE,
795 /* equiv idx, value */ 21, VALUE_OPT_X509CERTFILE,
796 /* equivalenced to */ NO_EQUIVALENT,
797 /* min, max, act ct */ 0, 1, 0,
798 /* opt state flags */ X509CERTFILE_FLAGS, 0,
799 /* last opt argumnt */ { NULL }, /* --x509certfile */
800 /* arg list/cookie */ NULL,
801 /* must/cannot opts */ NULL, NULL,
802 /* option proc */ NULL,
803 /* desc, NAME, name */ X509CERTFILE_DESC, X509CERTFILE_NAME, X509CERTFILE_name,
804 /* disablement strs */ NULL, NULL },
806 { /* entry idx, value */ 22, VALUE_OPT_X509DSAKEYFILE,
807 /* equiv idx, value */ 22, VALUE_OPT_X509DSAKEYFILE,
808 /* equivalenced to */ NO_EQUIVALENT,
809 /* min, max, act ct */ 0, 1, 0,
810 /* opt state flags */ X509DSAKEYFILE_FLAGS, 0,
811 /* last opt argumnt */ { NULL }, /* --x509dsakeyfile */
812 /* arg list/cookie */ NULL,
813 /* must/cannot opts */ NULL, NULL,
814 /* option proc */ NULL,
815 /* desc, NAME, name */ X509DSAKEYFILE_DESC, X509DSAKEYFILE_NAME, X509DSAKEYFILE_name,
816 /* disablement strs */ NULL, NULL },
818 { /* entry idx, value */ 23, VALUE_OPT_X509DSACERTFILE,
819 /* equiv idx, value */ 23, VALUE_OPT_X509DSACERTFILE,
820 /* equivalenced to */ NO_EQUIVALENT,
821 /* min, max, act ct */ 0, 1, 0,
822 /* opt state flags */ X509DSACERTFILE_FLAGS, 0,
823 /* last opt argumnt */ { NULL }, /* --x509dsacertfile */
824 /* arg list/cookie */ NULL,
825 /* must/cannot opts */ NULL, NULL,
826 /* option proc */ NULL,
827 /* desc, NAME, name */ X509DSACERTFILE_DESC, X509DSACERTFILE_NAME, X509DSACERTFILE_name,
828 /* disablement strs */ NULL, NULL },
830 { /* entry idx, value */ 24, VALUE_OPT_X509ECCKEYFILE,
831 /* equiv idx, value */ 24, VALUE_OPT_X509ECCKEYFILE,
832 /* equivalenced to */ NO_EQUIVALENT,
833 /* min, max, act ct */ 0, 1, 0,
834 /* opt state flags */ X509ECCKEYFILE_FLAGS, 0,
835 /* last opt argumnt */ { NULL }, /* --x509ecckeyfile */
836 /* arg list/cookie */ NULL,
837 /* must/cannot opts */ NULL, NULL,
838 /* option proc */ NULL,
839 /* desc, NAME, name */ X509ECCKEYFILE_DESC, X509ECCKEYFILE_NAME, X509ECCKEYFILE_name,
840 /* disablement strs */ NULL, NULL },
842 { /* entry idx, value */ 25, VALUE_OPT_X509ECCCERTFILE,
843 /* equiv idx, value */ 25, VALUE_OPT_X509ECCCERTFILE,
844 /* equivalenced to */ NO_EQUIVALENT,
845 /* min, max, act ct */ 0, 1, 0,
846 /* opt state flags */ X509ECCCERTFILE_FLAGS, 0,
847 /* last opt argumnt */ { NULL }, /* --x509ecccertfile */
848 /* arg list/cookie */ NULL,
849 /* must/cannot opts */ NULL, NULL,
850 /* option proc */ NULL,
851 /* desc, NAME, name */ X509ECCCERTFILE_DESC, X509ECCCERTFILE_NAME, X509ECCCERTFILE_name,
852 /* disablement strs */ NULL, NULL },
854 { /* entry idx, value */ 26, VALUE_OPT_PGPSUBKEY,
855 /* equiv idx, value */ 26, VALUE_OPT_PGPSUBKEY,
856 /* equivalenced to */ NO_EQUIVALENT,
857 /* min, max, act ct */ 0, 1, 0,
858 /* opt state flags */ PGPSUBKEY_FLAGS, 0,
859 /* last opt argumnt */ { NULL }, /* --pgpsubkey */
860 /* arg list/cookie */ NULL,
861 /* must/cannot opts */ NULL, NULL,
862 /* option proc */ NULL,
863 /* desc, NAME, name */ PGPSUBKEY_DESC, PGPSUBKEY_NAME, PGPSUBKEY_name,
864 /* disablement strs */ NULL, NULL },
866 { /* entry idx, value */ 27, VALUE_OPT_SRPPASSWD,
867 /* equiv idx, value */ 27, VALUE_OPT_SRPPASSWD,
868 /* equivalenced to */ NO_EQUIVALENT,
869 /* min, max, act ct */ 0, 1, 0,
870 /* opt state flags */ SRPPASSWD_FLAGS, 0,
871 /* last opt argumnt */ { NULL }, /* --srppasswd */
872 /* arg list/cookie */ NULL,
873 /* must/cannot opts */ NULL, NULL,
874 /* option proc */ doOptSrppasswd,
875 /* desc, NAME, name */ SRPPASSWD_DESC, SRPPASSWD_NAME, SRPPASSWD_name,
876 /* disablement strs */ NULL, NULL },
878 { /* entry idx, value */ 28, VALUE_OPT_SRPPASSWDCONF,
879 /* equiv idx, value */ 28, VALUE_OPT_SRPPASSWDCONF,
880 /* equivalenced to */ NO_EQUIVALENT,
881 /* min, max, act ct */ 0, 1, 0,
882 /* opt state flags */ SRPPASSWDCONF_FLAGS, 0,
883 /* last opt argumnt */ { NULL }, /* --srppasswdconf */
884 /* arg list/cookie */ NULL,
885 /* must/cannot opts */ NULL, NULL,
886 /* option proc */ doOptSrppasswdconf,
887 /* desc, NAME, name */ SRPPASSWDCONF_DESC, SRPPASSWDCONF_NAME, SRPPASSWDCONF_name,
888 /* disablement strs */ NULL, NULL },
890 { /* entry idx, value */ 29, VALUE_OPT_PSKPASSWD,
891 /* equiv idx, value */ 29, VALUE_OPT_PSKPASSWD,
892 /* equivalenced to */ NO_EQUIVALENT,
893 /* min, max, act ct */ 0, 1, 0,
894 /* opt state flags */ PSKPASSWD_FLAGS, 0,
895 /* last opt argumnt */ { NULL }, /* --pskpasswd */
896 /* arg list/cookie */ NULL,
897 /* must/cannot opts */ NULL, NULL,
898 /* option proc */ doOptPskpasswd,
899 /* desc, NAME, name */ PSKPASSWD_DESC, PSKPASSWD_NAME, PSKPASSWD_name,
900 /* disablement strs */ NULL, NULL },
902 { /* entry idx, value */ 30, VALUE_OPT_PSKHINT,
903 /* equiv idx, value */ 30, VALUE_OPT_PSKHINT,
904 /* equivalenced to */ NO_EQUIVALENT,
905 /* min, max, act ct */ 0, 1, 0,
906 /* opt state flags */ PSKHINT_FLAGS, 0,
907 /* last opt argumnt */ { NULL }, /* --pskhint */
908 /* arg list/cookie */ NULL,
909 /* must/cannot opts */ NULL, NULL,
910 /* option proc */ NULL,
911 /* desc, NAME, name */ PSKHINT_DESC, PSKHINT_NAME, PSKHINT_name,
912 /* disablement strs */ NULL, NULL },
914 { /* entry idx, value */ 31, VALUE_OPT_OCSP_RESPONSE,
915 /* equiv idx, value */ 31, VALUE_OPT_OCSP_RESPONSE,
916 /* equivalenced to */ NO_EQUIVALENT,
917 /* min, max, act ct */ 0, 1, 0,
918 /* opt state flags */ OCSP_RESPONSE_FLAGS, 0,
919 /* last opt argumnt */ { NULL }, /* --ocsp-response */
920 /* arg list/cookie */ NULL,
921 /* must/cannot opts */ NULL, NULL,
922 /* option proc */ doOptOcsp_Response,
923 /* desc, NAME, name */ OCSP_RESPONSE_DESC, OCSP_RESPONSE_NAME, OCSP_RESPONSE_name,
924 /* disablement strs */ NULL, NULL },
926 { /* entry idx, value */ 32, VALUE_OPT_PORT,
927 /* equiv idx, value */ 32, VALUE_OPT_PORT,
928 /* equivalenced to */ NO_EQUIVALENT,
929 /* min, max, act ct */ 0, 1, 0,
930 /* opt state flags */ PORT_FLAGS, 0,
931 /* last opt argumnt */ { NULL }, /* --port */
932 /* arg list/cookie */ NULL,
933 /* must/cannot opts */ NULL, NULL,
934 /* option proc */ optionNumericVal,
935 /* desc, NAME, name */ PORT_DESC, PORT_NAME, PORT_name,
936 /* disablement strs */ NULL, NULL },
938 { /* entry idx, value */ 33, VALUE_OPT_LIST,
939 /* equiv idx, value */ 33, VALUE_OPT_LIST,
940 /* equivalenced to */ NO_EQUIVALENT,
941 /* min, max, act ct */ 0, 1, 0,
942 /* opt state flags */ LIST_FLAGS, 0,
943 /* last opt argumnt */ { NULL }, /* --list */
944 /* arg list/cookie */ NULL,
945 /* must/cannot opts */ NULL, NULL,
946 /* option proc */ NULL,
947 /* desc, NAME, name */ LIST_DESC, LIST_NAME, LIST_name,
948 /* disablement strs */ NULL, NULL },
950 { /* entry idx, value */ INDEX_OPT_VERSION, VALUE_OPT_VERSION,
951 /* equiv idx value */ NO_EQUIVALENT, VALUE_OPT_VERSION,
952 /* equivalenced to */ NO_EQUIVALENT,
953 /* min, max, act ct */ 0, 1, 0,
954 /* opt state flags */ VER_FLAGS, 0,
955 /* last opt argumnt */ { NULL },
956 /* arg list/cookie */ NULL,
957 /* must/cannot opts */ NULL, NULL,
958 /* option proc */ VER_PROC,
959 /* desc, NAME, name */ VER_DESC, NULL, VER_name,
960 /* disablement strs */ NULL, NULL },
964 { /* entry idx, value */ INDEX_OPT_HELP, VALUE_OPT_HELP,
965 /* equiv idx value */ NO_EQUIVALENT, VALUE_OPT_HELP,
966 /* equivalenced to */ NO_EQUIVALENT,
967 /* min, max, act ct */ 0, 1, 0,
968 /* opt state flags */ OPTST_IMM | OPTST_NO_INIT, 0,
969 /* last opt argumnt */ { NULL },
970 /* arg list/cookie */ NULL,
971 /* must/cannot opts */ NULL, NULL,
972 /* option proc */ doUsageOpt,
973 /* desc, NAME, name */ HELP_DESC, NULL, HELP_name,
974 /* disablement strs */ NULL, NULL },
976 { /* entry idx, value */ INDEX_OPT_MORE_HELP, VALUE_OPT_MORE_HELP,
977 /* equiv idx value */ NO_EQUIVALENT, VALUE_OPT_MORE_HELP,
978 /* equivalenced to */ NO_EQUIVALENT,
979 /* min, max, act ct */ 0, 1, 0,
980 /* opt state flags */ MORE_HELP_FLAGS, 0,
981 /* last opt argumnt */ { NULL },
982 /* arg list/cookie */ NULL,
983 /* must/cannot opts */ NULL, NULL,
984 /* option proc */ optionPagedUsage,
985 /* desc, NAME, name */ MORE_HELP_DESC, NULL, MORE_HELP_name,
986 /* disablement strs */ NULL, NULL }
990 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
992 * Define the gnutls-serv Option Environment
994 #define zPROGNAME (gnutls_serv_opt_strs+2767)
995 #define zUsageTitle (gnutls_serv_opt_strs+2779)
996 #define zRcName NULL
997 #define apzHomeList NULL
998 #define zBugsAddr (gnutls_serv_opt_strs+2882)
999 #define zExplain (gnutls_serv_opt_strs+2901)
1000 #define zDetail (gnutls_serv_opt_strs+2904)
1001 #define zFullVersion (gnutls_serv_opt_strs+2963)
1002 /* extracted from optcode.tlib near line 350 */
1004 #if defined(ENABLE_NLS)
1005 # define OPTPROC_BASE OPTPROC_TRANSLATE | OPTPROC_NXLAT_OPT
1006 static tOptionXlateProc translate_option_strings;
1007 #else
1008 # define OPTPROC_BASE OPTPROC_NONE
1009 # define translate_option_strings NULL
1010 #endif /* ENABLE_NLS */
1013 #define gnutls_serv_full_usage (NULL)
1015 #define gnutls_serv_short_usage (gnutls_serv_opt_strs+2985)
1017 #endif /* not defined __doxygen__ */
1020 * Create the static procedure(s) declared above.
1023 * The callout function that invokes the optionUsage function.
1025 * @param pOptions the AutoOpts option description structure
1026 * @param pOptDesc the descriptor for the "help" (usage) option.
1027 * @noreturn
1029 static void
1030 doUsageOpt(tOptions * pOptions, tOptDesc * pOptDesc)
1032 optionUsage(&gnutls_servOptions, GNUTLS_SERV_EXIT_SUCCESS);
1033 /* NOTREACHED */
1034 (void)pOptDesc;
1035 (void)pOptions;
1038 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
1040 * Code to handle the debug option.
1042 * @param pOptions the gnutls-serv options data structure
1043 * @param pOptDesc the option descriptor for this option.
1045 static void
1046 doOptDebug(tOptions* pOptions, tOptDesc* pOptDesc)
1048 static struct {long rmin, rmax;} const rng[1] = {
1049 { 0 , 9999 } };
1050 int ix;
1052 if (pOptions <= OPTPROC_EMIT_LIMIT)
1053 goto emit_ranges;
1054 optionNumericVal(pOptions, pOptDesc);
1056 for (ix = 0; ix < 1; ix++) {
1057 if (pOptDesc->optArg.argInt < rng[ix].rmin)
1058 continue; /* ranges need not be ordered. */
1059 if (pOptDesc->optArg.argInt == rng[ix].rmin)
1060 return;
1061 if (rng[ix].rmax == LONG_MIN)
1062 continue;
1063 if (pOptDesc->optArg.argInt <= rng[ix].rmax)
1064 return;
1067 option_usage_fp = stderr;
1069 emit_ranges:
1071 optionShowRange(pOptions, pOptDesc, (void *)rng, 1);
1074 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
1076 * Code to handle the mtu option.
1078 * @param pOptions the gnutls-serv options data structure
1079 * @param pOptDesc the option descriptor for this option.
1081 static void
1082 doOptMtu(tOptions* pOptions, tOptDesc* pOptDesc)
1084 static struct {long rmin, rmax;} const rng[1] = {
1085 { 0, 17000 } };
1086 int ix;
1088 if (pOptions <= OPTPROC_EMIT_LIMIT)
1089 goto emit_ranges;
1090 optionNumericVal(pOptions, pOptDesc);
1092 for (ix = 0; ix < 1; ix++) {
1093 if (pOptDesc->optArg.argInt < rng[ix].rmin)
1094 continue; /* ranges need not be ordered. */
1095 if (pOptDesc->optArg.argInt == rng[ix].rmin)
1096 return;
1097 if (rng[ix].rmax == LONG_MIN)
1098 continue;
1099 if (pOptDesc->optArg.argInt <= rng[ix].rmax)
1100 return;
1103 option_usage_fp = stderr;
1105 emit_ranges:
1107 optionShowRange(pOptions, pOptDesc, (void *)rng, 1);
1110 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
1112 * Code to handle the dhparams option.
1114 * @param pOptions the gnutls-serv options data structure
1115 * @param pOptDesc the option descriptor for this option.
1117 static void
1118 doOptDhparams(tOptions* pOptions, tOptDesc* pOptDesc)
1120 static teOptFileType const type =
1121 FTYPE_MODE_MUST_EXIST + FTYPE_MODE_NO_OPEN;
1122 static tuFileMode mode;
1123 #ifndef O_CLOEXEC
1124 # define O_CLOEXEC 0
1125 #endif
1126 mode.file_flags = O_CLOEXEC;
1128 optionFileCheck(pOptions, pOptDesc, type, mode);
1131 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
1133 * Code to handle the x509crlfile option.
1135 * @param pOptions the gnutls-serv options data structure
1136 * @param pOptDesc the option descriptor for this option.
1138 static void
1139 doOptX509crlfile(tOptions* pOptions, tOptDesc* pOptDesc)
1141 static teOptFileType const type =
1142 FTYPE_MODE_MUST_EXIST + FTYPE_MODE_NO_OPEN;
1143 static tuFileMode mode;
1144 #ifndef O_CLOEXEC
1145 # define O_CLOEXEC 0
1146 #endif
1147 mode.file_flags = O_CLOEXEC;
1149 optionFileCheck(pOptions, pOptDesc, type, mode);
1152 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
1154 * Code to handle the pgpkeyfile option.
1156 * @param pOptions the gnutls-serv options data structure
1157 * @param pOptDesc the option descriptor for this option.
1159 static void
1160 doOptPgpkeyfile(tOptions* pOptions, tOptDesc* pOptDesc)
1162 static teOptFileType const type =
1163 FTYPE_MODE_MUST_EXIST + FTYPE_MODE_NO_OPEN;
1164 static tuFileMode mode;
1165 #ifndef O_CLOEXEC
1166 # define O_CLOEXEC 0
1167 #endif
1168 mode.file_flags = O_CLOEXEC;
1170 optionFileCheck(pOptions, pOptDesc, type, mode);
1173 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
1175 * Code to handle the pgpkeyring option.
1177 * @param pOptions the gnutls-serv options data structure
1178 * @param pOptDesc the option descriptor for this option.
1180 static void
1181 doOptPgpkeyring(tOptions* pOptions, tOptDesc* pOptDesc)
1183 static teOptFileType const type =
1184 FTYPE_MODE_MUST_EXIST + FTYPE_MODE_NO_OPEN;
1185 static tuFileMode mode;
1186 #ifndef O_CLOEXEC
1187 # define O_CLOEXEC 0
1188 #endif
1189 mode.file_flags = O_CLOEXEC;
1191 optionFileCheck(pOptions, pOptDesc, type, mode);
1194 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
1196 * Code to handle the pgpcertfile option.
1198 * @param pOptions the gnutls-serv options data structure
1199 * @param pOptDesc the option descriptor for this option.
1201 static void
1202 doOptPgpcertfile(tOptions* pOptions, tOptDesc* pOptDesc)
1204 static teOptFileType const type =
1205 FTYPE_MODE_MUST_EXIST + FTYPE_MODE_NO_OPEN;
1206 static tuFileMode mode;
1207 #ifndef O_CLOEXEC
1208 # define O_CLOEXEC 0
1209 #endif
1210 mode.file_flags = O_CLOEXEC;
1212 optionFileCheck(pOptions, pOptDesc, type, mode);
1215 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
1217 * Code to handle the srppasswd option.
1219 * @param pOptions the gnutls-serv options data structure
1220 * @param pOptDesc the option descriptor for this option.
1222 static void
1223 doOptSrppasswd(tOptions* pOptions, tOptDesc* pOptDesc)
1225 static teOptFileType const type =
1226 FTYPE_MODE_MUST_EXIST + FTYPE_MODE_NO_OPEN;
1227 static tuFileMode mode;
1228 #ifndef O_CLOEXEC
1229 # define O_CLOEXEC 0
1230 #endif
1231 mode.file_flags = O_CLOEXEC;
1233 optionFileCheck(pOptions, pOptDesc, type, mode);
1236 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
1238 * Code to handle the srppasswdconf option.
1240 * @param pOptions the gnutls-serv options data structure
1241 * @param pOptDesc the option descriptor for this option.
1243 static void
1244 doOptSrppasswdconf(tOptions* pOptions, tOptDesc* pOptDesc)
1246 static teOptFileType const type =
1247 FTYPE_MODE_MUST_EXIST + FTYPE_MODE_NO_OPEN;
1248 static tuFileMode mode;
1249 #ifndef O_CLOEXEC
1250 # define O_CLOEXEC 0
1251 #endif
1252 mode.file_flags = O_CLOEXEC;
1254 optionFileCheck(pOptions, pOptDesc, type, mode);
1257 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
1259 * Code to handle the pskpasswd option.
1261 * @param pOptions the gnutls-serv options data structure
1262 * @param pOptDesc the option descriptor for this option.
1264 static void
1265 doOptPskpasswd(tOptions* pOptions, tOptDesc* pOptDesc)
1267 static teOptFileType const type =
1268 FTYPE_MODE_MUST_EXIST + FTYPE_MODE_NO_OPEN;
1269 static tuFileMode mode;
1270 #ifndef O_CLOEXEC
1271 # define O_CLOEXEC 0
1272 #endif
1273 mode.file_flags = O_CLOEXEC;
1275 optionFileCheck(pOptions, pOptDesc, type, mode);
1278 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
1280 * Code to handle the ocsp-response option.
1282 * @param pOptions the gnutls-serv options data structure
1283 * @param pOptDesc the option descriptor for this option.
1285 static void
1286 doOptOcsp_Response(tOptions* pOptions, tOptDesc* pOptDesc)
1288 static teOptFileType const type =
1289 FTYPE_MODE_MUST_EXIST + FTYPE_MODE_NO_OPEN;
1290 static tuFileMode mode;
1291 #ifndef O_CLOEXEC
1292 # define O_CLOEXEC 0
1293 #endif
1294 mode.file_flags = O_CLOEXEC;
1296 optionFileCheck(pOptions, pOptDesc, type, mode);
1298 /* extracted from optmain.tlib near line 1113 */
1301 * The directory containing the data associated with gnutls-serv.
1303 #ifndef PKGDATADIR
1304 # define PKGDATADIR ""
1305 #endif
1308 * Information about the person or institution that packaged gnutls-serv
1309 * for the current distribution.
1311 #ifndef WITH_PACKAGER
1312 # define gnutls_serv_packager_info NULL
1313 #else
1314 static char const gnutls_serv_packager_info[] =
1315 "Packaged by " WITH_PACKAGER
1317 # ifdef WITH_PACKAGER_VERSION
1318 " ("WITH_PACKAGER_VERSION")"
1319 # endif
1321 # ifdef WITH_PACKAGER_BUG_REPORTS
1322 "\nReport gnutls_serv bugs to " WITH_PACKAGER_BUG_REPORTS
1323 # endif
1324 "\n";
1325 #endif
1326 #ifndef __doxygen__
1328 #endif /* __doxygen__ */
1330 * The option definitions for gnutls-serv. The one structure that
1331 * binds them all.
1333 tOptions gnutls_servOptions = {
1334 OPTIONS_STRUCT_VERSION,
1335 0, NULL, /* original argc + argv */
1336 ( OPTPROC_BASE
1337 + OPTPROC_ERRSTOP
1338 + OPTPROC_SHORTOPT
1339 + OPTPROC_LONGOPT
1340 + OPTPROC_NO_REQ_OPT
1341 + OPTPROC_NO_ARGS
1342 + OPTPROC_GNUUSAGE
1343 + OPTPROC_MISUSE ),
1344 0, NULL, /* current option index, current option */
1345 NULL, NULL, zPROGNAME,
1346 zRcName, zCopyright, zLicenseDescrip,
1347 zFullVersion, apzHomeList, zUsageTitle,
1348 zExplain, zDetail, optDesc,
1349 zBugsAddr, /* address to send bugs to */
1350 NULL, NULL, /* extensions/saved state */
1351 optionUsage, /* usage procedure */
1352 translate_option_strings, /* translation procedure */
1354 * Indexes to special options
1356 { INDEX_OPT_MORE_HELP, /* more-help option index */
1357 NO_EQUIVALENT, /* save option index */
1358 NO_EQUIVALENT, /* '-#' option index */
1359 NO_EQUIVALENT /* index of default opt */
1361 37 /* full option count */, 34 /* user option count */,
1362 gnutls_serv_full_usage, gnutls_serv_short_usage,
1363 NULL, NULL,
1364 PKGDATADIR, gnutls_serv_packager_info
1367 #if ENABLE_NLS
1368 #include <stdio.h>
1369 #include <stdlib.h>
1370 #include <string.h>
1371 #include <unistd.h>
1372 #include <autoopts/usage-txt.h>
1374 static char* AO_gettext(char const* pz);
1375 static void coerce_it(void** s);
1378 * AutoGen specific wrapper function for gettext.
1379 * It relies on the macro _() to convert from English to the target
1380 * language, then strdup-duplicates the result string.
1382 * @param[in] pz the input text used as a lookup key.
1383 * @returns the translated text (if there is one),
1384 * or the original text (if not).
1386 static char *
1387 AO_gettext(char const* pz)
1389 char* pzRes;
1390 if (pz == NULL)
1391 return NULL;
1392 pzRes = _(pz);
1393 if (pzRes == pz)
1394 return pzRes;
1395 pzRes = strdup(pzRes);
1396 if (pzRes == NULL) {
1397 fputs(_("No memory for duping translated strings\n"), stderr);
1398 exit(GNUTLS_SERV_EXIT_FAILURE);
1400 return pzRes;
1403 static void coerce_it(void** s) { *s = AO_gettext(*s);
1407 * Translate all the translatable strings in the gnutls_servOptions
1408 * structure defined above. This is done only once.
1410 static void
1411 translate_option_strings(void)
1413 tOptions * const pOpt = &gnutls_servOptions;
1416 * Guard against re-translation. It won't work. The strings will have
1417 * been changed by the first pass through this code. One shot only.
1419 if (option_usage_text.field_ct != 0) {
1421 * Do the translations. The first pointer follows the field count
1422 * field. The field count field is the size of a pointer.
1424 tOptDesc * pOD = pOpt->pOptDesc;
1425 char ** ppz = (char**)(void*)&(option_usage_text);
1426 int ix = option_usage_text.field_ct;
1428 do {
1429 ppz++;
1430 *ppz = AO_gettext(*ppz);
1431 } while (--ix > 0);
1433 coerce_it((void*)&(pOpt->pzCopyright));
1434 coerce_it((void*)&(pOpt->pzCopyNotice));
1435 coerce_it((void*)&(pOpt->pzFullVersion));
1436 coerce_it((void*)&(pOpt->pzUsageTitle));
1437 coerce_it((void*)&(pOpt->pzExplain));
1438 coerce_it((void*)&(pOpt->pzDetail));
1439 coerce_it((void*)&(pOpt->pzPackager));
1440 coerce_it((void*)&(pOpt->pzShortUsage));
1441 option_usage_text.field_ct = 0;
1443 for (ix = pOpt->optCt; ix > 0; ix--, pOD++)
1444 coerce_it((void*)&(pOD->pzText));
1447 if ((pOpt->fOptSet & OPTPROC_NXLAT_OPT_CFG) == 0) {
1448 tOptDesc * pOD = pOpt->pOptDesc;
1449 int ix;
1451 for (ix = pOpt->optCt; ix > 0; ix--, pOD++) {
1452 coerce_it((void*)&(pOD->pz_Name));
1453 coerce_it((void*)&(pOD->pz_DisableName));
1454 coerce_it((void*)&(pOD->pz_DisablePfx));
1456 /* prevent re-translation */
1457 gnutls_servOptions.fOptSet |= OPTPROC_NXLAT_OPT_CFG | OPTPROC_NXLAT_OPT;
1461 #endif /* ENABLE_NLS */
1463 #ifdef __cplusplus
1465 #endif
1466 /* serv-args.c ends here */