00001 /* 00002 * Copyright (C) 2001, 2002, 2003, 2004, 2005, 2007 Free Software Foundation 00003 * 00004 * Author: Nikos Mavrogiannopoulos 00005 * 00006 * This file is part of GNUTLS. 00007 * 00008 * The GNUTLS library is free software; you can redistribute it and/or 00009 * modify it under the terms of the GNU Lesser General Public License 00010 * as published by the Free Software Foundation; either version 2.1 of 00011 * the License, or (at your option) any later version. 00012 * 00013 * This library is distributed in the hope that it will be useful, but 00014 * WITHOUT ANY WARRANTY; without even the implied warranty of 00015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00016 * Lesser General Public License for more details. 00017 * 00018 * You should have received a copy of the GNU Lesser General Public 00019 * License along with this library; if not, write to the Free Software 00020 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 00021 * USA 00022 * 00023 */ 00024 00025 #include "gnutls_int.h" 00026 #include "gnutls_errors.h" 00027 #include <stdio.h> 00028 #include <stdlib.h> 00029 #include <gcrypt.h> 00030 00031 const char * 00032 MHD__gnutls_packet2str (content_type_t packet) 00033 { 00034 switch (packet) 00035 { 00036 case GNUTLS_CHANGE_CIPHER_SPEC: 00037 return "Change Cipher Spec"; 00038 case GNUTLS_ALERT: 00039 return "Alert"; 00040 case GNUTLS_HANDSHAKE: 00041 return "Handshake"; 00042 case GNUTLS_APPLICATION_DATA: 00043 return "Application Data"; 00044 case GNUTLS_INNER_APPLICATION: 00045 return "Inner Application"; 00046 00047 default: 00048 return "Unknown Packet"; 00049 } 00050 } 00051 00052 const char * 00053 MHD__gnutls_handshake2str (MHD_gnutls_handshake_description_t handshake) 00054 { 00055 00056 switch (handshake) 00057 { 00058 case GNUTLS_HANDSHAKE_HELLO_REQUEST: 00059 return "HELLO REQUEST"; 00060 break; 00061 case GNUTLS_HANDSHAKE_CLIENT_HELLO: 00062 return "CLIENT HELLO"; 00063 break; 00064 case GNUTLS_HANDSHAKE_SERVER_HELLO: 00065 return "SERVER HELLO"; 00066 break; 00067 case GNUTLS_HANDSHAKE_CERTIFICATE_PKT: 00068 return "CERTIFICATE"; 00069 break; 00070 case GNUTLS_HANDSHAKE_SERVER_KEY_EXCHANGE: 00071 return "SERVER KEY EXCHANGE"; 00072 break; 00073 case GNUTLS_HANDSHAKE_CERTIFICATE_REQUEST: 00074 return "CERTIFICATE REQUEST"; 00075 break; 00076 case GNUTLS_HANDSHAKE_SERVER_HELLO_DONE: 00077 return "SERVER HELLO DONE"; 00078 break; 00079 case GNUTLS_HANDSHAKE_CERTIFICATE_VERIFY: 00080 return "CERTIFICATE VERIFY"; 00081 break; 00082 case GNUTLS_HANDSHAKE_CLIENT_KEY_EXCHANGE: 00083 return "CLIENT KEY EXCHANGE"; 00084 break; 00085 case GNUTLS_HANDSHAKE_FINISHED: 00086 return "FINISHED"; 00087 break; 00088 case GNUTLS_HANDSHAKE_SUPPLEMENTAL: 00089 return "SUPPLEMENTAL"; 00090 break; 00091 default: 00092 return "Unknown Handshake packet"; 00093 00094 } 00095 }