platform.h File Reference

The Mbed TLS platform abstraction layer. More...

#include "config.h"
#include "platform_time.h"
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
Include dependency graph for platform.h:

Go to the source code of this file.

Data Structures

struct  mbedtls_platform_context
 The platform context structure. More...

Defines

#define mbedtls_free   free
#define mbedtls_calloc   calloc
#define mbedtls_fprintf   fprintf
#define mbedtls_printf   printf
#define mbedtls_snprintf   MBEDTLS_PLATFORM_STD_SNPRINTF
#define mbedtls_exit   exit
#define MBEDTLS_EXIT_SUCCESS   MBEDTLS_PLATFORM_STD_EXIT_SUCCESS
#define MBEDTLS_EXIT_FAILURE   MBEDTLS_PLATFORM_STD_EXIT_FAILURE
SECTION: Module settings

The configuration options you can set for this module are in this section. Either change them in config.h or define them on the compiler command line.



#define MBEDTLS_PLATFORM_STD_SNPRINTF   snprintf
#define MBEDTLS_PLATFORM_STD_PRINTF   printf
#define MBEDTLS_PLATFORM_STD_FPRINTF   fprintf
#define MBEDTLS_PLATFORM_STD_CALLOC   calloc
#define MBEDTLS_PLATFORM_STD_FREE   free
#define MBEDTLS_PLATFORM_STD_EXIT   exit
#define MBEDTLS_PLATFORM_STD_TIME   time
#define MBEDTLS_PLATFORM_STD_EXIT_SUCCESS   EXIT_SUCCESS
#define MBEDTLS_PLATFORM_STD_EXIT_FAILURE   EXIT_FAILURE
#define MBEDTLS_PLATFORM_STD_NV_SEED_READ   mbedtls_platform_std_nv_seed_read
#define MBEDTLS_PLATFORM_STD_NV_SEED_WRITE   mbedtls_platform_std_nv_seed_write
#define MBEDTLS_PLATFORM_STD_NV_SEED_FILE   "seedfile"

Functions

int mbedtls_platform_setup (mbedtls_platform_context *ctx)
 This function performs any platform initialization operations.
void mbedtls_platform_teardown (mbedtls_platform_context *ctx)
 This function performs any platform teardown operations.

Detailed Description

The Mbed TLS platform abstraction layer.

Definition in file platform.h.


Define Documentation

#define mbedtls_calloc   calloc

Definition at line 158 of file platform.h.

#define mbedtls_exit   exit

Definition at line 263 of file platform.h.

#define MBEDTLS_EXIT_FAILURE   MBEDTLS_PLATFORM_STD_EXIT_FAILURE

Definition at line 276 of file platform.h.

#define MBEDTLS_EXIT_SUCCESS   MBEDTLS_PLATFORM_STD_EXIT_SUCCESS

Definition at line 271 of file platform.h.

#define mbedtls_fprintf   fprintf

Definition at line 182 of file platform.h.

#define mbedtls_free   free

Definition at line 157 of file platform.h.

#define MBEDTLS_PLATFORM_STD_CALLOC   calloc

The default calloc function to use.

Definition at line 94 of file platform.h.

#define MBEDTLS_PLATFORM_STD_EXIT   exit

The default exit function to use.

Definition at line 100 of file platform.h.

#define MBEDTLS_PLATFORM_STD_EXIT_FAILURE   EXIT_FAILURE

The default exit value to use.

Definition at line 109 of file platform.h.

#define MBEDTLS_PLATFORM_STD_EXIT_SUCCESS   EXIT_SUCCESS

The default exit value to use.

Definition at line 106 of file platform.h.

#define MBEDTLS_PLATFORM_STD_FPRINTF   fprintf

The default fprintf function to use.

Definition at line 91 of file platform.h.

#define MBEDTLS_PLATFORM_STD_FREE   free

The default free function to use.

Definition at line 97 of file platform.h.

#define MBEDTLS_PLATFORM_STD_NV_SEED_FILE   "seedfile"

Definition at line 119 of file platform.h.

#define MBEDTLS_PLATFORM_STD_NV_SEED_READ   mbedtls_platform_std_nv_seed_read

Definition at line 113 of file platform.h.

#define MBEDTLS_PLATFORM_STD_NV_SEED_WRITE   mbedtls_platform_std_nv_seed_write

Definition at line 116 of file platform.h.

#define MBEDTLS_PLATFORM_STD_PRINTF   printf

The default printf function to use.

Definition at line 88 of file platform.h.

#define MBEDTLS_PLATFORM_STD_SNPRINTF   snprintf

The default snprintf function to use.

Definition at line 84 of file platform.h.

#define MBEDTLS_PLATFORM_STD_TIME   time

The default time function to use.

Definition at line 103 of file platform.h.

#define mbedtls_printf   printf

Definition at line 205 of file platform.h.

#define mbedtls_snprintf   MBEDTLS_PLATFORM_STD_SNPRINTF

Definition at line 240 of file platform.h.


Function Documentation

int mbedtls_platform_setup ( mbedtls_platform_context ctx  ) 

This function performs any platform initialization operations.

Parameters:
ctx The Mbed TLS context.
Returns:
0 on success.
Note:
This function is intended to allow platform-specific initialization, and should be called before any other library functions. Its implementation is platform-specific, and unless platform-specific code is provided, it does nothing.

Its use and whether it is necessary to call it is dependent on the platform.

void mbedtls_platform_teardown ( mbedtls_platform_context ctx  ) 

This function performs any platform teardown operations.

Parameters:
ctx The Mbed TLS context.
Note:
This function should be called after every other Mbed TLS module has been correctly freed using the appropriate free function. Its implementation is platform-specific, and unless platform-specific code is provided, it does nothing.

Its use and whether it is necessary to call it is dependent on the platform.


Generated on 10 Aug 2020 for mbed TLS v2.7.16 by  doxygen 1.6.1