summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjai <jai@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2007-02-01 23:52:49 +0000
committerjai <jai@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2007-02-01 23:52:49 +0000
commit707b74cae589d58f118764233b657d3759581e5b (patch)
tree1078d085a235e7655bf6505e34592c7f60fb9fd4
parenta3aed2c5ce803ac530868b6971699cbf96fddd91 (diff)
downloadATCD-707b74cae589d58f118764233b657d3759581e5b.tar.gz
adding DS library
-rw-r--r--modules/TAO/tao/DiffServPolicy/DiffServ_Protocols_Hooks.cpp30
-rw-r--r--modules/TAO/tao/DiffServPolicy/DiffServ_Protocols_Hooks.h2
2 files changed, 32 insertions, 0 deletions
diff --git a/modules/TAO/tao/DiffServPolicy/DiffServ_Protocols_Hooks.cpp b/modules/TAO/tao/DiffServPolicy/DiffServ_Protocols_Hooks.cpp
index 23421641416..5f16249942c 100644
--- a/modules/TAO/tao/DiffServPolicy/DiffServ_Protocols_Hooks.cpp
+++ b/modules/TAO/tao/DiffServPolicy/DiffServ_Protocols_Hooks.cpp
@@ -86,6 +86,36 @@ TAO_DS_Network_Priority_Protocols_Hooks::set_dscp_codepoint (
const CORBA::Long
TAO_DS_Network_Priority_Protocols_Hooks::get_dscp_codepoint (
+ TAO_Service_Context &sc)
+{
+ CORBA::Long dscp_codepoint = 0;
+ const IOP::ServiceContext *context;
+
+ if (sc.get_context (IOP::REP_NWPRIORITY, &context) == 1)
+ {
+ TAO_InputCDR cdr (reinterpret_cast
+ <const char*>
+ (context->context_data.get_buffer ()),
+ context->context_data.length ());
+
+ CORBA::Boolean byte_order;
+ if ((cdr >> ACE_InputCDR::to_boolean (byte_order)) == 0)
+ {
+ throw (CORBA::MARSHAL ());
+ }
+ cdr.reset_byte_order (static_cast<int> (byte_order));
+
+ if ((cdr >> dscp_codepoint) == 0)
+ {
+ throw (CORBA::MARSHAL ());
+ }
+ }
+
+ return dscp_codepoint;
+}
+
+const CORBA::Long
+TAO_DS_Network_Priority_Protocols_Hooks::get_dscp_codepoint (
TAO_Stub *stub, CORBA::Object *object)
{
CORBA::Long dscp = 0;
diff --git a/modules/TAO/tao/DiffServPolicy/DiffServ_Protocols_Hooks.h b/modules/TAO/tao/DiffServPolicy/DiffServ_Protocols_Hooks.h
index f770212214f..b0282048bc8 100644
--- a/modules/TAO/tao/DiffServPolicy/DiffServ_Protocols_Hooks.h
+++ b/modules/TAO/tao/DiffServPolicy/DiffServ_Protocols_Hooks.h
@@ -44,6 +44,8 @@ public:
const CORBA::Long get_dscp_codepoint (TAO_Stub *stub, CORBA::Object *object);
+ const CORBA::Long get_dscp_codepoint (TAO_Service_Context &sc);
+
void set_dscp_codepoint (CORBA::Long dscp_codepoint);
void np_service_context (TAO_Stub *stub,