diff options
author | jai <jai@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2007-02-22 02:30:00 +0000 |
---|---|---|
committer | jai <jai@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2007-02-22 02:30:00 +0000 |
commit | 0b5e8c230d46ce1ab2ff58f1941fdd8d5ae6d7e9 (patch) | |
tree | 400271ee508a7b91e04dddb2a6092d6982179a41 | |
parent | 88c51f0a5bd31aa531351cff3f8878eebd69df07 (diff) | |
download | ATCD-0b5e8c230d46ce1ab2ff58f1941fdd8d5ae6d7e9.tar.gz |
ChangeLogTag: Thu Feb 22 02:27:00 UTC 2007 Jaiganesh B <jai.dre.vanderbilt.edu>
-rw-r--r-- | CIAO/ChangeLog | 21 | ||||
-rwxr-xr-x | CIAO/tools/Config_Handlers/RT-CCM/CNPM_Handler.cpp | 93 | ||||
-rwxr-xr-x | CIAO/tools/Config_Handlers/RT-CCM/CNPM_Handler.h | 45 | ||||
-rwxr-xr-x | CIAO/tools/Config_Handlers/RT-CCM/NPM_Handler.cpp | 131 | ||||
-rwxr-xr-x | CIAO/tools/Config_Handlers/RT-CCM/NPM_Handler.h | 45 | ||||
-rw-r--r-- | CIAO/tools/Config_Handlers/RT-CCM/PS_Handler.cpp | 52 | ||||
-rw-r--r-- | CIAO/tools/Config_Handlers/RT-CCM/RT-CCM-Handlers.mpc | 2 |
7 files changed, 382 insertions, 7 deletions
diff --git a/CIAO/ChangeLog b/CIAO/ChangeLog index 7c1dc834846..84a7849aa3a 100644 --- a/CIAO/ChangeLog +++ b/CIAO/ChangeLog @@ -1,3 +1,24 @@ +Thu Feb 22 02:27:00 UTC 2007 Jaiganesh B <jai.dre.vanderbilt.edu> + + * tools/Config_Handlers/RT-CCM/CNPM_Handler.h: + * tools/Config_Handlers/RT-CCM/CNPM_Handler.cpp: + * tools/Config_Handlers/RT-CCM/NPM_Handler.h: + * tools/Config_Handlers/RT-CCM/NPM_Handler.cpp: + + New config handlers for handling the DiffServ policy + additions in the CIAOServerResources schema. + + * tools/Config_Handlers/RT-CCM/PS_Handler.cpp: + + PolicySet within the CIAOServerResources schema will now + have DiffServ policy specify sub-elements. So the PolicySet + handler is modified to call the specific handlers checked-in + above. + + * tools/Config_Handlers/RT-CCM/RT-CCM-Handlers.mpc: + + Included the new files in the MPC. + Thu Feb 22 01:26:05 UTC 2007 Jaiganesh B <jai.dre.vanderbilt.edu> * docs/schema/CIAOServerResources.xsd: diff --git a/CIAO/tools/Config_Handlers/RT-CCM/CNPM_Handler.cpp b/CIAO/tools/Config_Handlers/RT-CCM/CNPM_Handler.cpp new file mode 100755 index 00000000000..34f83a8fb4c --- /dev/null +++ b/CIAO/tools/Config_Handlers/RT-CCM/CNPM_Handler.cpp @@ -0,0 +1,93 @@ +// $Id$ + +#include "CNPM_Handler.h" +#include "CIAOServerResources.hpp" +#include "ace/Auto_Ptr.h" + +#define IPDSFIELD_DSCP_DEFAULT 0x00 +#define IPDSFIELD_DSCP_CS1 0x08 +#define IPDSFIELD_DSCP_CS2 0x10 +#define IPDSFIELD_DSCP_CS3 0x18 +#define IPDSFIELD_DSCP_CS4 0x20 +#define IPDSFIELD_DSCP_CS5 0x28 +#define IPDSFIELD_DSCP_CS6 0x30 +#define IPDSFIELD_DSCP_CS7 0x38 +#define IPDSFIELD_DSCP_AF11 0x0A +#define IPDSFIELD_DSCP_AF12 0x0C +#define IPDSFIELD_DSCP_AF13 0x0E +#define IPDSFIELD_DSCP_AF21 0x12 +#define IPDSFIELD_DSCP_AF22 0x14 +#define IPDSFIELD_DSCP_AF23 0x16 +#define IPDSFIELD_DSCP_AF31 0x1A +#define IPDSFIELD_DSCP_AF32 0x1C +#define IPDSFIELD_DSCP_AF33 0x1E +#define IPDSFIELD_DSCP_AF41 0x22 +#define IPDSFIELD_DSCP_AF42 0x24 +#define IPDSFIELD_DSCP_AF43 0x26 +#define IPDSFIELD_ECT_MASK 0x02 +#define IPDSFIELD_CE_MASK 0x01 +#define IPDSFIELD_DSCP_EF 0x2E + +static int const dscp[] = +{ + IPDSFIELD_DSCP_DEFAULT , + IPDSFIELD_DSCP_CS1 , + IPDSFIELD_DSCP_CS2 , + IPDSFIELD_DSCP_CS3 , + IPDSFIELD_DSCP_CS4 , + IPDSFIELD_DSCP_CS5 , + IPDSFIELD_DSCP_CS6 , + IPDSFIELD_DSCP_CS7 , + IPDSFIELD_DSCP_AF11 , + IPDSFIELD_DSCP_AF12 , + IPDSFIELD_DSCP_AF13 , + IPDSFIELD_DSCP_AF21 , + IPDSFIELD_DSCP_AF22 , + IPDSFIELD_DSCP_AF23 , + IPDSFIELD_DSCP_AF31 , + IPDSFIELD_DSCP_AF32 , + IPDSFIELD_DSCP_AF33 , + IPDSFIELD_DSCP_AF41 , + IPDSFIELD_DSCP_AF42 , + IPDSFIELD_DSCP_AF43 , + IPDSFIELD_DSCP_EF +}; + + +namespace CIAO +{ + namespace Config_Handlers + { + + bool + CNPM_Handler::cnw_priority_pd (const CNWPriorityModelPolicyDef &src, + ::CIAO::DAnCE::CNWPriorityModelPolicyDef &dest) + { + int request_array_slot = 7; + long d = dscp[request_array_slot]; + + int a = static_cast <ACE_INT16> (d); + long b = static_cast <ACE_INT32> (a); + long c = static_cast <ACE_INT32> (a); + + ACE_DEBUG ((LM_DEBUG, "numbers are %d %X %X\n", a, b, c)); + + dest.request_dscp = + static_cast <ACE_INT32> (src.request_dscp ()); + dest.reply_dscp = + static_cast <ACE_INT32> (src.reply_dscp ()); + + return true; + } + + CNWPriorityModelPolicyDef + CNPM_Handler::cnw_priority_pd ( + const ::CIAO::DAnCE::CNWPriorityModelPolicyDef &src) + { + auto_ptr <CNWPriorityModelPolicyDef> pmd; + pmd.reset (new CNWPriorityModelPolicyDef (0, 0)); + return *pmd; + } + } +} + diff --git a/CIAO/tools/Config_Handlers/RT-CCM/CNPM_Handler.h b/CIAO/tools/Config_Handlers/RT-CCM/CNPM_Handler.h new file mode 100755 index 00000000000..39da8b2fae4 --- /dev/null +++ b/CIAO/tools/Config_Handlers/RT-CCM/CNPM_Handler.h @@ -0,0 +1,45 @@ +/** + * @file CNPM_Handler.h + * + * $Id$ + */ + + +#ifndef CIAO_CONFIG_HANDLERS_CNPM_HANDLER_H +#define CIAO_CONFIG_HANDLERS_CNPM_HANDLER_H + +#include /**/ "ace/pre.h" + +#include "RT_CCM_Handlers_Export.h" +#include "DAnCE/Deployment/CIAO_ServerResourcesC.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +namespace CIAO +{ + namespace Config_Handlers + { + class CNWPriorityModelPolicyDef; + + /** + * @class CNPM_Handler + * @brief Handler class for client NetworkPriorityModelPolicyDefs + */ + + class RT_CCM_Handlers_Export CNPM_Handler + { + public: + static bool cnw_priority_pd (const CNWPriorityModelPolicyDef &src, + ::CIAO::DAnCE::CNWPriorityModelPolicyDef &dest); + + static CNWPriorityModelPolicyDef cnw_priority_pd ( + const ::CIAO::DAnCE::CNWPriorityModelPolicyDef &src); + }; + } + +} + +#include /**/ "ace/post.h" +#endif /* CIAO_CONFIG_HANDLERS_CNPM_HANDLER_H */ diff --git a/CIAO/tools/Config_Handlers/RT-CCM/NPM_Handler.cpp b/CIAO/tools/Config_Handlers/RT-CCM/NPM_Handler.cpp new file mode 100755 index 00000000000..d530b2169e2 --- /dev/null +++ b/CIAO/tools/Config_Handlers/RT-CCM/NPM_Handler.cpp @@ -0,0 +1,131 @@ +// $Id$ + +#include "NPM_Handler.h" +#include "CIAOServerResources.hpp" +#include "ace/Auto_Ptr.h" + +#define IPDSFIELD_DSCP_DEFAULT 0x00 +#define IPDSFIELD_DSCP_CS1 0x08 +#define IPDSFIELD_DSCP_CS2 0x10 +#define IPDSFIELD_DSCP_CS3 0x18 +#define IPDSFIELD_DSCP_CS4 0x20 +#define IPDSFIELD_DSCP_CS5 0x28 +#define IPDSFIELD_DSCP_CS6 0x30 +#define IPDSFIELD_DSCP_CS7 0x38 +#define IPDSFIELD_DSCP_AF11 0x0A +#define IPDSFIELD_DSCP_AF12 0x0C +#define IPDSFIELD_DSCP_AF13 0x0E +#define IPDSFIELD_DSCP_AF21 0x12 +#define IPDSFIELD_DSCP_AF22 0x14 +#define IPDSFIELD_DSCP_AF23 0x16 +#define IPDSFIELD_DSCP_AF31 0x1A +#define IPDSFIELD_DSCP_AF32 0x1C +#define IPDSFIELD_DSCP_AF33 0x1E +#define IPDSFIELD_DSCP_AF41 0x22 +#define IPDSFIELD_DSCP_AF42 0x24 +#define IPDSFIELD_DSCP_AF43 0x26 +#define IPDSFIELD_ECT_MASK 0x02 +#define IPDSFIELD_CE_MASK 0x01 +#define IPDSFIELD_DSCP_EF 0x2E + +static int const dscp[] = +{ + IPDSFIELD_DSCP_DEFAULT , + IPDSFIELD_DSCP_CS1 , + IPDSFIELD_DSCP_CS2 , + IPDSFIELD_DSCP_CS3 , + IPDSFIELD_DSCP_CS4 , + IPDSFIELD_DSCP_CS5 , + IPDSFIELD_DSCP_CS6 , + IPDSFIELD_DSCP_CS7 , + IPDSFIELD_DSCP_AF11 , + IPDSFIELD_DSCP_AF12 , + IPDSFIELD_DSCP_AF13 , + IPDSFIELD_DSCP_AF21 , + IPDSFIELD_DSCP_AF22 , + IPDSFIELD_DSCP_AF23 , + IPDSFIELD_DSCP_AF31 , + IPDSFIELD_DSCP_AF32 , + IPDSFIELD_DSCP_AF33 , + IPDSFIELD_DSCP_AF41 , + IPDSFIELD_DSCP_AF42 , + IPDSFIELD_DSCP_AF43 , + IPDSFIELD_DSCP_EF +}; + + +namespace CIAO +{ + namespace Config_Handlers + { + + bool + NPM_Handler::nw_priority_model_pd (const NWPriorityModelPolicyDef &src, + ::CIAO::DAnCE::NWPriorityModelPolicyDef &dest) + { + switch (src.nw_priority_model ().integral ()) + { + case NWPriorityModel::SERVER_DECLARED_NWPRIORITY_l: + dest.nw_priority_model = ::CIAO::DAnCE::SERVER_DECLARED_NWPRIORITY; + break; + + case NWPriorityModel::CLIENT_PROPAGATED_NWPRIORITY_l: + dest.nw_priority_model = ::CIAO::DAnCE::CLIENT_PROPAGATED_NWPRIORITY; + break; + + default: + ACE_ERROR ((LM_ERROR, + "Unknown priority model passed to priority_model_pd\n")); + return false; + } + + int request_array_slot = 7; + long d = dscp[request_array_slot]; + + int a = static_cast <ACE_INT16> (d); + long b = static_cast <ACE_INT32> (a); + long c = static_cast <ACE_INT32> (a); + + ACE_DEBUG ((LM_DEBUG, "numbers are %d %X %X\n", a, b, c)); + + dest.request_dscp = + static_cast <ACE_INT32> (src.request_dscp ()); + dest.reply_dscp = + static_cast <ACE_INT32> (src.reply_dscp ()); + + return true; + } + + + NWPriorityModelPolicyDef + NPM_Handler::nw_priority_model_pd ( + const ::CIAO::DAnCE::NWPriorityModelPolicyDef &src) + { + auto_ptr <NWPriorityModelPolicyDef> pmd; + + switch (src.nw_priority_model) + { + case ::CIAO::DAnCE::CLIENT_PROPAGATED_NWPRIORITY: + pmd.reset (new NWPriorityModelPolicyDef +(NWPriorityModel::CLIENT_PROPAGATED_NWPRIORITY, 0, 0)); + break; + + case ::CIAO::DAnCE::SERVER_DECLARED_NWPRIORITY: + pmd.reset (new NWPriorityModelPolicyDef +(NWPriorityModel::SERVER_DECLARED_NWPRIORITY, 0, 0)); + break; + + default: + ACE_ERROR ((LM_ERROR, + "Invalid priority model given to nw_priority_model_pd\n")); + throw 1; + } + + return *pmd; + } + + + } + +} + diff --git a/CIAO/tools/Config_Handlers/RT-CCM/NPM_Handler.h b/CIAO/tools/Config_Handlers/RT-CCM/NPM_Handler.h new file mode 100755 index 00000000000..bde507ba189 --- /dev/null +++ b/CIAO/tools/Config_Handlers/RT-CCM/NPM_Handler.h @@ -0,0 +1,45 @@ +/** + * @file NPM_Handler.h + * + * $Id$ + */ + + +#ifndef CIAO_CONFIG_HANDLERS_NPM_HANDLER_H +#define CIAO_CONFIG_HANDLERS_NPM_HANDLER_H + +#include /**/ "ace/pre.h" + +#include "RT_CCM_Handlers_Export.h" +#include "DAnCE/Deployment/CIAO_ServerResourcesC.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +namespace CIAO +{ + namespace Config_Handlers + { + class NWPriorityModelPolicyDef; + + /** + * @class NPM_Handler + * @brief Handler class for NetworkPriorityModelPolicyDefs + */ + + class RT_CCM_Handlers_Export NPM_Handler + { + public: + static bool nw_priority_model_pd (const NWPriorityModelPolicyDef &src, + ::CIAO::DAnCE::NWPriorityModelPolicyDef &dest); + + static NWPriorityModelPolicyDef nw_priority_model_pd ( + const ::CIAO::DAnCE::NWPriorityModelPolicyDef &src); + }; + } + +} + +#include /**/ "ace/post.h" +#endif /* CIAO_CONFIG_HANDLERS_NPM_HANDLER_H */ diff --git a/CIAO/tools/Config_Handlers/RT-CCM/PS_Handler.cpp b/CIAO/tools/Config_Handlers/RT-CCM/PS_Handler.cpp index 95c5bb76d9d..16a2f71f40a 100644 --- a/CIAO/tools/Config_Handlers/RT-CCM/PS_Handler.cpp +++ b/CIAO/tools/Config_Handlers/RT-CCM/PS_Handler.cpp @@ -2,6 +2,8 @@ #include "PS_Handler.h" #include "PM_Handler.h" +#include "NPM_Handler.h" +#include "CNPM_Handler.h" #include "CIAOServerResources.hpp" namespace CIAO @@ -19,6 +21,8 @@ namespace CIAO CORBA::ULong len (dest.policies.length ()); dest.policies.length (len + src.count_priorityModel () + + src.count_nwpriorityModel () + + src.count_cnwpriorityModel () + src.count_threadpool () + src.count_priorityBandedConnection ()); @@ -33,6 +37,30 @@ namespace CIAO dest.policies[len++].PriorityModelDef (pmd); } + for (PolicySet::nwpriorityModel_const_iterator i = + src.begin_nwpriorityModel (); + i != src.end_nwpriorityModel (); + ++i) + { + ::CIAO::DAnCE::NWPriorityModelPolicyDef npmd; + + NPM_Handler::nw_priority_model_pd (*i, npmd); + + dest.policies[len++].NWPriorityModelDef (npmd); + } + + for (PolicySet::cnwpriorityModel_const_iterator i = + src.begin_cnwpriorityModel (); + i != src.end_cnwpriorityModel (); + ++i) + { + ::CIAO::DAnCE::CNWPriorityModelPolicyDef cnpmd; + + CNPM_Handler::cnw_priority_pd (*i, cnpmd); + + dest.policies[len++].CNWPriorityModelDef (cnpmd); + } + for (PolicySet::threadpool_const_iterator i = src.begin_threadpool (); i != src.end_threadpool (); ++i) @@ -55,13 +83,9 @@ namespace CIAO dest.policies[len++].PriorityBandedConnectionDef (pbc); } - - - return true; } - PolicySet PS_Handler::policy_set (const ::CIAO::DAnCE::PolicySet &src) { @@ -74,7 +98,7 @@ namespace CIAO i < src.policies.length (); ++i) { - ACE_ERROR ((LM_ERROR, + ACE_DEBUG ((LM_ERROR, "Attempting switch for i = %d\n", i)); @@ -82,7 +106,20 @@ namespace CIAO { case ::CIAO::DAnCE::PRIORITY_MODEL_POLICY_TYPE: ps.add_priorityModel ( - PM_Handler::priority_model_pd (src.policies[i].PriorityModelDef ())); + PM_Handler::priority_model_pd ( + src.policies[i].PriorityModelDef ())); + break; + + case ::CIAO::DAnCE::NETWORK_PRIORITY_TYPE: + ps.add_nwpriorityModel ( + NPM_Handler::nw_priority_model_pd ( + src.policies[i].NWPriorityModelDef ())); + break; + + case ::CIAO::DAnCE::CLIENT_NETWORK_PRIORITY_TYPE: + ps.add_cnwpriorityModel ( + CNPM_Handler::cnw_priority_pd ( + src.policies[i].CNWPriorityModelDef ())); break; case ::CIAO::DAnCE::THREADPOOL_POLICY_TYPE: @@ -90,7 +127,8 @@ namespace CIAO break; case ::CIAO::DAnCE::PRIORITY_BANDED_CONNECTION_POLICY_TYPE: - ps.add_priorityBandedConnection (src.policies[i].PriorityBandedConnectionDef ().Id.in ()); + ps.add_priorityBandedConnection ( + src.policies[i].PriorityBandedConnectionDef ().Id.in ()); break; case 0: diff --git a/CIAO/tools/Config_Handlers/RT-CCM/RT-CCM-Handlers.mpc b/CIAO/tools/Config_Handlers/RT-CCM/RT-CCM-Handlers.mpc index 5061a0b9ea6..707eab51c12 100644 --- a/CIAO/tools/Config_Handlers/RT-CCM/RT-CCM-Handlers.mpc +++ b/CIAO/tools/Config_Handlers/RT-CCM/RT-CCM-Handlers.mpc @@ -34,6 +34,8 @@ project (RT_CCM_Config_Handlers) : acelib, ciao_deployment_stub, ciao_xml_utils OR_Handler.cpp PM_Handler.cpp PS_Handler.cpp + CNPM_Handler.cpp + NPM_Handler.cpp SRD_Handler.cpp TP_Handler.cpp TPL_Handler.cpp |