mbed TLS library

Dependents:   HTTPClient-SSL WS_SERVER

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers version.h Source File

version.h

Go to the documentation of this file.
00001 /**
00002  * \file version.h
00003  *
00004  * \brief Run-time version information
00005  *
00006  *  Copyright (C) 2006-2014, ARM Limited, All Rights Reserved
00007  *
00008  *  This file is part of mbed TLS (https://tls.mbed.org)
00009  *
00010  *  This program is free software; you can redistribute it and/or modify
00011  *  it under the terms of the GNU General Public License as published by
00012  *  the Free Software Foundation; either version 2 of the License, or
00013  *  (at your option) any later version.
00014  *
00015  *  This program is distributed in the hope that it will be useful,
00016  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00017  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00018  *  GNU General Public License for more details.
00019  *
00020  *  You should have received a copy of the GNU General Public License along
00021  *  with this program; if not, write to the Free Software Foundation, Inc.,
00022  *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
00023  */
00024 /*
00025  * This set of compile-time defines and run-time variables can be used to
00026  * determine the version number of the mbed TLS library used.
00027  */
00028 #ifndef POLARSSL_VERSION_H
00029 #define POLARSSL_VERSION_H
00030 
00031 #if !defined(POLARSSL_CONFIG_FILE)
00032 #include "config.h"
00033 #else
00034 #include POLARSSL_CONFIG_FILE
00035 #endif
00036 
00037 /**
00038  * The version number x.y.z is split into three parts.
00039  * Major, Minor, Patchlevel
00040  */
00041 #define POLARSSL_VERSION_MAJOR  1
00042 #define POLARSSL_VERSION_MINOR  3
00043 #define POLARSSL_VERSION_PATCH  11
00044 
00045 /**
00046  * The single version number has the following structure:
00047  *    MMNNPP00
00048  *    Major version | Minor version | Patch version
00049  */
00050 #define POLARSSL_VERSION_NUMBER         0x01030B00
00051 #define POLARSSL_VERSION_STRING         "1.3.11"
00052 #define POLARSSL_VERSION_STRING_FULL    "mbed TLS 1.3.11"
00053 
00054 #if defined(POLARSSL_VERSION_C)
00055 
00056 #ifdef __cplusplus
00057 extern "C" {
00058 #endif
00059 
00060 /**
00061  * Get the version number.
00062  *
00063  * \return          The constructed version number in the format
00064  *                  MMNNPP00 (Major, Minor, Patch).
00065  */
00066 unsigned int version_get_number( void );
00067 
00068 /**
00069  * Get the version string ("x.y.z").
00070  *
00071  * \param string    The string that will receive the value.
00072  *                  (Should be at least 9 bytes in size)
00073  */
00074 void version_get_string( char *string );
00075 
00076 /**
00077  * Get the full version string ("mbed TLS x.y.z").
00078  *
00079  * \param string    The string that will receive the value. The mbed TLS version
00080  *                  string will use 18 bytes AT MOST including a terminating
00081  *                  null byte.
00082  *                  (So the buffer should be at least 18 bytes to receive this
00083  *                  version string).
00084  */
00085 void version_get_string_full( char *string );
00086 
00087 /**
00088  * \brief           Check if support for a feature was compiled into this
00089  *                  mbed TLS binary. This allows you to see at runtime if the
00090  *                  library was for instance compiled with or without
00091  *                  Multi-threading support.
00092  *
00093  *                  Note: only checks against defines in the sections "System
00094  *                        support", "mbed TLS modules" and "mbed TLS feature
00095  *                        support" in config.h
00096  *
00097  * \param feature   The string for the define to check (e.g. "POLARSSL_AES_C")
00098  *
00099  * \return          0 if the feature is present, -1 if the feature is not
00100  *                  present and -2 if support for feature checking as a whole
00101  *                  was not compiled in.
00102  */
00103 int version_check_feature( const char *feature );
00104 
00105 #ifdef __cplusplus
00106 }
00107 #endif
00108 
00109 #endif /* POLARSSL_VERSION_C */
00110 
00111 #endif /* version.h */
00112