mbed client lightswitch demo

Dependencies:   mbed Socket lwip-eth lwip-sys lwip

Fork of mbed-client-classic-example-lwip by Austin Blackstone

Committer:
mbedAustin
Date:
Thu Jun 09 17:08:36 2016 +0000
Revision:
11:cada08fc8a70
Commit for public Consumption

Who changed what in which revision?

UserRevisionLine numberNew contents of line
mbedAustin 11:cada08fc8a70 1 /**
mbedAustin 11:cada08fc8a70 2 * \file debug.h
mbedAustin 11:cada08fc8a70 3 *
mbedAustin 11:cada08fc8a70 4 * \brief Debug functions
mbedAustin 11:cada08fc8a70 5 *
mbedAustin 11:cada08fc8a70 6 * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved
mbedAustin 11:cada08fc8a70 7 * SPDX-License-Identifier: Apache-2.0
mbedAustin 11:cada08fc8a70 8 *
mbedAustin 11:cada08fc8a70 9 * Licensed under the Apache License, Version 2.0 (the "License"); you may
mbedAustin 11:cada08fc8a70 10 * not use this file except in compliance with the License.
mbedAustin 11:cada08fc8a70 11 * You may obtain a copy of the License at
mbedAustin 11:cada08fc8a70 12 *
mbedAustin 11:cada08fc8a70 13 * http://www.apache.org/licenses/LICENSE-2.0
mbedAustin 11:cada08fc8a70 14 *
mbedAustin 11:cada08fc8a70 15 * Unless required by applicable law or agreed to in writing, software
mbedAustin 11:cada08fc8a70 16 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
mbedAustin 11:cada08fc8a70 17 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
mbedAustin 11:cada08fc8a70 18 * See the License for the specific language governing permissions and
mbedAustin 11:cada08fc8a70 19 * limitations under the License.
mbedAustin 11:cada08fc8a70 20 *
mbedAustin 11:cada08fc8a70 21 * This file is part of mbed TLS (https://tls.mbed.org)
mbedAustin 11:cada08fc8a70 22 */
mbedAustin 11:cada08fc8a70 23 #ifndef MBEDTLS_DEBUG_H
mbedAustin 11:cada08fc8a70 24 #define MBEDTLS_DEBUG_H
mbedAustin 11:cada08fc8a70 25
mbedAustin 11:cada08fc8a70 26 #if !defined(MBEDTLS_CONFIG_FILE)
mbedAustin 11:cada08fc8a70 27 #include "config.h"
mbedAustin 11:cada08fc8a70 28 #else
mbedAustin 11:cada08fc8a70 29 #include MBEDTLS_CONFIG_FILE
mbedAustin 11:cada08fc8a70 30 #endif
mbedAustin 11:cada08fc8a70 31
mbedAustin 11:cada08fc8a70 32 #include "ssl.h"
mbedAustin 11:cada08fc8a70 33
mbedAustin 11:cada08fc8a70 34 #if defined(MBEDTLS_ECP_C)
mbedAustin 11:cada08fc8a70 35 #include "ecp.h"
mbedAustin 11:cada08fc8a70 36 #endif
mbedAustin 11:cada08fc8a70 37
mbedAustin 11:cada08fc8a70 38 #if defined(MBEDTLS_DEBUG_C)
mbedAustin 11:cada08fc8a70 39
mbedAustin 11:cada08fc8a70 40 #define MBEDTLS_DEBUG_STRIP_PARENS( ... ) __VA_ARGS__
mbedAustin 11:cada08fc8a70 41
mbedAustin 11:cada08fc8a70 42 #define MBEDTLS_SSL_DEBUG_MSG( level, args ) \
mbedAustin 11:cada08fc8a70 43 mbedtls_debug_print_msg( ssl, level, __FILE__, __LINE__, \
mbedAustin 11:cada08fc8a70 44 MBEDTLS_DEBUG_STRIP_PARENS args )
mbedAustin 11:cada08fc8a70 45
mbedAustin 11:cada08fc8a70 46 #define MBEDTLS_SSL_DEBUG_RET( level, text, ret ) \
mbedAustin 11:cada08fc8a70 47 mbedtls_debug_print_ret( ssl, level, __FILE__, __LINE__, text, ret )
mbedAustin 11:cada08fc8a70 48
mbedAustin 11:cada08fc8a70 49 #define MBEDTLS_SSL_DEBUG_BUF( level, text, buf, len ) \
mbedAustin 11:cada08fc8a70 50 mbedtls_debug_print_buf( ssl, level, __FILE__, __LINE__, text, buf, len )
mbedAustin 11:cada08fc8a70 51
mbedAustin 11:cada08fc8a70 52 #if defined(MBEDTLS_BIGNUM_C)
mbedAustin 11:cada08fc8a70 53 #define MBEDTLS_SSL_DEBUG_MPI( level, text, X ) \
mbedAustin 11:cada08fc8a70 54 mbedtls_debug_print_mpi( ssl, level, __FILE__, __LINE__, text, X )
mbedAustin 11:cada08fc8a70 55 #endif
mbedAustin 11:cada08fc8a70 56
mbedAustin 11:cada08fc8a70 57 #if defined(MBEDTLS_ECP_C)
mbedAustin 11:cada08fc8a70 58 #define MBEDTLS_SSL_DEBUG_ECP( level, text, X ) \
mbedAustin 11:cada08fc8a70 59 mbedtls_debug_print_ecp( ssl, level, __FILE__, __LINE__, text, X )
mbedAustin 11:cada08fc8a70 60 #endif
mbedAustin 11:cada08fc8a70 61
mbedAustin 11:cada08fc8a70 62 #if defined(MBEDTLS_X509_CRT_PARSE_C)
mbedAustin 11:cada08fc8a70 63 #define MBEDTLS_SSL_DEBUG_CRT( level, text, crt ) \
mbedAustin 11:cada08fc8a70 64 mbedtls_debug_print_crt( ssl, level, __FILE__, __LINE__, text, crt )
mbedAustin 11:cada08fc8a70 65 #endif
mbedAustin 11:cada08fc8a70 66
mbedAustin 11:cada08fc8a70 67 #else /* MBEDTLS_DEBUG_C */
mbedAustin 11:cada08fc8a70 68
mbedAustin 11:cada08fc8a70 69 #define MBEDTLS_SSL_DEBUG_MSG( level, args ) do { } while( 0 )
mbedAustin 11:cada08fc8a70 70 #define MBEDTLS_SSL_DEBUG_RET( level, text, ret ) do { } while( 0 )
mbedAustin 11:cada08fc8a70 71 #define MBEDTLS_SSL_DEBUG_BUF( level, text, buf, len ) do { } while( 0 )
mbedAustin 11:cada08fc8a70 72 #define MBEDTLS_SSL_DEBUG_MPI( level, text, X ) do { } while( 0 )
mbedAustin 11:cada08fc8a70 73 #define MBEDTLS_SSL_DEBUG_ECP( level, text, X ) do { } while( 0 )
mbedAustin 11:cada08fc8a70 74 #define MBEDTLS_SSL_DEBUG_CRT( level, text, crt ) do { } while( 0 )
mbedAustin 11:cada08fc8a70 75
mbedAustin 11:cada08fc8a70 76 #endif /* MBEDTLS_DEBUG_C */
mbedAustin 11:cada08fc8a70 77
mbedAustin 11:cada08fc8a70 78 #ifdef __cplusplus
mbedAustin 11:cada08fc8a70 79 extern "C" {
mbedAustin 11:cada08fc8a70 80 #endif
mbedAustin 11:cada08fc8a70 81
mbedAustin 11:cada08fc8a70 82 /**
mbedAustin 11:cada08fc8a70 83 * \brief Set the level threshold to handle globally. Messages that have a
mbedAustin 11:cada08fc8a70 84 * level over the threshold value are ignored.
mbedAustin 11:cada08fc8a70 85 * (Default value: 0 (No debug))
mbedAustin 11:cada08fc8a70 86 *
mbedAustin 11:cada08fc8a70 87 * \param threshold maximum level of messages to pass on
mbedAustin 11:cada08fc8a70 88 */
mbedAustin 11:cada08fc8a70 89 void mbedtls_debug_set_threshold( int threshold );
mbedAustin 11:cada08fc8a70 90
mbedAustin 11:cada08fc8a70 91 void mbedtls_debug_print_msg( const mbedtls_ssl_context *ssl, int level,
mbedAustin 11:cada08fc8a70 92 const char *file, int line,
mbedAustin 11:cada08fc8a70 93 const char *format, ... );
mbedAustin 11:cada08fc8a70 94
mbedAustin 11:cada08fc8a70 95 void mbedtls_debug_print_ret( const mbedtls_ssl_context *ssl, int level,
mbedAustin 11:cada08fc8a70 96 const char *file, int line,
mbedAustin 11:cada08fc8a70 97 const char *text, int ret );
mbedAustin 11:cada08fc8a70 98
mbedAustin 11:cada08fc8a70 99 void mbedtls_debug_print_buf( const mbedtls_ssl_context *ssl, int level,
mbedAustin 11:cada08fc8a70 100 const char *file, int line, const char *text,
mbedAustin 11:cada08fc8a70 101 const unsigned char *buf, size_t len );
mbedAustin 11:cada08fc8a70 102
mbedAustin 11:cada08fc8a70 103 #if defined(MBEDTLS_BIGNUM_C)
mbedAustin 11:cada08fc8a70 104 void mbedtls_debug_print_mpi( const mbedtls_ssl_context *ssl, int level,
mbedAustin 11:cada08fc8a70 105 const char *file, int line,
mbedAustin 11:cada08fc8a70 106 const char *text, const mbedtls_mpi *X );
mbedAustin 11:cada08fc8a70 107 #endif
mbedAustin 11:cada08fc8a70 108
mbedAustin 11:cada08fc8a70 109 #if defined(MBEDTLS_ECP_C)
mbedAustin 11:cada08fc8a70 110 void mbedtls_debug_print_ecp( const mbedtls_ssl_context *ssl, int level,
mbedAustin 11:cada08fc8a70 111 const char *file, int line,
mbedAustin 11:cada08fc8a70 112 const char *text, const mbedtls_ecp_point *X );
mbedAustin 11:cada08fc8a70 113 #endif
mbedAustin 11:cada08fc8a70 114
mbedAustin 11:cada08fc8a70 115 #if defined(MBEDTLS_X509_CRT_PARSE_C)
mbedAustin 11:cada08fc8a70 116 void mbedtls_debug_print_crt( const mbedtls_ssl_context *ssl, int level,
mbedAustin 11:cada08fc8a70 117 const char *file, int line,
mbedAustin 11:cada08fc8a70 118 const char *text, const mbedtls_x509_crt *crt );
mbedAustin 11:cada08fc8a70 119 #endif
mbedAustin 11:cada08fc8a70 120
mbedAustin 11:cada08fc8a70 121 #ifdef __cplusplus
mbedAustin 11:cada08fc8a70 122 }
mbedAustin 11:cada08fc8a70 123 #endif
mbedAustin 11:cada08fc8a70 124
mbedAustin 11:cada08fc8a70 125 #endif /* debug.h */