Barracuda Application Server C/C++ Reference
NO
HttpSharkSslServCon.h
1/*
2 * ____ _________ __ _
3 * / __ \___ ____ _/ /_ __(_)___ ___ ___ / / ____ ____ _(_)____
4 * / /_/ / _ \/ __ `/ / / / / / __ `__ \/ _ \/ / / __ \/ __ `/ / ___/
5 * / _, _/ __/ /_/ / / / / / / / / / / / __/ /___/ /_/ / /_/ / / /__
6 * /_/ |_|\___/\__,_/_/ /_/ /_/_/ /_/ /_/\___/_____/\____/\__, /_/\___/
7 * /____/
8 *
9 * Barracuda Embedded Web-Server
10 *
11 ****************************************************************************
12 * HEADER
13 *
14 * $Id: HttpSharkSslServCon.h 4915 2021-12-01 18:26:55Z wini $
15 *
16 * COPYRIGHT: Real Time Logic LLC, 2004 - 2012
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 */
39#ifndef __HttpSharkSslServCon_h
40#define __HttpSharkSslServCon_h
41
42#include <HttpServCon.h>
43#include <BaServerLib.h>
44#include <SharkSSL.h>
45#include <string.h>
46#include <DoubleList.h>
47
48
49
50
51
52
62typedef struct HttpSharkSslServCon
63{
64#ifdef __cplusplus
65
66 void *operator new(size_t s) { return ::baMalloc(s); }
67 void operator delete(void* d) { if(d) ::baFree(d); }
68 void *operator new(size_t, void *place) { return place; }
69 void operator delete(void*, void *) { }
70
71 // Default constructor is used as a dummy op with the C constructors
73
91 HttpSharkSslServCon(SharkSsl* sharkSsl,
92 HttpServer* server,
93 SoDisp* dispatcher,
94 U16 port=443,
95 bool setIP6=false,
96 const void* interfaceName=0,
97 HttpServCon_AcceptNewCon userDefinedAccept=0);
98 BaBool isValid();
99
102 int setPort(U16 portNumber, bool setIp6=false,
103 const void* interfaceName=0);
105 private:
106#endif
107 HttpServCon sCon;
108 DoubleList sharkSslConList;
109 SharkSsl* sharkSsl;
110 BaBool requestClientCert;
111 BaBool favorRSA;
113
114
115#ifdef __cplusplus
116extern "C" {
117#endif
118SHARKSSL_API void HttpSharkSslServCon_constructor(
120 SharkSsl* sharkSsl,
121 struct HttpServer* server,
122 struct SoDisp* dispatcher,
123 U16 port,
124 BaBool setIP6,
125 const void* interfaceName,
126 HttpServCon_AcceptNewCon userDefinedAccept);
127SHARKSSL_API int HttpServCon_setPort(HttpServCon* o, U16 portNumber,
128 BaBool setIp6, const void* interfaceName);
129SHARKSSL_API int HttpSharkSslServCon_setPort(HttpSharkSslServCon* o,
130 U16 portNumber,
131 BaBool setIp6,
132 const void* interfaceName);
133#define HttpSharkSslServCon_isValid(o) HttpServCon_isValid((HttpServCon*)o)
134#define HttpSharkSslServCon_requestClientCert(o,enable) \
135 (o)->requestClientCert=enable
136#define HttpSharkSslServCon_favorRSA(o,enable) \
137 (o)->favorRSA=enable
138
139SHARKSSL_API void HttpSharkSslServCon_destructor(HttpSharkSslServCon* o);
140
141SHARKSSL_API int HttpSharkSslServCon_bindExec(
142 SoDispCon* con, SharkSsl* ssl,const char* alpn,const char* host,int port);
143
144#ifdef __cplusplus
145}
146inline HttpSharkSslServCon::HttpSharkSslServCon(
147 SharkSsl* sharkSsl,
148 HttpServer* server,
149 SoDisp* dispatcher,
150 U16 port,
151 bool setIP6,
152 const void* interfaceName,
153 HttpServCon_AcceptNewCon userDefinedAccept) {
154 HttpSharkSslServCon_constructor(
155 this,sharkSsl,server,dispatcher,
156 port,setIP6?TRUE:FALSE,
157 interfaceName,userDefinedAccept); }
158inline BaBool HttpSharkSslServCon::isValid() {
159 return HttpServCon_isValid(this); }
161 U16 portNumber,bool setIp6,const void* interfaceName) {
162 return HttpSharkSslServCon_setPort(
163 this,portNumber,setIp6?TRUE:FALSE,interfaceName);
164}
165
166inline HttpSharkSslServCon::~HttpSharkSslServCon() {
167 HttpSharkSslServCon_destructor(this);}
168#endif
169
170#endif
void * baMalloc(size_t size)
Returns pointer to uninitialized newly-allocated space for an object of size "size",...
void baFree(void *p)
Deallocates space to which it points.
Create a server listen object.
Definition: HttpServCon.h:61
The Web Server.
Definition: HttpServer.h:2864
Create a SharkSSL server listen object.
Definition: HttpSharkSslServCon.h:63
int setPort(U16 portNumber, bool setIp6=false, const void *interfaceName=0)
Change the port number for the "listen" object.
Definition: HttpSharkSslServCon.h:160
Contains information about the physical socket connection.
Definition: SoDispCon.h:112
The SoDisp dispatches any socket connection that contains data by calling the SoDispCon::execute memb...
Definition: SoDisp.h:86