summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--TAO/ChangeLogs/ChangeLog-02a12
-rw-r--r--TAO/orbsvcs/orbsvcs/AV/AVStreams_i.cpp4
-rw-r--r--TAO/orbsvcs/orbsvcs/AV/AVStreams_i.i21
-rw-r--r--TAO/orbsvcs/orbsvcs/AV/UDP.cpp73
-rw-r--r--TAO/orbsvcs/orbsvcs/AV/UDP.h4
5 files changed, 110 insertions, 4 deletions
diff --git a/TAO/ChangeLogs/ChangeLog-02a b/TAO/ChangeLogs/ChangeLog-02a
index 79a9ac6bd19..0eb0e7e2474 100644
--- a/TAO/ChangeLogs/ChangeLog-02a
+++ b/TAO/ChangeLogs/ChangeLog-02a
@@ -1,3 +1,15 @@
+Fri Oct 12 00:42:42 2001 Craig Rodriguse <crodrigu@bbn.com>
+
+ * orbsvcs/orbsvcs/AV/AVStreams_i.cpp:
+ * orbsvcs/orbsvcs/AV/AVStreams_i.i:
+ Improve debugging statements
+
+ * orbsvcs/orbsvcs/AV/UDP.cpp:
+ * orbsvcs/orbsvcs/AV/UDP.h:
+ For UDP pluggable protocol, add capability to
+ set Diffserv Codepoint and Explicit Congestion Notification
+ (ECN) bits in IP TOS (Type of Service) field.
+
Wed Oct 10 17:12:04 2001 Priyanka Gontla <pgontla@ece.uci.edu>
* tao/ORB_Core.cpp :
diff --git a/TAO/orbsvcs/orbsvcs/AV/AVStreams_i.cpp b/TAO/orbsvcs/orbsvcs/AV/AVStreams_i.cpp
index 2b330beb50b..cebba6f5191 100644
--- a/TAO/orbsvcs/orbsvcs/AV/AVStreams_i.cpp
+++ b/TAO/orbsvcs/orbsvcs/AV/AVStreams_i.cpp
@@ -1608,6 +1608,10 @@ void
TAO_Base_StreamEndPoint::set_flow_handler (const char *flowname,
TAO_AV_Flow_Handler *handler)
{
+ if(TAO_debug_level > 1)
+ {
+ ACE_DEBUG ((LM_DEBUG, "(%N,%l) TAO_Base_StreamEndPoint::set_flow_handler(), flowname: %s\n", flowname));
+ }
ACE_CString flow_name_key (flowname);
if (this->flow_handler_map_.bind (flow_name_key, handler) != 0)
ACE_ERROR ((LM_ERROR,
diff --git a/TAO/orbsvcs/orbsvcs/AV/AVStreams_i.i b/TAO/orbsvcs/orbsvcs/AV/AVStreams_i.i
index 0e62350f8ae..f98b4a31f27 100644
--- a/TAO/orbsvcs/orbsvcs/AV/AVStreams_i.i
+++ b/TAO/orbsvcs/orbsvcs/AV/AVStreams_i.i
@@ -37,10 +37,23 @@ TAO_AV_QoS::get_flow_qos (const char *flowname,
flow_qos);
if (result < 0)
- ACE_ERROR_RETURN ((LM_DEBUG,
- "(%N,%l) TAO_AV_QOS::get_flow_qos qos_map::find failed for %s\n",
- flowname),
- -1);
+ {
+ ACE_DEBUG((LM_DEBUG, "(%N,%l) qos_map contains the flows:\n"));
+
+ ACE_Hash_Map_Manager<ACE_CString,AVStreams::QoS,ACE_Null_Mutex>::ITERATOR iter
+ = qos_map_.begin();
+
+ while( iter != qos_map_.end() )
+ {
+ ACE_DEBUG((LM_DEBUG, " %s\n", (*iter).ext_id_.c_str() ));
+ ++iter;
+ }
+
+ ACE_ERROR_RETURN ((LM_DEBUG,
+ "(%N,%l) TAO_AV_QOS::get_flow_qos qos_map::find failed for %s\n",
+ flowname),
+ -1);
+ }
return 0;
}
diff --git a/TAO/orbsvcs/orbsvcs/AV/UDP.cpp b/TAO/orbsvcs/orbsvcs/AV/UDP.cpp
index 5c5bc70b684..b7841a09443 100644
--- a/TAO/orbsvcs/orbsvcs/AV/UDP.cpp
+++ b/TAO/orbsvcs/orbsvcs/AV/UDP.cpp
@@ -72,6 +72,79 @@ TAO_AV_UDP_Flow_Handler::get_handle (void) const
return this->sock_dgram_.get_handle () ;
}
+int
+TAO_AV_UDP_Flow_Handler::change_qos(AVStreams::QoS qos)
+{
+ if( TAO_debug_level > 0 )
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "(%N,%l) TAO_AV_UDP_Flow_Handler::change_qos\n"));
+ }
+
+ unsigned int i=0;
+
+ int ret = 0;
+ CORBA::Long dscp = 0;
+ CORBA::Long ecn = 0;
+ int dscp_flag=0;
+ for(i=0; i < qos.QoSParams.length(); i++)
+ {
+
+ if( ACE_OS::strcmp( qos.QoSParams[i].property_name.in(), "Diffserv_Codepoint") == 0)
+ {
+ qos.QoSParams[i].property_value >>= dscp;
+ dscp_flag=1;
+ // DSCP value can only be 6 bits wide
+ if(!((dscp >= 0) && (dscp <= 63)))
+ {
+ dscp_flag = 0;
+ ACE_DEBUG((LM_DEBUG, "(%N,%l) ECN value can only be (0-3) not %d\n", ecn));
+ return -1;
+ }
+ }
+
+ if( ACE_OS::strcmp( qos.QoSParams[i].property_name.in(), "ECN") == 0)
+ {
+ qos.QoSParams[i].property_value >>= ecn;
+ // ECN value can only occupy bits 6 and 7 of the
+ // IP Diffserv byte
+ if(!((ecn >= 0) && (ecn <= 3)))
+ {
+ ACE_DEBUG((LM_DEBUG, "(%N,%l) ECN value can only be (0-3) not %d\n", ecn));
+ ecn = 0;
+ }
+
+ }
+ }
+ // Set the Diffserv byte only if we specified
+ // the Diffserv Codepoint (DSCP) or ECN via QoSParams
+ // passed into this method
+ if(dscp_flag || ecn)
+ {
+ int tos;
+ tos = (int)(dscp << 2);
+ if(ecn)
+ {
+ tos |= ecn;
+ }
+ ret = sock_dgram_.set_option(IPPROTO_IP, IP_TOS, (int *)&tos , (int)sizeof(tos));
+
+ if(TAO_debug_level > 1)
+ {
+ ACE_DEBUG((LM_DEBUG, "(%N,%l) set tos: ret: %d\n", ret));
+ }
+ }
+
+ if(TAO_debug_level > 1)
+ {
+ if(ret < 0 )
+ {
+ ACE_DEBUG((LM_DEBUG, "(%N,%l) errno: %p\n"));
+ }
+ }
+ return ret;
+}
+
//------------------------------------------------------------
// TAO_AV_UDP_Transport
//------------------------------------------------------------
diff --git a/TAO/orbsvcs/orbsvcs/AV/UDP.h b/TAO/orbsvcs/orbsvcs/AV/UDP.h
index 3b5b8036254..d1817e52c02 100644
--- a/TAO/orbsvcs/orbsvcs/AV/UDP.h
+++ b/TAO/orbsvcs/orbsvcs/AV/UDP.h
@@ -90,6 +90,7 @@ public:
virtual ssize_t recv (iovec *iov,
int iovcnt,
ACE_Time_Value *s = 0);
+
protected:
TAO_AV_UDP_Flow_Handler *handler_;
ACE_Addr *addr_;
@@ -117,6 +118,9 @@ public:
virtual int handle_timeout (const ACE_Time_Value &tv, const void *arg = 0);
const ACE_SOCK_Dgram *get_socket (void) const;
virtual ACE_Event_Handler* event_handler (void){ return this; }
+ /// Change the QoS
+ virtual int change_qos (AVStreams::QoS);
+
protected:
TAO_AV_Core *av_core_;
ACE_INET_Addr peer_addr_;