1 | /**
|
---|
2 | * @file
|
---|
3 | * Application layered TCP/TLS connection API (to be used from TCPIP thread)
|
---|
4 | *
|
---|
5 | * This file contains memory management function prototypes for a TLS layer using mbedTLS.
|
---|
6 | *
|
---|
7 | * Memory management contains:
|
---|
8 | * - allocating/freeing altcp_mbedtls_state_t
|
---|
9 | * - allocating/freeing memory used in the mbedTLS library
|
---|
10 | */
|
---|
11 |
|
---|
12 | /*
|
---|
13 | * Copyright (c) 2017 Simon Goldschmidt
|
---|
14 | * All rights reserved.
|
---|
15 | *
|
---|
16 | * Redistribution and use in source and binary forms, with or without modification,
|
---|
17 | * are permitted provided that the following conditions are met:
|
---|
18 | *
|
---|
19 | * 1. Redistributions of source code must retain the above copyright notice,
|
---|
20 | * this list of conditions and the following disclaimer.
|
---|
21 | * 2. Redistributions in binary form must reproduce the above copyright notice,
|
---|
22 | * this list of conditions and the following disclaimer in the documentation
|
---|
23 | * and/or other materials provided with the distribution.
|
---|
24 | * 3. The name of the author may not be used to endorse or promote products
|
---|
25 | * derived from this software without specific prior written permission.
|
---|
26 | *
|
---|
27 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
---|
28 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
---|
29 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
|
---|
30 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
---|
31 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
---|
32 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
---|
33 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
---|
34 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
---|
35 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
---|
36 | * OF SUCH DAMAGE.
|
---|
37 | *
|
---|
38 | * This file is part of the lwIP TCP/IP stack.
|
---|
39 | *
|
---|
40 | * Author: Simon Goldschmidt <goldsimon@gmx.de>
|
---|
41 | *
|
---|
42 | */
|
---|
43 | #ifndef LWIP_HDR_ALTCP_MBEDTLS_MEM_H
|
---|
44 | #define LWIP_HDR_ALTCP_MBEDTLS_MEM_H
|
---|
45 |
|
---|
46 | #include "lwip/opt.h"
|
---|
47 |
|
---|
48 | #if LWIP_ALTCP /* don't build if not configured for use in lwipopts.h */
|
---|
49 |
|
---|
50 | #include "lwip/apps/altcp_tls_mbedtls_opts.h"
|
---|
51 |
|
---|
52 | #if LWIP_ALTCP_TLS && LWIP_ALTCP_TLS_MBEDTLS
|
---|
53 |
|
---|
54 | #include "altcp_tls_mbedtls_structs.h"
|
---|
55 |
|
---|
56 | #ifdef __cplusplus
|
---|
57 | extern "C" {
|
---|
58 | #endif
|
---|
59 |
|
---|
60 | void altcp_mbedtls_mem_init(void);
|
---|
61 | altcp_mbedtls_state_t *altcp_mbedtls_alloc(void *conf);
|
---|
62 | void altcp_mbedtls_free(void *conf, altcp_mbedtls_state_t *state);
|
---|
63 | void *altcp_mbedtls_alloc_config(size_t size);
|
---|
64 | void altcp_mbedtls_free_config(void *item);
|
---|
65 |
|
---|
66 | #ifdef __cplusplus
|
---|
67 | }
|
---|
68 | #endif
|
---|
69 |
|
---|
70 | #endif /* LWIP_ALTCP_TLS && LWIP_ALTCP_TLS_MBEDTLS */
|
---|
71 | #endif /* LWIP_ALTCP */
|
---|
72 | #endif /* LWIP_HDR_ALTCP_MBEDTLS_MEM_H */
|
---|