wolfSSL SSL/TLS library, support up to TLS1.3

Dependents:   OS

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers wolfio.h Source File

wolfio.h

Go to the documentation of this file.
00001 /* io.h
00002  *
00003  * Copyright (C) 2006-2017 wolfSSL Inc.
00004  *
00005  * This file is part of wolfSSL.
00006  *
00007  * wolfSSL is free software; you can redistribute it and/or modify
00008  * it under the terms of the GNU General Public License as published by
00009  * the Free Software Foundation; either version 2 of the License, or
00010  * (at your option) any later version.
00011  *
00012  * wolfSSL is distributed in the hope that it will be useful,
00013  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015  * GNU General Public License for more details.
00016  *
00017  * You should have received a copy of the GNU General Public License
00018  * along with this program; if not, write to the Free Software
00019  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
00020  */
00021 
00022 /*!
00023     \file wolfssl/wolfio.h   
00024 */
00025 
00026 #ifndef WOLFSSL_IO_H
00027 #define WOLFSSL_IO_H
00028 
00029 #ifdef __cplusplus
00030     extern "C" {
00031 #endif
00032 
00033 /* OCSP and CRL_IO require HTTP client */
00034 #if defined(HAVE_OCSP) || defined(HAVE_CRL_IO)
00035     #ifndef HAVE_HTTP_CLIENT
00036         #define HAVE_HTTP_CLIENT
00037     #endif
00038 #endif
00039 
00040 #if !defined(WOLFSSL_USER_IO)
00041     /* Micrium uses NetSock I/O callbacks in wolfio.c */
00042     #if !defined(USE_WOLFSSL_IO) && !defined(MICRIUM)
00043         #define USE_WOLFSSL_IO
00044     #endif
00045 #endif
00046 
00047 
00048 #if defined(USE_WOLFSSL_IO) || defined(HAVE_HTTP_CLIENT)
00049 
00050 #ifdef HAVE_LIBZ
00051     #include "zlib.h"
00052 #endif
00053 
00054 #ifndef USE_WINDOWS_API
00055     #ifdef WOLFSSL_LWIP
00056         /* lwIP needs to be configured to use sockets API in this mode */
00057         /* LWIP_SOCKET 1 in lwip/opt.h or in build */
00058         #include "lwip/sockets.h"
00059         #ifndef LWIP_PROVIDE_ERRNO
00060             #include <errno.h>
00061             #define LWIP_PROVIDE_ERRNO 1
00062         #endif
00063     #elif defined(FREESCALE_MQX)
00064         #include <posix.h>
00065         #include <rtcs.h>
00066     #elif defined(FREESCALE_KSDK_MQX)
00067         #include <rtcs.h>
00068     #elif (defined(WOLFSSL_MDK_ARM) || defined(WOLFSSL_KEIL_TCP_NET))
00069         #include "cmsis_os.h"
00070         #include "rl_net.h"
00071         #include "errno.h"
00072     #elif defined(WOLFSSL_CMSIS_RTOS)
00073         #include "cmsis_os.h"
00074     #elif defined(WOLFSSL_TIRTOS)
00075         #include <sys/socket.h>
00076     #elif defined(FREERTOS_TCP)
00077         #include "FreeRTOS_Sockets.h"
00078     #elif defined(WOLFSSL_IAR_ARM)
00079         /* nothing */
00080     #elif defined(WOLFSSL_VXWORKS)
00081         #include <sockLib.h>
00082         #include <errno.h>
00083     #elif defined(WOLFSSL_NUCLEUS_1_2)
00084         #include <externs.h>
00085         #include <errno.h>
00086     #elif defined(WOLFSSL_ATMEL)
00087         #include "socket/include/socket.h"
00088     #elif defined(INTIME_RTOS)
00089         #undef MIN
00090         #undef MAX
00091         #include <rt.h>
00092         #include <sys/types.h>
00093         #include <sys/socket.h>
00094         #include <netdb.h>
00095         #include <netinet/in.h>
00096         #include <io.h>
00097         /* <sys/socket.h> defines these, to avoid conflict, do undef */
00098         #undef SOCKADDR
00099         #undef SOCKADDR_IN
00100     #elif defined(WOLFSSL_PRCONNECT_PRO)
00101         #include <prconnect_pro/prconnect_pro.h>
00102         #include <sys/types.h>
00103         #include <errno.h>
00104         #include <unistd.h>
00105         #include <fcntl.h>
00106         #include <netdb.h>
00107         #include <sys/ioctl.h>
00108     #elif defined(WOLFSSL_SGX)
00109         #include <errno.h>
00110     #elif !defined(WOLFSSL_NO_SOCK)
00111         #include <sys/types.h>
00112         #include <errno.h>
00113         #ifndef EBSNET
00114             #include <unistd.h>
00115         #endif
00116         #include <fcntl.h>
00117 
00118         #if defined(HAVE_RTP_SYS)
00119             #include <socket.h>
00120         #elif defined(EBSNET)
00121             #include "rtipapi.h"  /* errno */
00122             #include "socket.h"
00123         #elif !defined(DEVKITPRO) && !defined(WOLFSSL_PICOTCP)
00124             #include <sys/socket.h>
00125             #include <arpa/inet.h>
00126             #include <netinet/in.h>
00127             #include <netdb.h>
00128             #ifdef __PPU
00129                 #include <netex/errno.h>
00130             #else
00131                 #include <sys/ioctl.h>
00132             #endif
00133         #endif
00134     #endif
00135 #endif /* USE_WINDOWS_API */
00136 
00137 #ifdef __sun
00138     #include <sys/filio.h>
00139 #endif
00140 
00141 #ifdef USE_WINDOWS_API
00142     /* no epipe yet */
00143     #ifndef WSAEPIPE
00144         #define WSAEPIPE       -12345
00145     #endif
00146     #define SOCKET_EWOULDBLOCK WSAEWOULDBLOCK
00147     #define SOCKET_EAGAIN      WSAETIMEDOUT
00148     #define SOCKET_ECONNRESET  WSAECONNRESET
00149     #define SOCKET_EINTR       WSAEINTR
00150     #define SOCKET_EPIPE       WSAEPIPE
00151     #define SOCKET_ECONNREFUSED WSAENOTCONN
00152     #define SOCKET_ECONNABORTED WSAECONNABORTED
00153 #elif defined(__PPU)
00154     #define SOCKET_EWOULDBLOCK SYS_NET_EWOULDBLOCK
00155     #define SOCKET_EAGAIN      SYS_NET_EAGAIN
00156     #define SOCKET_ECONNRESET  SYS_NET_ECONNRESET
00157     #define SOCKET_EINTR       SYS_NET_EINTR
00158     #define SOCKET_EPIPE       SYS_NET_EPIPE
00159     #define SOCKET_ECONNREFUSED SYS_NET_ECONNREFUSED
00160     #define SOCKET_ECONNABORTED SYS_NET_ECONNABORTED
00161 #elif defined(FREESCALE_MQX) || defined(FREESCALE_KSDK_MQX)
00162     #if MQX_USE_IO_OLD
00163         /* RTCS old I/O doesn't have an EWOULDBLOCK */
00164         #define SOCKET_EWOULDBLOCK  EAGAIN
00165         #define SOCKET_EAGAIN       EAGAIN
00166         #define SOCKET_ECONNRESET   RTCSERR_TCP_CONN_RESET
00167         #define SOCKET_EINTR        EINTR
00168         #define SOCKET_EPIPE        EPIPE
00169         #define SOCKET_ECONNREFUSED RTCSERR_TCP_CONN_REFUSED
00170         #define SOCKET_ECONNABORTED RTCSERR_TCP_CONN_ABORTED
00171     #else
00172         #define SOCKET_EWOULDBLOCK  NIO_EWOULDBLOCK
00173         #define SOCKET_EAGAIN       NIO_EAGAIN
00174         #define SOCKET_ECONNRESET   NIO_ECONNRESET
00175         #define SOCKET_EINTR        NIO_EINTR
00176         #define SOCKET_EPIPE        NIO_EPIPE
00177         #define SOCKET_ECONNREFUSED NIO_ECONNREFUSED
00178         #define SOCKET_ECONNABORTED NIO_ECONNABORTED
00179     #endif
00180 #elif defined(WOLFSSL_MDK_ARM)|| defined(WOLFSSL_KEIL_TCP_NET)
00181         #define SOCKET_EWOULDBLOCK BSD_ERROR_WOULDBLOCK
00182         #define SOCKET_EAGAIN      BSD_ERROR_LOCKED
00183         #define SOCKET_ECONNRESET  BSD_ERROR_CLOSED
00184         #define SOCKET_EINTR       BSD_ERROR
00185         #define SOCKET_EPIPE       BSD_ERROR
00186         #define SOCKET_ECONNREFUSED BSD_ERROR
00187         #define SOCKET_ECONNABORTED BSD_ERROR
00188 #elif defined(WOLFSSL_PICOTCP)
00189     #define SOCKET_EWOULDBLOCK  PICO_ERR_EAGAIN
00190     #define SOCKET_EAGAIN       PICO_ERR_EAGAIN
00191     #define SOCKET_ECONNRESET   PICO_ERR_ECONNRESET
00192     #define SOCKET_EINTR        PICO_ERR_EINTR
00193     #define SOCKET_EPIPE        PICO_ERR_EIO
00194     #define SOCKET_ECONNREFUSED PICO_ERR_ECONNREFUSED
00195     #define SOCKET_ECONNABORTED PICO_ERR_ESHUTDOWN
00196 #elif defined(FREERTOS_TCP)
00197     #define SOCKET_EWOULDBLOCK FREERTOS_EWOULDBLOCK
00198     #define SOCKET_EAGAIN       FREERTOS_EWOULDBLOCK
00199     #define SOCKET_ECONNRESET   FREERTOS_SOCKET_ERROR
00200     #define SOCKET_EINTR        FREERTOS_SOCKET_ERROR
00201     #define SOCKET_EPIPE        FREERTOS_SOCKET_ERROR
00202     #define SOCKET_ECONNREFUSED FREERTOS_SOCKET_ERROR
00203     #define SOCKET_ECONNABORTED FREERTOS_SOCKET_ERROR
00204 #elif defined(WOLFSSL_NUCLEUS_1_2)
00205     #define SOCKET_EWOULDBLOCK  NU_WOULD_BLOCK
00206     #define SOCKET_EAGAIN       NU_WOULD_BLOCK
00207     #define SOCKET_ECONNRESET   NU_NOT_CONNECTED
00208     #define SOCKET_EINTR        NU_NOT_CONNECTED
00209     #define SOCKET_EPIPE        NU_NOT_CONNECTED
00210     #define SOCKET_ECONNREFUSED NU_CONNECTION_REFUSED
00211     #define SOCKET_ECONNABORTED NU_NOT_CONNECTED
00212 #else
00213     #define SOCKET_EWOULDBLOCK EWOULDBLOCK
00214     #define SOCKET_EAGAIN      EAGAIN
00215     #define SOCKET_ECONNRESET  ECONNRESET
00216     #define SOCKET_EINTR       EINTR
00217     #define SOCKET_EPIPE       EPIPE
00218     #define SOCKET_ECONNREFUSED ECONNREFUSED
00219     #define SOCKET_ECONNABORTED ECONNABORTED
00220 #endif /* USE_WINDOWS_API */
00221 
00222 
00223 #ifdef USE_WINDOWS_API
00224     #define CloseSocket(s) closesocket(s)
00225     #define StartTCP() { WSADATA wsd; WSAStartup(0x0002, &wsd); }
00226 #elif defined(WOLFSSL_MDK_ARM) || defined(WOLFSSL_KEIL_TCP_NET)
00227     extern int closesocket(int);
00228     #define CloseSocket(s) closesocket(s)
00229     #define StartTCP()
00230 #else
00231     #define CloseSocket(s) close(s)
00232     #define StartTCP()
00233     #ifdef FREERTOS_TCP_WINSIM
00234         extern int close(int);
00235     #endif
00236 #endif
00237 
00238 
00239 
00240 #ifdef DEVKITPRO
00241     /* from network.h */
00242     int net_send(int, const void*, int, unsigned int);
00243     int net_recv(int, void*, int, unsigned int);
00244     #define SEND_FUNCTION net_send
00245     #define RECV_FUNCTION net_recv
00246 #elif defined(WOLFSSL_LWIP)
00247     #define SEND_FUNCTION lwip_send
00248     #define RECV_FUNCTION lwip_recv
00249 #elif defined(WOLFSSL_PICOTCP)
00250     #define SEND_FUNCTION pico_send
00251     #define RECV_FUNCTION pico_recv
00252 #elif defined(FREERTOS_TCP)
00253     #define RECV_FUNCTION(a,b,c,d)  FreeRTOS_recv((Socket_t)(a),(void*)(b), (size_t)(c), (BaseType_t)(d))
00254     #define SEND_FUNCTION(a,b,c,d)  FreeRTOS_send((Socket_t)(a),(void*)(b), (size_t)(c), (BaseType_t)(d))
00255 #elif defined(WOLFSSL_VXWORKS)
00256     #define SEND_FUNCTION send
00257     #define RECV_FUNCTION recv
00258 #elif defined(WOLFSSL_NUCLEUS_1_2)
00259     #define SEND_FUNCTION NU_Send
00260     #define RECV_FUNCTION NU_Recv
00261 #else
00262     #define SEND_FUNCTION send
00263     #define RECV_FUNCTION recv
00264     #if !defined(HAVE_SOCKADDR) && !defined(WOLFSSL_NO_SOCK)
00265         #define HAVE_SOCKADDR
00266     #endif
00267 #endif
00268 
00269 #ifdef USE_WINDOWS_API
00270     typedef unsigned int SOCKET_T;
00271 #else
00272     typedef int SOCKET_T;
00273 #endif
00274 
00275 #ifndef WOLFSSL_NO_SOCK
00276     #ifndef XSOCKLENT
00277         #ifdef USE_WINDOWS_API
00278             #define XSOCKLENT int
00279         #else
00280             #define XSOCKLENT socklen_t
00281         #endif
00282     #endif
00283 
00284     /* Socket Addr Support */
00285     #ifdef HAVE_SOCKADDR
00286         typedef struct sockaddr         SOCKADDR;
00287         typedef struct sockaddr_storage SOCKADDR_S;
00288         typedef struct sockaddr_in      SOCKADDR_IN;
00289         #ifdef WOLFSSL_IPV6
00290             typedef struct sockaddr_in6 SOCKADDR_IN6;
00291         #endif
00292         typedef struct hostent          HOSTENT;
00293     #endif /* HAVE_SOCKADDR */
00294 
00295     /* use gethostbyname for c99 */
00296     #ifdef WOLF_C99
00297         #undef HAVE_GETADDRINFO
00298     #endif
00299 
00300     #ifdef HAVE_GETADDRINFO
00301         typedef struct addrinfo         ADDRINFO;
00302     #endif
00303 #endif /* WOLFSSL_NO_SOCK */
00304 
00305 
00306 /* IO API's */
00307 #ifdef HAVE_IO_TIMEOUT
00308     WOLFSSL_API  int wolfIO_SetBlockingMode(SOCKET_T sockfd, int non_blocking);
00309     WOLFSSL_API void wolfIO_SetTimeout(int to_sec);;
00310     WOLFSSL_API  int wolfIO_Select(SOCKET_T sockfd, int to_sec);
00311 #endif
00312 WOLFSSL_API  int wolfIO_TcpConnect(SOCKET_T* sockfd, const char* ip,
00313     unsigned short port, int to_sec);
00314 WOLFSSL_API  int wolfIO_Send(SOCKET_T sd, char *buf, int sz, int wrFlags);
00315 WOLFSSL_API  int wolfIO_Recv(SOCKET_T sd, char *buf, int sz, int rdFlags);
00316 
00317 #endif /* USE_WOLFSSL_IO || HAVE_HTTP_CLIENT */
00318 
00319 
00320 WOLFSSL_API int BioSend(WOLFSSL* ssl, char *buf, int sz, void *ctx);
00321 WOLFSSL_API int BioReceive(WOLFSSL* ssl, char* buf, int sz, void* ctx);
00322 #if defined(USE_WOLFSSL_IO)
00323     /* default IO callbacks */
00324     WOLFSSL_API int EmbedReceive(WOLFSSL* ssl, char* buf, int sz, void* ctx);
00325     WOLFSSL_API int EmbedSend(WOLFSSL* ssl, char* buf, int sz, void* ctx);
00326 
00327     #ifdef WOLFSSL_DTLS
00328         WOLFSSL_API int EmbedReceiveFrom(WOLFSSL* ssl, char* buf, int sz, void*);
00329         WOLFSSL_API int EmbedSendTo(WOLFSSL* ssl, char* buf, int sz, void* ctx);
00330         WOLFSSL_API int EmbedGenerateCookie(WOLFSSL* ssl, unsigned char* buf,
00331                                            int sz, void*);
00332         #ifdef WOLFSSL_MULTICAST
00333             WOLFSSL_API int EmbedReceiveFromMcast(WOLFSSL* ssl,
00334                                                   char* buf, int sz, void*);
00335         #endif /* WOLFSSL_MULTICAST */
00336         #ifdef WOLFSSL_SESSION_EXPORT
00337             WOLFSSL_API int EmbedGetPeer(WOLFSSL* ssl, char* ip, int* ipSz,
00338                                                 unsigned short* port, int* fam);
00339             WOLFSSL_API int EmbedSetPeer(WOLFSSL* ssl, char* ip, int ipSz,
00340                                                   unsigned short port, int fam);
00341         #endif /* WOLFSSL_SESSION_EXPORT */
00342     #endif /* WOLFSSL_DTLS */
00343 #endif /* USE_WOLFSSL_IO */
00344 
00345 #ifdef HAVE_OCSP
00346     WOLFSSL_API int wolfIO_HttpBuildRequestOcsp(const char* domainName,
00347         const char* path, int ocspReqSz, unsigned char* buf, int bufSize);
00348     WOLFSSL_API int wolfIO_HttpProcessResponseOcsp(int sfd,
00349         unsigned char** respBuf, unsigned char* httpBuf, int httpBufSz,
00350         void* heap);
00351 
00352     WOLFSSL_API int EmbedOcspLookup(void*, const char*, int, unsigned char*,
00353                                    int, unsigned char**);
00354     WOLFSSL_API void EmbedOcspRespFree(void*, unsigned char*);
00355 #endif
00356 
00357 #ifdef HAVE_CRL_IO
00358     WOLFSSL_API int wolfIO_HttpBuildRequestCrl(const char* url, int urlSz,
00359         const char* domainName, unsigned char* buf, int bufSize);
00360     WOLFSSL_API int wolfIO_HttpProcessResponseCrl(WOLFSSL_CRL* crl, int sfd,
00361         unsigned char* httpBuf, int httpBufSz);
00362 
00363     WOLFSSL_API int EmbedCrlLookup(WOLFSSL_CRL* crl, const char* url,
00364         int urlSz);
00365 #endif
00366 
00367 
00368 #if defined(HAVE_HTTP_CLIENT)
00369     WOLFSSL_API  int wolfIO_DecodeUrl(const char* url, int urlSz, char* outName,
00370         char* outPath, unsigned short* outPort);
00371 
00372     WOLFSSL_API  int wolfIO_HttpBuildRequest(const char* reqType,
00373         const char* domainName, const char* path, int pathLen, int reqSz,
00374         const char* contentType, unsigned char* buf, int bufSize);
00375     WOLFSSL_API  int wolfIO_HttpProcessResponse(int sfd, const char** appStrList,
00376         unsigned char** respBuf, unsigned char* httpBuf, int httpBufSz,
00377         int dynType, void* heap);
00378 #endif /* HAVE_HTTP_CLIENT */
00379 
00380 
00381 /* I/O callbacks */
00382 typedef int (*CallbackIORecv)(WOLFSSL *ssl, char *buf, int sz, void *ctx);
00383 typedef int (*CallbackIOSend)(WOLFSSL *ssl, char *buf, int sz, void *ctx);
00384 WOLFSSL_API void wolfSSL_CTX_SetIORecv(WOLFSSL_CTX*, CallbackIORecv);
00385 WOLFSSL_API void wolfSSL_CTX_SetIOSend(WOLFSSL_CTX*, CallbackIOSend);
00386 /* deprecated old name */
00387 #define wolfSSL_SetIORecv wolfSSL_CTX_SetIORecv
00388 #define wolfSSL_SetIOSend wolfSSL_CTX_SetIOSend
00389 
00390 WOLFSSL_API void wolfSSL_SetIOReadCtx( WOLFSSL* ssl, void *ctx);
00391 WOLFSSL_API void wolfSSL_SetIOWriteCtx(WOLFSSL* ssl, void *ctx);
00392 
00393 WOLFSSL_API void* wolfSSL_GetIOReadCtx( WOLFSSL* ssl);
00394 WOLFSSL_API void* wolfSSL_GetIOWriteCtx(WOLFSSL* ssl);
00395 
00396 WOLFSSL_API void wolfSSL_SetIOReadFlags( WOLFSSL* ssl, int flags);
00397 WOLFSSL_API void wolfSSL_SetIOWriteFlags(WOLFSSL* ssl, int flags);
00398 
00399 
00400 #ifdef HAVE_NETX
00401     WOLFSSL_LOCAL int NetX_Receive(WOLFSSL *ssl, char *buf, int sz, void *ctx);
00402     WOLFSSL_LOCAL int NetX_Send(WOLFSSL *ssl, char *buf, int sz, void *ctx);
00403 
00404     WOLFSSL_API void wolfSSL_SetIO_NetX(WOLFSSL* ssl, NX_TCP_SOCKET* nxsocket,
00405                                       ULONG waitoption);
00406 #endif /* HAVE_NETX */
00407 
00408 #ifdef MICRIUM
00409     WOLFSSL_LOCAL int MicriumSend(WOLFSSL* ssl, char* buf, int sz, void* ctx);
00410     WOLFSSL_LOCAL int MicriumReceive(WOLFSSL* ssl, char* buf, int sz,
00411                                      void* ctx);
00412     WOLFSSL_LOCAL int MicriumReceiveFrom(WOLFSSL* ssl, char* buf, int sz,
00413                                          void* ctx);
00414     WOLFSSL_LOCAL int MicriumSendTo(WOLFSSL* ssl, char* buf, int sz, void* ctx);
00415 #endif /* MICRIUM */
00416 
00417 #ifdef WOLFSSL_DTLS
00418     typedef int (*CallbackGenCookie)(WOLFSSL* ssl, unsigned char* buf, int sz,
00419                                      void* ctx);
00420     WOLFSSL_API void  wolfSSL_CTX_SetGenCookie(WOLFSSL_CTX*, CallbackGenCookie);
00421     WOLFSSL_API void  wolfSSL_SetCookieCtx(WOLFSSL* ssl, void *ctx);
00422     WOLFSSL_API void* wolfSSL_GetCookieCtx(WOLFSSL* ssl);
00423 
00424     #ifdef WOLFSSL_SESSION_EXPORT
00425         typedef int (*CallbackGetPeer)(WOLFSSL* ssl, char* ip, int* ipSz,
00426                                             unsigned short* port, int* fam);
00427         typedef int (*CallbackSetPeer)(WOLFSSL* ssl, char* ip, int ipSz,
00428                                               unsigned short port, int fam);
00429 
00430         WOLFSSL_API void wolfSSL_CTX_SetIOGetPeer(WOLFSSL_CTX*, CallbackGetPeer);
00431         WOLFSSL_API void wolfSSL_CTX_SetIOSetPeer(WOLFSSL_CTX*, CallbackSetPeer);
00432     #endif /* WOLFSSL_SESSION_EXPORT */
00433 #endif
00434 
00435 
00436 
00437 #ifndef XINET_NTOP
00438     #define XINET_NTOP(a,b,c,d) inet_ntop((a),(b),(c),(d))
00439     #ifdef USE_WINDOWS_API /* Windows-friendly definition */
00440         #undef  XINET_NTOP
00441         #define XINET_NTOP(a,b,c,d) InetNtop((a),(b),(c),(d))
00442     #endif
00443 #endif
00444 #ifndef XINET_PTON
00445     #define XINET_PTON(a,b,c)   inet_pton((a),(b),(c))
00446     #ifdef USE_WINDOWS_API /* Windows-friendly definition */
00447         #undef  XINET_PTON
00448         #define XINET_PTON(a,b,c)   InetPton((a),(b),(c))
00449     #endif
00450 #endif
00451 #ifndef XHTONS
00452     #define XHTONS(a) htons((a))
00453 #endif
00454 #ifndef XNTOHS
00455     #define XNTOHS(a) ntohs((a))
00456 #endif
00457 
00458 #ifndef WOLFSSL_IP4
00459     #define WOLFSSL_IP4 AF_INET
00460 #endif
00461 #ifndef WOLFSSL_IP6
00462     #define WOLFSSL_IP6 AF_INET6
00463 #endif
00464 
00465 
00466 #ifdef __cplusplus
00467     }  /* extern "C" */
00468 #endif
00469 
00470 #endif /* WOLFSSL_IO_H */
00471