GNU libmicrohttpd  0.9.65
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 
46 struct MHD_TLS_ConnectionState;
47 
48 
49 
54 {
58  void *cls;
59 
63  void
64  (*done)(struct MHD_TLS_Plugin *plugin);
65 
78  enum MHD_StatusCode
79  (*init_kcp)(void *cls,
80  const char *mem_key,
81  const char *mem_cert,
82  const char *pass);
83 
84 
92  enum MHD_StatusCode
93  (*init_dhparams)(void *cls,
94  const char *dh);
95 
96 
104  enum MHD_StatusCode
105  (*init_mem_trust)(void *cls,
106  const char *mem_trust);
107 
108 
117  struct MHD_TLS_ConnectionState *
118  (*setup_connection)(void *cls,
119  ...);
120 
121 
122  enum MHD_Bool
123  (*handshake)(void *cls,
124  struct MHD_TLS_ConnectionState *cs);
125 
126 
127  enum MHD_Bool
128  (*idle_ready)(void *cls,
129  struct MHD_TLS_ConnectionState *cs);
130 
131 
132  enum MHD_Bool
134  struct MHD_TLS_ConnectionState *cs,
135  enum MHD_RequestEventLoopInfo *eli);
136 
137  ssize_t
138  (*send)(void *cls,
139  struct MHD_TLS_ConnectionState *cs,
140  const void *buf,
141  size_t buf_size);
142 
143 
144  ssize_t
145  (*recv)(void *cls,
146  struct MHD_TLS_ConnectionState *cs,
147  void *buf,
148  size_t buf_size);
149 
150 
151  const char *
152  (*strerror)(void *cls,
153  int ec);
154 
155  enum MHD_Bool
157  struct MHD_TLS_ConnectionState *cs);
158 
159  enum MHD_Bool
161  struct MHD_TLS_ConnectionState *cs);
162 
163 
164  void
166  struct MHD_TLS_ConnectionState *cs);
167 
172 };
173 
174 
182 typedef struct MHD_TLS_Plugin *
183 (*MHD_TLS_PluginInit) (const char *ciphers);
184 
185 
192 #define MHD_TLS_INIT(body) \
193  struct MHD_TLS_Plugin * \
194  MHD_TLS_init_ ## MHD_TLS_ABI_VERSION (const char *ciphers) \\
195  { body }
196 
197 #endif
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)
enum MHD_Bool(* shutdown_connection)(void *cls, struct MHD_TLS_ConnectionState *cs)
enum MHD_StatusCode(* init_dhparams)(void *cls, const char *dh)
ssize_t(* recv)(void *cls, struct MHD_TLS_ConnectionState *cs, void *buf, size_t buf_size)
enum MHD_StatusCode(* init_kcp)(void *cls, const char *mem_key, const char *mem_cert, const char *pass)
enum MHD_Bool(* handshake)(void *cls, struct MHD_TLS_ConnectionState *cs)
void(* done)(struct MHD_TLS_Plugin *plugin)
enum MHD_Bool(* idle_ready)(void *cls, struct MHD_TLS_ConnectionState *cs)
enum MHD_StatusCode(* init_mem_trust)(void *cls, const char *mem_trust)
enum MHD_Bool(* check_record_pending)(void *cls, struct MHD_TLS_ConnectionState *cs)
enum MHD_Bool(* update_event_loop_info)(void *cls, struct MHD_TLS_ConnectionState *cs, enum MHD_RequestEventLoopInfo *eli)