34 #if !defined(WOLFSSL_USER_IO) 36 #if defined(HAVE_OCSP) || defined(HAVE_CRL_IO) 37 #ifndef HAVE_HTTP_CLIENT 38 #define HAVE_HTTP_CLIENT 43 #if !defined(WOLFSSL_USER_IO) 45 #if !defined(USE_WOLFSSL_IO) && !defined(MICRIUM) && \ 46 !defined(WOLFSSL_CONTIKI) && !defined(WOLFSSL_NO_SOCK) 47 #define USE_WOLFSSL_IO 52 #if defined(USE_WOLFSSL_IO) || defined(HAVE_HTTP_CLIENT) 58 #ifndef USE_WINDOWS_API 59 #if defined(WOLFSSL_LWIP) && !defined(WOLFSSL_APACHE_MYNEWT) 62 #include "lwip/sockets.h" 63 #ifndef LWIP_PROVIDE_ERRNO 65 #define LWIP_PROVIDE_ERRNO 1 67 #elif defined(FREESCALE_MQX) 70 #elif defined(FREESCALE_KSDK_MQX) 72 #elif (defined(WOLFSSL_MDK_ARM) || defined(WOLFSSL_KEIL_TCP_NET)) 75 #elif defined(WOLFSSL_CMSIS_RTOS) 77 #elif defined(WOLFSSL_CMSIS_RTOSv2) 78 #include "cmsis_os2.h" 79 #elif defined(WOLFSSL_TIRTOS) 80 #include <sys/socket.h> 81 #elif defined(FREERTOS_TCP) 82 #include "FreeRTOS_Sockets.h" 83 #elif defined(WOLFSSL_IAR_ARM) 85 #elif defined(HAVE_NETX_BSD) 91 #elif defined(WOLFSSL_VXWORKS) 94 #elif defined(WOLFSSL_NUCLEUS_1_2) 97 #elif defined(WOLFSSL_ATMEL) 98 #include "socket/include/socket.h" 99 #elif defined(INTIME_RTOS) 103 #include <sys/types.h> 104 #include <sys/socket.h> 106 #include <netinet/in.h> 111 #elif defined(WOLFSSL_PRCONNECT_PRO) 112 #include <prconnect_pro/prconnect_pro.h> 113 #include <sys/types.h> 118 #include <sys/ioctl.h> 119 #elif defined(WOLFSSL_SGX) 121 #elif defined(WOLFSSL_APACHE_MYNEWT) && !defined(WOLFSSL_LWIP) 122 #include <mn_socket/mn_socket.h> 123 #elif defined(WOLFSSL_DEOS) 124 #include <socketapi.h> 125 #include <lwip-socket.h> 127 #elif defined(WOLFSSL_ZEPHYR) 128 #include <net/socket.h> 129 #elif defined(HAVE_NETX) 132 #elif !defined(WOLFSSL_NO_SOCK) 133 #include <sys/types.h> 139 #define XFCNTL(fd, flag, block) fcntl((fd), (flag), (block)) 141 #if defined(HAVE_RTP_SYS) 143 #elif defined(EBSNET) 146 #elif !defined(DEVKITPRO) && !defined(WOLFSSL_PICOTCP) \ 147 && !defined(WOLFSSL_CONTIKI) && !defined(WOLFSSL_WICED) \ 148 && !defined(WOLFSSL_GNRC) && !defined(WOLFSSL_RIOT_OS) 149 #include <sys/socket.h> 150 #include <arpa/inet.h> 151 #include <netinet/in.h> 154 #include <netex/errno.h> 156 #include <sys/ioctl.h> 161 #if defined(WOLFSSL_RENESAS_RA6M3G) 168 #include <sys/filio.h> 171 #ifdef USE_WINDOWS_API 174 #define WSAEPIPE -12345 176 #define SOCKET_EWOULDBLOCK WSAEWOULDBLOCK 177 #define SOCKET_EAGAIN WSAETIMEDOUT 178 #define SOCKET_ECONNRESET WSAECONNRESET 179 #define SOCKET_EINTR WSAEINTR 180 #define SOCKET_EPIPE WSAEPIPE 181 #define SOCKET_ECONNREFUSED WSAENOTCONN 182 #define SOCKET_ECONNABORTED WSAECONNABORTED 184 #define SOCKET_EWOULDBLOCK SYS_NET_EWOULDBLOCK 185 #define SOCKET_EAGAIN SYS_NET_EAGAIN 186 #define SOCKET_ECONNRESET SYS_NET_ECONNRESET 187 #define SOCKET_EINTR SYS_NET_EINTR 188 #define SOCKET_EPIPE SYS_NET_EPIPE 189 #define SOCKET_ECONNREFUSED SYS_NET_ECONNREFUSED 190 #define SOCKET_ECONNABORTED SYS_NET_ECONNABORTED 191 #elif defined(FREESCALE_MQX) || defined(FREESCALE_KSDK_MQX) 194 #define SOCKET_EWOULDBLOCK EAGAIN 195 #define SOCKET_EAGAIN EAGAIN 196 #define SOCKET_ECONNRESET RTCSERR_TCP_CONN_RESET 197 #define SOCKET_EINTR EINTR 198 #define SOCKET_EPIPE EPIPE 199 #define SOCKET_ECONNREFUSED RTCSERR_TCP_CONN_REFUSED 200 #define SOCKET_ECONNABORTED RTCSERR_TCP_CONN_ABORTED 202 #define SOCKET_EWOULDBLOCK NIO_EWOULDBLOCK 203 #define SOCKET_EAGAIN NIO_EAGAIN 204 #define SOCKET_ECONNRESET NIO_ECONNRESET 205 #define SOCKET_EINTR NIO_EINTR 206 #define SOCKET_EPIPE NIO_EPIPE 207 #define SOCKET_ECONNREFUSED NIO_ECONNREFUSED 208 #define SOCKET_ECONNABORTED NIO_ECONNABORTED 210 #elif defined(WOLFSSL_MDK_ARM)|| defined(WOLFSSL_KEIL_TCP_NET) 211 #define SOCKET_EWOULDBLOCK BSD_ERROR_WOULDBLOCK 212 #define SOCKET_EAGAIN BSD_ERROR_LOCKED 213 #define SOCKET_ECONNRESET BSD_ERROR_CLOSED 214 #define SOCKET_EINTR BSD_ERROR 215 #define SOCKET_EPIPE BSD_ERROR 216 #define SOCKET_ECONNREFUSED BSD_ERROR 217 #define SOCKET_ECONNABORTED BSD_ERROR 218 #elif defined(WOLFSSL_PICOTCP) 219 #define SOCKET_EWOULDBLOCK PICO_ERR_EAGAIN 220 #define SOCKET_EAGAIN PICO_ERR_EAGAIN 221 #define SOCKET_ECONNRESET PICO_ERR_ECONNRESET 222 #define SOCKET_EINTR PICO_ERR_EINTR 223 #define SOCKET_EPIPE PICO_ERR_EIO 224 #define SOCKET_ECONNREFUSED PICO_ERR_ECONNREFUSED 225 #define SOCKET_ECONNABORTED PICO_ERR_ESHUTDOWN 226 #elif defined(FREERTOS_TCP) 227 #define SOCKET_EWOULDBLOCK FREERTOS_EWOULDBLOCK 228 #define SOCKET_EAGAIN FREERTOS_EWOULDBLOCK 229 #define SOCKET_ECONNRESET FREERTOS_SOCKET_ERROR 230 #define SOCKET_EINTR FREERTOS_SOCKET_ERROR 231 #define SOCKET_EPIPE FREERTOS_SOCKET_ERROR 232 #define SOCKET_ECONNREFUSED FREERTOS_SOCKET_ERROR 233 #define SOCKET_ECONNABORTED FREERTOS_SOCKET_ERROR 234 #elif defined(WOLFSSL_NUCLEUS_1_2) 235 #define SOCKET_EWOULDBLOCK NU_WOULD_BLOCK 236 #define SOCKET_EAGAIN NU_WOULD_BLOCK 237 #define SOCKET_ECONNRESET NU_NOT_CONNECTED 238 #define SOCKET_EINTR NU_NOT_CONNECTED 239 #define SOCKET_EPIPE NU_NOT_CONNECTED 240 #define SOCKET_ECONNREFUSED NU_CONNECTION_REFUSED 241 #define SOCKET_ECONNABORTED NU_NOT_CONNECTED 242 #elif defined(WOLFSSL_DEOS) 243 #define SOCKET_EWOULDBLOCK EAGAIN 244 #define SOCKET_EAGAIN EAGAIN 245 #define SOCKET_ECONNRESET EINTR 246 #define SOCKET_EINTR EINTR 247 #define SOCKET_EPIPE EPIPE 248 #define SOCKET_ECONNREFUSED SOCKET_ERROR 249 #define SOCKET_ECONNABORTED SOCKET_ERROR 250 #elif defined(HAVE_NETX) 251 #define SOCKET_EWOULDBLOCK NX_NOT_CONNECTED 252 #define SOCKET_EAGAIN NX_NOT_CONNECTED 253 #define SOCKET_ECONNRESET NX_NOT_CONNECTED 254 #define SOCKET_EINTR NX_NOT_CONNECTED 255 #define SOCKET_EPIPE NX_NOT_CONNECTED 256 #define SOCKET_ECONNREFUSED NX_NOT_CONNECTED 257 #define SOCKET_ECONNABORTED NX_NOT_CONNECTED 259 #define SOCKET_EWOULDBLOCK EWOULDBLOCK 260 #define SOCKET_EAGAIN EAGAIN 261 #define SOCKET_ECONNRESET ECONNRESET 262 #define SOCKET_EINTR EINTR 263 #define SOCKET_EPIPE EPIPE 264 #define SOCKET_ECONNREFUSED ECONNREFUSED 265 #define SOCKET_ECONNABORTED ECONNABORTED 270 int net_send(
int,
const void*,
int,
unsigned int);
271 int net_recv(
int,
void*,
int,
unsigned int);
272 #define SEND_FUNCTION net_send 273 #define RECV_FUNCTION net_recv 274 #elif defined(WOLFSSL_LWIP) && !defined(WOLFSSL_APACHE_MYNEWT) 275 #define SEND_FUNCTION lwip_send 276 #define RECV_FUNCTION lwip_recv 277 #elif defined(WOLFSSL_PICOTCP) 278 #define SEND_FUNCTION pico_send 279 #define RECV_FUNCTION pico_recv 280 #elif defined(FREERTOS_TCP) 281 #define RECV_FUNCTION(a,b,c,d) FreeRTOS_recv((Socket_t)(a),(void*)(b), (size_t)(c), (BaseType_t)(d)) 282 #define SEND_FUNCTION(a,b,c,d) FreeRTOS_send((Socket_t)(a),(void*)(b), (size_t)(c), (BaseType_t)(d)) 283 #elif defined(WOLFSSL_VXWORKS) 284 #define SEND_FUNCTION send 285 #define RECV_FUNCTION recv 286 #elif defined(WOLFSSL_NUCLEUS_1_2) 287 #define SEND_FUNCTION NU_Send 288 #define RECV_FUNCTION NU_Recv 289 #elif defined(WOLFSSL_ZEPHYR) 290 #ifndef WOLFSSL_MAX_SEND_SZ 291 #define WOLFSSL_MAX_SEND_SZ 256 294 #define SEND_FUNCTION send 295 #define RECV_FUNCTION recv 297 #define SEND_FUNCTION send 298 #define RECV_FUNCTION recv 299 #if !defined(HAVE_SOCKADDR) && !defined(WOLFSSL_NO_SOCK) 300 #define HAVE_SOCKADDR 304 #ifdef USE_WINDOWS_API 305 typedef unsigned int SOCKET_T;
307 typedef int SOCKET_T;
310 #ifndef WOLFSSL_NO_SOCK 312 #ifdef USE_WINDOWS_API 313 #define XSOCKLENT int 315 #define XSOCKLENT socklen_t 321 typedef struct sockaddr SOCKADDR;
322 typedef struct sockaddr_storage SOCKADDR_S;
323 typedef struct sockaddr_in SOCKADDR_IN;
325 typedef struct sockaddr_in6 SOCKADDR_IN6;
331 #if defined(HAVE_GETADDRINFO) && !defined(WOLF_C99) 332 typedef struct addrinfo ADDRINFO;
338 #ifdef HAVE_IO_TIMEOUT 339 WOLFSSL_API
int wolfIO_SetBlockingMode(SOCKET_T sockfd,
int non_blocking);
340 WOLFSSL_API
void wolfIO_SetTimeout(
int to_sec);
341 WOLFSSL_API
int wolfIO_Select(SOCKET_T sockfd,
int to_sec);
343 WOLFSSL_API
int wolfIO_TcpConnect(SOCKET_T* sockfd,
const char* ip,
344 unsigned short port,
int to_sec);
345 WOLFSSL_API
int wolfIO_Send(SOCKET_T sd,
char *buf,
int sz,
int wrFlags);
346 WOLFSSL_API
int wolfIO_Recv(SOCKET_T sd,
char *buf,
int sz,
int rdFlags);
350 #ifndef WOLFSSL_NO_SOCK 351 #ifdef USE_WINDOWS_API 353 #define CloseSocket(s) closesocket(s) 355 #define StartTCP() { WSADATA wsd; WSAStartup(0x0002, &wsd); } 356 #elif defined(WOLFSSL_MDK_ARM) || defined(WOLFSSL_KEIL_TCP_NET) 358 extern int closesocket(
int);
359 #define CloseSocket(s) closesocket(s) 364 #define CloseSocket(s) close(s) 367 #ifdef FREERTOS_TCP_WINSIM 368 extern int close(
int);
374 WOLFSSL_API
int BioSend(
WOLFSSL* ssl,
char *buf,
int sz,
void *ctx);
375 WOLFSSL_API
int BioReceive(
WOLFSSL* ssl,
char* buf,
int sz,
void* ctx);
376 #if defined(USE_WOLFSSL_IO) 386 #ifdef WOLFSSL_MULTICAST 387 WOLFSSL_API
int EmbedReceiveFromMcast(
WOLFSSL* ssl,
388 char* buf,
int sz,
void*);
390 #ifdef WOLFSSL_SESSION_EXPORT 391 WOLFSSL_API
int EmbedGetPeer(
WOLFSSL* ssl,
char* ip,
int* ipSz,
392 unsigned short* port,
int* fam);
393 WOLFSSL_API
int EmbedSetPeer(
WOLFSSL* ssl,
char* ip,
int ipSz,
394 unsigned short port,
int fam);
400 WOLFSSL_API
int wolfIO_HttpBuildRequestOcsp(
const char* domainName,
401 const char* path,
int ocspReqSz,
unsigned char* buf,
int bufSize);
402 WOLFSSL_API
int wolfIO_HttpProcessResponseOcsp(
int sfd,
403 unsigned char** respBuf,
unsigned char* httpBuf,
int httpBufSz,
406 WOLFSSL_API
int EmbedOcspLookup(
void*,
const char*,
int,
unsigned char*,
407 int,
unsigned char**);
412 WOLFSSL_API
int wolfIO_HttpBuildRequestCrl(
const char* url,
int urlSz,
413 const char* domainName,
unsigned char* buf,
int bufSize);
414 WOLFSSL_API
int wolfIO_HttpProcessResponseCrl(
WOLFSSL_CRL* crl,
int sfd,
415 unsigned char* httpBuf,
int httpBufSz);
417 WOLFSSL_API
int EmbedCrlLookup(
WOLFSSL_CRL* crl,
const char* url,
422 #if defined(HAVE_HTTP_CLIENT) 423 WOLFSSL_API
int wolfIO_DecodeUrl(
const char* url,
int urlSz,
char* outName,
424 char* outPath,
unsigned short* outPort);
426 WOLFSSL_API
int wolfIO_HttpBuildRequest(
const char* reqType,
427 const char* domainName,
const char* path,
int pathLen,
int reqSz,
428 const char* contentType,
unsigned char* buf,
int bufSize);
429 WOLFSSL_LOCAL
int wolfIO_HttpBuildRequest_ex(
const char* reqType,
430 const char* domainName,
const char* path,
int pathLen,
int reqSz,
431 const char* contentType,
const char *exHdrs,
unsigned char* buf,
int bufSize);
432 WOLFSSL_API
int wolfIO_HttpProcessResponse(
int sfd,
const char** appStrList,
433 unsigned char** respBuf,
unsigned char* httpBuf,
int httpBufSz,
434 int dynType,
void* heap);
439 typedef int (*CallbackIORecv)(
WOLFSSL *ssl,
char *buf,
int sz,
void *ctx);
440 typedef int (*CallbackIOSend)(
WOLFSSL *ssl,
char *buf,
int sz,
void *ctx);
442 WOLFSSL_API
void wolfSSL_CTX_SetIOSend(
WOLFSSL_CTX*, CallbackIOSend);
443 WOLFSSL_API
void wolfSSL_SSLSetIORecv(
WOLFSSL*, CallbackIORecv);
444 WOLFSSL_API
void wolfSSL_SSLSetIOSend(
WOLFSSL*, CallbackIOSend);
446 #define wolfSSL_SetIORecv wolfSSL_CTX_SetIORecv 447 #define wolfSSL_SetIOSend wolfSSL_CTX_SetIOSend 460 WOLFSSL_LOCAL
int NetX_Receive(
WOLFSSL *ssl,
char *buf,
int sz,
void *ctx);
461 WOLFSSL_LOCAL
int NetX_Send(
WOLFSSL *ssl,
char *buf,
int sz,
void *ctx);
468 WOLFSSL_LOCAL
int MicriumSend(
WOLFSSL* ssl,
char* buf,
int sz,
void* ctx);
469 WOLFSSL_LOCAL
int MicriumReceive(
WOLFSSL* ssl,
char* buf,
int sz,
471 WOLFSSL_LOCAL
int MicriumReceiveFrom(
WOLFSSL* ssl,
char* buf,
int sz,
473 WOLFSSL_LOCAL
int MicriumSendTo(
WOLFSSL* ssl,
char* buf,
int sz,
void* ctx);
476 #if defined(WOLFSSL_APACHE_MYNEWT) && !defined(WOLFSSL_LWIP) 477 WOLFSSL_LOCAL
int Mynewt_Receive(
WOLFSSL *ssl,
char *buf,
int sz,
void *ctx);
478 WOLFSSL_LOCAL
int Mynewt_Send(
WOLFSSL* ssl,
char *buf,
int sz,
void *ctx);
479 WOLFSSL_API
void wolfSSL_SetIO_Mynewt(
WOLFSSL* ssl,
struct mn_socket* mnSocket,
480 struct mn_sockaddr_in* mnSockAddrIn);
487 struct tcp_socket tcp;
488 struct udp_socket udp;
492 uint8_t *input_databuf;
493 uint8_t *output_databuf;
494 uint8_t *ssl_rx_databuf;
497 struct process *process;
498 tcp_socket_data_callback_t input_callback;
499 tcp_socket_event_callback_t event_callback;
501 uip_ipaddr_t peer_addr;
507 WOLFSSL_LOCAL
int uIPSend(
WOLFSSL* ssl,
char* buf,
int sz,
void* ctx);
508 WOLFSSL_LOCAL
int uIPReceive(
WOLFSSL* ssl,
char* buf,
int sz,
510 WOLFSSL_LOCAL
int uIPReceiveFrom(
WOLFSSL* ssl,
char* buf,
int sz,
512 WOLFSSL_LOCAL
int uIPSendTo(
WOLFSSL* ssl,
char* buf,
int sz,
void* ctx);
517 #include <sock_types.h> 518 #include <net/gnrc.h> 520 #include <net/sock.h> 521 #include <net/gnrc/tcp.h> 522 #include <net/gnrc/udp.h> 526 #ifdef MODULE_SOCK_TCP 535 struct _sock_tl_ep peer_addr;
540 WOLFSSL_LOCAL
int GNRC_ReceiveFrom(
WOLFSSL* ssl,
char* buf,
int sz,
542 WOLFSSL_LOCAL
int GNRC_SendTo(
WOLFSSL* ssl,
char* buf,
int sz,
void* ctx);
548 typedef int (*CallbackGenCookie)(
WOLFSSL* ssl,
unsigned char* buf,
int sz,
551 WOLFSSL_API
void wolfSSL_SetCookieCtx(
WOLFSSL* ssl,
void *ctx);
554 #ifdef WOLFSSL_SESSION_EXPORT 555 typedef int (*CallbackGetPeer)(
WOLFSSL* ssl,
char* ip,
int* ipSz,
556 unsigned short* port,
int* fam);
557 typedef int (*CallbackSetPeer)(
WOLFSSL* ssl,
char* ip,
int ipSz,
558 unsigned short port,
int fam);
560 WOLFSSL_API
void wolfSSL_CTX_SetIOGetPeer(
WOLFSSL_CTX*, CallbackGetPeer);
561 WOLFSSL_API
void wolfSSL_CTX_SetIOSetPeer(
WOLFSSL_CTX*, CallbackSetPeer);
568 #define XINET_NTOP(a,b,c,d) inet_ntop((a),(b),(c),(d)) 569 #ifdef USE_WINDOWS_API 571 #define XINET_NTOP(a,b,c,d) InetNtop((a),(b),(c),(d)) 575 #define XINET_PTON(a,b,c) inet_pton((a),(b),(c)) 576 #ifdef USE_WINDOWS_API 578 #define XINET_PTON(a,b,c) InetPton((a),(b),(c)) 582 #define XHTONS(a) htons((a)) 585 #define XNTOHS(a) ntohs((a)) 589 #define WOLFSSL_IP4 AF_INET 592 #define WOLFSSL_IP6 AF_INET6 WOLFSSL_API void wolfSSL_CTX_SetGenCookie(WOLFSSL_CTX *, CallbackGenCookie)
This function sets the callback for the CBIOCookie member of the WOLFSSL_CTX structure. The CallbackGenCookie type is a function pointer and has the signature: int (CallbackGenCookie)(WOLFSSL ssl, unsigned char* buf, int sz, void* ctx);.
Definition: wolfio.c:1617
WOLFSSL_API int EmbedReceive(WOLFSSL *ssl, char *buf, int sz, void *ctx)
This function is the receive embedded callback.
Definition: wolfio.c:215
WOLFSSL_API void wolfSSL_SetIOWriteCtx(WOLFSSL *ssl, void *ctx)
This function registers a context for the SSL session’s send callback function. By default...
Definition: wolfio.c:1576
WOLFSSL_API void * wolfSSL_GetIOReadCtx(WOLFSSL *ssl)
This function returns the IOCB_ReadCtx member of the WOLFSSL struct.
Definition: wolfio.c:1583
Definition: internal.h:1924
WOLFSSL_API int EmbedReceiveFrom(WOLFSSL *ssl, char *buf, int sz, void *)
This function is the receive embedded callback.
Definition: wolfio.c:309
WOLFSSL_API void wolfSSL_SetIO_NetX(WOLFSSL *ssl, NX_TCP_SOCKET *nxsocket, ULONG waitoption)
This function sets the nxSocket and nxWait members of the nxCtx struct within the WOLFSSL structure...
Definition: wolfio.c:1760
WOLFSSL_API int EmbedGenerateCookie(WOLFSSL *ssl, unsigned char *buf, int sz, void *)
This function is the DTLS Generate Cookie callback.
Definition: wolfio.c:493
Definition: internal.h:2595
WOLFSSL_API void wolfSSL_CTX_SetIORecv(WOLFSSL_CTX *, CallbackIORecv)
This function registers a receive callback for wolfSSL to get input data. By default, wolfSSL uses EmbedReceive() as the callback which uses the system’s TCP recv() function. The user can register a function to get input from memory, some other network module, or from anywhere. Please see the EmbedReceive() function in src/io.c as a guide for how the function should work and for error codes. In particular, IO_ERR_WANT_READ should be returned for non blocking receive when no data is ready.
Definition: wolfio.c:1523
WOLFSSL_API int EmbedSend(WOLFSSL *ssl, char *buf, int sz, void *ctx)
This function is the send embedded callback.
Definition: wolfio.c:257
WOLFSSL_API void wolfSSL_SetIOReadFlags(WOLFSSL *ssl, int flags)
This function sets the flags for the receive callback to use for the given SSL session. The receive callback could be either the default wolfSSL EmbedReceive callback, or a custom callback specified by the user (see wolfSSL_CTX_SetIORecv). The default flag value is set internally by wolfSSL to the value of 0. The default wolfSSL receive callback uses the recv() function to receive data from the socket. From the recv() man page: “The flags argument to a recv() function is formed by or'ing one or more of the values: MSG_OOB process out-of-band data, MSG_PEEK peek at incoming message, MSG_WAITALL wait for full request or error. The MSG_OOB flag requests receipt of out-of-band data that would not be received in the normal data stream. Some protocols place expedited data at the head of the normal data queue, and thus this flag cannot be used with such protocols. The MSG_PEEK flag causes the receive operation to return data from the beginning of the receive queue without removing that data from the queue. Thus, a subsequent receive call will return the same data. The MSG_WAITALL flag requests that the operation block until the full request is satisfied. However, the call may still return less data than requested if a signal is caught, an error or disconnect occurs, or the next data to be received is of a different type than that returned.”
Definition: wolfio.c:1601
WOLFSSL_API void wolfSSL_SetIOWriteFlags(WOLFSSL *ssl, int flags)
This function sets the flags for the send callback to use for the given SSL session. The send callback could be either the default wolfSSL EmbedSend callback, or a custom callback specified by the user (see wolfSSL_CTX_SetIOSend). The default flag value is set internally by wolfSSL to the value of 0. The default wolfSSL send callback uses the send() function to send data from the socket. From the send() man page: “The flags parameter may include one or more of the following: #define MSG_OOB 0x1 // process out-of-band data, #define MSG_DONTROUTE 0x4 // bypass routing, use direct interface. The flag MSG_OOB is used to send `‘out-of-band’' data on sockets that support this notion (e.g. SOCK_STREAM); the underlying protocol must also support `‘out-of-band’' data. MSG_DONTROUTE is usually used only by diagnostic or routing programs.”
Definition: wolfio.c:1608
WOLFSSL_API void * wolfSSL_GetCookieCtx(WOLFSSL *ssl)
This function returns the IOCB_CookieCtx member of the WOLFSSL structure.
Definition: wolfio.c:1631
WOLFSSL_API int EmbedSendTo(WOLFSSL *ssl, char *buf, int sz, void *ctx)
This function is the send embedded callback.
Definition: wolfio.c:390
WOLFSSL_API void EmbedOcspRespFree(void *, unsigned char *)
This function frees the response buffer.
Definition: wolfio.c:1418
WOLFSSL_API void * wolfSSL_GetIOWriteCtx(WOLFSSL *ssl)
This function returns the IOCB_WriteCtx member of the WOLFSSL structure.
Definition: wolfio.c:1592
WOLFSSL_API void wolfSSL_SetIOReadCtx(WOLFSSL *ssl, void *ctx)
This function registers a context for the SSL session’s receive callback function. By default, wolfSSL sets the file descriptor passed to wolfSSL_set_fd() as the context when wolfSSL is using the system’s TCP library. If you’ve registered your own receive callback you may want to set a specific context for the session. For example, if you’re using memory buffers the context may be a pointer to a structure describing where and how to access the memory buffers.
Definition: wolfio.c:1569
Definition: internal.h:3849