doc update
[gnutls.git] / src / cli-args.c
blobd02345d35dc3216405780468f17f478b01a1d001
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 November 1, 2012 at 03:36:16 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[3856] =
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 DANE certificate verification (DNSSEC)\0"
98 /* 1059 */ "DANE\0"
99 /* 1064 */ "no-dane\0"
100 /* 1072 */ "Use the local DNS server for DNSSEC resolving.\0"
101 /* 1119 */ "LOCAL_DNS\0"
102 /* 1129 */ "no-local-dns\0"
103 /* 1142 */ "Disable CA certificate verification\0"
104 /* 1178 */ "CA_VERIFICATION\0"
105 /* 1194 */ "no-ca-verification\0"
106 /* 1213 */ "Enable OCSP certificate verification\0"
107 /* 1250 */ "OCSP\0"
108 /* 1255 */ "no-ocsp\0"
109 /* 1263 */ "Establish a session and resume\0"
110 /* 1294 */ "RESUME\0"
111 /* 1301 */ "resume\0"
112 /* 1308 */ "Activate heartbeat support\0"
113 /* 1335 */ "HEARTBEAT\0"
114 /* 1345 */ "heartbeat\0"
115 /* 1355 */ "Establish a session and rehandshake\0"
116 /* 1391 */ "REHANDSHAKE\0"
117 /* 1403 */ "rehandshake\0"
118 /* 1415 */ "Don't accept session tickets\0"
119 /* 1444 */ "NOTICKET\0"
120 /* 1453 */ "noticket\0"
121 /* 1462 */ "Enable OCSP status request\0"
122 /* 1489 */ "OCSP_STATUS_REQUEST\0"
123 /* 1509 */ "no-ocsp-status-request\0"
124 /* 1532 */ "Connect, establish a plain session and start TLS.\0"
125 /* 1582 */ "STARTTLS\0"
126 /* 1591 */ "starttls\0"
127 /* 1600 */ "Use DTLS (datagram TLS) over UDP\0"
128 /* 1633 */ "UDP\0"
129 /* 1637 */ "udp\0"
130 /* 1641 */ "Set MTU for datagram TLS\0"
131 /* 1666 */ "MTU\0"
132 /* 1670 */ "mtu\0"
133 /* 1674 */ "Offer SRTP profiles\0"
134 /* 1694 */ "SRTP_PROFILES\0"
135 /* 1708 */ "srtp-profiles\0"
136 /* 1722 */ "Send CR LF instead of LF\0"
137 /* 1747 */ "CRLF\0"
138 /* 1752 */ "crlf\0"
139 /* 1757 */ "Use DER format for certificates to read from\0"
140 /* 1802 */ "X509FMTDER\0"
141 /* 1813 */ "x509fmtder\0"
142 /* 1824 */ "Send the openpgp fingerprint, instead of the key\0"
143 /* 1873 */ "FINGERPRINT\0"
144 /* 1885 */ "fingerprint\0"
145 /* 1897 */ "Disable all the TLS extensions\0"
146 /* 1928 */ "DISABLE_EXTENSIONS\0"
147 /* 1947 */ "disable-extensions\0"
148 /* 1966 */ "Print peer's certificate in PEM format\0"
149 /* 2005 */ "PRINT_CERT\0"
150 /* 2016 */ "print-cert\0"
151 /* 2027 */ "The maximum record size to advertize\0"
152 /* 2064 */ "RECORDSIZE\0"
153 /* 2075 */ "recordsize\0"
154 /* 2086 */ "The minimum number of bits allowed for DH\0"
155 /* 2128 */ "DH_BITS\0"
156 /* 2136 */ "dh-bits\0"
157 /* 2144 */ "Priorities string\0"
158 /* 2162 */ "PRIORITY\0"
159 /* 2171 */ "priority\0"
160 /* 2180 */ "Certificate file or PKCS #11 URL to use\0"
161 /* 2220 */ "X509CAFILE\0"
162 /* 2231 */ "x509cafile\0"
163 /* 2242 */ "CRL file to use\0"
164 /* 2258 */ "X509CRLFILE\0"
165 /* 2270 */ "x509crlfile\0"
166 /* 2282 */ "PGP Key file to use\0"
167 /* 2302 */ "PGPKEYFILE\0"
168 /* 2313 */ "pgpkeyfile\0"
169 /* 2324 */ "PGP Key ring file to use\0"
170 /* 2349 */ "PGPKEYRING\0"
171 /* 2360 */ "pgpkeyring\0"
172 /* 2371 */ "PGP Public Key (certificate) file to use\0"
173 /* 2412 */ "PGPCERTFILE\0"
174 /* 2424 */ "pgpcertfile\0"
175 /* 2436 */ "X.509 key file or PKCS #11 URL to use\0"
176 /* 2474 */ "X509KEYFILE\0"
177 /* 2486 */ "x509keyfile\0"
178 /* 2498 */ "X.509 Certificate file or PKCS #11 URL to use\0"
179 /* 2544 */ "X509CERTFILE\0"
180 /* 2557 */ "x509certfile\0"
181 /* 2570 */ "PGP subkey to use (hex or auto)\0"
182 /* 2602 */ "PGPSUBKEY\0"
183 /* 2612 */ "pgpsubkey\0"
184 /* 2622 */ "SRP username to use\0"
185 /* 2642 */ "SRPUSERNAME\0"
186 /* 2654 */ "srpusername\0"
187 /* 2666 */ "SRP password to use\0"
188 /* 2686 */ "SRPPASSWD\0"
189 /* 2696 */ "srppasswd\0"
190 /* 2706 */ "PSK username to use\0"
191 /* 2726 */ "PSKUSERNAME\0"
192 /* 2738 */ "pskusername\0"
193 /* 2750 */ "PSK key (in hex) to use\0"
194 /* 2774 */ "PSKKEY\0"
195 /* 2781 */ "pskkey\0"
196 /* 2788 */ "The port or service to connect to\0"
197 /* 2822 */ "PORT\0"
198 /* 2827 */ "port\0"
199 /* 2832 */ "Don't abort program if server certificate can't be validated\0"
200 /* 2893 */ "INSECURE\0"
201 /* 2902 */ "insecure\0"
202 /* 2911 */ "Benchmark individual ciphers\0"
203 /* 2940 */ "BENCHMARK_CIPHERS\0"
204 /* 2958 */ "benchmark-ciphers\0"
205 /* 2976 */ "Benchmark individual software ciphers (no hw acceleration)\0"
206 /* 3035 */ "BENCHMARK_SOFT_CIPHERS\0"
207 /* 3058 */ "benchmark-soft-ciphers\0"
208 /* 3081 */ "Benchmark TLS key exchange methods\0"
209 /* 3116 */ "BENCHMARK_TLS_KX\0"
210 /* 3133 */ "benchmark-tls-kx\0"
211 /* 3150 */ "Benchmark TLS ciphers\0"
212 /* 3172 */ "BENCHMARK_TLS_CIPHERS\0"
213 /* 3194 */ "benchmark-tls-ciphers\0"
214 /* 3216 */ "Print a list of the supported algorithms and modes\0"
215 /* 3267 */ "LIST\0"
216 /* 3272 */ "list\0"
217 /* 3277 */ "Display extended usage information and exit\0"
218 /* 3321 */ "help\0"
219 /* 3326 */ "Extended usage information passed thru pager\0"
220 /* 3371 */ "more-help\0"
221 /* 3381 */ "Output version information and exit\0"
222 /* 3417 */ "version\0"
223 /* 3425 */ "GNUTLS_CLI\0"
224 /* 3436 */ "gnutls-cli - GnuTLS client - Ver. @VERSION@\n"
225 "USAGE: %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]... [hostname]\n\0"
226 /* 3549 */ "bug-gnutls@gnu.org\0"
227 /* 3568 */ "\n\n\0"
228 /* 3571 */ "\n"
229 "Simple client program to set up a TLS connection to some other computer. It\n"
230 "sets up a TLS connection and forwards data from the standard input to the\n"
231 "secured socket and vice versa.\n\0"
232 /* 3755 */ "gnutls-cli @VERSION@\0"
233 /* 3776 */ "Usage: gnutls-cli [options] hostname\n"
234 "gnutls-cli --help for usage instructions.\n";
237 * debug option description:
239 #define DEBUG_DESC (gnutls_cli_opt_strs+890)
240 #define DEBUG_NAME (gnutls_cli_opt_strs+908)
241 #define DEBUG_name (gnutls_cli_opt_strs+914)
242 #define DEBUG_FLAGS (OPTST_DISABLED \
243 | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC))
246 * verbose option description:
248 #define VERBOSE_DESC (gnutls_cli_opt_strs+920)
249 #define VERBOSE_NAME (gnutls_cli_opt_strs+940)
250 #define VERBOSE_name (gnutls_cli_opt_strs+948)
251 #define VERBOSE_FLAGS (OPTST_DISABLED)
254 * tofu option description:
256 #define TOFU_DESC (gnutls_cli_opt_strs+956)
257 #define TOFU_NAME (gnutls_cli_opt_strs+997)
258 #define NOT_TOFU_name (gnutls_cli_opt_strs+1002)
259 #define NOT_TOFU_PFX (gnutls_cli_opt_strs+1010)
260 #define TOFU_name (NOT_TOFU_name + 3)
261 #define TOFU_FLAGS (OPTST_DISABLED)
264 * dane option description:
266 #define DANE_DESC (gnutls_cli_opt_strs+1013)
267 #define DANE_NAME (gnutls_cli_opt_strs+1059)
268 #define NOT_DANE_name (gnutls_cli_opt_strs+1064)
269 #define NOT_DANE_PFX (gnutls_cli_opt_strs+1010)
270 #define DANE_name (NOT_DANE_name + 3)
271 #define DANE_FLAGS (OPTST_DISABLED)
274 * local-dns option description:
276 #define LOCAL_DNS_DESC (gnutls_cli_opt_strs+1072)
277 #define LOCAL_DNS_NAME (gnutls_cli_opt_strs+1119)
278 #define NOT_LOCAL_DNS_name (gnutls_cli_opt_strs+1129)
279 #define NOT_LOCAL_DNS_PFX (gnutls_cli_opt_strs+1010)
280 #define LOCAL_DNS_name (NOT_LOCAL_DNS_name + 3)
281 #define LOCAL_DNS_FLAGS (OPTST_DISABLED)
284 * ca-verification option description:
286 #define CA_VERIFICATION_DESC (gnutls_cli_opt_strs+1142)
287 #define CA_VERIFICATION_NAME (gnutls_cli_opt_strs+1178)
288 #define NOT_CA_VERIFICATION_name (gnutls_cli_opt_strs+1194)
289 #define NOT_CA_VERIFICATION_PFX (gnutls_cli_opt_strs+1010)
290 #define CA_VERIFICATION_name (NOT_CA_VERIFICATION_name + 3)
291 #define CA_VERIFICATION_FLAGS (OPTST_INITENABLED)
294 * ocsp option description:
296 #define OCSP_DESC (gnutls_cli_opt_strs+1213)
297 #define OCSP_NAME (gnutls_cli_opt_strs+1250)
298 #define NOT_OCSP_name (gnutls_cli_opt_strs+1255)
299 #define NOT_OCSP_PFX (gnutls_cli_opt_strs+1010)
300 #define OCSP_name (NOT_OCSP_name + 3)
301 #define OCSP_FLAGS (OPTST_DISABLED)
304 * resume option description:
306 #define RESUME_DESC (gnutls_cli_opt_strs+1263)
307 #define RESUME_NAME (gnutls_cli_opt_strs+1294)
308 #define RESUME_name (gnutls_cli_opt_strs+1301)
309 #define RESUME_FLAGS (OPTST_DISABLED)
312 * heartbeat option description:
314 #define HEARTBEAT_DESC (gnutls_cli_opt_strs+1308)
315 #define HEARTBEAT_NAME (gnutls_cli_opt_strs+1335)
316 #define HEARTBEAT_name (gnutls_cli_opt_strs+1345)
317 #define HEARTBEAT_FLAGS (OPTST_DISABLED)
320 * rehandshake option description:
322 #define REHANDSHAKE_DESC (gnutls_cli_opt_strs+1355)
323 #define REHANDSHAKE_NAME (gnutls_cli_opt_strs+1391)
324 #define REHANDSHAKE_name (gnutls_cli_opt_strs+1403)
325 #define REHANDSHAKE_FLAGS (OPTST_DISABLED)
328 * noticket option description:
330 #define NOTICKET_DESC (gnutls_cli_opt_strs+1415)
331 #define NOTICKET_NAME (gnutls_cli_opt_strs+1444)
332 #define NOTICKET_name (gnutls_cli_opt_strs+1453)
333 #define NOTICKET_FLAGS (OPTST_DISABLED)
336 * ocsp-status-request option description:
338 #define OCSP_STATUS_REQUEST_DESC (gnutls_cli_opt_strs+1462)
339 #define OCSP_STATUS_REQUEST_NAME (gnutls_cli_opt_strs+1489)
340 #define NOT_OCSP_STATUS_REQUEST_name (gnutls_cli_opt_strs+1509)
341 #define NOT_OCSP_STATUS_REQUEST_PFX (gnutls_cli_opt_strs+1010)
342 #define OCSP_STATUS_REQUEST_name (NOT_OCSP_STATUS_REQUEST_name + 3)
343 #define OCSP_STATUS_REQUEST_FLAGS (OPTST_INITENABLED)
346 * starttls option description:
348 #define STARTTLS_DESC (gnutls_cli_opt_strs+1532)
349 #define STARTTLS_NAME (gnutls_cli_opt_strs+1582)
350 #define STARTTLS_name (gnutls_cli_opt_strs+1591)
351 #define STARTTLS_FLAGS (OPTST_DISABLED)
354 * udp option description:
356 #define UDP_DESC (gnutls_cli_opt_strs+1600)
357 #define UDP_NAME (gnutls_cli_opt_strs+1633)
358 #define UDP_name (gnutls_cli_opt_strs+1637)
359 #define UDP_FLAGS (OPTST_DISABLED)
362 * mtu option description:
364 #define MTU_DESC (gnutls_cli_opt_strs+1641)
365 #define MTU_NAME (gnutls_cli_opt_strs+1666)
366 #define MTU_name (gnutls_cli_opt_strs+1670)
367 #define MTU_FLAGS (OPTST_DISABLED \
368 | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC))
371 * srtp_profiles option description:
373 #define SRTP_PROFILES_DESC (gnutls_cli_opt_strs+1674)
374 #define SRTP_PROFILES_NAME (gnutls_cli_opt_strs+1694)
375 #define SRTP_PROFILES_name (gnutls_cli_opt_strs+1708)
376 #define SRTP_PROFILES_FLAGS (OPTST_DISABLED \
377 | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
380 * crlf option description:
382 #define CRLF_DESC (gnutls_cli_opt_strs+1722)
383 #define CRLF_NAME (gnutls_cli_opt_strs+1747)
384 #define CRLF_name (gnutls_cli_opt_strs+1752)
385 #define CRLF_FLAGS (OPTST_DISABLED)
388 * x509fmtder option description:
390 #define X509FMTDER_DESC (gnutls_cli_opt_strs+1757)
391 #define X509FMTDER_NAME (gnutls_cli_opt_strs+1802)
392 #define X509FMTDER_name (gnutls_cli_opt_strs+1813)
393 #define X509FMTDER_FLAGS (OPTST_DISABLED)
396 * fingerprint option description:
398 #define FINGERPRINT_DESC (gnutls_cli_opt_strs+1824)
399 #define FINGERPRINT_NAME (gnutls_cli_opt_strs+1873)
400 #define FINGERPRINT_name (gnutls_cli_opt_strs+1885)
401 #define FINGERPRINT_FLAGS (OPTST_DISABLED)
404 * disable-extensions option description:
406 #define DISABLE_EXTENSIONS_DESC (gnutls_cli_opt_strs+1897)
407 #define DISABLE_EXTENSIONS_NAME (gnutls_cli_opt_strs+1928)
408 #define DISABLE_EXTENSIONS_name (gnutls_cli_opt_strs+1947)
409 #define DISABLE_EXTENSIONS_FLAGS (OPTST_DISABLED)
412 * print-cert option description:
414 #define PRINT_CERT_DESC (gnutls_cli_opt_strs+1966)
415 #define PRINT_CERT_NAME (gnutls_cli_opt_strs+2005)
416 #define PRINT_CERT_name (gnutls_cli_opt_strs+2016)
417 #define PRINT_CERT_FLAGS (OPTST_DISABLED)
420 * recordsize option description:
422 #define RECORDSIZE_DESC (gnutls_cli_opt_strs+2027)
423 #define RECORDSIZE_NAME (gnutls_cli_opt_strs+2064)
424 #define RECORDSIZE_name (gnutls_cli_opt_strs+2075)
425 #define RECORDSIZE_FLAGS (OPTST_DISABLED \
426 | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC))
429 * dh-bits option description:
431 #define DH_BITS_DESC (gnutls_cli_opt_strs+2086)
432 #define DH_BITS_NAME (gnutls_cli_opt_strs+2128)
433 #define DH_BITS_name (gnutls_cli_opt_strs+2136)
434 #define DH_BITS_FLAGS (OPTST_DISABLED \
435 | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC))
438 * priority option description:
440 #define PRIORITY_DESC (gnutls_cli_opt_strs+2144)
441 #define PRIORITY_NAME (gnutls_cli_opt_strs+2162)
442 #define PRIORITY_name (gnutls_cli_opt_strs+2171)
443 #define PRIORITY_FLAGS (OPTST_DISABLED \
444 | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
447 * x509cafile option description:
449 #define X509CAFILE_DESC (gnutls_cli_opt_strs+2180)
450 #define X509CAFILE_NAME (gnutls_cli_opt_strs+2220)
451 #define X509CAFILE_name (gnutls_cli_opt_strs+2231)
452 #define X509CAFILE_FLAGS (OPTST_DISABLED \
453 | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
456 * x509crlfile option description:
458 #define X509CRLFILE_DESC (gnutls_cli_opt_strs+2242)
459 #define X509CRLFILE_NAME (gnutls_cli_opt_strs+2258)
460 #define X509CRLFILE_name (gnutls_cli_opt_strs+2270)
461 #define X509CRLFILE_FLAGS (OPTST_DISABLED \
462 | OPTST_SET_ARGTYPE(OPARG_TYPE_FILE))
465 * pgpkeyfile option description:
467 #define PGPKEYFILE_DESC (gnutls_cli_opt_strs+2282)
468 #define PGPKEYFILE_NAME (gnutls_cli_opt_strs+2302)
469 #define PGPKEYFILE_name (gnutls_cli_opt_strs+2313)
470 #define PGPKEYFILE_FLAGS (OPTST_DISABLED \
471 | OPTST_SET_ARGTYPE(OPARG_TYPE_FILE))
474 * pgpkeyring option description:
476 #define PGPKEYRING_DESC (gnutls_cli_opt_strs+2324)
477 #define PGPKEYRING_NAME (gnutls_cli_opt_strs+2349)
478 #define PGPKEYRING_name (gnutls_cli_opt_strs+2360)
479 #define PGPKEYRING_FLAGS (OPTST_DISABLED \
480 | OPTST_SET_ARGTYPE(OPARG_TYPE_FILE))
483 * pgpcertfile option description:
485 #define PGPCERTFILE_DESC (gnutls_cli_opt_strs+2371)
486 #define PGPCERTFILE_NAME (gnutls_cli_opt_strs+2412)
487 #define PGPCERTFILE_name (gnutls_cli_opt_strs+2424)
488 #define PGPCERTFILE_FLAGS (OPTST_DISABLED \
489 | OPTST_SET_ARGTYPE(OPARG_TYPE_FILE))
492 * x509keyfile option description:
494 #define X509KEYFILE_DESC (gnutls_cli_opt_strs+2436)
495 #define X509KEYFILE_NAME (gnutls_cli_opt_strs+2474)
496 #define X509KEYFILE_name (gnutls_cli_opt_strs+2486)
497 #define X509KEYFILE_FLAGS (OPTST_DISABLED \
498 | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
501 * x509certfile option description:
503 #define X509CERTFILE_DESC (gnutls_cli_opt_strs+2498)
504 #define X509CERTFILE_NAME (gnutls_cli_opt_strs+2544)
505 #define X509CERTFILE_name (gnutls_cli_opt_strs+2557)
506 #define X509CERTFILE_FLAGS (OPTST_DISABLED \
507 | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
510 * pgpsubkey option description:
512 #define PGPSUBKEY_DESC (gnutls_cli_opt_strs+2570)
513 #define PGPSUBKEY_NAME (gnutls_cli_opt_strs+2602)
514 #define PGPSUBKEY_name (gnutls_cli_opt_strs+2612)
515 #define PGPSUBKEY_FLAGS (OPTST_DISABLED \
516 | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
519 * srpusername option description:
521 #define SRPUSERNAME_DESC (gnutls_cli_opt_strs+2622)
522 #define SRPUSERNAME_NAME (gnutls_cli_opt_strs+2642)
523 #define SRPUSERNAME_name (gnutls_cli_opt_strs+2654)
524 #define SRPUSERNAME_FLAGS (OPTST_DISABLED \
525 | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
528 * srppasswd option description:
530 #define SRPPASSWD_DESC (gnutls_cli_opt_strs+2666)
531 #define SRPPASSWD_NAME (gnutls_cli_opt_strs+2686)
532 #define SRPPASSWD_name (gnutls_cli_opt_strs+2696)
533 #define SRPPASSWD_FLAGS (OPTST_DISABLED \
534 | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
537 * pskusername option description:
539 #define PSKUSERNAME_DESC (gnutls_cli_opt_strs+2706)
540 #define PSKUSERNAME_NAME (gnutls_cli_opt_strs+2726)
541 #define PSKUSERNAME_name (gnutls_cli_opt_strs+2738)
542 #define PSKUSERNAME_FLAGS (OPTST_DISABLED \
543 | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
546 * pskkey option description:
548 #define PSKKEY_DESC (gnutls_cli_opt_strs+2750)
549 #define PSKKEY_NAME (gnutls_cli_opt_strs+2774)
550 #define PSKKEY_name (gnutls_cli_opt_strs+2781)
551 #define PSKKEY_FLAGS (OPTST_DISABLED \
552 | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
555 * port option description:
557 #define PORT_DESC (gnutls_cli_opt_strs+2788)
558 #define PORT_NAME (gnutls_cli_opt_strs+2822)
559 #define PORT_name (gnutls_cli_opt_strs+2827)
560 #define PORT_FLAGS (OPTST_DISABLED \
561 | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
564 * insecure option description:
566 #define INSECURE_DESC (gnutls_cli_opt_strs+2832)
567 #define INSECURE_NAME (gnutls_cli_opt_strs+2893)
568 #define INSECURE_name (gnutls_cli_opt_strs+2902)
569 #define INSECURE_FLAGS (OPTST_DISABLED)
572 * benchmark-ciphers option description:
574 #define BENCHMARK_CIPHERS_DESC (gnutls_cli_opt_strs+2911)
575 #define BENCHMARK_CIPHERS_NAME (gnutls_cli_opt_strs+2940)
576 #define BENCHMARK_CIPHERS_name (gnutls_cli_opt_strs+2958)
577 #define BENCHMARK_CIPHERS_FLAGS (OPTST_DISABLED)
580 * benchmark-soft-ciphers option description:
582 #define BENCHMARK_SOFT_CIPHERS_DESC (gnutls_cli_opt_strs+2976)
583 #define BENCHMARK_SOFT_CIPHERS_NAME (gnutls_cli_opt_strs+3035)
584 #define BENCHMARK_SOFT_CIPHERS_name (gnutls_cli_opt_strs+3058)
585 #define BENCHMARK_SOFT_CIPHERS_FLAGS (OPTST_DISABLED)
588 * benchmark-tls-kx option description:
590 #define BENCHMARK_TLS_KX_DESC (gnutls_cli_opt_strs+3081)
591 #define BENCHMARK_TLS_KX_NAME (gnutls_cli_opt_strs+3116)
592 #define BENCHMARK_TLS_KX_name (gnutls_cli_opt_strs+3133)
593 #define BENCHMARK_TLS_KX_FLAGS (OPTST_DISABLED)
596 * benchmark-tls-ciphers option description:
598 #define BENCHMARK_TLS_CIPHERS_DESC (gnutls_cli_opt_strs+3150)
599 #define BENCHMARK_TLS_CIPHERS_NAME (gnutls_cli_opt_strs+3172)
600 #define BENCHMARK_TLS_CIPHERS_name (gnutls_cli_opt_strs+3194)
601 #define BENCHMARK_TLS_CIPHERS_FLAGS (OPTST_DISABLED)
604 * list option description:
606 #define LIST_DESC (gnutls_cli_opt_strs+3216)
607 #define LIST_NAME (gnutls_cli_opt_strs+3267)
608 #define LIST_name (gnutls_cli_opt_strs+3272)
609 #define LIST_FLAGS (OPTST_DISABLED)
612 * Help/More_Help/Version option descriptions:
614 #define HELP_DESC (gnutls_cli_opt_strs+3277)
615 #define HELP_name (gnutls_cli_opt_strs+3321)
616 #ifdef HAVE_WORKING_FORK
617 #define MORE_HELP_DESC (gnutls_cli_opt_strs+3326)
618 #define MORE_HELP_name (gnutls_cli_opt_strs+3371)
619 #define MORE_HELP_FLAGS (OPTST_IMM | OPTST_NO_INIT)
620 #else
621 #define MORE_HELP_DESC NULL
622 #define MORE_HELP_name NULL
623 #define MORE_HELP_FLAGS (OPTST_OMITTED | OPTST_NO_INIT)
624 #endif
625 #ifdef NO_OPTIONAL_OPT_ARGS
626 # define VER_FLAGS (OPTST_IMM | OPTST_NO_INIT)
627 #else
628 # define VER_FLAGS (OPTST_SET_ARGTYPE(OPARG_TYPE_STRING) | \
629 OPTST_ARG_OPTIONAL | OPTST_IMM | OPTST_NO_INIT)
630 #endif
631 #define VER_DESC (gnutls_cli_opt_strs+3381)
632 #define VER_name (gnutls_cli_opt_strs+3417)
634 * Declare option callback procedures
636 extern tOptProc
637 optionBooleanVal, optionNestedVal, optionNumericVal,
638 optionPagedUsage, optionPrintVersion, optionResetOpt,
639 optionStackArg, optionTimeDate, optionTimeVal,
640 optionUnstackArg, optionVendorOption;
641 static tOptProc
642 doOptDebug, doOptMtu, doOptPgpcertfile, doOptPgpkeyfile,
643 doOptPgpkeyring, doOptRecordsize, doOptX509crlfile, doUsageOpt;
644 #define VER_PROC optionPrintVersion
646 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
648 * Define the gnutls-cli Option Descriptions.
649 * This is an array of OPTION_CT entries, one for each
650 * option that the gnutls-cli program responds to.
652 static tOptDesc optDesc[OPTION_CT] = {
653 { /* entry idx, value */ 0, VALUE_OPT_DEBUG,
654 /* equiv idx, value */ 0, VALUE_OPT_DEBUG,
655 /* equivalenced to */ NO_EQUIVALENT,
656 /* min, max, act ct */ 0, 1, 0,
657 /* opt state flags */ DEBUG_FLAGS, 0,
658 /* last opt argumnt */ { NULL }, /* --debug */
659 /* arg list/cookie */ NULL,
660 /* must/cannot opts */ NULL, NULL,
661 /* option proc */ doOptDebug,
662 /* desc, NAME, name */ DEBUG_DESC, DEBUG_NAME, DEBUG_name,
663 /* disablement strs */ NULL, NULL },
665 { /* entry idx, value */ 1, VALUE_OPT_VERBOSE,
666 /* equiv idx, value */ 1, VALUE_OPT_VERBOSE,
667 /* equivalenced to */ NO_EQUIVALENT,
668 /* min, max, act ct */ 0, NOLIMIT, 0,
669 /* opt state flags */ VERBOSE_FLAGS, 0,
670 /* last opt argumnt */ { NULL }, /* --verbose */
671 /* arg list/cookie */ NULL,
672 /* must/cannot opts */ NULL, NULL,
673 /* option proc */ NULL,
674 /* desc, NAME, name */ VERBOSE_DESC, VERBOSE_NAME, VERBOSE_name,
675 /* disablement strs */ NULL, NULL },
677 { /* entry idx, value */ 2, VALUE_OPT_TOFU,
678 /* equiv idx, value */ 2, VALUE_OPT_TOFU,
679 /* equivalenced to */ NO_EQUIVALENT,
680 /* min, max, act ct */ 0, 1, 0,
681 /* opt state flags */ TOFU_FLAGS, 0,
682 /* last opt argumnt */ { NULL }, /* --tofu */
683 /* arg list/cookie */ NULL,
684 /* must/cannot opts */ NULL, NULL,
685 /* option proc */ NULL,
686 /* desc, NAME, name */ TOFU_DESC, TOFU_NAME, TOFU_name,
687 /* disablement strs */ NOT_TOFU_name, NOT_TOFU_PFX },
689 { /* entry idx, value */ 3, VALUE_OPT_DANE,
690 /* equiv idx, value */ 3, VALUE_OPT_DANE,
691 /* equivalenced to */ NO_EQUIVALENT,
692 /* min, max, act ct */ 0, 1, 0,
693 /* opt state flags */ DANE_FLAGS, 0,
694 /* last opt argumnt */ { NULL }, /* --dane */
695 /* arg list/cookie */ NULL,
696 /* must/cannot opts */ NULL, NULL,
697 /* option proc */ NULL,
698 /* desc, NAME, name */ DANE_DESC, DANE_NAME, DANE_name,
699 /* disablement strs */ NOT_DANE_name, NOT_DANE_PFX },
701 { /* entry idx, value */ 4, VALUE_OPT_LOCAL_DNS,
702 /* equiv idx, value */ 4, VALUE_OPT_LOCAL_DNS,
703 /* equivalenced to */ NO_EQUIVALENT,
704 /* min, max, act ct */ 0, 1, 0,
705 /* opt state flags */ LOCAL_DNS_FLAGS, 0,
706 /* last opt argumnt */ { NULL }, /* --local-dns */
707 /* arg list/cookie */ NULL,
708 /* must/cannot opts */ NULL, NULL,
709 /* option proc */ NULL,
710 /* desc, NAME, name */ LOCAL_DNS_DESC, LOCAL_DNS_NAME, LOCAL_DNS_name,
711 /* disablement strs */ NOT_LOCAL_DNS_name, NOT_LOCAL_DNS_PFX },
713 { /* entry idx, value */ 5, VALUE_OPT_CA_VERIFICATION,
714 /* equiv idx, value */ 5, VALUE_OPT_CA_VERIFICATION,
715 /* equivalenced to */ NO_EQUIVALENT,
716 /* min, max, act ct */ 0, 1, 0,
717 /* opt state flags */ CA_VERIFICATION_FLAGS, 0,
718 /* last opt argumnt */ { NULL }, /* --ca-verification */
719 /* arg list/cookie */ NULL,
720 /* must/cannot opts */ NULL, NULL,
721 /* option proc */ NULL,
722 /* desc, NAME, name */ CA_VERIFICATION_DESC, CA_VERIFICATION_NAME, CA_VERIFICATION_name,
723 /* disablement strs */ NOT_CA_VERIFICATION_name, NOT_CA_VERIFICATION_PFX },
725 { /* entry idx, value */ 6, VALUE_OPT_OCSP,
726 /* equiv idx, value */ 6, VALUE_OPT_OCSP,
727 /* equivalenced to */ NO_EQUIVALENT,
728 /* min, max, act ct */ 0, 1, 0,
729 /* opt state flags */ OCSP_FLAGS, 0,
730 /* last opt argumnt */ { NULL }, /* --ocsp */
731 /* arg list/cookie */ NULL,
732 /* must/cannot opts */ NULL, NULL,
733 /* option proc */ NULL,
734 /* desc, NAME, name */ OCSP_DESC, OCSP_NAME, OCSP_name,
735 /* disablement strs */ NOT_OCSP_name, NOT_OCSP_PFX },
737 { /* entry idx, value */ 7, VALUE_OPT_RESUME,
738 /* equiv idx, value */ 7, VALUE_OPT_RESUME,
739 /* equivalenced to */ NO_EQUIVALENT,
740 /* min, max, act ct */ 0, 1, 0,
741 /* opt state flags */ RESUME_FLAGS, 0,
742 /* last opt argumnt */ { NULL }, /* --resume */
743 /* arg list/cookie */ NULL,
744 /* must/cannot opts */ NULL, NULL,
745 /* option proc */ NULL,
746 /* desc, NAME, name */ RESUME_DESC, RESUME_NAME, RESUME_name,
747 /* disablement strs */ NULL, NULL },
749 { /* entry idx, value */ 8, VALUE_OPT_HEARTBEAT,
750 /* equiv idx, value */ 8, VALUE_OPT_HEARTBEAT,
751 /* equivalenced to */ NO_EQUIVALENT,
752 /* min, max, act ct */ 0, 1, 0,
753 /* opt state flags */ HEARTBEAT_FLAGS, 0,
754 /* last opt argumnt */ { NULL }, /* --heartbeat */
755 /* arg list/cookie */ NULL,
756 /* must/cannot opts */ NULL, NULL,
757 /* option proc */ NULL,
758 /* desc, NAME, name */ HEARTBEAT_DESC, HEARTBEAT_NAME, HEARTBEAT_name,
759 /* disablement strs */ NULL, NULL },
761 { /* entry idx, value */ 9, VALUE_OPT_REHANDSHAKE,
762 /* equiv idx, value */ 9, VALUE_OPT_REHANDSHAKE,
763 /* equivalenced to */ NO_EQUIVALENT,
764 /* min, max, act ct */ 0, 1, 0,
765 /* opt state flags */ REHANDSHAKE_FLAGS, 0,
766 /* last opt argumnt */ { NULL }, /* --rehandshake */
767 /* arg list/cookie */ NULL,
768 /* must/cannot opts */ NULL, NULL,
769 /* option proc */ NULL,
770 /* desc, NAME, name */ REHANDSHAKE_DESC, REHANDSHAKE_NAME, REHANDSHAKE_name,
771 /* disablement strs */ NULL, NULL },
773 { /* entry idx, value */ 10, VALUE_OPT_NOTICKET,
774 /* equiv idx, value */ 10, VALUE_OPT_NOTICKET,
775 /* equivalenced to */ NO_EQUIVALENT,
776 /* min, max, act ct */ 0, 1, 0,
777 /* opt state flags */ NOTICKET_FLAGS, 0,
778 /* last opt argumnt */ { NULL }, /* --noticket */
779 /* arg list/cookie */ NULL,
780 /* must/cannot opts */ NULL, NULL,
781 /* option proc */ NULL,
782 /* desc, NAME, name */ NOTICKET_DESC, NOTICKET_NAME, NOTICKET_name,
783 /* disablement strs */ NULL, NULL },
785 { /* entry idx, value */ 11, VALUE_OPT_OCSP_STATUS_REQUEST,
786 /* equiv idx, value */ 11, VALUE_OPT_OCSP_STATUS_REQUEST,
787 /* equivalenced to */ NO_EQUIVALENT,
788 /* min, max, act ct */ 0, 1, 0,
789 /* opt state flags */ OCSP_STATUS_REQUEST_FLAGS, 0,
790 /* last opt argumnt */ { NULL }, /* --ocsp-status-request */
791 /* arg list/cookie */ NULL,
792 /* must/cannot opts */ NULL, NULL,
793 /* option proc */ NULL,
794 /* desc, NAME, name */ OCSP_STATUS_REQUEST_DESC, OCSP_STATUS_REQUEST_NAME, OCSP_STATUS_REQUEST_name,
795 /* disablement strs */ NOT_OCSP_STATUS_REQUEST_name, NOT_OCSP_STATUS_REQUEST_PFX },
797 { /* entry idx, value */ 12, VALUE_OPT_STARTTLS,
798 /* equiv idx, value */ 12, VALUE_OPT_STARTTLS,
799 /* equivalenced to */ NO_EQUIVALENT,
800 /* min, max, act ct */ 0, 1, 0,
801 /* opt state flags */ STARTTLS_FLAGS, 0,
802 /* last opt argumnt */ { NULL }, /* --starttls */
803 /* arg list/cookie */ NULL,
804 /* must/cannot opts */ NULL, NULL,
805 /* option proc */ NULL,
806 /* desc, NAME, name */ STARTTLS_DESC, STARTTLS_NAME, STARTTLS_name,
807 /* disablement strs */ NULL, NULL },
809 { /* entry idx, value */ 13, VALUE_OPT_UDP,
810 /* equiv idx, value */ 13, VALUE_OPT_UDP,
811 /* equivalenced to */ NO_EQUIVALENT,
812 /* min, max, act ct */ 0, 1, 0,
813 /* opt state flags */ UDP_FLAGS, 0,
814 /* last opt argumnt */ { NULL }, /* --udp */
815 /* arg list/cookie */ NULL,
816 /* must/cannot opts */ NULL, NULL,
817 /* option proc */ NULL,
818 /* desc, NAME, name */ UDP_DESC, UDP_NAME, UDP_name,
819 /* disablement strs */ NULL, NULL },
821 { /* entry idx, value */ 14, VALUE_OPT_MTU,
822 /* equiv idx, value */ 14, VALUE_OPT_MTU,
823 /* equivalenced to */ NO_EQUIVALENT,
824 /* min, max, act ct */ 0, 1, 0,
825 /* opt state flags */ MTU_FLAGS, 0,
826 /* last opt argumnt */ { NULL }, /* --mtu */
827 /* arg list/cookie */ NULL,
828 /* must/cannot opts */ NULL, NULL,
829 /* option proc */ doOptMtu,
830 /* desc, NAME, name */ MTU_DESC, MTU_NAME, MTU_name,
831 /* disablement strs */ NULL, NULL },
833 { /* entry idx, value */ 15, VALUE_OPT_SRTP_PROFILES,
834 /* equiv idx, value */ 15, VALUE_OPT_SRTP_PROFILES,
835 /* equivalenced to */ NO_EQUIVALENT,
836 /* min, max, act ct */ 0, 1, 0,
837 /* opt state flags */ SRTP_PROFILES_FLAGS, 0,
838 /* last opt argumnt */ { NULL }, /* --srtp_profiles */
839 /* arg list/cookie */ NULL,
840 /* must/cannot opts */ NULL, NULL,
841 /* option proc */ NULL,
842 /* desc, NAME, name */ SRTP_PROFILES_DESC, SRTP_PROFILES_NAME, SRTP_PROFILES_name,
843 /* disablement strs */ NULL, NULL },
845 { /* entry idx, value */ 16, VALUE_OPT_CRLF,
846 /* equiv idx, value */ 16, VALUE_OPT_CRLF,
847 /* equivalenced to */ NO_EQUIVALENT,
848 /* min, max, act ct */ 0, 1, 0,
849 /* opt state flags */ CRLF_FLAGS, 0,
850 /* last opt argumnt */ { NULL }, /* --crlf */
851 /* arg list/cookie */ NULL,
852 /* must/cannot opts */ NULL, NULL,
853 /* option proc */ NULL,
854 /* desc, NAME, name */ CRLF_DESC, CRLF_NAME, CRLF_name,
855 /* disablement strs */ NULL, NULL },
857 { /* entry idx, value */ 17, VALUE_OPT_X509FMTDER,
858 /* equiv idx, value */ 17, VALUE_OPT_X509FMTDER,
859 /* equivalenced to */ NO_EQUIVALENT,
860 /* min, max, act ct */ 0, 1, 0,
861 /* opt state flags */ X509FMTDER_FLAGS, 0,
862 /* last opt argumnt */ { NULL }, /* --x509fmtder */
863 /* arg list/cookie */ NULL,
864 /* must/cannot opts */ NULL, NULL,
865 /* option proc */ NULL,
866 /* desc, NAME, name */ X509FMTDER_DESC, X509FMTDER_NAME, X509FMTDER_name,
867 /* disablement strs */ NULL, NULL },
869 { /* entry idx, value */ 18, VALUE_OPT_FINGERPRINT,
870 /* equiv idx, value */ 18, VALUE_OPT_FINGERPRINT,
871 /* equivalenced to */ NO_EQUIVALENT,
872 /* min, max, act ct */ 0, 1, 0,
873 /* opt state flags */ FINGERPRINT_FLAGS, 0,
874 /* last opt argumnt */ { NULL }, /* --fingerprint */
875 /* arg list/cookie */ NULL,
876 /* must/cannot opts */ NULL, NULL,
877 /* option proc */ NULL,
878 /* desc, NAME, name */ FINGERPRINT_DESC, FINGERPRINT_NAME, FINGERPRINT_name,
879 /* disablement strs */ NULL, NULL },
881 { /* entry idx, value */ 19, VALUE_OPT_DISABLE_EXTENSIONS,
882 /* equiv idx, value */ 19, VALUE_OPT_DISABLE_EXTENSIONS,
883 /* equivalenced to */ NO_EQUIVALENT,
884 /* min, max, act ct */ 0, 1, 0,
885 /* opt state flags */ DISABLE_EXTENSIONS_FLAGS, 0,
886 /* last opt argumnt */ { NULL }, /* --disable-extensions */
887 /* arg list/cookie */ NULL,
888 /* must/cannot opts */ NULL, NULL,
889 /* option proc */ NULL,
890 /* desc, NAME, name */ DISABLE_EXTENSIONS_DESC, DISABLE_EXTENSIONS_NAME, DISABLE_EXTENSIONS_name,
891 /* disablement strs */ NULL, NULL },
893 { /* entry idx, value */ 20, VALUE_OPT_PRINT_CERT,
894 /* equiv idx, value */ 20, VALUE_OPT_PRINT_CERT,
895 /* equivalenced to */ NO_EQUIVALENT,
896 /* min, max, act ct */ 0, 1, 0,
897 /* opt state flags */ PRINT_CERT_FLAGS, 0,
898 /* last opt argumnt */ { NULL }, /* --print-cert */
899 /* arg list/cookie */ NULL,
900 /* must/cannot opts */ NULL, NULL,
901 /* option proc */ NULL,
902 /* desc, NAME, name */ PRINT_CERT_DESC, PRINT_CERT_NAME, PRINT_CERT_name,
903 /* disablement strs */ NULL, NULL },
905 { /* entry idx, value */ 21, VALUE_OPT_RECORDSIZE,
906 /* equiv idx, value */ 21, VALUE_OPT_RECORDSIZE,
907 /* equivalenced to */ NO_EQUIVALENT,
908 /* min, max, act ct */ 0, 1, 0,
909 /* opt state flags */ RECORDSIZE_FLAGS, 0,
910 /* last opt argumnt */ { NULL }, /* --recordsize */
911 /* arg list/cookie */ NULL,
912 /* must/cannot opts */ NULL, NULL,
913 /* option proc */ doOptRecordsize,
914 /* desc, NAME, name */ RECORDSIZE_DESC, RECORDSIZE_NAME, RECORDSIZE_name,
915 /* disablement strs */ NULL, NULL },
917 { /* entry idx, value */ 22, VALUE_OPT_DH_BITS,
918 /* equiv idx, value */ 22, VALUE_OPT_DH_BITS,
919 /* equivalenced to */ NO_EQUIVALENT,
920 /* min, max, act ct */ 0, 1, 0,
921 /* opt state flags */ DH_BITS_FLAGS, 0,
922 /* last opt argumnt */ { NULL }, /* --dh-bits */
923 /* arg list/cookie */ NULL,
924 /* must/cannot opts */ NULL, NULL,
925 /* option proc */ optionNumericVal,
926 /* desc, NAME, name */ DH_BITS_DESC, DH_BITS_NAME, DH_BITS_name,
927 /* disablement strs */ NULL, NULL },
929 { /* entry idx, value */ 23, VALUE_OPT_PRIORITY,
930 /* equiv idx, value */ 23, VALUE_OPT_PRIORITY,
931 /* equivalenced to */ NO_EQUIVALENT,
932 /* min, max, act ct */ 0, 1, 0,
933 /* opt state flags */ PRIORITY_FLAGS, 0,
934 /* last opt argumnt */ { NULL }, /* --priority */
935 /* arg list/cookie */ NULL,
936 /* must/cannot opts */ NULL, NULL,
937 /* option proc */ NULL,
938 /* desc, NAME, name */ PRIORITY_DESC, PRIORITY_NAME, PRIORITY_name,
939 /* disablement strs */ NULL, NULL },
941 { /* entry idx, value */ 24, VALUE_OPT_X509CAFILE,
942 /* equiv idx, value */ 24, VALUE_OPT_X509CAFILE,
943 /* equivalenced to */ NO_EQUIVALENT,
944 /* min, max, act ct */ 0, 1, 0,
945 /* opt state flags */ X509CAFILE_FLAGS, 0,
946 /* last opt argumnt */ { NULL }, /* --x509cafile */
947 /* arg list/cookie */ NULL,
948 /* must/cannot opts */ NULL, NULL,
949 /* option proc */ NULL,
950 /* desc, NAME, name */ X509CAFILE_DESC, X509CAFILE_NAME, X509CAFILE_name,
951 /* disablement strs */ NULL, NULL },
953 { /* entry idx, value */ 25, VALUE_OPT_X509CRLFILE,
954 /* equiv idx, value */ 25, VALUE_OPT_X509CRLFILE,
955 /* equivalenced to */ NO_EQUIVALENT,
956 /* min, max, act ct */ 0, 1, 0,
957 /* opt state flags */ X509CRLFILE_FLAGS, 0,
958 /* last opt argumnt */ { NULL }, /* --x509crlfile */
959 /* arg list/cookie */ NULL,
960 /* must/cannot opts */ NULL, NULL,
961 /* option proc */ doOptX509crlfile,
962 /* desc, NAME, name */ X509CRLFILE_DESC, X509CRLFILE_NAME, X509CRLFILE_name,
963 /* disablement strs */ NULL, NULL },
965 { /* entry idx, value */ 26, VALUE_OPT_PGPKEYFILE,
966 /* equiv idx, value */ 26, VALUE_OPT_PGPKEYFILE,
967 /* equivalenced to */ NO_EQUIVALENT,
968 /* min, max, act ct */ 0, 1, 0,
969 /* opt state flags */ PGPKEYFILE_FLAGS, 0,
970 /* last opt argumnt */ { NULL }, /* --pgpkeyfile */
971 /* arg list/cookie */ NULL,
972 /* must/cannot opts */ NULL, NULL,
973 /* option proc */ doOptPgpkeyfile,
974 /* desc, NAME, name */ PGPKEYFILE_DESC, PGPKEYFILE_NAME, PGPKEYFILE_name,
975 /* disablement strs */ NULL, NULL },
977 { /* entry idx, value */ 27, VALUE_OPT_PGPKEYRING,
978 /* equiv idx, value */ 27, VALUE_OPT_PGPKEYRING,
979 /* equivalenced to */ NO_EQUIVALENT,
980 /* min, max, act ct */ 0, 1, 0,
981 /* opt state flags */ PGPKEYRING_FLAGS, 0,
982 /* last opt argumnt */ { NULL }, /* --pgpkeyring */
983 /* arg list/cookie */ NULL,
984 /* must/cannot opts */ NULL, NULL,
985 /* option proc */ doOptPgpkeyring,
986 /* desc, NAME, name */ PGPKEYRING_DESC, PGPKEYRING_NAME, PGPKEYRING_name,
987 /* disablement strs */ NULL, NULL },
989 { /* entry idx, value */ 28, VALUE_OPT_PGPCERTFILE,
990 /* equiv idx, value */ 28, VALUE_OPT_PGPCERTFILE,
991 /* equivalenced to */ NO_EQUIVALENT,
992 /* min, max, act ct */ 0, 1, 0,
993 /* opt state flags */ PGPCERTFILE_FLAGS, 0,
994 /* last opt argumnt */ { NULL }, /* --pgpcertfile */
995 /* arg list/cookie */ NULL,
996 /* must/cannot opts */ NULL, NULL,
997 /* option proc */ doOptPgpcertfile,
998 /* desc, NAME, name */ PGPCERTFILE_DESC, PGPCERTFILE_NAME, PGPCERTFILE_name,
999 /* disablement strs */ NULL, NULL },
1001 { /* entry idx, value */ 29, VALUE_OPT_X509KEYFILE,
1002 /* equiv idx, value */ 29, VALUE_OPT_X509KEYFILE,
1003 /* equivalenced to */ NO_EQUIVALENT,
1004 /* min, max, act ct */ 0, 1, 0,
1005 /* opt state flags */ X509KEYFILE_FLAGS, 0,
1006 /* last opt argumnt */ { NULL }, /* --x509keyfile */
1007 /* arg list/cookie */ NULL,
1008 /* must/cannot opts */ NULL, NULL,
1009 /* option proc */ NULL,
1010 /* desc, NAME, name */ X509KEYFILE_DESC, X509KEYFILE_NAME, X509KEYFILE_name,
1011 /* disablement strs */ NULL, NULL },
1013 { /* entry idx, value */ 30, VALUE_OPT_X509CERTFILE,
1014 /* equiv idx, value */ 30, VALUE_OPT_X509CERTFILE,
1015 /* equivalenced to */ NO_EQUIVALENT,
1016 /* min, max, act ct */ 0, 1, 0,
1017 /* opt state flags */ X509CERTFILE_FLAGS, 0,
1018 /* last opt argumnt */ { NULL }, /* --x509certfile */
1019 /* arg list/cookie */ NULL,
1020 /* must/cannot opts */ NULL, NULL,
1021 /* option proc */ NULL,
1022 /* desc, NAME, name */ X509CERTFILE_DESC, X509CERTFILE_NAME, X509CERTFILE_name,
1023 /* disablement strs */ NULL, NULL },
1025 { /* entry idx, value */ 31, VALUE_OPT_PGPSUBKEY,
1026 /* equiv idx, value */ 31, VALUE_OPT_PGPSUBKEY,
1027 /* equivalenced to */ NO_EQUIVALENT,
1028 /* min, max, act ct */ 0, 1, 0,
1029 /* opt state flags */ PGPSUBKEY_FLAGS, 0,
1030 /* last opt argumnt */ { NULL }, /* --pgpsubkey */
1031 /* arg list/cookie */ NULL,
1032 /* must/cannot opts */ NULL, NULL,
1033 /* option proc */ NULL,
1034 /* desc, NAME, name */ PGPSUBKEY_DESC, PGPSUBKEY_NAME, PGPSUBKEY_name,
1035 /* disablement strs */ NULL, NULL },
1037 { /* entry idx, value */ 32, VALUE_OPT_SRPUSERNAME,
1038 /* equiv idx, value */ 32, VALUE_OPT_SRPUSERNAME,
1039 /* equivalenced to */ NO_EQUIVALENT,
1040 /* min, max, act ct */ 0, 1, 0,
1041 /* opt state flags */ SRPUSERNAME_FLAGS, 0,
1042 /* last opt argumnt */ { NULL }, /* --srpusername */
1043 /* arg list/cookie */ NULL,
1044 /* must/cannot opts */ NULL, NULL,
1045 /* option proc */ NULL,
1046 /* desc, NAME, name */ SRPUSERNAME_DESC, SRPUSERNAME_NAME, SRPUSERNAME_name,
1047 /* disablement strs */ NULL, NULL },
1049 { /* entry idx, value */ 33, VALUE_OPT_SRPPASSWD,
1050 /* equiv idx, value */ 33, VALUE_OPT_SRPPASSWD,
1051 /* equivalenced to */ NO_EQUIVALENT,
1052 /* min, max, act ct */ 0, 1, 0,
1053 /* opt state flags */ SRPPASSWD_FLAGS, 0,
1054 /* last opt argumnt */ { NULL }, /* --srppasswd */
1055 /* arg list/cookie */ NULL,
1056 /* must/cannot opts */ NULL, NULL,
1057 /* option proc */ NULL,
1058 /* desc, NAME, name */ SRPPASSWD_DESC, SRPPASSWD_NAME, SRPPASSWD_name,
1059 /* disablement strs */ NULL, NULL },
1061 { /* entry idx, value */ 34, VALUE_OPT_PSKUSERNAME,
1062 /* equiv idx, value */ 34, VALUE_OPT_PSKUSERNAME,
1063 /* equivalenced to */ NO_EQUIVALENT,
1064 /* min, max, act ct */ 0, 1, 0,
1065 /* opt state flags */ PSKUSERNAME_FLAGS, 0,
1066 /* last opt argumnt */ { NULL }, /* --pskusername */
1067 /* arg list/cookie */ NULL,
1068 /* must/cannot opts */ NULL, NULL,
1069 /* option proc */ NULL,
1070 /* desc, NAME, name */ PSKUSERNAME_DESC, PSKUSERNAME_NAME, PSKUSERNAME_name,
1071 /* disablement strs */ NULL, NULL },
1073 { /* entry idx, value */ 35, VALUE_OPT_PSKKEY,
1074 /* equiv idx, value */ 35, VALUE_OPT_PSKKEY,
1075 /* equivalenced to */ NO_EQUIVALENT,
1076 /* min, max, act ct */ 0, 1, 0,
1077 /* opt state flags */ PSKKEY_FLAGS, 0,
1078 /* last opt argumnt */ { NULL }, /* --pskkey */
1079 /* arg list/cookie */ NULL,
1080 /* must/cannot opts */ NULL, NULL,
1081 /* option proc */ NULL,
1082 /* desc, NAME, name */ PSKKEY_DESC, PSKKEY_NAME, PSKKEY_name,
1083 /* disablement strs */ NULL, NULL },
1085 { /* entry idx, value */ 36, VALUE_OPT_PORT,
1086 /* equiv idx, value */ 36, VALUE_OPT_PORT,
1087 /* equivalenced to */ NO_EQUIVALENT,
1088 /* min, max, act ct */ 0, 1, 0,
1089 /* opt state flags */ PORT_FLAGS, 0,
1090 /* last opt argumnt */ { NULL }, /* --port */
1091 /* arg list/cookie */ NULL,
1092 /* must/cannot opts */ NULL, NULL,
1093 /* option proc */ NULL,
1094 /* desc, NAME, name */ PORT_DESC, PORT_NAME, PORT_name,
1095 /* disablement strs */ NULL, NULL },
1097 { /* entry idx, value */ 37, VALUE_OPT_INSECURE,
1098 /* equiv idx, value */ 37, VALUE_OPT_INSECURE,
1099 /* equivalenced to */ NO_EQUIVALENT,
1100 /* min, max, act ct */ 0, 1, 0,
1101 /* opt state flags */ INSECURE_FLAGS, 0,
1102 /* last opt argumnt */ { NULL }, /* --insecure */
1103 /* arg list/cookie */ NULL,
1104 /* must/cannot opts */ NULL, NULL,
1105 /* option proc */ NULL,
1106 /* desc, NAME, name */ INSECURE_DESC, INSECURE_NAME, INSECURE_name,
1107 /* disablement strs */ NULL, NULL },
1109 { /* entry idx, value */ 38, VALUE_OPT_BENCHMARK_CIPHERS,
1110 /* equiv idx, value */ 38, VALUE_OPT_BENCHMARK_CIPHERS,
1111 /* equivalenced to */ NO_EQUIVALENT,
1112 /* min, max, act ct */ 0, 1, 0,
1113 /* opt state flags */ BENCHMARK_CIPHERS_FLAGS, 0,
1114 /* last opt argumnt */ { NULL }, /* --benchmark-ciphers */
1115 /* arg list/cookie */ NULL,
1116 /* must/cannot opts */ NULL, NULL,
1117 /* option proc */ NULL,
1118 /* desc, NAME, name */ BENCHMARK_CIPHERS_DESC, BENCHMARK_CIPHERS_NAME, BENCHMARK_CIPHERS_name,
1119 /* disablement strs */ NULL, NULL },
1121 { /* entry idx, value */ 39, VALUE_OPT_BENCHMARK_SOFT_CIPHERS,
1122 /* equiv idx, value */ 39, VALUE_OPT_BENCHMARK_SOFT_CIPHERS,
1123 /* equivalenced to */ NO_EQUIVALENT,
1124 /* min, max, act ct */ 0, 1, 0,
1125 /* opt state flags */ BENCHMARK_SOFT_CIPHERS_FLAGS, 0,
1126 /* last opt argumnt */ { NULL }, /* --benchmark-soft-ciphers */
1127 /* arg list/cookie */ NULL,
1128 /* must/cannot opts */ NULL, NULL,
1129 /* option proc */ NULL,
1130 /* desc, NAME, name */ BENCHMARK_SOFT_CIPHERS_DESC, BENCHMARK_SOFT_CIPHERS_NAME, BENCHMARK_SOFT_CIPHERS_name,
1131 /* disablement strs */ NULL, NULL },
1133 { /* entry idx, value */ 40, VALUE_OPT_BENCHMARK_TLS_KX,
1134 /* equiv idx, value */ 40, VALUE_OPT_BENCHMARK_TLS_KX,
1135 /* equivalenced to */ NO_EQUIVALENT,
1136 /* min, max, act ct */ 0, 1, 0,
1137 /* opt state flags */ BENCHMARK_TLS_KX_FLAGS, 0,
1138 /* last opt argumnt */ { NULL }, /* --benchmark-tls-kx */
1139 /* arg list/cookie */ NULL,
1140 /* must/cannot opts */ NULL, NULL,
1141 /* option proc */ NULL,
1142 /* desc, NAME, name */ BENCHMARK_TLS_KX_DESC, BENCHMARK_TLS_KX_NAME, BENCHMARK_TLS_KX_name,
1143 /* disablement strs */ NULL, NULL },
1145 { /* entry idx, value */ 41, VALUE_OPT_BENCHMARK_TLS_CIPHERS,
1146 /* equiv idx, value */ 41, VALUE_OPT_BENCHMARK_TLS_CIPHERS,
1147 /* equivalenced to */ NO_EQUIVALENT,
1148 /* min, max, act ct */ 0, 1, 0,
1149 /* opt state flags */ BENCHMARK_TLS_CIPHERS_FLAGS, 0,
1150 /* last opt argumnt */ { NULL }, /* --benchmark-tls-ciphers */
1151 /* arg list/cookie */ NULL,
1152 /* must/cannot opts */ NULL, NULL,
1153 /* option proc */ NULL,
1154 /* desc, NAME, name */ BENCHMARK_TLS_CIPHERS_DESC, BENCHMARK_TLS_CIPHERS_NAME, BENCHMARK_TLS_CIPHERS_name,
1155 /* disablement strs */ NULL, NULL },
1157 { /* entry idx, value */ 42, VALUE_OPT_LIST,
1158 /* equiv idx, value */ 42, VALUE_OPT_LIST,
1159 /* equivalenced to */ NO_EQUIVALENT,
1160 /* min, max, act ct */ 0, 1, 0,
1161 /* opt state flags */ LIST_FLAGS, 0,
1162 /* last opt argumnt */ { NULL }, /* --list */
1163 /* arg list/cookie */ NULL,
1164 /* must/cannot opts */ NULL, NULL,
1165 /* option proc */ NULL,
1166 /* desc, NAME, name */ LIST_DESC, LIST_NAME, LIST_name,
1167 /* disablement strs */ NULL, NULL },
1169 { /* entry idx, value */ INDEX_OPT_VERSION, VALUE_OPT_VERSION,
1170 /* equiv idx value */ NO_EQUIVALENT, VALUE_OPT_VERSION,
1171 /* equivalenced to */ NO_EQUIVALENT,
1172 /* min, max, act ct */ 0, 1, 0,
1173 /* opt state flags */ VER_FLAGS, 0,
1174 /* last opt argumnt */ { NULL },
1175 /* arg list/cookie */ NULL,
1176 /* must/cannot opts */ NULL, NULL,
1177 /* option proc */ VER_PROC,
1178 /* desc, NAME, name */ VER_DESC, NULL, VER_name,
1179 /* disablement strs */ NULL, NULL },
1183 { /* entry idx, value */ INDEX_OPT_HELP, VALUE_OPT_HELP,
1184 /* equiv idx value */ NO_EQUIVALENT, VALUE_OPT_HELP,
1185 /* equivalenced to */ NO_EQUIVALENT,
1186 /* min, max, act ct */ 0, 1, 0,
1187 /* opt state flags */ OPTST_IMM | OPTST_NO_INIT, 0,
1188 /* last opt argumnt */ { NULL },
1189 /* arg list/cookie */ NULL,
1190 /* must/cannot opts */ NULL, NULL,
1191 /* option proc */ doUsageOpt,
1192 /* desc, NAME, name */ HELP_DESC, NULL, HELP_name,
1193 /* disablement strs */ NULL, NULL },
1195 { /* entry idx, value */ INDEX_OPT_MORE_HELP, VALUE_OPT_MORE_HELP,
1196 /* equiv idx value */ NO_EQUIVALENT, VALUE_OPT_MORE_HELP,
1197 /* equivalenced to */ NO_EQUIVALENT,
1198 /* min, max, act ct */ 0, 1, 0,
1199 /* opt state flags */ MORE_HELP_FLAGS, 0,
1200 /* last opt argumnt */ { NULL },
1201 /* arg list/cookie */ NULL,
1202 /* must/cannot opts */ NULL, NULL,
1203 /* option proc */ optionPagedUsage,
1204 /* desc, NAME, name */ MORE_HELP_DESC, NULL, MORE_HELP_name,
1205 /* disablement strs */ NULL, NULL }
1209 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
1211 * Define the gnutls-cli Option Environment
1213 #define zPROGNAME (gnutls_cli_opt_strs+3425)
1214 #define zUsageTitle (gnutls_cli_opt_strs+3436)
1215 #define zRcName NULL
1216 #define apzHomeList NULL
1217 #define zBugsAddr (gnutls_cli_opt_strs+3549)
1218 #define zExplain (gnutls_cli_opt_strs+3568)
1219 #define zDetail (gnutls_cli_opt_strs+3571)
1220 #define zFullVersion (gnutls_cli_opt_strs+3755)
1221 /* extracted from optcode.tlib near line 350 */
1223 #if defined(ENABLE_NLS)
1224 # define OPTPROC_BASE OPTPROC_TRANSLATE | OPTPROC_NXLAT_OPT
1225 static tOptionXlateProc translate_option_strings;
1226 #else
1227 # define OPTPROC_BASE OPTPROC_NONE
1228 # define translate_option_strings NULL
1229 #endif /* ENABLE_NLS */
1232 #define gnutls_cli_full_usage (NULL)
1234 #define gnutls_cli_short_usage (gnutls_cli_opt_strs+3776)
1236 #endif /* not defined __doxygen__ */
1239 * Create the static procedure(s) declared above.
1242 * The callout function that invokes the optionUsage function.
1244 * @param pOptions the AutoOpts option description structure
1245 * @param pOptDesc the descriptor for the "help" (usage) option.
1246 * @noreturn
1248 static void
1249 doUsageOpt(tOptions * pOptions, tOptDesc * pOptDesc)
1251 optionUsage(&gnutls_cliOptions, GNUTLS_CLI_EXIT_SUCCESS);
1252 /* NOTREACHED */
1253 (void)pOptDesc;
1254 (void)pOptions;
1257 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
1259 * Code to handle the debug option.
1261 * @param pOptions the gnutls-cli options data structure
1262 * @param pOptDesc the option descriptor for this option.
1264 static void
1265 doOptDebug(tOptions* pOptions, tOptDesc* pOptDesc)
1267 static struct {long rmin, rmax;} const rng[1] = {
1268 { 0 , 9999 } };
1269 int ix;
1271 if (pOptions <= OPTPROC_EMIT_LIMIT)
1272 goto emit_ranges;
1273 optionNumericVal(pOptions, pOptDesc);
1275 for (ix = 0; ix < 1; ix++) {
1276 if (pOptDesc->optArg.argInt < rng[ix].rmin)
1277 continue; /* ranges need not be ordered. */
1278 if (pOptDesc->optArg.argInt == rng[ix].rmin)
1279 return;
1280 if (rng[ix].rmax == LONG_MIN)
1281 continue;
1282 if (pOptDesc->optArg.argInt <= rng[ix].rmax)
1283 return;
1286 option_usage_fp = stderr;
1288 emit_ranges:
1290 optionShowRange(pOptions, pOptDesc, (void *)rng, 1);
1293 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
1295 * Code to handle the mtu option.
1297 * @param pOptions the gnutls-cli options data structure
1298 * @param pOptDesc the option descriptor for this option.
1300 static void
1301 doOptMtu(tOptions* pOptions, tOptDesc* pOptDesc)
1303 static struct {long rmin, rmax;} const rng[1] = {
1304 { 0, 17000 } };
1305 int ix;
1307 if (pOptions <= OPTPROC_EMIT_LIMIT)
1308 goto emit_ranges;
1309 optionNumericVal(pOptions, pOptDesc);
1311 for (ix = 0; ix < 1; ix++) {
1312 if (pOptDesc->optArg.argInt < rng[ix].rmin)
1313 continue; /* ranges need not be ordered. */
1314 if (pOptDesc->optArg.argInt == rng[ix].rmin)
1315 return;
1316 if (rng[ix].rmax == LONG_MIN)
1317 continue;
1318 if (pOptDesc->optArg.argInt <= rng[ix].rmax)
1319 return;
1322 option_usage_fp = stderr;
1324 emit_ranges:
1326 optionShowRange(pOptions, pOptDesc, (void *)rng, 1);
1329 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
1331 * Code to handle the recordsize option.
1333 * @param pOptions the gnutls-cli options data structure
1334 * @param pOptDesc the option descriptor for this option.
1336 static void
1337 doOptRecordsize(tOptions* pOptions, tOptDesc* pOptDesc)
1339 static struct {long rmin, rmax;} const rng[1] = {
1340 { 0, 4096 } };
1341 int ix;
1343 if (pOptions <= OPTPROC_EMIT_LIMIT)
1344 goto emit_ranges;
1345 optionNumericVal(pOptions, pOptDesc);
1347 for (ix = 0; ix < 1; ix++) {
1348 if (pOptDesc->optArg.argInt < rng[ix].rmin)
1349 continue; /* ranges need not be ordered. */
1350 if (pOptDesc->optArg.argInt == rng[ix].rmin)
1351 return;
1352 if (rng[ix].rmax == LONG_MIN)
1353 continue;
1354 if (pOptDesc->optArg.argInt <= rng[ix].rmax)
1355 return;
1358 option_usage_fp = stderr;
1360 emit_ranges:
1362 optionShowRange(pOptions, pOptDesc, (void *)rng, 1);
1365 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
1367 * Code to handle the x509crlfile option.
1369 * @param pOptions the gnutls-cli options data structure
1370 * @param pOptDesc the option descriptor for this option.
1372 static void
1373 doOptX509crlfile(tOptions* pOptions, tOptDesc* pOptDesc)
1375 static teOptFileType const type =
1376 FTYPE_MODE_MUST_EXIST + FTYPE_MODE_NO_OPEN;
1377 static tuFileMode mode;
1378 #ifndef O_CLOEXEC
1379 # define O_CLOEXEC 0
1380 #endif
1381 mode.file_flags = O_CLOEXEC;
1383 optionFileCheck(pOptions, pOptDesc, type, mode);
1386 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
1388 * Code to handle the pgpkeyfile option.
1390 * @param pOptions the gnutls-cli options data structure
1391 * @param pOptDesc the option descriptor for this option.
1393 static void
1394 doOptPgpkeyfile(tOptions* pOptions, tOptDesc* pOptDesc)
1396 static teOptFileType const type =
1397 FTYPE_MODE_MUST_EXIST + FTYPE_MODE_NO_OPEN;
1398 static tuFileMode mode;
1399 #ifndef O_CLOEXEC
1400 # define O_CLOEXEC 0
1401 #endif
1402 mode.file_flags = O_CLOEXEC;
1404 optionFileCheck(pOptions, pOptDesc, type, mode);
1407 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
1409 * Code to handle the pgpkeyring option.
1411 * @param pOptions the gnutls-cli options data structure
1412 * @param pOptDesc the option descriptor for this option.
1414 static void
1415 doOptPgpkeyring(tOptions* pOptions, tOptDesc* pOptDesc)
1417 static teOptFileType const type =
1418 FTYPE_MODE_MUST_EXIST + FTYPE_MODE_NO_OPEN;
1419 static tuFileMode mode;
1420 #ifndef O_CLOEXEC
1421 # define O_CLOEXEC 0
1422 #endif
1423 mode.file_flags = O_CLOEXEC;
1425 optionFileCheck(pOptions, pOptDesc, type, mode);
1428 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
1430 * Code to handle the pgpcertfile option.
1432 * @param pOptions the gnutls-cli options data structure
1433 * @param pOptDesc the option descriptor for this option.
1435 static void
1436 doOptPgpcertfile(tOptions* pOptions, tOptDesc* pOptDesc)
1438 static teOptFileType const type =
1439 FTYPE_MODE_MUST_EXIST + FTYPE_MODE_NO_OPEN;
1440 static tuFileMode mode;
1441 #ifndef O_CLOEXEC
1442 # define O_CLOEXEC 0
1443 #endif
1444 mode.file_flags = O_CLOEXEC;
1446 optionFileCheck(pOptions, pOptDesc, type, mode);
1448 /* extracted from optmain.tlib near line 1113 */
1451 * The directory containing the data associated with gnutls-cli.
1453 #ifndef PKGDATADIR
1454 # define PKGDATADIR ""
1455 #endif
1458 * Information about the person or institution that packaged gnutls-cli
1459 * for the current distribution.
1461 #ifndef WITH_PACKAGER
1462 # define gnutls_cli_packager_info NULL
1463 #else
1464 static char const gnutls_cli_packager_info[] =
1465 "Packaged by " WITH_PACKAGER
1467 # ifdef WITH_PACKAGER_VERSION
1468 " ("WITH_PACKAGER_VERSION")"
1469 # endif
1471 # ifdef WITH_PACKAGER_BUG_REPORTS
1472 "\nReport gnutls_cli bugs to " WITH_PACKAGER_BUG_REPORTS
1473 # endif
1474 "\n";
1475 #endif
1476 #ifndef __doxygen__
1478 #endif /* __doxygen__ */
1480 * The option definitions for gnutls-cli. The one structure that
1481 * binds them all.
1483 tOptions gnutls_cliOptions = {
1484 OPTIONS_STRUCT_VERSION,
1485 0, NULL, /* original argc + argv */
1486 ( OPTPROC_BASE
1487 + OPTPROC_ERRSTOP
1488 + OPTPROC_SHORTOPT
1489 + OPTPROC_LONGOPT
1490 + OPTPROC_NO_REQ_OPT
1491 + OPTPROC_NEGATIONS
1492 + OPTPROC_REORDER
1493 + OPTPROC_GNUUSAGE
1494 + OPTPROC_MISUSE ),
1495 0, NULL, /* current option index, current option */
1496 NULL, NULL, zPROGNAME,
1497 zRcName, zCopyright, zLicenseDescrip,
1498 zFullVersion, apzHomeList, zUsageTitle,
1499 zExplain, zDetail, optDesc,
1500 zBugsAddr, /* address to send bugs to */
1501 NULL, NULL, /* extensions/saved state */
1502 optionUsage, /* usage procedure */
1503 translate_option_strings, /* translation procedure */
1505 * Indexes to special options
1507 { INDEX_OPT_MORE_HELP, /* more-help option index */
1508 NO_EQUIVALENT, /* save option index */
1509 NO_EQUIVALENT, /* '-#' option index */
1510 NO_EQUIVALENT /* index of default opt */
1512 46 /* full option count */, 43 /* user option count */,
1513 gnutls_cli_full_usage, gnutls_cli_short_usage,
1514 NULL, NULL,
1515 PKGDATADIR, gnutls_cli_packager_info
1518 #if ENABLE_NLS
1519 #include <stdio.h>
1520 #include <stdlib.h>
1521 #include <string.h>
1522 #include <unistd.h>
1523 #include <autoopts/usage-txt.h>
1525 static char* AO_gettext(char const* pz);
1526 static void coerce_it(void** s);
1529 * AutoGen specific wrapper function for gettext.
1530 * It relies on the macro _() to convert from English to the target
1531 * language, then strdup-duplicates the result string.
1533 * @param[in] pz the input text used as a lookup key.
1534 * @returns the translated text (if there is one),
1535 * or the original text (if not).
1537 static char *
1538 AO_gettext(char const* pz)
1540 char* pzRes;
1541 if (pz == NULL)
1542 return NULL;
1543 pzRes = _(pz);
1544 if (pzRes == pz)
1545 return pzRes;
1546 pzRes = strdup(pzRes);
1547 if (pzRes == NULL) {
1548 fputs(_("No memory for duping translated strings\n"), stderr);
1549 exit(GNUTLS_CLI_EXIT_FAILURE);
1551 return pzRes;
1554 static void coerce_it(void** s) { *s = AO_gettext(*s);
1558 * Translate all the translatable strings in the gnutls_cliOptions
1559 * structure defined above. This is done only once.
1561 static void
1562 translate_option_strings(void)
1564 tOptions * const pOpt = &gnutls_cliOptions;
1567 * Guard against re-translation. It won't work. The strings will have
1568 * been changed by the first pass through this code. One shot only.
1570 if (option_usage_text.field_ct != 0) {
1572 * Do the translations. The first pointer follows the field count
1573 * field. The field count field is the size of a pointer.
1575 tOptDesc * pOD = pOpt->pOptDesc;
1576 char ** ppz = (char**)(void*)&(option_usage_text);
1577 int ix = option_usage_text.field_ct;
1579 do {
1580 ppz++;
1581 *ppz = AO_gettext(*ppz);
1582 } while (--ix > 0);
1584 coerce_it((void*)&(pOpt->pzCopyright));
1585 coerce_it((void*)&(pOpt->pzCopyNotice));
1586 coerce_it((void*)&(pOpt->pzFullVersion));
1587 coerce_it((void*)&(pOpt->pzUsageTitle));
1588 coerce_it((void*)&(pOpt->pzExplain));
1589 coerce_it((void*)&(pOpt->pzDetail));
1590 coerce_it((void*)&(pOpt->pzPackager));
1591 coerce_it((void*)&(pOpt->pzShortUsage));
1592 option_usage_text.field_ct = 0;
1594 for (ix = pOpt->optCt; ix > 0; ix--, pOD++)
1595 coerce_it((void*)&(pOD->pzText));
1598 if ((pOpt->fOptSet & OPTPROC_NXLAT_OPT_CFG) == 0) {
1599 tOptDesc * pOD = pOpt->pOptDesc;
1600 int ix;
1602 for (ix = pOpt->optCt; ix > 0; ix--, pOD++) {
1603 coerce_it((void*)&(pOD->pz_Name));
1604 coerce_it((void*)&(pOD->pz_DisableName));
1605 coerce_it((void*)&(pOD->pz_DisablePfx));
1607 /* prevent re-translation */
1608 gnutls_cliOptions.fOptSet |= OPTPROC_NXLAT_OPT_CFG | OPTPROC_NXLAT_OPT;
1612 #endif /* ENABLE_NLS */
1614 #ifdef __cplusplus
1616 #endif
1617 /* cli-args.c ends here */