sdk-core
v2026.11.05
PS2 SDK - core tier (build-critical EE/IOP modules)
Toggle main menu visibility
Loading...
Searching...
No Matches
altcp_tls.h
Go to the documentation of this file.
1
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_TLS_H
44
#define LWIP_HDR_ALTCP_TLS_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
#if LWIP_ALTCP_TLS
51
52
#include "
lwip/altcp.h
"
53
54
/* check if mbedtls port is enabled */
55
#include "
lwip/apps/altcp_tls_mbedtls_opts.h
"
56
/* allow session structure to be fully defined when using mbedtls port */
57
#if LWIP_ALTCP_TLS_MBEDTLS
58
#include "mbedtls/ssl.h"
59
#endif
60
61
#ifdef __cplusplus
62
extern
"C"
{
63
#endif
64
68
struct
altcp_tls_config;
69
73
struct
altcp_tls_config *altcp_tls_create_config_server(u8_t cert_count);
74
78
err_t altcp_tls_config_server_add_privkey_cert(
struct
altcp_tls_config *config,
79
const
u8_t *privkey,
size_t
privkey_len,
80
const
u8_t *privkey_pass,
size_t
privkey_pass_len,
81
const
u8_t *cert,
size_t
cert_len);
82
88
struct
altcp_tls_config *altcp_tls_create_config_server_privkey_cert(
const
u8_t *privkey,
size_t
privkey_len,
89
const
u8_t *privkey_pass,
size_t
privkey_pass_len,
90
const
u8_t *cert,
size_t
cert_len);
91
95
struct
altcp_tls_config *altcp_tls_create_config_client(
const
u8_t *cert,
size_t
cert_len);
96
100
struct
altcp_tls_config *altcp_tls_create_config_client_2wayauth(
const
u8_t *ca,
size_t
ca_len,
const
u8_t *privkey,
size_t
privkey_len,
101
const
u8_t *privkey_pass,
size_t
privkey_pass_len,
102
const
u8_t *cert,
size_t
cert_len);
103
111
int
altcp_tls_configure_alpn_protocols(
struct
altcp_tls_config *conf,
const
char
**protos);
112
116
void
altcp_tls_free_config(
struct
altcp_tls_config *conf);
117
127
void
altcp_tls_free_entropy(
void
);
128
132
struct
altcp_pcb *altcp_tls_wrap(
struct
altcp_tls_config *config,
struct
altcp_pcb *inner_pcb);
133
137
struct
altcp_pcb *altcp_tls_new(
struct
altcp_tls_config *config, u8_t ip_type);
138
145
struct
altcp_pcb *altcp_tls_alloc(
void
*arg, u8_t ip_type);
146
151
void
*altcp_tls_context(
struct
altcp_pcb *conn);
152
156
struct
altcp_tls_session
157
#if LWIP_ALTCP_TLS_MBEDTLS
158
{
159
mbedtls_ssl_session data;
160
}
161
#endif
162
;
163
168
void
altcp_tls_init_session(
struct
altcp_tls_session *dest);
169
175
err_t altcp_tls_get_session(
struct
altcp_pcb *conn,
struct
altcp_tls_session *dest);
176
182
err_t altcp_tls_set_session(
struct
altcp_pcb *conn,
struct
altcp_tls_session *from);
183
188
void
altcp_tls_free_session(
struct
altcp_tls_session *dest);
189
190
#ifdef __cplusplus
191
}
192
#endif
193
194
#endif
/* LWIP_ALTCP_TLS */
195
#endif
/* LWIP_ALTCP */
196
#endif
/* LWIP_HDR_ALTCP_TLS_H */
altcp.h
altcp_tls_mbedtls_opts.h
opt.h
core
ps2ip
include
lwip_include
lwip
altcp_tls.h
Generated by
1.18.0