GNU libmicrohttpd 0.9.77
Loading...
Searching...
No Matches
microhttpd_tls.h
Go to the documentation of this file.
1/*
2 This file is part of libmicrohttpd
3 Copyright (C) 2018 Christian Grothoff (and other contributing authors)
4
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
9
10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
14
15 You should have received a copy of the GNU Lesser General Public
16 License along with this library; if not, write to the Free Software
17 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18*/
19
26#ifndef MICROHTTPD_TLS_H
27#define MICROHTTPD_TLS_H
28
29#include <microhttpd2.h>
30
34#define MHD_TLS_ABI_VERSION 0
35
40#define MHD_TLS_ABI_VERSION_STR "0"
41
42
46struct MHD_TLS_ConnectionState;
47
48
53{
57 void *cls;
58
62 void
63 (*done)(struct MHD_TLS_Plugin *plugin);
64
77 enum MHD_StatusCode
78 (*init_kcp)(void *cls,
79 const char *mem_key,
80 const char *mem_cert,
81 const char *pass);
82
83
91 enum MHD_StatusCode
92 (*init_dhparams)(void *cls,
93 const char *dh);
94
95
103 enum MHD_StatusCode
104 (*init_mem_trust)(void *cls,
105 const char *mem_trust);
106
107
116 struct MHD_TLS_ConnectionState *
117 (*setup_connection)(void *cls,
118 ...);
119
120
121 enum MHD_Bool
122 (*handshake)(void *cls,
123 struct MHD_TLS_ConnectionState *cs);
124
125
126 enum MHD_Bool
127 (*idle_ready)(void *cls,
128 struct MHD_TLS_ConnectionState *cs);
129
130
131 enum MHD_Bool
133 struct MHD_TLS_ConnectionState *cs,
134 enum MHD_RequestEventLoopInfo *eli);
135
136 ssize_t
137 (*send)(void *cls,
138 struct MHD_TLS_ConnectionState *cs,
139 const void *buf,
140 size_t buf_size);
141
142
143 ssize_t
144 (*recv)(void *cls,
145 struct MHD_TLS_ConnectionState *cs,
146 void *buf,
147 size_t buf_size);
148
149
150 const char *
151 (*strerror)(void *cls,
152 int ec);
153
154 enum MHD_Bool
155 (*check_record_pending)(void *cls,
156 struct MHD_TLS_ConnectionState *cs);
157
158 enum MHD_Bool
159 (*shutdown_connection)(void *cls,
160 struct MHD_TLS_ConnectionState *cs);
161
162
163 void
164 (*teardown_connection)(void *cls,
165 struct MHD_TLS_ConnectionState *cs);
166
171};
172
173
181typedef struct MHD_TLS_Plugin *
182(*MHD_TLS_PluginInit) (const char *ciphers);
183
184
191#define MHD_TLS_INIT(body) \
192 struct MHD_TLS_Plugin * \
193 MHD_TLS_init_ ## MHD_TLS_ABI_VERSION (const char *ciphers) \ \
194 { body }
195
196#endif
enum MHD_Bool(* idle_ready)(void *cls, struct MHD_TLS_ConnectionState *cs)
ssize_t(* recv)(void *cls, struct MHD_TLS_ConnectionState *cs, void *buf, size_t buf_size)
enum MHD_Bool(* update_event_loop_info)(void *cls, struct MHD_TLS_ConnectionState *cs, enum MHD_RequestEventLoopInfo *eli)
enum MHD_StatusCode(* init_mem_trust)(void *cls, const char *mem_trust)
enum MHD_Bool(* shutdown_connection)(void *cls, struct MHD_TLS_ConnectionState *cs)
enum MHD_Bool(* handshake)(void *cls, struct MHD_TLS_ConnectionState *cs)
enum MHD_StatusCode(* init_kcp)(void *cls, const char *mem_key, const char *mem_cert, const char *pass)
enum MHD_Bool(* check_record_pending)(void *cls, struct MHD_TLS_ConnectionState *cs)
enum MHD_StatusCode(* init_dhparams)(void *cls, const char *dh)
ssize_t(* send)(void *cls, struct MHD_TLS_ConnectionState *cs, const void *buf, size_t buf_size)
void(* teardown_connection)(void *cls, struct MHD_TLS_ConnectionState *cs)
void(* done)(struct MHD_TLS_Plugin *plugin)