network_platform.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. /*
  2. * Copyright 2010-2015 Amazon.com, Inc. or its affiliates. All Rights Reserved.
  3. * Additions Copyright 2016 Espressif Systems (Shanghai) PTE LTD
  4. *
  5. * Licensed under the Apache License, Version 2.0 (the "License").
  6. * You may not use this file except in compliance with the License.
  7. * A copy of the License is located at
  8. *
  9. * http://aws.amazon.com/apache2.0
  10. *
  11. * or in the "license" file accompanying this file. This file is distributed
  12. * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
  13. * express or implied. See the License for the specific language governing
  14. * permissions and limitations under the License.
  15. */
  16. #ifndef IOTSDKC_NETWORK_MBEDTLS_PLATFORM_H_H
  17. #if !defined(MBEDTLS_CONFIG_FILE)
  18. #include "mbedtls/config.h"
  19. #else
  20. #include MBEDTLS_CONFIG_FILE
  21. #endif
  22. #include "mbedtls/platform.h"
  23. #include "mbedtls/net_sockets.h"
  24. #include "mbedtls/ssl.h"
  25. #include "mbedtls/entropy.h"
  26. #include "mbedtls/ctr_drbg.h"
  27. #include "mbedtls/certs.h"
  28. #include "mbedtls/x509.h"
  29. #include "mbedtls/error.h"
  30. #include "mbedtls/debug.h"
  31. #include "mbedtls/timing.h"
  32. #ifdef __cplusplus
  33. extern "C" {
  34. #endif
  35. /**
  36. * @brief TLS Connection Parameters
  37. *
  38. * Defines a type containing TLS specific parameters to be passed down to the
  39. * TLS networking layer to create a TLS secured socket.
  40. */
  41. typedef struct _TLSDataParams {
  42. mbedtls_entropy_context entropy;
  43. mbedtls_ctr_drbg_context ctr_drbg;
  44. mbedtls_ssl_context ssl;
  45. mbedtls_ssl_config conf;
  46. uint32_t flags;
  47. mbedtls_x509_crt cacert;
  48. mbedtls_x509_crt clicert;
  49. mbedtls_pk_context pkey;
  50. mbedtls_net_context server_fd;
  51. }TLSDataParams;
  52. #define IOTSDKC_NETWORK_MBEDTLS_PLATFORM_H_H
  53. #ifdef __cplusplus
  54. }
  55. #endif
  56. #endif //IOTSDKC_NETWORK_MBEDTLS_PLATFORM_H_H