mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2026-01-27 04:22:19 +01:00
Enhance MQX platform support and integration
This commit is contained in:
@@ -56,15 +56,23 @@
|
||||
/* default */
|
||||
#define XINET_NTOA inet_ntoa
|
||||
#define XINET_ATON inet_aton
|
||||
#ifdef FREESCALE_MQX
|
||||
#define XINET_PTON(a,b,c,d) inet_pton((a),(b),(c),(d))
|
||||
#else
|
||||
#define XINET_PTON(a,b,c) inet_pton((a),(b),(c))
|
||||
#endif
|
||||
#define XINET_NTOP inet_ntop
|
||||
#define XINET_ADDR inet_addr
|
||||
#define XHTONS htons
|
||||
#define XNTOHS ntohs
|
||||
#define XHTONL htonl
|
||||
#define XNTOHL ntohl
|
||||
#ifdef FREESCALE_MQX
|
||||
#define XINADDR_NONE INADDR_BROADCAST
|
||||
#else
|
||||
#define XINADDR_NONE INADDR_NONE
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if !defined(WOLFCRYPT_ONLY) && !defined(NO_FILESYSTEM)
|
||||
#ifdef WOLFSSL_SNIFFER
|
||||
@@ -76,7 +84,7 @@
|
||||
#ifdef TCP_PROTOCOL
|
||||
#undef TCP_PROTOCOL
|
||||
#endif
|
||||
#else
|
||||
#elif !defined(FREESCALE_MQX)
|
||||
#ifndef _WIN32
|
||||
#include <arpa/inet.h>
|
||||
#else
|
||||
@@ -1817,6 +1825,9 @@ static int SetNamedPrivateKey(const char* name, const char* address, int port,
|
||||
#ifdef FUSION_RTOS
|
||||
if (XINET_PTON(AF_INET6, address, serverIp.ip6,
|
||||
sizeof(serverIp.ip4)) == 1)
|
||||
#elif defined(FREESCALE_MQX)
|
||||
if (XINET_PTON(AF_INET6, address, serverIp.ip6,
|
||||
sizeof(serverIp.ip6)) == RTCS_OK)
|
||||
#else
|
||||
if (XINET_PTON(AF_INET6, address, serverIp.ip6) == 1)
|
||||
#endif
|
||||
@@ -7672,6 +7683,9 @@ int ssl_RemoveSession(const char* clientIp, int clientPort,
|
||||
#ifdef FUSION_RTOS
|
||||
if (XINET_PTON(AF_INET6, clientIp, clientAddr.ip6,
|
||||
sizeof(clientAddr.ip4)) == 1)
|
||||
#elif defined(FREESCALE_MQX)
|
||||
if (XINET_PTON(AF_INET6, clientIp, clientAddr.ip6,
|
||||
sizeof(clientAddr.ip6)) == RTCS_OK)
|
||||
#else
|
||||
if (XINET_PTON(AF_INET6, clientIp, clientAddr.ip6) == 1)
|
||||
#endif
|
||||
@@ -7691,6 +7705,9 @@ int ssl_RemoveSession(const char* clientIp, int clientPort,
|
||||
#ifdef FUSION_RTOS
|
||||
if (XINET_PTON(AF_INET6, serverIp, serverAddr.ip6,
|
||||
sizeof(serverAddr.ip4)) == 1)
|
||||
#elif defined(FREESCALE_MQX)
|
||||
if (XINET_PTON(AF_INET6, clientIp, clientAddr.ip6,
|
||||
sizeof(clientAddr.ip6)) == RTCS_OK)
|
||||
#else
|
||||
if (XINET_PTON(AF_INET6, serverIp, serverAddr.ip6) == 1)
|
||||
#endif
|
||||
|
||||
@@ -21390,7 +21390,11 @@ WOLFSSL_ASN1_STRING* wolfSSL_a2i_IPADDRESS(const char* ipa)
|
||||
}
|
||||
|
||||
buf[WOLFSSL_IP6_ADDR_LEN] = '\0';
|
||||
#ifdef FREESCALE_MQX
|
||||
if (XINET_PTON(af, ipa, (void*)buf, sizeof(buf)) != RTCS_OK) {
|
||||
#else
|
||||
if (XINET_PTON(af, ipa, (void*)buf) != 1) {
|
||||
#endif
|
||||
WOLFSSL_MSG("Error parsing IP address");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -1853,8 +1853,7 @@ extern void uITRON4_free(void *p) ;
|
||||
#else
|
||||
#define XFREE(p, h, t) {void* xp = (p); (void)(h); (void)(t); if ((xp)) _mem_free((xp));}
|
||||
#endif
|
||||
|
||||
/* Note: MQX has no realloc, using fastmath above */
|
||||
#define XREALLOC(p, n, h, t) ((void)(h), (void)(t), (void *)_mem_realloc((p), (n)))
|
||||
#endif
|
||||
#ifdef USE_FAST_MATH
|
||||
/* Undef first to avoid re-definition if user_settings.h defines */
|
||||
|
||||
@@ -935,6 +935,7 @@ WOLFSSL_ABI WOLFSSL_API int wolfCrypt_Cleanup(void);
|
||||
#define XSEEK_END IO_SEEK_END
|
||||
#define XBADFILE NULL
|
||||
#define XFGETS fgets
|
||||
#define XFPRINTF fprintf
|
||||
|
||||
#elif defined(WOLFSSL_DEOS)
|
||||
#define NO_FILESYSTEM
|
||||
|
||||
@@ -602,6 +602,11 @@ WOLFSSL_API int wolfIO_RecvFrom(SOCKET_T sd, WOLFSSL_BIO_ADDR *addr, char *buf,
|
||||
} while(0)
|
||||
#endif
|
||||
#define StartTCP() WC_DO_NOTHING
|
||||
#elif defined(FREESCALE_MQX)
|
||||
#ifndef CloseSocket
|
||||
#define CloseSocket(s) closesocket(s)
|
||||
#endif
|
||||
#define StartTCP() WC_DO_NOTHING
|
||||
#else
|
||||
#ifndef CloseSocket
|
||||
#define CloseSocket(s) close(s)
|
||||
@@ -987,6 +992,8 @@ WOLFSSL_API void wolfSSL_SetIOWriteFlags(WOLFSSL* ssl, int flags);
|
||||
#else
|
||||
#define XINET_PTON(a,b,c) InetPton((a),(PCWSTR)(b),(c))
|
||||
#endif
|
||||
#elif defined(FREESCALE_MQX)
|
||||
#define XINET_PTON(a,b,c,d) inet_pton((a),(b),(c),(d))
|
||||
#else
|
||||
#define XINET_PTON(a,b,c) inet_pton((a),(b),(c))
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user