1 /*****************************************************************
3 | Platinum - Frame Server
5 | Copyright (c) 2004-2010, Plutinosoft, LLC.
7 | http://www.plutinosoft.com
9 | This program is free software; you can redistribute it and/or
10 | modify it under the terms of the GNU General Public License
11 | as published by the Free Software Foundation; either version 2
12 | of the License, or (at your option) any later version.
14 | OEMs, ISVs, VARs and other distributors that combine and
15 | distribute commercially licensed software with Platinum software
16 | and do not wish to distribute the source code for the commercially
17 | licensed software under version 2, or (at your option) any later
18 | version, of the GNU General Public License (the "GPL") must enter
19 | into a commercial license agreement with Plutinosoft, LLC.
20 | licensing@plutinosoft.com
22 | This program is distributed in the hope that it will be useful,
23 | but WITHOUT ANY WARRANTY; without even the implied warranty of
24 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25 | GNU General Public License for more details.
27 | You should have received a copy of the GNU General Public License
28 | along with this program; see the file LICENSE.txt. If not, write to
29 | the Free Software Foundation, Inc.,
30 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
31 | http://www.gnu.org/licenses/gpl-2.0.html
33 ****************************************************************/
35 #ifndef _PLT_FRAME_SERVER_H_
36 #define _PLT_FRAME_SERVER_H_
38 /*----------------------------------------------------------------------
40 +---------------------------------------------------------------------*/
42 #include "PltHttpServer.h"
43 #include "PltFrameBuffer.h"
45 /*----------------------------------------------------------------------
46 | forward declarations
47 +---------------------------------------------------------------------*/
48 class PLT_SocketPolicyServer
;
50 /*----------------------------------------------------------------------
51 | PLT_StreamValidator class
52 +---------------------------------------------------------------------*/
53 class PLT_StreamValidator
56 virtual ~PLT_StreamValidator() {}
57 virtual bool OnNewRequestAccept(const NPT_HttpRequest
& request
,
58 const NPT_HttpRequestContext
& context
,
59 NPT_HttpResponse
& response
,
60 NPT_Reference
<PLT_FrameBuffer
>& buffer
) = 0;
63 /*----------------------------------------------------------------------
64 | PLT_HttpStreamRequestHandler
65 +---------------------------------------------------------------------*/
66 class PLT_HttpStreamRequestHandler
: public NPT_HttpRequestHandler
70 PLT_HttpStreamRequestHandler(PLT_StreamValidator
& stream_validator
) :
71 m_StreamValidator(stream_validator
) {}
73 // NPT_HttpRequestHandler methods
74 NPT_Result
SetupResponse(NPT_HttpRequest
& request
,
75 const NPT_HttpRequestContext
& context
,
76 NPT_HttpResponse
& response
) override
;
79 PLT_StreamValidator
& m_StreamValidator
;
82 /*----------------------------------------------------------------------
83 | PLT_FrameServer class
84 +---------------------------------------------------------------------*/
85 class PLT_FrameServer
: public PLT_HttpServer
88 PLT_FrameServer(const char* resource_name
,
89 PLT_StreamValidator
& stream_validator
,
90 NPT_IpAddress address
= NPT_IpAddress::Any
,
92 bool policy_server_enabled
= false);
93 ~PLT_FrameServer() override
;
95 NPT_Result
Start() override
;
98 PLT_SocketPolicyServer
* m_PolicyServer
;
99 PLT_StreamValidator
& m_StreamValidator
;
100 bool m_PolicyServerEnabled
;
103 #endif /* _PLT_FRAME_SERVER_H_ */