/* File generated by GAA 1.6.1
*/
#define GAA_NO_WIN32
-#line 91 "cli.gaa"
+#line 94 "cli.gaa"
/* C declarations */
void gaa_help(void)
{
- printf("gnutls-cli help\nUsage: gnutls-cli [options] hostname\n");
+ printf("GNU TLS test client\nUsage: gnutls-cli [options] hostname\n\n\n");
__gaa_helpsingle('r', "resume", "", "Connect, establish a session. Connect again and resume this session.");
__gaa_helpsingle(0, "crlf", "", "Send CR LF instead of LF.");
__gaa_helpsingle(0, "x509fmtder", "", "Use DER format for certificates");
__gaa_helpsingle(0, "srppasswd", "PASSWD ", "SRP password to use.");
__gaa_helpsingle('l', "list", "", "Print a list of the supported algorithms and modes.");
__gaa_helpsingle('h', "help", "", "prints this help");
+ __gaa_helpsingle('v', "version", "", "prints the program's version number");
+ __gaa_helpsingle(0, "copyright", "", "prints the program's license");
#line 100 "gaa.skel"
}
struct _gaainfo
{
-#line 78 "cli.gaa"
+#line 81 "cli.gaa"
char **rest_args;
-#line 77 "cli.gaa"
+#line 80 "cli.gaa"
int nrest_args;
#line 70 "cli.gaa"
char *srp_passwd;
#define GAA_MULTIPLE_OPTION 3
#define GAA_REST 0
-#define GAA_NB_OPTION 23
-#define GAAOPTID_help 1
-#define GAAOPTID_list 2
-#define GAAOPTID_srppasswd 3
-#define GAAOPTID_srpusername 4
-#define GAAOPTID_x509certfile 5
-#define GAAOPTID_x509keyfile 6
-#define GAAOPTID_pgpcertfile 7
-#define GAAOPTID_pgptrustdb 8
-#define GAAOPTID_pgpkeyring 9
-#define GAAOPTID_pgpkeyfile 10
-#define GAAOPTID_x509cafile 11
-#define GAAOPTID_ctypes 12
-#define GAAOPTID_kx 13
-#define GAAOPTID_macs 14
-#define GAAOPTID_comp 15
-#define GAAOPTID_protocols 16
-#define GAAOPTID_ciphers 17
-#define GAAOPTID_recordsize 18
-#define GAAOPTID_port 19
-#define GAAOPTID_fingerprint 20
-#define GAAOPTID_x509fmtder 21
-#define GAAOPTID_crlf 22
-#define GAAOPTID_resume 23
+#define GAA_NB_OPTION 25
+#define GAAOPTID_copyright 1
+#define GAAOPTID_version 2
+#define GAAOPTID_help 3
+#define GAAOPTID_list 4
+#define GAAOPTID_srppasswd 5
+#define GAAOPTID_srpusername 6
+#define GAAOPTID_x509certfile 7
+#define GAAOPTID_x509keyfile 8
+#define GAAOPTID_pgpcertfile 9
+#define GAAOPTID_pgptrustdb 10
+#define GAAOPTID_pgpkeyring 11
+#define GAAOPTID_pgpkeyfile 12
+#define GAAOPTID_x509cafile 13
+#define GAAOPTID_ctypes 14
+#define GAAOPTID_kx 15
+#define GAAOPTID_macs 16
+#define GAAOPTID_comp 17
+#define GAAOPTID_protocols 18
+#define GAAOPTID_ciphers 19
+#define GAAOPTID_recordsize 20
+#define GAAOPTID_port 21
+#define GAAOPTID_fingerprint 22
+#define GAAOPTID_x509fmtder 23
+#define GAAOPTID_crlf 24
+#define GAAOPTID_resume 25
#line 168 "gaa.skel"
GAA_CHECK1STR("p", GAAOPTID_port);
case GAA_MULTIPLE_OPTION:
#line 375 "gaa.skel"
+ GAA_CHECK1STR("", GAAOPTID_copyright);
+ GAA_CHECK1STR("v", GAAOPTID_version);
GAA_CHECK1STR("h", GAAOPTID_help);
GAA_CHECK1STR("l", GAAOPTID_list);
GAA_CHECK1STR("f", GAAOPTID_fingerprint);
#line 277 "gaa.skel"
break;
case GAA_WORD_OPTION:
+ GAA_CHECKSTR("copyright", GAAOPTID_copyright);
+ GAA_CHECKSTR("version", GAAOPTID_version);
GAA_CHECKSTR("help", GAAOPTID_help);
GAA_CHECKSTR("list", GAAOPTID_list);
GAA_CHECKSTR("srppasswd", GAAOPTID_srppasswd);
switch(gaa_num)
{
+ case GAAOPTID_copyright:
+ OK = 0;
+#line 78 "cli.gaa"
+{ print_license(); exit(0); ;};
+
+ return GAA_OK;
+ break;
+ case GAAOPTID_version:
+ OK = 0;
+#line 77 "cli.gaa"
+{ cli_version(); exit(0); ;};
+
+ return GAA_OK;
+ break;
case GAAOPTID_help:
OK = 0;
#line 75 "cli.gaa"
break;
case GAA_REST:
GAA_LIST_FILL(GAAREST_tmp.arg1, gaa_getstr, char*, GAAREST_tmp.size1);
-#line 79 "cli.gaa"
+#line 82 "cli.gaa"
{ gaaval->rest_args = GAAREST_tmp.arg1; gaaval->nrest_args = GAAREST_tmp.size1 ;};
return GAA_OK;
if(inited == 0)
{
-#line 81 "cli.gaa"
+#line 84 "cli.gaa"
{ gaaval->resume=0; gaaval->port=443; gaaval->rest_args=NULL; gaaval->nrest_args=0; gaaval->ciphers=NULL;
gaaval->kx=NULL; gaaval->comp=NULL; gaaval->macs=NULL; gaaval->ctype=NULL; gaaval->nciphers=0;
gaaval->nkx=0; gaaval->ncomp=0; gaaval->nmacs=0; gaaval->nctype = 0; gaaval->record_size=0;
struct _gaainfo
{
-#line 78 "cli.gaa"
+#line 81 "cli.gaa"
char **rest_args;
-#line 77 "cli.gaa"
+#line 80 "cli.gaa"
int nrest_args;
#line 70 "cli.gaa"
char *srp_passwd;
#define DEFAULT_SRP_USERNAME "test"
#define DEFAULT_SRP_PASSWD "test"
+
static int cert_callback(GNUTLS_STATE state,
const gnutls_datum * client_certs, int ncerts,
const gnutls_datum * req_ca_cert, int nreqs)
}
}
+
+void cli_version(void) {
+ fprintf(stderr, "GNU TLS test client, ");
+ fprintf(stderr, "version %s.\n", LIBGNUTLS_VERSION);
+}
-helpnode "gnutls-cli help\nUsage: gnutls-cli [options] hostname"
+helpnode "GNU TLS test client\nUsage: gnutls-cli [options] hostname\n\n"
#int resume;
option (r, resume) { $resume = 1 } "Connect, establish a session. Connect again and resume this session."
option (l, list) { print_list(); exit(0); } "Print a list of the supported algorithms and modes."
option (h, help) { gaa_help(); exit(0); } "prints this help"
+option (v, version) { cli_version(); exit(0); } "prints the program's version number"
+option ( copyright) { print_license(); exit(0); } "prints the program's license"
+
#int nrest_args;
#char **rest_args;
rest *STR "hostname" { $rest_args = $1; $nrest_args = @1 }
return;
}
+
+void print_license(void)
+{
+ fprintf(stdout,
+ "\nCopyright (C) 2001-2002 Nikos Mavroyanopoulos\n"
+ "This program is free software; you can redistribute it and/or modify \n"
+ "it under the terms of the GNU General Public License as published by \n"
+ "the Free Software Foundation; either version 2 of the License, or \n"
+ "(at your option) any later version. \n" "\n"
+ "This program is distributed in the hope that it will be useful, \n"
+ "but WITHOUT ANY WARRANTY; without even the implied warranty of \n"
+ "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the \n"
+ "GNU General Public License for more details. \n" "\n"
+ "You should have received a copy of the GNU General Public License \n"
+ "along with this program; if not, write to the Free Software \n"
+ "Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\n\n");
+}
/* File generated by GAA 1.6.1
*/
#define GAA_NO_WIN32
-#line 84 "serv.gaa"
+#line 88 "serv.gaa"
#include <common.h>
#include <stdio.h>
void gaa_help(void)
{
- printf("gnutls-serv help\nUsage: gnutls-serv [options]\n");
+ printf("GNU TLS test server\nUsage: gnutls-serv [options]\n\n\n");
__gaa_helpsingle('g', "generate", "", "Generate Diffie Hellman Parameters.");
__gaa_helpsingle('p', "port", "integer ", "The port to connect to.");
__gaa_helpsingle(0, "http", "", "Act as an HTTP Server.");
__gaa_helpsingle(0, "ctypes", "certType1 certType2... ", "Certificate types to enable.");
__gaa_helpsingle('l', "list", "", "Print a list of the supported algorithms and modes.");
__gaa_helpsingle('h', "help", "", "prints this help");
+ __gaa_helpsingle('v', "version", "", "prints the program's version number");
+ __gaa_helpsingle(0, "copyright", "", "prints the program's license");
#line 100 "gaa.skel"
}
#define GAA_MULTIPLE_OPTION 3
#define GAA_REST 0
-#define GAA_NB_OPTION 23
-#define GAAOPTID_help 1
-#define GAAOPTID_list 2
-#define GAAOPTID_ctypes 3
-#define GAAOPTID_kx 4
-#define GAAOPTID_macs 5
-#define GAAOPTID_comp 6
-#define GAAOPTID_protocols 7
-#define GAAOPTID_ciphers 8
-#define GAAOPTID_srppasswdconf 9
-#define GAAOPTID_srppasswd 10
-#define GAAOPTID_pgpkeyserver 11
-#define GAAOPTID_x509certfile 12
-#define GAAOPTID_x509keyfile 13
-#define GAAOPTID_pgpcertfile 14
-#define GAAOPTID_pgpkeyfile 15
-#define GAAOPTID_pgptrustdb 16
-#define GAAOPTID_pgpkeyring 17
-#define GAAOPTID_x509cafile 18
-#define GAAOPTID_x509fmtder 19
-#define GAAOPTID_echo 20
-#define GAAOPTID_http 21
-#define GAAOPTID_port 22
-#define GAAOPTID_generate 23
+#define GAA_NB_OPTION 25
+#define GAAOPTID_copyright 1
+#define GAAOPTID_version 2
+#define GAAOPTID_help 3
+#define GAAOPTID_list 4
+#define GAAOPTID_ctypes 5
+#define GAAOPTID_kx 6
+#define GAAOPTID_macs 7
+#define GAAOPTID_comp 8
+#define GAAOPTID_protocols 9
+#define GAAOPTID_ciphers 10
+#define GAAOPTID_srppasswdconf 11
+#define GAAOPTID_srppasswd 12
+#define GAAOPTID_pgpkeyserver 13
+#define GAAOPTID_x509certfile 14
+#define GAAOPTID_x509keyfile 15
+#define GAAOPTID_pgpcertfile 16
+#define GAAOPTID_pgpkeyfile 17
+#define GAAOPTID_pgptrustdb 18
+#define GAAOPTID_pgpkeyring 19
+#define GAAOPTID_x509cafile 20
+#define GAAOPTID_x509fmtder 21
+#define GAAOPTID_echo 22
+#define GAAOPTID_http 23
+#define GAAOPTID_port 24
+#define GAAOPTID_generate 25
#line 168 "gaa.skel"
GAA_CHECK1STR("p", GAAOPTID_port);
case GAA_MULTIPLE_OPTION:
#line 375 "gaa.skel"
+ GAA_CHECK1STR("", GAAOPTID_copyright);
+ GAA_CHECK1STR("v", GAAOPTID_version);
GAA_CHECK1STR("h", GAAOPTID_help);
GAA_CHECK1STR("l", GAAOPTID_list);
GAA_CHECK1STR("", GAAOPTID_x509fmtder);
#line 277 "gaa.skel"
break;
case GAA_WORD_OPTION:
+ GAA_CHECKSTR("copyright", GAAOPTID_copyright);
+ GAA_CHECKSTR("version", GAAOPTID_version);
GAA_CHECKSTR("help", GAAOPTID_help);
GAA_CHECKSTR("list", GAAOPTID_list);
GAA_CHECKSTR("ctypes", GAAOPTID_ctypes);
switch(gaa_num)
{
+ case GAAOPTID_copyright:
+ OK = 0;
+#line 76 "serv.gaa"
+{ print_license(); exit(0); ;};
+
+ return GAA_OK;
+ break;
+ case GAAOPTID_version:
+ OK = 0;
+#line 75 "serv.gaa"
+{ serv_version(); exit(0); ;};
+
+ return GAA_OK;
+ break;
case GAAOPTID_help:
OK = 0;
#line 73 "serv.gaa"
if(inited == 0)
{
-#line 75 "serv.gaa"
+#line 79 "serv.gaa"
{ gaaval->generate=0; gaaval->port=5556; gaaval->http=0; gaaval->ciphers=NULL;
gaaval->kx=NULL; gaaval->comp=NULL; gaaval->macs=NULL; gaaval->ctype=NULL; gaaval->nciphers=0;
gaaval->nkx=0; gaaval->ncomp=0; gaaval->nmacs=0; gaaval->nctype = 0;
}
+
+void serv_version(void) {
+ fprintf(stderr, "GNU TLS test server, ");
+ fprintf(stderr, "version %s.\n", LIBGNUTLS_VERSION);
+}
-helpnode "gnutls-serv help\nUsage: gnutls-serv [options]"
+helpnode "GNU TLS test server\nUsage: gnutls-serv [options]\n\n"
#int generate;
option (g, generate) { $generate = 1 } "Generate Diffie Hellman Parameters."
option (l, list) { print_list(); exit(0); } "Print a list of the supported algorithms and modes."
option (h, help) { gaa_help(); exit(0); } "prints this help"
+option (v, version) { serv_version(); exit(0); } "prints the program's version number"
+option ( copyright) { print_license(); exit(0); } "prints the program's license"
+
+
init { $generate=0; $port=5556; $http=0; $ciphers=NULL;
$kx=NULL; $comp=NULL; $macs=NULL; $ctype=NULL; $nciphers=0;
$nkx=0; $ncomp=0; $nmacs=0; $nctype = 0;
-/* File generated by GAA 1.6.0
+/* File generated by GAA 1.6.1
*/
#define GAA_NO_WIN32
#include <stdio.h>
void gaa_help(void)
{
- printf("gnutls-cli-debug help\nUsage: gnutls-cli-debug [options] hostname""\n");
- __gaa_helpsingle('p', "port", """integer"" ", "The port to connect to.");
+ printf("GNU TLS debug client\nUsage: gnutls-cli-debug [options] hostname\n\n\n");
+ __gaa_helpsingle('p', "port", "integer ", "The port to connect to.");
__gaa_helpsingle('h', "help", "", "prints this help");
#line 100 "gaa.skel"
-helpnode "gnutls-cli-debug help\nUsage: gnutls-cli-debug [options] hostname"
+helpnode "GNU TLS debug client\nUsage: gnutls-cli-debug [options] hostname\n\n"
#int pp;
option (p, port) INT "integer" { $pp = $1 } "The port to connect to."