]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
*** empty log message ***
authorNikos Mavrogiannopoulos <nmav@gnutls.org>
Mon, 27 May 2002 21:38:37 +0000 (21:38 +0000)
committerNikos Mavrogiannopoulos <nmav@gnutls.org>
Mon, 27 May 2002 21:38:37 +0000 (21:38 +0000)
src/cli-gaa.c
src/cli-gaa.h
src/cli.c
src/cli.gaa
src/common.c
src/serv-gaa.c
src/serv.c
src/serv.gaa
src/tls_test-gaa.c
src/tls_test.gaa

index e450528239b18bf556978bebd369fe6c41e209a3..4cf871417482b0643f20483fe4db594265d8216f 100644 (file)
@@ -1,7 +1,7 @@
 /* File generated by GAA 1.6.1
  */
 #define GAA_NO_WIN32
-#line 91 "cli.gaa"
+#line 94 "cli.gaa"
 
 /* C declarations */
 
@@ -110,7 +110,7 @@ void __gaa_helpsingle(char short_name, char *name,
 
 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");
@@ -134,6 +134,8 @@ void gaa_help(void)
        __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"
 }
@@ -148,9 +150,9 @@ typedef struct _gaainfo gaainfo;
 
 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;
@@ -260,30 +262,32 @@ int gaa_error = 0;
 #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"
 
@@ -627,6 +631,8 @@ int gaa_get_option_num(char *str, int status)
                        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);
@@ -637,6 +643,8 @@ int gaa_get_option_num(char *str, int status)
 #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);
@@ -709,6 +717,20 @@ int gaa_try(int gaa_num, int gaa_index, gaainfo *gaaval, char *opt_list)
     
     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"
@@ -911,7 +933,7 @@ int gaa_try(int gaa_num, int gaa_index, gaainfo *gaaval, char *opt_list)
                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;
@@ -939,7 +961,7 @@ int gaa(int argc, char **argv, gaainfo *gaaval)
     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; 
index bc468010101b50f2f8df12348f49eb74d1c38da8..f22211bbd8a8658d398846514c516180af6aa3ab 100644 (file)
@@ -8,9 +8,9 @@ typedef struct _gaainfo gaainfo;
 
 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;
index b9de47c1f8405f4c9ff78a903b98448e57edcc6a..7cb854ec1bdb061929e5025746ce6786cb4c77a4 100644 (file)
--- a/src/cli.c
+++ b/src/cli.c
@@ -99,6 +99,7 @@ int cert_type_priority[16] = { GNUTLS_CRT_X509, GNUTLS_CRT_OPENPGP, 0 };
 #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)
@@ -633,3 +634,8 @@ void gaa_parser(int argc, char **argv)
    }
 
 }
+
+void cli_version(void) {
+       fprintf(stderr, "GNU TLS test client, ");
+       fprintf(stderr, "version %s.\n", LIBGNUTLS_VERSION);
+}
index 5c40a364a3a3a6070aaff10cdec4717651410dcc..63a4677328a417180464b2def3a788fc0e78c9ac 100644 (file)
@@ -1,4 +1,4 @@
-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."
@@ -74,6 +74,9 @@ option (srppasswd) STR "PASSWD" { $srp_passwd = $1 } "SRP password to use."
 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 }
index a0df10ad8905904d35735e445dd94ae623a0d88d..029bf491105dd31569f8106370f1b0fe0d7e4756 100644 (file)
@@ -309,3 +309,20 @@ void print_list(void)
 
        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");
+}
index 373e26e5287be374078cf4c1bb057c1b45a450f3..eb8bb6d1c67b460d737cfab6fdb1bee040c4b957 100644 (file)
@@ -1,7 +1,7 @@
 /* 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>
@@ -108,7 +108,7 @@ void __gaa_helpsingle(char short_name, char *name,
 
 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.");
@@ -132,6 +132,8 @@ void gaa_help(void)
        __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"
 }
@@ -252,30 +254,32 @@ int gaa_error = 0;
 #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"
 
@@ -612,6 +616,8 @@ int gaa_get_option_num(char *str, int status)
                        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);
@@ -622,6 +628,8 @@ int gaa_get_option_num(char *str, int status)
 #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);
@@ -694,6 +702,20 @@ int gaa_try(int gaa_num, int gaa_index, gaainfo *gaaval, char *opt_list)
     
     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"
@@ -917,7 +939,7 @@ int gaa(int argc, char **argv, gaainfo *gaaval)
     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;
index a45715790c844d269509fbd658e00abb10aae9b5..a8cd14ce224ae50b9c51d3a311a6078e69ade592 100644 (file)
@@ -721,3 +721,8 @@ void gaa_parser(int argc, char **argv)
 
 
 }
+
+void serv_version(void) {
+       fprintf(stderr, "GNU TLS test server, ");
+       fprintf(stderr, "version %s.\n", LIBGNUTLS_VERSION);
+}
index d1369d5ec0e60bb0c45f69b1df12009167dc41af..6903a913efdbb155312bb75705dabe294363e43b 100644 (file)
@@ -1,4 +1,4 @@
-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."
@@ -72,6 +72,10 @@ option (ctypes) *STR "certType1 certType2..." { $ctype = $1; $nctype = @1 } "Cer
 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;
index 676fff1119b49eb8cdf81f3561a3df752063b26b..98a4796c295a39facc50659f0bb0535e52d3e6e2 100644 (file)
@@ -1,4 +1,4 @@
-/* File generated by GAA 1.6.0
+/* File generated by GAA 1.6.1
  */
 #define GAA_NO_WIN32
 #include <stdio.h>
@@ -105,8 +105,8 @@ void __gaa_helpsingle(char short_name, char *name,
 
 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"
index 571e059956af5a0b709bb7bf9cd72d87eba1535e..0e73c1d1164b22d2a2884fd3cb3f9ade99bfa1e1 100644 (file)
@@ -1,4 +1,4 @@
-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."