SSLIOP_Acceptor.h

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 
00003 //=============================================================================
00004 /**
00005  *  @file    SSLIOP_Acceptor.h
00006  *
00007  *  SSLIOP_Acceptor.h,v 1.34 2006/03/14 06:14:35 jtc Exp
00008  *
00009  *  IIOP/SSL specific acceptor processing
00010  *
00011  *
00012  *  @author Carlos O'Ryan <coryan@uci.edu>
00013  *  @author Ossama Othman <ossama@uci.edu>
00014  */
00015 //=============================================================================
00016 
00017 
00018 #ifndef TAO_SSLIOP_ACCEPTOR_H
00019 #define TAO_SSLIOP_ACCEPTOR_H
00020 
00021 #include /**/ "ace/pre.h"
00022 
00023 #include "ace/config-all.h"
00024 
00025 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00026 # pragma once
00027 #endif /* ACE_LACKS_PRAGMA_ONCE */
00028 
00029 #include "orbsvcs/SSLIOP/IIOP_SSL_Acceptor.h"
00030 #include "orbsvcs/SSLIOP/SSLIOP_Connection_Handler.h"
00031 #include "orbsvcs/SSLIOP/SSLIOP_Accept_Strategy.h"
00032 
00033 #include "orbsvcs/SSLIOPC.h"  /* CSIv1 */
00034 #include "orbsvcs/CSIIOPC.h"  /* CSIv2 */
00035 
00036 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
00037 
00038 namespace TAO
00039 {
00040   namespace SSLIOP
00041   {
00042 
00043     /**
00044      * @class Acceptor
00045      *
00046      * @brief The SSLIOP-specific bridge class for the concrete acceptor.
00047      */
00048     class Acceptor
00049       : public IIOP_SSL_Acceptor
00050     {
00051     public:
00052 
00053       /// Constructor.
00054       Acceptor (::Security::QOP qop,
00055                 const ACE_Time_Value & timeout);
00056 
00057       /// Destructor.
00058       ~Acceptor (void);
00059 
00060       typedef ACE_Strategy_Acceptor<Connection_Handler, ACE_SSL_SOCK_ACCEPTOR> BASE_ACCEPTOR;
00061       typedef TAO_Creation_Strategy<Connection_Handler> CREATION_STRATEGY;
00062       typedef TAO_Concurrency_Strategy<Connection_Handler> CONCURRENCY_STRATEGY;
00063       typedef Accept_Strategy ACCEPT_STRATEGY;
00064 
00065       /**
00066        * @name The TAO_Acceptor Methods
00067        *
00068        * Check the documentation in tao/Pluggable.h for details.
00069        */
00070       //@{
00071       virtual int open (TAO_ORB_Core *orb_core,
00072                         ACE_Reactor *reactor,
00073                         int version_major,
00074                         int version_minor,
00075                         const char *address,
00076                         const char *options = 0);
00077       virtual int open_default (TAO_ORB_Core *orb_core,
00078                                 ACE_Reactor *reactor,
00079                                 int version_major,
00080                                 int version_minor,
00081                                 const char *options = 0);
00082       virtual int close (void);
00083       virtual int create_profile (const TAO::ObjectKey &object_key,
00084                                   TAO_MProfile &mprofile,
00085                                   CORBA::Short priority);
00086       virtual int is_collocated (const TAO_Endpoint* endpoint);
00087       //@}
00088 
00089       /// Retrieve the CSIv1 SSLIOP::SSL component associated with the
00090       /// endpoints set up by this acceptor.
00091       const ::SSLIOP::SSL &ssl_component (void) const;
00092 
00093     private:
00094 
00095       /// Implement the common part of the open*() methods.
00096       int ssliop_open_i (TAO_ORB_Core *orb_core,
00097                          const ACE_INET_Addr& addr,
00098                          ACE_Reactor *reactor);
00099 
00100       /// Parse protocol specific options.
00101       virtual int parse_options_i (int &argc, ACE_CString ** argv);
00102 
00103       /// Ensure that neither the endpoint configuration nor the ORB
00104       /// configuration violate security measures.
00105       int verify_secure_configuration (TAO_ORB_Core *orb_core,
00106                                        int major,
00107                                        int minor);
00108 
00109       /// Helper method to add a new profile to the mprofile for
00110       /// each endpoint.
00111       int create_new_profile (const TAO::ObjectKey &object_key,
00112                               TAO_MProfile &mprofile,
00113                               CORBA::Short priority);
00114 
00115       /// Helper method to create a profile that contains all of
00116       /// our endpoints.
00117       int create_shared_profile (const TAO::ObjectKey &object_key,
00118                                  TAO_MProfile &mprofile,
00119                                  CORBA::Short priority);
00120 
00121     private:
00122 
00123       /// The concrete acceptor, as a pointer to it's base class.
00124       BASE_ACCEPTOR ssl_acceptor_;
00125 
00126       /**
00127        * @name Acceptor Strategies
00128        *
00129        * Strategies used when accepting an incoming connection.
00130        */
00131       CREATION_STRATEGY *creation_strategy_;
00132       CONCURRENCY_STRATEGY *concurrency_strategy_;
00133       ACCEPT_STRATEGY *accept_strategy_;
00134 
00135       /// The CSIv1 SSL component.
00136       /**
00137        * This is the SSLIOP endpoint-specific tagged component that is
00138        * embedded in a given IOR.
00139        */
00140       ::SSLIOP::SSL ssl_component_;
00141 
00142       /// The SSLIOP CSIv2 tagged component.
00143       /**
00144        *
00145        */
00146       CSIIOP::TLS_SEC_TRANS csiv2_component_;
00147 
00148       /// The accept() timeout.
00149       /**
00150        * This timeout includes the overall time to complete the SSL
00151        * handshake.  This includes both the TCP handshake and the SSL
00152        * handshake.
00153        */
00154       const ACE_Time_Value timeout_;
00155 
00156     };
00157 
00158   }  // End SSLIOP namespace.
00159 }  // End TAO namespace.
00160 
00161 TAO_END_VERSIONED_NAMESPACE_DECL
00162 
00163 #if defined(__ACE_INLINE__)
00164 #include "orbsvcs/SSLIOP/SSLIOP_Acceptor.i"
00165 #endif /* __ACE_INLINE__ */
00166 
00167 #include /**/ "ace/post.h"
00168 
00169 #endif  /* TAO_SSLIOP_ACCEPTOR_H */

Generated on Thu Nov 9 13:54:13 2006 for TAO_SSLIOP by doxygen 1.3.6