Barracuda Application Server C/C++ Reference
Native APIs, integration guides, and platform interfaces
HttpSharkSslServCon.h
Go to the documentation of this file.
1/*
2 * ____ _________ __ _
3 * / __ \___ ____ _/ /_ __(_)___ ___ ___ / / ____ ____ _(_)____
4 * / /_/ / _ \/ __ `/ / / / / / __ `__ \/ _ \/ / / __ \/ __ `/ / ___/
5 * / _, _/ __/ /_/ / / / / / / / / / / / __/ /___/ /_/ / /_/ / / /__
6 * /_/ |_|\___/\__,_/_/ /_/ /_/_/ /_/ /_/\___/_____/\____/\__, /_/\___/
7 * /____/
8 *
9 * Barracuda Embedded Web-Server
10 *
11 ****************************************************************************
12 * HEADER
13 *
14 * $Id: HttpSharkSslServCon.h 6056 2026-09-20 05:09:33Z wini $
15 *
16 * COPYRIGHT: Real Time Logic LLC, 2004 - 2026
17 *
18 * This software is copyrighted by and is the sole property of Real
19 * Time Logic LLC. All rights, title, ownership, or other interests in
20 * the software remain the property of Real Time Logic LLC. This
21 * software may only be used in accordance with the terms and
22 * conditions stipulated in the corresponding license agreement under
23 * which the software has been supplied. Any unauthorized use,
24 * duplication, transmission, distribution, or disclosure of this
25 * software is expressly forbidden.
26 *
27 * This Copyright notice may not be removed or modified without prior
28 * written consent of Real Time Logic LLC.
29 *
30 * Real Time Logic LLC. reserves the right to modify this software
31 * without notice.
32 *
33 * http://www.realtimelogic.com
34 ****************************************************************************
35 *
36 * SharkSSL for Barracuda Embedded Web-Server
37 *
38 */
146#ifndef __HttpSharkSslServCon_h
147#define __HttpSharkSslServCon_h
148
149#include <HttpServCon.h>
150#include <BaServerLib.h>
151#include <SharkSSL.h>
152#include <string.h>
153#include <DoubleList.h>
154
155
156
157
158
159
170{
171#ifdef __cplusplus
172
173 void *operator new(size_t s) { return ::baMalloc(s); }
174 void operator delete(void* d) { if(d) ::baFree(d); }
175 void *operator new(size_t, void *place) { return place; }
176 void operator delete(void*, void *) { }
177
180
203 HttpSharkSslServCon(SharkSsl* sharkSsl,
204 HttpServer* server,
205 SoDisp* dispatcher,
206 U16 port=443,
207 bool setIP6=false,
208 const void* interfaceName=0,
209 HttpServCon_AcceptNewCon userDefinedAccept=0);
212 BaBool isValid();
213
223 int setPort(U16 portNumber, bool setIp6=false,
224 const void* interfaceName=0);
228 private:
229#endif
230 HttpServCon sCon;
231 DoubleList sharkSslConList;
232 SharkSsl* sharkSsl;
233 BaBool requestClientCert;
234 BaBool favorRSA;
236
237
238#ifdef __cplusplus
239extern "C" {
240#endif
245 SharkSsl* sharkSsl,
246 struct HttpServer* server,
247 struct SoDisp* dispatcher,
248 U16 port,
249 BaBool setIP6,
250 const void* interfaceName,
251 HttpServCon_AcceptNewCon userDefinedAccept);
252SHARKSSL_API int HttpServCon_setPort(HttpServCon* o, U16 portNumber,
253 BaBool setIp6, const void* interfaceName);
257 U16 portNumber,
258 BaBool setIp6,
259 const void* interfaceName);
262#define HttpSharkSslServCon_isValid(o) HttpServCon_isValid((HttpServCon*)o)
268#define HttpSharkSslServCon_requestClientCert(o,enable) \
269 (o)->requestClientCert=enable
275#define HttpSharkSslServCon_favorRSA(o,enable) \
276 (o)->favorRSA=enable
277
281
282SHARKSSL_API int HttpSharkSslServCon_bindExec(
283 SoDispCon* con, SharkSsl* ssl,const char* alpn,const char* host,int port);
284
285#ifdef __cplusplus
286}
288 SharkSsl* sharkSsl,
289 HttpServer* server,
290 SoDisp* dispatcher,
291 U16 port,
292 bool setIP6,
293 const void* interfaceName,
294 HttpServCon_AcceptNewCon userDefinedAccept) {
296 this,sharkSsl,server,dispatcher,
297 port,setIP6?TRUE:FALSE,
298 interfaceName,userDefinedAccept); }
300 return HttpServCon_isValid(this); }
302 U16 portNumber,bool setIp6,const void* interfaceName) {
304 this,portNumber,setIp6?TRUE:FALSE,interfaceName);
305}
306
309#endif
310
311#endif
void(* HttpServCon_AcceptNewCon)(struct HttpServCon *scon, HttpConnection *newcon)
Handle a newly accepted connection while the dispatcher mutex is held.
Definition: HttpServCon.h:58
#define HttpServCon_isValid(o)
Definition: HttpServCon.h:197
BA_API int HttpServCon_setPort(HttpServCon *o, U16 portNumber, BaBool setIp6, const void *interfaceName)
Open a replacement listening endpoint before closing the old one.
struct HttpSharkSslServCon HttpSharkSslServCon
Create a SharkSSL server listen object.
SHARKSSL_API void HttpSharkSslServCon_destructor(HttpSharkSslServCon *o)
Close the listener and every accepted TLS connection still tracked by it.
SHARKSSL_API void HttpSharkSslServCon_constructor(HttpSharkSslServCon *o, SharkSsl *sharkSsl, struct HttpServer *server, struct SoDisp *dispatcher, U16 port, BaBool setIP6, const void *interfaceName, HttpServCon_AcceptNewCon userDefinedAccept)
Create a SharkSSL Server Connection.
SHARKSSL_API int HttpSharkSslServCon_setPort(HttpSharkSslServCon *o, U16 portNumber, BaBool setIp6, const void *interfaceName)
Open a replacement listener, then close the old listener on success.
void * baMalloc(size_t size)
Allocate uninitialized storage using the target's configured allocator.
void baFree(void *p)
Release storage using the target's configured allocator.
uint16_t U16
Unsigned 16-bit integer.
Definition: GenPrimT.h:91
U8 BaBool
Boolean stored in an unsigned byte; FALSE is zero and TRUE is one.
Definition: GenPrimT.h:118
Create a server listen object.
Definition: HttpServCon.h:70
The Web Server.
Definition: HttpServer.h:3393
Create a SharkSSL server listen object.
Definition: HttpSharkSslServCon.h:170
HttpSharkSslServCon()
Uninitialized storage; use a C constructor before use or destruction.
Definition: HttpSharkSslServCon.h:179
int setPort(U16 portNumber, bool setIp6=false, const void *interfaceName=0)
Open a replacement listener, then close the old listener on success.
Definition: HttpSharkSslServCon.h:301
BaBool isValid()
Definition: HttpSharkSslServCon.h:299
~HttpSharkSslServCon()
Close the listener and every accepted TLS connection still tracked by it.
Definition: HttpSharkSslServCon.h:307
Contains information about the physical socket connection.
Definition: SoDispCon.h:120
The SoDisp dispatches any socket connection that contains data by calling the SoDispCon::execute memb...
Definition: SoDisp.h:91