Main Page   Class Hierarchy   Compound List   File List   Compound Members  

C_SecureSocket.hpp

00001 /*
00002  *  This program is free software; you can redistribute it and/or modify
00003  *  it under the terms of the GNU General Public License as published by
00004  *  the Free Software Foundation; either version 2 of the License, or
00005  *  (at your option) any later version.
00006  *
00007  *  This program is distributed in the hope that it will be useful,
00008  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00009  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010  *  GNU General Public License for more details.
00011  *
00012  *  You should have received a copy of the GNU General Public License
00013  *  along with this program; if not, write to the Free Software
00014  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00015  *
00016  * (c)Copyright 2006 Hewlett-Packard Development Company, LP.
00017  *
00018  */
00019 
00020 #ifndef _C_SECURE_SOCKET_H
00021 #define _C_SECURE_SOCKET_H
00022 
00023 
00024 #include "ssl_t.hpp"
00025 #include "C_Socket.hpp"
00026 
00027 class C_SecureSocket {
00028 public:
00029   C_SecureSocket(SSL_CTX * P_ssl_ctx) ;
00030  ~C_SecureSocket() ;
00031 
00032   void ssl_error(int P_resultCode);
00033 
00034 
00035 protected:
00036   SSL_CTX * m_ssl_ctx ;
00037   BIO     * m_bio ;
00038   SSL     * m_ssl ;
00039 
00040 
00041 } ;
00042 
00043 class C_SecureSocketListen : public C_SocketListen, public C_SecureSocket {
00044 
00045 public:
00046   C_SecureSocketListen(SSL_CTX * P_ssl_ctx,
00047                        T_SocketType  P_type, 
00048                        T_pIpAddr     P_addr, 
00049                        int           P_channel_id,
00050                        size_t        P_read_buf_size,
00051                        size_t        P_segm_buf_size) ;
00052   C_SecureSocketListen(SSL_CTX * P_ssl_ctx, C_SocketListen& P_Socket);
00053   virtual ~C_SecureSocketListen() ;  
00054 protected:
00055   virtual C_Socket*  create_socket_server(int *P_ret) ;
00056 
00057 } ;
00058 
00059 class C_SecureSocketServer : public C_SocketServer , public C_SecureSocket {
00060 
00061 public:
00062   C_SecureSocketServer(SSL_CTX * P_ssl_ctx,
00063                        C_SocketListen *P_listen, 
00064                        int P_channel_id,
00065                        size_t P_read_buf_size,
00066                        size_t P_segm_buf_size);
00067   
00068   C_SecureSocketServer(SSL_CTX * P_ssl_ctx,
00069                        T_SocketType  P_type, 
00070                        T_pIpAddr     P_addr, 
00071                        int           P_channel_id,
00072                        size_t        P_read_buf_size,
00073                        size_t        P_segm_buf_size) ;
00074   
00075   C_SecureSocketServer(SSL_CTX * P_ssl_ctx, C_SocketServer& P_Socket);
00076   virtual ~C_SecureSocketServer();
00077   virtual int _call_read() ;
00078 
00079   virtual int _open(size_t                 P_buffer_size, 
00080                     C_ProtocolBinaryFrame *P_protocol) ;
00081   int _secure_mode() ;
00082   virtual int _call_write(unsigned char *P_buf, size_t P_size);
00083   virtual C_Socket* process_fd_in_progess(fd_set *P_rSet, 
00084                                           fd_set *P_wSet, 
00085                                           C_TransportEvent *P_event) ;
00086 
00087 
00088 } ;
00089 
00090 class C_SecureSocketClient : public C_SocketClient, public C_SecureSocket {
00091 public:
00092   C_SecureSocketClient(SSL_CTX * P_ssl_ctx,
00093                        T_SocketType  P_type, 
00094                        T_pIpAddr     P_addr, 
00095                        int           P_channel_id,
00096                        size_t        P_read_buf_size,
00097                        size_t        P_segm_buf_size) ;
00098   C_SecureSocketClient(SSL_CTX * P_ssl_ctx, C_SocketClient& P_Socket);
00099   virtual ~C_SecureSocketClient() ;
00100   virtual int _call_read() ; 
00101 
00102   virtual int _open (T_pOpenStatus P_status,
00103                      size_t        P_buffer_size,
00104                      C_ProtocolBinaryFrame *P_protocol);
00105   int _secure_mode() ;
00106   virtual C_Socket* process_fd_in_progess(fd_set *P_rSet, 
00107                                           fd_set *P_wSet, 
00108                                           C_TransportEvent *P_event) ;
00109   virtual int _call_write(unsigned char *P_buf, size_t P_size);
00110   
00111 } ;
00112 
00113 #endif // _C_SECURE_SOCKET_H
00114 
00115 

Generated on Wed Mar 7 14:44:58 2007 for Seagull by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002