This is a fork of the mbed port of axTLS

Dependents:   TLS_axTLS-Example HTTPSClientExample

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers os_port.h Source File

os_port.h

Go to the documentation of this file.
00001 #ifndef HEADER_OS_PORT_H
00002 #define HEADER_OS_PORT_H
00003 #ifdef __cplusplus
00004 extern "C" {
00005 #endif
00006 
00007 #include "config.h"
00008 //#include <Thread.h>
00009 #define SSL_CTX_MUTEX_TYPE          //Mutex
00010 #define SSL_CTX_MUTEX_INIT(A)       //pthread_mutex_init(&A, NULL)
00011 #define SSL_CTX_MUTEX_DESTROY(A)    //pthread_mutex_destroy(&A)
00012 #define SSL_CTX_LOCK(A)             //pthread_mutex_lock(&A)
00013 #define SSL_CTX_UNLOCK(A)           //pthread_mutex_unlock(&A)
00014 
00015 #define malloc(A)       ax_malloc(A, __FILE__, __LINE__)
00016 #ifndef realloc
00017 #define realloc(A,B)    ax_realloc(A,B, __FILE__, __LINE__)
00018 #endif
00019 #define calloc(A,B)     ax_calloc(A,B, __FILE__, __LINE__)
00020 #define free(A)         ax_free(A, __FILE__, __LINE__)
00021 
00022 #define STDCALL
00023 #define EXP_FUNC
00024 struct timeval;
00025 EXP_FUNC void STDCALL gettimeofday(struct timeval* t,void* timezone);
00026 
00027 void init_memory_buf(void);
00028 void disable_memory_buf(void);
00029 void enable_memory_buf(void);
00030 void print_buf_stats(void);
00031 void print_all_buf_stats(void);
00032 
00033 EXP_FUNC void * STDCALL ax_malloc(size_t s, const char* f, const int l);
00034 EXP_FUNC void * STDCALL ax_realloc(void *y, size_t s, const char* f, const int l);
00035 EXP_FUNC void * STDCALL ax_calloc(size_t n, size_t s, const char* f, const int l);
00036 EXP_FUNC void   STDCALL ax_free(void *y, const char* f, const int l);
00037 
00038 void exit_now(const char *format, ...);
00039 
00040 //EXP_FUNC int STDCALL ax_open(const char *pathname, int flags); 
00041 
00042 #define SOCKET_READ(A,B,C)      lwip_read(A,B,C)
00043 #define SOCKET_WRITE(A,B,C)     lwip_write(A,B,C)
00044 #define SOCKET_CLOSE(A)         closesocket(A)
00045 #define TTY_FLUSH()
00046 #ifdef __cplusplus
00047 }
00048 #endif
00049 #endif 
00050