2 * \file platform_time.h
4 * \brief mbed TLS Platform time abstraction
6 * Copyright (C) 2006-2016, ARM Limited, All Rights Reserved
7 * SPDX-License-Identifier: Apache-2.0
9 * Licensed under the Apache License, Version 2.0 (the "License"); you may
10 * not use this file except in compliance with the License.
11 * You may obtain a copy of the License at
13 * http://www.apache.org/licenses/LICENSE-2.0
15 * Unless required by applicable law or agreed to in writing, software
16 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
17 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 * See the License for the specific language governing permissions and
19 * limitations under the License.
21 * This file is part of mbed TLS (https://tls.mbed.org)
23 #ifndef MBEDTLS_PLATFORM_TIME_H
24 #define MBEDTLS_PLATFORM_TIME_H
26 #if !defined(MBEDTLS_CONFIG_FILE)
29 #include MBEDTLS_CONFIG_FILE
37 * \name SECTION: Module settings
39 * The configuration options you can set for this module are in this section.
40 * Either change them in config.h or define them on the compiler command line.
47 #if defined(MBEDTLS_PLATFORM_TIME_TYPE_MACRO)
48 typedef MBEDTLS_PLATFORM_TIME_TYPE_MACRO mbedtls_time_t;
52 typedef time_t mbedtls_time_t;
53 #endif /* MBEDTLS_PLATFORM_TIME_TYPE_MACRO */
56 * The function pointers for time
58 #if defined(MBEDTLS_PLATFORM_TIME_ALT)
59 extern mbedtls_time_t (*mbedtls_time)( mbedtls_time_t* time );
62 * \brief Set your own time function pointer
64 * \param time_func the time function implementation
68 int mbedtls_platform_set_time( mbedtls_time_t (*time_func)( mbedtls_time_t* time ) );
70 #if defined(MBEDTLS_PLATFORM_TIME_MACRO)
71 #define mbedtls_time MBEDTLS_PLATFORM_TIME_MACRO
73 #define mbedtls_time time
74 #endif /* MBEDTLS_PLATFORM_TIME_MACRO */
75 #endif /* MBEDTLS_PLATFORM_TIME_ALT */
81 #endif /* platform_time.h */