More enum docs.
[gnutls.git] / doc / printlist.c
blobaaa6fe072a8891a0676343dea28213358ad96bb2
1 /*
2 * Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
3 * Author: Nikos Mavrogiannopoulos
5 * This file is part of GNUTLS.
7 * GNUTLS is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
12 * GNUTLS is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
21 #include <config.h>
22 #include <stdio.h>
23 #include <stdlib.h>
24 #include <string.h>
25 #include <gnutls/gnutls.h>
26 #include <gnutls/x509.h>
27 #include <gnutls/openpgp.h>
29 int
30 main (void)
33 size_t i;
34 const char *name;
35 char id[2];
36 gnutls_kx_algorithm_t kx;
37 gnutls_cipher_algorithm_t cipher;
38 gnutls_mac_algorithm_t mac;
39 gnutls_protocol_t version;
41 printf ("Available cipher suites:\n");
42 printf ("@multitable @columnfractions .60 .20 .20\n");
43 for (i = 0; (name = gnutls_cipher_suite_info
44 (i, id, &kx, &cipher, &mac, &version)); i++)
46 printf ("@item %s\n@tab 0x%02x 0x%02x\n@tab %s\n",
47 name,
48 (unsigned char) id[0], (unsigned char) id[1],
49 gnutls_protocol_get_name (version));
51 printf ("@end multitable\n");
55 const gnutls_certificate_type_t *p = gnutls_certificate_type_list ();
57 printf ("\n\nAvailable certificate types:\n@itemize\n");
58 for (; *p; p++)
60 printf ("@item %s\n", gnutls_certificate_type_get_name (*p));
62 printf ("@end itemize\n");
66 const gnutls_protocol_t *p = gnutls_protocol_list ();
68 printf ("\nAvailable protocols:\n@itemize\n");
69 for (; *p; p++)
71 printf ("@item %s\n", gnutls_protocol_get_name (*p));
73 printf ("@end itemize\n");
77 const gnutls_cipher_algorithm_t *p = gnutls_cipher_list ();
79 printf ("\nAvailable ciphers:\n@itemize\n");
80 for (; *p; p++)
82 printf ("@item %s\n", gnutls_cipher_get_name (*p));
84 printf ("@end itemize\n");
88 const gnutls_mac_algorithm_t *p = gnutls_mac_list ();
90 printf ("\nAvailable MAC algorithms:\n@itemize\n");
91 for (; *p; p++)
93 printf ("@item %s\n", gnutls_mac_get_name (*p));
95 printf ("@end itemize\n");
99 const gnutls_kx_algorithm_t *p = gnutls_kx_list ();
101 printf ("\nAvailable key exchange methods:\n@itemize\n");
102 for (; *p; p++)
104 printf ("@item %s\n", gnutls_kx_get_name (*p));
106 printf ("@end itemize\n");
110 const gnutls_pk_algorithm_t *p = gnutls_pk_list ();
112 printf ("\nAvailable public key algorithms:\n@itemize\n");
113 for (; *p; p++)
115 printf ("@item %s\n", gnutls_pk_get_name (*p));
117 printf ("@end itemize\n");
121 const gnutls_sign_algorithm_t *p = gnutls_sign_list ();
123 printf ("\nAvailable public key signature algorithms:\n@itemize\n");
124 for (; *p; p++)
126 printf ("@item %s\n", gnutls_sign_get_name (*p));
128 printf ("@end itemize\n");
132 const gnutls_compression_method_t *p = gnutls_compression_list ();
134 printf ("\nAvailable compression methods:\n@itemize\n");
135 for (; *p; p++)
137 printf ("@item %s\n", gnutls_compression_get_name (*p));
139 printf ("@end itemize\n");