QoS_Session.h

Go to the documentation of this file.
00001 /* -*- C++ -*- */
00002 
00003 //=============================================================================
00004 /**
00005  *  @file    QoS_Session.h
00006  *
00007  *  $Id: QoS_Session.h 69855 2005-12-08 22:25:45Z ossama $
00008  *
00009  *  @author Vishal Kachroo <vishal@cs.wustl.edu>
00010  */
00011 //=============================================================================
00012 
00013 
00014 #ifndef ACE_QOS_SESSION_H
00015 #define ACE_QOS_SESSION_H
00016 #include /**/ "ace/pre.h"
00017 
00018 #include "ACE_QoS_Export.h"
00019 #include "ace/INET_Addr.h"
00020 #include "ace/OS_QoS.h"
00021 
00022 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00023 # pragma once
00024 #endif /* ACE_LACKS_PRAGMA_ONCE */
00025 
00026 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
00027 
00028 class ACE_SOCK;
00029 class ACE_QoS_Manager;
00030 
00031 typedef int ACE_Protocol_ID;
00032 // IPPROTO_UDP or IPPROTO_TCP.
00033 
00034 /**
00035  * @class ACE_QoS_Session
00036  *
00037  * @brief A QoS Session object.
00038  *
00039  * This class defines the interface for a QoS Session. It abstracts the
00040  * notion of QoS on different platforms and presents a simple, easy-to-use
00041  * API. Current [RAPI,GQoS] and future implementations will conform to this
00042  * interface.
00043  */
00044 class ACE_QoS_Export ACE_QoS_Session
00045 {
00046 
00047 public:
00048 
00049   enum RSVP_Event_Type
00050   {
00051     RSVP_PATH_EVENT,
00052     RSVP_RESV_EVENT,
00053     RSVP_RESV_CONFIRM,
00054     RSVP_RESV_ERROR,
00055     RSVP_PATH_ERROR    
00056   };
00057 
00058   /// A flag to indicate if this endpoint is a sender or a receiver or
00059   /// both.
00060   enum ACE_End_Point_Type
00061   {
00062     ACE_QOS_SENDER,
00063     ACE_QOS_RECEIVER,
00064     ACE_QOS_BOTH
00065   };
00066 
00067   
00068   /// to shutup g++.
00069   virtual ~ACE_QoS_Session (void) {};
00070 
00071   /// Open a QoS session [dest IP, dest port, Protocol ID].
00072   virtual int open (ACE_INET_Addr dest_addr,
00073                     ACE_Protocol_ID protocol_id) = 0;
00074 
00075   /// Close the QoS Session.
00076   virtual int close (void) = 0;
00077 
00078   /// Returns the QoS in the current session.
00079   virtual ACE_QoS qos (void) const = 0;
00080 
00081   /// Set QoS for the current session. The qos manager is used to
00082   /// confirm if this QoS session was subscribed to by the socket.
00083   virtual int qos (ACE_SOCK *socket,
00084                    ACE_QoS_Manager *qos_manager,
00085                    const ACE_QoS &ace_qos) = 0;
00086 
00087   /**
00088    * Sets the QoS for this session object to ace_qos. Does not
00089    * interfere with the QoS in the underlying socket. This call is
00090    * useful to update the QoS object when the underlying socket QoS is
00091    * being set through a mechanism other than the previous qos ()
00092    * method e.g. inside the dgram_mcast.subscribe () where the QoS for
00093    * the socket is set through ACE_OS::join_leaf ().
00094    */
00095   virtual void qos (const ACE_QoS &ace_qos) = 0;
00096 
00097   /**
00098    * This is called from handle_qos () method of the the QoS Event
00099    * Handler.  Invoking this method is an indication of a QoS event
00100    * occurring, that may have resulted in a change of QoS for the
00101    * underlying session. This method updates the QoS object associated
00102    * with this session.
00103    */
00104   virtual int update_qos (void) = 0;
00105 
00106   /// Get/Set methods for the flags_.
00107   virtual ACE_End_Point_Type flags (void) const = 0;
00108   virtual void flags (const ACE_End_Point_Type flags) = 0;
00109 
00110   /// Get the session id.
00111   virtual int session_id (void) const = 0;
00112 
00113   /// Set the session id.
00114   virtual void session_id (const int session_id) = 0;
00115 
00116   /// Get the file descriptor on which RSVP events will occur.
00117   virtual ACE_HANDLE rsvp_events_handle (void) = 0;
00118 
00119   virtual void  rsvp_event_type (RSVP_Event_Type event_type) = 0;
00120   ///Set the RAPI event that last occured
00121   
00122   virtual RSVP_Event_Type rsvp_event_type (void) = 0;
00123   ///Get the RAPI event that last occured
00124 
00125 
00126   /// Get the destination address for this session.
00127   virtual ACE_INET_Addr dest_addr (void) const = 0;
00128 
00129   /// Set the destination address for this session.
00130   virtual void dest_addr (const ACE_INET_Addr &dest_addr) = 0;
00131 
00132   /// Get the source port for this session.
00133   virtual u_short source_port (void) const = 0;
00134 
00135   /// Set the source port for this session.
00136   virtual void source_port (const u_short &source_port) = 0;
00137 
00138   //Set the source host
00139   virtual ACE_INET_Addr* source_addr (void) const = 0;
00140   
00141   /// Set the source port for this session.
00142   virtual void source_addr (ACE_INET_Addr* source_addr) = 0;
00143   
00144 
00145   /**
00146    * Returns the version of the underlying RSVP implementation. Is
00147    * meaningful only when the underlying implementation has
00148    * versioning.
00149    */
00150   virtual int version (void) = 0;
00151 
00152 protected:
00153 
00154   /// Source port if this is a Sender session. Used for rapi_sender ().
00155   u_short source_port_;
00156 
00157   /// session id for the session.
00158   int session_id_;
00159 
00160   /// Destination address for this session.
00161   ACE_INET_Addr dest_addr_;
00162 
00163   /// Source address for this session.
00164   ACE_INET_Addr* src_addr_;
00165 
00166   /// Is this a TCP or a UDP session.
00167   ACE_Protocol_ID protocol_id_;
00168 
00169   /// QoS for this session.
00170   ACE_QoS qos_;
00171 
00172   /// Specifies if this is a sending/receiving/both session.
00173   ACE_End_Point_Type flags_;
00174 
00175   RSVP_Event_Type rsvp_event_type_;
00176   //Has the last rsvp event that occured
00177 
00178 };
00179 
00180 ACE_END_VERSIONED_NAMESPACE_DECL
00181 
00182 #include /**/ "ace/post.h"
00183 #endif /* ACE_QOS_SESSION_H */

Generated on Sun Jan 27 13:03:37 2008 for ACE_QoS by doxygen 1.3.6