mbed TLS Build
include/mbedtls/version.h@1:1a219dea6cb5, 2019-06-04 (annotated)
- Committer:
- williequesada
- Date:
- Tue Jun 04 16:03:38 2019 +0000
- Revision:
- 1:1a219dea6cb5
- Parent:
- 0:cdf462088d13
compartir a Pablo
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
markrad | 0:cdf462088d13 | 1 | /** |
markrad | 0:cdf462088d13 | 2 | * \file version.h |
markrad | 0:cdf462088d13 | 3 | * |
markrad | 0:cdf462088d13 | 4 | * \brief Run-time version information |
markrad | 0:cdf462088d13 | 5 | * |
markrad | 0:cdf462088d13 | 6 | * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved |
markrad | 0:cdf462088d13 | 7 | * SPDX-License-Identifier: Apache-2.0 |
markrad | 0:cdf462088d13 | 8 | * |
markrad | 0:cdf462088d13 | 9 | * Licensed under the Apache License, Version 2.0 (the "License"); you may |
markrad | 0:cdf462088d13 | 10 | * not use this file except in compliance with the License. |
markrad | 0:cdf462088d13 | 11 | * You may obtain a copy of the License at |
markrad | 0:cdf462088d13 | 12 | * |
markrad | 0:cdf462088d13 | 13 | * http://www.apache.org/licenses/LICENSE-2.0 |
markrad | 0:cdf462088d13 | 14 | * |
markrad | 0:cdf462088d13 | 15 | * Unless required by applicable law or agreed to in writing, software |
markrad | 0:cdf462088d13 | 16 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
markrad | 0:cdf462088d13 | 17 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
markrad | 0:cdf462088d13 | 18 | * See the License for the specific language governing permissions and |
markrad | 0:cdf462088d13 | 19 | * limitations under the License. |
markrad | 0:cdf462088d13 | 20 | * |
markrad | 0:cdf462088d13 | 21 | * This file is part of mbed TLS (https://tls.mbed.org) |
markrad | 0:cdf462088d13 | 22 | */ |
markrad | 0:cdf462088d13 | 23 | /* |
markrad | 0:cdf462088d13 | 24 | * This set of compile-time defines and run-time variables can be used to |
markrad | 0:cdf462088d13 | 25 | * determine the version number of the mbed TLS library used. |
markrad | 0:cdf462088d13 | 26 | */ |
markrad | 0:cdf462088d13 | 27 | #ifndef MBEDTLS_VERSION_H |
markrad | 0:cdf462088d13 | 28 | #define MBEDTLS_VERSION_H |
markrad | 0:cdf462088d13 | 29 | |
markrad | 0:cdf462088d13 | 30 | #if !defined(MBEDTLS_CONFIG_FILE) |
markrad | 0:cdf462088d13 | 31 | #include "config.h" |
markrad | 0:cdf462088d13 | 32 | #else |
markrad | 0:cdf462088d13 | 33 | #include MBEDTLS_CONFIG_FILE |
markrad | 0:cdf462088d13 | 34 | #endif |
markrad | 0:cdf462088d13 | 35 | |
markrad | 0:cdf462088d13 | 36 | /** |
markrad | 0:cdf462088d13 | 37 | * The version number x.y.z is split into three parts. |
markrad | 0:cdf462088d13 | 38 | * Major, Minor, Patchlevel |
markrad | 0:cdf462088d13 | 39 | */ |
markrad | 0:cdf462088d13 | 40 | #define MBEDTLS_VERSION_MAJOR 2 |
markrad | 0:cdf462088d13 | 41 | #define MBEDTLS_VERSION_MINOR 4 |
markrad | 0:cdf462088d13 | 42 | #define MBEDTLS_VERSION_PATCH 1 |
markrad | 0:cdf462088d13 | 43 | |
markrad | 0:cdf462088d13 | 44 | /** |
markrad | 0:cdf462088d13 | 45 | * The single version number has the following structure: |
markrad | 0:cdf462088d13 | 46 | * MMNNPP00 |
markrad | 0:cdf462088d13 | 47 | * Major version | Minor version | Patch version |
markrad | 0:cdf462088d13 | 48 | */ |
markrad | 0:cdf462088d13 | 49 | #define MBEDTLS_VERSION_NUMBER 0x02040100 |
markrad | 0:cdf462088d13 | 50 | #define MBEDTLS_VERSION_STRING "2.4.1" |
markrad | 0:cdf462088d13 | 51 | #define MBEDTLS_VERSION_STRING_FULL "mbed TLS 2.4.1" |
markrad | 0:cdf462088d13 | 52 | |
markrad | 0:cdf462088d13 | 53 | #if defined(MBEDTLS_VERSION_C) |
markrad | 0:cdf462088d13 | 54 | |
markrad | 0:cdf462088d13 | 55 | #ifdef __cplusplus |
markrad | 0:cdf462088d13 | 56 | extern "C" { |
markrad | 0:cdf462088d13 | 57 | #endif |
markrad | 0:cdf462088d13 | 58 | |
markrad | 0:cdf462088d13 | 59 | /** |
markrad | 0:cdf462088d13 | 60 | * Get the version number. |
markrad | 0:cdf462088d13 | 61 | * |
markrad | 0:cdf462088d13 | 62 | * \return The constructed version number in the format |
markrad | 0:cdf462088d13 | 63 | * MMNNPP00 (Major, Minor, Patch). |
markrad | 0:cdf462088d13 | 64 | */ |
markrad | 0:cdf462088d13 | 65 | unsigned int mbedtls_version_get_number( void ); |
markrad | 0:cdf462088d13 | 66 | |
markrad | 0:cdf462088d13 | 67 | /** |
markrad | 0:cdf462088d13 | 68 | * Get the version string ("x.y.z"). |
markrad | 0:cdf462088d13 | 69 | * |
markrad | 0:cdf462088d13 | 70 | * \param string The string that will receive the value. |
markrad | 0:cdf462088d13 | 71 | * (Should be at least 9 bytes in size) |
markrad | 0:cdf462088d13 | 72 | */ |
markrad | 0:cdf462088d13 | 73 | void mbedtls_version_get_string( char *string ); |
markrad | 0:cdf462088d13 | 74 | |
markrad | 0:cdf462088d13 | 75 | /** |
markrad | 0:cdf462088d13 | 76 | * Get the full version string ("mbed TLS x.y.z"). |
markrad | 0:cdf462088d13 | 77 | * |
markrad | 0:cdf462088d13 | 78 | * \param string The string that will receive the value. The mbed TLS version |
markrad | 0:cdf462088d13 | 79 | * string will use 18 bytes AT MOST including a terminating |
markrad | 0:cdf462088d13 | 80 | * null byte. |
markrad | 0:cdf462088d13 | 81 | * (So the buffer should be at least 18 bytes to receive this |
markrad | 0:cdf462088d13 | 82 | * version string). |
markrad | 0:cdf462088d13 | 83 | */ |
markrad | 0:cdf462088d13 | 84 | void mbedtls_version_get_string_full( char *string ); |
markrad | 0:cdf462088d13 | 85 | |
markrad | 0:cdf462088d13 | 86 | /** |
markrad | 0:cdf462088d13 | 87 | * \brief Check if support for a feature was compiled into this |
markrad | 0:cdf462088d13 | 88 | * mbed TLS binary. This allows you to see at runtime if the |
markrad | 0:cdf462088d13 | 89 | * library was for instance compiled with or without |
markrad | 0:cdf462088d13 | 90 | * Multi-threading support. |
markrad | 0:cdf462088d13 | 91 | * |
markrad | 0:cdf462088d13 | 92 | * \note only checks against defines in the sections "System |
markrad | 0:cdf462088d13 | 93 | * support", "mbed TLS modules" and "mbed TLS feature |
markrad | 0:cdf462088d13 | 94 | * support" in config.h |
markrad | 0:cdf462088d13 | 95 | * |
markrad | 0:cdf462088d13 | 96 | * \param feature The string for the define to check (e.g. "MBEDTLS_AES_C") |
markrad | 0:cdf462088d13 | 97 | * |
markrad | 0:cdf462088d13 | 98 | * \return 0 if the feature is present, |
markrad | 0:cdf462088d13 | 99 | * -1 if the feature is not present and |
markrad | 0:cdf462088d13 | 100 | * -2 if support for feature checking as a whole was not |
markrad | 0:cdf462088d13 | 101 | * compiled in. |
markrad | 0:cdf462088d13 | 102 | */ |
markrad | 0:cdf462088d13 | 103 | int mbedtls_version_check_feature( const char *feature ); |
markrad | 0:cdf462088d13 | 104 | |
markrad | 0:cdf462088d13 | 105 | #ifdef __cplusplus |
markrad | 0:cdf462088d13 | 106 | } |
markrad | 0:cdf462088d13 | 107 | #endif |
markrad | 0:cdf462088d13 | 108 | |
markrad | 0:cdf462088d13 | 109 | #endif /* MBEDTLS_VERSION_C */ |
markrad | 0:cdf462088d13 | 110 | |
markrad | 0:cdf462088d13 | 111 | #endif /* version.h */ |