From 13a0dc6fc442bf1e9b1a7842f20cd882db0e88d1 Mon Sep 17 00:00:00 2001
From: Ruud Overeem <overeem@astron.nl>
Date: Thu, 12 Mar 2015 17:50:13 +0000
Subject: [PATCH] Task #7593: autogen creates the protocol files now in the
 namespace XXX_Protocol. Modified the sources to look in these namespaces.

---
 MAC/APL/APLCommon/src/CTState.cc              |  1 +
 MAC/APL/APLCommon/src/ChildControl.cc         |  2 +
 MAC/APL/APLCommon/src/ControllerDefines.cc    |  1 +
 MAC/APL/APLCommon/src/ParentControl.cc        |  2 +
 MAC/APL/APLCommon/test/ControllerProtMenu.cc  |  1 +
 MAC/APL/APLCommon/test/tOutOfBand.cc          |  1 +
 MAC/APL/APLCommon/test/tParentControl.cc      |  3 +-
 .../src/CEPHardwareMonitor/BlueGeneMonitor.cc |  1 +
 .../src/CEPHardwareMonitor/ClusterMonitor.cc  |  1 +
 .../CEPCU/src/OnlineControl/OnlineControl.cc  |  2 +
 .../CEPCU/src/PythonControl/PythonControl.cc  |  2 +
 .../CUDaemons/CT_StartDaemon/CTStartDaemon.cc |  1 +
 .../PVSSGateway_Stub/PVSSGatewayStub.cc       |  1 +
 .../CUDaemons/Service_Broker/ServiceBroker.cc |  1 +
 MAC/APL/CUDaemons/test/LDtestMenu.cc          |  1 +
 .../src/KeyValueLogger/KeyValueLogger.cc      |  2 +
 .../src/LogProcessor/LogProcessor.cc          |  2 +
 .../src/PVSSGateway/PVSSGateway.cc            |  2 +
 .../src/SASGateway/SASGateway.cc              |  2 +
 .../src/SoftwareMonitor/SoftwareMonitor.cc    |  2 +
 .../SoftwareMonitor/SoftwareMonitorMain.cc    |  1 +
 .../src/CRTriggerControl/TriggerControl.cc    |  3 ++
 .../MainCU/src/MACScheduler/MACScheduler.cc   |  3 ++
 MAC/APL/MainCU/src/MACScheduler/ObsClaimer.cc |  2 +
 MAC/APL/MainCU/src/MACScheduler/claimTest.cc  |  2 +
 .../ObservationControl/ObservationControl.cc  |  3 ++
 .../Cal_Server/src/SubArraySubscription.cc    |  1 +
 MAC/APL/PAC/Cal_Server/src/calinfo.cc         |  1 +
 MAC/APL/PAC/Cal_Server/test/CalTest.h         |  2 +-
 MAC/APL/PAC/ITRFBeamServer/src/AnaBeamMgr.cc  |  1 +
 MAC/APL/PAC/ITRFBeamServer/src/BeamServer.cc  |  1 +
 MAC/APL/PAC/ITRFBeamServer/src/BeamServer.h   |  1 +
 MAC/APL/PAC/ITRFBeamServer/src/beamctl.h      |  1 +
 .../PAC/SHMInfo_Server/src/SHMInfoServer.cc   |  4 +-
 .../SHMInfo_Server/src/SHMPolicyHandler.cc    | 11 ++--
 MAC/APL/PAC/SHMInfo_Server/src/SHMSession.cc  |  1 +
 MAC/APL/PAC/SHMInfo_Server/src/SHMSession.h   |  1 +
 .../PAC/SHMInfo_Server/src/SHMSubscription.cc | 13 ++---
 .../PAC/SHMInfo_Server/src/SHM_Protocol.prot  |  2 -
 MAC/APL/PIC/RSP_Driver/src/BMRead.cc          | 10 ++--
 MAC/APL/PIC/RSP_Driver/src/BMWrite.cc         |  9 +++-
 MAC/APL/PIC/RSP_Driver/src/Cache.h            |  1 +
 MAC/APL/PIC/RSP_Driver/src/RSPDriver.cc       |  2 +
 MAC/APL/PIC/RSP_Driver/src/rspctl.cc          |  2 +
 MAC/APL/PIC/RSP_Driver/src/rspctl.h           |  1 +
 MAC/APL/PIC/RSP_Driver/test/EPAStub.h         |  1 +
 .../include/APL/RSP_Protocol/Bitmode.h        |  1 +
 .../include/APL/RSP_Protocol/BypassSettings.h |  1 +
 .../include/APL/RSP_Protocol/HBASettings.h    |  1 +
 .../include/APL/RSP_Protocol/Latency.h        |  1 +
 .../include/APL/RSP_Protocol/RCUSettings.h    |  1 +
 .../include/APL/RSP_Protocol/RSUSettings.h    |  1 +
 .../include/APL/RSP_Protocol/SDOMode.h        |  1 +
 .../include/APL/RSP_Protocol/SPUStatus.h      |  1 +
 .../include/APL/RSP_Protocol/SystemStatus.h   |  1 +
 .../include/APL/RSP_Protocol/TBBSettings.h    |  1 +
 .../include/APL/RSP_Protocol/TDStatus.h       |  1 +
 .../include/APL/RSP_Protocol/Versions.h       |  1 +
 MAC/APL/PIC/TBB_Driver/src/Command.h          |  1 +
 MAC/APL/PIC/TBB_Driver/src/DriverSettings.cc  |  2 +-
 MAC/APL/PIC/TBB_Driver/src/MsgHandler.h       |  2 +
 MAC/APL/PIC/TBB_Driver/src/TBBDriver.cc       |  3 ++
 MAC/APL/PIC/TBB_Driver/src/tbbctl.h           |  1 +
 MAC/APL/RTDBCommon/src/ClaimMgrTask.cc        |  2 +
 MAC/APL/RTDBCommon/src/disabledRCUlist.cc     |  1 +
 MAC/APL/RTDBCommon/src/setObjectState.cc      |  1 +
 MAC/APL/RTDBCommon/test/tClaimManager.cc      |  1 +
 .../StationCU/src/BeamControl/BeamControl.cc  |  3 ++
 .../CalibrationControl/CalibrationControl.cc  |  3 ++
 .../src/ClockControl/ClockControl.cc          |  4 ++
 MAC/APL/StationCU/src/ClockControl/clkctl.cc  |  1 +
 .../src/HardwareMonitor/ECMonitor.cc          |  2 +
 .../HardwareMonitor/HardwareMonitorMain.cc    |  2 +
 .../src/HardwareMonitor/RSPMonitor.cc         |  2 +
 .../src/HardwareMonitor/TBBMonitor.cc         |  2 +
 .../src/HardwareMonitor/TBBMonitor.h          |  1 +
 .../StationCU/src/StationControl/ActiveObs.cc |  2 +
 .../src/StationControl/StationControl.cc      |  4 ++
 .../StationCU/src/TBBControl/TBBControl.cc    |  5 ++
 MAC/APL/StationCU/src/TBBControl/trigctl.cc   |  1 +
 MAC/GCF/RTDB/src/DPanswer.cc                  |  1 +
 MAC/GCF/RTDB/test/tDPservice.cc               |  1 +
 MAC/GCF/RTDB/test/tPerformanceReport.cc       |  1 +
 MAC/GCF/RTDB/test/tPropertySet.cc             |  1 +
 MAC/GCF/RTDB/test/tRTDBPerformance.cc         |  1 +
 MAC/GCF/RTDB/test/tRTDBPort.cc                |  1 +
 MAC/GCF/RTDB/test/testQuery.cc                |  1 +
 MAC/GCF/TM/src/PortImpl/GCF_TCPPort.cc        |  1 +
 .../TM/src/ServiceBroker/ServiceBrokerTask.cc |  7 +--
 MAC/GCF/TM/test/Echo.cc                       |  5 +-
 MAC/GCF/TM/test/Ping.cc                       | 10 ++--
 MAC/GCF/TM/test/tAutoOpen.cc                  |  5 +-
 MAC/GCF/TM/test/tClient.cc                    |  5 +-
 MAC/GCF/TM/test/tEventBinding.cc              |  5 +-
 MAC/GCF/TM/test/tEventQueue.cc                |  5 +-
 MAC/GCF/TM/test/tITCPort.cc                   |  5 +-
 MAC/GCF/TM/test/tServer.cc                    |  5 +-
 MAC/GCF/TM/test/tStateResult.cc               |  5 +-
 MAC/MACIO/autogen/protocol.tpl                | 50 +++++++++----------
 MAC/MACIO/include/MACIO/Marshalling.tcc       |  7 ++-
 MAC/MACIO/include/MACIO/RTmetadata.h          |  1 +
 MAC/MACIO/src/EventPort.cc                    |  1 +
 MAC/MACIO/test/Clone_Protocol.prot            |  5 +-
 MAC/MACIO/test/tClone.cc                      | 13 ++---
 MAC/MACIO/test/tEventPort.cc                  |  1 +
 MAC/MACIO/test/tMarshalling.cc                | 35 ++-----------
 MAC/MACIO/test/tProtocol.cc                   |  2 +
 107 files changed, 229 insertions(+), 120 deletions(-)

