benchmark time was increased.
[gnutls.git] / src / cli-args.c
blobb4f05015da94ee2f7839d94cd5ebf71bc3d1cabd
1 /* -*- buffer-read-only: t -*- vi: set ro:
2 *
3 * DO NOT EDIT THIS FILE (cli-args.c)
4 *
5 * It has been AutoGen-ed August 30, 2012 at 09:58:04 PM by AutoGen 5.16
6 * From the definitions cli-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-cli 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-cli 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-cli 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-cli 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 "cli-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_cli_opt_strs+0)
60 #define zLicenseDescrip (gnutls_cli_opt_strs+281)
63 #ifndef NULL
64 # define NULL 0
65 #endif
68 * gnutls-cli option static const strings
70 static char const gnutls_cli_opt_strs[3538] =
71 /* 0 */ "gnutls-cli @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 /* 281 */ "gnutls-cli is free software: you can redistribute it and/or modify it under\n"
78 "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-cli 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 /* 890 */ "Enable debugging.\0"
88 /* 908 */ "DEBUG\0"
89 /* 914 */ "debug\0"
90 /* 920 */ "More verbose output\0"
91 /* 940 */ "VERBOSE\0"
92 /* 948 */ "verbose\0"
93 /* 956 */ "Enable trust on first use authentication\0"
94 /* 997 */ "TOFU\0"
95 /* 1002 */ "no-tofu\0"
96 /* 1010 */ "no\0"
97 /* 1013 */ "Enable OCSP certificate verification\0"
98 /* 1050 */ "OCSP\0"
99 /* 1055 */ "no-ocsp\0"
100 /* 1063 */ "Establish a session and resume\0"
101 /* 1094 */ "RESUME\0"
102 /* 1101 */ "resume\0"
103 /* 1108 */ "Activate heartbeat support\0"
104 /* 1135 */ "HEARTBEAT\0"
105 /* 1145 */ "heartbeat\0"
106 /* 1155 */ "Establish a session and rehandshake\0"
107 /* 1191 */ "REHANDSHAKE\0"
108 /* 1203 */ "rehandshake\0"
109 /* 1215 */ "Don't accept session tickets\0"
110 /* 1244 */ "NOTICKET\0"
111 /* 1253 */ "noticket\0"
112 /* 1262 */ "Connect, establish a plain session and start TLS.\0"
113 /* 1312 */ "STARTTLS\0"
114 /* 1321 */ "starttls\0"
115 /* 1330 */ "Use DTLS (datagram TLS) over UDP\0"
116 /* 1363 */ "UDP\0"
117 /* 1367 */ "udp\0"
118 /* 1371 */ "Set MTU for datagram TLS\0"
119 /* 1396 */ "MTU\0"
120 /* 1400 */ "mtu\0"
121 /* 1404 */ "Send CR LF instead of LF\0"
122 /* 1429 */ "CRLF\0"
123 /* 1434 */ "crlf\0"
124 /* 1439 */ "Use DER format for certificates to read from\0"
125 /* 1484 */ "X509FMTDER\0"
126 /* 1495 */ "x509fmtder\0"
127 /* 1506 */ "Send the openpgp fingerprint, instead of the key\0"
128 /* 1555 */ "FINGERPRINT\0"
129 /* 1567 */ "fingerprint\0"
130 /* 1579 */ "Disable all the TLS extensions\0"
131 /* 1610 */ "DISABLE_EXTENSIONS\0"
132 /* 1629 */ "disable-extensions\0"
133 /* 1648 */ "Print peer's certificate in PEM format\0"
134 /* 1687 */ "PRINT_CERT\0"
135 /* 1698 */ "print-cert\0"
136 /* 1709 */ "The maximum record size to advertize\0"
137 /* 1746 */ "RECORDSIZE\0"
138 /* 1757 */ "recordsize\0"
139 /* 1768 */ "The minimum number of bits allowed for DH\0"
140 /* 1810 */ "DH_BITS\0"
141 /* 1818 */ "dh-bits\0"
142 /* 1826 */ "Priorities string\0"
143 /* 1844 */ "PRIORITY\0"
144 /* 1853 */ "priority\0"
145 /* 1862 */ "Certificate file or PKCS #11 URL to use\0"
146 /* 1902 */ "X509CAFILE\0"
147 /* 1913 */ "x509cafile\0"
148 /* 1924 */ "CRL file to use\0"
149 /* 1940 */ "X509CRLFILE\0"
150 /* 1952 */ "x509crlfile\0"
151 /* 1964 */ "PGP Key file to use\0"
152 /* 1984 */ "PGPKEYFILE\0"
153 /* 1995 */ "pgpkeyfile\0"
154 /* 2006 */ "PGP Key ring file to use\0"
155 /* 2031 */ "PGPKEYRING\0"
156 /* 2042 */ "pgpkeyring\0"
157 /* 2053 */ "PGP Public Key (certificate) file to use\0"
158 /* 2094 */ "PGPCERTFILE\0"
159 /* 2106 */ "pgpcertfile\0"
160 /* 2118 */ "X.509 key file or PKCS #11 URL to use\0"
161 /* 2156 */ "X509KEYFILE\0"
162 /* 2168 */ "x509keyfile\0"
163 /* 2180 */ "X.509 Certificate file or PKCS #11 URL to use\0"
164 /* 2226 */ "X509CERTFILE\0"
165 /* 2239 */ "x509certfile\0"
166 /* 2252 */ "PGP subkey to use (hex or auto)\0"
167 /* 2284 */ "PGPSUBKEY\0"
168 /* 2294 */ "pgpsubkey\0"
169 /* 2304 */ "SRP username to use\0"
170 /* 2324 */ "SRPUSERNAME\0"
171 /* 2336 */ "srpusername\0"
172 /* 2348 */ "SRP password to use\0"
173 /* 2368 */ "SRPPASSWD\0"
174 /* 2378 */ "srppasswd\0"
175 /* 2388 */ "PSK username to use\0"
176 /* 2408 */ "PSKUSERNAME\0"
177 /* 2420 */ "pskusername\0"
178 /* 2432 */ "PSK key (in hex) to use\0"
179 /* 2456 */ "PSKKEY\0"
180 /* 2463 */ "pskkey\0"
181 /* 2470 */ "The port or service to connect to\0"
182 /* 2504 */ "PORT\0"
183 /* 2509 */ "port\0"
184 /* 2514 */ "Don't abort program if server certificate can't be validated\0"
185 /* 2575 */ "INSECURE\0"
186 /* 2584 */ "insecure\0"
187 /* 2593 */ "Benchmark individual ciphers\0"
188 /* 2622 */ "BENCHMARK_CIPHERS\0"
189 /* 2640 */ "benchmark-ciphers\0"
190 /* 2658 */ "Benchmark individual software ciphers (no hw acceleration)\0"
191 /* 2717 */ "BENCHMARK_SOFT_CIPHERS\0"
192 /* 2740 */ "benchmark-soft-ciphers\0"
193 /* 2763 */ "Benchmark TLS key exchange methods\0"
194 /* 2798 */ "BENCHMARK_TLS_KX\0"
195 /* 2815 */ "benchmark-tls-kx\0"
196 /* 2832 */ "Benchmark TLS ciphers\0"
197 /* 2854 */ "BENCHMARK_TLS_CIPHERS\0"
198 /* 2876 */ "benchmark-tls-ciphers\0"
199 /* 2898 */ "Print a list of the supported algorithms and modes\0"
200 /* 2949 */ "LIST\0"
201 /* 2954 */ "list\0"
202 /* 2959 */ "Display extended usage information and exit\0"
203 /* 3003 */ "help\0"
204 /* 3008 */ "Extended usage information passed thru pager\0"
205 /* 3053 */ "more-help\0"
206 /* 3063 */ "Output version information and exit\0"
207 /* 3099 */ "version\0"
208 /* 3107 */ "GNUTLS_CLI\0"
209 /* 3118 */ "gnutls-cli - GnuTLS client - Ver. @VERSION@\n"
210 "USAGE: %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]... [hostname]\n\0"
211 /* 3231 */ "bug-gnutls@gnu.org\0"
212 /* 3250 */ "\n\n\0"
213 /* 3253 */ "\n"
214 "Simple client program to set up a TLS connection to some other computer. It\n"
215 "sets up a TLS connection and forwards data from the standard input to the\n"
216 "secured socket and vice versa.\n\0"
217 /* 3437 */ "gnutls-cli @VERSION@\0"
218 /* 3458 */ "Usage: gnutls-cli [options] hostname\n"
219 "gnutls-cli --help for usage instructions.\n";
222 * debug option description:
224 #define DEBUG_DESC (gnutls_cli_opt_strs+890)
225 #define DEBUG_NAME (gnutls_cli_opt_strs+908)
226 #define DEBUG_name (gnutls_cli_opt_strs+914)
227 #define DEBUG_FLAGS (OPTST_DISABLED \
228 | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC))
231 * verbose option description:
233 #define VERBOSE_DESC (gnutls_cli_opt_strs+920)
234 #define VERBOSE_NAME (gnutls_cli_opt_strs+940)
235 #define VERBOSE_name (gnutls_cli_opt_strs+948)
236 #define VERBOSE_FLAGS (OPTST_DISABLED)
239 * tofu option description:
241 #define TOFU_DESC (gnutls_cli_opt_strs+956)
242 #define TOFU_NAME (gnutls_cli_opt_strs+997)
243 #define NOT_TOFU_name (gnutls_cli_opt_strs+1002)
244 #define NOT_TOFU_PFX (gnutls_cli_opt_strs+1010)
245 #define TOFU_name (NOT_TOFU_name + 3)
246 #define TOFU_FLAGS (OPTST_DISABLED)
249 * ocsp option description:
251 #define OCSP_DESC (gnutls_cli_opt_strs+1013)
252 #define OCSP_NAME (gnutls_cli_opt_strs+1050)
253 #define NOT_OCSP_name (gnutls_cli_opt_strs+1055)
254 #define NOT_OCSP_PFX (gnutls_cli_opt_strs+1010)
255 #define OCSP_name (NOT_OCSP_name + 3)
256 #define OCSP_FLAGS (OPTST_DISABLED)
259 * resume option description:
261 #define RESUME_DESC (gnutls_cli_opt_strs+1063)
262 #define RESUME_NAME (gnutls_cli_opt_strs+1094)
263 #define RESUME_name (gnutls_cli_opt_strs+1101)
264 #define RESUME_FLAGS (OPTST_DISABLED)
267 * heartbeat option description:
269 #define HEARTBEAT_DESC (gnutls_cli_opt_strs+1108)
270 #define HEARTBEAT_NAME (gnutls_cli_opt_strs+1135)
271 #define HEARTBEAT_name (gnutls_cli_opt_strs+1145)
272 #define HEARTBEAT_FLAGS (OPTST_DISABLED)
275 * rehandshake option description:
277 #define REHANDSHAKE_DESC (gnutls_cli_opt_strs+1155)
278 #define REHANDSHAKE_NAME (gnutls_cli_opt_strs+1191)
279 #define REHANDSHAKE_name (gnutls_cli_opt_strs+1203)
280 #define REHANDSHAKE_FLAGS (OPTST_DISABLED)
283 * noticket option description:
285 #define NOTICKET_DESC (gnutls_cli_opt_strs+1215)
286 #define NOTICKET_NAME (gnutls_cli_opt_strs+1244)
287 #define NOTICKET_name (gnutls_cli_opt_strs+1253)
288 #define NOTICKET_FLAGS (OPTST_DISABLED)
291 * starttls option description:
293 #define STARTTLS_DESC (gnutls_cli_opt_strs+1262)
294 #define STARTTLS_NAME (gnutls_cli_opt_strs+1312)
295 #define STARTTLS_name (gnutls_cli_opt_strs+1321)
296 #define STARTTLS_FLAGS (OPTST_DISABLED)
299 * udp option description:
301 #define UDP_DESC (gnutls_cli_opt_strs+1330)
302 #define UDP_NAME (gnutls_cli_opt_strs+1363)
303 #define UDP_name (gnutls_cli_opt_strs+1367)
304 #define UDP_FLAGS (OPTST_DISABLED)
307 * mtu option description:
309 #define MTU_DESC (gnutls_cli_opt_strs+1371)
310 #define MTU_NAME (gnutls_cli_opt_strs+1396)
311 #define MTU_name (gnutls_cli_opt_strs+1400)
312 #define MTU_FLAGS (OPTST_DISABLED \
313 | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC))
316 * crlf option description:
318 #define CRLF_DESC (gnutls_cli_opt_strs+1404)
319 #define CRLF_NAME (gnutls_cli_opt_strs+1429)
320 #define CRLF_name (gnutls_cli_opt_strs+1434)
321 #define CRLF_FLAGS (OPTST_DISABLED)
324 * x509fmtder option description:
326 #define X509FMTDER_DESC (gnutls_cli_opt_strs+1439)
327 #define X509FMTDER_NAME (gnutls_cli_opt_strs+1484)
328 #define X509FMTDER_name (gnutls_cli_opt_strs+1495)
329 #define X509FMTDER_FLAGS (OPTST_DISABLED)
332 * fingerprint option description:
334 #define FINGERPRINT_DESC (gnutls_cli_opt_strs+1506)
335 #define FINGERPRINT_NAME (gnutls_cli_opt_strs+1555)
336 #define FINGERPRINT_name (gnutls_cli_opt_strs+1567)
337 #define FINGERPRINT_FLAGS (OPTST_DISABLED)
340 * disable-extensions option description:
342 #define DISABLE_EXTENSIONS_DESC (gnutls_cli_opt_strs+1579)
343 #define DISABLE_EXTENSIONS_NAME (gnutls_cli_opt_strs+1610)
344 #define DISABLE_EXTENSIONS_name (gnutls_cli_opt_strs+1629)
345 #define DISABLE_EXTENSIONS_FLAGS (OPTST_DISABLED)
348 * print-cert option description:
350 #define PRINT_CERT_DESC (gnutls_cli_opt_strs+1648)
351 #define PRINT_CERT_NAME (gnutls_cli_opt_strs+1687)
352 #define PRINT_CERT_name (gnutls_cli_opt_strs+1698)
353 #define PRINT_CERT_FLAGS (OPTST_DISABLED)
356 * recordsize option description:
358 #define RECORDSIZE_DESC (gnutls_cli_opt_strs+1709)
359 #define RECORDSIZE_NAME (gnutls_cli_opt_strs+1746)
360 #define RECORDSIZE_name (gnutls_cli_opt_strs+1757)
361 #define RECORDSIZE_FLAGS (OPTST_DISABLED \
362 | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC))
365 * dh-bits option description:
367 #define DH_BITS_DESC (gnutls_cli_opt_strs+1768)
368 #define DH_BITS_NAME (gnutls_cli_opt_strs+1810)
369 #define DH_BITS_name (gnutls_cli_opt_strs+1818)
370 #define DH_BITS_FLAGS (OPTST_DISABLED \
371 | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC))
374 * priority option description:
376 #define PRIORITY_DESC (gnutls_cli_opt_strs+1826)
377 #define PRIORITY_NAME (gnutls_cli_opt_strs+1844)
378 #define PRIORITY_name (gnutls_cli_opt_strs+1853)
379 #define PRIORITY_FLAGS (OPTST_DISABLED \
380 | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
383 * x509cafile option description:
385 #define X509CAFILE_DESC (gnutls_cli_opt_strs+1862)
386 #define X509CAFILE_NAME (gnutls_cli_opt_strs+1902)
387 #define X509CAFILE_name (gnutls_cli_opt_strs+1913)
388 #define X509CAFILE_FLAGS (OPTST_DISABLED \
389 | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
392 * x509crlfile option description:
394 #define X509CRLFILE_DESC (gnutls_cli_opt_strs+1924)
395 #define X509CRLFILE_NAME (gnutls_cli_opt_strs+1940)
396 #define X509CRLFILE_name (gnutls_cli_opt_strs+1952)
397 #define X509CRLFILE_FLAGS (OPTST_DISABLED \
398 | OPTST_SET_ARGTYPE(OPARG_TYPE_FILE))
401 * pgpkeyfile option description:
403 #define PGPKEYFILE_DESC (gnutls_cli_opt_strs+1964)
404 #define PGPKEYFILE_NAME (gnutls_cli_opt_strs+1984)
405 #define PGPKEYFILE_name (gnutls_cli_opt_strs+1995)
406 #define PGPKEYFILE_FLAGS (OPTST_DISABLED \
407 | OPTST_SET_ARGTYPE(OPARG_TYPE_FILE))
410 * pgpkeyring option description:
412 #define PGPKEYRING_DESC (gnutls_cli_opt_strs+2006)
413 #define PGPKEYRING_NAME (gnutls_cli_opt_strs+2031)
414 #define PGPKEYRING_name (gnutls_cli_opt_strs+2042)
415 #define PGPKEYRING_FLAGS (OPTST_DISABLED \
416 | OPTST_SET_ARGTYPE(OPARG_TYPE_FILE))
419 * pgpcertfile option description:
421 #define PGPCERTFILE_DESC (gnutls_cli_opt_strs+2053)
422 #define PGPCERTFILE_NAME (gnutls_cli_opt_strs+2094)
423 #define PGPCERTFILE_name (gnutls_cli_opt_strs+2106)
424 #define PGPCERTFILE_FLAGS (OPTST_DISABLED \
425 | OPTST_SET_ARGTYPE(OPARG_TYPE_FILE))
428 * x509keyfile option description:
430 #define X509KEYFILE_DESC (gnutls_cli_opt_strs+2118)
431 #define X509KEYFILE_NAME (gnutls_cli_opt_strs+2156)
432 #define X509KEYFILE_name (gnutls_cli_opt_strs+2168)
433 #define X509KEYFILE_FLAGS (OPTST_DISABLED \
434 | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
437 * x509certfile option description:
439 #define X509CERTFILE_DESC (gnutls_cli_opt_strs+2180)
440 #define X509CERTFILE_NAME (gnutls_cli_opt_strs+2226)
441 #define X509CERTFILE_name (gnutls_cli_opt_strs+2239)
442 #define X509CERTFILE_FLAGS (OPTST_DISABLED \
443 | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
446 * pgpsubkey option description:
448 #define PGPSUBKEY_DESC (gnutls_cli_opt_strs+2252)
449 #define PGPSUBKEY_NAME (gnutls_cli_opt_strs+2284)
450 #define PGPSUBKEY_name (gnutls_cli_opt_strs+2294)
451 #define PGPSUBKEY_FLAGS (OPTST_DISABLED \
452 | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
455 * srpusername option description:
457 #define SRPUSERNAME_DESC (gnutls_cli_opt_strs+2304)
458 #define SRPUSERNAME_NAME (gnutls_cli_opt_strs+2324)
459 #define SRPUSERNAME_name (gnutls_cli_opt_strs+2336)
460 #define SRPUSERNAME_FLAGS (OPTST_DISABLED \
461 | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
464 * srppasswd option description:
466 #define SRPPASSWD_DESC (gnutls_cli_opt_strs+2348)
467 #define SRPPASSWD_NAME (gnutls_cli_opt_strs+2368)
468 #define SRPPASSWD_name (gnutls_cli_opt_strs+2378)
469 #define SRPPASSWD_FLAGS (OPTST_DISABLED \
470 | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
473 * pskusername option description:
475 #define PSKUSERNAME_DESC (gnutls_cli_opt_strs+2388)
476 #define PSKUSERNAME_NAME (gnutls_cli_opt_strs+2408)
477 #define PSKUSERNAME_name (gnutls_cli_opt_strs+2420)
478 #define PSKUSERNAME_FLAGS (OPTST_DISABLED \
479 | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
482 * pskkey option description:
484 #define PSKKEY_DESC (gnutls_cli_opt_strs+2432)
485 #define PSKKEY_NAME (gnutls_cli_opt_strs+2456)
486 #define PSKKEY_name (gnutls_cli_opt_strs+2463)
487 #define PSKKEY_FLAGS (OPTST_DISABLED \
488 | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
491 * port option description:
493 #define PORT_DESC (gnutls_cli_opt_strs+2470)
494 #define PORT_NAME (gnutls_cli_opt_strs+2504)
495 #define PORT_name (gnutls_cli_opt_strs+2509)
496 #define PORT_FLAGS (OPTST_DISABLED \
497 | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
500 * insecure option description:
502 #define INSECURE_DESC (gnutls_cli_opt_strs+2514)
503 #define INSECURE_NAME (gnutls_cli_opt_strs+2575)
504 #define INSECURE_name (gnutls_cli_opt_strs+2584)
505 #define INSECURE_FLAGS (OPTST_DISABLED)
508 * benchmark-ciphers option description:
510 #define BENCHMARK_CIPHERS_DESC (gnutls_cli_opt_strs+2593)
511 #define BENCHMARK_CIPHERS_NAME (gnutls_cli_opt_strs+2622)
512 #define BENCHMARK_CIPHERS_name (gnutls_cli_opt_strs+2640)
513 #define BENCHMARK_CIPHERS_FLAGS (OPTST_DISABLED)
516 * benchmark-soft-ciphers option description:
518 #define BENCHMARK_SOFT_CIPHERS_DESC (gnutls_cli_opt_strs+2658)
519 #define BENCHMARK_SOFT_CIPHERS_NAME (gnutls_cli_opt_strs+2717)
520 #define BENCHMARK_SOFT_CIPHERS_name (gnutls_cli_opt_strs+2740)
521 #define BENCHMARK_SOFT_CIPHERS_FLAGS (OPTST_DISABLED)
524 * benchmark-tls-kx option description:
526 #define BENCHMARK_TLS_KX_DESC (gnutls_cli_opt_strs+2763)
527 #define BENCHMARK_TLS_KX_NAME (gnutls_cli_opt_strs+2798)
528 #define BENCHMARK_TLS_KX_name (gnutls_cli_opt_strs+2815)
529 #define BENCHMARK_TLS_KX_FLAGS (OPTST_DISABLED)
532 * benchmark-tls-ciphers option description:
534 #define BENCHMARK_TLS_CIPHERS_DESC (gnutls_cli_opt_strs+2832)
535 #define BENCHMARK_TLS_CIPHERS_NAME (gnutls_cli_opt_strs+2854)
536 #define BENCHMARK_TLS_CIPHERS_name (gnutls_cli_opt_strs+2876)
537 #define BENCHMARK_TLS_CIPHERS_FLAGS (OPTST_DISABLED)
540 * list option description:
542 #define LIST_DESC (gnutls_cli_opt_strs+2898)
543 #define LIST_NAME (gnutls_cli_opt_strs+2949)
544 #define LIST_name (gnutls_cli_opt_strs+2954)
545 #define LIST_FLAGS (OPTST_DISABLED)
548 * Help/More_Help/Version option descriptions:
550 #define HELP_DESC (gnutls_cli_opt_strs+2959)
551 #define HELP_name (gnutls_cli_opt_strs+3003)
552 #ifdef HAVE_WORKING_FORK
553 #define MORE_HELP_DESC (gnutls_cli_opt_strs+3008)
554 #define MORE_HELP_name (gnutls_cli_opt_strs+3053)
555 #define MORE_HELP_FLAGS (OPTST_IMM | OPTST_NO_INIT)
556 #else
557 #define MORE_HELP_DESC NULL
558 #define MORE_HELP_name NULL
559 #define MORE_HELP_FLAGS (OPTST_OMITTED | OPTST_NO_INIT)
560 #endif
561 #ifdef NO_OPTIONAL_OPT_ARGS
562 # define VER_FLAGS (OPTST_IMM | OPTST_NO_INIT)
563 #else
564 # define VER_FLAGS (OPTST_SET_ARGTYPE(OPARG_TYPE_STRING) | \
565 OPTST_ARG_OPTIONAL | OPTST_IMM | OPTST_NO_INIT)
566 #endif
567 #define VER_DESC (gnutls_cli_opt_strs+3063)
568 #define VER_name (gnutls_cli_opt_strs+3099)
570 * Declare option callback procedures
572 extern tOptProc
573 optionBooleanVal, optionNestedVal, optionNumericVal,
574 optionPagedUsage, optionPrintVersion, optionResetOpt,
575 optionStackArg, optionTimeDate, optionTimeVal,
576 optionUnstackArg, optionVendorOption;
577 static tOptProc
578 doOptDebug, doOptMtu, doOptPgpcertfile, doOptPgpkeyfile,
579 doOptPgpkeyring, doOptRecordsize, doOptX509crlfile, doUsageOpt;
580 #define VER_PROC optionPrintVersion
582 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
584 * Define the gnutls-cli Option Descriptions.
585 * This is an array of OPTION_CT entries, one for each
586 * option that the gnutls-cli program responds to.
588 static tOptDesc optDesc[OPTION_CT] = {
589 { /* entry idx, value */ 0, VALUE_OPT_DEBUG,
590 /* equiv idx, value */ 0, VALUE_OPT_DEBUG,
591 /* equivalenced to */ NO_EQUIVALENT,
592 /* min, max, act ct */ 0, 1, 0,
593 /* opt state flags */ DEBUG_FLAGS, 0,
594 /* last opt argumnt */ { NULL }, /* --debug */
595 /* arg list/cookie */ NULL,
596 /* must/cannot opts */ NULL, NULL,
597 /* option proc */ doOptDebug,
598 /* desc, NAME, name */ DEBUG_DESC, DEBUG_NAME, DEBUG_name,
599 /* disablement strs */ NULL, NULL },
601 { /* entry idx, value */ 1, VALUE_OPT_VERBOSE,
602 /* equiv idx, value */ 1, VALUE_OPT_VERBOSE,
603 /* equivalenced to */ NO_EQUIVALENT,
604 /* min, max, act ct */ 0, NOLIMIT, 0,
605 /* opt state flags */ VERBOSE_FLAGS, 0,
606 /* last opt argumnt */ { NULL }, /* --verbose */
607 /* arg list/cookie */ NULL,
608 /* must/cannot opts */ NULL, NULL,
609 /* option proc */ NULL,
610 /* desc, NAME, name */ VERBOSE_DESC, VERBOSE_NAME, VERBOSE_name,
611 /* disablement strs */ NULL, NULL },
613 { /* entry idx, value */ 2, VALUE_OPT_TOFU,
614 /* equiv idx, value */ 2, VALUE_OPT_TOFU,
615 /* equivalenced to */ NO_EQUIVALENT,
616 /* min, max, act ct */ 0, 1, 0,
617 /* opt state flags */ TOFU_FLAGS, 0,
618 /* last opt argumnt */ { NULL }, /* --tofu */
619 /* arg list/cookie */ NULL,
620 /* must/cannot opts */ NULL, NULL,
621 /* option proc */ NULL,
622 /* desc, NAME, name */ TOFU_DESC, TOFU_NAME, TOFU_name,
623 /* disablement strs */ NOT_TOFU_name, NOT_TOFU_PFX },
625 { /* entry idx, value */ 3, VALUE_OPT_OCSP,
626 /* equiv idx, value */ 3, VALUE_OPT_OCSP,
627 /* equivalenced to */ NO_EQUIVALENT,
628 /* min, max, act ct */ 0, 1, 0,
629 /* opt state flags */ OCSP_FLAGS, 0,
630 /* last opt argumnt */ { NULL }, /* --ocsp */
631 /* arg list/cookie */ NULL,
632 /* must/cannot opts */ NULL, NULL,
633 /* option proc */ NULL,
634 /* desc, NAME, name */ OCSP_DESC, OCSP_NAME, OCSP_name,
635 /* disablement strs */ NOT_OCSP_name, NOT_OCSP_PFX },
637 { /* entry idx, value */ 4, VALUE_OPT_RESUME,
638 /* equiv idx, value */ 4, VALUE_OPT_RESUME,
639 /* equivalenced to */ NO_EQUIVALENT,
640 /* min, max, act ct */ 0, 1, 0,
641 /* opt state flags */ RESUME_FLAGS, 0,
642 /* last opt argumnt */ { NULL }, /* --resume */
643 /* arg list/cookie */ NULL,
644 /* must/cannot opts */ NULL, NULL,
645 /* option proc */ NULL,
646 /* desc, NAME, name */ RESUME_DESC, RESUME_NAME, RESUME_name,
647 /* disablement strs */ NULL, NULL },
649 { /* entry idx, value */ 5, VALUE_OPT_HEARTBEAT,
650 /* equiv idx, value */ 5, VALUE_OPT_HEARTBEAT,
651 /* equivalenced to */ NO_EQUIVALENT,
652 /* min, max, act ct */ 0, 1, 0,
653 /* opt state flags */ HEARTBEAT_FLAGS, 0,
654 /* last opt argumnt */ { NULL }, /* --heartbeat */
655 /* arg list/cookie */ NULL,
656 /* must/cannot opts */ NULL, NULL,
657 /* option proc */ NULL,
658 /* desc, NAME, name */ HEARTBEAT_DESC, HEARTBEAT_NAME, HEARTBEAT_name,
659 /* disablement strs */ NULL, NULL },
661 { /* entry idx, value */ 6, VALUE_OPT_REHANDSHAKE,
662 /* equiv idx, value */ 6, VALUE_OPT_REHANDSHAKE,
663 /* equivalenced to */ NO_EQUIVALENT,
664 /* min, max, act ct */ 0, 1, 0,
665 /* opt state flags */ REHANDSHAKE_FLAGS, 0,
666 /* last opt argumnt */ { NULL }, /* --rehandshake */
667 /* arg list/cookie */ NULL,
668 /* must/cannot opts */ NULL, NULL,
669 /* option proc */ NULL,
670 /* desc, NAME, name */ REHANDSHAKE_DESC, REHANDSHAKE_NAME, REHANDSHAKE_name,
671 /* disablement strs */ NULL, NULL },
673 { /* entry idx, value */ 7, VALUE_OPT_NOTICKET,
674 /* equiv idx, value */ 7, VALUE_OPT_NOTICKET,
675 /* equivalenced to */ NO_EQUIVALENT,
676 /* min, max, act ct */ 0, 1, 0,
677 /* opt state flags */ NOTICKET_FLAGS, 0,
678 /* last opt argumnt */ { NULL }, /* --noticket */
679 /* arg list/cookie */ NULL,
680 /* must/cannot opts */ NULL, NULL,
681 /* option proc */ NULL,
682 /* desc, NAME, name */ NOTICKET_DESC, NOTICKET_NAME, NOTICKET_name,
683 /* disablement strs */ NULL, NULL },
685 { /* entry idx, value */ 8, VALUE_OPT_STARTTLS,
686 /* equiv idx, value */ 8, VALUE_OPT_STARTTLS,
687 /* equivalenced to */ NO_EQUIVALENT,
688 /* min, max, act ct */ 0, 1, 0,
689 /* opt state flags */ STARTTLS_FLAGS, 0,
690 /* last opt argumnt */ { NULL }, /* --starttls */
691 /* arg list/cookie */ NULL,
692 /* must/cannot opts */ NULL, NULL,
693 /* option proc */ NULL,
694 /* desc, NAME, name */ STARTTLS_DESC, STARTTLS_NAME, STARTTLS_name,
695 /* disablement strs */ NULL, NULL },
697 { /* entry idx, value */ 9, VALUE_OPT_UDP,
698 /* equiv idx, value */ 9, VALUE_OPT_UDP,
699 /* equivalenced to */ NO_EQUIVALENT,
700 /* min, max, act ct */ 0, 1, 0,
701 /* opt state flags */ UDP_FLAGS, 0,
702 /* last opt argumnt */ { NULL }, /* --udp */
703 /* arg list/cookie */ NULL,
704 /* must/cannot opts */ NULL, NULL,
705 /* option proc */ NULL,
706 /* desc, NAME, name */ UDP_DESC, UDP_NAME, UDP_name,
707 /* disablement strs */ NULL, NULL },
709 { /* entry idx, value */ 10, VALUE_OPT_MTU,
710 /* equiv idx, value */ 10, VALUE_OPT_MTU,
711 /* equivalenced to */ NO_EQUIVALENT,
712 /* min, max, act ct */ 0, 1, 0,
713 /* opt state flags */ MTU_FLAGS, 0,
714 /* last opt argumnt */ { NULL }, /* --mtu */
715 /* arg list/cookie */ NULL,
716 /* must/cannot opts */ NULL, NULL,
717 /* option proc */ doOptMtu,
718 /* desc, NAME, name */ MTU_DESC, MTU_NAME, MTU_name,
719 /* disablement strs */ NULL, NULL },
721 { /* entry idx, value */ 11, VALUE_OPT_CRLF,
722 /* equiv idx, value */ 11, VALUE_OPT_CRLF,
723 /* equivalenced to */ NO_EQUIVALENT,
724 /* min, max, act ct */ 0, 1, 0,
725 /* opt state flags */ CRLF_FLAGS, 0,
726 /* last opt argumnt */ { NULL }, /* --crlf */
727 /* arg list/cookie */ NULL,
728 /* must/cannot opts */ NULL, NULL,
729 /* option proc */ NULL,
730 /* desc, NAME, name */ CRLF_DESC, CRLF_NAME, CRLF_name,
731 /* disablement strs */ NULL, NULL },
733 { /* entry idx, value */ 12, VALUE_OPT_X509FMTDER,
734 /* equiv idx, value */ 12, VALUE_OPT_X509FMTDER,
735 /* equivalenced to */ NO_EQUIVALENT,
736 /* min, max, act ct */ 0, 1, 0,
737 /* opt state flags */ X509FMTDER_FLAGS, 0,
738 /* last opt argumnt */ { NULL }, /* --x509fmtder */
739 /* arg list/cookie */ NULL,
740 /* must/cannot opts */ NULL, NULL,
741 /* option proc */ NULL,
742 /* desc, NAME, name */ X509FMTDER_DESC, X509FMTDER_NAME, X509FMTDER_name,
743 /* disablement strs */ NULL, NULL },
745 { /* entry idx, value */ 13, VALUE_OPT_FINGERPRINT,
746 /* equiv idx, value */ 13, VALUE_OPT_FINGERPRINT,
747 /* equivalenced to */ NO_EQUIVALENT,
748 /* min, max, act ct */ 0, 1, 0,
749 /* opt state flags */ FINGERPRINT_FLAGS, 0,
750 /* last opt argumnt */ { NULL }, /* --fingerprint */
751 /* arg list/cookie */ NULL,
752 /* must/cannot opts */ NULL, NULL,
753 /* option proc */ NULL,
754 /* desc, NAME, name */ FINGERPRINT_DESC, FINGERPRINT_NAME, FINGERPRINT_name,
755 /* disablement strs */ NULL, NULL },
757 { /* entry idx, value */ 14, VALUE_OPT_DISABLE_EXTENSIONS,
758 /* equiv idx, value */ 14, VALUE_OPT_DISABLE_EXTENSIONS,
759 /* equivalenced to */ NO_EQUIVALENT,
760 /* min, max, act ct */ 0, 1, 0,
761 /* opt state flags */ DISABLE_EXTENSIONS_FLAGS, 0,
762 /* last opt argumnt */ { NULL }, /* --disable-extensions */
763 /* arg list/cookie */ NULL,
764 /* must/cannot opts */ NULL, NULL,
765 /* option proc */ NULL,
766 /* desc, NAME, name */ DISABLE_EXTENSIONS_DESC, DISABLE_EXTENSIONS_NAME, DISABLE_EXTENSIONS_name,
767 /* disablement strs */ NULL, NULL },
769 { /* entry idx, value */ 15, VALUE_OPT_PRINT_CERT,
770 /* equiv idx, value */ 15, VALUE_OPT_PRINT_CERT,
771 /* equivalenced to */ NO_EQUIVALENT,
772 /* min, max, act ct */ 0, 1, 0,
773 /* opt state flags */ PRINT_CERT_FLAGS, 0,
774 /* last opt argumnt */ { NULL }, /* --print-cert */
775 /* arg list/cookie */ NULL,
776 /* must/cannot opts */ NULL, NULL,
777 /* option proc */ NULL,
778 /* desc, NAME, name */ PRINT_CERT_DESC, PRINT_CERT_NAME, PRINT_CERT_name,
779 /* disablement strs */ NULL, NULL },
781 { /* entry idx, value */ 16, VALUE_OPT_RECORDSIZE,
782 /* equiv idx, value */ 16, VALUE_OPT_RECORDSIZE,
783 /* equivalenced to */ NO_EQUIVALENT,
784 /* min, max, act ct */ 0, 1, 0,
785 /* opt state flags */ RECORDSIZE_FLAGS, 0,
786 /* last opt argumnt */ { NULL }, /* --recordsize */
787 /* arg list/cookie */ NULL,
788 /* must/cannot opts */ NULL, NULL,
789 /* option proc */ doOptRecordsize,
790 /* desc, NAME, name */ RECORDSIZE_DESC, RECORDSIZE_NAME, RECORDSIZE_name,
791 /* disablement strs */ NULL, NULL },
793 { /* entry idx, value */ 17, VALUE_OPT_DH_BITS,
794 /* equiv idx, value */ 17, VALUE_OPT_DH_BITS,
795 /* equivalenced to */ NO_EQUIVALENT,
796 /* min, max, act ct */ 0, 1, 0,
797 /* opt state flags */ DH_BITS_FLAGS, 0,
798 /* last opt argumnt */ { NULL }, /* --dh-bits */
799 /* arg list/cookie */ NULL,
800 /* must/cannot opts */ NULL, NULL,
801 /* option proc */ optionNumericVal,
802 /* desc, NAME, name */ DH_BITS_DESC, DH_BITS_NAME, DH_BITS_name,
803 /* disablement strs */ NULL, NULL },
805 { /* entry idx, value */ 18, VALUE_OPT_PRIORITY,
806 /* equiv idx, value */ 18, VALUE_OPT_PRIORITY,
807 /* equivalenced to */ NO_EQUIVALENT,
808 /* min, max, act ct */ 0, 1, 0,
809 /* opt state flags */ PRIORITY_FLAGS, 0,
810 /* last opt argumnt */ { NULL }, /* --priority */
811 /* arg list/cookie */ NULL,
812 /* must/cannot opts */ NULL, NULL,
813 /* option proc */ NULL,
814 /* desc, NAME, name */ PRIORITY_DESC, PRIORITY_NAME, PRIORITY_name,
815 /* disablement strs */ NULL, NULL },
817 { /* entry idx, value */ 19, VALUE_OPT_X509CAFILE,
818 /* equiv idx, value */ 19, VALUE_OPT_X509CAFILE,
819 /* equivalenced to */ NO_EQUIVALENT,
820 /* min, max, act ct */ 0, 1, 0,
821 /* opt state flags */ X509CAFILE_FLAGS, 0,
822 /* last opt argumnt */ { NULL }, /* --x509cafile */
823 /* arg list/cookie */ NULL,
824 /* must/cannot opts */ NULL, NULL,
825 /* option proc */ NULL,
826 /* desc, NAME, name */ X509CAFILE_DESC, X509CAFILE_NAME, X509CAFILE_name,
827 /* disablement strs */ NULL, NULL },
829 { /* entry idx, value */ 20, VALUE_OPT_X509CRLFILE,
830 /* equiv idx, value */ 20, VALUE_OPT_X509CRLFILE,
831 /* equivalenced to */ NO_EQUIVALENT,
832 /* min, max, act ct */ 0, 1, 0,
833 /* opt state flags */ X509CRLFILE_FLAGS, 0,
834 /* last opt argumnt */ { NULL }, /* --x509crlfile */
835 /* arg list/cookie */ NULL,
836 /* must/cannot opts */ NULL, NULL,
837 /* option proc */ doOptX509crlfile,
838 /* desc, NAME, name */ X509CRLFILE_DESC, X509CRLFILE_NAME, X509CRLFILE_name,
839 /* disablement strs */ NULL, NULL },
841 { /* entry idx, value */ 21, VALUE_OPT_PGPKEYFILE,
842 /* equiv idx, value */ 21, VALUE_OPT_PGPKEYFILE,
843 /* equivalenced to */ NO_EQUIVALENT,
844 /* min, max, act ct */ 0, 1, 0,
845 /* opt state flags */ PGPKEYFILE_FLAGS, 0,
846 /* last opt argumnt */ { NULL }, /* --pgpkeyfile */
847 /* arg list/cookie */ NULL,
848 /* must/cannot opts */ NULL, NULL,
849 /* option proc */ doOptPgpkeyfile,
850 /* desc, NAME, name */ PGPKEYFILE_DESC, PGPKEYFILE_NAME, PGPKEYFILE_name,
851 /* disablement strs */ NULL, NULL },
853 { /* entry idx, value */ 22, VALUE_OPT_PGPKEYRING,
854 /* equiv idx, value */ 22, VALUE_OPT_PGPKEYRING,
855 /* equivalenced to */ NO_EQUIVALENT,
856 /* min, max, act ct */ 0, 1, 0,
857 /* opt state flags */ PGPKEYRING_FLAGS, 0,
858 /* last opt argumnt */ { NULL }, /* --pgpkeyring */
859 /* arg list/cookie */ NULL,
860 /* must/cannot opts */ NULL, NULL,
861 /* option proc */ doOptPgpkeyring,
862 /* desc, NAME, name */ PGPKEYRING_DESC, PGPKEYRING_NAME, PGPKEYRING_name,
863 /* disablement strs */ NULL, NULL },
865 { /* entry idx, value */ 23, VALUE_OPT_PGPCERTFILE,
866 /* equiv idx, value */ 23, VALUE_OPT_PGPCERTFILE,
867 /* equivalenced to */ NO_EQUIVALENT,
868 /* min, max, act ct */ 0, 1, 0,
869 /* opt state flags */ PGPCERTFILE_FLAGS, 0,
870 /* last opt argumnt */ { NULL }, /* --pgpcertfile */
871 /* arg list/cookie */ NULL,
872 /* must/cannot opts */ NULL, NULL,
873 /* option proc */ doOptPgpcertfile,
874 /* desc, NAME, name */ PGPCERTFILE_DESC, PGPCERTFILE_NAME, PGPCERTFILE_name,
875 /* disablement strs */ NULL, NULL },
877 { /* entry idx, value */ 24, VALUE_OPT_X509KEYFILE,
878 /* equiv idx, value */ 24, VALUE_OPT_X509KEYFILE,
879 /* equivalenced to */ NO_EQUIVALENT,
880 /* min, max, act ct */ 0, 1, 0,
881 /* opt state flags */ X509KEYFILE_FLAGS, 0,
882 /* last opt argumnt */ { NULL }, /* --x509keyfile */
883 /* arg list/cookie */ NULL,
884 /* must/cannot opts */ NULL, NULL,
885 /* option proc */ NULL,
886 /* desc, NAME, name */ X509KEYFILE_DESC, X509KEYFILE_NAME, X509KEYFILE_name,
887 /* disablement strs */ NULL, NULL },
889 { /* entry idx, value */ 25, VALUE_OPT_X509CERTFILE,
890 /* equiv idx, value */ 25, VALUE_OPT_X509CERTFILE,
891 /* equivalenced to */ NO_EQUIVALENT,
892 /* min, max, act ct */ 0, 1, 0,
893 /* opt state flags */ X509CERTFILE_FLAGS, 0,
894 /* last opt argumnt */ { NULL }, /* --x509certfile */
895 /* arg list/cookie */ NULL,
896 /* must/cannot opts */ NULL, NULL,
897 /* option proc */ NULL,
898 /* desc, NAME, name */ X509CERTFILE_DESC, X509CERTFILE_NAME, X509CERTFILE_name,
899 /* disablement strs */ NULL, NULL },
901 { /* entry idx, value */ 26, VALUE_OPT_PGPSUBKEY,
902 /* equiv idx, value */ 26, VALUE_OPT_PGPSUBKEY,
903 /* equivalenced to */ NO_EQUIVALENT,
904 /* min, max, act ct */ 0, 1, 0,
905 /* opt state flags */ PGPSUBKEY_FLAGS, 0,
906 /* last opt argumnt */ { NULL }, /* --pgpsubkey */
907 /* arg list/cookie */ NULL,
908 /* must/cannot opts */ NULL, NULL,
909 /* option proc */ NULL,
910 /* desc, NAME, name */ PGPSUBKEY_DESC, PGPSUBKEY_NAME, PGPSUBKEY_name,
911 /* disablement strs */ NULL, NULL },
913 { /* entry idx, value */ 27, VALUE_OPT_SRPUSERNAME,
914 /* equiv idx, value */ 27, VALUE_OPT_SRPUSERNAME,
915 /* equivalenced to */ NO_EQUIVALENT,
916 /* min, max, act ct */ 0, 1, 0,
917 /* opt state flags */ SRPUSERNAME_FLAGS, 0,
918 /* last opt argumnt */ { NULL }, /* --srpusername */
919 /* arg list/cookie */ NULL,
920 /* must/cannot opts */ NULL, NULL,
921 /* option proc */ NULL,
922 /* desc, NAME, name */ SRPUSERNAME_DESC, SRPUSERNAME_NAME, SRPUSERNAME_name,
923 /* disablement strs */ NULL, NULL },
925 { /* entry idx, value */ 28, VALUE_OPT_SRPPASSWD,
926 /* equiv idx, value */ 28, VALUE_OPT_SRPPASSWD,
927 /* equivalenced to */ NO_EQUIVALENT,
928 /* min, max, act ct */ 0, 1, 0,
929 /* opt state flags */ SRPPASSWD_FLAGS, 0,
930 /* last opt argumnt */ { NULL }, /* --srppasswd */
931 /* arg list/cookie */ NULL,
932 /* must/cannot opts */ NULL, NULL,
933 /* option proc */ NULL,
934 /* desc, NAME, name */ SRPPASSWD_DESC, SRPPASSWD_NAME, SRPPASSWD_name,
935 /* disablement strs */ NULL, NULL },
937 { /* entry idx, value */ 29, VALUE_OPT_PSKUSERNAME,
938 /* equiv idx, value */ 29, VALUE_OPT_PSKUSERNAME,
939 /* equivalenced to */ NO_EQUIVALENT,
940 /* min, max, act ct */ 0, 1, 0,
941 /* opt state flags */ PSKUSERNAME_FLAGS, 0,
942 /* last opt argumnt */ { NULL }, /* --pskusername */
943 /* arg list/cookie */ NULL,
944 /* must/cannot opts */ NULL, NULL,
945 /* option proc */ NULL,
946 /* desc, NAME, name */ PSKUSERNAME_DESC, PSKUSERNAME_NAME, PSKUSERNAME_name,
947 /* disablement strs */ NULL, NULL },
949 { /* entry idx, value */ 30, VALUE_OPT_PSKKEY,
950 /* equiv idx, value */ 30, VALUE_OPT_PSKKEY,
951 /* equivalenced to */ NO_EQUIVALENT,
952 /* min, max, act ct */ 0, 1, 0,
953 /* opt state flags */ PSKKEY_FLAGS, 0,
954 /* last opt argumnt */ { NULL }, /* --pskkey */
955 /* arg list/cookie */ NULL,
956 /* must/cannot opts */ NULL, NULL,
957 /* option proc */ NULL,
958 /* desc, NAME, name */ PSKKEY_DESC, PSKKEY_NAME, PSKKEY_name,
959 /* disablement strs */ NULL, NULL },
961 { /* entry idx, value */ 31, VALUE_OPT_PORT,
962 /* equiv idx, value */ 31, VALUE_OPT_PORT,
963 /* equivalenced to */ NO_EQUIVALENT,
964 /* min, max, act ct */ 0, 1, 0,
965 /* opt state flags */ PORT_FLAGS, 0,
966 /* last opt argumnt */ { NULL }, /* --port */
967 /* arg list/cookie */ NULL,
968 /* must/cannot opts */ NULL, NULL,
969 /* option proc */ NULL,
970 /* desc, NAME, name */ PORT_DESC, PORT_NAME, PORT_name,
971 /* disablement strs */ NULL, NULL },
973 { /* entry idx, value */ 32, VALUE_OPT_INSECURE,
974 /* equiv idx, value */ 32, VALUE_OPT_INSECURE,
975 /* equivalenced to */ NO_EQUIVALENT,
976 /* min, max, act ct */ 0, 1, 0,
977 /* opt state flags */ INSECURE_FLAGS, 0,
978 /* last opt argumnt */ { NULL }, /* --insecure */
979 /* arg list/cookie */ NULL,
980 /* must/cannot opts */ NULL, NULL,
981 /* option proc */ NULL,
982 /* desc, NAME, name */ INSECURE_DESC, INSECURE_NAME, INSECURE_name,
983 /* disablement strs */ NULL, NULL },
985 { /* entry idx, value */ 33, VALUE_OPT_BENCHMARK_CIPHERS,
986 /* equiv idx, value */ 33, VALUE_OPT_BENCHMARK_CIPHERS,
987 /* equivalenced to */ NO_EQUIVALENT,
988 /* min, max, act ct */ 0, 1, 0,
989 /* opt state flags */ BENCHMARK_CIPHERS_FLAGS, 0,
990 /* last opt argumnt */ { NULL }, /* --benchmark-ciphers */
991 /* arg list/cookie */ NULL,
992 /* must/cannot opts */ NULL, NULL,
993 /* option proc */ NULL,
994 /* desc, NAME, name */ BENCHMARK_CIPHERS_DESC, BENCHMARK_CIPHERS_NAME, BENCHMARK_CIPHERS_name,
995 /* disablement strs */ NULL, NULL },
997 { /* entry idx, value */ 34, VALUE_OPT_BENCHMARK_SOFT_CIPHERS,
998 /* equiv idx, value */ 34, VALUE_OPT_BENCHMARK_SOFT_CIPHERS,
999 /* equivalenced to */ NO_EQUIVALENT,
1000 /* min, max, act ct */ 0, 1, 0,
1001 /* opt state flags */ BENCHMARK_SOFT_CIPHERS_FLAGS, 0,
1002 /* last opt argumnt */ { NULL }, /* --benchmark-soft-ciphers */
1003 /* arg list/cookie */ NULL,
1004 /* must/cannot opts */ NULL, NULL,
1005 /* option proc */ NULL,
1006 /* desc, NAME, name */ BENCHMARK_SOFT_CIPHERS_DESC, BENCHMARK_SOFT_CIPHERS_NAME, BENCHMARK_SOFT_CIPHERS_name,
1007 /* disablement strs */ NULL, NULL },
1009 { /* entry idx, value */ 35, VALUE_OPT_BENCHMARK_TLS_KX,
1010 /* equiv idx, value */ 35, VALUE_OPT_BENCHMARK_TLS_KX,
1011 /* equivalenced to */ NO_EQUIVALENT,
1012 /* min, max, act ct */ 0, 1, 0,
1013 /* opt state flags */ BENCHMARK_TLS_KX_FLAGS, 0,
1014 /* last opt argumnt */ { NULL }, /* --benchmark-tls-kx */
1015 /* arg list/cookie */ NULL,
1016 /* must/cannot opts */ NULL, NULL,
1017 /* option proc */ NULL,
1018 /* desc, NAME, name */ BENCHMARK_TLS_KX_DESC, BENCHMARK_TLS_KX_NAME, BENCHMARK_TLS_KX_name,
1019 /* disablement strs */ NULL, NULL },
1021 { /* entry idx, value */ 36, VALUE_OPT_BENCHMARK_TLS_CIPHERS,
1022 /* equiv idx, value */ 36, VALUE_OPT_BENCHMARK_TLS_CIPHERS,
1023 /* equivalenced to */ NO_EQUIVALENT,
1024 /* min, max, act ct */ 0, 1, 0,
1025 /* opt state flags */ BENCHMARK_TLS_CIPHERS_FLAGS, 0,
1026 /* last opt argumnt */ { NULL }, /* --benchmark-tls-ciphers */
1027 /* arg list/cookie */ NULL,
1028 /* must/cannot opts */ NULL, NULL,
1029 /* option proc */ NULL,
1030 /* desc, NAME, name */ BENCHMARK_TLS_CIPHERS_DESC, BENCHMARK_TLS_CIPHERS_NAME, BENCHMARK_TLS_CIPHERS_name,
1031 /* disablement strs */ NULL, NULL },
1033 { /* entry idx, value */ 37, VALUE_OPT_LIST,
1034 /* equiv idx, value */ 37, VALUE_OPT_LIST,
1035 /* equivalenced to */ NO_EQUIVALENT,
1036 /* min, max, act ct */ 0, 1, 0,
1037 /* opt state flags */ LIST_FLAGS, 0,
1038 /* last opt argumnt */ { NULL }, /* --list */
1039 /* arg list/cookie */ NULL,
1040 /* must/cannot opts */ NULL, NULL,
1041 /* option proc */ NULL,
1042 /* desc, NAME, name */ LIST_DESC, LIST_NAME, LIST_name,
1043 /* disablement strs */ NULL, NULL },
1045 { /* entry idx, value */ INDEX_OPT_VERSION, VALUE_OPT_VERSION,
1046 /* equiv idx value */ NO_EQUIVALENT, VALUE_OPT_VERSION,
1047 /* equivalenced to */ NO_EQUIVALENT,
1048 /* min, max, act ct */ 0, 1, 0,
1049 /* opt state flags */ VER_FLAGS, 0,
1050 /* last opt argumnt */ { NULL },
1051 /* arg list/cookie */ NULL,
1052 /* must/cannot opts */ NULL, NULL,
1053 /* option proc */ VER_PROC,
1054 /* desc, NAME, name */ VER_DESC, NULL, VER_name,
1055 /* disablement strs */ NULL, NULL },
1059 { /* entry idx, value */ INDEX_OPT_HELP, VALUE_OPT_HELP,
1060 /* equiv idx value */ NO_EQUIVALENT, VALUE_OPT_HELP,
1061 /* equivalenced to */ NO_EQUIVALENT,
1062 /* min, max, act ct */ 0, 1, 0,
1063 /* opt state flags */ OPTST_IMM | OPTST_NO_INIT, 0,
1064 /* last opt argumnt */ { NULL },
1065 /* arg list/cookie */ NULL,
1066 /* must/cannot opts */ NULL, NULL,
1067 /* option proc */ doUsageOpt,
1068 /* desc, NAME, name */ HELP_DESC, NULL, HELP_name,
1069 /* disablement strs */ NULL, NULL },
1071 { /* entry idx, value */ INDEX_OPT_MORE_HELP, VALUE_OPT_MORE_HELP,
1072 /* equiv idx value */ NO_EQUIVALENT, VALUE_OPT_MORE_HELP,
1073 /* equivalenced to */ NO_EQUIVALENT,
1074 /* min, max, act ct */ 0, 1, 0,
1075 /* opt state flags */ MORE_HELP_FLAGS, 0,
1076 /* last opt argumnt */ { NULL },
1077 /* arg list/cookie */ NULL,
1078 /* must/cannot opts */ NULL, NULL,
1079 /* option proc */ optionPagedUsage,
1080 /* desc, NAME, name */ MORE_HELP_DESC, NULL, MORE_HELP_name,
1081 /* disablement strs */ NULL, NULL }
1085 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
1087 * Define the gnutls-cli Option Environment
1089 #define zPROGNAME (gnutls_cli_opt_strs+3107)
1090 #define zUsageTitle (gnutls_cli_opt_strs+3118)
1091 #define zRcName NULL
1092 #define apzHomeList NULL
1093 #define zBugsAddr (gnutls_cli_opt_strs+3231)
1094 #define zExplain (gnutls_cli_opt_strs+3250)
1095 #define zDetail (gnutls_cli_opt_strs+3253)
1096 #define zFullVersion (gnutls_cli_opt_strs+3437)
1097 /* extracted from optcode.tlib near line 350 */
1099 #if defined(ENABLE_NLS)
1100 # define OPTPROC_BASE OPTPROC_TRANSLATE | OPTPROC_NXLAT_OPT
1101 static tOptionXlateProc translate_option_strings;
1102 #else
1103 # define OPTPROC_BASE OPTPROC_NONE
1104 # define translate_option_strings NULL
1105 #endif /* ENABLE_NLS */
1108 #define gnutls_cli_full_usage (NULL)
1110 #define gnutls_cli_short_usage (gnutls_cli_opt_strs+3458)
1112 #endif /* not defined __doxygen__ */
1115 * Create the static procedure(s) declared above.
1118 * The callout function that invokes the optionUsage function.
1120 * @param pOptions the AutoOpts option description structure
1121 * @param pOptDesc the descriptor for the "help" (usage) option.
1122 * @noreturn
1124 static void
1125 doUsageOpt(tOptions * pOptions, tOptDesc * pOptDesc)
1127 optionUsage(&gnutls_cliOptions, GNUTLS_CLI_EXIT_SUCCESS);
1128 /* NOTREACHED */
1129 (void)pOptDesc;
1130 (void)pOptions;
1133 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
1135 * Code to handle the debug option.
1137 * @param pOptions the gnutls-cli options data structure
1138 * @param pOptDesc the option descriptor for this option.
1140 static void
1141 doOptDebug(tOptions* pOptions, tOptDesc* pOptDesc)
1143 static struct {long rmin, rmax;} const rng[1] = {
1144 { 0 , 9999 } };
1145 int ix;
1147 if (pOptions <= OPTPROC_EMIT_LIMIT)
1148 goto emit_ranges;
1149 optionNumericVal(pOptions, pOptDesc);
1151 for (ix = 0; ix < 1; ix++) {
1152 if (pOptDesc->optArg.argInt < rng[ix].rmin)
1153 continue; /* ranges need not be ordered. */
1154 if (pOptDesc->optArg.argInt == rng[ix].rmin)
1155 return;
1156 if (rng[ix].rmax == LONG_MIN)
1157 continue;
1158 if (pOptDesc->optArg.argInt <= rng[ix].rmax)
1159 return;
1162 option_usage_fp = stderr;
1164 emit_ranges:
1166 optionShowRange(pOptions, pOptDesc, (void *)rng, 1);
1169 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
1171 * Code to handle the mtu option.
1173 * @param pOptions the gnutls-cli options data structure
1174 * @param pOptDesc the option descriptor for this option.
1176 static void
1177 doOptMtu(tOptions* pOptions, tOptDesc* pOptDesc)
1179 static struct {long rmin, rmax;} const rng[1] = {
1180 { 0, 17000 } };
1181 int ix;
1183 if (pOptions <= OPTPROC_EMIT_LIMIT)
1184 goto emit_ranges;
1185 optionNumericVal(pOptions, pOptDesc);
1187 for (ix = 0; ix < 1; ix++) {
1188 if (pOptDesc->optArg.argInt < rng[ix].rmin)
1189 continue; /* ranges need not be ordered. */
1190 if (pOptDesc->optArg.argInt == rng[ix].rmin)
1191 return;
1192 if (rng[ix].rmax == LONG_MIN)
1193 continue;
1194 if (pOptDesc->optArg.argInt <= rng[ix].rmax)
1195 return;
1198 option_usage_fp = stderr;
1200 emit_ranges:
1202 optionShowRange(pOptions, pOptDesc, (void *)rng, 1);
1205 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
1207 * Code to handle the recordsize option.
1209 * @param pOptions the gnutls-cli options data structure
1210 * @param pOptDesc the option descriptor for this option.
1212 static void
1213 doOptRecordsize(tOptions* pOptions, tOptDesc* pOptDesc)
1215 static struct {long rmin, rmax;} const rng[1] = {
1216 { 0, 4096 } };
1217 int ix;
1219 if (pOptions <= OPTPROC_EMIT_LIMIT)
1220 goto emit_ranges;
1221 optionNumericVal(pOptions, pOptDesc);
1223 for (ix = 0; ix < 1; ix++) {
1224 if (pOptDesc->optArg.argInt < rng[ix].rmin)
1225 continue; /* ranges need not be ordered. */
1226 if (pOptDesc->optArg.argInt == rng[ix].rmin)
1227 return;
1228 if (rng[ix].rmax == LONG_MIN)
1229 continue;
1230 if (pOptDesc->optArg.argInt <= rng[ix].rmax)
1231 return;
1234 option_usage_fp = stderr;
1236 emit_ranges:
1238 optionShowRange(pOptions, pOptDesc, (void *)rng, 1);
1241 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
1243 * Code to handle the x509crlfile option.
1245 * @param pOptions the gnutls-cli options data structure
1246 * @param pOptDesc the option descriptor for this option.
1248 static void
1249 doOptX509crlfile(tOptions* pOptions, tOptDesc* pOptDesc)
1251 static teOptFileType const type =
1252 FTYPE_MODE_MUST_EXIST + FTYPE_MODE_NO_OPEN;
1253 static tuFileMode mode;
1254 #ifndef O_CLOEXEC
1255 # define O_CLOEXEC 0
1256 #endif
1257 mode.file_flags = O_CLOEXEC;
1259 optionFileCheck(pOptions, pOptDesc, type, mode);
1262 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
1264 * Code to handle the pgpkeyfile option.
1266 * @param pOptions the gnutls-cli options data structure
1267 * @param pOptDesc the option descriptor for this option.
1269 static void
1270 doOptPgpkeyfile(tOptions* pOptions, tOptDesc* pOptDesc)
1272 static teOptFileType const type =
1273 FTYPE_MODE_MUST_EXIST + FTYPE_MODE_NO_OPEN;
1274 static tuFileMode mode;
1275 #ifndef O_CLOEXEC
1276 # define O_CLOEXEC 0
1277 #endif
1278 mode.file_flags = O_CLOEXEC;
1280 optionFileCheck(pOptions, pOptDesc, type, mode);
1283 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
1285 * Code to handle the pgpkeyring option.
1287 * @param pOptions the gnutls-cli options data structure
1288 * @param pOptDesc the option descriptor for this option.
1290 static void
1291 doOptPgpkeyring(tOptions* pOptions, tOptDesc* pOptDesc)
1293 static teOptFileType const type =
1294 FTYPE_MODE_MUST_EXIST + FTYPE_MODE_NO_OPEN;
1295 static tuFileMode mode;
1296 #ifndef O_CLOEXEC
1297 # define O_CLOEXEC 0
1298 #endif
1299 mode.file_flags = O_CLOEXEC;
1301 optionFileCheck(pOptions, pOptDesc, type, mode);
1304 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
1306 * Code to handle the pgpcertfile option.
1308 * @param pOptions the gnutls-cli options data structure
1309 * @param pOptDesc the option descriptor for this option.
1311 static void
1312 doOptPgpcertfile(tOptions* pOptions, tOptDesc* pOptDesc)
1314 static teOptFileType const type =
1315 FTYPE_MODE_MUST_EXIST + FTYPE_MODE_NO_OPEN;
1316 static tuFileMode mode;
1317 #ifndef O_CLOEXEC
1318 # define O_CLOEXEC 0
1319 #endif
1320 mode.file_flags = O_CLOEXEC;
1322 optionFileCheck(pOptions, pOptDesc, type, mode);
1324 /* extracted from optmain.tlib near line 1113 */
1327 * The directory containing the data associated with gnutls-cli.
1329 #ifndef PKGDATADIR
1330 # define PKGDATADIR ""
1331 #endif
1334 * Information about the person or institution that packaged gnutls-cli
1335 * for the current distribution.
1337 #ifndef WITH_PACKAGER
1338 # define gnutls_cli_packager_info NULL
1339 #else
1340 static char const gnutls_cli_packager_info[] =
1341 "Packaged by " WITH_PACKAGER
1343 # ifdef WITH_PACKAGER_VERSION
1344 " ("WITH_PACKAGER_VERSION")"
1345 # endif
1347 # ifdef WITH_PACKAGER_BUG_REPORTS
1348 "\nReport gnutls_cli bugs to " WITH_PACKAGER_BUG_REPORTS
1349 # endif
1350 "\n";
1351 #endif
1352 #ifndef __doxygen__
1354 #endif /* __doxygen__ */
1356 * The option definitions for gnutls-cli. The one structure that
1357 * binds them all.
1359 tOptions gnutls_cliOptions = {
1360 OPTIONS_STRUCT_VERSION,
1361 0, NULL, /* original argc + argv */
1362 ( OPTPROC_BASE
1363 + OPTPROC_ERRSTOP
1364 + OPTPROC_SHORTOPT
1365 + OPTPROC_LONGOPT
1366 + OPTPROC_NO_REQ_OPT
1367 + OPTPROC_NEGATIONS
1368 + OPTPROC_REORDER
1369 + OPTPROC_GNUUSAGE
1370 + OPTPROC_MISUSE ),
1371 0, NULL, /* current option index, current option */
1372 NULL, NULL, zPROGNAME,
1373 zRcName, zCopyright, zLicenseDescrip,
1374 zFullVersion, apzHomeList, zUsageTitle,
1375 zExplain, zDetail, optDesc,
1376 zBugsAddr, /* address to send bugs to */
1377 NULL, NULL, /* extensions/saved state */
1378 optionUsage, /* usage procedure */
1379 translate_option_strings, /* translation procedure */
1381 * Indexes to special options
1383 { INDEX_OPT_MORE_HELP, /* more-help option index */
1384 NO_EQUIVALENT, /* save option index */
1385 NO_EQUIVALENT, /* '-#' option index */
1386 NO_EQUIVALENT /* index of default opt */
1388 41 /* full option count */, 38 /* user option count */,
1389 gnutls_cli_full_usage, gnutls_cli_short_usage,
1390 NULL, NULL,
1391 PKGDATADIR, gnutls_cli_packager_info
1394 #if ENABLE_NLS
1395 #include <stdio.h>
1396 #include <stdlib.h>
1397 #include <string.h>
1398 #include <unistd.h>
1399 #include <autoopts/usage-txt.h>
1401 static char* AO_gettext(char const* pz);
1402 static void coerce_it(void** s);
1405 * AutoGen specific wrapper function for gettext.
1406 * It relies on the macro _() to convert from English to the target
1407 * language, then strdup-duplicates the result string.
1409 * @param[in] pz the input text used as a lookup key.
1410 * @returns the translated text (if there is one),
1411 * or the original text (if not).
1413 static char *
1414 AO_gettext(char const* pz)
1416 char* pzRes;
1417 if (pz == NULL)
1418 return NULL;
1419 pzRes = _(pz);
1420 if (pzRes == pz)
1421 return pzRes;
1422 pzRes = strdup(pzRes);
1423 if (pzRes == NULL) {
1424 fputs(_("No memory for duping translated strings\n"), stderr);
1425 exit(GNUTLS_CLI_EXIT_FAILURE);
1427 return pzRes;
1430 static void coerce_it(void** s) { *s = AO_gettext(*s);
1434 * Translate all the translatable strings in the gnutls_cliOptions
1435 * structure defined above. This is done only once.
1437 static void
1438 translate_option_strings(void)
1440 tOptions * const pOpt = &gnutls_cliOptions;
1443 * Guard against re-translation. It won't work. The strings will have
1444 * been changed by the first pass through this code. One shot only.
1446 if (option_usage_text.field_ct != 0) {
1448 * Do the translations. The first pointer follows the field count
1449 * field. The field count field is the size of a pointer.
1451 tOptDesc * pOD = pOpt->pOptDesc;
1452 char ** ppz = (char**)(void*)&(option_usage_text);
1453 int ix = option_usage_text.field_ct;
1455 do {
1456 ppz++;
1457 *ppz = AO_gettext(*ppz);
1458 } while (--ix > 0);
1460 coerce_it((void*)&(pOpt->pzCopyright));
1461 coerce_it((void*)&(pOpt->pzCopyNotice));
1462 coerce_it((void*)&(pOpt->pzFullVersion));
1463 coerce_it((void*)&(pOpt->pzUsageTitle));
1464 coerce_it((void*)&(pOpt->pzExplain));
1465 coerce_it((void*)&(pOpt->pzDetail));
1466 coerce_it((void*)&(pOpt->pzPackager));
1467 coerce_it((void*)&(pOpt->pzShortUsage));
1468 option_usage_text.field_ct = 0;
1470 for (ix = pOpt->optCt; ix > 0; ix--, pOD++)
1471 coerce_it((void*)&(pOD->pzText));
1474 if ((pOpt->fOptSet & OPTPROC_NXLAT_OPT_CFG) == 0) {
1475 tOptDesc * pOD = pOpt->pOptDesc;
1476 int ix;
1478 for (ix = pOpt->optCt; ix > 0; ix--, pOD++) {
1479 coerce_it((void*)&(pOD->pz_Name));
1480 coerce_it((void*)&(pOD->pz_DisableName));
1481 coerce_it((void*)&(pOD->pz_DisablePfx));
1483 /* prevent re-translation */
1484 gnutls_cliOptions.fOptSet |= OPTPROC_NXLAT_OPT_CFG | OPTPROC_NXLAT_OPT;
1488 #endif /* ENABLE_NLS */
1490 #ifdef __cplusplus
1492 #endif
1493 /* cli-args.c ends here */