Documentation

Documentation

Includes

config.h

#include "config.h"
#include "config.h"

MBEDTLS_CONFIG_FILE

#include MBEDTLS_CONFIG_FILE
#include MBEDTLS_CONFIG_FILE

stdlib.h

#include <stdlib.h>
#include 

pthread.h

#include <pthread.h>
#include 

threading_alt.h

#include "threading_alt.h"
#include "threading_alt.h"

Macros

Marco MBEDTLS_THREADING_H

#define MBEDTLS_THREADING_H


      

Marco MBEDTLS_ERR_THREADING_FEATURE_UNAVAILABLE

#define MBEDTLS_ERR_THREADING_FEATURE_UNAVAILABLE        -1A /**< The selected feature is not available. */
/* MBEDTLS_ERR_THREADING_FEATURE_UNAVAILABLE is deprecated and should not be
 * used. */

Marco MBEDTLS_ERR_THREADING_BAD_INPUT_DATA

#define MBEDTLS_ERR_THREADING_BAD_INPUT_DATA             -1C /**< Bad input parameters to function. */


      

Marco MBEDTLS_ERR_THREADING_MUTEX_ERROR

#define MBEDTLS_ERR_THREADING_MUTEX_ERROR                -1E /**< Locking / unlocking / free failed with error code. */

      

Functions

Func mbedtls_threading_set_alt

void mbedtls_threading_set_alt( void (*mutex_init)( mbedtls_threading_mutex_t * ),
                      void (*mutex_free)( mbedtls_threading_mutex_t * ),
                      int (*mutex_lock)( mbedtls_threading_mutex_t * ),
                      int (*mutex_unlock)( mbedtls_threading_mutex_t * ) );
/**
 * \brief           Set your alternate threading implementation function
 *                  pointers and initialize global mutexes. If used, this
 *                  function must be called once in the main thread before any
 *                  other mbed TLS function is called, and
 *                  mbedtls_threading_free_alt() must be called once in the main
 *                  thread after all other mbed TLS functions.
 *
 * \note            mutex_init() and mutex_free() don't return a status code.
 *                  If mutex_init() fails, it should leave its argument (the
 *                  mutex) in a state such that mutex_lock() will fail when
 *                  called with this argument.
 *
 * \param mutex_init    the init function implementation
 * \param mutex_free    the free function implementation
 * \param mutex_lock    the lock function implementation
 * \param mutex_unlock  the unlock function implementation
 */

Func mbedtls_threading_free_alt

void mbedtls_threading_free_alt( void );
/**
 * \brief               Free global mutexes.
 */

Vars

Consts

Types

Typedefs

Typedef mbedtls_threading_mutex_t;

typedef struct mbedtls_threading_mutex_t
{
   pthread_mutex_t mutex;
   char is_valid;
} mbedtls_threading_mutex_t;