42#include <SharkSslEx.h>
73#define INFINITE_TMO (~((U32)0))
107#ifndef INVALID_SOCKET
108#define INVALID_SOCKET ((SOCKET)-1)
111#ifndef SOCKET_constructor
112#define SOCKET_constructor(o, ctx) ((void)(ctx), (*(o) = INVALID_SOCKET))
125#define se_disableTrace(disable)
131#if XPRINTF && SHARKSSL_ENABLE_INFO_API
134#define printCiphersuite(notused)
170#if (SHARKSSL_TLS_1_3 && SHARKSSL_ENABLE_KEY_UPDATE)
268#ifndef se_getSockName
269#define se_getSockName(sock, buf, status) do { \
270 struct sockaddr_in in; int size=sizeof(struct sockaddr_in); \
271 *(status) = getsockname(*(sock), (struct sockaddr *)&in, &size); \
272 memcpy((buf), &in.sin_addr.s_addr, 4); \
273 if(*(status) == 0) *(status) = 4; \
283#define xprintf(data) _xprintf data
struct SharkSslCon SharkSslCon
SharkSslCon is an opaque handle returned by function SharkSsl_createCon.
Definition: SharkSSL.h:496
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.
int seSec_close(SharkSslCon *s, SOCKET *sock)
Sends the complete close_notify alert before closing the socket.
#define printCiphersuite(notused)
Print the selected ciphersuite.
Definition: selib.h:134
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:103
SeCtx structure: See Context Manager and Bare Metal Systems for details.
Definition: SeCtx.h:71