diff --git a/MAC/APL/APLCommon/src/CTState.cc b/MAC/APL/APLCommon/src/CTState.cc
index c6dc2b8d5ab..51fe38e48ce 100644
--- a/MAC/APL/APLCommon/src/CTState.cc
+++ b/MAC/APL/APLCommon/src/CTState.cc
@@ -29,6 +29,7 @@
 #include "Controller_Protocol.ph"
 
 namespace LOFAR {
+  using namespace Controller_Protocol;
   namespace APLCommon {
 
 typedef struct stateSignal {
diff --git a/MAC/APL/APLCommon/src/ChildControl.cc b/MAC/APL/APLCommon/src/ChildControl.cc
index b3d330652d9..b494b87bff0 100644
--- a/MAC/APL/APLCommon/src/ChildControl.cc
+++ b/MAC/APL/APLCommon/src/ChildControl.cc
@@ -41,6 +41,8 @@
 using namespace boost;
 
 namespace LOFAR {
+  using namespace Controller_Protocol;
+  using namespace StartDaemon_Protocol;
   using namespace GCF::TM;
   namespace APLCommon {
 
diff --git a/MAC/APL/APLCommon/src/ControllerDefines.cc b/MAC/APL/APLCommon/src/ControllerDefines.cc
index 6556607eb99..23ba0997a3b 100644
--- a/MAC/APL/APLCommon/src/ControllerDefines.cc
+++ b/MAC/APL/APLCommon/src/ControllerDefines.cc
@@ -36,6 +36,7 @@
 using namespace boost;
 
 namespace LOFAR {
+  using namespace Controller_Protocol;
   namespace APLCommon {
 
 typedef struct cntlrDefinition {
diff --git a/MAC/APL/APLCommon/src/ParentControl.cc b/MAC/APL/APLCommon/src/ParentControl.cc
index 9d93ec87c22..1a323baa3d0 100644
--- a/MAC/APL/APLCommon/src/ParentControl.cc
+++ b/MAC/APL/APLCommon/src/ParentControl.cc
@@ -36,6 +36,8 @@
 #include <StartDaemon_Protocol.ph>
 
 namespace LOFAR {
+  using namespace Controller_Protocol;
+  using namespace StartDaemon_Protocol;
   using namespace GCF::TM;
   using namespace boost::posix_time;
   namespace APLCommon {
diff --git a/MAC/APL/APLCommon/test/ControllerProtMenu.cc b/MAC/APL/APLCommon/test/ControllerProtMenu.cc
index 7700f4411da..3cd94a55626 100644
--- a/MAC/APL/APLCommon/test/ControllerProtMenu.cc
+++ b/MAC/APL/APLCommon/test/ControllerProtMenu.cc
@@ -37,6 +37,7 @@
 using namespace std;
 
 namespace LOFAR {
+	using namespace Controller_Protocol;
 	using namespace APLCommon;
 	using namespace GCF::TM;
 	namespace Test {
diff --git a/MAC/APL/APLCommon/test/tOutOfBand.cc b/MAC/APL/APLCommon/test/tOutOfBand.cc
index 03c5bf292c9..a1adea295c6 100644
--- a/MAC/APL/APLCommon/test/tOutOfBand.cc
+++ b/MAC/APL/APLCommon/test/tOutOfBand.cc
@@ -30,6 +30,7 @@
 #include "Controller_Protocol.ph"
 
 using namespace LOFAR;
+using namespace LOFAR::Controller_Protocol;
 using namespace LOFAR::APLCommon;
 
 typedef struct stateFlow_t {
diff --git a/MAC/APL/APLCommon/test/tParentControl.cc b/MAC/APL/APLCommon/test/tParentControl.cc
index 9ba05f7c661..3df79fb805e 100644
--- a/MAC/APL/APLCommon/test/tParentControl.cc
+++ b/MAC/APL/APLCommon/test/tParentControl.cc
@@ -27,7 +27,6 @@
 #include <Common/ParameterSet.h>
 #include <MACIO/MACServiceInfo.h>
 #include <APL/APLCommon/APL_Defines.h>
-//#include <APL/APLCommon/Controller_Protocol.ph>
 #include <APL/APLCommon/ControllerDefines.h>
 #include <APL/APLCommon/ParentControl.h>
 #include <Controller_Protocol.ph>
@@ -38,6 +37,8 @@
 using namespace LOFAR::GCF::TM;
 
 namespace LOFAR {
+	using namespace Controller_Protocol;
+	using namespace StartDaemon_Protocol;
 	namespace APLCommon {
 
 #define FAKEPARENTCTRLSERVICENAME	"FakeParentController:v1.0"
diff --git a/MAC/APL/CEPCU/src/CEPHardwareMonitor/BlueGeneMonitor.cc b/MAC/APL/CEPCU/src/CEPHardwareMonitor/BlueGeneMonitor.cc
index 169a1496c39..7694237699f 100644
--- a/MAC/APL/CEPCU/src/CEPHardwareMonitor/BlueGeneMonitor.cc
+++ b/MAC/APL/CEPCU/src/CEPHardwareMonitor/BlueGeneMonitor.cc
@@ -44,6 +44,7 @@
 #define MAX2(a,b)	((a) > (b)) ? (a) : (b)
 
 namespace LOFAR {
+	using namespace DP_Protocol;
 	using namespace APL::RTDBCommon;
 	using namespace GCF::TM;
 	using namespace GCF::PVSS;
diff --git a/MAC/APL/CEPCU/src/CEPHardwareMonitor/ClusterMonitor.cc b/MAC/APL/CEPCU/src/CEPHardwareMonitor/ClusterMonitor.cc
index 3395dc59d32..d55756d0dd5 100644
--- a/MAC/APL/CEPCU/src/CEPHardwareMonitor/ClusterMonitor.cc
+++ b/MAC/APL/CEPCU/src/CEPHardwareMonitor/ClusterMonitor.cc
@@ -45,6 +45,7 @@
 #define MAX2(a,b)	((a) > (b)) ? (a) : (b)
 
 namespace LOFAR {
+	using namespace DP_Protocol;
 	using namespace APL::RTDBCommon;
 	using namespace GCF::TM;
 	using namespace GCF::PVSS;
diff --git a/MAC/APL/CEPCU/src/OnlineControl/OnlineControl.cc b/MAC/APL/CEPCU/src/OnlineControl/OnlineControl.cc
index 6afb4bb8724..e8fc93f543b 100644
--- a/MAC/APL/CEPCU/src/OnlineControl/OnlineControl.cc
+++ b/MAC/APL/CEPCU/src/OnlineControl/OnlineControl.cc
@@ -59,6 +59,8 @@ using namespace boost::posix_time;
 using namespace std;
 
 namespace LOFAR {
+	using namespace DP_Protocol;
+	using namespace Controller_Protocol;
 	using namespace APLCommon;
 	using namespace OTDB;
 	namespace CEPCU {
diff --git a/MAC/APL/CEPCU/src/PythonControl/PythonControl.cc b/MAC/APL/CEPCU/src/PythonControl/PythonControl.cc
index f6e1d880f10..ffc164431e2 100644
--- a/MAC/APL/CEPCU/src/PythonControl/PythonControl.cc
+++ b/MAC/APL/CEPCU/src/PythonControl/PythonControl.cc
@@ -53,6 +53,8 @@ using namespace boost::posix_time;
 using qpid::messaging::Message;
 
 namespace LOFAR {
+	using namespace DP_Protocol;
+	using namespace Controller_Protocol;
 	using namespace APLCommon;
 	using namespace GCF::TM;
 	using namespace GCF::PVSS;
diff --git a/MAC/APL/CUDaemons/CT_StartDaemon/CTStartDaemon.cc b/MAC/APL/CUDaemons/CT_StartDaemon/CTStartDaemon.cc
index 9ef212f531f..5884acf4098 100644
--- a/MAC/APL/CUDaemons/CT_StartDaemon/CTStartDaemon.cc
+++ b/MAC/APL/CUDaemons/CT_StartDaemon/CTStartDaemon.cc
@@ -41,6 +41,7 @@
 using namespace LOFAR::GCF::TM;
 
 namespace LOFAR {
+  using namespace StartDaemon_Protocol;
   namespace CUDaemons {
 
 //
diff --git a/MAC/APL/CUDaemons/PVSSGateway_Stub/PVSSGatewayStub.cc b/MAC/APL/CUDaemons/PVSSGateway_Stub/PVSSGatewayStub.cc
index 77571f23f3f..4b6b6b82944 100644
--- a/MAC/APL/CUDaemons/PVSSGateway_Stub/PVSSGatewayStub.cc
+++ b/MAC/APL/CUDaemons/PVSSGateway_Stub/PVSSGatewayStub.cc
@@ -36,6 +36,7 @@
 #include <signal.h>
 
 namespace LOFAR {
+  using namespace KVT_Protocol;
   using namespace MACIO;
   namespace GCF {
     using namespace TM;
diff --git a/MAC/APL/CUDaemons/Service_Broker/ServiceBroker.cc b/MAC/APL/CUDaemons/Service_Broker/ServiceBroker.cc
index 22ea47c26d6..4992123c949 100644
--- a/MAC/APL/CUDaemons/Service_Broker/ServiceBroker.cc
+++ b/MAC/APL/CUDaemons/Service_Broker/ServiceBroker.cc
@@ -35,6 +35,7 @@
 #include <Service_Broker/Package__Version.h>
 
 namespace LOFAR {
+    using namespace SB_Protocol;
     using namespace MACIO;
     using namespace GCF::TM;
 	namespace CUDaemons {
diff --git a/MAC/APL/CUDaemons/test/LDtestMenu.cc b/MAC/APL/CUDaemons/test/LDtestMenu.cc
index c0bc2e4ac48..41a9d1cfd80 100644
--- a/MAC/APL/CUDaemons/test/LDtestMenu.cc
+++ b/MAC/APL/CUDaemons/test/LDtestMenu.cc
@@ -32,6 +32,7 @@
 using namespace LOFAR;
 using namespace LOFAR::APLCommon;
 using namespace LOFAR::CUdaemons;
+using namespace LOFAR::StartDaemon_protocol;
 
 static	EventPort*		SDport = 0;
 
diff --git a/MAC/APL/CURTDBDaemons/src/KeyValueLogger/KeyValueLogger.cc b/MAC/APL/CURTDBDaemons/src/KeyValueLogger/KeyValueLogger.cc
index 356b2672b7b..e6c90b62798 100644
--- a/MAC/APL/CURTDBDaemons/src/KeyValueLogger/KeyValueLogger.cc
+++ b/MAC/APL/CURTDBDaemons/src/KeyValueLogger/KeyValueLogger.cc
@@ -39,6 +39,8 @@
 #include <boost/date_time/posix_time/posix_time.hpp>
 
 namespace LOFAR {
+  using namespace KVT_Protocol;
+  using namespace DP_Protocol;
   using namespace MACIO;
   using namespace OTDB;
   namespace GCF {
diff --git a/MAC/APL/CURTDBDaemons/src/LogProcessor/LogProcessor.cc b/MAC/APL/CURTDBDaemons/src/LogProcessor/LogProcessor.cc
index f618a1233f6..9e98752ca41 100644
--- a/MAC/APL/CURTDBDaemons/src/LogProcessor/LogProcessor.cc
+++ b/MAC/APL/CURTDBDaemons/src/LogProcessor/LogProcessor.cc
@@ -37,6 +37,8 @@
 using namespace log4cplus;
 using namespace log4cplus::helpers;
 namespace LOFAR {
+  using namespace LOG_Protocol;
+  using namespace DP_Protocol;
   using namespace MACIO;
   namespace GCF {
     using namespace TM;
diff --git a/MAC/APL/CURTDBDaemons/src/PVSSGateway/PVSSGateway.cc b/MAC/APL/CURTDBDaemons/src/PVSSGateway/PVSSGateway.cc
index 4875626938b..4e6fb29b648 100644
--- a/MAC/APL/CURTDBDaemons/src/PVSSGateway/PVSSGateway.cc
+++ b/MAC/APL/CURTDBDaemons/src/PVSSGateway/PVSSGateway.cc
@@ -41,6 +41,8 @@
 #include <signal.h>
 
 namespace LOFAR {
+  using namespace KVT_Protocol;
+  using namespace DP_Protocol;
   using namespace MACIO;
   namespace GCF {
     using namespace TM;
diff --git a/MAC/APL/CURTDBDaemons/src/SASGateway/SASGateway.cc b/MAC/APL/CURTDBDaemons/src/SASGateway/SASGateway.cc
index 918e6259257..b6f36b6ca53 100644
--- a/MAC/APL/CURTDBDaemons/src/SASGateway/SASGateway.cc
+++ b/MAC/APL/CURTDBDaemons/src/SASGateway/SASGateway.cc
@@ -39,6 +39,8 @@
 #include <boost/date_time/posix_time/posix_time.hpp>
 
 namespace LOFAR {
+  using namespace KVT_Protocol;
+  using namespace DP_Protocol;
   using namespace MACIO;
   using namespace OTDB;
   namespace GCF {
diff --git a/MAC/APL/CURTDBDaemons/src/SoftwareMonitor/SoftwareMonitor.cc b/MAC/APL/CURTDBDaemons/src/SoftwareMonitor/SoftwareMonitor.cc
index b49165c7311..2a2ae4014f2 100644
--- a/MAC/APL/CURTDBDaemons/src/SoftwareMonitor/SoftwareMonitor.cc
+++ b/MAC/APL/CURTDBDaemons/src/SoftwareMonitor/SoftwareMonitor.cc
@@ -64,6 +64,8 @@ const int	MAX_PROCMAP_ERRORS = 3;
 
 using namespace boost::posix_time;
 namespace LOFAR {
+	using namespace DP_Protocol;
+	using namespace CM_Protocol;
 	using namespace APLCommon;
 	using namespace APL::RTDBCommon;
 	using namespace GCF::TM;
diff --git a/MAC/APL/CURTDBDaemons/src/SoftwareMonitor/SoftwareMonitorMain.cc b/MAC/APL/CURTDBDaemons/src/SoftwareMonitor/SoftwareMonitorMain.cc
index 7dd28c43474..3234e51e5af 100644
--- a/MAC/APL/CURTDBDaemons/src/SoftwareMonitor/SoftwareMonitorMain.cc
+++ b/MAC/APL/CURTDBDaemons/src/SoftwareMonitor/SoftwareMonitorMain.cc
@@ -34,6 +34,7 @@ using namespace LOFAR;
 using namespace LOFAR::GCF;
 using namespace LOFAR::GCF::TM;
 using namespace LOFAR::RTDBDaemons;
+using namespace LOFAR::DP_Protocol;
 
 // Use a terminate handler that can produce a backtrace.
 Exception::TerminateHandler t(Exception::terminate);
diff --git a/MAC/APL/MainCU/src/CRTriggerControl/TriggerControl.cc b/MAC/APL/MainCU/src/CRTriggerControl/TriggerControl.cc
index a6e461c9b1e..7fe1d74c71b 100644
--- a/MAC/APL/MainCU/src/CRTriggerControl/TriggerControl.cc
+++ b/MAC/APL/MainCU/src/CRTriggerControl/TriggerControl.cc
@@ -60,6 +60,9 @@ using namespace std;
 using namespace LOFAR::StringUtil;
 
 namespace LOFAR {
+    using namespace DP_Protocol;
+    using namespace Controller_Protocol;
+    using namespace CR_Protocol;
     using namespace APLCommon;
     namespace MainCU {
 
diff --git a/MAC/APL/MainCU/src/MACScheduler/MACScheduler.cc b/MAC/APL/MainCU/src/MACScheduler/MACScheduler.cc
index 5464388d30b..cbfcd97a3e8 100644
--- a/MAC/APL/MainCU/src/MACScheduler/MACScheduler.cc
+++ b/MAC/APL/MainCU/src/MACScheduler/MACScheduler.cc
@@ -54,6 +54,9 @@ using namespace boost::posix_time;
 using namespace std;
 
 namespace LOFAR {
+	using namespace Controller_Protocol;
+	using namespace DP_Protocol;
+	using namespace CM_Protocol;
 	using namespace APLCommon;
 	namespace MainCU {
 
diff --git a/MAC/APL/MainCU/src/MACScheduler/ObsClaimer.cc b/MAC/APL/MainCU/src/MACScheduler/ObsClaimer.cc
index e8e80b190b0..6614dd202eb 100644
--- a/MAC/APL/MainCU/src/MACScheduler/ObsClaimer.cc
+++ b/MAC/APL/MainCU/src/MACScheduler/ObsClaimer.cc
@@ -52,6 +52,8 @@ using namespace boost::posix_time;
 using namespace std;
 
 namespace LOFAR {
+	using namespace DP_Protocol;
+	using namespace CM_Protocol;
 	using namespace APLCommon;
 	namespace MainCU {
 
diff --git a/MAC/APL/MainCU/src/MACScheduler/claimTest.cc b/MAC/APL/MainCU/src/MACScheduler/claimTest.cc
index a95d6bf8056..2885766d8e1 100644
--- a/MAC/APL/MainCU/src/MACScheduler/claimTest.cc
+++ b/MAC/APL/MainCU/src/MACScheduler/claimTest.cc
@@ -41,6 +41,8 @@ using namespace LOFAR::GCF::RTDB;
 using namespace std;
 
 namespace LOFAR {
+	using namespace CM_Protocol;
+	using namespace DP_Protocol;
 	using namespace APLCommon;
 	namespace MainCU {
 
diff --git a/MAC/APL/MainCU/src/ObservationControl/ObservationControl.cc b/MAC/APL/MainCU/src/ObservationControl/ObservationControl.cc
index 62a099b482f..89b2b518e43 100644
--- a/MAC/APL/MainCU/src/ObservationControl/ObservationControl.cc
+++ b/MAC/APL/MainCU/src/ObservationControl/ObservationControl.cc
@@ -48,6 +48,9 @@
 using namespace boost::posix_time;
 
 namespace LOFAR {
+	using namespace Controller_Protocol;
+	using namespace DP_Protocol;
+	using namespace CM_Protocol;
 	using namespace APLCommon;
 	using namespace GCF::TM;
 	using namespace GCF::PVSS;
diff --git a/MAC/APL/PAC/Cal_Server/src/SubArraySubscription.cc b/MAC/APL/PAC/Cal_Server/src/SubArraySubscription.cc
index 82c4f46092d..a55f3cd306e 100644
--- a/MAC/APL/PAC/Cal_Server/src/SubArraySubscription.cc
+++ b/MAC/APL/PAC/Cal_Server/src/SubArraySubscription.cc
@@ -30,6 +30,7 @@
 using namespace LOFAR;
 using namespace CAL;
 using namespace RTC;
+using namespace CAL_Protocol;
 
 void SubArraySubscription::update(Subject* subject)
 {
diff --git a/MAC/APL/PAC/Cal_Server/src/calinfo.cc b/MAC/APL/PAC/Cal_Server/src/calinfo.cc
index b4e785ab2e2..4c131190445 100644
--- a/MAC/APL/PAC/Cal_Server/src/calinfo.cc
+++ b/MAC/APL/PAC/Cal_Server/src/calinfo.cc
@@ -32,6 +32,7 @@
 #include "calinfo.h" 
 
 namespace LOFAR {
+  using namespace CAL_Protocol;
   using namespace GCF;
   using namespace GCF::TM;
   namespace CAL {
diff --git a/MAC/APL/PAC/Cal_Server/test/CalTest.h b/MAC/APL/PAC/Cal_Server/test/CalTest.h
index 397501a613d..ec000bd284b 100644
--- a/MAC/APL/PAC/Cal_Server/test/CalTest.h
+++ b/MAC/APL/PAC/Cal_Server/test/CalTest.h
@@ -77,7 +77,7 @@ namespace LOFAR {
 	  // ports
 	  GCFPort m_server;
 
-	  memptr_t	m_handle; // subscription handle
+	  void*		m_handle; // subscription handle
 	  int 		m_counter1; // general purpose test counter, semantics assigned per test
 
 	  string  m_name;        // name of the current array
diff --git a/MAC/APL/PAC/ITRFBeamServer/src/AnaBeamMgr.cc b/MAC/APL/PAC/ITRFBeamServer/src/AnaBeamMgr.cc
index cd78782f1e4..8eaaf40446c 100644
--- a/MAC/APL/PAC/ITRFBeamServer/src/AnaBeamMgr.cc
+++ b/MAC/APL/PAC/ITRFBeamServer/src/AnaBeamMgr.cc
@@ -45,6 +45,7 @@ using namespace blitz;
 using namespace LOFAR;
 using namespace BS;
 using namespace IBS_Protocol;
+using namespace RSP_Protocol;
 using namespace std;
 using namespace RTC;
 using namespace CASATools;
diff --git a/MAC/APL/PAC/ITRFBeamServer/src/BeamServer.cc b/MAC/APL/PAC/ITRFBeamServer/src/BeamServer.cc
index bf65b2021e5..3f42e964d85 100644
--- a/MAC/APL/PAC/ITRFBeamServer/src/BeamServer.cc
+++ b/MAC/APL/PAC/ITRFBeamServer/src/BeamServer.cc
@@ -59,6 +59,7 @@ namespace LOFAR {
   using namespace RTC;
   using namespace IBS_Protocol;
   using namespace RSP_Protocol;
+  using namespace CAL_Protocol;
   using namespace GCF::TM;
   namespace BS {
 
diff --git a/MAC/APL/PAC/ITRFBeamServer/src/BeamServer.h b/MAC/APL/PAC/ITRFBeamServer/src/BeamServer.h
index 07d08ab6052..3a5ded97e48 100644
--- a/MAC/APL/PAC/ITRFBeamServer/src/BeamServer.h
+++ b/MAC/APL/PAC/ITRFBeamServer/src/BeamServer.h
@@ -37,6 +37,7 @@
 
 namespace LOFAR {
   using namespace CASATools;
+  using namespace IBS_Protocol;
   using GCF::TM::GCFTask;
   using GCF::TM::GCFPort;
   using GCF::TM::GCFTCPPort;
diff --git a/MAC/APL/PAC/ITRFBeamServer/src/beamctl.h b/MAC/APL/PAC/ITRFBeamServer/src/beamctl.h
index c0e8eb2d0eb..32cdad4ac92 100644
--- a/MAC/APL/PAC/ITRFBeamServer/src/beamctl.h
+++ b/MAC/APL/PAC/ITRFBeamServer/src/beamctl.h
@@ -36,6 +36,7 @@ namespace LOFAR {
   using GCF::TM::GCFPort;
   using GCF::TM::GCFTCPPort;
   using GCF::TM::GCFPortInterface;
+  using IBS_Protocol::Pointing;
   namespace BS {
 
 class beamctl : public GCFTask
diff --git a/MAC/APL/PAC/SHMInfo_Server/src/SHMInfoServer.cc b/MAC/APL/PAC/SHMInfo_Server/src/SHMInfoServer.cc
index f964a2fa885..10a3b6cc17f 100644
--- a/MAC/APL/PAC/SHMInfo_Server/src/SHMInfoServer.cc
+++ b/MAC/APL/PAC/SHMInfo_Server/src/SHMInfoServer.cc
@@ -33,10 +33,12 @@
 #include "SHMSession.h"
 #include "SHM_Protocol.ph"
 #include "SHMInfoServer.h"
-//MAXMOD add for antenna coords
 #include <APL/CAL_Protocol/CAL_Protocol.ph>
 
 namespace LOFAR {
+	using namespace RSP_Protocol;
+	using namespace CAL_Protocol;
+	using namespace SHM_Protocol;
 	using namespace MACIO;
 	using namespace GCF::TM;
 	namespace AMI {
diff --git a/MAC/APL/PAC/SHMInfo_Server/src/SHMPolicyHandler.cc b/MAC/APL/PAC/SHMInfo_Server/src/SHMPolicyHandler.cc
index 406616ec3d8..0296cc52e1f 100644
--- a/MAC/APL/PAC/SHMInfo_Server/src/SHMPolicyHandler.cc
+++ b/MAC/APL/PAC/SHMInfo_Server/src/SHMPolicyHandler.cc
@@ -37,13 +37,10 @@ using std::ifstream;
 
 #define ASCII_LINE_SIZE 1024
 
-namespace LOFAR 
-{
-using namespace GCF::Common;
-//using namespace APLCommon;
-
- namespace AMI
- {
+namespace LOFAR {
+  using namespace GCF::Common;
+  using namespace SHM_Protocol;
+ namespace AMI {
 
 string trim(string source)
 {  
diff --git a/MAC/APL/PAC/SHMInfo_Server/src/SHMSession.cc b/MAC/APL/PAC/SHMInfo_Server/src/SHMSession.cc
index cf33625872d..3851bbd69a6 100644
--- a/MAC/APL/PAC/SHMInfo_Server/src/SHMSession.cc
+++ b/MAC/APL/PAC/SHMInfo_Server/src/SHMSession.cc
@@ -39,6 +39,7 @@ using namespace blitz;
 
 
 namespace LOFAR {
+	using namespace SHM_Protocol;
 	using namespace GCF::TM;
 	using namespace RTC;
 	using namespace APL::RTDBCommon;
diff --git a/MAC/APL/PAC/SHMInfo_Server/src/SHMSession.h b/MAC/APL/PAC/SHMInfo_Server/src/SHMSession.h
index 99d143562c3..c3698b0aa6b 100644
--- a/MAC/APL/PAC/SHMInfo_Server/src/SHMSession.h
+++ b/MAC/APL/PAC/SHMInfo_Server/src/SHMSession.h
@@ -40,6 +40,7 @@ namespace blitz {
 
 namespace LOFAR {
 	using MACIO::GCFEvent;
+	using namespace RSP_Protocol;
 	namespace AMI {  
 
 class SHMInfoServer;
diff --git a/MAC/APL/PAC/SHMInfo_Server/src/SHMSubscription.cc b/MAC/APL/PAC/SHMInfo_Server/src/SHMSubscription.cc
index 427b81810ab..3b80b81a0b0 100644
--- a/MAC/APL/PAC/SHMInfo_Server/src/SHMSubscription.cc
+++ b/MAC/APL/PAC/SHMInfo_Server/src/SHMSubscription.cc
@@ -28,14 +28,11 @@
 #include <GCF/PVSS/PVSSInfo.h>
 #include <GCF/PVSS/GCF_PValue.h>
 
-namespace LOFAR
-{
-
-using namespace GCF::Common;
-using namespace GCF::PAL;
-  
-  namespace AMI
-  {
+namespace LOFAR {
+  using namespace GCF::Common;
+  using namespace GCF::PAL;
+  using namespace SHM_Protocol;
+  namespace AMI {
     
 INIT_TRACER_CONTEXT(SHMSubscription, LOFARLOGGER_PACKAGE);
 
diff --git a/MAC/APL/PAC/SHMInfo_Server/src/SHM_Protocol.prot b/MAC/APL/PAC/SHMInfo_Server/src/SHM_Protocol.prot
index 069b7387ab9..de20e51ae06 100644
--- a/MAC/APL/PAC/SHMInfo_Server/src/SHM_Protocol.prot
+++ b/MAC/APL/PAC/SHMInfo_Server/src/SHM_Protocol.prot
@@ -8,10 +8,8 @@ prefix = "SHM"; // for the signal names
 id = "(LOFAR::MACIO::F_APL_PROTOCOL+5)"; 
 include = '<Common/LofarTypes.h>';
 
-//MAXMOD
 include = '<XCStatistics.h>';
 include = '<RspStatus.h>';
-//include = '<XCSubbandSelection.h>';  MAXMOD-TEST removal
 
 // The "SHM" (MAC Information Server) protocol describes all possible
 // interactions between the MAC (Monitoring-And-Control) and SHM
diff --git a/MAC/APL/PIC/RSP_Driver/src/BMRead.cc b/MAC/APL/PIC/RSP_Driver/src/BMRead.cc
index 6fe90647eb8..1791a1642aa 100644
--- a/MAC/APL/PIC/RSP_Driver/src/BMRead.cc
+++ b/MAC/APL/PIC/RSP_Driver/src/BMRead.cc
@@ -33,9 +33,11 @@
 #include "Cache.h"
 
 using namespace blitz;
-using namespace LOFAR;
-using namespace RSP;
-using namespace RTC;
+namespace LOFAR {
+  using namespace RSP_Protocol;
+  using namespace EPA_Protocol;
+  using namespace RTC;
+  namespace RSP {
 
 BMRead::BMRead(GCFPortInterface& board_port, int board_id)
   : SyncAction(board_port, board_id, 1)
@@ -106,3 +108,5 @@ GCFEvent::TResult BMRead::handleack(GCFEvent& event, GCFPortInterface& /*port*/)
   LOG_DEBUG_STR("BMRead::handleack() done");
   return GCFEvent::HANDLED;
 }
+  } // namespace RSP
+} // namespace LOFAR
diff --git a/MAC/APL/PIC/RSP_Driver/src/BMWrite.cc b/MAC/APL/PIC/RSP_Driver/src/BMWrite.cc
index cf5289f508d..7e17e6b9193 100644
--- a/MAC/APL/PIC/RSP_Driver/src/BMWrite.cc
+++ b/MAC/APL/PIC/RSP_Driver/src/BMWrite.cc
@@ -36,8 +36,11 @@
 
 using namespace blitz;
 using namespace LOFAR;
-using namespace RSP;
-using namespace RTC;
+namespace LOFAR {
+  using namespace RSP_Protocol;
+  using namespace EPA_Protocol;
+  using namespace RTC;
+  namespace RSP {
 
 BMWrite::BMWrite(GCFPortInterface& board_port, int board_id)
   : SyncAction(board_port, board_id, 1)
@@ -112,3 +115,5 @@ GCFEvent::TResult BMWrite::handleack(GCFEvent& event, GCFPortInterface& /*port*/
   
   return GCFEvent::HANDLED;
 }
+  } // namespace RSP
+} // namespace LOFAR
diff --git a/MAC/APL/PIC/RSP_Driver/src/Cache.h b/MAC/APL/PIC/RSP_Driver/src/Cache.h
index 041d1505b1f..69c7c891ddb 100644
--- a/MAC/APL/PIC/RSP_Driver/src/Cache.h
+++ b/MAC/APL/PIC/RSP_Driver/src/Cache.h
@@ -35,6 +35,7 @@
 #include "SerdesBuffer.h"
 
 namespace LOFAR {
+  using namespace RSP_Protocol;
   namespace RSP {
 
 class Cache; // forward declaration
diff --git a/MAC/APL/PIC/RSP_Driver/src/RSPDriver.cc b/MAC/APL/PIC/RSP_Driver/src/RSPDriver.cc
index 0a4a3498828..26e5bed7bce 100644
--- a/MAC/APL/PIC/RSP_Driver/src/RSPDriver.cc
+++ b/MAC/APL/PIC/RSP_Driver/src/RSPDriver.cc
@@ -173,6 +173,8 @@
 #define PPS_FETCH_TIMEOUT { 3, 0 }
 
 namespace LOFAR {
+	using namespace EPA_Protocol;
+	using namespace RSP_Protocol;
 	using namespace GCF::TM;
 	namespace RSP {
 	using namespace blitz;
diff --git a/MAC/APL/PIC/RSP_Driver/src/rspctl.cc b/MAC/APL/PIC/RSP_Driver/src/rspctl.cc
index 0a6c9a1b00c..3a9860108a0 100644
--- a/MAC/APL/PIC/RSP_Driver/src/rspctl.cc
+++ b/MAC/APL/PIC/RSP_Driver/src/rspctl.cc
@@ -60,6 +60,8 @@
 								c-'A'+10 : ((c>='a' && c<='f') ? c-'a'+10 : 0)))
 
 namespace LOFAR {
+	using namespace RSP_Protocol;
+	using namespace EPA_Protocol;
 	using namespace GCF::TM;
 	namespace rspctl {
 	using namespace std;
diff --git a/MAC/APL/PIC/RSP_Driver/src/rspctl.h b/MAC/APL/PIC/RSP_Driver/src/rspctl.h
index 049dc5c2a5c..0cf23cb8d3f 100644
--- a/MAC/APL/PIC/RSP_Driver/src/rspctl.h
+++ b/MAC/APL/PIC/RSP_Driver/src/rspctl.h
@@ -43,6 +43,7 @@
 #include <boost/dynamic_bitset.hpp>
 
 namespace LOFAR {
+	using namespace RSP_Protocol;
 	using GCF::TM::GCFTask;
 	using GCF::TM::GCFPort;
 	using GCF::TM::GCFTCPPort;
diff --git a/MAC/APL/PIC/RSP_Driver/test/EPAStub.h b/MAC/APL/PIC/RSP_Driver/test/EPAStub.h
index 2871c0cb813..d5e77c2a426 100644
--- a/MAC/APL/PIC/RSP_Driver/test/EPAStub.h
+++ b/MAC/APL/PIC/RSP_Driver/test/EPAStub.h
@@ -29,6 +29,7 @@
 #include <GCF/TM/GCF_Control.h>
 
 namespace LOFAR {
+  using namespace EPA_Protocol;
   using GCF::TM::GCFTask;
   using GCF::TM::GCFPortInterface;
   using GCF::TM::GCFTimerPort;
diff --git a/MAC/APL/PIC/RSP_Protocol/include/APL/RSP_Protocol/Bitmode.h b/MAC/APL/PIC/RSP_Protocol/include/APL/RSP_Protocol/Bitmode.h
index 931cb954c1e..205f8f9da29 100644
--- a/MAC/APL/PIC/RSP_Protocol/include/APL/RSP_Protocol/Bitmode.h
+++ b/MAC/APL/PIC/RSP_Protocol/include/APL/RSP_Protocol/Bitmode.h
@@ -34,6 +34,7 @@
 #include <Common/LofarTypes.h>
 
 namespace LOFAR {
+  using namespace EPA_Protocol;
   namespace RSP_Protocol {
 
     class BitmodeInfo
diff --git a/MAC/APL/PIC/RSP_Protocol/include/APL/RSP_Protocol/BypassSettings.h b/MAC/APL/PIC/RSP_Protocol/include/APL/RSP_Protocol/BypassSettings.h
index b7ca02e17ce..ad1f73f6803 100644
--- a/MAC/APL/PIC/RSP_Protocol/include/APL/RSP_Protocol/BypassSettings.h
+++ b/MAC/APL/PIC/RSP_Protocol/include/APL/RSP_Protocol/BypassSettings.h
@@ -33,6 +33,7 @@
 #include <APL/RSP_Protocol/EPA_Protocol.ph>
 
 namespace LOFAR {
+  using namespace EPA_Protocol;
   namespace RSP_Protocol {
 
 // Note: Bypass registers are per BP, so each register has info for the X
diff --git a/MAC/APL/PIC/RSP_Protocol/include/APL/RSP_Protocol/HBASettings.h b/MAC/APL/PIC/RSP_Protocol/include/APL/RSP_Protocol/HBASettings.h
index 7339e710825..2f82c80ba4c 100644
--- a/MAC/APL/PIC/RSP_Protocol/include/APL/RSP_Protocol/HBASettings.h
+++ b/MAC/APL/PIC/RSP_Protocol/include/APL/RSP_Protocol/HBASettings.h
@@ -33,6 +33,7 @@
 #include <Common/LofarTypes.h>
 
 namespace LOFAR {
+  using namespace EPA_Protocol;
   namespace RSP_Protocol {
 
     class HBASettings
diff --git a/MAC/APL/PIC/RSP_Protocol/include/APL/RSP_Protocol/Latency.h b/MAC/APL/PIC/RSP_Protocol/include/APL/RSP_Protocol/Latency.h
index e4a77f31026..03d9b3f2dd8 100644
--- a/MAC/APL/PIC/RSP_Protocol/include/APL/RSP_Protocol/Latency.h
+++ b/MAC/APL/PIC/RSP_Protocol/include/APL/RSP_Protocol/Latency.h
@@ -33,6 +33,7 @@
 #include <APL/RSP_Protocol/EPA_Protocol.ph>
 
 namespace LOFAR {
+  using namespace EPA_Protocol;
   namespace RSP_Protocol {
 
     class Latency
diff --git a/MAC/APL/PIC/RSP_Protocol/include/APL/RSP_Protocol/RCUSettings.h b/MAC/APL/PIC/RSP_Protocol/include/APL/RSP_Protocol/RCUSettings.h
index bea7241826b..4dd92886410 100644
--- a/MAC/APL/PIC/RSP_Protocol/include/APL/RSP_Protocol/RCUSettings.h
+++ b/MAC/APL/PIC/RSP_Protocol/include/APL/RSP_Protocol/RCUSettings.h
@@ -34,6 +34,7 @@
 #include <Common/StringUtil.h>
 
 namespace LOFAR {
+  using namespace EPA_Protocol;
   namespace RSP_Protocol {
 
 // Note: The rcucontrol value is presented in the user interface as an uint32 value.
diff --git a/MAC/APL/PIC/RSP_Protocol/include/APL/RSP_Protocol/RSUSettings.h b/MAC/APL/PIC/RSP_Protocol/include/APL/RSP_Protocol/RSUSettings.h
index 3f445c74642..480528f5225 100644
--- a/MAC/APL/PIC/RSP_Protocol/include/APL/RSP_Protocol/RSUSettings.h
+++ b/MAC/APL/PIC/RSP_Protocol/include/APL/RSP_Protocol/RSUSettings.h
@@ -33,6 +33,7 @@
 #include <Common/LofarTypes.h>
 
 namespace LOFAR {
+  using namespace EPA_Protocol;
   namespace RSP_Protocol {
 
     class RSUSettings {
diff --git a/MAC/APL/PIC/RSP_Protocol/include/APL/RSP_Protocol/SDOMode.h b/MAC/APL/PIC/RSP_Protocol/include/APL/RSP_Protocol/SDOMode.h
index 922fdd3008d..10ef3924245 100644
--- a/MAC/APL/PIC/RSP_Protocol/include/APL/RSP_Protocol/SDOMode.h
+++ b/MAC/APL/PIC/RSP_Protocol/include/APL/RSP_Protocol/SDOMode.h
@@ -34,6 +34,7 @@
 #include <Common/LofarTypes.h>
 
 namespace LOFAR {
+  using namespace EPA_Protocol;
   namespace RSP_Protocol {
 
     class SDOModeInfo
diff --git a/MAC/APL/PIC/RSP_Protocol/include/APL/RSP_Protocol/SPUStatus.h b/MAC/APL/PIC/RSP_Protocol/include/APL/RSP_Protocol/SPUStatus.h
index 5b65f7ce0cb..cbb338368d8 100644
--- a/MAC/APL/PIC/RSP_Protocol/include/APL/RSP_Protocol/SPUStatus.h
+++ b/MAC/APL/PIC/RSP_Protocol/include/APL/RSP_Protocol/SPUStatus.h
@@ -33,6 +33,7 @@
 #include <APL/RSP_Protocol/EPA_Protocol.ph>
 
 namespace LOFAR {
+  using namespace EPA_Protocol;
   namespace RSP_Protocol {
 
 class SPUStatus
diff --git a/MAC/APL/PIC/RSP_Protocol/include/APL/RSP_Protocol/SystemStatus.h b/MAC/APL/PIC/RSP_Protocol/include/APL/RSP_Protocol/SystemStatus.h
index 9c248c021ff..e0c0cb296f1 100644
--- a/MAC/APL/PIC/RSP_Protocol/include/APL/RSP_Protocol/SystemStatus.h
+++ b/MAC/APL/PIC/RSP_Protocol/include/APL/RSP_Protocol/SystemStatus.h
@@ -33,6 +33,7 @@
 #include <APL/RSP_Protocol/EPA_Protocol.ph>
 
 namespace LOFAR {
+  using namespace EPA_Protocol;
   namespace RSP_Protocol {
 
     class SystemStatus
diff --git a/MAC/APL/PIC/RSP_Protocol/include/APL/RSP_Protocol/TBBSettings.h b/MAC/APL/PIC/RSP_Protocol/include/APL/RSP_Protocol/TBBSettings.h
index 3cec2e122e6..bf8f98695f9 100644
--- a/MAC/APL/PIC/RSP_Protocol/include/APL/RSP_Protocol/TBBSettings.h
+++ b/MAC/APL/PIC/RSP_Protocol/include/APL/RSP_Protocol/TBBSettings.h
@@ -32,6 +32,7 @@
 #include <Common/LofarTypes.h>
 
 namespace LOFAR {
+  using namespace EPA_Protocol;
   namespace RSP_Protocol {
 
     class TBBSettings
diff --git a/MAC/APL/PIC/RSP_Protocol/include/APL/RSP_Protocol/TDStatus.h b/MAC/APL/PIC/RSP_Protocol/include/APL/RSP_Protocol/TDStatus.h
index c3b0785ef49..12aa00e9ab1 100644
--- a/MAC/APL/PIC/RSP_Protocol/include/APL/RSP_Protocol/TDStatus.h
+++ b/MAC/APL/PIC/RSP_Protocol/include/APL/RSP_Protocol/TDStatus.h
@@ -33,6 +33,7 @@
 #include <APL/RSP_Protocol/EPA_Protocol.ph>
 
 namespace LOFAR {
+  using namespace EPA_Protocol;
   namespace RSP_Protocol {
 
     class TDStatus
diff --git a/MAC/APL/PIC/RSP_Protocol/include/APL/RSP_Protocol/Versions.h b/MAC/APL/PIC/RSP_Protocol/include/APL/RSP_Protocol/Versions.h
index 9701c647485..9eb1a4d2ae5 100644
--- a/MAC/APL/PIC/RSP_Protocol/include/APL/RSP_Protocol/Versions.h
+++ b/MAC/APL/PIC/RSP_Protocol/include/APL/RSP_Protocol/Versions.h
@@ -34,6 +34,7 @@
 #include <Common/LofarTypes.h>
 
 namespace LOFAR {
+  using namespace EPA_Protocol;
   namespace RSP_Protocol {
 
     class Versions
diff --git a/MAC/APL/PIC/TBB_Driver/src/Command.h b/MAC/APL/PIC/TBB_Driver/src/Command.h
index c53ec4dba3c..05e5a6141ad 100644
--- a/MAC/APL/PIC/TBB_Driver/src/Command.h
+++ b/MAC/APL/PIC/TBB_Driver/src/Command.h
@@ -31,6 +31,7 @@
 #include "DriverSettings.h"
 
 namespace LOFAR {
+    using namespace TBB_Protocol;
 	namespace TBB {
 
 
diff --git a/MAC/APL/PIC/TBB_Driver/src/DriverSettings.cc b/MAC/APL/PIC/TBB_Driver/src/DriverSettings.cc
index c220d823c2f..4e751be266f 100644
--- a/MAC/APL/PIC/TBB_Driver/src/DriverSettings.cc
+++ b/MAC/APL/PIC/TBB_Driver/src/DriverSettings.cc
@@ -33,7 +33,7 @@
 #include <fstream>
 
 using namespace LOFAR;
-	//using namespace GCFCommon;
+using namespace TBB_Protocol;
 using namespace TBB;
 
 // rcu to channel conversion, rcu-0 is on channel-2
diff --git a/MAC/APL/PIC/TBB_Driver/src/MsgHandler.h b/MAC/APL/PIC/TBB_Driver/src/MsgHandler.h
index a882dae53f8..231130668d7 100644
--- a/MAC/APL/PIC/TBB_Driver/src/MsgHandler.h
+++ b/MAC/APL/PIC/TBB_Driver/src/MsgHandler.h
@@ -36,6 +36,8 @@
 #include "DriverSettings.h"
 
 namespace LOFAR {
+	using namespace TBB_Protocol;
+	using namespace TP_Protocol;
 	namespace TBB {
 		
 
diff --git a/MAC/APL/PIC/TBB_Driver/src/TBBDriver.cc b/MAC/APL/PIC/TBB_Driver/src/TBBDriver.cc
index a16dfa903db..fc13ebd86f3 100644
--- a/MAC/APL/PIC/TBB_Driver/src/TBBDriver.cc
+++ b/MAC/APL/PIC/TBB_Driver/src/TBBDriver.cc
@@ -83,6 +83,9 @@ using namespace LOFAR;
 using namespace GCF::TM;
 using namespace MACIO;
 using namespace TBB;
+using namespace TBB_Protocol;
+using namespace RSP_Protocol;
+using namespace TP_Protocol;
 using namespace std;
 
 // Use a terminate handler that can produce a backtrace.
diff --git a/MAC/APL/PIC/TBB_Driver/src/tbbctl.h b/MAC/APL/PIC/TBB_Driver/src/tbbctl.h
index 3726e2e5709..873bd6385cc 100644
--- a/MAC/APL/PIC/TBB_Driver/src/tbbctl.h
+++ b/MAC/APL/PIC/TBB_Driver/src/tbbctl.h
@@ -37,6 +37,7 @@
 
 
 namespace LOFAR {
+  using namespace TBB_Protocol;
   using GCF::TM::GCFTask;
   using GCF::TM::GCFPort;
   using GCF::TM::GCFTimerPort;
diff --git a/MAC/APL/RTDBCommon/src/ClaimMgrTask.cc b/MAC/APL/RTDBCommon/src/ClaimMgrTask.cc
index 30e48df00e5..476b71e1bd1 100644
--- a/MAC/APL/RTDBCommon/src/ClaimMgrTask.cc
+++ b/MAC/APL/RTDBCommon/src/ClaimMgrTask.cc
@@ -30,6 +30,8 @@
 #include "CM_Protocol.ph"
 
 namespace LOFAR {
+  using namespace CM_Protocol;
+  using namespace DP_Protocol;
   using namespace GCF::TM;
   using namespace GCF::PVSS;
   using namespace GCF::RTDB;
diff --git a/MAC/APL/RTDBCommon/src/disabledRCUlist.cc b/MAC/APL/RTDBCommon/src/disabledRCUlist.cc
index e99a476b818..0884352b54d 100644
--- a/MAC/APL/RTDBCommon/src/disabledRCUlist.cc
+++ b/MAC/APL/RTDBCommon/src/disabledRCUlist.cc
@@ -36,6 +36,7 @@
 string	gResult;
 
 namespace LOFAR {
+  using namespace DP_Protocol;
   using namespace GCF;
   using namespace GCF::TM;
   using namespace GCF::PVSS;
diff --git a/MAC/APL/RTDBCommon/src/setObjectState.cc b/MAC/APL/RTDBCommon/src/setObjectState.cc
index 99888894536..a9d8c294bff 100644
--- a/MAC/APL/RTDBCommon/src/setObjectState.cc
+++ b/MAC/APL/RTDBCommon/src/setObjectState.cc
@@ -34,6 +34,7 @@
 int	gError = 0;
 
 namespace LOFAR {
+  using namespace DP_Protocol;
   using namespace GCF;
   using namespace GCF::TM;
   using namespace GCF::PVSS;
diff --git a/MAC/APL/RTDBCommon/test/tClaimManager.cc b/MAC/APL/RTDBCommon/test/tClaimManager.cc
index dbf1b21a67f..0b115c109aa 100644
--- a/MAC/APL/RTDBCommon/test/tClaimManager.cc
+++ b/MAC/APL/RTDBCommon/test/tClaimManager.cc
@@ -28,6 +28,7 @@
 #include "tClaimManager.h"
 
 namespace LOFAR {
+  using namespace CM_Protocol;
   using namespace GCF;
   using namespace GCF::TM;
   namespace APL {
diff --git a/MAC/APL/StationCU/src/BeamControl/BeamControl.cc b/MAC/APL/StationCU/src/BeamControl/BeamControl.cc
index b5bbbcb16f9..65538f13802 100644
--- a/MAC/APL/StationCU/src/BeamControl/BeamControl.cc
+++ b/MAC/APL/StationCU/src/BeamControl/BeamControl.cc
@@ -55,6 +55,9 @@ using namespace std;
 
 namespace LOFAR {
 	using namespace APLCommon;
+	using namespace DP_Protocol;
+	using namespace Controller_Protocol;
+	using namespace IBS_Protocol;
 	namespace StationCU {
 
 #define MAX2(a,b)	((a)>(b)?(a):(b))
diff --git a/MAC/APL/StationCU/src/CalibrationControl/CalibrationControl.cc b/MAC/APL/StationCU/src/CalibrationControl/CalibrationControl.cc
index 255d5363efb..a482c6044dd 100644
--- a/MAC/APL/StationCU/src/CalibrationControl/CalibrationControl.cc
+++ b/MAC/APL/StationCU/src/CalibrationControl/CalibrationControl.cc
@@ -49,6 +49,9 @@ using namespace boost::posix_time;
 
 namespace LOFAR {
 	using namespace APLCommon;
+	using namespace DP_Protocol;
+	using namespace Controller_Protocol;
+	using namespace CAL_Protocol;
 	namespace StationCU {
 	
 // static pointer to this object for signal handler
diff --git a/MAC/APL/StationCU/src/ClockControl/ClockControl.cc b/MAC/APL/StationCU/src/ClockControl/ClockControl.cc
index e14df9add84..e561d2fb1dd 100644
--- a/MAC/APL/StationCU/src/ClockControl/ClockControl.cc
+++ b/MAC/APL/StationCU/src/ClockControl/ClockControl.cc
@@ -48,6 +48,10 @@ using namespace std;
 
 namespace LOFAR {
 	using namespace APLCommon;
+	using namespace Controller_Protocol;
+	using namespace RSP_Protocol;
+	using namespace DP_Protocol;
+	using namespace Clock_Protocol;
 	namespace StationCU {
 	
 
diff --git a/MAC/APL/StationCU/src/ClockControl/clkctl.cc b/MAC/APL/StationCU/src/ClockControl/clkctl.cc
index 81fde40a8c4..78dc253db80 100644
--- a/MAC/APL/StationCU/src/ClockControl/clkctl.cc
+++ b/MAC/APL/StationCU/src/ClockControl/clkctl.cc
@@ -31,6 +31,7 @@
 #include "clkctl.h"
 
 namespace LOFAR {
+	using namespace Clock_Protocol;
 	using namespace LOFAR::GCF::TM;
 
 ClkCtl::ClkCtl(const string& name) :
diff --git a/MAC/APL/StationCU/src/HardwareMonitor/ECMonitor.cc b/MAC/APL/StationCU/src/HardwareMonitor/ECMonitor.cc
index b1517b62bff..37a4ace3904 100644
--- a/MAC/APL/StationCU/src/HardwareMonitor/ECMonitor.cc
+++ b/MAC/APL/StationCU/src/HardwareMonitor/ECMonitor.cc
@@ -54,6 +54,8 @@ namespace LOFAR {
 	using namespace GCF::RTDB;
 	using namespace APLCommon;
 	using namespace APL::RTDBCommon;
+	using namespace EC_Protocol;
+	using namespace DP_Protocol;
 	namespace StationCU {
 
 //
diff --git a/MAC/APL/StationCU/src/HardwareMonitor/HardwareMonitorMain.cc b/MAC/APL/StationCU/src/HardwareMonitor/HardwareMonitorMain.cc
index d21c9bf1728..d8d7a688456 100644
--- a/MAC/APL/StationCU/src/HardwareMonitor/HardwareMonitorMain.cc
+++ b/MAC/APL/StationCU/src/HardwareMonitor/HardwareMonitorMain.cc
@@ -36,6 +36,8 @@ using namespace LOFAR;
 using namespace LOFAR::GCF;
 using namespace LOFAR::GCF::TM;
 using namespace LOFAR::StationCU;
+using namespace LOFAR::RSP_Protocol;
+using namespace LOFAR::DP_Protocol;
 
 // Use a terminate handler that can produce a backtrace.
 Exception::TerminateHandler t(Exception::terminate);
diff --git a/MAC/APL/StationCU/src/HardwareMonitor/RSPMonitor.cc b/MAC/APL/StationCU/src/HardwareMonitor/RSPMonitor.cc
index b75f4d372b6..3d38d28ad15 100644
--- a/MAC/APL/StationCU/src/HardwareMonitor/RSPMonitor.cc
+++ b/MAC/APL/StationCU/src/HardwareMonitor/RSPMonitor.cc
@@ -44,6 +44,8 @@
 #define MAX2(a,b)	((a) > (b)) ? (a) : (b)
 
 namespace LOFAR {
+	using namespace RSP_Protocol;
+	using namespace DP_Protocol;
 	using namespace APLCommon;
 	using namespace APL::RTDBCommon;
 	using namespace GCF::TM;
diff --git a/MAC/APL/StationCU/src/HardwareMonitor/TBBMonitor.cc b/MAC/APL/StationCU/src/HardwareMonitor/TBBMonitor.cc
index 8a953191bd5..9519bc804b9 100644
--- a/MAC/APL/StationCU/src/HardwareMonitor/TBBMonitor.cc
+++ b/MAC/APL/StationCU/src/HardwareMonitor/TBBMonitor.cc
@@ -42,6 +42,8 @@
 using namespace boost::posix_time;
 
 namespace LOFAR {
+	using namespace TBB_Protocol;
+	using namespace DP_Protocol;
 	using namespace GCF::TM;
 	using namespace GCF::PVSS;
 	using namespace GCF::RTDB;
diff --git a/MAC/APL/StationCU/src/HardwareMonitor/TBBMonitor.h b/MAC/APL/StationCU/src/HardwareMonitor/TBBMonitor.h
index 73535f2f0e4..2025c83f4be 100644
--- a/MAC/APL/StationCU/src/HardwareMonitor/TBBMonitor.h
+++ b/MAC/APL/StationCU/src/HardwareMonitor/TBBMonitor.h
@@ -36,6 +36,7 @@
 // forward declaration
 
 namespace LOFAR {
+    using namespace TBB_Protocol;
 	namespace StationCU {
 
 using	MACIO::GCFEvent;
diff --git a/MAC/APL/StationCU/src/StationControl/ActiveObs.cc b/MAC/APL/StationCU/src/StationControl/ActiveObs.cc
index 9a80f1d7db5..c8e440540e3 100644
--- a/MAC/APL/StationCU/src/StationControl/ActiveObs.cc
+++ b/MAC/APL/StationCU/src/StationControl/ActiveObs.cc
@@ -42,6 +42,8 @@
 #include "ActiveObs.h"
 
 namespace LOFAR {
+	using namespace Controller_Protocol;
+	using namespace DP_Protocol;
 	using namespace APLCommon;
 	using namespace MACIO;
 	using namespace GCF::TM;
diff --git a/MAC/APL/StationCU/src/StationControl/StationControl.cc b/MAC/APL/StationCU/src/StationControl/StationControl.cc
index 88b9691ef87..082acb939af 100644
--- a/MAC/APL/StationCU/src/StationControl/StationControl.cc
+++ b/MAC/APL/StationCU/src/StationControl/StationControl.cc
@@ -67,6 +67,10 @@ using namespace std;
 
 namespace LOFAR {
 	using namespace APLCommon;
+	using namespace Controller_Protocol;
+	using namespace RSP_Protocol;
+	using namespace DP_Protocol;
+	using namespace Clock_Protocol;
 	namespace StationCU {
 
 // static pointer to this object for signalhandler
diff --git a/MAC/APL/StationCU/src/TBBControl/TBBControl.cc b/MAC/APL/StationCU/src/TBBControl/TBBControl.cc
index b05d1d5d73d..6788e2bd7d3 100644
--- a/MAC/APL/StationCU/src/TBBControl/TBBControl.cc
+++ b/MAC/APL/StationCU/src/TBBControl/TBBControl.cc
@@ -61,6 +61,11 @@ using namespace boost::posix_time;
 using namespace std;
 
 namespace LOFAR {
+    using namespace Controller_Protocol;
+    using namespace CR_Protocol;
+    using namespace TBB_Protocol;
+    using namespace RSP_Protocol;
+    using namespace DP_Protocol;
     using namespace GCF::TM;
     using namespace GCF::PVSS;
     using namespace GCF::RTDB;
diff --git a/MAC/APL/StationCU/src/TBBControl/trigctl.cc b/MAC/APL/StationCU/src/TBBControl/trigctl.cc
index 9264d493686..783d38fe171 100644
--- a/MAC/APL/StationCU/src/TBBControl/trigctl.cc
+++ b/MAC/APL/StationCU/src/TBBControl/trigctl.cc
@@ -57,6 +57,7 @@ using namespace std;
 using namespace LOFAR;
 using namespace GCF::TM;
 using namespace CR_Protocol;
+using namespace TBB_Protocol;
 using namespace TrigCtl;
 
 // Use a terminate handler that can produce a backtrace.
diff --git a/MAC/GCF/RTDB/src/DPanswer.cc b/MAC/GCF/RTDB/src/DPanswer.cc
index 8b334e631fa..3e77e439e74 100644
--- a/MAC/GCF/RTDB/src/DPanswer.cc
+++ b/MAC/GCF/RTDB/src/DPanswer.cc
@@ -29,6 +29,7 @@
 #include "DPanswer.h"
 
 namespace LOFAR {
+  using namespace DP_Protocol;
   using namespace MACIO;
   namespace GCF {
     namespace RTDB {
diff --git a/MAC/GCF/RTDB/test/tDPservice.cc b/MAC/GCF/RTDB/test/tDPservice.cc
index 5d915b54c50..1a54d4d83e8 100644
--- a/MAC/GCF/RTDB/test/tDPservice.cc
+++ b/MAC/GCF/RTDB/test/tDPservice.cc
@@ -33,6 +33,7 @@
 #include "DPresponse.h"
 
 namespace LOFAR {
+  using namespace DP_Protocol;
   namespace GCF {
   using namespace TM;
   using namespace PVSS;
diff --git a/MAC/GCF/RTDB/test/tPerformanceReport.cc b/MAC/GCF/RTDB/test/tPerformanceReport.cc
index 8c1673961f2..be7a8684e84 100644
--- a/MAC/GCF/RTDB/test/tPerformanceReport.cc
+++ b/MAC/GCF/RTDB/test/tPerformanceReport.cc
@@ -36,6 +36,7 @@ int		NR_OF_ACTIONS(1000);
 bool	gReadMode;
 
 namespace LOFAR {
+  using namespace DP_Protocol;
   namespace GCF {
   using namespace TM;
   using namespace PVSS;
diff --git a/MAC/GCF/RTDB/test/tPropertySet.cc b/MAC/GCF/RTDB/test/tPropertySet.cc
index 252df33a5c9..114f455c78d 100644
--- a/MAC/GCF/RTDB/test/tPropertySet.cc
+++ b/MAC/GCF/RTDB/test/tPropertySet.cc
@@ -31,6 +31,7 @@
 #include "tPropertySet.h"
 
 namespace LOFAR {
+  using namespace DP_Protocol;
   namespace GCF {
   using namespace TM;
   using namespace PVSS;
diff --git a/MAC/GCF/RTDB/test/tRTDBPerformance.cc b/MAC/GCF/RTDB/test/tRTDBPerformance.cc
index 59e03e2db51..c52a6c2a8b8 100644
--- a/MAC/GCF/RTDB/test/tRTDBPerformance.cc
+++ b/MAC/GCF/RTDB/test/tRTDBPerformance.cc
@@ -33,6 +33,7 @@
 #include "RTDBPerfResp.h"
 
 namespace LOFAR {
+  using namespace DP_Protocol;
   namespace GCF {
   using namespace TM;
   using namespace PVSS;
diff --git a/MAC/GCF/RTDB/test/tRTDBPort.cc b/MAC/GCF/RTDB/test/tRTDBPort.cc
index 6dd5a136535..4d7a6420562 100644
--- a/MAC/GCF/RTDB/test/tRTDBPort.cc
+++ b/MAC/GCF/RTDB/test/tRTDBPort.cc
@@ -31,6 +31,7 @@
 #include "tRTDBPort.h"
 
 namespace LOFAR {
+  using namespace KVT_Protocol;
   namespace GCF {
   using namespace TM;
   using namespace PVSS;
diff --git a/MAC/GCF/RTDB/test/testQuery.cc b/MAC/GCF/RTDB/test/testQuery.cc
index 17a7480673e..b5c004755da 100644
--- a/MAC/GCF/RTDB/test/testQuery.cc
+++ b/MAC/GCF/RTDB/test/testQuery.cc
@@ -36,6 +36,7 @@ static string DPclause;
 static string whereClause;
 
 namespace LOFAR {
+  using namespace DP_Protocol;
   namespace GCF {
   using namespace TM;
   using namespace PVSS;
diff --git a/MAC/GCF/TM/src/PortImpl/GCF_TCPPort.cc b/MAC/GCF/TM/src/PortImpl/GCF_TCPPort.cc
index 2b56e883d5d..af83278dc8b 100644
--- a/MAC/GCF/TM/src/PortImpl/GCF_TCPPort.cc
+++ b/MAC/GCF/TM/src/PortImpl/GCF_TCPPort.cc
@@ -38,6 +38,7 @@
 const uint UDP_BUFFER_SIZE = 1600;
 
 namespace LOFAR {
+  using namespace SB_Protocol;
   namespace GCF {
     using namespace SB;
     namespace TM {
diff --git a/MAC/GCF/TM/src/ServiceBroker/ServiceBrokerTask.cc b/MAC/GCF/TM/src/ServiceBroker/ServiceBrokerTask.cc
index 6e99bc2a682..4b4edc3434c 100644
--- a/MAC/GCF/TM/src/ServiceBroker/ServiceBrokerTask.cc
+++ b/MAC/GCF/TM/src/ServiceBroker/ServiceBrokerTask.cc
@@ -31,9 +31,10 @@
 #include <unistd.h>
 
 namespace LOFAR {
- namespace GCF {
-  using namespace TM;
-  namespace SB {
+  using namespace SB_Protocol;
+  namespace GCF {
+    using namespace TM;
+    namespace SB {
 
 //
 // Initialize static elements
diff --git a/MAC/GCF/TM/test/Echo.cc b/MAC/GCF/TM/test/Echo.cc
index 98680a67285..cfa8e916771 100644
--- a/MAC/GCF/TM/test/Echo.cc
+++ b/MAC/GCF/TM/test/Echo.cc
@@ -32,8 +32,9 @@ static	int			gSeqnr;
 static	LOFAR::GCF::TM::GCFTCPPort*	gClientPort;
 
 namespace LOFAR {
- namespace GCF {
-  namespace TM {
+  using namespace Echo_Protocol;
+  namespace GCF {
+    namespace TM {
 
 Echo::Echo(string name) : GCFTask((State)&Echo::initial, name)
 {
diff --git a/MAC/GCF/TM/test/Ping.cc b/MAC/GCF/TM/test/Ping.cc
index 08e7e3f0b56..aacdace9eac 100644
--- a/MAC/GCF/TM/test/Ping.cc
+++ b/MAC/GCF/TM/test/Ping.cc
@@ -28,12 +28,10 @@
 #include "Echo_Protocol.ph"
 
 
-namespace LOFAR 
-{
- namespace GCF 
- {
-  namespace TM 
-  {
+namespace LOFAR {
+  using namespace Echo_Protocol;
+  namespace GCF {
+    namespace TM {
 
 /**
  * Function to calculate the elapsed time between two tiemval's.
diff --git a/MAC/GCF/TM/test/tAutoOpen.cc b/MAC/GCF/TM/test/tAutoOpen.cc
index b50df9898bd..38a2f036136 100644
--- a/MAC/GCF/TM/test/tAutoOpen.cc
+++ b/MAC/GCF/TM/test/tAutoOpen.cc
@@ -29,8 +29,9 @@
 #include "tServer.h"
 
 namespace LOFAR {
- namespace GCF {
-  namespace TM {
+  using namespace Echo_Protocol;
+  namespace GCF {
+    namespace TM {
 
 
 // Constructors of both classes
diff --git a/MAC/GCF/TM/test/tClient.cc b/MAC/GCF/TM/test/tClient.cc
index 671a51135bf..c4d4cf67307 100644
--- a/MAC/GCF/TM/test/tClient.cc
+++ b/MAC/GCF/TM/test/tClient.cc
@@ -28,8 +28,9 @@
 #include "tClient.h"
 
 namespace LOFAR {
- namespace GCF {
-  namespace TM {
+  using namespace Echo_Protocol;
+  namespace GCF {
+    namespace TM {
 
 
 // Constructors of both classes
diff --git a/MAC/GCF/TM/test/tEventBinding.cc b/MAC/GCF/TM/test/tEventBinding.cc
index 692ebdfbbf9..2f646f1452f 100644
--- a/MAC/GCF/TM/test/tEventBinding.cc
+++ b/MAC/GCF/TM/test/tEventBinding.cc
@@ -29,8 +29,9 @@
 #include "tServer.h"
 
 namespace LOFAR {
- namespace GCF {
-  namespace TM {
+  using namespace Echo_Protocol;
+  namespace GCF {
+    namespace TM {
 
 static int	gCounter1;
 static int	gCounter2;
diff --git a/MAC/GCF/TM/test/tEventQueue.cc b/MAC/GCF/TM/test/tEventQueue.cc
index 7117401142e..9b78365a01a 100644
--- a/MAC/GCF/TM/test/tEventQueue.cc
+++ b/MAC/GCF/TM/test/tEventQueue.cc
@@ -32,8 +32,9 @@ static	int	gTest = 0;
 static	int	gTimerID;
 
 namespace LOFAR {
- namespace GCF {
-  namespace TM {
+  using namespace Echo_Protocol;
+  namespace GCF {
+    namespace TM {
 
 
 // Constructors of both classes
diff --git a/MAC/GCF/TM/test/tITCPort.cc b/MAC/GCF/TM/test/tITCPort.cc
index d49ad07f9fc..d76d63e22cd 100644
--- a/MAC/GCF/TM/test/tITCPort.cc
+++ b/MAC/GCF/TM/test/tITCPort.cc
@@ -33,8 +33,9 @@
 #include "Echo_Protocol.ph"
 
 namespace LOFAR {
- namespace GCF {
-  namespace TM {
+  using namespace Echo_Protocol;
+  namespace GCF {
+    namespace TM {
 
 EchoPingEvent 	gPing;
 EchoPingEvent 	gPing2;
diff --git a/MAC/GCF/TM/test/tServer.cc b/MAC/GCF/TM/test/tServer.cc
index ed8b86dc3e6..0c9051ebc41 100644
--- a/MAC/GCF/TM/test/tServer.cc
+++ b/MAC/GCF/TM/test/tServer.cc
@@ -28,8 +28,9 @@
 #include "Echo_Protocol.ph"
 
 namespace LOFAR {
- namespace GCF {
-  namespace TM {
+  using namespace Echo_Protocol;
+  namespace GCF {
+    namespace TM {
 
 tServer::tServer(string name, uint	startupDelay) : 
 	GCFTask((State)&tServer::initial, name),
diff --git a/MAC/GCF/TM/test/tStateResult.cc b/MAC/GCF/TM/test/tStateResult.cc
index b68904ed0b2..54406a61678 100644
--- a/MAC/GCF/TM/test/tStateResult.cc
+++ b/MAC/GCF/TM/test/tStateResult.cc
@@ -30,8 +30,9 @@
 #include "tServer.h"
 
 namespace LOFAR {
- namespace GCF {
-  namespace TM {
+  using namespace Echo_Protocol;
+  namespace GCF {
+    namespace TM {
 
 
 // Constructors of both classes
diff --git a/MAC/MACIO/autogen/protocol.tpl b/MAC/MACIO/autogen/protocol.tpl
index 763352f1284..c89e7bef42b 100644
--- a/MAC/MACIO/autogen/protocol.tpl
+++ b/MAC/MACIO/autogen/protocol.tpl
@@ -9,7 +9,7 @@
 [+ DEFINE signal_id +][+ signal_name +]_ID[+ ENDDEF +]
 [+ DEFINE cap_signal +][+ (string-substitute (string-capitalize! (get "signal")) '( "_" )' ( "" )) +][+ ENDDEF +]
 [+ DEFINE event_class_name +][+ prefix_cap +][+ cap_signal +]Event[+ ENDDEF +]
-[+ DEFINE event_class_decl +][+ event_class_name +] : public MACIO::GCFEvent[+ ENDDEF +]
+[+ DEFINE event_class_decl +][+ event_class_name +] : public LOFAR::MACIO::GCFEvent[+ ENDDEF +]
 [+ DEFINE protocol_name +][+ (string-upcase (base-name)) +][+ ENDDEF +]
 [+ DEFINE project +][+ IF (exist? "project") +][+ (get "project") +][+ ELSE +]LOFAR[+ ENDIF +][+ ENDDEF +]
 [+ DEFINE event_class_member_type +][+ IF (*== (get "type") "]") +][+ (substring (get "type") 0 (string-index (get "type") #\[)) +][+ ELSE +][+ (get "type") +][+ ENDIF +][+ ENDDEF +]
@@ -38,15 +38,16 @@
 #include <MACIO/Marshalling.tcc>
 #include "[+ (base-name) +].ph"
 
-using namespace LOFAR::MACIO;
-[+ IF (exist? "project") +]using namespace LOFAR;[+ ENDIF +]
-using namespace std;
+// using namespace LOFAR::MACIO;
+namespace [+ project +] {
+  namespace [+ (base-name) +] {
+    using namespace std;
 
-[+ FOR Cfunction "" +][+ (get "result")+] [+ project +]::[+ (base-name) +]::[+ (get "name") +] {
+[+ FOR Cfunction "" +][+ (get "result")+] [+ (get "name") +] {
 [+ (get "code") +]
 }[+ ENDFOR +]
 
-const char* [+ project +]::[+ (base-name) +]::[+ protocol_name +]_signalnames[] = 
+const char* [+ protocol_name +]_signalnames[] = 
 {
   "[+ protocol_name +]: invalid signal",[+ FOR event "," +]
   "[+ signal_name +]"[+ ENDFOR +]
@@ -57,9 +58,9 @@ const char* [+ protocol_name +]_errornames[] =
 	"[+ (get "msg") +]"[+ ENDFOR error +]
 };
 
-const struct protocolStrings		[+ project +]::[+ (base-name) +]::[+ protocol-name +]_STRINGS = {
+const struct LOFAR::MACIO::protocolStrings		[+ protocol-name +]_STRINGS = {
 	[+ (count "event") +]+1, [+ (count "error") +], 
-	[+ project +]::[+ (base-name) +]::[+ protocol_name +]_signalnames,
+	[+ protocol_name +]_signalnames,
 	[+ protocol_name +]_errornames
 };
 [+ ELSE +]
@@ -74,10 +75,9 @@ const struct protocolStrings		[+ project +]::[+ (base-name) +]::[+ protocol-name
 #include <string>
 #include <cstring>
 
-namespace [+ project +]
-{
-	namespace [+ (base-name) +]
-	{
+namespace [+ project +] {
+  namespace [+ (base-name) +] {
+    using namespace LOFAR;
 
 [+ (get "prelude") +]
 
@@ -121,7 +121,7 @@ extern const struct LOFAR::MACIO::protocolStrings [+ protocol-name +]_STRINGS;
   class [+ event_class_decl +]
   {
     public:
-      [+ event_class_name +](MACIO::GCFEvent& e);
+      [+ event_class_name +](LOFAR::MACIO::GCFEvent& e);
       [+ event_class_name +]();
       virtual ~[+ event_class_name +]();
 
@@ -130,7 +130,7 @@ extern const struct LOFAR::MACIO::protocolStrings [+ protocol-name +]_STRINGS;
 
       void pack();
       virtual [+ event_class_name +]*	clone();
-      ostream& print (ostream& os) const;
+      virtual void print (ostream& os) const;
 
     private:
       [+ event_class_name +]([+ event_class_name +]&);
@@ -141,11 +141,12 @@ extern const struct LOFAR::MACIO::protocolStrings [+ protocol-name +]_STRINGS;
 
 inline ostream& operator<<(ostream& os, const [+ event_class_name +]& event)
 {
-    return (event.print(os));
+    event.print(os);
+	return os;
 };
  [+ ELSE +]
-[+ event_class_name +]::[+ event_class_name +](MACIO::GCFEvent& e)
-  : MACIO::GCFEvent(e)[+ FOR param "" +][+ IF (or (*== (get "type") "[]") (*== (get "type") "*")) +],
+[+ event_class_name +]::[+ event_class_name +](LOFAR::MACIO::GCFEvent& e)
+  : LOFAR::MACIO::GCFEvent(e)[+ FOR param "" +][+ IF (or (*== (get "type") "[]") (*== (get "type") "*")) +],
     [+ (get "name") +](0)[+ ENDIF +][+ IF (*== (get "type") "[]") +],
     [+ (get "name") +]NOE(0)[+ ENDIF +][+ ENDFOR +]
 {
@@ -153,7 +154,7 @@ inline ostream& operator<<(ostream& os, const [+ event_class_name +]& event)
 }
       
 [+ event_class_name +]::[+ event_class_name +]()
-  : MACIO::GCFEvent([+ signal_name +])[+ FOR param "" +][+ IF (or (*== (get "type") "[]") (*== (get "type") "*")) +],
+  : LOFAR::MACIO::GCFEvent([+ signal_name +])[+ FOR param "" +][+ IF (or (*== (get "type") "[]") (*== (get "type") "*")) +],
     [+ (get "name") +](0)[+ ENDIF +][+ IF (*== (get "type") "[]") +],
     [+ (get "name") +]NOE(0)[+ ENDIF +][+ ENDFOR +]
 {        
@@ -189,7 +190,6 @@ void [+ event_class_name +]::pack()
   [+ ENDIF +][+ ENDFOR +]
 	[+ IF (= (count "param") 0) +]
   // no params in this event to pack
-  (void)__offset;
 	[+ ENDIF +]
 }
 
@@ -216,7 +216,7 @@ void [+ event_class_name +]::unpack()
     MSH_unpack(_buffer, __offset, [+ (get "name") +]);
     [+ ENDIF +][+ ENDFOR +]
 	_buffer  = 0;
-        (void)__offset;
+	__offset = 0;
 }
 
 [+ event_class_name +]* [+ event_class_name +]::clone()
@@ -228,12 +228,12 @@ void [+ event_class_name +]::unpack()
     return (clonedEvent);
 }
 
-ostream& [+ event_class_name +]::print(ostream& os) const
+void [+ event_class_name +]::print(ostream& os) const
 {
 using LOFAR::operator<<;
   // Note: 'userdefined' classes are only printed if they are 'printable'
   //       base classes are printed except when they are 'nonprintable'
-  MACIO::GCFEvent::print(os);
+  LOFAR::MACIO::GCFEvent::print(os);
   [+ FOR param "" +][+ IF (==* (get "type") "struct") +][+ ELSE +]
     [+ IF (or (and (exist? "userdefined") (exist? "printable")) (and (not(exist? "userdefined")) (not(exist? "nonprintable")))) +]
       [+ IF (*== (get "type") "*") +]
@@ -241,15 +241,13 @@ using LOFAR::operator<<;
       [+ ELSE +]
       os << " [+ (get "name") +] = " <<  [+ (get "name") +] << endl; // [+ (get "type") +]
       [+ ENDIF +][+ ENDIF +][+ ENDIF +]
-  [+ ENDFOR +]return (os);
+  [+ ENDFOR +]
 }
 [+ ENDIF +][+ ENDFOR +]
 
-[+ IF (= (suffix) "ph") +]
 	} // namespace [+ (base-name) +]
 } // namespace [+ project +]
 
-using namespace [+ project +]::[+ (base-name) +];
-
+[+ IF (= (suffix) "ph") +]
 #endif
 [+ ENDIF +]
diff --git a/MAC/MACIO/include/MACIO/Marshalling.tcc b/MAC/MACIO/include/MACIO/Marshalling.tcc
index 0e8b571c28a..debadb1956f 100644
--- a/MAC/MACIO/include/MACIO/Marshalling.tcc
+++ b/MAC/MACIO/include/MACIO/Marshalling.tcc
@@ -34,7 +34,12 @@
 #include <boost/dynamic_bitset.hpp>
 #include <sstream>
 
-using namespace LOFAR;
+using LOFAR::int32;
+using LOFAR::uint32;
+using LOFAR::map;
+using LOFAR::stringstream;
+using LOFAR::vector;
+using LOFAR::KVpair;
 
 // Basic template
 template<typename T> inline uint32 MSH_size(const T	&tVar)
diff --git a/MAC/MACIO/include/MACIO/RTmetadata.h b/MAC/MACIO/include/MACIO/RTmetadata.h
index de776587deb..5760e99893a 100644
--- a/MAC/MACIO/include/MACIO/RTmetadata.h
+++ b/MAC/MACIO/include/MACIO/RTmetadata.h
@@ -43,6 +43,7 @@
 // Avoid 'using namespace' in headerfiles
 
 namespace LOFAR {
+  using namespace KVT_Protocol;
   namespace MACIO {
 
 // \addtogroup MACIO
diff --git a/MAC/MACIO/src/EventPort.cc b/MAC/MACIO/src/EventPort.cc
index fceda40f61f..404ca21eea9 100644
--- a/MAC/MACIO/src/EventPort.cc
+++ b/MAC/MACIO/src/EventPort.cc
@@ -35,6 +35,7 @@
 //#include "GSB_Defines.h"
 
 namespace LOFAR {
+  using namespace SB_Protocol;
   namespace MACIO {
 
 // Note: the difference with GCF-ports is that this port is only based on the
diff --git a/MAC/MACIO/test/Clone_Protocol.prot b/MAC/MACIO/test/Clone_Protocol.prot
index 0ffb8e30a9d..268d21af011 100644
--- a/MAC/MACIO/test/Clone_Protocol.prot
+++ b/MAC/MACIO/test/Clone_Protocol.prot
@@ -8,7 +8,6 @@ prefix = "Clone"; // for the signal names
 id = "LOFAR::MACIO::F_APL_PROTOCOL";
 // specify extra include files
 // e.g.
-include = '<MACIO/StringVector.h>';
 include = '<sys/time.h>';
 
 //
@@ -52,9 +51,7 @@ event = {
 	dir = IN;
 	param = {
 		name = "SV";
-		type = "MACIO::StringVector";
-		userdefined;
-		printable;
+		type = "vector<string>";
 	};
 };
 
diff --git a/MAC/MACIO/test/tClone.cc b/MAC/MACIO/test/tClone.cc
index f8ed9a14009..3785ac9da00 100644
--- a/MAC/MACIO/test/tClone.cc
+++ b/MAC/MACIO/test/tClone.cc
@@ -30,6 +30,7 @@
 #include "Clone_Protocol.ph"
 
 using namespace LOFAR;
+using namespace LOFAR::Clone_Protocol;
 using namespace LOFAR::MACIO;
 
 int main (int	/*argc*/, char* argv[]) 
@@ -68,12 +69,12 @@ int main (int	/*argc*/, char* argv[])
 
 	LOG_INFO("Cloning an event with a stringVector");
 	CloneVectorEvent	theOrgVector;
-	theOrgVector.SV().push_back("aap");
-	theOrgVector.SV().push_back("noot");
-	theOrgVector.SV().push_back("mies");
-	theOrgVector.SV().push_back("wim");
-	theOrgVector.SV().push_back("zus");
-	theOrgVector.SV().push_back("jet");
+	theOrgVector.SV.push_back("aap");
+	theOrgVector.SV.push_back("noot");
+	theOrgVector.SV.push_back("mies");
+	theOrgVector.SV.push_back("wim");
+	theOrgVector.SV.push_back("zus");
+	theOrgVector.SV.push_back("jet");
 	LOG_INFO_STR(theOrgVector);
 
 	CloneVectorEvent*	theClonedVector = theOrgVector.clone();
diff --git a/MAC/MACIO/test/tEventPort.cc b/MAC/MACIO/test/tEventPort.cc
index 6c95d91665a..31d197e4028 100644
--- a/MAC/MACIO/test/tEventPort.cc
+++ b/MAC/MACIO/test/tEventPort.cc
@@ -27,6 +27,7 @@
 #include "Echo_Protocol.ph"
 
 using namespace LOFAR;
+using namespace LOFAR::Echo_Protocol;
 using namespace LOFAR::MACIO;
 
 static	EchoPingEvent		pingEvent;
diff --git a/MAC/MACIO/test/tMarshalling.cc b/MAC/MACIO/test/tMarshalling.cc
index 013bfe578a9..679ca1bc023 100644
--- a/MAC/MACIO/test/tMarshalling.cc
+++ b/MAC/MACIO/test/tMarshalling.cc
@@ -33,9 +33,6 @@
 #include "tMarshalling.h"
 
 
-using namespace LOFAR;
-using namespace std;
-
 namespace LOFAR {
 
 SubArray::SubArray(int i, double d, string s) :
@@ -101,6 +98,9 @@ size_t SubArrayNC::unpack(const char*	buffer) {
 
 } // namespace LOFAR
 
+using namespace LOFAR;
+using namespace std;
+
 int main (int	/*argc*/, char**	/*argv[]*/)
 {
 	// string test
@@ -344,33 +344,4 @@ int main (int	/*argc*/, char**	/*argv[]*/)
 		iterdv++;
 	}
 	ASSERTSTR (offset1 == offset2 && dv1 == dv2, "Failure in vector<double>");
-
-	// KVpair
-	KVpair intVar("integerVar", 3125);
-	KVpair strVar("stringVar", "3125");
-	KVpair dblVar("doubleVar", 3125.0);
-
-	cout << "intVar size=" << MSH_size(intVar) << endl;
-	cout << "strVar size=" << MSH_size(strVar) << endl;
-	cout << "dblVar size=" << MSH_size(dblVar) << endl;
-
-	bzero(buf, 4096);
-	offset = 0;
-	MSH_pack(buf, offset, intVar);
-	MSH_pack(buf, offset, strVar);
-	MSH_pack(buf, offset, dblVar);
-	cout << "packed:" << endl;
-	hexdump(buf, offset);
-
-	offset = 0;
-	KVpair	intVar2;
-	MSH_unpack(buf, offset, intVar2);
-	KVpair	strVar2;
-	MSH_unpack(buf, offset, strVar2);
-	KVpair	dblVar2;
-	MSH_unpack(buf, offset, dblVar2);
-
-	ASSERTSTR(intVar == intVar2, "integer KVpair different after pack and unpack!");
-	ASSERTSTR(strVar == strVar2, "string KVpair different after pack and unpack!");
-	ASSERTSTR(dblVar == dblVar2, "double KVpair different after pack and unpack!");
 }
diff --git a/MAC/MACIO/test/tProtocol.cc b/MAC/MACIO/test/tProtocol.cc
index 56423b0e39c..d86b4dafed6 100644
--- a/MAC/MACIO/test/tProtocol.cc
+++ b/MAC/MACIO/test/tProtocol.cc
@@ -30,6 +30,8 @@
 #include "Echo_Protocol.ph"
 
 using namespace LOFAR;
+using namespace LOFAR::testprotocol;
+using namespace LOFAR::Echo_Protocol;
 using namespace LOFAR::MACIO;
 
 int main (int	/*argc*/, char* argv[]) 
-- 
GitLab