OSDN Git Service

Merge branch 'packet_edit' into autotools-fix(releng)
[ultramonkey-l7/sslproxy.git] / include / sslproxyserver.h
1 /*
2  * @file  sslproxyserver.h
3  * @brief SSLproxy server Header
4  *
5  * Copyright (C) 2008  NTT COMWARE Corporation.
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Lesser General Public
9  * License as published by the Free Software Foundation; either
10  * version 2.1 of the License, or (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15  * Lesser General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public
18  * License along with this library; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
20  * 02110-1301 USA
21  *
22  **********************************************************************
23  *
24  * Distributed under the Boost Software Licence, Version 1.0
25  * http://www.boost.org/LICENSE_1_0.txt
26  *
27  **********************************************************************/
28
29 #ifndef __SSLPROXYSERVER_H__
30 #define __SSLPROXYSERVER_H__
31
32 #include "sslproxy.h"
33 #include "sslproxysession.h"
34
35 //! SSLproxy session management table.
36 extern std::map<long, int> sessionTable;
37 extern pthread_mutex_t sessionTable_mutex;
38
39 class sslproxy_server
40 {
41 protected:
42         boost::asio::io_service&                        sslservice;
43         boost::asio::ip::tcp::acceptor                  sslacceptor;
44         boost::asio::ssl::context                       sslcontext;
45         boost::asio::ip::tcp::resolver::iterator        target_endpoint_iterator;
46         std::string                                     private_key_passwd;
47 public:
48         // constructor
49         sslproxy_server(boost::asio::io_service& io_service,
50                         boost::asio::ip::tcp::resolver::iterator target_itr,
51                         boost::asio::ip::tcp::endpoint recv_endpoint);
52         // destructor
53         ~sslproxy_server();
54         // Get password callback function.
55         std::string get_password();
56         // Acception handling function.
57         void handle_accept(sslproxy_session* session, const boost::system::error_code& error);
58 };
59
60 #endif //__SSLPROXYSERVER_H__