42#include <SharkSslEx.h>
73#define INFINITE_TMO (~((U32)0))
105#ifndef SOCKET_constructor
106#define SOCKET_constructor(o, ctx) (void)ctx,memset(o,0,sizeof(SOCKET))
119#define se_disableTrace(disable)
125#if XPRINTF && SHARKSSL_ENABLE_INFO_API
128#define printCiphersuite(notused)
246#ifndef se_getSockName
247#define se_getSockName(sock, buf, status) do { \
248 struct sockaddr_in in; int size=sizeof(struct sockaddr_in); \
249 *(status) = getsockname(*(sock), (struct sockaddr *)&in, &size); \
250 memcpy((buf), &in.sin_addr.s_addr, 4); \
251 if(*(status) == 0) *(status) = 4; \
261#define xprintf(data) _xprintf data
struct SharkSslCon SharkSslCon
SharkSslCon is an opaque handle returned by function SharkSsl_createCon.
Definition: SharkSSL.h:553
void se_close(SOCKET *sock)
Close a connected socket connection.
int se_accept(SOCKET **listenSock, U32 timeout, SOCKET **outSock)
Waits for remote connections on the server SOCKET object 'listenSock', initialized by function se_bin...
S32 se_send(SOCKET *sock, const void *buf, U32 len)
Sends data to the connected peer.
int se_connect(SOCKET *sock, const char *address, U16 port)
Initializes a SOCKET object connected to a remote host/address at a given port.
int se_sockValid(SOCKET *sock)
Returns TRUE if socket is valid (connected).
int seSec_read(SharkSslCon *s, SOCKET *sock, U8 **buf, U32 timeout)
Read data from socket stream and decode the encrypted data.
#define printCiphersuite(notused)
Print the selected ciphersuite.
Definition: selib.h:128
int seSec_write(SharkSslCon *s, SOCKET *sock, U8 *buf, int maxLen)
Encrypts and sends encrypted data to the connected peer side.
void mainTask(SeCtx *ctx)
Main entry for all example programs.
int se_bind(SOCKET *sock, U16 port)
Initializes a SOCKET object bound to a local port, ready to accept client connections.
S32 se_recv(SOCKET *sock, void *buf, U32 len, U32 timeout)
Waits for data sent by peer.
int seSec_handshake(SharkSslCon *s, SOCKET *sock, U32 timeout, const char *commonName)
Performs the initial SSL handshaking using an asymmetric cipher in order to establish cipher settings...
void se_disableTrace(int disable)
Disable/enable the trace when XPRINTF is defined.
void _xprintf(const char *fmt,...)
The example code and macro xprintf requires this function when the code is compiled with macro XPRINT...
#define SOCKET
Infinite wait time option for socket read functions.
Definition: selib.h:102
SeCtx structure: See Context Manager and Bare Metal Systems for details.
Definition: SeCtx.h:71