espconn_ssl.h 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. #ifndef ESPCONN_SSL_CLIENT_H
  2. #define ESPCONN_SSL_CLIENT_H
  3. #include "ssl/ssl_ssl.h"
  4. #include "ssl/ssl_tls1.h"
  5. #include "lwip/app/espconn.h"
  6. typedef struct _ssl_msg {
  7. SSL_CTX *ssl_ctx;
  8. SSL *ssl;
  9. bool quiet;
  10. char *private_key_file;
  11. uint8_t session_id[SSL_SESSION_ID_SIZE];
  12. u16_t pkt_length;
  13. } ssl_msg;
  14. /******************************************************************************
  15. * FunctionName : sslserver_start
  16. * Description : Initialize the server: set up a listen PCB and bind it to
  17. * the defined port
  18. * Parameters : espconn -- the espconn used to build client
  19. * Returns : none
  20. *******************************************************************************/
  21. extern sint8 espconn_ssl_server(struct espconn *espconn);
  22. /******************************************************************************
  23. * FunctionName : espconn_ssl_client
  24. * Description : Initialize the client: set up a connect PCB and bind it to
  25. * the defined port
  26. * Parameters : espconn -- the espconn used to build client
  27. * Returns : none
  28. *******************************************************************************/
  29. extern sint8 espconn_ssl_client(struct espconn *espconn);
  30. /******************************************************************************
  31. * FunctionName : espconn_ssl_write
  32. * Description : sent data for client or server
  33. * Parameters : void *arg -- client or server to send
  34. * uint8* psent -- Data to send
  35. * uint16 length -- Length of data to send
  36. * Returns : none
  37. *******************************************************************************/
  38. extern void espconn_ssl_sent(void *arg, uint8 *psent, uint16 length);
  39. /******************************************************************************
  40. * FunctionName : espconn_ssl_disconnect
  41. * Description : A new incoming connection has been disconnected.
  42. * Parameters : espconn -- the espconn used to disconnect with host
  43. * Returns : none
  44. *******************************************************************************/
  45. extern void espconn_ssl_disconnect(espconn_msg *pdis);
  46. #endif