wolfssl_chibios.h 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. /*
  2. ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio
  3. Licensed under the Apache License, Version 2.0 (the "License");
  4. you may not use this file except in compliance with the License.
  5. You may obtain a copy of the License at
  6. http://www.apache.org/licenses/LICENSE-2.0
  7. Unless required by applicable law or agreed to in writing, software
  8. distributed under the License is distributed on an "AS IS" BASIS,
  9. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  10. See the License for the specific language governing permissions and
  11. limitations under the License.
  12. */
  13. /*
  14. * **** This file incorporates work covered by the following copyright and ****
  15. * **** permission notice: ****
  16. *
  17. * Copyright (C) 2006-2017 wolfSSL Inc.
  18. *
  19. * This file is part of wolfSSL.
  20. *
  21. * wolfSSL is free software; you can redistribute it and/or modify
  22. * it under the terms of the GNU General Public License as published by
  23. * the Free Software Foundation; either version 2 of the License, or
  24. * (at your option) any later version.
  25. *
  26. * wolfSSL is distributed in the hope that it will be useful,
  27. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  28. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  29. * GNU General Public License for more details.
  30. *
  31. * You should have received a copy of the GNU General Public License
  32. * along with this program; if not, write to the Free Software
  33. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
  34. *
  35. */
  36. #ifndef WOLFSSL_SK_H
  37. #define WOLFSSL_SK_H
  38. #include "wolfssl/ssl.h"
  39. #include "wolfssl/wolfcrypt/types.h"
  40. #include "lwip/opt.h"
  41. #include "lwip/arch.h"
  42. #include "lwip/api.h"
  43. #include "user_settings.h"
  44. #define XMALLOC(s,h,t) chibios_alloc(h,s)
  45. #define XFREE(p,h,t) chibios_free(p)
  46. struct sslconn {
  47. WOLFSSL_CTX *ctx;
  48. WOLFSSL *ssl;
  49. struct netconn *conn;
  50. };
  51. typedef struct sslconn sslconn;
  52. sslconn *sslconn_accept(struct sslconn *sk);
  53. sslconn *sslconn_new(enum netconn_type t, WOLFSSL_METHOD *method);
  54. void sslconn_close(sslconn *sk);
  55. int wolfssl_send_cb(WOLFSSL* ssl, char *buf, int sz, void *ctx);
  56. int wolfssl_recv_cb(WOLFSSL *ssl, char *buf, int sz, void *ctx);
  57. void *chibios_alloc(void *heap, int size);
  58. void chibios_free(void *ptr);
  59. word32 LowResTimer(void);
  60. #endif